Explorar el Código

修改提现逻辑、明细样式

baipiao hace 2 semanas
padre
commit
4c7b1e294c

+ 84 - 27
pages/referral/extractList.vue

@@ -18,13 +18,24 @@
 	 		 </view>
 	 </view>
 	 <view class="linetop" v-if="type==2">
-		 <view class="name">提现金额:{{item.applyMoney}}</view>
-		 <view class="lineTIme" :style="[
-			  item.applyState === 2 && { color: 'rgb(7, 183, 91)' },
-			  item.applyState === 0 && { color: 'rgb(255, 102, 0)' },
-			  item.applyState === 1 && { color: 'red' }
-			]"
-		>{{jkstateMap[~~item.applyState]}}</view>
+		 <view class="name">提现金额:{{item.applyMoney.toFixed(2)}}</view>
+		 
+		 <view class="resultTitle">
+		 	<span v-if="item.cashType !=2 && item.cashState==3">线上打款/打款成功</span>
+			<span v-if="item.cashType !=2 && item.cashState==2">线上打款/打款失败</span>
+			<span v-if="item.cashType !=2 && item.cashState==1">线上打款/打款中</span>
+			<span v-if="item.cashType !=2 && item.cashState==0">线上打款/未打款</span>
+			<span v-if="item.cashType ==2 && item.cashState==3">线下打款/打款成功</span>
+			<span v-if="item.cashType ==2 && item.cashState==2">线下打款/打款失败</span>
+			<span v-if="item.cashType ==2 && item.cashState==1">线下打款/打款中</span>
+			<span v-if="item.cashType ==2 && item.cashState==0">线下打款/未打款</span>
+		 </view>
+		 
+		 <view class="lineTIme jkButton" @click="getMoney(item)" v-if="(item.applyState == 2 && item.cashState == 0 && item.cashType == 0) ||(item.applyState == 2 && item.cashState == 1 && item.cashType == 0)">确认收款</view>
+		 <!-- <view class="lineTIme jkButton"  v-if="item.applyState == 2 && item.cashState == 1 && item.cashType == 0">提现中</view>
+		 <view class="lineTIme jkButton"  v-if="item.applyState == 2 && item.cashState == 2 && item.cashType == 0">提现失败</view>
+		 <view class="lineTIme jkButton"  v-if="item.applyState == 2 && item.cashState == 3 && item.cashType == 0">已提现</view>
+		 <view class="lineTIme jkButton"  v-if="item.applyState == 2 && item.cashType == 1">线下打款</view> -->
 	 </view>
 	 
 	 <view class="lineCOnt" v-if="type==2">
@@ -32,12 +43,13 @@
 	 		 	<view class="lineContLeft">
 	 				 <view class="lineContLeftMs">申请时间:{{item.applyTime}}</view>
 	 		 	</view>
-	 			<view class="lineTIme jkButton" @click="getMoney(item)" v-if="item.applyState == 2 && item.cashState == 0 && item.cashType == 0">去提现</view>
-				<view class="lineTIme jkButton"  v-if="item.applyState == 2 && item.cashState == 1 && item.cashType == 0">提现中</view>
-				<view class="lineTIme jkButton"  v-if="item.applyState == 2 && item.cashState == 2 && item.cashType == 0">提现失败</view>
-				<view class="lineTIme jkButton"  v-if="item.applyState == 2 && item.cashState == 3 && item.cashType == 0">已提现</view>
-				<view class="lineTIme jkButton"  v-if="item.applyState == 2 && item.cashType == 1">线下打款</view>
-				
+	 			
+				<view class="lineTIme" :style="[
+					  item.applyState === 2 && { color: '#4FDF23' },
+					  item.applyState === 0 && { color: 'red' },
+					  item.applyState === 1 && { color: '#7F7E7E' }
+					]"
+				>{{jkstateMap[~~item.applyState]}}</view>
 	 		 </view>
 	 		
 	 </view>
@@ -128,7 +140,7 @@
 				uni.showLoading({
 					title: '加载中'
 				})
-				if(jk.cashState == 0){
+				if(jk.cashState == 0 || jk.cashState == 1){
 					this.money = jk.applyMoney
 					this.$http('jkCashout/jkCashout', {
 					    jkcashid:jk.id
@@ -152,6 +164,9 @@
 							uni.showLoading({
 								title: res.msg
 							})
+							setTimeout(() => {
+							  uni.hideLoading()
+							}, 2000)
 						}
 					})
 				}else{
@@ -177,15 +192,25 @@
 						this.stopInterval();
 						this.getWechatMoney();
 					}
-					if(res.code == 0 && res.data.state =='SUCCESS'){
+					else if(res.code == 0 && res.data.state =='SUCCESS'){
 						//成功页面
 						console.log("领取成功-跳转成功页面");
 						this.goRouter('../subPack/extractSuccess?money='+this.money);
 					}
-					if(res.code == 0 && res.data.state =='FAIL'){
+					else if(res.code == 0 && res.data.state =='FAIL'){
 						//失败页面
 						console.log("领取失败-跳转失败页面");
 						this.goRouter('../subPack/extractFail?money='+this.money)
+					}else if(res.code == 1){
+						uni.showToast({
+							title: res.msg,
+							icon: 'error',
+							duration: 3000,
+						});
+						this.stopInterval();
+					}else{
+						this.stopInterval();
+						uni.hideLoading();
 					}
 				})
 			},
