Commit 821b80a8 authored by spc's avatar spc

Merge branch 'master' into 20250901_915Act

parents 426127d7 21692b07
......@@ -4,68 +4,45 @@
<!-- 弹窗头部 -->
<view class="popup-header">
<text class="popup-title">切换宝宝</text>
<image
class="close-btn"
:src="`${$baseUrl}shengzhangTool/1001/changeBaby/closeBtn.png`"
mode="aspectFit"
@click="closePopup"
/>
<image class="close-btn" :src="`${$baseUrl}shengzhangTool/1001/changeBaby/closeBtn.png`"
mode="aspectFit" @click="closePopup" />
</view>
<!-- 宝宝列表 -->
<view class="baby-list">
<view
v-for="(baby, index) in babyList"
:key="index"
class="baby-item"
:class="{ selected: selectIndex === index }"
@click="selectBaby(index)"
>
<view v-for="(baby, index) in babyList" :key="index" class="baby-item"
:class="{ selected: selectIndex === index }" @click="selectBaby(index)">
<!-- 选中背景 -->
<image
v-if="selectIndex === index"
class="baby-item-bg"
:src="`${$baseUrl}shengzhangTool/1001/changeBaby/babyItemBg.png`"
mode="aspectFit"
/>
<image v-if="selectIndex === index" class="baby-item-bg"
:src="`${$baseUrl}shengzhangTool/1001/changeBaby/babyItemBg.png`" mode="aspectFit" />
<!-- 宝宝头像 -->
<image
class="baby-avatar"
:src="baby.babyAvatar || `https://course.feihe.com/momclub-picture/common/default_avatar.png`"
mode="aspectFill"
/>
<image class="baby-avatar"
:src="baby.babyAvatar || `https://course.feihe.com/momclub-picture/common/default_avatar.png`"
mode="aspectFill" />
<!-- 宝宝信息 -->
<view class="baby-info">
<view class="baby-name-row">
<text class="baby-name">{{ baby.babyName }}</text>
<image
class="gender-icon"
:src="baby.babyGender === 'M' ? `${$baseUrl}shengzhangTool/1001/sex1.png` : `${$baseUrl}shengzhangTool/1001/sex0.png`"
mode="aspectFit"
/>
<image class="gender-icon"
:src="baby.babyGender === 'M' ? `${$baseUrl}shengzhangTool/1001/sex1.png` : `${$baseUrl}shengzhangTool/1001/sex0.png`"
mode="aspectFit" />
</view>
<text class="baby-birthday">宝宝生日: {{ baby.babyBirthday }}</text>
</view>
</view>
</view>
<image
class="ok-btn"
:class="{'ok-btn-active': isOkPressed}"
:src="`${$baseUrl}shengzhangTool/1001/changeBaby/okBtn.png`"
@touchstart="handleOkTouchStart"
@touchend="handleOkTouchEnd"
mode="aspectFit"
></image>
<image class="ok-btn" :class="{ 'ok-btn-active': isOkPressed }"
:src="`${$baseUrl}shengzhangTool/1001/changeBaby/okBtn.png`" @touchstart="handleOkTouchStart"
@touchend="handleOkTouchEnd" mode="aspectFit"></image>
</view>
</view>
</template>
<script setup>
import { ref, defineEmits, defineProps, onMounted } from 'vue'
import { ref, defineEmits, defineProps, onMounted, watch } from 'vue'
import { useUserStore } from "@/stores/user";
import md from '../md.js'
......@@ -91,12 +68,13 @@ const props = defineProps({
}
})
const userStore = useUserStore();
const emit = defineEmits(['update:visible', 'update:selectedIndex', 'change'])
const selectHandle = () => {
}
const isOkPressed = ref(false)
......@@ -145,9 +123,10 @@ const selectBaby = (index) => {
}
const babyList = ref([]);
onMounted(() => {
const initListData = () => {
babyList.value = (userStore.babyInfo?.allBabyBaseInfo || []).filter(tem => tem.babyStage === 2);
if(babyList.value === null){
if (babyList.value === null) {
babyList.value = [];
}
......@@ -159,6 +138,16 @@ onMounted(() => {
toolName: "生长曲线",
popName: "切换宝宝弹窗"
});
}
watch(() => props.visible, (val, oldVal) => {
if (val && !oldVal) {
// 打开的时候更新数据
initListData();
}
}, { immediate: true })
onMounted(() => {
initListData();
})
......@@ -192,13 +181,13 @@ onMounted(() => {
align-items: center;
justify-content: space-between;
padding: 40rpx 30rpx 20rpx;
.popup-title {
font-size: 32rpx;
font-weight: bold;
color: #333;
}
.close-btn {
width: 40rpx;
height: 40rpx;
......@@ -223,11 +212,11 @@ onMounted(() => {
height: 129rpx;
border-radius: 16rpx;
background-color: #fff;
&.selected {
background-color: transparent;
}
.baby-item-bg {
position: absolute;
top: 0;
......@@ -238,7 +227,7 @@ onMounted(() => {
height: 100%;
z-index: 1;
}
.baby-avatar {
position: relative;
z-index: 2;
......@@ -247,30 +236,30 @@ onMounted(() => {
border-radius: 50%;
margin-right: 20rpx;
}
.baby-info {
position: relative;
z-index: 2;
flex: 1;
.baby-name-row {
display: flex;
align-items: center;
margin-bottom: 8rpx;
.baby-name {
font-size: 28rpx;
font-weight: bold;
color: #333;
margin-right: 10rpx;
}
.gender-icon {
width: 24rpx;
height: 24rpx;
}
}
.baby-birthday {
font-size: 24rpx;
color: #666;
......@@ -285,6 +274,7 @@ onMounted(() => {
height: 98rpx;
margin-left: 35rpx;
margin-top: 0rpx;
&.ok-btn-active {
transform: scale(0.95);
}
......@@ -292,12 +282,4 @@ onMounted(() => {
}
}
</style>
\ No newline at end of file
......@@ -35,6 +35,7 @@
</template>
</view>
<view class="form-btn" @click="onAdd">
<image v-if="isType == '0' || isType == '2'" :src="`${$baseUrl}chanjianTool/1001/icon23.png`"></image>
<template v-if="type == '1'">
......@@ -43,6 +44,8 @@
<template v-if="type == '2'">
{{ isType == '0' ? '添加状态' : isType == '3' ? '我知道了' : isType == '1' ? '切换状态' : '修改状态' }}
</template>
<button v-if="isNotLogin" type="primary" class="phone-button" open-type="getPhoneNumber"
@getphonenumber="getRealtimePhoneNumber" />
</view>
</view>
</view>
......@@ -53,7 +56,8 @@ import {
ref,
onMounted,
computed,
defineEmits
defineEmits,
watch
} from 'vue'
import { useUserStore } from "@/stores/user";
// 接受父组件参数
......@@ -61,6 +65,10 @@ const props = defineProps({
type: {
type: String,
default: '1', // 1 非宝宝状态 2 非孕中状态
},
isNotLogin: {
type: Boolean,
default: false //是否未登录
}
})
// 用户信息
......@@ -68,7 +76,7 @@ const userStore = useUserStore();
const babyInfo = ref(userStore.babyInfo)
// 回调函数
const emit = defineEmits([ 'statusChange', 'close'])
const emit = defineEmits(['statusChange', 'close'])
const isType = ref('0') // 0 添加状态或者宝宝 1 切换状态 2 修改状态 3 宝宝已达上限
......@@ -77,18 +85,18 @@ const babyBaseId = ref('')
// 产检信息
const pregnancyStatus = computed(() => {
return isType.value == '0' ? '新增孕中'
: isType.value == '1' ? '切换孕中'
: isType.value == '2' ? '修改备孕'
: '';
return isType.value == '0' ? '新增孕中'
: isType.value == '1' ? '切换孕中'
: isType.value == '2' ? '修改备孕'
: '';
})
// 生长曲线和喂养记录
const babyStatus = computed(() => {
return isType.value == '0' ? '新增宝宝'
: isType.value == '1' ? '切换宝宝'
: isType.value == '2' ? (babyInfo.value.babyStage == 0 ? '修改备孕' :
babyInfo.value.babyStage == 1 ? '修改孕中' : '')
: '';
return isType.value == '0' ? '新增宝宝'
: isType.value == '1' ? '切换宝宝'
: isType.value == '2' ? (babyInfo.value.babyStage == 0 ? '修改备孕' :
babyInfo.value.babyStage == 1 ? '修改孕中' : '')
: '';
})
// 跳转新增宝宝状态页面
const navigateToFn = () => {
......@@ -98,12 +106,30 @@ const navigateToFn = () => {
url: `/pages/person/person?type=${type}`
})
}
const getRealtimePhoneNumber = async (e) => {
console.log("获取手机号码", e);
if (e.detail.errMsg !== "getPhoneNumber:ok") {
uni.showToast({
title: "请授权使用手机号",
icon: "none",
});
return;
}
await userStore.phoneCallback(e.detail, () => { }, () => {
emit('afterPhone') //如果没有宝宝信息,页面中处理宝宝注册信息
});
console.log("closeclosecloseclose");
emit('close')
emit('statusChange') //借用这个事件,刷新下页面数据
};
// 切换状态 需要对应的宝宝id 直接请求接口
const switchState = async () => {
console.log('切换状态', babyBaseId.value)
await userStore.changeBabySelected(babyBaseId.value);
// 发送事件 通知主页面
// 发送事件 通知主页面
emit('statusChange')
}
// 修改状态 需要对应备胎的id 跳转到编辑页面
......@@ -117,8 +143,12 @@ const modifyState = async () => {
url: `/pages/person/person?type=${type}&id=${babyBaseId.value}`
})
}
//这里新增一下未登录的情况,点击事件直接去拉起手机号授权
// 跳转新增产检页面
const onAdd = () => {
if (props.isNotLogin == true) {
return;
}
// 0 添加状态或者宝宝 1 切换状态 2 修改状态 3 宝宝已达上限
switch (isType.value) {
case '0':
......@@ -131,17 +161,28 @@ const onAdd = () => {
modifyState()
break;
case '3':
uni.navigateBack()
if (getCurrentPages().length > 1) {
uni.navigateBack()
} else {
uni.reLaunch({
url: '/pages/index/index'
})
}
break;
default:
break;
}
}
onMounted(() => {
onMounted(async () => {
if (props.isNotLogin) {
await userStore.wxAutoLogin();
}
// 宝宝生长测试和喂养记录
console.log('babyInfo-获取宝宝', babyInfo.value)
const babyBaseInfo = babyInfo.value.allBabyBaseInfo
const babyBaseInfo = babyInfo?.value?.allBabyBaseInfo
console.log("🚀 ~ babyBaseInfo:", babyBaseInfo)
// 有宝宝状态
if (babyBaseInfo) {
......@@ -168,7 +209,7 @@ onMounted(() => {
// }
babyBaseId.value = babyInfo.value.content.id;
isType.value = '2';
}
}
// 产检提醒
......@@ -205,14 +246,14 @@ onMounted(() => {
// 如果找到符合条件的 baby,取出它的 id 并赋值
babyBaseId.value = stageOneBaby.id;
} else { // 修改
console.log('没有找到符合条件的 baby', babyInfo.value);
console.log('没有找到符合条件的 baby', babyInfo.value);
// // 判断没有备孕的状态
// if (!babyBaseInfo.some(baby => baby.babyStage == 0)) {
// isType.value = '0'
// } else {
// const stageZeroBaby = babyBaseInfo.find(baby => baby.babyStage == 0);
babyBaseId.value = babyInfo.value.content.id;
isType.value = '2';
babyBaseId.value = babyInfo.value.content.id;
isType.value = '2';
// }
}
......@@ -319,11 +360,19 @@ onMounted(() => {
align-items: center;
justify-content: center;
margin-top: 55rpx;
position: relative;
image {
width: 42rpx;
height: 42rpx;
margin-right: 12rpx;
}
.phone-button {
width: 100%;
height: 100%;
position: absolute;
opacity: 0;
}
}
</style>
\ No newline at end of file
......@@ -6,7 +6,7 @@ const init = (SENSORS_URL) => {
sensors.setPara({
name: "sensors",
server_url: SENSORS_URL,
show_log: true,
show_log: false,
autoTrack: {
appLaunch: true, // 默认为 true,false 则关闭 $MPLaunch 事件采集
appShow: true, // 默认为 true,false 则关闭 $MPShow 事件采集
......@@ -178,6 +178,15 @@ const sensorPopLogTake = (logObj) => {
sensorPopLog(evt);
};
const sensorUserLogTake = (logObj) => {
if (!logObj) {
return;
}
sensors.track("xcxUserStatus", {
...logObj,
});
};
export default {
init,
sensors,
......@@ -188,4 +197,5 @@ export default {
sensorComponentLogTake,
sensorPopLog,
sensorPopLogTake,
sensorUserLogTake
};
......@@ -120,6 +120,12 @@
},
"channelTabListMianTitle": "有声频道",
"swiperList": [
{
"videoUrl": "homepage/homeSwiper/V1/9_1.mp4",
"link": {},
"title": "教师节banner",
"url": "homepage/homeSwiper/V1/9.gif"
},
{
"img": "homepage/homeSwiper/V1/7.jpg",
"link": {
......
{
"clickMore": {
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/xmhMainProcess/member/index?entrySource=xmh_wechatmp_points_recgoodsbot"
},
"tupianBanben": "1022",
"swiper": [],
"goodsListData": {
"listCommon": {
"listItemImgBg": "integral/1022/listItemImgBg.png"
},
"tabInfo": {
"tabBg": "tapSelectBg.png",
"tabTexts": [
{
"line2": "",
"line1": "星品榜单"
},
{
"line2": "",
"line1": "0元爆款"
},
{
"line2": "",
"line1": "北纬专场"
}
]
},
"goodsData": [
{
"titles": [
"星飞帆4段儿童成长配...",
"星飞帆卓睿4段儿童配...",
"飞鹤臻贵儿童成长配方...",
"茁然 茁护儿童配方奶...",
"经典爱本乳铁蛋白配方...",
"飞鹤茁然高钙奶酪泡芙...",
"金装1962-中老年高钙...",
"经典爱本膳骨配方奶粉...",
"经典爱本清澄配方奶粉...",
"金装1962-高钙高蛋白...",
"德佑纯水湿巾80抽/包",
"婴儿专护除菌除螨洗衣...",
"DHA深海鳕鱼肠80g*4袋",
"云朵软软绵柔巾洗脸巾..."
],
"prices": [
"低至730积分+¥115",
"低至865积分+¥195",
"低至1000积分+¥228",
"低至715积分+¥125",
"低至3160积分+¥126.4",
"低至1400积分+¥55.8",
"低至1780积分+¥71.2",
"低至3160积分+¥126.4",
"低至3960积分+¥158.4",
"低至1780积分+¥71.2",
"低至65积分+¥36.5",
"低至440积分+¥17.5",
"低至520积分+¥20.8",
"低至460积分+¥18.3"
],
"goodsImgs": [
"listItemImgJx0.png",
"listItemImgJx1.png",
"listItemImgJx2.png",
"listItemImgJx3.png",
"listItemImgJx4.png",
"listItemImgJx5.png",
"listItemImgJx6.png",
"listItemImgJx7.png",
"listItemImgJx8.png",
"listItemImgJx9.png",
"listItemImgJx10.png",
"listItemImgJx11.png",
"listItemImgJx13.png",
"listItemImgJx14.png"
]
},
{
"titles": [
"星飞帆4段儿童成长配...",
"飞鹤茁然儿童配方奶升...",
"茁然 茁护儿童配方奶...",
"宝宝钙维生素D软胶囊...",
"公牛 新国标插座/插线...",
"九阳煮蛋器多功能智能...",
"荣事达电煮锅家用多功...",
"babygo进口户外防水...",
"苏泊尔(SUPOR)真...",
"超级飞侠儿童绘画笔套..."
],
"prices": [
11500,
8900,
12000,
5450,
5980,
5900,
5900,
3800,
9900,
7900
],
"goodsImgs": [
"listItemImgXL0.png",
"listItemImgXL1.png",
"listItemImgXL2.png",
"listItemImgXL3.png",
"listItemImgXL5.png",
"listItemImgXL7.png",
"listItemImgXL9.png",
"listItemImgXL11.png",
"listItemImgXL12.png",
"listItemImgXL13.png"
]
},
{
"titles": [
"北纬47度水果玉米",
"北纬47度黄糯鲜玉米",
"北纬47度白甜糯玉米",
"北纬47度东北烧烤...",
"北纬47度花甜糯玉米",
"北纬47度黑珍珠玉米",
"N47°植物酵素乳245...",
"N47°水果玉米汁245..."
],
"prices": [
4740,
3900,
4600,
5990,
4600,
5200,
9990,
7990
],
"goodsImgs": [
"listItemImgPzh0.png",
"listItemImgPzh1.png",
"listItemImgPzh2.png",
"listItemImgPzh3.png",
"listItemImgPzh4.png",
"listItemImgPzh5.png",
"listItemImgPzh6.png",
"listItemImgPzh7.png"
]
}
],
"productIdUrl": {
"lingyuan": [
{
"productId": "643301938280182989",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/shopMainProcess/product/index?productId={productId}&skuId={skuId}&entrySource=xmh_wechatmp_points_star",
"skuId": "643301938280182990"
},
{
"productId": "570770855028876907",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/shopMainProcess/product/index?productId={productId}&skuId={skuId}&entrySource=xmh_wechatmp_points_star",
"skuId": "570770855028876908"
},
{
"productId": "643302772176787321",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/shopMainProcess/product/index?productId={productId}&skuId={skuId}&entrySource=xmh_wechatmp_points_star",
"skuId": "643302772176787322"
},
{
"productId": "650261586675438161",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/shopMainProcess/product/index?productId={productId}&skuId={skuId}&entrySource=xmh_wechatmp_points_star",
"skuId": "650261761758111604"
},
{
"productId": "637462885116453461",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/shopMainProcess/product/index?productId={productId}&skuId={skuId}&entrySource=xmh_wechatmp_points_star",
"skuId": "637462885116453462"
},
{
"productId": "664995106239801237",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/shopMainProcess/product/index?productId={productId}&skuId={skuId}&entrySource=xmh_wechatmp_points_star",
"skuId": "664995106239801238"
},
{
"productId": "664992929630904330",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/shopMainProcess/product/index?productId={productId}&skuId={skuId}&entrySource=xmh_wechatmp_points_star",
"skuId": "702706680618457075"
},
{
"productId": "477231839213998660",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/shopMainProcess/product/index?productId={productId}&skuId={skuId}&entrySource=xmh_wechatmp_points_star",
"skuId": "477231839213998661"
},
{
"productId": "710238004623156187",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/shopMainProcess/product/index?productId={productId}&skuId={skuId}&entrySource=xmh_wechatmp_points_star",
"skuId": "710238148411278894"
},
{
"productId": "637105594356118250",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/shopMainProcess/product/index?productId={productId}&skuId={skuId}&entrySource=xmh_wechatmp_points_star",
"skuId": "637105594356118251"
}
],
"xingpin": [
{
"productId": "632366292935447153",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/shopMainProcess/product/index?productId={productId}&skuId={skuId}&entrySource=xmh_wechatmp_points_star",
"skuId": "632366292935447154"
},
{
"productId": "434526218612696157",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/shopMainProcess/product/index?productId={productId}&skuId={skuId}&entrySource=xmh_wechatmp_points_star",
"skuId": "434526218612696158"
},
{
"productId": "779457178234291713",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/shopMainProcess/product/index?productId={productId}&skuId={skuId}&entrySource=xmh_wechatmp_points_star",
"skuId": "779457178234291714"
},
{
"productId": "632368902459430553",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/shopMainProcess/product/index?productId={productId}&skuId={skuId}&entrySource=xmh_wechatmp_points_star",
"skuId": "632368902459430554"
},
{
"productId": "748373470406312440",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/shopMainProcess/product/index?productId={productId}&skuId={skuId}&entrySource=xmh_wechatmp_points_star",
"skuId": "748373470406312441"
},
{
"productId": "700209063828145600",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/shopMainProcess/product/index?productId={productId}&skuId={skuId}&entrySource=xmh_wechatmp_points_star",
"skuId": "700209063828145601"
},
{
"productId": "444612538255511698",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/shopMainProcess/product/index?productId={productId}&skuId={skuId}&entrySource=xmh_wechatmp_points_star",
"skuId": "444612538255511699"
},
{
"productId": "748374838109458955",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/shopMainProcess/product/index?productId={productId}&skuId={skuId}&entrySource=xmh_wechatmp_points_star",
"skuId": "748374838109458956"
},
{
"productId": "748376191670080756",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/shopMainProcess/product/index?productId={productId}&skuId={skuId}&entrySource=xmh_wechatmp_points_star",
"skuId": "748376191670080757"
},
{
"productId": "444614841574228087",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/shopMainProcess/product/index?productId={productId}&skuId={skuId}&entrySource=xmh_wechatmp_points_star",
"skuId": "444614841574228088"
},
{
"productId": "642944987112793104",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/shopMainProcess/product/index?productId={productId}&skuId={skuId}&entrySource=xmh_wechatmp_points_star",
"skuId": "642944987112793105"
},
{
"productId": "660577242594873852",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/shopMainProcess/product/index?productId={productId}&skuId={skuId}&entrySource=xmh_wechatmp_points_star",
"skuId": "660577242594873853"
},
{
"productId": "670068445908034706",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/shopMainProcess/product/index?productId={productId}&skuId={skuId}&entrySource=xmh_wechatmp_points_star",
"skuId": "670072178498381183"
},
{
"productId": "660575857729992191",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/shopMainProcess/product/index?productId={productId}&skuId={skuId}&entrySource=xmh_wechatmp_points_star",
"skuId": "660575857729992192"
}
],
"beiwei": [
{
"productId": "694019044167238066",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/shopMainProcess/product/index?productId={productId}&skuId={skuId}&entrySource=xmh_wechatmp_points_star",
"skuId": "694019044167238067"
},
{
"productId": "548984197069284758",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/shopMainProcess/product/index?productId={productId}&skuId={skuId}&entrySource=xmh_wechatmp_points_star",
"skuId": "548984197069284759"
},
{
"productId": "548991402553569325",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/shopMainProcess/product/index?productId={productId}&skuId={skuId}&entrySource=xmh_wechatmp_points_star",
"skuId": "548991402553569326"
},
{
"productId": "757045038059549612",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/shopMainProcess/product/index?productId={productId}&skuId={skuId}&entrySource=xmh_wechatmp_points_star",
"skuId": "757045038059549613"
},
{
"productId": "555507401709887582",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/shopMainProcess/product/index?productId={productId}&skuId={skuId}&entrySource=xmh_wechatmp_points_star",
"skuId": "555507401709887583"
},
{
"productId": "555151404052796950",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/shopMainProcess/product/index?productId={productId}&skuId={skuId}&entrySource=xmh_wechatmp_points_star",
"skuId": "555151404052796951"
},
{
"productId": "704050114989893289",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/shopMainProcess/product/index?productId={productId}&skuId={skuId}&entrySource=xmh_wechatmp_points_star",
"skuId": "704050114989893290"
},
{
"productId": "710290587034550507",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/shopMainProcess/product/index?productId={productId}&skuId={skuId}&entrySource=xmh_wechatmp_points_star",
"skuId": "710290587034550508"
}
]
}
},
"quanyitiaozhuanInfo": {
"shengrili": {
"qushiyong": {
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/shopMainProcess/coupons/couponList"
}
},
"suyuanyou": {
"qubaoming": {
"type": 3,
"url": "https://member.feihe.com/memberH5/#/SyySignupInfo?activityCode=syy20250806&sceneCode=WXG01"
}
}
},
"vipIntegral": {
"gonglue": {
"img": "strategyBtn.png",
"type": 3,
"url": "https://mom.feihe.com/member/mine/pointStrategy"
},
"jifenmingxi": {
"type": 3,
"url": "https://mom.feihe.com/member/mine/newPointDetail?crmId={crmid}&appCode=XMH"
},
"progressBar": {
"barBgImg": "progressBarBgIntegral.png",
"barImg": "progressBarIntegral.png"
},
"vipCardInfo": {
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/xmhMainProcess/member/index?entrySource=xmh_wechatmp_points_recgoodsbot"
},
"excharge": {
"img": "integralExchargeBtn.png",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/shopMainList/topicNew/index?id=1000187"
}
},
"viplv": {
"imgs": [
"imgPlatinum0.png",
"imgPlatinum1.png",
"imgPlatinum2.png",
"imgPlatinum3.png",
"imgPlatinum4.png"
],
"upLvTxts": [
"扫罐内码或下单有机会提升至/V2铂金会员",
"扫罐内码或下单有机会提升至/V3钻石会员",
"扫罐内码或下单有机会提升至/V4星光会员",
"扫罐内码或下单有机会提升至/V5星耀会员",
"已提升至最高等级/V5星耀会员"
],
"vipLvIcon": [
"imgPlatinumIcon0.png",
"imgPlatinumIcon1.png",
"imgPlatinumIcon2.png",
"imgPlatinumIcon3.png",
"imgPlatinumIcon4.png"
],
"nickNameColors": [
"#1d1e25",
"#1d1e25",
"#ffffff"
],
"imgBgs": [
"imgPlatinumBg0.png",
"imgPlatinumBg1.png",
"imgPlatinumBg2.png",
"imgPlatinumBg3.png",
"imgPlatinumBg4.png"
],
"dangqianColors": [
"#b27c1e",
"#447ab0",
"#332288",
"#674513",
"#674513"
],
"vipNameImgs": [
"imgPlatinumName0.png",
"imgPlatinumName1.png",
"imgPlatinumName2.png",
"imgPlatinumName3.png",
"imgPlatinumName4.png"
]
},
"vipActive": [
{
"img": "vipAct250910001.png",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "/subPackages/shopMainProcess/product/index?productId=543558664688883066&skuId=543560605494007100",
"title": "黄糯玉米"
},
{
"img": "vipAct2.png",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "/subPackages/shopMainProcess/lottery/index?utm_campaign=%E6%BA%AF%E6%BA%90%E6%8A%BD%E5%A5%96&_channel_track_key=ngSppZAj"
}
],
"vipLvInfo": [
{
"vipLvIcon": "vipLvIcon0.png",
"vipLvBg": "vipLvBg0.png",
"currentLvTip": "currentLvTip0.png",
"barVip": "barVip0.png",
"barBgVip": "barBgVip0.png"
},
{
"vipLvIcon": "vipLvIcon1.png",
"vipLvBg": "vipLvBg1.png",
"currentLvTip": "currentLvTip1.png",
"barVip": "barVip1.png",
"barBgVip": "barBgVip1.png"
},
{
"vipLvIcon": "vipLvIcon2.png",
"vipLvBg": "vipLvBg2.png",
"currentLvTip": "currentLvTip2.png",
"barVip": "barVip2.png",
"barBgVip": "barBgVip2.png"
},
{
"vipLvIcon": "vipLvIcon3.png",
"vipLvBg": "vipLvBg3.png",
"currentLvTip": "currentLvTip3.png",
"barVip": "barVip3.png",
"barBgVip": "barBgVip3.png"
},
{
"vipLvIcon": "vipLvIcon4.png",
"vipLvBg": "vipLvBg4.png",
"currentLvTip": "currentLvTip4.png",
"barVip": "barVip4.png",
"barBgVip": "barBgVip4.png"
}
],
"qunyiInfo": {
"vipRule": {
"type": 3,
"url": "https://mom.feihe.com/member/mine/pointStrategy"
},
"quanyiBgs": [
{
"selectImg": "quanyiSelectBg0.png",
"lockImg": "quanyiLockBg0.png",
"unlockImg": "quanyiunLockBg0.png",
"quanyiNum": 3
},
{
"selectImg": "quanyiSelectBg1.png",
"lockImg": "quanyiLockBg1.png",
"unlockImg": "quanyiunLockBg1.png",
"quanyiNum": 5
},
{
"selectImg": "quanyiSelectBg2.png",
"lockImg": "quanyiLockBg2.png",
"unlockImg": "quanyiunLockBg2.png",
"quanyiNum": 8
},
{
"selectImg": "quanyiSelectBg3.png",
"lockImg": "quanyiLockBg3.png",
"unlockImg": "quanyiunLockBg3.png",
"quanyiNum": 9
},
{
"selectImg": "quanyiSelectBg4.png",
"lockImg": "quanyiLockBg4.png",
"unlockImg": "quanyiunLockBg4.png",
"quanyiNum": 9
}
],
"rule": {
"type": 3,
"url": "https://mom.feihe.com/member/mine/pointStrategy"
},
"imgInfos": [
{
"img": "yueyueliIcon0.png",
"name": "月月礼",
"width": "99rpx",
"height": "99rpx"
},
{
"img": "yuerIcon0.png",
"name": "育儿课程",
"width": "99rpx",
"height": "99rpx"
},
{
"img": "mainfeiIcon0.png",
"name": "免费问诊",
"width": "99rpx",
"height": "99rpx"
},
{
"img": "aibenxinrenliIcon0.png",
"name": "爱本新人礼",
"width": "99rpx",
"height": "99rpx"
},
{
"img": "zhuanduanliIcon0.png",
"name": "转段礼",
"width": "99rpx",
"height": "99rpx"
},
{
"img": "zhousuiliIcon0.png",
"name": "周岁礼",
"width": "99rpx",
"height": "99rpx"
},
{
"img": "shengriliIcon0.png",
"name": "生日礼",
"width": "99rpx",
"height": "99rpx"
},
{
"img": "jinjiliIcon0.png",
"name": "晋级礼",
"width": "99rpx",
"height": "99rpx"
},
{
"img": "suyuanyouIcon0.png",
"name": "溯源游",
"width": "99rpx",
"height": "99rpx"
}
],
"vipQuanyiUrl": {
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "subPackages/xmhMainProcess/member/index?entrySource=xmh_wechatmp_points_recgoodsbot"
},
"vipLvsQuanyi": [
{
"isNewArr": [],
"qunyiList": [
0,
2,
5
]
},
{
"isNewArr": [
6,
7
],
"qunyiList": [
6,
7,
0,
2,
5
]
},
{
"isNewArr": [
8,
1
],
"qunyiList": [
8,
1,
6,
7,
0,
2,
5
]
},
{
"isNewArr": [
9
],
"qunyiList": [
9,
8,
1,
6,
7,
0,
2,
5
]
},
{
"isNewArr": [
9
],
"qunyiList": [
9,
8,
1,
6,
7,
0,
2,
5
]
}
]
}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -52,7 +52,9 @@
<button open-type="getPhoneNumber" @getphonenumber="(e) => onGetPhoneNumber(e, 'like')"
class="auth-like-btn phone-auth-btn-cover"></button>
<!-- 分享按钮授权覆盖 - 移除这个,让分享按钮正常工作 -->
<!-- 分享按钮授权覆盖 -->
<button open-type="getPhoneNumber" @getphonenumber="(e) => onGetPhoneNumber(e, 'share')"
class="auth-share-btn phone-auth-btn-cover"></button>
</div>
</div>
</view>
......@@ -72,7 +74,7 @@ defineOptions({
})
// 响应式数据
const collectionNumber = ref('123456789')
const collectionNumber = ref('')
const recordId = ref('') // 添加记录ID的响应式变量
const detailData = ref({
content: '',
......@@ -267,9 +269,9 @@ const handleGoBack = () => {
}
}
// 生命周期
onMounted(async (options) => {
// 页面初始化逻辑
const initPage = async () => {
md.sensorComponentLogTake({
xcxComponentExposure: "true",
pageName: "星妈lab-藏品详情页",
......@@ -284,7 +286,6 @@ onMounted(async (options) => {
componentContent: "分享"
});
// 调用 home 接口获取登录状态
await homeStore.loadHomeInfo()
......@@ -297,7 +298,6 @@ onMounted(async (options) => {
recordId.value = id // 立即保存ID,确保分享时能获取到
await fetchDetailData(id)
md.sensorComponentLogTake({
xcxComponentExposure: "true",
pageName: "星妈lab-藏品详情页",
......@@ -305,7 +305,7 @@ onMounted(async (options) => {
componentContent: "藏品详情页+" + detailData.value.content
});
} else {
console.warn('⚠️ 未获取到页面参数 id', options, currentPage.options)
console.warn('⚠️ 未获取到页面参数 id', currentPage.options)
// uni.showToast({
// title: '参数错误',
// icon: 'none'
......@@ -323,6 +323,22 @@ onMounted(async (options) => {
withShareTicket: true,
menus: ['shareAppMessage']
})
}
// 生命周期
onMounted(async (options) => {
console.log('星妈lab详情页面已加载')
// 先进行自动登录获取基础信息,登录成功后执行页面初始化
try {
console.log('开始执行 normalAutoLogin...')
await userStore.normalAutoLogin(initPage)
console.log('normalAutoLogin 完成')
} catch (error) {
console.error('normalAutoLogin 失败:', error)
// 即使登录失败也执行页面初始化
await initPage()
}
})
// 定义分享函数
......
This source diff could not be displayed because it is too large. You can view the blob instead.
<template>
<view class="person-page">
<image
class="icon-return"
:src="$baseUrl + 'person/icon_return.png'"
mode="aspectFit"
@click="handleReturn"
/>
<image
class="banner_upload"
:src="$baseUrl + 'person/customer.png'"
mode="aspectFit"
:data-log="{
xcxClick: '我的页面-信息修改页点击',
pageName: '我的页面-信息修改页',
buttonName: '上传背景',
}"
@click="handleUploadBackground"
/>
<image class="icon-return" :src="$baseUrl + 'person/icon_return.png'" mode="aspectFit" @click="handleReturn" />
<image class="banner_upload" :src="$baseUrl + 'person/customer.png'" mode="aspectFit" :data-log="{
xcxClick: '我的页面-信息修改页点击',
pageName: '我的页面-信息修改页',
buttonName: '上传背景',
}" @click="handleUploadBackground" />
<view class="person-header">
<image
class="banner_bg"
:src="formData.backgroundImg || $baseUrl + 'person/banner.png'"
mode="aspectFill"
/>
<image
class="banner_cover"
:src="$baseUrl + 'person/cover_white.png'"
mode="aspectFill"
/>
<image class="banner_bg" :src="formData.backgroundImg || $baseUrl + 'person/banner.png'" mode="aspectFill" />
<image class="banner_cover" :src="$baseUrl + 'person/cover_white.png'" mode="aspectFill" />
</view>
<!-- 头像 -->
<view class="person-avatar">
<view class="person-avatar-box">
<button
class="avatar-wrapper"
open-type="chooseAvatar"
@chooseavatar="onChooseAvatar"
>
<image
class="person-avatar-img"
mode="aspectFill"
:src="formData.babyAvatar || $baseUrl + 'common/default_avatar.png'"
></image>
<button class="avatar-wrapper" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
<image class="person-avatar-img" mode="aspectFill"
:src="formData.babyAvatar || $baseUrl + 'common/default_avatar.png'"></image>
</button>
</view>
<image
class="avatar-edit"
:src="$baseUrl + 'person/icon_modify.png'"
mode="widthFix"
lazy-load="false"
binderror=""
bindload=""
/>
<image class="avatar-edit" :src="$baseUrl + 'person/icon_modify.png'" mode="widthFix" lazy-load="false"
binderror="" bindload="" />
</view>
<form @submit="onSubmit">
<view class="person-info">
<block
v-for="(item, index) in formItems
.filter(formItemFilter)
.slice(
0,
formData.babyStage == 2 && pageStatus.formStatus == 2
? 6
: formItems.length
)"
:key="item.name"
>
<view
class="form-row"
:style="{
'border-bottom':
pageStatus.formStatus == 0 &&
<block v-for="(item, index) in formItems
.filter(formItemFilter)
.slice(
0,
formData.babyStage == 2 && pageStatus.formStatus == 2
? 6
: formItems.length
)" :key="item.name">
<view class="form-row" :style="{
'border-bottom':
pageStatus.formStatus == 0 &&
index == formItems.filter(formItemFilter).length - 1
? 'none'
: '1rpx solid #f2f2f2',
}"
>
? 'none'
: '1rpx solid #f2f2f2',
}">
<text class="form-label">
{{ getlabelFn(item) }}
<!-- {{ item.label }} -->
<text v-if="item.required" class="required">*</text>
</text>
<!-- 输入框类型 -->
<input
v-if="item.type === 'input'"
class="form-input"
:name="item.name"
:placeholder="item.placeholder"
v-model="formData[item.name]"
:maxlength="item.maxLength"
/>
<input v-if="item.type === 'input'" class="form-input" :name="item.name" :placeholder="item.placeholder"
v-model="formData[item.name]" :maxlength="item.maxLength" />
<!-- 只读展示类型 -->
<view v-else-if="item.type === 'display'" class="form-input-box">
<view class="form-input" style="color: #222">{{
formData[item.name] || item.placeholder
}}</view>
}}</view>
</view>
<view
v-else-if="item.type === 'display-obj'"
class="form-input-box"
>
<view v-else-if="item.type === 'display-obj'" class="form-input-box">
<view class="form-input" style="color: #222">{{
getLabelByValue(item, formData[item.name])
}}</view>
}}</view>
</view>
<!-- 选择器类型 -->
<picker-custom
v-else-if="item.type === 'picker'"
:mode="item.mode"
:range="item.range"
:value="
item.mode === 'date'
? formData[item.name]
: getPickerIndex(item)
"
:onPickerChange="(e) => onPickerChange(e, item.name)"
:onLayerVisibleChange="(e) => (pageStatus.btnStatus = !e)"
:onStatusChange="onDateStatusChange"
>
<picker-custom v-else-if="item.type === 'picker'" :mode="item.mode" :range="item.range" :value="item.mode === 'date'
? formData[item.name]
: getPickerIndex(item)
" :onPickerChange="(e) => onPickerChange(e, item.name)"
:onLayerVisibleChange="(e) => (pageStatus.btnStatus = !e)" :onStatusChange="onDateStatusChange">
<view class="form-input-box">
<view class="form-input">{{
getLabelByValue(item, formData[item.name]) || item.placeholder
}}</view>
<image
class="form-input-icon"
:src="$baseUrl + 'person/icon_arrow_yellow_right.png'"
/>
}}</view>
<image class="form-input-icon" :src="$baseUrl + 'person/icon_arrow_yellow_right.png'" />
</view>
</picker-custom>
<!-- 多选弹窗类型 -->
<view
v-else-if="item.type === 'multi-picker'"
@click="handleMultiPickerOpen(item)"
>
<view v-else-if="item.type === 'multi-picker'" @click="handleMultiPickerOpen(item)">
<view class="form-input-box">
<view class="form-input">
{{
(formData[item.name] &&
(formData[item.name].split(",").join("、").length > 11
? formData[item.name]
.split(",")
.join("、")
.slice(0, 11) + "..."
.split(",")
.join("、")
.slice(0, 11) + "..."
: formData[item.name].split(",").join("、"))) ||
item.placeholder
}}
</view>
<image
class="form-input-icon"
:src="$baseUrl + 'person/icon_arrow_yellow_right.png'"
/>
<image class="form-input-icon" :src="$baseUrl + 'person/icon_arrow_yellow_right.png'" />
</view>
</view>
<!-- 单选类型 -->
<radio-group
v-else-if="item.type === 'radio'"
@change="(e) => onRadioChange(e, item.name)"
>
<label
v-for="opt in item.options"
:key="opt.value"
class="form-radio"
>
<radio
:value="opt.value"
:checked="formData[item.name] === opt.value"
/>
<radio-group v-else-if="item.type === 'radio'" @change="(e) => onRadioChange(e, item.name)">
<label v-for="opt in item.options" :key="opt.value" class="form-radio">
<radio :value="opt.value" :checked="formData[item.name] === opt.value" />
{{ opt.label }}
</label>
</radio-group>
</view>
</block>
<view
v-if="formData.babyStage == 2"
class="form-bottom-btn"
@click="handleFormBottomBtn"
>
<view v-if="formData.babyStage == 2" class="form-bottom-btn" @click="handleFormBottomBtn">
<text class="form-bottom-text">
{{ pageStatus.formStatus == 1 ? "收起" : "展开" }}
</text>
<image
v-if="pageStatus.formStatus == 1"
class="form-bottom-icon"
:src="$baseUrl + 'person/icon_arrow_yellow_up.png'"
mode="aspectFit"
/>
<image
v-else
class="form-bottom-icon"
:src="$baseUrl + 'person/icon_arrow_yellow_down.png'"
mode="aspectFit"
/>
<image v-if="pageStatus.formStatus == 1" class="form-bottom-icon"
:src="$baseUrl + 'person/icon_arrow_yellow_up.png'" mode="aspectFit" />
<image v-else class="form-bottom-icon" :src="$baseUrl + 'person/icon_arrow_yellow_down.png'"
mode="aspectFit" />
</view>
</view>
<view class="form-bottom"></view>
......@@ -206,18 +120,11 @@
</button>
</form>
<MultiSelectLayer
v-if="multiPickerStatus && currentMultiPickerName"
v-model="multiPickerStatus"
:title="
formItems.find((i) => i.name === currentMultiPickerName)?.label +
'(多选)'
"
:options="formItems.find((i) => i.name === currentMultiPickerName)?.range"
:modelSelected="multiPickerSelected[currentMultiPickerName]"
@confirm="handleMultiPickerConfirm"
@cancel="handleMultiPickerCancel"
/>
<MultiSelectLayer v-if="multiPickerStatus && currentMultiPickerName" v-model="multiPickerStatus" :title="formItems.find((i) => i.name === currentMultiPickerName)?.label +
'(多选)'
" :options="formItems.find((i) => i.name === currentMultiPickerName)?.range"
:modelSelected="multiPickerSelected[currentMultiPickerName]" @confirm="handleMultiPickerConfirm"
@cancel="handleMultiPickerCancel" />
</view>
</template>
......@@ -579,6 +486,13 @@ const onSubmit = async (e) => {
console.log("提交数据", data);
const pregnancyStatus = babyStageMap.find((i) => i.value === formData.value.babyStage)?.label || "";
md.sensorUserLogTake({
memberid: uni.getStorageSync('memberId'),
pregnancyStatus: pregnancyStatus,
})
showLoading();
const res = await updateBabyInfo(data);
......@@ -707,8 +621,8 @@ const getLabelByValue = (item, value) => {
item.placeholder = formData.value.babyBirthday
? formData.value.babyBirthday
: formData.value.babyStage == 1
? "请选择预产日期"
: "请选择出生日期";
? "请选择预产日期"
: "请选择出生日期";
return item.placeholder;
}
return value;
......@@ -846,9 +760,11 @@ watch(
<style lang="less" scoped>
@import "@/common.less";
.person-page {
background-color: #f6f8fa;
min-height: 100vh;
.icon-return {
width: 20rpx;
height: 32rpx;
......@@ -870,6 +786,7 @@ watch(
.person-header {
position: relative;
height: 463rpx;
.banner_bg {
width: 100%;
height: 100%;
......@@ -942,6 +859,7 @@ watch(
position: relative;
z-index: 2;
box-sizing: border-box;
.form-row {
display: flex;
align-items: center;
......@@ -958,11 +876,13 @@ watch(
width: 250rpx;
color: #222;
font-size: 28rpx;
.required {
color: #b88a3a;
margin-left: -4rpx;
}
}
.form-input {
flex: 1;
color: #6f6d67;
......@@ -998,6 +918,7 @@ watch(
justify-content: center;
width: 100%;
height: 80rpx;
.form-bottom-text {
font-size: 28rpx;
color: #6f6d67;
......@@ -1015,6 +936,7 @@ watch(
height: 300rpx;
width: 100%;
}
.form-btn {
width: 686rpx;
height: 94rpx;
......
......@@ -114,11 +114,12 @@
</view>
<!-- 提示弹窗 -->
<popup-tip v-if="isTip" type="2" @statusChange="onBabyChange" @close="isTip = false"></popup-tip>
<popup-tip v-if="isTip" type="2" @statusChange="onBabyChange" @afterPhone="isShowRegisterLayer = true"
:isNotLogin="isNotLogin" @close="isTip = false"></popup-tip>
<RegisterLayer v-model="isShowRegisterLayer" @confirm="onRegisterConfirm" />
<!-- 使用封装后的日期选择器组件 -->
<DatePicker v-model:visible="visible" :default-date="time" @confirm="handleDateConfirm"
/>
<DatePicker v-model:visible="visible" :default-date="time" @confirm="handleDateConfirm" />
</view>
</view>
</template>
......@@ -133,7 +134,9 @@ import {
} from 'vue'
import {
onLoad,
onShow
onShow,
onShareAppMessage,
onShareTimeline
} from '@dcloudio/uni-app'
import {
jump,
......@@ -150,6 +153,7 @@ import {
} from '../../api/obstetric.js';
// 导入日期选择器组件
import DatePicker from '@/components/DatePicker.vue'
import RegisterLayer from '@/components/RegisterLayer.vue'
const {
proxy
} = getCurrentInstance();
......@@ -168,6 +172,8 @@ const isWxNotification = ref(true)
// 提示弹窗
const isTip = ref(false)
const isNotLogin = ref(false);
const isShowRegisterLayer = ref(false)
// 弹窗控制
const showPicker = ref(false)
......@@ -354,7 +360,7 @@ const close = (type) => {
});
}
showPicker.value = false;
}
// 选择提醒事件
const handleChange = (e) => {
......@@ -562,8 +568,19 @@ const onBabyChange = () => {
publicFn()
}
// 公共函数
const publicFn = () => {
console.log("🚀 ~ onShow ~ userStore:", userStore.babyInfo)
const publicFn =async () => {
await userStore.loadUserInfo()
console.log("🚀 ~ onShow ~ userStore:", userStore.userInfo)
isNotLogin.value = false;
if (
userStore?.userInfo?.memberId &&
userStore?.userInfo?.memberId == "not_login" || !userStore.userInfo
) {
isNotLogin.value = true;
}
const babyInfo = userStore.babyInfo
if (babyInfo && babyInfo.babyStage == 1) {
isTip.value = false
......@@ -577,6 +594,11 @@ const publicFn = () => {
isTip.value = true
}
}
const onRegisterConfirm = async () => {
isShowRegisterLayer.value = false;
await userStore.loadBabyInfo()
publicFn()
}
onShow(async () => {
await userStore.loadBabyInfo()
console.log('宝宝信息加载完成:', userStore.babyInfo)
......@@ -589,6 +611,24 @@ onMounted(() => {
pageName: "产检提醒首页"
});
})
onShareAppMessage(() => {
return {
title: "产检工具:孕检项目全掌握,产检日程不错过",
path: "/pages/postnatalCheckUp/postnatalCheckUp",
imageUrl: $baseUrl + "share/chanjian.png",
}
});
onShareTimeline(() => {
return {
title: "产检工具:孕检项目全掌握,产检日程不错过",
path: "/pages/postnatalCheckUp/postnatalCheckUp",
imageUrl: $baseUrl + "share/chanjian.png",
}
});
</script>
<style lang="less" scoped>
......
......@@ -307,7 +307,7 @@
</template>
<script setup>
import { ref, onMounted } from 'vue'
import { ref, onMounted, getCurrentInstance } from 'vue'
import { onLoad, onShareAppMessage } from "@dcloudio/uni-app";
import { useShengzhangStore } from '../../stores/shengzhangResult.js';
import { formatDate, jump, JumpType } from '../../utils/index.js';
......@@ -320,7 +320,8 @@ import md from '../../md';
const isRecords = ref(false);
const shareText = ref('')
const { proxy } = getCurrentInstance();
const $baseUrl = proxy.$baseUrl;
onLoad((options) => {
isRecords.value = options.isRecords;
// activeTab.value = isRecords.value ? 'history' : 'latest';
......@@ -699,9 +700,9 @@ const backFailHandler = () => {
onShareAppMessage(() => {
return {
title: shareText.value,
title: shareText.value || "生长测评:精准评估宝宝发育水平",
path: `/pages/shengzhangTestResult/shengzhangTestResult`,
imageUrl: ''
imageUrl: $baseUrl + "share/shengzhang.png",
}
})
......@@ -713,10 +714,21 @@ onMounted(async () => {
xcxPage: "测评结果页",
pageName: "测评结果页"
});
const userStore = useUserStore();
//获取历史记录
const historyListData = await getGrowthHistoryList();
console.log(userStore.babyInfo?.content?.id+'--------------------',shengzhangStore?.getGrowthCurveDataInfoHeight?.userDataPoints)
if(!userStore.babyInfo?.content?.id ){
jump({
type: JumpType.INNER,
url: "/pages/shengzhangTools/shengzhangTools"
})
return;
}
if(!historyListData.success || (!historyListData.data || historyListData.data.length == 0)){
showNoValBg.value = true;
return;
......@@ -761,7 +773,7 @@ onMounted(async () => {
}
}
const userStore = useUserStore();
const babyId = userStore.babyInfo?.content?.id;
const babyDataHeight = {
......
<template>
<view class="shengzhang-tools-container">
<swiper
class="banner-swiper"
:indicator-dots="swiperData?.length > 1"
:autoplay="swiperData?.length > 1"
:circular="swiperData?.length > 1"
indicator-color="#dfddd9"
indicator-active-color="#b27c1e"
:indicator-top="596"
v-if="swiperData && swiperData?.length > 0"
>
<swiper class="banner-swiper" :indicator-dots="swiperData?.length > 1" :autoplay="swiperData?.length > 1"
:circular="swiperData?.length > 1" indicator-color="#dfddd9" indicator-active-color="#b27c1e"
:indicator-top="596" v-if="swiperData && swiperData?.length > 0">
<swiper-item v-for="(item, index) in swiperData" :key="index">
<image
class="banner-img"
:src="`${$baseUrl}${item?.img}`"
mode="aspectFill"
@click="bannerHandler(item, index)"
/>
<image class="banner-img" :src="`${$baseUrl}${item?.img}`" mode="aspectFill"
@click="bannerHandler(item, index)" />
</swiper-item>
</swiper>
<!-- <image @tap="backHandler" class="btnback" :src="$baseUrl + `shengzhangTool/1001/backBtn.png`"></image>
<text class="title">生长测评</text> -->
<view class="info-container">
<!-- 顶部宝宝信息区域 -->
<view class="baby-info-section">
<view class="baby-avatar">
<image class="avatar-img" :src="babyAvatar ? babyAvatar : `https://course.feihe.com/momclub-picture/common/default_avatar.png`" mode="aspectFill"></image>
<image class="avatar-img"
:src="babyAvatar ? babyAvatar : `https://course.feihe.com/momclub-picture/common/default_avatar.png`"
mode="aspectFill"></image>
</view>
<view class="baby-details">
<view class="baby-name-row">
<text class="baby-name">{{ babyName }}</text>
<image class="change-baby-btn" @click="changeBaby" :src="`${$baseUrl}shengzhangTool/1001/changeBaby.png`" mode="aspectFit"></image>
<image class="change-baby-btn" @click="changeBaby"
:src="`${$baseUrl}shengzhangTool/1001/changeBaby.png`" mode="aspectFit"></image>
</view>
<view class="baby-info-row">
<view class="gender-age">
<image class="gender-icon" :src="babyGender == 'M' ? `${$baseUrl}shengzhangTool/1001/sex1.png` : `${$baseUrl}shengzhangTool/1001/sex0.png`" mode="aspectFit"></image>
<image class="gender-icon"
:src="babyGender == 'M' ? `${$baseUrl}shengzhangTool/1001/sex1.png` : `${$baseUrl}shengzhangTool/1001/sex0.png`"
mode="aspectFit"></image>
<text class="age-text">{{ babyAge }}</text>
</view>
<text class="birth-date">{{ formatDate(babyBirthday) }}</text>
......@@ -43,7 +37,8 @@
</view>
<view class="record-btn" @click="viewRecords">
<text class="record-text">测评记录</text>
<image class="arrow-icon" :src="`${$baseUrl}shengzhangTool/1001/close.png`" mode="aspectFit"></image>
<image class="arrow-icon" :src="`${$baseUrl}shengzhangTool/1001/close.png`" mode="aspectFit">
</image>
</view>
</view>
......@@ -56,17 +51,19 @@
<text class="label">本次测评日期</text>
<view class="date-container" @click="showDatePicker">
<text class="date-value">{{ selectedDate }}</text>
<image class="edit-icon" :src="`${$baseUrl}shengzhangTool/1001/editIcon.png`" mode="aspectFit"></image>
<image class="edit-icon" :src="`${$baseUrl}shengzhangTool/1001/editIcon.png`" mode="aspectFit">
</image>
</view>
</view>
<!-- 分割线 -->
<image class="divider-line" :src="`${$baseUrl}shengzhangTool/1001/line.png`" mode="aspectFit"></image>
<view class="feeding-row">
<text class="label">宝宝喂养方式</text>
<view class="feeding-select" @click="showFeedingPopup">
<text class="feeding-value">{{ selectedFeedText }}</text>
<image class="dropdown-icon" :src="`${$baseUrl}shengzhangTool/1001/close.png`" mode="aspectFit"></image>
<image class="dropdown-icon" :src="`${$baseUrl}shengzhangTool/1001/close.png`" mode="aspectFit">
</image>
</view>
</view>
</view>
......@@ -89,15 +86,12 @@
<view class="input-section">
<view class="input-item">
<view class="input-container">
<image class="input-bg" :src="`${$baseUrl}shengzhangTool/1001/numBg.png`" mode="aspectFit"></image>
<picker-view
class="measurement-picker"
:class="{ 'measurement-picker-disabled': isHeightTipActive }"
:value="heightPickerValue"
@change="onHeightChange"
:indicator-style="indicatorStyle"
indicator-class="date-picker"
>
<image class="input-bg" :src="`${$baseUrl}shengzhangTool/1001/numBg.png`" mode="aspectFit">
</image>
<picker-view class="measurement-picker"
:class="{ 'measurement-picker-disabled': isHeightTipActive }" :value="heightPickerValue"
@change="onHeightChange" :indicator-style="indicatorStyle"
indicator-class="date-picker">
<picker-view-column>
<view v-for="(item, index) in heightRange" :key="index" class="picker-item">
{{ item }}
......@@ -105,30 +99,20 @@
</picker-view-column>
</picker-view>
<!-- 身高输入框 -->
<input
class="measurement-input"
type="number"
:value="height"
@input="onHeightInput"
@blur="onHeightBlur"
@focus="onHeightFocus"
:disabled="isHeightTipActive"
:style="`background-image: url(${$baseUrl}shengzhangTool/1001/numBg.png); background-size: 100% 100%; background-repeat: no-repeat;`"
/>
<input class="measurement-input" type="number" :value="height" @input="onHeightInput"
@blur="onHeightBlur" @focus="onHeightFocus" :disabled="isHeightTipActive"
:style="`background-image: url(${$baseUrl}shengzhangTool/1001/numBg.png); background-size: 100% 100%; background-repeat: no-repeat;`" />
<text class="unit">cm</text>
</view>
</view>
<view class="input-item">
<view class="input-container">
<image class="input-bg" :src="`${$baseUrl}shengzhangTool/1001/numBg.png`" mode="aspectFit"></image>
<picker-view
class="measurement-picker"
:class="{ 'measurement-picker-disabled': isWeightTipActive }"
:value="weightPickerValue"
@change="onWeightChange"
:indicator-style="indicatorStyle"
indicator-class="date-picker"
>
<image class="input-bg" :src="`${$baseUrl}shengzhangTool/1001/numBg.png`" mode="aspectFit">
</image>
<picker-view class="measurement-picker"
:class="{ 'measurement-picker-disabled': isWeightTipActive }" :value="weightPickerValue"
@change="onWeightChange" :indicator-style="indicatorStyle"
indicator-class="date-picker">
<picker-view-column>
<view v-for="(item, index) in weightRange" :key="index" class="picker-item">
{{ item }}
......@@ -136,30 +120,19 @@
</picker-view-column>
</picker-view>
<!-- 体重输入框 -->
<input
class="measurement-input"
type="number"
:value="weight"
@input="onWeightInput"
@blur="onWeightBlur"
@focus="onWeightFocus"
:disabled="isWeightTipActive"
:style="`background-image: url(${$baseUrl}shengzhangTool/1001/numBg.png); background-size: 100% 100%; background-repeat: no-repeat;`"
/>
<input class="measurement-input" type="number" :value="weight" @input="onWeightInput"
@blur="onWeightBlur" @focus="onWeightFocus" :disabled="isWeightTipActive"
:style="`background-image: url(${$baseUrl}shengzhangTool/1001/numBg.png); background-size: 100% 100%; background-repeat: no-repeat;`" />
<text class="unit">kg</text>
</view>
</view>
<view class="input-item">
<view class="input-container">
<image class="input-bg" :src="`${$baseUrl}shengzhangTool/1001/numBg.png`" mode="aspectFit"></image>
<picker-view
class="measurement-picker"
:class="{ 'measurement-picker-disabled': isHeadTipActive }"
:value="headPickerValue"
@change="onHeadChange"
:indicator-style="indicatorStyle"
indicator-class="date-picker"
>
<image class="input-bg" :src="`${$baseUrl}shengzhangTool/1001/numBg.png`" mode="aspectFit">
</image>
<picker-view class="measurement-picker"
:class="{ 'measurement-picker-disabled': isHeadTipActive }" :value="headPickerValue"
@change="onHeadChange" :indicator-style="indicatorStyle" indicator-class="date-picker">
<picker-view-column>
<view v-for="(item, index) in headRange" :key="index" class="picker-item">
{{ item }}
......@@ -167,16 +140,9 @@
</picker-view-column>
</picker-view>
<!-- 头围输入框 -->
<input
class="measurement-input"
type="number"
:value="headCircumference"
@input="onHeadInput"
@blur="onHeadBlur"
@focus="onHeadFocus"
:disabled="isHeadTipActive"
:style="`background-image: url(${$baseUrl}shengzhangTool/1001/numBg.png); background-size: 100% 100%; background-repeat: no-repeat;`"
/>
<input class="measurement-input" type="number" :value="headCircumference"
@input="onHeadInput" @blur="onHeadBlur" @focus="onHeadFocus" :disabled="isHeadTipActive"
:style="`background-image: url(${$baseUrl}shengzhangTool/1001/numBg.png); background-size: 100% 100%; background-repeat: no-repeat;`" />
<text class="unit">cm</text>
</view>
</view>
......@@ -199,7 +165,8 @@
<!-- 提交按钮 -->
<view class="submit-section">
<view class="submit-btn" @click="submitData">
<image class="submit-bg" :src="`${$baseUrl}shengzhangTool/1001/submitBtn.png`" mode="aspectFit"></image>
<image class="submit-bg" :src="`${$baseUrl}shengzhangTool/1001/submitBtn.png`" mode="aspectFit">
</image>
<!-- <text class="submit-text">确认提交</text> -->
</view>
<view class="bottom-tip" @click="onClickTips">
......@@ -209,14 +176,18 @@
</view>
</view>
<view class="guide-container" v-if="guideIndex != -1" @click="guideHandler">
<image v-if="guideIndex == 0" class="guide-img0" :src="`${$baseUrl}shengzhangTool/1001/guide0.png`" mode="aspectFit"></image>
<image v-if="guideIndex == 1" class="guide-img1" :src="`${$baseUrl}shengzhangTool/1001/guide1-2.png`" mode="aspectFit"></image>
<image v-if="guideIndex == 2" class="guide-img2" :src="`${$baseUrl}shengzhangTool/1001/guide2.png`" mode="aspectFit"></image>
<image v-if="guideIndex == 0" class="guide-img0" :src="`${$baseUrl}shengzhangTool/1001/guide0.png`"
mode="aspectFit"></image>
<image v-if="guideIndex == 1" class="guide-img1" :src="`${$baseUrl}shengzhangTool/1001/guide1-2.png`"
mode="aspectFit"></image>
<image v-if="guideIndex == 2" class="guide-img2" :src="`${$baseUrl}shengzhangTool/1001/guide2.png`"
mode="aspectFit"></image>
</view>
<view class="loading-container" v-if="showLoading">
<view class="loading-content">
<view class="star-container">
<image class="loading-star" :src="`${$baseUrl}shengzhangTool/1001/loadingActImg.png`" mode="aspectFit"></image>
<image class="loading-star" :src="`${$baseUrl}shengzhangTool/1001/loadingActImg.png`"
mode="aspectFit"></image>
</view>
<view class="loading-text">
<text class="loading-title">正在计算宝宝的生长测评得分</text>
......@@ -227,49 +198,42 @@
</view>
<!-- 在页面底部添加弹窗组件 -->
<BabySwitchPopup
v-model:visible="showBabySwitchPopup"
:babyList="babyList"
v-model:selectedIndex="currentBabyIndex"
@change="onBabyChange"
/>
<BabySwitchPopup v-model:visible="showBabySwitchPopup" :babyList="babyList" v-model:selectedIndex="currentBabyIndex"
@change="onBabyChange" />
<!-- 喂养方式弹窗 -->
<BabyFeedSwitchPopup
v-model:visible="showFeedSwitchPopup"
v-model:selectedIndex="currentFeedIndex"
@change="onFeedChange"
/>
<BabyFeedSwitchPopup v-model:visible="showFeedSwitchPopup" v-model:selectedIndex="currentFeedIndex"
@change="onFeedChange" />
<!-- 日期选择弹窗 -->
<DatePickerPopup
v-model:visible="showDatePickerPopup"
v-model:selectedDate="selectedDate"
v-model:babyBirthday="babyBirthday"
@change="onDateChange"
/>
<DatePickerPopup v-model:visible="showDatePickerPopup" v-model:selectedDate="selectedDate"
v-model:babyBirthday="babyBirthday" @change="onDateChange" />
<!-- 宝宝测评提示弹窗 -->
<BabyTestTipsPopup
v-model:visible="showBabyTestTipsPopup"
/>
<popup-tip v-if="isTip" type="1" @statusChange="onBabyChange1" @close="isTip = false"></popup-tip>
<BabyTestTipsPopup v-model:visible="showBabyTestTipsPopup" />
<popup-tip v-if="isTip" type="1" @statusChange="onBabyChange1" @afterPhone="isShowRegisterLayer = true"
@close="isTip = false" :isNotLogin="isNotLogin"></popup-tip>
<RegisterLayer v-model="isShowRegisterLayer" @confirm="onRegisterConfirm" />
</template>
<script setup>
import { onMounted, ref } from 'vue'
import { onMounted, ref, getCurrentInstance, watch } from 'vue'
import BabySwitchPopup from '@/components/BabySwitchPopup.vue'
import BabyFeedSwitchPopup from '@/components/BabyFeedSwitchPopup.vue'
import DatePickerPopup from '@/components/DatePickerPopup.vue'
import BabyTestTipsPopup from '@/components/BabyTestTipsPopup.vue'
import { growthHome, guideCompleted, getGrowthCurveData,fetchShengzhangToolsJSON } from '../../api/shengzhangTools'
import { onLoad,onShow } from "@dcloudio/uni-app";
import { throttleTap,jump, JumpType, formatDate } from '../../utils/index.js';
import { growthHome, guideCompleted, getGrowthCurveData, fetchShengzhangToolsJSON } from '../../api/shengzhangTools'
import { onLoad, onShow, onShareAppMessage, onShareTimeline } from "@dcloudio/uni-app";
import { throttleTap, jump, JumpType, formatDate } from '../../utils/index.js';
import { useShengzhangStore } from '../../stores/shengzhangResult.js';
import { useUserStore } from "@/stores/user";
import md from '../../md';
import { RegisterLayer } from '@/components/RegisterLayer.vue';
import { storeToRefs } from 'pinia'
const isTip = ref(false);
const isNotLogin = ref(false);
const isShowRegisterLayer = ref(false);
const babyName = ref('宝宝名称')
const babyAge = ref('8月龄')
......@@ -282,39 +246,40 @@ const shengzhangStore = useShengzhangStore();
const guideFlag = ref(false);
const showLoading = ref(false);
const { proxy } = getCurrentInstance();
const $baseUrl = proxy.$baseUrl;
const bannerHandler = (item, index) => {
console.log(item)
let buttonName = '';
switch(index){
case 0:
buttonName = '第一张焦点图';
break;
case 1:
buttonName = '第二张焦点图';
break;
case 2:
buttonName = '第三张焦点图';
break;
case 3:
buttonName = '第四张焦点图';
break;
}
switch (index) {
case 0:
buttonName = '第一张焦点图';
break;
case 1:
buttonName = '第二张焦点图';
break;
case 2:
buttonName = '第三张焦点图';
break;
case 3:
buttonName = '第四张焦点图';
break;
}
md.sensorLogTake({
xcxClick: "生长曲线首页-banner资源位",
pageName: "生长曲线首页",
buttonName: buttonName,
});
if(item?.url != ""){
jump({
type: item.type,
url: item.url,
extra: item.extra
})
}
md.sensorLogTake({
xcxClick: "生长曲线首页-banner资源位",
pageName: "生长曲线首页",
buttonName: buttonName,
});
if (item?.url != "") {
jump({
type: item.type,
url: item.url,
extra: item.extra
})
}
}
// 首页组件逻辑
......@@ -381,10 +346,10 @@ const showDatePicker = () => {
console.log('显示日期选择器')
md.sensorPopLogTake({
xcxPopExposure: "true",
toolName: "生长曲线",
popName: "选择本次测评日期弹窗"
});
xcxPopExposure: "true",
toolName: "生长曲线",
popName: "选择本次测评日期弹窗"
});
showDatePickerPopup.value = true
}
......@@ -401,7 +366,7 @@ const showFeedingPopup = () => {
pageName: "生长曲线首页",
buttonName: "生长曲线首页-宝宝喂养方式选择-点击",
});
console.log('显示喂养方式弹窗')
showFeedSwitchPopup.value = true
currentFeedIndex.value = 1 // 默认选中"母乳+奶粉混合喂养"
......@@ -559,15 +524,15 @@ const viewRecords = () => {
}
const convertFeedingType = (type) => {
if(type == '纯母乳'){
if (type == '纯母乳') {
return 'BREAST_MILK'
}else if(type == '母乳+奶粉混合喂养'){
} else if (type == '母乳+奶粉混合喂养') {
return 'MIXED'
}else if(type == '奶粉'){
} else if (type == '奶粉') {
return 'FORMULA'
}else if(type == '母乳+辅食'){
} else if (type == '母乳+辅食') {
return 'BREAST_MILK_CF'
}else if(type == '奶粉+辅食'){
} else if (type == '奶粉+辅食') {
return 'FORMULA_CF'
}
}
......@@ -577,10 +542,10 @@ const submitData = throttleTap(async () => {
pageName: "生长曲线首页",
buttonName: "生长曲线首页-确认提交-点击",
});
showLoading.value = true;
if(headCircumference.value == 0){
if (headCircumference.value == 0) {
headCircumference.value = null;
}
const submitData = {
......@@ -595,9 +560,9 @@ const submitData = throttleTap(async () => {
await shengzhangStore.assessmentSave(submitData);
if(shengzhangStore.shengzhangInfo.success){
if (shengzhangStore.shengzhangInfo.success) {
babyId.value = shengzhangStore.shengzhangInfo.babyId;
}else{
} else {
showLoading.value = false;
return;
}
......@@ -628,8 +593,8 @@ const submitData = throttleTap(async () => {
await shengzhangStore.getGrowthCurveData(babyDataHead);
//跳转测评结果页
if(shengzhangStore.shengzhangInfo.success){
//跳转测评结果页
if (shengzhangStore.shengzhangInfo.success) {
jump({
type: JumpType.INNER,
url: "/pages/shengzhangTestResult/shengzhangTestResult"
......@@ -665,7 +630,7 @@ const onFeedChange = (feedOption, index) => {
console.log('选择了喂养方式:', feedOption, index)
selectedFeedText.value = feedOption.name
currentFeedIndex.value = index
// 这里可以更新页面上显示的喂养方式
// 比如更新 feeding-select 中的文本
}
......@@ -704,11 +669,11 @@ const toggleHeadTip = () => {
pushCount(2)
isHeadTipActive.value = !isHeadTipActive.value
if(isHeadTipActive.value){
if (isHeadTipActive.value) {
// 不改变输入框的值,只标记为暂无数据状态
tempHeadCircumference.value = headCircumference.value;
headCircumference.value = 0;
}else{
headCircumference.value = 0;
} else {
// 恢复原来的值
headCircumference.value = tempHeadCircumference.value;
}
......@@ -758,77 +723,49 @@ const guideHandler = async () => {
if (guideIndex.value > 2) {
const data = await guideCompleted();
if(data.success){
if (data.success) {
guideFlag.value = true;
guideIndex.value = -1;
}else{
} else {
//引导页完成失败,提示用户
}
}
}
const userStore = useUserStore();
const { babyInfo } = storeToRefs(userStore)
// 获取页面参数
onLoad((options) => {
if (options.babyId) {
babyId.value = parseInt(options.babyId)
console.log('获取到的babyId:', babyId.value)
}
})
watch(babyInfo, async (newVal, oldVal) => {
console.log(oldVal,'-----babyId发生变化,重新获取数据', newVal)
if((!oldVal || !oldVal?.content?.id) && newVal?.content?.id){
console.log('start重新获取数据', newVal)
await babyRefresh();
}
})
onShow(async () => {
await babyRefresh();
})
// 提示弹窗回调
const onBabyChange1= async ()=>{
const onRegisterConfirm = async () => {
isShowRegisterLayer.value = false;
await babyRefresh();
}
const babyRefresh = async () => {
const userStore = useUserStore();
const babyInfo = userStore.babyInfo;
if(babyInfo && babyInfo.babyStage == 2){
isTip.value = false
await refreshBabyInfo();
}else{
isTip.value = true;
}
// 提示弹窗回调
const onBabyChange1 = async () => {
await babyRefresh();
}
const shengzhangToolsData = ref({activeInfo:[
{
"img": "shengzhangTool/1001/banner1.png",
"url": "subPackages/shopMainList/topicNew/index?id=1000911",
"type": 2,
"extra": {
"appId": "wx4205ec55b793245e",
"envVersion": "release"
}
}
]
});
const swiperData = ref([]);
onMounted(async () => {
md.sensorLogTake({
xcxPage: "生长曲线首页",
pageName: "生长曲线首页"
});
const {data} = await fetchShengzhangToolsJSON();
if(data){
shengzhangToolsData.value = {...data};
}else{
shengzhangToolsData.value = {activeInfo:[]};
}
swiperData.value = shengzhangToolsData?.value?.activeInfo || [];
})
const refreshBabyInfo = async () => {
const userStore = useUserStore();
babyId.value = userStore.babyInfo?.content?.id;
......@@ -844,11 +781,11 @@ const refreshBabyInfo = async () => {
// (item) => item.selected
// );
const {data} = await growthHome(babyId.value);
const { data } = await growthHome(babyId.value);
selectedDate.value = formatDate(new Date());
// const data = {"babyId":1234,"babyName":"小强","gender":"M","monthAge":3,"avatar":"https://momclub.feihe.com/pmall/momclub-picture/integral/1009/yuerBtn.png","birthDate":"2018-10-28 14:06:45","guideFlag":false};
babyName.value = data.babyName
babyAge.value = data.monthAge + '月龄'
babyBirthday.value = data.birthDate
......@@ -869,33 +806,107 @@ const refreshBabyInfo = async () => {
// }
}
const babyRefresh = async () => {
const userStore = useUserStore();
await userStore.loadBabyInfo();
const babyInfo = userStore.babyInfo;
isNotLogin.value = false;
isTip.value = false
if (
userStore?.userInfo?.memberId &&
userStore?.userInfo?.memberId == "not_login" || !userStore.userInfo
) {
isNotLogin.value = true;
}
console.log(babyInfo?.babyStage + '--------------------', babyInfo)
if (babyInfo && babyInfo.babyStage == 2) {
isTip.value = false
await refreshBabyInfo();
} else {
isTip.value = true;
}
}
const shengzhangToolsData = ref({
activeInfo: [
{
"img": "shengzhangTool/1001/banner1.png",
"url": "subPackages/shopMainList/topicNew/index?id=1000911",
"type": 2,
"extra": {
"appId": "wx4205ec55b793245e",
"envVersion": "release"
}
}
]
});
const swiperData = ref([]);
onMounted(async () => {
md.sensorLogTake({
xcxPage: "生长曲线首页",
pageName: "生长曲线首页"
});
const { data } = await fetchShengzhangToolsJSON();
if (data) {
shengzhangToolsData.value = { ...data };
} else {
shengzhangToolsData.value = { activeInfo: [] };
}
swiperData.value = shengzhangToolsData?.value?.activeInfo || [];
})
onShareAppMessage(() => {
return {
title: "生长测评:精准评估宝宝发育水平",
path: "/pages/shengzhangTools/shengzhangTools",
imageUrl: $baseUrl + "share/shengzhang.png",
}
});
onShareTimeline(() => {
return {
title: "生长测评:精准评估宝宝发育水平",
path: "/pages/shengzhangTools/shengzhangTools",
imageUrl: $baseUrl + "share/shengzhang.png",
}
});
</script>
<style lang="less" scoped>
.shengzhang-tools-container {
width: 100%;
overflow-x: hidden;
overflow-y: auto;
background-color: #fdf6eb;
display: flex;
flex-flow: column;
width: 100%;
overflow-x: hidden;
overflow-y: auto;
background-color: #fdf6eb;
display: flex;
flex-flow: column;
.banner-swiper {
position: relative;
width: 687rpx;
margin-left: 32rpx;
height: 176rpx;
padding-bottom: 50rpx;
.banner-img {
width: 100%;
height: 100%;
border-radius: 16rpx;
}
}
.btnback {
position: absolute;
top: 119rpx;
......@@ -903,7 +914,7 @@ const refreshBabyInfo = async () => {
width: 29rpx;
height: 29rpx;
}
.title {
position: absolute;
top: 111rpx;
......@@ -913,7 +924,7 @@ const refreshBabyInfo = async () => {
color: #000;
font-weight: 600;
}
.info-container {
width: 750rpx;
height: 1210rpx;
......@@ -929,79 +940,79 @@ const refreshBabyInfo = async () => {
display: flex;
align-items: center;
padding: 0 10rpx;
.baby-avatar {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
overflow: hidden;
margin-right: 20rpx;
.avatar-img {
width: 100%;
height: 100%;
}
}
.baby-details {
flex: 1;
.baby-name-row {
display: flex;
align-items: center;
margin-bottom: 8rpx;
.baby-name {
font-size: 32rpx;
font-weight: bold;
color: #333;
margin-right: 20rpx;
}
.change-baby-btn {
width: 139rpx;
height: 37rpx;
}
}
.baby-info-row {
display: flex;
align-items: center;
.gender-age {
display: flex;
align-items: center;
margin-right: 30rpx;
.gender-icon {
width: 24rpx;
height: 24rpx;
margin-right: 8rpx;
}
.age-text {
font-size: 26rpx;
color: #666;
}
}
.birth-date {
font-size: 26rpx;
color: #666;
}
}
}
.record-btn {
display: flex;
align-items: center;
.record-text {
font-size: 26rpx;
color: #666;
margin-right: 8rpx;
}
.arrow-icon {
width: 20rpx;
height: 20rpx;
......@@ -1020,50 +1031,50 @@ const refreshBabyInfo = async () => {
display: flex;
align-items: center;
justify-content: space-between;
.label {
font-size: 28rpx;
color: #333;
}
.date-container {
display: flex;
align-items: center;
.date-value {
font-size: 28rpx;
color: #666;
margin-right: 10rpx;
}
.edit-icon {
width: 24rpx;
height: 24rpx;
}
}
}
.feeding-row {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 25rpx;
.label {
font-size: 28rpx;
color: #333;
}
.feeding-select {
display: flex;
align-items: center;
.feeding-value {
font-size: 28rpx;
color: #666;
margin-right: 8rpx;
}
.dropdown-icon {
width: 20rpx;
height: 20rpx;
......@@ -1075,16 +1086,16 @@ const refreshBabyInfo = async () => {
.measurement-section {
margin-bottom: 40rpx;
margin-top: 80rpx;
.measurement-header {
display: flex;
margin-bottom: 25rpx;
.measurement-item {
flex: 1;
text-align: center;
.measurement-title {
font-size: 28rpx;
color: #333;
......@@ -1092,35 +1103,35 @@ const refreshBabyInfo = async () => {
}
}
}
.input-section {
display: flex;
.input-item {
flex: 1;
display: flex;
justify-content: center;
.input-container {
position: relative;
display: flex;
align-items: center;
justify-content: center;
.input-bg {
position: absolute;
width: 105rpx;
height: 44rpx;
z-index: 1;
}
.measurement-picker {
position: relative;
z-index: 2;
width: 70rpx;
height: 370rpx;
background: transparent;
:deep(.date-picker::before) {
content: none;
}
......@@ -1133,7 +1144,7 @@ const refreshBabyInfo = async () => {
opacity: 0.4;
pointer-events: none;
}
.picker-item {
display: flex;
align-items: center;
......@@ -1145,14 +1156,14 @@ const refreshBabyInfo = async () => {
line-height: 40rpx;
}
}
.measurement-input {
position: absolute;
z-index: 3;
width: 105rpx;
height: 44rpx;
margin-top: 2rpx;
margin-top: 2rpx;
// background: #ffffff;
border: none;
font-size: 28rpx;
......@@ -1160,18 +1171,18 @@ const refreshBabyInfo = async () => {
text-align: center;
font-weight: bold;
margin-left: 0rpx;
&:disabled {
opacity: 0.4;
pointer-events: none;
}
&::placeholder {
color: #999;
font-size: 20rpx;
}
}
.unit {
position: absolute;
z-index: 2;
......@@ -1186,60 +1197,60 @@ const refreshBabyInfo = async () => {
.tips-section {
display: flex;
.tip-item0 {
flex: 1;
text-align: center;
&:hover {
opacity: 0.8;
}
.tip-text {
font-size: 24rpx;
color: #1d1e26;
text-decoration: underline;
&.tip-text-active {
color: red !important;
}
}
}
.tip-item1 {
flex: 1;
text-align: center;
&:hover {
opacity: 0.8;
}
.tip-text {
font-size: 24rpx;
color: #1d1e26;
text-decoration: underline;
&.tip-text-active {
color: red !important;
}
}
}
.tip-item2 {
// flex: 1;
position: absolute;
// text-align: center;
right: 97rpx;
&:hover {
opacity: 0.8;
}
.tip-text {
font-size: 24rpx;
color: #1d1e26;
text-decoration: underline;
&.tip-text-active {
color: red !important;
}
......@@ -1248,12 +1259,12 @@ const refreshBabyInfo = async () => {
}
}
.submit-section {
.submit-section {
position: relative;
margin-top: 130rpx;
// bottom: 50rpx;
// z-index: 666;
.submit-btn {
position: relative;
width: 681rpx;
......@@ -1262,14 +1273,14 @@ const refreshBabyInfo = async () => {
align-items: center;
justify-content: center;
margin-bottom: 20rpx;
.submit-bg {
position: absolute;
width: 100%;
height: 100%;
z-index: 1;
}
.submit-text {
position: relative;
z-index: 2;
......@@ -1278,12 +1289,12 @@ const refreshBabyInfo = async () => {
font-weight: bold;
}
}
.bottom-tip {
display: flex;
align-items: center;
justify-content: center;
.tip-icon {
width: 424rpx;
height: 23rpx;
......@@ -1292,28 +1303,31 @@ const refreshBabyInfo = async () => {
}
}
.guide-container{
.guide-container {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
height: 100%;
z-index: 1000;
.guide-img0{
.guide-img0 {
width: 100%;
height: 1624rpx;
position: absolute;
top: 0;
left: 0;
}
.guide-img1{
.guide-img1 {
width: 100%;
height: 1624rpx;
height: 1624rpx;
position: absolute;
top: 0;
left: 0;
}
.guide-img2{
.guide-img2 {
width: 100%;
height: 1624rpx;
position: absolute;
......@@ -1360,7 +1374,7 @@ const refreshBabyInfo = async () => {
align-items: center;
justify-content: center;
top: 850rpx;
.loading-title {
font-size: 32rpx;
color: #ffffff;
......@@ -1383,9 +1397,11 @@ const refreshBabyInfo = async () => {
0% {
opacity: 0.6;
}
50% {
opacity: 1;
}
100% {
opacity: 0.6;
}
......
......@@ -20,19 +20,22 @@
<view class="banner_content">
<image class="banner_img" :src="$baseUrl + `xingmaLab/1001/bannerImg0.png`" mode="aspectFill" />
</view>
<view v-for="(item, index) in cangguanList" :key="index" class="item_cangguan"
@click="handleItemClick_cangguan(item, index)">
<!-- <image class="item_cangguan_img" :src="`${item.imgUrl}`" mode="widthFix">
<image class="item_cangguan_img_up" :src="`${item.imgUrl}`" mode="widthFix"></image>
</image> -->
<view class="item_cangguan_img1"
:style="`background-image: url(${item.imgUrl}); background-size: 707rpx auto; background-repeat: no-repeat;`"
mode="widthFix">
<image class="item_cangguan_img" :src="`${item.imgUrl}`" mode="widthFix" @load="(e) => handleImageLoad(e, item, index)"></image>
<image class="item_cangguan_img_up" :src="`${item.imgUrl}`" mode="aspectFill" :style="`width: ${item.targetWidth - 30}rpx; height: ${item.targetHeight - 120}rpx;`"></image>
<view class="item_cangguan_img1"
:style="`background-image: url(${item.imgUrl}); background-size: 707rpx auto; background-repeat: no-repeat;`"
mode="widthFix">
<image class="item_cangguan_img" :src="`${item.imgUrl}`" mode="widthFix"
@load="(e) => handleImageLoad(e, item, index)"></image>
<image class="item_cangguan_img_up" :src="`${item.imgUrl}`" mode="aspectFill"
:style="`width: ${item.targetWidth - 30}rpx; height: ${item.targetHeight - 120}rpx;`">
</image>
</view>
<view class="item_cangguan_bottom">
<view class="item_cangguan_bottom_bg">
</view>
......@@ -101,29 +104,29 @@
padding="{{ [0, 12, 0, 12] }}" type="masonry">
<view v-for="(item, index) in cangpinList" :key="index" class="waterfall-item"
@click="handleItemClick_cangpin(item, index)">
<view class="item-up-content">
<image class="item-image" :src="item.imgUrl" mode="widthFix" />
<view class="item-num">
<text class="badge-num">N0.{{ item.bizNo }}</text>
</view>
<view class="item-up-content">
<image class="item-image" :src="item.imgUrl" mode="widthFix" />
<view class="item-num">
<text class="badge-num">N0.{{ item.bizNo }}</text>
</view>
<view v-if="item.state == 1" class="item-badge">
<text class="badge-text">精选推荐</text>
<text class="badge-text">精选推荐</text>
</view>
</view>
</view>
<view class="item-info">
<view class="item-info">
<view class="item-title">{{ item.content }}</view>
<view class="item-meta">
<view class="creator-info">
<view class="item-meta">
<view class="creator-info">
<image class="creator-avatar" :src="item.avatar" mode="aspectFit" />
<text class="creator-name">{{ item.nickname }}</text>
<text class="creator-name">{{ item.nickname }}</text>
</view>
</view>
</view>
</view>
</grid-view>
</scroll-view>
</view>
<!-- 我的收藏列表 -->
......@@ -156,10 +159,10 @@
<text class="badge-text">精选推荐</text>
</view>
</view>
<view class="item-info">
<view class="item-info">
<view class="item-title">{{ item.content }}</view>
<view class="item-meta">
<view class="creator-info">
<view class="item-meta">
<view class="creator-info">
<image class="creator-avatar" :src="item.avatar" mode="aspectFit" />
<text class="creator-name">{{ item.nickname }}</text>
</view>
......@@ -168,7 +171,7 @@
</view>
</grid-view>
</scroll-view>
</view>
</view>
</view>
</view>
......@@ -195,7 +198,7 @@
<!-- 无次数弹窗 - 使用 Xingmalabnotimepop 组件 -->
<Xingmalabnotimepop :visible="showNoTimePopup" title="发布次数已用完" @button-click="handleNoTimeButtonClick"
@close="showNoTimePopup = false" />
</view>
</view>
</template>
<script setup>
......@@ -233,9 +236,9 @@ const currentItemType = ref('cangguan');
// onPageScroll((e) => {
// console.log('e.scrollTop=',e);
// const newVal = e.scrollTop;
// });
const isGeting = ref(false);
......@@ -322,59 +325,59 @@ const currentItem = ref(null);
onShow(async () => {
md.sensorComponentLogTake({
xcxComponentExposure: "true",
pageName: "星妈lab首页",
componentName: "底部切换组件",
componentContent: "星妈会藏馆"
});
xcxComponentExposure: "true",
pageName: "星妈lab首页",
componentName: "底部切换组件",
componentContent: "星妈会藏馆"
});
md.sensorComponentLogTake({
xcxComponentExposure: "true",
pageName: "星妈lab首页",
componentName: "底部切换组件",
componentContent: "发布"
});
xcxComponentExposure: "true",
pageName: "星妈lab首页",
componentName: "底部切换组件",
componentContent: "发布"
});
md.sensorComponentLogTake({
xcxComponentExposure: "true",
pageName: "星妈lab首页",
componentName: "底部切换组件",
componentContent: "我的藏品"
});
xcxComponentExposure: "true",
pageName: "星妈lab首页",
componentName: "底部切换组件",
componentContent: "我的藏品"
});
md.sensorComponentLogTake({
xcxComponentExposure: "true",
pageName: "星妈lab首页",
componentName: "星妈会藏馆",
componentContent: "首页藏品"
});
xcxComponentExposure: "true",
pageName: "星妈lab首页",
componentName: "星妈会藏馆",
componentContent: "首页藏品"
});
const pages = getCurrentPages()
let currentPage = pages[pages.length - 1]
const isFavorite = currentPage?.properties?.isFavorite
const isFavorite = currentPage?.properties?.isFavorite
console.log('isFavorite=', isFavorite);
console.log('currentPage=', currentPage);
// console.log('onshow')
//1收藏,-1取消收藏,不存在刷新页面
if(!isFavorite){
if (!isFavorite) {
await xingmaLabStore.loadXingmaInfo();
await reloadCangguanList();
await reloadCangpinList();
await reloadShoucangList();
}else{
if(isFavorite == 1){
} else {
if (isFavorite == 1) {
currentItem.value.collection = true;
}else{
if(currentItemType.value == 'cangguan'){
} else {
if (currentItemType.value == 'cangguan') {
currentItem.value.collection = false;
}else{
} else {
shoucangList.value.splice(currentItem.value, 1)
}
}
}
})
const cangguanListIdx = ref(1);
......@@ -386,7 +389,7 @@ onMounted(async () => {
// await xingmaLabStore.loadXingmaInfo();
// console.log('xingmaLabStore=', xingmaLabStore.xingmaInfo);
// //获取藏馆列表
// const data1 = await fetchRecordList(cangguanListIdx.value, 4);
// cangguanList.value = cangguanList.value.concat(data1.data.list);
......@@ -477,9 +480,15 @@ const convertDobuleList = (list) => {
// 方法
const handleBack = () => {
uni.navigateBack({
delta: 1
})
if (getCurrentPages().length > 1) {
uni.navigateBack({
delta: 1
})
} else {
uni.redirectTo({
url: '/pages/index/index?pageType=my'
})
}
}
const switchTab = (tab) => {
......@@ -491,8 +500,8 @@ const switchTab = (tab) => {
//我的藏品/我的收藏tab
const switchSubTab = async (subTab) => {
if(subTab == 'collections'){
if(currentFrontNavType != 'collections'){
if (subTab == 'collections') {
if (currentFrontNavType != 'collections') {
currentFrontNavType = 'collections'
md.sensorComponentLogTake({
......@@ -506,8 +515,8 @@ const switchSubTab = async (subTab) => {
}
}else if(subTab == 'favorites'){
if(currentFrontNavType != 'favorites'){
} else if (subTab == 'favorites') {
if (currentFrontNavType != 'favorites') {
md.sensorComponentLogTake({
xcxComponentClick: "true",
pageName: "星妈lab首页",
......@@ -570,7 +579,7 @@ const handleBottomNavClick = async (navType) => {
// 点击"星妈会藏馆"时,切换到藏馆tab,展示单列列表
activeTab.value = 'cangguan'
if(currentButtomNavType != 'cangguan'){
if (currentButtomNavType != 'cangguan') {
md.sensorComponentLogTake({
xcxComponentExposure: "true",
pageName: "星妈lab首页",
......@@ -591,19 +600,19 @@ const handleBottomNavClick = async (navType) => {
});
md.sensorComponentLogTake({
xcxComponentExposure: "true",
pageName: "星妈lab-我的藏品页",
componentName: "我的藏品",
componentContent: "我的藏品-藏品标题"
});
xcxComponentExposure: "true",
pageName: "星妈lab-我的藏品页",
componentName: "我的藏品",
componentContent: "我的藏品-藏品标题"
});
// 点击"我的藏品"时,切换到我的藏馆tab,默认展示我的藏品
activeTab.value = 'wodecangguan'
if(currentButtomNavType != 'wodecangguan'){
if (currentButtomNavType != 'wodecangguan') {
currentButtomNavType = 'wodecangguan';
if(currentFrontNavType == ''){
if(!(cangpinList.value && cangpinList.value.length > 0)){
if (currentFrontNavType == '') {
if (!(cangpinList.value && cangpinList.value.length > 0)) {
md.sensorComponentLogTake({
xcxComponentExposure: "true",
pageName: "星妈lab-我的藏品页",
......@@ -611,7 +620,7 @@ const handleBottomNavClick = async (navType) => {
componentContent: "我的藏品-去发布"
});
}
// else{
// md.sensorComponentLogTake({
// xcxComponentExposure: "true",
......@@ -625,10 +634,10 @@ const handleBottomNavClick = async (navType) => {
currentFrontNavType = 'collections'
// await reloadCangpinList();
}else{
} else {
currentFrontNavType = activeSubTab.value;
if(activeSubTab.value == 'collections'){
if(!(cangpinList.value && cangpinList.value.length > 0)){
if (activeSubTab.value == 'collections') {
if (!(cangpinList.value && cangpinList.value.length > 0)) {
md.sensorComponentLogTake({
xcxComponentExposure: "true",
......@@ -637,7 +646,7 @@ const handleBottomNavClick = async (navType) => {
componentContent: "我的藏品-去发布"
});
}
// else{
// md.sensorComponentLogTake({
// xcxComponentExposure: "true",
......@@ -648,7 +657,7 @@ const handleBottomNavClick = async (navType) => {
// }
// await reloadCangpinList();
//走onshow刷新,因为去发布按钮埋点
}else{
} else {
// md.sensorComponentLogTake({
// xcxComponentExposure: "true",
// pageName: "星妈lab-我的藏品页",
......@@ -668,11 +677,11 @@ const handleItemClick_cangguan = (item, index) => {
currentItem.value = item;
currentItemType.value = 'cangguan';
md.sensorComponentLogTake({
xcxComponentClick: "true",
pageName: "星妈lab首页",
componentName: "星妈会藏馆",
componentContent: `首页藏品-藏品标题${item.content}`
});
xcxComponentClick: "true",
pageName: "星妈lab首页",
componentName: "星妈会藏馆",
componentContent: `首页藏品-藏品标题${item.content}`
});
// 这里可以添加跳转逻辑
uni.navigateTo({
......@@ -729,12 +738,12 @@ const handlePublish = () => {
const handleNoTimeButtonClick = () => {
showNoTimePopup.value = false
// // 显示更详细的发布次数信息
// const { currentMonthPublishCount, maxPublishCount, remainingPublishCount } = xingmaLabStore.xingmaInfo
// uni.showToast({
// title: `本月已发布${currentMonthPublishCount}次,剩余${remainingPublishCount}次`,
// icon: 'none',
// duration: 3000
// // 显示更详细的发布次数信息
// const { currentMonthPublishCount, maxPublishCount, remainingPublishCount } = xingmaLabStore.xingmaInfo
// uni.showToast({
// title: `本月已发布${currentMonthPublishCount}次,剩余${remainingPublishCount}次`,
// icon: 'none',
// duration: 3000
// })
}
</script>
......
......@@ -71,7 +71,7 @@ export const useUserStore = defineStore("userInfo", {
* @param {Object} data : {encryptedData, iv, code}
* @returns
*/
async phoneCallback(data, onOpenRegisterFn = () => { }) {
async phoneCallback(data, onOpenRegisterFn = () => { }, cb) {
uni.login({
provider: "weixin",
success: async (res) => {
......@@ -86,7 +86,11 @@ export const useUserStore = defineStore("userInfo", {
code: data.code,
codeLogin: res.code,
});
!babyExistence && onOpenRegisterFn && onOpenRegisterFn();
if (!babyExistence.value && cb) {
cb();
}
const homeStore = useHomeStore();
await homeStore.setBabyExistence(babyExistence);
......@@ -115,7 +119,7 @@ export const useUserStore = defineStore("userInfo", {
// 缓存用户memberId
uni.setStorageSync('memberId', data?.memberId)
}
this.userInfo = data;
this.userInfo = data;
},
setBabyNickCache(id, name) {
......
......@@ -36,7 +36,7 @@ export function jump({ type, url, extra = {} }) {
console.log("jumpParams:", jumpParams);
if(extra.embedded){
if(extra.embedded || jumpParams.appId === 'wx4205ec55b793245e'){ // 星妈优选的小程序都为半屏拉起
uni.openEmbeddedMiniProgram(jumpParams);
}else{
uni.navigateToMiniProgram(jumpParams);
......
......@@ -58,7 +58,7 @@
<swiper-item v-for="(item, index) in toolList.tools" :key="index"
:class="['swiperItem', { 'active': currentIndex === index }]">
<view class="tool">
<button v-if="homeStore && !homeStore.isLogin && item.title!='星妈起名' && item.title!='体质测试'"
<button v-if="homeStore && !homeStore.isLogin && item.title!='星妈起名' && item.title!='喂养工具' && item.title!='产检提醒' && item.title!='宝宝生长测评' && item.title!='体质测试'"
open-type="getPhoneNumber" @getphonenumber="onGetPhoneNumber" class="sq_btn"></button>
<image class="tool_bg" :src="$baseUrl + item.icon" @tap="handleToolClick(item)">
</image>
......
......@@ -100,8 +100,9 @@
<view class="tool-list">
<view class="tool-item" v-for="item in toolList" :key="item.title" @click="handleToolClick(item)">
<image class="tool-icon" :src="$baseUrl + item.bgUrl" mode="aspectFit" />
<!-- || item.title == '产检提醒' || item.title == '喂养记录' || item.title == '生长测评' -->
<button
v-if="(item.title == '医生问诊' || item.title == '产检提醒' || item.title == '喂养记录' || item.title == '生长测评') && !cfgStatus.isRegister"
v-if="(item.title == '医生问诊') && !cfgStatus.isRegister"
class="tool-btn-register" type="primary" open-type="getPhoneNumber"
@getphonenumber="getRealtimePhoneNumber" />
</view>
......@@ -268,7 +269,7 @@ const handleToolClick = async (item) => {
}
// 三个工具校验是否授权
else if (item.title === "生长测评" || item.title === "喂养记录" || item.title === "产检提醒") {
if (!cfgStatus.value.isRegister) return;
// if (!cfgStatus.value.isRegister) return;
jump({ type: item.link.type, url: item.link.url });
}
else {
......@@ -404,6 +405,8 @@ const initData = async () => {
// 已出生或孕中显示
cfgStatus.value.showDetail = __showDetail;
if (__showDetail) {
wheelOptions.value =
babyInfo.value.babyStage == 2
......
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