修复...
This commit is contained in:
@@ -11,21 +11,18 @@
|
||||
<!-- 进度 -->
|
||||
<view class="plan">
|
||||
<view class="plan-1">
|
||||
<span>基本信息</span>
|
||||
<u-line-progress :percentage="percentplan1" activeColor="#34ce98" class="line-progress" :showText="false" />
|
||||
<span>基本信息</span> <u-line-progress :percentage="percentplan1" activeColor="#34ce98" class="line-progress" :showText="false" />
|
||||
</view>
|
||||
<view class="plan-2">
|
||||
<span>健康目标</span>
|
||||
<u-line-progress :percentage="percentplan2" activeColor="#34ce98" width="200rpx" class="line-progress" :showText="false" />
|
||||
<span>健康目标</span> <u-line-progress :percentage="percentplan2" activeColor="#34ce98" width="200rpx" class="line-progress" :showText="false" />
|
||||
</view>
|
||||
<view class="plan-3">
|
||||
<span>行为习惯</span>
|
||||
<u-line-progress :percentage="percentplan3" activeColor="#34ce98" width="200rpx" class="line-progress" :showText="false" />
|
||||
<span>行为习惯</span> <u-line-progress :percentage="percentplan3" activeColor="#34ce98" width="200rpx" class="line-progress" :showText="false" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 进度1 基本信息 -->
|
||||
<view>
|
||||
<block>
|
||||
<!-- 进度1 基本信息页面展示 性别 -->
|
||||
<view class="plan-content" v-if="sexShow">
|
||||
<view class="info-des">生理性别和激素会影响我们的身体代谢食物的方式</view>
|
||||
@@ -47,19 +44,7 @@
|
||||
<view class="age">
|
||||
<view class="info-title">你的出生日期是?</view>
|
||||
<view class="year" @change="dateShow = true">{{ showBirthday }}</view>
|
||||
<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"
|
||||
/>
|
||||
<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" />
|
||||
</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" />
|
||||
<view class="info-des">身高体重信息对健康信息有重要参考价值</view>
|
||||
<view class="info-title">您的身高是?</view>
|
||||
<!-- -->
|
||||
<view class="weight">
|
||||
<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)" />
|
||||
@@ -84,51 +68,18 @@
|
||||
<view class="next" @click="weightClick(2)">下一步</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<!-- 进度2 健康目标 -->
|
||||
<view>
|
||||
<block>
|
||||
<!-- 减脂类型 -->
|
||||
<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" />
|
||||
<view class="info-title">您的目标是?</view>
|
||||
<view class="target-type">
|
||||
<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>
|
||||
<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 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>
|
||||
<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 class="pre-next">
|
||||
<view class="pro" @click="targetClick(1)">上一步</view>
|
||||
@@ -141,10 +92,7 @@
|
||||
<view class="info-title">您的打算减脂多少?</view>
|
||||
<view class="target-type">
|
||||
<view class="target-type-item">
|
||||
<view class="count">
|
||||
<span>{{ weightTargetU }}</span>
|
||||
公斤
|
||||
</view>
|
||||
<view class="count"> <span>{{ weightTargetU }}</span> 公斤 </view>
|
||||
<vue-scale :min="10" :max="100" :int="false" :single="10" :h="80" :styles="styles" @scroll="scrollTargetWeight" :scrollLeft="Number(weightTargetU)" />
|
||||
</view>
|
||||
</view>
|
||||
@@ -153,7 +101,7 @@
|
||||
<view class="next" @click="targetWeightClick(2)">下一步</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<!-- 进度3 行为习惯 -->
|
||||
<!-- 减脂类型 -->
|
||||
@@ -162,51 +110,19 @@
|
||||
<view class="info-title">您的运动量是?</view>
|
||||
<view class="target-type">
|
||||
<view class="target-type-item">
|
||||
<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"
|
||||
/>
|
||||
<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" />
|
||||
久坐不动
|
||||
</view>
|
||||
<view class="target-type-item">
|
||||
<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"
|
||||
/>
|
||||
<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" />
|
||||
少量运动
|
||||
</view>
|
||||
<view class="target-type-item">
|
||||
<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"
|
||||
/>
|
||||
<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" />
|
||||
中等运动量
|
||||
</view>
|
||||
<view class="target-type-item">
|
||||
<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"
|
||||
/>
|
||||
<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" />
|
||||
超强度运动
|
||||
</view>
|
||||
</view>
|
||||
@@ -274,7 +190,6 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
showBirthday() {
|
||||
console.log(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.heightWeightShow = true; // 展示身高体重模块
|
||||
},
|
||||
|
||||
// 年龄 ----- 取消选择年龄
|
||||
camcelBirthday() {
|
||||
this.birthdayShow = false; // // 年龄页面弹窗不显示
|
||||
@@ -304,6 +220,7 @@ export default {
|
||||
this.percentplan1 = 0; // 进度为0
|
||||
this.sexShow = true; // 显示性别页面
|
||||
},
|
||||
|
||||
//年龄------------- 过滤出生年月日
|
||||
formatter(type, value) {
|
||||
if (type === 'year') {return `${value}年`;}
|
||||
@@ -311,6 +228,8 @@ export default {
|
||||
if (type === 'day') {return `${value}日`;}
|
||||
return value;
|
||||
},
|
||||
|
||||
|
||||
// 体重---------标尺滚动
|
||||
scrollWeight(msg) {
|
||||
this.weightU = msg;
|
||||
@@ -332,6 +251,8 @@ export default {
|
||||
this.targetShow = true; // 目标页面展示
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// 目标 ------------点击 1上一页 2 下一页
|
||||
targetClick(type) {
|
||||
if (type === 1) {
|
||||
@@ -368,6 +289,8 @@ export default {
|
||||
this.behaviorShow = true; // 打开行为习惯页面
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// 目标 运动量--------- 1上一页 2 下一页
|
||||
targetBehaviorClick(type) {
|
||||
if (type === 1) {
|
||||
@@ -391,7 +314,6 @@ export default {
|
||||
exercise: this.activedbehaviarTarget, // 运动量
|
||||
days: 1
|
||||
};
|
||||
console.log(params, 'params.....');
|
||||
recordsHealth(params)
|
||||
.then(res => {
|
||||
uni.showModal({
|
||||
@@ -408,8 +330,10 @@ export default {
|
||||
.catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: 'none'
|
||||
});
|
||||
icon: "none",
|
||||
duration: 2000,
|
||||
mask: true
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,7 @@
|
||||
<view class="evaluation">
|
||||
<!-- 进度 -->
|
||||
<view class="percent">
|
||||
<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"
|
||||
/>
|
||||
<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" />
|
||||
<u-line-progress class="pre-ico" :percentage="percent" height="10" :showText="false" :activeColor="colorList[colorIndex]" />
|
||||
<span :style="{ color: colorList[colorIndex] }">{{ percent }}%</span>
|
||||
</view>
|
||||
@@ -30,15 +19,7 @@
|
||||
<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 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>
|
||||
</view>
|
||||
<!-- 底部确认按钮 -->
|
||||
@@ -47,13 +28,16 @@
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { evaluationsQuestion, evaluationsAnswers } from '@/apis/interfaces/evaluation.js';
|
||||
export default {
|
||||
import {
|
||||
evaluationsQuestion,
|
||||
evaluationsAnswers
|
||||
} from '@/apis/interfaces/evaluation.js';
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
percent: 70,
|
||||
colorList: ['#34ce98', '#b6c29a', '#f4d000', '#8a977b', '#e58308', '#dc5712'],
|
||||
colorList: ['#34ce98', '#d04500', '#f4d000', '#55aa00', '#e58308', '#dc5a1d'],
|
||||
colorIndex: Math.floor(Math.random() * 6), // 基本案列数据
|
||||
currentInfo: {}, //当前题目的内容
|
||||
option_ids: [], // 答案id的数组
|
||||
@@ -70,11 +54,19 @@ export default {
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 答题列表
|
||||
getList() {
|
||||
evaluationsQuestion(this.$Route.query.id, this.page).then(res => {
|
||||
this.currentInfo = res.data[0];
|
||||
this.percent = Number(((res.page.current - 1) / res.page.total).toFixed(2)) * 100;
|
||||
this.has_more = res.page.has_more;
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: "none",
|
||||
duration: 2000,
|
||||
mask: true
|
||||
})
|
||||
});
|
||||
},
|
||||
groupChange(n) {
|
||||
@@ -91,7 +83,10 @@ export default {
|
||||
next() {
|
||||
if (this.has_more) {
|
||||
if (this.currentId === '') {
|
||||
uni.showToast({ title: '请选择答案', icon: 'none' });
|
||||
uni.showToast({
|
||||
title: '请选择答案',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.option_ids.push(this.currentId);
|
||||
@@ -109,7 +104,6 @@ export default {
|
||||
};
|
||||
evaluationsAnswers(data)
|
||||
.then(res => {
|
||||
console.log(res);
|
||||
this.parent = 100;
|
||||
uni.showToast({
|
||||
title: '答题完成,立即查看结果',
|
||||
@@ -124,17 +118,21 @@ export default {
|
||||
})
|
||||
.catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message
|
||||
});
|
||||
title: err.message,
|
||||
icon: "none",
|
||||
duration: 2000,
|
||||
mask: true
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.evaluation {
|
||||
.evaluation {
|
||||
padding: $padding $padding $padding * 4 $padding;
|
||||
|
||||
.percent {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
@@ -142,18 +140,22 @@ export default {
|
||||
justify-content: center;
|
||||
box-sizing: border-box;
|
||||
font-size: $title-size - 2;
|
||||
|
||||
.pre-ico {
|
||||
margin: $padding;
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: $title-size + 10;
|
||||
font-weight: bold;
|
||||
padding-top: $padding;
|
||||
}
|
||||
|
||||
.lists {
|
||||
.radio-g {
|
||||
padding-top: $padding * 2;
|
||||
|
||||
.radio-item {
|
||||
background: #f9f9f9;
|
||||
padding: $padding;
|
||||
@@ -161,6 +163,7 @@ export default {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.bottom-btn {
|
||||
text-align: center;
|
||||
padding: 24rpx $padding;
|
||||
@@ -173,5 +176,5 @@ export default {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { evaluationsInfo } from '@/apis/interfaces/evaluation.js';
|
||||
export default {
|
||||
import {evaluationsInfo} from '@/apis/interfaces/evaluation.js';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
info: {},
|
||||
@@ -32,17 +32,20 @@ export default {
|
||||
—
|
||||
<br/>
|
||||
适用于18-65岁,存在亚健康或尿酸偏高人群`,
|
||||
shadowStyle: {
|
||||
backgroundImage: 'none',
|
||||
paddingTop: '0',
|
||||
marginTop: '20rpx'
|
||||
}
|
||||
shadowStyle: {backgroundImage: 'none',paddingTop: '0',marginTop: '20rpx'}
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
evaluationsInfo(this.$Route.query.id).then(res => {
|
||||
this.content = res.content;
|
||||
this.info = res;
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: "none",
|
||||
duration: 2000,
|
||||
mask: true
|
||||
})
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
@@ -52,19 +55,19 @@ export default {
|
||||
});
|
||||
},
|
||||
toResult() {
|
||||
console.log('点击了测试');
|
||||
uni.navigateTo({
|
||||
url: `/pages/evaluation/result?id=${this.$Route.query.id}`
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.introduce {
|
||||
.introduce {
|
||||
background-color: $main-color;
|
||||
min-height: 100vh;
|
||||
|
||||
.intro-history {
|
||||
padding: $padding * 1.5 $padding;
|
||||
color: $window-color;
|
||||
@@ -76,6 +79,7 @@ export default {
|
||||
justify-content: flex-end;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
// 测评展示
|
||||
.intro-content {
|
||||
background: rgba($color: #fff, $alpha: 1);
|
||||
@@ -85,6 +89,7 @@ export default {
|
||||
border-radius: $radius;
|
||||
position: relative;
|
||||
box-shadow: 0 0 10rpx 4rpx rgba($color: $main-color, $alpha: 0.1);
|
||||
|
||||
// 标题
|
||||
.intro-title {
|
||||
font-size: $title-size * 1.8;
|
||||
@@ -93,6 +98,7 @@ export default {
|
||||
position: relative;
|
||||
top: -40rpx;
|
||||
}
|
||||
|
||||
// 介绍
|
||||
.intro-des {
|
||||
line-height: $title-size * 1.8;
|
||||
@@ -102,10 +108,12 @@ export default {
|
||||
font-size: $title-size-m;
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
|
||||
// 图片
|
||||
.intro-img {
|
||||
margin-top: $padding * 0.8;
|
||||
}
|
||||
|
||||
// 开始测评
|
||||
.answer {
|
||||
position: absolute;
|
||||
@@ -123,6 +131,7 @@ export default {
|
||||
font-size: $title-size-m + 6;
|
||||
}
|
||||
}
|
||||
|
||||
// 备注信息
|
||||
.remark {
|
||||
color: $text-gray;
|
||||
@@ -130,5 +139,5 @@ export default {
|
||||
padding: $padding * 2 $padding;
|
||||
line-height: $title-size * 1.3;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -11,44 +11,20 @@
|
||||
<!-- 评测列表主要内容 标题 图片 描述 -->
|
||||
<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" />
|
||||
<view class="title-des">
|
||||
<view class="title">{{ item.title }}</view>
|
||||
<view class="des">{{ item.description || '--' }}</view>
|
||||
</view>
|
||||
<view class="title-des"> <view class="title">{{ item.title }}</view> <view class="des">{{ item.description || '--' }}</view> </view>
|
||||
</view>
|
||||
|
||||
<!-- 分数 -->
|
||||
<view class="score" v-if="item.is_answer">
|
||||
<span>{{ item.answer.total }}</span>
|
||||
分
|
||||
</view>
|
||||
<view class="score" v-if="item.is_answer"> <span>{{ item.answer.total }}</span> 分 </view>
|
||||
|
||||
<!-- 评测状态 -->
|
||||
<view class="--status">
|
||||
<!-- 已测试展示 状态-->
|
||||
<view class="status" v-if="item.is_answer">
|
||||
<span class="dian">·</span>
|
||||
{{ item.remark }}
|
||||
</view>
|
||||
<view class="status" v-if="item.is_answer"> <span class="dian">·</span> {{ item.remark }} </view>
|
||||
<view v-if="item.is_answer" class="history" @click="toResult(item)">查看历史结果</view>
|
||||
<!-- 未测试展示 状态-->
|
||||
<view class="status" v-if="!item.is_answer">
|
||||
<span class="dian">·</span>
|
||||
<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 class="status" v-if="!item.is_answer"> <span class="dian">·</span> <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>
|
||||
<!-- 没有更多 -->
|
||||
@@ -72,6 +48,13 @@ export default {
|
||||
getList() {
|
||||
evaluations().then(res => {
|
||||
this.evalList = res;
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: "none",
|
||||
duration: 2000,
|
||||
mask: true
|
||||
})
|
||||
});
|
||||
},
|
||||
// nowEva
|
||||
|
||||
@@ -53,9 +53,7 @@
|
||||
<!-- 标题 -->
|
||||
<view class="title-content"><view class="title">营养建议</view></view>
|
||||
<block v-for="(item, index) in 3" :key="index">
|
||||
<view class="title2">
|
||||
<span>{{ item }}. 低Gi</span>
|
||||
</view>
|
||||
<view class="title2"> <span>{{ item }}. 低Gi</span> </view>
|
||||
<!-- 描述 -->
|
||||
<view class="des">饮食营养及生活方式对维持面部年轻态影响较大,建议注意食材选择,逐步清淡口味;规律作息,逐个改善不良生活习惯;帮助改善当前皮肤状态。</view>
|
||||
</block>
|
||||
@@ -63,10 +61,7 @@
|
||||
<!-- 更多 -->
|
||||
<view class="answer-item">
|
||||
<!-- 标题 -->
|
||||
<view class="title-content">
|
||||
<view class="title">更多护肤知识</view>
|
||||
<u-icon name="arrow-right" color="#333" size="20" />
|
||||
</view>
|
||||
<view class="title-content"> <view class="title">更多护肤知识</view> <u-icon name="arrow-right" color="#333" size="20" /> </view>
|
||||
<!-- 横向滚动推荐 -->
|
||||
<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">
|
||||
@@ -109,6 +104,13 @@ export default {
|
||||
]
|
||||
};
|
||||
this.loaded = true;
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: "none",
|
||||
duration: 2000,
|
||||
mask: true
|
||||
})
|
||||
});
|
||||
},
|
||||
reEva() {
|
||||
|
||||
@@ -60,11 +60,17 @@ export default {
|
||||
healthSports(data).then(res => {
|
||||
this.lists = this.lists.concat(res.data);
|
||||
this.has_more = res.page.has_more;
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: "none",
|
||||
duration: 2000,
|
||||
mask: true
|
||||
})
|
||||
});
|
||||
},
|
||||
// 显示弹窗内容
|
||||
addSport(item) {
|
||||
console.log(item);
|
||||
this.selectSports = item;
|
||||
this.selectSports.duration = 60;
|
||||
this.addSportsShow = true;
|
||||
@@ -99,7 +105,6 @@ export default {
|
||||
//#region 搜索相关方法 start
|
||||
// 点击搜索左侧按钮
|
||||
searchCustom(e) {
|
||||
console.log(e);
|
||||
this.name = e;
|
||||
this.reset();
|
||||
},
|
||||
|
||||
@@ -8,11 +8,7 @@
|
||||
|
||||
<template>
|
||||
<view class="add-foods">
|
||||
<view class="re">
|
||||
<view>低等热量</view>
|
||||
<view>中等热量</view>
|
||||
<view>高等热量</view>
|
||||
</view>
|
||||
<view class="re"> <view>低等热量</view> <view>中等热量</view> <view>高等热量</view> </view>
|
||||
<!-- 搜索页面 -->
|
||||
<u-search :show-action="true" actionText="搜索" :animation="true" :clearabled="true" placeholder="请输入食品名称"
|
||||
@custom="searchCustom" @clear="clearSearch" v-model="name" />
|
||||
@@ -59,8 +55,6 @@
|
||||
//没有id的时候就是新增要处理type
|
||||
this.type = this.$Route.query.type;
|
||||
this.date = this.$Route.query.date;
|
||||
console.log(this.date,'date.........')
|
||||
// this.getFoods();
|
||||
},
|
||||
onLoad() {
|
||||
this.getFoods();
|
||||
@@ -85,9 +79,15 @@
|
||||
name: this.name,
|
||||
};
|
||||
healthFoods(data).then((res) => {
|
||||
console.log(res);
|
||||
this.lists = this.lists.concat(res.data);
|
||||
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,
|
||||
date: this.date,
|
||||
};
|
||||
console.log(data,'data...........');
|
||||
this.addHealthFoods(data);
|
||||
},
|
||||
// 添加食物
|
||||
addHealthFoods(data) {
|
||||
addHealthFoods(data).then((res) => {
|
||||
console.log(res);
|
||||
this.addShow = false;
|
||||
this.$Router.back();
|
||||
}).catch(err => {
|
||||
console.log(err, '添加食物error');
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: "none",
|
||||
@@ -133,7 +130,6 @@
|
||||
},
|
||||
// 点击搜索左侧按钮
|
||||
searchCustom(e) {
|
||||
console.log(e);
|
||||
this.name = e;
|
||||
this.reset();
|
||||
},
|
||||
|
||||
@@ -28,15 +28,10 @@
|
||||
</u-navbar>
|
||||
<!-- 喝水及水杯文字 -->
|
||||
<view class="drink-content">
|
||||
<view class="title" v-if="!water.is_complete">
|
||||
再喝
|
||||
<span class="num">{{ water.lack.cup }}</span>
|
||||
杯
|
||||
<span class="total">(约{{ water.lack.value }}ml)</span>
|
||||
</view>
|
||||
<view class="title" v-if="!water.is_complete"> 再喝 <span class="num">{{ water.lack.cup }}</span> 杯 <span
|
||||
class="total">(约{{ water.lack.value }}ml)</span> </view>
|
||||
<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"
|
||||
mode="widthFix" width="140rpx" />
|
||||
</view>
|
||||
@@ -48,13 +43,11 @@
|
||||
</view>
|
||||
<!-- 目标 -->
|
||||
<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"
|
||||
:label="water.target + 'ml'" labelPos="left" labelSize="16" labelColor="#666" space="6" />
|
||||
</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"
|
||||
:label="water.ml + 'ml'" labelPos="left" labelSize="16" labelColor="#666" space="6" />
|
||||
</view>
|
||||
@@ -86,11 +79,7 @@
|
||||
<u-icon size="30" :name="require('../../static/icon/water-icon.png')" />
|
||||
</view>
|
||||
<view class="list-item">
|
||||
<view class="list-item-title">
|
||||
水
|
||||
<span>{{ item.time }}</span>
|
||||
</view>
|
||||
{{ item.ml }}ml
|
||||
<view class="list-item-title"> 水 <span>{{ item.time }}</span> </view> {{ item.ml }}ml
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -156,12 +145,17 @@
|
||||
this.tagertsDefaultIndex = [res.tagerts.findIndex(item => item.number === res.water
|
||||
.target)];
|
||||
this.loaded = true;
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: "none",
|
||||
duration: 2000,
|
||||
mask: true
|
||||
})
|
||||
});
|
||||
},
|
||||
// 确认方法index===1 每日目标 2,水杯容量
|
||||
targetSure(index, e) {
|
||||
// console.log("触发了targetSure", index, e.value[0]);
|
||||
// let date = moment(new Date()).format("YYYY--MM--DD");
|
||||
let params = {};
|
||||
if (index === '1') {
|
||||
params = {
|
||||
@@ -180,25 +174,29 @@
|
||||
this.getWaters();
|
||||
this.waterCShow = false;
|
||||
this.targetShow = false;
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: "none",
|
||||
duration: 2000,
|
||||
mask: true
|
||||
})
|
||||
});
|
||||
},
|
||||
// 喝水
|
||||
drinkWater() {
|
||||
console.log('喝水。。。')
|
||||
let data = {
|
||||
date: this.today
|
||||
}
|
||||
console.log(data, 'data....')
|
||||
drinkWater(data).then(res => {
|
||||
this.getWaters();
|
||||
this.dateLists()
|
||||
}).catch(err => {
|
||||
console.log(err, '添加食物error');
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: "none",
|
||||
duration:2000,
|
||||
mask:true
|
||||
duration: 2000,
|
||||
mask: true
|
||||
})
|
||||
});
|
||||
},
|
||||
@@ -219,8 +217,10 @@
|
||||
.catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: 'none'
|
||||
});
|
||||
icon: "none",
|
||||
duration: 2000,
|
||||
mask: true
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -233,22 +233,21 @@
|
||||
month: this.month,
|
||||
type: this.dateType
|
||||
}
|
||||
console.log(data,'data.....')
|
||||
dateList(data).then(res => {
|
||||
console.log(res)
|
||||
this.calendarList = res.calendar
|
||||
this.dateType = ''
|
||||
this.month = res.month
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: 'none'
|
||||
icon: "none",
|
||||
duration: 2000,
|
||||
mask: true
|
||||
})
|
||||
})
|
||||
},
|
||||
// 选择日期
|
||||
dateClick(item) {
|
||||
console.log(item)
|
||||
this.today = item.today
|
||||
this.month = item.today
|
||||
this.reset()
|
||||
|
||||
@@ -10,53 +10,35 @@
|
||||
<view class="record--foods">
|
||||
<!-- 自定义导航部分 -->
|
||||
<u-navbar :safeAreaInsetTop="true" :fixed='true' bgColor="#34ce98" :autoBack="true">
|
||||
<view class="u-nav-slot" slot="left">
|
||||
<u-icon name="arrow-leftward" :bold="true" size="20" color="#fff" />
|
||||
</view>
|
||||
<view class="u-nav-slot" slot="left"> <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()">
|
||||
<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>
|
||||
<u-icon name="play-right-fill" size="14" color="#fff" @click="datePreNext('after')" />
|
||||
</view>
|
||||
<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>
|
||||
<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-navbar>
|
||||
|
||||
<!-- 饮食进度条 -->
|
||||
<view class="cricle-content">
|
||||
<view class="info">
|
||||
饮食摄入
|
||||
<span>{{ calorys.intake_total }}</span>
|
||||
</view>
|
||||
<view class="info"> 饮食摄入 <span>{{ calorys.intake_total }}</span> </view>
|
||||
<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 :class="['num', calorys.exceeds ? 'num1' : '']">{{ calorys.amount }}</span>
|
||||
<span>推荐预算{{ calorys.goal }}</span>
|
||||
</arprogress>
|
||||
<view class="info" @click="errToast">
|
||||
运动消耗
|
||||
<span>{{ calorys.exercise_total }}</span>
|
||||
</view>
|
||||
<view class="info" @click="errToast"> 运动消耗 <span>{{ calorys.exercise_total }}</span> </view>
|
||||
<view class="ic-left">摄入量推荐</view>
|
||||
<u-icon class="ic-day" name="checkmark-circle" color="#34ce98" size="10" :label="`${calorys.days}天`"
|
||||
labelColor="#34ce98" labelSize="10" space="3" />
|
||||
<u-icon class="ic-day" name="checkmark-circle" color="#34ce98" size="10" :label="`${calorys.days}天`" labelColor="#34ce98" labelSize="10" space="3" />
|
||||
</view>
|
||||
|
||||
<!-- 有饮食记录 -->
|
||||
<template v-if="intakes.length > 0">
|
||||
<view class="foods-add" v-for="(it, index) in intakes" :key="index">
|
||||
<view class="foods-title">
|
||||
<view class="title-left">
|
||||
{{ it.name }}
|
||||
<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 class="title-left"> {{ it.name }} <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>
|
||||
<goodsList :lists="it.intake" type="no-dian" @editGoods="editGoods" @longClickGoods="longClickGoods" />
|
||||
</view>
|
||||
@@ -66,31 +48,23 @@
|
||||
<template v-if="sportsTotal > 0">
|
||||
<view class="foods-title" style="padding-top:50rpx;">
|
||||
<view class="title-left">运动</view>
|
||||
<view class="title-right">
|
||||
{{ sportsTotal }}
|
||||
<span class="dw">千卡</span>
|
||||
<u-icon name="arrow-right" color="#ddd" size="13" :bold="true" />
|
||||
<view class="title-right"> {{ 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" />
|
||||
</template>
|
||||
|
||||
<!-- 没有饮食记录 -->
|
||||
<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"
|
||||
width="300rpx" class="no-foods-img" />
|
||||
<u-image :src="require('../../static/imgs/no-foods.png')" :lazy-load="true" radius="10rpx" mode="widthFix" width="300rpx" class="no-foods-img" />
|
||||
<view>还没有添加今日饮食记录</view>
|
||||
<view>请点击屏幕下方按钮来添加</view>
|
||||
</view>
|
||||
|
||||
<!-- 加餐模块 -->
|
||||
<u-action-sheet :actions="addEatList" title="加餐模块" :closeOnClickOverlay="true" :closeOnClickAction="true"
|
||||
@select="selectClick" cancelText="取消" :show="addEatShow" @close="addEatShow = false"></u-action-sheet>
|
||||
<u-action-sheet :actions="addEatList" title="加餐模块" :closeOnClickOverlay="true" :closeOnClickAction="true" @select="selectClick" cancelText="取消" :show="addEatShow" @close="addEatShow = false" />
|
||||
|
||||
<!-- 底部 早餐等菜单 -->
|
||||
<u-tabbar :fixed="true" :placeholder="true" :safeAreaInsetBottom="true" inactiveColor="#333"
|
||||
@click="tabbarClick">
|
||||
<u-tabbar :fixed="true" :placeholder="true" :safeAreaInsetBottom="true" inactiveColor="#333" @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-2.png')" />
|
||||
<u-tabbar-item text="+晚餐" @click="tabbarClick" :icon="require('../../static/imgs/foods-3.png')" />
|
||||
@@ -99,17 +73,13 @@
|
||||
</u-tabbar>
|
||||
|
||||
<!-- 添加食谱弹窗 -->
|
||||
<addFoods v-if="addShow" :addShow="addShow" :selectGoods="selectGoods" :decimals="true" @confirm="confirmHandle"
|
||||
@close="closeHandle" @delThis="delThis" @tabGoodsInfo="tabGoodsInfo" max="999" />
|
||||
<addFoods v-if="addShow" :addShow="addShow" :selectGoods="selectGoods" :decimals="true" @confirm="confirmHandle" @close="closeHandle" @delThis="delThis" @tabGoodsInfo="tabGoodsInfo" max="999" />
|
||||
|
||||
<!-- 修改运动弹窗 -->
|
||||
<addPopup :selectSports="selectSports" :addSportsShow="addSportsShow" @comfirmSport="comfirmSport"
|
||||
@cancleSport="cancleSport" @delSport="delSport" />
|
||||
|
||||
<addPopup :selectSports="selectSports" :addSportsShow="addSportsShow" @comfirmSport="comfirmSport" @cancleSport="cancleSport" @delSport="delSport" />
|
||||
|
||||
<!-- 选择日历 -->
|
||||
<dateTemplate :lists="calendarList" :today="today" :month="month" :dateShow="dateShow" type='foods' @backDate="backDate"
|
||||
@dateClick="dateClick" @closeDate="closeDate" @datePreNext="datePreNext" />
|
||||
<dateTemplate :lists="calendarList" :today="today" :month="month" :dateShow="dateShow" type='foods' @backDate="backDate" @dateClick="dateClick" @closeDate="closeDate" @datePreNext="datePreNext" />
|
||||
|
||||
</view>
|
||||
</template>
|
||||
@@ -173,6 +143,13 @@
|
||||
this.intakes = res.intakes;
|
||||
this.sports = res.exercises.lists;
|
||||
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,
|
||||
title: '编辑运动'
|
||||
};
|
||||
// console.log(this.selectSports);
|
||||
this.addSportsShow = true;
|
||||
},
|
||||
// 弹窗确认按钮新增 这里接口报错了 ,
|
||||
@@ -207,7 +183,9 @@
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: 'none'
|
||||
icon: "none",
|
||||
duration: 2000,
|
||||
mask: true
|
||||
})
|
||||
});
|
||||
},
|
||||
@@ -220,11 +198,17 @@
|
||||
let params = {
|
||||
exercise_id: this.selectSports.exercise_id //
|
||||
};
|
||||
console.log(params);
|
||||
delHealthSports(params).then(res => {
|
||||
this.addSportsShow = false;
|
||||
this.selectSports = {};
|
||||
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)
|
||||
tabbarClick(e) {
|
||||
console.log(e);
|
||||
this.tabarIndex = e;
|
||||
if (e === 3) {
|
||||
this.addEatShow = true;
|
||||
@@ -319,14 +302,14 @@
|
||||
// 添加食物
|
||||
editHealthFoods(data) {
|
||||
editHealthFoods(data).then(res => {
|
||||
console.log(res,'添加食物');
|
||||
this.addShow = false;
|
||||
this.getList();
|
||||
}).catch(err=>{
|
||||
console.log(res,'添加食物error');
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title:err.message,
|
||||
icon:"none"
|
||||
title: err.message,
|
||||
icon: "none",
|
||||
duration: 2000,
|
||||
mask: true
|
||||
})
|
||||
});
|
||||
},
|
||||
@@ -335,6 +318,13 @@
|
||||
delHealthFoods(this.selectGoods[0].intake_id).then(res => {
|
||||
this.addShow = false;
|
||||
this.getList();
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: "none",
|
||||
duration: 2000,
|
||||
mask: true
|
||||
})
|
||||
});
|
||||
},
|
||||
// 跳转到食品详情
|
||||
@@ -354,14 +344,15 @@
|
||||
type: this.dateType
|
||||
}
|
||||
dateList(data).then(res => {
|
||||
console.log(res)
|
||||
this.calendarList = res.calendar
|
||||
this.dateType = ''
|
||||
this.month = res.month
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: 'none'
|
||||
icon: "none",
|
||||
duration: 2000,
|
||||
mask: true
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
@@ -398,7 +398,6 @@ export default {
|
||||
*/
|
||||
logs() {
|
||||
logs().then(res => {
|
||||
// console.log(res.is_login)
|
||||
this.weight = res.weight;
|
||||
this.water = res.water;
|
||||
this.intake_run = res.intake_run;
|
||||
@@ -408,6 +407,13 @@ export default {
|
||||
this.banner = res.banner;
|
||||
this.user = res.user;
|
||||
this.notifications_count = res.notifications_count;
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: "none",
|
||||
duration: 2000,
|
||||
mask: true
|
||||
})
|
||||
});
|
||||
},
|
||||
/**
|
||||
|
||||
@@ -134,7 +134,6 @@
|
||||
//获取体重首页接口
|
||||
getWeights() {
|
||||
weights(this.page).then((res) => {
|
||||
console.log(res)
|
||||
if (res.lists.page.current === 1) {
|
||||
this.lists = []
|
||||
}
|
||||
@@ -198,7 +197,6 @@
|
||||
|
||||
// 点击底部切换
|
||||
tabbarClick(e) {
|
||||
console.log(e)
|
||||
this.tabbarId = Number(e)
|
||||
}
|
||||
},
|
||||
|
||||
@@ -3,18 +3,14 @@
|
||||
<!-- 更多管理 -->
|
||||
<view class="list">
|
||||
<view class="list-item" @click="updImgs">
|
||||
<view class="list-item-left">
|
||||
<span>修改头像</span>
|
||||
</view>
|
||||
<view class="list-item-left"> <span>修改头像</span> </view>
|
||||
<view class="avatar" >
|
||||
<image :src="avatar.showPath || require('@/static/user/cover.png')" mode="aspectFill" />
|
||||
<u-icon name="arrow-right" color="#999" size="20"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-item">
|
||||
<view class="list-item-left">
|
||||
<span>修改昵称</span>
|
||||
</view>
|
||||
<view class="list-item-left"> <span>修改昵称</span> </view>
|
||||
<view class="input">
|
||||
<input type="text" :value="nickname" @blur='blur' placeholder="请输入用户的昵称" maxlength="12" />
|
||||
<u-icon name="arrow-right" color="#999" size="20"></u-icon>
|
||||
@@ -88,7 +84,9 @@
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: 'none'
|
||||
icon: "none",
|
||||
duration: 2000,
|
||||
mask: true
|
||||
})
|
||||
})
|
||||
}
|
||||
@@ -116,7 +114,9 @@
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: 'none'
|
||||
icon: "none",
|
||||
duration: 2000,
|
||||
mask: true
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
@@ -4,61 +4,42 @@
|
||||
<view class="files" @click="sexShow = true">
|
||||
<view class="name">性别</view>
|
||||
<view class="text">
|
||||
<u-icon
|
||||
class="target-icon"
|
||||
:label="recordsData.sex == 1 ? '男士' : '女士'"
|
||||
name="arrow-right"
|
||||
color="#999"
|
||||
size="14"
|
||||
labelSize="14"
|
||||
labelColor="#666"
|
||||
labelPos="left"
|
||||
space="10"
|
||||
/>
|
||||
<u-icon class="target-icon" :label="recordsData.sex == 1 ? '男士' : '女士'" name="arrow-right" color="#999"
|
||||
size="14" labelSize="14" 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"
|
||||
/>
|
||||
<u-action-sheet :actions="sexList" title="你的性别是?" :show="sexShow" cancelText="暂不修改"
|
||||
@select=" e => { (this.recordsData.sex = e.id), (this.sexShow = false); } " @close="sexShow = false" />
|
||||
<!-- 性别 end -->
|
||||
|
||||
<!-- 生日 start -->
|
||||
<view class="files" @click="birthdayShow = true">
|
||||
<view class="name">生日</view>
|
||||
<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"
|
||||
labelSize="14" labelColor="#666" labelPos="left" space="10" />
|
||||
</view>
|
||||
</view>
|
||||
<u-datetime-picker
|
||||
confirmColor="#34ce98"
|
||||
v-model="recordsData.birthday"
|
||||
mode="date"
|
||||
:show="birthdayShow"
|
||||
:formatter="formatter"
|
||||
:minDate="-302688000"
|
||||
:maxDate="maxDate"
|
||||
<u-datetime-picker confirmColor="#34ce98" v-model="recordsData.birthday" mode="date" :show="birthdayShow"
|
||||
:formatter="formatter" :minDate="-302688000" :maxDate="maxDate"
|
||||
@confirm=" e => { this.recordsData.birthday = e.value, this.birthdayShow = false } "
|
||||
@cancel=" () => { this.birthdayShow = false; } "
|
||||
/>
|
||||
@cancel=" () => { this.birthdayShow = false; } " />
|
||||
<!-- 生日 end -->
|
||||
|
||||
<!-- 身高 start-->
|
||||
<view class="files" @click="heightShow = true">
|
||||
<view class="name">身高</view>
|
||||
<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"
|
||||
size="14" labelSize="14" labelColor="#666" labelPos="left" space="10" />
|
||||
</view>
|
||||
</view>
|
||||
<u-popup :show="heightShow" @close="() => { heightShow = false }">
|
||||
<view class="v-scale">
|
||||
<view class="title"> 你的身高为?</view>
|
||||
<view class="total"> {{recordsData.height}} CM </view>
|
||||
<vue-scale :min="10" :max="100" :int="false" :single="10" :h="80" :styles="styles" @scroll="scrollAll('height',$event)" :scrollLeft="Number(recordsData.height)" />
|
||||
<vue-scale :min="10" :max="100" :int="false" :single="10" :h="80" :styles="styles"
|
||||
@scroll="scrollAll('height',$event)" :scrollLeft="Number(recordsData.height)" />
|
||||
</view>
|
||||
</u-popup>
|
||||
<!-- 身高 end -->
|
||||
@@ -67,14 +48,16 @@
|
||||
<view class="files bt30" @click="weightShow = true">
|
||||
<view class="name">最新体重</view>
|
||||
<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"
|
||||
size="14" labelSize="14" labelColor="#666" labelPos="left" space="10" />
|
||||
</view>
|
||||
</view>
|
||||
<u-popup :show="weightShow" @close="() => { weightShow = false }">
|
||||
<view class="v-scale">
|
||||
<view class="title"> 你的当前体重为?</view>
|
||||
<view class="total"> {{recordsData.weight}} KG </view>
|
||||
<vue-scale :min="10" :max="100" :int="false" :single="10" :h="80" :styles="styles" @scroll="scrollAll('weight',$event)" :scrollLeft="Number(recordsData.weight)" />
|
||||
<vue-scale :min="10" :max="100" :int="false" :single="10" :h="80" :styles="styles"
|
||||
@scroll="scrollAll('weight',$event)" :scrollLeft="Number(recordsData.weight)" />
|
||||
</view>
|
||||
</u-popup>
|
||||
<!-- 生日 end -->
|
||||
@@ -83,29 +66,29 @@
|
||||
<view class="files" @click="targetShow = true">
|
||||
<view class="name">目标</view>
|
||||
<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"
|
||||
color="#999" size="14" labelSize="14" labelColor="#666" labelPos="left" space="10" />
|
||||
</view>
|
||||
</view>
|
||||
<u-action-sheet
|
||||
:actions="targetList"
|
||||
title="你的目标是?"
|
||||
:show="targetShow"
|
||||
cancelText="暂不修改"
|
||||
<u-action-sheet :actions="targetList" title="你的目标是?" :show="targetShow" cancelText="暂不修改"
|
||||
@select=" e => { (this.selectedTargetIndex = this.targetList.findIndex(item => e.id === item.id)), (this.targetShow = false); } "
|
||||
@close="targetShow = false"
|
||||
/>
|
||||
@close="targetShow = false" />
|
||||
<!-- 目标 end -->
|
||||
|
||||
<!-- 目标体重 start-->
|
||||
<view class="files" @click="targetWeightShow = true">
|
||||
<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">
|
||||
<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>
|
||||
<u-popup :show="targetWeightShow" @close="() => { targetWeightShow = false }">
|
||||
<view class="v-scale">
|
||||
<view class="title"> 你的目标体重为?</view>
|
||||
<view class="total"> {{recordsData.goal_weight}} KG </view>
|
||||
<vue-scale :min="10" :max="100" :int="false" :single="10" :h="80" :styles="styles" @scroll="scrollAll('goalweight',$event)" :scrollLeft="Number(recordsData.goal_weight)" />
|
||||
<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 -->
|
||||
@@ -114,17 +97,13 @@
|
||||
<view class="files" @click="exerciseShow = true">
|
||||
<view class="name">运动量</view>
|
||||
<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"
|
||||
color="#999" size="14" labelSize="14" labelColor="#666" labelPos="left" space="10" />
|
||||
</view>
|
||||
</view>
|
||||
<u-action-sheet
|
||||
:actions="exerciseList"
|
||||
title="你的运动量是?"
|
||||
:show="exerciseShow"
|
||||
cancelText="暂不修改"
|
||||
<u-action-sheet :actions="exerciseList" title="你的运动量是?" :show="exerciseShow" cancelText="暂不修改"
|
||||
@select=" e => { (this.selectExerciseIndex = this.exerciseList.findIndex(item => e.id === item.id)), (this.exerciseShow = false); } "
|
||||
@close="exerciseShow = false"
|
||||
/>
|
||||
@close="exerciseShow = false" />
|
||||
<!-- 运动量 end -->
|
||||
<view class="sureBtn" @click="sureBtn"> 确认修改 </view>
|
||||
<view class="des">修改资料后可更新并查看最新方案,预算热量可能会发生变化</view>
|
||||
@@ -132,11 +111,14 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { editHealthBefore,editHealth } from '@/apis/interfaces/essentialInfo.js';
|
||||
import moment from 'moment';
|
||||
import vueScale from '@/components/vueScale'; // 体重标尺
|
||||
export default {
|
||||
components:{
|
||||
import {
|
||||
editHealthBefore,
|
||||
editHealth
|
||||
} from '@/apis/interfaces/essentialInfo.js';
|
||||
import moment from 'moment';
|
||||
import vueScale from '@/components/vueScale'; // 体重标尺
|
||||
export default {
|
||||
components: {
|
||||
vueScale
|
||||
},
|
||||
data() {
|
||||
@@ -145,16 +127,43 @@ export default {
|
||||
birthdayShow: false, // 出生日期展示
|
||||
maxDate: new Date().getTime(),
|
||||
sexShow: false, // 性别弹窗是否显示
|
||||
sexList: [{name: '男士',id: 1},{name: '女士',id: 2}],
|
||||
sexList: [{
|
||||
name: '男士',
|
||||
id: 1
|
||||
}, {
|
||||
name: '女士',
|
||||
id: 2
|
||||
}],
|
||||
targetShow: false, // 目标弹窗是否显示
|
||||
targetList: [{name: '减脂',id: 1},{name: '保持体重',id: 2},{name: '增肌',id: 3}],
|
||||
selectedTargetIndex: 0,// 默认选择了那个target
|
||||
exerciseShow:false,// 运动量弹窗是否显示
|
||||
exerciseList:[{name:'久坐不动',id:1},{name:'少量运动',id:2},{name:'中等运动量',id:3},{name:'超强度运动',id:4}],
|
||||
selectExerciseIndex:0,//默认选择运动量是久坐不懂得
|
||||
heightShow:false,
|
||||
weightShow:false,
|
||||
targetWeightShow:false,
|
||||
targetList: [{
|
||||
name: '减脂',
|
||||
id: 1
|
||||
}, {
|
||||
name: '保持体重',
|
||||
id: 2
|
||||
}, {
|
||||
name: '增肌',
|
||||
id: 3
|
||||
}],
|
||||
selectedTargetIndex: 0, // 默认选择了那个target
|
||||
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',
|
||||
@@ -180,94 +189,118 @@ export default {
|
||||
this.selectExerciseIndex = this.exerciseList.findIndex(item => item.id === res.exercise)
|
||||
})
|
||||
.catch(err => {
|
||||
conso.log(err);
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: "none",
|
||||
duration: 2000,
|
||||
mask: true
|
||||
})
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 身高 体重 目标体重 滚动
|
||||
scrollAll(type,value) {
|
||||
if(type === 'height'){
|
||||
scrollAll(type, value) {
|
||||
if (type === 'height') {
|
||||
return this.recordsData.height = value;
|
||||
}
|
||||
if(type === 'weight'){
|
||||
if (type === 'weight') {
|
||||
return this.recordsData.weight = value;
|
||||
}
|
||||
if(type === 'goalweight'){
|
||||
if (type === 'goalweight') {
|
||||
return this.recordsData.goal_weight = value;
|
||||
}
|
||||
},
|
||||
// 年龄 - 过滤 - 自定义 - 出生年月日
|
||||
formatter(type, value) {
|
||||
if (type === 'year') {return `${value}年`;}
|
||||
if (type === 'month') {return `${value}月`;}
|
||||
if (type === 'day') {return `${value}日`;}
|
||||
if (type === 'year') {
|
||||
return `${value}年`;
|
||||
}
|
||||
if (type === 'month') {
|
||||
return `${value}月`;
|
||||
}
|
||||
if (type === 'day') {
|
||||
return `${value}日`;
|
||||
}
|
||||
return value;
|
||||
},
|
||||
// 提交按钮
|
||||
sureBtn(){
|
||||
|
||||
sureBtn() {
|
||||
let params = {
|
||||
record_id:this.recordsData.record_id,
|
||||
birthday:moment(this.recordsData.birthday).format('YYYY-MM-DD'),
|
||||
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
|
||||
record_id: this.recordsData.record_id,
|
||||
birthday: moment(this.recordsData.birthday).format('YYYY-MM-DD'),
|
||||
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=>{
|
||||
editHealth(params.record_id, params).then(res => {
|
||||
this.$Router.back()
|
||||
}).catch(err=>{
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: "none",
|
||||
duration: 2000,
|
||||
mask: true
|
||||
})
|
||||
this.$Router.back()
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
.content {
|
||||
padding: $padding;
|
||||
}
|
||||
.files {
|
||||
}
|
||||
|
||||
.files {
|
||||
display: flex;
|
||||
padding: $padding + 10 $padding - 20;
|
||||
box-sizing: border-box;
|
||||
border-bottom: #f9f9f9 2rpx solid;
|
||||
font-size: $title-size;
|
||||
|
||||
&:last-child {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.name {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.text {
|
||||
color: $text-gray;
|
||||
}
|
||||
}
|
||||
.v-scale{
|
||||
}
|
||||
|
||||
.v-scale {
|
||||
padding: $padding * 2 0;
|
||||
font-size: $title-size;
|
||||
.title{
|
||||
|
||||
.title {
|
||||
text-align: center;
|
||||
font-size: $title-size + 10;
|
||||
margin-bottom: $margin;
|
||||
}
|
||||
.total{
|
||||
|
||||
.total {
|
||||
font-size: $title-size;
|
||||
color: $main-color;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
.des {
|
||||
}
|
||||
|
||||
.des {
|
||||
color: $text-gray-m;
|
||||
font-size: $title-size-m - 4;
|
||||
margin-top: $margin * 2;
|
||||
text-align: center;
|
||||
}
|
||||
.sureBtn{
|
||||
}
|
||||
|
||||
.sureBtn {
|
||||
background-color: $main-color;
|
||||
color: #fff;
|
||||
font-size: $title-size;
|
||||
@@ -275,8 +308,9 @@ export default {
|
||||
padding: $padding;
|
||||
border-radius: $radius;
|
||||
margin-top: $margin * 2;
|
||||
}
|
||||
.bt30 {
|
||||
}
|
||||
|
||||
.bt30 {
|
||||
border-bottom: #f9f9f9 20rpx solid;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -316,7 +316,7 @@
|
||||
|
||||
.user-content {
|
||||
padding-left: 158rpx;
|
||||
height: 128rpx;
|
||||
height: 140rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
|
||||
Reference in New Issue
Block a user