wangfukang 3 weeks ago
parent
commit
cfc253a934
  1. 1
      pages/login/login.vue
  2. 17
      pages/myCenter/setPrint.vue
  3. 19
      pages/shop/addType.vue

1
pages/login/login.vue

@ -389,6 +389,7 @@
uni.setStorageSync('schoolShop', res.result.shop)
uni.setStorageSync('shopTakeaway', item.shopTakeaway)
uni.setStorageSync('printingMethod', item.printingMethod || (res.result.shop && res.result.shop.printingMethod) || 'bluetooth')
uni.setStorageSync('cloudPrinterBrand', (res.result.shop && res.result.shop.printerBrand) || 'daqu')
uni.setStorageSync('cloudPrinterSn', (res.result.shop && res.result.shop.printerSn) || '')
uni.setStorageSync('cloudPrinterName', (res.result.shop && res.result.shop.printerName) || '')
uni.setStorageSync('attrId', item.attrId)

17
pages/myCenter/setPrint.vue

@ -10,7 +10,7 @@
</view>
<view class="connected-printer" v-if="printingMethod == 'cloud'">
<text>{{cloudPrinterSn ? '已绑定云打印机' : '未绑定云打印机'}}</text>
<text class="connected-printer-name">{{cloudPrinterName || cloudPrinterSn || '请到后台绑定'}}</text>
<text class="connected-printer-name">{{cloudPrinterBrandName}} {{cloudPrinterName || cloudPrinterSn || '请到后台绑定'}}</text>
</view>
<button type="primary" style="margin-top: 40rpx;font-size: 32rpx;" :loading="isCloudPrint" v-if="printingMethod == 'cloud' && cloudPrinterSn"
@tap="cloudPrintTest" text=''>云打印测试</button>
@ -96,10 +96,21 @@
isPrint: false,
isCloudPrint: false,
printingMethod: uni.getStorageSync('printingMethod') || 'bluetooth',
cloudPrinterBrand: uni.getStorageSync('cloudPrinterBrand') || 'daqu',
cloudPrinterSn: '',
cloudPrinterName: '',
}
},
computed: {
cloudPrinterBrandName() {
const names = {
daqu: '大趋智能',
yilianyun: '易联云',
feieyun: '飞鹅云'
};
return names[this.cloudPrinterBrand || 'daqu'] || '大趋智能';
}
},
//页面卸载是关闭蓝牙链接
// onUnload() {
// uni.hideLoading()
@ -153,9 +164,11 @@
}, false, 'GET', 'application/x-www-form-urlencoded').then(res => {
if (res.code == 200 && res.result) {
this.printingMethod = res.result.printingMethod || 'bluetooth';
this.cloudPrinterBrand = res.result.printerBrand || 'daqu';
this.cloudPrinterSn = res.result.printerSn || '';
this.cloudPrinterName = res.result.printerName || '';
uni.setStorageSync('printingMethod', this.printingMethod);
uni.setStorageSync('cloudPrinterBrand', this.cloudPrinterBrand);
uni.setStorageSync('cloudPrinterSn', this.cloudPrinterSn);
uni.setStorageSync('cloudPrinterName', this.cloudPrinterName);
}
@ -177,9 +190,11 @@
}, false, 'POST', 'application/x-www-form-urlencoded').then(res => {
if (res.code == 200 && res.result) {
this.printingMethod = res.result.printingMethod || method;
this.cloudPrinterBrand = res.result.printerBrand || 'daqu';
this.cloudPrinterSn = res.result.printerSn || '';
this.cloudPrinterName = res.result.printerName || '';
uni.setStorageSync('printingMethod', this.printingMethod);
uni.setStorageSync('cloudPrinterBrand', this.cloudPrinterBrand);
uni.setStorageSync('cloudPrinterSn', this.cloudPrinterSn);
uni.setStorageSync('cloudPrinterName', this.cloudPrinterName);
uni.showToast({

19
pages/shop/addType.vue

@ -315,13 +315,28 @@
}
.bj-btn {
float: right;
display: flex;
align-items: center;
justify-content: center;
width: 88rpx;
height: 50rpx;
margin: 25rpx 25rpx 0 0;
font-size: 24rpx;
padding: 0;
line-height: 50rpx;
line-height: 1;
color: #00231C;
background: transparent;
border-radius: 50rpx;
border: none;
border: 0;
box-sizing: border-box;
-webkit-appearance: none;
appearance: none;
overflow: hidden;
}
.bj-btn::after {
border: 0;
}
.type-popup {

Loading…
Cancel
Save