<template>
	<view>
		<!-- 模态框 -->
		<view class="cu-modal" :class="isShow?'show':''">
			<view class="cu-dialog">
				<view class="padding-xl">
					<view>授予小程序绑定微信手机号码的权限</view>
				</view>
				<view class="cu-bar bg-white">
					<navigator class="modal-bottom-oper margin-0 flex-sub text-black solid-right" open-type="exit" target="miniProgram">拒绝授权
					</navigator>
					<view class="margin-0 flex-sub">
						<button class="margin-0 flex-sub cu-btn bg-white text-main-color"
							open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">确认授权</button>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'vertify-phone',
		emits: ['reload'],
		data() {
			return {
				isShow: false
			}
		},
		methods: {
			showModal(e) {
				this.isShow = true
			},
			hideModal(e) {
				this.isShow = false;
			},
			getPhoneNumber(e) {
				this.$request.storagePhoneIntoUserInfo(e.detail.code).then(res => {
					if (res) {
						this.$emit('reload');
					}
				})
			}
		}
	}
</script>

<style>
</style>
