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

6666666

parent b83d595c
...@@ -16,4 +16,6 @@ export const assessmentSave = (data) => api.post('/c/growth/assessment/save', da ...@@ -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 getGrowthCurveData = (babyData) => api.post('/c/growth/curve/data', babyData);
export const getGrowthHistoryList = () => api.post('/c/growth/history/list'); 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'}); // 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' ...@@ -297,7 +297,7 @@ import { ref, onMounted } from 'vue'
import { onLoad } from "@dcloudio/uni-app"; import { onLoad } 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';
import { getGrowthHistoryList } from '../../api/shengzhangTools'; import { getGrowthHistoryList,getGrowthAssessmentDetail } from '../../api/shengzhangTools';
import ShengzhangQuxianTipsPopup from '../../components/shengzhangQuxianTipsPopup.vue'; import ShengzhangQuxianTipsPopup from '../../components/shengzhangQuxianTipsPopup.vue';
const isRecords = ref(false); const isRecords = ref(false);
...@@ -433,7 +433,6 @@ const generateCurveData1 = (lineData, type, arrayName, minOrMax) =>{ ...@@ -433,7 +433,6 @@ const generateCurveData1 = (lineData, type, arrayName, minOrMax) =>{
point[type] = minOrMax === 'min' ? element?.[arrayName]?.min : element?.[arrayName]?.max point[type] = minOrMax === 'min' ? element?.[arrayName]?.min : element?.[arrayName]?.max
data.push(point); data.push(point);
}); });
return data; return data;
} }
// slightHighRange // slightHighRange
...@@ -558,13 +557,13 @@ const getYAxisLabel = () => { ...@@ -558,13 +557,13 @@ const getYAxisLabel = () => {
*/ */
const getYTicks = () => { const getYTicks = () => {
if (activeCurveTab.value === 'height') { 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') { } 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') { } 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 () => { ...@@ -660,7 +659,16 @@ onMounted(async () => {
const shengzhangStore = useShengzhangStore(); const shengzhangStore = useShengzhangStore();
if(isRecords.value){ if(isRecords.value){
if(historyListData.success){ 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 = { const babyDataHeight = {
...@@ -711,7 +719,7 @@ onMounted(async () => { ...@@ -711,7 +719,7 @@ onMounted(async () => {
curveDataPostWeight.value = shengzhangStore.getGrowthCurveDataInfoWeight.curveData; curveDataPostWeight.value = shengzhangStore.getGrowthCurveDataInfoWeight.curveData;
curveDataPostHead.value = shengzhangStore.getGrowthCurveDataInfoHead.curveData; curveDataPostHead.value = shengzhangStore.getGrowthCurveDataInfoHead.curveData;
console.log('curveDataPostHeight.value=', curveDataPostHeight.value); console.log('curveDataPostHeight.value=', curveDataPostHeight.value);
standardCurves.value = { standardCurves.value = {
height: { height: {
// slightlyLow: generateCurveData(45, 105, 'height'), // slightlyLow: generateCurveData(45, 105, 'height'),
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<!-- 顶部宝宝信息区域 --> <!-- 顶部宝宝信息区域 -->
<view class="baby-info-section"> <view class="baby-info-section">
<view class="baby-avatar"> <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>
<view class="baby-details"> <view class="baby-details">
<view class="baby-name-row"> <view class="baby-name-row">
...@@ -231,6 +231,7 @@ import { growthHome, guideCompleted, getGrowthCurveData } from '../../api/shengz ...@@ -231,6 +231,7 @@ import { growthHome, guideCompleted, getGrowthCurveData } from '../../api/shengz
import { onLoad } from "@dcloudio/uni-app"; import { onLoad } from "@dcloudio/uni-app";
import { throttleTap,jump, JumpType, formatDate } from '../../utils/index.js'; import { throttleTap,jump, JumpType, formatDate } from '../../utils/index.js';
import { useShengzhangStore } from '../../stores/shengzhangResult.js'; import { useShengzhangStore } from '../../stores/shengzhangResult.js';
import { useUserStore } from "@/stores/user";
const swiperData = ref([ const swiperData = ref([
{ bannerImg: `shengzhangTool/1001/banner1.png` }, { bannerImg: `shengzhangTool/1001/banner1.png` },
...@@ -396,8 +397,8 @@ const submitData = throttleTap(async () => { ...@@ -396,8 +397,8 @@ const submitData = throttleTap(async () => {
await shengzhangStore.assessmentSave(submitData); const data11 = await shengzhangStore.assessmentSave(submitData);
console.log('data11=', data11);
const babyDataHeight = { const babyDataHeight = {
babyId: babyId.value, babyId: babyId.value,
...@@ -576,6 +577,9 @@ onLoad((options) => { ...@@ -576,6 +577,9 @@ onLoad((options) => {
}) })
onMounted(async () => { 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} = 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}; // 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", { ...@@ -26,8 +26,8 @@ export const useShengzhangStore = defineStore("shengzhangInfo", {
async assessmentSave(submitData) { async assessmentSave(submitData) {
const data = await assessmentSave(submitData); const data = await assessmentSave(submitData);
data.data.success = data.success;
if(data.success){ if(data.success){
data.data.success = data.success;
this.setShengzhangInfo(data.data); this.setShengzhangInfo(data.data);
} }
}, },
......
...@@ -449,14 +449,14 @@ onMounted(async () => { ...@@ -449,14 +449,14 @@ onMounted(async () => {
babyId.value = userStore.babyInfo?.allBabyBaseInfo.find( babyId.value = userStore.babyInfo?.allBabyBaseInfo.find(
(item) => item.selected (item) => item.selected
)?.id; )?.id;
console.log('babyIdsdfsdfsdfsdfsdfsdfdsfsdf=', babyId.value); console.log('babyIdsdfsdfsdfsdfsdfsdfdsfsdf=', babyId.value);
const a = { const a = {
"bgUrl": "my/babytest.png", "bgUrl": "my/babytest.png",
"desc": "生长测评", "desc": "生长测评",
"link": { "link": {
"extra": {babyId: babyId.value},
"type": 1, "type": 1,
"url": "/pages/shengzhangTools/shengzhangTools" "url": "/pages/shengzhangTools/shengzhangTools?babyId="
}, },
"title": "生长测评" "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