| <template> | |
| 	<view class="u-page se-w-vw-100"> | |
| 		<view v-if="!isLogin" class="se-flex se-flex-h-e se-p-20"> | |
| 			<u-button style="background-color: #FF7A31;color: #fff;" @click="goLogin">登录</u-button> | |
| 		</view> | |
| 		 | |
| 		 | |
| 		<template v-else> | |
| 			<u-subsection bg-color="#ff7a31" button-color="#f0b744" active-color="#ff7a31" inactive-color="#ffffff" :list="list" :current="current" @change="sectionChange"></u-subsection> | |
| 			<!--  招聘订单 --> | |
| 			<enterpriseBox ref="enterpriseBoxRef" v-if="current==0" /> | |
| 			<!--求职订单  --> | |
| 			<masterBox ref="masterBoxRef" v-if="current==1" /> | |
| 		</template> | |
| 		 | |
| 	</view> | |
| </template> | |
| 
 | |
| <script> | |
| 	import masterBox from "./component/master.vue" | |
| 	import enterpriseBox from "./component/enterprise.vue" | |
| 	 | |
| 	export default{ | |
| 		components:{ | |
| 			enterpriseBox, | |
| 			masterBox | |
| 		}, | |
| 		data(){ | |
| 			return{ | |
| 				list: [ | |
| 					{ | |
| 						name: '招聘订单' | |
| 					}, | |
| 					{ | |
| 						name: '求职订单' | |
| 					} | |
| 				], | |
| 				current: 0, | |
| 				isLogin: !!uni.getStorageSync('token') | |
| 			} | |
| 		}, | |
| 		onShow() { | |
| 			this.isLogin = !!uni.getStorageSync('token') | |
| 			if(this.current==0){ | |
| 				this.$refs.enterpriseBoxRef.onRefresh(); | |
| 			}else if(this.current==1){ | |
| 				this.$refs.masterBoxRef.onRefresh(); | |
| 			} | |
| 		}, | |
| 		onReachBottom() { | |
| 			if(this.current==0){ | |
| 				this.$refs.enterpriseBoxRef.onReach(); | |
| 			}else if(this.current==1){ | |
| 				this.$refs.masterBoxRef.onReach(); | |
| 			} | |
| 		}, | |
| 		onPullDownRefresh() { | |
| 			if(this.current==0){ | |
| 				this.$refs.enterpriseBoxRef.onRefresh(); | |
| 			}else if(this.current==1){ | |
| 				this.$refs.masterBoxRef.onRefresh(); | |
| 			} | |
| 		}, | |
| 		methods:{ | |
| 			sectionChange(index){ | |
| 				this.current=index | |
| 			}, | |
| 			goLogin(){ | |
| 				uni.navigateTo({ url: '/pages/auth/index' }) | |
| 			} | |
| 		} | |
| 	} | |
| </script> | |
| 
 | |
| <style> | |
| </style> |