You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

521 lines
11 KiB

<template>
3 years ago
<view class="information-box">
3 years ago
<skeleton v-if="showSkeleton" ref="skeleton" loading="chiaroscuro" selector="skeleton" bgcolor="#FFF"></skeleton>
<view class="search-box acea-row row-middle skeleton-rect">
3 years ago
<image src="../../static/images/search-icon.png" mode=""></image>
<input type="text" value="" placeholder="请输入相关关键词" />
3 years ago
<view class="search acea-row row-center-wrapper">搜一下</view>
</view>
3 years ago
<swiper class="vote-box skeleton-rect">
3 years ago
<swiper-item v-for="(item,index) in hotList" :key="index" @click="toDetail(item.id)">
3 years ago
<image :src="item.imageInput" mode="aspectFill" class="vote-img"></image>
<view class="news">
3 years ago
<view class="news-title-h line1">{{item.title}}</view>
3 years ago
<view class="news-title-s line1">{{item.createTime}}</view>
3 years ago
</view>
</swiper-item>
</swiper>
3 years ago
<scroll-view class="scroll-view_N skeleton-rect" scroll-x="true">
3 years ago
<view class="rotaion-box" @click="toCategoryList(item.id)" v-for="(item,index) in categoryList" :key="index">
3 years ago
<view class="acea-row rotaion row-center">
3 years ago
<image :src="item.img" mode="aspectFill"></image>
<view class="rotaion-h">{{item.name}}</view>
<view class="rotaion-s">{{item.description}}</view>
3 years ago
</view>
3 years ago
</view>
</scroll-view>
<!-- 最新资讯 -->
3 years ago
<view class="newInfo-box skeleton-rect" v-if="newList.length > 0">
3 years ago
<image src="../../static/images/newInfo.png" mode="" class="newInfo-title-img"></image>
<view class="newInfo">
3 years ago
<view class="modular acea-row row-between" v-for="(item,index) in newList" :key="index"
3 years ago
@click="toDetail(item.id)">
<view class="acea-row title">
<view class="modular-h line2">{{item.title}}</view>
3 years ago
<view class="title-l acea-row row-between">
3 years ago
<view>{{item.author}}</view>
<view>{{item.createTime.split(' ')[0]}}</view>
3 years ago
<view class="acea-row row-middle">{{item.visit}}
3 years ago
<image src="../../static/images/eye.png" mode="aspectFill"></image>
3 years ago
</view>
</view>
</view>
3 years ago
<image :src="item.imageInput" mode="aspectFill"></image>
3 years ago
</view>
</view>
</view>
<!-- 热点精选 -->
3 years ago
<view class="hotspot-box skeleton-rect">
3 years ago
<image src="../../static/images/user/hotspot.png" mode="" class="title-h-img"></image>
<scroll-view class="scroll-view_H acea-row" scroll-x="true">
3 years ago
<view class="slide-box" v-for="(item,index) in hotList" :key="index" @click="toDetail(item.id)">
3 years ago
<image :src="item.imageInput" mode="aspectFill"></image>
3 years ago
<view class="hotspot-con">
<view class="hotspot-icon">热点</view>
3 years ago
<view class="hotspot-title-h line2">{{item.title}}</view>
3 years ago
</view>
</view>
</scroll-view>
</view>
<!-- 值得关注 -->
3 years ago
<view class="follow-box skeleton-rect">
3 years ago
<image src="../../static/images/follow-title.png" mode="" class="title-h-img"></image>
3 years ago
<view class="follow-con" v-for="(item,index) in concernList" :key="index" @click="toDetail(item.id)">
3 years ago
<view class="follow-top acea-row row-between">
3 years ago
<view class="acea-row follow-title">
<view class="follow-h line2">{{item.title}}</view>
3 years ago
<view class="follow-title-l acea-row row-between">
3 years ago
<view>{{item.author}}</view>
3 years ago
<view>{{item.createTime}}</view>
<view class="acea-row row-middle">
<text>{{item.visit}}</text>
3 years ago
<image src="../../static/images/eye.png" mode="aspectFill"></image>
3 years ago
</view>
</view>
</view>
3 years ago
<image :src="item.imageInput" mode="aspectFill"></image>
3 years ago
</view>
<view class="follow-bottom acea-row row-middle">
3 years ago
<image :src="item.imageInput" mode=""></image>
3 years ago
<view class="follow-title-b">
3 years ago
<view class="title-s">{{item.author}}</view>
<view class="title-con line1">{{item.title}}</view>
3 years ago
</view>
3 years ago
<!-- <view class="follow-btn">关注+</view> -->
3 years ago
</view>
</view>
3 years ago
<!-- <LoadStatus :loadStatus="loadstatus"></LoadStatus> -->
3 years ago
</view>
</view>
</template>
<script>
3 years ago
import { getArticle } from "@/api/home";
import { articleIndex } from "@/api/article"
3 years ago
import LoadStatus from "@/components/LoadStatus"
import skeleton from '@/components/quick-skeleton/quick-skeleton'
3 years ago
export default {
3 years ago
components:{
LoadStatus,
skeleton
},
3 years ago
data() {
return {
3 years ago
categoryList: [],
newList: [],
hotList: [],
concernList: [],
3 years ago
articleList: [],
page: 0,
size: 10,
3 years ago
loadstatus: '上拉加载更多...',
showSkeleton: true
3 years ago
}
},
mounted() {
3 years ago
// this.getArticleList()
this.getArticleIndex()
3 years ago
},
onReachBottom() {
this.page = this.page + 1
3 years ago
// this.getArticleList()
3 years ago
},
computed:{
3 years ago
},
onPullDownRefresh() {
this.getArticleIndex()
},
onReady: function() {
const that = this;
that.$refs.skeleton.attachedAction();
that.$refs.skeleton.readyAction();
3 years ago
},
methods: {
3 years ago
getArticleIndex(){
3 years ago
uni.showLoading({
title: '正在加载中...',
})
3 years ago
articleIndex().then((res)=>{
this.categoryList = res.data.categoryList
this.concernList = res.data.concernList
this.hotList = res.data.hotList
this.newList = res.data.newList
3 years ago
uni.hideLoading()
uni.stopPullDownRefresh()
this.showSkeleton = false
3 years ago
})
},
3 years ago
getArticleList() {
3 years ago
this.loadstatus = '正在加载中...'
3 years ago
getArticle({
page: this.page,
size: this.size,
isHot: 0
}).then((res) => {
3 years ago
if(res.data.content.length < this.size){
this.loadstatus = '没有更多了...'
}
3 years ago
this.articleList = this.articleList.concat(res.data.content)
})
},
toDetail(id) {
this.$yrouter.push({
path: '/pages/life/articleDetail/index',
query: {
id: id
}
})
},
3 years ago
toCategoryList(id){
3 years ago
uni.navigateTo({
3 years ago
url: '/pages/life/articleList/index?active=' + id
3 years ago
});
},
}
}
</script>
<style>
3 years ago
.information-box {
3 years ago
width: 100%;
3 years ago
height: auto;
margin-bottom: 50rpx;
3 years ago
position: relative;
}
3 years ago
.search-box {
3 years ago
width: 670rpx;
height: 68rpx;
border: 2rpx solid #FF5100;
border-radius: 8rpx;
3 years ago
margin: 24rpx auto 52rpx;
3 years ago
font-size: 28rpx;
position: relative;
}
3 years ago
.search-box image {
3 years ago
width: 35rpx;
height: 35rpx;
margin: 0 29rpx 0 52rpx;
}
3 years ago
.search {
3 years ago
position: absolute;
right: 0;
width: 132rpx;
height: 68rpx;
background: linear-gradient(39deg, #FF5100 0%, #FFA074 100%);
border-radius: 8rpx;
color: #fff;
3 years ago
3 years ago
}
3 years ago
.vote-box {
3 years ago
width: 670rpx;
height: 358rpx;
box-shadow: 0px 6rpx 12rpx rgba(0, 0, 0, 0.16);
border-radius: 16rpx;
margin: 0 auto;
position: relative;
3 years ago
overflow: hidden;
3 years ago
}
3 years ago
.vote-img {
position: absolute;
width: 670rpx;
height: 358rpx;
}
.news {
3 years ago
width: 590rpx;
height: 94rpx;
background: rgba(0, 0, 0, 0.2);
border-radius: 14rpx;
3 years ago
position: absolute;
3 years ago
bottom: 6rpx;
left: 50%;
margin-left: -295rpx;
color: #fff;
padding: 14rpx;
3 years ago
}
3 years ago
.news-title-h {
3 years ago
font-size: 28rpx;
}
3 years ago
.news-title-s {
3 years ago
font-size: 20rpx;
}
3 years ago
/* .vote {
3 years ago
width: 100%;
height: 110rpx;
position: absolute;
bottom: 0;
border: 1rpx solid #000000;
3 years ago
} */
.scroll-view_N {
3 years ago
width: 100%;
3 years ago
height: 238rpx;
margin: 30rpx 0rpx 34rpx 0rpx;
3 years ago
white-space: nowrap;
}
3 years ago
.rotaion-box {
3 years ago
width: 168rpx;
3 years ago
height: 208rpx;
3 years ago
background: #FFFFFF;
box-shadow: 0rpx 6rpx 12rpx rgba(0, 0, 0, 0.16);
border-radius: 16rpx;
3 years ago
margin: 10rpx 32rpx 10rpx 0rpx;
3 years ago
display: inline-block;
}
3 years ago
.rotaion-box:nth-child(1) {
margin-left: 40rpx;
}
.rotaion {
width: 100%;
height: 208rpx;
padding: 36rpx 0 16rpx 0;
}
.rotaion image {
3 years ago
width: 80rpx;
height: 80rpx;
border-radius: 50%;
}
3 years ago
.rotaion-h {
3 years ago
height: 34rpx;
font-size: 24rpx;
color: #333333;
font-weight: 600;
}
3 years ago
.rotaion-s {
3 years ago
height: 26rpx;
font-size: 18rpx;
color: #9D9D9D;
}
3 years ago
3 years ago
/* 最新资讯 */
3 years ago
.newInfo-box {
overflow: hidden;
3 years ago
}
3 years ago
.newInfo-title-img {
3 years ago
width: 160rpx;
height: 52rpx;
margin: 0 0 18rpx 38rpx;
}
3 years ago
.newInfo {
3 years ago
width: 100%;
height: 528rpx;
3 years ago
overflow-y: scroll;
3 years ago
border-top: 2rpx solid #EFEFEF;
}
3 years ago
.modular {
3 years ago
width: 100%;
height: 176rpx;
border-bottom: 2rpx solid #EFEFEF;
padding: 20rpx 40rpx 22rpx 40rpx;
}
3 years ago
.modular-h {
width: 400rpx;
3 years ago
height: 80rpx;
font-size: 28rpx;
color: #4A4A4A;
font-weight: 600;
}
3 years ago
.modular image {
3 years ago
width: 204rpx;
height: 134rpx;
3 years ago
border-radius: 8px;
3 years ago
}
3 years ago
.title {
width: 400rpx;
3 years ago
height: 134rpx;
}
3 years ago
.title-l {
width: 400rpx;
3 years ago
height: 34rpx;
font-size: 24rpx;
color: #707070;
}
3 years ago
.title-l image {
3 years ago
width: 24rpx;
height: 24rpx;
margin-left: 5rpx;
}
3 years ago
3 years ago
/* 热点精选 */
3 years ago
.hotspot-box {
3 years ago
width: 100%;
height: 456rpx;
}
3 years ago
.title-h-img {
3 years ago
width: 162rpx;
height: 62rpx;
margin: 32rpx 0 5rpx 40rpx;
}
3 years ago
.scroll-view_H {
3 years ago
width: 100%;
height: 344rpx;
white-space: nowrap;
}
3 years ago
.scroll-view_H image {
3 years ago
width: 670rpx;
height: 344rpx;
border-radius: 10rpx;
position: absolute;
}
3 years ago
.slide-box {
3 years ago
position: relative;
width: 670rpx;
height: 100%;
display: inline-block;
margin-right: 16rpx;
}
3 years ago
.hotspot-con {
3 years ago
width: 670rpx;
height: 94rpx;
background: rgba(0, 0, 0, 0.2);
border-radius: 0px 0px 8rpx 8rpx;
padding: 8rpx 32rpx;
color: #fff;
3 years ago
position: absolute;
3 years ago
bottom: 0;
3 years ago
}
3 years ago
.hotspot-icon {
3 years ago
width: 72rpx;
height: 32rpx;
background: #FE3737;
border-radius: 12rpx 2rpx 12rpx 0;
position: absolute;
3 years ago
top:-46rpx;
3 years ago
font-size: 22rpx;
color: #fff;
text-align: center;
}
3 years ago
.hotspot-title-h {
3 years ago
width: 588rpx;
font-size: 28rpx;
color: #FFFFFF;
}
3 years ago
3 years ago
/* 值得关注 */
3 years ago
.follow-box {
3 years ago
width: 100%;
3 years ago
position: relative;
overflow: hidden;
3 years ago
}
3 years ago
.follow-con {
3 years ago
width: 670rpx;
height: 250rpx;
margin: 0 auto;
background: #FFFFFF;
box-shadow: 0rpx 4rpx 10rpx rgba(0, 0, 0, 0.16);
border-radius: 16rpx;
margin-bottom: 32rpx;
}
3 years ago
.follow-top {
3 years ago
width: 100%;
height: 170rpx;
padding: 20rpx 20rpx 26rpx 20rpx;
border-bottom: 1rpx solid #DCDCDC;
}
3 years ago
.follow-top image {
3 years ago
width: 232rpx;
height: 130rpx;
border-radius: 16rpx;
}
3 years ago
.follow-title {
3 years ago
width: 370rpx;
height: 100%;
}
3 years ago
.follow-h {
width: 100%;
3 years ago
height: 80rpx;
font-size: 28rpx;
color: #000000;
font-weight: 600;
}
3 years ago
.follow-title-l {
width: 290rpx;
3 years ago
height: 28rpx;
font-size: 20rpx;
color: #707070;
}
3 years ago
.follow-title-l image {
3 years ago
width: 24rpx;
height: 24rpx;
margin-left: 5rpx;
}
3 years ago
.follow-bottom {
3 years ago
width: 100%;
height: 80rpx;
padding: 12rpx 20rpx 16rpx 20rpx;
}
3 years ago
.follow-bottom image {
3 years ago
width: 52rpx;
height: 52rpx;
border-radius: 50%;
margin-right: 8rpx;
}
3 years ago
.follow-title-b {}
.title-s {
3 years ago
height: 28rpx;
3 years ago
font-size: 22rpx;
3 years ago
margin-bottom: 6rpx;
font-weight: 600;
}
3 years ago
.title-con {
width: 230rpx;
3 years ago
font-size: 20rpx;
3 years ago
color: #707070;
}
3 years ago
.follow-btn {
3 years ago
width: 136rpx;
height: 40rpx;
background: linear-gradient(39deg, #FF5A0D 0%, #FFAC85 100%);
border-radius: 26rpx;
font-size: 28rpx;
color: #fff;
text-align: center;
position: absolute;
right: 60rpx;
}
3 years ago
</style>