@@ -197,19 +222,42 @@
 				      package: this.packageInfo,
 				      success: (res) => {
 				        // res.err_msg将在页面展示成功后返回应用时返回ok,并不代表付款成功
-						console.log(res);
-						 if (res.errMsg === 'requestMerchantTransfer:ok') {
-						              // res.err_msg将在页面展示成功后返回应用时返回success,并不代表付款成功
-									  this.checkJkCashoutState();
+						if (res.errMsg === 'requestMerchantTransfer:ok') {
+							 //展示页面成功
+							this.checkJkCashoutState();
+						}
+						if (res.errMsg === 'requestMerchantTransfer:fail') {
+							//展示页面失败
+							this.stopInterval()
+							this.getWechatMoney();
+						}
+						if (res.errMsg === 'requestMerchantTransfer:cancel') {
+							//用户点击取消
+							console.log("用户取消");
+							this.stopInterval()
+							//this.userCancelMoney();
 						}
 						
 				      },
 				      fail: (res) => {
-						 
+						  console.log(res);
+						 if (res.errMsg === 'requestMerchantTransfer:fail:internal error') {
+						 	//用户点击取消
+						 	this.stopInterval()
+						 	//this.userCancelMoney();
+						 }
 				      }
 				    });
 				}
-			}
+			},
+			  userCancelMoney(){
+				  //用户取消提现 outBatchNo:this.outBatchNo,
+				  this.$http('jkCashout/failJkCashout', {
+					 jkcashid:this.jkcashid
+				  }, 'POST').then(res => {
+					
+				 })
+			  }
 		},
 		onReachBottom(){
 			//this.page++;
@@ -284,13 +332,22 @@
 }
 .lineContLeft{
 	display: flex;
+	
 }
 .lineTIme{
 	font-size: 28rpx;
+	padding-right: 10rpx;
 }
 .name{
 	font-weight: 500;
-	color: #3C3C3C;
+	color: #999999;
+	width: 300rpx;
+}
+.resultTitle{
+	position: absolute;
+	color: darkorange;
+	left: 320rpx;
+	font-size: 28rpx;
 }
 .amount{
 	color: #EC0F0A;
@@ -300,14 +357,14 @@
 	height: 30rpx;
 }
 .jkButton{
-	color: #ffffff;
+	color: black;
 	font-size: 28rpx;
-	border: 1rpx solid rgb(  7,183, 91);
-	background-color: rgb(  7,183, 91);
+	border: 1rpx solid #999999;
+	background-color: #ffffff;
 	width: 120rpx;
 	height: 40rpx;
 	text-align: center;
 	line-height: 40rpx;
-	border-radius: 50rpx;
+	border-radius: 10rpx;
 }
 </style>

+ 1 - 1
pages/subPack/extractFail.vue

@@ -12,7 +12,7 @@
 		<span class="box-money-num">{{money}}</span>
 	</view>
 	<view class="box-sm">
-		请联系管理员
+		请重新发起申请或者联系门店
 	</view>
 		
 	<view class="backButton" style="display: none;" @click="goRouter('promotion')">

+ 1 - 1
pages/subPack/promotion.vue

@@ -11,7 +11,7 @@
 		</view>
 		<view class="top-row" style="border-top: solid 3rpx #FFA68A;">
 			<view class="numLine">总收益:{{sumMoney.toFixed(2)}}</view>
-			<!-- <view class="numLine">提现中:{{inMoney}}</view> -->
+			<view class="numLine">提现中:{{inMoney.toFixed(2)}}</view>
 			<view class="numLine">已到账:{{alreadyMoney.toFixed(2)}}</view>
 		</view>
 	</view>

+ 37 - 3
pages/subPack/promotionExtract.vue

@@ -233,9 +233,16 @@
 						clearTimeout(this.timer);
 			       		this.goRouter('../subPack/extractFail?money='+this.money)
 			       	}else if(res.code == 1){
+						
+						uni.showToast({
+							title: res.msg,
+							icon: 'error',
+							duration: 3000,
+						});
 						clearTimeout(this.timer);
 					}
 					else{
+						console.log("else")
 						this.timer = setTimeout(this.checkOrderStatus, 2000);
 					}
 			       })
@@ -261,15 +268,42 @@
 			  	        // res.err_msg将在页面展示成功后返回应用时返回ok,并不代表付款成功
 			  			console.log(res);
 			  			 if (res.errMsg === 'requestMerchantTransfer:ok') {
-			  					this.checkOrderStatusMounted();
+							 //展示页面成功
+			  				this.checkOrderStatusMounted();
 			  			}
-			  			
+						if (res.errMsg === 'requestMerchantTransfer:fail') {
+							//展示页面失败
+							//this.checkOrderStatusMounted();
+						}
+						if (res.errMsg === 'requestMerchantTransfer:cancel') {
+							//用户点击取消
+							this.beforeDestroy();
+							//this.userCancelMoney();
+							this.goRouter('../referral/extractList?type=2');
+						}
 			  	      },
 			  	      fail: (res) => {
-			  			 
+						  console.log(res);
+			  			 if (res.errMsg === 'requestMerchantTransfer:fail:internal error') {
+			  			 	//用户点击取消
+			  			 	this.beforeDestroy();
+			  			 	//this.userCancelMoney();
+							this.goRouter('../referral/extractList?type=2');
+			  			 }
+						 
+						 
 			  	      }
 			  	    });
 			  	}
+			  },
+			  userCancelMoney(){
+				  //用户取消提现 outBatchNo:this.outBatchNo,
+				  
+				  this.$http('jkCashout/failJkCashout', {
+					 jkcashid:this.jkcashid
+				  }, 'POST').then(res => {
+					
+				 })
 			  }
 		}
 	}