future 1 year ago
parent
commit
4c642c0551

+ 2 - 2
assets/script/run/loading_view/loading_view.ts

@@ -89,7 +89,7 @@ export class loading_view extends Component {
                                             user_data.user_id = _data.content.openid;
                                             formData.openid = _data.content.openid;
                                             formData.platform = 'douyin'
-                                            console.log("_data",_data)
+                                            // console.log("_data",_data)
                                             login_call_back();
                                         }
                                     })
@@ -110,7 +110,7 @@ export class loading_view extends Component {
                                             user_data.user_id = _data.content.openid;
                                             formData.openid = _data.content.openid;
                                             formData.platform = 'wx'
-                                            console.log("_data",data)
+                                            // console.log("_data",data)
                                             login_call_back();
                                         }
                                     })

+ 4 - 1
assets/script/run/top_layer.ts

@@ -115,8 +115,11 @@ export class top_layer extends Component {
     }
 
     onClickShare(){
+        gameManager.Singleton.sys_click_button_music()
+
+        let level_data = gameManager.Singleton.getLevelData()
         let videoPath = SdkUtil.ttGetScreenRecordingVideoPath()
-        SdkUtil.shareGame(config.gameName, '', videoPath)
+        SdkUtil.shareGame(level_data.name, level_data.cover, videoPath)
     }
 
     onClickNext(){

+ 49 - 12
assets/script/sdkUtil.ts

@@ -72,27 +72,66 @@ export class SdkUtil {
     public static shareGame(title: string, imageUrl: string, videoPath: string) {
         if(sys.platform == sys.Platform.BYTEDANCE_MINI_GAME) {
             if(videoPath!="") {
-                this.ttShareScreenRecordVideo(title,videoPath)
+                this.ttShareScreenRecordVideo(config.gameName,videoPath)
             }
         } else if(sys.platform == sys.Platform.WECHAT_GAME) {
-            // 微信分享
+            title = title + '好刺激、好好玩'
+            this.wxShare(title, imageUrl)
         }
-        // //@ts-ignore
+    }
+
+    /**
+     * 微信分享
+     * 
+     * @static
+     * @param {string} title
+     * @param {string} imageUrl
+     * @returns
+     * @memberof SdkUtil
+     */
+    public static wxShare(title: string, imageUrl: string) {
+        // console.log('微信分享=',title, 'imageUrl=',imageUrl)
+        wx.showShareMenu({
+            withShareTicket: true,
+            // shareAppMessage(可以删除):显示分享给好友选项,shareTimeline(可以删除):显示分享至朋友圈选项
+		    // 可以只开启前者。如果要开启后者,则两者必须都开启才能生效。
+            // menus: ['shareAppMessage', 'shareTimeline'],
+            menus: ['shareAppMessage'],
+            complete: () => {}
+        });
+
+        // 主动分享
+        wx.shareAppMessage({
+            title: title,
+            imageUrl: imageUrl
+        });
+
+        // 被动分享
+        // wx.onShareAppMessage( () => {
+        //     return {
+        //         // 标题,不传则默认使用小游戏的名称
+        //         title: title,
+        //         // 转发链接所显示的图片,比例5:4,资源可以是本地或远程。不传则默认使用游戏截图。           
+        //         imageUrl: imageUrl,
+        //     }
+        // });
+
+        //@ts-ignore
         // if (!window.wx) {
         //     return;
         // }
-
-        // //@ts-ignore
+        // 
+        //@ts-ignore
         // wx.showShareMenu({
         //     withShareTicket: true,
         //     complete: () => {
-
+        //         console.log('')
         //     }
-        // });
-
-        // //@ts-ignore
+        // }
+        //
+        //@ts-ignore
         // if (wx.aldOnShareAppMessage) {
-        //     //@ts-ignore
+        //     //@ts-ignore 被动分享
         //     wx.aldOnShareAppMessage(function () {
         //         // 用户点击了“转发”按钮
         //         return {
@@ -108,12 +147,10 @@ export class SdkUtil {
         //         return {
         //             title: title,
         //             imageUrl: imageUrl,
-
         //         };
         //     });
         // }
     }
-
     
     /**
      * 抖音/微信激励视频

+ 8 - 1
settings/v2/packages/builder.json

@@ -1,3 +1,10 @@
 {
-  "__version__": "1.3.7"
+  "__version__": "1.3.7",
+  "splash-setting": {
+    "logo": {
+      "type": "none"
+    },
+    "totalTime": 500,
+    "displayRatio": 0.0001
+  }
 }

+ 1 - 1
settings/v2/packages/information.json

@@ -6,7 +6,7 @@
       "label": "customSplash",
       "enable": true,
       "customSplash": {
-        "complete": false,
+        "complete": true,
         "form": "https://creator-api.cocos.com/api/form/show?sid=1946a123f7c7fbd687e396df9cd842f9"
       }
     },