|
@@ -12,7 +12,8 @@ Page({
|
|
|
scopeBluetooth: false,
|
|
|
userFuzzyLocation: true,
|
|
|
isNotruter: false,
|
|
|
- isFromRootPage: true,
|
|
|
+ _isFromRootPage: true,
|
|
|
+ isAiDevice: false,
|
|
|
connectDevice: {},
|
|
|
imageUrl: "./../../../img/c.png",
|
|
|
},
|
|
@@ -34,7 +35,9 @@ Page({
|
|
|
|
|
|
if (Object.keys(param).length <= 1) {
|
|
|
// 扫描进来的只有一个参数
|
|
|
- that.data.isFromRootPage = false;
|
|
|
+ that.setData({
|
|
|
+ isAiDevice: true,
|
|
|
+ })
|
|
|
|
|
|
var classifyProducts = constant.app.globalData.classifyProducts;
|
|
|
if (!constant.strings.isEmpty(classifyProducts)) {
|
|
@@ -78,17 +81,11 @@ Page({
|
|
|
updateDeviceUrl(param) {
|
|
|
var that = this
|
|
|
that.data.connectDevice = param;
|
|
|
-
|
|
|
var typeList = param["typeList"] ?? [];
|
|
|
- console.log("找到设备5", typeList);
|
|
|
-
|
|
|
if (!constant.strings.isEmpty(typeList)) {
|
|
|
- console.log("找到设备3");
|
|
|
-
|
|
|
typeList = typeList.filter((v) => v.connectType == 3);
|
|
|
if (!constant.strings.isEmpty(typeList)) {
|
|
|
console.log("找到设备4", typeList);
|
|
|
-
|
|
|
that.setData({
|
|
|
imageUrl: typeList[0].deviceLinkResp.icon1,
|
|
|
});
|
|
@@ -100,7 +97,7 @@ Page({
|
|
|
// 重置小程序界面到首页
|
|
|
console.log("返回界面4", constant.routePath.index);
|
|
|
|
|
|
- if (this.data.isFromRootPage) {
|
|
|
+ if (this.data._isFromRootPage) {
|
|
|
constant.routeUtil.goBack();
|
|
|
} else {
|
|
|
console.log("返回界面4", constant.routePath.index);
|
|
@@ -170,13 +167,19 @@ Page({
|
|
|
constant.routeUtil.jumpParam(constant.routePath.deviceConnect1, param);
|
|
|
}
|
|
|
},
|
|
|
- fail(res) {
|
|
|
- if (res.errCode === 10001) {
|
|
|
+ fail(err) {
|
|
|
+ if (err.errCode === 10001) {
|
|
|
wx.showToast({
|
|
|
title: '手机蓝牙未打开',
|
|
|
icon: "none",
|
|
|
duration: 2000
|
|
|
})
|
|
|
+ } else {
|
|
|
+ wx.showToast({
|
|
|
+ title: err,
|
|
|
+ icon: "none",
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
});
|