tianyi 11 hours ago
parent
commit
a2d14e1753
  1. 47
      package2/shop/merchantCenter.vue
  2. 35
      package2/shop/orderDetail.vue
  3. 131
      package2/shop/shopOrderList.vue

47
package2/shop/merchantCenter.vue

@ -33,7 +33,7 @@
<view class="order22"> <view class="order22">
<view class="order33" @tap="goDetail('db',3)"> <view class="order33" @tap="goDetail('db',3)">
<view class="order44"> <view class="order44">
0 {{daichucan}}
</view> </view>
<view class="order55"> <view class="order55">
待出餐 待出餐
@ -41,7 +41,7 @@
</view> </view>
<view class="order33" @tap="goDetail('db',4)"> <view class="order33" @tap="goDetail('db',4)">
<view class="order44"> <view class="order44">
0 {{daiquhuo}}
</view> </view>
<view class="order55"> <view class="order55">
待取货 待取货
@ -49,7 +49,7 @@
</view> </view>
<view class="order33" @tap="goDetail('db',5)"> <view class="order33" @tap="goDetail('db',5)">
<view class="order44"> <view class="order44">
0 {{daisongda}}
</view> </view>
<view class="order55"> <view class="order55">
待送达 待送达
@ -59,7 +59,7 @@
<view class="order22"> <view class="order22">
<view class="order33" @tap="goDetail('db',2)"> <view class="order33" @tap="goDetail('db',2)">
<view class="order44"> <view class="order44">
0 {{daixiaofei}}
</view> </view>
<view class="order55"> <view class="order55">
待消费 待消费
@ -67,7 +67,7 @@
</view> </view>
<view class="order33" @tap="goDetail('db',7)"> <view class="order33" @tap="goDetail('db',7)">
<view class="order44"> <view class="order44">
0 {{shopData.refundCount == undefined?0:shopData.refundCount}}
</view> </view>
<view class="order55"> <view class="order55">
待退款/售后 待退款/售后
@ -75,7 +75,7 @@
</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">
待回复差评 待回复差评
@ -97,7 +97,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">
今日订单 今日订单
@ -105,7 +105,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">
营业额 营业额
@ -178,7 +178,12 @@
return { return {
menuButtonInfo: {}, menuButtonInfo: {},
businessStatus:1, businessStatus:1,
shop:{} shop:{},
shopData:{},
daixiaofei:0,
daichucan:0,
daiquhuo:0,
daisongda:0
} }
}, },
onShow() { onShow() {
@ -186,8 +191,32 @@
}, },
onLoad(option) { onLoad(option) {
this.getBusinessStatus() this.getBusinessStatus()
this.getData()
}, },
methods: { methods: {
getData(){
this.tui.request("/mall/order/countByShop/"+uni.getStorageSync('shopId'), "GET", {}, false, true).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 {
this.tui.toast(res.message)
}
uni.hideLoading()
}).catch((res) => {})
},
// //
getBusinessStatus(){ getBusinessStatus(){
this.tui.request("/app/shoptakeaway/getByShopId", "GET", { this.tui.request("/app/shoptakeaway/getByShopId", "GET", {

35
package2/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>
@ -192,6 +192,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

131
package2/shop/shopOrderList.vue

@ -16,7 +16,8 @@
:scroll-with-animation="true"> :scroll-with-animation="true">
<view class="status-list"> <view class="status-list">
<view v-for="(item, index) in statusList" :key="index" class="status-item" <view v-for="(item, index) in statusList" :key="index" class="status-item"
:class="{ 'active': currentIndex == item.value }" @click="handleStatusClick(item.value,item.value)"> :class="{ 'active': currentIndex == item.value }"
@click="handleStatusClick(item.value,item.value)">
<text class="status-text">{{ item.name }}</text> <text class="status-text">{{ item.name }}</text>
</view> </view>
</view> </view>
@ -28,16 +29,16 @@
{{'#' + item.numberCode}} {{'#' + item.numberCode}}
</view> </view>
<view style="flex: 1;display: flex;padding-left: 20rpx;"> <view style="flex: 1;display: flex;padding-left: 20rpx;">
{{item.createTime | formatISOTime}} {{item.createTime | formatISOTime}}
<!-- <text>已退款</text> --> <!-- <text>已退款</text> -->
</view> </view>
<view> <view>
{{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.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?'已售后':""}}
</view> </view>
</view> </view>
<view style="height: 120rpx;padding-top: 20rpx;"> <view style="height: 120rpx;padding-top: 20rpx;">
<view style="height: 50rpx;line-height: 50rpx;font-size: 28rpx;font-weight: 700;display: flex;"> <view style="height: 50rpx;line-height: 50rpx;font-size: 28rpx;font-weight: 700;display: flex;">
商品 <text><text>{{item.goodsNum}}</text></text> <text style="color: red;flex: 1;text-align: right;">已出餐</text> 商品 <text><text>{{item.goodsNum}}</text></text>
</view> </view>
<view style="display: flex;" v-for="(item1,index1) in item.goodsList" :key="index"> <view style="display: flex;" v-for="(item1,index1) in item.goodsList" :key="index">
<view style="flex: 1;"> <view style="flex: 1;">
@ -51,6 +52,12 @@
</view> </view>
</view> </view>
</view> </view>
<view @tap.stop="mealServing(item)" v-if="currentIndex == 13" style="height: 40px;border-top: 1px solid #eee;display: flex;">
<view style="flex: 1;"></view>
<view style="background: linear-gradient(90deg, rgba(227, 255, 150, 1), rgba(166, 255, 234, 1));width: 50px;height: 30px;border-radius: 7px;line-height: 30px;text-align: center;font-weight: 700;margin-top: 10px;">
已出餐
</view>
</view>
</view> </view>
</view> </view>
</template> </template>
@ -60,31 +67,22 @@
data() { data() {
return { return {
loadStatus: 'more', loadStatus: 'more',
searchForm:{ searchForm: {
pageNum:1, pageNum: 1,
pageSize:10, pageSize: 10,
shopName:'', shopName: '',
searchStatus:10, searchStatus: 10,
shopId:uni.getStorageSync('shopId'), shopId: uni.getStorageSync('shopId'),
regionId:JSON.parse(uni.getStorageSync('area')).id regionId: JSON.parse(uni.getStorageSync('area')).id
}, },
totalPages: 1, totalPages: 1,
orderList:[], orderList: [],
currentIndex: 10, currentIndex: 10,
menuButtonInfo: {}, menuButtonInfo: {},
statusList: [{ statusList: [{
name: '全部', name: '全部',
value: 10, value: 10,
checked: true checked: true
},{
name: '待支付',
value: 0,
checked: true
},
{
name: '待成团',
value: 1,
checked: false
}, },
{ {
name: '待消费', name: '待消费',
@ -92,8 +90,8 @@
checked: false checked: false
}, },
{ {
name: '待接单', name: '待出餐',
value: 3, value: 13,
checked: false checked: false
}, },
{ {
@ -125,16 +123,6 @@
name: '已取消', name: '已取消',
value: 9, value: 9,
checked: false checked: false
},
{
name: '售后中',
value: 11,
checked: false
},
{
name: '已售后',
value: 12,
checked: false
} }
] ]
} }
@ -145,33 +133,47 @@
this.searchForm.pageNum++; this.searchForm.pageNum++;
this.getOrderList(); this.getOrderList();
}, },
filters:{ filters: {
formatISOTime(isoString) { formatISOTime(isoString) {
const date = new Date(isoString); const date = new Date(isoString);
const year = date.getFullYear(); const year = date.getFullYear();
const month = (date.getMonth() + 1).toString().padStart(2, '0'); const month = (date.getMonth() + 1).toString().padStart(2, '0');
const day = date.getDate().toString().padStart(2, '0'); const day = date.getDate().toString().padStart(2, '0');
const hours = date.getHours().toString().padStart(2, '0'); const hours = date.getHours().toString().padStart(2, '0');
const minutes = date.getMinutes().toString().padStart(2, '0'); const minutes = date.getMinutes().toString().padStart(2, '0');
const seconds = date.getSeconds().toString().padStart(2, '0'); const seconds = date.getSeconds().toString().padStart(2, '0');
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
} }
}, },
onShow() { onShow() {
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect() this.menuButtonInfo = uni.getMenuButtonBoundingClientRect()
}, },
onLoad(option) { onLoad(option) {
if(option.index){ if (option.index) {
this.searchForm.searchStatus = option.index this.searchForm.searchStatus = option.index
this.currentIndex = option.index this.currentIndex = option.index
} }
this.getList() this.getList()
}, },
methods: { methods: {
getList(){ getList() {
this.loadStatus = 'loading' this.loadStatus = 'loading'
let that = this let that = this
that.tui.request("/mall/order/page", "POST", this.searchForm, false, false).then((res) => { 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.tui.request(url, "POST", this.currentIndex == 11 ? data : this.searchForm, false, false).then((
res) => {
that.loadStatus = 'nomore'; that.loadStatus = 'nomore';
if (res.code == 200) { if (res.code == 200) {
if (that.searchForm.pageNum == 1) { if (that.searchForm.pageNum == 1) {
@ -179,9 +181,9 @@
} else { } else {
that.orderList = [...that.orderList, ...res.result.records] that.orderList = [...that.orderList, ...res.result.records]
} }
for(let i=0;i<that.orderList.length;i++){ for (let i = 0; i < that.orderList.length; i++) {
that.orderList[i].goodsNum = 0 that.orderList[i].goodsNum = 0
for(let m=0;m<that.orderList[i].goodsList.length;m++){ for (let m = 0; m < that.orderList[i].goodsList.length; m++) {
that.orderList[i].goodsNum += that.orderList[i].goodsList[m].quantity that.orderList[i].goodsNum += that.orderList[i].goodsList[m].quantity
} }
} }
@ -194,12 +196,41 @@
uni.hideLoading(); uni.hideLoading();
}).catch((res) => {}); }).catch((res) => {});
}, },
goDetail(id){ 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) => {});
}
}
});
},
goDetail(id) {
uni.navigateTo({ uni.navigateTo({
url:'/package2/shop/orderDetail?id=' + id url: '/package2/shop/orderDetail?id=' + id
}) })
}, },
handleStatusClick(index,value) { handleStatusClick(index, value) {
if (this.currentIndex === index) return; if (this.currentIndex === index) return;
this.currentIndex = index; this.currentIndex = index;
this.searchForm.searchStatus = value this.searchForm.searchStatus = value

Loading…
Cancel
Save