diff --git a/App.vue b/App.vue index 309dbc4..d06c90b 100644 --- a/App.vue +++ b/App.vue @@ -75,6 +75,7 @@ }, onShareAppMessage() { wx.onAppRoute(() => { + let white = ['BagStation/pages/stationDetail/stationDetail'] // console.log('当前页面路由发生变化 触发该事件onShareAppMessage') const pages = getCurrentPages() //获取加载的页面 const view = pages[pages.length - 1] //获取当前页面的对象 @@ -94,11 +95,14 @@ console.log(view.route) clearTimeout(loginTimer) clearTimeout(onlineTimer) + if (view.route != 'pages/index/startPage/startPage' && view.route.indexOf('BagAuth') == -1) { const token = uni.getStorageSync('Authorization') const openid = uni.getStorageSync('openid') if (token && openid) { - this.getAmount() + if(!white.includes(view.route)){ + this.getAmount() + } onlineTimer = setTimeout(() => { if (this.loginStatus == 'offline') { uni.clearStorageSync() diff --git a/BagStation/pages/components/price-select-tab.vue b/BagStation/pages/components/price-select-tab.vue index 53a62dd..c2f734a 100644 --- a/BagStation/pages/components/price-select-tab.vue +++ b/BagStation/pages/components/price-select-tab.vue @@ -20,7 +20,7 @@ - + @@ -117,7 +117,7 @@ - + @@ -144,7 +144,7 @@ - + 优惠 @@ -160,7 +160,7 @@ 优惠券 {{'----'}} - + @@ -355,7 +355,6 @@ oilBarTy: '', ty: { realMoney: "" - }, tyRes: { liter: '', @@ -377,7 +376,7 @@ plateNumbers: [], showPlate: "", showOrder: '', - radio: '', + radio: null, imgURL: this.global.imgURL, scrollLeft: 0, checkVol: [{ @@ -407,7 +406,6 @@ hot: false, }], plateNumber: '', - checkMoney:[{ value: 100, name: '100 ', @@ -503,6 +501,15 @@ }, 2) } }, + radio:{ + handler(n,o) { + console.log(n,o,'handler'); + this.checkBar.forEach(item=>{ + item.checked = false + }); + this.oilBar = '' + } + } }, computed: { priceId() { @@ -639,6 +646,7 @@ }) }, checkInfo(){ + console.log(this.radio) this.tsetPlate(this.plateNumber ? this.plateNumber : this.plateNumberSel) if (!this.testPlateResult) { this.plateNumber='' @@ -648,10 +656,10 @@ }) // return false } - if (!this.oilSitePriceDetailsVo[this.radio].priceId) { + if (this.radio==null||!this.oilSitePriceDetailsVo[this.radio].priceId) { uni.showToast({ icon: 'none', - title: '未选择油品' + title: '请选择油品' }) return false } @@ -797,7 +805,7 @@ } }, beforeMake() { - + console.log(this.radio,'beforeMake') this.tsetPlate(this.plateNumber ? this.plateNumber : this.plateNumberSel) if (!this.testPlateResult) { this.plateNumber='' @@ -807,10 +815,10 @@ }) // return false } - if (!this.oilSitePriceDetailsVo[this.radio].priceId) { + if (this.radio==null||!this.oilSitePriceDetailsVo[this.radio].priceId) { uni.showToast({ icon: 'none', - title: '未选择油品' + title: '请选择油品' }) return false } @@ -912,11 +920,14 @@ this.oilSitePriceDetailsVo = [] oilSiteApi.getNewSitePrice(channelId).then(res => { if (res.code == 20000) { - this.radio = 0 this.plateNumbers = res.data.plateNumbers - this.oilSitePriceDetailsVo = res.data.oilSitePriceDetailsVo - this.activeSitePrice = res.data.oilSitePriceDetailsVo[0].priceId - this.siteUserNames = res.data.siteUserNames + this.oilSitePriceDetailsVo = res.data.oilSitePriceDetailsVo; + this.siteUserNames = res.data.siteUserNames; + if(this.oilSitePriceDetailsVo.length==1){ + this.radio = 0 + this.activeSitePrice = res.data.oilSitePriceDetailsVo[0].priceId + } + } }) }, @@ -957,11 +968,18 @@ }, changePrice(e) { this.radio = e.detail.value - console.log(e) + console.log(e,'changePrice') this.vol ='' this.activeSitePrice = this.oilSitePriceDetailsVo[this.radio].priceId this.realMoney ='--' - this.xoilAmountGun = '' + this.xoilAmountGun = ''; + Object.keys(this.tyRes).forEach(key=>{ + this.tyRes[key]='' + }) + Object.keys(this.ty).forEach(key=>{ + this.ty[key]='' + }) + this.vlom = '' // // console.log(this.radio) console.log(this.oilSitePriceDetailsVo[this.radio]) }, diff --git a/BagStation/pages/stationDetail/stationDetail.vue b/BagStation/pages/stationDetail/stationDetail.vue index c0be0a3..9975373 100644 --- a/BagStation/pages/stationDetail/stationDetail.vue +++ b/BagStation/pages/stationDetail/stationDetail.vue @@ -189,9 +189,9 @@ onLoad(option) { if(!option.item){ let siteInfos = uni.getStorageSync('siteInfo') - var oilItem = JSON.parse(siteInfos) + var oilItem = JSON.parse(decodeURIComponent(siteInfos)) }else{ - var oilItem = JSON.parse(option.item) + var oilItem = JSON.parse(decodeURIComponent(option.item)) } uni.setStorageSync('oilItem',oilItem) this.getSiteInfo(oilItem.siteId) diff --git a/pages/tabbar/home/home.vue b/pages/tabbar/home/home.vue index e0dc734..ddc1a24 100644 --- a/pages/tabbar/home/home.vue +++ b/pages/tabbar/home/home.vue @@ -553,7 +553,7 @@ } }, toDetail(item) { - let itemS = JSON.stringify(item) + let itemS = encodeURIComponent(JSON.stringify(item)) console.log(itemS) if (uni.getStorageSync('user')) { uni.navigateTo({ diff --git a/pages/tabbar/station/stationList.vue b/pages/tabbar/station/stationList.vue index ae05760..46c6f71 100644 --- a/pages/tabbar/station/stationList.vue +++ b/pages/tabbar/station/stationList.vue @@ -388,7 +388,7 @@ }, toDetail(item) { - let itemS = JSON.stringify(item) + let itemS = encodeURIComponent(JSON.stringify(item)) if (uni.getStorageSync('user')) { uni.navigateTo({ url: `/BagStation/pages/stationDetail/stationDetail?item=${itemS}`, diff --git a/utils/request.js b/utils/request.js index cfd7047..91d109e 100644 --- a/utils/request.js +++ b/utils/request.js @@ -4,11 +4,11 @@ import utils from '@/utils/encode' // const env = process.env.NODE_ENV const env = 'production'/* */ // const env = 'test' -const testUrl = 'http://192.168.0.65:38080' +const testUrl = 'http://192.168.0.45:38080' // const productUrl = 'http://121.196.213.68/adminapi' //预生产 -const productUrl = 'https://www.xingoil.com/adminapi' // 生产,加密 new -// const productUrl = 'http://uat.xingoil.com/adminapi' // 生产,加密 new +// const productUrl = 'https://www.xingoil.com/adminapi' // 生产,加密 new +const productUrl = 'http://uat.xingoil.com/adminapi' // 生产,加密 new const service = axios.create({ baseURL: env == 'production' ? productUrl : testUrl, // baseURL: testUrl,