|
|
@@ -126,7 +126,7 @@
|
|
|
<template v-if="data.status == 1">
|
|
|
<button class="button-com red big" @click="payFn">立即支付</button>
|
|
|
</template>
|
|
|
- <!-- 已支付且非待付/取消/已退款时,展示申请售后入口 -->
|
|
|
+ <!-- 仅可售后时展示;不可售后(未付/取消/已退完/分销已结算/待审核等)隐藏 -->
|
|
|
<template v-else-if="showRefundBtn">
|
|
|
<button class="button-com default big refund-btn" @click="goRefund">申请售后</button>
|
|
|
</template>
|
|
|
@@ -134,6 +134,10 @@
|
|
|
</view>
|
|
|
</template>
|
|
|
<script>
|
|
|
+/**
|
|
|
+ * 商城订单详情
|
|
|
+ * 底部「申请售后」由详情接口 canApplyRefund / 本地兜底规则控制显隐
|
|
|
+ */
|
|
|
import { mapGetters } from "vuex";
|
|
|
import orderItem from "@/components/module/app-order-item";
|
|
|
import ListModule from "@/components/module/app-order-list";
|
|
|
@@ -154,20 +158,32 @@ export default {
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters({ shopUser: "getShopUser" }),
|
|
|
- /** 已付款且非待付/取消/已退款、非红冲单时显示申请售后 */
|
|
|
+ /**
|
|
|
+ * 是否展示申请售后:优先用详情 canApplyRefund,与后端 RefundController 一致
|
|
|
+ */
|
|
|
showRefundBtn() {
|
|
|
- const d = this.data || {}
|
|
|
+ const d = this.data || {};
|
|
|
+ if (d.canApplyRefund !== undefined && d.canApplyRefund !== null && d.canApplyRefund !== "") {
|
|
|
+ return Number(d.canApplyRefund) === 1;
|
|
|
+ }
|
|
|
+ // 接口未返回时的兜底(含分销已结算)
|
|
|
if (Number(d.payStatus) !== 1) {
|
|
|
- return false
|
|
|
+ return false;
|
|
|
}
|
|
|
if (Number(d.forward) === 1) {
|
|
|
- return false
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if ([1, 5, 6].indexOf(Number(d.status)) !== -1) {
|
|
|
+ return false;
|
|
|
}
|
|
|
- const status = Number(d.status)
|
|
|
- if ([1, 5, 6].indexOf(status) !== -1) {
|
|
|
- return false
|
|
|
+ if (Number(d.distOrderSettled) === 1) {
|
|
|
+ return false;
|
|
|
}
|
|
|
- return true
|
|
|
+ const could = Number(d.orderPrice || 0) - Number(d.tkPrice || 0);
|
|
|
+ if (could <= 0) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
},
|
|
|
statusImg() {
|
|
|
let img = "";
|
|
|
@@ -187,12 +203,16 @@ export default {
|
|
|
goShOrder(info){
|
|
|
this.$util.pageTo({url:'/pages/order/detail?id='+info.shOrderId})
|
|
|
},
|
|
|
- /** 跳转申请售后页 */
|
|
|
+ /** 跳转申请售后;分销已结算时兜底提示 */
|
|
|
goRefund() {
|
|
|
if (!this.data.id) {
|
|
|
- return
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (Number(this.data.distOrderSettled) === 1) {
|
|
|
+ uni.showToast({ title: "分销佣金已结算,无法申请售后", icon: "none" });
|
|
|
+ return;
|
|
|
}
|
|
|
- this.$util.pageTo({ url: '/pages/order/refund?id=' + this.data.id })
|
|
|
+ this.$util.pageTo({ url: "/pages/order/refund?id=" + this.data.id });
|
|
|
},
|
|
|
init() {
|
|
|
this.getDetail().then(() => {
|
|
|
@@ -336,7 +356,7 @@ export default {
|
|
|
.default {
|
|
|
width: 260upx;
|
|
|
}
|
|
|
- /* 申请售后按钮:主色描边,与「立即支付」实心主色区分主次 */
|
|
|
+ /* 申请售后:描边主色,与「立即支付」实心区分 */
|
|
|
.refund-btn {
|
|
|
color: $mainColor !important;
|
|
|
border: 1upx solid $mainColor !important;
|