shish 1 mēnesi atpakaļ
vecāks
revīzija
504e26eca6
2 mainītis faili ar 33 papildinājumiem un 21 dzēšanām
  1. 2 2
      ghsApp/src/admin/shop/add.vue
  2. 31 19
      hdApp/src/pagesPurchase/refund.vue

+ 2 - 2
ghsApp/src/admin/shop/add.vue

@@ -119,7 +119,7 @@
 				</tui-list-cell>
 
 				<tui-list-cell class="line-cell" :hover="false">
-					<view class="tui-title">自主申请售后</view>
+					<view class="tui-title">线上申请售后</view>
 					<view class="select-button-wrap">
 						<button class="admin-button-com middle" :class="[form.afterSale == 1 ? 'blue' : 'default']" @click="form.afterSale = 1">允许</button>
 						<button class="admin-button-com middle" :class="[form.afterSale == 0 ? 'blue' : 'default']" @click="form.afterSale = 0">禁止</button>
@@ -145,7 +145,7 @@
 					</tui-list-cell>
 
 					<tui-list-cell class="line-cell" :hover="false">
-						<view class="tui-title">自主申请时限</view>
+						<view class="tui-title">线上申请时限</view>
 						<input v-model="form.saleHour" @focus="form.saleHour=''" placeholder-class="phcolor" class="tui-input" name="saleHour" placeholder="下单几小时内可申请,0不限时" type="number" />
 					</tui-list-cell>
 				</block>

+ 31 - 19
hdApp/src/pagesPurchase/refund.vue

@@ -1,5 +1,6 @@
 <template>
-	<view class="refund-page">
+<view class="refund-page">
+	<block v-if="orderInfo.afterSaleRule.afterSale == 1">
 		<!-- 红色提示信息 - 售后说明 -->
 		<view class="info-tip">
 			<view class="info-content">
@@ -27,7 +28,7 @@
 					@tap="refundType=1">
 					退货并退款
 				</button>
-				<button 
+				<button v-if="orderInfo.afterSaleRule.refundOnlyPrice == 1"
 					class="type-button" 
 					:class="refundType==2?'active':''" 
 					@tap="refundType=2">
@@ -139,24 +140,11 @@
 				</htz-image-upload>
 				<view class="upload-warning">
 					必须按规范提供照片,否则申请将直接驳回。
-					<view style="color:#049E2C;font-weight:bold;text-decoration:underline;" @click="getRule()">点击查看拍照规范</view>
+					<view style="color:#049E2C;font-weight:bold;text-decoration:underline;font-size:34upx;" @click="getRule()">点击查看拍照规范</view>
 				</view>
 			</view>
 		</view>
 
-		<!-- 审核通知卡片 -->
-		<!-- #ifdef MP-WEIXIN -->
-		<!-- <view class="card-section">
-			<view class="section-title">
-				<text class="title-text">审核通知</text>
-			</view>
-			<view class="notice-section">
-				<button class="admin-button-com middle default" @click="noticeMe()" v-if="needNotice == 0">点击开启通知</button>
-				<button class="admin-button-com middle green-btn" v-else>已经开启通知</button>
-			</view>
-		</view> -->
-		<!-- #endif -->
-
 		<!-- 退款方式提示:余额/线上/挂账/线下 -->
 		<view class="tip-section">
 			<text v-if="orderInfo.onlinePay == 2" class="tip-text online-tip">此单线上付款,审核通过后,钱会原路自动退回</text>
@@ -173,7 +161,15 @@
 			<button class="action-btn confirm-btn" formType="submit" @tap="confirmRefund">提交申请</button>
 		</view>
 
-	</view>
+	</block>
+	<block v-else>
+		<view class="info-tip">
+			<view class="info-content">
+				<text class="info-text">暂不支持线上申请售后,请联系批发店</text>
+			</view>
+		</view>
+	</block>
+</view>
 </template>
 <script>
 import { mapGetters } from "vuex"
@@ -194,7 +190,15 @@ export default {
 			refundMoney:0,
 			refundType:1,
 			remark:'',
-			orderInfo:{},
+			// 售后规则默认值,init 拉取订单后会被接口 afterSaleRule 覆盖
+			orderInfo: {
+				afterSaleRule: {
+					afterSale: 1,
+					saleHour: 12,
+					refundOnlyPrice: 1,
+					refundMustImg: 0
+				}
+			},
 			couldRefundPrice:0,
 			unClear:[],
 			refundImgData:[],
@@ -293,6 +297,10 @@ export default {
 				uni.showToast({title:'请选择商品',icon:'none'})
 				return;
 			}
+			if(Number(this.orderInfo.afterSaleRule.refundMustImg) == 1 && this.$util.isEmpty(this.uploadRefundImg)){
+				uni.showToast({title:'请上传花材照片',icon:'none'})
+				return;
+			}
 			let imgData = JSON.stringify(this.uploadRefundImg)
 			let refundParams = {
 				id:this.option.id,
@@ -325,8 +333,12 @@ export default {
 		async init() {
 			//getOriginalItem 取原有的花材结构(小菊的花材结构有变化)
 			const res = await getFullInfo({ id: this.option.id,getOriginalItem:1 })
+			const defaultAfterSaleRule = this.orderInfo.afterSaleRule || {}
 			this.orderInfo = res.data
-			
+			this.orderInfo.afterSaleRule = {
+				...defaultAfterSaleRule,
+				...(res.data.afterSaleRule || {})
+			}
 			this.couldRefundPrice = Number(res.data.orderPrice) - Number(res.data.tkPrice)
 			this.couldRefundPrice = this.couldRefundPrice.toFixed(2)
 			this.couldRefundPrice = parseFloat(this.couldRefundPrice)