xujialiang 4 年之前
父节点
当前提交
5ca63f0503
共有 1 个文件被更改,包括 20 次插入2 次删除
  1. 20 2
      assets/scripts/Platform/WeChat/WeChatPlatform.ts

+ 20 - 2
assets/scripts/Platform/WeChat/WeChatPlatform.ts

@@ -40,6 +40,21 @@ export class WeChatPlatform extends BasePlatform {
         'QqKo2705RAWkAdz0FaX0yQ=='
     ]
 
+    private _shareInfo:any[] = [
+        {
+            imageUrlId: 'W1rJy8OeTMy3A4w+fStBZw==',
+            imageUrl: 'https://mmocgame.qpic.cn/wechatgame/oibRozFPq5kVrHgYD9aBicGTxzPOOPvHfia8TZdkQ7BnzsEuBfFKcianic9mCdq2OiaKod/0'
+        },
+        {
+            imageUrlId: '5ZVIdG5hQGGaCs0j2LplTg==',
+            imageUrl: 'https://mmocgame.qpic.cn/wechatgame/oibRozFPq5kVm5USa9okMA4qqvWe3IrMKWu1PZp2NbGWH3gSmaiazcJ5lwzYlcEg8Z/0'
+        },
+        {
+            imageUrlId: 'QqKo2705RAWkAdz0FaX0yQ==',
+            imageUrl: 'https://mmocgame.qpic.cn/wechatgame/oibRozFPq5kVdXISc8e9SQnmPCHRI0r72q7lUyfiaMkfDuLaw5E8vVQTPMod4nc93J/0'
+        },
+    ]
+
     constructor() {
         super()
         this.__systemInfo = this.wx.getSystemInfoSync();
@@ -141,11 +156,14 @@ export class WeChatPlatform extends BasePlatform {
                 withShareTicket: true
             });
             let shareTitle = this._shareTitles[Math.floor(Math.random() * this._shareTitles.length)]
-            let imageUrlId = this._shareImage[Math.floor(Math.random() * this._shareImage.length)]
+            let shareinfo = this._shareInfo[Math.floor(Math.random() * this._shareInfo.length)]
+            let imageUrlId = shareinfo.imageUrlId
+            let imageUrl = shareinfo.imageUrl
             this.wx.onShareAppMessage(() => {
                 return {
                     title: shareTitle,
-                    imageUrlId: imageUrlId
+                    imageUrlId: imageUrlId,
+                    imageUrl: imageUrl
                 }
             })