修复...

This commit is contained in:
2022-02-14 11:44:49 +08:00
parent b3739a9d8d
commit db94c6b962
14 changed files with 762 additions and 812 deletions

View File

@@ -11,21 +11,18 @@
<!-- 进度 --> <!-- 进度 -->
<view class="plan"> <view class="plan">
<view class="plan-1"> <view class="plan-1">
<span>基本信息</span> <span>基本信息</span> <u-line-progress :percentage="percentplan1" activeColor="#34ce98" class="line-progress" :showText="false" />
<u-line-progress :percentage="percentplan1" activeColor="#34ce98" class="line-progress" :showText="false" />
</view> </view>
<view class="plan-2"> <view class="plan-2">
<span>健康目标</span> <span>健康目标</span> <u-line-progress :percentage="percentplan2" activeColor="#34ce98" width="200rpx" class="line-progress" :showText="false" />
<u-line-progress :percentage="percentplan2" activeColor="#34ce98" width="200rpx" class="line-progress" :showText="false" />
</view> </view>
<view class="plan-3"> <view class="plan-3">
<span>行为习惯</span> <span>行为习惯</span> <u-line-progress :percentage="percentplan3" activeColor="#34ce98" width="200rpx" class="line-progress" :showText="false" />
<u-line-progress :percentage="percentplan3" activeColor="#34ce98" width="200rpx" class="line-progress" :showText="false" />
</view> </view>
</view> </view>
<!-- 进度1 基本信息 --> <!-- 进度1 基本信息 -->
<view> <block>
<!-- 进度1 基本信息页面展示 性别 --> <!-- 进度1 基本信息页面展示 性别 -->
<view class="plan-content" v-if="sexShow"> <view class="plan-content" v-if="sexShow">
<view class="info-des">生理性别和激素会影响我们的身体代谢食物的方式</view> <view class="info-des">生理性别和激素会影响我们的身体代谢食物的方式</view>
@@ -47,19 +44,7 @@
<view class="age"> <view class="age">
<view class="info-title">你的出生日期是</view> <view class="info-title">你的出生日期是</view>
<view class="year" @change="dateShow = true">{{ showBirthday }}</view> <view class="year" @change="dateShow = true">{{ showBirthday }}</view>
<u-datetime-picker <u-datetime-picker confirmColor="#34ce98" ref="datetimePicker" v-model="birthday" mode="date" :show="dateShow" :formatter="formatter" :minDate="-302688000" :maxDate="maxDate" :closeOnClickOverlay="true" @confirm="confirmBirthday" @cancel="camcelBirthday" />
confirmColor="#34ce98"
ref="datetimePicker"
v-model="birthday"
mode="date"
:show="dateShow"
:formatter="formatter"
:minDate="-302688000"
:maxDate="maxDate"
:closeOnClickOverlay="true"
@confirm="confirmBirthday"
@cancel="camcelBirthday"
/>
</view> </view>
</view> </view>
@@ -68,7 +53,6 @@
<u-image class="sex-item-avatar" width="100rpx" height="100rpx" :src="require('../../static/imgs/avatar-1.png')" :lazy-load="true" shape="circle" /> <u-image class="sex-item-avatar" width="100rpx" height="100rpx" :src="require('../../static/imgs/avatar-1.png')" :lazy-load="true" shape="circle" />
<view class="info-des">身高体重信息对健康信息有重要参考价值</view> <view class="info-des">身高体重信息对健康信息有重要参考价值</view>
<view class="info-title">您的身高是</view> <view class="info-title">您的身高是</view>
<!-- -->
<view class="weight"> <view class="weight">
<view class="count"><span>{{ heightU }}</span>厘米</view> <view class="count"><span>{{ heightU }}</span>厘米</view>
<vue-scale :min="10" :max="100" :int="false" :single="10" :h="80" :styles="styles" @scroll="scrollHeight" :scrollLeft="Number(heightU)" /> <vue-scale :min="10" :max="100" :int="false" :single="10" :h="80" :styles="styles" @scroll="scrollHeight" :scrollLeft="Number(heightU)" />
@@ -84,51 +68,18 @@
<view class="next" @click="weightClick(2)">下一步</view> <view class="next" @click="weightClick(2)">下一步</view>
</view> </view>
</view> </view>
</view> </block>
<!-- 进度2 健康目标 --> <!-- 进度2 健康目标 -->
<view> <block>
<!-- 减脂类型 --> <!-- 减脂类型 -->
<view v-if="targetShow" class="plan-content target-content"> <view v-if="targetShow" class="plan-content target-content">
<u-image class="sex-item-avatar" width="100rpx" height="100rpx" :src="require('../../static/imgs/avatar-1.png')" :lazy-load="true" shape="circle" /> <u-image class="sex-item-avatar" width="100rpx" height="100rpx" :src="require('../../static/imgs/avatar-1.png')" :lazy-load="true" shape="circle" />
<view class="info-title">您的目标是</view> <view class="info-title">您的目标是</view>
<view class="target-type"> <view class="target-type">
<view class="target-type-item"> <view class="target-type-item"> <u-image class="target-img" width="160rpx" height="160rpx" @click="activedTarget = '1'" :src="activedTarget === '1' ? require('../../static/imgs/ic-w-s.png') : require('../../static/imgs/ic-w-n.png')" :lazy-load="true" shape="circle" /> 减肥 </view>
<u-image <view class="target-type-item"> <u-image class="target-img" width="160rpx" height="160rpx" @click="activedTarget = '2'" :src="activedTarget === '2' ? require('../../static/imgs/ic-b-s.png') : require('../../static/imgs/ic-b-n.png')" :lazy-load="true" shape="circle" /> 保持体重 </view>
class="target-img" <view class="target-type-item"> <u-image class="target-img" width="160rpx" height="160rpx" @click="activedTarget = '3'" :src="activedTarget === '3' ? require('../../static/imgs/ic-m-s.png') : require('../../static/imgs/ic-m-n.png')" :lazy-load="true" shape="circle" /> 增肌 </view>
width="160rpx"
height="160rpx"
@click="activedTarget = '1'"
:src="activedTarget === '1' ? require('../../static/imgs/ic-w-s.png') : require('../../static/imgs/ic-w-n.png')"
:lazy-load="true"
shape="circle"
/>
减肥
</view>
<view class="target-type-item">
<u-image
class="target-img"
width="160rpx"
height="160rpx"
@click="activedTarget = '2'"
:src="activedTarget === '2' ? require('../../static/imgs/ic-b-s.png') : require('../../static/imgs/ic-b-n.png')"
:lazy-load="true"
shape="circle"
/>
保持体重
</view>
<view class="target-type-item">
<u-image
class="target-img"
width="160rpx"
height="160rpx"
@click="activedTarget = '3'"
:src="activedTarget === '3' ? require('../../static/imgs/ic-m-s.png') : require('../../static/imgs/ic-m-n.png')"
:lazy-load="true"
shape="circle"
/>
增肌
</view>
</view> </view>
<view class="pre-next"> <view class="pre-next">
<view class="pro" @click="targetClick(1)">上一步</view> <view class="pro" @click="targetClick(1)">上一步</view>
@@ -141,10 +92,7 @@
<view class="info-title">您的打算减脂多少</view> <view class="info-title">您的打算减脂多少</view>
<view class="target-type"> <view class="target-type">
<view class="target-type-item"> <view class="target-type-item">
<view class="count"> <view class="count"> <span>{{ weightTargetU }}</span> 公斤 </view>
<span>{{ weightTargetU }}</span>
公斤
</view>
<vue-scale :min="10" :max="100" :int="false" :single="10" :h="80" :styles="styles" @scroll="scrollTargetWeight" :scrollLeft="Number(weightTargetU)" /> <vue-scale :min="10" :max="100" :int="false" :single="10" :h="80" :styles="styles" @scroll="scrollTargetWeight" :scrollLeft="Number(weightTargetU)" />
</view> </view>
</view> </view>
@@ -153,7 +101,7 @@
<view class="next" @click="targetWeightClick(2)">下一步</view> <view class="next" @click="targetWeightClick(2)">下一步</view>
</view> </view>
</view> </view>
</view> </block>
<!-- 进度3 行为习惯 --> <!-- 进度3 行为习惯 -->
<!-- 减脂类型 --> <!-- 减脂类型 -->
@@ -162,51 +110,19 @@
<view class="info-title">您的运动量是</view> <view class="info-title">您的运动量是</view>
<view class="target-type"> <view class="target-type">
<view class="target-type-item"> <view class="target-type-item">
<u-image <u-image class="target-img" width="120rpx" height="120rpx" @click="activedbehaviarTarget = '1'" :src="activedbehaviarTarget === '1' ? require('../../static/imgs/ic-w-01.png') : require('../../static/imgs/ic-w-02.png')" :lazy-load="true" shape="circle" />
class="target-img"
width="120rpx"
height="120rpx"
@click="activedbehaviarTarget = '1'"
:src="activedbehaviarTarget === '1' ? require('../../static/imgs/ic-w-01.png') : require('../../static/imgs/ic-w-02.png')"
:lazy-load="true"
shape="circle"
/>
久坐不动 久坐不动
</view> </view>
<view class="target-type-item"> <view class="target-type-item">
<u-image <u-image class="target-img" width="120rpx" height="120rpx" @click="activedbehaviarTarget = '2'" :src="activedbehaviarTarget === '2' ? require('../../static/imgs/ic-w-03.png') : require('../../static/imgs/ic-w-04.png')" :lazy-load="true" shape="circle" />
class="target-img"
width="120rpx"
height="120rpx"
@click="activedbehaviarTarget = '2'"
:src="activedbehaviarTarget === '2' ? require('../../static/imgs/ic-w-03.png') : require('../../static/imgs/ic-w-04.png')"
:lazy-load="true"
shape="circle"
/>
少量运动 少量运动
</view> </view>
<view class="target-type-item"> <view class="target-type-item">
<u-image <u-image class="target-img" width="120rpx" height="120rpx" @click="activedbehaviarTarget = '3'" :src="activedbehaviarTarget === '3' ? require('../../static/imgs/ic-w-05.png') : require('../../static/imgs/ic-w-06.png')" :lazy-load="true" shape="circle" />
class="target-img"
width="120rpx"
height="120rpx"
@click="activedbehaviarTarget = '3'"
:src="activedbehaviarTarget === '3' ? require('../../static/imgs/ic-w-05.png') : require('../../static/imgs/ic-w-06.png')"
:lazy-load="true"
shape="circle"
/>
中等运动量 中等运动量
</view> </view>
<view class="target-type-item"> <view class="target-type-item">
<u-image <u-image class="target-img" width="120rpx" height="120rpx" @click="activedbehaviarTarget = '4'" :src="activedbehaviarTarget === '4' ? require('../../static/imgs/ic-w-07.png') : require('../../static/imgs/ic-w-08.png')" :lazy-load="true" shape="circle" />
class="target-img"
width="120rpx"
height="120rpx"
@click="activedbehaviarTarget = '4'"
:src="activedbehaviarTarget === '4' ? require('../../static/imgs/ic-w-07.png') : require('../../static/imgs/ic-w-08.png')"
:lazy-load="true"
shape="circle"
/>
超强度运动 超强度运动
</view> </view>
</view> </view>
@@ -274,7 +190,6 @@ export default {
}, },
computed: { computed: {
showBirthday() { showBirthday() {
console.log(moment(this.birthday).format('YYYY年MM月DD日'));
return moment(this.birthday).format('YYYY年MM月DD日'); return moment(this.birthday).format('YYYY年MM月DD日');
} }
}, },
@@ -297,6 +212,7 @@ export default {
this.percentplan1 = uni.$u.range(0, 100, this.percentplan1 + 33.33); // 增加进度 this.percentplan1 = uni.$u.range(0, 100, this.percentplan1 + 33.33); // 增加进度
this.heightWeightShow = true; // 展示身高体重模块 this.heightWeightShow = true; // 展示身高体重模块
}, },
// 年龄 ----- 取消选择年龄 // 年龄 ----- 取消选择年龄
camcelBirthday() { camcelBirthday() {
this.birthdayShow = false; // // 年龄页面弹窗不显示 this.birthdayShow = false; // // 年龄页面弹窗不显示
@@ -304,6 +220,7 @@ export default {
this.percentplan1 = 0; // 进度为0 this.percentplan1 = 0; // 进度为0
this.sexShow = true; // 显示性别页面 this.sexShow = true; // 显示性别页面
}, },
//年龄------------- 过滤出生年月日 //年龄------------- 过滤出生年月日
formatter(type, value) { formatter(type, value) {
if (type === 'year') {return `${value}`;} if (type === 'year') {return `${value}`;}
@@ -311,6 +228,8 @@ export default {
if (type === 'day') {return `${value}`;} if (type === 'day') {return `${value}`;}
return value; return value;
}, },
// 体重---------标尺滚动 // 体重---------标尺滚动
scrollWeight(msg) { scrollWeight(msg) {
this.weightU = msg; this.weightU = msg;
@@ -332,6 +251,8 @@ export default {
this.targetShow = true; // 目标页面展示 this.targetShow = true; // 目标页面展示
} }
}, },
// 目标 ------------点击 1上一页 2 下一页 // 目标 ------------点击 1上一页 2 下一页
targetClick(type) { targetClick(type) {
if (type === 1) { if (type === 1) {
@@ -368,6 +289,8 @@ export default {
this.behaviorShow = true; // 打开行为习惯页面 this.behaviorShow = true; // 打开行为习惯页面
} }
}, },
// 目标 运动量--------- 1上一页 2 下一页 // 目标 运动量--------- 1上一页 2 下一页
targetBehaviorClick(type) { targetBehaviorClick(type) {
if (type === 1) { if (type === 1) {
@@ -391,7 +314,6 @@ export default {
exercise: this.activedbehaviarTarget, // 运动量 exercise: this.activedbehaviarTarget, // 运动量
days: 1 days: 1
}; };
console.log(params, 'params.....');
recordsHealth(params) recordsHealth(params)
.then(res => { .then(res => {
uni.showModal({ uni.showModal({
@@ -406,10 +328,12 @@ export default {
}); });
}) })
.catch(err => { .catch(err => {
uni.showToast({ uni.showToast({
title: err.message, title: err.message,
icon: 'none' icon: "none",
}); duration: 2000,
mask: true
})
}); });
} }
} }

View File

@@ -6,172 +6,175 @@
* @LastEditTime: 2022-01-13 17:16:09 * @LastEditTime: 2022-01-13 17:16:09
--> -->
<template> <template>
<view class="evaluation"> <view class="evaluation">
<!-- 进度 --> <!-- 进度 -->
<view class="percent"> <view class="percent">
<u-icon <u-icon name="arrow-left" :color="colorList[colorIndex]" size="14" label="上一题" :labelColor="colorList[colorIndex]" labelSize="14" :bold="true" space="3" v-if="page !== 1" @click="preQ" />
name="arrow-left" <u-line-progress class="pre-ico" :percentage="percent" height="10" :showText="false" :activeColor="colorList[colorIndex]" />
:color="colorList[colorIndex]" <span :style="{ color: colorList[colorIndex] }">{{ percent }}%</span>
size="14" </view>
label="上一题" <!-- 标题 -->
:labelColor="colorList[colorIndex]" <view class="title">{{ page }}.{{ currentInfo.title }}</view>
labelSize="14" <!-- 题目列表 -->
:bold="true" <view class="lists">
space="3" <view class="list-item">
v-if="page !== 1" <u-radio-group placement="column" @change="groupChange" iconPlacement="right" class="radio-g" :value="currentId">
@click="preQ" <u-radio class="radio-item" :customStyle="{ marginBottom: '8px' }" v-for="(item, index) in currentInfo.options" :key="index" :label="item.title" :name="item.option_id" :activeColor="colorList[colorIndex]" />
/> </u-radio-group>
<u-line-progress class="pre-ico" :percentage="percent" height="10" :showText="false" :activeColor="colorList[colorIndex]" /> </view>
<span :style="{ color: colorList[colorIndex] }">{{ percent }}%</span> <!-- 底部确认按钮 -->
</view> <view class="bottom-btn" :style="{ background: colorList[colorIndex] }" @click="next">下一步</view>
<!-- 标题 --> </view>
<view class="title">{{ page }}.{{ currentInfo.title }}</view> </view>
<!-- 题目列表 -->
<view class="lists">
<view class="list-item">
<u-radio-group placement="column" @change="groupChange" iconPlacement="right" class="radio-g" :value="currentId">
<u-radio
class="radio-item"
:customStyle="{ marginBottom: '8px' }"
v-for="(item, index) in currentInfo.options"
:key="index"
:label="item.title"
:name="item.option_id"
:activeColor="colorList[colorIndex]"
></u-radio>
</u-radio-group>
</view>
<!-- 底部确认按钮 -->
<view class="bottom-btn" :style="{ background: colorList[colorIndex] }" @click="next">下一步</view>
</view>
</view>
</template> </template>
<script> <script>
import { evaluationsQuestion, evaluationsAnswers } from '@/apis/interfaces/evaluation.js'; import {
export default { evaluationsQuestion,
components: {}, evaluationsAnswers
data() { } from '@/apis/interfaces/evaluation.js';
return { export default {
percent: 70, components: {},
colorList: ['#34ce98', '#b6c29a', '#f4d000', '#8a977b', '#e58308', '#dc5712'], data() {
colorIndex: Math.floor(Math.random() * 6), // 基本案列数据 return {
currentInfo: {}, //当前题目的内容 percent: 70,
option_ids: [], // 答案id的数组 colorList: ['#34ce98', '#d04500', '#f4d000', '#55aa00', '#e58308', '#dc5a1d'],
has_more: false, // 是否有下一页 colorIndex: Math.floor(Math.random() * 6), // 基本案列数据
page: 1, currentInfo: {}, //当前题目的内容
currentId: '' // 默认值 option_ids: [], // 答案id的数组
}; has_more: false, // 是否有下一页
}, page: 1,
onShow() { currentId: '' // 默认值
this.getList(); };
uni.setNavigationBarColor({ },
frontColor: '#ffffff', //文字颜色 onShow() {
backgroundColor: `${this.colorList[this.colorIndex]}` //底部背景色 this.getList();
}); uni.setNavigationBarColor({
}, frontColor: '#ffffff', //文字颜色
methods: { backgroundColor: `${this.colorList[this.colorIndex]}` //底部背景色
getList() { });
evaluationsQuestion(this.$Route.query.id, this.page).then(res => { },
this.currentInfo = res.data[0]; methods: {
this.percent = Number(((res.page.current - 1) / res.page.total).toFixed(2)) * 100; // 答题列表
this.has_more = res.page.has_more; getList() {
}); evaluationsQuestion(this.$Route.query.id, this.page).then(res => {
}, this.currentInfo = res.data[0];
groupChange(n) { this.percent = Number(((res.page.current - 1) / res.page.total).toFixed(2)) * 100;
this.currentId = n; this.has_more = res.page.has_more;
}, }).catch(err => {
// 上一题 uni.showToast({
preQ() { title: err.message,
this.option_ids.pop(); icon: "none",
this.currentId = ''; duration: 2000,
this.page = this.page - 1; mask: true
this.getList(); })
}, });
//下一题 },
next() { groupChange(n) {
if (this.has_more) { this.currentId = n;
if (this.currentId === '') { },
uni.showToast({ title: '请选择答案', icon: 'none' }); // 上一题
return; preQ() {
} this.option_ids.pop();
this.option_ids.push(this.currentId); this.currentId = '';
this.currentId = ''; this.page = this.page - 1;
this.page = this.page + 1; this.getList();
this.getList(); },
} else { //下一题
if (this.option_ids.length !== this.page) { next() {
this.option_ids.push(this.currentId); if (this.has_more) {
this.currentId = ''; if (this.currentId === '') {
} uni.showToast({
let data = { title: '请选择答案',
option_ids: this.option_ids.toString(), icon: 'none'
id: this.$Route.query.id });
}; return;
evaluationsAnswers(data) }
.then(res => { this.option_ids.push(this.currentId);
console.log(res); this.currentId = '';
this.parent = 100; this.page = this.page + 1;
uni.showToast({ this.getList();
title: '答题完成,立即查看结果', } else {
icon: 'none', if (this.option_ids.length !== this.page) {
mask: true this.option_ids.push(this.currentId);
}); this.currentId = '';
setTimeout(() => { }
uni.navigateTo({ let data = {
url: `/pages/evaluation/result?id=${this.$Route.query.id}` option_ids: this.option_ids.toString(),
}); id: this.$Route.query.id
}, 1000); };
}) evaluationsAnswers(data)
.catch(err => { .then(res => {
uni.showToast({ this.parent = 100;
title: err.message uni.showToast({
}); title: '答题完成,立即查看结果',
}); icon: 'none',
} mask: true
} });
} setTimeout(() => {
}; uni.navigateTo({
url: `/pages/evaluation/result?id=${this.$Route.query.id}`
});
}, 1000);
})
.catch(err => {
uni.showToast({
title: err.message,
icon: "none",
duration: 2000,
mask: true
})
});
}
}
}
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.evaluation { .evaluation {
padding: $padding $padding $padding * 4 $padding; padding: $padding $padding $padding * 4 $padding;
.percent {
display: flex; .percent {
flex-direction: row; display: flex;
align-items: center; flex-direction: row;
justify-content: center; align-items: center;
box-sizing: border-box; justify-content: center;
font-size: $title-size - 2; box-sizing: border-box;
.pre-ico { font-size: $title-size - 2;
margin: $padding;
} .pre-ico {
} margin: $padding;
.title { }
font-size: $title-size + 10; }
font-weight: bold;
padding-top: $padding; .title {
} font-size: $title-size + 10;
.lists { font-weight: bold;
.radio-g { padding-top: $padding;
padding-top: $padding * 2; }
.radio-item {
background: #f9f9f9; .lists {
padding: $padding; .radio-g {
border-radius: $radius; padding-top: $padding * 2;
flex: 1;
} .radio-item {
} background: #f9f9f9;
.bottom-btn { padding: $padding;
text-align: center; border-radius: $radius;
padding: 24rpx $padding; flex: 1;
border-radius: $radius + 40; }
color: #fff; }
font-size: $title-size;
position: fixed; .bottom-btn {
bottom: $padding; text-align: center;
width: calc(100% - 60rpx); padding: 24rpx $padding;
box-sizing: border-box; border-radius: $radius + 40;
} color: #fff;
} font-size: $title-size;
} position: fixed;
bottom: $padding;
width: calc(100% - 60rpx);
box-sizing: border-box;
}
}
}
</style> </style>

