吉光研途前端代码仓库
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.

267 lines
6.4 KiB

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