<template>
	<view class="content">
		<image class="success_bind" src="/static/images/mine/success_bind.jpg" mode="widthFix"></image>
		<!-- <view class="bindbox">
			<image src="/static/bindComUser.png" mode="aspectFill"></image>
			<view>立即绑定，享受更多权益</view>
		</view>
		<button class="bind-btn" :loading="btnLodaing" :disabled="btnLodaing" @click="handleBind">立即绑定</button> -->
	</view>
</template>

<script>
	import { bindCompanyFsUser } from '@/api/companyUser.js'
	export default {
		data() {
			return {
				btnLodaing: false,
				companyUserId: '',
				isWechat: true
			}
		},
		onLoad(option) {
			this.companyUserId = option.companyUserId
			this.isWechat = String(navigator.userAgent.toLowerCase().match(/MicroMessenger/i)) === "micromessenger"
		},
		methods: {
			handleBind() {
				this.btnLodaing = true
				uni.showLoading({
					title: '绑定中...'
				})
				bindCompanyFsUser(this.companyUserId).then(res=>{
					this.btnLodaing = false
					uni.hideLoading()
					uni.showToast({
						title: res.msg,
						icon: 'none'
					})
				}).catch(()=>{
					this.btnLodaing = false
					uni.hideLoading()
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.success_bind {
		width: 100%;
		height: auto;
	}
	.bindbox {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		padding-top: 20vh;
		font-family: PingFang SC, PingFang SC;
		font-weight: 400;
		font-size: 32rpx;
		color: #757575;
		image {
			height: 150rpx;
			width: 150rpx;
			margin-bottom: 50rpx;
		}
	}
	.content {
		width: 100%;
		display: flex;
		flex-direction: column;
		align-items: center;
		padding-bottom: calc(var(--window-bottom) + 150rpx);
		
	}
	.bind-btn {
		margin: 20vh auto 20px auto;
		width: 300px;
		height: 44px;
		line-height: 44px;
		text-align: center;
		background: #FF5030 !important;
		color: #fff !important;
		font-size: 16px;
		font-weight: 500;
		border-radius: 22px;
		display: block;
		&:after {
			border: none;
		}
	}
</style>
