erekook 6 months ago
parent
commit
250047fb84
1 changed files with 7 additions and 2 deletions
  1. 7 2
      app.js

+ 7 - 2
app.js

@@ -46,6 +46,11 @@ App({
     SendEvent("customAppletsShowEvent", {}, this);
   },
 
+  onHide: function () {
+    console.log("onHide-小程序进入后台");
+    SendEvent("customAppletsHideEvent", {}, this);
+  },
+
   // 腾讯广告小程序sdk上报
   sdkTrack(eventName, eventValue) {
     try {
@@ -120,8 +125,8 @@ App({
                 appId: apple.appid,
                 openId: res.openId,
               })
-                .then(() => {})
-                .catch((err) => {});
+                .then(() => { })
+                .catch((err) => { });
               SendEvent("login", {
                 userCode: res.userCode,
                 openId: res.openId,