You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
< script setup >
/**
* name:
* user: sa0ChunLuyu
* date: 2023年6月8日 19:26:33
*/
import {
ref
} from 'vue'
import {
$response
} from '@/api'
import {
onShow
} from '@dcloudio/uni-app'
import {
setToken
} from '@/lu/token.js'
const $props = defineProps ( {
token : {
type : String ,
default : ''
} ,
page : {
type : String ,
default : 'home'
} ,
orderid : {
type : String ,
default : ''
} ,
param : {
type : String ,
default : ''
} ,
hospital : {
type : String ,
default : '0'
}
} ) ;
const tip _content = ref ( '正在校验' )
const getUserInfo = ( ) => {
setToken ( $props . token )
uni . $lu . user ( ( info ) => {
if ( ! ! info . id ) {
tip _content . value = '登录成功'
let param = decodeURIComponent ( $props . param )
let page = ! ! $props . page ? $props . page : 'home'
let orderid = ! ! $props . orderid ? $props . orderid : ''
param = ! ! param ? '&' + param : ''
uni . reLaunch ( {
url : ` /pages/main/ ${ page } / ${ page } ?hospital= ${ $props . hospital } ${ param } &orderid= ${ $props . orderid } `
} )
} else {
tip _content . value = '登录失败'
}
} , ( ) => {
tip _content . value = '登录失败'
} )
}
onShow ( ( ) => {
getUserInfo ( )
} )
< / script >
< template >
< view >
< view class = "tip_wrapper" > { { tip _content } } < / view >
< / view >
< / template >
< style scoped >
. tip _wrapper {
position : fixed ;
top : 40 % ;
left : 50 % ;
transform : translate ( - 50 % , - 50 % ) ;
font - size : 30 rpx ;
font - weight : bold ;
}
< / style >