【bug】 bug修改 微信扫描二维码签到登录后跳转的问题

This commit is contained in:
fengachen
2022-01-07 14:56:47 +08:00
parent 877622c36b
commit 878f8b52ec
9 changed files with 240 additions and 103 deletions
+53 -13
View File
@@ -1,7 +1,8 @@
import UserApi from '../../assets/js/http/userApi'
import {baseUrl, URL_CONFIG} from '../../assets/js/project.config.js'
import {
isLogin
isLogin,
isLoginSignIn
} from '../../assets/js/common'
Page({
@@ -80,10 +81,10 @@ Page({
// 微信扫码 判断是否登录
if(options.q) {
let url = decodeURIComponent(options.q)
let meetingId = url.split('=')[1]
// 登录过的就直接签到 否则跳转登录页
isLogin( () => {
let url = decodeURIComponent(options.q)
let meetingId = url.split('=')[1]
isLoginSignIn( () => {
// 通过会议id 获取签到信息
UserApi.scanCode({
meetingId
@@ -115,7 +116,8 @@ Page({
})
}
}).catch(err => {})
})
},meetingId)
}
// 这里是会议详情的跳转签到
if(options.type === 'meetingDetail'){
@@ -123,10 +125,10 @@ Page({
UserApi.scanCode({
meetingId
}).then(res => {
wx.showToast({
title: '获取签到信息...',
icon: 'loading'
})
// wx.showToast({
// title: '获取签到信息...',
// icon: 'loading'
// })
if (res.success) {
that.setData({
form:res.result
@@ -148,10 +150,10 @@ Page({
that.setData({
form:res.result
})
wx.showToast({
title: '未查到报名信息...',
icon: 'loading'
})
// wx.showToast({
// title: '未查到报名信息...',
// icon: 'loading'
// })
// 未查到报名信息
that.setData({
isSigned: 0,
@@ -178,6 +180,44 @@ Page({
form
})
}
// 这里是微信扫描失败 重新登录后 跳转签到页面执行的逻辑 isLoginSignIn是会议id
if(options.isLoginSignIn){
//请出缓存中的 isLoginSignIn 防止下次登录出现问题
wx.removeStorage({
key: 'isLoginSignIn',
})
let meetingId = options.isLoginSignIn
UserApi.scanCode({
meetingId
}).then(res => {
if (res.success) {
that.setData({
form:res.result
})
let src
if(res.result.checkFile){ // 签到名回显
src = baseUrl + URL_CONFIG + 'sys/common/download/' + res.result.checkFile
}else{
src = ''
}
this.setData({
isSigned: 1,
src
})
// wx.navigateTo({ // 已报名
// url: `../scanSign/scanSign?signed=1&meeting=${result}`,
// })
} else {
that.setData({
form:res.result
})
// 未查到报名信息
that.setData({
isSigned: 0,
})
}
}).catch(err => {})
}
},
/**