食物交换份内容修改
This commit is contained in:
commit
f13bb2040e
|
@ -75,7 +75,7 @@ export default { // 所有接口
|
|||
hasLifestyleAssessment: (param) => ajax.get('dis-day-task/hasLifestyleAssessment', param), //查询生活方式评估状态
|
||||
sendTheVerificationCodeApp: (param) => ajax.get('sysUser/sendTheVerificationCodeApp', param), // 发送手机号验证码
|
||||
selectFoodsInfo: (param) => ajax.get(`doodsInfo/selectFoodsInfo`, param), // 查询食材详情
|
||||
selectDictListByFoodList: (param) => ajax.get('disease-assess-dict/selectDictListByFoodList', param), //查询疾病字典
|
||||
selectDictListByFoodList: (param) => ajax.get('disease-assess-dict/selectDictListByFoodList2', param), //查询疾病字典
|
||||
getDiseaseFoodsLevel: (param) => ajax.get(`healthTools/getDiseaseFoodsLevel`, param), //食物榜单
|
||||
getFoodTypes: (param) => ajax.get('healthTools/getFoodTypes', param),
|
||||
selectFoodsList: (param) => ajax.get(`healthTools/selectFoodsList`, param), //食物成分
|
||||
|
|
|
@ -127,6 +127,28 @@ page {
|
|||
color: #51CED5;
|
||||
font-weight: 500;
|
||||
}
|
||||
.descri{
|
||||
width:100%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-end;
|
||||
font-weight: 400;
|
||||
font-size: 26px;
|
||||
margin-top:15px;
|
||||
color: #6E7477;
|
||||
}
|
||||
.descri-content{
|
||||
width:100%;
|
||||
margin-top:15px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-end;
|
||||
.content{
|
||||
font-weight: 400;
|
||||
font-size: 26px;
|
||||
color: #6E7477;
|
||||
}
|
||||
}
|
||||
.bottomTitle{
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
|
|
|
@ -10,8 +10,10 @@
|
|||
<text style="color: #42444F;">{{fomeData.foodName}}</text>
|
||||
<text class="cutt"></text>
|
||||
</view>
|
||||
<view class="greyColor">100g</view>
|
||||
<view class="greyColor">{{fomeData.foodKcal}}{{fomeData.foodUnit}}</view>
|
||||
<view v-if="type == 1 || type == 2" class="greyColor">100g</view>
|
||||
<view v-if="type == 1" class="greyColor">{{fomeData.foodKcal}}{{fomeData.foodUnit}}</view>
|
||||
<view v-if="type == 2" class="greyColor">{{fomeData.foodKcal}}{{fomeData.foodUnit}}钠</view>
|
||||
<view v-if="type == 3" class="greyColor">{{fomeData.foodWeight}}ml</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="exchange">
|
||||
|
@ -19,12 +21,27 @@
|
|||
</view>
|
||||
<block v-for="(item,index) in fomeData.foodInfos" :key="index">
|
||||
<view class="tagBg">
|
||||
<view class="flex align-center">
|
||||
<view v-if="type == 1" class="flex align-center">
|
||||
<text style="color: #fff;">{{item.foodName}}</text>
|
||||
<text class="cutt"></text>
|
||||
</view>
|
||||
<view class="colorWhite">100g</view>
|
||||
<view class="colorWhite">{{item.foodKcal}}{{item.foodUnit}}</view>
|
||||
<view v-if="type == 2" class="flex align-center">
|
||||
<text style="color: #fff;">盐</text>
|
||||
<text class="cutt"></text>
|
||||
</view>
|
||||
<view v-if="type == 3" class="flex align-center">
|
||||
<text style="color: #fff;">糖</text>
|
||||
<text class="cutt"></text>
|
||||
</view>
|
||||
<view v-if="type == 1" class="colorWhite">100g</view>
|
||||
<view v-if="type == 1" class="colorWhite">{{item.foodKcal}}{{item.foodUnit}}</view>
|
||||
<view v-if="type == 2 || type == 3" class="colorWhite">{{ item.foodSalt }}g</view>
|
||||
</view>
|
||||
<view v-if='type == 2' class="descri">注:1克食盐≈400mg钠</view>
|
||||
<view v-if='type == 3' class="descri-content">
|
||||
<view class="content">
|
||||
注:成年人每天的添加糖摄入量不应超过 50 克,最好控制在 25 克以下。
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="index < fomeData.foodInfos.length - 1" class="symbol">+</view>
|
||||
</block>
|
||||
|
@ -51,12 +68,14 @@
|
|||
return {
|
||||
fomeData: {},
|
||||
id: null, //食物id
|
||||
type:"", //食物分类
|
||||
pageShow: false,
|
||||
isHome: false, //返回首页图标是否显示
|
||||
}
|
||||
},
|
||||
onLoad(opt) {
|
||||
this.id = opt.id
|
||||
this.type = opt.type
|
||||
this.getFoodsInfo()
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -17,11 +17,20 @@
|
|||
<view>
|
||||
<view style="font-size: 44px;font-weight: 500;margin-bottom: 10px;">{{item.foodName}}
|
||||
</view>
|
||||
<view>
|
||||
<view v-if='foodClass == 1'>
|
||||
<span class="themColor" style="font-size: 36px;">{{item.foodKcal}}</span>
|
||||
<span class="themColor" style="font-size: 28px;">千卡</span>
|
||||
<span style="font-size: 28px;color:#666;">/100克</span>
|
||||
</view>
|
||||
<view v-if='foodClass == 2'>
|
||||
<span class="themColor" style="font-size: 36px;">{{item.foodKcal}}</span>
|
||||
<span class="themColor" style="font-size: 28px;">mg钠</span>
|
||||
<span style="font-size: 28px;color:#666;">/100克</span>
|
||||
</view>
|
||||
<view v-if='foodClass == 3'>
|
||||
<span class="themColor" style="font-size: 36px;">{{item.foodSalt}}</span>
|
||||
<span class="themColor" style="font-size: 28px;">ml</span>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="rightArrow">
|
||||
|
@ -98,6 +107,7 @@
|
|||
total: 0, //总条数
|
||||
isPageShow: false, //列表是否显示
|
||||
isHome: false, //返回首页图标是否显示
|
||||
foodClass:"", //点击食品分类
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
@ -106,12 +116,13 @@
|
|||
userId: 29
|
||||
}
|
||||
}).then(res => {
|
||||
this.diseaseList = res.data
|
||||
this.diseaseList = res.data.slice(0,3)
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 选择
|
||||
twoChane(item, index) {
|
||||
this.foodClass = item.id //食品分类,1,高油类,2,高钠类,3,饮料与糖
|
||||
this.selectIndex = index
|
||||
this.typeCode = item.id
|
||||
this.pageNum = 1
|
||||
|
@ -149,7 +160,7 @@
|
|||
},
|
||||
goDetail(item) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/hairtailScreen/exchangePortion/detail/detail?id=' + item.id
|
||||
url: '/pages/hairtailScreen/exchangePortion/detail/detail?id=' + item.id + '&type=' + this.foodClass
|
||||
})
|
||||
},
|
||||
// 上一页
|
||||
|
|
Loading…
Reference in New Issue