<template>
	<view class="riderr_login">
		<view class="rider_type">
			<view class="type_name">请选择发布类型</view>
			<!-- <view class="type_tit">请选择您是那种类型</view> -->
		</view>
		<view class="type_box" v-for="(item,index) in list" :key="item.id" @click="bindrider(item.name)">
			<view class="name">{{item.name}}</view>
			<view class="icon">
				<u-icon name="arrow-right"></u-icon>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [{
					id: 1,
					name: '个人发布'
				}, {
					id: 2,
					name: '企业发布'
				}],
				Qe: 0,
				geRen: 0,
				renzheng: false
			}
		},
		onLoad() {
			this.Qe = uni.getStorageSync("Qe")
			this.geRen = uni.getStorageSync("geRen")
			if (this.Qe == 2 || this.geRen == 2) {
				this.renzheng = false
			} else {
				this.renzheng = true
			}
		},
		methods: {
			bindrider(name) {
				console.log(name)
				if (name == '个人发布') {
					if (this.renzheng) {
						uni.showModal({
							title: '提示',
							content: '您还未认证,请先认证',
							success(res) {
								if (res.confirm) {
									uni.navigateTo({
										url: "/my/renzheng/index?classify=" + 1
									})
								}
							}
						})
						return
					} else {
						uni.navigateTo({
							url: '/my/publish/editor?'
						})
					}

				} else if (name == '企业发布') {
					if (this.renzheng) {
						uni.showModal({
							title: '提示',
							content: '您还未认证,请先认证',
							success(res) {
								if (res.confirm) {
									uni.navigateTo({
										url: "/my/renzheng/index?classify=" + 2
									})
								}
							}
						})
						return
					} else {
						uni.navigateTo({
							url: '/my/publish/firm'
						})
					}


				}
			}
		}
	}
</script>

<style>
	.riderr_login {
		width: 100%;
	}

	.rider_type {
		width: 90%;
		margin: 0 auto;
		margin-top: 50rpx;
		margin-bottom: 135rpx;
	}

	.type_name {
		font-size: 38rpx;
		font-weight: bold;
		letter-spacing: 2rpx;
	}

	.type_tit {
		color: #999999;
		font-size: 21rpx;
		margin-top: 10rpx;
	}

	.type_box {
		width: 90%;
		margin: 0 auto;
		height: 110rpx;
		background: #F2F2F2;
		display: flex;
		margin-bottom: 20rpx;
		border-radius: 18rpx;
	}

	.name {
		flex: 1;
		font-size: 30rpx;
		color: black;
		display: flex;
		justify-content: left;
		align-items: center;
		margin-left: 60rpx;
	}

	.icon {
		flex: 1;
		display: flex;
		justify-content: flex-end;
		align-items: center;
		margin-right: 30rpx;
	}

	.icon image {
		width: 15rpx;
		height: 25rpx;
	}
</style>
