KongDuo
xiaozhiyong 2 years ago
parent 0f72d67b2e
commit 91895c9265
  1. 49
      BagAuth/pages/login/login.vue
  2. 7
      BagAuth/pages/login/oldLogin.vue
  3. 4
      BagStation/pages/stationDetail/stationDetail.vue

@ -99,16 +99,14 @@
} }
}, },
onLoad(option) { onLoad(option) {
if(option){ if(option.companyId === '1460872936910831616'){
if(option.companyId === '1460872936910831616'){ this.otherUser = true
this.otherUser = true uni.clearStorageSync()
uni.clearStorageSync() this.weChatLogin(option)
this.weChatLogin(option) // console.log('')
// console.log('') return
return
}
} }
let IsOtherUser = uni.getStorageSync('isOther') let IsOtherUser = uni.getStorageSync('isOther')
// console.log('onload',IsOtherUser) // console.log('onload',IsOtherUser)
if(IsOtherUser){ if(IsOtherUser){
@ -119,6 +117,7 @@
this.otherUser = true this.otherUser = true
return return
} else{ } else{
this.weChatLogin() this.weChatLogin()
} }
// console.log('onLoad----') // console.log('onLoad----')
@ -132,11 +131,10 @@
methods: { methods: {
weChatLogin(option){ weChatLogin(option){
let isJump = uni.getStorageSync('isJump'); let isJump = uni.getStorageSync('isJump');
let siteId = uni.getStorageSync('siteId')
uni.clearStorageSync(); uni.clearStorageSync();
if(isJump){ if(isJump) uni.setStorageSync('isJump',isJump)
uni.setStorageSync('isJump',isJump) if(siteId) uni.setStorageSync('siteId',siteId)
}
this.refreshLocation() this.refreshLocation()
let _that = this let _that = this
uni.login({ uni.login({
@ -144,15 +142,15 @@
success: (loginRes) => { success: (loginRes) => {
const code = loginRes.code const code = loginRes.code
this.onceCode = code this.onceCode = code
console.log('这里是code') // console.log('code')
console.log(this.onceCode) // console.log(this.onceCode)
oilIdentityApi.sendCode(this.onceCode).then(res => { oilIdentityApi.sendCode(this.onceCode).then(res => {
if (res.code === 20000) { if (res.code === 20000) {
console.log('这里是sendCode',res) // console.log('sendCode',res)
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)
console.log('这里是213','++++++') // console.log('213','++++++')
if(option){ if(option){
if(option.companyId == '1460872936910831616'){ if(option.companyId == '1460872936910831616'){
let sysCustomerInfos = { let sysCustomerInfos = {
@ -169,17 +167,17 @@
} }
uni.setStorageSync('isOther',_that.otherUser) uni.setStorageSync('isOther',_that.otherUser)
uni.setStorageSync('otherUserInfo',sysCustomerInfos) uni.setStorageSync('otherUserInfo',sysCustomerInfos)
console.log('此处为data参数:',data) // console.log('data',data)
console.log('当前为卡利用户:companyId 为',sysCustomerInfos.companyId) // console.log('companyId ',sysCustomerInfos.companyId)
oilIdentityApi.wechatLogin(data).then(res=>{ oilIdentityApi.wechatLogin(data).then(res=>{
console.log('这里是wechatLogin',res) // console.log('wechatLogin',res)
this.OtherloginSuccess(res) this.OtherloginSuccess(res)
console.log(res) // console.log(res)
}) })
return return
} }
}else{ }else{
console.log('这里是213','----') // console.log('213','----')
this.autoLogin() this.autoLogin()
} }
// uni.setStorageSync('isOther',_that.otherUser) // uni.setStorageSync('isOther',_that.otherUser)
@ -312,6 +310,13 @@
} }
}) })
}, 1000); }, 1000);
let siteId = uni.getStorageSync('siteId')
if(siteId) {
uni.redirectTo({
url: `/BagStation/pages/stationDetail/stationDetail?siteId=${siteId}`
})
return
}
// //
uni.switchTab({ uni.switchTab({
url: '/pages/tabbar/home/home' url: '/pages/tabbar/home/home'

@ -351,6 +351,13 @@
icon: 'none' icon: 'none'
}) })
}, 1000); }, 1000);
let siteId = uni.getStorageSync('siteId')
if(siteId) {
uni.redirectTo({
url: `/BagStation/pages/stationDetail/stationDetail?siteId=${siteId}`
})
return
}
// //
uni.switchTab({ uni.switchTab({
url: '/pages/tabbar/home/home' url: '/pages/tabbar/home/home'

@ -217,8 +217,8 @@
this.innerAudioContext?.stop() this.innerAudioContext?.stop()
}, },
onLoad(option) { onLoad(option) {
let siteId = uni.getStorageSync('siteId') || option.siteId // let siteId = uni.getStorageSync('siteId') ||
if(siteId) { if(option.siteId) {
uni.setStorageSync('siteId',siteId) uni.setStorageSync('siteId',siteId)
this.siteId = siteId this.siteId = siteId
this.getSiteInfo(siteId) this.getSiteInfo(siteId)

Loading…
Cancel
Save