[更新发现]
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="modular goods">
|
||||
<image class="img" src="/static/find/menu_0.jpg" mode="aspectFill"></image>
|
||||
<image class="img" :src="foodDate.cover" mode="aspectFill"></image>
|
||||
<view class="title">
|
||||
<view class="name">
|
||||
白粉桃
|
||||
{{ foodDate.name }}
|
||||
</view>
|
||||
<view class="text">
|
||||
295千卡/100克
|
||||
{{ foodDate.heat }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -15,11 +15,11 @@
|
||||
<view class="modular foods">
|
||||
<view class="title">
|
||||
<view class="name">
|
||||
推荐搭配
|
||||
食物价值
|
||||
</view>
|
||||
</view>
|
||||
<view class="text">
|
||||
白粉桃富含蛋白质、脂肪、维生素、挥发油、有机酸、矿物质、粗纤维和水化合物等多种成份。有解饥消渴,补养身体;且有增进人体胆汁分泌,促进消化和治疗便秘等功效
|
||||
{{ foodDate.recom_text }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
</view>
|
||||
<view class="energy">
|
||||
<view class="number">
|
||||
<text>113</text>千卡
|
||||
<text>{{ calory }}</text>{{ current == 0 ? '千卡' : '千焦'}}
|
||||
</view>
|
||||
<view class="tips">
|
||||
每100克(可食用部分)
|
||||
@@ -65,41 +65,41 @@
|
||||
含量
|
||||
</view>
|
||||
<view class="tabs-title">
|
||||
NPV%
|
||||
NRV%
|
||||
</view>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="label">
|
||||
<view class="label" v-if="nutrition.protein">
|
||||
<view class="label-name">
|
||||
蛋白质
|
||||
</view>
|
||||
<view class="label-name">
|
||||
0.1克
|
||||
{{ nutrition.protein.value }}克
|
||||
</view>
|
||||
<view class="label-name">
|
||||
0.1%
|
||||
{{ nutrition.protein.nrv }}%
|
||||
</view>
|
||||
</view>
|
||||
<view class="label">
|
||||
<view class="label" v-if="nutrition.cellulose">
|
||||
<view class="label-name">
|
||||
脂肪
|
||||
</view>
|
||||
<view class="label-name">
|
||||
0.4克
|
||||
{{ nutrition.cellulose.value }}克
|
||||
</view>
|
||||
<view class="label-name">
|
||||
0.7%
|
||||
{{ nutrition.cellulose.nrv }}%
|
||||
</view>
|
||||
</view>
|
||||
<view class="label">
|
||||
<view class="label" v-if="nutrition.carbohydrate">
|
||||
<view class="label-name">
|
||||
碳水化合物
|
||||
</view>
|
||||
<view class="label-name">
|
||||
0.2克
|
||||
{{ nutrition.carbohydrate.nrv }}克
|
||||
</view>
|
||||
<view class="label-name">
|
||||
0.1%
|
||||
{{ nutrition.carbohydrate.nrv }}%
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -109,20 +109,20 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="modular foods">
|
||||
<view class="modular foods" v-if="goodsArr.length > 0">
|
||||
<view class="title">
|
||||
<view class="name">
|
||||
相关商品
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<image class="item-cover" src="http://api.zh.shangkelian.cn/storage/images/2022/01/06/fc143605e2a1557989e96652d990579f.png" mode="aspectFill"></image>
|
||||
<view class="item" v-for="(item, index) in goodsArr" :key="index">
|
||||
<image class="item-cover" :src="item.cover ? item.cover : '/static/find/default_img.png'" mode="aspectFill"></image>
|
||||
<view class="item-title">
|
||||
<view class="nowrap item-name">
|
||||
黑果枸杞
|
||||
{{ item.name }}
|
||||
</view>
|
||||
<view class="item-price">
|
||||
¥99.00
|
||||
¥{{ item.price }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-btn">
|
||||
@@ -134,16 +134,40 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
import { foodDet } from '@/apis/interfaces/ranking'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
current: 0
|
||||
foodDate : '',
|
||||
goodsArr : [],
|
||||
calory : '',
|
||||
nutrition : '',
|
||||
current : 0
|
||||
}
|
||||
},
|
||||
onLoad() {},
|
||||
mounted() {
|
||||
this.foodRank()
|
||||
},
|
||||
methods: {
|
||||
// 分类-食物
|
||||
foodRank(){
|
||||
foodDet(this.$Route.query.id).then(res => {
|
||||
this.foodDate = res
|
||||
this.goodsArr = res.goods
|
||||
this.nutrition = res.data
|
||||
this.calory = res.calory
|
||||
})
|
||||
},
|
||||
|
||||
// 热量切换
|
||||
switchTab(val) {
|
||||
this.current = val
|
||||
if(val == 0) {
|
||||
this.calory = this.foodDate.calory
|
||||
return
|
||||
}else {
|
||||
this.calory = this.foodDate.joule
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user