Commit d441a60b61ad3f382b3b66813ba263bf95500b08
1 parent
1dcf8f79
Exists in
master
feat: 下拉加载,超链接,支付问题修改
fix: 扫码问题修复
Showing
6 changed files
with
95 additions
and
39 deletions
 
Show diff stats
src/main.js
| 1 | 1 | import Vue from 'vue' | 
| 2 | -import { Popup, Toast, Picker, Tag, Tab, Tabs, Area, Search, Swipe, SwipeItem, Cell, List, Collapse, CollapseItem, Button, Field, Icon, Sticky, DropdownMenu, DropdownItem, Rate, Calendar, Checkbox, Empty, Lazyload, Radio, RadioGroup, CellGroup, Dialog, CheckboxGroup, NavBar } from 'vant'; | |
| 2 | +import { Popup, Toast, Picker, Tag, Tab, Tabs, Area, Search, Swipe, SwipeItem, Cell, List, Collapse, CollapseItem, Button, Field, Icon, Sticky, DropdownMenu, DropdownItem, Rate, Calendar, Checkbox, Empty, Lazyload, Radio, RadioGroup, CellGroup, Dialog, CheckboxGroup, NavBar, PullRefresh } from 'vant'; | |
| 3 | 3 | import App from './App.vue' | 
| 4 | 4 | import router from './router' | 
| 5 | 5 | import store from './store' | 
| ... | ... | @@ -44,6 +44,7 @@ Vue | 
| 44 | 44 | .use(Toast) | 
| 45 | 45 | .use(Dialog) | 
| 46 | 46 | .use(NavBar) | 
| 47 | + .use(PullRefresh) | |
| 47 | 48 | .use(RadioGroup) | 
| 48 | 49 | .use(Radio); | 
| 49 | 50 | Vue.config.productionTip = false; | ... | ... | 
src/views/Home/MyClassList.vue
| ... | ... | @@ -147,7 +147,7 @@ export default { | 
| 147 | 147 | } | 
| 148 | 148 | var basePosition = [this.baseInfo.signLong, this.baseInfo.signLat]; | 
| 149 | 149 | AMap.convertFrom(basePosition, 'baidu', function (status, result) { | 
| 150 | - console.log(result) | |
| 150 | + console.log('基地定位转换:',result) | |
| 151 | 151 | if (result.info === 'ok') { | 
| 152 | 152 | basePosition = [result.locations[0].lng, result.locations[0].lat]; // Array.<LngLat> | 
| 153 | 153 | } | 
| ... | ... | @@ -156,10 +156,12 @@ export default { | 
| 156 | 156 | message: '请求中...', | 
| 157 | 157 | }); | 
| 158 | 158 | this.getNowPosition((posi) => { //获取当前位置坐标 | 
| 159 | + console.log('获取当前位置坐标:',posi) | |
| 159 | 160 | this.$toast.clear(); | 
| 160 | 161 | if (posi) { | 
| 161 | 162 | var nowPosition = [posi.position.lng, posi.position.lat]; | 
| 162 | 163 | var distance = AMap.GeometryUtil.distance(nowPosition, basePosition); | 
| 164 | + console.log('两点距离:',distance) | |
| 163 | 165 | console.log(parseInt(distance), nowPosition, basePosition) | 
| 164 | 166 | if (parseInt(distance) > 500) { | 
| 165 | 167 | this.failShow = true; | ... | ... | 
src/views/Home/component/HomeScan.vue
| ... | ... | @@ -12,12 +12,12 @@ export default { | 
| 12 | 12 | "type": "qrCode" | 
| 13 | 13 | }).then(res => { | 
| 14 | 14 | console.log(res) | 
| 15 | - const qrcode = res.qrcode | |
| 15 | + const qrcode = res.text | |
| 16 | 16 | if(qrcode.length>10){ | 
| 17 | 17 | this.$toast.fail('请扫描正确的基地码') | 
| 18 | 18 | return; | 
| 19 | 19 | } | 
| 20 | - this.$router.push({ name: 'MyClassList', query: { qrresult: res.qrcode } }) | |
| 20 | + this.$router.push({ name: 'MyClassList', query: { qrresult: res.text } }) | |
| 21 | 21 | }).catch(err => { | 
| 22 | 22 | console.log(err) | 
| 23 | 23 | }) | ... | ... | 
src/views/Service/CheckOrder.vue
| ... | ... | @@ -248,17 +248,22 @@ export default { | 
| 248 | 248 | "payWay": 0, | 
| 249 | 249 | "productId": this.showCourseData.id, //商品id | 
| 250 | 250 | "quit_url": location.href, | 
| 251 | - "subject": "研学产品", | |
| 252 | - "totalFee": "0.01", | |
| 251 | + "subject": this.showCourseData.course_name + '_' + this.date, | |
| 252 | + "totalFee": this.selectCombo.actualPrice * 1000 * this.count / 1000 | |
| 253 | 253 | }, | 
| 254 | 254 | onSuccess: res => { | 
| 255 | 255 | console.log(res) | 
| 256 | 256 | localStorage.setItem('outTradeNo', data.trade_no) | 
| 257 | - // res.data.data默认是我们拿到的form代码 | |
| 258 | - const div = document.createElement('div') | |
| 259 | - div.innerHTML = res.data.message | |
| 257 | + // this.BridgePay(res.data.message) | |
| 258 | + let divForm = document.getElementsByTagName('divform') | |
| 259 | + if (divForm.length) { | |
| 260 | + document.body.removeChild(divForm[0]) | |
| 261 | + } | |
| 262 | + const div = document.createElement('divform') | |
| 263 | + div.innerHTML = res.data.message // res.data就是sb支付宝返回给你的form | |
| 260 | 264 | document.body.appendChild(div) | 
| 261 | - document.forms[0].submit() //重要,这个才是点击跳页面的核心 | |
| 265 | + // document.forms[0].setAttribute('target', '_blank') // 加了_blank可能出问题所以我注释了 | |
| 266 | + document.forms[0].submit() | |
| 262 | 267 | }, | 
| 263 | 268 | onFail: err => { | 
| 264 | 269 | console.log('err', err) | 
| ... | ... | @@ -267,15 +272,25 @@ export default { | 
| 267 | 272 | } | 
| 268 | 273 | }, | 
| 269 | 274 | // 支付API | 
| 270 | - BridgePay (credential) { | |
| 271 | - var payMsg = { | |
| 272 | - platform: 1, | |
| 273 | - arg: { | |
| 274 | - "credential": credential, | |
| 275 | - "inSandBox": false | |
| 276 | - } | |
| 277 | - }; | |
| 278 | - }, | |
| 275 | + // BridgePay (credential) { | |
| 276 | + // var payMsg = { | |
| 277 | + // platform: 1, | |
| 278 | + // arg: { | |
| 279 | + // "credential": credential, | |
| 280 | + // "inSandBox": false | |
| 281 | + // } | |
| 282 | + // }; | |
| 283 | + // ZWJSBridge.pay(payMsg).then((result) => { | |
| 284 | + | |
| 285 | + // alert('支付成功!'); | |
| 286 | + // console.log('#### ZWJSBridge.pay() result:' + result); | |
| 287 | + | |
| 288 | + // }).catch((error) => { | |
| 289 | + // var errorMsg = JSON.stringify(error); | |
| 290 | + // alert('支付失败:' + errorMsg); | |
| 291 | + // console.log('#### ZWJSBridge.pay() error:' + error); | |
| 292 | + // }); | |
| 293 | + // }, | |
| 279 | 294 | //判断是否为支付会跳,查询订单状态 | 
| 280 | 295 | getOrderStatus (outTradeNo) { | 
| 281 | 296 | console.log('getOrderStatus') | ... | ... | 
src/views/Service/ServiceBaseKQ.vue
| ... | ... | @@ -10,7 +10,9 @@ | 
| 10 | 10 | </van-swipe> | 
| 11 | 11 | <img class="card_zzy" src="../../assets/service/card_zzy.png" alt="" @click="handleMyCard"> | 
| 12 | 12 | <img class="order_btn" src="../../assets/service/order.png" alt="" @click="handleMyOrder"> | 
| 13 | - <ServiceListFour :list="campList" :notab="false"></ServiceListFour> | |
| 13 | + <van-pull-refresh v-model="loading" @refresh="onRefresh('campList')"> | |
| 14 | + <ServiceListFour :list="campList" :notab="false"></ServiceListFour> | |
| 15 | + </van-pull-refresh> | |
| 14 | 16 | </div> | 
| 15 | 17 | </div> | 
| 16 | 18 | <div v-show="tabName=='KQ'"> | 
| ... | ... | @@ -30,24 +32,34 @@ | 
| 30 | 32 | <div class="top_tool"> | 
| 31 | 33 | <van-search class="search" v-model="search" shape="round" background="transparent" placeholder="搜索活动、研学旅行、服务" @search="onSearch" /> | 
| 32 | 34 | </div> | 
| 33 | - <div class="redLink">轻纺城小学红色网上游主题教育馆</div> | |
| 35 | + <div class="redLink" @click="handleRedLink">轻纺城小学红色网上游主题教育馆</div> | |
| 34 | 36 | </van-sticky> | 
| 35 | 37 | <div class="tabsCard"> | 
| 36 | 38 | <van-tabs v-model="active" sticky offset-top="24vw" z-index='100' :ellipsis="false" :before-change="beforeChange"> | 
| 37 | 39 | <van-tab title="革命遗址"> | 
| 38 | - <ServiceListThird :list="uniList" :notab="true"></ServiceListThird> | |
| 40 | + <van-pull-refresh v-model="loading" @refresh="onRefresh('uniList')"> | |
| 41 | + <ServiceListThird :list="uniList" :notab="true"></ServiceListThird> | |
| 42 | + </van-pull-refresh> | |
| 39 | 43 | </van-tab> | 
| 40 | 44 | <van-tab title="文化传承"> | 
| 41 | - <ServiceListThird :list="weekList" :notab="true"></ServiceListThird> | |
| 45 | + <van-pull-refresh v-model="loading" @refresh="onRefresh('weekList')"> | |
| 46 | + <ServiceListThird :list="weekList" :notab="true"></ServiceListThird> | |
| 47 | + </van-pull-refresh> | |
| 42 | 48 | </van-tab> | 
| 43 | 49 | <van-tab title="红色军旅"> | 
| 44 | - <ServiceListThird :list="cityList" :notab="true"></ServiceListThird> | |
| 50 | + <van-pull-refresh v-model="loading" @refresh="onRefresh('cityList')"> | |
| 51 | + <ServiceListThird :list="cityList" :notab="true"></ServiceListThird> | |
| 52 | + </van-pull-refresh> | |
| 45 | 53 | </van-tab> | 
| 46 | 54 | <van-tab title="乡村振新"> | 
| 47 | - <ServiceListThird :list="selectList" :notab="true"></ServiceListThird> | |
| 55 | + <van-pull-refresh v-model="loading" @refresh="onRefresh('selectList')"> | |
| 56 | + <ServiceListThird :list="selectList" :notab="true"></ServiceListThird> | |
| 57 | + </van-pull-refresh> | |
| 48 | 58 | </van-tab> | 
| 49 | 59 | <van-tab title="大好河山"> | 
| 50 | - <ServiceListThird :list="riverList" :notab="true"></ServiceListThird> | |
| 60 | + <van-pull-refresh v-model="loading" @refresh="onRefresh('riverList')"> | |
| 61 | + <ServiceListThird :list="riverList" :notab="true"></ServiceListThird> | |
| 62 | + </van-pull-refresh> | |
| 51 | 63 | </van-tab> | 
| 52 | 64 | </van-tabs> | 
| 53 | 65 | </div> | 
| ... | ... | @@ -84,6 +96,7 @@ export default { | 
| 84 | 96 | riverList: [], | 
| 85 | 97 | tabName: 'KQ', | 
| 86 | 98 | campList: [], | 
| 99 | + loading: false | |
| 87 | 100 | } | 
| 88 | 101 | }, | 
| 89 | 102 | watch: { | 
| ... | ... | @@ -106,6 +119,22 @@ export default { | 
| 106 | 119 | this.initService() | 
| 107 | 120 | }, | 
| 108 | 121 | methods: { | 
| 122 | + onRefresh (list) { | |
| 123 | + if(list=='campList'){ | |
| 124 | + this.getCampList() | |
| 125 | + }else if(list=='uniList'){ | |
| 126 | + this.getUniList() | |
| 127 | + }else if(list=='weekList'){ | |
| 128 | + this.getWeekList() | |
| 129 | + }else if(list=='cityList'){ | |
| 130 | + this.getCityList() | |
| 131 | + }else if(list=='selectList'){ | |
| 132 | + this.getSelectList() | |
| 133 | + }else if(list=='riverList'){ | |
| 134 | + this.getRiverList() | |
| 135 | + } | |
| 136 | + | |
| 137 | + }, | |
| 109 | 138 | initService () { | 
| 110 | 139 | this.getUniList() | 
| 111 | 140 | this.getWeekList() | 
| ... | ... | @@ -138,7 +167,6 @@ export default { | 
| 138 | 167 | "channelCode": "" | 
| 139 | 168 | }, | 
| 140 | 169 | onSuccess: data => { | 
| 141 | - console.log('data', data) | |
| 142 | 170 | this.$toast.clear() | 
| 143 | 171 | let uniList = data.data.data; | 
| 144 | 172 | for (let i in uniList) { | 
| ... | ... | @@ -149,7 +177,9 @@ export default { | 
| 149 | 177 | uniList[i].endDate = this.Moment(uniList[i].endDate).format('YYYY.M.D'); | 
| 150 | 178 | } | 
| 151 | 179 | } | 
| 180 | + this.loading = false | |
| 152 | 181 | this.uniList = uniList | 
| 182 | + console.log('革命遗址:', data) | |
| 153 | 183 | }, | 
| 154 | 184 | onFail: err => { | 
| 155 | 185 | console.log('err', err) | 
| ... | ... | @@ -178,7 +208,6 @@ export default { | 
| 178 | 208 | "channelCode": "" | 
| 179 | 209 | }, | 
| 180 | 210 | onSuccess: data => { | 
| 181 | - console.log('data', data) | |
| 182 | 211 | let weekList = data.data.data; | 
| 183 | 212 | for (let i in weekList) { | 
| 184 | 213 | weekList[i].course_labels = weekList[i].course_labels?.split(','); | 
| ... | ... | @@ -188,7 +217,9 @@ export default { | 
| 188 | 217 | weekList[i].endDate = this.Moment(weekList[i].endDate).format('YYYY.M.D'); | 
| 189 | 218 | } | 
| 190 | 219 | } | 
| 220 | + this.loading = false | |
| 191 | 221 | this.weekList = weekList | 
| 222 | + console.log('文化传承:', weekList) | |
| 192 | 223 | }, | 
| 193 | 224 | onFail: err => { | 
| 194 | 225 | console.log('err', err) | 
| ... | ... | @@ -217,7 +248,6 @@ export default { | 
| 217 | 248 | "channelCode": "" | 
| 218 | 249 | }, | 
| 219 | 250 | onSuccess: data => { | 
| 220 | - console.log('data', data) | |
| 221 | 251 | let cityList = data.data.data; | 
| 222 | 252 | for (let i in cityList) { | 
| 223 | 253 | cityList[i].course_labels = cityList[i].course_labels?.split(','); | 
| ... | ... | @@ -227,7 +257,9 @@ export default { | 
| 227 | 257 | cityList[i].endDate = this.Moment(cityList[i].endDate).format('YYYY.M.D'); | 
| 228 | 258 | } | 
| 229 | 259 | } | 
| 260 | + this.loading = false | |
| 230 | 261 | this.cityList = cityList | 
| 262 | + console.log('红色军旅:', cityList) | |
| 231 | 263 | }, | 
| 232 | 264 | onFail: err => { | 
| 233 | 265 | console.log('err', err) | 
| ... | ... | @@ -256,7 +288,6 @@ export default { | 
| 256 | 288 | "channelCode": "" | 
| 257 | 289 | }, | 
| 258 | 290 | onSuccess: data => { | 
| 259 | - console.log('data', data) | |
| 260 | 291 | let selectList = data.data.data; | 
| 261 | 292 | for (let i in selectList) { | 
| 262 | 293 | selectList[i].course_labels = selectList[i].course_labels?.split(','); | 
| ... | ... | @@ -266,7 +297,9 @@ export default { | 
| 266 | 297 | selectList[i].endDate = this.Moment(selectList[i].endDate).format('YYYY.M.D'); | 
| 267 | 298 | } | 
| 268 | 299 | } | 
| 300 | + this.loading = false | |
| 269 | 301 | this.selectList = selectList | 
| 302 | + console.log('乡村振新:', selectList) | |
| 270 | 303 | }, | 
| 271 | 304 | onFail: err => { | 
| 272 | 305 | console.log('err', err) | 
| ... | ... | @@ -295,7 +328,6 @@ export default { | 
| 295 | 328 | "channelCode": "" | 
| 296 | 329 | }, | 
| 297 | 330 | onSuccess: data => { | 
| 298 | - console.log('data', data) | |
| 299 | 331 | let riverList = data.data.data; | 
| 300 | 332 | for (let i in riverList) { | 
| 301 | 333 | riverList[i].course_labels = riverList[i].course_labels?.split(','); | 
| ... | ... | @@ -305,7 +337,9 @@ export default { | 
| 305 | 337 | riverList[i].endDate = this.Moment(riverList[i].endDate).format('YYYY.M.D'); | 
| 306 | 338 | } | 
| 307 | 339 | } | 
| 340 | + this.loading = false | |
| 308 | 341 | this.riverList = riverList | 
| 342 | + console.log('大好河山:', riverList) | |
| 309 | 343 | }, | 
| 310 | 344 | onFail: err => { | 
| 311 | 345 | console.log('err', err) | 
| ... | ... | @@ -335,7 +369,6 @@ export default { | 
| 335 | 369 | "channelCode": "GZH002" | 
| 336 | 370 | }, | 
| 337 | 371 | onSuccess: data => { | 
| 338 | - console.log('data', data) | |
| 339 | 372 | let campList = data.data.data; | 
| 340 | 373 | for (let i in campList) { | 
| 341 | 374 | campList[i].course_labels = campList[i].course_labels?.split(','); | 
| ... | ... | @@ -345,7 +378,9 @@ export default { | 
| 345 | 378 | campList[i].endDate = this.Moment(campList[i].endDate).format('YYYY.M.D'); | 
| 346 | 379 | } | 
| 347 | 380 | } | 
| 381 | + this.loading = false | |
| 348 | 382 | this.campList = campList | 
| 383 | + console.log('每周一营:', data) | |
| 349 | 384 | }, | 
| 350 | 385 | onFail: err => { | 
| 351 | 386 | console.log('err', err) | 
| ... | ... | @@ -369,7 +404,7 @@ export default { | 
| 369 | 404 | // 我的优惠券 | 
| 370 | 405 | handleMyCard () { | 
| 371 | 406 | // this.$toast('暂未开放,敬请期待!'); | 
| 372 | - this.$router.push({ name: 'CardBoxXST', query: { active: 1} }) | |
| 407 | + this.$router.push({ name: 'CardBoxXST', query: { active: 1 } }) | |
| 373 | 408 | }, | 
| 374 | 409 | formatWeek (week) { | 
| 375 | 410 | return week == 1 ? '周一' : week == 2 ? '周二' : week == 3 ? '周三' : week == 4 ? '周四' : week == 5 ? '周五' : week == 6 ? '周六' : week == 0 ? '周日' : ''; | 
| ... | ... | @@ -378,6 +413,10 @@ export default { | 
| 378 | 413 | handleBanner () { | 
| 379 | 414 | location.href = 'https://mp.weixin.qq.com/s/a4N3xr2nXZ-aG3OEakv-Dg' | 
| 380 | 415 | }, | 
| 416 | + handleRedLink () { | |
| 417 | + location.href = 'https://720yun.com/t/89vkzwd7pfw?scene_id=80780201' | |
| 418 | + | |
| 419 | + } | |
| 381 | 420 | }, | 
| 382 | 421 | components: { | 
| 383 | 422 | Tabbar4, | 
| ... | ... | @@ -491,7 +530,6 @@ export default { | 
| 491 | 530 | right: 20px; | 
| 492 | 531 | z-index: 99; | 
| 493 | 532 | } | 
| 494 | - | |
| 495 | 533 | } | 
| 496 | 534 | |
| 497 | 535 | ::v-deep .van-search__content { | 
| ... | ... | @@ -582,11 +620,11 @@ export default { | 
| 582 | 620 | font-size: 44px; | 
| 583 | 621 | } | 
| 584 | 622 | } | 
| 585 | - .van-tab{ | |
| 623 | + .van-tab { | |
| 586 | 624 | font-size: 40px; | 
| 587 | 625 | } | 
| 588 | - .van-tab--active{ | |
| 589 | - font-size: 44px; | |
| 626 | + .van-tab--active { | |
| 627 | + font-size: 44px; | |
| 590 | 628 | } | 
| 591 | 629 | } | 
| 592 | 630 | } | ... | ... | 
src/views/Service/component/ServiceListThird.vue
| ... | ... | @@ -135,7 +135,7 @@ export default { | 
| 135 | 135 | } | 
| 136 | 136 | } | 
| 137 | 137 | .cardBox_title { | 
| 138 | - height: 10vw; | |
| 138 | + min-height: 10vw; | |
| 139 | 139 | width: 100%; | 
| 140 | 140 | padding: 0 3vw; | 
| 141 | 141 | box-sizing: border-box; | 
| ... | ... | @@ -147,7 +147,7 @@ export default { | 
| 147 | 147 | align-items: center; | 
| 148 | 148 | |
| 149 | 149 | .cardBox_title_red { | 
| 150 | - width: 15vw; | |
| 150 | + width: 20vw; | |
| 151 | 151 | color: red; | 
| 152 | 152 | text-align: right; | 
| 153 | 153 | } | ... | ... | 
