wangfukang 1 week ago
parent
commit
ee60e25ef9
  1. 719
      package1/order/returnOrder.vue

719
package1/order/returnOrder.vue

@ -0,0 +1,719 @@
<template>
<!-- 订单详情 -->
<view class="page1">
<view class="">
<view class="title">
<view class="title-sreach">
<view class="back-btn" @tap="back" :style="{'top': menuButtonInfo.top +'px'}">
<uni-icons type="left" size="28"></uni-icons>
</view>
</view>
</view>
<view class="content">
<view class="box1">
<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: #eee;border-radius: 20rpx;">
<view class="goods-img">
<img :src="item1.productPicture" alt="">
</view>
<view class="goods-content">
<view class="goods-name">
{{item1.productName}}
<view class="goods-num">
<view class="num-plus" style="background: #999;color: #fff;"
@tap="changeValue('minus',index1)">
-
</view>
<view class="num">
{{item1.returnCount ? item1.returnCount : 0}}
</view>
<view class="num-plus" @tap="changeValue('plus',index1)">
+
</view>
</view>
</view>
<view class="goods-content-center">
<view class="goods-deal1">
{{item1.specs}}
</view>
</view>
<view class="goods-content-bottom">
<view style="width: 50%;">
X{{item1.quantity}}
</view>
<view class="pintuan-left-price">
{{item1.price}}
</view>
</view>
</view>
</view>
<view>
<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>
<view style="color: #000;font-weight:700;">
{{orderDetail.packageFee}}
</view>
</view>
<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;">
{{orderDetail.deliveryFee}}
</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;">
-1 <uni-icons type="right" size="12"></uni-icons>
</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="flex: 1;">
实付
</view>
<view class="">
{{orderDetail.totalAmount}}
</view>
</view>
</view>
<view class="box1">
<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;">
北校区1号宿舍楼5楼512(0702)
</view>
</view> -->
<view style="height: 80rpx;line-height: 80rpx;display: flex;" v-if="orderDetail.numberCode != null">
<view style="flex: 1;color: #777;font-weight: 700;">
订单号
</view>
<view style="color: #000;font-weight: 700;">
{{orderDetail.numberCode}}
</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;">
{{orderDetail.createTime | formatTime}}
</view>
</view>
<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 != ''">
{{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="flex: 1;color: #777;font-weight: 700;">
配送员接单时间
</view>
<view style="color: #000;font-weight: 700;">
{{orderDetail.deliveryInfo.acceptTime | formatTime}}
</view>
</view>
<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 != ''">
{{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="flex: 1;color: #777;font-weight: 700;">
配送员到店时间
</view>
<view style="color: #000;font-weight: 700;">
{{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="flex: 1;color: #777;font-weight: 700;">
配送员取货时间
</view>
<view style="color: #000;font-weight: 700;">
{{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="flex: 1;color: #777;font-weight: 700;">
配送员送达时间
</view>
<view style="color: #000;font-weight: 700;">
{{orderDetail.deliveryInfo.finishTime ? orderDetail.deliveryInfo.finishTime : '' | formatTime}}
</view>
</view>
<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;">
{{orderDetail.deliveryInfo.finishTime ? orderDetail.deliveryInfo.finishTime : '尽快送达' | formatTime}}
</view>
</view>
<view class="pintuan2"
style="width: 100%; border-radius: 100rpx;"
@tap.stop="">
申请售后{{allReturnPrice}}
</view>
</view>
</view>
</view>
</view>
<!-- 退款原因弹窗 -->
<uni-popup ref="carPopup" background-color="#fff">
<view class="car-content">
<view class="car-close" @tap="$refs.carPopup.close()">
<uni-icons type="close" size="30" color="#fff"></uni-icons>
</view>
<view class="car-title">
选择退款原因
</view>
</view>
</uni-popup>
<uni-popup ref="returnPopup" 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;">
确定要取消订单吗
<text v-if="payData.status == 2 || payData.status == 3 || payData.status == 4 || payData.status == 4">取消订单需要商家同意</text>
</view>
<view class="btn" @tap="returnOrder()">
确认取消
</view>
</view>
</uni-popup>
</view>
</template>
<script>
export default {
data() {
return {
pintuan:false,
menuButtonInfo: {},
orderId:'',
allReturnPrice:0,
vModelValue:0,
payData:{},
orderDetail:{},
codeImg:'https://jewel-shop.oss-cn-beijing.aliyuncs.com/3a4e68eb14d7417cbb4f15fa85907c64.jpg'
}
},
components: {
},
filters: {
formatHourMinute(value) {
if (!value) return '';
const date = new Date(value);
// (getDate)0
const day = String(date.getDate()).padStart(2, '0');
// (getHours)0
const hour = String(date.getHours()).padStart(2, '0');
// (getMinutes)0
const minute = String(date.getMinutes()).padStart(2, '0');
// --:
return `${day}-${hour}:${minute}`;
},
formatTime(value) {
if (!value) return '';
const date = new Date(value);
//
const year = date.getFullYear();
// (getMonth 0-11 +1)0
const month = String(date.getMonth() + 1).padStart(2, '0');
// (getDate)0
const day = String(date.getDate()).padStart(2, '0');
// (getHours)0
const hour = String(date.getHours()).padStart(2, '0');
// (getMinutes)0
const minute = String(date.getMinutes()).padStart(2, '0');
// (getSeconds)0
const second = String(date.getSeconds()).padStart(2, '0');
// -- ::
return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
}
},
onLoad(option) {
if (option.order) {
this.orderDetail = JSON.parse(decodeURIComponent(option.order));
}
},
onShow() {
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect()
this.$refs.carPopup.open();
},
methods: {
openCode(){
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){
return true;
}
return false;
},
returnPopupProp(item){
this.payData = item;
this.$refs.returnPopup.open('bottom');
},
changeValue(type,index) {
console.log(this.orderDetail.goodsList[index])
if(!this.orderDetail.goodsList[index].returnCount){
this.orderDetail.goodsList[index].returnCount = 0
}
if(type == 'plus'){
if((this.orderDetail.goodsList[index].returnCount + 1) <= this.orderDetail.goodsList[index].quantity){
this.orderDetail.goodsList[index].returnCount += 1
this.allReturnPrice += Number(Number(this.orderDetail.goodsList[index].price + this.orderDetail.goodsList[index].packageFee).toFixed(2))
}
}else{
if(this.orderDetail.goodsList[index].returnCount > 0){
this.allReturnPrice -= Number(Number(this.orderDetail.goodsList[index].price + this.orderDetail.goodsList[index].packageFee).toFixed(2))
}
this.orderDetail.goodsList[index].returnCount = this.orderDetail.goodsList[index].returnCount > 0 ?this.orderDetail.goodsList[index].returnCount -= 1:0
}
this.$forceUpdate()
},
returnOrder(){
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) => {
if (res.code == 200) {
that.tui.toast("取消订单成功");
that.getOrderDetail(item.id)
that.$forceUpdate();
} else {
that.tui.toast(res.message);
return;
}
uni.hideLoading();
}).catch((res) => {});
},
refreah(item){
this.getOrderDetail(item.id)
this.$forceUpdate();
},
getOrderDetail(id){
let that = this
that.tui.request("/mall/order/detail/"+id, "GET", {}, false, true).then((res) => {
if (res.code == 200) {
that.orderDetail = res.result;
if(that.orderDetail.groupInfo){
// 0: 1: 2: 3:()
if(that.orderDetail.groupInfo.status != 1 && that.orderDetail.groupInfo.status != 2){
that.pintuan = true;
}
}
that.$forceUpdate();
} else {
that.tui.toast(res.message)
return
}
}).catch((res) => {})
},
back() {
uni.navigateBack()
}
}
}
</script>
<style lang="scss">
page {
width: 100%;
height: 100%;
font-size: 24rpx;
background: #F5F8F5;
color: #00231C;
}
.page1 {
width: 100%;
height: 100%;
font-size: 24rpx;
position: relative;
}
.title{
background: url('https://jewel-shop.oss-cn-beijing.aliyuncs.com/8bc15960c2dc40268e295d6dd23aecce.png') no-repeat;
width: 100%;
height: 54%;
}
.content{
position: absolute;
top: 200rpx;
width: 95%;
margin-left: 2.5%;
}
.title-sreach{
width: 100%;
display: flex;
height: 200rpx;
position: relative;
}
.back-btn{
position: absolute;
bottom: 0;
left: 0;
}
.box1{
width: 95%;
margin: 0 auto 20rpx;
background: #fff;
border-radius: 20rpx;
padding: 20rpx;
}
.goods-img {
width: 160rpx;
height: 160rpx;
position: relative;
img {
width: 100%;
background-size: 100%;
height: 100%;
}
}
.goods-content {
flex: 1;
padding-left: 20rpx;
}
.goods-name {
font-size: 32rpx;
font-weight: 900;
}
.goods-content-center {
display: flex;
margin: 16rpx 0;
color: #777;
}
.goods-deal1 {
width: 60%;
}
.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;
right: 0;
background: #eee;
width: 130rpx;
height: 50rpx;
text-align: center;
line-height: 50rpx;
border-radius: 16rpx;
color: #777;
border: 1px solid #777;
font-size: 20rpx;
}
.btn-box{
height: 120rpx;
}
.btn{
width: 90%;
height: 100rpx;
line-height: 100rpx;
background: linear-gradient(90deg, rgba(227, 255, 150, 1), rgba(166, 255, 234, 1));
font-size: 32rpx;
border-radius: 120rpx;
text-align: center;
margin: 0 auto;
font-weight: 700;
}
.img-popup-content {
width: 600rpx;
height: 800rpx;
background: url('https://jewel-shop.oss-cn-beijing.aliyuncs.com/73e684e3319c468d9252461ba3c9e95b.png') no-repeat;
background-size: 100%;
}
.title1 {
background: url('https://jewel-shop.oss-cn-beijing.aliyuncs.com/69c894452e924bedbb5a24bf978f47c7.png') no-repeat;
width: 100%;
height: 30%;
background-size: 100%;
}
.title-sreach1 {
width: 100%;
display: flex;
height: 200rpx;
position: relative;
}
.back-btn1 {
position: absolute;
bottom: 0;
left: 0;
}
.box11 {
width: 95%;
margin: 0 auto 20rpx;
background: #fff;
border-radius: 20rpx;
padding: 20rpx;
position: absolute;top: 450rpx;left: 2.5%;
}
.goods-img1 {
width: 160rpx;
height: 160rpx;
position: relative;
img {
width: 100%;
background-size: 100%;
height: 100%;
}
}
.goods-content1 {
flex: 1;
padding-left: 20rpx;
}
.goods-name1 {
font-size: 32rpx;
font-weight: 900;
}
.goods-content-center1 {
display: flex;
margin: 16rpx 0;
color: #777;
}
.pintuan-left-price1 {
width: 55%;
text-align: right;
font-weight: 700;
color: #000;
display: flex;
}
.goods-content-bottom {
display: flex;
line-height: 56rpx;
color: #777;
}
.ziqu-xuanfu1 {
position: absolute;
top: 0;
right: 0;
background: linear-gradient(90deg, rgba(227, 255, 150, 1), rgba(166, 255, 234, 1));
border-top-right-radius: 20rpx;
border-bottom-left-radius: 20rpx;
font-weight: 700;
font-size: 20rpx;
height: 56rpx;
width: 120rpx;
text-align: center;
line-height: 56rpx;
}
.weipincheng1 {
width: 90rpx;
height: 90rpx;
background: #a6ffea;
border-radius: 90rpx;
text-align: center;
font-size: 60rpx;
font-weight: 700;
margin-left: -6rpx;
z-index: 97;
color: #02fbdd;
border: 1px solid #a6ffea;
line-height: 80rpx;
margin: 0 auto;
}
.kaituan11{
display: flex;
height: 70rpx;
font-size: 44rpx;
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);
border: 1px solid rgba(166, 255, 234, 1);
border-radius: 20rpx;
height: 44rpx;
line-height: 38rpx;
width: 280rpx;
text-align: center;
margin: 10rpx 0 0 20rpx;
}
.num-plus {
width: 56rpx;
height: 56rpx;
font-size: 36rpx;
text-align: center;
font-weight: 700;
line-height: 48rpx;
border-radius: 10rpx;
background: rgba(0, 35, 28, 1);
color: rgba(166, 255, 234, 1);
}
.num {
width: 80rpx;
height: 56rpx;
text-align: center;
line-height: 56rpx;
font-size: 28rpx;
}
.goods-num {
display: flex;
height: 56rpx;
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;
background: linear-gradient(90deg, rgba(227, 255, 150, 1), rgba(166, 255, 234, 1));
border-radius: 100rpx;
text-align: center;
line-height: 100rpx;
font-size: 30rpx;
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;
max-height: 1200rpx;
width: 100%;
border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx;
padding: 20rpx;
overflow: scroll;
}
.car-close {
width: 60rpx;
height: 60rpx;
position: absolute;
top: -80rpx;
right: 20rpx;
}
.car-title {
height: 96rpx;
line-height: 60rpx;
margin: 0 auto;
font-size: 28rpx;
font-weight: 700;
}
</style>
Loading…
Cancel
Save