Commit 803d409c authored by weishengfei's avatar weishengfei

refactor(My): 移除未使用的代码块

- 注释掉获取宝宝信息的代码
- 删除与产检提醒、喂养记录和生长测评相关的冗余逻辑
- 简化了 handleToolClick 函数,移除了不必要的条件判断
parent 970912f7
...@@ -187,7 +187,7 @@ const handleToolClick = async (item) => { ...@@ -187,7 +187,7 @@ const handleToolClick = async (item) => {
// 跳转产检提醒页面判断 // 跳转产检提醒页面判断
let listData = userStore.babyInfo ? userStore.babyInfo.allBabyBaseInfo : [] // let listData = userStore.babyInfo ? userStore.babyInfo.allBabyBaseInfo : []
if (item.title === "医生问诊") { if (item.title === "医生问诊") {
if (!cfgStatus.value.isRegister) return; if (!cfgStatus.value.isRegister) return;
...@@ -220,63 +220,6 @@ const handleToolClick = async (item) => { ...@@ -220,63 +220,6 @@ const handleToolClick = async (item) => {
}, },
}, },
}); });
} else if(item.title === "产检提醒"){
if (!cfgStatus.value.isRegister) return;
if(listData.length > 0){
const hasPregnancy = listData.some(item => item.babyStage === 1 && item.selected === true )
console.log(hasPregnancy, 'hasPregnancy')
if(hasPregnancy){
jump({ type: item.link.type, url: item.link.url});
} else{
uni.showToast({
title: "需要是孕中状态才可以进入哦",
icon: "none",
});
}
} else{
uni.showToast({
title: "需要是孕中状态才可以进入哦",
icon: "none",
});
}
} else if (item.title === "喂养记录") {
if (!cfgStatus.value.isRegister) return;
if (listData.length > 0) {
const hasBirth = listData.some(item => item.babyStage === 2 && item.selected === true )
console.log(hasBirth,listData, 'hasBirth')
if (hasBirth) {
jump({ type: item.link.type, url: item.link.url });
}else{
uni.showToast({
title: "需要已生育宝宝的状态才可以进入哦",
icon: "none",
});
}
} else {
uni.showToast({
title: "需要已生育宝宝的状态才可以进入哦",
icon: "none",
});
}
} else if(item.title === '生长测评'){
if (!cfgStatus.value.isRegister) return;
if(listData.length > 0){
const hasPregnancy = listData.some(item => item.babyStage === 2 && item.selected === true )
if(hasPregnancy){
jump({ type: item.link.type, url: item.link.url});
} else{
uni.showToast({
title: "需要已生育宝宝的状态才可以进入哦",
icon: "none",
});
}
}else{
uni.showToast({
title: "需要已生育宝宝的状态才可以进入哦",
icon: "none",
});
}
} else { } else {
jump({ type: item.link.type, url: item.link.url}); jump({ type: item.link.type, url: item.link.url});
// const extra = item.link.extra; // const extra = item.link.extra;
...@@ -287,7 +230,6 @@ const handleToolClick = async (item) => { ...@@ -287,7 +230,6 @@ const handleToolClick = async (item) => {
// } // }
} }
}; };
//跳转到ai取名页面 //跳转到ai取名页面
// const toAiNaming = () => { // const toAiNaming = () => {
// jump({ // jump({
......
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