分享页面分享链接点击复制
This commit is contained in:
parent
7fec77bc9d
commit
5fd9b217ef
|
|
@ -12,17 +12,16 @@
|
|||
<uv-qrcode :options="qrcodeOptions" :value="qrcodeValue" size="500rpx"></uv-qrcode>
|
||||
</view>
|
||||
|
||||
<!-- 按钮区域 -->
|
||||
<!-- <view class="button-container">-->
|
||||
<!-- <button class="action-button" @click="saveAndSharePoster">-->
|
||||
<!-- <text class="button-text">保存分享海报</text>-->
|
||||
<!-- </button>-->
|
||||
<view class="button-container">
|
||||
<button class="action-button" @click="copyQrcodeValue">
|
||||
<text class="button-text">复制邀请链接</text>
|
||||
</button>
|
||||
|
||||
<!-- <button class="action-button" @click="sendToFriends">-->
|
||||
<!-- <text class="button-text">保存分享海报</text>-->
|
||||
<!-- <text class="button-sub-text">发给好友扫码</text>-->
|
||||
<!-- </button>-->
|
||||
<!-- </view>-->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
|
@ -31,6 +30,11 @@
|
|||
import commonEnum from '../../enum/commonEnum'
|
||||
import UvQrcode from '../../uni_modules/uv-qrcode/components/uv-qrcode/uv-qrcode.vue'
|
||||
import { getLocalUserId } from '../../api/user/user.js'
|
||||
import { onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
|
||||
|
||||
onShareAppMessage(e => {
|
||||
return {}
|
||||
})
|
||||
|
||||
export default {
|
||||
name: 'AgentsPage',
|
||||
|
|
@ -55,6 +59,26 @@ export default {
|
|||
this.initQrcodeValue()
|
||||
},
|
||||
methods: {
|
||||
// 复制二维码链接
|
||||
copyQrcodeValue() {
|
||||
uni.setClipboardData({
|
||||
data: this.qrcodeValue,
|
||||
success: () => {
|
||||
uni.showToast({
|
||||
title: '链接已复制',
|
||||
icon: 'success',
|
||||
})
|
||||
console.log('复制成功:', this.qrcodeValue)
|
||||
},
|
||||
fail: err => {
|
||||
console.error('复制失败:', err)
|
||||
uni.showToast({
|
||||
title: '复制失败',
|
||||
icon: 'none',
|
||||
})
|
||||
},
|
||||
})
|
||||
},
|
||||
// 初始化二维码内容
|
||||
initQrcodeValue() {
|
||||
const userId = getLocalUserId()
|
||||
|
|
@ -142,7 +166,7 @@ export default {
|
|||
.action-button {
|
||||
flex: 1;
|
||||
max-width: 280rpx;
|
||||
height: 100rpx;
|
||||
height: 80rpx;
|
||||
background: white;
|
||||
border: 2rpx solid #ff6b35;
|
||||
border-radius: 50rpx;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user