diff --git a/App.vue b/App.vue
index 9a674d2..485b3c5 100644
--- a/App.vue
+++ b/App.vue
@@ -64,7 +64,7 @@
value: item.id
})
})
- console.log(channelCodes, productCodes, siteBrands)
+ // console.log(channelCodes, productCodes, siteBrands)
this.menuList[0].detailList = this.menuList[0].detailList.concat(channelCodes)
this.menuList[1].detailList = this.menuList[1].detailList.concat(productCodes)
this.menuList[2].detailList = this.menuList[2].detailList.concat(siteBrands)
@@ -93,146 +93,79 @@
}
}
// console.log(view.route)
- clearTimeout(loginTimer)
- clearTimeout(onlineTimer)
-
+ // 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')
-
+
let jumpUrl = '/BagAuth/pages/login/login?loginType=true'
let urlTarget = this.obtainUrlPathParameterTarget(view.$page.fullPath)
- console.log('urlTarget',urlTarget)
+ // console.log('urlTarget', urlTarget)
let target = {}
- if(urlTarget.q) {
- let originLink = decodeURIComponent(decodeURIComponent(urlTarget.q))
- target = this.obtainUrlPathParameterTarget(originLink)
- target.siteId && (jumpUrl += `?scanningParams=${decodeURIComponent(urlTarget.q)}`)
+ if (urlTarget.q) {
+ try {
+ let originLink = decodeURIComponent(decodeURIComponent(urlTarget.q))
+ target = this.obtainUrlPathParameterTarget(originLink)
+ target.siteId && (jumpUrl += `&scanningParams=${decodeURIComponent(urlTarget.q)}`)
+ } catch (e) {}
}
-
- if (token && openid) {
- this.getAmount()
- // if(!white.includes(view.route)){
- // this.getAmount()
- // }
- onlineTimer = setTimeout(() => {
- if (this.loginStatus == 'offline') {
- uni.clearStorageSync()
- uni.showModal({
- title: '需要您重新登录',
- content: this.msg,
- duration: '3000',
- success: function(res) {
- if (res.confirm) {
- uni.redirectTo({
- url: jumpUrl
- })
- }
- },
- complete: () => {
- clearTimeout(onlineTimer)
- }
- })
- }
- }, 1000)
+ if (token && openid) {
+ this.getAmount(jumpUrl)
} else {
target.siteId && uni.redirectTo({
- url: jumpUrl
- })
- // loginTimer = setTimeout(() => {
- // uni.showModal({
- // title: '请您登录',
- // content: '您还没有登录,暂时查不到油站哦',
- // duration: '3000',
- // success: function(res) {
- // if (res.confirm) {
- // uni.redirectTo({
- // url: '/BagAuth/pages/login/login'
- // })
- // }
- // }
- // })
- // }, 1000)
+ url: jumpUrl
+ })
}
-
-
}
- // }
})
},
-
+
obtainUrlPathParameterTarget(url) {
let target = {}
- if(url.includes('?')) {
+ if (url.includes('?')) {
let paramsText = url.split("?")[1]
let paramsArr = paramsText.split("&")
paramsArr.forEach(item => {
target[item.split('=')[0]] = item.split('=')[1]
})
}
- console.log('11target',target)
+ // console.log('11target', target)
return target
},
-
+
// 是否token过期或ip更改
- getAmount() {
- clearTimeout(loginTimer)
+ getAmount(jumpUrl) {
accountApi.getTotalOilCardInfo().then(res => {
- if (res.code == 20000) {
- this.loginStatus = 'online'
- } else if (res.code == 42011) {
- this.loginStatus = 'offline'
- this.msg = res.msg
+ if (res.code == 42011) {
+ uni.clearStorageSync()
+ uni.showModal({
+ title: '需要您重新登录',
+ content: res.msg,
+ duration: '3000',
+ success: (res) => {
+ if (res.confirm) {
+ uni.redirectTo({
+ url: jumpUrl
+ })
+ }
+ }
+ })
}
})
},
},
- onReady() {
-
- },
-
- onShow: function() {
- // uni.getLocation({
- // type: 'wgs84',
- // success: function(res) {
- // uni.setStorageSync('location', {
- // longitude: res.longitude + '',
- // latitude: res.latitude + ''
- // })
- // }
- // });
- // console.log('onReady')
- const token = uni.getStorageSync('Authorization')
- const openid = uni.getStorageSync('openid')
- let key = ''
- if (token && openid) {
- this.getAmount()
- key = '真在线'
- } else {
- key = '离线'
- }
- if (key == '在线') {
+ // onShow: function() {
+ // const token = uni.getStorageSync('Authorization')
+ // const openid = uni.getStorageSync('openid')
- }
- setTimeout(() => {
- // console.log(key)
- if (key == '在线') {
-
- } else {
- // uni.redirectTo({
- // url: '/BagAuth/pages/login/login'
- // })
- }
- }, 2000)
- // uni.showShareMenu()
- // console.log('App Show')
-
- },
- onHide: function() {
- // console.log('App Hide')
- }
+ // if (token && openid) {
+ // this.getAmount()
+ // }
+ // },
}
diff --git a/BagAuth/pages/login/login.vue b/BagAuth/pages/login/login.vue
index 9df523a..9c2f7c8 100644
--- a/BagAuth/pages/login/login.vue
+++ b/BagAuth/pages/login/login.vue
@@ -223,17 +223,17 @@
let user = resData.authTokenDTO.loginUser
uni.setStorageSync('user', user)
- setTimeout(() => {
- uni.showToast({
- title: res.msg,
- icon: 'none',
- complete: (err) => {
- }
- })
- }, 1000);
+ // setTimeout(() => {
+ // uni.showToast({
+ // title: res.msg,
+ // icon: 'none',
+ // complete: (err) => {
+ // }
+ // })
+ // }, 1000);
if(this.scanningParams) {
uni.redirectTo({
- url: `/BagStation/pages/stationDetail/stationDetail?q=${this.scanningParams}`
+ url: `/BagStation/pages/makeOrder/makeOrder?q=${this.scanningParams}`
})
return
}
diff --git a/BagAuth/pages/login/oldLogin.vue b/BagAuth/pages/login/oldLogin.vue
index cf5bc00..fab67b0 100644
--- a/BagAuth/pages/login/oldLogin.vue
+++ b/BagAuth/pages/login/oldLogin.vue
@@ -171,11 +171,11 @@
loginRes: {},
checked: false,
next: false,
- scanningParams:null
+ scanningParams: null
}
},
onLoad(options) {
- if(options.scanningParams) {
+ if (options.scanningParams) {
// 用于扫码进入油站详情页面
this.scanningParams = options.scanningParams
}
@@ -408,11 +408,11 @@
icon: 'none'
})
}, 1000);
- if(this.scanningParams) {
+ if (this.scanningParams && this.scanningParams !== 'null') {
uni.redirectTo({
- url: `/BagStation/pages/stationDetail/stationDetail?q=${this.scanningParams}`
+ url: `/BagStation/pages/makeOrder/makeOrder?q=${this.scanningParams}`
})
- return
+ return
}
// 这里有问题
uni.switchTab({
diff --git a/BagStation/pages/components/price-select-tab.vue b/BagStation/pages/components/price-select-tab.vue
index 0042965..7edcd28 100644
--- a/BagStation/pages/components/price-select-tab.vue
+++ b/BagStation/pages/components/price-select-tab.vue
@@ -8,26 +8,30 @@
-
+
{{item.channelCode|channelCodeFamt}}
-
+