tianyi 3 weeks ago
parent
commit
3df5fd1c2e
  1. 2
      package1/buyFood/buyFood.vue
  2. 1
      package1/order/orderDetail.vue
  3. 148
      package1/order/returnOrder.vue

2
package1/buyFood/buyFood.vue

@ -1345,6 +1345,8 @@
border: 2rpx solid #e8eeee;
margin: 0 18rpx 0 0;
background: #fff;
text-align: center;
line-height: 42rpx;
}
.buy-bottom {

1
package1/order/orderDetail.vue

@ -1108,7 +1108,6 @@
that.$forceUpdate();
} else {
that.tui.toast(res.message);
return;
}
uni.hideLoading();
}).catch((res) => {});

148
package1/order/returnOrder.vue

@ -18,7 +18,9 @@
<view style="width: 100%;line-height: 70rpx;font-size: 28rpx;font-weight: 700;">
{{orderDetail.shopName}}
</view>
<view v-for="(item1,index1) in orderDetail.goodsList" :key="index1" v-if="orderDetail.goodsList != null && orderDetail.goodsList.length > 0" style="display: flex;padding: 20rpx;background: rgba(247, 248, 248, 0.6);border-radius: 20rpx;">
<view v-for="(item1,index1) in orderDetail.goodsList" :key="index1"
v-if="orderDetail.goodsList != null && orderDetail.goodsList.length > 0"
style="display: flex;padding: 20rpx;background: rgba(247, 248, 248, 0.6);border-radius: 20rpx;">
<view class="goods-img">
<img :src="item1.productPicture" alt="">
</view>
@ -40,7 +42,7 @@
</view>
<view class="goods-content-center">
<view class="goods-deal1">
{{item1.specs}}
{{item1.specs | delNode}}
</view>
</view>
<view class="goods-content-bottom">
@ -54,7 +56,8 @@
</view>
</view>
<view>
<view style="height: 80rpx;line-height: 80rpx;display: flex;" v-if="orderDetail.packageFee != null && orderDetail.packageFee > 0">
<view style="height: 80rpx;line-height: 80rpx;display: flex;"
v-if="orderDetail.packageFee != null && orderDetail.packageFee > 0">
<view style="flex: 1;color: #777;font-weight: 700;">
打包费
</view>
@ -62,7 +65,8 @@
{{orderDetail.packageFee}}
</view>
</view>
<view style="height: 80rpx;line-height: 80rpx;display: flex;" v-if="orderDetail.deliveryType == 1">
<view style="height: 80rpx;line-height: 80rpx;display: flex;"
v-if="orderDetail.deliveryType == 1">
<view style="flex: 1;color: #777;font-weight: 700;">
配送费
</view>
@ -70,7 +74,8 @@
{{orderDetail.deliveryFee}}
</view>
</view>
<view style="height: 80rpx;line-height: 80rpx;display: flex;" v-if="orderDetail.userCouponNum > 0">
<view style="height: 80rpx;line-height: 80rpx;display: flex;"
v-if="orderDetail.userCouponNum > 0">
<view style="flex: 1;color: #777;font-weight: 700;">
优惠券
</view>
@ -79,7 +84,8 @@
</view>
</view>
</view>
<view style="display: flex;height: 80rpx;line-height: 100rpx;border-top: 1px solid #eee;font-size: 32rpx;font-weight: 700;">
<view
style="display: flex;height: 80rpx;line-height: 100rpx;border-top: 1px solid #eee;font-size: 32rpx;font-weight: 700;">
<view style="flex: 1;">
实付
</view>
@ -98,7 +104,8 @@
北校区1号宿舍楼5楼512(0702)
</view>
</view> -->
<view style="height: 80rpx;line-height: 80rpx;display: flex;" v-if="orderDetail.numberCode != null">
<view style="height: 80rpx;line-height: 80rpx;display: flex;"
v-if="orderDetail.numberCode != null">
<view style="flex: 1;color: #777;font-weight: 700;">
订单号
</view>
@ -114,18 +121,21 @@
{{orderDetail.createTime | formatTime}}
</view>
</view>
<view style="height: 80rpx;line-height: 80rpx;display: flex;" v-if="orderDetail.deliveryType == 1">
<view style="height: 80rpx;line-height: 80rpx;display: flex;"
v-if="orderDetail.deliveryType == 1">
<view style="flex: 1;color: #777;font-weight: 700;">
配送员
</view>
<view style="color: #000;font-weight: 700;" v-if="orderDetail.deliveryInfo.workerId != null && orderDetail.deliveryInfo.workerId != ''">
<view style="color: #000;font-weight: 700;"
v-if="orderDetail.deliveryInfo.workerId != null && orderDetail.deliveryInfo.workerId != ''">
{{orderDetail.deliveryInfo.workerName != null ? orderDetail.deliveryInfo.workerName : ''}}
</view>
<view style="color: #000;font-weight: 700;" v-else>
未指定等待接单中
</view>
</view>
<view style="height: 80rpx;line-height: 80rpx;display: flex;" v-if="orderDetail.deliveryType == 1 && orderDetail.deliveryInfo.workerId">
<view style="height: 80rpx;line-height: 80rpx;display: flex;"
v-if="orderDetail.deliveryType == 1 && orderDetail.deliveryInfo.workerId">
<view style="flex: 1;color: #777;font-weight: 700;">
配送员接单时间
</view>
@ -133,15 +143,18 @@
{{orderDetail.deliveryInfo.acceptTime | formatTime}}
</view>
</view>
<view style="height: 80rpx;line-height: 80rpx;display: flex;" v-if="orderDetail.deliveryType == 1">
<view style="height: 80rpx;line-height: 80rpx;display: flex;"
v-if="orderDetail.deliveryType == 1">
<view style="flex: 1;color: #777;font-weight: 700;">
商家出餐时间
</view>
<view style="color: #000;font-weight: 700;" v-if="orderDetail.deliveryInfo.workerId != null && orderDetail.deliveryInfo.workerId != ''">
<view style="color: #000;font-weight: 700;"
v-if="orderDetail.deliveryInfo.workerId != null && orderDetail.deliveryInfo.workerId != ''">
{{orderDetail.shopMakeTime ? orderDetail.shopMakeTime : '' | formatTime}}
</view>
</view>
<view style="height: 80rpx;line-height: 80rpx;display: flex;" v-if="orderDetail.deliveryType == 1 && orderDetail.deliveryInfo.workerId != ''">
<view style="height: 80rpx;line-height: 80rpx;display: flex;"
v-if="orderDetail.deliveryType == 1 && orderDetail.deliveryInfo.workerId != ''">
<view style="flex: 1;color: #777;font-weight: 700;">
配送员到店时间
</view>
@ -149,7 +162,8 @@
{{orderDetail.deliveryInfo.arriveTime ? orderDetail.deliveryInfo.arriveTime : '' | formatTime}}
</view>
</view>
<view style="height: 80rpx;line-height: 80rpx;display: flex;" v-if="orderDetail.deliveryType == 1 && orderDetail.deliveryInfo.workerId != ''">
<view style="height: 80rpx;line-height: 80rpx;display: flex;"
v-if="orderDetail.deliveryType == 1 && orderDetail.deliveryInfo.workerId != ''">
<view style="flex: 1;color: #777;font-weight: 700;">
配送员取货时间
</view>
@ -157,7 +171,8 @@
{{orderDetail.deliveryInfo.getTime ? orderDetail.deliveryInfo.getTime : '' | formatTime}}
</view>
</view>
<view style="height: 80rpx;line-height: 80rpx;display: flex;" v-if="orderDetail.deliveryType == 1 && orderDetail.deliveryInfo.workerId != ''">
<view style="height: 80rpx;line-height: 80rpx;display: flex;"
v-if="orderDetail.deliveryType == 1 && orderDetail.deliveryInfo.workerId != ''">
<view style="flex: 1;color: #777;font-weight: 700;">
配送员送达时间
</view>
@ -166,7 +181,8 @@
</view>
</view>
<view style="height: 80rpx;line-height: 80rpx;display: flex;" v-if="orderDetail.deliveryType == 1">
<view style="height: 80rpx;line-height: 80rpx;display: flex;"
v-if="orderDetail.deliveryType == 1">
<view style="flex: 1;color: #777;font-weight: 700;">
送达时间
</view>
@ -174,7 +190,8 @@
{{orderDetail.deliveryInfo.finishTime ? orderDetail.deliveryInfo.finishTime : '尽快送达' | formatTime}}
</view>
</view>
<view style="height: 160rpx;line-height: 160rpx;display: flex;" v-if="orderDetail.deliveryType == 1">
<view style="height: 160rpx;line-height: 160rpx;display: flex;"
v-if="orderDetail.deliveryType == 1">
<view style="flex: 1;color: #777;font-weight: 700;">
上传图片
</view>
@ -184,28 +201,29 @@
<uni-icons type="camera" size="28" color="#777"></uni-icons>
</view>
<view style="overflow-x: scroll;display: flex;width: 350rpx;">
<view v-if="returnData.pictures !=''" style="width: 160rpx;height: 160rpx;margin-left: 20rpx;">
<view v-if="returnData.pictures !=''"
style="width: 160rpx;height: 160rpx;margin-left: 20rpx;">
<img :src="returnData.pictures" alt="" class="upload-img">
</view>
</view>
</view>
</view>
<view style="height: 170rpx;line-height: 170rpx;display: flex;margin-top: 40rpx;" v-if="orderDetail.deliveryType == 1">
<view style="height: 170rpx;line-height: 170rpx;display: flex;margin-top: 40rpx;"
v-if="orderDetail.deliveryType == 1">
<view style="flex: 1;color: #777;font-weight: 700;">
订单备注
</view>
<view style="height: 200rpx;background: rgba(247, 248, 248, 0.6);border-radius: 40rpx;padding: 20rpx;width: 70%;">
<textarea name="" id="" cols="30" rows="10" placeholder="请填写备注" v-model="returnData.reason"
style="height: 160rpx;width: 100%;"></textarea>
<view
style="height: 200rpx;background: rgba(247, 248, 248, 0.6);border-radius: 40rpx;padding: 20rpx;width: 70%;">
<textarea name="" id="" cols="30" rows="10" placeholder="请填写备注"
v-model="returnData.reason" style="height: 160rpx;width: 100%;"></textarea>
</view>
</view>
<view class="btn"
@tap.stop="$refs.carPopup.open()">
<view class="btn" @tap.stop="$refs.carPopup.open()">
售后原因
</view>
<view class="btn"
@tap.stop="submit()">
<view class="btn" @tap.stop="submit()">
申请售后{{returnData.refundAmount}}
</view>
</view>
@ -253,7 +271,8 @@
<view class="guize-list">
<view style="height: 80rpx;line-height: 80rpx;font-size: 36rpx;font-weight: 700;text-align: center;">
确定要取消订单吗
<text v-if="payData.status == 2 || payData.status == 3 || payData.status == 4 || payData.status == 4">取消订单需要商家同意</text>
<text
v-if="payData.status == 2 || payData.status == 3 || payData.status == 4 || payData.status == 4">取消订单需要商家同意</text>
</view>
<view class="btn" @tap="returnOrder()">
确认取消
@ -326,6 +345,23 @@
// -- ::
return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
},
delNode(data) {
// 1.
let str;
if (typeof data === 'object' && data !== null) {
// JSON
str = JSON.stringify(data);
} else if (typeof data === 'string') {
str = data;
} else {
//
str = String(data);
}
// 2. { } "
const result = str.replace(/[{}"]/g, '');
return result;
}
},
onLoad(option) {
@ -433,7 +469,8 @@
if (this.orderDetail.goodsList[i].returnCount) {
this.orderDetail.goodsList[i].quantity = this.orderDetail.goodsList[i].returnCount
if (this.orderDetail.deliveryType == 1) {
this.orderDetail.goodsList[i].price = Number(this.orderDetail.goodsList[i].price) + Number(this.orderDetail.goodsList[i].packageFee)
this.orderDetail.goodsList[i].price = Number(this.orderDetail.goodsList[i].price) + Number(this
.orderDetail.goodsList[i].packageFee)
}
this.returnData.items.push(this.orderDetail.goodsList[i])
}
@ -461,7 +498,8 @@
this.$refs.imgPopup.open()
},
orderStatus(item) {
if(item.status == 0 || item.status == 10 || item.status == 2 || (item.status == 3 && item.deliveryType == 1) || (item.status == 3 && item.deliveryType == 2) || item.status == 4){
if (item.status == 0 || item.status == 10 || item.status == 2 || (item.status == 3 && item.deliveryType ==
1) || (item.status == 3 && item.deliveryType == 2) || item.status == 4) {
return true;
}
return false;
@ -476,10 +514,12 @@
this.orderDetail.goodsList[index].returnCount = 0
}
if (type == 'plus') {
if((this.orderDetail.goodsList[index].returnCount + 1) <= this.orderDetail.goodsList[index].quantity){
if ((this.orderDetail.goodsList[index].returnCount + 1) <= this.orderDetail.goodsList[index]
.quantity) {
this.orderDetail.goodsList[index].returnCount += 1
if (this.orderDetail.deliveryType == 1) {
this.returnData.refundAmount += Number(Number(this.orderDetail.goodsList[index].price + this.orderDetail.goodsList[index].packageFee).toFixed(2))
this.returnData.refundAmount += Number(Number(this.orderDetail.goodsList[index].price + this
.orderDetail.goodsList[index].packageFee).toFixed(2))
} else {
this.returnData.refundAmount += Number(this.orderDetail.goodsList[index].price)
}
@ -489,13 +529,15 @@
} else {
if (this.orderDetail.goodsList[index].returnCount > 0) {
if (this.orderDetail.deliveryType == 1) {
this.returnData.refundAmount -= Number(Number(this.orderDetail.goodsList[index].price + this.orderDetail.goodsList[index].packageFee).toFixed(2))
this.returnData.refundAmount -= Number(Number(this.orderDetail.goodsList[index].price + this
.orderDetail.goodsList[index].packageFee).toFixed(2))
} else {
this.returnData.refundAmount -= Number(this.orderDetail.goodsList[index].price)
}
this.returnData.refundAmount = Number(this.returnData.refundAmount.toFixed(2))
}
this.orderDetail.goodsList[index].returnCount = this.orderDetail.goodsList[index].returnCount > 0 ?this.orderDetail.goodsList[index].returnCount -= 1:0
this.orderDetail.goodsList[index].returnCount = this.orderDetail.goodsList[index].returnCount > 0 ?
this.orderDetail.goodsList[index].returnCount -= 1 : 0
}
this.$forceUpdate()
@ -504,7 +546,10 @@
this.$refs.returnPopup.close();
let item = this.payData
let that = this
that.tui.request("/mall/order/cancel", "POST", {orderId:item.id,userId:uni.getStorageSync('id')}, false, true).then((res) => {
that.tui.request("/mall/order/cancel", "POST", {
orderId: item.id,
userId: uni.getStorageSync('id')
}, false, true).then((res) => {
if (res.code == 200) {
that.tui.toast("取消订单成功");
that.getOrderDetail(item.id)
@ -587,6 +632,7 @@
bottom: 0;
left: 0;
}
.title-name {
padding-top: 110rpx;
font-size: 36rpx;
@ -594,6 +640,7 @@
flex: 1;
text-align: center;
}
.box1 {
width: 95%;
margin: 0 auto 20rpx;
@ -601,6 +648,7 @@
border-radius: 20rpx;
padding: 20rpx;
}
.goods-img {
width: 160rpx;
height: 160rpx;
@ -612,6 +660,7 @@
height: 100%;
}
}
.goods-content {
flex: 1;
padding-left: 20rpx;
@ -627,45 +676,55 @@
margin: 16rpx 0;
color: #777;
}
.goods-deal1 {
width: 60%;
width: 100%;
}
.goods-content-bottom {
display: flex;
line-height: 56rpx;
color: #777;
}
.pintuan-left-price {
width: 50%;
text-align: right;
font-weight: 700;
color: #000;
}
.status-img {
width: 84rpx;
height: 84rpx;
img {
width: 84rpx;
height: 84rpx;
background-size: 100%;
}
}
.status-text {
flex: 1;
position: relative;
padding-left: 20rpx;
}
.status-zhu {
font-size: 32rpx;
font-weight: 700;
}
.status-fu {
height: 50rpx;
line-height: 50rpx;
}
.status-address {
font-weight: 700;
}
.status-btn {
position: absolute;
top: 20rpx;
@ -680,9 +739,11 @@
border: 1px solid #777;
font-size: 20rpx;
}
.btn-box {
height: 120rpx;
}
.btn {
width: 90%;
height: 100rpx;
@ -694,6 +755,7 @@
margin: 0 auto;
font-weight: 700;
}
.img-popup-content {
width: 600rpx;
height: 800rpx;
@ -727,7 +789,9 @@
background: #fff;
border-radius: 20rpx;
padding: 20rpx;
position: absolute;top: 450rpx;left: 2.5%;
position: absolute;
top: 450rpx;
left: 2.5%;
}
.goods-img1 {
@ -802,6 +866,7 @@
line-height: 80rpx;
margin: 0 auto;
}
.kaituan11 {
display: flex;
height: 70rpx;
@ -809,10 +874,12 @@
font-weight: 700;
margin-top: 20rpx;
}
.kaituan1-title1 {
position: relative;
margin-left: 20rpx;
}
.kaituan1-title11 {
font-size: 24rpx;
background: rgba(224, 255, 222, 0.65);
@ -824,6 +891,7 @@
text-align: center;
margin: 10rpx 0 0 20rpx;
}
.num-plus {
width: 56rpx;
height: 56rpx;
@ -852,20 +920,24 @@
flex: 1;
margin-left: 40rpx;
}
.kaituan21 {
display: flex;
width: 90%;
margin: 40rpx auto;
}
.kaituan221 {
flex: 1;
}
.kaituan31 {
height: 80rpx;
line-height: 80rpx;
text-align: center;
color: #777;
}
.kaituan41 {
width: 95%;
height: 100rpx;
@ -877,13 +949,16 @@
font-weight: 700;
margin: 20rpx auto;
}
.kaituan51 {
margin: 80rpx 0 40rpx;
}
.pintuan2 {
flex: 1;
background: linear-gradient(90deg, rgba(227, 255, 150, 1), rgba(166, 255, 234, 1));
}
.car-content {
position: relative;
height: auto;
@ -910,6 +985,7 @@
font-size: 28rpx;
font-weight: 700;
}
.btn {
width: 95%;
height: 100rpx;

Loading…
Cancel
Save