瀏覽代碼

运维没登录跳转过来得处理

腾讯ocr渠道不签约
yangteng 1 年之前
父節點
當前提交
200e9879c3
共有 2 個文件被更改,包括 76 次插入15 次删除
  1. 12
    2
      login/login.vue
  2. 64
    13
      subpackage/after-sale/transfer-page.vue

+ 12
- 2
login/login.vue 查看文件

@@ -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'
})

+ 64
- 13
subpackage/after-sale/transfer-page.vue 查看文件

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

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

onLoad((options) => {
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)
silentLogin().then(() => {
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
quanCheckActionTrue().then((item : any) => {
console.log("item====", item, item.data.length)
if (item.data.length == 1) {
@@ -73,10 +76,58 @@
})
}, 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 = () => {

Loading…
取消
儲存