Prechádzať zdrojové kódy

feature:更新小程序授权界面的方法

zeng.chen 15 hodín pred
rodič
commit
4c27e50a49

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 16 - 2
pages/pageB/authWeb/authWeb.js


+ 6 - 2
pages/pageB/authWeb/authWeb.wxml

@@ -1,3 +1,7 @@
 <!-- pages/testQQ/testQQ.wxml -->
-<nav-bar bind:goBack="_goBack" nav-bgc-class="ex-nav-bgc-class" nav-title-class="ex-nav-title-class" ex-back-pre="ex-back-pre" bind:tap="callback" navbar-data='{{nvabarData}}'></nav-bar>
-<web-view id='webView' class="content" src="{{qrcodeUrl}}" bindmessage="webChannel"></web-view>
+<!-- <view class="container">
+    <nav-bar bind:goBack="_goBack" class="nav_bar" nav-bgc-class="ex-nav-bgc-class" nav-title-class="ex-nav-title-class" ex-back-pre="ex-back-pre" bind:tap="callback" navbar-data='{{nvabarData}}'></nav-bar>
+    <web-view class="web-view" src="{{qrcodeUrl}}" bindmessage="webChannel"></web-view>
+</view> -->
+<!-- style="height: calc(100vh - {{navBarHeight}}px); width:100%; margin-top:{{navBarHeight}}px" -->
+<web-view src="{{qrcodeUrl}}" bindmessage="webChannel"></web-view>

+ 1 - 13
pages/pageB/authWeb/authWeb.wxss

@@ -1,13 +1 @@
-/* pages/testQQ/testQQ.wxss */
-web-view {
-	margin-top: 10%;
-	width: 100%;
-	height: 90%;
-}
-
-.btn {
-	margin-top: 0;
-	width: 100%;
-	height: 10%;
-	color: red;
-}
+/* pages/testQQ/testQQ.wxss */

+ 27 - 7
pages/pageB/deviceWake/deviceWake.js

@@ -9,7 +9,7 @@ const {
 import lexin_util from '../../../utils/lexin/util.js';
 import routePath from '../../../utils/routePath.js';
 import routeUtil from '../../../utils/routeUtil.js';
-import { autoAuth, unbind, EnumPlatformId } from '../../../utils/auth/auth_util.js';
+import { autoAuth, unbind, EnumPlatformId, getAuthStatus } from '../../../utils/auth/auth_util.js';
 
 Page({
   data: {
@@ -97,10 +97,9 @@ Page({
       DstDeviceName: deviceMac
     });
 
-    app.PubMsg({
-      type: "start_dm_auth",
-      DstDeviceName: deviceMac
-    });
+    if (that.data.qqAuthInfo) {
+      that.getAuthStatus();
+    }
 
     // 赋值按钮回调
     that.setData({
@@ -145,6 +144,12 @@ Page({
       case "message":
         // 设备信息
         if (payloads.type === "get_dev_info") {
+
+          app.PubMsg({
+            type: "start_dm_auth",
+            DstDeviceName: that.data.deviceMac
+          });
+
           console.log("设备信息get_dev_info:", payloads);
           that.setData({
             deviceOther: payloads.other,
@@ -242,12 +247,26 @@ Page({
           // 		}
           // 	}
           console.log("设备信息start_dm_auth:", payloads);
+          var noDsn = that.data.qqAuthInfo == null;
           that.data.qqAuthInfo = payloads.other;
+          if (noDsn) {
+            that.getAuthStatus();
+          }
 
         }
       default:
     }
   },
+  getAuthStatus() {
+    var that = this;
+    // 这个界面只有wifi的?
+    getAuthStatus(EnumPlatformId.QQ, that.getDeivce()).then((res) => {
+      that.setData({ isQQAuth: res });
+    });
+    getAuthStatus(EnumPlatformId.XMLY, that.getDeivce()).then((res) => {
+      that.setData({ isAuthXmly: res });
+    });
+  },
 
   // 休眠-选择时间
   switch1Change(e) {
@@ -542,9 +561,10 @@ Page({
         content: '确定要解除喜马拉雅授权吗?',
         success(res) {
           if (res.confirm) {
-            unbind(EnumPlatformId.XMLY, that.getDeivce()).then((res) => {
+            unbind(that.getDeivce(), EnumPlatformId.XMLY).then((res) => {
+              console.log("解绑喜马拉雅3:", res);
               that.setData({
-                isAuthXmly: res
+                isAuthXmly: !res
               });
             });
           }