Commit 9e4ff0cf by 张立顺

线上二维码bug修复

1 parent 3fb5ed9f
......@@ -84,7 +84,7 @@
hover-class="btn-hover"
open-type="getPhoneNumber"
bindgetphonenumber="wxLogin"
loading="{{loading}}">微信登录
loading="{{loading}}">授权登录
</button>
</block>
<block wx:else>
......
......@@ -15,19 +15,19 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) { },
onLoad(options) {},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() { },
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
const appEnter = wx.getEnterOptionsSync()
console.log(appEnter,'appEnter');
console.log(appEnter, 'appEnter')
if (appEnter.scene == 1037) {
if (Object.keys(appEnter.referrerInfo).length) {
const { extraData } = appEnter.referrerInfo
......@@ -36,51 +36,53 @@ Page({
} else this.init()
} else if ([1047, 1048, 1049].includes(appEnter.scene)) {
// debugger
console.log(!this.options.scene,this.options,'!this.options.scene');
console.log(!this.options.scene, this.options, '!this.options.scene')
if (!this.options.scene) {
this.init()
return
}
sceneByIdApi({
id: decodeURIComponent(appEnter.query.scene).split('=')[1]
}).then(res => {
const url = res.scene
const obj = this.arrToObj(url.split('&'))
if (obj.hasOwnProperty('userName') && obj.hasOwnProperty('password')) {
wx.$storage.rm("sessionId")
wx.$storage.rm("userInfo")
wx.$storage.rm("auto_login_object")
wx.$storage.rm("posterId")
wx.$storage.rm("mock_data")
wx.$storage.set("firstLogin", "firstLogin")
wx.$storage.set("disLikeRecordFlag", true)
this.accountLogin(obj)
} else this.init()
}).catch(() => {
this.init()
})
.then(res => {
const url = res.scene
const obj = this.arrToObj(url.split('&'))
if (obj.hasOwnProperty('userName') && obj.hasOwnProperty('password')) {
wx.$storage.rm('sessionId')
wx.$storage.rm('userInfo')
wx.$storage.rm('auto_login_object')
wx.$storage.rm('posterId')
wx.$storage.rm('mock_data')
wx.$storage.set('firstLogin', 'firstLogin')
wx.$storage.set('disLikeRecordFlag', true)
this.accountLogin(obj)
} else this.init()
})
.catch(() => {
this.init()
})
} else this.init()
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() { },
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() { },
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() { },
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() { },
onReachBottom() {},
arrToObj(list) {
if (!Array.isArray(list)) {
return {}
......@@ -167,35 +169,37 @@ Page({
userName: obj.userName,
password: md5(obj.password)
}
USERAPI.accountLogin(params).then(({ code, data, message }) => {
if (code == '0') {
const { sessionId, loginUserInfoList } = data
var routeParams = {}
var list = []
console.log(obj,'obj');
if (obj.url == '/packagesList/packageOutput/pages/summary') {
routeParams = {
merchantId: obj.merchantId,
merchantName: obj.merchantName,
pMerchantId: loginUserInfoList[0].subLoginUser.merchantId,
pMerchantName: loginUserInfoList[0].subLoginUser.merchantName,
isSuper: loginUserInfoList[0].isSuper,
fixScenceCode: obj.sceneCode
USERAPI.accountLogin(params)
.then(({ code, data, message }) => {
if (code == '0') {
const { sessionId, loginUserInfoList } = data
var routeParams = {}
var list = []
console.log(obj, 'obj')
if (obj.url == '/packagesList/packageOutput/pages/summary') {
routeParams = {
merchantId: obj.merchantId,
merchantName: obj.merchantName,
pMerchantId: loginUserInfoList[0].subLoginUser.merchantId,
pMerchantName: loginUserInfoList[0].subLoginUser.merchantName,
isSuper: loginUserInfoList[0].isSuper,
fixScenceCode: obj.sceneCode
}
Object.keys(routeParams).forEach(item => {
list.push(item + '=' + routeParams[item])
})
this.options.targetPath = obj.url + '?' + list.join('&')
// this.options.targetPath = '/pages/tab/output/output' + "?" + list.join("&")
this.options.targetPath = '/pages/tab/outputValue/outputValue' + '?' + list.join('&')
}
Object.keys(routeParams).forEach((item) => {
list.push(item + "=" + routeParams[item])
})
this.options.targetPath = obj.url + "?" + list.join("&")
this.options.targetPath = '/pages/tab/output/output' + "?" + list.join("&")
setLoginInfo(loginUserInfoList[0], sessionId)
} else {
wx.$api.showToast(message || '系统异常')
setTimeout(() => {
wx.$router.reLaunch('login.index')
}, 1e3)
}
setLoginInfo(loginUserInfoList[0], sessionId)
} else {
wx.$api.showToast(message || '系统异常')
setTimeout(() => {
wx.$router.reLaunch('login.index')
}, 1e3)
}
})
})
.catch(err => {
wx.$api.showToast('系统异常')
setTimeout(() => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!