shish 4 лет назад
Родитель
Сommit
5825bc0a5f
2 измененных файлов с 90 добавлено и 40 удалено
  1. 43 28
      ghsApp/src/pagesOrder/refundMsg.vue
  2. 47 12
      hdApp/src/pagesPurchase/refundDetail.vue

+ 43 - 28
ghsApp/src/pagesOrder/refundMsg.vue

@@ -20,7 +20,6 @@
 					background: #3385ff;
 					border-radius: 50%;
 				}
-
 			}
 		}
 		.refund-item-list{
@@ -51,7 +50,7 @@
 		}
 		.refund-item{
 			display: flex;
-			padding: 30rpx 0;
+			padding: 20rpx 0;
 			.refund-label{width: 200rpx;text{color: red;}}
 			input{
 				border: 1px solid #ddd;
@@ -59,10 +58,10 @@
 			textarea{
 				width: calc(100% - 210rpx);
 				border: 1px solid #ddd;
+				height:150rpx;
 			}
 		}
 		.btn-box{
-
 			.btn{
 				width: 200rpx;
 				height: 60rpx;
@@ -74,7 +73,6 @@
 					border: 1px solid #3385ff;
 				}
 			}
-
 		}
 	}
 </style>
@@ -84,8 +82,6 @@
 					<view class="refund-label">退款方式:</view>
 					<view class="flex list">
 						<view class="flex" >{{refundType==1?'退货并退款':'仅退款'}}</view>
-						<!--<view class="flex" @tap="refundType=1" ><view class="flex-center radioBtn" :class="refundType==1?'active':''"></view>退货并退款</view>-->
-						<!--<view style="margin-left: 20rpx" class="flex" @tap="refundType=2"><view class="flex-center radioBtn"  :class="refundType==1?'':'active'"></view>仅退款</view>-->
 					</view>
 				</view>
 				<view class="refund-item-list" v-if="refundType==1">
@@ -93,7 +89,6 @@
 					<view>
 						<view class="list" v-for="(res,i) in product" :key="i">
 						<view class="flex list-title" >
-							<!--<view class="flex-center radioBtn" :class="res.isActive?'active':''"></view>-->
 							{{res.itemName}}  {{`¥${res.itemPrice}`}}
 						</view>
 						<view class="flex list-val">
@@ -103,28 +98,34 @@
 					</view>
 					</view>
 				</view>
+				<view class="flex refund-item">
+					<view class="refund-label">订单原价:</view>
+					<view class="list">{{parseFloat(prePrice)||0}}</view>
+				</view>
+
+				<view class="flex refund-item" v-if="discountType == 4">
+					<view class="refund-label">红包优惠:</view>
+					<view class="list">
+						<text style="color:red;margin-right:20rpx;">-{{parseFloat(discountAmount) || 0}}</text>
+						<text v-if="parseFloat(realPrice) == parseFloat(refundMoney)" style="color:red;">红包已退还</text>
+					</view>
+				</view>
 
 				<view class="flex refund-item">
-					<view class="refund-label">订单金额:</view>
-					<view class="list">{{totalMoney}}</view>
+					<view class="refund-label">实付金额:</view>
+					<view class="list">{{parseFloat(realPrice)||0}}</view>
 				</view>
 
 				<view class="flex refund-item">
 					<view class="refund-label"><text></text>退款金额:</view>
-					<input type="text" disabled   v-model="refundMoney">
+					<input type="text" disabled v-model="refundMoney">
 				</view>
-
-
 		<view class=" refund-item">
 			<view class="refund-label">备注:</view>
 			<textarea disabled v-model="remark" />
 		</view>
-
-
-
 	</view>
 </template>
