|
@@ -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
|
|
|
});
|
|
|
});
|
|
|
}
|