修改了列表跳转方式

This commit is contained in:
fengerli
2025-08-15 10:30:08 +08:00
parent 106320bfd5
commit 8e1a37dbea
6 changed files with 55 additions and 60 deletions

View File

@ -812,7 +812,7 @@
uni.showLoading({ uni.showLoading({
title: '加载中...' title: '加载中...'
}) })
eventChannel.on('deviceControl', (data) => { eventChannel.on('detailData', (data) => {
console.log(data, '这是传过来的惨呼啊'); console.log(data, '这是传过来的惨呼啊');
this.itemInfo = data.data; this.itemInfo = data.data;
this.deviceID = data.data.id; this.deviceID = data.data.id;

View File

@ -143,7 +143,7 @@
url: "/pages/6170/deviceControl/index", url: "/pages/6170/deviceControl/index",
success: (res) => { success: (res) => {
// 页面跳转成功后的回调函数 // 页面跳转成功后的回调函数
res.eventChannel.emit('deviceControl', { res.eventChannel.emit('detailData', {
data: item, data: item,
apiType: 'listB' // 自定义标识 // 自定义标识,详情哪里根据这个参数不同信息 apiType: 'listB' // 自定义标识 // 自定义标识,详情哪里根据这个参数不同信息
}); });

View File

@ -352,13 +352,13 @@ export default {
* @param {number} [interval=800] - 轮询间隔(毫秒) * @param {number} [interval=800] - 轮询间隔(毫秒)
* @param {number} [maxRetries=10] - 最大重试次数 * @param {number} [maxRetries=10] - 最大重试次数
*/ */
async getdeviceSTatus(val, batchId, interval = 800, maxRetries = 10) { async getdeviceSTatus(val, batchId, interval = 800) {
let retries = 0; //let retries = 0;
const checkStatus = async () => { const checkStatus = async () => {
if (retries >= maxRetries) { // if (retries >= maxRetries) {
throw new Error('超过最大重试次数'); // throw new Error('超过最大重试次数');
} // }
retries++; // retries++;
try { try {
const data = { const data = {
@ -991,6 +991,7 @@ export default {
// 最后关闭加载状态 // 最后关闭加载状态
this.pageLoading = false this.pageLoading = false
this.deviceInfo = res.data this.deviceInfo = res.data
if (!isUpdate) { if (!isUpdate) {
this.personnelInfo = { this.personnelInfo = {
unitName: res.data.personnelInfo.unitName || '', unitName: res.data.personnelInfo.unitName || '',
@ -999,6 +1000,30 @@ export default {
position: res.data.personnelInfo.position || '', position: res.data.personnelInfo.position || '',
}; };
this.messageToSend = res.data.sendMsg || ''; 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"] // 将权限字符串转换为数组 ["1", "2"]
if (isFromShared) { if (isFromShared) {
@ -1086,7 +1111,7 @@ export default {
uni.showLoading({ uni.showLoading({
title: '加载中...' title: '加载中...'
}) })
eventChannel.on('deviceControl', (data) => { eventChannel.on('detailData', (data) => {
console.log(data, 'data'); console.log(data, 'data');
this.itemInfo = data.data; this.itemInfo = data.data;
this.deviceID = data.data.id; this.deviceID = data.data.id;

View File

@ -175,7 +175,7 @@
url: "/pages/6170/deviceControl/index", url: "/pages/6170/deviceControl/index",
success: (res) => { success: (res) => {
// 页面跳转成功后的回调函数 // 页面跳转成功后的回调函数
res.eventChannel.emit('deviceControl', { res.eventChannel.emit('detailData', {
data: item, data: item,
apiType: 'listB' // 自定义标识 // 自定义标识,详情哪里根据这个参数不同信息 apiType: 'listB' // 自定义标识 // 自定义标识,详情哪里根据这个参数不同信息
}); });

View File

@ -483,53 +483,23 @@
} }
}) })
}, },
// 列表跳转
handleFile(item) { handleFile(item) {
// communicationMode 0是4G 1是蓝牙,考虑多个4g设备 let url = item.detailPageUrl;
if (item.typeName == 'BJQ6170') {
uni.navigateTo({ uni.navigateTo({
url: "/pages/6170/deviceControl/index", url: url,
events: { events: {
ack: function(data) {} ack: function(data) {}
}, },
success: (res) => { 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', { res.eventChannel.emit('detailData', {
data: item data: item,
deviceType: this.tabs[this.activeTab].id || '',
apiType: 'listA' //标识,根据这个参数,区分普通详情,分享跳转详情,查不一样的权限信息
}); });
} }
}) })
}
}, },
onIntall() { onIntall() {
this.page = 1; this.page = 1;

View File

@ -1,5 +1,5 @@
import config from '../config/index.js'; import config from '../config/index.js';
const env = 'production'; //production development //开发of线上 改这里就行 const env = 'development'; //production development //开发of线上 改这里就行
const BASE = config[env]; const BASE = config[env];
const request = (options) => { const request = (options) => {
console.log("options"+JSON.stringify(options),BASE.BASE_URL) console.log("options"+JSON.stringify(options),BASE.BASE_URL)