merge upstream
This commit is contained in:
@ -24,10 +24,60 @@ export function deviceDeleteAudioFile(params) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 更新语音,使用语音
|
||||||
|
export function deviceUpdateVoice(data) {
|
||||||
|
return request({
|
||||||
|
url: `/app/hby100j/device/updateVoice`,
|
||||||
|
method: 'post',
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
// 100J信息
|
// 100J信息
|
||||||
export function deviceDetail(id) {
|
export function deviceDetail(id) {
|
||||||
return request({
|
return request({
|
||||||
url: `/app/hby100/device/${id}`,
|
url: `/app/hby100j/device/${id}`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 爆闪模式
|
||||||
|
export function deviceStrobeMode(data) {
|
||||||
|
return request({
|
||||||
|
url: `/app/hby100j/device/strobeMode`,
|
||||||
|
method: 'post',
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 强制报警
|
||||||
|
export function deviceForceAlarmActivation(data) {
|
||||||
|
return request({
|
||||||
|
url: `/app/hby100j/device/forceAlarmActivation`,
|
||||||
|
method: 'post',
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 爆闪频率
|
||||||
|
export function deviceStrobeFrequency(data) {
|
||||||
|
return request({
|
||||||
|
url: `/app/hby100j/device/strobeFrequency`,
|
||||||
|
method: 'post',
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 灯光调节亮度
|
||||||
|
export function deviceLightAdjustment(data) {
|
||||||
|
return request({
|
||||||
|
url: `/app/hby100j/device/lightAdjustment`,
|
||||||
|
method: 'post',
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 调节音量
|
||||||
|
export function deviceUpdateVolume(data) {
|
||||||
|
return request({
|
||||||
|
url: `/app/hby100j/device/updateVolume`,
|
||||||
|
method: 'post',
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
const config = {
|
const config = {
|
||||||
// 开发环境
|
// 开发环境
|
||||||
development: {
|
development: {
|
||||||
BASE_URL: 'http://192.168.110.172:8000',//http://139.224.253.23:8000
|
BASE_URL: 'http://192.168.2.34:8000',//http://139.224.253.23:8000
|
||||||
API_PREFIX: '',
|
API_PREFIX: '',
|
||||||
// MQTT 配置
|
// MQTT 配置
|
||||||
MQTT_HOST: 'www.cnxhyc.com',
|
MQTT_HOST: 'www.cnxhyc.com',
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="maincontent contentBg">
|
<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' }">
|
:down="downOption" :fixed="false" :style="{ height: mescrollHeight + 'px' }">
|
||||||
<uni-swipe-action ref="swipeAction">
|
<uni-swipe-action ref="swipeAction">
|
||||||
<view v-for="(item, index) in dataListA" class="li" :key="index" :ref="'swipeItem_' + index">
|
<view v-for="(item, index) in dataListA" class="li" :key="index" :ref="'swipeItem_' + index">
|
||||||
@ -27,8 +27,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="itemRight ">
|
<view class="itemRight ">
|
||||||
<view class="btn" @click.stop="Apply(item,index)"
|
<view class="btn" @click.stop="Apply(item,index)"
|
||||||
:class="{'active':item.isApply,'btn-default':!item.isApply}">
|
:class="{'active':item.useStatus,'btn-default':!item.useStatus}">
|
||||||
{{item.isApply ?'使用中':'使用'}}
|
{{item.useStatus==1 ?'使用中':'使用'}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="clear"></view>
|
<view class="clear"></view>
|
||||||
@ -94,7 +94,8 @@
|
|||||||
import {
|
import {
|
||||||
deviceVoliceList,
|
deviceVoliceList,
|
||||||
videRenameAudioFile,
|
videRenameAudioFile,
|
||||||
deviceDeleteAudioFile
|
deviceDeleteAudioFile,
|
||||||
|
deviceUpdateVoice
|
||||||
} from '@/api/100J/HBY100-J.js'
|
} from '@/api/100J/HBY100-J.js'
|
||||||
import {
|
import {
|
||||||
showLoading,
|
showLoading,
|
||||||
@ -185,9 +186,6 @@
|
|||||||
createTime: "", //创建时间
|
createTime: "", //创建时间
|
||||||
fileUrl: "", //本地地址
|
fileUrl: "", //本地地址
|
||||||
fileUrl: "", //网络地址
|
fileUrl: "", //网络地址
|
||||||
statu: "", //状态,是否公开
|
|
||||||
isApply: "" //是否使用中
|
|
||||||
|
|
||||||
},
|
},
|
||||||
cPlay: {
|
cPlay: {
|
||||||
Id: "", //编号
|
Id: "", //编号
|
||||||
@ -195,8 +193,6 @@
|
|||||||
createTime: "", //创建时间
|
createTime: "", //创建时间
|
||||||
fileUrl: "", //本地地址
|
fileUrl: "", //本地地址
|
||||||
fileUrl: "", //网络地址
|
fileUrl: "", //网络地址
|
||||||
statu: "", //状态,是否公开
|
|
||||||
isApply: "" //是否使用中
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -208,7 +204,7 @@
|
|||||||
console.log(rec, 'ressss');
|
console.log(rec, 'ressss');
|
||||||
this.blue = rec.ble;
|
this.blue = rec.ble;
|
||||||
this.device = rec.data;
|
this.device = rec.data;
|
||||||
this.getinitData(rec.data.deviceId,true)
|
this.getinitData(rec.data.deviceId, true)
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -220,7 +216,7 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//语音管理列表
|
//语音管理列表
|
||||||
getinitData(val,isLoadMore = false) {
|
getinitData(val, isLoadMore = false) {
|
||||||
let data = {
|
let data = {
|
||||||
deviceId: this.device.deviceId
|
deviceId: this.device.deviceId
|
||||||
}
|
}
|
||||||
@ -456,40 +452,56 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
Apply(item, index) {
|
Apply(item, index) {
|
||||||
if (item.isApply) {
|
console.log(item, 'itemmm');
|
||||||
return;
|
let data = {
|
||||||
|
id: item.id
|
||||||
}
|
}
|
||||||
let task = () => {
|
deviceUpdateVoice(data).then((RES) => {
|
||||||
let fileList = uni.getStorageSync(Common.audioStorageKey);
|
if (RES.code == 200) {
|
||||||
for (let i = 0; i < these.dataListA.length; i++) {
|
uni.showToast({
|
||||||
let ele = these.dataListA[i];
|
title: RES.msg,
|
||||||
if (i === index) {
|
icon: 'none',
|
||||||
these.$set(these.dataListA[index], "isApply", true);
|
duration: 1000
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
console.log("状态修改完成");
|
console.log("状态修改完成");
|
||||||
eventChannel.emit('audioApply', item.Id);
|
// eventChannel.emit('audioApply', item.Id);
|
||||||
console.log("返回上一页");
|
console.log("返回上一页");
|
||||||
|
setTimeout(()=>{
|
||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
|
},1000)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
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() {
|
closePop: function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user