minsu.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <template>
  2. <view class="body" style="background-color: #efefef">
  3. <u-navbar :autoBack="true" title="民俗宗教" bgColor="rgba(255,255,255,0)" :placeholder="true" titleStyle="font-weight:bold;color:#121212"></u-navbar>
  4. <view>
  5. <u-swiper :list="list1" height="335rpx" :indicator="true" :autoplay="true" :circular="true" keyName="image" showTitle></u-swiper>
  6. </view>
  7. <!-- 生活习俗 -->
  8. <view class="sh_xs banxin">
  9. <view class="text-wrapper_7" v-for="(item, index) in customList" :key="item.id">
  10. <view @click="getContentList(index)" class="gebg_Duo" style="">
  11. <text lines="1" class="text_4">{{ item.name }}</text>
  12. <text lines="1" class="text_5">查看更多》</text>
  13. </view>
  14. <view class="sh_xs_box">
  15. <view class="sh_xs_item" v-for="(item2, index1) in customList[index].content_list" :key="item.id">
  16. <view @click="detailsBtn(index, index1)" class="img_box">
  17. <image class="img" :src="item2.thumbnail"></image>
  18. </view>
  19. <view class="">{{ item2.title }}</view>
  20. <view class="ms_dianzan">
  21. <view class="">
  22. <uni-icons type="star-filled" color="#4e7198" size="20"></uni-icons>
  23. <text>{{ item2.collects }}</text>
  24. </view>
  25. <view class="" style="display: flex; align-items: center; justify-content: space-evenly">
  26. <uni-icons type="heart-filled" color="#ca5642" size="20"></uni-icons>
  27. <text>{{ item2.likes }}</text>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. let that;
  38. export default {
  39. data() {
  40. return {
  41. id: '',
  42. main_body_id: '',
  43. list1: [
  44. {
  45. image: 'https://img0.baidu.com/it/u=1541281845,960690765&fm=253&fmt=auto&app=138&f=JPEG?w=758&h=500',
  46. title: '山里乡民祭妈祖'
  47. },
  48. {
  49. image: 'https://img1.baidu.com/it/u=4153166350,2319982730&fm=253&fmt=auto&app=138&f=JPEG?w=640&h=424',
  50. title: '初九拜天公'
  51. },
  52. {
  53. image: 'https://img1.baidu.com/it/u=3003350307,572069045&fm=253&fmt=auto&app=138&f=JPEG?w=751&h=500',
  54. title: '福建茶乡古礼祭茶神'
  55. }
  56. ],
  57. // 生活习俗
  58. customList: []
  59. };
  60. },
  61. onShow() {
  62. this.getMainBodyColumnContentList(this.id);
  63. },
  64. onLoad(o) {
  65. that = this;
  66. this.id = o.id;
  67. this.main_body_id = this.$db.get('main_body_id');
  68. this.getColumnList(o.id);
  69. this.getMainBodyColumnContentList(o.id);
  70. },
  71. methods: {
  72. detailsBtn(i, is) {
  73. // console.log(i, '55555555555');
  74. // console.log(is, '6666666666');
  75. // console.log(this.customList[i].content_list[is].id, '75555558');
  76. uni.navigateTo({
  77. url: '/index_fenbao/minsu/ms_wenZhang?id=' + this.customList[i].content_list[is].id
  78. });
  79. },
  80. // 模型的主体栏目列表
  81. getColumnList(id) {
  82. this.$api.getColumnList(
  83. {
  84. model_id: id,
  85. main_body_id: this.main_body_id
  86. },
  87. function (res) {
  88. // console.log(res, 'res');
  89. }
  90. );
  91. },
  92. // 查看更多
  93. getContentList(i) {
  94. uni.navigateTo({
  95. url: `/index_fenbao/minsu/geng_duo?id=${this.id}&main_body_id=${this.main_body_id}&main_body_column_id=${this.customList[i].id}`
  96. });
  97. },
  98. // 主体栏目默认内容列表
  99. getMainBodyColumnContentList(id) {
  100. this.$api.getMainBodyColumnContentList(
  101. {
  102. model_id: id,
  103. main_body_id: this.main_body_id
  104. },
  105. function (res) {
  106. // console.log(res, '内容列表默认');
  107. that.customList = res.data;
  108. }
  109. );
  110. }
  111. }
  112. };
  113. </script>
  114. <style>
  115. .banxin {
  116. margin: 0 32rpx 0 32rpx;
  117. }
  118. /deep/.u-swiper-indicator__wrapper__dot--active {
  119. width: 5px !important;
  120. }
  121. /* 去除轮播图标题遮罩背景色 */
  122. /* .u-swiper__wrapper__item__wrapper__title {
  123. background-color: transparent !important;
  124. } */
  125. .sh_xs {
  126. display: flex;
  127. flex-flow: wrap;
  128. justify-content: space-between;
  129. }
  130. .ms_dianzan {
  131. width: 245rpx;
  132. display: flex;
  133. justify-content: space-between;
  134. margin-top: 10rpx;
  135. margin-bottom: 10rpx;
  136. }
  137. .sh_xs_item {
  138. border-radius: 10rpx;
  139. background: #ffffff;
  140. margin-left: 30rpx;
  141. }
  142. .text-wrapper_7 {
  143. width: 651rpx;
  144. margin: 33rpx 15rpx 25rpx 5rpx;
  145. }
  146. .text_4 {
  147. width: 112rpx;
  148. height: 27rpx;
  149. color: rgba(49, 37, 32, 1);
  150. font-size: 28rpx;
  151. font-weight: 700;
  152. white-space: nowrap;
  153. line-height: 28rpx;
  154. }
  155. .text_5 {
  156. width: 89rpx;
  157. height: 20rpx;
  158. color: rgba(18, 18, 18, 1);
  159. font-size: 22rpx;
  160. white-space: nowrap;
  161. line-height: 20rpx;
  162. margin-top: 3rpx;
  163. }
  164. .sh_xs_box {
  165. display: flex;
  166. justify-content: space-around;
  167. }
  168. .img {
  169. width: 100%;
  170. height: 100%;
  171. border-radius: 10rpx;
  172. }
  173. .img_box {
  174. width: 330rpx;
  175. height: 185rpx;
  176. margin-bottom: 10rpx;
  177. }
  178. .gebg_Duo {
  179. height: 60rpx;
  180. display: flex;
  181. justify-content: space-between;
  182. }
  183. </style>