|
|
@@ -1,11 +1,12 @@
|
|
|
<!--
|
|
|
商城订单申请售后页
|
|
|
供订单详情「申请售后」进入;顾客勾选商品/金额后提交待审核申请,商家在 hdApp 审核
|
|
|
+ 撤销后仍可重新申请:把已取消记录改回待审核
|
|
|
-->
|
|
|
<template>
|
|
|
<view class="refund-page">
|
|
|
- <!-- 已有申请:展示进度 -->
|
|
|
- <template v-if="apply && apply.id">
|
|
|
+ <!-- 已有申请:展示进度(点「重新申请」后切到表单) -->
|
|
|
+ <template v-if="showApplyProgress">
|
|
|
<view class="card-section">
|
|
|
<view class="section-title">
|
|
|
<text class="title-text">申请进度</text>
|
|
|
@@ -33,6 +34,10 @@
|
|
|
<view class="bottom-actions" v-if="apply.status == 0">
|
|
|
<button class="action-btn cancel-btn" @tap="doCancel">撤销申请</button>
|
|
|
</view>
|
|
|
+ <view class="bottom-actions" v-else-if="canReapply">
|
|
|
+ <button class="action-btn cancel-btn" @tap="goBack">返回</button>
|
|
|
+ <button class="action-btn confirm-btn" @tap="startReapply">重新申请</button>
|
|
|
+ </view>
|
|
|
<view class="bottom-actions" v-else>
|
|
|
<button class="action-btn cancel-btn" @tap="goBack">返回</button>
|
|
|
</view>
|
|
|
@@ -184,7 +189,7 @@
|
|
|
</view>
|
|
|
|
|
|
<view class="bottom-actions">
|
|
|
- <button class="action-btn cancel-btn" @tap="goBack">取消</button>
|
|
|
+ <button class="action-btn cancel-btn" @tap="onFormCancel">取消</button>
|
|
|
<button class="action-btn confirm-btn" @tap="askSubmit">提交申请</button>
|
|
|
</view>
|
|
|
</template>
|
|
|
@@ -207,10 +212,29 @@ export default {
|
|
|
apply: null,
|
|
|
canApply: 0,
|
|
|
refundDeadlineTip: '',
|
|
|
- submitting: false
|
|
|
+ submitting: false,
|
|
|
+ // 已取消后点「重新申请」进入表单,提交时把原记录改回待审核
|
|
|
+ reapplying: false
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
+ /** 是否展示申请进度;重新申请中不锁在进度页 */
|
|
|
+ showApplyProgress() {
|
|
|
+ if (!this.apply || !this.apply.id) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if (this.reapplying) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ return true
|
|
|
+ },
|
|
|
+ /** 已取消且订单仍可售后时允许重新申请 */
|
|
|
+ canReapply() {
|
|
|
+ if (!this.apply || !this.apply.id) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ return Number(this.apply.status) === 3 && Number(this.canApply) === 1
|
|
|
+ },
|
|
|
/** 是否展示已退金额行(避免模板里写 > 比较,兼容小程序 WXML) */
|
|
|
hasTkPrice() {
|
|
|
return Number(this.orderInfo.tkPrice) > 0
|
|
|
@@ -267,11 +291,33 @@ export default {
|
|
|
goBack() {
|
|
|
uni.navigateBack({ delta: 1 })
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 表单取消:重新申请中退回已取消进度页,首次申请则离开本页
|
|
|
+ */
|
|
|
+ onFormCancel() {
|
|
|
+ if (this.reapplying) {
|
|
|
+ this.reapplying = false
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.goBack()
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 已取消后重新申请:切到表单,提交时后端把该记录改回待审核
|
|
|
+ */
|
|
|
+ startReapply() {
|
|
|
+ if (!this.canReapply) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.reapplying = true
|
|
|
+ this.remark = ''
|
|
|
+ this.refundType = 1
|
|
|
+ },
|
|
|
/** 切换为只退款 */
|
|
|
onOnlyRefund() {
|
|
|
this.refundType = 2
|
|
|
},
|
|
|
init() {
|
|
|
+ this.reapplying = false
|
|
|
const id = this.option.id
|
|
|
if (!id) {
|
|
|
this.$msg('缺少订单信息')
|