Commit 40699575 authored by 张九刚's avatar 张九刚

feat: backup

parent 2f99e2c5
......@@ -161,7 +161,14 @@ const onAdd = () => {
modifyState()
break;
case '3':
uni.navigateBack()
if (getCurrentPages().length > 1) {
uni.navigateBack()
} else {
uni.reLaunch({
url: '/pages/index/index'
})
}
break;
default:
break;
......
This diff is collapsed.
......@@ -114,7 +114,9 @@
</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" />
......@@ -151,6 +153,7 @@ import {
} from '../../api/obstetric.js';
// 导入日期选择器组件
import DatePicker from '@/components/DatePicker.vue'
import RegisterLayer from '@/components/RegisterLayer.vue'
const {
proxy
} = getCurrentInstance();
......@@ -169,6 +172,8 @@ const isWxNotification = ref(true)
// 提示弹窗
const isTip = ref(false)
const isNotLogin = ref(false);
const isShowRegisterLayer = ref(false)
// 弹窗控制
const showPicker = ref(false)
......@@ -563,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
......@@ -578,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)
......
......@@ -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,7 +714,16 @@ onMounted(async () => {
xcxPage: "测评结果页",
pageName: "测评结果页"
});
const userStore = useUserStore();
console.log(userStore.babyInfo?.content?.id+'--------------------',shengzhangStore?.getGrowthCurveDataInfoHeight?.userDataPoints)
if(!userStore.babyInfo?.content?.id || !shengzhangStore?.getGrowthCurveDataInfoHeight?.userDataPoints){
jump({
type: JumpType.INNER,
url: "/pages/shengzhangTools/shengzhangTools"
})
return;
}
//获取历史记录
const historyListData = await getGrowthHistoryList();
......@@ -761,7 +771,7 @@ onMounted(async () => {
}
}
const userStore = useUserStore();
const babyId = userStore.babyInfo?.content?.id;
const babyDataHeight = {
......
......@@ -802,14 +802,15 @@ const babyRefresh = async () => {
const userStore = useUserStore();
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();
......
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