From e688937e0d385a08faceb69871c7f4c633ff2293 Mon Sep 17 00:00:00 2001 From: dzc <2388224167@qq.com> Date: Thu, 4 Dec 2025 15:29:44 +0800 Subject: [PATCH] 1 --- src/pages/wechat/index.vue | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/pages/wechat/index.vue b/src/pages/wechat/index.vue index 7ba62ea0..7d91abc3 100644 --- a/src/pages/wechat/index.vue +++ b/src/pages/wechat/index.vue @@ -71,7 +71,8 @@ + class="flex-1 text-center px-2 py-8rpx border-1px border-solid rounded-full border-color-theme active_cl_bg-color-theme" + @tap="copyLink"> 复制链接 @@ -155,6 +156,7 @@ const state = reactive({ ], summary: {}, posterPic: "", + posterUrl: "", }); @@ -208,11 +210,26 @@ const getMiniProgramPoster = async () => { let { code, data } = await BrokerageApi.getBrokerageCode(); if (code != 0) throw new Error() state.posterPic = data?.posterPic || '' + state.posterUrl = data?.url || '' } catch (error) { console.error("|获取分销海报|,意外的错误:", error); } } +// 复制海报 +const copyLink = () => { + uni.setClipboardData({ + data: state.posterUrl, + success: () => { + uni.showToast({ title: '复制成功', icon: 'success' }); + }, + fail: (err) => { + uni.showToast({ title: '复制失败', icon: 'none' }); + console.error("|复制链接|,意外的错误:", err); + } + }); +} + // 保存海报 const savePoster = () => { if (!state.posterPic) {