-
 <script>
 import { refundDetail } from "@/api/refund/index";
 export default {
@@ -132,26 +133,40 @@ export default {
 		return {
 			isMonitor:true,
 			product:'',
-			totalMoney:'',
-			refundMoney:null,
+			refundMoney:0,
 			refundType:1,
 			remark:'',
+			refundInfo:{},
+			realPrice:0,
+			prePrice:0,
+			discountType:0,
+			discountAmount:0
 		};
 	},
 	onShow() {
 	},
 	methods: {
-		async init() {
-			const res = await refundDetail({
+		init() {
+			refundDetail({
 				orderSn: this.option.orderSn
-			});
-			this.product = res.data.itemInfo;
-			this.refundType = res.data.refundType;
-			this.refundMoney = res.data.refundPrice;
-			this.remark = res.data.remark;
-			this.totalMoney = res.data.totalPrice
+			}).then(res=>{
+				this.refundInfo = res.data
+				this.product = res.data.itemInfo;
+				this.refundType = res.data.refundType;
+				this.refundMoney = res.data.refundPrice;
+				this.remark = res.data.remark;
+				this.prePrice = res.data.orderInfo.prePrice
+				this.discountType = res.data.orderInfo.discountType || 0
+				this.discountAmount = res.data.orderInfo.discountAmount || 0
+				if(this.discountType == 4){
+					let realPrice = (Number(res.data.orderInfo.prePrice) - Number(res.data.orderInfo.discountAmount)).toFixed(2)
+					this.realPrice = parseFloat(realPrice)
+				}else{
+					this.realPrice = parseFloat(res.data.orderInfo.realPrice)
+				}
+			})
+
 		},
 	}
 };
-</script>
-
+</script>

+ 47 - 12
hdApp/src/pagesPurchase/refundDetail.vue

@@ -1,6 +1,7 @@
 <template>
   <view class="app-content">
     <view class="info-content_box">
+
       <view class="module-com content-box proInfo">
         <view class="commodity-view">
           <view class="infoAEdit">
@@ -22,7 +23,7 @@
                   <text class="item-name">{{ s.name }}</text>
                   <text class="item-price">
                     <text class="unit"></text>
-                    <text class="price"><text>{{s.itemNum}}扎*{{s.itemPrice}}</text></text>
+                    <text class="price"><text>{{s.itemNum}}扎*{{parseFloat(s.itemPrice)}}</text></text>
                   </text>
                 </view>
                 <view class="info-line">
@@ -32,14 +33,30 @@
               </view>
             </view>
           </view>
-          <view class="summary-bar">
-            <view class="operate-view"></view>
-            <view class="describe-view">
-              合计 ¥<text class="price">{{ refundData.info.refundPrice }}</text>
-            </view>
-          </view>
         </view>
       </view>
+
+			<view class="content-box price-detail">
+				<div class="module-com input-line-wrap">
+					<tui-list-cell class="line-cell" :hover="false">
+						<div class="tui-title">订单原价</div>
+						<div class="detail-price_box">¥{{ prePrice }}</div>
+					</tui-list-cell>
+					<tui-list-cell class="line-cell" :hover="false" v-if="discountType == 4">
+						<div class="tui-title">红包优惠</div>
+						<div class="detail-price_box red"><text v-if="refundPrice == actPrice" style="margin-right:10rpx;">已退还</text>¥{{ discountAmount }}</div>
+					</tui-list-cell>
+					<tui-list-cell class="line-cell" :hover="false">
+						<div class="tui-title">实付金额</div>
+						<div class="detail-price_box">¥{{ actPrice }}</div>
+					</tui-list-cell>
+					<tui-list-cell class="line-cell" :hover="false">
+						<div class="tui-title">退款金额</div>
+						<div class="detail-price_box red">¥{{ refundPrice }}</div>
+					</tui-list-cell>
+				</div>
+			</view>
+
       <view v-if="detailInfo.remark !=''" class="content-box price-detail">
         <div class="module-com input-line-wrap">
           <tui-list-cell
@@ -59,6 +76,7 @@
           </tui-list-cell>
         </div>
       </view>
+
     </view>
   </view>
 </template>
@@ -73,11 +91,13 @@ export default {
   },
   data () {
     return {
-      refundData:{}
+      refundData:{},
+      prePrice:0,
+      actPrice:0,
+      discountType:0,
+      discountAmount:0,
+      refundPrice:0
     };
-  },
-  onShow () {
-
   },
   onPullDownRefresh() {
 			this.initData().then(res => {
@@ -91,6 +111,17 @@ export default {
     async initData () {
       return getRefundData({ cgId: this.option.id }).then(res => {
         this.refundData = res.data
+        this.prePrice = res.data.cgInfo.prePrice
+        this.discountType = res.data.cgInfo.discountType
+        this.discountAmount = res.data.cgInfo.discountAmount
+        if(this.discountType == 4){
+          let actPrice = (Number(res.data.cgInfo.prePrice) - Number(res.data.cgInfo.discountAmount)).toFixed(2)
+          this.actPrice = parseFloat(actPrice)
+        }else{
+          this.actPrice = parseFloat(res.data.cgInfo.actPrice)
+        }
+        
+        this.refundPrice = res.data.info.refundPrice
         this.$forceUpdate()
       })
     }
@@ -195,9 +226,13 @@ export default {
             justify-content: space-between;
             align-items: flex-end;
             .item-name {
-              color: #666;
+              color: #444444;
               font-size: 30px;
               font-weight: 700;
+              overflow: hidden;
+              text-overflow:ellipsis;
+              white-space: nowrap;
+              width:320rpx;
             }
             .item-price {
               color: #333;