代客下单问题修复,积分上传问题修复
This commit is contained in:
@@ -73,16 +73,23 @@
|
||||
<view class="shop-amount">
|
||||
<text
|
||||
class="orderAmount">¥{{item.status == 'unpaid'?item.originAmount:item.orderAmount}}</text>
|
||||
<text class="totalNumber">共{{item.goods.length}}件</text>
|
||||
<text class="totalNumber">共{{totalGoodsNum(item.goods) }}件</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="footer-wrap">
|
||||
<view class="take_food_number u-m-b-16" v-if="item.takeCode">
|
||||
<text class="u-font-24 color-333"> 取餐号:</text>
|
||||
<text class="u-font-32 font-700 color-333">{{item.takeCode}}</text>
|
||||
|
||||
</view>
|
||||
<view class="footer-wrap">
|
||||
<view class="btn" @click.stop="$u.debounce(isRemoveOrder(item,index),1000)"
|
||||
v-if="item.status != 'unpaid' && item.status != 'paying'"> 删除订单 </view>
|
||||
v-if="item.status == 'done' || item.status == 'cancelled'"> 删除订单 </view>
|
||||
<view class="btn s" @click.stop="$u.debounce(showpopupclick(item),1000)"
|
||||
v-if="item.status == 'unpaid' || item.status == 'paying'"> 去付款 </view>
|
||||
</view> -->
|
||||
|
||||
<view class="btn s" @click.stop="agignOrder(item)" v-if="item.status == 'done'"> 再来一单 </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-colum" v-if="orderForm.list.length <= 0">
|
||||
@@ -116,13 +123,59 @@
|
||||
} from '@dcloudio/uni-app'
|
||||
import Nav from '@/components/CustomNavbar.vue'; //导航栏
|
||||
import {
|
||||
APIuserorder
|
||||
APIuserorder,
|
||||
APIputuserorder
|
||||
} from '@/common/api/order/index.js'
|
||||
// pinia管理
|
||||
import {
|
||||
useNavbarStore
|
||||
} from '@/stores/navbarStore';
|
||||
import {APIshopUserInfo} from '@/common/api/member.js'
|
||||
const store = useNavbarStore();
|
||||
|
||||
async function agignOrder(item){
|
||||
await APIshopUserInfo({
|
||||
shopId:item.shopId
|
||||
}).then(shopUserInfo=>{
|
||||
if(shopUserInfo){
|
||||
uni.cache.set("dinersNum", 1);
|
||||
uni.cache.set("tableCode", shopUserInfo.id);
|
||||
uni.cache.set("shopId", item.shopId);
|
||||
uni.navigateTo({
|
||||
url: "/pages/product/index?type=beforehand&order_id="+item.id+'&one_more_order=1',
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
function totalGoodsNum(arr){
|
||||
if(!arr){
|
||||
return 0
|
||||
}
|
||||
return arr.reduce((prve,cur)=>{
|
||||
return prve+cur.num
|
||||
},0)
|
||||
}
|
||||
function isRemoveOrder(item) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '订单一旦删除不可恢复,确认删除该订单吗?',
|
||||
showCancel: true,
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
APIputuserorder(item.id).then(res => {
|
||||
uni.showToast({
|
||||
title: '删除成功',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(() => {
|
||||
init_fn()
|
||||
}, 1000)
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 导航栏
|
||||
const tabs = [{
|
||||
@@ -218,15 +271,15 @@
|
||||
}
|
||||
|
||||
const orderinfo = (e) => {
|
||||
if(e.status=='unpaid'){
|
||||
uni.cache.set('shopId',e.shopId)
|
||||
if (e.status == 'unpaid') {
|
||||
uni.cache.set('shopId', e.shopId)
|
||||
uni.pro.navigateTo('order/confirm-order', {
|
||||
orderId: e.id,
|
||||
shopId: e.shopId,
|
||||
})
|
||||
return
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
uni.pro.navigateTo('order/detail', {
|
||||
orderId: e.id,
|
||||
shopId: e.shopId
|
||||
@@ -340,7 +393,7 @@
|
||||
}
|
||||
|
||||
.header-wrap {
|
||||
padding: 16rpx 18rpx;
|
||||
padding: 32rpx 24rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
@@ -378,7 +431,7 @@
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: 0 18rpx 18rpx 18rpx;
|
||||
padding: 0 24rpx 16rpx 30rpx;
|
||||
|
||||
.shop-info {
|
||||
display: flex;
|
||||
@@ -450,11 +503,9 @@
|
||||
padding: 0 18rpx 32rpx 18rpx;
|
||||
|
||||
.btn {
|
||||
width: 128rpx;
|
||||
height: 48rpx;
|
||||
line-height: 43rpx;
|
||||
text-align: center;
|
||||
background: #FFFFFF;
|
||||
padding: 6rpx 14rpx;
|
||||
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||
border: 2rpx solid #EDEDED;
|
||||
font-weight: 400;
|
||||
@@ -527,4 +578,10 @@
|
||||
.ml-20 {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.take_food_number{
|
||||
padding: 20rpx;
|
||||
background-color: #F8F8F8;
|
||||
margin-left: 36rpx;
|
||||
margin-right: 24rpx;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user