View File

@@ -6,129 +6,138 @@
* @LastEditTime: 2022-01-13 17:26:38 * @LastEditTime: 2022-01-13 17:26:38
--> -->
<template> <template>
<view class="introduce"> <view class="introduce">
<view class="intro-history" v-if="info.is_answer" @click="toResult">测评记录</view> <view class="intro-history" v-if="info.is_answer" @click="toResult">测评记录</view>
<view class="intro-history" v-else @click="toResult">暂未测评</view> <view class="intro-history" v-else @click="toResult">暂未测评</view>
<view class="intro-content"> <view class="intro-content">
<view class="intro-title">{{ info.title }}</view> <view class="intro-title">{{ info.title }}</view>
<u-read-more class="intro-des" :toggle="true" showHeight="140" ref="uReadMore" :shadowStyle="shadowStyle" color="#34ce98" textIndent="0"> <u-read-more class="intro-des" :toggle="true" showHeight="140" ref="uReadMore" :shadowStyle="shadowStyle" color="#34ce98" textIndent="0">
<rich-text :nodes="content"></rich-text> <rich-text :nodes="content"></rich-text>
</u-read-more> </u-read-more>
<u-image class="intro-img" width="100%" radius="20rpx" height="700rpx" :src="info.cover ? info.cover : require('../../static/imgs/indro.png')" :lazy-load="true" /> <u-image class="intro-img" width="100%" radius="20rpx" height="700rpx" :src="info.cover ? info.cover : require('../../static/imgs/indro.png')" :lazy-load="true" />
<view class="answer" @click="nowAn">开始测评</view> <view class="answer" @click="nowAn">开始测评</view>
</view> </view>
<view class="remark">本评测会收集孕产情况健康状况家族病史用药情况信息用于开展相关评测为你生成分析报告</view> <view class="remark">本评测会收集孕产情况健康状况家族病史用药情况信息用于开展相关评测为你生成分析报告</view>
</view> </view>
</template> </template>
<script> <script>
import { evaluationsInfo } from '@/apis/interfaces/evaluation.js'; import {evaluationsInfo} from '@/apis/interfaces/evaluation.js';
export default { export default {
data() { data() {
return { return {
info: {}, info: {},
content: `本测试预计完成时间5-8分钟 content: `本测试预计完成时间5-8分钟
<br/> <br/>
<br/> <br/>
适用于18-65岁存在亚健康或尿酸偏高人群`, 适用于18-65岁存在亚健康或尿酸偏高人群`,
shadowStyle: { shadowStyle: {backgroundImage: 'none',paddingTop: '0',marginTop: '20rpx'}
backgroundImage: 'none', };
paddingTop: '0', },
marginTop: '20rpx' onShow() {
} evaluationsInfo(this.$Route.query.id).then(res => {
}; this.content = res.content;
}, this.info = res;
onShow() { }).catch(err => {
evaluationsInfo(this.$Route.query.id).then(res => { uni.showToast({
this.content = res.content; title: err.message,
this.info = res; icon: "none",
}); duration: 2000,
}, mask: true
methods: { })
nowAn() { });
uni.navigateTo({ },
url: `/pages/evaluation/index?id=${this.$Route.query.id}` methods: {
}); nowAn() {
}, uni.navigateTo({
toResult() { url: `/pages/evaluation/index?id=${this.$Route.query.id}`
console.log('点击了测试'); });
uni.navigateTo({ },
url: `/pages/evaluation/result?id=${this.$Route.query.id}` toResult() {
}); uni.navigateTo({
} url: `/pages/evaluation/result?id=${this.$Route.query.id}`
} });
}; }
}
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.introduce { .introduce {
background-color: $main-color; background-color: $main-color;
min-height: 100vh; min-height: 100vh;
.intro-history {
padding: $padding * 1.5 $padding; .intro-history {
color: $window-color; padding: $padding * 1.5 $padding;
text-decoration: underline; color: $window-color;
font-size: $title-size-lg; text-decoration: underline;
display: flex; font-size: $title-size-lg;
flex-direction: row; display: flex;
align-items: center; flex-direction: row;
justify-content: flex-end; align-items: center;
box-sizing: border-box; justify-content: flex-end;
} box-sizing: border-box;
// 测评展示 }
.intro-content {
background: rgba($color: #fff, $alpha: 1); // 测评展示
min-height: 30vh; .intro-content {
padding: 0 $padding; background: rgba($color: #fff, $alpha: 1);
margin: $margin * 1.5; min-height: 30vh;
border-radius: $radius; padding: 0 $padding;
position: relative; margin: $margin * 1.5;
box-shadow: 0 0 10rpx 4rpx rgba($color: $main-color, $alpha: 0.1); border-radius: $radius;
// 标题 position: relative;
.intro-title { box-shadow: 0 0 10rpx 4rpx rgba($color: $main-color, $alpha: 0.1);
font-size: $title-size * 1.8;
font-weight: bold; // 标题
color: $text-color; .intro-title {
position: relative; font-size: $title-size * 1.8;
top: -40rpx; font-weight: bold;
} color: $text-color;
// 介绍 position: relative;
.intro-des { top: -40rpx;
line-height: $title-size * 1.8; }
color: $text-color;
position: relative; // 介绍
top: -10rpx; .intro-des {
font-size: $title-size-m; line-height: $title-size * 1.8;
padding-bottom: 20rpx; color: $text-color;
} position: relative;
// 图片 top: -10rpx;
.intro-img { font-size: $title-size-m;
margin-top: $padding * 0.8; padding-bottom: 20rpx;
} }
// 开始测评
.answer { // 图片
position: absolute; .intro-img {
bottom: -30rpx; margin-top: $padding * 0.8;
width: 400rpx; }
height: 90rpx;
line-height: 90rpx; // 开始测评
left: 50%; .answer {
text-align: center; position: absolute;
background: rgba($color: #fff, $alpha: 0.94); bottom: -30rpx;
margin-left: -200rpx; width: 400rpx;
border-radius: $radius-m * 4; height: 90rpx;
font-weight: bold; line-height: 90rpx;
color: $text-color; left: 50%;
font-size: $title-size-m + 6; text-align: center;
} background: rgba($color: #fff, $alpha: 0.94);
} margin-left: -200rpx;
// 备注信息 border-radius: $radius-m * 4;
.remark { font-weight: bold;
color: $text-gray; color: $text-color;
font-size: $title-size - 6; font-size: $title-size-m + 6;
padding: $padding * 2 $padding; }
line-height: $title-size * 1.3; }
}
} // 备注信息
.remark {
color: $text-gray;
font-size: $title-size - 6;
padding: $padding * 2 $padding;
line-height: $title-size * 1.3;
}
}
</style> </style>

View File

@@ -11,44 +11,20 @@
<!-- 评测列表主要内容 标题 图片 描述 --> <!-- 评测列表主要内容 标题 图片 描述 -->
<view class="--content"> <view class="--content">
<u-image class="content-img" width="170rpx" height="170rpx" radius="20rpx" :src="item.cover ? item.cover : require('../../static/imgs/test.png')" :lazy-load="true" /> <u-image class="content-img" width="170rpx" height="170rpx" radius="20rpx" :src="item.cover ? item.cover : require('../../static/imgs/test.png')" :lazy-load="true" />
<view class="title-des"> <view class="title-des"> <view class="title">{{ item.title }}</view> <view class="des">{{ item.description || '--' }}</view> </view>
<view class="title">{{ item.title }}</view>
<view class="des">{{ item.description || '--' }}</view>
</view>
</view> </view>
<!-- 分数 --> <!-- 分数 -->
<view class="score" v-if="item.is_answer"> <view class="score" v-if="item.is_answer"> <span>{{ item.answer.total }}</span> </view>
<span>{{ item.answer.total }}</span>
</view>
<!-- 评测状态 --> <!-- 评测状态 -->
<view class="--status"> <view class="--status">
<!-- 已测试展示 状态--> <!-- 已测试展示 状态-->
<view class="status" v-if="item.is_answer"> <view class="status" v-if="item.is_answer"> <span class="dian">·</span> {{ item.remark }} </view>
<span class="dian">·</span>
{{ item.remark }}
</view>
<view v-if="item.is_answer" class="history" @click="toResult(item)">查看历史结果</view> <view v-if="item.is_answer" class="history" @click="toResult(item)">查看历史结果</view>
<!-- 未测试展示 状态--> <!-- 未测试展示 状态-->
<view class="status" v-if="!item.is_answer"> <view class="status" v-if="!item.is_answer"> <span class="dian">·</span> <span class="person">{{ item.remark }}</span> 人已测 | 约4~8分钟 </view>
<span class="dian">·</span> <u-icon name="arrow-right" :color="item.is_answer ? '#26a377' : '#faa81a'" size="14" :bold="true" :label="item.is_answer ? '重新评测' : '开始测评'" labelPos="left" labelSize="14" space="1" :labelColor="item.is_answer ? '#26a377' : '#faa81a'" @click="nowEva(item)" />
<span class="person">{{ item.remark }}</span>
人已测 | 约4~8分钟
</view>
<u-icon
name="arrow-right"
:color="item.is_answer ? '#26a377' : '#faa81a'"
size="14"
:bold="true"
:label="item.is_answer ? '重新评测' : '开始测评'"
labelPos="left"
labelSize="14"
space="1"
:labelColor="item.is_answer ? '#26a377' : '#faa81a'"
@click="nowEva(item)"
/>
</view> </view>
</view> </view>
<!-- 没有更多 --> <!-- 没有更多 -->
@@ -72,7 +48,14 @@ export default {
getList() { getList() {
evaluations().then(res => { evaluations().then(res => {
this.evalList = res; this.evalList = res;
}); }).catch(err => {
uni.showToast({
title: err.message,
icon: "none",
duration: 2000,
mask: true
})
});
}, },
// nowEva // nowEva
nowEva(item) { nowEva(item) {

View File

@@ -53,9 +53,7 @@
<!-- 标题 --> <!-- 标题 -->
<view class="title-content"><view class="title">营养建议</view></view> <view class="title-content"><view class="title">营养建议</view></view>
<block v-for="(item, index) in 3" :key="index"> <block v-for="(item, index) in 3" :key="index">
<view class="title2"> <view class="title2"> <span>{{ item }}. 低Gi</span> </view>
<span>{{ item }}. 低Gi</span>
</view>
<!-- 描述 --> <!-- 描述 -->
<view class="des">饮食营养及生活方式对维持面部年轻态影响较大建议注意食材选择逐步清淡口味规律作息逐个改善不良生活习惯帮助改善当前皮肤状态</view> <view class="des">饮食营养及生活方式对维持面部年轻态影响较大建议注意食材选择逐步清淡口味规律作息逐个改善不良生活习惯帮助改善当前皮肤状态</view>
</block> </block>
@@ -63,10 +61,7 @@
<!-- 更多 --> <!-- 更多 -->
<view class="answer-item"> <view class="answer-item">
<!-- 标题 --> <!-- 标题 -->
<view class="title-content"> <view class="title-content"> <view class="title">更多护肤知识</view> <u-icon name="arrow-right" color="#333" size="20" /> </view>
<view class="title">更多护肤知识</view>
<u-icon name="arrow-right" color="#333" size="20" />
</view>
<!-- 横向滚动推荐 --> <!-- 横向滚动推荐 -->
<scroll-view class="scroll-view_H" scroll-x="true"> <scroll-view class="scroll-view_H" scroll-x="true">
<view v-for="(item, index) in 6" :key="index" id="demo1" class="scroll-view-item_H"> <view v-for="(item, index) in 6" :key="index" id="demo1" class="scroll-view-item_H">
@@ -109,7 +104,14 @@ export default {
] ]
}; };
this.loaded = true; this.loaded = true;
}); }).catch(err => {
uni.showToast({
title: err.message,
icon: "none",
duration: 2000,
mask: true
})
});
}, },
reEva() { reEva() {
uni.navigateTo({ uni.navigateTo({

View File

@@ -60,11 +60,17 @@ export default {
healthSports(data).then(res => { healthSports(data).then(res => {
this.lists = this.lists.concat(res.data); this.lists = this.lists.concat(res.data);
this.has_more = res.page.has_more; this.has_more = res.page.has_more;
}); }).catch(err => {
uni.showToast({
title: err.message,
icon: "none",
duration: 2000,
mask: true
})
});
}, },
// 显示弹窗内容 // 显示弹窗内容
addSport(item) { addSport(item) {
console.log(item);
this.selectSports = item; this.selectSports = item;
this.selectSports.duration = 60; this.selectSports.duration = 60;
this.addSportsShow = true; this.addSportsShow = true;
@@ -99,7 +105,6 @@ export default {
//#region 搜索相关方法 start //#region 搜索相关方法 start
// 点击搜索左侧按钮 // 点击搜索左侧按钮
searchCustom(e) { searchCustom(e) {
console.log(e);
this.name = e; this.name = e;
this.reset(); this.reset();
}, },

View File

@@ -8,11 +8,7 @@
<template> <template>
<view class="add-foods"> <view class="add-foods">
<view class="re"> <view class="re"> <view>低等热量</view> <view>中等热量</view> <view>高等热量</view> </view>
<view>低等热量</view>
<view>中等热量</view>
<view>高等热量</view>
</view>
<!-- 搜索页面 --> <!-- 搜索页面 -->
<u-search :show-action="true" actionText="搜索" :animation="true" :clearabled="true" placeholder="请输入食品名称" <u-search :show-action="true" actionText="搜索" :animation="true" :clearabled="true" placeholder="请输入食品名称"
@custom="searchCustom" @clear="clearSearch" v-model="name" /> @custom="searchCustom" @clear="clearSearch" v-model="name" />
@@ -59,8 +55,6 @@
//没有id的时候就是新增要处理type //没有id的时候就是新增要处理type
this.type = this.$Route.query.type; this.type = this.$Route.query.type;
this.date = this.$Route.query.date; this.date = this.$Route.query.date;
console.log(this.date,'date.........')
// this.getFoods();
}, },
onLoad() { onLoad() {
this.getFoods(); this.getFoods();
@@ -85,9 +79,15 @@
name: this.name, name: this.name,
}; };
healthFoods(data).then((res) => { healthFoods(data).then((res) => {
console.log(res);
this.lists = this.lists.concat(res.data); this.lists = this.lists.concat(res.data);
this.has_more = res.page.has_more; this.has_more = res.page.has_more;
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none",
duration: 2000,
mask: true
})
}); });
}, },
// 监听点击键盘触发返回值新增食品 // 监听点击键盘触发返回值新增食品
@@ -100,17 +100,14 @@
food_id: this.selectGoods[0].food_id, food_id: this.selectGoods[0].food_id,
date: this.date, date: this.date,
}; };
console.log(data,'data...........');
this.addHealthFoods(data); this.addHealthFoods(data);
}, },
// 添加食物 // 添加食物
addHealthFoods(data) { addHealthFoods(data) {
addHealthFoods(data).then((res) => { addHealthFoods(data).then((res) => {
console.log(res);
this.addShow = false; this.addShow = false;
this.$Router.back(); this.$Router.back();
}).catch(err => { }).catch(err => {
console.log(err, '添加食物error');
uni.showToast({ uni.showToast({
title: err.message, title: err.message,
icon: "none", icon: "none",
@@ -133,7 +130,6 @@
}, },
// 点击搜索左侧按钮 // 点击搜索左侧按钮
searchCustom(e) { searchCustom(e) {
console.log(e);
this.name = e; this.name = e;
this.reset(); this.reset();
}, },

View File

@@ -28,15 +28,10 @@
</u-navbar> </u-navbar>
<!-- 喝水及水杯文字 --> <!-- 喝水及水杯文字 -->
<view class="drink-content"> <view class="drink-content">
<view class="title" v-if="!water.is_complete"> <view class="title" v-if="!water.is_complete"> 再喝 <span class="num">{{ water.lack.cup }}</span> <span
再喝 class="total">{{ water.lack.value }}ml</span> </view>
<span class="num">{{ water.lack.cup }}</span>
<span class="total">{{ water.lack.value }}ml</span>
</view>
<view class="title" v-if="water.is_complete"> <view class="title" v-if="water.is_complete">
已喝 已喝 <span class="num">{{ water.total }}ml</span>
<span class="num">{{ water.total }}ml</span>
<u-image class="is_complete" :src="require('../../static/imgs/target.png')" :lazy-load="true" <u-image class="is_complete" :src="require('../../static/imgs/target.png')" :lazy-load="true"
mode="widthFix" width="140rpx" /> mode="widthFix" width="140rpx" />
</view> </view>
@@ -48,13 +43,11 @@
</view> </view>
<!-- 目标 --> <!-- 目标 -->
<view class="water-target"> <view class="water-target">
<view class="target-item" @click="targetShow = true"> <view class="target-item" @click="targetShow = true"> 今日目标
今日目标
<u-icon class="target-icon" name="arrow-right" color="#666" size="14" :bold="true" <u-icon class="target-icon" name="arrow-right" color="#666" size="14" :bold="true"
:label="water.target + 'ml'" labelPos="left" labelSize="16" labelColor="#666" space="6" /> :label="water.target + 'ml'" labelPos="left" labelSize="16" labelColor="#666" space="6" />
</view> </view>
<view class="target-item" @click="waterCShow = true"> <view class="target-item" @click="waterCShow = true"> 水杯容量
水杯容量
<u-icon class="target-icon" name="arrow-right" color="#666" size="14" :bold="true" <u-icon class="target-icon" name="arrow-right" color="#666" size="14" :bold="true"
:label="water.ml + 'ml'" labelPos="left" labelSize="16" labelColor="#666" space="6" /> :label="water.ml + 'ml'" labelPos="left" labelSize="16" labelColor="#666" space="6" />
</view> </view>
@@ -86,11 +79,7 @@
<u-icon size="30" :name="require('../../static/icon/water-icon.png')" /> <u-icon size="30" :name="require('../../static/icon/water-icon.png')" />
</view> </view>
<view class="list-item"> <view class="list-item">
<view class="list-item-title"> <view class="list-item-title"> <span>{{ item.time }}</span> </view> {{ item.ml }}ml
<span>{{ item.time }}</span>
</view>
{{ item.ml }}ml
</view> </view>
</view> </view>
</template> </template>
@@ -156,12 +145,17 @@
this.tagertsDefaultIndex = [res.tagerts.findIndex(item => item.number === res.water this.tagertsDefaultIndex = [res.tagerts.findIndex(item => item.number === res.water
.target)]; .target)];
this.loaded = true; this.loaded = true;
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none",
duration: 2000,
mask: true
})
}); });
}, },
// 确认方法index===1 每日目标 2水杯容量 // 确认方法index===1 每日目标 2水杯容量
targetSure(index, e) { targetSure(index, e) {
// console.log("触发了targetSure", index, e.value[0]);
// let date = moment(new Date()).format("YYYY--MM--DD");
let params = {}; let params = {};
if (index === '1') { if (index === '1') {
params = { params = {
@@ -180,25 +174,29 @@
this.getWaters(); this.getWaters();
this.waterCShow = false; this.waterCShow = false;
this.targetShow = false; this.targetShow = false;
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none",
duration: 2000,
mask: true
})
}); });
}, },
// 喝水 // 喝水
drinkWater() { drinkWater() {
console.log('喝水。。。')
let data = { let data = {
date: this.today date: this.today
} }
console.log(data, 'data....')
drinkWater(data).then(res => { drinkWater(data).then(res => {
this.getWaters(); this.getWaters();
this.dateLists() this.dateLists()
}).catch(err => { }).catch(err => {
console.log(err, '添加食物error');
uni.showToast({ uni.showToast({
title: err.message, title: err.message,
icon: "none", icon: "none",
duration:2000, duration: 2000,
mask:true mask: true
}) })
}); });
}, },
@@ -219,8 +217,10 @@
.catch(err => { .catch(err => {
uni.showToast({ uni.showToast({
title: err.message, title: err.message,
icon: 'none' icon: "none",
}); duration: 2000,
mask: true
})
}); });
} }
} }
@@ -233,22 +233,21 @@
month: this.month, month: this.month,
type: this.dateType type: this.dateType
} }
console.log(data,'data.....')
dateList(data).then(res => { dateList(data).then(res => {
console.log(res)
this.calendarList = res.calendar this.calendarList = res.calendar
this.dateType = '' this.dateType = ''
this.month = res.month this.month = res.month
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
title: err.message, title: err.message,
icon: 'none' icon: "none",
duration: 2000,
mask: true
}) })
}) })
}, },
// 选择日期 // 选择日期
dateClick(item) { dateClick(item) {
console.log(item)
this.today = item.today this.today = item.today
this.month = item.today this.month = item.today
this.reset() this.reset()

View File

@@ -10,53 +10,35 @@
<view class="record--foods"> <view class="record--foods">
<!-- 自定义导航部分 --> <!-- 自定义导航部分 -->
<u-navbar :safeAreaInsetTop="true" :fixed='true' bgColor="#34ce98" :autoBack="true"> <u-navbar :safeAreaInsetTop="true" :fixed='true' bgColor="#34ce98" :autoBack="true">
<view class="u-nav-slot" slot="left"> <view class="u-nav-slot" slot="left"> <u-icon name="arrow-leftward" :bold="true" size="20" color="#fff" /> </view>
<u-icon name="arrow-leftward" :bold="true" size="20" color="#fff" />
</view>
<view class="u-nav-slot u-center" slot="center" @click="dateShow = true,dateLists()"> <view class="u-nav-slot u-center" slot="center" @click="dateShow = true,dateLists()">
<u-icon name="play-left-fill" size="14" color="#fff" @click="datePreNext('before')" /> <u-icon name="play-left-fill" size="14" color="#fff" @click="datePreNext('before')" />
<view class="date"> <u-icon name="calendar" color="#fff" label-color="#fff" width="150" :label="today" label-size="14" size="20" /> </view> <view class="date"> <u-icon name="calendar" color="#fff" label-color="#fff" width="150" :label="today" label-size="14" size="20" /> </view>
<u-icon name="play-right-fill" size="14" color="#fff" @click="datePreNext('after')" /> <u-icon name="play-right-fill" size="14" color="#fff" @click="datePreNext('after')" />
</view> </view>
<view class="u-nav-slot" slot="right"> <view class="u-nav-slot" slot="right"> <u-icon :name="require('@/static/icon/sign-icon.gif')" :bold="true" size="30" @click="$Router.push({name:'signIndex'})" /> </view>
<u-icon :name="require('@/static/icon/sign-icon.gif')" :bold="true" size="30" @click="$Router.push({name:'signIndex'})" />
</view>
</u-navbar> </u-navbar>
<!-- 饮食进度条 --> <!-- 饮食进度条 -->
<view class="cricle-content"> <view class="cricle-content">
<view class="info"> <view class="info"> 饮食摄入 <span>{{ calorys.intake_total }}</span> </view>
饮食摄入
<span>{{ calorys.intake_total }}</span>
</view>
<arprogress :percent="calorys.exceeds ? 100 : calorys.ratio" inactiveColor="#f5f4f9" <arprogress :percent="calorys.exceeds ? 100 : calorys.ratio" inactiveColor="#f5f4f9"
:activeColor="calorys.exceeds ? '#f00' : '#34ce98'" width="300" class="cricle" borderWidth="20"> :activeColor="calorys.exceeds ? '#c50000' : '#34ce98'" width="300" class="cricle" borderWidth="20">
<span>{{ calorys.exceeds ? '多吃了' : '还可以吃' }}</span> <span>{{ calorys.exceeds ? '多吃了' : '还可以吃' }}</span>
<span :class="['num', calorys.exceeds ? 'num1' : '']">{{ calorys.amount }}</span> <span :class="['num', calorys.exceeds ? 'num1' : '']">{{ calorys.amount }}</span>
<span>推荐预算{{ calorys.goal }}</span> <span>推荐预算{{ calorys.goal }}</span>
</arprogress> </arprogress>
<view class="info" @click="errToast"> <view class="info" @click="errToast"> 运动消耗 <span>{{ calorys.exercise_total }}</span> </view>
运动消耗
<span>{{ calorys.exercise_total }}</span>
</view>
<view class="ic-left">摄入量推荐</view> <view class="ic-left">摄入量推荐</view>
<u-icon class="ic-day" name="checkmark-circle" color="#34ce98" size="10" :label="`${calorys.days}天`" <u-icon class="ic-day" name="checkmark-circle" color="#34ce98" size="10" :label="`${calorys.days}天`" labelColor="#34ce98" labelSize="10" space="3" />
labelColor="#34ce98" labelSize="10" space="3" />
</view> </view>
<!-- 有饮食记录 --> <!-- 有饮食记录 -->
<template v-if="intakes.length > 0"> <template v-if="intakes.length > 0">
<view class="foods-add" v-for="(it, index) in intakes" :key="index"> <view class="foods-add" v-for="(it, index) in intakes" :key="index">
<view class="foods-title"> <view class="foods-title">
<view class="title-left"> <view class="title-left"> {{ it.name }} <span v-if="it.remark">{{ it.remark || '' }}</span> </view>
{{ it.name }} <view class="title-right"> {{ it.total }} <span class="dw">千卡</span> <u-icon name="arrow-right" color="#ddd" size="13" :bold="true" /> </view>
<span v-if="it.remark">{{ it.remark || '' }}</span>
</view>
<view class="title-right">
{{ it.total }}
<span class="dw">千卡</span>
<u-icon name="arrow-right" color="#ddd" size="13" :bold="true" />
</view>
</view> </view>
<goodsList :lists="it.intake" type="no-dian" @editGoods="editGoods" @longClickGoods="longClickGoods" /> <goodsList :lists="it.intake" type="no-dian" @editGoods="editGoods" @longClickGoods="longClickGoods" />
</view> </view>
@@ -66,31 +48,23 @@
<template v-if="sportsTotal > 0"> <template v-if="sportsTotal > 0">
<view class="foods-title" style="padding-top:50rpx;"> <view class="foods-title" style="padding-top:50rpx;">
<view class="title-left">运动</view> <view class="title-left">运动</view>
<view class="title-right"> <view class="title-right"> {{ sportsTotal }} <span class="dw">千卡</span> <u-icon name="arrow-right" color="#ddd" size="13" :bold="true" /> </view>
{{ sportsTotal }}
<span class="dw">千卡</span>
<u-icon name="arrow-right" color="#ddd" size="13" :bold="true" />
</view>
</view> </view>
<sports type="edit" :lists="sports" @editSport="editSport" @longClick="longClick" /> <sports type="edit" :lists="sports" @editSport="editSport" @longClick="longClick" />
</template> </template>
<!-- 没有饮食记录 --> <!-- 没有饮食记录 -->
<view class="no-foods" v-if="sports.length === 0 && intakes.length === 0"> <view class="no-foods" v-if="sports.length === 0 && intakes.length === 0">
<u-image :src="require('../../static/imgs/no-foods.png')" :lazy-load="true" radius="10rpx" mode="widthFix" <u-image :src="require('../../static/imgs/no-foods.png')" :lazy-load="true" radius="10rpx" mode="widthFix" width="300rpx" class="no-foods-img" />
width="300rpx" class="no-foods-img" />
<view>还没有添加今日饮食记录</view> <view>还没有添加今日饮食记录</view>
<view>请点击屏幕下方按钮来添加</view> <view>请点击屏幕下方按钮来添加</view>
</view> </view>
<!-- 加餐模块 --> <!-- 加餐模块 -->
<u-action-sheet :actions="addEatList" title="加餐模块" :closeOnClickOverlay="true" :closeOnClickAction="true" <u-action-sheet :actions="addEatList" title="加餐模块" :closeOnClickOverlay="true" :closeOnClickAction="true" @select="selectClick" cancelText="取消" :show="addEatShow" @close="addEatShow = false" />
@select="selectClick" cancelText="取消" :show="addEatShow" @close="addEatShow = false"></u-action-sheet>
<!-- 底部 早餐等菜单 --> <!-- 底部 早餐等菜单 -->
<u-tabbar :fixed="true" :placeholder="true" :safeAreaInsetBottom="true" inactiveColor="#333" <u-tabbar :fixed="true" :placeholder="true" :safeAreaInsetBottom="true" inactiveColor="#333" @click="tabbarClick">
@click="tabbarClick">
<u-tabbar-item text="+早餐" @click="tabbarClick" :icon="require('../../static/imgs/foods-1.png')" /> <u-tabbar-item text="+早餐" @click="tabbarClick" :icon="require('../../static/imgs/foods-1.png')" />
<u-tabbar-item text="+午餐" @click="tabbarClick" :icon="require('../../static/imgs/foods-2.png')" /> <u-tabbar-item text="+午餐" @click="tabbarClick" :icon="require('../../static/imgs/foods-2.png')" />
<u-tabbar-item text="+晚餐" @click="tabbarClick" :icon="require('../../static/imgs/foods-3.png')" /> <u-tabbar-item text="+晚餐" @click="tabbarClick" :icon="require('../../static/imgs/foods-3.png')" />
@@ -99,17 +73,13 @@
</u-tabbar> </u-tabbar>
<!-- 添加食谱弹窗 --> <!-- 添加食谱弹窗 -->
<addFoods v-if="addShow" :addShow="addShow" :selectGoods="selectGoods" :decimals="true" @confirm="confirmHandle" <addFoods v-if="addShow" :addShow="addShow" :selectGoods="selectGoods" :decimals="true" @confirm="confirmHandle" @close="closeHandle" @delThis="delThis" @tabGoodsInfo="tabGoodsInfo" max="999" />
@close="closeHandle" @delThis="delThis" @tabGoodsInfo="tabGoodsInfo" max="999" />
<!-- 修改运动弹窗 --> <!-- 修改运动弹窗 -->
<addPopup :selectSports="selectSports" :addSportsShow="addSportsShow" @comfirmSport="comfirmSport" <addPopup :selectSports="selectSports" :addSportsShow="addSportsShow" @comfirmSport="comfirmSport" @cancleSport="cancleSport" @delSport="delSport" />
@cancleSport="cancleSport" @delSport="delSport" />
<!-- 选择日历 --> <!-- 选择日历 -->
<dateTemplate :lists="calendarList" :today="today" :month="month" :dateShow="dateShow" type='foods' @backDate="backDate" <dateTemplate :lists="calendarList" :today="today" :month="month" :dateShow="dateShow" type='foods' @backDate="backDate" @dateClick="dateClick" @closeDate="closeDate" @datePreNext="datePreNext" />
@dateClick="dateClick" @closeDate="closeDate" @datePreNext="datePreNext" />
</view> </view>
</template> </template>
@@ -173,6 +143,13 @@
this.intakes = res.intakes; this.intakes = res.intakes;
this.sports = res.exercises.lists; this.sports = res.exercises.lists;
this.sportsTotal = res.exercises.total; this.sportsTotal = res.exercises.total;
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none",
duration: 2000,
mask: true
})
}); });
}, },
@@ -188,7 +165,6 @@
exercise_id: item.exercise_id, exercise_id: item.exercise_id,
title: '编辑运动' title: '编辑运动'
}; };
// console.log(this.selectSports);
this.addSportsShow = true; this.addSportsShow = true;
}, },
// 弹窗确认按钮新增 这里接口报错了 // 弹窗确认按钮新增 这里接口报错了
@@ -207,7 +183,9 @@
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
title: err.message, title: err.message,
icon: 'none' icon: "none",
duration: 2000,
mask: true
}) })
}); });
}, },
@@ -220,11 +198,17 @@
let params = { let params = {
exercise_id: this.selectSports.exercise_id // exercise_id: this.selectSports.exercise_id //
}; };
console.log(params);
delHealthSports(params).then(res => { delHealthSports(params).then(res => {
this.addSportsShow = false; this.addSportsShow = false;
this.selectSports = {}; this.selectSports = {};
this.getList(); this.getList();
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none",
duration: 2000,
mask: true
})
}); });
}, },
// 长按删除触发事件运动 // 长按删除触发事件运动
@@ -272,7 +256,6 @@
}, },
// 底部按钮点击触发的事件 早餐1 午餐3 晚餐5 加餐(早2中4晚6) // 底部按钮点击触发的事件 早餐1 午餐3 晚餐5 加餐(早2中4晚6)
tabbarClick(e) { tabbarClick(e) {
console.log(e);
this.tabarIndex = e; this.tabarIndex = e;
if (e === 3) { if (e === 3) {
this.addEatShow = true; this.addEatShow = true;
@@ -319,14 +302,14 @@
// 添加食物 // 添加食物
editHealthFoods(data) { editHealthFoods(data) {
editHealthFoods(data).then(res => { editHealthFoods(data).then(res => {
console.log(res,'添加食物');
this.addShow = false; this.addShow = false;
this.getList(); this.getList();
}).catch(err=>{ }).catch(err => {
console.log(res,'添加食物error');
uni.showToast({ uni.showToast({
title:err.message, title: err.message,
icon:"none" icon: "none",
duration: 2000,
mask: true
}) })
}); });
}, },
@@ -335,6 +318,13 @@
delHealthFoods(this.selectGoods[0].intake_id).then(res => { delHealthFoods(this.selectGoods[0].intake_id).then(res => {
this.addShow = false; this.addShow = false;
this.getList(); this.getList();
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none",
duration: 2000,
mask: true
})
}); });
}, },
// 跳转到食品详情 // 跳转到食品详情
@@ -354,14 +344,15 @@
type: this.dateType type: this.dateType
} }
dateList(data).then(res => { dateList(data).then(res => {
console.log(res)
this.calendarList = res.calendar this.calendarList = res.calendar
this.dateType = '' this.dateType = ''
this.month = res.month this.month = res.month
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
title: err.message, title: err.message,
icon: 'none' icon: "none",
duration: 2000,
mask: true
}) })
}) })
}, },

