xiang_qing.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <view>
  3. <u-navbar :autoBack="true" :title="title" bgColor="rgba(255,255,255,255)" :placeholder="true" titleStyle="font-weight:bold;color:#121212"></u-navbar>
  4. <view class="ad">
  5. <view @click="projectListBtn(index)" class="box_22" v-for="(item, index) in projectList" :key="item.id">
  6. <view class="block_5">
  7. <image style="width: 100%; height: 100%; border-radius: 0 50rpx 0 20rpx" :src="item.thumbnail"></image>
  8. <view class="tag_1">
  9. <text lines="1" class="text_9">{{ item.type_text }}</text>
  10. </view>
  11. <view class="tag_2">
  12. <text lines="1" class="text_10">{{ item.title }}</text>
  13. </view>
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. let that;
  21. export default {
  22. data() {
  23. return { main_body_id: '', title: '', projectList: [] };
  24. },
  25. onLoad(o) {
  26. that = this;
  27. this.title = o.title;
  28. this.main_body_id = this.$db.get('main_body_id');
  29. console.log(o);
  30. this.getContentList(o);
  31. },
  32. methods: {
  33. // 主体栏目内容列表查看更多
  34. getContentList(o) {
  35. this.$api.getContentList(
  36. {
  37. model_id: o.id /* 模型id */,
  38. main_body_id: this.main_body_id,
  39. main_body_column_id: o.main_body_column_id /* 栏目id */,
  40. page: '1',
  41. pageSize: '10'
  42. },
  43. function (res) {
  44. console.log(res, '内容列表更多');
  45. that.projectList = res.data;
  46. }
  47. );
  48. },
  49. // 详情
  50. projectListBtn(i) {
  51. uni.navigateTo({
  52. url: '/index_fenbao/mn_jingshen/PageSpirit?id=' + this.projectList[i].id
  53. });
  54. }
  55. }
  56. };
  57. </script>
  58. <style>
  59. .ad {
  60. margin: 20rpx 32rpx 0 32rpx;
  61. }
  62. .box_22 {
  63. height: 345rpx;
  64. display: flex;
  65. flex-direction: column;
  66. width: 686rpx;
  67. margin-bottom: 50rpx;
  68. }
  69. .block_5 {
  70. position: relative;
  71. height: 345rpx;
  72. width: 686rpx;
  73. display: flex;
  74. flex-direction: column;
  75. }
  76. .tag_1 {
  77. position: absolute;
  78. background-color: rgba(77, 113, 153, 1);
  79. border-radius: 9rpx 9rpx 32rpx 0rpx;
  80. height: 48rpx;
  81. display: flex;
  82. flex-direction: column;
  83. width: 86rpx;
  84. }
  85. .tag_2 {
  86. position: absolute;
  87. bottom: 36rpx;
  88. right: 20rpx;
  89. }
  90. .text_10 {
  91. width: 147rpx;
  92. height: 29rpx;
  93. overflow-wrap: break-word;
  94. color: #ffffff;
  95. font-size: 34rpx;
  96. font-family: Adobe Heiti Std R;
  97. font-weight: normal;
  98. text-align: left;
  99. white-space: nowrap;
  100. line-height: 30rpx;
  101. }
  102. .text_9 {
  103. width: 47rpx;
  104. height: 23rpx;
  105. overflow-wrap: break-word;
  106. color: rgba(255, 255, 255, 1);
  107. font-size: 24rpx;
  108. font-family: SourceHanSansCN-Bold;
  109. font-weight: 700;
  110. text-align: left;
  111. white-space: nowrap;
  112. line-height: 24rpx;
  113. margin: 12rpx 0 0 19rpx;
  114. }
  115. </style>