templateC.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <scroll-view scroll-x="true" class="container article-list">
  3. <view class="section" v-for="(item,index) in productList" :key="index" @click="navigaitionTo(item)">
  4. <view class="cover">
  5. <image :src="item.appletsImage" mode="widthFix" class="cover-gg"></image>
  6. </view>
  7. <view class="article-text">
  8. <view class="title">{{item.name}}</view>
  9. <view class="content" v-text="item.content"></view>
  10. </view>
  11. </view>
  12. </scroll-view>
  13. </template>
  14. <script>
  15. import caimeiApi from '@/common/config/caimeiApi.js'
  16. export default {
  17. data(){
  18. return{
  19. productList:[]
  20. }
  21. },
  22. props:{
  23. pageData: {
  24. type: Object
  25. },
  26. userIdentity: {
  27. type: Number
  28. }
  29. },
  30. created() {
  31. this.initData(this.pageData);
  32. },
  33. methods:{
  34. initData(data){
  35. this.productList = data.floorImageList;
  36. },
  37. navigaitionTo(item){
  38. if (item.adsImage === '' && item.linkType === -1) {
  39. return
  40. }
  41. caimeiApi.FlooryNavigateTo(item)
  42. }
  43. }
  44. }
  45. </script>
  46. <style lang="scss">
  47. .article-list {
  48. width: 750rpx;
  49. margin-left: -24rpx;
  50. height: auto;
  51. box-sizing: border-box;
  52. white-space: nowrap;
  53. .section {
  54. display: inline-block;
  55. width: 310rpx;
  56. height: 392rpx;
  57. background: #ffffff;
  58. box-sizing: border-box;
  59. border-radius: 16rpx;
  60. margin-right: 24rpx;
  61. vertical-align: middle;
  62. &:first-child{
  63. margin-left: 24rpx;
  64. }
  65. .cover {
  66. width: 310rpx;
  67. height: 220rpx;
  68. border-radius: 16rpx 16rpx 0 0;
  69. overflow: hidden;
  70. .cover-gg{
  71. width: 310rpx;
  72. height: 220rpx;
  73. }
  74. }
  75. .article-text {
  76. width: 310rpx;
  77. box-sizing: border-box;
  78. padding: 24rpx;
  79. .title {
  80. font-size: 26rpx;
  81. height: 37rpx;
  82. color: #3a3a3a;
  83. margin-bottom: 16rpx;
  84. word-break: break-all;
  85. overflow: hidden;
  86. text-overflow: ellipsis;
  87. display: -webkit-box;
  88. -webkit-line-clamp: 1;
  89. -webkit-box-orient: vertical;
  90. }
  91. .content {
  92. white-space: normal;
  93. font-size: 24rpx;
  94. line-height: 40rpx;
  95. color: #8a8a8a;
  96. word-break: break-all;
  97. overflow: hidden;
  98. text-overflow: ellipsis;
  99. display: -webkit-box;
  100. -webkit-line-clamp: 2;
  101. -webkit-box-orient: vertical;
  102. }
  103. }
  104. }
  105. }
  106. </style>