|
|
|
@ -79,27 +79,14 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</uni-popup> |
|
|
|
<view> |
|
|
|
蓝牙状态:{{printStatus?'已连接':'未连接'}} |
|
|
|
</view> |
|
|
|
<view @click="closePrint" style="width:100rpx;height: 150rpx;background:#000;margin-left: 50px;color:#fff;">断开连接 |
|
|
|
</view> |
|
|
|
<view style="width:100rpx;height: 150rpx;background:#000;"> |
|
|
|
<kk-printer ref="kkprinter" :bufferData="bufferData" :printNum="printNum" |
|
|
|
:defaultText="defaultText" @statusChange="statusChange"></kk-printer> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import cell from '../../components/ordercell/index.vue' |
|
|
|
import util from '@/components/kk-printer/utils/util.js'; |
|
|
|
import * as blesdk from '@/components/kk-printer/utils/bluetoolth.js'; |
|
|
|
import kkPrinter from '@/components/kk-printer/index.vue'; |
|
|
|
export default { |
|
|
|
components: { |
|
|
|
cell, |
|
|
|
kkPrinter |
|
|
|
cell |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
i18n() { |
|
|
|
@ -110,6 +97,7 @@ |
|
|
|
return { |
|
|
|
bufferData: [], |
|
|
|
printNum: 1, |
|
|
|
yNum: 10, |
|
|
|
defaultText: '连接蓝牙', |
|
|
|
p: 1, |
|
|
|
centerarray: ['完成订单', '已抢订单', '配送里程'], |
|
|
|
@ -137,7 +125,8 @@ |
|
|
|
this.tab2 = [this.i18n.eva.quanbu, this.i18n.order.yiwancheng, this.i18n.order.yizhuandan] |
|
|
|
}, |
|
|
|
onLoad(option) { |
|
|
|
var that = this |
|
|
|
let that = this; |
|
|
|
|
|
|
|
if (option.index) { |
|
|
|
this.selectedIndex2 = option.index |
|
|
|
} |
|
|
|
@ -151,6 +140,81 @@ |
|
|
|
this.printStatus = uni.getStorageSync('deviceId') ? true : false |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
onPrint() { |
|
|
|
var that = this |
|
|
|
that.yNum = 10 |
|
|
|
let strCmd = blesdk.CreatCPCLPage(440, 1800, 1, 0); |
|
|
|
|
|
|
|
strCmd += blesdk.addCPCLSETMAG(2, 2) |
|
|
|
strCmd += blesdk.addCPCLLocation(2); |
|
|
|
strCmd += blesdk.addCPCLSETBOLD('400'); |
|
|
|
// strCmd += blesdk.addCPCLText('0', that.yNum, '24', '2', 0, getApp().globalData.printData[0].order_id) |
|
|
|
strCmd += blesdk.addCPCLText('0', that.yNum, '24', '2', 0, "#0112 外卖单") |
|
|
|
|
|
|
|
strCmd += blesdk.addCPCLLocation(0); |
|
|
|
strCmd += blesdk.addCPCLSETBOLD('0') |
|
|
|
|
|
|
|
strCmd += blesdk.addCPCLSETMAG(1, 1) |
|
|
|
strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '七里香快餐明珠精品馆') |
|
|
|
|
|
|
|
strCmd += blesdk.addCPCLSETMAG(1, 1) |
|
|
|
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, "预计时间:2026-02-01 13:14:00") |
|
|
|
|
|
|
|
strCmd += blesdk.addCPCLSETMAG(1, 1) |
|
|
|
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, "*********") |
|
|
|
|
|
|
|
strCmd += blesdk.addCPCLSETMAG(2, 2) |
|
|
|
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '1', 0, '王 先生') |
|
|
|
|
|
|
|
|
|
|
|
strCmd += blesdk.addCPCLSETMAG(1, 1) |
|
|
|
strCmd += blesdk.addCPCLText('0', that.yNum += 50, '24', '0', 0, '联系电话: *******0775') |
|
|
|
|
|
|
|
strCmd += blesdk.addCPCLSETMAG(2, 2) |
|
|
|
strCmd += blesdk.addCPCLText('0', that.yNum += 50, '24', '0', 0, '地址:河北东川建设集团有限公司(河北省沧州市运河区)******') |
|
|
|
|
|
|
|
strCmd += blesdk.addCPCLSETMAG(1, 1) |
|
|
|
strCmd += blesdk.addCPCLText('0', that.yNum += 50, '24', '0', 0, '为保护隐私,顾客电话及地址已隐藏,') |
|
|
|
|
|
|
|
strCmd += blesdk.addCPCLSETMAG(1, 1) |
|
|
|
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, '您可登陆商家端或骑手端查看') |
|
|
|
|
|
|
|
strCmd += blesdk.addCPCLSETMAG(1, 1) |
|
|
|
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, |
|
|
|
'*******************************************') |
|
|
|
|
|
|
|
strCmd += blesdk.addCPCLSETMAG(2, 2) |
|
|
|
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, '1、红烧黛玉') |
|
|
|
|
|
|
|
strCmd += blesdk.addCPCLSETMAG(2, 2) |
|
|
|
strCmd += blesdk.addCPCLText('0', that.yNum += 50, '24', '0', 0, 'X1 16元') |
|
|
|
|
|
|
|
strCmd += blesdk.addCPCLSETMAG(1, 1) |
|
|
|
strCmd += blesdk.addCPCLText('0', that.yNum += 50, '24', '0', 0, |
|
|
|
'*******************************************') |
|
|
|
|
|
|
|
strCmd += blesdk.addCPCLSETMAG(1, 1) |
|
|
|
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, '配送费: 1元') |
|
|
|
strCmd += blesdk.addCPCLSETMAG(1, 1) |
|
|
|
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, '合计金额: 17元') |
|
|
|
|
|
|
|
strCmd += blesdk.addCPCLSETMAG(1, 1) |
|
|
|
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, |
|
|
|
'*******************************************') |
|
|
|
|
|
|
|
strCmd += blesdk.addCPCLSETMAG(1, 1) |
|
|
|
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, '商品取到后,如有任何商品问题,请') |
|
|
|
|
|
|
|
strCmd += blesdk.addCPCLSETMAG(1, 1) |
|
|
|
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, '联系商家或平台,客服将为您服务客') |
|
|
|
|
|
|
|
strCmd += blesdk.addCPCLSETMAG(1, 1) |
|
|
|
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, '服电话13521030702,谢谢您的惠顾') |
|
|
|
|
|
|
|
|
|
|
|
strCmd += blesdk.addCPCLPrint(); |
|
|
|
that.bufferData.push(strCmd); |
|
|
|
}, |
|
|
|
statusChange() { |
|
|
|
this.printStatus = true; |
|
|
|
}, |
|
|
|
|