修改了列表跳转方式
This commit is contained in:
@ -812,7 +812,7 @@
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
})
|
||||
eventChannel.on('deviceControl', (data) => {
|
||||
eventChannel.on('detailData', (data) => {
|
||||
console.log(data, '这是传过来的惨呼啊');
|
||||
this.itemInfo = data.data;
|
||||
this.deviceID = data.data.id;
|
||||
|
@ -143,7 +143,7 @@
|
||||
url: "/pages/6170/deviceControl/index",
|
||||
success: (res) => {
|
||||
// 页面跳转成功后的回调函数
|
||||
res.eventChannel.emit('deviceControl', {
|
||||
res.eventChannel.emit('detailData', {
|
||||
data: item,
|
||||
apiType: 'listB' // 自定义标识 // 自定义标识,详情哪里根据这个参数不同信息
|
||||
});
|
||||
|
@ -352,13 +352,13 @@ export default {
|
||||
* @param {number} [interval=800] - 轮询间隔(毫秒)
|
||||
* @param {number} [maxRetries=10] - 最大重试次数
|
||||
*/
|
||||
async getdeviceSTatus(val, batchId, interval = 800, maxRetries = 10) {
|
||||
let retries = 0;
|
||||
async getdeviceSTatus(val, batchId, interval = 800) {
|
||||
//let retries = 0;
|
||||
const checkStatus = async () => {
|
||||
if (retries >= maxRetries) {
|
||||
throw new Error('超过最大重试次数');
|
||||
}
|
||||
retries++;
|
||||
// if (retries >= maxRetries) {
|
||||
// throw new Error('超过最大重试次数');
|
||||
// }
|
||||
// retries++;
|
||||
|
||||
try {
|
||||
const data = {
|
||||
@ -916,7 +916,7 @@ export default {
|
||||
title: statusRes.msg,
|
||||
icon: 'none'
|
||||
});
|
||||
// 刷新详情接口
|
||||
// 刷新详情接口
|
||||
this.fetchDeviceDetail(this.computedDeviceId, true);
|
||||
uni.$emit('deviceStatusUpdate', {});
|
||||
this.showPopupFlag = false
|
||||
@ -991,6 +991,7 @@ export default {
|
||||
// 最后关闭加载状态
|
||||
this.pageLoading = false
|
||||
this.deviceInfo = res.data
|
||||
|
||||
if (!isUpdate) {
|
||||
this.personnelInfo = {
|
||||
unitName: res.data.personnelInfo.unitName || '',
|
||||
@ -999,6 +1000,30 @@ export default {
|
||||
position: res.data.personnelInfo.position || '',
|
||||
};
|
||||
this.messageToSend = res.data.sendMsg || '';
|
||||
this.sliderValue = res.data.lightBrightness || '25'
|
||||
let mainLightMode = parseInt(res.data.mainLightMode);
|
||||
switch (mainLightMode) {
|
||||
case 0:
|
||||
this.currentMainMode = '关闭';
|
||||
break;
|
||||
case 1:
|
||||
this.currentMainMode = '强光';
|
||||
break;
|
||||
case 2:
|
||||
this.currentMainMode = '弱光';
|
||||
break;
|
||||
case 3:
|
||||
this.currentMainMode = '爆闪';
|
||||
break;
|
||||
case 4:
|
||||
this.currentMainMode = '泛光';
|
||||
break;
|
||||
default:
|
||||
console.log('未知的灯光模式:', mainLightMode);
|
||||
}
|
||||
const laserMode = res.data.LaserLightMode;
|
||||
this.isLaserOn = laserMode === 1;
|
||||
this.currentlaserMode = this.isLaserOn ? "开启" : "关闭";
|
||||
}
|
||||
// 将权限字符串转换为数组 ["1", "2"]
|
||||
if (isFromShared) {
|
||||
@ -1007,8 +1032,8 @@ export default {
|
||||
} else {
|
||||
this.isSharedDevice = false;
|
||||
this.activePermissions = []; // 非分享设备清空权限
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 关闭加载中
|
||||
uni.hideLoading()
|
||||
}
|
||||
@ -1086,7 +1111,7 @@ export default {
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
})
|
||||
eventChannel.on('deviceControl', (data) => {
|
||||
eventChannel.on('detailData', (data) => {
|
||||
console.log(data, 'data');
|
||||
this.itemInfo = data.data;
|
||||
this.deviceID = data.data.id;
|
||||
|
@ -175,7 +175,7 @@
|
||||
url: "/pages/6170/deviceControl/index",
|
||||
success: (res) => {
|
||||
// 页面跳转成功后的回调函数
|
||||
res.eventChannel.emit('deviceControl', {
|
||||
res.eventChannel.emit('detailData', {
|
||||
data: item,
|
||||
apiType: 'listB' // 自定义标识 // 自定义标识,详情哪里根据这个参数不同信息
|
||||
});
|
||||
|
@ -483,53 +483,23 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
// 列表跳转
|
||||
handleFile(item) {
|
||||
// communicationMode 0是4G 1是蓝牙,考虑多个4g设备
|
||||
if (item.typeName == 'BJQ6170') {
|
||||
uni.navigateTo({
|
||||
url: "/pages/6170/deviceControl/index",
|
||||
events: {
|
||||
ack: function(data) {}
|
||||
},
|
||||
success: (res) => {
|
||||
// 页面跳转成功后的回调函数
|
||||
res.eventChannel.emit('deviceControl', {
|
||||
data: item,
|
||||
apiType: 'listA' // 自定义标识,详情哪里根据这个参数不同信息
|
||||
});
|
||||
}
|
||||
})
|
||||
} else if (item.typeName == 'HBY210') {
|
||||
const currentTab = this.tabs[this.activeTab];
|
||||
const deviceType = currentTab.id || '';
|
||||
uni.navigateTo({
|
||||
url: "/pages/210/deviceControl/index",
|
||||
events: {
|
||||
ack: function(data) {}
|
||||
},
|
||||
success: (res) => {
|
||||
// 页面跳转成功后的回调函数
|
||||
res.eventChannel.emit('deviceControl', {
|
||||
data: item,
|
||||
deviceType: deviceType,
|
||||
apiType: 'listA' // 自定义标识
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
if (item.typeName == '6155') {
|
||||
uni.navigateTo({
|
||||
url: "/pages/6155/deviceDetail",
|
||||
events: {
|
||||
ack: function(data) {}
|
||||
},
|
||||
success: (res) => {
|
||||
res.eventChannel.emit('detailData', {
|
||||
data: item
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
let url = item.detailPageUrl;
|
||||
uni.navigateTo({
|
||||
url: url,
|
||||
events: {
|
||||
ack: function(data) {}
|
||||
},
|
||||
success: (res) => {
|
||||
// 页面跳转成功后的回调函数
|
||||
res.eventChannel.emit('detailData', {
|
||||
data: item,
|
||||
deviceType: this.tabs[this.activeTab].id || '',
|
||||
apiType: 'listA' //标识,根据这个参数,区分普通详情,分享跳转详情,查不一样的权限信息
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
onIntall() {
|
||||
this.page = 1;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import config from '../config/index.js';
|
||||
const env = 'production'; //production development //开发of线上 改这里就行
|
||||
const env = 'development'; //production development //开发of线上 改这里就行
|
||||
const BASE = config[env];
|
||||
const request = (options) => {
|
||||
console.log("options"+JSON.stringify(options),BASE.BASE_URL)
|
||||
|
Reference in New Issue
Block a user