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

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