501 lines
14 KiB
Vue
Raw Normal View History

2024-02-19 10:44:33 +08:00
<template>
<view class="orderGoods" :style="viewColor">
<view class='goodWrapper' :class="'item'+orderData.order_type">
<view v-if="orderData.order_type == 1" class="title acea-row row-between-wrapper">
<view class="item-status" :class="'status'+evaluate">{{evaluate == 0 ? '待核销' : '已核销'}}</view>
<view v-if="evaluate != 0 && orderData.verify_time" class="item-date">{{orderData.verify_time}}</view>
</view>
<view v-for="(item,index) in cartInfo" :key="index">
<view v-if="activityType === 2">
<view class='item presell_item'>
<view class="acea-row row-between-wrapper">
<view class='pictrue' @click="jumpCon(item)">
2024-03-20 11:55:11 +08:00
<image
:src='(item.cart_info.productAttr && item.cart_info.productAttr.image) || item.cart_info.product.image'>
</image>
2024-02-19 10:44:33 +08:00
</view>
<view class='text'>
<view class='acea-row row-between-wrapper'>
2024-03-20 11:55:11 +08:00
<view class='name line1' style="width: 360rpx;"><text
class="event_name event_bg">预售</text>{{item.cart_info.product.store_name}}
</view>
<view class='num'><text
class="p-color">{{item.cart_info.productPresellAttr.presell_price}}</text><br />x
{{item.product_num}}
</view>
2024-02-19 10:44:33 +08:00
</view>
2024-03-20 11:55:11 +08:00
<view class='attr line1' v-if="item.cart_info.productAttr.sku" style="margin-top: 0;">
{{item.cart_info.productAttr.sku}}
</view>
<view v-if="evaluate === 0 || evaluate === 10 || evaluate === 11"
class="event_ship event_color">发货时间
2024-02-19 10:44:33 +08:00
<!--全款预售-->
2024-03-20 11:55:11 +08:00
<text
v-if="item.cart_info.productPresell.presell_type === 1">{{ item.cart_info.productPresell.delivery_type === 1 ? '支付成功后' : '预售结束后' }}{{ item.cart_info.productPresell.delivery_day }}天内</text>
2024-02-19 10:44:33 +08:00
<!--定金预售-->
2024-03-20 11:55:11 +08:00
<text
v-if="item.cart_info.productPresell.presell_type === 2">{{ item.cart_info.productPresell.delivery_type === 1 ? '支付尾款后' : '预售结束后' }}{{ item.cart_info.productPresell.delivery_day }}天内</text>
</view>
2024-02-19 10:44:33 +08:00
<view class="right-btn-box event_box">
2024-03-20 11:55:11 +08:00
<view class="btn-item"
2024-03-28 16:44:33 +08:00
v-if="evaluate != 2 && item.is_refund ==0 && pay_type!= 10 && status==0 && (evaluate != 10 && evaluate != 11) && orderData.refund_status || item.refund_num > 0"
2024-04-27 11:47:31 +08:00
@click.stop="showTips=true,refundItem=item">申请退款</view>
2024-03-20 11:55:11 +08:00
<view class="btn-item err" v-if="item.is_refund ==1">退款中 x
{{item.product_num - item.refund_num}}
</view>
<view class='btn-item err' v-if="item.is_refund >1">已退款 x
{{item.product_num - item.refund_num}}
</view>
<view class='btn-item' v-if='item.is_reply==0 && evaluate==2 && item.is_refund==0'
@click.stop="evaluateTap(item.order_product_id,orderId)">去评价</view>
2024-02-19 10:44:33 +08:00
<view class='btn-item on' v-else-if="item.is_reply==1 && evaluate==2">已评价</view>
</view>
</view>
</view>
</view>
<view v-if="orderData.status >= 10" class="event_progress">
2024-03-20 11:55:11 +08:00
<view class="progress_list">
2024-02-19 10:44:33 +08:00
<view class="progress_name">阶段一 买家已付款</view>
2024-03-20 11:55:11 +08:00
<view class="progress_price">商品定金 <text
class="align_right">{{ orderData.pay_price }}</text></view>
<view class="progress_pay">定金实付款<text
class="align_right t-color">{{ orderData.pay_price }}</text></view>
2024-02-19 10:44:33 +08:00
</view>
<view class="progress_list">
2024-03-20 11:55:11 +08:00
<view class="progress_name">阶段二
<text
v-if="orderData.status == 10 && orderData.presellOrder.activeStatus == 0">未开始</text>
<text
v-if="orderData.status == 10 && orderData.presellOrder.activeStatus == 1">等待买家付尾款</text>
<text
v-if="orderData.status == 11 || orderData.presellOrder.activeStatus == 2">交易已关闭</text>
2024-02-19 10:44:33 +08:00
</view>
2024-03-20 11:55:11 +08:00
<view class="progress_price">商品尾款 <text
class="align_right">{{ orderData.presellOrder.pay_price }}</text></view>
<view class="progress_pay">尾款需付款<text
class="align_right t-color">{{ orderData.presellOrder.pay_price }}</text></view>
2024-02-19 10:44:33 +08:00
</view>
</view>
</view>
<view v-else class='item'>
<view class="acea-row row-between-wrapper">
<view class='pictrue' @click="jumpCon(item)">
2024-03-20 11:55:11 +08:00
<image
:src='(item.cart_info.productAttr && item.cart_info.productAttr.image) || item.cart_info.product.image'>
</image>
2024-02-19 10:44:33 +08:00
</view>
<view class='text'>
2024-03-20 11:55:11 +08:00
<view class='acea-row row-between-wrapper'>
<view class='name line1'><text v-if="item.product_type != 0 && item.product_type != 10"
:class="'font_bg-red type'+item.product_type">{{item.product_type == 1 ? "秒杀" : item.product_type == 2 ? "预售" : item.product_type == 3 ? "助力" : item.product_type == 4 ? "拼团" : ""}}</text>{{item.cart_info.product.store_name}}
2024-02-19 10:44:33 +08:00
</view>
2024-03-20 11:55:11 +08:00
<view class='num'>x {{item.product_num}}</view>
</view>
<view class='attr line1' v-if="item.cart_info.productAttr.sku">
{{item.cart_info.productAttr.sku}}
</view>
<view class='money p-color' v-if="item.cart_info.product_type ==3">
{{item.cart_info.productAssistAttr.assist_price}}</view>
<view class='money p-color' v-else-if="item.cart_info.product_type ==4">
{{item.cart_info.activeSku.active_price}}</view>
<view class='money acea-row row-middle' v-else>
<text>{{item.cart_info.productAttr.price}}</text>
<image v-if="item.cart_info.productAttr.show_svip_price" class="svip-img"
:src="`${domain}/static/images/svip.png`"></image>
</view>
2024-02-19 10:44:33 +08:00
</view>
</view>
<view class="right-btn-box">
2024-03-20 11:55:11 +08:00
<view class="btn-item err" v-if="item.is_refund ==1">退款中 x
{{item.product_num - item.refund_num}}
</view>
<view class='btn-item err' v-if="item.is_refund >1">已退款 x {{item.product_num - item.refund_num}}
</view>
<view class="btn-item"
2024-03-28 16:44:33 +08:00
v-if="evaluate != 2 && item.refund_switch==1 && pay_type!= 10 && status==0 && (item.is_refund == 0 && evaluate != 9 && orderData.refund_status || item.refund_num > 0)"
2024-04-27 11:47:31 +08:00
@click.stop="showTips=true,refundItem=item">申请退款</view>
2024-03-20 11:55:11 +08:00
<view class='btn-item' v-if='item.is_reply==0 && evaluate==2 && item.refund_num > 0'
@click.stop="evaluateTap(item.order_product_id,orderId)">去评价</view>
2024-02-19 10:44:33 +08:00
<view class='btn-item on' v-else-if="item.is_reply==1 && evaluate==2">已评价</view>
</view>
2024-03-20 11:55:11 +08:00
</view>
2024-02-19 10:44:33 +08:00
</view>
</view>
2024-04-27 11:47:31 +08:00
<u-overlay :show="showTips">
<view class="tips">
<view class="" style="font-size: 32rpx;">
温馨提示
</view>
<view class="">
下单后1小时内申请退款可极速退款
</view>
<u-button color="#61D137" text="我知道了" @tap="refund(refundItem)"></u-button>
</view>
</u-overlay>
2024-02-19 10:44:33 +08:00
</view>
</template>
<script>
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
2024-03-20 11:55:11 +08:00
import {
openOrderRefundSubscribe
} from '@/utils/SubscribeMessage.js';
import {
goShopDetail
} from '@/libs/order.js'
import {
initiateAssistApi
} from '@/api/activity.js';
import {
mapGetters
} from "vuex";
import {
HTTP_REQUEST_URL
} from '@/config/app';
2024-02-19 10:44:33 +08:00
export default {
props: {
evaluate: {
type: Number,
default: 0,
},
activityType: {
type: Number,
default: 0,
},
cartInfo: {
type: Array,
default: function() {
return [];
}
},
orderId: {
type: String,
default: '',
},
2024-04-27 11:47:31 +08:00
pay_type: {
type: [Number, String],
default: 0,
},
status: {
type: [Number, String],
default: 0,
},
2024-02-19 10:44:33 +08:00
jump: {
type: Boolean,
default: false,
},
orderData: {
type: Object,
default: function() {
return {};
}
2024-04-13 15:40:22 +08:00
},
2024-04-27 11:47:31 +08:00
sale_type: {
type: [Number, String],
default: 1,
},
2024-02-19 10:44:33 +08:00
},
computed: mapGetters(['viewColor']),
data() {
return {
2024-04-27 11:47:31 +08:00
showTips: false, //退款提示弹窗
refundItem: null,
2024-02-19 10:44:33 +08:00
domain: HTTP_REQUEST_URL,
2024-03-20 11:55:11 +08:00
totalNmu: '',
2024-02-19 10:44:33 +08:00
isTimePay: false, //是否到支付时间
};
},
2024-03-20 11:55:11 +08:00
watch: {
cartInfo: function(nVal, oVal) {
console.log(nVal);
console.log(oVal);
2024-02-19 10:44:33 +08:00
let num = 0
2024-03-20 11:55:11 +08:00
nVal.forEach((item, index) => {
2024-02-19 10:44:33 +08:00
num += item.cart_num
})
this.totalNmu = num
2024-03-20 11:55:11 +08:00
console.log(nVal);
2024-02-19 10:44:33 +08:00
}
},
onShow() {
this.isPayBalance()
},
mounted() {},
methods: {
2024-03-20 11:55:11 +08:00
evaluateTap: function(unique, orderId) {
2024-02-19 10:44:33 +08:00
uni.navigateTo({
2024-04-13 15:40:22 +08:00
url: `/pages/users/goods_comment_con/index?uni=${unique}&order_id=${orderId}&sale_type=${this.sale_type}`
2024-02-19 10:44:33 +08:00
})
},
// 判断是否到支付尾款时间
2024-03-20 11:55:11 +08:00
isPayBalance() {
2024-02-19 10:44:33 +08:00
let that = this;
2024-03-20 11:55:11 +08:00
if (that.orderData.status === 10) {
if (new Date() < new Date(that.orderData.presellOrder.final_start_time)) {
2024-02-19 10:44:33 +08:00
that.isTimePay = false; //未开始
2024-03-20 11:55:11 +08:00
} else if ((new Date() >= new Date(that.orderData.presellOrder.final_start_time)) && (new Date() <=
new Date(that.orderData.presellOrder.final_start_time))) {
2024-02-19 10:44:33 +08:00
that.isTimePay = true; //立即支付
}
}
},
2024-03-20 11:55:11 +08:00
jumpCon: function(item) {
if (item.product_type == 4) item.activity_id = item.cart_info && item.cart_info.activeSku
.product_group_id
if (item.product_type == 3) item.activity_id = item.cart_info && item.cart_info.productAssistAttr
.product_assist_id
2024-04-13 15:40:22 +08:00
goShopDetail(item, '', this.sale_type).then(res => {
2024-02-19 10:44:33 +08:00
initiateAssistApi(item.activity_id).then(res => {
let id = res.data.product_assist_set_id;
2024-03-20 11:55:11 +08:00
uni.hideLoading();
uni.navigateTo({
2024-04-27 11:47:31 +08:00
url: '/pages/activity/assist_detail/index?id=' + id +
'&sale_type=' + this.sale_type
2024-03-20 11:55:11 +08:00
});
}).catch((err) => {
uni.showToast({
title: err,
icon: 'none'
})
2024-02-19 10:44:33 +08:00
});
2024-03-20 11:55:11 +08:00
})
2024-02-19 10:44:33 +08:00
},
// 退款
2024-03-20 11:55:11 +08:00
refund(item) {
2024-04-27 11:47:31 +08:00
if (this.showTips) this.showTips = false;
2024-02-19 10:44:33 +08:00
// #ifdef MP
openOrderRefundSubscribe().then(() => {
uni.hideLoading();
2024-03-20 11:55:11 +08:00
if (this.evaluate == 0 || this.evaluate == 9 || this.orderData.is_virtual != 0) {
2024-02-19 10:44:33 +08:00
uni.navigateTo({
2024-03-20 11:55:11 +08:00
url: '/pages/users/refund/confirm?order_id=' + this.orderId + '&type=1' +
'&ids=' + item.order_product_id + '&refund_type=1&order_type=' + this
2024-04-13 15:40:22 +08:00
.orderData.order_type + '&sale_type=' + this.sale_type
2024-02-19 10:44:33 +08:00
})
2024-03-20 11:55:11 +08:00
} else {
2024-02-19 10:44:33 +08:00
uni.navigateTo({
2024-03-20 11:55:11 +08:00
url: '/pages/users/refund/select?order_id=' + this.orderId +
'&type=1&order_type=' + this.orderData.order_type + '&ids=' + item
2024-04-13 15:40:22 +08:00
.order_product_id + '&sale_type=' + this.sale_type
2024-02-19 10:44:33 +08:00
})
}
}).catch(() => {
uni.hideLoading();
})
// #endif
// #ifdef H5 || APP-PLUS
2024-03-20 11:55:11 +08:00
if (this.evaluate == 0 || this.evaluate == 9 || this.orderData.is_virtual != 0) {
2024-02-19 10:44:33 +08:00
uni.navigateTo({
2024-03-20 11:55:11 +08:00
url: '/pages/users/refund/confirm?order_id=' + this.orderId + '&type=1' + '&ids=' + item
2024-04-27 11:47:31 +08:00
.order_product_id + '&refund_type=1&order_type=' + this.orderData.order_type +
'&sale_type=' + this.sale_type
2024-02-19 10:44:33 +08:00
})
2024-03-20 11:55:11 +08:00
} else {
2024-02-19 10:44:33 +08:00
uni.navigateTo({
2024-03-20 11:55:11 +08:00
url: '/pages/users/refund/select?order_id=' + this.orderId + '&type=1&order_type=' + this
2024-04-27 11:47:31 +08:00
.orderData.order_type + '&ids=' + item.order_product_id + '&sale_type=' + this
.sale_type
2024-02-19 10:44:33 +08:00
})
}
// #endif
}
}
}
</script>
<style scoped lang="scss">
.orderGoods {
background-color: #fff;
}
2024-03-20 11:55:11 +08:00
2024-02-19 10:44:33 +08:00
.p-color {
color: var(--view-priceColor);
}
2024-03-20 11:55:11 +08:00
.t-color {
2024-02-19 10:44:33 +08:00
color: var(--view-theme);
}
2024-03-20 11:55:11 +08:00
.svip-img {
2024-02-19 10:44:33 +08:00
width: 65rpx;
height: 28rpx;
margin: 4rpx 0 0 4rpx;
}
2024-03-20 11:55:11 +08:00
.title {
2024-02-19 10:44:33 +08:00
height: 86rpx;
position: relative;
padding: 0 30rpx;
2024-03-20 11:55:11 +08:00
&::after {
2024-02-19 10:44:33 +08:00
content: "";
width: 750rpx;
2024-03-20 11:55:11 +08:00
border-bottom: 2rpx dotted #D8D8D8;
2024-02-19 10:44:33 +08:00
position: absolute;
bottom: 0;
left: 0;
}
2024-03-20 11:55:11 +08:00
.item-status {
2024-02-19 10:44:33 +08:00
color: #999999;
font-size: 30rpx;
2024-03-20 11:55:11 +08:00
&.status0 {
2024-02-19 10:44:33 +08:00
color: #2291F8;
}
}
2024-03-20 11:55:11 +08:00
.item-date {
2024-02-19 10:44:33 +08:00
color: #666666;
font-size: 28rpx;
}
2024-03-20 11:55:11 +08:00
}
.right-btn-box {
2024-02-19 10:44:33 +08:00
display: flex;
align-items: center;
justify-content: flex-end;
2024-03-20 11:55:11 +08:00
&.event_box {
2024-02-19 10:44:33 +08:00
position: static;
}
2024-03-20 11:55:11 +08:00
.btn-item {
2024-02-19 10:44:33 +08:00
display: flex;
align-items: center;
justify-content: center;
2024-03-20 11:55:11 +08:00
width: 140rpx;
height: 46rpx;
2024-02-19 10:44:33 +08:00
margin-left: 10rpx;
2024-03-20 11:55:11 +08:00
border: 1px solid rgba(187, 187, 187, 1);
border-radius: 23rpx;
2024-02-19 10:44:33 +08:00
font-size: 24rpx;
color: #282828;
2024-03-20 11:55:11 +08:00
&.on {
background: rgba(220, 220, 220, 1);
border-color: rgba(220, 220, 220, 1);
2024-02-19 10:44:33 +08:00
}
2024-03-20 11:55:11 +08:00
&.err {
background: rgba(247, 247, 247, 1);
border-color: rgba(247, 247, 247, 1);
2024-02-19 10:44:33 +08:00
color: #AAAAAA;
}
}
}
2024-03-20 11:55:11 +08:00
.event_bg {
2024-02-19 10:44:33 +08:00
background: #FF7F00;
}
2024-03-20 11:55:11 +08:00
.event_color {
2024-02-19 10:44:33 +08:00
color: #FF7F00;
}
2024-03-20 11:55:11 +08:00
.presell_item {
2024-02-19 10:44:33 +08:00
height: auto;
padding-bottom: 15rpx;
}
2024-03-20 11:55:11 +08:00
.event_progress {
2024-02-19 10:44:33 +08:00
margin-top: 20rpx;
background: #fff;
2024-03-20 11:55:11 +08:00
2024-02-19 10:44:33 +08:00
.progress_name {
padding-left: 30rpx;
height: 60rpx;
line-height: 60rpx;
font-size: 24rpx;
font-weight: bold;
position: relative;
color: var(--view-theme);
2024-03-20 11:55:11 +08:00
&::before {
2024-02-19 10:44:33 +08:00
content: "";
display: inline-block;
width: 5rpx;
height: 34rpx;
background: var(--view-theme);
position: absolute;
top: 15rpx;
left: 0;
}
}
2024-03-20 11:55:11 +08:00
.align_right {
2024-02-19 10:44:33 +08:00
float: right;
font-weight: bold;
}
2024-03-20 11:55:11 +08:00
.progress_price {
2024-02-19 10:44:33 +08:00
padding: 20rpx 30rpx;
color: #999999;
font-size: 22rpx;
}
2024-03-20 11:55:11 +08:00
.progress_pay {
2024-02-19 10:44:33 +08:00
padding: 25rpx 30rpx;
background: var(--view-minorColor);
font-size: 26rpx;
color: #282828;
}
}
2024-03-20 11:55:11 +08:00
.event_name {
2024-02-19 10:44:33 +08:00
display: inline-block;
margin-right: 9rpx;
color: #fff;
font-size: 20rpx;
padding: 0 8rpx;
2024-03-20 11:55:11 +08:00
line-height: 30rpx;
2024-02-19 10:44:33 +08:00
text-align: center;
2024-03-20 11:55:11 +08:00
border-radius: 6rpx;
2024-02-19 10:44:33 +08:00
}
2024-03-20 11:55:11 +08:00
.event_ship {
2024-02-19 10:44:33 +08:00
font-size: 20rpx;
2024-03-20 11:55:11 +08:00
margin-top: 10rpx;
2024-02-19 10:44:33 +08:00
}
2024-03-20 11:55:11 +08:00
.goodWrapper.item1 {
&::after {
2024-02-19 10:44:33 +08:00
content: "";
display: block;
width: 750rpx;
height: 14rpx;
background: #F0F0F0;
2024-03-20 11:55:11 +08:00
}
2024-02-19 10:44:33 +08:00
}
2024-04-27 11:47:31 +08:00
.tips {
width: 590rpx;
height: 354rpx;
background-color: white;
border-radius: 16rpx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
box-sizing: border-box;
padding: 50rpx 40rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
}
2024-03-20 11:55:11 +08:00
</style>