Przeglądaj źródła

修改中转页登录bug

master
yangteng 1 rok temu
rodzic
commit
d732e4436c

+ 12
- 2
login/login.vue Wyświetl plik

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

onLoad((option) => {
if (option.back == 1) {
state.back = option.back
}
if (option.back == 2) {
state.back = option.back
state.params = JSON.parse(decodeURIComponent(option.params))
}
uni.$on("login", (data) => {
state.username = data.phone;
});
@@ -177,7 +182,12 @@
uni.navigateBack({
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({
url: '/pages/index/index'
})

+ 54
- 65
subpackage/after-sale/transfer-page.vue Wyświetl plik

@@ -5,7 +5,7 @@

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

onLoad((options) => {
console.log("options",options)
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) => {
console.log("item====", item, item.data.length)
if (item.data.length == 1) {
@@ -76,60 +115,10 @@
})
}, 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 = () => {
if (state.userType == "1") {
var data = {
@@ -284,4 +273,4 @@

<style scoped>

</style>
</style>

+ 1
- 1
subpackage/personal-center/install-activation-order.vue Wyświetl plik

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


+ 1
- 1
utils/network/request.js Wyświetl plik

@@ -93,7 +93,6 @@ export function request(code, options = {}, start = false) {
'content-type': contentType,
'Access-Token': getItem(StorageKeys.Token)
}
console.log('code', code, options.data)
if (!start) {
//判断code不为空
if (code) {
@@ -103,6 +102,7 @@ export function request(code, options = {}, start = false) {
}), 2);
}
}
console.log('code', code, options.data)
//是否显示加载中
if (options.showLoading) {
uni.showLoading({

Ładowanie…
Anuluj
Zapisz