templateB.vue 2.0 KB

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