From c768d20f2256ba40ebf6bc1be984c667d6bc7a11 Mon Sep 17 00:00:00 2001 From: zuoxiao <470321431@qq.com> Date: 星期五, 27 十二月 2024 14:52:59 +0800 Subject: [PATCH] 添加分享功能 --- pages/home/home.js | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/pages/home/home.js b/pages/home/home.js index cd54a3f..b20556c 100644 --- a/pages/home/home.js +++ b/pages/home/home.js @@ -697,5 +697,19 @@ const minutes = date.getMinutes().toString().padStart(2, '0'); const seconds = date.getSeconds().toString().padStart(2, '0'); return `${hours}:${minutes}:${seconds}`; + }, + onShareAppMessage: function (options) { + // 璁剧疆鍒嗕韩鍐呭 + return { + title: '澶х鐏屾簤鍔╂墜', // 鍒嗕韩鏍囬 + path: '/pages/home/home', // 鍒嗕韩璺緞锛岃璺緞闇�瑕佹槸褰撳墠灏忕▼搴忓瓨鍦ㄧ殑椤甸潰璺緞 + imageUrl: '/images/logo2.jpg', // 鍒嗕韩鍥炬爣锛屽彲浠ユ槸缃戠粶鍥剧墖璺緞鎴栨湰鍦板浘鐗囪矾寰� + success: function (res) { + // 鍒嗕韩鎴愬姛鐨勫洖璋冨嚱鏁� + }, + fail: function (res) { + // 鍒嗕韩澶辫触鐨勫洖璋冨嚱鏁� + } + }; } }) \ No newline at end of file -- Gitblit v1.8.0