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