View File

@@ -398,7 +398,6 @@ export default {
*/ */
logs() { logs() {
logs().then(res => { logs().then(res => {
// console.log(res.is_login)
this.weight = res.weight; this.weight = res.weight;
this.water = res.water; this.water = res.water;
this.intake_run = res.intake_run; this.intake_run = res.intake_run;
@@ -408,7 +407,14 @@ export default {
this.banner = res.banner; this.banner = res.banner;
this.user = res.user; this.user = res.user;
this.notifications_count = res.notifications_count; this.notifications_count = res.notifications_count;
}); }).catch(err => {
uni.showToast({
title: err.message,
icon: "none",
duration: 2000,
mask: true
})
});
}, },
/** /**
* @description:跳转登录页面 * @description:跳转登录页面

View File

@@ -134,7 +134,6 @@
//获取体重首页接口 //获取体重首页接口
getWeights() { getWeights() {
weights(this.page).then((res) => { weights(this.page).then((res) => {
console.log(res)
if (res.lists.page.current === 1) { if (res.lists.page.current === 1) {
this.lists = [] this.lists = []
} }
@@ -198,7 +197,6 @@
// 点击底部切换 // 点击底部切换
tabbarClick(e) { tabbarClick(e) {
console.log(e)
this.tabbarId = Number(e) this.tabbarId = Number(e)
} }
}, },

View File

@@ -3,18 +3,14 @@
<!-- 更多管理 --> <!-- 更多管理 -->
<view class="list"> <view class="list">
<view class="list-item" @click="updImgs"> <view class="list-item" @click="updImgs">
<view class="list-item-left"> <view class="list-item-left"> <span>修改头像</span> </view>
<span>修改头像</span>
</view>
<view class="avatar" > <view class="avatar" >
<image :src="avatar.showPath || require('@/static/user/cover.png')" mode="aspectFill" /> <image :src="avatar.showPath || require('@/static/user/cover.png')" mode="aspectFill" />
<u-icon name="arrow-right" color="#999" size="20"></u-icon> <u-icon name="arrow-right" color="#999" size="20"></u-icon>
</view> </view>
</view> </view>
<view class="list-item"> <view class="list-item">
<view class="list-item-left"> <view class="list-item-left"> <span>修改昵称</span> </view>
<span>修改昵称</span>
</view>
<view class="input"> <view class="input">
<input type="text" :value="nickname" @blur='blur' placeholder="请输入用户的昵称" maxlength="12" /> <input type="text" :value="nickname" @blur='blur' placeholder="请输入用户的昵称" maxlength="12" />
<u-icon name="arrow-right" color="#999" size="20"></u-icon> <u-icon name="arrow-right" color="#999" size="20"></u-icon>
@@ -86,11 +82,13 @@
this.avatar.showPath = pathRes.url[0] this.avatar.showPath = pathRes.url[0]
this.resetUserInfo('avatar',pathRes.url[0]) this.resetUserInfo('avatar',pathRes.url[0])
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
title: err.message, title: err.message,
icon: 'none' icon: "none",
}) duration: 2000,
}) mask: true
})
})
} }
}) })
}, },
@@ -114,11 +112,13 @@
}) })
this.getUserInfo() this.getUserInfo()
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
title: err.message, title: err.message,
icon: 'none' icon: "none",
}) duration: 2000,
}) mask: true
})
})
} }
} }
} }

View File

@@ -1,282 +1,316 @@
<template> <template>
<view class="content"> <view class="content">
<!-- 性别start --> <!-- 性别start -->
<view class="files" @click="sexShow = true"> <view class="files" @click="sexShow = true">
<view class="name">性别</view> <view class="name">性别</view>
<view class="text"> <view class="text">
<u-icon <u-icon class="target-icon" :label="recordsData.sex == 1 ? '男士' : '女士'" name="arrow-right" color="#999"
class="target-icon" size="14" labelSize="14" labelColor="#666" labelPos="left" space="10" />
:label="recordsData.sex == 1 ? '男士' : '女士'" </view>
name="arrow-right" </view>
color="#999" <u-action-sheet :actions="sexList" title="你的性别是?" :show="sexShow" cancelText="暂不修改"
size="14" @select=" e => { (this.recordsData.sex = e.id), (this.sexShow = false); } " @close="sexShow = false" />
labelSize="14" <!-- 性别 end -->
labelColor="#666"
labelPos="left"
space="10"
/>
</view>
</view>
<u-action-sheet
:actions="sexList"
title="你的性别是?"
:show="sexShow"
cancelText="暂不修改"
@select=" e => { (this.recordsData.sex = e.id), (this.sexShow = false); } "
@close="sexShow = false"
/>
<!-- 性别 end -->
<!-- 生日 start --> <!-- 生日 start -->
<view class="files" @click="birthdayShow = true"> <view class="files" @click="birthdayShow = true">
<view class="name">生日</view> <view class="name">生日</view>
<view class="text"> <view class="text">
<u-icon class="target-icon" :label="showBirthday" name="arrow-right" color="#999" size="14" labelSize="14" labelColor="#666" labelPos="left" space="10" /> <u-icon class="target-icon" :label="showBirthday" name="arrow-right" color="#999" size="14"
</view> labelSize="14" labelColor="#666" labelPos="left" space="10" />
</view> </view>
<u-datetime-picker </view>
confirmColor="#34ce98" <u-datetime-picker confirmColor="#34ce98" v-model="recordsData.birthday" mode="date" :show="birthdayShow"
v-model="recordsData.birthday" :formatter="formatter" :minDate="-302688000" :maxDate="maxDate"
mode="date" @confirm=" e => { this.recordsData.birthday = e.value, this.birthdayShow = false } "
:show="birthdayShow" @cancel=" () => { this.birthdayShow = false; } " />
:formatter="formatter" <!-- 生日 end -->
:minDate="-302688000"
:maxDate="maxDate"
@confirm=" e => { this.recordsData.birthday = e.value, this.birthdayShow = false } "
@cancel=" () => { this.birthdayShow = false; } "
/>
<!-- 生日 end -->
<!-- 身高 start--> <!-- 身高 start-->
<view class="files" @click="heightShow = true"> <view class="files" @click="heightShow = true">
<view class="name">身高</view> <view class="name">身高</view>
<view class="text"> <view class="text">
<u-icon class="target-icon" :label="recordsData.height + ` CM`" name="arrow-right" color="#999" size="14" labelSize="14" labelColor="#666" labelPos="left" space="10" /> <u-icon class="target-icon" :label="recordsData.height + ` CM`" name="arrow-right" color="#999"
</view> size="14" labelSize="14" labelColor="#666" labelPos="left" space="10" />
</view> </view>
<u-popup :show="heightShow" @close="() => { heightShow = false }"> </view>
<view class="v-scale"> <u-popup :show="heightShow" @close="() => { heightShow = false }">
<view class="title"> 你的身高为?</view> <view class="v-scale">
<view class="total"> {{recordsData.height}} CM </view> <view class="title"> 你的身高为?</view>
<vue-scale :min="10" :max="100" :int="false" :single="10" :h="80" :styles="styles" @scroll="scrollAll('height',$event)" :scrollLeft="Number(recordsData.height)" /> <view class="total"> {{recordsData.height}} CM </view>
</view> <vue-scale :min="10" :max="100" :int="false" :single="10" :h="80" :styles="styles"
</u-popup> @scroll="scrollAll('height',$event)" :scrollLeft="Number(recordsData.height)" />
<!-- 身高 end --> </view>
</u-popup>
<!-- 身高 end -->
<!-- 最新体重 start --> <!-- 最新体重 start -->
<view class="files bt30" @click="weightShow = true"> <view class="files bt30" @click="weightShow = true">
<view class="name">最新体重</view> <view class="name">最新体重</view>
<view class="text"> <view class="text">
<u-icon class="target-icon" :label="recordsData.weight + ` KG`" name="arrow-right" color="#999" size="14" labelSize="14" labelColor="#666" labelPos="left" space="10" /> <u-icon class="target-icon" :label="recordsData.weight + ` KG`" name="arrow-right" color="#999"
</view> size="14" labelSize="14" labelColor="#666" labelPos="left" space="10" />
</view> </view>
<u-popup :show="weightShow" @close="() => { weightShow = false }"> </view>
<view class="v-scale"> <u-popup :show="weightShow" @close="() => { weightShow = false }">
<view class="title"> 你的当前体重为?</view> <view class="v-scale">
<view class="total"> {{recordsData.weight}} KG </view> <view class="title"> 你的当前体重为?</view>
<vue-scale :min="10" :max="100" :int="false" :single="10" :h="80" :styles="styles" @scroll="scrollAll('weight',$event)" :scrollLeft="Number(recordsData.weight)" /> <view class="total"> {{recordsData.weight}} KG </view>
</view> <vue-scale :min="10" :max="100" :int="false" :single="10" :h="80" :styles="styles"
</u-popup> @scroll="scrollAll('weight',$event)" :scrollLeft="Number(recordsData.weight)" />
<!-- 生日 end --> </view>
</u-popup>
<!-- 生日 end -->
<!-- 目标 start --> <!-- 目标 start -->
<view class="files" @click="targetShow = true"> <view class="files" @click="targetShow = true">
<view class="name">目标</view> <view class="name">目标</view>
<view class="text"> <view class="text">
<u-icon class="target-icon" :label="targetList[selectedTargetIndex].name" name="arrow-right" color="#999" size="14" labelSize="14" labelColor="#666" labelPos="left" space="10" /> <u-icon class="target-icon" :label="targetList[selectedTargetIndex].name" name="arrow-right"
</view> color="#999" size="14" labelSize="14" labelColor="#666" labelPos="left" space="10" />
</view> </view>
<u-action-sheet </view>
:actions="targetList" <u-action-sheet :actions="targetList" title="你的目标是?" :show="targetShow" cancelText="暂不修改"
title="你的目标是?" @select=" e => { (this.selectedTargetIndex = this.targetList.findIndex(item => e.id === item.id)), (this.targetShow = false); } "
:show="targetShow" @close="targetShow = false" />
cancelText="暂不修改" <!-- 目标 end -->
@select=" e => { (this.selectedTargetIndex = this.targetList.findIndex(item => e.id === item.id)), (this.targetShow = false); } "
@close="targetShow = false"
/>
<!-- 目标 end -->
<!-- 目标体重 start--> <!-- 目标体重 start-->
<view class="files" @click="targetWeightShow = true"> <view class="files" @click="targetWeightShow = true">
<view class="name">目标体重</view> <view class="name">目标体重</view>
<view class="text"><u-icon class="target-icon" :label="recordsData.goal_weight + ` KG`" name="arrow-right" color="#999" size="14" labelSize="14" labelColor="#666" labelPos="left" space="10" /></view> <view class="text">
</view> <u-icon class="target-icon" :label="recordsData.goal_weight + ` KG`" name="arrow-right" color="#999"
<u-popup :show="targetWeightShow" @close="() => { targetWeightShow = false }"> size="14" labelSize="14" labelColor="#666" labelPos="left" space="10" />
<view class="v-scale"> </view>
<view class="title"> 你的目标体重为?</view> </view>
<view class="total"> {{recordsData.goal_weight}} KG </view> <u-popup :show="targetWeightShow" @close="() => { targetWeightShow = false }">
<vue-scale :min="10" :max="100" :int="false" :single="10" :h="80" :styles="styles" @scroll="scrollAll('goalweight',$event)" :scrollLeft="Number(recordsData.goal_weight)" /> <view class="v-scale">
</view> <view class="title"> 你的目标体重为?</view>
</u-popup> <view class="total"> {{recordsData.goal_weight}} KG </view>
<!-- 目标体重 end --> <vue-scale :min="10" :max="100" :int="false" :single="10" :h="80" :styles="styles"
@scroll="scrollAll('goalweight',$event)" :scrollLeft="Number(recordsData.goal_weight)" />
</view>
</u-popup>
<!-- 目标体重 end -->
<!-- 运动量 start --> <!-- 运动量 start -->
<view class="files" @click="exerciseShow = true"> <view class="files" @click="exerciseShow = true">
<view class="name">运动量</view> <view class="name">运动量</view>
<view class="text"> <view class="text">
<u-icon class="target-icon" :label="exerciseList[selectExerciseIndex].name" name="arrow-right" color="#999" size="14" labelSize="14" labelColor="#666" labelPos="left" space="10" /> <u-icon class="target-icon" :label="exerciseList[selectExerciseIndex].name" name="arrow-right"
</view> color="#999" size="14" labelSize="14" labelColor="#666" labelPos="left" space="10" />
</view> </view>
<u-action-sheet </view>
:actions="exerciseList" <u-action-sheet :actions="exerciseList" title="你的运动量是?" :show="exerciseShow" cancelText="暂不修改"
title="你的运动量是?" @select=" e => { (this.selectExerciseIndex = this.exerciseList.findIndex(item => e.id === item.id)), (this.exerciseShow = false); } "
:show="exerciseShow" @close="exerciseShow = false" />
cancelText="暂不修改" <!-- 运动量 end -->
@select=" e => { (this.selectExerciseIndex = this.exerciseList.findIndex(item => e.id === item.id)), (this.exerciseShow = false); } " <view class="sureBtn" @click="sureBtn"> 确认修改 </view>
@close="exerciseShow = false" <view class="des">修改资料后可更新并查看最新方案预算热量可能会发生变化</view>
/> </view>
<!-- 运动量 end -->
<view class="sureBtn" @click="sureBtn"> 确认修改 </view>
<view class="des">修改资料后可更新并查看最新方案预算热量可能会发生变化</view>
</view>
</template> </template>
<script> <script>
import { editHealthBefore,editHealth } from '@/apis/interfaces/essentialInfo.js'; import {
import moment from 'moment'; editHealthBefore,
import vueScale from '@/components/vueScale'; // 体重标尺 editHealth
export default { } from '@/apis/interfaces/essentialInfo.js';
components:{ import moment from 'moment';
vueScale import vueScale from '@/components/vueScale'; // 体重标尺
}, export default {
data() { components: {
return { vueScale
recordsData: {}, },
birthdayShow: false, // 出生日期展示 data() {
maxDate: new Date().getTime(), return {
sexShow: false, // 性别弹窗是否显示 recordsData: {},
sexList: [{name: '男士',id: 1},{name: '女士',id: 2}], birthdayShow: false, // 出生日期展示
targetShow: false, // 目标弹窗是否显示 maxDate: new Date().getTime(),
targetList: [{name: '减脂',id: 1},{name: '保持体重',id: 2},{name: '增肌',id: 3}], sexShow: false, // 性别弹窗是否显示
selectedTargetIndex: 0,// 默认选择了那个target sexList: [{
exerciseShow:false,// 运动量弹窗是否显示 name: '男士',
exerciseList:[{name:'久坐不动',id:1},{name:'少量运动',id:2},{name:'中等运动量',id:3},{name:'超强度运动',id:4}], id: 1
selectExerciseIndex:0,//默认选择运动量是久坐不懂得 }, {
heightShow:false, name: '女士',
weightShow:false, id: 2
targetWeightShow:false, }],
styles: { targetShow: false, // 目标弹窗是否显示
line: '#dbdbdb', targetList: [{
bginner: '#fbfbfb', name: '减脂',
bgoutside: '#ffffff', id: 1
font: '#404040', }, {
fontColor: '#404040', name: '保持体重',
fontSize: 16 id: 2
}, }, {
}; name: '增肌',
}, id: 3
computed: { }],
showBirthday() { selectedTargetIndex: 0, // 默认选择了那个target
return moment(this.recordsData.birthday).format('YYYY年MM月DD日'); exerciseShow: false, // 运动量弹窗是否显示
} exerciseList: [{
}, name: '久坐不动',
id: 1
}, {
name: '少量运动',
id: 2
}, {
name: '中等运动量',
id: 3
}, {
name: '超强度运动',
id: 4
}],
selectExerciseIndex: 0, //默认选择运动量是久坐不懂得
heightShow: false,
weightShow: false,
targetWeightShow: false,
styles: {
line: '#dbdbdb',
bginner: '#fbfbfb',
bgoutside: '#ffffff',
font: '#404040',
fontColor: '#404040',
fontSize: 16
},
};
},
computed: {
showBirthday() {
return moment(this.recordsData.birthday).format('YYYY年MM月DD日');
}
},
onShow() { onShow() {
let id = this.$Route.query.id; let id = this.$Route.query.id;
editHealthBefore(id) editHealthBefore(id)
.then(res => { .then(res => {
this.recordsData = res; this.recordsData = res;
this.recordsData.birthday = moment(res.birthday).format('YYYY-MM-DD'); this.recordsData.birthday = moment(res.birthday).format('YYYY-MM-DD');
this.selectExerciseIndex = this.exerciseList.findIndex(item => item.id === res.exercise) this.selectExerciseIndex = this.exerciseList.findIndex(item => item.id === res.exercise)
}) })
.catch(err => { .catch(err => {
conso.log(err); uni.showToast({
}); title: err.message,
}, icon: "none",
methods: { duration: 2000,
// 身高 体重 目标体重 滚动 mask: true
scrollAll(type,value) { })
if(type === 'height'){ });
return this.recordsData.height = value; },
} methods: {
if(type === 'weight'){ // 身高 体重 目标体重 滚动
return this.recordsData.weight = value; scrollAll(type, value) {
} if (type === 'height') {
if(type === 'goalweight'){ return this.recordsData.height = value;
return this.recordsData.goal_weight = value; }
} if (type === 'weight') {
}, return this.recordsData.weight = value;
// 年龄 - 过滤 - 自定义 - 出生年月日 }
formatter(type, value) { if (type === 'goalweight') {
if (type === 'year') {return `${value}`;} return this.recordsData.goal_weight = value;
if (type === 'month') {return `${value}`;} }
if (type === 'day') {return `${value}`;} },
return value; // 年龄 - 过滤 - 自定义 - 出生年月日
}, formatter(type, value) {
// 提交按钮 if (type === 'year') {
sureBtn(){ return `${value}`;
}
let params = { if (type === 'month') {
record_id:this.recordsData.record_id, return `${value}`;
birthday:moment(this.recordsData.birthday).format('YYYY-MM-DD'), }
sex:this.recordsData.sex, if (type === 'day') {
height:this.recordsData.height, return `${value}`;
weight:this.recordsData.weight, }
exercise:this.exerciseList[this.selectExerciseIndex].id, return value;
goal_weight:this.recordsData.goal_weight, },
days:1 // 提交按钮
} sureBtn() {
editHealth(params.record_id,params).then(res=>{ let params = {
this.$Router.back() record_id: this.recordsData.record_id,
}).catch(err=>{ birthday: moment(this.recordsData.birthday).format('YYYY-MM-DD'),
this.$Router.back() sex: this.recordsData.sex,
}) height: this.recordsData.height,
weight: this.recordsData.weight,
} exercise: this.exerciseList[this.selectExerciseIndex].id,
} goal_weight: this.recordsData.goal_weight,
}; days: 1
}
editHealth(params.record_id, params).then(res => {
this.$Router.back()
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none",
duration: 2000,
mask: true
})
this.$Router.back()
})
}
}
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.content { .content {
padding: $padding; padding: $padding;
} }
.files {
display: flex; .files {
padding: $padding + 10 $padding - 20; display: flex;
box-sizing: border-box; padding: $padding + 10 $padding - 20;
border-bottom: #f9f9f9 2rpx solid; box-sizing: border-box;
font-size: $title-size; border-bottom: #f9f9f9 2rpx solid;
&:last-child { font-size: $title-size;
border: none;
} &:last-child {
.name { border: none;
flex: 1; }
}
.text { .name {
color: $text-gray; flex: 1;
} }
}
.v-scale{ .text {
padding: $padding * 2 0; color: $text-gray;
font-size: $title-size; }
.title{ }
text-align: center;
font-size: $title-size + 10; .v-scale {
margin-bottom: $margin; padding: $padding * 2 0;
} font-size: $title-size;
.total{
font-size: $title-size; .title {
color: $main-color; text-align: center;
text-align: center; font-size: $title-size + 10;
} margin-bottom: $margin;
} }
.des {
color: $text-gray-m; .total {
font-size: $title-size-m - 4; font-size: $title-size;
margin-top: $margin * 2; color: $main-color;
text-align: center; text-align: center;
} }
.sureBtn{ }
background-color: $main-color;
color: #fff; .des {
font-size: $title-size; color: $text-gray-m;
text-align: center; font-size: $title-size-m - 4;
padding: $padding; margin-top: $margin * 2;
border-radius: $radius; text-align: center;
margin-top: $margin * 2; }
}
.bt30 { .sureBtn {
border-bottom: #f9f9f9 20rpx solid; background-color: $main-color;
} color: #fff;
font-size: $title-size;
text-align: center;
padding: $padding;
border-radius: $radius;
margin-top: $margin * 2;
}
.bt30 {
border-bottom: #f9f9f9 20rpx solid;
}
</style> </style>

View File

@@ -316,7 +316,7 @@
.user-content { .user-content {
padding-left: 158rpx; padding-left: 158rpx;
height: 128rpx; height: 140rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;