Commit 9e4ff0cf by 张立顺

线上二维码bug修复

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