邹能昇 3 сар өмнө
parent
commit
cdaa1c482d

+ 18 - 1
nova-werun/pages/home/share/index.js

@@ -496,5 +496,22 @@ Page({
             fail: function (res) {}
         })
     },
-
+    shar() {
+        wx.downloadFile({
+            url: this.data.saveimage, //图片服务器地址
+            success: (res) => {
+                wx.showShareImageMenu({
+                    path: res.tempFilePath, //转为本地地址showShareImageMenu进行分享
+                    success: (res) => {
+                        uni.hideLoading();
+                        this.modalShare = null;
+                    },
+                    fail: (err) => {
+                        uni.hideLoading();
+                        this.modalShare = null;
+                    },
+                });
+            },
+        });
+    }
 })

+ 1 - 1
nova-werun/pages/home/share/index.wxml

@@ -41,7 +41,7 @@
     <view class="sharebox">
         <view class="share-text">分享到</view>
         <view class="share-picbox">
-            <view class="share-pic">
+            <view class="share-pic" bindtap="shar">
                 <view class="share-pic-box">
                     <image class="image"  src="https://file-cloud.fmode.cn/qpFbRRSZrO/20241112/1djefq104546048.png?imageView2/1/w/200/h/200"></image>
                 </view>