schangxiang@126.com
2025-09-17 c0e20b1b0f1298cdc0af0037d60e74d51e364501
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<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>