<template>
	<RefreshView ref="mescrollRef" :pageBg="EDEDED" :hasBack="true" text="授权登陆" :useDownScroll="false" :useUpScroll="false" >
		<view class="login">
			<view class="name-logo">
				<image class="name" src="../../static/img/login/tool_name.png"></image>
				<image class="logo" src="../../static/img/login/logo.png"></image>
			</view>
			<view class="icons">
				<image class="wx-icon" src="../../static/img/login/wx_icon.png"></image>
				<image class="exchange" src="../../static/img/login/exchange.png"></image>
				<image class="head-image" src="../../static/img/login/headimage.png"></image>
			</view>
			<view>申请获取以下权限</view>
			<view class="margin-bottom-wide">您的手机号</view>
			<view class="line-thin margin-top70"></view>
			<button class="margin-top70 button-blue" @click="authLogin()">微信授权登录</button>
			<button class="margin-top50 button-gray" @click="noLogin()">暂时不登录</button>
		</view>
	</RefreshView>
</template>
<script>
	export default {
		methods:{
			authLogin(){
				this.WxAuthLogin()
					.then((res) => {
						console.log('sysUserSid', getApp().globalData.sysUserSid)
						console.log('sysUserInfoSid', getApp().globalData.sysUserInfoSid)
						console.log('sysUserWxAuthSid', getApp().globalData.sysUserWxAuthSid)
						console.log('isLogin', getApp().globalData.isLogin)
						getApp().globalData.sysUserSid = res
						getApp().globalData.isLogin = true
						console.log("登陆返回：",res)
						uni.navigateBack({
							delta: 1
						})
					})
			},
			
			noLogin(){
				uni.navigateBack({
					delta: 1
				})
			}
			 }
	}
</script>
<style>
	@import url("../../static/columns.css");
</style>