1506 lines
32 KiB
Vue
1506 lines
32 KiB
Vue
<template>
|
||
<view class="content contentBg">
|
||
<view class="eq">
|
||
<view class="leftImg" @click.stop="previewImg(formData.img)">
|
||
<image class="img" :src="formData.img" mode="aspectFit"></image>
|
||
</view>
|
||
<view class="rightTxt">
|
||
<view class="row">
|
||
<image class="img" src="/static/images/6155/DeviceDetail/battry.png" mode="aspectFit"></image>
|
||
<view class="txt">
|
||
<view class="bigTxt">{{formData.battary}}%</view>
|
||
<view class="smallTxt">电量</view>
|
||
</view>
|
||
</view>
|
||
<view class="row">
|
||
<image class="img" src="/static/images/6155/DeviceDetail/time.png" mode="aspectFit"></image>
|
||
<view class="txt">
|
||
<view class="bigTxt">{{formData.xuhang}}</view>
|
||
<view class="smallTxt">续航时间</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
<view class="eqinfo">
|
||
|
||
<view class="item">
|
||
<text class="lbl">蓝牙名称</text>
|
||
<text class="value">{{formData.blename}}</text>
|
||
</view>
|
||
<view class="item">
|
||
<text class="lbl">设备名称</text>
|
||
<text class="value">{{formData.deviceName}}</text>
|
||
</view>
|
||
<view class="item">
|
||
<text class="lbl">蓝牙状态</text>
|
||
<text class="value" :class="formData.bleStatu?'green':'red'">{{formData.bleStatu?'已连接':'未连接'}}</text>
|
||
</view>
|
||
|
||
</view>
|
||
<view class="lamp">
|
||
<view class="title">
|
||
<text>照明模式</text>
|
||
<text @click="showLihgtPercent('shuxie')"
|
||
:class="formData.lightCurr=='shuxie'?'active':'noActive'">亮度</text>
|
||
</view>
|
||
</view>
|
||
|
||
|
||
<view class="lightMode">
|
||
<view class="item" @click="lightSetting('shuxie')" @longpress="showLihgtPercent('shuxie')"
|
||
:class="formData.lightCurr=='shuxie'?'active':''">
|
||
<view class="imgContent center">
|
||
<image class="img"
|
||
:src="formData.lightCurr=='shuxie'?'/static/images/6331/shuxieActive.png':'/static/images/6331/shuXie.png'"
|
||
mode="aspectFit"></image>
|
||
</view>
|
||
<view class="txt">书写</view>
|
||
</view>
|
||
<view class="item" @click="lightSetting('work')" :class="formData.lightCurr=='work'?'active':''">
|
||
<view class="imgContent center">
|
||
<image class="img"
|
||
:src="formData.lightCurr=='work'?'/static/images/6331/workActive.png':'/static/images/6331/work.png'"
|
||
mode="aspectFit"></image>
|
||
</view>
|
||
<view class="txt">工作光</view>
|
||
</view>
|
||
<view class="item" @click="lightSetting('jieN')" :class="formData.lightCurr=='jieN'?'active':''">
|
||
<view class="imgContent center">
|
||
<image class="img"
|
||
:src="formData.lightCurr=='jieN'?'/static/images/6331/jieNActive.png':'/static/images/6331/jieN.png'"
|
||
mode="aspectFit"></image>
|
||
</view>
|
||
<view class="txt">节能光</view>
|
||
</view>
|
||
</view>
|
||
<view class="lamp">
|
||
<view class="title">
|
||
<text>警示灯模式</text>
|
||
|
||
</view>
|
||
</view>
|
||
<view class="modeSetting">
|
||
<view class="item" :class="formData.modeCurr=='rb'?'active':''" @click="warnLightSetting('rb')">
|
||
<view class="p100 center line15">
|
||
<view>
|
||
<view>红蓝</view>
|
||
<view>闪烁</view>
|
||
</view>
|
||
|
||
</view>
|
||
|
||
</view>
|
||
<view class="item " :class="formData.modeCurr=='yellow'?'active':''" @click="warnLightSetting('yellow')">
|
||
<view class="p100 center line15">
|
||
<view>
|
||
<view>黄光</view>
|
||
<view>频闪</view>
|
||
</view>
|
||
|
||
</view>
|
||
|
||
</view>
|
||
<view class="item " :class="formData.modeCurr=='quwen'?'active':''" @click="warnLightSetting('quwen')">
|
||
<view class="p100 center">驱蚊</view>
|
||
</view>
|
||
|
||
</view>
|
||
|
||
|
||
<view class="lamp">
|
||
<view class="title">
|
||
<text>语音播报</text>
|
||
|
||
</view>
|
||
</view>
|
||
|
||
<view class="lampMode">
|
||
<view class="mode fleft noMargintop" :class="formData.cMode?'active':''" v-on:click.stop="playAudio()">
|
||
<view class="leftImg">
|
||
<image class="img" src="/static/images/6331/play.png" mode="aspectFit"></image>
|
||
</view>
|
||
<view class="rightTxt">
|
||
<text class="bigTxt">播放语音</text>
|
||
|
||
</view>
|
||
</view>
|
||
|
||
<view class="mode fleft marginLeft noMargintop" :class="formData.cMode?'active':''"
|
||
v-on:click.stop="audioManage()">
|
||
<view class="leftImg">
|
||
<image class="img" src="/static/images/6331/upload.png" mode="aspectFit"></image>
|
||
</view>
|
||
<view class="rightTxt">
|
||
<text class="bigTxt">语音管理</text>
|
||
|
||
</view>
|
||
</view>
|
||
|
||
<view class="mode fleft" :class="formData.cMode?'active':''" v-on:click.stop="volumeSetting()">
|
||
<view class="leftImg">
|
||
<image class="img" src="/static/images/6331/volume.png" mode="aspectFit"></image>
|
||
</view>
|
||
<view class="rightTxt">
|
||
<text class="bigTxt">音量调节</text>
|
||
|
||
</view>
|
||
</view>
|
||
<view class="clear"></view>
|
||
</view>
|
||
|
||
|
||
<view class="proinfo lamp">
|
||
<text class="title">产品信息</text>
|
||
<view class="itemcontent">
|
||
<view class="item" @click="proParam()">
|
||
<image class="img" src="/static/images/6155/DeviceDetail/param.png" mode="aspectFit"></image>
|
||
<text class="txt">产品参数</text>
|
||
</view>
|
||
<view class="item" @click="handRemark()">
|
||
<image class="img" src="/static/images/6155/DeviceDetail/remark.png" mode="aspectFit"></image>
|
||
<text class="txt">操作说明</text>
|
||
</view>
|
||
<view class="item" @click="handVideo()">
|
||
<image class="img" src="/static/images/6155/DeviceDetail/video.png" mode="aspectFit"></image>
|
||
<text class="txt">操作视频</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 弹窗通知 -->
|
||
<MessagePopup :visible="Status.Pop.showPop" :type="Status.Pop.popType" :bgColor="Status.Pop.bgColor"
|
||
:borderColor="Status.Pop.borderColor" :textColor="Status.Pop.textColor"
|
||
:buttonBgColor="Status.Pop.buttonBgColor" :buttonTextColor="Status.Pop.buttonTextColor"
|
||
:iconUrl="Status.Pop.iconUrl" :message="Status.Pop.message" :buttonText="Status.Pop.buttonText"
|
||
@buttonClick="HidePop" :visiblePrompt="Status.Pop.visiblePrompt" :promptTitle="Status.Pop.promptTitle"
|
||
v-model="Status.Pop.modelValue" @closePop="closePop" :showSlot="Status.Pop.showSlot">
|
||
|
||
<view :class="Status.showLightingSet?'':'displayNone'">
|
||
<view class="slideTitle">
|
||
<text>亮度</text>
|
||
<text>{{formData.liangDu}}%</text>
|
||
</view>
|
||
<view class="slider-container">
|
||
<slider min="1" max="100" step="1" :disabled="false" :value="formData.liangDu" activeColor="#bbe600"
|
||
backgroundColor="#00000000" block-size="20" block-color="#ffffffde" @change="sliderChange"
|
||
@changing="sliderChange" class="custom-slider" />
|
||
|
||
</view>
|
||
</view>
|
||
|
||
<view :class="Status.showVolumeSet?'':'displayNone'">
|
||
<view class="slideTitle">
|
||
<text>音量</text>
|
||
<text>{{formData.volume}}%</text>
|
||
</view>
|
||
<view class="slider-container">
|
||
<slider min="1" max="100" step="1" :disabled="false" :value="formData.volume" activeColor="#bbe600"
|
||
backgroundColor="#00000000" block-size="20" block-color="#ffffffde" @change="sliderChange"
|
||
@changing="sliderChange" class="custom-slider" />
|
||
|
||
</view>
|
||
</view>
|
||
|
||
</MessagePopup>
|
||
|
||
<!-- 下方菜单 -->
|
||
<BottomSlideMenuPlus :config="Status.BottomMenu" @close="closeMenu" @itemClick="handleItemClick"
|
||
@btnClick="btnClick">
|
||
<view>
|
||
<view class="addIco">
|
||
<view class="icoContent center" v-on:click.stop="checkImgUpload()">
|
||
<image mode="aspectFit" class="img" src="/static/images/6155/DeviceDetail/add.png"></image>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</BottomSlideMenuPlus>
|
||
|
||
<global-loading ref="loading" />
|
||
|
||
|
||
</view>
|
||
</template>
|
||
|
||
<script>
|
||
import gbk from '@/utils/gbk.js'
|
||
import BleTool from '@/utils/BleHelper.js'
|
||
import BleReceive from '@/utils/BleReceive';
|
||
import {
|
||
showLoading,
|
||
hideLoading,
|
||
updateLoading
|
||
} from '@/utils/loading.js'
|
||
import {
|
||
request,
|
||
baseURL
|
||
} from '../../utils/request';
|
||
|
||
import usrApi from '@/api/670/HBY670.js'
|
||
const pagePath = "pages/6331/BJQ6331";
|
||
|
||
var ble = null;
|
||
var these = null;
|
||
var recei = null;
|
||
var slideTime = null;
|
||
|
||
export default {
|
||
data() {
|
||
return {
|
||
Status: {
|
||
showLightingSet: false,
|
||
showVolumeSet: false,
|
||
Pop: {
|
||
showPop: false, //是否显示弹窗
|
||
popType: 'custom',
|
||
bgColor: '#383934bd',
|
||
borderColor: '#BBE600',
|
||
textColor: '#ffffffde',
|
||
buttonBgColor: '#BBE600',
|
||
buttonTextColor: '#232323DE',
|
||
iconUrl: '',
|
||
message: '您确定要这样做吗?',
|
||
buttonText: '确定',
|
||
clickEvt: '',
|
||
visiblePrompt: false,
|
||
promptTitle: '设备名称',
|
||
modelValue: '',
|
||
visibleClose: false,
|
||
okCallback: null,
|
||
showSlot: false
|
||
},
|
||
BottomMenu: {
|
||
show: false,
|
||
showHeader: true,
|
||
menuItems: [{
|
||
text: '强光',
|
||
icon: '/static/images/6155/DeviceDetail/qiang.png'
|
||
},
|
||
{
|
||
text: '弱光',
|
||
icon: '/static/images/6155/DeviceDetail/ruo.png'
|
||
},
|
||
{
|
||
text: '爆闪',
|
||
icon: '/static/images/6155/DeviceDetail/shan.png'
|
||
}
|
||
],
|
||
activeIndex: -1,
|
||
bgColor: '#2a2a2a',
|
||
itemBgColor: '#3a3a3a',
|
||
textColor: '#ffffffde',
|
||
textAlign: 'flex-start',
|
||
title: '主灯模式',
|
||
showDivider: false,
|
||
dividerColor: '#00000000',
|
||
dividerThickness: '0rpx',
|
||
dividerMargin: '10rpx',
|
||
itemHeight: '80rpx',
|
||
type: '',
|
||
showBtn: true,
|
||
btnBgColor: "#bbe600",
|
||
btnText: "确定",
|
||
btnTextColor: "#232323de",
|
||
showMask: true,
|
||
maskBgColor: '#00000066',
|
||
showClose: false
|
||
},
|
||
usrToggle: true,
|
||
},
|
||
formData: {
|
||
img: '/static/images/6155/DeviceDetail/equip.png',
|
||
battary: '',
|
||
xuhang: '',
|
||
blename: '',
|
||
deviceName: '',
|
||
lightCurr: '',
|
||
liangDu: 100,
|
||
modeCurr: '',
|
||
bleStatu: false,
|
||
deviceId: '',
|
||
volume: 100
|
||
},
|
||
|
||
device: {
|
||
id: "",
|
||
deviceName: "",
|
||
deviceImei: "",
|
||
deviceMac: "",
|
||
communicationMode: 0,
|
||
devicePic: "",
|
||
typeName: "",
|
||
bluetoothName: null,
|
||
deviceStatus: null,
|
||
bindingTime: "",
|
||
onlineStatus: 0,
|
||
battery: "0",
|
||
latitude: null,
|
||
longitude: null,
|
||
alarmStatus: null,
|
||
detailPageUrl: "/pages/6331/BJQ6331",
|
||
showConfirm: false
|
||
}
|
||
}
|
||
},
|
||
|
||
onUnload() {
|
||
console.log("页面卸载,释放资源");
|
||
ble.removeAllCallback(pagePath);
|
||
},
|
||
onLoad: function() {
|
||
these = this;
|
||
recei = BleReceive.getBleReceive();
|
||
ble = BleTool.getBleTool();
|
||
|
||
|
||
ble.addReceiveCallback(these.bleValueNotify, pagePath);
|
||
ble.addStateBreakCallback(these.bleStateBreak, pagePath);
|
||
ble.addStateRecoveryCallback(these.bleStateRecovry, pagePath);
|
||
ble.addDisposeCallback(these.deviceDispose, pagePath);
|
||
ble.addRecoveryCallback(these.deviceRecovry, pagePath);
|
||
|
||
|
||
let eventChannel = this.getOpenerEventChannel();
|
||
|
||
eventChannel.on('detailData', function(data) {
|
||
|
||
// console.log("收到父页面的参数:" + JSON.stringify(data));
|
||
var device = data.data;
|
||
these.device = device;
|
||
let f = ble.data.LinkedList.find((v) => {
|
||
if (v.macAddress == device.deviceMac) {
|
||
// console.log("找到设备了", v);
|
||
these.formData.deviceId = v.deviceId;
|
||
return true;
|
||
}
|
||
return false;
|
||
});
|
||
if (!f) {
|
||
|
||
|
||
these.showBleUnConnect();
|
||
these.getDetail();
|
||
return;
|
||
}
|
||
let form = f.formData;
|
||
if (form) {
|
||
let keys = Object.keys(form);
|
||
for (var i = keys.length; i >= 0; i--) {
|
||
let key = keys[i];
|
||
if (key in these.formData) {
|
||
these.formData[key] = form[key];
|
||
}
|
||
|
||
}
|
||
}
|
||
these.formData.blename = f.name ? f.name : "Unname";
|
||
these.formData.deviceName = device.deviceName;
|
||
these.formData.img = device.devicePic;
|
||
|
||
these.formData.deviceId = f.deviceId;
|
||
ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => {
|
||
these.formData.bleStatu = true;
|
||
});
|
||
these.setBleFormData();
|
||
these.getDetail();
|
||
|
||
|
||
});
|
||
|
||
},
|
||
onHide: function() {
|
||
this.Status.pageHide = true;
|
||
},
|
||
onShow() {
|
||
this.Status.pageHide = false;
|
||
},
|
||
computed: {
|
||
|
||
},
|
||
methods: {
|
||
sliderChange: function(evt) {
|
||
|
||
let val = evt.detail.value;
|
||
let type = "";
|
||
if (this.Status.showLightingSet) {
|
||
this.formData.liangDu = val;
|
||
type = "liangdu";
|
||
} else {
|
||
this.formData.volume = val;
|
||
type = "volume"
|
||
}
|
||
clearTimeout(slideTime)
|
||
//给蓝牙设备发送信号更新亮度
|
||
slideTime = setTimeout(() => {
|
||
this.bleSendCmd(type, val)
|
||
}, 200);
|
||
},
|
||
closeSetPop() {
|
||
this.Status.showLightingSet = false;
|
||
this.Status.showVolumeSet = false;
|
||
},
|
||
playAudio() { //播放语音
|
||
let play = () => {
|
||
alert('正在播放中');
|
||
}
|
||
this.showPop({
|
||
showPop: true, //是否显示弹窗
|
||
popType: 'custom',
|
||
bgColor: '#383934bd',
|
||
borderColor: '#FFC84E1E',
|
||
textColor: '#ffffffde',
|
||
buttonBgColor: '#FFC84E',
|
||
buttonTextColor: '#232323DE',
|
||
iconUrl: '',
|
||
message: '确认播放设备语音内容?',
|
||
buttonText: '确定',
|
||
clickEvt: '',
|
||
visiblePrompt: false,
|
||
promptTitle: '',
|
||
modelValue: '',
|
||
visibleClose: true,
|
||
okCallback: play
|
||
});
|
||
},
|
||
audioManage() { //语音管理
|
||
uni.navigateTo({
|
||
url: '/pages/6331/AudioManager',
|
||
success(res) {
|
||
res.eventChannel.emit("deviceData", these.device);
|
||
},
|
||
events: {
|
||
over: function(data) {
|
||
|
||
}
|
||
}
|
||
})
|
||
},
|
||
volumeSetting() { //音量设置
|
||
this.Status.showVolumeSet = true;
|
||
|
||
this.showPop({
|
||
showPop: true, //是否显示弹窗
|
||
popType: 'custom',
|
||
bgColor: '#38393466',
|
||
borderColor: '#00000000',
|
||
textColor: '#ffffffde',
|
||
buttonBgColor: '#FFC84E',
|
||
buttonTextColor: '#232323DE',
|
||
iconUrl: '',
|
||
message: '',
|
||
buttonText: '',
|
||
clickEvt: '',
|
||
visiblePrompt: false,
|
||
promptTitle: '',
|
||
modelValue: '',
|
||
visibleClose: true,
|
||
okCallback: null,
|
||
showSlot: true
|
||
});
|
||
|
||
},
|
||
showLihgtPercent(item) { //亮度调整
|
||
if (item == this.formData.lightCurr) {
|
||
|
||
this.Status.showLightingSet = true;
|
||
|
||
this.showPop({
|
||
showPop: true, //是否显示弹窗
|
||
popType: 'custom',
|
||
bgColor: '#38393466',
|
||
borderColor: '#00000000',
|
||
textColor: '#ffffffde',
|
||
buttonBgColor: '#FFC84E',
|
||
buttonTextColor: '#232323DE',
|
||
iconUrl: '',
|
||
message: '',
|
||
buttonText: '',
|
||
clickEvt: '',
|
||
visiblePrompt: false,
|
||
promptTitle: '',
|
||
modelValue: '',
|
||
visibleClose: true,
|
||
okCallback: null,
|
||
showSlot: true
|
||
});
|
||
|
||
|
||
|
||
}
|
||
|
||
|
||
},
|
||
warnLightSetting(item) { //警示灯模式
|
||
let type = item;
|
||
if (item == this.formData.modeCurr) {
|
||
type = 'warnClose';
|
||
}
|
||
|
||
this.formData.modeCurr = type;
|
||
this.bleSendCmd(type);
|
||
},
|
||
lightSetting(item) {
|
||
let type = item;
|
||
if (item == this.formData.lightCurr) {
|
||
type = 'lightClose';
|
||
}
|
||
|
||
this.formData.lightCurr = type;
|
||
this.bleSendCmd(type);
|
||
},
|
||
bleSendCmd(type, values) {
|
||
let f = this.getDevice();
|
||
|
||
if (!f) {
|
||
this.showBleUnConnect();
|
||
return;
|
||
}
|
||
|
||
let dic = {
|
||
shuxie: [],
|
||
work: [],
|
||
jieN: [],
|
||
rb: [],
|
||
yellow: [],
|
||
quwen: [],
|
||
liangdu: [],
|
||
volume: []
|
||
}
|
||
let array = dic[type];
|
||
if (type in dic) {
|
||
if (type === 'liangdu' || type == 'volume') {
|
||
if (Array.isArray(values)) {
|
||
array = array.concat(values);
|
||
} else {
|
||
array.push(values);
|
||
}
|
||
}
|
||
} else {
|
||
if (Array.isArray(values)) {
|
||
array = values;
|
||
} else {
|
||
array = [values];
|
||
}
|
||
}
|
||
|
||
|
||
ble.sendHexs(f.deviceId, array, f.writeServiceId, f.wirteCharactId, 100).catch(ex => {
|
||
these.showPop({
|
||
message: "发送失败," + ex.msg,
|
||
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
|
||
borderColor: "#e034344d",
|
||
buttonBgColor: "#E03434",
|
||
});
|
||
});
|
||
|
||
},
|
||
|
||
deviceRecovry(res) {
|
||
if (this.Status.pageHide) {
|
||
return;
|
||
}
|
||
if (res.deviceId == these.formData.deviceId) {
|
||
this.formData.bleStatu = true;
|
||
setTimeout(() => {
|
||
hideLoading(these, 1000);
|
||
});
|
||
uni.showToast({
|
||
icon: 'success',
|
||
title: '蓝牙连接成功'
|
||
});
|
||
}
|
||
|
||
},
|
||
deviceDispose(res) {
|
||
if (this.Status.pageHide) {
|
||
return;
|
||
}
|
||
if (res.deviceId == these.formData.deviceId) {
|
||
this.formData.bleStatu = false;
|
||
setTimeout(() => {
|
||
hideLoading(these, 1000);
|
||
});
|
||
uni.showToast({
|
||
icon: 'fail',
|
||
title: '蓝牙连接已断开'
|
||
});
|
||
}
|
||
|
||
},
|
||
bleStateBreak() {
|
||
if (this.Status.pageHide) {
|
||
return;
|
||
}
|
||
//蓝牙适配器不可用
|
||
this.formData.bleStatu = false;
|
||
uni.showToast({
|
||
icon: 'fail',
|
||
title: '蓝牙已不可用'
|
||
})
|
||
hideLoading(this);
|
||
},
|
||
bleStateRecovry() {
|
||
console.log("蓝牙可用");
|
||
if (this.Status.pageHide) {
|
||
return;
|
||
}
|
||
console.log("蓝牙可用");
|
||
//蓝牙适配器再次可用,尝试恢复连接
|
||
showLoading(this, {
|
||
text: "蓝牙恢复可用,正在连接设备"
|
||
});
|
||
ble.LinkBlue(these.formData.deviceId).then(() => {
|
||
these.formData.bleStatu = true;
|
||
updateLoading(these, {
|
||
text: '连接成功'
|
||
});
|
||
}).catch(ex => {
|
||
updateLoading(these, {
|
||
text: ex.msg
|
||
})
|
||
}).finally(() => {
|
||
setTimeout(() => {
|
||
hideLoading(these);
|
||
}, 1000);
|
||
|
||
});
|
||
},
|
||
previewImg(img) {
|
||
if (!img) {
|
||
return;
|
||
}
|
||
|
||
uni.previewImage({
|
||
urls: [img]
|
||
})
|
||
},
|
||
|
||
bleValueNotify: function(receive, device, path) { //订阅消息
|
||
console.log("收到设备的数据", receive)
|
||
let data = recei.ReceiveData(receive, device, pagePath);
|
||
|
||
|
||
|
||
},
|
||
getDevice: function() {
|
||
|
||
// console.log("LinkedList=", ble.data.LinkedList);
|
||
// console.log("formData=", these.formData);
|
||
let f = ble.data.LinkedList.find((v) => {
|
||
return v.macAddress == these.device.deviceMac;
|
||
});
|
||
|
||
return f;
|
||
},
|
||
getDetail() {
|
||
var that = this;
|
||
usrApi.getDetail(this.device.id).then(res => {
|
||
console.log("res=", res);
|
||
if (res && res.code == 200) {
|
||
res = res.data;
|
||
|
||
}
|
||
});
|
||
},
|
||
|
||
setBleFormData() {
|
||
ble.data.LinkedList.find((v) => {
|
||
if (v.deviceId == these.formData.deviceId) {
|
||
v.formData = these.formData;
|
||
|
||
return true;
|
||
}
|
||
return false;
|
||
});
|
||
|
||
uni.setStorageSync(ble.StorageKey, ble.data.LinkedList);
|
||
},
|
||
|
||
showBleUnConnect() {
|
||
|
||
these.showPop({
|
||
message: "蓝牙未连接过该设备,请使用蓝牙重新添加该设备",
|
||
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
|
||
borderColor: "#e034344d",
|
||
buttonBgColor: "#E03434",
|
||
buttonText: '去连接',
|
||
buttonTextColor: '#FFFFFFde',
|
||
okCallback: function() {
|
||
|
||
uni.navigateTo({
|
||
url: "/pages/common/addBLE/addEquip",
|
||
events: {
|
||
BindOver: function(data) {
|
||
console.log(data)
|
||
these.formData.bleStatu=true;
|
||
}
|
||
},
|
||
success: function(res) {
|
||
// 通过eventChannel向被打开页面传送数据
|
||
res.eventChannel.emit('detailData', {
|
||
data: these.device
|
||
})
|
||
},
|
||
fail(ex) {
|
||
console.log("跳转失败", ex);
|
||
}
|
||
})
|
||
}
|
||
});
|
||
|
||
|
||
|
||
|
||
|
||
},
|
||
|
||
proParam: function() {
|
||
|
||
uni.navigateTo({
|
||
url: '/pages/common/productDes/index?id=' + this.device.id,
|
||
success(ev) {
|
||
|
||
}
|
||
});
|
||
},
|
||
handRemark: function() {
|
||
uni.navigateTo({
|
||
url: '/pages/common/operatingInstruct/index?id=' + this.device.id,
|
||
success(ev) {
|
||
|
||
}
|
||
});
|
||
},
|
||
handVideo: function() {
|
||
uni.navigateTo({
|
||
url: '/pages/common/operationVideo/index?id=' + this.device.id,
|
||
success(ev) {
|
||
|
||
}
|
||
});
|
||
},
|
||
closePop: function() {
|
||
this.Status.Pop.showPop = false;
|
||
|
||
if (this.Status.Pop.cancelCallback) {
|
||
this.Status.Pop.cancelCallback();
|
||
}
|
||
},
|
||
HidePop: function() {
|
||
if (this.Status.Pop.clickEvt == 'SendUsr') {
|
||
|
||
}
|
||
|
||
|
||
this.Status.Pop.showPop = false;
|
||
if (this.Status.Pop.okCallback) {
|
||
this.Status.Pop.okCallback();
|
||
}
|
||
},
|
||
showPop: function(option) {
|
||
let def = {
|
||
showPop: true, //是否显示弹窗
|
||
popType: 'custom',
|
||
bgColor: '#383934bd',
|
||
borderColor: '#BBE600',
|
||
textColor: '#ffffffde',
|
||
buttonBgColor: '#BBE600',
|
||
buttonTextColor: '#232323DE',
|
||
iconUrl: '',
|
||
message: '',
|
||
buttonText: '',
|
||
clickEvt: '',
|
||
visiblePrompt: false,
|
||
promptTitle: '',
|
||
modelValue: '',
|
||
visibleClose: false,
|
||
okCallback: null,
|
||
showSlot: false
|
||
}
|
||
|
||
let keys = Object.keys(def);
|
||
|
||
for (let i = 0; i < keys.length; i++) {
|
||
let key = keys[i];
|
||
if (key in option) {
|
||
continue;
|
||
}
|
||
these.Status.Pop[key] = def[key];
|
||
}
|
||
if (option) {
|
||
keys = Object.keys(option);
|
||
for (let i = 0; i < keys.length; i++) {
|
||
let key = keys[i];
|
||
|
||
these.Status.Pop[key] = option[key];
|
||
}
|
||
}
|
||
|
||
if (!option.borderColor) {
|
||
option.borderColor = '#BBE600';
|
||
option.buttonBgColor = '#BBE600';
|
||
}
|
||
these.Status.Pop.showPop = true;
|
||
}
|
||
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style>
|
||
.content {
|
||
padding: 30rpx;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
.eq {
|
||
width: 100%;
|
||
height: 250rpx;
|
||
border-radius: 8px;
|
||
background: rgba(26, 26, 26, 1);
|
||
box-sizing: border-box;
|
||
padding: 24rpx 28rpx;
|
||
display: flex;
|
||
flex-direction: row;
|
||
flex-wrap: nowrap;
|
||
align-content: center;
|
||
justify-content: center;
|
||
align-items: center;
|
||
margin-bottom: 24rpx;
|
||
}
|
||
|
||
.eq .leftImg {
|
||
box-sizing: border-box;
|
||
padding: 36rpx;
|
||
border-radius: 16rpx;
|
||
background: rgba(42, 42, 42, 0.5);
|
||
}
|
||
|
||
.eq .leftImg,
|
||
.eq .rightTxt {
|
||
width: 50%;
|
||
height: 100%;
|
||
}
|
||
|
||
.eq .rightTxt {
|
||
display: flex;
|
||
flex-direction: column;
|
||
flex-wrap: nowrap;
|
||
align-content: flex-start;
|
||
justify-content: space-evenly;
|
||
align-items: flex-start;
|
||
}
|
||
|
||
.eq .leftImg .img {
|
||
width: 100%;
|
||
height: 100%;
|
||
}
|
||
|
||
.eq .rightTxt .img {
|
||
width: 52rpx;
|
||
height: 52rpx;
|
||
}
|
||
|
||
.eq .rightTxt .row {
|
||
width: 100%;
|
||
display: flex;
|
||
flex-direction: row;
|
||
flex-wrap: nowrap;
|
||
align-content: center;
|
||
justify-content: flex-start;
|
||
align-items: center;
|
||
box-sizing: border-box;
|
||
padding-left: 50rpx;
|
||
}
|
||
|
||
.eq .rightTxt .row .txt {
|
||
padding-left: 20rpx;
|
||
}
|
||
|
||
.eq .bigTxt {
|
||
color: rgba(255, 255, 255, 0.87);
|
||
font-family: PingFang SC;
|
||
font-size: 28rpx;
|
||
font-weight: 400;
|
||
}
|
||
|
||
.eq .smallTxt {
|
||
color: rgba(255, 255, 255, 0.6);
|
||
font-family: PingFang SC;
|
||
font-size: 24rpx;
|
||
font-weight: 400;
|
||
}
|
||
|
||
|
||
.eqinfo {
|
||
border-radius: 16rpx;
|
||
background: rgba(26, 26, 26, 1);
|
||
box-sizing: border-box;
|
||
padding: 14rpx 0rpx;
|
||
}
|
||
|
||
.eqinfo .item {
|
||
width: 100%;
|
||
height: 60rpx;
|
||
line-height: 60rpx;
|
||
padding: 0rpx 28rpx;
|
||
box-sizing: border-box;
|
||
display: flex;
|
||
flex-direction: row;
|
||
flex-wrap: nowrap;
|
||
align-content: center;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
}
|
||
|
||
.eqinfo .lbl {
|
||
color: rgba(255, 255, 255, 0.87);
|
||
font-family: PingFang SC;
|
||
font-size: 28rpx;
|
||
font-weight: 400;
|
||
|
||
letter-spacing: 0.07px;
|
||
text-align: left;
|
||
}
|
||
|
||
.eqinfo .value {
|
||
color: rgba(255, 255, 255, 0.6);
|
||
font-family: PingFang SC;
|
||
font-size: 28rpx;
|
||
font-weight: 400;
|
||
|
||
letter-spacing: 0.07px;
|
||
text-align: left;
|
||
}
|
||
|
||
.lamp {
|
||
margin-top: 24rpx;
|
||
}
|
||
|
||
.lamp .title .active {}
|
||
|
||
.lamp .title .noActive {
|
||
color: #FFFFFF3c !important;
|
||
}
|
||
|
||
.lamp .title {
|
||
width: 100%;
|
||
height: 60rpx;
|
||
line-height: 60rpx;
|
||
padding: 0rpx 28rpx;
|
||
box-sizing: border-box;
|
||
display: flex;
|
||
flex-direction: row;
|
||
flex-wrap: nowrap;
|
||
align-content: center;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
font-size: 28rpx;
|
||
}
|
||
|
||
.lampMode {
|
||
|
||
width: 100%;
|
||
box-sizing: border-box;
|
||
|
||
}
|
||
|
||
.lampMode .mode {
|
||
width: calc(calc(100% - 34rpx) / 2);
|
||
border-radius: 8px;
|
||
margin-top: 20rpx;
|
||
background: rgba(26, 26, 26, 1);
|
||
display: flex;
|
||
flex-direction: row;
|
||
flex-wrap: nowrap;
|
||
align-content: center;
|
||
align-items: center;
|
||
justify-content: flex-start;
|
||
padding: 30rpx;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
.lampMode .mode.noMargintop {
|
||
margin-top: 0px !important;
|
||
}
|
||
|
||
.lampMode .mode.active {
|
||
|
||
border: 1px solid rgba(174, 214, 0, 1);
|
||
}
|
||
|
||
.lampMode .mode.active .bigTxt {
|
||
|
||
color: rgba(174, 214, 0, 1) !important;
|
||
}
|
||
|
||
.mode.marginLeft {
|
||
margin-left: 34rpx !important;
|
||
}
|
||
|
||
.mode .leftImg .img {
|
||
width: 70rpx;
|
||
height: 70rpx;
|
||
}
|
||
|
||
.mode .rightTxt {
|
||
display: flex;
|
||
flex-direction: column;
|
||
flex-wrap: nowrap;
|
||
align-content: flex-start;
|
||
justify-content: center;
|
||
align-items: flex-start;
|
||
padding-left: 20rpx;
|
||
}
|
||
|
||
.mode .bigTxt {
|
||
color: rgba(255, 255, 255, 0.87);
|
||
font-family: PingFang SC;
|
||
font-size: 28rpx;
|
||
font-weight: 400;
|
||
|
||
letter-spacing: 0.07px;
|
||
|
||
}
|
||
|
||
.mode .smallTxt {
|
||
color: rgba(255, 255, 255, 0.6);
|
||
font-family: PingFang SC;
|
||
font-size: 24rpx;
|
||
font-weight: 400;
|
||
|
||
letter-spacing: 0.07px;
|
||
|
||
}
|
||
|
||
.usrinfo {
|
||
border-radius: 8px;
|
||
width: 100%;
|
||
box-sizing: border-box;
|
||
padding: 24rpx 28rpx;
|
||
background: rgba(26, 26, 26, 1);
|
||
}
|
||
|
||
.usrtitle {
|
||
color: rgba(255, 255, 255, 0.87);
|
||
font-family: PingFang SC;
|
||
font-size: 28rpx;
|
||
font-weight: 400;
|
||
height: 40rpx;
|
||
line-height: 40rpx;
|
||
letter-spacing: 0.07px;
|
||
|
||
}
|
||
|
||
.usrinfo .btnSend {
|
||
line-height: 65rpx;
|
||
border-radius: 8px;
|
||
width: 120rpx;
|
||
height: 65rpx;
|
||
color: rgba(35, 35, 35, 0.87);
|
||
font-family: PingFang SC;
|
||
font-size: 24rpx;
|
||
font-weight: 400;
|
||
letter-spacing: 0.15rpx;
|
||
text-align: center;
|
||
background-color: #BBE600;
|
||
}
|
||
|
||
.usrinfo .item {
|
||
border-radius: 8px;
|
||
width: 100%;
|
||
box-sizing: border-box;
|
||
line-height: 90rpx;
|
||
height: 90rpx;
|
||
background: rgba(42, 42, 42, 1);
|
||
margin-top: 24rpx;
|
||
display: flex;
|
||
flex-direction: row;
|
||
flex-wrap: nowrap;
|
||
align-content: center;
|
||
justify-content: flex-start;
|
||
align-items: center;
|
||
}
|
||
|
||
.usrinfo .lbl {
|
||
width: 120rpx;
|
||
height: 100%;
|
||
padding-left: 24rpx;
|
||
box-sizing: border-box;
|
||
|
||
text-align: right;
|
||
|
||
color: rgba(255, 255, 255, 0.87);
|
||
font-family: PingFang SC;
|
||
font-size: 28rpx;
|
||
font-weight: 400;
|
||
|
||
letter-spacing: 0.07px;
|
||
|
||
}
|
||
|
||
.usrinfo .value {
|
||
width: calc(100% - 120rpx);
|
||
height: 100%;
|
||
|
||
font-size: 28rpx;
|
||
font-weight: 400;
|
||
|
||
letter-spacing: 0.07px;
|
||
text-align: left;
|
||
|
||
}
|
||
|
||
.usrinfo .value .uni-input-input {
|
||
color: rgba(255, 255, 255, 0.87);
|
||
font-family: PingFang SC;
|
||
|
||
}
|
||
|
||
|
||
.usrplace {
|
||
color: rgba(255, 255, 255, 0.4);
|
||
font-family: PingFang SC;
|
||
font-size: 28rpx;
|
||
font-weight: 400;
|
||
letter-spacing: 0.07px;
|
||
text-align: left;
|
||
}
|
||
|
||
.proinfo .itemcontent {
|
||
display: flex;
|
||
display: flex;
|
||
flex-direction: row;
|
||
flex-wrap: nowrap;
|
||
align-content: center;
|
||
justify-content: space-evenly;
|
||
}
|
||
|
||
.proinfo .item {
|
||
width: 180rpx;
|
||
height: 180rpx;
|
||
box-sizing: border-box;
|
||
padding: 40rpx;
|
||
border-radius: 16rpx;
|
||
background: rgba(26, 26, 26, 1);
|
||
display: flex;
|
||
flex-direction: column;
|
||
flex-wrap: nowrap;
|
||
align-content: center;
|
||
justify-content: center;
|
||
align-items: center;
|
||
}
|
||
|
||
.proinfo .item .img {
|
||
width: 50rpx;
|
||
height: 50rpx;
|
||
|
||
|
||
}
|
||
|
||
.proinfo .item .txt {
|
||
color: rgba(255, 255, 255, 0.6);
|
||
font-family: PingFang SC;
|
||
font-size: 24rpx;
|
||
font-weight: 400;
|
||
margin-top: 20rpx;
|
||
letter-spacing: 0.07px;
|
||
text-align: left;
|
||
}
|
||
|
||
|
||
.slider-container {
|
||
padding: 0px;
|
||
}
|
||
|
||
|
||
|
||
|
||
.addIco {
|
||
width: 100%;
|
||
height: 360rpx;
|
||
display: flex;
|
||
flex-direction: row;
|
||
flex-wrap: nowrap;
|
||
align-content: center;
|
||
justify-content: center;
|
||
align-items: center;
|
||
}
|
||
|
||
.icoContent {
|
||
width: 240rpx;
|
||
height: 240rpx;
|
||
border-radius: 8rpx;
|
||
|
||
|
||
background: rgba(58, 58, 58, 1);
|
||
}
|
||
|
||
.icoContent .img {
|
||
width: 70rpx;
|
||
height: 70rpx;
|
||
}
|
||
|
||
.modeSetting {
|
||
display: flex;
|
||
flex-direction: row;
|
||
flex-wrap: nowrap;
|
||
align-content: center;
|
||
justify-content: space-around;
|
||
align-items: center;
|
||
background-color: #1a1a1a;
|
||
box-sizing: border-box;
|
||
padding: 30rpx 0rpx;
|
||
border-radius: 16rpx;
|
||
}
|
||
|
||
.modeSetting .item {
|
||
width: 120rpx;
|
||
height: 120rpx;
|
||
background: #2A2A2A;
|
||
border-radius: 50%;
|
||
|
||
color: rgba(255, 255, 255, 0.87);
|
||
|
||
font-family: PingFang SC;
|
||
font-size: 28rpx;
|
||
font-weight: 400;
|
||
line-height: 0px;
|
||
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
.modeSetting .item.active {
|
||
border: 4rpx solid rgba(174, 214, 0, 1);
|
||
background: rgba(26, 26, 26, 1);
|
||
padding: 4rpx;
|
||
color: rgba(26, 26, 26, 0.87);
|
||
}
|
||
|
||
.modeSetting .item.active .p100 {
|
||
background: rgba(174, 214, 0, 1);
|
||
border-radius: 50%;
|
||
|
||
}
|
||
|
||
|
||
.usrinfo .image {
|
||
width: 30rpx;
|
||
height: 40rpx;
|
||
}
|
||
|
||
.usrinfo .img {
|
||
width: 30rpx;
|
||
height: 40rpx;
|
||
}
|
||
|
||
.content {
|
||
|
||
box-sizing: border-box;
|
||
width: 100%;
|
||
min-height: 100vh;
|
||
height: auto;
|
||
}
|
||
|
||
.contentBg {
|
||
background-color: #121212;
|
||
color: #ffffffde;
|
||
}
|
||
|
||
.fleft {
|
||
float: left;
|
||
}
|
||
|
||
.fright {
|
||
float: right;
|
||
}
|
||
|
||
.clear {
|
||
clear: both;
|
||
}
|
||
|
||
.displayNone {
|
||
display: none !important;
|
||
}
|
||
|
||
.p100 {
|
||
width: 100%;
|
||
height: 100%;
|
||
}
|
||
|
||
.line15 {
|
||
line-height: 34rpx;
|
||
}
|
||
|
||
.center {
|
||
display: flex;
|
||
flex-direction: row;
|
||
flex-wrap: nowrap;
|
||
align-content: center;
|
||
justify-content: center;
|
||
align-items: center;
|
||
}
|
||
|
||
.centerCol {
|
||
display: flex;
|
||
flex-direction: column;
|
||
}
|
||
|
||
.centerLeft {
|
||
display: flex;
|
||
flex-direction: row;
|
||
flex-wrap: nowrap;
|
||
align-content: center;
|
||
justify-content: flex-start;
|
||
align-items: center;
|
||
}
|
||
|
||
.warnnig {
|
||
border-radius: 16rpx;
|
||
width: 100%;
|
||
height: 70rpx;
|
||
line-height: 70rpx;
|
||
background: rgba(224, 52, 52, 1);
|
||
box-sizing: border-box;
|
||
padding: 0rpx 30rpx;
|
||
margin-top: 20rpx;
|
||
color: rgba(255, 255, 255, 0.87);
|
||
font-family: 'PingFang SC';
|
||
font-size: 28rpx;
|
||
font-weight: 400;
|
||
display: flex;
|
||
flex-direction: row;
|
||
flex-wrap: nowrap;
|
||
align-content: center;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
}
|
||
|
||
.netContent {
|
||
display: flex;
|
||
flex-direction: row;
|
||
flex-wrap: nowrap;
|
||
align-content: flex-end;
|
||
justify-content: space-around;
|
||
align-items: flex-end;
|
||
width: 50rpx;
|
||
}
|
||
|
||
.net {
|
||
width: 7rpx;
|
||
background: rgba(255, 255, 255, 0.3);
|
||
}
|
||
|
||
.net.netone {
|
||
height: 11rpx;
|
||
}
|
||
|
||
.net.nettwo {
|
||
height: 17rpx;
|
||
}
|
||
|
||
.net.netsiri {
|
||
height: 23rpx;
|
||
}
|
||
|
||
.net.netfour {
|
||
height: 29rpx;
|
||
}
|
||
|
||
.net.netfive {
|
||
height: 35rpx;
|
||
}
|
||
|
||
.net.active {
|
||
background: #FFFFFF !important;
|
||
}
|
||
|
||
.lightMode {
|
||
width: 100%;
|
||
height: 180rpx;
|
||
border-radius: 16rpx;
|
||
background: rgba(26, 26, 26, 1);
|
||
margin-bottom: 30rpx;
|
||
display: flex;
|
||
flex-direction: row;
|
||
flex-wrap: nowrap;
|
||
align-content: center;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
}
|
||
|
||
|
||
.lightMode .item {
|
||
width: calc(calc(100% - 90rpx) / 3);
|
||
height: 100%;
|
||
box-sizing: border-box;
|
||
border-radius: 16rpx;
|
||
|
||
color: rgba(255, 255, 255, 0.87);
|
||
font-family: 'PingFang SC';
|
||
font-size: 28rpx;
|
||
font-weight: 400;
|
||
letter-spacing: 0.14rpx;
|
||
display: flex;
|
||
flex-direction: column;
|
||
flex-wrap: nowrap;
|
||
align-content: center;
|
||
justify-content: space-evenly;
|
||
align-items: center;
|
||
}
|
||
|
||
.lightMode .item.active {
|
||
|
||
color: #AED600;
|
||
}
|
||
|
||
.lightMode .imgContent {
|
||
width: 80rpx;
|
||
height: 100rpx;
|
||
}
|
||
|
||
.lightMode .imgContent .img {
|
||
width: 100%;
|
||
height: 100%;
|
||
|
||
}
|
||
|
||
.mask {
|
||
position: fixed;
|
||
z-index: 99998;
|
||
width: 100%;
|
||
height: 100%;
|
||
background-color: #00000000;
|
||
top: 0px;
|
||
left: 0px;
|
||
}
|
||
|
||
.popContent {
|
||
position: fixed;
|
||
z-index: 99999;
|
||
width: 85%;
|
||
height: auto;
|
||
min-height: 200rpx;
|
||
border-radius: 40rpx;
|
||
backdrop-filter: blur(28rpx);
|
||
background: #383934;
|
||
left: 50%;
|
||
/* 水平方向居中起点(父容器50%位置) */
|
||
top: 50%;
|
||
/* 垂直方向居中起点 */
|
||
transform: translate(-50%, -50%);
|
||
/* 向左/上偏移自身一半,实现完全居中 */
|
||
}
|
||
|
||
.slideTitle {
|
||
display: flex;
|
||
flex-direction: row;
|
||
flex-wrap: nowrap;
|
||
align-content: center;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
margin-top: 30rpx;
|
||
width: 100%;
|
||
box-sizing: border-box;
|
||
padding: 0px 30rpx;
|
||
}
|
||
</style> |