blob: 0851a7606e99a162af8a377e0eee21b223cbe9d4 [file] [log] [blame]
guangchao.xu070005a2020-12-07 09:56:40 +08001<template>
2 <view class="wrap">
3 <!-- 头部导航 -->
4 <u-sticky h5-nav-height="0">
5 <!-- #ifndef MP-WEIXIN -->
6 <view class="status_bar"></view>
7 <!-- #endif -->
8 <view class="wrap-header">
9 <view class="img-box" @click="scan">
10 <u-image src="/static/images/index/scan.png" width="40rpx" height="40rpx" mode="aspectFit"></u-image>
11 </view>
12 <u-search placeholder="暂无服务可查询" v-model="searchVal" :show-action="false" bg-color="#F7F7F7" margin="0 15rpx"
13 @search="search"></u-search>
14 <view class="img-box" @click="toPath('/pages/sub_index/qrcode/index')">
15 <u-image src="/static/images/index/money.png" width="40rpx" height="40rpx" mode="aspectFit"></u-image>
16 </view>
guangchao.xu50e42382021-01-04 17:53:47 +080017 <view class="img-box" @click="toPath('/pages/sub_medical/appointment')">
guangchao.xu070005a2020-12-07 09:56:40 +080018 <u-image src="/static/images/index/square.png" width="40rpx" height="40rpx" mode="aspectFit"></u-image>
19 </view>
20 </view>
21 </u-sticky>
22 <!-- bannar内容 -->
23 <view class="wrap-bannar">
24 <view class="wrap-bannar-title">
25 <text>城市服务</text>
26 <text>一键速享</text>
27 </view>
28 <view class="wrap-bannar-box">
29 <image src="/static/images/index/bannar.png" mode="widthFix"></image>
30 <view class="wrap-bannar-box-overtitle">
31 <text>出行缴费</text>
32 <text>自在随心</text>
33 </view>
34 </view>
35 </view>
36 <!-- 功能列表 -->
37 <view class="wrap-func">
38 <u-image src="/static/images/index/bannar1.png" width="100%" mode="widthFix" border-radius="10"></u-image>
39 <!-- <view class="wrap-func-item" v-for="(v,i) in funcList" :key="i" @click="toPath()">
40 <u-image :src="v.src" width="70rpx" height="70rpx" mode="aspectFit"></u-image>
41 <text>{{v.title}}</text>
42 </view> -->
43 </view>
44 <!--热门活动 -->
45 <view class="wrap-active">
46 <text class="wrap-active-title">热门活动</text>
47 <view class="wrap-active-bannar">
48 <!-- <u-image src="/static/images/index/bannar01.png" width="100%" mode="widthFix"></u-image> -->
49 <u-swiper :list="activeImgList" name="picid" img-mode="scaleToFill" height="170" interval="5000" duration="1500"
50 @click="activeImg"></u-swiper>
51 </view>
52 <view class="wrap-active-con">
53 <view class="wrap-active-con-item" @click="signin">
54 <u-image src="/static/images/index/mrqd.png" width="70rpx" height="70rpx"></u-image>
55 <view class="wrap-active-con-item-desc">
56 <text class="wrap-active-con-item-desc-title">每日签到</text>
57 <text class="wrap-active-con-item-desc-desc">签到即可领积分</text>
58 </view>
59 </view>
60 <view class="wrap-active-con-item" @click="toUrl('/pages/sub_index/activeDetails/index?id='+ activity.articleno + '&type=' + activity.code)">
61 <u-image src="/static/images/index/smkhd.png" width="70rpx" height="70rpx"></u-image>
62 <view class="wrap-active-con-item-desc">
63 <text class="wrap-active-con-item-desc-title">{{activity.title?activity.title:''}}</text>
64 <text class="wrap-active-con-item-desc-desc">{{activity.subtitle?activity.subtitle:'暂无'}}</text>
65 </view>
66 </view>
67 <view class="wrap-active-con-item" @click="toPath('/pages/sub_tabbar/active')">
68 <u-image src="/static/images/index/more.png" width="70rpx" height="70rpx"></u-image>
69 <view class="wrap-active-con-item-desc">
70 <text class="wrap-active-con-item-desc-title">更多活动</text>
71 </view>
72 </view>
73 </view>
74 </view>
75 <!-- 市民卡业务 -->
76 <view class="wrap-service">
77 <text class="wrap-service-title">市民卡业务</text>
78 <view class="wrap-service-con">
79 <view class="wrap-service-con-exp" @click="toUrl('/pages/sub_index/introduce/index')">
80 <u-image src="/static/images/index/smkjj.png" width="100%" mode="widthFix"></u-image>
81 <text class="wrap-service-con-exp-desc">市民卡简介</text>
82 </view>
83 <view class="wrap-service-con-box">
84 <view class="wrap-service-con-box-bl">
85 <u-image src="/static/images/index/bl.png" width="100%" mode="widthFix"></u-image>
86 <view class="wrap-service-con-box-bl-over" @click="toPath('/pages/sub_index/getCityCard/index')">
87 <text class="wrap-service-con-box-bl-over-up">办理</text>
88 <text class="wrap-service-con-box-bl-over-dowm">网络快速办理</text>
89 </view>
90 </view>
91 <view class="wrap-service-con-box-bl">
92 <u-image src="/static/images/index/zx.png" width="100%" mode="widthFix"></u-image>
93 <view class="wrap-service-con-box-bl-over" @click="toPath('/pages/sub_index/chat/index')">
94 <text class="wrap-service-con-box-bl-over-up">咨询</text>
95 <text class="wrap-service-con-box-bl-over-dowm">24小时在线咨询</text>
96 </view>
97 </view>
98 </view>
99 </view>
100 </view>
101 <!-- 底部tabbar -->
102 <!-- <u-gap height="70"></u-gap> -->
103 <u-tabbar :list="vuex_tabbar" :mid-button="true" active-color="#2FA8E1" inactive-color="#999999" @change="changeTabbar"></u-tabbar>
104 </view>
105</template>
106
107<script>
108 export default {
109 data() {
110 return {
111 searchVal: "",
112 funcList: [{
113 title: "物业缴费",
114 src: "/static/images/index/wyjf.png"
115 }, {
116 title: "电费",
117 src: "/static/images/index/df.png"
118 }, {
119 title: "加油卡充值",
120 src: "/static/images/index/jykcz.png"
121 }, {
122 title: "宽带费",
123 src: "/static/images/index/kdf.png"
124 }, {
125 title: "手机缴费",
126 src: "/static/images/index/sjjf.png"
127 }, {
128 title: "固话充值",
129 src: "/static/images/index/ghcz.png"
130 }, {
131 title: "违章查询",
132 src: "/static/images/index/wzcx.png"
133 }, {
134 title: "全部",
135 src: "/static/images/index/all.png"
136 }],
137 activity: [],
138 activeImgList: [{
139 picid: "/static/images/index/bannar01.png",
140 articleno: '00000003'
141 }, ]
142 }
143 },
guangchao.xu50e42382021-01-04 17:53:47 +0800144 onShow() {},
guangchao.xu070005a2020-12-07 09:56:40 +0800145 methods: {
146 search(e) {
147 uni.showToast({
148 icon: "none",
149 title: "搜索服务功能暂未开通",
150 duration: 1500
151 })
152 },
153
154 scan() {
guangchao.xu50e42382021-01-04 17:53:47 +0800155 // #ifdef APP-PLUS
guangchao.xu070005a2020-12-07 09:56:40 +0800156 let that = this
guangchao.xu50e42382021-01-04 17:53:47 +0800157 var ali = uni.requireNativePlugin("Mpaas-Scan-Module")
158 ali.mpaasScan({
159 // 扫码 UI 风格,参数可为 qr、bar,默认为 qr
160 'type': 'qr',
161 // 扫码识别类型,参数可多选,qrCode、barCode,不设置,默认识别所有
162 'scanType': ['qrCode'],
163 // 是否隐藏相册,默认false不隐藏
164 'hideAlbum': false
165 },
166 (ret) => {
167 let url = ret.resp_result
guangchao.xu070005a2020-12-07 09:56:40 +0800168 uni.showToast({
169 title: "扫描成功",
170 icon: "none",
171 duration: 800,
172 complete() {
guangchao.xu070005a2020-12-07 09:56:40 +0800173 let param = {
174 url: url
175 }
guangchao.xu50e42382021-01-04 17:53:47 +0800176 //console.log(param.url)
guangchao.xu070005a2020-12-07 09:56:40 +0800177 that.$u.get('/v1/qrcode/auth', param).then(ret => {
guangchao.xu96b39792020-12-15 16:46:12 +0800178 //console.log(ret.data.url)
guangchao.xu070005a2020-12-07 09:56:40 +0800179 if (ret.data.permit) {
180 if (ret.data.action == 'water') {
guangchao.xu50e42382021-01-04 17:53:47 +0800181 // setTimeout(() => {
182 // uni.navigateTo({
183 // url: "/pages/sub_index/scanView/index?url=" + ret.data.url
184 // })
185 // }, 1500)
186 let userid = uni.getStorageSync("userid")
187 let url = ret.data.url
188 if (url.indexOf("?") > 0) {
189 url = url + "&userid=" + userid
190 } else {
191 url = url + "?userid=" + userid
192 }
193 let wv = plus.webview.create(url, 'webview_water', {
194 backButtonAutoControl: 'close',
195 popGesture: 'close'
guangchao.xu070005a2020-12-07 09:56:40 +0800196 })
guangchao.xu50e42382021-01-04 17:53:47 +0800197 setTimeout(() => {
198 wv.show()
199 }, 1500)
200 wv.drag({
201 direction: 'right',
202 moveMode: 'followFinger'
203 }, {
204 view: 'webview_water',
205 moveMode: 'follow'
206 }, function(e) {
207 wv.close()
208 });
209 wv.drag({
210 direction: 'left',
211 moveMode: 'followFinger'
212 }, {
213 view: 'webview_water',
214 moveMode: 'follow'
215 }, function(e) {
216 wv.close()
217 });
218 } else if (ret.data.action == 'dlsmkh5') {
219 let token = uni.getStorageSync('token')
220 let wv = plus.webview.create(ret.data.url, 'webview_pay', {
221 backButtonAutoControl: 'close',
222 additionalHttpHeaders: {
223 Authorization: 'Bearer ' + token
224 }
225 })
226 setTimeout(() => {
227 wv.show()
228 }, 1500)
guangchao.xu070005a2020-12-07 09:56:40 +0800229 }
230 } else {
231 uni.showToast({
232 icon: "none",
233 title: "暂不支持此二维码",
234 duration: 1500
235 })
236 }
237 })
238 }
239 })
guangchao.xu50e42382021-01-04 17:53:47 +0800240 })
guangchao.xu070005a2020-12-07 09:56:40 +0800241 // #endif
guangchao.xu50e42382021-01-04 17:53:47 +0800242
guangchao.xu070005a2020-12-07 09:56:40 +0800243 },
guangchao.xu50e42382021-01-04 17:53:47 +0800244
245 // scan() {
246 // let that = this
247 // // #ifndef H5
248 // // 只允许通过相机扫码
249 // uni.scanCode({
250 // success: function(res) {
251 // let url = res.result
252 // console.log(url)
253 // uni.showToast({
254 // title: "扫描成功",
255 // icon: "none",
256 // duration: 800,
257 // complete() {
258 // let param = {
259 // url: url
260 // }
261 // console.log(param.url)
262 // that.$u.get('/v1/qrcode/auth', param).then(ret => {
263 // console.log(ret.data.url)
264 // if (ret.data.permit) {
265 // if (ret.data.action == 'water') {
266 // setTimeout(() => {
267 // uni.navigateTo({
268 // url: "/pages/sub_index/scanView/index?url=" + ret.data.url
269 // })
270 // }, 1500)
271 // } else if (ret.data.action == 'dlsmkh5') {
272 // // #ifdef APP-PLUS
273 // let token = uni.getStorageSync('token')
274 // let wv = plus.webview.create(ret.data.url, 'webview_pay', {
275 // backButtonAutoControl:'close',
276 // additionalHttpHeaders: {
277 // Authorization: 'Bearer ' + token
278 // }
279 // })
280 // setTimeout(() => {
281 // wv.show()
282 // }, 1500)
283 // // #endif
284 // // #ifndef APP-PLUS
285 // uni.showToast({
286 // icon: "none",
287 // title: "只支持app端",
288 // duration: 1500
289 // })
290 // // #endif
291 // }
292 // } else {
293 // uni.showToast({
294 // icon: "none",
295 // title: "暂不支持此二维码",
296 // duration: 1500
297 // })
298 // }
299 // })
300 // }
301 // })
302 // }
303 // });
304 // // #endif
305 // // #ifdef H5
306 // uni.showToast({
307 // icon: "none",
308 // title: "H5不支持此功能",
309 // duration: 1500
310 // })
311 // // #endif
312 // },
guangchao.xu070005a2020-12-07 09:56:40 +0800313 getActivityList() {
314 let that = this
315 let param = [{
316 code: "PopularActivities", //OnlineActivities、OfflineActivities、PopularActivities
317 pagesize: 1,
318 pageno: 1
319 }]
320 that.$u.post("/i/activity", param).then(res => {
321 if (res.data[0].articles.list.length > 0) {
322 let list = res.data[0].articles.list[0]
323 list.code = 'PopularActivities'
324 that.activity = list
325 }
326 })
327 },
328 activeImg(index) {
329 let that = this
330 let obj = that.activeImgList[index]
331 uni.navigateTo({
332 url: '/pages/sub_index/activeDetails/index?id=' + obj.articleno
333 })
334 },
335 getBannarList() {
336 let that = this
337 that.$u.get('i/column/banner', {}).then(res => {
338 if (res.data.length > 0) {
339 that.activeImgList = res.data
340 //console.log(that.activeImgList)
341 }
342 }).catch(res => {
343 //console.log(1)
344 })
345 },
346 signin() {
347 let that = this
348 that.$u.post('v1/point/task/signin', {}).then(res => {
349 uni.showToast({
350 icon: "none",
351 title: "签到成功",
352 duration: 1500
353 })
354 })
355 }
356 },
357 onLoad() {
358 this.getBannarList()
359 // #ifdef APP-PLUS
360 //引入插件
361 const KJJPush = uni.requireNativePlugin('KJ-JPush');
362 let uid = uni.getStorageSync("uid")
363 //设置Alias
364 KJJPush.setAlias(uid ? uid : 'tourist', 1, result => {
365 //console.log("setAlias:" + JSON.stringify(result));
366 });
367
368 // #endif
369
guangchao.xu96b39792020-12-15 16:46:12 +0800370 },
guangchao.xu50e42382021-01-04 17:53:47 +0800371 async onPullDownRefresh() {
guangchao.xu96b39792020-12-15 16:46:12 +0800372 await this.getActivityList()
373 uni.stopPullDownRefresh()
guangchao.xu070005a2020-12-07 09:56:40 +0800374 }
375 }
376</script>
377
378<style lang="scss" scoped>
379 /* #ifdef MP-WEIXIN */
380 .wrap-func {
381 /deep/image {
382 display: block;
383 }
384 }
385
386 /* #endif */
387
388 .status_bar {
389 background-color: #FFFFFF;
390 }
391
392 .wrap {
393 background-color: #FFFFFF;
394
395 &-header {
396 display: flex;
397 flex-direction: row;
398 align-items: center;
399 justify-content: space-between;
400 padding: 10rpx 15rpx;
401 background-color: #FFFFFF;
402
403 image {
404 width: 50rpx;
405 height: 50rpx;
406 }
407
408 .img-box {
409 display: flex;
410 justify-content: center;
411 align-items: center;
412 padding: 0 15rpx;
413 }
414 }
415
416 &-bannar {
417 width: 100vw;
418 margin-top: 10rpx;
419
420 &-title {
421 width: 300rpx;
422 margin: auto;
423 display: flex;
424 justify-content: space-between;
425 font-size: 35rpx;
426 font-weight: bold;
427 font-style: oblique;
428 font-family: "PingFang-SC-Bold";
429 }
430
431 image {
432 width: 100%;
433 }
434
435 &-box {
436 position: relative;
437
438 &-overtitle {
439 position: absolute;
440 width: 250rpx;
441 background-color: #ECECEC;
442 padding: 10rpx 20rpx;
443 border-radius: 50rpx;
444 top: 20rpx;
445 left: 50%;
446 transform: translate(-50%, 0);
447 display: flex;
448 font-size: 24rpx;
449 justify-content: space-between;
450 color: #808080;
451 letter-spacing: 2rpx;
452 font-family: "PingFang-SC-Medium";
453 }
454 }
455 }
456
457 &-func {
458 width: 95vw;
459 background-color: #FFFFFF;
460 margin: -180rpx auto 0;
461 // display: flex;
462 // flex-wrap: wrap;
463 // justify-content: space-between;
464 // padding: 30rpx 0;
465 border-radius: 10rpx;
466 box-shadow: 0 0rpx 6rpx #808080;
467 position: relative;
468
469 /deep/uni-image {
470 display: block;
471 }
472
473 &-item {
474 width: 25%;
475 display: flex;
476 flex-direction: column;
477 align-items: center;
478 margin-bottom: 30rpx;
479
480 text {
481 margin-top: 10rpx;
482 color: #333333;
483 font-family: "PingFang-SC-Medium";
484 font-size: 24rpx;
485 }
486 }
487 }
488
489 &-active {
490 margin-top: 30rpx;
491 padding: 0 2.5vw;
492
493 &-title {
494 font-family: "PingFang-SC-Medium";
495 font-size: 30rpx;
496 color: #333333;
497 }
498
499 &-bannar {
500 margin-top: 20rpx;
501 }
502
503 &-con {
504 display: flex;
505 justify-content: space-between;
506 margin-top: 20rpx;
507
508 // align-items: center;
509 &-item {
510 width: 32%;
511 display: flex;
512 flex-direction: column;
513 align-items: center;
514 background-color: #F7F7F7;
515 padding: 50rpx 20rpx 30rpx;
516 border-radius: 10rpx;
517
518 &-desc {
519 display: flex;
520 flex-direction: column;
521 align-items: center;
522 margin-top: 50rpx;
523 width: 100%;
524 text-align: center;
525
526 &-desc {
527 width: 100%;
528 color: #666666;
529 font-size: 20rpx;
530 margin-top: 10rpx;
531 overflow: hidden;
532 text-overflow: ellipsis;
533 white-space: nowrap;
534 }
535
536 &-title {
537 width: 100%;
538 font-family: "PingFang-SC-Medium";
539 font-size: 26rpx;
540 color: #333333;
541 overflow: hidden;
542 text-overflow: ellipsis;
543 white-space: nowrap;
544 }
545 }
546 }
547 }
548 }
549
550 &-service {
551 margin-top: 30rpx;
552 padding: 0 2.5vw;
553
554 &-title {
555 font-family: "PingFang-SC-Medium";
556 font-size: 30rpx;
557 color: #333333;
558 }
559
560 &-con {
561 display: flex;
562 flex-direction: row;
563 justify-content: space-between;
564 margin-top: 20rpx;
565
566 &-exp {
567 position: relative;
568 width: 50%;
569
570 &-desc {
571 position: absolute;
572 top: 30rpx;
573 left: 30rpx;
574 font-family: "PingFang-SC-Medium";
575 color: #FFFFFF;
576 font-size: 36rpx;
577 }
578 }
579
580 &-box {
581 width: 49%;
582 display: flex;
583 flex-direction: column;
584
585 &-bl {
586 position: relative;
587 margin-top: -10rpx;
588
589 &-over {
590 display: flex;
591 flex-direction: column;
592 position: absolute;
593 top: 50%;
594 left: 15%;
595 transform: translateY(-50%);
596
597 &-up {
598 font-family: "PingFang-SC-Medium";
599 font-size: 30rpx;
600 }
601
602 &-dowm {
603 font-family: "PingFang-SC-Medium";
604 font-size: 24rpx;
605 color: #999999;
606 }
607 }
608 }
609 }
610 }
611
612 }
613 }
614</style>