<template>
	<view class="container">
		<view class="page">
			<text class="num actived pass">1</text>
			<text class="line line_pass"></text>
			<text class="num actived pass">2</text>
			<text class="line line_pass"></text>
			<text class="num actived pass">3</text>
			<text class="line line_pass"></text>
			<text class="num actived pass">4</text>
			<text class="line line_pass"></text>
			<text class="num actived pass">5</text>
			<text class="line line_pass"></text>
			<text class="num actived pass">6</text>
			<text class="line line_pass"></text>
 			<text class="num actived pass">7</text>
<!--			<text class="line line_pass"></text>
			<text class="num actived pass">8</text> -->
		</view>
		<view class="wrapper">
			<view class="iconfont icon-gou"></view>
			<h4>{{approvalStatus==3?'审批通过':'您已提交成功'}}</h4>
			<view class="result" v-if="this.partnerLevel=='P1' && approvalStatus==3">
				欢迎您加入{{companyName}} ！
			</view>
			<view class="result" v-if="this.partnerLevel=='A1' && approvalStatus==3">
				恭喜您成为 {{areaName}} 事业伙伴！
			</view>
			<view class="result" v-if="this.partnerLevel=='B1' && approvalStatus!=3">
				您的申请已进入人工审核，请耐心等待！
			</view>
			<view class="result" v-if="this.partnerLevel=='B1' && approvalStatus==3">
				欢迎您加入{{areaName}}！
			</view>
			<view class="">
				<view class="home" @click="toHome()">
					返回首页,开启新的篇章 >
				</view>
			<!-- 	<view class="" style="text-align: center;color: #20269B;" v-if="isH5">
					<text>请前往应用商店下载App</text>
				</view>
				<view class="home" v-else @click="toHome()">
					返回首页,开启新的篇章 >
				</view> -->
			</view>
		</view>
	</view>
</template>

<script>
		import api from '@/api/api';
		import {companyInfo} from "@/environments/environment";
		export default{
			data(){
				return {
					companyName: companyInfo.companyName,
					partnerLevel:null,
					areaName:null,
					approvalStatus:null,
					applyType: null,
					isH5: false,
				}
			},
			components:{},
			onLoad(options){
				this.shareId  = options.shareId 
				this.areaName = options.areaName;
				// this.partnerLevel = options.partnerLevel;
				// this.approvalStatus = options.approvalStatus;
				if(uni.getStorageSync('isH5')){
					this.isH5 = true
				}
			},
			onShow() {
				if (uni.getStorageSync('applyId')) {
					this.queryById(uni.getStorageSync('applyId'), null)
				} else if (this.shareId) {
					this.queryById(this.shareId, null)
				} else {
					this.queryById(null, uni.getStorageSync('cffp_userId'))
				}
			},
			methods:{
				queryById(id, userId) {
					api.queryById({
						id: id,
						userId: userId
					}).then((res) => {
						if (res['success']) {
							// this.applyParam = res['data']['data'];
							this.approvalStatus = res.data.data.approvalStatus
							this.partnerLevel = res.data.data.partnerLevel
						}
					})
				},
				toHome(){
					uni.switchTab({
						url:'/pages/index/index'
					})
				}
			
			}
		}
	
</script>

<style lang="scss" scoped>
	@import 'applyCommon.scss';
	.container{
		display: flex;
		flex-direction: column;
	}
	.wrapper{
		flex: 1;
		padding-top: 40rpx;
		background-color: #fff !important;
		.icon-gou{
			color: #78c06e;
			font-size: 200rpx;
			text-align: center;
			margin: 20rpx;
		}
		.result,h4{
			text-align: center;
			margin-bottom: 20rpx;
		}
		.navigator-wrap{
			text-align: center;
			padding: 40rpx 0;
			color: #20269B;
			font-size: 36rpx;
		}
		.home{
			color: #20269B;
			text-align: center;
		}
	}
</style>