100J功能开发

This commit is contained in:
fengerli
2026-02-04 15:27:43 +08:00
parent e3f5ef4c91
commit d62d3f734a
4 changed files with 1557 additions and 1351 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
<template>
<view class="maincontent contentBg">
<mescroll-uni class="device-list" @init="mescrollInit" @down="downCallback" @up="upCallback" :up="upOption"
<mescroll-uni class="device-list" @init=" " @down="downCallback" @up="upCallback" :up="upOption"
:down="downOption" :fixed="false" :style="{ height: mescrollHeight + 'px' }">
<uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in dataListA" class="li" :key="index" :ref="'swipeItem_' + index">
@ -27,8 +27,8 @@
</view>
<view class="itemRight ">
<view class="btn" @click.stop="Apply(item,index)"
:class="{'active':item.isApply,'btn-default':!item.isApply}">
{{item.isApply ?'使用中':'使用'}}
:class="{'active':item.useStatus,'btn-default':!item.useStatus}">
{{item.useStatus==1 ?'使用中':'使用'}}
</view>
</view>
<view class="clear"></view>
@ -94,7 +94,8 @@
import {
deviceVoliceList,
videRenameAudioFile,
deviceDeleteAudioFile
deviceDeleteAudioFile,
deviceUpdateVoice
} from '@/api/100J/HBY100-J.js'
import {
showLoading,
@ -185,9 +186,6 @@
createTime: "", //创建时间
fileUrl: "", //本地地址
fileUrl: "", //网络地址
statu: "", //状态,是否公开
isApply: "" //是否使用中
},
cPlay: {
Id: "", //编号
@ -195,8 +193,6 @@
createTime: "", //创建时间
fileUrl: "", //本地地址
fileUrl: "", //网络地址
statu: "", //状态,是否公开
isApply: "" //是否使用中
}
}
},
@ -208,7 +204,7 @@
console.log(rec, 'ressss');
this.blue = rec.ble;
this.device = rec.data;
this.getinitData(rec.data.deviceId,true)
this.getinitData(rec.data.deviceId, true)
});
},
@ -220,7 +216,7 @@
},
methods: {
//语音管理列表
getinitData(val,isLoadMore = false) {
getinitData(val, isLoadMore = false) {
let data = {
deviceId: this.device.deviceId
}
@ -456,40 +452,56 @@
}
},
Apply(item, index) {
if (item.isApply) {
return;
console.log(item, 'itemmm');
let data = {
id: item.id
}
let task = () => {
let fileList = uni.getStorageSync(Common.audioStorageKey);
for (let i = 0; i < these.dataListA.length; i++) {
let ele = these.dataListA[i];
if (i === index) {
these.$set(these.dataListA[index], "isApply", true);
fileList.find(v => {
if (!v.devices) {
v.devices = [];
}
if (v.Id == ele.Id) {
v.devices.push(these.device.id);
return true;
} else {
for (let j = 0; j < v.devices.length; j++) {
if (v.devices[j] === these.device.id) {
v.devices.splice(j, 1);
break
};
}
}
return false;
});
} else {
these.$set(these.dataListA[i], "isApply", false);
}
deviceUpdateVoice(data).then((RES) => {
if (RES.code == 200) {
uni.showToast({
title: RES.msg,
icon: 'none',
duration: 1000
});
console.log("状态修改完成");
// eventChannel.emit('audioApply', item.Id);
console.log("返回上一页");
setTimeout(()=>{
uni.navigateBack();
},1000)
}
console.log("状态修改完成");
eventChannel.emit('audioApply', item.Id);
console.log("返回上一页");
uni.navigateBack();
})
let task = () => {
//let fileList = uni.getStorageSync(Common.audioStorageKey);
// for (let i = 0; i < these.dataListA.length; i++) {
// let ele = these.dataListA[i];
// if (i === index) {
// these.$set(these.dataListA[index], "isApply", true);
// fileList.find(v => {
// if (!v.devices) {
// v.devices = [];
// }
// if (v.Id == ele.Id) {
// v.devices.push(these.device.id);
// return true;
// } else {
// for (let j = 0; j < v.devices.length; j++) {
// if (v.devices[j] === these.device.id) {
// v.devices.splice(j, 1);
// break
// };
// }
// }
// return false;
// });
// } else {
// these.$set(these.dataListA[i], "isApply", false);
// }
// }
}
},
closePop: function() {