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

feat: backup

parent 2f99e2c5
...@@ -161,7 +161,14 @@ const onAdd = () => { ...@@ -161,7 +161,14 @@ const onAdd = () => {
modifyState() modifyState()
break; break;
case '3': case '3':
uni.navigateBack() if (getCurrentPages().length > 1) {
uni.navigateBack()
} else {
uni.reLaunch({
url: '/pages/index/index'
})
}
break; break;
default: default:
break; break;
......
This diff is collapsed.
...@@ -114,7 +114,9 @@ ...@@ -114,7 +114,9 @@
</view> </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" />
...@@ -151,6 +153,7 @@ import { ...@@ -151,6 +153,7 @@ import {
} from '../../api/obstetric.js'; } from '../../api/obstetric.js';
// 导入日期选择器组件 // 导入日期选择器组件
import DatePicker from '@/components/DatePicker.vue' import DatePicker from '@/components/DatePicker.vue'
import RegisterLayer from '@/components/RegisterLayer.vue'
const { const {
proxy proxy
} = getCurrentInstance(); } = getCurrentInstance();
...@@ -169,6 +172,8 @@ const isWxNotification = ref(true) ...@@ -169,6 +172,8 @@ const isWxNotification = ref(true)
// 提示弹窗 // 提示弹窗
const isTip = ref(false) const isTip = ref(false)
const isNotLogin = ref(false);
const isShowRegisterLayer = ref(false)
// 弹窗控制 // 弹窗控制
const showPicker = ref(false) const showPicker = ref(false)
...@@ -563,8 +568,19 @@ const onBabyChange = () => { ...@@ -563,8 +568,19 @@ const onBabyChange = () => {
publicFn() publicFn()
} }
// 公共函数 // 公共函数
const publicFn = () => { const publicFn =async () => {
console.log("🚀 ~ onShow ~ userStore:", userStore.babyInfo)
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 const babyInfo = userStore.babyInfo
if (babyInfo && babyInfo.babyStage == 1) { if (babyInfo && babyInfo.babyStage == 1) {
isTip.value = false isTip.value = false
...@@ -578,6 +594,11 @@ const publicFn = () => { ...@@ -578,6 +594,11 @@ const publicFn = () => {
isTip.value = true isTip.value = true
} }
} }
const onRegisterConfirm = async () => {
isShowRegisterLayer.value = false;
await userStore.loadBabyInfo()
publicFn()
}
onShow(async () => { onShow(async () => {
await userStore.loadBabyInfo() await userStore.loadBabyInfo()
console.log('宝宝信息加载完成:', userStore.babyInfo) console.log('宝宝信息加载完成:', userStore.babyInfo)
......
...@@ -307,7 +307,7 @@ ...@@ -307,7 +307,7 @@
</template> </template>
<script setup> <script setup>
import { ref, onMounted } from 'vue' import { ref, onMounted, getCurrentInstance } from 'vue'
import { onLoad, onShareAppMessage } from "@dcloudio/uni-app"; import { onLoad, onShareAppMessage } from "@dcloudio/uni-app";
import { useShengzhangStore } from '../../stores/shengzhangResult.js'; import { useShengzhangStore } from '../../stores/shengzhangResult.js';
import { formatDate, jump, JumpType } from '../../utils/index.js'; import { formatDate, jump, JumpType } from '../../utils/index.js';
...@@ -320,7 +320,8 @@ import md from '../../md'; ...@@ -320,7 +320,8 @@ import md from '../../md';
const isRecords = ref(false); const isRecords = ref(false);
const shareText = ref('') const shareText = ref('')
const { proxy } = getCurrentInstance();
const $baseUrl = proxy.$baseUrl;
onLoad((options) => { onLoad((options) => {
isRecords.value = options.isRecords; isRecords.value = options.isRecords;
// activeTab.value = isRecords.value ? 'history' : 'latest'; // activeTab.value = isRecords.value ? 'history' : 'latest';
...@@ -699,9 +700,9 @@ const backFailHandler = () => { ...@@ -699,9 +700,9 @@ const backFailHandler = () => {
onShareAppMessage(() => { onShareAppMessage(() => {
return { return {
title: shareText.value, title: shareText.value || "生长测评:精准评估宝宝发育水平",
path: `/pages/shengzhangTestResult/shengzhangTestResult`, path: `/pages/shengzhangTestResult/shengzhangTestResult`,
imageUrl: '' imageUrl: $baseUrl + "share/shengzhang.png",
} }
}) })
...@@ -713,7 +714,16 @@ onMounted(async () => { ...@@ -713,7 +714,16 @@ onMounted(async () => {
xcxPage: "测评结果页", xcxPage: "测评结果页",
pageName: "测评结果页" 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(); const historyListData = await getGrowthHistoryList();
...@@ -761,7 +771,7 @@ onMounted(async () => { ...@@ -761,7 +771,7 @@ onMounted(async () => {
} }
} }
const userStore = useUserStore();
const babyId = userStore.babyInfo?.content?.id; const babyId = userStore.babyInfo?.content?.id;
const babyDataHeight = { const babyDataHeight = {
......
...@@ -802,14 +802,15 @@ const babyRefresh = async () => { ...@@ -802,14 +802,15 @@ const babyRefresh = async () => {
const userStore = useUserStore(); const userStore = useUserStore();
const babyInfo = userStore.babyInfo; const babyInfo = userStore.babyInfo;
isNotLogin.value = false; isNotLogin.value = false;
isTip.value = false
if ( if (
userStore?.userInfo?.memberId && userStore?.userInfo?.memberId &&
userStore?.userInfo?.memberId == "not_login" || !userStore.userInfo userStore?.userInfo?.memberId == "not_login" || !userStore.userInfo
) { ) {
isNotLogin.value = true; isNotLogin.value = true;
} }
console.log(babyInfo?.babyStage+'--------------------',babyInfo)
if (babyInfo && babyInfo.babyStage == 2) { if (babyInfo && babyInfo.babyStage == 2) {
isTip.value = false isTip.value = false
await refreshBabyInfo(); 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