吉光研途前端代码仓库
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
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
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
1 month ago
3 months ago
1 month 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
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" :style="style">
  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 utils from '@/utils/utils'
  58. import mixinsList from '@/mixins/list.js'
  59. import tabber from '@/components/base/tabbar.vue'
  60. import suspendDropdown from '@/components/base/suspendDropdown.vue'
  61. export default {
  62. mixins: [mixinsList],
  63. components: {
  64. tabber,
  65. suspendDropdown,
  66. },
  67. data() {
  68. return {
  69. keyword: '',
  70. bannerList: [],
  71. serviceOptions: [],
  72. majorOptions: [],
  73. periodOptions: [],
  74. list: [],
  75. queryParams: {
  76. pageNo: 1,
  77. pageSize: 10,
  78. title: '',
  79. categoryServiceId: '',
  80. categoryMajorId: '',
  81. categoryPeriodId: '',
  82. },
  83. mixinsListApi: 'queryAriticleList',
  84. style: '',
  85. }
  86. },
  87. onLoad() {
  88. this.style = `padding-top: calc(${utils.getNavHeight()}px - 16rpx)`
  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. padding-top: calc(var(--status-bar-height) + 120rpx);
  143. justify-content: space-between;
  144. align-items: flex-start;
  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. box-sizing: border-box;
  163. .img {
  164. width: 50rpx;
  165. height: auto;
  166. }
  167. }
  168. }
  169. .bg {
  170. position: relative;
  171. width: 100vw;
  172. height: auto;
  173. .img {
  174. width: 100%;
  175. height: auto;
  176. }
  177. &-logo {
  178. position: absolute;
  179. top: 0;
  180. right: 0;
  181. width: 342rpx;
  182. height: auto;
  183. opacity: 0.3;
  184. }
  185. }
  186. .main {
  187. position: absolute;
  188. top: 0;
  189. left: 0;
  190. width: 100vw;
  191. padding-bottom: 182rpx;
  192. box-sizing: border-box;
  193. }
  194. .section {
  195. margin: 0 38rpx 24rpx 38rpx;
  196. }
  197. .search {
  198. width: calc(100% - 38rpx * 2);
  199. height: 48rpx;
  200. background-color: #FFFFFF;
  201. border-radius: 37rpx;
  202. box-sizing: border-box;
  203. display: flex;
  204. align-items: center;
  205. overflow: hidden;
  206. box-shadow: 2rpx 2rpx 9rpx 0 rgba($color: #C5C5C5, $alpha: 0.75);
  207. /deep/ .uv-search__content {
  208. padding: 0;
  209. border: none;
  210. }
  211. /deep/ .uv-search__content__input {
  212. margin-left: 18rpx;
  213. }
  214. &-icon {
  215. padding: 18rpx 10rpx 18rpx 18rpx;
  216. background: rgba($color: #E8DBF3, $alpha: 0.8);
  217. .img {
  218. width: 30rpx;
  219. height: auto;
  220. }
  221. }
  222. }
  223. .swiper {
  224. // border-radius: 10rpx;
  225. // overflow: hidden;
  226. .img {
  227. width: 100%;
  228. height: auto;
  229. }
  230. /deep/ .uv-swiper-indicator__wrapper__dot {
  231. width: 25rpx;
  232. height: 5rpx;
  233. border-radius: 4rpx;
  234. margin: 0 4rpx;
  235. }
  236. /deep/ .uv-swiper-indicator__wrapper__dot--active {
  237. width: 25rpx;
  238. }
  239. }
  240. .filter {
  241. justify-content: space-between;
  242. margin: 0 38rpx 18rpx 38rpx;
  243. padding: 0 20rpx;
  244. background: #FAF9FD;
  245. box-shadow: 4rpx 4rpx 6rpx 0rpx rgba($color: #2A2A2B, $alpha: 0.12);
  246. border-radius: 4rpx;
  247. &-item {
  248. // flex: 1;
  249. }
  250. }
  251. .list {
  252. padding-bottom: 38rpx;
  253. &-item {
  254. $width: calc(100vw - 38rpx * 2);
  255. margin: 0 38rpx;
  256. width: $width;
  257. // height: 284rpx;
  258. height: calc(#{$width} * 282 / 672);
  259. border-radius: 10rpx;
  260. overflow: hidden;
  261. box-shadow: 4rpx 4rpx 6rpx 0rpx rgba($color: #000000, $alpha: 0.15);
  262. & + & {
  263. margin-top: 18rpx;
  264. }
  265. .img {
  266. width: 100%;
  267. height: 100%;
  268. }
  269. }
  270. }
  271. .empty {
  272. margin-top: 65rpx;
  273. }
  274. </style>