<template>
|
<view class="">
|
<view class="notice-list" @click="navToDetail(item.id,item.eventType,item.pdId)" v-for="(item,index) in data"
|
:key="index">
|
<view v-if="item.url" class="notice-inner flex j-c-s-b">
|
<view class="notice-list-left flex f-d-c j-c-s-b">
|
<text class="notice-title f-26">{{item.title}}</text>
|
<view class="flex j-c-s-b a-i-c">
|
<view class="flex a-i-c">
|
<tag-cell v-if="item.dictValue" :text="item.dictValue" />
|
<view class="flex a-i-c">
|
<u-icon name="eye-fill" size="14" color="#CECECE"></u-icon>
|
<text class="f-24 c-99 ml-5">{{item.viewNumber}}</text>
|
</view>
|
</view>
|
<text class="f-24 c-99">{{item.createTime}}</text>
|
</view>
|
</view>
|
<u-image :src="setUrl(item.url)" width="200rpx" height="140rpx"></u-image>
|
</view>
|
<view v-else class="notice-inner flex f-d-c j-c-s-b">
|
<text class="notice-title f-26">{{item.title}}</text>
|
<view class="flex j-c-s-b a-i-c">
|
<view class="flex a-i-c">
|
<tag-cell :text="item.dictValue" />
|
<view class="flex a-i-c">
|
<u-icon name="eye-fill" size="14" color="#CECECE"></u-icon>
|
<text class="f-24 c-99 ml-5">{{item.viewNumber}}</text>
|
</view>
|
</view>
|
<text class="f-24 c-99">{{item.createTime}}</text>
|
</view>
|
</view>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import tagCell from './tagCell'
|
import {
|
minioBaseUrl
|
} from '@/common/setting.js'
|
export default {
|
name: "noticeList",
|
props: {
|
data: Array,
|
pageType: String
|
},
|
components: {
|
tagCell
|
},
|
data() {
|
return {
|
|
}
|
},
|
methods: {
|
|
setUrl(url) {
|
return `${minioBaseUrl}${url}`
|
},
|
|
navToDetail(id, type, pdId) {
|
if (this.pageType) {
|
uni.navigateTo({
|
url: `/subPackage/article/detail?id=${id}&type=${this.pageType}`
|
})
|
} else {
|
uni.navigateTo({
|
url: `/subPackage/article/detail?id=${id}`
|
})
|
}
|
|
// if(type == 0 || type == 1){
|
// uni.navigateTo({
|
// url: `/subPackage/article/detail?id=${id}&type=${type}&pdId=${pdId}`
|
// })
|
// }else {
|
// uni.navigateTo({
|
// url: `/subPackage/article/detail?id=${id}`
|
// })
|
// }
|
}
|
}
|
}
|
</script>
|
|
<style scoped lang="scss">
|
.notice-list {
|
padding: 30rpx 0;
|
border-bottom: 1px solid #f5f5f5;
|
|
.notice-inner {
|
width: 100%;
|
height: 140rpx;
|
}
|
}
|
|
.notice-list-left {
|
width: calc(100% - 200rpx - 20rpx);
|
height: 140rpx;
|
}
|
|
.notice-title {
|
width: 100%;
|
display: -webkit-box;
|
-webkit-box-orient: vertical;
|
-webkit-line-clamp: 2;
|
overflow: hidden;
|
}
|
|
.ml-5 {
|
margin-left: 5rpx;
|
}
|
</style>
|