Commit 4063e012 authored by 王炽's avatar 王炽

6666666

parent b83d595c
......@@ -16,4 +16,6 @@ export const assessmentSave = (data) => api.post('/c/growth/assessment/save', da
export const getGrowthCurveData = (babyData) => api.post('/c/growth/curve/data', babyData);
export const getGrowthHistoryList = () => api.post('/c/growth/history/list');
export const getGrowthAssessmentDetail = (assessmentId) => api.post('/c/growth/assessment/detail', { assessmentId });
// export const fetchHomeJSON = () => api.get('/c/front/content',{type:'home'});
\ No newline at end of file
......@@ -297,7 +297,7 @@ import { ref, onMounted } from 'vue'
import { onLoad } from "@dcloudio/uni-app";
import { useShengzhangStore } from '../../stores/shengzhangResult.js';
import { formatDate, jump, JumpType } from '../../utils/index.js';
import { getGrowthHistoryList } from '../../api/shengzhangTools';
import { getGrowthHistoryList,getGrowthAssessmentDetail } from '../../api/shengzhangTools';
import ShengzhangQuxianTipsPopup from '../../components/shengzhangQuxianTipsPopup.vue';
const isRecords = ref(false);
......@@ -433,7 +433,6 @@ const generateCurveData1 = (lineData, type, arrayName, minOrMax) =>{
point[type] = minOrMax === 'min' ? element?.[arrayName]?.min : element?.[arrayName]?.max
data.push(point);
});
return data;
}
// slightHighRange
......@@ -558,13 +557,13 @@ const getYAxisLabel = () => {
*/
const getYTicks = () => {
if (activeCurveTab.value === 'height') {
return [40, 50, 60, 70, 80, 90, 100]
return [40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170]
} else if (activeCurveTab.value === 'weight') {
return [0, 3, 6, 9, 12, 15, 18]
return [0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50]
} else if (activeCurveTab.value === 'head') {
return [0, 3, 6, 9, 12, 15, 18]
return [20, 25, 30, 35, 40, 45, 50, 55, 60]
}
return [40, 50, 60, 70, 80, 90, 100]
return [40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170]
}
// 显示生长曲线提示
......@@ -660,7 +659,16 @@ onMounted(async () => {
const shengzhangStore = useShengzhangStore();
if(isRecords.value){
if(historyListData.success){
shengzhangInfo = historyListData.data[0];
if(historyListData.data && historyListData.data.length > 0){
shengzhangInfo = historyListData.data[0];
const detailData = await getGrowthAssessmentDetail(shengzhangInfo.id);
if(detailData.success){
shengzhangInfo = detailData.data;
}
}
}
const babyDataHeight = {
......@@ -711,7 +719,7 @@ onMounted(async () => {
curveDataPostWeight.value = shengzhangStore.getGrowthCurveDataInfoWeight.curveData;
curveDataPostHead.value = shengzhangStore.getGrowthCurveDataInfoHead.curveData;
console.log('curveDataPostHeight.value=', curveDataPostHeight.value);
standardCurves.value = {
height: {
// slightlyLow: generateCurveData(45, 105, 'height'),
......
......@@ -25,7 +25,7 @@
<!-- 顶部宝宝信息区域 -->
<view class="baby-info-section">
<view class="baby-avatar">
<image class="avatar-img" :src="`${$baseUrl}${babyAvatar}`" 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">
......@@ -231,6 +231,7 @@ import { growthHome, guideCompleted, getGrowthCurveData } from '../../api/shengz
import { onLoad } from "@dcloudio/uni-app";
import { throttleTap,jump, JumpType, formatDate } from '../../utils/index.js';
import { useShengzhangStore } from '../../stores/shengzhangResult.js';
import { useUserStore } from "@/stores/user";
const swiperData = ref([
{ bannerImg: `shengzhangTool/1001/banner1.png` },
......@@ -396,8 +397,8 @@ const submitData = throttleTap(async () => {
await shengzhangStore.assessmentSave(submitData);
const data11 = await shengzhangStore.assessmentSave(submitData);
console.log('data11=', data11);
const babyDataHeight = {
babyId: babyId.value,
......@@ -576,6 +577,9 @@ onLoad((options) => {
})
onMounted(async () => {
const userStore = useUserStore();
babyId.value = userStore.babyInfo?.content?.id;
console.log('babyId.value=', babyId.value);
const {data} = await growthHome(babyId.value);
// 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};
......
......@@ -26,8 +26,8 @@ export const useShengzhangStore = defineStore("shengzhangInfo", {
async assessmentSave(submitData) {
const data = await assessmentSave(submitData);
data.data.success = data.success;
if(data.success){
data.data.success = data.success;
this.setShengzhangInfo(data.data);
}
},
......
......@@ -449,14 +449,14 @@ onMounted(async () => {
babyId.value = userStore.babyInfo?.allBabyBaseInfo.find(
(item) => item.selected
)?.id;
console.log('babyIdsdfsdfsdfsdfsdfsdfdsfsdf=', babyId.value);
const a = {
"bgUrl": "my/babytest.png",
"desc": "生长测评",
"link": {
"extra": {babyId: babyId.value},
"type": 1,
"url": "/pages/shengzhangTools/shengzhangTools"
"url": "/pages/shengzhangTools/shengzhangTools?babyId="
},
"title": "生长测评"
}
......
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