xiaozy_优化 #6
20
App.vue
20
App.vue
@@ -134,14 +134,17 @@
|
|||||||
const openid = uni.getStorageSync('openid')
|
const openid = uni.getStorageSync('openid')
|
||||||
|
|
||||||
let jumpUrl = '/BagAuth/pages/login/login'
|
let jumpUrl = '/BagAuth/pages/login/login'
|
||||||
let urlTarget = this.obtainUrlPathParameterTarget(view.$page.fullPath)
|
|
||||||
console.log('urlTarget',urlTarget)
|
|
||||||
let target = {}
|
let target = {}
|
||||||
if(urlTarget.q) {
|
|
||||||
let originLink = decodeURIComponent(decodeURIComponent(urlTarget.q))
|
// if(view.route === 'BagStation/pages/stationDetail/stationDetail') {
|
||||||
target = this.obtainUrlPathParameterTarget(originLink)
|
// let urlTarget = this.obtainUrlPathParameterTarget(view.$page.fullPath)
|
||||||
target.siteId && (jumpUrl += `?scanningParams=${decodeURIComponent(urlTarget.q)}`)
|
// if(urlTarget.q) {
|
||||||
}
|
// let originLink = decodeURIComponent(decodeURIComponent(urlTarget.q))
|
||||||
|
// target = this.obtainUrlPathParameterTarget(originLink)
|
||||||
|
// target.siteId && (jumpUrl += `?scanningParams=${decodeURIComponent(urlTarget.q)}`)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
// console.log('jumpUrl',jumpUrl)
|
// console.log('jumpUrl',jumpUrl)
|
||||||
if (token && openid) {
|
if (token && openid) {
|
||||||
this.getAmount()
|
this.getAmount()
|
||||||
@@ -277,6 +280,9 @@
|
|||||||
},
|
},
|
||||||
onHide: function() {
|
onHide: function() {
|
||||||
// console.log('App Hide')
|
// console.log('App Hide')
|
||||||
|
},
|
||||||
|
onUnload:function() {
|
||||||
|
uni.removeStorageSync('scanningParams')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -153,11 +153,16 @@
|
|||||||
sessionKey: '',
|
sessionKey: '',
|
||||||
nickName: '',
|
nickName: '',
|
||||||
loginOut: uni.getStorageSync('loginOut') ? true : false,
|
loginOut: uni.getStorageSync('loginOut') ? true : false,
|
||||||
scanningParams:null
|
// scanningParams:null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
|
let scanningParamsLocale = uni.getStorageSync('scanningParams')
|
||||||
uni.clearStorageSync()
|
uni.clearStorageSync()
|
||||||
|
if(scanningParamsLocale || options.scanningParams) {
|
||||||
|
// 用于扫码进入油站详情页面
|
||||||
|
uni.setStorageSync('scanningParams',options.scanningParams || scanningParamsLocale)
|
||||||
|
}
|
||||||
this.refreshLocation()
|
this.refreshLocation()
|
||||||
uni.login({
|
uni.login({
|
||||||
provider: 'weixin',
|
provider: 'weixin',
|
||||||
@@ -166,10 +171,6 @@
|
|||||||
this.onceCode = code
|
this.onceCode = code
|
||||||
oilIdentityApi.sendCode(this.onceCode).then(res => {
|
oilIdentityApi.sendCode(this.onceCode).then(res => {
|
||||||
if (res.code === 20000) {
|
if (res.code === 20000) {
|
||||||
if(options.scanningParams) {
|
|
||||||
// 用于扫码进入油站详情页面
|
|
||||||
this.scanningParams = options.scanningParams
|
|
||||||
}
|
|
||||||
this.sessionKey = res.data.sessionKey
|
this.sessionKey = res.data.sessionKey
|
||||||
uni.setStorageSync('openid', res.data.openId)
|
uni.setStorageSync('openid', res.data.openId)
|
||||||
uni.setStorageSync('unionid', res.data.unionId)
|
uni.setStorageSync('unionid', res.data.unionId)
|
||||||
@@ -225,7 +226,7 @@
|
|||||||
},
|
},
|
||||||
refuseEmpower() {
|
refuseEmpower() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/BagAuth/pages/login/oldLogin?scanningParams=${this.scanningParams}`
|
url: '/BagAuth/pages/login/oldLogin'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -280,9 +281,10 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}, 1000);
|
}, 1000);
|
||||||
if(this.scanningParams) {
|
let scanningParams = uni.getStorageSync('scanningParams')
|
||||||
|
if(scanningParams) {
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: `/BagStation/pages/stationDetail/stationDetail?q=${this.scanningParams}`
|
url: `/BagStation/pages/stationDetail/stationDetail?q=${scanningParams}`
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -172,13 +172,6 @@
|
|||||||
loginRes: {},
|
loginRes: {},
|
||||||
checked: false,
|
checked: false,
|
||||||
next: false,
|
next: false,
|
||||||
scanningParams:null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad(options) {
|
|
||||||
if(options.scanningParams) {
|
|
||||||
// 用于扫码进入油站详情页面
|
|
||||||
this.scanningParams = options.scanningParams
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {},
|
onShow() {},
|
||||||
@@ -409,9 +402,11 @@
|
|||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
}, 1000);
|
}, 1000);
|
||||||
if(this.scanningParams) {
|
|
||||||
|
let scanningParams = uni.getStorageSync('scanningParams')
|
||||||
|
if(scanningParams) {
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: `/BagStation/pages/stationDetail/stationDetail?q=${this.scanningParams}`
|
url: `/BagStation/pages/stationDetail/stationDetail?q=${scanningParams}`
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -188,16 +188,9 @@
|
|||||||
|
|
||||||
|
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
// console.log('option',option)
|
|
||||||
// let userInfo = uni.getStorageSync('user')
|
|
||||||
// if(!userInfo && option.q) {
|
|
||||||
// uni.redirectTo({
|
|
||||||
// url: `/BagAuth/pages/login/login?scanningParams=${option.q}`
|
|
||||||
// })
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
|
|
||||||
if(option.q) {
|
if(option.q) {
|
||||||
|
uni.setStorageSync('scanningParams',option.q)
|
||||||
let originLink = decodeURIComponent(option.q)
|
let originLink = decodeURIComponent(option.q)
|
||||||
let target = this.obtainUrlPathParameterTarget(originLink)
|
let target = this.obtainUrlPathParameterTarget(originLink)
|
||||||
console.log('target',target)
|
console.log('target',target)
|
||||||
|
|||||||
@@ -567,7 +567,7 @@
|
|||||||
} else {
|
} else {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title:'请您登录',
|
title:'请您登录',
|
||||||
content:"登录小星加油才可以加油 |˛˙꒳˙)♡",
|
content:"登录中品加油才可以加油 |˛˙꒳˙)♡",
|
||||||
confirmText:'去登陆',
|
confirmText:'去登陆',
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
if(res.confirm){
|
if(res.confirm){
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import utils from '@/utils/encode'
|
|||||||
// const env = process.env.NODE_ENV
|
// const env = process.env.NODE_ENV
|
||||||
// const env = 'production'/* */
|
// const env = 'production'/* */
|
||||||
const env = 'production'
|
const env = 'production'
|
||||||
const testUrl = 'http://192.168.110.230:38080'
|
const testUrl = 'http://192.168.110.10:38080'
|
||||||
// const productUrl = 'http://121.196.213.68/adminapi' //预生产
|
// const productUrl = 'http://121.196.213.68/adminapi' //预生产
|
||||||
|
|
||||||
// const productUrl = 'https://www.xingoil.com/adminapi' // 生产,加密 new
|
// const productUrl = 'https://www.xingoil.com/adminapi' // 生产,加密 new
|
||||||
|
|||||||
Reference in New Issue
Block a user