封装发送照片、视频、文字,各设备调用公共模块
This commit is contained in:
@ -37,6 +37,10 @@
|
||||
<text class="lbl">设备名称</text>
|
||||
<text class="value">{{device.deviceName}}</text>
|
||||
</view>
|
||||
<view class="item">
|
||||
<text class="lbl">IMEI</text>
|
||||
<text class="value">{{device.deviceImei}}</text>
|
||||
</view>
|
||||
<view class="item">
|
||||
<text class="lbl">Mac地址</text>
|
||||
<text class="value">{{device.deviceMac}}</text>
|
||||
@ -57,12 +61,12 @@
|
||||
<text class="lbl">定位信息</text>
|
||||
<view class="multiValue" @click.stop="gotoMap()">
|
||||
<view class="valueItem valueFont">
|
||||
{{formData.sta_longitude}}
|
||||
{{formData?formData.sta_longitude:""}}
|
||||
|
||||
</view>
|
||||
<view class="valueItem valueFont">
|
||||
|
||||
{{formData.sta_latitude}}
|
||||
{{formData?formData.sta_latitude:""}}
|
||||
|
||||
</view>
|
||||
<view class="valueItem">
|
||||
@ -70,7 +74,7 @@
|
||||
<view style="width:80%;float: right;text-align: right;" class="valueFont">
|
||||
<uni-icons type="location" size="17" color="rgba(255, 255, 255, 0.8)"
|
||||
style="vertical-align: bottom;" />
|
||||
{{formData.address}}
|
||||
{{formData?formData.address:''}}
|
||||
</view>
|
||||
<view class="clear"></view>
|
||||
</view>
|
||||
@ -318,10 +322,11 @@
|
||||
let eventChannel = this.getOpenerEventChannel();
|
||||
|
||||
eventChannel.on('detailData', (data) => {
|
||||
|
||||
this.initWatch();
|
||||
// console.log("收到父页面的参数:" + JSON.stringify(data));
|
||||
var device = data.data;
|
||||
these.device = device;
|
||||
these.Status.apiType = data.apiType;
|
||||
if (data.apiType !== 'listA') {
|
||||
Common.getdeviceShareId(data.data.id).then(res => {
|
||||
if (res.code == 200) {
|
||||
@ -364,7 +369,7 @@
|
||||
these.setBleFormData();
|
||||
|
||||
|
||||
this.initWatch();
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
@ -736,7 +741,7 @@
|
||||
console.log("this.formData[key] =", this.formData[key]);
|
||||
}
|
||||
},
|
||||
bleSend(json, validWarn = true) {
|
||||
bleSend(json, validWarn = true,bleLink) {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (this.formData.sta_ShakeBit != '' && this.formData.sta_ShakeBit != '0' && validWarn) {
|
||||
reject({
|
||||
@ -750,8 +755,10 @@
|
||||
reject({
|
||||
code: -1
|
||||
});
|
||||
|
||||
this.showBleUnConnect();
|
||||
if(bleLink){
|
||||
this.showBleUnConnect();
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
@ -882,10 +889,8 @@
|
||||
let json = {
|
||||
ins_Side_Light: val
|
||||
}
|
||||
this.bleSend(json, true).then(() => {}).catch(ex => {
|
||||
if (ex.code == -1) {
|
||||
return;
|
||||
}
|
||||
this.bleSend(json, true,false).then(() => {}).catch(ex => {
|
||||
|
||||
console.log("蓝牙发送失败,尝试用mq发送");
|
||||
this.mqSend(json, true).catch(err => {
|
||||
if (err.code == -1) {
|
||||
@ -933,10 +938,8 @@
|
||||
ins_ShakeBit: type
|
||||
};
|
||||
|
||||
this.bleSend(json, false).catch(ex => {
|
||||
if (ex.code == -1) {
|
||||
return;
|
||||
}
|
||||
this.bleSend(json, false,false).catch(ex => {
|
||||
|
||||
|
||||
this.mqSend(json, false).catch(err => {
|
||||
if (err.code == -1) {
|
||||
|
||||
Reference in New Issue
Block a user