diff --git a/components/print/index.js b/components/print/index.js index 560edb4..edb9594 100644 --- a/components/print/index.js +++ b/components/print/index.js @@ -9,13 +9,23 @@ export default { getData() { var that = this; + console.log("1111111111111111111111111111111") if(uni.getStorageSync('bluetoothDeviceId')){ let id = uni.getStorageSync('bluetoothDeviceId') this.bindViewTap(id,false) }else{ uni.showModal({ title: '提示', - content: '您还没有连接打印机,将无法为您打印小票!' + content: '您还没有连接打印机,将无法为您打印小票!', + confirmText:'连接蓝牙', + cancelText:'暂不连接', + success: function (res) { + if (res.confirm) { + uni.navigateTo({ + url:'/pages/myCenter/setPrint' + }) + } + } }); } }, diff --git a/components/tab-bar/delivery.vue b/components/tab-bar/delivery.vue index 46ead4d..c9c2ac3 100644 --- a/components/tab-bar/delivery.vue +++ b/components/tab-bar/delivery.vue @@ -19,36 +19,45 @@ - - - - {{'#' + item.numberCode}} - - - {{item.createTime | formatISOTime}} - - - - {{item.status == 0?'待支付':item.status == 1?' 待成团':item.status == 2?'待消费':item.status == 3?'待接单':item.status == 4?'待取货':item.status == 5?'待送达':item.status == 6?'已完成':item.status == 7?'待退款':item.status == 8?'已退款':item.status == 9?'已取消':item.status == 11?'售后中':item.status == 12?'已售后':""}} - - - - - 商品 {{item.goodsNum}} 已出餐 - - - - {{item1.productName}} + + + + + {{'#' + item.numberCode}} - - {{'X' + item1.quantity}} + + {{item.createTime | formatISOTime}} + - {{'¥'+ item1.price}} + {{item.status == 0?'待支付':item.status == 2?'待配送员接单':(item.status == 3 && item.deliveryType == 1 && item.shopMakeTime == null) || (item.status == 3 && item.deliveryType == 2 && item.userRequireMake == 1)?'待出餐':(item.status == 3 && item.deliveryType == 1 && item.shopMakeTime != null)?'待取货':(item.status == 3 && item.deliveryType == 2)?'待消费':item.status == 4?'待送达':item.status == 5?'已完成':item.status == 7?'待同意退款':item.status == 8?'已退款':item.status == 6?'已取消':item.status == 11?'售后中':item.status == 12?'已售后':""}} + + + + + 商品 {{item.goodsNum}} + + + + {{item1.productName}} + + + {{'X' + item1.quantity}} + + + {{'¥'+ item1.price}} + + + + + + + 已出餐 - + + @@ -56,7 +65,6 @@ export default { data() { return { - loadStatus: 'more', searchForm:{ pageNum:1, pageSize:10, @@ -73,24 +81,23 @@ value: 10, checked: true }, - { name: '待消费', value: 2, checked: false }, { - name: '待接单', - value: 3, + name: '待出餐', + value: 13, checked: false }, { - name: '待发货', + name: '待取货', value: 4, checked: false }, { - name: '已发货', + name: '待送达', value: 5, checked: false }, @@ -105,29 +112,18 @@ checked: false }, { - name: '已取消', - value: 9, + name: '已退款', + value: 8, checked: false }, { - name: '售后中', - value: 11, - checked: false - }, - { - name: '已售后', - value: 12, + name: '已取消', + value: 9, checked: false } ] } }, - onReachBottom() { - if (this.searchForm.pageNum >= this.totalPages) return; - // this.status = 'loading'; - this.searchForm.pageNum++; - this.getOrderList(); - }, filters:{ formatISOTime(isoString) { const date = new Date(isoString); @@ -141,19 +137,64 @@ } }, methods: { - init(){ - // if(option.index){ - // this.searchForm.searchStatus = option.index - // this.currentIndex = option.index - // } + init(index){ + if(index){ + this.searchForm.searchStatus = index + this.currentIndex = index + } this.getList() }, + onReachPage(){ + console.log("11111") + if (this.searchForm.pageNum >= this.totalPages) return; + this.searchForm.pageNum++; + this.getList(); + }, + mealServing(item){ + let that = this + uni.showModal({ + title: '提示', + content: '确定要出餐吗?', + success: function (res) { + if (res.confirm) { + let data = {} + let url = '' + if(item.deliveryType == 2){ //自取单 + url = '/mall/order/complete' + }else if(item.deliveryType == 1){ //外卖单 + url = '/mall/order/shopMakeTime' + } + that.tui.request(url, "post", { + orderId:item.id + }, false, true).then((res) => { + if (res.code == 200) { + that.getList() + } else { + that.tui.toast(res.message); + return; + } + uni.hideLoading(); + }).catch((res) => {}); + } + } + }); + }, getList(){ - this.loadStatus = 'loading' let that = this - - that.NB.sendRequest("/mall/order/page", this.searchForm, true, 'POST', 'application/json').then((res) => { - that.loadStatus = 'nomore'; + let url = '' + let data = { + linkId: uni.getStorageSync('shopId'), + pageNum: this.searchForm.pageNum, + pageSize: 10, + statusList: [0, 3], + regionId:JSON.parse(uni.getStorageSync('area')).regionId + } + if(this.currentIndex == 11){ + url = "/mall/refund/page" + }else{ + url = "/mall/order/page" + } + that.NB.sendRequest(url, this.currentIndex == 11?data : this.searchForm, true, 'POST', 'application/json').then((res) => { if (res.code == 200) { if (that.searchForm.pageNum == 1) { that.orderList = res.result.records; @@ -183,6 +224,7 @@ handleStatusClick(index,value) { if (this.currentIndex === index) return; this.currentIndex = index; + this.searchForm.pageNum = 1 this.searchForm.searchStatus = value this.getList() } @@ -298,5 +340,6 @@ background: #fff; border-radius: 20rpx; padding: 20rpx; + height: 100px; } \ No newline at end of file