guangchao.xu | 070005a | 2020-12-07 09:56:40 +0800 | [diff] [blame] | 1 | <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.xu | c43cf97 | 2021-01-18 13:37:55 +0800 | [diff] [blame^] | 17 | <view class="img-box" @click="toPath('')"> |
guangchao.xu | 070005a | 2020-12-07 09:56:40 +0800 | [diff] [blame] | 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> |
guangchao.xu | c43cf97 | 2021-01-18 13:37:55 +0800 | [diff] [blame^] | 60 | <view class="wrap-active-con-item" @click="activity.length == 0?'':toUrl('/pages/sub_index/activeDetails/index?id='+ activity.articleno + '&type=' + activity.code)"> |
guangchao.xu | 070005a | 2020-12-07 09:56:40 +0800 | [diff] [blame] | 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> |
guangchao.xu | c43cf97 | 2021-01-18 13:37:55 +0800 | [diff] [blame^] | 108 | const app = getApp() |
guangchao.xu | 070005a | 2020-12-07 09:56:40 +0800 | [diff] [blame] | 109 | export default { |
| 110 | data() { |
| 111 | return { |
| 112 | searchVal: "", |
| 113 | funcList: [{ |
| 114 | title: "物业缴费", |
| 115 | src: "/static/images/index/wyjf.png" |
| 116 | }, { |
| 117 | title: "电费", |
| 118 | src: "/static/images/index/df.png" |
| 119 | }, { |
| 120 | title: "加油卡充值", |
| 121 | src: "/static/images/index/jykcz.png" |
| 122 | }, { |
| 123 | title: "宽带费", |
| 124 | src: "/static/images/index/kdf.png" |
| 125 | }, { |
| 126 | title: "手机缴费", |
| 127 | src: "/static/images/index/sjjf.png" |
| 128 | }, { |
| 129 | title: "固话充值", |
| 130 | src: "/static/images/index/ghcz.png" |
| 131 | }, { |
| 132 | title: "违章查询", |
| 133 | src: "/static/images/index/wzcx.png" |
| 134 | }, { |
| 135 | title: "全部", |
| 136 | src: "/static/images/index/all.png" |
| 137 | }], |
| 138 | activity: [], |
| 139 | activeImgList: [{ |
| 140 | picid: "/static/images/index/bannar01.png", |
| 141 | articleno: '00000003' |
| 142 | }, ] |
| 143 | } |
| 144 | }, |
guangchao.xu | 070005a | 2020-12-07 09:56:40 +0800 | [diff] [blame] | 145 | methods: { |
guangchao.xu | c43cf97 | 2021-01-18 13:37:55 +0800 | [diff] [blame^] | 146 | get_prompt() { |
| 147 | //提示更新或通告 |
| 148 | let vername = app.globalData.vername |
| 149 | let verno = app.globalData.verno |
| 150 | let params = { |
| 151 | vername, |
| 152 | verno |
| 153 | } |
| 154 | this.$u.get('/i/app/prompt', params).then(res => { |
| 155 | let is_have_content = res.prompt |
| 156 | if (!!is_have_content) { |
| 157 | uni.showModal({ |
| 158 | title: '提示', |
| 159 | content: is_have_content |
| 160 | }) |
| 161 | } |
| 162 | |
| 163 | }) |
| 164 | }, |
guangchao.xu | 070005a | 2020-12-07 09:56:40 +0800 | [diff] [blame] | 165 | search(e) { |
| 166 | uni.showToast({ |
| 167 | icon: "none", |
| 168 | title: "搜索服务功能暂未开通", |
| 169 | duration: 1500 |
| 170 | }) |
| 171 | }, |
| 172 | |
| 173 | scan() { |
guangchao.xu | 50e4238 | 2021-01-04 17:53:47 +0800 | [diff] [blame] | 174 | // #ifdef APP-PLUS |
guangchao.xu | 070005a | 2020-12-07 09:56:40 +0800 | [diff] [blame] | 175 | let that = this |
guangchao.xu | 50e4238 | 2021-01-04 17:53:47 +0800 | [diff] [blame] | 176 | var ali = uni.requireNativePlugin("Mpaas-Scan-Module") |
| 177 | ali.mpaasScan({ |
| 178 | // 扫码 UI 风格,参数可为 qr、bar,默认为 qr |
| 179 | 'type': 'qr', |
| 180 | // 扫码识别类型,参数可多选,qrCode、barCode,不设置,默认识别所有 |
| 181 | 'scanType': ['qrCode'], |
| 182 | // 是否隐藏相册,默认false不隐藏 |
| 183 | 'hideAlbum': false |
| 184 | }, |
| 185 | (ret) => { |
| 186 | let url = ret.resp_result |
guangchao.xu | 070005a | 2020-12-07 09:56:40 +0800 | [diff] [blame] | 187 | uni.showToast({ |
| 188 | title: "扫描成功", |
| 189 | icon: "none", |
| 190 | duration: 800, |
| 191 | complete() { |
guangchao.xu | 070005a | 2020-12-07 09:56:40 +0800 | [diff] [blame] | 192 | let param = { |
| 193 | url: url |
| 194 | } |
guangchao.xu | 50e4238 | 2021-01-04 17:53:47 +0800 | [diff] [blame] | 195 | //console.log(param.url) |
guangchao.xu | 070005a | 2020-12-07 09:56:40 +0800 | [diff] [blame] | 196 | that.$u.get('/v1/qrcode/auth', param).then(ret => { |
guangchao.xu | c43cf97 | 2021-01-18 13:37:55 +0800 | [diff] [blame^] | 197 | // console.log(ret.data) |
guangchao.xu | 070005a | 2020-12-07 09:56:40 +0800 | [diff] [blame] | 198 | if (ret.data.permit) { |
| 199 | if (ret.data.action == 'water') { |
guangchao.xu | 50e4238 | 2021-01-04 17:53:47 +0800 | [diff] [blame] | 200 | setTimeout(() => { |
guangchao.xu | c43cf97 | 2021-01-18 13:37:55 +0800 | [diff] [blame^] | 201 | uni.navigateTo({ |
| 202 | url: "/pages/sub_index/scanView/index?url=" + ret.data.url |
| 203 | }) |
guangchao.xu | 50e4238 | 2021-01-04 17:53:47 +0800 | [diff] [blame] | 204 | }, 1500) |
guangchao.xu | 50e4238 | 2021-01-04 17:53:47 +0800 | [diff] [blame] | 205 | } else if (ret.data.action == 'dlsmkh5') { |
| 206 | let token = uni.getStorageSync('token') |
| 207 | let wv = plus.webview.create(ret.data.url, 'webview_pay', { |
| 208 | backButtonAutoControl: 'close', |
| 209 | additionalHttpHeaders: { |
| 210 | Authorization: 'Bearer ' + token |
| 211 | } |
| 212 | }) |
| 213 | setTimeout(() => { |
| 214 | wv.show() |
| 215 | }, 1500) |
guangchao.xu | 070005a | 2020-12-07 09:56:40 +0800 | [diff] [blame] | 216 | } |
| 217 | } else { |
| 218 | uni.showToast({ |
| 219 | icon: "none", |
| 220 | title: "暂不支持此二维码", |
| 221 | duration: 1500 |
| 222 | }) |
| 223 | } |
| 224 | }) |
| 225 | } |
| 226 | }) |
guangchao.xu | 50e4238 | 2021-01-04 17:53:47 +0800 | [diff] [blame] | 227 | }) |
guangchao.xu | 070005a | 2020-12-07 09:56:40 +0800 | [diff] [blame] | 228 | // #endif |
guangchao.xu | 50e4238 | 2021-01-04 17:53:47 +0800 | [diff] [blame] | 229 | |
guangchao.xu | 070005a | 2020-12-07 09:56:40 +0800 | [diff] [blame] | 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() |
guangchao.xu | c43cf97 | 2021-01-18 13:37:55 +0800 | [diff] [blame^] | 277 | setTimeout(() => { |
| 278 | this.get_prompt() |
| 279 | }, 5 * 1000) |
| 280 | this.getActivityList() |
guangchao.xu | 070005a | 2020-12-07 09:56:40 +0800 | [diff] [blame] | 281 | // #ifdef APP-PLUS |
| 282 | //引入插件 |
| 283 | const KJJPush = uni.requireNativePlugin('KJ-JPush'); |
| 284 | let uid = uni.getStorageSync("uid") |
| 285 | //设置Alias |
| 286 | KJJPush.setAlias(uid ? uid : 'tourist', 1, result => { |
| 287 | //console.log("setAlias:" + JSON.stringify(result)); |
| 288 | }); |
| 289 | |
| 290 | // #endif |
| 291 | |
guangchao.xu | 96b3979 | 2020-12-15 16:46:12 +0800 | [diff] [blame] | 292 | }, |
guangchao.xu | 50e4238 | 2021-01-04 17:53:47 +0800 | [diff] [blame] | 293 | async onPullDownRefresh() { |
guangchao.xu | 96b3979 | 2020-12-15 16:46:12 +0800 | [diff] [blame] | 294 | await this.getActivityList() |
| 295 | uni.stopPullDownRefresh() |
guangchao.xu | 070005a | 2020-12-07 09:56:40 +0800 | [diff] [blame] | 296 | } |
| 297 | } |
| 298 | </script> |
| 299 | |
| 300 | <style lang="scss" scoped> |
| 301 | /* #ifdef MP-WEIXIN */ |
| 302 | .wrap-func { |
| 303 | /deep/image { |
| 304 | display: block; |
| 305 | } |
| 306 | } |
| 307 | |
| 308 | /* #endif */ |
| 309 | |
| 310 | .status_bar { |
| 311 | background-color: #FFFFFF; |
| 312 | } |
| 313 | |
| 314 | .wrap { |
| 315 | background-color: #FFFFFF; |
| 316 | |
| 317 | &-header { |
| 318 | display: flex; |
| 319 | flex-direction: row; |
| 320 | align-items: center; |
| 321 | justify-content: space-between; |
| 322 | padding: 10rpx 15rpx; |
| 323 | background-color: #FFFFFF; |
| 324 | |
| 325 | image { |
| 326 | width: 50rpx; |
| 327 | height: 50rpx; |
| 328 | } |
| 329 | |
| 330 | .img-box { |
| 331 | display: flex; |
| 332 | justify-content: center; |
| 333 | align-items: center; |
| 334 | padding: 0 15rpx; |
| 335 | } |
| 336 | } |
| 337 | |
| 338 | &-bannar { |
| 339 | width: 100vw; |
| 340 | margin-top: 10rpx; |
| 341 | |
| 342 | &-title { |
| 343 | width: 300rpx; |
| 344 | margin: auto; |
| 345 | display: flex; |
| 346 | justify-content: space-between; |
| 347 | font-size: 35rpx; |
| 348 | font-weight: bold; |
| 349 | font-style: oblique; |
| 350 | font-family: "PingFang-SC-Bold"; |
| 351 | } |
| 352 | |
| 353 | image { |
| 354 | width: 100%; |
| 355 | } |
| 356 | |
| 357 | &-box { |
| 358 | position: relative; |
| 359 | |
| 360 | &-overtitle { |
| 361 | position: absolute; |
| 362 | width: 250rpx; |
| 363 | background-color: #ECECEC; |
| 364 | padding: 10rpx 20rpx; |
| 365 | border-radius: 50rpx; |
| 366 | top: 20rpx; |
| 367 | left: 50%; |
| 368 | transform: translate(-50%, 0); |
| 369 | display: flex; |
| 370 | font-size: 24rpx; |
| 371 | justify-content: space-between; |
| 372 | color: #808080; |
| 373 | letter-spacing: 2rpx; |
| 374 | font-family: "PingFang-SC-Medium"; |
| 375 | } |
| 376 | } |
| 377 | } |
| 378 | |
| 379 | &-func { |
| 380 | width: 95vw; |
| 381 | background-color: #FFFFFF; |
| 382 | margin: -180rpx auto 0; |
| 383 | // display: flex; |
| 384 | // flex-wrap: wrap; |
| 385 | // justify-content: space-between; |
| 386 | // padding: 30rpx 0; |
| 387 | border-radius: 10rpx; |
| 388 | box-shadow: 0 0rpx 6rpx #808080; |
| 389 | position: relative; |
| 390 | |
| 391 | /deep/uni-image { |
| 392 | display: block; |
| 393 | } |
| 394 | |
| 395 | &-item { |
| 396 | width: 25%; |
| 397 | display: flex; |
| 398 | flex-direction: column; |
| 399 | align-items: center; |
| 400 | margin-bottom: 30rpx; |
| 401 | |
| 402 | text { |
| 403 | margin-top: 10rpx; |
| 404 | color: #333333; |
| 405 | font-family: "PingFang-SC-Medium"; |
| 406 | font-size: 24rpx; |
| 407 | } |
| 408 | } |
| 409 | } |
| 410 | |
| 411 | &-active { |
| 412 | margin-top: 30rpx; |
| 413 | padding: 0 2.5vw; |
| 414 | |
| 415 | &-title { |
| 416 | font-family: "PingFang-SC-Medium"; |
| 417 | font-size: 30rpx; |
| 418 | color: #333333; |
| 419 | } |
| 420 | |
| 421 | &-bannar { |
| 422 | margin-top: 20rpx; |
| 423 | } |
| 424 | |
| 425 | &-con { |
| 426 | display: flex; |
| 427 | justify-content: space-between; |
| 428 | margin-top: 20rpx; |
| 429 | |
| 430 | // align-items: center; |
| 431 | &-item { |
| 432 | width: 32%; |
| 433 | display: flex; |
| 434 | flex-direction: column; |
| 435 | align-items: center; |
| 436 | background-color: #F7F7F7; |
| 437 | padding: 50rpx 20rpx 30rpx; |
| 438 | border-radius: 10rpx; |
| 439 | |
| 440 | &-desc { |
| 441 | display: flex; |
| 442 | flex-direction: column; |
| 443 | align-items: center; |
| 444 | margin-top: 50rpx; |
| 445 | width: 100%; |
| 446 | text-align: center; |
| 447 | |
| 448 | &-desc { |
| 449 | width: 100%; |
| 450 | color: #666666; |
| 451 | font-size: 20rpx; |
| 452 | margin-top: 10rpx; |
| 453 | overflow: hidden; |
| 454 | text-overflow: ellipsis; |
| 455 | white-space: nowrap; |
| 456 | } |
| 457 | |
| 458 | &-title { |
| 459 | width: 100%; |
| 460 | font-family: "PingFang-SC-Medium"; |
| 461 | font-size: 26rpx; |
| 462 | color: #333333; |
| 463 | overflow: hidden; |
| 464 | text-overflow: ellipsis; |
| 465 | white-space: nowrap; |
| 466 | } |
| 467 | } |
| 468 | } |
| 469 | } |
| 470 | } |
| 471 | |
| 472 | &-service { |
| 473 | margin-top: 30rpx; |
| 474 | padding: 0 2.5vw; |
| 475 | |
| 476 | &-title { |
| 477 | font-family: "PingFang-SC-Medium"; |
| 478 | font-size: 30rpx; |
| 479 | color: #333333; |
| 480 | } |
| 481 | |
| 482 | &-con { |
| 483 | display: flex; |
| 484 | flex-direction: row; |
| 485 | justify-content: space-between; |
| 486 | margin-top: 20rpx; |
| 487 | |
| 488 | &-exp { |
| 489 | position: relative; |
| 490 | width: 50%; |
| 491 | |
| 492 | &-desc { |
| 493 | position: absolute; |
| 494 | top: 30rpx; |
| 495 | left: 30rpx; |
| 496 | font-family: "PingFang-SC-Medium"; |
| 497 | color: #FFFFFF; |
| 498 | font-size: 36rpx; |
| 499 | } |
| 500 | } |
| 501 | |
| 502 | &-box { |
| 503 | width: 49%; |
| 504 | display: flex; |
| 505 | flex-direction: column; |
| 506 | |
| 507 | &-bl { |
| 508 | position: relative; |
| 509 | margin-top: -10rpx; |
| 510 | |
| 511 | &-over { |
| 512 | display: flex; |
| 513 | flex-direction: column; |
| 514 | position: absolute; |
| 515 | top: 50%; |
| 516 | left: 15%; |
| 517 | transform: translateY(-50%); |
| 518 | |
| 519 | &-up { |
| 520 | font-family: "PingFang-SC-Medium"; |
| 521 | font-size: 30rpx; |
| 522 | } |
| 523 | |
| 524 | &-dowm { |
| 525 | font-family: "PingFang-SC-Medium"; |
| 526 | font-size: 24rpx; |
| 527 | color: #999999; |
| 528 | } |
| 529 | } |
| 530 | } |
| 531 | } |
| 532 | } |
| 533 | |
| 534 | } |
| 535 | } |
| 536 | </style> |