[更新发现]

This commit is contained in:
zhangmanman
2022-01-13 13:56:32 +08:00
parent 9af54bc24a
commit c82f40ee09
27 changed files with 1274 additions and 295 deletions

View File

@@ -4,94 +4,67 @@
<view class="status-main">
<view class="helloe">欢迎使用ZH健康</view>
<view class="btns">
<view class="btns-item" @click="$Router.push({name: 'signIndex'})"><image src="@/static/icon/sign-icon.png" mode="widthFix"></image></view>
<view class="btns-item show"><uni-icons custom-prefix="iconfont" type="icon-pinglun" size="25"></uni-icons></view>
<view class="btns-item" @click="$Router.push({name: 'signIndex'})"><image src="@/static/icon/sign-icon.gif" mode="widthFix"></image></view>
<view class="btns-item show" @click="$Router.push({name: 'noticeIndex'})"><uni-icons custom-prefix="iconfont" type="icon-pinglun" size="25"></uni-icons></view>
</view>
</view>
</view>
<!-- 搜索 -->
<view class="search">
<navigator class="search-nav" url="">
<view class="search-nav" @click="$Router.push({name: 'indexSearch'})">
<uni-icons class="search-icon" custom-prefix="iconfont" type="icon-sousuo" color="#34CE98" size="20"></uni-icons>
低脂鸡胸肉
</navigator>
</view>
</view>
<!-- 排行榜 -->
<view class="img-card" @click="$Router.push({name: 'rankingIndex'})"><image src="@/static/dev/img-01.png" mode="widthFix"></image></view>
<!-- 精选推荐 -->
<view class="new-box"><view class="title">精选推荐</view><view class="more" @click="$Router.push({name: 'menuIndex'})">查看更多</view></view>
<u-scroll-list class="choiceness-box" indicatorColor="#dafff2" indicatorActiveColor="#34CE98">
<view v-for="(item, index) in choiceness" class="choiceness-item" :key="index">
<view class="choiceness-item-nav" :style="'backgroundColor:#' + item.color">
<image class="choiceness-item-cover" :src="item.thumb"></image>
<view class="choiceness-item-title">{{item.title}}</view>
<view class="choiceness-item-describe">{{item.describe}}</view>
<view v-for="(item, index) in choiceness" class="choiceness-item" :key="index" @click="$Router.push({name: 'menuClassify', params: {id: item.category_id, index: index + 1 }})">
<view class="choiceness-item-nav" :style="'backgroundColor:' + item.color">
<image class="choiceness-item-cover" :src="item.cover"></image>
<view class="nowrap choiceness-item-title">{{item.name}}</view>
<view class="nowrap choiceness-item-describe">{{item.description}}</view>
</view>
</view>
</u-scroll-list>
<!-- 话题广场 -->
<view class="new-box">
<view class="title">话题广场</view><view class="more" @click="$Router.push({name: 'topicIndex'})">查看更多</view>
<view class="title">话题广场</view><view class="more" @click="$Router.push({name: 'topicIndex'})">更多分类</view>
<oct-topic
:lists="topicArr"
@onTopic="$Router.push({ name: 'topicDetails', params: {id: $event.id }})"
@onTopic="$Router.push({ name: 'topicDetails', params: {id: $event.topic_id }})"
/>
</view>
<!-- ZH健康 -->
<view class="img-card"><image src="@/static/dev/img-00.png" mode="widthFix"></image></view>
<view class="img-card"><image src="@/static/dev/img-00.png" mode="widthFix" @click="$Router.push({ name: 'indexGuide'})" ></image></view>
</view>
</template>
<script>
export default {
data() {
return {
choiceness: [{
title : "低碳食谱",
describe: "减肥人士的最爱",
color : "c8e6da",
thumb : 'https://cdn.uviewui.com/uview/goods/1.jpg'
},{
title : "低GI食谱",
describe: "家庭衡量膳食平衡",
color : "f0edff",
thumb : 'https://cdn.uviewui.com/uview/goods/1.jpg'
},{
title : "高蛋白食谱",
describe: "健身搭配食用更佳",
color : "fbeed3",
thumb : 'https://cdn.uviewui.com/uview/goods/1.jpg'
}],
topicArr: [{
id: 1,
title: '坚持做瑜伽可以减肥吗',
read: '100',
praise: '100',
cover: 'http://up.boohee.cn/house/u/mboohee/img/others/7.2.jpg'
},{
id: 2,
title: '有没有减肥秘诀/减肥偏方/减肥窍门',
read: '100',
praise: '100',
cover: 'http://up.boohee.cn/house/u/mboohee/img/others/yundong1.jpg'
},{
id: 3,
title: '只需2招迅速变出小蛮腰',
read: '100',
praise: '100',
cover: 'http://up.boohee.cn/house/u/mboohee/img/others/yundong2.jpg'
},{
id: 3,
title: '有效方便的减肥方法有哪些',
read: '100',
praise: '100',
cover: 'http://up.boohee.cn/house/u/mboohee/img/others/jian.jpg'
}]
};
},
onLoad() {},
methods: {}
};
import { index } from '@/apis/interfaces/topic'
export default {
data() {
return {
choiceness: [],
topicArr: []
};
},
mounted() {
// 获取首页
this.getindex()
},
methods: {
// 首页
getindex(){
index().then(res => {
this.choiceness = res.recipeCategories
this.topicArr = res.topics
})
},
}
};
</script>
<style lang="scss" scoped>
@@ -129,16 +102,16 @@ export default {
width: 46rpx;
vertical-align: top;
}
&.show::before {
content: '';
height: 10rpx;
width: 10rpx;
position: absolute;
right: 0;
top: 0;
background: $text-price;
border-radius: 50%;
}
// &.show::before {
// content: '';
// height: 10rpx;
// width: 10rpx;
// position: absolute;
// right: 0;
// top: 0;
// background: $text-price;
// border-radius: 50%;
// }
}
}
}
@@ -180,10 +153,10 @@ export default {
}
&-cover{
position: absolute;
right: $margin;
top: $margin;
width: 88rpx;
height: 88rpx;
right: $margin - 10;
top: $margin - 5;
width: 100rpx;
height: 100rpx;
vertical-align: top;
}
&-title{
@@ -200,6 +173,9 @@ export default {
font-size: 20rpx;
@extend .nowrap;
}
.choiceness-item-describe {
width: 180rpx;
}
}
}