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