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

147
pages/index/index.vue

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

35
pages/shop/orderDetail.vue

@ -17,7 +17,7 @@
<text style="margin: 0 10px;">期望送达</text> <text style="margin: 0 10px;">期望送达</text>
<text>明天 06:30</text> <text>明天 06:30</text>
<text style="flex: 1;text-align: right;color: red;"> <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> </text>
</view> </view>
<view class="box1" style="display: flex;height: 50px;line-height: 50px;padding: 0 10px;"> <view class="box1" style="display: flex;height: 50px;line-height: 50px;padding: 0 10px;">
@ -138,8 +138,8 @@
<view class="btn"> <view class="btn">
打印小票 打印小票
</view> </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> </view>
</view> </view>
@ -191,6 +191,35 @@
uni.hideLoading(); uni.hideLoading();
}).catch((res) => {}); }).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){ makeCall(phone){
uni.makePhoneCall({ uni.makePhoneCall({
phoneNumber: phone phoneNumber: phone

Loading…
Cancel
Save