templateA.vue 2.1 KB

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