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

2

parent ce0848b2
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<slot> <slot>
登录 登录
</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> </view>
<van-popup :show="showPhone"> <van-popup :show="showPhone">
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
reactive, reactive,
toRefs, toRefs,
onMounted, onMounted,
getCurrentInstance,
inject inject
} from "vue"; } from "vue";
import { import {
...@@ -48,6 +49,10 @@ ...@@ -48,6 +49,10 @@
}, },
components: {}, components: {},
setup(props,{attrs,slots,emit}) { setup(props,{attrs,slots,emit}) {
const pages = getCurrentPages() // 获取栈实例
const currentRoute = pages[pages.length-1].route; // 获取当前页面路由
let Toast = inject("$toast"); let Toast = inject("$toast");
let data = reactive({ let data = reactive({
obj: { obj: {
...@@ -56,7 +61,6 @@ ...@@ -56,7 +61,6 @@
}, },
showPhone: false, showPhone: false,
showLogin:true,//多次点击 showLogin:true,//多次点击
}); });
let methods = { let methods = {
getUserProfile() { getUserProfile() {
...@@ -68,8 +72,9 @@ ...@@ -68,8 +72,9 @@
data.obj.Name = info.userInfo.nickName; data.obj.Name = info.userInfo.nickName;
data.obj.Photo = info.userInfo.avatarUrl; data.obj.Photo = info.userInfo.avatarUrl;
data.showPhone = true; //显示获取手机号码弹窗 data.showPhone = true; //显示获取手机号码弹窗
uni.hideTabBar()//手机授权弹窗出现 隐藏tabbar 不是层级过高 if(currentRoute=="pages/index/index"){
uni.hideTabBar()//手机授权弹窗出现 隐藏tabbar
}
}, },
fail: () => { fail: () => {
uni.showToast({ uni.showToast({
...@@ -89,8 +94,8 @@ ...@@ -89,8 +94,8 @@
// console.log(e) // console.log(e)
data.obj.iv = e.detail.iv data.obj.iv = e.detail.iv
data.obj.encryptedData = e.detail.encryptedData data.obj.encryptedData = e.detail.encryptedData
that.getCode() // that.getCode()
that.parsePhoneNum(data.obj.encryptedData, data.obj.iv,data.obj.code)
} }
}, },
getCode() { //获取code getCode() { //获取code
...@@ -103,7 +108,7 @@ ...@@ -103,7 +108,7 @@
success: (res) => { success: (res) => {
//获取code //获取code
data.obj.code = res.code data.obj.code = res.code
that.parsePhoneNum(data.obj.encryptedData, data.obj.iv,res.code)
}, },
fail: () => { fail: () => {
uni.showToast({ 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