Commit 56cc89a1 authored by 罗超's avatar 罗超

2

parent ce0848b2
......@@ -4,7 +4,7 @@
<slot>
登录
</slot>
<button class="hotsopt" style="" open-type="getUserInfo" @tap="getUserProfile()"></button>
<button class="hotsopt" style="" open-type="getUserInfo" @tap="getUserProfile()" @click="getCode"></button>
</view>
<van-popup :show="showPhone">
......@@ -33,6 +33,7 @@
reactive,
toRefs,
onMounted,
getCurrentInstance,
inject
} from "vue";
import {
......@@ -48,6 +49,10 @@
},
components: {},
setup(props,{attrs,slots,emit}) {
const pages = getCurrentPages() // 获取栈实例
const currentRoute = pages[pages.length-1].route; // 获取当前页面路由
let Toast = inject("$toast");
let data = reactive({
obj: {
......@@ -56,7 +61,6 @@
},
showPhone: false,
showLogin:true,//多次点击
});
let methods = {
getUserProfile() {
......@@ -68,8 +72,9 @@
data.obj.Name = info.userInfo.nickName;
data.obj.Photo = info.userInfo.avatarUrl;
data.showPhone = true; //显示获取手机号码弹窗
uni.hideTabBar()//手机授权弹窗出现 隐藏tabbar 不是层级过高
if(currentRoute=="pages/index/index"){
uni.hideTabBar()//手机授权弹窗出现 隐藏tabbar
}
},
fail: () => {
uni.showToast({
......@@ -89,8 +94,8 @@
// console.log(e)
data.obj.iv = e.detail.iv
data.obj.encryptedData = e.detail.encryptedData
that.getCode()
// that.getCode()
that.parsePhoneNum(data.obj.encryptedData, data.obj.iv,data.obj.code)
}
},
getCode() { //获取code
......@@ -103,7 +108,7 @@
success: (res) => {
//获取code
data.obj.code = res.code
that.parsePhoneNum(data.obj.encryptedData, data.obj.iv,res.code)
},
fail: () => {
uni.showToast({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment