百川更新

This commit is contained in:
2023-09-20 16:04:55 +08:00
parent d7d1fc5ae5
commit eade32dca7
8 changed files with 104 additions and 43 deletions

View File

@@ -89,26 +89,27 @@
loginRes: {},
sessionKey: '',
nickName: '',
loginOut: uni.getStorageSync('loginOut') ? true : false
loginOut: uni.getStorageSync('loginOut') ? true : false,
scanningParams:null
}
},
onLoad(e) {
if(e.loginType){
this.loginType = Boolean(e.loginType);
console.log(e.loginType,'e.loginType')
}
uni.clearStorageSync()
// this.refreshLocation()
uni.login({
provider: 'weixin',
success: (loginRes) => {
console.log(loginRes, '+++++++')
const code = loginRes.code
this.onceCode = code
console.log(this.onceCode, '----------')
this.onceCode = code
oilIdentityApi.sendCode(this.onceCode).then(res => {
console.log(res, '++++++++++++++++')
if (res.code === 20000) {
if(e.scanningParams) {
// 用于扫码进入油站详情页面
this.scanningParams = e.scanningParams
}
this.sessionKey = res.data.sessionKey
uni.setStorageSync('openid', res.data.openId)
uni.setStorageSync('unionid', res.data.unionId)
@@ -125,7 +126,6 @@
}
}).catch(err => {
console.log(err)
uni.reLaunch({
url: '/BagAuth/pages/login/boforeLogin/boforeLogin',
fail: (err) => {
@@ -170,7 +170,7 @@
},
refuseEmpower() {
uni.navigateTo({
url: '/BagAuth/pages/login/oldLogin'
url: `/BagAuth/pages/login/oldLogin?scanningParams=${this.scanningParams}`
})
},
@@ -184,7 +184,6 @@
})
return
}
// console.log(e.detail)
if (e.detail.errMsg === 'getPhoneNumber:ok') {
const data1 = {
...e.detail,
@@ -204,7 +203,6 @@
bindLoginByPhone(data, url) {
if (this.count < 1) {
oilIdentityApi.bindLoginByPhone(data, url).then(res => {
console.log(res)
if (res.code == 20000) {
this.loginSuccess(res)
}
@@ -230,20 +228,23 @@
title: res.msg,
icon: 'none',
complete: (err) => {
// console.log(err)
}
})
}, 1000);
if(this.scanningParams) {
uni.redirectTo({
url: `/BagStation/pages/stationDetail/stationDetail?q=${this.scanningParams}`
})
return
}
// 这里有问题
uni.switchTab({
url: '/pages/tabbar/home/home'
})
}else{
console.log(this.loginType,'loginTypeloginTypeloginType')
if(!this.loginType){
this.refuseLogin()
}
console.log('禁摩登录i失败==================')
}
},
}

View File

@@ -170,7 +170,14 @@
count: 0,
loginRes: {},
checked: false,
next: false
next: false,
scanningParams:null
}
},
onLoad(options) {
if(options.scanningParams) {
// 用于扫码进入油站详情页面
this.scanningParams = options.scanningParams
}
},
onShow() {},
@@ -401,6 +408,12 @@
icon: 'none'
})
}, 1000);
if(this.scanningParams) {
uni.redirectTo({
url: `/BagStation/pages/stationDetail/stationDetail?q=${this.scanningParams}`
})
return
}
// 这里有问题
uni.switchTab({
url: '/pages/tabbar/home/home'