Commit 61d2afe5 authored by spc's avatar spc

fixed

parent ccc1dd89
......@@ -175,7 +175,7 @@ const bannerList = ref([]) // Banner列表
const loading = ref(true) // 加载状态
// 邀请相关数据
const showMask = ref(false);
const showMask = ref(true);
const showDrawSucModal = ref(false);
const currentAwardName = ref('');
const currentAwardImageUrl = ref('');
......@@ -384,6 +384,7 @@ const fetchAct915HomeData = async () => {
console.log('检测到邀请码:', incomingCode)
// 根据登录状态决定助力处理方式
if (isLogin.value) {
showMask.value = false
// 已登录用户直接调用助力接口
console.log('用户已登录,直接调用助力接口')
await handleInvitationAssist(incomingCode);
......@@ -401,6 +402,7 @@ const fetchAct915HomeData = async () => {
}
if (isLogin.value) {
console.warn('isLogin.value', isLogin.value)
showMask.value = false
}
}
......@@ -721,26 +723,33 @@ onMounted(async () => {
// Phone authorization
const onGetPhoneNumber = async (e) => {
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
const options = currentPage.options;
const incomingCode = options.invitationCode;
if (e.detail.errMsg === 'getPhoneNumber:ok') {
try {
// console.warn('onGetPhoneNumber', e.detail)
// 隐藏授权弹窗
showMask.value = false;
userStore.phoneCallback(e.detail, null, null, async () => {
showMask.value = false;
// 重新获取用户信息(登录后)
await fetchAct915HomeData();
console.warn('授权后重新获取用户信息')
// 检查是否有邀请码需要处理助力
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
const options = currentPage.options;
const incomingCode = options.invitationCode;
if (incomingCode) {
// 使用统一的助力处理函数
await handleInvitationAssist(incomingCode);
}
}, {
wxLoginBusinessDTO: {
activityUserInvite915Code: incomingCode
}
})
} catch (error) {
console.error('授权后处理失败:', error)
......
......@@ -16,8 +16,8 @@ const {
// request.js
// 通常可以吧 baseUrl 单独放在一个 js 文件了
// const baseUrl = "http://172.16.230.108:7777/pmall";
// const baseUrl = "https://momclub-uat.feihe.com/pmall";//测试环境
let baseUrl = "https://momclub.feihe.com/pmall";//生产环境
const baseUrl = "https://momclub-uat.feihe.com/pmall";//测试环境
// let baseUrl = "https://momclub.feihe.com/pmall";//生产环境
// const baseUrl = "https://docs.dui88.com/mock/1956/api";//mock
// const baseUrl = "https://feihe.m.duibatest.com.cn/pmall"
......
......@@ -71,13 +71,13 @@ export const useUserStore = defineStore("userInfo", {
* @param {Object} data : {encryptedData, iv, code}
* @returns
*/
async phoneCallback(data, onOpenRegisterFn = () => { }, cb,cb2) {
async phoneCallback(data, onOpenRegisterFn = () => { }, cb=null, cb2=null,invitationInfo=null) {
uni.login({
provider: "weixin",
success: async (res) => {
// console.log('wxAutoLogin', res);
if (res.errMsg === "login:ok") {
// 用户手机授权
// 用户手机授权F
const {
data: babyExistence
} = await fetchAutoPhone({
......@@ -85,6 +85,7 @@ export const useUserStore = defineStore("userInfo", {
phoneIv: data.iv,
code: data.code,
codeLogin: res.code,
...invitationInfo,
});
!babyExistence && onOpenRegisterFn && onOpenRegisterFn();
......@@ -311,12 +312,12 @@ export const useUserStore = defineStore("userInfo", {
},
/**
*
* @param {sy使用}
* @returns
*/
async normalAutoLogin(cb = null) {
/**
*
* @param {sy使用}
* @returns
*/
async normalAutoLogin(cb = null) {
uni.login({
provider: "weixin",
success: async (res) => {
......
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