123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- <template>
- <view>
- <view class="title" >
- <view class="title_text">{{info.title}}</view>
- <view class="title_more" @click="clicktoMore">更多></view>
- </view>
- <view v-if="menuslist.length>0">
- <wenzhanList currentName='index' :listdata="menuslist" ></wenzhanList>
- </view>
- </view>
- </template>
- <script>
- import wenzhanList from '@/pages/components/wenzhanList.vue'
- import {moduleByFour} from '@/http/api/common.js'
- export default {
- components: {
- wenzhanList,
- },
- data() {
- return {
- menuslist:[],
- info:{
- title:'最新资讯'
- }
- }
- },
- async mounted() {
- this.getmoduleByFour()
- },
- methods: {
- async getmoduleByFour(){
- //获取模块4
- let res = await moduleByFour()
- this.menuslist = []
- if (res.data.code == 200) {
- this.info = res.data.data
- if (res.data.data.articleVoList) {
- const arr = res.data.data.articleVoList;
- this.menuslist = arr.slice(0, 3);
- }
- }
- },
- clicktoMore(){
- if (this.info?.moreToSubId && this.info?.moreToColumnId) {
- let data = {
- curNowid:this.info?.moreToColumnId,
- curNowsubid:this.info?.moreToSubId,
- }
- uni.setStorageSync('curNowdata',JSON.stringify(data) );
- uni.switchTab({
- url: '/pages/home/Information',
- });
- }
- },
- }
- }
- </script>
- <style>
- .title{
- display: flex;
- width: 90vw;
- justify-content: space-between;
- margin: 0 auto;
- }
- .title_text{
- width: 128rpx;
- height: 45rpx;
- font-size: 32rpx;
- font-weight: bold;
- color: #333333;
- line-height: 45rpx;
- }
- .title_more{
- width: 80rpx;
- height: 40rpx;
- font-size: 28rpx;
- font-weight: 500;
- color: #999999;
- line-height: 40rpx;
- }
- .box{
- display: flex;
- margin: 20rpx auto;
- justify-content: flex-start;
- width: 90vw;
- height: 160rpx;
- }
- .box_img{
- width: 224rpx;
- height: 150rpx;
- border-radius: 16rpx;
- background-color: #999999;
- }
- .box_right{
- margin-left: 10rpx;
- display: flex;
- flex-direction: column;
- justify-content: space-around;
- }
- .box_title{
- width: 454rpx;
- height: 80rpx;
- font-size: 28rpx;
- font-weight: bold;
- color: #333333;
- line-height: 40rpx;
- display: -webkit-box;
- word-break: break-all;
- text-overflow: ellipsis;
- overflow: hidden;
- -webkit-box-orient: vertical;
- -webkit-line-clamp:2;
- }
- .box_type{
- display: flex;
- justify-content: space-between;
- font-size: 28rpx;
- font-weight: 400;
- color: #999999;
- line-height: 40rpx;
- }
- </style>
-
|