wangfukang 3 years ago
parent
commit
87b3f0980d
  1. 31
      components/kk-printer/index.vue

31
components/kk-printer/index.vue

@ -3,25 +3,17 @@
<view class="kk-printer-btn" @tap="handlePrintTap" style="color:#FFF;">
{{isPrinting?printingText:defaultText}}
</view>
<view class="kk-shadow" :class="isShowSearch?'show':''" @tap="handleSearchClose">
<!-- <view class="kk-shadow" :class="isShowSearch?'show':''" @tap="handleSearchClose">
<view class="kk-modal" @tap.stop="doNothing">
<view class="kk-search-device">
<!-- <view class="kk-filter-wrap">
<view class="filter-title">根据SRRI过滤设备</view>
<slider @change="handleSRRIChange" max='-20' min='-100' value="-95" show-value/>
</view>
<view class="kk-filter-wrap">
<view class="filter-title">根据蓝牙名过滤</view>
<input type="text" placeholder-class="kk-placeholder-class" placeholder="请输入蓝牙名字或设备ID搜索" v-model="filterName" />
</view> -->
<view class="kk-btn-wrap">
<view class="kk-btn-item confirm-btn" @tap="searchBtnTap" v-if="!isSearching">
<view class="kk-btn-item confirm-btn" @tap="" v-if="!isSearching">
搜索设备
</view>
<view class="kk-btn-item confirm-btn" v-else>
搜索中...
</view>
<view class="kk-btn-item" @tap="stopSearchBtnTap">
<view class="kk-btn-item" @tap="stopBluetoothDevicesDiscovery">
停止搜索
</view>
</view>
@ -32,7 +24,7 @@
</view>
<view class="" v-else>
<view class="kk-devices-item" v-for="(item,index) in filterDeviceList" :key="index"
@tap="handleConnectDevice(item)">
@tap="">
<view class="name" style="color:#000;">
<text>设备名称:</text>
<text>{{item.name?item.name:'未命名'}}</text>
@ -41,20 +33,12 @@
<text>信号强度:</text>
<text>({{Math.max(0, item.RSSI + 100)}}%)</text>
</view>
<!-- <view class="deviceid">
<text>设备ID:</text>
<text>{{item.deviceId}}</text>
</view>
<view class="advmac" v-if="item.advMac">
<text>advMac:</text>
<text>{{item.advMac}}</text>
</view> -->
</view>
</view>
</view>
</view>
</view>
</view>
</view> -->
</view>
</template>
@ -163,11 +147,14 @@
},
beforeDestroy() {
this.stopSearchBtnTap();
this.stopBluetoothDevicesDiscovery();
},
methods: {
doNothing() {
return;
},
stopBluetoothDevicesDiscovery(){
wx.stopBluetoothDevicesDiscovery() //444
},
//点击打印按钮
handlePrintTap() {

Loading…
Cancel
Save