This commit is contained in:
aihe 2024-05-10 17:59:07 +08:00
parent b63f238fe4
commit 467fa587b6

View File

@ -16,12 +16,13 @@
<view class="">
<view class="pt-10 pb-10">连接信息</view>
<u-steps activeColor="#969799" :current="curTab" direction="column" dot="true">
<u-steps-item v-for="(item, index) in conInfos" @click="changeTab(index)">
<u-steps-item v-for="(item, index) in conInfos">
<template v-slot:title>
<view :class="`${index == curTab ? 'clr-prm' : 'clr-sub'} pl-20`">{{item.title}}</view>
<view @click="changeTab(index)" :class="`${index == curTab ? 'clr-prm' : 'clr-sub'} pl-20`">{{item.title}}</view>
</template>
<template v-slot:desc>
<view class="mt-10 pl-20">{{item.desc}}</view>
<view @click="changeTab(index)" class="mt-10 pl-20">{{item.desc}}</view>
</template>
</u-steps-item>
</u-steps>
@ -306,8 +307,9 @@ export default {
showToast(errmsg)
return
}
let pic_res
try{
let pic_res = await this.renderPic();
pic_res = await this.renderPic();
showToast('图片获取成功')
}catch(e){
showToast('图片获取失败')
@ -362,7 +364,6 @@ export default {
hideLoading()
showToast('打印成功')
}catch(e){
hideLoading()
console.log('打印异常', e)
}
},
@ -376,9 +377,6 @@ export default {
const delay = 20;
for (let i = 0, j = 0, length = buffer.byteLength; i < length; i += maxChunk, j++) {
let subPackage = buffer.slice(i, i + maxChunk <= length ? (i + maxChunk) : length);
await new Promise((resolve)=> {
setTimeout(resolve, j * delay)
})
try{
await _this.printbuff(subPackage)
}catch(msg){