فهرست منبع

红包 价格控制

shish 4 سال پیش
والد
کامیت
8d5d93be06
2فایلهای تغییر یافته به همراه12 افزوده شده و 22 حذف شده
  1. 3 5
      ghsApp/src/pagesOrder/refund.vue
  2. 9 17
      hdApp/src/pagesPurchase/refundDetail.vue

+ 3 - 5
ghsApp/src/pagesOrder/refund.vue

@@ -68,7 +68,6 @@
 			}
 			}
 		}
 		}
 		.btn-box{
 		.btn-box{
-
 			.btn{
 			.btn{
 				width: 200rpx;
 				width: 200rpx;
 				height: 60rpx;
 				height: 60rpx;
@@ -80,7 +79,6 @@
 					border: 1px solid #3385ff;
 					border: 1px solid #3385ff;
 				}
 				}
 			}
 			}
-
 		}
 		}
 	}
 	}
 </style>
 </style>
@@ -177,6 +175,9 @@ export default {
 				})
 				})
 			}
 			}
 			this.refundMoney = parseFloat((this.refundPrice * this.discount).toFixed(2))
 			this.refundMoney = parseFloat((this.refundPrice * this.discount).toFixed(2))
+			if(Number(this.refundMoney) > Number(this.orderInfo.realPrice)){
+				this.refundMoney = parseFloat(this.orderInfo.realPrice)
+			}
 		},
 		},
 	},
 	},
 	methods: {
 	methods: {
@@ -250,13 +251,10 @@ export default {
 				id: this.option.id,getOriginalItem:1
 				id: this.option.id,getOriginalItem:1
 			});
 			});
 			this.orderInfo = res.data
 			this.orderInfo = res.data
-
 			this.discount = parseFloat((this.orderInfo.realPrice / this.orderInfo.prePrice).toFixed(2))
 			this.discount = parseFloat((this.orderInfo.realPrice / this.orderInfo.prePrice).toFixed(2))
-
 			this.product = res.data.product.map(ele=>{
 			this.product = res.data.product.map(ele=>{
 				return {...ele,isActive:false,big:null,small:null}
 				return {...ele,isActive:false,big:null,small:null}
 			})
 			})
-			console.log(this.product)
 		},
 		},
 	}
 	}
 };
 };

+ 9 - 17
hdApp/src/pagesPurchase/refundDetail.vue

@@ -8,16 +8,8 @@
             <text>退款花材</text>
             <text>退款花材</text>
           </view>
           </view>
           <view class="commodity-list">
           <view class="commodity-list">
-            <view
-              v-for="(s, idx) in refundData.itemList"
-              :key="idx"
-              class="commodity-item"
-            >
-              <image
-                class="item-icon"
-                :src="s.cover"
-                alt=""
-              />
+            <view v-for="(s, idx) in refundData.itemList" :key="idx" class="commodity-item">
+              <image class="item-icon" :src="s.cover" alt="" />
               <view class="item-info">
               <view class="item-info">
                 <view class="info-line">
                 <view class="info-line">
                   <text class="item-name">{{ s.name }}</text>
                   <text class="item-name">{{ s.name }}</text>
@@ -44,7 +36,7 @@
 					</tui-list-cell>
 					</tui-list-cell>
 					<tui-list-cell class="line-cell" :hover="false" v-if="discountType == 4">
 					<tui-list-cell class="line-cell" :hover="false" v-if="discountType == 4">
 						<div class="tui-title">红包优惠</div>
 						<div class="tui-title">红包优惠</div>
-						<div class="detail-price_box red"><text v-if="refundPrice == actPrice" style="margin-right:10rpx;">已退还</text>¥{{ discountAmount }}</div>
+						<div class="detail-price_box red"><text v-if="hbRefund == 1" style="margin-right:50rpx;">红包已退回</text>-¥{{ discountAmount }}</div>
 					</tui-list-cell>
 					</tui-list-cell>
 					<tui-list-cell class="line-cell" :hover="false">
 					<tui-list-cell class="line-cell" :hover="false">
 						<div class="tui-title">实付金额</div>
 						<div class="tui-title">实付金额</div>
@@ -96,7 +88,8 @@ export default {
       actPrice:0,
       actPrice:0,
       discountType:0,
       discountType:0,
       discountAmount:0,
       discountAmount:0,
-      refundPrice:0
+      refundPrice:0,
+      hbRefund:0
     };
     };
   },
   },
   onPullDownRefresh() {
   onPullDownRefresh() {
@@ -108,8 +101,8 @@ export default {
     init() {
     init() {
       this.initData()
       this.initData()
     },
     },
-    async initData () {
-      return getRefundData({ cgId: this.option.id }).then(res => {
+    initData () {
+      getRefundData({ cgId: this.option.id }).then(res => {
         this.refundData = res.data
         this.refundData = res.data
         this.prePrice = res.data.cgInfo.prePrice
         this.prePrice = res.data.cgInfo.prePrice
         this.discountType = res.data.cgInfo.discountType
         this.discountType = res.data.cgInfo.discountType
@@ -120,9 +113,8 @@ export default {
         }else{
         }else{
           this.actPrice = parseFloat(res.data.cgInfo.actPrice)
           this.actPrice = parseFloat(res.data.cgInfo.actPrice)
         }
         }
-        
+        this.hbRefund = res.data.info.hbRefund
         this.refundPrice = res.data.info.refundPrice
         this.refundPrice = res.data.info.refundPrice
-        this.$forceUpdate()
       })
       })
     }
     }
   }
   }
@@ -311,7 +303,7 @@ export default {
   }
   }
   .detail-price_box {
   .detail-price_box {
     color: #333333;
     color: #333333;
-    font-size: 22px;
+    font-size: 28px;
     text-align: right;
     text-align: right;
     flex: 1;
     flex: 1;
     font-weight: 600;
     font-weight: 600;