食物交换份内容修改

This commit is contained in:
jxg 2024-05-17 17:49:55 +08:00
commit f13bb2040e
4 changed files with 62 additions and 10 deletions

View File

@ -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), //食物成分

View File

@ -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;

View File

@ -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: {

View File

@ -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 //123
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
})
},
//