Przeglądaj źródła

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

腾讯ocr渠道不签约
yangteng 1 rok temu
rodzic
commit
200e9879c3
2 zmienionych plików z 76 dodań i 15 usunięć
  1. 12
    2
      login/login.vue
  2. 64
    13
      subpackage/after-sale/transfer-page.vue

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

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

+ 64
- 13
subpackage/after-sale/transfer-page.vue Wyświetl plik



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


onLoad((options) => { 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) => { 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 = () => {

Ładowanie…
Anuluj
Zapisz