tianyi 10 hours ago
parent
commit
185309613a
  1. 151
      pages/index/index.vue
  2. 35
      pages/shop/orderDetail.vue

151
pages/index/index.vue

@ -30,25 +30,25 @@
</view>
<view class="order2">
<view class="order22">
<view class="order33" @tap="changeIndex(1)">
<view class="order33" @tap="changeIndex(1,3)">
<view class="order44">
0
{{daichucan}}
</view>
<view class="order55">
接单
出餐
</view>
</view>
<view class="order33" @tap="changeIndex(1)">
<view class="order33" @tap="changeIndex(1,4)">
<view class="order44">
0
{{daiquhuo}}
</view>
<view class="order55">
待取货
</view>
</view>
<view class="order33" @tap="changeIndex(1)">
<view class="order33" @tap="changeIndex(1,5)">
<view class="order44">
0
{{daisongda}}
</view>
<view class="order55">
待送达
@ -56,33 +56,25 @@
</view>
</view>
<view class="order22">
<view class="order33" @tap="changeIndex(1)">
<view class="order33" @tap="changeIndex(1,2)">
<view class="order44">
0
{{daixiaofei}}
</view>
<view class="order55">
待消费
</view>
</view>
<view class="order33" @tap="changeIndex(1)">
<view class="order33" @tap="changeIndex(1,11)">
<view class="order44">
0
{{shopData.refundCount == undefined?0:shopData.refundCount}}
</view>
<view class="order55">
待退款
</view>
</view>
<view class="order33" @tap="changeIndex(1)">
<view class="order44">
0
</view>
<view class="order55">
待售后
待退款/售后
</view>
</view>
<view class="order33" @tap="goDetail('pj')">
<view class="order44">
0
{{shopData.pendingBadReviewCount == undefined?0:shopData.pendingBadReviewCount}}
</view>
<view class="order55">
待回复差评
@ -104,7 +96,7 @@
<view class="data2">
<view class="data22">
<view class="data222">
0
{{shopData.orderRevenueAndCount.count}}
</view>
<view class="data333">
今日订单
@ -112,7 +104,7 @@
</view>
<view class="data22">
<view class="data222">
0
{{shopData.orderRevenueAndCount.amount}}
</view>
<view class="data333">
营业额
@ -219,6 +211,11 @@
shop:{},
areaList:[],
shopList: [],
shopData:{},
daixiaofei:0,
daichucan:0,
daiquhuo:0,
daisongda:0
}
},
components: {
@ -228,6 +225,7 @@
},
onShow() {
this.indexInit()
this.getData()
},
onLoad() {
@ -245,29 +243,6 @@
this.checkArea()
}
},
//
onActionItemClick(item) {
if(this.type == 'wuliu'){
this.current = item.id
this.name = item.companyName
}else{
this.current = item.shop.id
this.name = item.shopName
this.shopOwnerPhone = item.shopOwnerPhone
}
if (!this.shopName) return this.tui.toast('请输入新店铺名称', 2000)
this.tui.request("/app/shop/modifyShopNameById", "put", {
id: this.shopId,
shopName: this.shopName
}, false, true).then((res) => {
if (res.code === 200) {
this.getList()
this.onPopupClose()
} else {
this.tui.toast(res.message)
}
})
},
checkArea(){
this.NB.sendRequest("/auth/getShopByUser", {}, false, 'post', 'application/x-www-form-urlencoded').then((res) => {
if (res.code == 200) {
@ -378,43 +353,65 @@
url: url
})
},
getData(){
that.NB.sendRequest("/mall/order/countByShop/"+uni.getStorageSync('shopId'), {}, true, 'GET', 'application/x-www-form-urlencoded').then((res) => {
if (res.code == 200) {
this.shopData = res.result
for(let i=0;i<this.shopData.orderStatusCount.length;i++){
if(this.shopData.orderStatusCount[i].counttype){
if(this.shopData.orderStatusCount[i].counttype == 'daisong'){
this.daisongda = this.shopData.orderStatusCount[i].count
}else if(this.shopData.orderStatusCount[i].counttype == 'daiqu'){
this.daiquhuo = this.shopData.orderStatusCount[i].count
}else if(this.shopData.orderStatusCount[i].counttype == 'daixiaofei'){
this.daixiaofei = this.shopData.orderStatusCount[i].count
}else if(this.shopData.orderStatusCount[i].counttype == 'daichucan'){
this.daichucan = this.shopData.orderStatusCount[i].count
}
}
}
} else {
that.tui.toast(res.message)
}
uni.hideLoading()
}).catch((res) => {})
},
//
scanCodeAdd() {
let that = this;
uni.scanCode({
success: (res) => {
if (res.scanType == "QR_CODE") { //
console.log('二维码',res)
// let shopId = base.decode(res.result.split(',')[1])
// if (shopId == uni.getStorageSync('shopId').substring('10', '12')) {
// that.productId = base.decode(res.result.split(',')[0])
// that.toggle('bottom', base.decode(res.result.split(',')[0]));
let shopId = res.result.split('@@')[1]
if (shopId == uni.getStorageSync('shopId')) {
let productId = res.result.split('@@')[0]
uni.showModal({
title: '提示',
content: '确定要核销该订单吗?',
success: function (res1) {
if (res1.confirm) {
that.NB.sendRequest("/mall/order/complete", {
orderId: productId
}, true, 'post', 'application/x-www-form-urlencoded').then((res) => {
if (res.code == 200) {
uni.showToast({
title: '核销成功',
icon: 'none'
})
} else {
that.tui.toast(res.message)
}
uni.hideLoading()
}).catch((res) => {})
}
}
});
// } else {
// that.tui.toast('')
// }
} else {
console.log('条形码',res)
// that.NB.sendRequest("/app/product/getByBarcode", "POST", {
// barcode: res.result
// }, false, true).then((res1) => {
// if (res1.code == 200) {
// that.productId = res1.result[0].id
// if (res1.result == '') {
// that.tui.toast('')
// } else {
// that.toggle('bottom', res1.result[0].id);
// }
// } else {
// that.tui.toast(res.message)
// }
// }).catch((res) => {
// that.tui.toast(res)
// })
} else {
that.tui.toast('未查询到此订单信息,请核实!')
}
}
},
fail: (res) => {
uni.showToast({
@ -425,7 +422,7 @@
})
},
//tab
changeIndex(index) {
changeIndex(index,type) {
let that = this;
this.lastIndex = this.currentIndex
this.currentIndex = index
@ -434,7 +431,7 @@
this.indexInit()
break;
case 1:
that.$refs.deLivery.init()
that.$refs.deLivery.init(type)
break;
case 2:
that.$refs.myCenter.init()

35
pages/shop/orderDetail.vue

@ -17,7 +17,7 @@
<text style="margin: 0 10px;">期望送达</text>
<text>明天 06:30</text>
<text style="flex: 1;text-align: right;color: red;">
{{data.status == 0?'待支付':data.status == 1?' 待成团':data.status == 2?'待消费':data.status == 3?'待接单':data.status == 4?'待取货':data.status == 5?'待送达':data.status == 6?'已完成':data.status == 7?'待退款':data.status == 8?'已退款':data.status == 9?'已取消':data.status == 11?'售后中':data.status == 12?'已售后':""}}
{{data.status == 0?'待支付':data.status == 2?'待配送员接单':(data.status == 3 && data.deliveryType == 1 && data.shopMakeTime == null) || (data.status == 3 && data.deliveryType == 2 && data.userRequireMake == 1)?'待出餐':(data.status == 3 && data.deliveryType == 1 && data.shopMakeTime != null)?'待取货':(data.status == 3 && data.deliveryType == 2)?'待消费':data.status == 4?'待送达':data.status == 5?'已完成':data.status == 7?'待同意退款':data.status == 8?'已退款':data.status == 6?'已取消':data.status == 11?'售后中':data.status == 12?'已售后':""}}
</text>
</view>
<view class="box1" style="display: flex;height: 50px;line-height: 50px;padding: 0 10px;">
@ -138,8 +138,8 @@
<view class="btn">
打印小票
</view>
<view class="btn" style="background: rgba(0, 35, 28, 1);color: rgba(166, 255, 234, 1);">
取消订单
<view @tap="mealServing(data)" v-if="(data.status == 3 && data.deliveryType == 1 && data.shopMakeTime == null) || (data.status == 3 && data.deliveryType == 2 && data.userRequireMake == 1)" class="btn" style="background: rgba(0, 35, 28, 1);color: rgba(166, 255, 234, 1);">
已出餐
</view>
</view>
</view>
@ -191,6 +191,35 @@
uni.hideLoading();
}).catch((res) => {});
},
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) {
this.back()
} else {
that.tui.toast(res.message);
return;
}
uni.hideLoading();
}).catch((res) => {});
}
}
});
},
makeCall(phone){
uni.makePhoneCall({
phoneNumber: phone

Loading…
Cancel
Save