zhengkaixin пре 4 година
родитељ
комит
8bea163073

+ 20 - 5
bobo-router/index.js

@@ -13,16 +13,31 @@ Vue.use(uniCrazyRouter)
 //**  后续操作,访问的是 uniCrazyRouter的前置守卫
 
 
-uniCrazyRouter.beforeEach(async (to, from, next) => {
-
-	// 逻辑代码
-	console.log("beforeEach")
-	routerBeforeEach(to, from, next);
+uniCrazyRouter.beforeEach(async (to, from, next) => {
+	// 逻辑代码
+	console.log("beforeEach")
+	
+	if(to.url==from.url){
+		
+		var url="pages/index/index";
+		if(to.url.indexOf("pages/order")==0){
+			url="pages/order/index";
+		}
+		if(to.url.indexOf("pages/wallet")==0){
+			url="pages/wallet/index";
+		}
+		
+		window.location.href=window.location.href.split('#')[0]+"#/"+url
+	}else{
+		routerBeforeEach(to, from, next);
+	}
+	
 })
 
 uniCrazyRouter.afterEach((to, from) => {
 	// 逻辑代码
 	console.log("afterEach")
+	
 	if(process.car.NODE_ENV=='dev'||process.car.NODE_ENV=='test'){
 		    uni.setNavigationBarTitle({
 		       		title:'车信达('+process.car.NODE_ENV+')',

+ 3 - 2
pages/order/index.js

@@ -2,7 +2,8 @@ import * as API  from '@/apis/merchant.js'
 
 export default {
 	data() {
-		return {
+		return {
+			isLoading:false,
 			thisyear: 0,
 			params: {
 				year: true,
@@ -92,7 +93,7 @@ export default {
 				dateStr:this.selectForm.select3,
 			}
 			API.profitList(obj).then(response => {
-				 
+				  this.isLoading=true;
 				// selectList1
 				this.profitList = response.data;
 				this.$refs.common.showLoading(false);

+ 7 - 0
pages/order/index.vue

@@ -20,6 +20,13 @@
 					<u-cell-group>
 						<u-cell-item v-for="item,i in profitList.list" :key="i" :title="item.dateDesc" :value="'+'+item.revenue"  @click="gotoUrl(item.dateDesc)" ></u-cell-item>
 					</u-cell-group>
+					
+					<view  v-if="isLoading&&profitList.list&&profitList.list.length==0" style="text-align:center;margin-top: 40px;" >
+						<img src="static/img/null.png" style="width: 50%;" alt="" >
+						<view>暂无数据</view>
+					 
+					</view>
+					
 				</view>
 				 
 			</view>

+ 5 - 4
pages/order/list.js

@@ -2,7 +2,8 @@ import * as API  from '@/apis/merchant.js'
 
 export default {
 	data() {
-		return {
+		return {
+			isLoading:false,
 			thisyear: 0,
 			 clientHeight:0,
 			show1: false,
@@ -114,7 +115,7 @@ export default {
 				...this.listForm
 			}
 			API.sellList(obj).then(response => {
-				 
+				  this.isLoading=true;
 				if (response) {
 					if (this.listForm.pageIndex == 1) {
 						this.recordList = response.data.data;
@@ -160,8 +161,8 @@ export default {
 		},
 		show3confirm(op) {
 			var i = op[0];
-			this.selectForm.select2Index=i;
-			var obj = this.selectList2[i]
+			this.selectForm.select3Index=i;
+			var obj = this.selectList3[i]
 			
 			this.selectForm.select3 = obj.id;
 			this.selectForm.select3Name = obj.name;

+ 6 - 1
pages/order/list.vue

@@ -15,7 +15,11 @@
 			<navigator@click="show3=true" >{{selectForm.select3Name}}<text class="icon iconfont icon-xiajiantou"></text></navigator>
 		</view>
 			<view class="von-sp">
-				<scroll-view   :style="'height: '+clientHeight+'px;'"   scroll-y="true"     @scrolltolower="lower">
+				<view  v-if="isLoading&&recordList&&recordList.length==0" style="text-align:center;margin-top: 120px;" >
+					<img src="static/img/null.png" style="width: 50%;" alt="" >
+					<view>暂无数据</view>
+				</view>
+				<scroll-view   v-if="recordList&&recordList.length" :style="'height: '+clientHeight+'px;'"   scroll-y="true"     @scrolltolower="lower">
 				<!-- blue支付宝 green微信支付 orange现金购票 red纸质车票 -->
 					<view class="von-sp-list" v-for="item,i in recordList" :key="i" @click="gotoUrl(item)">
 						<h5 class="flex-sp">订单编号:{{item.outOrderNo}}<text class="green">{{item.payNameStr}}</text></h5>
@@ -26,6 +30,7 @@
 						</view>
 					</view>
 				</scroll-view>
+				
 			</view>
 		</view>
 	</view>

+ 3 - 2
pages/wallet/info.vue

@@ -4,17 +4,18 @@
 		<u-navbar   title="记录详情" :is-back="true" >
 				<view class="slot-wrap"></view>	
 		</u-navbar>
-			<scroll-view  >
+			
 					<view class="von-sp-list von-zj-info">
 						<h5 class="flex-spal">{{info.name}}<h1>{{info.amount}}</h1></h5>
 						<view class="von-sp-text">
 							<p class="flex-sp"><text>交易类型</text>{{info.name}}</p>
+							<p class="flex-sp"><text>申请状态</text><text :style="info.status=='1'?'color: green;':'color: orange;'">{{info.statusStr}}</text></p>
 							<p class="flex-sp"><text>交易时间</text>{{info.time}}</p>
 							<p class="flex-sp"><text>流水单号</text>{{info.withdrawalNo}}</p>
 							<p class="flex-sp"><text>备注</text>{{info.remark}}</p>
 						</view>
 					</view>
-				</scroll-view>
+				
 	</view>
 </template>
 

+ 2 - 2
pages/wallet/list.js

@@ -3,7 +3,7 @@ import * as API  from '@/apis/merchant.js'
 export default {
 	data() {
 		return {
-			
+			isLoading:false,
 			 clientHeight:0,
 			
 		    
@@ -37,7 +37,7 @@ export default {
 			this.$refs.common.showLoading();
 			 
 			API.withdrawalRecordList(this.listForm).then(response => {
-				 
+				 this.isLoading=true;
 				if (response) {
 					if (this.listForm.pageIndex == 1) {
 						this.recordList = response.data.data;

+ 13 - 5
pages/wallet/list.vue

@@ -5,16 +5,24 @@
 				<view class="slot-wrap"></view>	
 		</u-navbar>
 		<view class="von-zj-list">
-			<view class="zj-list-item flex-spal">
+			<view  v-if="isLoading&&recordList&&recordList.length==0" style="text-align:center;margin-top: 120px;" >
+				<img src="static/img/null.png" style="width: 50%;" alt="" >
+				<view>暂无数据</view>
+			</view>
+			
+			<scroll-view  v-if="recordList&&recordList.length"  :style="'height: '+clientHeight+'px;'"   scroll-y="true"     @scrolltolower="lower">
+			
+			<view class="zj-list-item flex-spal" v-for="item,i in recordList"  @click="gotoUrl(item)" :key="i" >
 				<view>
-					<h4>账户提现<text class="orange">(待转账)</text></h4>
-					<h6>2021-03-02 12:30:20</h6>
+					<h4>{{item.name}}<text :class="item.status=='1'?'green':'orange'">({{item.statusStr}})</text></h4>
+					<h6>{{item.time}}</h6>
 				</view>
 				<view>
-					-1000<text class="icon iconfont icon-ico_listarrow"></text>
+					{{item.amount}}<text class="icon iconfont icon-ico_listarrow"></text>
 				</view>
 			</view>
-			<view class="zj-list-item flex-spal">
+				</scroll-view>
+			<view class="zj-list-item flex-spal" v-if="false">
 				<view>
 					<h4>账户提现<text class="green">((转账成功))</text></h4>
 					<h6>2021-03-02 12:30:20</h6>

+ 49 - 2
pages/wallet/out.js

@@ -3,6 +3,7 @@ import * as API  from '@/apis/merchant.js'
 	export default {
 		data() {
 			return {
+				txbool:false,
 				txAmount:'',
 				myAccount:{
 					account:{}
@@ -11,6 +12,39 @@ import * as API  from '@/apis/merchant.js'
 		},
 		
 		methods: { 
+			myerror(){
+				this.$refs.common.alert("每周"+this.showday(this.myAccount.date)+"可申请将账户内资金提现至银行卡;");
+				
+			},
+			myerror2(){
+				this.$refs.common.alert("请输入提现金额");
+				
+			},
+			showday(num){
+				 if(num==1){
+					 return "一"
+				 }
+				 if(num==2){
+				 					 return "二"
+				 }
+				 if(num==3){
+				 					 return "三"
+				 }
+				 if(num==4){
+				 					 return "四"
+				 }
+				 if(num==5){
+				 					 return "五"
+				 }
+				 if(num==6){
+				 					 return "六"
+				 }
+				 if(num==7){
+				 					 return "日"
+				 }
+				 
+				return ""
+			},
 			show(num){
 				if(num){
 					var i =num.length
@@ -31,9 +65,14 @@ import * as API  from '@/apis/merchant.js'
 		 
 			 getWithdrawalSubmit(){
 				 if(!this.txAmount){
-					 this.$refs.common.aler("请填写金额");
+					 this.$refs.common.alert("请填写金额");
 					 return  
 				 }
+				 
+				 if(this.txAmount==0){
+				 					 this.$refs.common.alert("请填写金额");
+				 					 return  
+				 }
 				 this.$refs.common.showLoading()
 				 	API.withdrawalSubmit(this.txAmount).then(response => {
 				 	
@@ -57,7 +96,15 @@ import * as API  from '@/apis/merchant.js'
 					API.myAccount().then(response => {
 					
 						  this.myAccount=response.data
-						 
+						 var d=new Date();
+						 	var week=d.getDay();
+							
+							if(this.myAccount.date==week){
+								this.txbool=true;
+							}
+							if(this.myAccount.date==7&&week==0){
+								this.txbool=true;
+							}
 					this.$refs.common.showLoading(false);
 				
 					}).catch(error => {					

+ 7 - 3
pages/wallet/out.vue

@@ -20,13 +20,17 @@
 				</view>
 				<h5 class="flex-sp">可提现余额¥{{myAccount.withdrawalAmount}}<navigator class="blue" @click="txAmount=myAccount.withdrawalAmount">全部提现</navigator></h5>
 			</view>
-			<u-button type="primary" @click="getWithdrawalSubmit">次日到账,确认提现</u-button>
+			<u-button type="primary" style="background-color: #9DC6FF;" @click="myerror"  v-if="!txbool">次日到账,确认提现</u-button>
+			
+			<u-button type="primary" style="background-color: #9DC6FF;"  @click="myerror2"  v-if="txbool&&!txAmount">次日到账,确认提现</u-button>
+			
+			<u-button type="primary"  @click="getWithdrawalSubmit" v-if="txbool&&txAmount" >次日到账,确认提现</u-button>
 			<view class="von-tx-text">
 				<p>提现说明:</p>
-				<p v-html="myAccount.message?myAccount.message:'1.每周一可申请将账户内收益提现至银行卡;'"></p>
+				<p >1.每周{{showday(myAccount.date)}}可申请将账户内资金提现至银行卡;</p>
 				<p>2.由于银行清算,提现申请将于次日内到账。如遇高峰期,可能延时到账,请耐心等待。</p>
 			</view>
-		</view>
+		</view> 
 	</view>
 </template>