体验优化添加失败时的提醒
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
<view slot="right">
|
||||
<view class="navbarRight center">
|
||||
<view class="imgContent" :class="{'visibilityHidden':Status.apiType!=item.apiType}"
|
||||
@click.stop="handleRightClick(item,index)" v-for="item,index in Status.navbar.icons">
|
||||
@click.stop="handleRightClick(item,index)" v-for="item,index in Status.navbar.icons">
|
||||
<image class="img" :src="item.src" mode="aspectFit"></image>
|
||||
<view class="baber" v-if="item.math">{{item.math>9?'9+':item.math}}</view>
|
||||
</view>
|
||||
@ -74,8 +74,8 @@
|
||||
|
||||
<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="sliderChanging"
|
||||
class="custom-slider" />
|
||||
backgroundColor="#00000000" block-size="20" block-color="#ffffffde" @change="sliderChange" @changing="sliderChanging"
|
||||
class="custom-slider" />
|
||||
|
||||
</view>
|
||||
</view>
|
||||
@ -124,23 +124,23 @@
|
||||
<view class="btnSend fright" v-on:click.stop="sendUsr">发送</view>
|
||||
<view class="clear"></view>
|
||||
<TextToHexV1 class="TextToHex" ref="textToHex" :txts="formData.textLines" :bgColor="'#FFFFFF'"
|
||||
:color="'#000000'" :fontSize="16" />
|
||||
:color="'#000000'" :fontSize="16" />
|
||||
</view>
|
||||
|
||||
<view class="item">
|
||||
<text class="lbl">单位:</text>
|
||||
<input class="value" v-model.trim="formData.textLines[0]" placeholder="请输入单位" maxlength="8"
|
||||
placeholder-class="usrplace" />
|
||||
placeholder-class="usrplace" />
|
||||
</view>
|
||||
<view class="item">
|
||||
<text class="lbl">部门:</text>
|
||||
<input class="value" v-model.trim="formData.textLines[1]" placeholder="请输入姓名" maxlength="8"
|
||||
placeholder-class="usrplace" />
|
||||
placeholder-class="usrplace" />
|
||||
</view>
|
||||
<view class="item">
|
||||
<text class="lbl">姓名:</text>
|
||||
<input class="value" v-model.trim="formData.textLines[2]" placeholder="请输入职位" maxlength="8"
|
||||
placeholder-class="usrplace" />
|
||||
placeholder-class="usrplace" />
|
||||
</view>
|
||||
|
||||
</view>
|
||||
@ -162,17 +162,11 @@
|
||||
</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" @closePop="closePop" :visiblePrompt="Status.Pop.visiblePrompt"
|
||||
:promptTitle="Status.Pop.promptTitle" v-model="Status.Pop.modelValue" />
|
||||
|
||||
|
||||
<!-- 下方菜单 -->
|
||||
<BottomSlideMenuPlus :config="Status.BottomMenu" @close="closeMenu" @itemClick="handleItemClick"
|
||||
@btnClick="btnClick">
|
||||
@btnClick="btnClick">
|
||||
<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>
|
||||
@ -182,6 +176,7 @@
|
||||
</BottomSlideMenuPlus>
|
||||
|
||||
<global-loading ref="loading" />
|
||||
<MsgBox ref="msgPop" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -201,6 +196,14 @@
|
||||
} from '@/utils/request.js';
|
||||
|
||||
var pagePath = "/pages/6155/BJQ6155";
|
||||
import {
|
||||
MsgSuccess,
|
||||
MsgError,
|
||||
MsgClose,
|
||||
MsgWarning,
|
||||
showPop,
|
||||
MsgInfo
|
||||
} from '@/utils/MsgPops.js'
|
||||
|
||||
var ble = null;
|
||||
var these = null;
|
||||
@ -413,7 +416,10 @@
|
||||
these.formData.bleStatu = 'connecting';
|
||||
ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => {
|
||||
these.formData.bleStatu = true;
|
||||
});
|
||||
}).catch(ex => {
|
||||
these.formData.bleStatu = 'err';
|
||||
MsgError("连接错误:" + ex.msg, "确定", these);
|
||||
});;
|
||||
these.setBleFormData();
|
||||
these.getDetail();
|
||||
|
||||
@ -433,7 +439,10 @@
|
||||
ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => {
|
||||
console.log("连接成功")
|
||||
these.formData.bleStatu = true;
|
||||
});
|
||||
}).catch(ex => {
|
||||
these.formData.bleStatu = 'err';
|
||||
MsgError("连接错误:" + ex.msg, "确定", these);
|
||||
});;
|
||||
}
|
||||
},
|
||||
onBackPress(e) {
|
||||
@ -480,6 +489,7 @@
|
||||
these.formData.bleStatu = true;
|
||||
}).catch(ex => {
|
||||
these.formData.bleStatu = 'err';
|
||||
MsgError("连接错误:" + ex.msg, "确定", these);
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -640,7 +650,8 @@
|
||||
}).catch(ex => {
|
||||
updateLoading(these, {
|
||||
text: ex.msg
|
||||
})
|
||||
});
|
||||
MsgError("连接错误:" + ex.msg, "确定", these);
|
||||
}).finally(() => {
|
||||
setTimeout(() => {
|
||||
hideLoading(these);
|
||||
@ -769,11 +780,11 @@
|
||||
return;
|
||||
}
|
||||
let os = plus.os.name;
|
||||
|
||||
// 分包发送图片数据
|
||||
var sendImagePackets = function(ReSendNo) {
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
// 总数据包数
|
||||
let totalPackets = os=='Android'?52:200;
|
||||
let currentPacket = 1;
|
||||
@ -808,11 +819,7 @@
|
||||
|
||||
// 计算当前包的数据
|
||||
let packetSize = os == 'Android' ? 250 : 64;
|
||||
// if (currentPacket <= 51) {
|
||||
// packetSize = 250; // 前51个包每个500字节
|
||||
// } else {
|
||||
// packetSize = 50; // 最后一个包100字节
|
||||
// }
|
||||
|
||||
|
||||
// 创建数据包
|
||||
let startIndex = (currentPacket - 1) * packetSize;
|
||||
@ -824,7 +831,7 @@
|
||||
let packetData = these.rgb565Data.slice(startIndex,
|
||||
endIndex);
|
||||
// 构建数据包
|
||||
let bufferSize = os ==packetSize.length*2+5; // 5 + packetData.length * 2; // 头部5字节 + 数据部分
|
||||
let bufferSize = packetData.length * 2+5; // 头部5字节 + 数据部分
|
||||
let buffer = new ArrayBuffer(bufferSize);
|
||||
let dataView = new DataView(buffer);
|
||||
|
||||
@ -833,12 +840,12 @@
|
||||
dataView.setUint8(1, 0x02); // 帧类型:开机画面
|
||||
dataView.setUint8(2, currentPacket); // 包序号
|
||||
dataView.setUint16(3, packetData.length*2,false);
|
||||
|
||||
|
||||
// 填充数据(每个RGB565值占2字节)
|
||||
for (let i = 0; i < packetData.length; i++) {
|
||||
dataView.setUint16(5 + i * 2, packetData[i], false); // 大端字节序
|
||||
}
|
||||
|
||||
|
||||
//发送数据包
|
||||
ble.sendData(f.deviceId, buffer, f.writeServiceId, f.wirteCharactId,
|
||||
10).then(() => {
|
||||
@ -911,8 +918,9 @@
|
||||
console.log("data=", data);
|
||||
these.Status.BottomMenu.show = false;
|
||||
these.rgb565Data = Common.convertToRGB565(data.piexls);
|
||||
|
||||
console.log("1111111111")
|
||||
setTimeout(function() {
|
||||
console.log("1111111111")
|
||||
sendImagePackets().catch(() => {
|
||||
|
||||
});
|
||||
@ -1540,6 +1548,7 @@
|
||||
option.buttonBgColor = '#BBE600';
|
||||
}
|
||||
these.Status.Pop.showPop = true;
|
||||
showPop(option, these);
|
||||
},
|
||||
sendUsr() {
|
||||
if (!this.permissions.includes('4') && this.Status.apiType !== 'listA') {
|
||||
|
||||
Reference in New Issue
Block a user