guo il y a 3 ans
Parent
commit
5798ab643d

+ 4 - 0
pages/order/myorder.vue

@@ -316,4 +316,8 @@
 		color: #FF4F00;
 		margin-left: 40rpx;
 	}
+	.orderState{
+		color: #F19D01;
+		font-size: 24rpx;
+	}
 </style>

+ 1 - 1
pages/order/orderDetail.vue

@@ -515,7 +515,7 @@
 			refundMoney(){
 				console.log('退款');
 				uni.navigateTo({
-					url:'../refundMoney/refundMoney?id='+this.id +'&maxMoney=' + this.orderData.PayMoney
+					url:'../refundMoney/refundMoney?sheetId='+this.id +'&maxMoney=' + this.orderData.PayMoney
 				})
 			},
 			orderPay() {

+ 106 - 22
pages/refundMoney/refundMoney.vue

@@ -33,6 +33,11 @@
 					class="textareaCont" maxlength="-1" auto-height="true" @confirm="feedDone" />
 
 			</view>
+
+			<view class="bottom">
+				<view class="shoreDz" @click="submit">提交</view>
+			</view>
+
 		</view>
 	</view>
 </template>
@@ -40,41 +45,95 @@
 <script>
 	export default {
 		data() {
-			return {
-				id:'',
+			return {
+				sheetId: '',
 				reasonArray: [],
 				firstIndex: null,
-				reasonId: '',
+				reasonId: '',
 				maxMoney: '',
 				money: '',
 				exeContent: '',
 			}
 		},
-		onLoad(opt) {
-			this.id = opt.id;
+		onLoad(opt) {
+			this.sheetId = opt.sheetId;
 			this.maxMoney = opt.maxMoney;
 			this.getRefundData();
 		},
-		methods: {
-			getRefundData() {
-				uni.showLoading({
-					title: '加载中'
-				})
-				let url = 'worldKeepCar/orderRefund/refuseReasonList',
-					params = {
-						type: 3,
-			
-					}
-				this.$http(url, params, 'GET').then(res => {
-			
+		methods: {
+			submit() {
+				if (this.reasonId == '') {
+					uni.showToast({
+						title: '请选择退款原因',
+						icon: 'none',
+						duration: 2000,
+					});
+					return ;
+				}
+				if (this.money==0) {
+					uni.showToast({
+						title: '请输入退款金额',
+						icon: 'none',
+						duration: 2000,
+					});
+					return ;
+				}
+				if (this.money > this.maxMoney) {
+					uni.showToast({
+						title: '退款金额不能大于最大可退金额',
+						icon: 'none',
+						duration: 2000,
+					});
+					return ;
+				}
+				
+				uni.showLoading({});
+				
+				this.$http('worldKeepCar/orderRefund/applyRefund', {
+					sheetId:this.sheetId,
+					applyReasonId:this.reasonId,
+					applyReason:this.reasonArray[this.firstIndex].contents,
+					money:this.money,
+					reasonComment: this.exeContent,
+					
+				}, 'POST').then(res => {
 					uni.hideLoading();
-			
-			
-					this.reasonArray = res.data
-					console.log(this.reasonArray);
+					if(res.code==0){
+						uni.showToast({
+							title: '提交成功',
+							icon: 'none',
+							duration: 2000,
+						});
+						setTimeout(function() {
+							uni.navigateBack({
+								
+							})
+						}, 2000); 	
+					}
+					
+					
 			
 				})
 			},
+			getRefundData() {
+				uni.showLoading({
+					title: '加载中'
+				})
+				let url = 'worldKeepCar/orderRefund/refuseReasonList',
+					params = {
+						type: 3,
+
+					}
+				this.$http(url, params, 'GET').then(res => {
+
+					uni.hideLoading();
+
+
+					this.reasonArray = res.data
+					console.log(this.reasonArray);
+
+				})
+			},
 			feedDone(e) {
 				this.exeContent = e.target.value
 
@@ -82,7 +141,7 @@
 			reasonChange(e) {
 
 				this.firstIndex = e.target.value
-				this.reasonId = this.reasonArray[this.firstIndex].ID
+				this.reasonId = this.reasonArray[this.firstIndex].id
 
 			},
 		}
@@ -156,4 +215,29 @@
 		padding: 30rpx 0;
 
 	}
+
+	.bottom {
+		width: 750rpx;
+		height: 120rpx;
+		background: #FFFFFF;
+		box-shadow: 0px -4px 8px 0px rgba(153, 153, 153, 0.08);
+		position: fixed;
+		left: 0;
+		bottom: 0;
+		display: flex;
+		justify-content: space-around;
+	}
+
+	.shoreDz {
+		width: 702rpx;
+		height: 74rpx;
+
+		background: linear-gradient(135deg, #FD5300 0%, #FF270A 100%);
+		border-radius: 37rpx;
+		text-align: center;
+		line-height: 74rpx;
+		color: #FFFFFF;
+		font-size: 30rpx;
+		margin-top: 24rpx;
+	}
 </style>

Fichier diff supprimé car celui-ci est trop grand
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/order/orderDetail.js.map


+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/order/orderDetail.js

@@ -716,7 +716,7 @@ __webpack_require__.r(__webpack_exports__);
     refundMoney: function refundMoney() {
       console.log('退款');
       uni.navigateTo({
-        url: '../refundMoney/refundMoney?id=' + this.id + '&maxMoney=' + this.orderData.PayMoney });
+        url: '../refundMoney/refundMoney?sheetId=' + this.id + '&maxMoney=' + this.orderData.PayMoney });
 
     },
     orderPay: function orderPay() {