shish 21 часов назад
Родитель
Сommit
2507f798bd
1 измененных файлов с 19 добавлено и 7 удалено
  1. 19 7
      hdApp/src/admin/order/refundDetail.vue

+ 19 - 7
hdApp/src/admin/order/refundDetail.vue

@@ -5,11 +5,8 @@
 -->
 <template>
 	<view class="refund-page">
+
 		<view class="refund-card" v-if="info.id">
-			<view class="refund-row" v-if="isFreeRefund">
-				<view class="refund-label">客户</view>
-				<view class="refund-value">{{ info.customName || '-' }}</view>
-			</view>
 
 			<view class="refund-row">
 				<view class="refund-label">{{ isFreeRefund ? '退货方式' : '退款方式' }}</view>
@@ -44,7 +41,10 @@
 					</block>
 				</view>
 			</view>
-
+			<view class="refund-row">
+				<view class="refund-label">客户</view>
+				<view class="refund-value">{{ info.customName || '-' }}</view>
+			</view>
 			<view class="refund-row">
 				<view class="refund-label">申请时间</view>
 				<view class="refund-value">{{ info.addTime ? String(info.addTime).substr(5, 11) : '' }}</view>
@@ -88,7 +88,7 @@
 
 			<template v-if="Number(info.status) !== 0">
 				<view class="refund-row">
-					<view class="refund-label">原单类型</view>
+					<view class="refund-label">原单时间</view>
 					<view class="refund-value">{{ info.sameDay === 0 ? '历史订单' : '当天订单' }}</view>
 				</view>
 			</template>
@@ -162,7 +162,9 @@ export default {
 			remark: '',
 			busy: false,
 			showReject: false,
-			rejectReason: ''
+			rejectReason: '',
+			/** 首次由 globalMixins onLoad 调 init;之后 onShow 才刷新,避免进页连打两次 */
+			detailInited: false
 		}
 	},
 	computed: {
@@ -229,7 +231,13 @@ export default {
 				&& !this.$util.isEmpty(this.productList)
 		}
 	},
+	/**
+	 * 从退还方式/凭证页返回时重拉;首次进页跳过(mixin onLoad 已 init)
+	 */
 	onShow() {
+		if (!this.detailInited) {
+			return
+		}
 		this.init()
 	},
 	methods: {
@@ -237,6 +245,7 @@ export default {
 		init() {
 			return refundDetail({ id: this.option.id }).then(res => {
 				if (res.code != 1 || !res.data) {
+					this.detailInited = true
 					return
 				}
 				const info = res.data.info || {}
@@ -247,6 +256,9 @@ export default {
 				this.refundType = info.refundType || 0
 				this.refundPrice = info.refundPrice || 0
 				this.remark = info.remark || res.data.remark || ''
+				this.detailInited = true
+			}).catch(() => {
+				this.detailInited = true
 			})
 		},
 		goToOrder() {