吉光研途前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

218 lines
5.3 KiB

3 days ago
3 days ago
3 days ago
3 days ago
3 days ago
3 days ago
3 days ago
3 days ago
  1. <template>
  2. <view class="page__view">
  3. <view class="bg"></view>
  4. <view class="main">
  5. <!-- 搜索栏 -->
  6. <view class="search">
  7. <uv-search v-model="keyword" placeholder="输入关键词搜索" bgColor="#FBFBFB" @custom="search" @search="search">
  8. <template #prefix>
  9. <image class="search-icon" src="@/static/image/icon-search.png" mode="widthFix"></image>
  10. </template>
  11. </uv-search>
  12. </view>
  13. <!-- 轮播图 -->
  14. <view class="swiper">
  15. <uv-swiper :list="bannerList" keyName="image" indicator indicatorMode="dot" indicatorActiveColor="#4883F9" indicatorInactiveColor="#FFFFFF" height="239rpx"></uv-swiper>
  16. </view>
  17. <view class="flex filter">
  18. <view class="filter-item">
  19. <suspendDropdown v-model="queryParams.categoryServiceId" label="服务分类筛选" :options="serviceOptions" @change="onFilterChange"></suspendDropdown>
  20. </view>
  21. <view class="filter-item">
  22. <suspendDropdown v-model="queryParams.categoryMajorId" label="专业筛选" :options="majorOptions" @change="onFilterChange"></suspendDropdown>
  23. </view>
  24. <view class="filter-item">
  25. <suspendDropdown v-model="queryParams.categoryPeriodId" label="阶段筛选" :options="periodOptions" @change="onFilterChange"></suspendDropdown>
  26. </view>
  27. </view>
  28. <view class="list">
  29. <template v-if="total">
  30. <view class="list-item" v-for="item in list" :key="item.id" @click="jumpToDetail(item.thesisId)">
  31. <image class="img" :src="item.image" mode="aspectFill"></image>
  32. </view>
  33. </template>
  34. <template v-else>
  35. <view class="flex empty">
  36. <image class="empty-icon" src="@/static/image/icon-empty.png" mode="widthFix"></image>
  37. </view>
  38. </template>
  39. </view>
  40. </view>
  41. <tabber select="case" />
  42. </view>
  43. </template>
  44. <script>
  45. import mixinsList from '@/mixins/list.js'
  46. import tabber from '@/components/base/tabbar.vue'
  47. import suspendDropdown from '@/components/base/suspendDropdown.vue'
  48. export default {
  49. mixins: [mixinsList],
  50. components: {
  51. tabber,
  52. suspendDropdown,
  53. },
  54. data() {
  55. return {
  56. keyword: '',
  57. bannerList: [],
  58. serviceOptions: [],
  59. majorOptions: [],
  60. periodOptions: [],
  61. list: [],
  62. queryParams: {
  63. pageNo: 1,
  64. pageSize: 10,
  65. title: null,
  66. categoryServiceId: null,
  67. categoryMajorId: null,
  68. categoryPeriodId: null,
  69. },
  70. mixinsListApi: 'queryAriticleList',
  71. }
  72. },
  73. onLoad() {
  74. this.fetchBanner()
  75. this.fetchOptions()
  76. this.getData()
  77. },
  78. methods: {
  79. search() {
  80. this.queryParams.pageNo = 1
  81. this.queryParams.pageSize = 10
  82. this.queryParams.title = this.keyword
  83. this.getData()
  84. },
  85. onFilterChange() {
  86. this.queryParams.pageNo = 1
  87. this.queryParams.pageSize = 10
  88. this.getData()
  89. },
  90. // 获取轮播图
  91. async fetchBanner() {
  92. try {
  93. this.bannerList = (await this.$fetch('queryBannerList', { type: '1' }))?.records // type:0-首页 1-案例 2-服务 3-其他
  94. } catch (err) {
  95. }
  96. },
  97. async fetchOptions() {
  98. this.$fetch('queryCategoryServiceList').then(res => {
  99. this.serviceOptions = res?.records?.map(item => ({ label: item.title, value: item.id })) || []
  100. }).catch(err => {
  101. })
  102. this.$fetch('queryCategoryMajorList').then(res => {
  103. this.majorOptions = res?.records?.map(item => ({ label: item.title, value: item.id })) || []
  104. }).catch(err => {
  105. })
  106. this.$fetch('queryCategoryPeriodList').then(res => {
  107. this.periodOptions = res?.records?.map(item => ({ label: item.title, value: item.id })) || []
  108. }).catch(err => {
  109. })
  110. },
  111. jumpToDetail(articleId) {
  112. uni.navigateTo({
  113. url: `/pages_order/case/index?articleId=${articleId}`
  114. })
  115. },
  116. }
  117. }
  118. </script>
  119. <style scoped lang="scss">
  120. .bg {
  121. width: 100%;
  122. height: 438rpx;
  123. background-image: linear-gradient(#4883F9, #4883F9, #4883F9, #FCFDFF);
  124. }
  125. .main {
  126. position: absolute;
  127. top: 0;
  128. left: 0;
  129. width: 100%;
  130. padding: 192rpx 0 182rpx 0;
  131. }
  132. .search {
  133. margin: 0 18rpx;
  134. width: calc(100% - 20rpx * 2);
  135. background-color: #FFFFFF;
  136. border-radius: 37rpx;
  137. padding: 13rpx 0 13rpx 18rpx;
  138. box-sizing: border-box;
  139. display: flex;
  140. align-items: center;
  141. /deep/ .uv-search__action {
  142. color: $uni-color;
  143. padding: 10rpx 18rpx;
  144. }
  145. &-icon {
  146. width: 26rpx;
  147. height: auto;
  148. }
  149. }
  150. .swiper {
  151. margin: 29rpx 18rpx 0 18rpx;
  152. border-radius: 25rpx 25rpx 0 0;
  153. overflow: hidden;
  154. /deep/ .uv-swiper-indicator__wrapper__dot {
  155. width: 15rpx;
  156. height: 15rpx;
  157. }
  158. /deep/ .uv-swiper-indicator__wrapper__dot--active {
  159. width: 15rpx;
  160. }
  161. }
  162. .filter {
  163. column-gap: 33rpx;
  164. padding: 0 23rpx;
  165. background: #FFFFFF;
  166. &-item {
  167. flex: 1;
  168. }
  169. }
  170. .list {
  171. padding: 34rpx 37rpx;
  172. &-item {
  173. width: 100%;
  174. height: 284rpx;
  175. border-radius: 15rpx;
  176. overflow: hidden;
  177. & + & {
  178. margin-top: 25rpx;
  179. }
  180. .img {
  181. width: 100%;
  182. height: 100%;
  183. }
  184. }
  185. }
  186. .empty {
  187. margin-top: 65rpx;
  188. }
  189. </style>