wangfukang 2 days ago
parent
commit
09953043c4
  1. 4
      components/print/index.js
  2. 10
      pages/index/index.vue
  3. 49
      pages/worker/index.vue

4
components/print/index.js

@ -84,6 +84,9 @@ export default {
}, },
//写入控制命令 //写入控制命令
async writeBLECharacteristicValue(onDone) { async writeBLECharacteristicValue(onDone) {
const printTask = (getApp().globalData.printData && getApp().globalData.printData[0]) || {};
const printReason = String(printTask.printReason || '');
const scanVerifyPrint = printTask.scanVerify == 1 || printTask.scanVerify === true || printTask.scanVerify == 'true' || printReason.indexOf('SCAN_VERIFY') != -1;
let printerJobs = new PrinterJobs(); let printerJobs = new PrinterJobs();
printerJobs.setAlign('ct').setSize(2, 2).setLineSpacing(60).print( printerJobs.setAlign('ct').setSize(2, 2).setLineSpacing(60).print(
data1.deliveryType == 1 && data1.orderType == 3 ? data1.deliveryInfo.numberCode : data1.numberCode data1.deliveryType == 1 && data1.orderType == 3 ? data1.deliveryInfo.numberCode : data1.numberCode
@ -94,6 +97,7 @@ export default {
(data1.status == 7 || data1.status == 11) ? '申请退款' : (data1.status == 7 || data1.status == 11) ? '申请退款' :
(data1.deliveryType == 1 && data1.orderType == 3) ? '面对面配送' : (data1.deliveryType == 1 && data1.orderType == 3) ? '面对面配送' :
(data1.status == 3 && data1.deliveryType == 2 && data1.userRequireMake != 1) ? '待消费' : (data1.status == 3 && data1.deliveryType == 2 && data1.userRequireMake != 1) ? '待消费' :
scanVerifyPrint ? '到店核销' :
data1.status == 5 ? '已完成' : data1.status == 5 ? '已完成' :
data1.status == 6 ? '已取消' : data1.status == 6 ? '已取消' :
data1.status == 8 ? '已退款' : data1.status == 8 ? '已退款' :

10
pages/index/index.vue

@ -548,7 +548,7 @@
title: '核销成功', title: '核销成功',
icon: 'none' icon: 'none'
}) })
that.printAfterComplete(productId) that.printAfterComplete(productId, true)
} else { } else {
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
@ -579,10 +579,11 @@
} }
}) })
}, },
printAfterComplete(orderId) { printAfterComplete(orderId, scanVerify) {
if (!orderId) return; if (!orderId) return;
if (uni.getStorageSync('printingMethod') == 'cloud') { if (uni.getStorageSync('printingMethod') == 'cloud') {
this.NB.sendRequest("/mall/order/cloudPrint/" + orderId, {}, false, 'post', const url = "/mall/order/cloudPrint/" + orderId + (scanVerify ? '?scanVerify=true' : '');
this.NB.sendRequest(url, {}, false, 'post',
'application/x-www-form-urlencoded').then((res) => { 'application/x-www-form-urlencoded').then((res) => {
if (res.code != 200) { if (res.code != 200) {
uni.showToast({ uni.showToast({
@ -594,7 +595,8 @@
return; return;
} }
getApp().globalData.printData.push({ getApp().globalData.printData.push({
order_id: orderId order_id: orderId,
scanVerify: scanVerify ? 1 : 0
}); });
if (!getApp().globalData.isPrinting) { if (!getApp().globalData.isPrinting) {
this.processPrintQueue(); this.processPrintQueue();

49
pages/worker/index.vue

@ -139,13 +139,11 @@
{{(item.deliveryFee + item.deliveryFeeMarketplace).toFixed(2)}} {{(item.deliveryFee + item.deliveryFeeMarketplace).toFixed(2)}}
</view> </view>
<view class="shangjia"> <view class="shangjia">
<text <text class="shop-name">{{item.shopName != null ? item.shopName : ''}}</text>
style="font-weight: 700;">{{item.shopName != null ? item.shopName : ''}}</text> <view v-if="item.deliveryType == 1" class="shop-detail-tag">
<view v-if="item.deliveryType == 1"
style="width: 32rpx;height: 30rpx;font-weight: 700;font-size: 20rpx;color: #fff;text-align: center;background: #00BFFF;border-radius: 10rpx;margin: 20rpx 0 0 10rpx;line-height: 30rpx;">
</view> </view>
<view v-else style="font-weight: 700;padding-left: 30rpx;"> <view v-else class="shop-count">
{{item.allCount ? item.allCount : 0}} {{item.allCount ? item.allCount : 0}}
</view> </view>
</view> </view>
@ -1472,11 +1470,46 @@
.shangjia { .shangjia {
width: 100%; width: 100%;
height: 70rpx;
margin: 0 auto; margin: 0 auto;
line-height: 70rpx; min-height: 70rpx;
padding-left: 28rpx; padding: 12rpx 118rpx 8rpx 28rpx;
box-sizing: border-box;
display: flex; display: flex;
align-items: flex-start;
}
.shop-name {
flex: 1;
min-width: 0;
font-weight: 700;
line-height: 38rpx;
word-break: break-all;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.shop-detail-tag {
flex-shrink: 0;
width: 32rpx;
height: 30rpx;
margin: 4rpx 0 0 10rpx;
border-radius: 10rpx;
background: #00BFFF;
color: #fff;
font-size: 20rpx;
font-weight: 700;
line-height: 30rpx;
text-align: center;
}
.shop-count {
flex-shrink: 0;
padding-left: 30rpx;
font-weight: 700;
line-height: 38rpx;
} }
.maotou { .maotou {

Loading…
Cancel
Save