feiyi.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. <template>
  2. <view class="body2">
  3. <u-navbar :autoBack="true" title="闽南非遗" bgColor="rgba(255,255,255,0)" :placeholder="true" titleStyle="font-weight:bold;color:#121212"></u-navbar>
  4. <view class="fy_nav_bj">
  5. <view class="" style="padding: 80rpx 0rpx 0 50rpx">
  6. <view style="font-size: 36rpx; margin-bottom: 20rpx">闽南非遗</view>
  7. <view style="font-size: 24rpx">推进制度化建设,打造非遗活态传承新机制</view>
  8. </view>
  9. </view>
  10. <!-- 轮播图 -->
  11. <view class="banxin">
  12. <u-swiper
  13. indicatorMode="dot"
  14. indicatorStyle="bottom: 10rpx"
  15. :list="list1"
  16. height="180rpx"
  17. :indicator="true"
  18. :autoplay="true"
  19. :circular="true"
  20. keyName="image"
  21. ></u-swiper>
  22. </view>
  23. <u-picker :show="show" @close="show = false" :closeOnClickOverlay="true" :columns="columns" @cancel="show = false" @confirm="yf_isok"></u-picker>
  24. <view class="banxin" style="margin-top: 40rpx">
  25. <!-- 选择城市 -->
  26. <view class="" style="display: flex">
  27. <view @click="show = true" class="fy_cs">
  28. <uni-icons type="location" size="20"></uni-icons>
  29. <text style="margin: 0 10rpx 0 10rpx">{{ columnsItem }}</text>
  30. <uni-icons type="bottom" size="20"></uni-icons>
  31. </view>
  32. <!-- 选择城市end -->
  33. <view class="">
  34. <u-tabs
  35. :list="tabList"
  36. :lineWidth="0"
  37. :activeStyle="{
  38. border: '1px solid #dac1a1',
  39. color: '#dac1a1'
  40. }"
  41. ></u-tabs>
  42. </view>
  43. </view>
  44. <!-- 滑动模式 -->
  45. <!-- <view class="" style="margin-left: 200rpx">
  46. <scroll-view scroll-x style="display: flex; white-space: nowrap" class="">
  47. <view @click="fyTab(item)" v-for="item in tabList" :key="item.id" class="fy_tab_item" :class="{ active: tabactive == item.id }">
  48. {{ item.name }}
  49. </view>
  50. </scroll-view>
  51. </view> -->
  52. </view>
  53. <!-- 内容 -->
  54. <view class="sh_xs banxin">
  55. <view @click="detailsBtn(index)" class="sh_xs_item" v-for="(item, index) in projectList" :key="item">
  56. <view class="" style="width: 325rpx; height: 180rpx; border-radius: 10rpx">
  57. <image style="width: 100%; height: 100%" :src="item.thumbnail"></image>
  58. </view>
  59. <view class="">{{ item.title }}</view>
  60. <view class="ms_dianzan">
  61. <view class="">
  62. <uni-icons type="star-filled" color="#4e7198" size="20"></uni-icons>
  63. <text>{{ item.collects }}</text>
  64. </view>
  65. <view class="" style="display: flex; align-items: center; justify-content: space-evenly">
  66. <uni-icons type="heart-filled" color="#ca5642" size="20"></uni-icons>
  67. <text>{{ item.likes }}</text>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. </template>
  74. <script>
  75. let that;
  76. export default {
  77. data() {
  78. return {
  79. isLoading: false, // 节流阀 默认为关闭状态
  80. main_body_id: '',
  81. page: '1',
  82. main_body_id: '',
  83. show: false,
  84. columns: [['厦门', '泉州', '福州']],
  85. columnsItem: '厦门' /* 选中的城市 */,
  86. tabactive: 0,
  87. list1: [
  88. {
  89. image: 'https://feicheng.16fw.cn:1443/uploads/20230403/f394190a0e3fc5873644beadead1cc3f.jpg'
  90. },
  91. {
  92. image: 'https://feicheng.16fw.cn:1443/uploads/20230403/00885f0245196beebe66ca79aebe5656.jpg'
  93. },
  94. {
  95. image: 'https://feicheng.16fw.cn:1443/uploads/20230403/1cf5f3c9c6b28fcbd3a983068f06d257.jpg'
  96. }
  97. ],
  98. tabList: [],
  99. projectList: []
  100. };
  101. },
  102. onLoad(o) {
  103. that = this;
  104. this.model_id = o.id;
  105. this.main_body_id = this.$db.get('main_body_id');
  106. this.getColumnList(o.id);
  107. this.getContentList(o.id);
  108. },
  109. onReachBottom() {
  110. if (this.isLoading) {
  111. return;
  112. } else {
  113. // 每次触发上拉触底 请求的页码 自加一
  114. this.page++;
  115. // 重新请求数据
  116. this.getContentList();
  117. }
  118. },
  119. methods: {
  120. fyTab(item) {
  121. this.tabactive = item.id;
  122. console.log(item);
  123. },
  124. // 选择城市
  125. yf_isok(e) {
  126. console.log(e);
  127. this.columnsItem = e.value;
  128. this.show = false;
  129. },
  130. detailsBtn(i) {
  131. uni.navigateTo({
  132. url: this.projectList[i].page
  133. });
  134. },
  135. getColumnList(id) {
  136. this.$api.getColumnList(
  137. {
  138. model_id: id,
  139. main_body_id: this.main_body_id
  140. },
  141. function (res) {
  142. let a = {
  143. diyname: 'crzx',
  144. id: '',
  145. image: '',
  146. name: '全部'
  147. };
  148. that.tabList = res.data;
  149. that.tabList.unshift(a);
  150. }
  151. );
  152. },
  153. // 栏目内容列表
  154. getContentList(id) {
  155. // 打开节流阀
  156. this.isLoading = true;
  157. this.$api.getContentList(
  158. {
  159. model_id: this.model_id,
  160. main_body_id: this.main_body_id,
  161. page: this.page,
  162. pageSize: '10'
  163. },
  164. function (res) {
  165. console.log(res, '内容列表');
  166. // 关闭节流阀
  167. that.isLoading = false;
  168. that.projectList = [...that.projectList, ...res.data];
  169. }
  170. );
  171. }
  172. }
  173. };
  174. </script>
  175. <style>
  176. .body2 {
  177. background-size: 100% 100%;
  178. background-attachment: fixed;
  179. background-repeat: repeat-y;
  180. background-color: #efefef;
  181. padding-bottom: 50rpx;
  182. background-color: #efefef;
  183. }
  184. .banxin {
  185. margin: 0 32rpx 0 32rpx;
  186. }
  187. /deep/.u-swiper-indicator__wrapper__dot--active {
  188. width: 5px !important;
  189. }
  190. .fy_nav_bj {
  191. width: 100%;
  192. height: 220rpx;
  193. color: #ffffff;
  194. margin-bottom: 25rpx;
  195. background-image: url('https://huli-app.wenlvti.net/app_static/minnanhun/image/fy_navbj.png');
  196. background-size: 100% 100%;
  197. }
  198. .active {
  199. border: 1px solid #dac1a1;
  200. }
  201. .fy_tab_item {
  202. line-height: 45rpx;
  203. text-align: center;
  204. margin-right: 30rpx;
  205. width: 170rpx;
  206. height: 50rpx;
  207. display: inline-block;
  208. background-color: #fffcf3;
  209. }
  210. .sh_xs {
  211. margin-top: 50rpx;
  212. display: flex;
  213. flex-flow: wrap;
  214. justify-content: space-between;
  215. }
  216. .ms_dianzan {
  217. width: 245rpx;
  218. display: flex;
  219. justify-content: space-between;
  220. margin-top: 10rpx;
  221. }
  222. .sh_xs_item {
  223. border-radius: 10rpx;
  224. background: #ffffff;
  225. margin-bottom: 35rpx;
  226. }
  227. .fy_cs {
  228. display: flex;
  229. align-items: center;
  230. height: 50rpx;
  231. margin-top: 20rpx;
  232. /* background-color: antiquewhite; */
  233. }
  234. </style>