diff --git a/pages/agents/requestAgent.vue b/pages/agents/requestAgent.vue index 2b3d9ca..206b744 100644 --- a/pages/agents/requestAgent.vue +++ b/pages/agents/requestAgent.vue @@ -12,17 +12,16 @@ - - - - - + + - - - - - + + + + + @@ -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;