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年8月14日 06:41:42
*/
import {
ref
} from 'vue'
import {
WeChatLoginTestAction ,
GzhConfig ,
$response
} from '@/api'
import {
onShow
} from '@dcloudio/uni-app'
const $props = defineProps ( {
code : {
type : String ,
default : ''
}
} ) ;
const user _code = ref ( '' )
const WeChatLoginTest = async ( ) => {
const response = await WeChatLoginTestAction ( {
code : $props . code ,
app _id : GzhConfig . id
} )
$response ( response , ( ) => {
user _code . value = JSON . stringify ( response . data . info , null , 4 )
} )
}
const copyContent = ( ) => {
uni . setClipboardData ( {
data : user _code . value
} )
}
const toHome = ( ) => {
uni . switchTab ( {
url : '/pages/main/index/index'
} )
}
onShow ( ( ) => {
WeChatLoginTest ( )
} )
< / script >
< template >
< view >
< textarea :maxlength ="-1" class = "textarea_wrapper" v-model ="user_code" />
<view class="button_line_wrapper">
<button size="mini" @click="copyContent()">复制</button>
<button size="mini" @click="toHome()">首页</button>
</view>
<view class="bottom_blank_wrapper" > < / view >
< / view >
< / template >
< style scoped >
. button _line _wrapper {
display : flex ;
justify - content : space - around ;
}
. textarea _wrapper {
margin - top : 100 rpx ;
height : 400 rpx ;
margin : 0 auto ;
}
< / style >