100J功能开发
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',
|
||||||
|
|||||||
@ -40,8 +40,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<text class="lbl">设备状态</text>
|
<text class="lbl">设备状态</text>
|
||||||
<text
|
<text class="value status-running">{{ deviceInfo.onlineStatus === 0 ? '离线' : deviceInfo.onlineStatus
|
||||||
class="value status-running">{{ deviceInfo.onlineStatus === 0 ? '离线' : deviceInfo.onlineStatus === 2 ? '故障' : '在线' }}</text>
|
=== 2 ? '故障' : '在线' }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<text class="lbl">定位信息</text>
|
<text class="lbl">定位信息</text>
|
||||||
@ -51,8 +51,8 @@
|
|||||||
{{ deviceInfo && deviceInfo.latitude ? Number(deviceInfo.latitude).toFixed(4) : '' }}
|
{{ deviceInfo && deviceInfo.latitude ? Number(deviceInfo.latitude).toFixed(4) : '' }}
|
||||||
</view>
|
</view>
|
||||||
<view class="info-value status-running locationGPS">
|
<view class="info-value status-running locationGPS">
|
||||||
<!-- <uni-icons @click="toggleForm" type="location" size="17" color="rgba(255, 255, 255, 0.8)"
|
<uni-icons @click="toggleForm" type="location" size="17" color="rgba(255, 255, 255, 0.8)"
|
||||||
style="vertical-align: bottom;" /> -->
|
style="vertical-align: bottom;" />
|
||||||
{{ deviceInfo.address }}
|
{{ deviceInfo.address }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -62,7 +62,7 @@
|
|||||||
<view class="sosContent">
|
<view class="sosContent">
|
||||||
<view class="btnSos openSos center" :class="{ active: formData.sta_SOSType === 1 }"
|
<view class="btnSos openSos center" :class="{ active: formData.sta_SOSType === 1 }"
|
||||||
@click="sosSetting(1)">
|
@click="sosSetting(1)">
|
||||||
{{ formData.sta_SOSType === 1 ? '报警中' : '强制报警' }}
|
{{ deviceInfo.chargeState === 1 ? '报警中' : '强制报警' }}
|
||||||
</view>
|
</view>
|
||||||
<view class="btnSos closeSos center" @click="sosSetting(0)">解除</view>
|
<view class="btnSos closeSos center" @click="sosSetting(0)">解除</view>
|
||||||
</view>
|
</view>
|
||||||
@ -97,19 +97,18 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="lampMode">
|
<view class="lampMode">
|
||||||
<view class="mode fleft " v-on:click.stop="openVolume(null, '8')"
|
<view class="mode fleft " v-on:click.stop="openVolume(null, '9')"
|
||||||
:class="{ 'active': formData.sta_VoiceType === '8' }">
|
:class="{ 'active': formData.sta_VoiceType === '9' }">
|
||||||
<view class="leftImg">
|
<view class="leftImg">
|
||||||
<image class="img" :class="{ 'displayNone': formData.sta_VoiceType === '8' }"
|
<image class="img" :class="{ 'displayNone': formData.sta_VoiceType === '9' }"
|
||||||
src="/static/images/common/play.png" mode="aspectFit"></image>
|
src="/static/images/common/play.png" mode="aspectFit"></image>
|
||||||
<image class="img" :class="{ 'displayNone': formData.sta_VoiceType !== '8' }"
|
<image class="img" :class="{ 'displayNone': formData.sta_VoiceType !== '9' }"
|
||||||
src="/static/images/common/pauseActive.png" mode="aspectFit"></image>
|
src="/static/images/common/pauseActive.png" mode="aspectFit"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="rightTxt">
|
<view class="rightTxt">
|
||||||
<text class="bigTxt">播放语音</text>
|
<text class="bigTxt">播放语音</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="mode fleft marginLeft" v-on:click.stop="audioManager(deviceInfo)">
|
<view class="mode fleft marginLeft" v-on:click.stop="audioManager(deviceInfo)">
|
||||||
<view class="leftImg">
|
<view class="leftImg">
|
||||||
<image class="img" src="/static/images/common/uploadCloud.png" mode="aspectFit"></image>
|
<image class="img" src="/static/images/common/uploadCloud.png" mode="aspectFit"></image>
|
||||||
@ -161,27 +160,21 @@
|
|||||||
<text class="sliderTxt">频率</text>
|
<text class="sliderTxt">频率</text>
|
||||||
<text class="sliderVal">{{ formData.sta_LightFreq }}HZ</text>
|
<text class="sliderVal">{{ formData.sta_LightFreq }}HZ</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="slider-container">
|
<view class="slider-container">
|
||||||
<slider min="0.5" max="10" step="0.5" :disabled="false" :value="formData.sta_LightFreq"
|
<slider min="0.5" max="10" step="0.5" :disabled="false" :value="formData.sta_LightFreq"
|
||||||
activeColor="#bbe600" backgroundColor="#686767" block-size="20" block-color="#ffffffde"
|
activeColor="#bbe600" backgroundColor="#686767" block-size="20" block-color="#ffffffde"
|
||||||
@change="onFreqChanging" @changing="onFreqChanging" class="custom-slider" />
|
@change="onFreqChanging" @changing="onFreqChanging" class="custom-slider" />
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="line"></view>
|
<view class="line"></view>
|
||||||
<view class="header paddingTop0">
|
<view class="header paddingTop0">
|
||||||
<text class="sliderTxt">音量</text>
|
<text class="sliderTxt">音量</text>
|
||||||
<text class="sliderVal">{{ formData.sta_VoiceVolume }}</text>
|
<text class="sliderVal">{{ formData.sta_VoiceVolume }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="slider-container">
|
<view class="slider-container">
|
||||||
<slider min="1" max="8" step="1" :disabled="false" :value="formData.sta_VoiceVolume"
|
<slider min="1" max="8" step="1" :disabled="false" :value="formData.sta_VoiceVolume"
|
||||||
activeColor="#bbe600" backgroundColor="#686767" block-size="20" block-color="#ffffffde"
|
activeColor="#bbe600" backgroundColor="#686767" block-size="20" block-color="#ffffffde"
|
||||||
@change="onVolumeChanging" @changing="onVolumeChanging" class="custom-slider" />
|
@change="onVolumeChanging" @changing="onVolumeChanging" class="custom-slider" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<view class="proinfo lamp">
|
<view class="proinfo lamp">
|
||||||
<text class="title">产品信息</text>
|
<text class="title">产品信息</text>
|
||||||
<view class="itemcontent">
|
<view class="itemcontent">
|
||||||
@ -202,7 +195,6 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 弹窗通知 -->
|
<!-- 弹窗通知 -->
|
||||||
<MessagePopup :visible="Status.Pop.showPop" :type="Status.Pop.popType" :bgColor="Status.Pop.bgColor"
|
<MessagePopup :visible="Status.Pop.showPop" :type="Status.Pop.popType" :bgColor="Status.Pop.bgColor"
|
||||||
:borderColor="Status.Pop.borderColor" :textColor="Status.Pop.textColor"
|
:borderColor="Status.Pop.borderColor" :textColor="Status.Pop.textColor"
|
||||||
@ -228,7 +220,12 @@
|
|||||||
baseURL
|
baseURL
|
||||||
} from '@/utils/request.js';
|
} from '@/utils/request.js';
|
||||||
import {
|
import {
|
||||||
deviceDetail
|
deviceDetail,
|
||||||
|
deviceStrobeMode,
|
||||||
|
deviceForceAlarmActivation,
|
||||||
|
deviceStrobeFrequency,
|
||||||
|
deviceLightAdjustment,
|
||||||
|
deviceUpdateVolume
|
||||||
} from '@/api/100J/HBY100-J.js'
|
} from '@/api/100J/HBY100-J.js'
|
||||||
var these = null;
|
var these = null;
|
||||||
import Common from '@/utils/Common.js'
|
import Common from '@/utils/Common.js'
|
||||||
@ -305,7 +302,7 @@
|
|||||||
macAddress: '',
|
macAddress: '',
|
||||||
bleStatu: false,
|
bleStatu: false,
|
||||||
sta_address: '',
|
sta_address: '',
|
||||||
sta_VoiceType: '',
|
sta_VoiceType: '0',
|
||||||
sta_VoiceVolume: 1,
|
sta_VoiceVolume: 1,
|
||||||
sta_LightType: '',
|
sta_LightType: '',
|
||||||
sta_LightFreq: 0.5,
|
sta_LightFreq: 0.5,
|
||||||
@ -321,8 +318,8 @@
|
|||||||
name: '消防',
|
name: '消防',
|
||||||
show: true
|
show: true
|
||||||
},
|
},
|
||||||
"2": {
|
"0": {
|
||||||
key: "2",
|
key: "0",
|
||||||
name: '公安',
|
name: '公安',
|
||||||
show: true
|
show: true
|
||||||
},
|
},
|
||||||
@ -336,8 +333,8 @@
|
|||||||
name: '市政',
|
name: '市政',
|
||||||
show: true
|
show: true
|
||||||
},
|
},
|
||||||
"5": {
|
"2": {
|
||||||
key: "5",
|
key: "2",
|
||||||
name: '应急',
|
name: '应急',
|
||||||
show: true
|
show: true
|
||||||
},
|
},
|
||||||
@ -346,60 +343,60 @@
|
|||||||
name: '医疗',
|
name: '医疗',
|
||||||
show: true
|
show: true
|
||||||
},
|
},
|
||||||
"7": {
|
"5": {
|
||||||
key: "7",
|
key: "5",
|
||||||
name: '铁道',
|
name: '铁道',
|
||||||
show: true
|
show: true
|
||||||
},
|
},
|
||||||
"8": {
|
"9": {
|
||||||
key: "8",
|
key: "9",
|
||||||
name: 'app语音',
|
name: 'app语音',
|
||||||
show: false
|
show: false
|
||||||
},
|
},
|
||||||
"0": {
|
"-1": {
|
||||||
key: "0",
|
key: "-1",
|
||||||
name: '关闭',
|
name: '关闭',
|
||||||
show: false
|
show: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
sta_LightType: [{
|
sta_LightType: [{
|
||||||
key: "1",
|
key: "6",
|
||||||
name: '红蓝',
|
name: '红蓝',
|
||||||
show: true
|
show: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "2",
|
key: "0",
|
||||||
name: '红闪',
|
name: '红闪',
|
||||||
show: true
|
show: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "3",
|
key: "2",
|
||||||
name: '黄闪',
|
name: '黄闪',
|
||||||
show: true
|
show: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "4",
|
key: "1",
|
||||||
name: '蓝闪',
|
name: '蓝闪',
|
||||||
show: true
|
show: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "5",
|
key: "3",
|
||||||
name: '红流水',
|
name: '红流水',
|
||||||
show: true
|
show: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "6",
|
key: "4",
|
||||||
name: '黄流水',
|
name: '黄流水',
|
||||||
show: true
|
show: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "7",
|
key: "5",
|
||||||
name: '蓝流水',
|
name: '蓝流水',
|
||||||
show: true
|
show: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "0",
|
key: "-1",
|
||||||
name: '关闭',
|
name: '关闭',
|
||||||
show: false
|
show: false
|
||||||
}
|
}
|
||||||
@ -465,6 +462,7 @@
|
|||||||
console.log(data, 'datatatatat');
|
console.log(data, 'datatatatat');
|
||||||
these.fetchDeviceDetail(data.data.id)
|
these.fetchDeviceDetail(data.data.id)
|
||||||
});
|
});
|
||||||
|
this.createThrottledFunctions();
|
||||||
|
|
||||||
},
|
},
|
||||||
onHide: function () {
|
onHide: function () {
|
||||||
@ -476,7 +474,14 @@
|
|||||||
computed: {
|
computed: {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
createThrottledFunctions() {
|
||||||
|
// 创建节流函数
|
||||||
|
this.throttledBrightnessChange = this.throttle(this.handleBrightnessChange, 500);
|
||||||
|
this.throttledFreqChange = this.throttle(this.handleFreqChange, 500);
|
||||||
|
this.throttledVolumeChange = this.throttle(this.handleVolumeChange, 500);
|
||||||
|
},
|
||||||
// 获取设备详情(普通详情)
|
// 获取设备详情(普通详情)
|
||||||
fetchDeviceDetail(id) {
|
fetchDeviceDetail(id) {
|
||||||
deviceDetail(id).then((res) => {
|
deviceDetail(id).then((res) => {
|
||||||
@ -516,18 +521,7 @@
|
|||||||
if (this.Status.apiType !== 'listA') { }
|
if (this.Status.apiType !== 'listA') { }
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/100J/audioManager/AudioList',
|
url: '/pages/100J/audioManager/AudioList',
|
||||||
events: {
|
events: {},
|
||||||
audioApply: function(id) {
|
|
||||||
//应用某个语音时,将数据发送给设备
|
|
||||||
console.log("准备发送数据", id);
|
|
||||||
showLoading(these, {
|
|
||||||
text: '准备发送数据'
|
|
||||||
});
|
|
||||||
these.audioData.hexs = uni.getStorageSync(Common.pcmStorageKey + "_" + id);
|
|
||||||
console.log("hexs.length=", these.audioData.hexs.length)
|
|
||||||
these.HoldYouHand();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
// 页面跳转成功后的回调函数
|
// 页面跳转成功后的回调函数
|
||||||
res.eventChannel.emit('deviceData', {
|
res.eventChannel.emit('deviceData', {
|
||||||
@ -539,17 +533,141 @@
|
|||||||
//频率
|
//频率
|
||||||
onFreqChanging(e) {
|
onFreqChanging(e) {
|
||||||
this.formData.sta_LightFreq = e.detail.value;
|
this.formData.sta_LightFreq = e.detail.value;
|
||||||
|
this.throttledFreqChange(e.detail.value);
|
||||||
},
|
},
|
||||||
//音量
|
//音量
|
||||||
onVolumeChanging(e) {
|
onVolumeChanging(e) {
|
||||||
this.formData.sta_VoiceVolume = e.detail.value;
|
this.formData.sta_VoiceVolume = e.detail.value;
|
||||||
|
this.throttledVolumeChange(e.detail.value);
|
||||||
},
|
},
|
||||||
|
|
||||||
// 亮度调节
|
// 亮度调节
|
||||||
onBrightnessChanging(e) {
|
onBrightnessChanging(e) {
|
||||||
this.formData.sta_LightDimmer = e.detail.value;
|
this.formData.sta_LightDimmer = e.detail.value;
|
||||||
|
this.throttledBrightnessChange(e.detail.value);
|
||||||
},
|
},
|
||||||
|
// 亮度调节
|
||||||
|
handleBrightnessChange(brightnessValue) {
|
||||||
|
let data = {
|
||||||
|
deviceId: this.deviceInfo.deviceId,
|
||||||
|
brightness: brightnessValue
|
||||||
|
};
|
||||||
|
console.log('发送亮度调节请求:', data);
|
||||||
|
deviceLightAdjustment(data).then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
console.log('亮度调节成功');
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg || '调节失败',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).catch((err) => {
|
||||||
|
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 频率调节
|
||||||
|
handleFreqChange(freqValue) {
|
||||||
|
let data = {
|
||||||
|
deviceId: this.deviceInfo.deviceId,
|
||||||
|
frequency: freqValue
|
||||||
|
};
|
||||||
|
|
||||||
|
deviceStrobeFrequency(data).then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg || '调节失败',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).catch((err) => {
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 音量调节处理函数
|
||||||
|
handleVolumeChange(volumeValue) {
|
||||||
|
let data = {
|
||||||
|
deviceId: this.deviceInfo.deviceId,
|
||||||
|
volume: volumeValue
|
||||||
|
};
|
||||||
|
deviceUpdateVolume(data).then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).catch((err) => {
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 节流函数
|
||||||
|
throttle(func, delay = 500) {
|
||||||
|
let timer = null;
|
||||||
|
let lastArgs = null;
|
||||||
|
let lastThis = null;
|
||||||
|
return function (...args) {
|
||||||
|
lastArgs = args;
|
||||||
|
lastThis = this;
|
||||||
|
|
||||||
|
if (!timer) {
|
||||||
|
timer = setTimeout(() => {
|
||||||
|
timer = null;
|
||||||
|
func.apply(lastThis, lastArgs);
|
||||||
|
}, delay);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
},
|
||||||
|
// 警示灯开关闭
|
||||||
lightTypeSet(item, index) {
|
lightTypeSet(item, index) {
|
||||||
this.formData.sta_LightType = item.key;
|
let val = item.key;
|
||||||
|
// 切换选中/取消选中逻辑
|
||||||
|
if (this.formData.sta_LightType === val) {
|
||||||
|
val = '-1';
|
||||||
|
}
|
||||||
|
this.formData.sta_LightType = val;
|
||||||
|
let data = {
|
||||||
|
deviceId: this.deviceInfo.deviceId,
|
||||||
|
// 开启/关闭:选中模式时传1,关闭时传0
|
||||||
|
enable: val === '-1' ? 0 : 1,
|
||||||
|
// 0 红色爆闪,1 蓝色爆闪,2 黄色爆闪,3,红色顺时针旋转爆闪,4黄色顺时针旋转爆闪,5,红蓝顺时针旋转爆闪,6 红蓝交替爆闪
|
||||||
|
mode: item.key
|
||||||
|
};
|
||||||
|
deviceStrobeMode(data).then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
const tipText = data.enable === 1 ? '开启成功' : '关闭成功';
|
||||||
|
uni.showToast({
|
||||||
|
title: tipText,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
// 报警模式
|
// 报警模式
|
||||||
setUsrToggle() {
|
setUsrToggle() {
|
||||||
@ -557,21 +675,25 @@
|
|||||||
},
|
},
|
||||||
// 播放语音
|
// 播放语音
|
||||||
openVolume(item, index) {
|
openVolume(item, index) {
|
||||||
if (item) {
|
if (!item) {
|
||||||
console.log(item.key, 'keyyy');
|
item = this.dic.sta_VoiceType[index];
|
||||||
this.formData.sta_VoiceType = item.key;
|
|
||||||
} else if (index === '8') { // 点击“播放语音”的场景
|
|
||||||
this.formData.sta_VoiceType = '8';
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
let val = item.key;
|
||||||
|
if (this.formData.sta_VoiceType === val) {
|
||||||
|
val = '-1';
|
||||||
|
}
|
||||||
|
this.formData.sta_VoiceType = val;
|
||||||
},
|
},
|
||||||
// 报警模式
|
// 报警模式
|
||||||
sosSetting(item) {
|
sosSetting(item) {
|
||||||
const isClose = item === 0;
|
console.log(this.deviceInfo, '44444');
|
||||||
|
console.log(item, 'tent');
|
||||||
|
const isClose = item.key === "-1";
|
||||||
if (!this.Status) this.Status = {};
|
if (!this.Status) this.Status = {};
|
||||||
if (!this.Status.Pop) this.Status.Pop = {
|
if (!this.Status.Pop) this.Status.Pop = {
|
||||||
showPop: false
|
showPop: false
|
||||||
};
|
};
|
||||||
|
|
||||||
// 弹窗配置
|
// 弹窗配置
|
||||||
this.Status.Pop = {
|
this.Status.Pop = {
|
||||||
...this.Status.Pop,
|
...this.Status.Pop,
|
||||||
@ -583,11 +705,31 @@
|
|||||||
showCancel: true,
|
showCancel: true,
|
||||||
buttonCancelText: '取消',
|
buttonCancelText: '取消',
|
||||||
okCallback: () => {
|
okCallback: () => {
|
||||||
this.formData.sta_SOSType = item;
|
console.log(this.formData.sta_SOSType, 'this.formData.sta_SOSType');
|
||||||
|
const data = {
|
||||||
|
deviceIds: [this.deviceInfo.deviceId],
|
||||||
|
// 声光报警开关:关闭传0,开启传1
|
||||||
|
voiceStrobeAlarm: isClose ? 0 : 1,
|
||||||
|
mode: this.formData.sta_VoiceType
|
||||||
|
};
|
||||||
|
deviceForceAlarmActivation(data).then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: isClose ? '声光报警已解除' : '强制报警已开启',
|
title: isClose ? '声光报警已解除' : '强制报警已开启',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).catch((err) => {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请求失败,请重试',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@ -824,10 +966,12 @@
|
|||||||
font-family: PingFang SC;
|
font-family: PingFang SC;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
|
||||||
letter-spacing: 0.07px;
|
letter-spacing: 0.07px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
.eqinfo .status-running{
|
||||||
|
color: rgba(174, 214, 0, 1);
|
||||||
|
}
|
||||||
|
|
||||||
.lamp {
|
.lamp {
|
||||||
margin-top: 24rpx;
|
margin-top: 24rpx;
|
||||||
|
|||||||
@ -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: "" //是否使用中
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -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