|
|
@ -22,7 +22,7 @@ |
|
|
<view class="goods-content"> |
|
|
<view class="goods-content"> |
|
|
<view class="goods-name"> |
|
|
<view class="goods-name"> |
|
|
{{item1.productName}} |
|
|
{{item1.productName}} |
|
|
<view class="goods-num"> |
|
|
<view class="goods-num" v-if="sellTime == 0"> |
|
|
<view class="num-plus" style="background: #999;color: #fff;" |
|
|
<view class="num-plus" style="background: #999;color: #fff;" |
|
|
@tap="changeValue('minus',index1)"> |
|
|
@tap="changeValue('minus',index1)"> |
|
|
- |
|
|
- |
|
|
@ -171,9 +171,33 @@ |
|
|
{{orderDetail.deliveryInfo.finishTime ? orderDetail.deliveryInfo.finishTime : '尽快送达' | formatTime}} |
|
|
{{orderDetail.deliveryInfo.finishTime ? orderDetail.deliveryInfo.finishTime : '尽快送达' | formatTime}} |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
<uni-forms-item label="上传图片" name="pictures"> |
|
|
|
|
|
<view class="upload-img" @tap="pictureAdd" |
|
|
|
|
|
style="background: #eee;text-align: center;line-height: 160rpx;"> |
|
|
|
|
|
<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;"> |
|
|
|
|
|
<img :src="returnData.pictures" alt="" class="upload-img"> |
|
|
|
|
|
</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
</uni-forms-item> |
|
|
|
|
|
<view class="content-box" style="line-height: 200rpx;"> |
|
|
|
|
|
<view class="content-title"> |
|
|
|
|
|
订单备注<text>*</text> |
|
|
|
|
|
</view> |
|
|
|
|
|
<view style="height: 200rpx;background: #eee;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> |
|
|
<view class="btn" |
|
|
<view class="btn" |
|
|
@tap.stop=""> |
|
|
@tap.stop="submit()"> |
|
|
申请售后¥{{allReturnPrice}} |
|
|
申请售后¥{{returnData.refundAmount}} |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
@ -181,9 +205,9 @@ |
|
|
|
|
|
|
|
|
</view> |
|
|
</view> |
|
|
<!-- 退款原因弹窗 --> |
|
|
<!-- 退款原因弹窗 --> |
|
|
<uni-popup ref="carPopup" background-color="#fff"> |
|
|
<uni-popup ref="carPopup" background-color="#fff" :mask-click="false"> |
|
|
<view class="car-content"> |
|
|
<view class="car-content"> |
|
|
<view class="car-close" @tap="$refs.carPopup.close()"> |
|
|
<view class="car-close"> |
|
|
<uni-icons type="close" size="30" color="#fff"></uni-icons> |
|
|
<uni-icons type="close" size="30" color="#fff"></uni-icons> |
|
|
</view> |
|
|
</view> |
|
|
<view class="car-title"> |
|
|
<view class="car-title"> |
|
|
@ -206,8 +230,12 @@ |
|
|
全额退款(配送员原因) |
|
|
全额退款(配送员原因) |
|
|
<radio :checked="sellTime==3" name="sellTime" @click="checkSellTime(3)" /> |
|
|
<radio :checked="sellTime==3" name="sellTime" @click="checkSellTime(3)" /> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
<view class=""> |
|
|
|
|
|
全额退款(商家+配送员原因) |
|
|
|
|
|
<radio :checked="sellTime==4" name="sellTime" @click="checkSellTime(4)" /> |
|
|
|
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="btn">确认</view> |
|
|
<view class="btn" @tap="chooseReturnType()">确认</view> |
|
|
</view> |
|
|
</view> |
|
|
</uni-popup> |
|
|
</uni-popup> |
|
|
|
|
|
|
|
|
@ -233,8 +261,10 @@ |
|
|
pintuan:false, |
|
|
pintuan:false, |
|
|
menuButtonInfo: {}, |
|
|
menuButtonInfo: {}, |
|
|
orderId:'', |
|
|
orderId:'', |
|
|
allReturnPrice:0, |
|
|
|
|
|
vModelValue:0, |
|
|
vModelValue:0, |
|
|
|
|
|
returnData:{ |
|
|
|
|
|
refundAmount:0 |
|
|
|
|
|
}, |
|
|
payData:{}, |
|
|
payData:{}, |
|
|
orderDetail:{}, |
|
|
orderDetail:{}, |
|
|
codeImg:'https://jewel-shop.oss-cn-beijing.aliyuncs.com/3a4e68eb14d7417cbb4f15fa85907c64.jpg' |
|
|
codeImg:'https://jewel-shop.oss-cn-beijing.aliyuncs.com/3a4e68eb14d7417cbb4f15fa85907c64.jpg' |
|
|
@ -298,9 +328,120 @@ |
|
|
this.$refs.carPopup.open('bottom'); |
|
|
this.$refs.carPopup.open('bottom'); |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
chooseReturnType(){ |
|
|
|
|
|
this.$refs.carPopup.close() |
|
|
|
|
|
if(this.sellTime == 0){ |
|
|
|
|
|
this.returnData.refundAmount = 0 |
|
|
|
|
|
this.returnData.refundType = 1 |
|
|
|
|
|
}else if(this.sellTime == 1){ |
|
|
|
|
|
this.returnData.refundAmount = this.orderDetail.deliveryFee |
|
|
|
|
|
this.returnData.refundType = 2 |
|
|
|
|
|
}else if(this.sellTime == 2){ |
|
|
|
|
|
this.returnData.refundAmount = this.orderDetail.totalAmount |
|
|
|
|
|
this.returnData.refundType = 3 |
|
|
|
|
|
this.returnData.refundTypeStatus = 1 |
|
|
|
|
|
}else if(this.sellTime == 3){ |
|
|
|
|
|
this.returnData.refundAmount = this.orderDetail.totalAmount |
|
|
|
|
|
this.returnData.refundType = 3 |
|
|
|
|
|
this.returnData.refundTypeStatus = 2 |
|
|
|
|
|
}else{ |
|
|
|
|
|
this.returnData.refundAmount = this.orderDetail.totalAmount |
|
|
|
|
|
this.returnData.refundType = 3 |
|
|
|
|
|
this.returnData.refundTypeStatus = 3 |
|
|
|
|
|
} |
|
|
|
|
|
this.changeProduct() |
|
|
|
|
|
}, |
|
|
|
|
|
changeProduct(){ |
|
|
|
|
|
for(let i = 0; i< this.orderDetail.goodsList.length;i++){ |
|
|
|
|
|
if(this.orderDetail.goodsList[i].returnCount){ |
|
|
|
|
|
this.orderDetail.goodsList[i].returnCount = 0 |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
pictureAdd(id, huan) { |
|
|
|
|
|
let that = this |
|
|
|
|
|
uni.chooseMedia({ |
|
|
|
|
|
count: 9, |
|
|
|
|
|
mediaType: ['image'], |
|
|
|
|
|
sourceType: ['album', 'camera'], |
|
|
|
|
|
success(res) { |
|
|
|
|
|
uni.showLoading({ |
|
|
|
|
|
title: '加载中...', |
|
|
|
|
|
mask: true |
|
|
|
|
|
}) |
|
|
|
|
|
for (let i = 0; i < res.tempFiles.length; i++) { |
|
|
|
|
|
that.upLoadFile(res.tempFiles[i].tempFilePath) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
async upLoadFile(path) { |
|
|
|
|
|
let that = this; |
|
|
|
|
|
let hiver_token = uni.getStorageSync("hiver_token") |
|
|
|
|
|
await uni.uploadFile({ |
|
|
|
|
|
url: that.tui.interfaceUrl() + '/upload/file', |
|
|
|
|
|
filePath: path, |
|
|
|
|
|
name: 'file', |
|
|
|
|
|
header: { |
|
|
|
|
|
"content-type": "multipart/form-data", |
|
|
|
|
|
'accessToken': hiver_token |
|
|
|
|
|
}, |
|
|
|
|
|
formData: {}, |
|
|
|
|
|
success: (uploadFileRes) => { |
|
|
|
|
|
let pathData = JSON.parse(uploadFileRes.data) |
|
|
|
|
|
that.returnData.pictures = pathData.result |
|
|
|
|
|
that.$forceUpdate() |
|
|
|
|
|
}, |
|
|
|
|
|
fail: (err) => { |
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: JSON.stringify(err), |
|
|
|
|
|
icon: 'none' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
await setTimeout(res => { |
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
}, 1000) |
|
|
|
|
|
}, |
|
|
checkSellTime(type){ |
|
|
checkSellTime(type){ |
|
|
this.sellTime = type; |
|
|
this.sellTime = type; |
|
|
}, |
|
|
}, |
|
|
|
|
|
submit(){ |
|
|
|
|
|
this.returnData.orderId = this.orderDetail.id |
|
|
|
|
|
this.returnData.userId = this.orderDetail.userId |
|
|
|
|
|
this.returnData.shopId = this.orderDetail.shopId |
|
|
|
|
|
if(this.orderDetail.deliveryInfo){ |
|
|
|
|
|
this.returnData.workerId = this.orderDetail.deliveryInfo.workerId |
|
|
|
|
|
} |
|
|
|
|
|
this.returnData.items = []; |
|
|
|
|
|
for(let i = 0; i< this.orderDetail.goodsList.length;i++){ |
|
|
|
|
|
if(this.orderDetail.goodsList[i].returnCount){ |
|
|
|
|
|
this.orderDetail.goodsList[i].quantity = this.orderDetail.goodsList[i].returnCount |
|
|
|
|
|
console.log(this.orderDetail.goodsList[i]) |
|
|
|
|
|
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]) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
uni.showLoading({ |
|
|
|
|
|
title: '提交售后中...' |
|
|
|
|
|
}); |
|
|
|
|
|
this.tui.request("/mall/refund/create", "POST", this.returnData, false, false).then(res => { |
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
if (res.code == 200) { |
|
|
|
|
|
uni.redirectTo({ |
|
|
|
|
|
url: '/package1/order/orderDetail?id=' + this.orderDetail.id |
|
|
|
|
|
}); |
|
|
|
|
|
} else { |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: res.message || '提交失败', |
|
|
|
|
|
icon: 'none' |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
openCode(){ |
|
|
openCode(){ |
|
|
this.$refs.imgPopup.open() |
|
|
this.$refs.imgPopup.open() |
|
|
}, |
|
|
}, |
|
|
@ -322,11 +463,13 @@ |
|
|
if(type == 'plus'){ |
|
|
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 |
|
|
this.orderDetail.goodsList[index].returnCount += 1 |
|
|
this.allReturnPrice += 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)) |
|
|
|
|
|
this.returnData.refundAmount = Number(this.returnData.refundAmount.toFixed(2)) |
|
|
} |
|
|
} |
|
|
}else{ |
|
|
}else{ |
|
|
if(this.orderDetail.goodsList[index].returnCount > 0){ |
|
|
if(this.orderDetail.goodsList[index].returnCount > 0){ |
|
|
this.allReturnPrice -= 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)) |
|
|
|
|
|
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 |
|
|
} |
|
|
} |
|
|
|