wangfukang 1 week ago
parent
commit
af45e20092
  1. 1
      package1/group/groupBuySingle.vue
  2. 233
      package1/order/orderDetail.vue

1
package1/group/groupBuySingle.vue

@ -1161,7 +1161,6 @@
for (let cartItem of this.cartItems) { for (let cartItem of this.cartItems) {
totalPackageFee += parseFloat(cartItem.item.lunchBox || 0) * cartItem.quantity; totalPackageFee += parseFloat(cartItem.item.lunchBox || 0) * cartItem.quantity;
} }
// //
uni.navigateTo({ uni.navigateTo({
url: '/package1/buyFood/buyFood?cart=' + encodeURIComponent(JSON.stringify(this.cartItems)) + url: '/package1/buyFood/buyFood?cart=' + encodeURIComponent(JSON.stringify(this.cartItems)) +

233
package1/order/orderDetail.vue

@ -67,14 +67,14 @@
<view class="kaituan41"> <view class="kaituan41">
分享至微信 <uni-icons type="weixin" size="15"></uni-icons> 分享至微信 <uni-icons type="weixin" size="15"></uni-icons>
</view> </view>
<view class="status-btn" style="top:0" v-if="orderStatus(orderDetail)" @tap="returnPopupProp(orderDetail)"> <view class="kaituan41" v-if="orderStatus(orderDetail)" @tap="returnPopupProp(orderDetail)">
取消订单 取消订单 <uni-icons type="weixin" size="15"></uni-icons>
</view> </view>
<view class="status-btn" v-if="orderStatus(orderDetail)" @tap="returnPopupProp(orderDetail)"> <view class="kaituan41" v-if="orderStatusBuy(orderDetail)" @tap="returnPopupPropBuy(orderDetail)">
补差价转直接购买 取消拼团转直接购买 <uni-icons type="weixin" size="15"></uni-icons>
</view> </view>
<view style="top: 35px;" @tap="refreah(orderDetail)"> <view class="kaituan41" @tap="refreah(orderDetail)">
刷新 刷新 <uni-icons type="weixin" size="15"></uni-icons>
</view> </view>
<view class="kaituan51"> <view class="kaituan51">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/c1f1b45c98fa4db1a1e5f98b3a0573c2.png" alt="" style="width: 520rpx;height: 150rpx;margin: 0 auto;display: block;" /> <img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/c1f1b45c98fa4db1a1e5f98b3a0573c2.png" alt="" style="width: 520rpx;height: 150rpx;margin: 0 auto;display: block;" />
@ -134,7 +134,7 @@
<view class="status-btn" style="top: 0;" v-if="orderStatus(orderDetail)" @tap="returnPopupProp(orderDetail)"> <view class="status-btn" style="top: 0;" v-if="orderStatus(orderDetail)" @tap="returnPopupProp(orderDetail)">
取消订单 取消订单
</view> </view>
<view class="status-btn" style="top: 0;" v-if="orderDetail.status == 5 && orderDetail.mallRefundRecord == null" @tap="returnProducts(orderDetail)"> <view class="status-btn" style="top: 0;" v-if="orderDetail.status == 5 && orderDetail.mallRefundRecord.length < 1" @tap="returnProducts(orderDetail)">
申请售后 申请售后
</view> </view>
<view class="status-btn" style="top: 35px;" @tap="refreah(orderDetail)"> <view class="status-btn" style="top: 35px;" @tap="refreah(orderDetail)">
@ -152,9 +152,12 @@
<view class="btn" v-if="orderDetail.status == 3 && orderDetail.deliveryType == 2" @tap="openCode"> <view class="btn" v-if="orderDetail.status == 3 && orderDetail.deliveryType == 2" @tap="openCode">
立即备餐 立即备餐
</view> </view>
<view class="btn" v-if="orderDetail.status == 2" @tap=""> <view class="btn" style="width: 40%;" v-if="orderDetail.status == 2" @tap="">
增加配送佣金 增加配送佣金
</view> </view>
<view class="btn" style="width: 40%;" v-if="orderDetail.status == 2" @tap="">
指派配送员
</view>
<!-- <view class="btn"> <!-- <view class="btn">
再来一单 再来一单
</view> </view>
@ -168,6 +171,100 @@
取消申请 取消申请
</view> --> </view> -->
</view> </view>
<view class="box1" v-if="orderDetail.mallRefundRecord != null && orderDetail.mallRefundRecord.length > 0">
<view style="width: 100%;line-height: 70rpx;font-size: 30rpx;font-weight: 700;">
退款/售后
</view>
<view style="display: flex;padding: 20rpx;background: #eee;border-radius: 20rpx;" v-for="(item2,index2) in orderDetail.mallRefundRecord" :key="index2">
<view>
<view style="height: 80rpx;line-height: 80rpx;display: flex;">
<view style="flex: 1;color: #777;font-weight: 700;">
申请时间
</view>
<view style="color: #000;font-weight:700;">
{{item2.createTime | formatTime}}
</view>
</view>
<view style="height: 80rpx;line-height: 80rpx;display: flex;">
<view style="flex: 1;color: #777;font-weight: 700;">
金额
</view>
<view style="color: #000;font-weight:700;">
{{item2.refundAmount}}
</view>
</view>
<view v-for="(item3,index3) in item2.items" :key="index3" v-if="item2.items != null && item2.items.length > 0" style="display: flex;padding: 20rpx;background: #eee;border-radius: 20rpx;">
<view class="goods-img">
<img :src="item3.productPicture" alt="">
</view>
<view class="goods-content">
<view class="goods-name">
{{item3.productName}}
</view>
<view class="goods-content-center">
<view class="goods-deal1">
{{item3.specs}}
</view>
</view>
<view class="goods-content-bottom">
<view style="width: 50%;">
X{{item3.quantity}}
</view>
<view class="pintuan-left-price">
{{item3.price}}
</view>
</view>
</view>
</view>
<view style="height: 80rpx;line-height: 80rpx;display: flex;">
<view style="flex: 1;color: #777;font-weight: 700;">
原因
</view>
<view style="color: #000;font-weight:700;">
{{item2.reason != null ? item2.reason : ''}}
</view>
</view>
<view style="height: 80rpx;line-height: 80rpx;display: flex;">
<view style="flex: 1;color: #777;font-weight: 700;">
图片
</view>
<view style="color: #000;font-weight:700;">
<image v-if="item2.pictures != null" :src="item2.pictures"></image>
</view>
</view>
<view style="height: 80rpx;line-height: 80rpx;display: flex;">
<view style="flex: 1;color: #777;font-weight: 700;">
退款类型
</view>
<view style="color: #000;font-weight:700;">
{{item2.refundType == 1 ? '退商品' : item2.refundType == 2 ? '退配送费' : '全额退款' }}
<text v-if="item2.refundTypeStatus != null">
| {{item2.refundTypeStatus == 1 ? '商家原因' : item2.refundTypeStatus == 2 ? '配送员原因' : item2.refundTypeStatus == 3 ? '商家/配送员都有原因' : '平台退款' }}
</text>
</view>
</view>
<view style="height: 80rpx;line-height: 80rpx;display: flex;">
<view style="flex: 1;color: #777;font-weight: 700;">
退款状态
</view>
<view style="color: #000;font-weight:700;">
{{item2.status == 0 ? '处理退款中' : item2.status == 1 ? '同意退款' : item2.status == 2 ? '拒绝退款' : item2.status == 3 ? '处理售后中' : item2.status == 4 ? '同意售后' : '拒绝售后' }}
</view>
</view>
<view style="height: 80rpx;line-height: 80rpx;display: flex;" v-if="item2.successTime != null">
<view style="flex: 1;color: #777;font-weight: 700;">
处理退款/售后时间
</view>
<view style="color: #000;font-weight:700;">
{{item2.successTime | formatTime}}
</view>
</view>
</view>
</view>
</view>
<view class="box1"> <view class="box1">
<view style="width: 100%;line-height: 70rpx;font-size: 28rpx;font-weight: 700;"> <view style="width: 100%;line-height: 70rpx;font-size: 28rpx;font-weight: 700;">
{{orderDetail.shopName}} {{orderDetail.shopName}}
@ -234,6 +331,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="box1"> <view class="box1">
<view> <view>
<!-- <view style="height: 80rpx;line-height: 80rpx;display: flex;"> <!-- <view style="height: 80rpx;line-height: 80rpx;display: flex;">
@ -363,6 +461,18 @@
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
<uni-popup ref="returnPopupBuy" background-color="#fff" style="height: 1600rpx !important;">
<view class="guize-list">
<view style="height: 80rpx;line-height: 80rpx;font-size: 36rpx;font-weight: 700;text-align: center;">
确定要取消拼团吗
</view>
<view class="btn" @tap="returnOrderBuy()">
确认取消
</view>
</view>
</uni-popup>
</view> </view>
</template> </template>
@ -471,6 +581,12 @@
} }
return false; return false;
}, },
orderStatusBuy(item){
if(item.status == 10){
return true;
}
return false;
},
returnPopupProp(item){ returnPopupProp(item){
this.payData = item; this.payData = item;
if(this.payData.shopMakeTime != null){ if(this.payData.shopMakeTime != null){
@ -510,6 +626,45 @@
} }
this.$refs.returnPopup.open('bottom'); this.$refs.returnPopup.open('bottom');
}, },
returnPopupPropBuy(item){
this.payData = item;
if(this.payData.shopMakeTime != null){
const date1 = new Date(this.payData.deliveryInfo.acceptTime);
const date2 = new Date(this.payData.shopMakeTime);
// 2. ()
let diffMs = Math.abs(date2 - date1);
// 3.
// 1 = 1000
// 1 = 60
// 1 = 60
const seconds = Math.floor((diffMs / 1000) % 60);
const minutes = Math.floor((diffMs / (1000 * 60)) % 60);
const hours = Math.floor(diffMs / (1000 * 60 * 60));
// 4. ( 9 -> 09)
const fmt = (num) => num.toString().padStart(2, '0');
this.shopTime = `${fmt(hours)}${fmt(minutes)}${fmt(seconds)}`;
const date3 = new Date();
// 2. ()
let diffMs1 = Math.abs(date3 - date2);
// 3.
// 1 = 1000
// 1 = 60
// 1 = 60
const seconds1 = Math.floor((diffMs1 / 1000) % 60);
const minutes1 = Math.floor((diffMs1 / (1000 * 60)) % 60);
const hours1 = Math.floor(diffMs1 / (1000 * 60 * 60));
this.peisongTime = `${fmt(hours1)}${fmt(minutes1)}${fmt(seconds1)}`;
}
this.$refs.returnPopupBuy.open('bottom');
},
returnOrder(){ returnOrder(){
this.$refs.returnPopup.close(); this.$refs.returnPopup.close();
let item = this.payData let item = this.payData
@ -526,6 +681,68 @@
uni.hideLoading(); uni.hideLoading();
}).catch((res) => {}); }).catch((res) => {});
}, },
returnOrderBuy(){
this.$refs.returnPopupBuy.close();
let item = this.payData
let that = this
that.tui.request("/mall/order/cancel", "POST", {refundType:3,refundTypeStatus:4,orderId:item.id,userId:uni.getStorageSync('id')}, false, true).then((res) => {
if (res.code == 200) {
that.tui.request("/app/shop/getShopInfoById", "POST", {id:that.payData.shopId,regionId:JSON.parse(uni.getStorageSync('area')).id}, false, true).then((res1) => {
if (res1.code == 200) {
uni.hideLoading();
//
let cartItems = [];
for(let i = 0;i<that.payData.goodsList.length;i++){
let productPrice = that.payData.goodsList[i].price
for(let a = 0;a<res1.result.products.length;a++){
if(res1.result.products[a].id == that.payData.goodsList[i].productId){
let priceToUse = 0;
if (res1.result.products[a].attributeListPrice) {
try {
let pObj = typeof res1.result.products[a].attributeListPrice === 'string' ? JSON.parse(res1.result.products[a].attributeListPrice) :
res1.result.products[a].attributeListPrice;
if (Array.isArray(pObj) && pObj.length > 0) {
priceToUse = parseFloat(pObj[0].specPrice);
} else {
for (let k in pObj) {
priceToUse = parseFloat(pObj[k].specPrice);
break;
}
}
} catch (e) {}
}
productPrice = priceToUse
}
}
that.payData.goodsList[i].id = that.payData.goodsList[i].productId
let specStr = that.payData.goodsList[i].specs;
let cartId = that.payData.goodsList[i].productId + '_' + specStr;
cartItems.push({
cartId: cartId,
item: that.payData.goodsList[i],
specs: JSON.parse(that.payData.goodsList[i].specs),
quantity: that.payData.goodsList[i].quantity,
price: productPrice.toFixed(2)
});
}
uni.navigateTo({
url: '/package1/buyFood/buyFood?cart=' + encodeURIComponent(JSON.stringify(cartItems)) +
'&shopItem=' + encodeURIComponent(JSON.stringify(res1.result.shop)) + '&packageFee=' +
that.payData.packageFee
});
} else {
that.tui.toast(res.message);
return;
}
uni.hideLoading();
}).catch((res1) => {});
} else {
that.tui.toast(res.message);
return;
}
uni.hideLoading();
}).catch((res) => {});
},
refreah(item){ refreah(item){
this.getOrderDetail(item.id) this.getOrderDetail(item.id)
this.$forceUpdate(); this.$forceUpdate();

Loading…
Cancel
Save