|
@@ -16,7 +16,7 @@ Page({
|
|
|
title: '配网模式选择', //导航栏 中间的标题
|
|
|
},
|
|
|
isNotruter: false,
|
|
|
- model: 0,
|
|
|
+ model: "",
|
|
|
connectDevice: {},
|
|
|
typeList: [{
|
|
|
"icon": "../../images/device/mode_2.png",
|
|
@@ -39,11 +39,11 @@ Page({
|
|
|
getModeName(curItem) {
|
|
|
// 设备类型:1-蓝牙,2-Wifi,3-传统蓝牙,4-4G
|
|
|
var str = "";
|
|
|
- if (curItem.deviceMode == 4) {
|
|
|
+ if (curItem.type == 4) {
|
|
|
str = "移动数据模式";
|
|
|
- } else if (curItem.deviceMode == 2) {
|
|
|
+ } else if (curItem.type == 2) {
|
|
|
str = "WiFi模式";
|
|
|
- } else if (curItem.deviceMode == 1) {
|
|
|
+ } else if (curItem.type == 1) {
|
|
|
str = "蓝牙模式";
|
|
|
}
|
|
|
return str;
|
|
@@ -98,6 +98,7 @@ Page({
|
|
|
});
|
|
|
this.setData({
|
|
|
typeList: list,
|
|
|
+ model: this.getModeName(device)
|
|
|
})
|
|
|
|
|
|
},
|
|
@@ -112,12 +113,21 @@ Page({
|
|
|
})
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
+ let _typeList = json.typeList.map(e => {
|
|
|
+ return {
|
|
|
+ icon: "../../images/device/mode_" + e.type + ".png",
|
|
|
+ text: this.getModeName(e),
|
|
|
+ type: e.type
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
var list = []
|
|
|
- var typeList = device.typeList.map(element => {
|
|
|
- return element.connectType;
|
|
|
- });
|
|
|
+ console.log(this.data.typeList)
|
|
|
+ console.log(_typeList)
|
|
|
+
|
|
|
this.data.typeList.forEach(element => {
|
|
|
- if (typeList.find(type => type === element.type)) {
|
|
|
+ if (_typeList.find(_type => _type.type === element.type)) {
|
|
|
list.push(element)
|
|
|
}
|
|
|
});
|