Procházet zdrojové kódy

修改中转页登录bug

master
yangteng před 1 rokem
rodič
revize
d732e4436c

+ 12
- 2
login/login.vue Zobrazit soubor

username: "", //用户名 username: "", //用户名
password: "", //密码 password: "", //密码
code: "", //验证码 code: "", //验证码
back: 0, //从app扫码看协议过来 登录了 还需要回到手机号验证页面 0 是原本的登录 1 要回去的登录
back: 0, //从app扫码看协议过来 登录了 还需要回到手机号验证页面 0 是原本的登录 1 要回去的登录 2运维跳转过来得中转页
params:{}
}); });


onLoad((option) => { onLoad((option) => {
if (option.back == 1) { if (option.back == 1) {
state.back = option.back state.back = option.back
} }
if (option.back == 2) {
state.back = option.back
state.params = JSON.parse(decodeURIComponent(option.params))
}
uni.$on("login", (data) => { uni.$on("login", (data) => {
state.username = data.phone; state.username = data.phone;
}); });
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1
}) })
} else {
} else if (state.back == 2) {
const params = encodeURIComponent(JSON.stringify(state.params))
uni.redirectTo({
url:`/subpackage/after-sale/transfer-page?params=${params}`
})
} else{
uni.switchTab({ uni.switchTab({
url: '/pages/index/index' url: '/pages/index/index'
}) })

+ 54
- 65
subpackage/after-sale/transfer-page.vue Zobrazit soubor



<script setup lang="ts"> <script setup lang="ts">
import { reactive } from "vue"; import { reactive } from "vue";
import { onLoad,onShow } from "@dcloudio/uni-app";
import { onLoad } from "@dcloudio/uni-app";
import { import {
navTo navTo
} from "@/utils/utils" } from "@/utils/utils"
// 31发票 32月结单查询 // 31发票 32月结单查询


onLoad((options) => { onLoad((options) => {
console.log("options",options)
if(options.params){ if(options.params){
let params=JSON.parse(decodeURIComponent(options.params))
// 登录回来
console.log("options",params)
state.type = params.type
state.name = params.name
state.vehicleId = params.vehicleId
state.deptShortName = params.deptShortName
state.userType = params.userType
state.userIdNum = params.userIdNum
state.mobile = params.mobile
let params=JSON.parse(decodeURIComponent(options.params))
// 登录回来
console.log("options",params)
state.type = params.type
state.name = params.name
state.vehicleId = params.vehicleId
state.deptShortName = params.deptShortName
state.userType = params.userType
state.userIdNum = params.userIdNum
state.mobile = params.mobile
judge()
}else{
// 不需要登录
state.type = options.type
state.name = options.name
state.vehicleId = options.vehicleId
state.deptShortName = options.deptShortName
state.userType = options.userType
state.userIdNum = options.userIdNum
state.mobile = options.mobile
console.log("options", options)
if((options.userType && state.userIdNum) || (options.userType && state.mobile)){
// 登录情况
silentLogin().then(() => {
judge()
})
}else{
let obj={
type:state.type,
name:state.name,
vehicleId:state.vehicleId,
deptShortName:state.deptShortName,
userType:state.userType,
userIdNum:state.userIdNum,
mobile:state.mobile,
}
const params = encodeURIComponent(JSON.stringify(obj))
// 没登录情况
uni.navigateTo({
url: `/login/login?back=2&params=${params}`,
})
}
}
})
// 判断哪些需要跳转
const judge=()=>{
if(state.type == "9" || state.type == "20" || state.type == "23" || state.type == "25" || state.type == "28" || state.type == "31"){
jump()
}else{
quanCheckActionTrue().then((item : any) => { quanCheckActionTrue().then((item : any) => {
console.log("item====", item, item.data.length) console.log("item====", item, item.data.length)
if (item.data.length == 1) { if (item.data.length == 1) {
}) })
}, 1500) }, 1500)
} }
}) })
}else{
// 不需要登录
state.type = options.type
state.name = options.name
state.vehicleId = options.vehicleId
state.deptShortName = options.deptShortName
state.userType = options.userType
state.userIdNum = options.userIdNum
state.mobile = options.mobile
console.log("options", options)
if((options.userType && state.userIdNum) || options.userType && state.mobile){
// 登录情况
silentLogin().then(() => {
quanCheckActionTrue().then((item : any) => {
console.log("item====", item, item.data.length)
if (item.data.length == 1) {
state.id = item.data[0]['id']
state.orderId = item.data[0]['orderId']
console.log(item)
jump()
} else {
msg('暂无车辆')
setTimeout(() => {
uni.switchTab({
url: "/pages/index/index"
})
}, 1500)
}
})
})
}else{
let obj={
type:state.type,
name:state.name,
vehicleId:state.vehicleId,
deptShortName:state.deptShortName,
userType:state.userType,
userIdNum:state.userIdNum,
mobile:state.mobile,
}
const params = encodeURIComponent(JSON.stringify(obj))
// 没登录情况
uni.navigateTo({
url: `/login/login?back=2&params=${params}`,
})
}
} }

})
}
const silentLogin = () => { const silentLogin = () => {
if (state.userType == "1") { if (state.userType == "1") {
var data = { var data = {


<style scoped> <style scoped>


</style>
</style>

+ 1
- 1
subpackage/personal-center/install-activation-order.vue Zobrazit soubor

uni.$on('refreshOrder', (data) => { uni.$on('refreshOrder', (data) => {
refreshList(); refreshList();
}); });
console.log("guoliale ")
refreshList(); refreshList();
}); });



+ 1
- 1
utils/network/request.js Zobrazit soubor

'content-type': contentType, 'content-type': contentType,
'Access-Token': getItem(StorageKeys.Token) 'Access-Token': getItem(StorageKeys.Token)
} }
console.log('code', code, options.data)
if (!start) { if (!start) {
//判断code不为空 //判断code不为空
if (code) { if (code) {
}), 2); }), 2);
} }
} }
console.log('code', code, options.data)
//是否显示加载中 //是否显示加载中
if (options.showLoading) { if (options.showLoading) {
uni.showLoading({ uni.showLoading({

Načítá se…
Zrušit
Uložit