<template>
	<view>
		<u-navbar back-text="发布"  back-icon-size="0"  :customBack="customBack" back-icon-color="#ffffff" :background="{backgroundColor: '#2795FD',}"
			:back-text-style="{color: '#ffffff'}"></u-navbar>

		<view class="main">
			<view class="title">
				选择您要发布的信息
			</view>
			<view class="headline">
				您好，欢迎来到荆开零工驿站
			</view>
			<view class="card" @click="toMyJobInformation">
				<view class="icon">
					<img src="@/assets/img/issue1@1x.png" alt="">
				</view>
				<view class="card-title">
					<view class="title1">
						求职信息
					</view>
					<view class="title2">
						坐等好工作来找你
					</view>
				</view>

				<view class="right">
					<u-icon name="arrow-right" color="#D6D6D6"></u-icon>
				</view>
			</view>

			<view class="card" @click="toLaborManagement">
				<view class="icon">
					<img src="@/assets/img/issue2@1x.png" alt="">
				</view>
				<view class="card-title">
					<view class="title1">
						招工信息
					</view>
					<view class="title2">
						精准满足用工需求
					</view>
				</view>

				<view class="right">
					<u-icon name="arrow-right" color="#D6D6D6"></u-icon>
				</view>
			</view>

			<view class="card" @click="toPostMessage">
				<view class="icon">
					<img src="@/assets/img/issue3@1x.png" alt="">
				</view>
				<view class="card-title">
					<view class="title1">
						共享用工
					</view>
					<view class="title2">
						发布共享公共信息
					</view>
				</view>

				<view class="right">
					<u-icon name="arrow-right" color="#D6D6D6"></u-icon>
				</view>
			</view>

		</view>

		
 <tabbar  :current="2"></tabbar>
	</view>

</template>

<script>
	import * as API from '@/apis/pagejs/tab.js'
	import tabbar from "@/components/Tabbar.vue"
	
	export default {
		components: {
		tabbar

		},
		data() {
			return {

			}
		},
		methods: {
			customBack(){
				
			},
			ck1(){
				var user = this.carhelp.getPersonInfo();
				
				if (!user) {
					uni.showModal({
						title: '提示',
						content: '当前操作需要登录',
						confirmText: "前往登录",
						showCancel: true,
						success: function(res) {
							if (res.confirm) {
								uni.navigateTo({
									url: '/pages/tab/mine/mine'
								})
				
							} else if (res.cancel) {
								//.log('用户点击取消');
							}
						}
					});
					return false
				}
				return true
			},
			ck2(){
				var user = this.carhelp.getPersonInfo();
				
				if (user.status != 1) {
					uni.showModal({
						title: '提示',
						content: '当前操作需要实名认证',
						confirmText: "实名认证",
						showCancel: true,
						success: function(res) {
							if (res.confirm) {
								uni.navigateTo({
									url: '/pages/packages/mine/otherServices/authentication'
								})
				
							} else if (res.cancel) {
								//.log('用户点击取消');
							}
						}
					});
					return false
				}
				return true
			},
			ck3(){
				var enterpriseInfo=this.carhelp.getPersonInfoPlus().enterpriseInfo;
				
				if (!enterpriseInfo||enterpriseInfo.status!=1) {
					uni.showModal({
						title: '提示',
						content: '当前操作需要进行企业认证',
						confirmText:"企业认证",
						showCancel: true,
						success: function(res) {
							if (res.confirm) {
								uni.navigateTo({
									url:'/pages/packages/mine/otherServices/authentication'
								})
								
							} else if (res.cancel) {
								//.log('用户点击取消');
							}
						}
					});
					return false
				}
				return true
			},
			toMyJobInformation() {
				
				if(this.ck1()){
					
				}else{
					return
				}
				
				uni.navigateTo({
					url: '/pages/packages/mine/myJobInformation/myJobInformation'
				})
			},
			toLaborManagement() {
				if(this.ck1()&&this.ck3()){
					
				}else{
					return
				}
				uni.navigateTo({
					url: '/pages/packages/mine/employmentService/laborManagement/postMessage'
				})
			},
			toPostMessage() {
				if(this.ck1()&&this.ck3()){
					
				}else{
					return
				}
				uni.navigateTo({
					url: '/pages/packages/mine/employmentService/postMessage'
				})
			},
		}
	}
</script>
<style>
	page {
		padding-bottom: 100px;
	}
</style>
<style scoped lang="scss">
	.main {
		padding: 96rpx 32rpx;

		.title {
			color: rgba(16, 16, 16, 1);
			font-size: 48rpx;
			font-family: 'PingFangSC-medium';
			line-height: 48rpx;
		}

		.headline {
			margin-top: 12rpx;
			line-height: 48rpx;
			color: rgba(119, 119, 119, 1);
			margin-bottom: 60rpx;
		}

		.card {
			display: flex;
			align-items: center;
			padding: 32rpx;
			border-radius: 12px;
			margin-bottom: 40rpx;
			background-color: rgba(245, 250, 255, 1);

			.icon {
				width: 136rpx;
				height: 136rpx;

				img {
					width: 100%;
					height: 100%;
				}
			}

			.card-title {
				margin-left: 40rpx;

				.title1 {
					color: rgba(16, 16, 16, 1);
					font-size: 36rpx;
					font-family: 'PingFangSC-medium';
				}

				.title2 {
					color: rgba(119, 119, 119, 1);
					margin-top: 8rpx;
				}
			}

			.right {
				margin-left: auto;
			}
		}

	}
</style>