|
@@ -1,8 +1,5 @@
|
|
|
const app = getApp();
|
|
|
-import strings from '../../../utils/strings.js';
|
|
|
-import routeUtil from '../../../utils/routeUtil.js';
|
|
|
-import routePath from '../../../utils/routePath.js'
|
|
|
-import routeRoot from '../../../utils/routeRoot.js'
|
|
|
+const constant = require('../../../utils/constant.js');
|
|
|
|
|
|
Page({
|
|
|
data: {
|
|
@@ -23,13 +20,13 @@ Page({
|
|
|
onLoad(options) {
|
|
|
var that = this;
|
|
|
var param = options.param;
|
|
|
- if (!strings.isEmpty(param)) {
|
|
|
+ if (!constant.strings.isEmpty(param)) {
|
|
|
param = JSON.parse(param);
|
|
|
that.data.connectDevice = param;
|
|
|
- if (!strings.isEmpty(param.typeList)) {
|
|
|
+ if (!constant.strings.isEmpty(param.typeList)) {
|
|
|
var typeList = param.typeList;
|
|
|
typeList = typeList.filter((v) => v.connectType == 3);
|
|
|
- if (!strings.isEmpty(typeList)) {
|
|
|
+ if (!constant.strings.isEmpty(typeList)) {
|
|
|
that.setData({
|
|
|
imageUrl: typeList[0].deviceLinkResp.icon1,
|
|
|
});
|
|
@@ -47,7 +44,7 @@ Page({
|
|
|
showCapsule: 1,
|
|
|
title: '连接配网',
|
|
|
callback: () => {
|
|
|
- routeUtil.goBackRoute(routeRoot.indexRoot);
|
|
|
+ constant.routeUtil.goBackRoute(constant.routeRoot.indexRoot);
|
|
|
}
|
|
|
},
|
|
|
})
|
|
@@ -109,7 +106,7 @@ Page({
|
|
|
success(res) {
|
|
|
if (that.data.scopeBluetooth && that.data.userFuzzyLocation) {
|
|
|
var param = "?param=" + JSON.stringify(that.data.connectDevice);
|
|
|
- routeUtil.jumpParam(routePath.deviceConnect1, param);
|
|
|
+ constant.routeUtil.jumpParam(constant.routePath.deviceConnect1, param);
|
|
|
}
|
|
|
},
|
|
|
fail(res) {
|
|
@@ -145,7 +142,7 @@ Page({
|
|
|
|
|
|
///返回到首页
|
|
|
notRoter() {
|
|
|
- routeUtil.goBackRoute(routeRoot.indexRoot);
|
|
|
+ constant.routeUtil.goBackRoute(constant.routeRoot.indexRoot);
|
|
|
},
|
|
|
|
|
|
onUnload() {
|