<template>
|
<view>
|
<view class="border margin_top30rpx">
|
<h2 class="text_align_center padding_bottom18 padding15 margin_bottom10rpx">选择打印驱动</h2>
|
<scroll-view scroll-y="true" style="height: 150rpx;">
|
<view style="margin-top: 30upx;" :key="index" v-for="(item,index) in list">
|
<button style="width: 400upx; color: #f18202;background-color: #fff;border: 1px solid #f18202;"
|
@click="longpress(item,index)"
|
:class="active==index?'bg-f18202':'color_f18202 border_1989FA'">{{item.name}}</button>
|
</view>
|
<view style="margin-top: 30upx;height: 130rpx;" v-if='list.length==0'>
|
<button
|
style="width: 600upx; color: #f18202;background-color: #fff;border: 1px solid #f18202;">暂无驱动</button>
|
</view>
|
</scroll-view>
|
<u-form :model="ware" ref="wareRef" v-if="numberShow" style='border-top: 1px solid #e4e4e4;'>
|
<u-row>
|
<u-col span="12">
|
<u-form-item label="打印数量:" prop="num" required label-width='150'
|
class='margin_left30rpx font_weight_bold'>
|
<input v-model="printNum" placeholder="请输入打印数量" class='width'
|
style="margin-left: 30rpx;text-align: right;">
|
</input>
|
</u-form-item>
|
</u-col>
|
</u-row>
|
</u-form>
|
|
</view>
|
<view class="flex justify-around transition margin_bottom30rpx margin_top30rpx">
|
<button class="width25 bg-grey" @click="$emit('back')">上一步</button>
|
<button class="width70 bg-f18202 color_F2F2F2" @click="writeBLECharacteristicValue">打印</button>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import mixBule from '@/mixins/Blue.js'
|
export default {
|
mixins: [mixBule],
|
data() {
|
return {
|
list: [],
|
active: null,
|
printNum:'',
|
ware: {
|
num: ''
|
},
|
wareRules: {
|
num: [{
|
required: true,
|
message: '打印数量不能为空',
|
trigger: 'blur'
|
}]
|
}
|
}
|
},
|
props: {
|
numberShow: {
|
type: Boolean,
|
default: false
|
},
|
printlist: {
|
type: Object,
|
default:{}
|
}
|
},
|
onReady() {
|
this.$refs.wareRef.setRules(this.wareRules)
|
},
|
created() {
|
this.tomy()
|
this.openBluetoothAdapter()
|
},
|
mounted() {
|
// console.log(this.printlist)
|
},
|
methods: {
|
}
|
}
|
</script>
|
|
<style>
|
</style>
|