<template>
	<view class="noauth-cont" v-if="haveAuth===2||haveAuth===3||haveAuth===4">
		<image src="https://hzstatic.hzinsights.com/cygx/czbk/noauth.png" class="noauth-ico"></image>
		<block v-if="haveAuth==3">
			<view class="tip">{{industryMsg}}</view>
			<view class="btn-cont" @click="applyAuth">
				立即申请
			</view>
		</block>
		<block v-if="haveAuth==4">
			<view class="tip">{{industryMsg}}</view>
			<view class="btn-cont" @click="applyAuth">
				立即申请
			</view>
		</block>
		<view class="tip" v-if="haveAuth===2">
			<text style="margin-bottom: 20rpx;">
				{{industryMsg}}
			</text>
			<text>
				若想参加可以联系对口销售
			</text>
			<text @click="callPhone(sellerMobile)">{{sellerName}}：<text style="color:#D4BF86; display: inline-block;">{{sellerMobile}}</text></text>
			<text>开通{{msgType=='Type'?'对应行业':'该行业'}}的试用权限</text>
		</view>
		<view class="btn-cont back-btn" @click="backIndex"> 返回</view>
	</view>
</template>

<script>
	import {
		User
	} from '@/config/api.js'
	export default {
		props: {
			haveAuth: {
				type: Number,
				required: true
			},
			industryMsg: {
				type: String,
				required: true
			},
			sellerMobile: {
				type: String,
				required: true
			},
			sellerName: {
				type: String,
				required: true
			},
			msgType: {
				type: String,
				required: true
			}
		},
		methods: {
			/* 无权限申请开通权限 */
			applyAuth() {
				/* 区分是否是潜在用户 */
				this.haveAuth === 3 ?
					uni.navigateTo({
						url: "/pages/applyTrial/applyTrial"
					}) :
					uni.showModal({
						title: '',
						content: '您已经提交过申请了，请耐心等待',
						showCancel: false,
						confirmColor: '#3385FF',
						success: function(res) {}
					});
			},
			// 返回首頁
			backIndex() {
				uni.navigateBack({
					fail(){
						uni.switchTab({
							url:'/pages/index/index'
						})
					}
				})
			},
			callPhone(num) {
				uni.makePhoneCall({
					phoneNumber: num
				})
			},
		}
	}
</script>

<style scoped lang="scss">
	.noauth-cont {
		padding-top: 150rpx;
		text-align: center;
		font-size: 28rpx;

		.noauth-ico {
			width: 365rpx;
			height: 229rpx;
			margin-bottom: 70rpx;
		}

		.tip {
			width: 532rpx;
			margin: 0 auto 100rpx;

			.contract {
				padding: 40rpx 90rpx 0;
				line-height: 44rpx;

				text {
					display: inline-block;
				}
			}
		}

		.btn-cont {
			width: 368rpx;
			height: 80rpx;
			background: linear-gradient(268deg, #2DDBFF 0%, #1599FF 49%, #005EFF 100%);
			color: #fff;
			font-size: 34rpx;
			margin: 0 auto;
			text-align: center;
			line-height: 80rpx;

			&.back-btn {
				background: linear-gradient(268deg, #2DDBFF 0%, #1599FF 49%, #005EFF 100%) !important;
				color: #fff;
				margin-top: 30rpx;
			}

			.btn_bg {
				width: 100%;
				height: 80rpx;
				position: absolute;
				left: 0;
				top: 0;
			}

			.btn-txt {
				width: 100%;
				position: absolute;
				z-index: 1;
			}
		}
	}
</style>
