123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- <template>
- <scroll-view scroll-x="true" class="container article-list">
- <view class="section" v-for="(item,index) in productList" :key="index" @click="navigaitionTo(item)">
- <view class="cover">
- <image :src="item.appletsImage" class="cover-gg"></image>
- </view>
- <view class="article-text">
- <view class="title">{{item.name}}</view>
- <view class="content" v-text="item.content"></view>
- </view>
- </view>
- </scroll-view>
- </template>
- <script>
- import caimeiApi from '@/common/config/caimeiApi.js'
- export default {
- data(){
- return{
- productList:[]
- }
- },
- props:{
- pageData: {
- type: Object
- },
- userIdentity: {
- type: Number
- }
- },
- created() {
- this.initData(this.pageData)
- },
- methods:{
- initData(data){
- this.productList = data.floorImageList
- },
- navigaitionTo(item){
- if(item.link){
- uni.navigateTo({
- url: `/pages/h5/article/path?link=${item.link}`
- })
- }
- }
- }
- }
- </script>
- <style lang="scss">
- .article-list {
- width: 750rpx;
- margin-left: -24rpx;
- height: auto;
- box-sizing: border-box;
- white-space: nowrap;
- .section {
- display: inline-block;
- width: 310rpx;
- height: 392rpx;
- background: #ffffff;
- box-sizing: border-box;
- border-radius: 16rpx;
- margin-right: 24rpx;
- vertical-align: middle;
- &:first-child{
- margin-left: 24rpx;
- }
- .cover {
- width: 310rpx;
- height: 220rpx;
- border-radius: 16rpx 16rpx 0 0;
- overflow: hidden;
- .cover-gg{
- width: 310rpx;
- height: 220rpx;
- }
- }
- .article-text {
- width: 310rpx;
- box-sizing: border-box;
- padding: 24rpx;
- .title {
- font-size: 26rpx;
- height: 37rpx;
- color: #3a3a3a;
- margin-bottom: 16rpx;
- word-break: break-all;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 1;
- -webkit-box-orient: vertical;
- }
- .content {
- white-space: normal;
- font-size: 24rpx;
- line-height: 40rpx;
- color: #8a8a8a;
- word-break: break-all;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- -webkit-box-orient: vertical;
- }
- }
- }
- }
- </style>
|