Browse Source

app跳转小程序失败 -- 还原

shizhongqi 4 years ago
parent
commit
15b83d291b
1 changed files with 21 additions and 30 deletions
  1. 21 30
      hdApp/src/admin/home/workbench.vue

+ 21 - 30
hdApp/src/admin/home/workbench.vue

@@ -156,39 +156,30 @@ export default {
       // #ifdef APP-PLUS
       let that = this
       if(plus.runtime.isApplicationExist({pname:'com.tencent.mm',action:'weixin://'})){
-        uni.login({
-          provider: 'weixin',
-          success: function (loginRes) {
-            plus.share.getServices(function(s){
-              var sweixin
-              
-              for (var i = 0; i < s.length; i++) {
-                var t = s[i];
-                if (t.id == 'weixin') {
-                    sweixin = t;
-                }
-              }
+        plus.share.getServices(function(s){
+          var sweixin
+          
+          for (var i = 0; i < s.length; i++) {
+            var t = s[i];
+            if (t.id == 'weixin') {
+                sweixin = t;
+            }
+          }
 
-              if (sweixin && sweixin.nativeClient) {
-                sweixin.launchMiniProgram({
-                  id: 'gh_73b8b357d19a',
-                  path: '/pagesPurchase/order',
-                  type: 0
-                });
-              } else {
-                that.$msg('请安装微信');
-                return false;
-              }
-            }, function(e){
-              that.$msg("获取微信失败:" + e.message)
-              console.log("获取微信失败:" + e.message);
+          if (sweixin && sweixin.nativeClient) {
+            sweixin.launchMiniProgram({
+              id: 'gh_73b8b357d19a',
+              path: '/pagesPurchase/order',
+              type: 0
             });
-          },
-          fail: function (res) {
-            that.$msg("微信登录失败:" + JSON.stringify(res))
-            console.log(res)
+          } else {
+            that.$msg('请安装微信');
+            return false;
           }
-        })
+        }, function(e){
+          that.$msg("获取微信失败:" + e.message)
+          console.log("获取微信失败:" + e.message);
+        });
       } else {
         that.$msg("微信应用未安装")
 				return false