12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <template>
- <view class="container article-list">
- <view class="section clearfix" v-for="(item,index) in productList" :key="index" @click="navigaitionTo(item)">
- <image :src="item.adsImage" mode="aspectFit" class="cover"></image>
- <view class="article-text">
- <view class="title">{{item.name}}</view>
- <view class="content" v-text="item.content"></view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data(){
- return{
- productList:[]
- }
- },
- props:{
- pageData: {
- type: Object
- },
- userIdentity: {
- type: Number
- },
- flag:{
- type:Boolean,
- default:false
- }
- },
- created() {
- this.initData(this.pageData);
- },
- methods:{
- initData(data){
- if(this.flag){
- this.productList = data.floorImageList
- }else{
- this.productList = data.floorImageList.slice(0,4);
- }
- },
- navigaitionTo(item){
- console.log(item);
- if(item.link){
- uni.navigateTo({
- url:`/h5/pages/article/path?link=${item.link}`
- })
- }
- }
- }
- }
- </script>
- <style lang="scss">
- .article-list {
- width: 100%;
- height: auto;
- box-sizing: border-box;
- .section {
- width: 702rpx;
- height: 250rpx;
- background: #ffffff;
- margin-bottom: 24rpx;
- box-sizing: border-box;
- padding: 24rpx;
- border-radius: 16rpx;
- .cover {
- float: left;
- width: 202rpx;
- height: 202rpx;
- margin-right: 20rpx;
- }
- .article-text {
- width: 432rpx;
- float: left;
- .title {
- font-size: 26rpx;
- height: 37rpx;
- color: #3a3a3a;
- margin-bottom: 18rpx;
- }
- .content {
- font-size: 24rpx;
- line-height: 38rpx;
- color: #8a8a8a;
- word-break: break-all;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-inline-box;
- -webkit-line-clamp: 4;
- -webkit-box-orient: vertical;
- }
- }
- }
- }
- </style>
|