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.

51 lines
1.2 KiB
Vue

This file contains ambiguous Unicode characters!

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
* usersa0ChunLuyu
* date2022-04-20 09:02:17
*/
import {
ref
} from 'vue'
const user_info = ref('')
const updateUserInfo = (res) => {
wx.getUserProfile({
desc: '新用户完善用户资料',
success: (res) => {
let d = res.userInfo
user_info.value = JSON.stringify(d, null, 4)
drawer_ref.value.open()
}
})
}
const drawer_ref = ref(null)
const drawerRef = (e) => {
drawer_ref.value = e
}
const copyContent = () => {
uni.setClipboardData({
data: user_info.value
})
}
</script>
<template>
<uni-drawer :ref="drawerRef" mode="right">
<view class="navbar_wrapper"></view>
<textarea :maxlength="-1" class="textarea_wrapper" v-model="user_info" />
<button size="mini" @click="copyContent()">复制</button>
</uni-drawer>
<uni-section title="用户信息" type="line">
<view class="uni-ma-5 uni-pb-5 example_item_wrapper">
<button size="mini" class="open_type_button_wrapper" @tap="updateUserInfo" withCredentials="true"></button>
</view>
</uni-section>
</template>
<style scoped>
.textarea_wrapper {
margin-top: 100rpx;
height: 400rpx;
}
</style>