<template>
	<view>
		<far-bottom></far-bottom>
		<!-- <loadlogo v-if="!loadlogo" /> -->
		<view class="container" >
			<view class="merchantSuccess-content p-r" v-if="page==1">
				<view class="dis-flex flex-y-center flex-dir-column">
					<image class="img" :src="imgfixUrls + 'centerMerchant/addsuccess.png'" />
					<view class="f-36 color-33" style="text-align: center;">确认成为{{storename}}的店员?</view>
					<view class="checkButton" @click="adminSureAPI">确认成为店员</view>
					<view class="checkNButton" @click="goHome">取消</view>
				</view>
			</view>
			<view class="merchantSuccess-content p-r" v-if="page==2">
				<view class="dis-flex flex-y-center flex-dir-column">
					<image class="img" :src="imgfixUrls + 'centerMerchant/addsuccess.png'" />
					<view class="f-36 color-33">操作成功</view>
					<view class="f-24 color-99 m-top20">等待管理员进行后续操作</view>
					<view class="gohomeButton" @click="goHome">进入首页</view>
				</view>
			</view>
		</view>
		<TabBars :tabBarAct="0" />
	</view>
</template>
<script>
	import App from '@/common/js/app.js'
	import Loadlogo from '@/components/template/loadlogo'
	import TabBars from '@/components/template/tabBar.vue'
	export default {
		data() {
			return {
				page:1,
				loadlogo: false,
				codes:null,
				storeid:null,
				storename:null
			}
		},
		components: {
			Loadlogo,
			TabBars
		},
		computed: {
		},
		onShow() {

		},
		mounted() {
		},
		onLoad(e){
			let _this=this
			_this.codes=e.codes
			_this.storeid=e.storeid
			_this.adminSurePage();
		},
		methods: {
			init(){
				let _this=this
				_this.adminSurePage();
			},
			// 确认成为店员接口
			adminSureAPI(){
				let _this=this
				let data={
					codes:_this.codes
				}
				App._post_form('&p=store&do=adminSureAPI',data,res=>{
					_this.page=2
				})
			},
			// 店员扫码后页面
			adminSurePage(){
				let _this=this
				let data={
					codes:_this.codes,
					storeid:_this.storeid
				}
				App._post_form('&p=store&do=adminSurePage',data,res=>{
					_this.storename=res.data.storename
				})
			},
			goHome(){
				App.navigationTo({
					url:'pages/mainPages/index/index'
				})
			},
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #FFFFFF;
	}

	.container {
		.color-33 {
			color: #333333;
		}
		.color-99 {
			color: #999999;
		}
		.checkButton{
			margin: 30upx 0 0 0;
			text-align: center;
			width:600upx;
			height:80upx;
			background:rgba(51,136,255,1);
			border-radius:10upx;
			line-height: 80upx;;
			color: #FFFFFF;
		}
		.checkNButton{
			margin: 30upx 0 0 0;
			text-align: center;
			width:600upx;
			height:80upx;
			background:#EEEEEE;
			border-radius:10upx;
			line-height: 80upx;;
			color: black;
		}
		// 详情内容
		.merchantSuccess-content {
			padding:0 65upx;
			.img{
				width:105upx;
				height:105upx;
				border-radius:50%;
				margin: 110upx 0 43upx;
			}
			.gohomeButton{
				width:100%;
				height:80upx;
				line-height: 80upx;
				text-align: center;
				color: #FFFFFF;
				margin-top: 74upx;
				background:rgba(51,136,255,1);
				border-radius:40upx;
			}
		}
	}
</style>
