templateC.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. }else if(item.linkType === -1){
  41. uni.navigateTo({
  42. url:`/h5/pages/activity/activity-detail?adsImage=${item.adsImage}&title=${item.name}`
  43. })
  44. }else{
  45. caimeiApi.FlooryNavigateTo(item)
  46. }
  47. }
  48. }
  49. }
  50. </script>
  51. <style lang="scss">
  52. .article-list {
  53. width: 750rpx;
  54. margin-left: -24rpx;
  55. height: auto;
  56. box-sizing: border-box;
  57. white-space: nowrap;
  58. .section {
  59. display: inline-block;
  60. width: 310rpx;
  61. height: 392rpx;
  62. background: #ffffff;
  63. box-sizing: border-box;
  64. border-radius: 16rpx;
  65. margin-right: 24rpx;
  66. vertical-align: middle;
  67. &:first-child{
  68. margin-left: 24rpx;
  69. }
  70. .cover {
  71. width: 310rpx;
  72. height: 220rpx;
  73. border-radius: 16rpx 16rpx 0 0;
  74. overflow: hidden;
  75. .cover-gg{
  76. width: 310rpx;
  77. height: 220rpx;
  78. }
  79. }
  80. .article-text {
  81. width: 310rpx;
  82. box-sizing: border-box;
  83. padding: 24rpx;
  84. .title {
  85. font-size: 26rpx;
  86. height: 37rpx;
  87. color: #3a3a3a;
  88. margin-bottom: 16rpx;
  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. white-space: normal;
  98. font-size: 24rpx;
  99. line-height: 40rpx;
  100. color: #8a8a8a;
  101. word-break: break-all;
  102. overflow: hidden;
  103. text-overflow: ellipsis;
  104. display: -webkit-box;
  105. -webkit-line-clamp: 2;
  106. -webkit-box-orient: vertical;
  107. }
  108. }
  109. }
  110. }
  111. </style>