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

312 lines
7.4 KiB

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