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

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