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

361 lines
8.6 KiB

3 months 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
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
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
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
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
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
1 month 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_index_title }}</view>
  11. <view class="desc">{{ configList.page_index_desc }}</view>
  12. </view>
  13. <view class="flex icon">
  14. <image class="img" :src="configList.config_logo" mode="widthFix"></image>
  15. </view>
  16. </view>
  17. <!-- 搜索栏 -->
  18. <view class="section search">
  19. <uv-search v-model="keyword" :showAction="false" placeholder="输入关键词搜索" placeholderColor="#B2B2B2" bgColor="#FFFFFF" @custom="search" @search="search">
  20. <template #prefix>
  21. <view class="flex search-icon">
  22. <image class="img" src="@/static/image/icon-search.png" mode="widthFix"></image>
  23. </view>
  24. </template>
  25. </uv-search>
  26. </view>
  27. <!-- 轮播图 -->
  28. <view class="section swiper">
  29. <uv-swiper :list="bannerList" keyName="image" indicator indicatorMode="dot" indicatorActiveColor="#FFFFFF" indicatorInactiveColor="#6851A7" height="240rpx"></uv-swiper>
  30. </view>
  31. <view class="section card" v-for="group in list" :key="group.id">
  32. <view class="card-header">
  33. <view class="card-header-title">{{ group.title }}</view>
  34. <image class="card-header-icon" src="@/static/image/icon-triangle-down.png" mode="widthFix"></image>
  35. </view>
  36. <view class="card-content">
  37. <view class="card-item card-row" v-for="item in group.children" :key="item.id">
  38. <view class="flex info">
  39. <image class="info-icon" :src="item.image" mode="widthFix"></image>
  40. <view class="info-label">{{ item.title }}</view>
  41. </view>
  42. <button class="flex btn" @click="jumpToCategory(group.id, item.id, item.title, 'queryThesisList')">
  43. <view>查看</view>
  44. <image class="btn-icon" src="@/static/image/icon-arrow-right.png" mode="widthFix"></image>
  45. </button>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="section card" v-for="group in list2" :key="group.id">
  50. <view class="card-header">
  51. <view class="card-header-title">{{ group.title }}</view>
  52. <image class="card-header-icon" src="@/static/image/icon-triangle-down.png" mode="widthFix"></image>
  53. </view>
  54. <view class="card-content">
  55. <view class="card-box">
  56. <view class="card-item info" v-for="item in group.children" :key="item.id" @click="jumpToCategory(group.id, item.id, item.title, 'queryThesisTwoList')">
  57. <image class="info-icon" :src="item.image" mode="widthFix"></image>
  58. <view class="info-label">{{ item.title }}</view>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. <tabber select="home" />
  64. </view>
  65. </view>
  66. </template>
  67. <script>
  68. import tabber from '@/components/base/tabbar.vue'
  69. export default {
  70. components: {
  71. tabber,
  72. },
  73. data() {
  74. return {
  75. keyword: '',
  76. bannerList: [],
  77. list: [],
  78. list2: [],
  79. }
  80. },
  81. onLoad() {
  82. this.fetchBanner()
  83. this.getData()
  84. },
  85. methods: {
  86. // 获取轮播图
  87. async fetchBanner() {
  88. try {
  89. this.bannerList = (await this.$fetch('queryBannerList', { type: '0' }))?.records // type:0-首页 1-案例 2-服务 3-其他
  90. } catch (err) {
  91. }
  92. },
  93. async fetchCategory(api) {
  94. try {
  95. let parents = (await this.$fetch(api, { pageNo: 1, pageSize: 1000 }))?.records?.filter(item => item.hasChild == '1')
  96. let results = await Promise.allSettled(parents.map(parent => { return this.$fetch(api, { pid: parent.id, pageNo: 1, pageSize: 1000 }) }))
  97. results.forEach((result, index) => {
  98. parents[index].children = result?.value?.records || []
  99. })
  100. return parents
  101. } catch (err) {
  102. return []
  103. }
  104. },
  105. async getData() {
  106. this.list = await this.fetchCategory('queryCategoryThesisList')
  107. this.list2 = await this.fetchCategory('queryCategoryThesisTwoList')
  108. },
  109. search() {
  110. uni.navigateTo({
  111. url: '/pages_order/thesis/search?search=' + this.keyword
  112. })
  113. },
  114. jumpToCategory(categoryOne, categoryTwo, title, api) {
  115. uni.navigateTo({
  116. url: `/pages_order/thesis/search?categoryOne=${categoryOne}&categoryTwo=${categoryTwo}&title=${title}&api=${api}`
  117. })
  118. },
  119. },
  120. }
  121. </script>
  122. <style scoped lang="scss">
  123. .page__view {
  124. /deep/ .tabbar-box {
  125. height: 0;
  126. padding: 0;
  127. }
  128. }
  129. .header {
  130. padding-top: 186rpx;
  131. justify-content: space-between;
  132. .title {
  133. font-size: 44rpx;
  134. font-weight: 700;
  135. color: #6851A7;
  136. }
  137. .desc {
  138. font-size: 22rpx;
  139. font-weight: 600;
  140. color: #808080;
  141. }
  142. .icon {
  143. // margin-top: 16rpx;
  144. width: 62rpx;
  145. height: 62rpx;
  146. border: 2rpx solid #A3A2C5;
  147. border-radius: 50%;
  148. overflow: hidden;
  149. .img {
  150. width: 50rpx;
  151. height: auto;
  152. }
  153. }
  154. }
  155. .bg {
  156. width: 100vw;
  157. height: auto;
  158. .img {
  159. width: 100%;
  160. height: auto;
  161. }
  162. &-logo {
  163. position: absolute;
  164. top: 0;
  165. right: 0;
  166. width: 342rpx;
  167. height: auto;
  168. opacity: 0.3;
  169. }
  170. }
  171. .main {
  172. position: absolute;
  173. top: 0;
  174. left: 0;
  175. width: 100vw;
  176. padding-bottom: 182rpx;
  177. box-sizing: border-box;
  178. }
  179. .section {
  180. margin: 0 38rpx 24rpx 38rpx;
  181. }
  182. .search {
  183. width: calc(100% - 38rpx * 2);
  184. height: 48rpx;
  185. background-color: #FFFFFF;
  186. border-radius: 37rpx;
  187. box-sizing: border-box;
  188. display: flex;
  189. align-items: center;
  190. overflow: hidden;
  191. box-shadow: 2rpx 2rpx 9rpx 0 rgba($color: #C5C5C5, $alpha: 0.75);
  192. /deep/ .uv-search__content {
  193. padding: 0;
  194. border: none;
  195. }
  196. /deep/ .uv-search__content__input {
  197. margin-left: 18rpx;
  198. }
  199. &-icon {
  200. padding: 18rpx 10rpx 18rpx 18rpx;
  201. background: rgba($color: #E8DBF3, $alpha: 0.8);
  202. .img {
  203. width: 30rpx;
  204. height: auto;
  205. }
  206. }
  207. }
  208. .swiper {
  209. border-radius: 10rpx;
  210. overflow: hidden;
  211. /deep/ .uv-swiper-indicator__wrapper__dot {
  212. width: 25rpx;
  213. height: 5rpx;
  214. border-radius: 4rpx;
  215. margin: 0 4rpx;
  216. }
  217. /deep/ .uv-swiper-indicator__wrapper__dot--active {
  218. width: 25rpx;
  219. }
  220. }
  221. .card {
  222. width: calc(100% - 38rpx * 2);
  223. box-sizing: border-box;
  224. padding-bottom: 45rpx;
  225. background: linear-gradient(to right, rgba($color: #C8C3FD, $alpha: 0.14), rgba($color: #E2DDFF, $alpha: 0.14));
  226. border-radius: 10rpx;
  227. box-shadow: 4rpx 4rpx 6rpx 0rpx rgba(0,0,0,0.15);
  228. &-header {
  229. display: flex;
  230. align-items: center;
  231. column-gap: 23rpx;
  232. width: 100%;
  233. padding: 25rpx 30rpx 27rpx 30rpx;
  234. box-sizing: border-box;
  235. &-title {
  236. font-size: 34rpx;
  237. font-weight: 700;
  238. color: #4D4D4D;
  239. }
  240. &-icon {
  241. width: 32rpx;
  242. height: auto;
  243. }
  244. }
  245. &-content {
  246. padding: 0 32rpx;
  247. box-sizing: border-box;
  248. }
  249. &-item {
  250. display: flex;
  251. align-items: center;
  252. justify-content: flex-start;
  253. column-gap: 50rpx;
  254. padding: 26rpx 28rpx;
  255. box-sizing: border-box;
  256. background: linear-gradient(to right, rgba($color: #E2DDFF, $alpha: 0.26), rgba($color: #C8C3FD, $alpha: 0.26));
  257. // background: rgba($color: #E2DDFF, $alpha: 0.26);
  258. border-radius: 10rpx;
  259. box-shadow: 4rpx 4rpx 6rpx 0rpx rgba($color: #626266, $alpha: 0.15);
  260. }
  261. .info {
  262. &-icon {
  263. width: 54rpx;
  264. height: auto;
  265. }
  266. &-label {
  267. font-size: 26rpx;
  268. font-weight: 400;
  269. color: #000000;
  270. }
  271. }
  272. &-row {
  273. justify-content: space-between;
  274. padding: 26rpx 30rpx 26rpx 42rpx;
  275. & + & {
  276. margin-top: 28rpx;
  277. }
  278. .info {
  279. column-gap: 35rpx;
  280. }
  281. .btn {
  282. column-gap: 12rpx;
  283. // padding: 8rpx 24rpx 8rpx 26rpx;
  284. padding: 10rpx 24rpx 10rpx 26rpx;
  285. line-height: 1;
  286. font-size: 20rpx;
  287. font-weight: 600;
  288. color: #6851A7;
  289. background: #FFFFFF;
  290. border-radius: 20rpx;
  291. &-icon {
  292. width: 22rpx;
  293. height: auto;
  294. }
  295. }
  296. }
  297. &-box {
  298. display: grid;
  299. grid-template-columns: repeat(2, 1fr);
  300. column-gap: 34rpx;
  301. row-gap: 26rpx;
  302. .info {
  303. column-gap: 50rpx;
  304. }
  305. }
  306. }
  307. </style>