<template>
	<view class="wrapper">
		<view class="icon_area">
			<image src="../../static/pay/success.png" mode="" class="success_icon"></image>
			<view class="success_txt">提交成功</view>
		</view>
		<view class="content_area">
			<view class="">
				
				<view class="subtitle">系统将在1个工作日内为您开通国家文化专网入网服务，请留意开通信息，谢谢你的支持。</view>
			</view>
		</view>
		<view class="footer_area">
			<button class="btn" @click="submit()">进入服务中心</button>
		</view>
	</view>
</template>

<script>
	import store from '@/store'
	// 校验登录
	import { checkLogin, showError } from '@/core/app'
	import * as UserApi from '@/api/user'
	
	export default {
		data() {
			return {
				//
			}
		},
		mounted() {
			this.init()
		},
		methods: {

			init(){
				if(checkLogin()==true){
					this.isLogin = true
					//console.log(this.userInfo)
					this.getUserInfo()
				}else{
					this.isLogin= false
					//this.$navTo("pages/login/index")
					showError("请登录后再操作",this.gotologin())
				}
			},

			// 跳转到登录页
			handleLogin() {
			  !this.isLogin && this.$navTo('pages/login/index')
			},
			
			// 获取当前用户信息
			getUserInfo() {
			  const app = this
			  return new Promise((resolve, reject) => {
			    !app.isLogin ? resolve(null) : UserApi.info({}, { load: app.isFirstload })
			      .then(result => {
					 // console.log(result)
			        app.userInfo = result.data.userInfo
					app.account = result.data.userInfo.mobile
			        resolve(app.userInfo)
			      })
			      .catch(err => {
			        if (err.result && err.result.status == 401) {
			          app.isLogin = false
			          resolve(null)
			        } else {
			          reject(err)
			        }
			      })
			  })
			},
			

			//提交成功
			submit(){
				this.$navTo("pages/home")
			}
		}
	}
</script>

<style scoped>
.wrapper{
	color: #101010;
	padding-bottom: 160rpx;
}

.icon_area{
	text-align: center;
}
.success_icon{
	width: 220rpx;
	height: 220rpx;
}
.success_txt{
	font-size: 20px;
	margin: 20px 0px 35px;
}
.content_area{
	padding: 0px 50rpx;
}

.subtitle{
	text-align: center;
	color: #999;
	font-size: 13px;
	margin-bottom: 26px;
}
.s_title{
	font-size: 16px;
	margin-bottom: 10px;
}
.footer_area{
	width: 100vw;
	height: 100rpx;
	position: fixed;
	bottom: 60rpx;
	left: 0px;
}
.footer_area .btn{
	width: 100%;
	height: 100%;
	font-size: 16px;
	color: #fff;
	background-color: #ffaa00;
	border-radius: 0px;
	line-height: 100rpx;
}
</style>
