<template>
	<view class="boox">
		<view class="title">
			{{ isPuqiang ? "数智工牌" : "AI营销辅助"}}
		</view>
		<view class="booximg">
			<!-- <image class="img" src="https://qufang.oss-cn-beijing.aliyuncs.com/zkgj/xcx/guidepage.png" mode=""></image> -->
			<image class="img" src="https://qufang.oss-cn-beijing.aliyuncs.com/zkgj/xcx/images1.png" mode=""></image>
		</view>
		
		<view class="center-dingwei">
			<view style="height: 44rpx;display: flex;margin-left: 213rpx;">
				<image style="width: 44rpx;height: 44rpx;" src="https://qufang.oss-cn-beijing.aliyuncs.com/zkgj/xcx/images2.png" mode=""></image>
				<view style="line-height: 44rpx;margin-left: 10rpx;font-size: 32rpx;color: #333333;">智能语音转写</view>
			</view>
			<view style="height: 44rpx;display: flex;margin-left: 213rpx;margin-top: 20rpx;">
				<image style="width: 44rpx;height: 44rpx;" src="https://qufang.oss-cn-beijing.aliyuncs.com/zkgj/xcx/images2.png" mode=""></image>
				<view style="line-height: 44rpx;margin-left: 10rpx;font-size: 32rpx;color: #333333;">高效的判客机制</view>
			</view>
			<view style="height: 44rpx;display: flex;margin-left: 213rpx;margin-top: 20rpx;">
				<image style="width: 44rpx;height: 44rpx;" src="https://qufang.oss-cn-beijing.aliyuncs.com/zkgj/xcx/images2.png" mode=""></image>
				<view style="line-height: 44rpx;margin-left: 10rpx;font-size: 32rpx;color: #333333;">全方位的客户跟进</view>
			</view>
			<view style="height: 44rpx;display: flex;margin-left: 213rpx;margin-top: 20rpx;">
				<image style="width: 44rpx;height: 44rpx;" src="https://qufang.oss-cn-beijing.aliyuncs.com/zkgj/xcx/images2.png" mode=""></image>
				<view style="line-height: 44rpx;margin-left: 10rpx;font-size: 32rpx;color: #333333;">专业的经济管家</view>
			</view>
			<view style="height: 44rpx;display: flex;margin-left: 213rpx;margin-top: 20rpx;">
				<image style="width: 44rpx;height: 44rpx;" src="https://qufang.oss-cn-beijing.aliyuncs.com/zkgj/xcx/images2.png" mode=""></image>
				<view style="line-height: 44rpx;margin-left: 10rpx;font-size: 32rpx;color: #333333;">在线实时沟通</view>
			</view>
		</view>
		
		<view @click="bindWxBLogin" class="button">
			<view class="view">
				立即去登录
			</view>
		</view>
	</view>
</template>

<script>
	var app = getApp();
	var config = require("../../config");
	export default {
		data() {
			return {
				name:"",
				path:'/pages/index/index',
				pathurl:'/pages/index/index',
				pathur2:'/pages/index/customer',
				pathur3:'/pages/center/prohibited/index',
			};
		},
		
		computed: {
			
			// 是否是普强小程序
			isPuqiang() {
				return config.service.host.indexOf('xitong.pachira.cn') == -1
			},
		},
		
		onLoad(opts) {
			this.name=opts.loginName ||'';
			let stat=opts.path||'';
			if(stat==1){
				this.path=this.pathur3;
			}else if(stat==2){
				this.path=this.pathur2;
			}else{
				this.path=this.pathurl;
			}
		},
		onShow: function() {
			if(this.name==''){
				uni.request({
					url: config.service.verify,
					method: "GET",
					header: {
						'content-type': 'application/json',
						'Access-Token': uni.getStorageSync('weapp_session_login_data').token
					},
					success: (data) => {
						if (data.data.code == 10000) {
							uni.switchTab({
								url: '/pages/index/index'
							});
						}
					}
				})
			}else{
				var userInfo=uni.getStorageSync('weapp_session_userInfo_data');
				if(userInfo){
					console.log(userInfo.loginName)
					if(this.name==userInfo.loginName){
						uni.request({
							url: config.service.verify,
							method: "GET",
							header: {
								'content-type': 'application/json',
								'Access-Token': uni.getStorageSync('weapp_session_login_data').token
							},
							success: (data) => {
								if (data.data.code == 10000) {
									if(this.path=='/pages/center/prohibited/index'){
										uni.navigateTo({
											url:this.path
										});
									}else{
										uni.switchTab({
											url:this.path
										});
									}
								}
							}
						})
					}else{
						console.log("不是本人")
					}
				}else{
					console.log("没有用户信息")
				}
			}
			
			
			
			
			
		
		},
		methods: {
			bindWxBLogin() {
				wx.navigateTo({
					url: '/pages/login/index'
				});
			}

		}
	};
</script>
<style lang="scss">
	.boox{
		width: 100vw;
		height: 100vh;
		position: relative;
		.title {
			width: 100%;
			position: absolute;
			left: 0rpx;
			top: 100rpx;
			text-align: center;
			color: #FFFFFF;
			font-size: 32rpx;
			font-weight: 500;
			z-index: 1000;
		}
		.booximg{
			width: 100vw;
			height: 96vh;
			.img{
				width: 100%;
				height: 100%;
			}
		}
		.center-dingwei{
			width: 100%;
			position: absolute;
			left: 0rpx;
			bottom:230rpx;
		}
		.button {
			width: 100%;
			position: absolute;
			left: 0rpx;
			bottom:80rpx;
			.view{
				width: 630rpx;
				height: 86rpx;
				margin: 0 auto;
				background: #2671E2;
				box-shadow: 0px 2rpx 20rpx 0rpx rgba(38, 113, 226, 0.5);
				border-radius: 49rpx;
				color: #FFFFFF;
				text-align: center;
				line-height: 86rpx;
				font-size: 32rpx;
			}
		}
	}
</style>
