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.

522 lines
10 KiB

<template>
3 years ago
<view class="information-box">
3 years ago
<view class="search-box acea-row row-middle">
<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">
<swiper-item v-for="(item,index) in articleList" :key="index">
<image :src="item.imageInput" mode="aspectFill" class="vote-img"></image>
<view class="news">
<view class="news-title-h line2">{{item.title}}</view>
<view class="news-title-s line1">{{item.title}}</view>
</view>
</swiper-item>
</swiper>
<scroll-view class="scroll-view_N" scroll-x="true">
<view class="rotaion-box" @click="toTodayEvent">
<view class="acea-row rotaion row-center">
3 years ago
<image src="../../static/images/details1.png" mode="aspectFill"></image>
3 years ago
<view class="rotaion-h">今日大事</view>
<view class="rotaion-s">每日热点资讯</view>
</view>
3 years ago
</view>
<view class="rotaion-box" @click="toBusinessInfo">
<view class="acea-row rotaion row-center">
3 years ago
<image src="../../static/images/details2.png" mode="aspectFill"></image>
3 years ago
<view class="rotaion-h">商业资讯</view>
<view class="rotaion-s">商业资讯抢先知</view>
</view>
</view>
<view class="rotaion-box" @click="toGovernmentPolicy">
<view class="acea-row rotaion row-center">
3 years ago
<image src="../../static/images/details3.png" mode="aspectFill"></image>
3 years ago
<view class="rotaion-h">政府政策</view>
<view class="rotaion-s">了解政府政策</view>
</view>
</view>
<view class="rotaion-box" @click="toLifeInfo">
<view class="acea-row rotaion row-center">
3 years ago
<image src="../../static/images/details4.png" mode="aspectFill"></image>
3 years ago
<view class="rotaion-h">生活资讯</view>
<view class="rotaion-s">有趣好玩</view>
</view>
3 years ago
</view>
</scroll-view>
<!-- 最新资讯 -->
<view class="newInfo-box">
3 years ago
<image src="../../static/images/newInfo.png" mode="" class="newInfo-title-img"></image>
<view class="newInfo">
<view class="modular acea-row row-between" v-for="(item,index) in articleList" :key="index"
@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">203
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>
<!-- 热点精选 -->
<view class="hotspot-box">
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">
<view class="slide-box" v-for="(item,index) in articleList" :key="index">
<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>
<!-- 值得关注 -->
<view class="follow-box">
3 years ago
<image src="../../static/images/follow-title.png" mode="" class="title-h-img"></image>
<view class="follow-con" v-for="(item,index) in articleList" :key="index">
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>
<view>{{item.createTime.split(' ')[0]}}</view>
3 years ago
<view class="acea-row row-middle">203
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 acea-row row-column-between">
<view class="title-s line1">{{item.author}}</view>
3 years ago
<view class="title-con line1">{{item.title}}</view>
3 years ago
</view>
<view class="follow-btn">关注+</view>
</view>
</view>
</view>
</view>
</template>
<script>
3 years ago
import {
getArticle
} from "@/api/home";
export default {
data() {
return {
articleList: [],
page: 0,
size: 10,
}
},
mounted() {
this.getArticleList()
},
onReachBottom() {
this.page = this.page + 1
this.getArticleList()
},
methods: {
getArticleList() {
getArticle({
page: this.page,
size: this.size,
isHot: 0
}).then((res) => {
this.articleList = this.articleList.concat(res.data.content)
})
},
toDetail(id) {
this.$yrouter.push({
path: '/pages/life/articleDetail/index',
query: {
id: id
}
})
},
// 今日大事
toTodayEvent() {
uni.navigateTo({
url: '/pages/life/articleList/index?active=1'
});
},
// 商业资讯
toBusinessInfo() {
uni.navigateTo({
url: '/pages/life/articleList/index?active=2'
});
},
// 政府政策
toGovernmentPolicy() {
uni.navigateTo({
url: '/pages/life/articleList/index?active=3'
});
},
// 生活资讯
toLifeInfo() {
uni.navigateTo({
url: '/pages/life/articleList/index?active=4'
});
},
}
}
</script>
3 years ago
<style lang="less">
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;
margin: 52rpx auto;
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;
3 years ago
right: -2rpx;
3 years ago
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;
3 years ago
/* background: #FFFFFF; */
3 years ago
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: 100%;
3 years ago
height: 358rpx;
3 years ago
border-radius: 16rpx 16rpx 0 0;
color: #FFF;
position: absolute;
3 years ago
padding: 0 40rpx;
3 years ago
}
3 years ago
.news-title-h {
width: 590rpx;
3 years ago
font-size: 28rpx;
position: absolute;
3 years ago
bottom: 65rpx;
3 years ago
}
3 years ago
.news-title-s {
width: 590rpx;
3 years ago
font-size: 20rpx;
position: absolute;
3 years ago
bottom: 25rpx;
3 years ago
}
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;
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: 588rpx;
height: 130rpx;
3 years ago
bottom: 30rpx;
3 years ago
left: 24rpx;
position: absolute;
}
3 years ago
.hotspot-icon {
3 years ago
width: 72rpx;
height: 32rpx;
background: #FE3737;
border-radius: 12rpx 2rpx 12rpx 0;
font-size: 22rpx;
color: #fff;
text-align: center;
3 years ago
margin-bottom: 16rpx;
3 years ago
}
3 years ago
.hotspot-title-h {
3 years ago
max-width: 588rpx;
max-height: 80rpx;
3 years ago
font-size: 28rpx;
color: #FFFFFF;
3 years ago
white-space: pre-wrap;
3 years ago
}
3 years ago
3 years ago
/* 值得关注 */
3 years ago
.follow-box {
3 years ago
width: 100%;
3 years ago
height: 940rpx;
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;
3 years ago
padding: 14rpx 20rpx 14rpx 20rpx;
3 years ago
}
3 years ago
.follow-bottom image {
3 years ago
width: 52rpx;
height: 52rpx;
border-radius: 50%;
margin-right: 8rpx;
}
3 years ago
3 years ago
.follow-title-b {
3 years ago
width: 230rpx;
3 years ago
height: 52rpx;
.title-s {
height: 25rpx;
line-height: 25rpx;
font-size: 20rpx;
font-weight: 600;
}
.title-con {
height: 20rpx;
font-size: 16rpx;
color: #707070;
}
3 years ago
}
3 years ago
3 years ago
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>