Commit 7f97f3c1 authored by spc's avatar spc

fixed

parent 0c59f9d5
...@@ -88,8 +88,8 @@ const getMessage = (e) => { ...@@ -88,8 +88,8 @@ const getMessage = (e) => {
const initWebviewUrl = async () => { const initWebviewUrl = async () => {
// 使用固定的基础URL,从 options 中获取或使用默认值 // 使用固定的基础URL,从 options 中获取或使用默认值
const options = pageOptions.value const options = pageOptions.value
let baseUrl = options.url || options.baseUrl || 'https://momclub-test.feihe.com/h5/game/index.html' let baseUrl = 'https://momclub-test.feihe.com/h5/game/index.html'
// 如果 baseUrl 已经包含协议,直接使用;否则添加协议 // 如果 baseUrl 已经包含协议,直接使用;否则添加协议
if (!baseUrl.startsWith('http://') && !baseUrl.startsWith('https://')) { if (!baseUrl.startsWith('http://') && !baseUrl.startsWith('https://')) {
baseUrl = 'https://' + baseUrl baseUrl = 'https://' + baseUrl
...@@ -113,17 +113,23 @@ const initWebviewUrl = async () => { ...@@ -113,17 +113,23 @@ const initWebviewUrl = async () => {
const params = { ...cleanOptions } const params = { ...cleanOptions }
if (cuk && !params.cuk) params.cuk = cuk if (cuk && !params.cuk) params.cuk = cuk
// 添加用户信息参数 // 添加用户信息参数
if (openId && !params.openId) params.openId = openId if (openId && !params.miniopenid) params.miniopenid = openId
if (unionId && !params.unionId) params.unionId = unionId if (unionId && !params.unionId) params.unionId = unionId
// 获取会员信息(优先从 memberInfo 获取,如果没有则从 userInfo 获取) // 获取会员信息(优先从 memberInfo 获取,如果没有则从 userInfo 获取)
const memberInfo = userStore.memberInfo || userStore.userInfo const memberInfo = userStore.memberInfo || userStore.userInfo
const userInfo = userStore.userInfo
// 添加微信昵称(如果存在)
if (userInfo?.nickname) {
params.wxNickName = userInfo.nickname
}
// 添加 memberId(如果已注册) // 添加 memberId(如果已注册)
if (memberInfo?.memberId && memberInfo.memberId !== "not_login") { if (memberInfo?.memberId && memberInfo.memberId !== "not_login") {
params.crmId = memberInfo.memberId params.crmId = memberInfo.memberId
// 添加会员ID // 添加会员ID
params.memberId = memberInfo.memberId params.memberid = memberInfo.memberId
// 添加是否登录(1表示已登录,0表示未登录) // 添加是否登录(1表示已登录,0表示未登录)
params.programLogin = '1' params.programLogin = '1'
// 添加会员等级(从 gradeList 中根据 grade 获取 gradeName) // 添加会员等级(从 gradeList 中根据 grade 获取 gradeName)
...@@ -315,7 +321,7 @@ onShareTimeline((options) => { ...@@ -315,7 +321,7 @@ onShareTimeline((options) => {
return { return {
title: title || '分享', title: title || '分享',
path: shareurl || '/pages/index/index', path: shareurl || '/pages/gameWebview/webview',
imageUrl: imageUrl || '', imageUrl: imageUrl || '',
success: function (res) { success: function (res) {
//星妈会埋点方法,用户分享成功后触发事件 //星妈会埋点方法,用户分享成功后触发事件
......
...@@ -248,7 +248,7 @@ export const useUserStore = defineStore("userInfo", { ...@@ -248,7 +248,7 @@ export const useUserStore = defineStore("userInfo", {
console.log("fetchMemberInfo=", data); console.log("fetchMemberInfo=", data);
this.setMemberInfo(data); this.setMemberInfo(data);
if (data?.memberId !== "not_login") { if (data?.memberId !== "not_login") {
uni.setStorageSync('memberId', data?.memberId) uni.setStorageSync('memberId', data?.memberId)
} }
...@@ -393,16 +393,16 @@ export const useUserStore = defineStore("userInfo", { ...@@ -393,16 +393,16 @@ export const useUserStore = defineStore("userInfo", {
/** /**
* 清除用户信息(注销时使用) * 清除用户信息(注销时使用)
*/ */
// clearUserData() { clearUserData() {
// this.userInfo = null; this.userInfo = null;
// this.babyInfo = null; this.babyInfo = null;
// this.memberInfo = null; this.memberInfo = null;
// this.babyNickCache = []; this.babyNickCache = [];
// this.cepingjieguoInfo = null; this.cepingjieguoInfo = null;
// // 清除本地存储 // 清除本地存储
// uni.removeStorageSync('memberId'); uni.removeStorageSync('memberId');
// uni.removeStorageSync('loginStatus'); uni.removeStorageSync('loginStatus');
// }, },
}, },
}); });
\ No newline at end of file
...@@ -88,11 +88,11 @@ export default { ...@@ -88,11 +88,11 @@ export default {
uni.hideLoading(); uni.hideLoading();
if (res.ok) { if (res.ok) {
// 清除本地缓存的用户信息 // 清除本地缓存的用户信息
// const userStore = useUserStore(); const userStore = useUserStore();
// const globalStore = useGlobalStore(); // const globalStore = useGlobalStore();
// const homeStore = useHomeStore(); // const homeStore = useHomeStore();
// userStore.clearUserData(); userStore.clearUserData();
// globalStore.clearAuthData(); // globalStore.clearAuthData();
// homeStore.clearHomeData(); // homeStore.clearHomeData();
...@@ -100,7 +100,7 @@ export default { ...@@ -100,7 +100,7 @@ export default {
// 跳转到首页 // 跳转到首页
uni.reLaunch({ uni.reLaunch({
url: '/pages/index/index' url: '/pages/index/index?pageType=home'
}); });
} else { } else {
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