blob: a2f261eaeb2ffdf80dae00e0c53bf125abf23602 [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>
17 <view class="img-box" @click="toPath('')">
18 <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 },
144 onShow() {
guangchao.xu070005a2020-12-07 09:56:40 +0800145 },
146 methods: {
147 search(e) {
148 uni.showToast({
149 icon: "none",
150 title: "搜索服务功能暂未开通",
151 duration: 1500
152 })
153 },
154
155 scan() {
156 let that = this
157 // #ifndef H5
158 // 只允许通过相机扫码
159 uni.scanCode({
guangchao.xu070005a2020-12-07 09:56:40 +0800160 success: function(res) {
guangchao.xu070005a2020-12-07 09:56:40 +0800161 let url = res.result
162 uni.showToast({
163 title: "扫描成功",
164 icon: "none",
165 duration: 800,
166 complete() {
guangchao.xu070005a2020-12-07 09:56:40 +0800167 let param = {
168 url: url
169 }
170 that.$u.get('/v1/qrcode/auth', param).then(ret => {
guangchao.xu96b39792020-12-15 16:46:12 +0800171 //console.log(ret.data.url)
guangchao.xu070005a2020-12-07 09:56:40 +0800172 if (ret.data.permit) {
173 if (ret.data.action == 'water') {
174 setTimeout(() => {
175 uni.navigateTo({
176 url: "/pages/sub_index/scanView/index?url=" + ret.data.url
177 })
178 }, 1500)
179 } else if (ret.data.action == 'dlsmkh5') {
180 // #ifdef APP-PLUS
181 let token = uni.getStorageSync('token')
182 let wv = plus.webview.create(ret.data.url, 'webview_pay', {
183 backButtonAutoControl:'close',
184 additionalHttpHeaders: {
185 Authorization: 'Bearer ' + token
186 }
187 })
188 setTimeout(() => {
189 wv.show()
190 }, 1500)
191 // #endif
192 // #ifndef APP-PLUS
193 uni.showToast({
194 icon: "none",
195 title: "只支持app端",
196 duration: 1500
197 })
198 // #endif
199 }
200 } else {
201 uni.showToast({
202 icon: "none",
203 title: "暂不支持此二维码",
204 duration: 1500
205 })
206 }
207 })
208 }
209 })
210 }
211 });
212 // #endif
213 // #ifdef H5
214 uni.showToast({
215 icon: "none",
216 title: "H5不支持此功能",
217 duration: 1500
218 })
219 // #endif
220 },
221 getActivityList() {
222 let that = this
223 let param = [{
224 code: "PopularActivities", //OnlineActivities、OfflineActivities、PopularActivities
225 pagesize: 1,
226 pageno: 1
227 }]
228 that.$u.post("/i/activity", param).then(res => {
229 if (res.data[0].articles.list.length > 0) {
230 let list = res.data[0].articles.list[0]
231 list.code = 'PopularActivities'
232 that.activity = list
233 }
234 })
235 },
236 activeImg(index) {
237 let that = this
238 let obj = that.activeImgList[index]
239 uni.navigateTo({
240 url: '/pages/sub_index/activeDetails/index?id=' + obj.articleno
241 })
242 },
243 getBannarList() {
244 let that = this
245 that.$u.get('i/column/banner', {}).then(res => {
246 if (res.data.length > 0) {
247 that.activeImgList = res.data
248 //console.log(that.activeImgList)
249 }
250 }).catch(res => {
251 //console.log(1)
252 })
253 },
254 signin() {
255 let that = this
256 that.$u.post('v1/point/task/signin', {}).then(res => {
257 uni.showToast({
258 icon: "none",
259 title: "签到成功",
260 duration: 1500
261 })
262 })
263 }
264 },
265 onLoad() {
266 this.getBannarList()
267 // #ifdef APP-PLUS
268 //引入插件
269 const KJJPush = uni.requireNativePlugin('KJ-JPush');
270 let uid = uni.getStorageSync("uid")
271 //设置Alias
272 KJJPush.setAlias(uid ? uid : 'tourist', 1, result => {
273 //console.log("setAlias:" + JSON.stringify(result));
274 });
275
276 // #endif
277
guangchao.xu96b39792020-12-15 16:46:12 +0800278 },
279 async onPullDownRefresh(){
280 await this.getActivityList()
281 uni.stopPullDownRefresh()
guangchao.xu070005a2020-12-07 09:56:40 +0800282 }
283 }
284</script>
285
286<style lang="scss" scoped>
287 /* #ifdef MP-WEIXIN */
288 .wrap-func {
289 /deep/image {
290 display: block;
291 }
292 }
293
294 /* #endif */
295
296 .status_bar {
297 background-color: #FFFFFF;
298 }
299
300 .wrap {
301 background-color: #FFFFFF;
302
303 &-header {
304 display: flex;
305 flex-direction: row;
306 align-items: center;
307 justify-content: space-between;
308 padding: 10rpx 15rpx;
309 background-color: #FFFFFF;
310
311 image {
312 width: 50rpx;
313 height: 50rpx;
314 }
315
316 .img-box {
317 display: flex;
318 justify-content: center;
319 align-items: center;
320 padding: 0 15rpx;
321 }
322 }
323
324 &-bannar {
325 width: 100vw;
326 margin-top: 10rpx;
327
328 &-title {
329 width: 300rpx;
330 margin: auto;
331 display: flex;
332 justify-content: space-between;
333 font-size: 35rpx;
334 font-weight: bold;
335 font-style: oblique;
336 font-family: "PingFang-SC-Bold";
337 }
338
339 image {
340 width: 100%;
341 }
342
343 &-box {
344 position: relative;
345
346 &-overtitle {
347 position: absolute;
348 width: 250rpx;
349 background-color: #ECECEC;
350 padding: 10rpx 20rpx;
351 border-radius: 50rpx;
352 top: 20rpx;
353 left: 50%;
354 transform: translate(-50%, 0);
355 display: flex;
356 font-size: 24rpx;
357 justify-content: space-between;
358 color: #808080;
359 letter-spacing: 2rpx;
360 font-family: "PingFang-SC-Medium";
361 }
362 }
363 }
364
365 &-func {
366 width: 95vw;
367 background-color: #FFFFFF;
368 margin: -180rpx auto 0;
369 // display: flex;
370 // flex-wrap: wrap;
371 // justify-content: space-between;
372 // padding: 30rpx 0;
373 border-radius: 10rpx;
374 box-shadow: 0 0rpx 6rpx #808080;
375 position: relative;
376
377 /deep/uni-image {
378 display: block;
379 }
380
381 &-item {
382 width: 25%;
383 display: flex;
384 flex-direction: column;
385 align-items: center;
386 margin-bottom: 30rpx;
387
388 text {
389 margin-top: 10rpx;
390 color: #333333;
391 font-family: "PingFang-SC-Medium";
392 font-size: 24rpx;
393 }
394 }
395 }
396
397 &-active {
398 margin-top: 30rpx;
399 padding: 0 2.5vw;
400
401 &-title {
402 font-family: "PingFang-SC-Medium";
403 font-size: 30rpx;
404 color: #333333;
405 }
406
407 &-bannar {
408 margin-top: 20rpx;
409 }
410
411 &-con {
412 display: flex;
413 justify-content: space-between;
414 margin-top: 20rpx;
415
416 // align-items: center;
417 &-item {
418 width: 32%;
419 display: flex;
420 flex-direction: column;
421 align-items: center;
422 background-color: #F7F7F7;
423 padding: 50rpx 20rpx 30rpx;
424 border-radius: 10rpx;
425
426 &-desc {
427 display: flex;
428 flex-direction: column;
429 align-items: center;
430 margin-top: 50rpx;
431 width: 100%;
432 text-align: center;
433
434 &-desc {
435 width: 100%;
436 color: #666666;
437 font-size: 20rpx;
438 margin-top: 10rpx;
439 overflow: hidden;
440 text-overflow: ellipsis;
441 white-space: nowrap;
442 }
443
444 &-title {
445 width: 100%;
446 font-family: "PingFang-SC-Medium";
447 font-size: 26rpx;
448 color: #333333;
449 overflow: hidden;
450 text-overflow: ellipsis;
451 white-space: nowrap;
452 }
453 }
454 }
455 }
456 }
457
458 &-service {
459 margin-top: 30rpx;
460 padding: 0 2.5vw;
461
462 &-title {
463 font-family: "PingFang-SC-Medium";
464 font-size: 30rpx;
465 color: #333333;
466 }
467
468 &-con {
469 display: flex;
470 flex-direction: row;
471 justify-content: space-between;
472 margin-top: 20rpx;
473
474 &-exp {
475 position: relative;
476 width: 50%;
477
478 &-desc {
479 position: absolute;
480 top: 30rpx;
481 left: 30rpx;
482 font-family: "PingFang-SC-Medium";
483 color: #FFFFFF;
484 font-size: 36rpx;
485 }
486 }
487
488 &-box {
489 width: 49%;
490 display: flex;
491 flex-direction: column;
492
493 &-bl {
494 position: relative;
495 margin-top: -10rpx;
496
497 &-over {
498 display: flex;
499 flex-direction: column;
500 position: absolute;
501 top: 50%;
502 left: 15%;
503 transform: translateY(-50%);
504
505 &-up {
506 font-family: "PingFang-SC-Medium";
507 font-size: 30rpx;
508 }
509
510 &-dowm {
511 font-family: "PingFang-SC-Medium";
512 font-size: 24rpx;
513 color: #999999;
514 }
515 }
516 }
517 }
518 }
519
520 }
521 }
522</style>