tianyi 2 weeks ago
parent
commit
2efe5ab218
  1. 59
      pages/shop/orderDetail.vue

59
pages/shop/orderDetail.vue

@ -13,9 +13,9 @@
</view>
<view class="content">
<view class="box1" style="display: flex;font-size: 28rpx;font-weight: 700;">
<text>{{'#'+data.numberCode}}</text>
<text style="margin: 0 20rpx;">期望送达</text>
<text>明天 06:30</text>
<text v-if="data.numberCode" style="margin-right: 20rpx;">{{'#'+data.numberCode}}</text>
<text style="margin-right: 20rpx;">期望送达</text>
<text>{{formattedMustFinishTime}}</text>
<text style="flex: 1;text-align: right;color: red;">
{{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>
@ -91,7 +91,7 @@
平台服务费
</view>
<view class="">
{{(data.chouyong).toFixed(2)}}
{{data.chouyong ?data.chouyong:0}}
</view>
</view>
</view>
@ -155,11 +155,11 @@
<uni-popup ref="groupPopup" background-color="#fff">
<view class="group-content">
<view style="height: 100rpx;text-align: center;line-height: 100rpx;font-size: 36rpx;font-weight: 700;">
<text>{{data.groupInfo.targetMembers}}人团/</text><text>已拼{{data.groupInfo.currentMembers}}</text>
<text>{{data.groupInfo?data.groupInfo.targetMembers:0}}人团/</text><text>已拼{{data.groupInfo?data.groupInfo.currentMembers:0}}</text>
</view>
<view class="kaituan2">
<view class="kaituan22" style="display: flex;">
<view class="" @tap="goDetail(item)" v-for="(item,index) in data.groupInfo.groupIdList" :key="index" style="width: 90rpx;height: 90rpx;margin: 0 auto;position: relative;">
<view class="" @tap="goDetail(item)" v-for="(item,index) in (data.groupInfo?data.groupInfo.groupIdList:[])" :key="index" style="width: 90rpx;height: 90rpx;margin: 0 auto;position: relative;">
<view style="z-index: 99;position: absolute;top:0;width: 90rpx;height: 90rpx;border-radius: 90rpx;border:4rpx solid #48D1CC"></view>
<view style="">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/801c569079da4540990c1cc634186fdd.png" alt="" style="width: 90rpx;height: 90rpx;border-radius: 90rpx;display: block;" />
@ -171,7 +171,7 @@
</view>
<view v-if="(data.groupInfo.targetMembers - data.groupInfo.currentMembers) > 0" class="kaituan22">
<view v-if="(data.groupInfo?data.groupInfo.targetMembers - data.groupInfo.currentMembers:0) > 0" class="kaituan22">
<view class="weipincheng">
+
</view>
@ -211,6 +211,38 @@
this.shopId = option.id
this.getDetail()
},
computed: {
//
formattedMustFinishTime() {
// 1. deliveryInfo mustFinishTime
const deliveryInfo = this.data.deliveryInfo;
if (!deliveryInfo || !deliveryInfo.mustFinishTime) {
return '';
}
// 2. (: "2026-05-19T17:40:11.000+08:00")
let rawTime = deliveryInfo.mustFinishTime;
// 3. ISO "-" "/"
// 19 "YYYY-MM-DDTHH:mm:ss"
rawTime = rawTime.replace(/-/g, '/');
// "YYYY/MM/DD HH:mm:ss"
rawTime = rawTime.replace('T', ' ').split('.')[0];
// 4. Date
const date = new Date(Date.parse(rawTime));
// 5. "2026-05-19 17:40:11"
const year = date.getFullYear();
const month = (date.getMonth() + 1).toString().padStart(2, '0');
const day = date.getDate().toString().padStart(2, '0');
const hours = date.getHours().toString().padStart(2, '0');
const minutes = date.getMinutes().toString().padStart(2, '0');
const seconds = date.getSeconds().toString().padStart(2, '0');
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}
},
methods: {
getDetail(){
let that = this
@ -218,19 +250,18 @@
if (res.code == 200) {
that.data = res.result
//
//1
let price = that.data.goodsAmount+that.data.packageFee
if(that.data.orderType == 1){
that.data.chouyong = price/100 * uni.getStorageSync('shopTakeaway').commissionRateOne
that.data.yujishouru = price - that.data.chouyong
that.data.chouyong = (price/100 * uni.getStorageSync('shopTakeaway').commissionRateOne).toFixed(2)
that.data.yujishouru = (price - that.data.chouyong).toFixed(2)
}else{
that.data.chouyong = price/100 * uni.getStorageSync('shopTakeaway').commissionRateMore
that.data.yujishouru = price - that.data.chouyong
that.data.chouyong = (price/100 * uni.getStorageSync('shopTakeaway').commissionRateMore).toFixed(2)
that.data.yujishouru = (price - that.data.chouyong).toFixed(2)
}
if(that.data.groupInfo != null){
if(that.data.groupInfo != null && that.data.groupInfo != undefined){
that.data.groupInfo.groupIdList = that.data.groupInfo.groupOrderIds.split(',');
}
that.data.goodsNum = 0
for(let m=0;m<that.data.goodsList.length;m++){
that.data.goodsNum += that.data.goodsList[m].quantity

Loading…
Cancel
Save