|
|
@ -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 |
|
|
|