Commit 5970b2df authored by spc's avatar spc

merge master

parents 5565a2dd ea3eb86c
<script setup lang="ts"> <script setup lang="ts">
import {computed, inject} from 'vue' import {computed, inject, watch, ref} from 'vue'
import {jump} from '@/utils' import {jump} from '@/utils'
import {MdConfig} from "../types"; import {MdConfig} from "../types";
import {useMD} from "../use-md"; import {useMD} from "../use-md";
...@@ -18,6 +18,8 @@ const props = defineProps<{ ...@@ -18,6 +18,8 @@ const props = defineProps<{
const pageName = inject('pageName', '') const pageName = inject('pageName', '')
const needRevoke = ref(false)
const style = computed(() => { const style = computed(() => {
const area = props.properties.area const area = props.properties.area
return { return {
...@@ -35,22 +37,36 @@ const emit = defineEmits<{ ...@@ -35,22 +37,36 @@ const emit = defineEmits<{
(e: 'getphonenumber', e: any): void (e: 'getphonenumber', e: any): void
}>() }>()
function onClick(e) { function onClick(e, revoke = false) {
emit('click', e) if (!revoke) {
emit('click', e)
logClick()
}
if ((!props.properties.needLogin || props.isLogin) && props.properties.link) { if ((!props.properties.needLogin || props.isLogin) && props.properties.link) {
jump(props.properties.link) jump(props.properties.link)
} }
logClick()
} }
function onGetPhoneNumber(e) {
needRevoke.value = true
emit('getphonenumber', e)
}
watch(() => props.isLogin, async (newVal) => {
if (newVal && needRevoke.value) {
needRevoke.value = false
onClick(null, true)
}
})
</script> </script>
<template> <template>
<button class="click-area" :class="{'debug-mode': debugMode}" :style="style" <button class="click-area" :class="{'debug-mode': debugMode}" :style="style"
:open-type="openType ?? (properties.needLogin && !isLogin ? 'getPhoneNumber' : undefined)" :open-type="openType ?? (properties.needLogin && !isLogin ? 'getPhoneNumber' : undefined)"
@click="onClick" @click="onClick"
@getphonenumber="(e) => emit('getphonenumber', e)" @getphonenumber="onGetPhoneNumber"
/> />
</template> </template>
......
...@@ -13,7 +13,7 @@ const gotPrizeModalRef = ref<InstanceType<typeof GotPrizeModal>>() ...@@ -13,7 +13,7 @@ const gotPrizeModalRef = ref<InstanceType<typeof GotPrizeModal>>()
const updateShareData = inject('updateShareData') const updateShareData = inject('updateShareData')
const onGetPhoneNumber = inject('onGetPhoneNumber') const onGetPhoneNumber = inject('onGetPhoneNumber')
const { proxy } = getCurrentInstance() const {proxy} = getCurrentInstance()
const $baseUrl = proxy.$baseUrl const $baseUrl = proxy.$baseUrl
const props = defineProps<{ const props = defineProps<{
...@@ -44,56 +44,54 @@ const inviteBtnProperties = computed(() => { ...@@ -44,56 +44,54 @@ const inviteBtnProperties = computed(() => {
async function updateInvitationInfo() { async function updateInvitationInfo() {
const resp = await fetchInvitationInfo() const resp = await fetchInvitationInfo()
console.log('invitationInfo:', resp.data)
return invitationInfo.value = resp.data return invitationInfo.value = resp.data
} }
async function tryAssist() { async function tryAssist() {
if (invitationInfo) { const pages = getCurrentPages();
const pages = getCurrentPages(); const currentPage = pages[pages.length - 1];
const currentPage = pages[pages.length - 1]; const options = currentPage.options;
const options = currentPage.options; const invitationCode = options.invitationCode;
const invitationCode = options.invitationCode;
if (invitationCode && !isAssist.value && props.isLogin) {
if (invitationCode && !isAssist.value && props.isLogin) { console.log('处理助力邀请码:', invitationCode)
console.log('处理助力邀请码:', invitationCode)
try {
try { const unionId = uni.getStorageSync('unionId');
const unionId = uni.getStorageSync('unionId');
const res = await invitationAssist(invitationCode, unionId);
const res = await invitationAssist(invitationCode, unionId); if (res && res.success) {
if (res && res.success) { uni.showToast({
uni.showToast({ title: '助力成功',
title: '助力成功', icon: 'none',
icon: 'none', duration: 2000
duration: 2000 });
}); isAssist.value = true;
isAssist.value = true; await updateInvitationInfo();
// 助力成功后重新获取数据 return Promise.resolve();
await updateInvitationInfo(); } else {
return Promise.resolve();
} else {
uni.showToast({
title: res.message,
icon: 'none',
duration: 2000
});
return Promise.reject();
}
} catch (error) {
console.error('助力请求失败:', error)
uni.showToast({ uni.showToast({
title: error.message, title: res.message,
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
}); });
return Promise.reject(); return Promise.reject();
} }
} catch (error) {
console.error('助力请求失败:', error)
uni.showToast({
title: error.message,
icon: 'none',
duration: 2000
});
return Promise.reject();
} }
} }
} }
async function initComponent() { async function initComponent() {
await tryAssist() await tryAssist().catch(console.log) // catch是为了不阻断逻辑
await updateInvitationInfo() await updateInvitationInfo()
...@@ -114,12 +112,12 @@ async function initComponent() { ...@@ -114,12 +112,12 @@ async function initComponent() {
watch(() => props.isLogin, async (newVal) => { watch(() => props.isLogin, async (newVal) => {
if (newVal) { if (newVal) {
initComponent() initComponent().catch(console.log)
} }
}) })
onMounted(async () => { onMounted(async () => {
initComponent() initComponent().catch(console.log)
}) })
</script> </script>
...@@ -130,7 +128,7 @@ onMounted(async () => { ...@@ -130,7 +128,7 @@ onMounted(async () => {
<template <template
v-for="i in 2"> v-for="i in 2">
<image <image
v-if="i-1 < 2 - invitationInfo.nextRewardNeedCount" v-if="isLogin ? i-1 < 2 - invitationInfo.nextRewardNeedCount : false"
class="avatar" class="avatar"
:src="getCdnUrl('home/icon-fill.png')" :src="getCdnUrl('home/icon-fill.png')"
/> />
...@@ -154,14 +152,14 @@ onMounted(async () => { ...@@ -154,14 +152,14 @@ onMounted(async () => {
background-color: rgba(255, 0, 0, 0.3); background-color: rgba(255, 0, 0, 0.3);
} }
.avatars{ .avatars {
position: absolute; position: absolute;
left: 24rpx; left: 24rpx;
top: 108rpx; top: 108rpx;
display: flex; display: flex;
gap: 25rpx; gap: 25rpx;
.avatar{ .avatar {
width: 63rpx; width: 63rpx;
height: 63rpx; height: 63rpx;
} }
......
...@@ -38,6 +38,7 @@ import {useUserStore} from '@/stores/user'; ...@@ -38,6 +38,7 @@ import {useUserStore} from '@/stores/user';
import ClickArea from "./components/ClickArea.vue"; import ClickArea from "./components/ClickArea.vue";
import ImageSwiper from "./components/ImageSwiper.vue"; import ImageSwiper from "./components/ImageSwiper.vue";
import InviteTask from "./components/InviteTask.vue"; import InviteTask from "./components/InviteTask.vue";
import { hideLoading, showLoading } from "@/utils";
const DEBUG_MODE = false const DEBUG_MODE = false
...@@ -48,7 +49,7 @@ const loading = ref(true) // 加载状态 ...@@ -48,7 +49,7 @@ const loading = ref(true) // 加载状态
// 邀请相关数据 // 邀请相关数据
const shareData = ref({ const shareData = ref({
title: '星妈会超级品牌周来啦!', title: '星妈会超级品牌周来啦!',
imageUrl: 'https://course.feihe.com/momclub-picture/activity/1015/v1/share-image.png', imageUrl: 'https://course.feihe.com/momclub-picture/activity/1015/v2/share-image.png',
path: '/activities/1015/home', path: '/activities/1015/home',
}) })
...@@ -61,6 +62,7 @@ const isLogin = computed(()=>{ ...@@ -61,6 +62,7 @@ const isLogin = computed(()=>{
}) })
function updateShareData(data) { function updateShareData(data) {
console.log('updateShareData:', data)
Object.assign(shareData.value, data) Object.assign(shareData.value, data)
} }
...@@ -187,6 +189,7 @@ onMounted(async () => { ...@@ -187,6 +189,7 @@ onMounted(async () => {
// Phone authorization // Phone authorization
const onGetPhoneNumber = async (e) => { const onGetPhoneNumber = async (e) => {
console.log('onGetPhoneNumber', e.detail) console.log('onGetPhoneNumber', e.detail)
showLoading('授权中...')
const pages = getCurrentPages(); const pages = getCurrentPages();
const currentPage = pages[pages.length - 1]; const currentPage = pages[pages.length - 1];
const options = currentPage.options; const options = currentPage.options;
...@@ -197,7 +200,8 @@ const onGetPhoneNumber = async (e) => { ...@@ -197,7 +200,8 @@ const onGetPhoneNumber = async (e) => {
// console.warn('onGetPhoneNumber', e.detail) // console.warn('onGetPhoneNumber', e.detail)
// 隐藏授权弹窗 // 隐藏授权弹窗
userStore.phoneCallback(e.detail, null, null, async () => { userStore.phoneCallback(e.detail, null, null, async () => {
// 重新获取用户信息(登录后) hideLoading()
// 重新获取用户信息(登录后)getphonenumber
await Promise.all([ await Promise.all([
userStore.loadUserInfo(), userStore.loadUserInfo(),
userStore.loadMemberInfo(), userStore.loadMemberInfo(),
...@@ -209,10 +213,12 @@ const onGetPhoneNumber = async (e) => { ...@@ -209,10 +213,12 @@ const onGetPhoneNumber = async (e) => {
} }
}) })
} catch (error) { } catch (error) {
hideLoading()
console.error('授权后处理失败:', error) console.error('授权后处理失败:', error)
uni.showToast({title: '授权失败', icon: 'none'}); uni.showToast({title: '授权失败', icon: 'none'});
} }
} else { } else {
hideLoading()
uni.showToast({title: '授权失败', icon: 'none'}); uni.showToast({title: '授权失败', icon: 'none'});
} }
}; };
......
const version = 'v1' const version = 'v2'
const baseUrl = 'http://127.0.0.1:8080/activity/1015' const baseUrl = 'http://127.0.0.1:8080/activity/1015'
export const getCdnUrl = (path) => `${baseUrl}/${version}/${path}` export const getCdnUrl = (path) => `${baseUrl}/${version}/${path}`
......
const version = 'v1' const version = 'v2'
//const baseUrl = 'http://127.0.0.1:8080/activity/1015' //const baseUrl = 'http://127.0.0.1:8080/activity/1015'
const baseUrl = 'https://course.feihe.com/momclub-picture/activity/1015' const baseUrl = 'https://course.feihe.com/momclub-picture/activity/1015'
......
...@@ -14,7 +14,7 @@ export function homeConfig(){ ...@@ -14,7 +14,7 @@ export function homeConfig(){
shareConfig: { shareConfig: {
title: '星妈会超级品牌周来啦!北纬47°六水香大米上新!', title: '星妈会超级品牌周来啦!北纬47°六水香大米上新!',
path: '/activities/1015/home', path: '/activities/1015/home',
imageUrl: 'https://course.feihe.com/momclub-picture/activity/1015/v1/share-image.png', imageUrl: 'https://course.feihe.com/momclub-picture/activity/1015/v2/share-image.png',
}, },
components: [ components: [
{ {
......
{ {
"background": { "background": {
"image": "https://course.feihe.com/momclub-picture/activity/1015/v1/home/bg.jpg", "image": "https://course.feihe.com/momclub-picture/activity/1015/v2/home/bg.jpg",
"style": { "style": {
"backgroundPosition": { "backgroundPosition": {
"y": "calc(4937rpx + 845rpx)" "y": "calc(4937rpx + 845rpx)"
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
"shareConfig": { "shareConfig": {
"title": "星妈会超级品牌周来啦!北纬47°六水香大米上新!", "title": "星妈会超级品牌周来啦!北纬47°六水香大米上新!",
"path": "/activities/1015/home", "path": "/activities/1015/home",
"imageUrl": "https://course.feihe.com/momclub-picture/activity/1015/v1/share-image.png" "imageUrl": "https://course.feihe.com/momclub-picture/activity/1015/v2/share-image.png"
}, },
"components": [ "components": [
{ {
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
"indicatorDots": true, "indicatorDots": true,
"items": [ "items": [
{ {
"image": "https://course.feihe.com/momclub-picture/activity/1015/v1/home/banner-0.png", "image": "https://course.feihe.com/momclub-picture/activity/1015/v2/home/banner-0.png",
"mdConfig": { "mdConfig": {
"pageName": "1015专题活动页面", "pageName": "1015专题活动页面",
"componentName": "banner头图", "componentName": "banner头图",
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
} }
}, },
{ {
"image": "https://course.feihe.com/momclub-picture/activity/1015/v1/home/banner-1.png", "image": "https://course.feihe.com/momclub-picture/activity/1015/v2/home/banner-1.png",
"mdConfig": { "mdConfig": {
"pageName": "1015专题活动页面", "pageName": "1015专题活动页面",
"componentName": "banner头图", "componentName": "banner头图",
......
import {useGlobalStore} from "@/stores/global"; import {useGlobalStore} from "@/stores/global";
const version = 'v1' const version = 'v2'
export function getCdnUrl(path){ export function getCdnUrl(path){
const {baseUrl} = useGlobalStore() const {baseUrl} = useGlobalStore()
......
...@@ -4,4 +4,4 @@ const { ...@@ -4,4 +4,4 @@ const {
} = requestModule; } = requestModule;
export const fetchBrandJSON = () => api.get('/c/front/content',{type:'brand'}); export const fetchBrandJSON = () => api.get('/c/front/content',{type:'brand_V1'});
\ No newline at end of file \ No newline at end of file
...@@ -9,9 +9,9 @@ const { ...@@ -9,9 +9,9 @@ const {
*/ */
export const fetchHomeInfo = () => api.get('/c/user/index'); export const fetchHomeInfo = () => api.get('/c/user/index');
export const fetchHomeJSON = () => api.get('/c/front/content', { type: 'home' });
export const fetchCanEatIndex = () => api.get('/c/eat/index'); export const fetchCanEatIndex = () => api.get('/c/eat/index');
export const fetchCanEatJoin = (data) => api.post('/c/eat/join', data); export const fetchCanEatJoin = (data) => api.post('/c/eat/join', data);
export const fetchHomeJSON = () => api.get('/c/front/content',{type:'home_V1'});
...@@ -8,7 +8,7 @@ const { ...@@ -8,7 +8,7 @@ const {
* @returns * @returns
*/ */
export const fetchIntegralJSON = () => api.get('/c/front/content',{type:'integral'}); export const fetchIntegralJSON = () => api.get('/c/front/content',{type:'integral_V1'});
/** /**
* 获取生日礼接口 * 获取生日礼接口
......
...@@ -46,7 +46,7 @@ export const fetchMemberInfo = () => api.get('/c/user/memberInfo'); ...@@ -46,7 +46,7 @@ export const fetchMemberInfo = () => api.get('/c/user/memberInfo');
*/ */
export const updateBabyInfo = (data) => api.post('/c/user/saveBaby', data); export const updateBabyInfo = (data) => api.post('/c/user/saveBaby', data);
export const fetchUserJSON = () => api.get('/c/front/content',{type:'my'}); export const fetchUserJSON = () => api.get('/c/front/content', { type: 'my_V1' });
/** 查询用户是否参与生育补贴和鹤礼2.0*/ /** 查询用户是否参与生育补贴和鹤礼2.0*/
export const checkParticipation = (data) => api.get('/c/fertility/index', data); export const checkParticipation = (data) => api.get('/c/fertility/index', data);
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
<image class="diamondbtn" :src="`${$baseUrl}${BABY_CLASS_IMAGES.DIAMOND.BTN}`" mode="aspectFit" <image class="diamondbtn" :src="`${$baseUrl}${BABY_CLASS_IMAGES.DIAMOND.BTN}`" mode="aspectFit"
@click="jump('diamond')"></image> @click="jump('diamond')"></image>
<!-- <image class="diamonddesc" :src="`${$baseUrl}${BABY_CLASS_IMAGES.DIAMOND.DESC}`" mode="aspectFit"></image> --> <!-- <image class="diamonddesc" :src="`${$baseUrl}${BABY_CLASS_IMAGES.DIAMOND.DESC}`" mode="aspectFit"></image> -->
<!-- <view class="diamonddesc" :style="{ color: getColor() }"> <view class="diamonddesc" :style="{ color: getColor() }">
7类课程:⼩⼉常⻅病-急救,产后恢复运动实操课,痱⼦,尿布疹,⼩⼉常⻅病-常⻅疾病护理,新⽣⼉⻩疸,⼉童安全⽤药操作课 <!-- 7类课程:⼩⼉常⻅病-急救,产后恢复运动实操课,痱⼦,尿布疹,⼩⼉常⻅病-常⻅疾病护理,新⽣⼉⻩疸,⼉童安全⽤药操作课 -->
</view>--> </view>
</view> </view>
<view v-if="currentLevelName === 'starshine'" class="starshine"> <view v-if="currentLevelName === 'starshine'" class="starshine">
...@@ -40,9 +40,9 @@ ...@@ -40,9 +40,9 @@
@click="jump('starshine')"></image> @click="jump('starshine')"></image>
<!-- <image class="starshinedesc" :src="`${$baseUrl}${BABY_CLASS_IMAGES.STARSHINE.DESC}`" mode="aspectFit"> <!-- <image class="starshinedesc" :src="`${$baseUrl}${BABY_CLASS_IMAGES.STARSHINE.DESC}`" mode="aspectFit">
</image> --> </image> -->
<!-- <view class="starshinedesc" :style="{ color: getColor() }"> <view class="starshinedesc" :style="{ color: getColor() }">
7类课程:⼩⼉常⻅病-急救,产后恢复运动实操课,痱⼦,尿布疹,⼩⼉常⻅病-常⻅疾病护理,新⽣⼉⻩疸,⼉童安全⽤药操作课 <!-- 7类课程:⼩⼉常⻅病-急救,产后恢复运动实操课,痱⼦,尿布疹,⼩⼉常⻅病-常⻅疾病护理,新⽣⼉⻩疸,⼉童安全⽤药操作课 -->
</view>--> </view>
</view> </view>
<view v-if="currentLevelName === 'starlight'" class="starlight"> <view v-if="currentLevelName === 'starlight'" class="starlight">
...@@ -63,9 +63,9 @@ ...@@ -63,9 +63,9 @@
@click="jump('starlight')"></image> @click="jump('starlight')"></image>
<!-- <image class="starlightdesc" :src="`${$baseUrl}${BABY_CLASS_IMAGES.STARLIGHT.DESC}`" mode="aspectFit"> <!-- <image class="starlightdesc" :src="`${$baseUrl}${BABY_CLASS_IMAGES.STARLIGHT.DESC}`" mode="aspectFit">
</image> --> </image> -->
<!-- <view class="starlightdesc" :style="{ color: getColor() }"> <view class="starlightdesc" :style="{ color: getColor() }">
7类课程:⼩⼉常⻅病-急救,产后恢复运动实操课,痱⼦,尿布疹,⼩⼉常⻅病-常⻅疾病护理,新⽣⼉⻩疸,⼉童安全⽤药操作课 <!-- 7类课程:⼩⼉常⻅病-急救,产后恢复运动实操课,痱⼦,尿布疹,⼩⼉常⻅病-常⻅疾病护理,新⽣⼉⻩疸,⼉童安全⽤药操作课 -->
</view>--> </view>
</view> </view>
<view v-if="currentLevelName === 'gold'" class="gold"> <view v-if="currentLevelName === 'gold'" class="gold">
...@@ -80,9 +80,9 @@ ...@@ -80,9 +80,9 @@
<image class="goldbtn" :src="`${$baseUrl}${BABY_CLASS_IMAGES.GOLD.BTN}`" mode="aspectFit" <image class="goldbtn" :src="`${$baseUrl}${BABY_CLASS_IMAGES.GOLD.BTN}`" mode="aspectFit"
@click="jump('gold')"></image> @click="jump('gold')"></image>
<!-- <image class="golddesc" :src="`${$baseUrl}${BABY_CLASS_IMAGES.GOLD.DESC}`" mode="aspectFit"></image> --> <!-- <image class="golddesc" :src="`${$baseUrl}${BABY_CLASS_IMAGES.GOLD.DESC}`" mode="aspectFit"></image> -->
<!-- <view class="golddesc" :style="{ color: getColor() }"> <view class="golddesc" :style="{ color: getColor() }">
5类课程:产检,⼉童疫苗,婴幼⼉护理,⼩⼉发热,⼩⼉7种常⻅病的治疗⽅法和⽤药原则 <!-- 5类课程:产检,⼉童疫苗,婴幼⼉护理,⼩⼉发热,⼩⼉7种常⻅病的治疗⽅法和⽤药原则 -->
</view>--> </view>
</view> </view>
<view v-if="currentLevelName === 'platinum'" class="platinum"> <view v-if="currentLevelName === 'platinum'" class="platinum">
...@@ -102,9 +102,9 @@ ...@@ -102,9 +102,9 @@
<image class="platinumbtn" :src="`${$baseUrl}${BABY_CLASS_IMAGES.PLATINUM.BTN}`" mode="aspectFit" <image class="platinumbtn" :src="`${$baseUrl}${BABY_CLASS_IMAGES.PLATINUM.BTN}`" mode="aspectFit"
@click="jump('platinum')"></image> @click="jump('platinum')"></image>
<!-- <image class="platinumdesc" :src="`${$baseUrl}${BABY_CLASS_IMAGES.PLATINUM.DESC}`" mode="aspectFit"></image> --> <!-- <image class="platinumdesc" :src="`${$baseUrl}${BABY_CLASS_IMAGES.PLATINUM.DESC}`" mode="aspectFit"></image> -->
<!-- <view class="platinumdesc" :style="{ color: getColor() }"> <view class="platinumdesc" :style="{ color: getColor() }">
5类课程:产检,⼉童疫苗,婴幼⼉护理,⼩⼉发热,⼩⼉7种常⻅病的治疗⽅法和⽤药原则 <!-- 5类课程:产检,⼉童疫苗,婴幼⼉护理,⼩⼉发热,⼩⼉7种常⻅病的治疗⽅法和⽤药原则 -->
</view>--> </view>
</view> </view>
</view> </view>
...@@ -195,8 +195,7 @@ const jump = (level) => { ...@@ -195,8 +195,7 @@ const jump = (level) => {
// 跳转到 H5 页面,地址暂时默认 https://www.baidu.com // 跳转到 H5 页面,地址暂时默认 https://www.baidu.com
// 可以根据不同等级跳转到不同的地址 // 可以根据不同等级跳转到不同的地址
//const url = 'https://member.feihe.com/memberH5/#/courses' const url = 'https://mom.feihe.com/babyWikipedia';
const url = 'https://mom.feihe.com/expertsView?from=home'
// 使用 uni.navigateTo 跳转到 webview 页面 // 使用 uni.navigateTo 跳转到 webview 页面
uni.navigateTo({ uni.navigateTo({
......
...@@ -6,10 +6,10 @@ export const BABY_CLASS_IMAGES = { ...@@ -6,10 +6,10 @@ export const BABY_CLASS_IMAGES = {
DIAMOND: { DIAMOND: {
BG: `pointRights/babyClass/${version}/DiamondBg.png`, BG: `pointRights/babyClass/${version}/DiamondBg.png`,
TITLE: `pointRights/babyClass/${version}/DiamondTitle.png`, TITLE: `pointRights/babyClass/${version}/DiamondTitle.png`,
IPS1: `pointRights/babyClass/${version}/DiamondIps1.png`, IPS1: `pointRights/babyClass/${version}/DiamondIps1-1.png`,
IPS2: `pointRights/babyClass/${version}/DiamondIps2.png`, IPS2: `pointRights/babyClass/${version}/DiamondIps2-1.png`,
IPS3: `pointRights/babyClass/${version}/DiamondIps3.png`, IPS3: `pointRights/babyClass/${version}/DiamondIps3-1.png`,
IPS4: `pointRights/babyClass/${version}/DiamondIps4.png`, IPS4: `pointRights/babyClass/${version}/DiamondIps4-1.png`,
BTN: `pointRights/babyClass/${version}/DiamondBtn.png`, BTN: `pointRights/babyClass/${version}/DiamondBtn.png`,
DESC: `pointRights/babyClass/${version}/DiamondDesc.png` DESC: `pointRights/babyClass/${version}/DiamondDesc.png`
}, },
...@@ -18,10 +18,10 @@ export const BABY_CLASS_IMAGES = { ...@@ -18,10 +18,10 @@ export const BABY_CLASS_IMAGES = {
STARSHINE: { STARSHINE: {
BG: `pointRights/babyClass/${version}/StarshineBg.png`, BG: `pointRights/babyClass/${version}/StarshineBg.png`,
TITLE: `pointRights/babyClass/${version}/StarshineTitle.png`, TITLE: `pointRights/babyClass/${version}/StarshineTitle.png`,
IPS1: `pointRights/babyClass/${version}/StarshineIps1.png`, IPS1: `pointRights/babyClass/${version}/StarshineIps1-1.png`,
IPS2: `pointRights/babyClass/${version}/StarshineIps2.png`, IPS2: `pointRights/babyClass/${version}/StarshineIps2-1.png`,
IPS3: `pointRights/babyClass/${version}/StarshineIps3.png`, IPS3: `pointRights/babyClass/${version}/StarshineIps3-1.png`,
IPS4: `pointRights/babyClass/${version}/StarshineIps4.png`, IPS4: `pointRights/babyClass/${version}/StarshineIps4-1.png`,
BTN: `pointRights/babyClass/${version}/StarshineBtn3.png`, BTN: `pointRights/babyClass/${version}/StarshineBtn3.png`,
DESC: `pointRights/babyClass/${version}/StarshineDesc.png` DESC: `pointRights/babyClass/${version}/StarshineDesc.png`
}, },
...@@ -30,10 +30,10 @@ export const BABY_CLASS_IMAGES = { ...@@ -30,10 +30,10 @@ export const BABY_CLASS_IMAGES = {
STARLIGHT: { STARLIGHT: {
BG: `pointRights/babyClass/${version}/StarlightBg.png`, BG: `pointRights/babyClass/${version}/StarlightBg.png`,
TITLE: `pointRights/babyClass/${version}/StarlightTitle.png`, TITLE: `pointRights/babyClass/${version}/StarlightTitle.png`,
IPS1: `pointRights/babyClass/${version}/StarlightIps1.png`, IPS1: `pointRights/babyClass/${version}/StarlightIps1-1.png`,
IPS2: `pointRights/babyClass/${version}/StarlightIps2.png`, IPS2: `pointRights/babyClass/${version}/StarlightIps2-1.png`,
IPS3: `pointRights/babyClass/${version}/StarlightIps3.png`, IPS3: `pointRights/babyClass/${version}/StarlightIps3-1.png`,
IPS4: `pointRights/babyClass/${version}/StarlightIps4.png`, IPS4: `pointRights/babyClass/${version}/StarlightIps4-1.png`,
BTN: `pointRights/babyClass/${version}/StarlightBtn.png`, BTN: `pointRights/babyClass/${version}/StarlightBtn.png`,
DESC: `pointRights/babyClass/${version}/StarlightDesc.png` DESC: `pointRights/babyClass/${version}/StarlightDesc.png`
}, },
...@@ -42,10 +42,10 @@ export const BABY_CLASS_IMAGES = { ...@@ -42,10 +42,10 @@ export const BABY_CLASS_IMAGES = {
GOLD: { GOLD: {
BG: `pointRights/babyClass/${version}/GoldIpsBg.png`, BG: `pointRights/babyClass/${version}/GoldIpsBg.png`,
TITLE: `pointRights/babyClass/${version}/GoldIpsTitle.png`, TITLE: `pointRights/babyClass/${version}/GoldIpsTitle.png`,
IPS1: `pointRights/babyClass/${version}/GoldIps1.png`, IPS1: `pointRights/babyClass/${version}/GoldIps1-1.png`,
IPS2: `pointRights/babyClass/${version}/GoldIps2.png`, IPS2: `pointRights/babyClass/${version}/GoldIps2-1.png`,
IPS3: `pointRights/babyClass/${version}/GoldIps3.png`, IPS3: `pointRights/babyClass/${version}/GoldIps3-1.png`,
IPS4: `pointRights/babyClass/${version}/GoldIps4.png`, IPS4: `pointRights/babyClass/${version}/GoldIps4-1.png`,
BTN: `pointRights/babyClass/${version}/GoldBtn.png`, BTN: `pointRights/babyClass/${version}/GoldBtn.png`,
DESC: `pointRights/babyClass/${version}/GoldDesc.png` DESC: `pointRights/babyClass/${version}/GoldDesc.png`
}, },
...@@ -54,10 +54,10 @@ export const BABY_CLASS_IMAGES = { ...@@ -54,10 +54,10 @@ export const BABY_CLASS_IMAGES = {
PLATINUM: { PLATINUM: {
BG: `pointRights/babyClass/${version}/PlatinumBg.png`, BG: `pointRights/babyClass/${version}/PlatinumBg.png`,
TITLE: `pointRights/babyClass/${version}/PlatinumTitle.png`, TITLE: `pointRights/babyClass/${version}/PlatinumTitle.png`,
IPS1: `pointRights/babyClass/${version}/PlatinumIps1.png`, IPS1: `pointRights/babyClass/${version}/PlatinumIps1-1.png`,
IPS2: `pointRights/babyClass/${version}/PlatinumIps2.png`, IPS2: `pointRights/babyClass/${version}/PlatinumIps2-1.png`,
IPS3: `pointRights/babyClass/${version}/PlatinumIps3.png`, IPS3: `pointRights/babyClass/${version}/PlatinumIps3-1.png`,
IPS4: `pointRights/babyClass/${version}/PlatinumIps4.png`, IPS4: `pointRights/babyClass/${version}/PlatinumIps4-1.png`,
BTN: `pointRights/babyClass/${version}/PlatinumBtn.png`, BTN: `pointRights/babyClass/${version}/PlatinumBtn.png`,
DESC: `pointRights/babyClass/${version}/PlatinumDesc2.png` DESC: `pointRights/babyClass/${version}/PlatinumDesc2.png`
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -306,6 +306,7 @@ ...@@ -306,6 +306,7 @@
"desc": "产品溯源", "desc": "产品溯源",
"bgUrl": "my/suyuan.png" "bgUrl": "my/suyuan.png"
}, { }, {
"hidden": true,
"link": { "link": {
"extra": {}, "extra": {},
"type": 3, "type": 3,
...@@ -341,14 +342,32 @@ ...@@ -341,14 +342,32 @@
], ],
"specialAttentionOptions": ["过敏", "长肉", "肠道", "消化", "脑发育"], "specialAttentionOptions": ["过敏", "长肉", "肠道", "消化", "脑发育"],
"activeInfo": [{ "activeInfo": [{
"img": "https://course.feihe.com/momclub-picture/my/vipAct251009001.jpg", "img": "https://course.feihe.com/momclub-picture/my/vipAct251019001.png",
"extra": { "extra": {
"envVersion": "release", "envVersion": "release",
"appId": "wx4205ec55b793245e" "appId": "wx4205ec55b793245e"
}, },
"type": 2, "type": 2,
"title": "兑换礼品", "title": "玉米",
"url": "/subPackages/shopMainList/topicNew/index?id=1001165" "url": "/subPackages/shopMainProcess/product/index?productId=822672030077575915&skuId=822672030077575917"
}, {
"img": "https://course.feihe.com/momclub-picture/my/vipAct251019101.png",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"title": "积分市集",
"url": "/subPackages/shopMainList/topicNew/index?id=1001167"
}, {
"img": "https://course.feihe.com/momclub-picture/my/vipAct251019201.png",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"title": "樊文花",
"url": "/subPackages/shopMainProcess/product/index?productId=821844522041316920&skuId=821844522041316921"
}], }],
"channelOptions": ["电商(京东/天猫)", "母婴店"] "channelOptions": ["电商(京东/天猫)", "母婴店"]
} }
......
...@@ -219,8 +219,8 @@ ...@@ -219,8 +219,8 @@
"navigationBarTitleText": "", "navigationBarTitleText": "",
"navigationStyle": "custom", "navigationStyle": "custom",
"enableShare": true, "enableShare": true,
"shareAppMessage": true, "enableShareAppMessage": true,
"shareTimeline": false "enableShareTimeline": true
} }
}, },
{ {
......
.page1{
height: calc(100vh - 218rpx);
}
.page2{
height: 100vh !important;
}
// 星妈实验室详情页面样式 // 星妈实验室详情页面样式
.xingmalabdetailpage { .xingmalabdetailpage {
width: 750rpx; width: 750rpx;
height: calc(100vh - 218rpx);
left: 0rpx; left: 0rpx;
top: 0rpx; top: 0rpx;
overflow-y: auto; overflow-y: auto;
......
...@@ -22,7 +22,9 @@ const registered = ref(undefined) ...@@ -22,7 +22,9 @@ const registered = ref(undefined)
const urlMap = { const urlMap = {
//'main': 'http://192.168.0.5:8001/#/page', //'main': 'http://192.168.0.5:8001/#/page',
'main': 'https://momclub-uat.feihe.com/h5/#/page', 'main': 'https://momclub.feihe.com/h5/#/page',
//'main': 'https://momclub-test.feihe.com/h5/#/page',
//'main': 'https://momclub-uat.feihe.com/h5/#/page',
}; };
const shareData = ref(null) const shareData = ref(null)
...@@ -47,9 +49,10 @@ const handleBack = () => { ...@@ -47,9 +49,10 @@ const handleBack = () => {
} }
async function ensureAutoLogin() { async function ensureAutoLogin() {
if (!globalStore.cuk) { //debugger
//if (!globalStore.cuk) {
await userStore.normalAutoLogin() await userStore.normalAutoLogin()
} //}
} }
onShow(async () => { onShow(async () => {
......
...@@ -37,6 +37,8 @@ async function onRegisterCancel() { ...@@ -37,6 +37,8 @@ async function onRegisterCancel() {
userStore.loadUserInfo(), userStore.loadUserInfo(),
]) ])
//用户信息更新,抛出事件
uni.$emit("updateUserInfo");
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1
}) })
......
...@@ -21,31 +21,31 @@ import md from "../md.js"; ...@@ -21,31 +21,31 @@ import md from "../md.js";
const globalStore = useGlobalStore(); const globalStore = useGlobalStore();
export const useUserStore = defineStore("userInfo", { export const useUserStore = defineStore("userInfo", {
state: () => { state: () => {
return { return {
userInfo: null, userInfo: null,
babyInfo: null, babyInfo: null,
memberInfo: null, memberInfo: null,
babyNickCache: [], babyNickCache: [],
cepingjieguoInfo: null, cepingjieguoInfo: null,
}; };
}, },
getters: { getters: {
isLogin: (state) => { isLogin: (state) => {
return state.userInfo?.memberId !== "not_login" return state.userInfo?.memberId !== "not_login"
} }
}, },
actions: { actions: {
/** /**
* 更新用户信息 * 更新用户信息
* @param {Object} userInfo * @param {Object} userInfo
*/ */
setUserInfo(userInfo) { setUserInfo(userInfo) {
this.userInfo = userInfo; this.userInfo = userInfo;
}, },
setMemberInfo(memberInfo) { setMemberInfo(memberInfo) {
this.memberInfo = memberInfo; this.memberInfo = memberInfo;
}, },
/** /**
* 更新宝宝信息 * 更新宝宝信息
...@@ -76,8 +76,7 @@ export const useUserStore = defineStore("userInfo", { ...@@ -76,8 +76,7 @@ export const useUserStore = defineStore("userInfo", {
* @param {Object} data : {encryptedData, iv, code} * @param {Object} data : {encryptedData, iv, code}
* @returns * @returns
*/ */
async phoneCallback(data, onOpenRegisterFn = () => { async phoneCallback(data, onOpenRegisterFn = () => {}, cb = null, cb2 = null, invitationInfo = null) {
}, cb = null, cb2 = null, invitationInfo = null) {
uni.login({ uni.login({
provider: "weixin", provider: "weixin",
success: async (res) => { success: async (res) => {
...@@ -85,7 +84,9 @@ export const useUserStore = defineStore("userInfo", { ...@@ -85,7 +84,9 @@ export const useUserStore = defineStore("userInfo", {
if (res.errMsg === "login:ok") { if (res.errMsg === "login:ok") {
// 用户手机授权F // 用户手机授权F
const { const {
data: {babyExistence} data: {
babyExistence
}
} = await fetchAutoPhone({ } = await fetchAutoPhone({
phoneEncryptedData: data.encryptedData, phoneEncryptedData: data.encryptedData,
phoneIv: data.iv, phoneIv: data.iv,
...@@ -126,6 +127,7 @@ export const useUserStore = defineStore("userInfo", { ...@@ -126,6 +127,7 @@ export const useUserStore = defineStore("userInfo", {
// 缓存用户memberId // 缓存用户memberId
uni.setStorageSync('memberId', data?.memberId) uni.setStorageSync('memberId', data?.memberId)
} }
uni.setStorageSync('loginStatus', data?.memberId == "not_login" ? 0 : 1)
this.userInfo = data; this.userInfo = data;
}, },
...@@ -171,7 +173,9 @@ export const useUserStore = defineStore("userInfo", { ...@@ -171,7 +173,9 @@ export const useUserStore = defineStore("userInfo", {
const RETRY_DELAY = 1000; // 1 second const RETRY_DELAY = 1000; // 1 second
try { try {
const {data} = await fetchBabyInfo(); const {
data
} = await fetchBabyInfo();
console.log("babyInfo-宝宝信息", data); console.log("babyInfo-宝宝信息", data);
if (data?.memberId !== "not_login") { if (data?.memberId !== "not_login") {
...@@ -299,7 +303,9 @@ export const useUserStore = defineStore("userInfo", { ...@@ -299,7 +303,9 @@ export const useUserStore = defineStore("userInfo", {
provider: "weixin", provider: "weixin",
success: async (res) => { success: async (res) => {
if (res.errMsg === "login:ok") { if (res.errMsg === "login:ok") {
const {data} = await autoLoginByCode(res.code); const {
data
} = await autoLoginByCode(res.code);
// 如果登录成功,获取用户信息和宝宝信息,更新到state中,方便全局使用 // 如果登录成功,获取用户信息和宝宝信息,更新到state中,方便全局使用
if (data && data.cuk) { if (data && data.cuk) {
globalStore.setCuk(data.cuk, data.openId, data.unionId); globalStore.setCuk(data.cuk, data.openId, data.unionId);
...@@ -329,7 +335,9 @@ export const useUserStore = defineStore("userInfo", { ...@@ -329,7 +335,9 @@ export const useUserStore = defineStore("userInfo", {
provider: "weixin", provider: "weixin",
success: async (res) => { success: async (res) => {
if (res.errMsg === "login:ok") { if (res.errMsg === "login:ok") {
const {data} = await autoLoginByCode(res.code); const {
data
} = await autoLoginByCode(res.code);
// 如果登录成功,获取用户信息和宝宝信息,更新到state中,方便全局使用 // 如果登录成功,获取用户信息和宝宝信息,更新到state中,方便全局使用
if (data && data.cuk) { if (data && data.cuk) {
globalStore.setCuk(data.cuk, data.openId, data.unionId); globalStore.setCuk(data.cuk, data.openId, data.unionId);
......
import {
JumpType,
jump
} from ".";
import {
useUserStore
} from "../stores/user";
export function checkLogin(back) {
const userStore = useUserStore();
const memberInfo = userStore.memberInfo;
if (!memberInfo?.memberId || memberInfo?.memberId == "not_login") { //未登录
jump({
type: JumpType.INNER,
url: "/pages/activity/register"
})
// 监听用户信息更新
uni.$once('updateUserInfo', () => {
if (back) {
back();
}
})
return
}
if (back) {
back();
}
}
\ No newline at end of file
...@@ -138,10 +138,10 @@ export function throttleTap(fn, delay = 1000) { ...@@ -138,10 +138,10 @@ export function throttleTap(fn, delay = 1000) {
let loadingCount = 0; let loadingCount = 0;
let loadingTimer = null; let loadingTimer = null;
export function showLoading() { export function showLoading(title = "加载中") {
if (loadingCount == 0) { if (loadingCount == 0) {
uni.showLoading({ uni.showLoading({
title: "加载中", title,
mask: true, mask: true,
}); });
......
...@@ -160,9 +160,8 @@ ...@@ -160,9 +160,8 @@
v-if="video2Channel.videoUrl || (video2Channel.finderUserName && video2Channel.feedId)"> v-if="video2Channel.videoUrl || (video2Channel.finderUserName && video2Channel.feedId)">
<video v-if="video2Channel.videoUrl" ref="brandVideo2Ref" id="brandVideo2" class="videoposter" <video v-if="video2Channel.videoUrl" ref="brandVideo2Ref" id="brandVideo2" class="videoposter"
:src="video2Channel.videoUrl?.indexOf('http') === 0 ? video2Channel.videoUrl : $baseUrl + video2Channel.videoUrl" :src="video2Channel.videoUrl?.indexOf('http') === 0 ? video2Channel.videoUrl : $baseUrl + video2Channel.videoUrl"
:autoplay="false" :autoplay="false" object-fit="cover" @loadedmetadata="onVideoLoadedMeta" @play="onVideo2Play"
:poster="video2Channel.posterUrl?.indexOf('http') === 0 ? video2Channel.posterUrl : $baseUrl + video2Channel.posterUrl" :poster="video2Channel.posterUrl?.indexOf('http') === 0 ? video2Channel.posterUrl : $baseUrl + video2Channel.posterUrl"
object-fit="cover" @loadedmetadata="onVideoLoadedMeta" @play="onVideo2Play"
@ended="onVideo2Ended"></video> @ended="onVideo2Ended"></video>
<image v-else class="videoposter" :data-comlog="{ <image v-else class="videoposter" :data-comlog="{
xcxComponentClick: 'true', xcxComponentClick: 'true',
...@@ -427,14 +426,21 @@ export default { ...@@ -427,14 +426,21 @@ export default {
async initBrandInfo() { async initBrandInfo() {
const { data } = await fetchBrandJSON(); const { data } = await fetchBrandJSON();
if (data) { if (data) {
this.swiperList = data.swiperList; this.swiperList = data.swiperList || [{
"title": "默认图",
"url": this.$baseUrl + "homepage/brandSwiperDefaultBg.png"
}];
this.erqiPeizhi = data.erqiPeizhi; this.erqiPeizhi = data.erqiPeizhi;
this.productTabList = data.productTabList || []; this.productTabList = data.productTabList || [];
this.productInfoList = data.product || []; this.productInfoList = data.product || [];
this.esgInfoList = data.esgInfoList[0] || []; this.esgInfoList = data.esgInfoList[0] || [];
this.qrInfoList = data.qrInfoList; this.qrInfoList = data.qrInfoList;
this.ipDesc = data.ipDesc; this.ipDesc = data.ipDesc;
this.swiperIconList = data.swiperIconList; this.swiperIconList = data.swiperIconList || [{
activeUrl: this.$baseUrl + "homepage/brandSwiperDefaultBg.png",
baseUrl: this.$baseUrl + "homepage/brandSwiperDefaultBg.png",
text: "默认图"
}];
this.testVideoUrl = data.videoUrl; this.testVideoUrl = data.videoUrl;
if (data.videoUrl.indexOf('http') === -1) { if (data.videoUrl.indexOf('http') === -1) {
data.videoUrl = this.$baseUrl + data.videoUrl; data.videoUrl = this.$baseUrl + data.videoUrl;
...@@ -569,11 +575,11 @@ export default { ...@@ -569,11 +575,11 @@ export default {
md.sensorComponentLogTake(evt.currentTarget.dataset.comlog); md.sensorComponentLogTake(evt.currentTarget.dataset.comlog);
} }
} }
const { productId, skuId, contentImg, contentImgLen, shareTitle, shareImg, title, link } = item; const { productId, skuId, contentImg, contentImgLen, shareTitle, shareImg, title, link, entrySource } = item;
const tabName = this.productTabList[this.channelTabIndex]; const tabName = this.productTabList[this.channelTabIndex];
if (productId && skuId) { if (productId && skuId && entrySource) {
const url = `subPackages/shopMainProcess/product/index?productId=${productId}&skuId=${skuId}&entrySource=xmh_wechatmp_brand_profamily`; const url = `subPackages/shopMainProcess/product/index?productId=${productId}&skuId=${skuId}&entrySource=${entrySource}`;
const type = JumpType.MINI; const type = JumpType.MINI;
const extra = { const extra = {
appId: 'wx4205ec55b793245e', //星妈优选小程序 appId: 'wx4205ec55b793245e', //星妈优选小程序
......
...@@ -70,11 +70,11 @@ ...@@ -70,11 +70,11 @@
<!-- <button <!-- <button
v-if="homeStore && !homeStore.isLogin && item.title!='星妈会Lab' && item.title!='星妈起名' && item.title!='喂养工具' && item.title!='产检提醒' && item.title!='宝宝生长测评' && item.title!='体质测试'" v-if="homeStore && !homeStore.isLogin && item.title!='星妈会Lab' && item.title!='星妈起名' && item.title!='喂养工具' && item.title!='产检提醒' && item.title!='宝宝生长测评' && item.title!='体质测试'"
open-type="getPhoneNumber" @getphonenumber="onGetPhoneNumber" class="sq_btn"></button> --> open-type="getPhoneNumber" @getphonenumber="onGetPhoneNumber" class="sq_btn"></button> -->
<image class="tool_bg" <image class="tool_bg" :src="$baseUrl + 'homepage/Q3Res/toolBg.png'"
:src="item.icon?.indexOf('http') === 0 ? item.icon : $baseUrl + item.icon"
@tap="handleToolClick(item)"> @tap="handleToolClick(item)">
</image> </image>
<!-- <image class="tool_icon" :src="$baseUrl + item.icon"></image> --> <image class="tool_icon"
:src="item.icon?.indexOf('http') === 0 ? item.icon : $baseUrl + item.icon"></image>
<!-- <image class="tool_jt" :src="$baseUrl + toolList.jtIcon"></image> --> <!-- <image class="tool_jt" :src="$baseUrl + toolList.jtIcon"></image> -->
<view class="tool_title">{{ item.title }}</view> <view class="tool_title">{{ item.title }}</view>
<view class="tool_context">{{ item.context }}</view> <view class="tool_context">{{ item.context }}</view>
...@@ -632,7 +632,13 @@ export default { ...@@ -632,7 +632,13 @@ export default {
} = await fetchHomeJSON(); } = await fetchHomeJSON();
console.warn("data", data) console.warn("data", data)
if (data) { if (data) {
this.swiperList = data.swiperList; this.swiperList = data.swiperList || [
{
"link": {},
"title": "默认图",
"url": this.$baseUrl + "homepage/homeSwiperDefaultBg.png"
},
];
this.vipConfigList = data.vipConfigList; this.vipConfigList = data.vipConfigList;
// this.vipCardList = data.vipCardList; // this.vipCardList = data.vipCardList;
this.contentImgList = data.contentImgList; this.contentImgList = data.contentImgList;
...@@ -1636,7 +1642,9 @@ export default { ...@@ -1636,7 +1642,9 @@ export default {
left: 0rpx; left: 0rpx;
top: 0rpx; top: 0rpx;
width: 400rpx; width: 400rpx;
pointer-events: none;
height: 470rpx; height: 470rpx;
z-index: 1;
border-radius: 40rpx; border-radius: 40rpx;
} }
...@@ -1645,6 +1653,7 @@ export default { ...@@ -1645,6 +1653,7 @@ export default {
left: 300rpx; left: 300rpx;
top: 510rpx; top: 510rpx;
width: 74rpx; width: 74rpx;
pointer-events: none;
height: 44rpx; height: 44rpx;
} }
...@@ -1652,6 +1661,7 @@ export default { ...@@ -1652,6 +1661,7 @@ export default {
position: absolute; position: absolute;
left: 30rpx; left: 30rpx;
top: 510rpx; top: 510rpx;
pointer-events: none;
color: #000; color: #000;
font-size: 36rpx; font-size: 36rpx;
width: 300rpx; width: 300rpx;
...@@ -1672,6 +1682,7 @@ export default { ...@@ -1672,6 +1682,7 @@ export default {
font-size: 24rpx; font-size: 24rpx;
color: #999; color: #999;
width: 300rpx; width: 300rpx;
pointer-events: none;
z-index: 2; z-index: 2;
overflow: hidden; overflow: hidden;
display: -webkit-box; display: -webkit-box;
......
...@@ -448,7 +448,10 @@ const handleEditProfile = (e) => { ...@@ -448,7 +448,10 @@ const handleEditProfile = (e) => {
componentContent: "资料编辑" componentContent: "资料编辑"
}) })
const type = userStore.babyInfo?.allBabyBaseInfo?.length ? "edit" : "add"; const type = userStore.babyInfo?.allBabyBaseInfo?.length == 0 ? "add" : "edit";
babyId.value = userStore.babyInfo?.allBabyBaseInfo?.find(
(item) => item.selected
)?.id;
if (type === "edit") { if (type === "edit") {
babyId.value = userStore.babyInfo?.allBabyBaseInfo.find( babyId.value = userStore.babyInfo?.allBabyBaseInfo.find(
...@@ -527,16 +530,19 @@ const initExposure = () => { ...@@ -527,16 +530,19 @@ const initExposure = () => {
} }
// onShow(async () => { onShow(async () => {
// console.log('onShow') console.log('onShow')
// await userStore.loadMemberInfo(); await userStore.loadMemberInfo();
// points.value = userStore.memberInfo?.points; points.value = userStore.memberInfo?.points;
// console.log('userStore.memberInfo=', userStore.memberInfo) console.log('userStore.memberInfo=', userStore.memberInfo)
})
// })
// 获取用户信息 // 获取用户信息
const initData = async () => { const initData = async () => {
// 确保加载会员信息以获取手机号
await userStore.loadMemberInfo();
points.value = userStore.memberInfo?.points;
if ( if (
userStore?.userInfo?.memberId && userStore?.userInfo?.memberId &&
userStore?.userInfo?.memberId == "not_login" userStore?.userInfo?.memberId == "not_login"
...@@ -593,10 +599,10 @@ const getRealtimePhoneNumber = async (e) => { ...@@ -593,10 +599,10 @@ const getRealtimePhoneNumber = async (e) => {
} }
await userStore.phoneCallback(e.detail, async () => { await userStore.phoneCallback(e.detail, async () => {
showRegisterLayer.value = true; showRegisterLayer.value = true;
// // 新增数据刷新逻辑 // 简化回调,避免重复调用接口
showLoading(); showLoading();
await userStore.loadMemberInfo();
await pageCfgStore.fetchCfg(); await pageCfgStore.fetchCfg();
// 只调用一次initData,loadMemberInfo已在initData内部处理
initData(); initData();
hideLoading(); hideLoading();
}); });
...@@ -692,6 +698,7 @@ onMounted(async () => { ...@@ -692,6 +698,7 @@ onMounted(async () => {
}); });
showLoading(); showLoading();
await userStore.loadMemberInfo(); await userStore.loadMemberInfo();
points.value = userStore.memberInfo?.points;
await pageCfgStore.fetchCfg(); await pageCfgStore.fetchCfg();
...@@ -746,7 +753,7 @@ onMounted(async () => { ...@@ -746,7 +753,7 @@ onMounted(async () => {
watch([() => userStore.userInfo, () => userStore.babyInfo], () => { watch([() => userStore.userInfo, () => userStore.babyInfo], () => {
console.log("userInfo/babyInfo变化", userStore.userInfo, userStore.babyInfo); console.log("userInfo/babyInfo变化", userStore.userInfo, userStore.babyInfo);
initData(); initData();
babyId.value = userStore.babyInfo?.allBabyBaseInfo.find( babyId.value = userStore.babyInfo?.allBabyBaseInfo?.find(
(item) => item.selected (item) => item.selected
)?.id; )?.id;
}); });
...@@ -1124,6 +1131,7 @@ defineExpose({}); ...@@ -1124,6 +1131,7 @@ defineExpose({});
.tool-icon { .tool-icon {
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 24rpx;
display: block; display: block;
} }
......
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