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: 2022-04-20 09:02:17
*/
import {
ref
} from 'vue'
const user _phone = ref ( '' )
const user _phone _show = ref ( false )
const phoneLoginButtonClick = ( e ) => {
uni . login ( {
provider : 'weixin' ,
success : ( loginRes ) => {
let d = {
code : loginRes . code ,
iv : e . detail . iv ,
encrypted _data : e . detail . encryptedData ,
}
user _phone . value = JSON . stringify ( d , null , 4 )
user _phone _show . value = true
} ,
} ) ;
}
const copyContent = ( ) => {
uni . setClipboardData ( {
data : user _phone . value
} )
}
< / script >
< template >
< u -modal title = "内容" v-model ="user_phone_show" :show-cancel-button="true" confirm-text="复制" cancel-text="关闭"
@confirm="copyContent">
<view class="slot-content">
<textarea :maxlength="-1" class="textarea_wrapper" v-model="user_phone" />
</view>
</u-modal>
<u-tr>
<u-td>用户手机号</u-td>
<u-td></u-td>
<u-td>
<button class="open_type_button_wrapper" open-type="getPhoneNumber" @getphonenumber="phoneLoginButtonClick"
withCredentials="true" > 获 取 手 机 号 < / button >
< / u -td >
< / u - t r >
< / template >
< style scoped >
. textarea _wrapper {
height : 200 rpx ;
}
. open _type _button _wrapper {
width : 140 rpx ;
height : 40 rpx ;
line - height : 40 rpx ;
font - size : 16 rpx ;
}
< / style >