gengDuoFC.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. <template>
  2. <view class="box">
  3. <u-navbar :autoBack="true" title="厦门文物" bgColor="rgba(255,255,255,0)" :placeholder="true" titleStyle="font-weight:bold;color:#000000"></u-navbar>
  4. <view class="fiex_top">
  5. <view class="top_box">
  6. <view @click="showqy = true" class="tit_box">
  7. <view class="">{{ qyVal ? qyVal : '区域' }}</view>
  8. <view class="">
  9. <image style="width: 40rpx; height: 40rpx" src="/static/img/map_more.png"></image>
  10. </view>
  11. </view>
  12. <view class="tit_box" @click="showlx = true">
  13. <view class="">{{ lxVal ? lxVal : '类型' }}</view>
  14. <view class="">
  15. <image style="width: 40rpx; height: 40rpx" src="/static/img/map_more.png"></image>
  16. </view>
  17. </view>
  18. <view class="tit_box" @click="showjb = true">
  19. <view class="">{{ jbVal ? jbVal : '级别' }}</view>
  20. <view class="">
  21. <image style="width: 40rpx; height: 40rpx" src="/static/img/map_more.png"></image>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="" style="border: 1px solid #eba869; width: 670rpx; margin: auto; margin-top: 32rpx">
  26. <u-search
  27. bgColor="transparent"
  28. v-model="val"
  29. shape="square"
  30. :showAction="true"
  31. actionText="搜索"
  32. @custom="searchBtn"
  33. :actionStyle="{ color: '#985741', fontSize: '28rpx', fontWeight: 'bold', backgroundColor: '#fff9e9' }"
  34. ></u-search>
  35. </view>
  36. </view>
  37. <scroll-view v-if="list.length" style="height: 1200rpx; margin-left: 6rpx" scroll-y="true" @scrolltolower="LoadMore">
  38. <view class="wenwu_box">
  39. <view @click="detailsBtn(item.id)" class="" v-for="(item, index) in list" :key="item.id">
  40. <view class="gc_item">
  41. <view class="gc_box" style="">
  42. <image style="width: 100%; height: 100%; border-radius: 15rpx" :src="item.thumbnail"></image>
  43. </view>
  44. <view class="tit">{{ item.title }}</view>
  45. <!-- <view class="bg_box">湖里区</view> -->
  46. <u-badge type="primary" max="99" :value="item.district" :absolute="true" :offset="[10, 5]"></u-badge>
  47. </view>
  48. </view>
  49. </view>
  50. </scroll-view>
  51. <view v-else><u-empty mode="data" text="暂无数据"></u-empty></view>
  52. <!-- 选择 -->
  53. <u-picker keyName="title" :show="showqy" @cancel="showqy = false" :columns="columnsQy" @close="close" :closeOnClickOverlay="true" @confirm="qyBtn"></u-picker>
  54. <u-picker keyName="title" :show="showlx" @cancel="showlx = false" :columns="columnsLx" @close="close" :closeOnClickOverlay="true" @confirm="lxBtn"></u-picker>
  55. <u-picker keyName="title" :show="showjb" @cancel="showjb = false" :columns="columnsJb" @close="close" :closeOnClickOverlay="true" @confirm="jbBtn"></u-picker>
  56. </view>
  57. </template>
  58. <script>
  59. let that;
  60. export default {
  61. data() {
  62. return {
  63. val: '',
  64. page: 1,
  65. list: [],
  66. isLoading: false,
  67. showqy: false,
  68. showlx: false,
  69. showjb: false,
  70. levelId: '',
  71. cr_typeId: '',
  72. regionId: '',
  73. qyVal: '',
  74. lxVal: '',
  75. jbVal: '',
  76. columnsQy: [],
  77. columnsLx: [],
  78. columnsJb: []
  79. };
  80. },
  81. onLoad() {
  82. that = this;
  83. this.getContentList();
  84. this.getCulturalRelicCategory();
  85. },
  86. methods: {
  87. // 文物分类列表
  88. getCulturalRelicCategory() {
  89. this.$api.getCulturalRelicCategory({ main_body_id: 1 }, function (res) {
  90. console.log(res, 565656);
  91. that.columnsQy = [res.data.region_list];
  92. that.columnsLx = [res.data.cr_type_list];
  93. that.columnsJb = [res.data.level_list];
  94. });
  95. },
  96. lxBtn(e) {
  97. console.log(e, 'eeeeeee');
  98. this.lxVal = e.value[0].title;
  99. this.showlx = false;
  100. this.list = [];
  101. this.page = 1;
  102. this.cr_typeId = e.value[0].id;
  103. this.getContentList();
  104. },
  105. qyBtn(e) {
  106. this.qyVal = e.value[0].title;
  107. this.showqy = false;
  108. this.list = [];
  109. this.page = 1;
  110. this.regionId = e.value[0].id;
  111. this.getContentList();
  112. },
  113. jbBtn(e) {
  114. this.jbVal = e.value[0].title;
  115. this.showjb = false;
  116. this.list = [];
  117. this.page = 1;
  118. this.levelId = e.value[0].id;
  119. this.getContentList();
  120. },
  121. detailsBtn(id) {
  122. uni.navigateTo({
  123. url: '/index_fenbao/GuanLi/XiangQing?id=' + id
  124. });
  125. },
  126. getContentList(id) {
  127. this.isLoading = true;
  128. this.$api.getContentList(
  129. {
  130. main_body_id: 1,
  131. model_id: 1,
  132. keywords: this.val,
  133. page: this.page,
  134. pageSize: '10',
  135. level: this.levelId,
  136. cr_type: this.cr_typeId,
  137. region: this.regionId
  138. },
  139. function (res) {
  140. that.isLoading = false;
  141. that.list = [...that.list, ...res.data];
  142. }
  143. );
  144. },
  145. searchBtn() {
  146. this.qyVal = '';
  147. this.lxVal = '';
  148. this.jbVal = '';
  149. this.levelId = '';
  150. this.cr_typeId = '';
  151. this.regionId = '';
  152. this.page = 1;
  153. this.list = [];
  154. this.getContentList();
  155. },
  156. LoadMore() {
  157. if (this.isLoading) {
  158. return;
  159. } else {
  160. // this.qyVal = '';
  161. // this.lxVal = '';
  162. // this.jbVal = '';
  163. this.page++;
  164. this.getContentList();
  165. }
  166. },
  167. close() {
  168. this.showqy = false;
  169. this.showlx = false;
  170. this.showjb = false;
  171. },
  172. clear() {
  173. this.val = '';
  174. }
  175. }
  176. };
  177. </script>
  178. <style>
  179. .box {
  180. width: 100%;
  181. padding-bottom: 50rpx;
  182. background-image: url('https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/xbg_2.png');
  183. background-size: 100% 100%;
  184. background-attachment: fixed;
  185. background-repeat: repeat-y;
  186. height: auto;
  187. }
  188. .fiex_top {
  189. /* margin-bottom: 20rpx; */
  190. }
  191. .top_box {
  192. display: flex;
  193. width: 90%;
  194. margin: auto;
  195. justify-content: space-between;
  196. }
  197. .tit_box {
  198. display: flex;
  199. align-items: center;
  200. text-align: center;
  201. width: 215rpx;
  202. height: 56rpx;
  203. justify-content: space-around;
  204. border: 2rpx solid #eba869;
  205. }
  206. .tit {
  207. overflow: hidden;
  208. text-overflow: ellipsis;
  209. white-space: nowrap;
  210. }
  211. .wenwu_box {
  212. width: 92%;
  213. margin: auto;
  214. margin-top: 20rpx;
  215. display: flex;
  216. flex-flow: wrap;
  217. justify-content: space-between;
  218. }
  219. .gc_item {
  220. position: relative;
  221. width: 324rpx;
  222. color: #444444;
  223. /* font-weight: 900; */
  224. font-size: 32rpx;
  225. margin-top: 20rpx;
  226. font-family: 'MyGlobalFont';
  227. }
  228. .gc_box {
  229. width: 333rpx;
  230. height: 280rpx;
  231. }
  232. .bg_box {
  233. width: 184rpx;
  234. height: 62rpx;
  235. margin: auto;
  236. margin-top: 20rpx;
  237. line-height: 62rpx;
  238. color: #fef3e1;
  239. font-size: 28rpx;
  240. font-weight: 500;
  241. background-image: url('/static/img/tab.png');
  242. background-size: 100% 100%;
  243. }
  244. .u-search__action--active.data-v-0a306a29 {
  245. height: 60rpx !important;
  246. line-height: 60rpx !important;
  247. }
  248. .u-search__action--active.data-v-2d141374 {
  249. height: 60rpx !important;
  250. line-height: 60rpx !important;
  251. }
  252. </style>