index copy.vue 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471
  1. <template>
  2. <div class="home-pages">
  3. <!-- 头部 -->
  4. <div class="home-head" @mouseleave="leaveClassify">
  5. <div class="classify" :class="classifyShow ? 'classify-show' : ''">
  6. <div
  7. class="classify-list"
  8. v-for="(item, index) in classifyList"
  9. :class="item.id == classifyId && classifyShow ? 'classify-hig' : ''"
  10. :key="index"
  11. @mouseenter="enterClassify(item)"
  12. v-show="classifyShow ? true : Number(index) < 13"
  13. >
  14. <div class="label ellipsis" @click="onPath('/search?type=1&topCategoryId=' + item.id)">{{ item.label }}</div>
  15. <div class="info info1 ellipsis" v-if="item.extra && item.extra.oneLable1">{{ item.extra.oneLable1 }}</div>
  16. <div class="info ellipsis" v-if="item.extra && item.extra.oneLable2">{{ item.extra.oneLable2 }}</div>
  17. <div class="classify-border" v-if="item.id == classifyId && classifyShow"></div>
  18. </div>
  19. </div>
  20. <div class="classify-bos" v-if="classifyShow">
  21. <div v-for="(item, index) in classifyInfo" :key="index" class="classify-item" @click="onPath('/search?type=2&middleCategoryId=' + item.id)">
  22. <div class="two-level ellipsis">{{ item.label || '' }}</div>
  23. <el-icon class="classify-icon" :size="14" color="#364153">
  24. <ArrowRight />
  25. </el-icon>
  26. <div class="classify-label">
  27. <div v-for="(item1, index1) in item.children" :key="index1" @click="onPath('/search?type=3&bottomCategoryId=' + item1.id)">
  28. {{ item1.label || '' }}
  29. </div>
  30. </div>
  31. </div>
  32. </div>
  33. <div class="head-bos">
  34. <div class="carousel">
  35. <el-carousel trigger="click" height="407px">
  36. <el-carousel-item v-for="item in carouselList" :key="item">
  37. <img :src="item.imageUrl" alt="" />
  38. </el-carousel-item>
  39. </el-carousel>
  40. </div>
  41. <div class="head-box">
  42. <div v-for="(item, index) in AdList" :key="index" class="head-item" @click="onPath('/plan?id=' + item.id)">
  43. <img :src="item.imageUrl" alt="" />
  44. </div>
  45. </div>
  46. </div>
  47. <!-- 右边 -->
  48. <div class="head-right">
  49. <div class="login-bos">
  50. <div class="login-box">
  51. <img :src="userInfo.avatar ? userInfo.avatar : profile" alt="" />
  52. <div>
  53. <div class="login1">您好,欢迎来到优易达</div>
  54. <div class="login2">{{ userInfo.nickName ? userInfo.nickName : '请先登录' }}</div>
  55. </div>
  56. </div>
  57. <div class="login-btn">
  58. <el-button v-if="!userInfo.nickName" type="primary" round size="small" style="width: 64px" @click="onPath('/login')">登录</el-button>
  59. <!-- @click="onPath('/reg')" -->
  60. <el-button v-if="!userInfo.nickName" type="primary" plain round size="small" style="width: 64px">注册</el-button>
  61. <el-button v-if="userInfo.nickName" type="primary" plain round size="small" style="width: 64px" @click="onlogout()">退出</el-button>
  62. </div>
  63. </div>
  64. <div class="real-time">
  65. <div class="real-title flex-row-between">
  66. <div class="real1">优易资讯</div>
  67. <div class="real2 flex-row-start">
  68. <div>更多</div>
  69. <el-icon :size="13" color="#83899F">
  70. <ArrowRight />
  71. </el-icon>
  72. </div>
  73. </div>
  74. <template v-for="(item, index) in realList" :key="index">
  75. <div @click="onPath('/solve/real?id=' + item.id)" class="real-list ellipsis" v-if="Number(index) < 7">{{ item.announcementTitle }}</div>
  76. </template>
  77. </div>
  78. <div class="interests">
  79. <div class="interests-title">企业会员权益</div>
  80. <div class="interests-bos">
  81. <div v-for="(item, index) in interestsList" :key="index" class="interests-item flex-column-center">
  82. <img :src="item.imageUrl" alt="" />
  83. <div>{{ item.title }}</div>
  84. </div>
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. <!-- 热门方案 -->
  90. <div class="home-title flex-row-between">
  91. <div>
  92. <span class="title1">{{ hotTitle.title }}</span>
  93. <span class="title2">{{ hotTitle.subtitle }}</span>
  94. </div>
  95. <div class="title-more flex-row-start" @click="onPath(hotTitle.linkUrl ? hotTitle.linkUrl : '/plan')">
  96. <div style="margin-right: 5px">{{ hotTitle.linkWord }}</div>
  97. <el-icon :size="13" color="#83899F">
  98. <ArrowRight />
  99. </el-icon>
  100. </div>
  101. </div>
  102. <div class="hot-bos">
  103. <template v-for="(item, index) in hotList" :key="index">
  104. <div class="hot-list flex-column-center" v-if="Number(index) < 4" @click="onPath('/plan_info?id=' + item.id)">
  105. <div class="hot1">{{ item.advertTitle }}</div>
  106. <div class="hot2">{{ item.advertBrief }}</div>
  107. <img :src="item.coverImage" alt="" />
  108. </div>
  109. </template>
  110. </div>
  111. <!-- 场景采购 -->
  112. <div class="home-title flex-row-between">
  113. <div>
  114. <span class="title1">{{ sceneTitle.title }}</span>
  115. <span class="title2">{{ sceneTitle.subtitle }}</span>
  116. </div>
  117. <div class="title-more flex-row-start" @click="onPath(sceneTitle.linkUrl ? sceneTitle.linkUrl : '/plan/procure')">
  118. <div style="margin-right: 5px">{{ sceneTitle.linkWord }}</div>
  119. <el-icon :size="13" color="#83899F">
  120. <ArrowRight />
  121. </el-icon>
  122. </div>
  123. </div>
  124. <div class="scene-bos">
  125. <template v-for="(item, index) in sceneList" :key="index">
  126. <div class="scene-list" v-if="Number(index) < 5" @click="onPath('/plan_info?id=' + item.id)">
  127. <div class="scene-box">
  128. <!-- <div class="scene1">{{ item.advertTitle }}</div>
  129. <div class="scene2">{{ item.advertBrief }}</div> -->
  130. </div>
  131. <img :src="item.coverImage" alt="" />
  132. </div>
  133. </template>
  134. </div>
  135. <!-- 大牌推荐 -->
  136. <div class="home-title flex-row-between">
  137. <div>
  138. <span class="title1">{{ bigbrandTitle.title }}</span>
  139. <span class="title2">{{ bigbrandTitle.subtitle }}</span>
  140. </div>
  141. <div class="title-more flex-row-start">
  142. <div style="margin-right: 5px">{{ bigbrandTitle.linkWord }}</div>
  143. <el-icon :size="13" color="#83899F">
  144. <ArrowRight />
  145. </el-icon>
  146. </div>
  147. </div>
  148. <div class="big-brand">
  149. <img class="bigBrand-one" :src="bigbrandOne.coverImage" alt="" />
  150. <div class="bigBrand-bos">
  151. <template v-for="(item, index) in bigbrandList" :key="index">
  152. <div class="bigBrand-list" v-if="Number(index) < 10">
  153. <img :src="item.brandLogo" alt="" />
  154. <div class="bigBrand1">{{ item.brandName || '' }}</div>
  155. <div class="bigBrand2">
  156. {{ item.advertBrief || '' }}
  157. </div>
  158. </div>
  159. </template>
  160. </div>
  161. </div>
  162. <!-- 行家精选 -->
  163. <div class="home-title flex-row-between">
  164. <div>
  165. <span class="title1">{{ expertTitle.title }}</span>
  166. <span class="title2">{{ expertTitle.subtitle }}</span>
  167. </div>
  168. <div class="title-more flex-row-start" @click="onPath(hotTitle.linkUrl ? hotTitle.linkUrl : '/search/special')">
  169. <div style="margin-right: 5px">{{ expertTitle.linkWord }}</div>
  170. <el-icon :size="13" color="#83899F">
  171. <ArrowRight />
  172. </el-icon>
  173. </div>
  174. </div>
  175. <div class="expert-bos">
  176. <template v-for="(item, index) in expertList" :key="index">
  177. <div class="expert-list" v-if="Number(index) < 5" @click="onPath('/item?id=' + item.id)">
  178. <img :src="item.productImage" alt="" />
  179. <div class="itemName ellipsis">{{ item.itemName || '' }}</div>
  180. <div class="price">
  181. <span class="memberPrice">¥{{ item.memberPrice }}</span>
  182. <span class="marketPrice">¥{{ item.marketPrice }}</span>
  183. </div>
  184. </div>
  185. </template>
  186. </div>
  187. <!-- 采购指南 -->
  188. <div class="home-title flex-row-between">
  189. <div>
  190. <span class="title1">{{ procureTitle.title }}</span>
  191. <span class="title2">{{ procureTitle.subtitle }}</span>
  192. </div>
  193. <div class="title-more flex-row-start" @click="onPath(hotTitle.linkUrl ? hotTitle.linkUrl : '/plan/guide')">
  194. <div style="margin-right: 5px">{{ procureTitle.linkWord }}</div>
  195. <el-icon :size="13" color="#83899F">
  196. <ArrowRight />
  197. </el-icon>
  198. </div>
  199. </div>
  200. <div class="procure-bos">
  201. <template v-for="(item, index) in procureList" :key="index">
  202. <div class="procure-list" v-if="Number(index) < 3">
  203. <img :src="item.coverImage" alt="" />
  204. <div class="procure1">{{ item.title || '' }}</div>
  205. <div class="procure2">{{ item.subtitle || '' }}</div>
  206. </div>
  207. </template>
  208. </div>
  209. <!-- 循环-商品 -->
  210. <div v-for="(item1, index1) in homeList" :key="index1">
  211. <!-- 头部 -->
  212. <div class="home-title flex-row-between">
  213. <div>
  214. <span class="title1">{{ item1.floorName }}</span>
  215. <span class="title2">{{ item1.floorDescribe }}</span>
  216. </div>
  217. <div class="title-more flex-row-start">
  218. <div style="margin-right: 5px">{{ item1.floorLabel }}</div>
  219. <el-icon :size="13" color="#83899F">
  220. <ArrowRight />
  221. </el-icon>
  222. </div>
  223. </div>
  224. <!-- 商品 -->
  225. <div class="goods-bos" v-if="item1.imgOne">
  226. <img class="goods-img" :src="item1.imgOne.advertiseImage" alt="" />
  227. <div class="home1-bos" v-if="item1.home1List && item1.home1List.length > 0">
  228. <div class="floorName">{{ item1.floorName }}</div>
  229. <div v-for="(item2, index2) in item1.home1List" :key="index2" class="home1-list">
  230. <img :src="item2.advertiseImage" alt="" />
  231. <div style="flex: 1; width: 0">
  232. <div class="advertiseName">{{ item2.advertiseName }}</div>
  233. <div class="advertiseDescribe ellipsis">{{ item2.advertiseDescribe }}</div>
  234. </div>
  235. </div>
  236. </div>
  237. <div class="home2-bos" v-if="item1.home2List && item1.home2List.length > 0">
  238. <div>
  239. <div class="floorName">发现</div>
  240. <div class="home2-box">
  241. <div v-for="(item2, index2) in item1.home2List" :key="index2" class="home2-list">
  242. <div style="flex: 1; width: 0">
  243. <div class="advertiseName ellipsis">{{ item2.advertiseName }}</div>
  244. <div class="advertiseDescribe ellipsis">{{ item2.advertiseDescribe }}</div>
  245. <el-button class="bnt" type="primary" size="small">立即进入</el-button>
  246. </div>
  247. <img :src="item2.advertiseImage" alt="" />
  248. </div>
  249. </div>
  250. </div>
  251. <div class="home2-two" v-if="item1.infoTwo">
  252. <div class="advertiseName">{{ item1.infoTwo.advertiseName }}</div>
  253. <div class="advertiseDescribe">{{ item1.infoTwo.advertiseDescribe }}</div>
  254. <img :src="item1.infoTwo.advertiseImage" alt="" />
  255. </div>
  256. </div>
  257. </div>
  258. <div class="shop-bos">
  259. <div class="shop-nav">
  260. <div class="nav-title">采购导航</div>
  261. <div class="nav-bos">
  262. <div v-for="(item2, index2) in item1.navList" :key="index2" class="nav-list flex-row-center" :class="index2 == 0 ? 'hig' : ''">
  263. {{ item2.labelName }}
  264. </div>
  265. </div>
  266. </div>
  267. <template v-for="(item2, index2) in item1.shopList" :key="index2">
  268. <div class="shop-list" v-if="Number(index2) < 4" @click="onInfo(item2)">
  269. <img :src="item2.productImage" alt="" />
  270. <div class="itemName ellipsis2">{{ item2.itemName }}</div>
  271. <div class="price">
  272. <span class="memberPrice">¥{{ item2.memberPrice }}</span>
  273. <span class="marketPrice">¥{{ item2.marketPrice }}</span>
  274. </div>
  275. </div>
  276. </template>
  277. </div>
  278. </div>
  279. <!-- 项目案例 -->
  280. <div class="home-title flex-row-between">
  281. <div>
  282. <span class="title1">{{ projectTitle.title }}</span>
  283. <span class="title2">{{ projectTitle.subtitle }}</span>
  284. </div>
  285. <div class="title-more flex-row-start" @click="onPath(projectTitle.linkUrl ? projectTitle.linkUrl : '/plan/project')">
  286. <div style="margin-right: 5px">{{ projectTitle.linkWord }}</div>
  287. <el-icon :size="13" color="#83899F">
  288. <ArrowRight />
  289. </el-icon>
  290. </div>
  291. </div>
  292. <div class="project-bos">
  293. <template v-for="(item, index) in projectList" :key="index">
  294. <div class="project-list" v-if="Number(index) < 3">
  295. <img :src="item.uploadProgram" alt="" />
  296. <div class="project-box">
  297. <div class="project1">{{ item.caseTitle || '' }}</div>
  298. <div class="project2">
  299. {{ item.projectBrief || '' }}
  300. </div>
  301. <div class="project-more flex-row-between">
  302. <div></div>
  303. <div class="flex-row-start">
  304. <div style="margin-right: 5px">了解详情</div>
  305. <el-icon :size="14" color="#E7000B">
  306. <ArrowRight />
  307. </el-icon>
  308. </div>
  309. </div>
  310. </div>
  311. </div>
  312. </template>
  313. </div>
  314. </div>
  315. </template>
  316. <script setup lang="ts">
  317. import profile from '@/assets/images/profile.jpg';
  318. import { onPath } from '@/utils/siteConfig';
  319. import { getToken } from '@/utils/auth';
  320. import { getInfo } from '@/api/login';
  321. import { getPlatformIndexDiyPcPage } from '@/api/home/diy';
  322. import {
  323. getProductCategoryTree,
  324. getHomeAdList,
  325. getYouYiZiXunPage,
  326. getEnterpriseMemberEquityList,
  327. getHomeThreeAdList,
  328. getHotSchemeTitle,
  329. getHotSchemeList,
  330. getScenePurchaseTitle,
  331. getScenePurchaseList,
  332. getPlatformFlashSaleTitle,
  333. getPlatformFlashSaleList,
  334. getPlatformFlashSaleBrand,
  335. getExpertSelectionTitle,
  336. getProcurementTopicsList,
  337. getPurchaseGuideTitle,
  338. getExpertSelectionList,
  339. getClassificationFloorList,
  340. getClassificationFloorDetail,
  341. getClassificationFloorLabel,
  342. getClassificationFloorDetail2,
  343. getProjectCaseTitle,
  344. getProjectCaseList
  345. } from '@/api/home/index';
  346. const userInfo = ref<any>({});
  347. const classifyList = ref<any>([]);
  348. const classifyShow = ref<any>(false);
  349. const classifyId = ref<any>('');
  350. const classifyInfo = ref<any>([]);
  351. const carouselList = ref<any>([]);
  352. const realList = ref<any>([]);
  353. const interestsList = ref<any>([]);
  354. const AdList = ref<any>([]);
  355. const hotTitle = ref<any>('');
  356. const hotList = ref<any>([]);
  357. const sceneTitle = ref<any>('');
  358. const sceneList = ref<any>([]);
  359. const expertTitle = ref<any>('');
  360. const expertList = ref<any>([{}, {}, {}, {}, {}]);
  361. const procureTitle = ref<any>('');
  362. const procureList = ref<any>([{}, {}, {}, {}, {}]);
  363. const projectTitle = ref<any>('');
  364. const projectList = ref<any>([{}, {}, {}, {}, {}]);
  365. const bigbrandTitle = ref<any>('');
  366. const bigbrandList = ref<any>([]);
  367. const bigbrandOne = ref<any>({});
  368. const homeList = ref<any>([]);
  369. const router = useRouter();
  370. getPlatformIndexDiyPcPage({}).then((res) => {
  371. if (res.code == 200) {
  372. }
  373. });
  374. onMounted(() => {
  375. if (getToken()) {
  376. getInfo().then((res) => {
  377. if (res.code == 200) {
  378. userInfo.value = res.data.user;
  379. }
  380. });
  381. }
  382. });
  383. //移入分类
  384. const enterClassify = (res: any) => {
  385. classifyShow.value = true;
  386. classifyId.value = res.id;
  387. classifyInfo.value = res.children;
  388. };
  389. //移出分类
  390. const leaveClassify = () => {
  391. classifyShow.value = false;
  392. };
  393. //头部分类
  394. import { categoryStore } from '@/store/modules/category';
  395. const categoryStoreStore = categoryStore();
  396. onMounted(async () => {
  397. try {
  398. // 根据当前路由路径获取分类数据
  399. classifyList.value = await categoryStoreStore.fetchCategories('/index');
  400. } catch (error) {
  401. console.error('获取分类失败:', error);
  402. }
  403. });
  404. //头部轮播
  405. getHomeAdList({}).then((res) => {
  406. if (res.code == 200) {
  407. carouselList.value = res.data;
  408. }
  409. });
  410. //头部优易资讯
  411. getYouYiZiXunPage({}).then((res) => {
  412. if (res.code == 200) {
  413. realList.value = res.data;
  414. }
  415. });
  416. //头部会员权益
  417. getEnterpriseMemberEquityList({}).then((res) => {
  418. if (res.code == 200) {
  419. interestsList.value = res.data;
  420. }
  421. });
  422. //首页三联广告(平台装修-楼层广告-首页三联广告)
  423. getHomeThreeAdList({}).then((res) => {
  424. if (res.code == 200) {
  425. AdList.value = res.data;
  426. }
  427. });
  428. //热门方案标题
  429. getHotSchemeTitle({}).then((res) => {
  430. if (res.code == 200) {
  431. hotTitle.value = res.data;
  432. }
  433. });
  434. //热门方案列表
  435. getHotSchemeList({}).then((res) => {
  436. if (res.code == 200) {
  437. hotList.value = res.data;
  438. }
  439. });
  440. //场景采购标题
  441. getScenePurchaseTitle({}).then((res) => {
  442. if (res.code == 200) {
  443. sceneTitle.value = res.data;
  444. }
  445. });
  446. //场景采购列表
  447. getScenePurchaseList({}).then((res) => {
  448. if (res.code == 200) {
  449. sceneList.value = res.data;
  450. }
  451. });
  452. //大牌推荐标题(平台闪购标题)
  453. getPlatformFlashSaleTitle({}).then((res) => {
  454. if (res.code == 200) {
  455. bigbrandTitle.value = res.data;
  456. }
  457. });
  458. //大牌推荐列表(平台闪购列表)
  459. getPlatformFlashSaleList({}).then((res) => {
  460. if (res.code == 200) {
  461. if (res.data.length > 0) {
  462. bigbrandOne.value = res.data[0];
  463. // bigbrandList.value = res.data.slice(1);
  464. }
  465. }
  466. });
  467. //大牌推荐列表(平台闪购列表)-右
  468. getPlatformFlashSaleBrand({}).then((res) => {
  469. if (res.code == 200) {
  470. if (res.data.length > 0) {
  471. bigbrandList.value = res.data;
  472. }
  473. }
  474. });
  475. //行家精选标题
  476. getExpertSelectionTitle({}).then((res) => {
  477. if (res.code == 200) {
  478. expertTitle.value = res.data;
  479. }
  480. });
  481. //行家精选列表
  482. getExpertSelectionList({}).then((res) => {
  483. if (res.code == 200) {
  484. expertList.value = res.data;
  485. }
  486. });
  487. //采购指南标题
  488. getPurchaseGuideTitle({}).then((res) => {
  489. if (res.code == 200) {
  490. procureTitle.value = res.data;
  491. }
  492. });
  493. //采购指南列表
  494. getProcurementTopicsList({}).then((res) => {
  495. if (res.code == 200) {
  496. procureList.value = res.data;
  497. console.log(res.data);
  498. }
  499. });
  500. //项目案例标题(平台装修-项目案例)
  501. getProjectCaseTitle({}).then((res) => {
  502. if (res.code == 200) {
  503. projectTitle.value = res.data;
  504. }
  505. });
  506. //项目案例列表(平台装修-项目案例)
  507. getProjectCaseList({}).then((res) => {
  508. if (res.code == 200) {
  509. projectList.value = res.data;
  510. }
  511. });
  512. //外面循环
  513. getClassificationFloorList({}).then(async (res) => {
  514. if (res.code == 200) {
  515. for (const item of res.data) {
  516. try {
  517. const datas1 = await getClassificationFloorDetail(item.floorNo);
  518. if (datas1.code == 200) {
  519. if (datas1.data.length > 0) {
  520. item.imgOne = datas1.data[0];
  521. if (datas1.data.length > 1) {
  522. item.home1List = datas1.data.slice(1, 4);
  523. }
  524. if (datas1.data.length > 4) {
  525. item.home2List = datas1.data.slice(4, 6);
  526. }
  527. if (datas1.data.length > 6) {
  528. item.infoTwo = datas1.data[6];
  529. }
  530. }
  531. }
  532. const datas2 = await getClassificationFloorLabel(item.floorNo);
  533. if (datas2.code == 200) {
  534. item.navList = datas2.data;
  535. }
  536. const datas3 = await getClassificationFloorDetail2(item.floorNo);
  537. if (datas2.code == 200) {
  538. item.shopList = datas3.data;
  539. }
  540. } catch (error) {}
  541. }
  542. homeList.value = res.data;
  543. console.log(homeList.value);
  544. }
  545. });
  546. const onInfo = (res: any) => {
  547. router.push('/shop/info?id=' + res.id);
  548. };
  549. import { useUserStore } from '@/store/modules/user';
  550. const onlogout = () => {
  551. useUserStore()
  552. .logout()
  553. .then(() => {
  554. onPath('/login');
  555. });
  556. };
  557. </script>
  558. <style lang="scss" scoped>
  559. .home-pages {
  560. width: 1200px;
  561. margin: 0 auto;
  562. // 头部
  563. .home-head {
  564. width: 1200px;
  565. position: relative;
  566. display: flex;
  567. gap: 0px 10px;
  568. margin-top: 10px;
  569. .classify {
  570. width: 234px;
  571. height: 540px;
  572. background: #ffffff;
  573. &.classify-show {
  574. position: absolute;
  575. z-index: 10;
  576. height: auto;
  577. min-height: 540px;
  578. }
  579. .classify-list {
  580. width: 100%;
  581. height: 40px;
  582. cursor: pointer;
  583. display: flex;
  584. align-items: center;
  585. padding-left: 15px;
  586. position: relative;
  587. &.classify-hig {
  588. border: 1px solid var(--el-color-primary);
  589. border-right: 0px solid var(--el-color-primary);
  590. }
  591. .label {
  592. max-width: 100px;
  593. font-weight: 600;
  594. font-size: 14px;
  595. color: #101828;
  596. white-space: nowrap;
  597. margin-right: 10px;
  598. &:hover {
  599. color: var(--el-color-primary);
  600. }
  601. }
  602. .info {
  603. max-width: 50px;
  604. font-size: 12px;
  605. color: #364153;
  606. white-space: nowrap;
  607. &.info1 {
  608. margin-right: 6px;
  609. }
  610. &:hover {
  611. color: var(--el-color-primary);
  612. }
  613. }
  614. .classify-border {
  615. position: absolute;
  616. right: -1px;
  617. top: 0px;
  618. width: 1px;
  619. height: 38px;
  620. background-color: #ffffff;
  621. z-index: 2;
  622. }
  623. }
  624. }
  625. .classify-bos {
  626. position: absolute;
  627. top: 0;
  628. right: 0;
  629. width: 966px;
  630. height: 100%;
  631. border: 1px solid var(--el-color-primary);
  632. background-color: #ffffff;
  633. overflow-y: auto;
  634. padding-left: 30px;
  635. z-index: 10;
  636. .classify-item {
  637. display: flex;
  638. padding-top: 10px;
  639. border-bottom: 1px solid #e5e7eb;
  640. .two-level {
  641. width: 90px;
  642. font-size: 14px;
  643. color: var(--el-color-primary);
  644. cursor: pointer;
  645. }
  646. .classify-icon {
  647. margin: 4px 15px 0 15px;
  648. }
  649. .classify-label {
  650. display: flex;
  651. flex-wrap: wrap;
  652. flex: 1;
  653. font-size: 14px;
  654. color: #364153;
  655. div {
  656. margin-right: 20px;
  657. margin-bottom: 10px;
  658. cursor: pointer;
  659. &:hover {
  660. color: var(--el-color-primary);
  661. }
  662. }
  663. }
  664. }
  665. }
  666. // 头部中间
  667. .head-bos {
  668. width: 756px;
  669. .carousel {
  670. width: 756px;
  671. height: 407px;
  672. background: #ffffff;
  673. img {
  674. width: 756px;
  675. height: 407px;
  676. }
  677. }
  678. .head-box {
  679. width: 756px;
  680. height: 122px;
  681. margin-top: 10px;
  682. display: flex;
  683. gap: 0 10px;
  684. .head-item {
  685. flex: 1;
  686. background-color: #ffffff;
  687. height: 122px;
  688. display: flex;
  689. // padding-left: 20px;
  690. align-items: center;
  691. cursor: pointer;
  692. border-radius: 5px;
  693. overflow: hidden;
  694. img {
  695. width: 100%;
  696. height: 100%;
  697. // width: 84px;
  698. // height: 84px;
  699. // margin-right: 10px;
  700. // border-radius: 10px;
  701. }
  702. .head-title {
  703. .head1 {
  704. font-weight: 550;
  705. font-size: 22px;
  706. color: #101828;
  707. }
  708. .head2 {
  709. width: 76px;
  710. height: 21px;
  711. border-radius: 34px;
  712. border: 1px solid #000000;
  713. font-size: 12px;
  714. color: #000000;
  715. margin-top: 6px;
  716. }
  717. }
  718. }
  719. }
  720. }
  721. //右边
  722. .head-right {
  723. flex: 1;
  724. width: 0;
  725. height: 540px;
  726. background: #ffffff;
  727. display: flex;
  728. flex-direction: column;
  729. .login-bos {
  730. width: calc(100% - 20px);
  731. height: 110px;
  732. border-bottom: 1px solid #e5e7eb;
  733. margin: 0 10px;
  734. display: flex;
  735. flex-direction: column;
  736. justify-content: space-between;
  737. padding: 16px 0;
  738. .login-box {
  739. display: flex;
  740. align-items: center;
  741. img {
  742. width: 40px;
  743. height: 40px;
  744. margin-right: 8px;
  745. border-radius: 40px;
  746. }
  747. .login-btn {
  748. width: 100%;
  749. }
  750. .login1 {
  751. font-size: 13px;
  752. color: #444444;
  753. }
  754. .login2 {
  755. margin-top: 2px;
  756. font-size: 12px;
  757. color: #6a7282;
  758. }
  759. }
  760. }
  761. .real-time {
  762. width: calc(100% - 20px);
  763. height: 227px;
  764. border-bottom: 1px solid #e5e7eb;
  765. margin: 0 10px;
  766. padding-top: 15px;
  767. .real-title {
  768. position: relative;
  769. margin-bottom: 12px;
  770. &::after {
  771. content: '';
  772. top: 3px;
  773. left: 0;
  774. position: absolute;
  775. width: 4px;
  776. height: 14px;
  777. background: var(--el-color-primary);
  778. }
  779. .real1 {
  780. font-weight: 600;
  781. font-size: 14px;
  782. color: #1d2129;
  783. padding-left: 15px;
  784. }
  785. .real2 {
  786. font-size: 13px;
  787. color: #83899f;
  788. cursor: pointer;
  789. }
  790. }
  791. .real-list {
  792. width: 100%;
  793. font-size: 14px;
  794. color: #1d2129;
  795. margin-bottom: 12px;
  796. cursor: pointer;
  797. &:hover {
  798. color: var(--el-color-primary);
  799. }
  800. }
  801. }
  802. .interests {
  803. flex: 1;
  804. width: calc(100% - 20px);
  805. margin: 0 10px;
  806. padding-top: 15px;
  807. .interests-title {
  808. position: relative;
  809. font-weight: 600;
  810. font-size: 14px;
  811. color: #1d2129;
  812. padding-left: 15px;
  813. &::after {
  814. content: '';
  815. top: 3px;
  816. left: 0;
  817. position: absolute;
  818. width: 4px;
  819. height: 14px;
  820. background: var(--el-color-primary);
  821. }
  822. }
  823. .interests-bos {
  824. display: flex;
  825. flex-wrap: wrap;
  826. .interests-item {
  827. width: 33.333%;
  828. font-size: 12px;
  829. color: #101828;
  830. margin-top: 15px;
  831. cursor: pointer;
  832. &:hover {
  833. color: var(--el-color-primary);
  834. }
  835. img {
  836. width: 34px;
  837. height: 34px;
  838. margin-bottom: 7px;
  839. }
  840. }
  841. }
  842. }
  843. }
  844. }
  845. //标题
  846. .home-title {
  847. width: 1200px;
  848. height: 56px;
  849. background: #ffffff;
  850. margin-top: 15px;
  851. padding: 0 20px;
  852. .title1 {
  853. font-weight: 600;
  854. font-size: 20px;
  855. color: #101828;
  856. }
  857. .title2 {
  858. font-size: 14px;
  859. color: #364153;
  860. margin-left: 10px;
  861. }
  862. .title-more {
  863. font-size: 14px;
  864. color: #364153;
  865. cursor: pointer;
  866. &:hover {
  867. color: var(--el-color-primary);
  868. }
  869. }
  870. }
  871. //热门方案
  872. .hot-bos {
  873. height: 176px;
  874. width: 1200px;
  875. display: flex;
  876. gap: 0 18px;
  877. margin-top: 12px;
  878. .hot-list {
  879. flex: 1;
  880. height: 176px;
  881. background: #ffffff;
  882. border-radius: 10px 10px 10px 10px;
  883. cursor: pointer;
  884. .hot1 {
  885. font-weight: 600;
  886. font-size: 16px;
  887. color: #101828;
  888. }
  889. .hot2 {
  890. font-size: 14px;
  891. color: #364153;
  892. margin: 2px 0 14px 0;
  893. }
  894. img {
  895. width: 80px;
  896. height: 80px;
  897. }
  898. }
  899. }
  900. // 场景采购
  901. .scene-bos {
  902. height: 304px;
  903. width: 1200px;
  904. display: flex;
  905. gap: 0 18px;
  906. margin-top: 12px;
  907. .scene-list {
  908. flex: 1;
  909. height: 304px;
  910. background: #ffffff;
  911. position: relative;
  912. cursor: pointer;
  913. .scene-box {
  914. padding-top: 35px;
  915. position: absolute;
  916. z-index: 2;
  917. width: 100%;
  918. .scene1 {
  919. font-weight: 600;
  920. font-size: 30px;
  921. color: #ffffff;
  922. text-align: center;
  923. width: 100%;
  924. }
  925. .scene2 {
  926. font-size: 17px;
  927. color: #ffffff;
  928. text-align: center;
  929. width: 100%;
  930. margin-top: 4px;
  931. }
  932. }
  933. img {
  934. position: absolute;
  935. width: 100%;
  936. height: 100%;
  937. top: 0;
  938. left: 0;
  939. background-color: #f4f4f4;
  940. }
  941. }
  942. }
  943. // 大牌推荐
  944. .big-brand {
  945. height: 334px;
  946. width: 1200px;
  947. margin-top: 12px;
  948. display: flex;
  949. .bigBrand-one {
  950. width: 233px;
  951. height: 334px;
  952. margin-right: 10px;
  953. }
  954. .bigBrand-bos {
  955. flex: 1;
  956. width: 0;
  957. display: flex;
  958. flex-wrap: wrap;
  959. gap: 10px;
  960. .bigBrand-list {
  961. width: 183.4px;
  962. height: 162px;
  963. background: #ffffff;
  964. display: flex;
  965. flex-direction: column;
  966. align-items: center;
  967. padding: 32px 20px 0 20px;
  968. img {
  969. width: 152px;
  970. height: 29px;
  971. }
  972. .bigBrand1 {
  973. font-weight: 600;
  974. font-size: 14px;
  975. color: #101828;
  976. margin: 10px 0 4px 0;
  977. }
  978. .bigBrand2 {
  979. font-weight: 400;
  980. font-size: 12px;
  981. color: #364153;
  982. display: -webkit-box;
  983. -webkit-line-clamp: 2;
  984. line-clamp: 2;
  985. /* 添加标准属性 */
  986. -webkit-box-orient: vertical;
  987. overflow: hidden;
  988. text-overflow: ellipsis;
  989. }
  990. }
  991. }
  992. }
  993. // 行家精选
  994. .expert-bos {
  995. width: 1200px;
  996. display: flex;
  997. margin-top: 12px;
  998. .expert-list {
  999. width: 230px;
  1000. height: 306px;
  1001. background: #ffffff;
  1002. margin-left: 12.5px;
  1003. padding: 20px;
  1004. cursor: pointer;
  1005. &:first-child {
  1006. margin-left: 0;
  1007. }
  1008. img {
  1009. width: 100%;
  1010. height: 190px;
  1011. }
  1012. .itemName {
  1013. font-weight: 400;
  1014. font-size: 14px;
  1015. color: #101828;
  1016. margin: 27px 0 2px 0;
  1017. }
  1018. .price {
  1019. .memberPrice {
  1020. color: var(--el-color-primary);
  1021. font-size: 16px;
  1022. color: #e7000b;
  1023. }
  1024. .marketPrice {
  1025. font-size: 12px;
  1026. color: #99a1af;
  1027. line-height: 20px;
  1028. text-decoration-line: line-through;
  1029. text-transform: none;
  1030. margin-left: 6px;
  1031. }
  1032. }
  1033. }
  1034. }
  1035. // 采购指南
  1036. .procure-bos {
  1037. display: flex;
  1038. width: 1200px;
  1039. margin-top: 12px;
  1040. gap: 0 15px;
  1041. .procure-list {
  1042. width: 390px;
  1043. height: 268px;
  1044. background: #ffffff;
  1045. cursor: pointer;
  1046. img {
  1047. width: 390px;
  1048. height: 200px;
  1049. }
  1050. .procure1 {
  1051. padding: 12px 0 4px 20px;
  1052. font-weight: 600;
  1053. font-size: 14px;
  1054. color: #101828;
  1055. }
  1056. .procure2 {
  1057. padding-left: 20px;
  1058. font-size: 12px;
  1059. color: #364153;
  1060. }
  1061. }
  1062. }
  1063. //循环-商品
  1064. .goods-bos {
  1065. height: 340px;
  1066. width: 1200px;
  1067. margin-top: 14px;
  1068. display: flex;
  1069. .goods-img {
  1070. width: 230px;
  1071. height: 340px;
  1072. cursor: pointer;
  1073. }
  1074. .home1-bos {
  1075. width: 476px;
  1076. height: 340px;
  1077. background: #ffffff;
  1078. margin-left: 10px;
  1079. padding: 18px 20px 0 20px;
  1080. display: flex;
  1081. flex-direction: column;
  1082. .floorName {
  1083. font-weight: 600;
  1084. font-size: 16px;
  1085. color: #101828;
  1086. }
  1087. .home1-list {
  1088. flex: 1;
  1089. display: flex;
  1090. border-bottom: 1px solid #e5e7eb;
  1091. align-items: center;
  1092. cursor: pointer;
  1093. .advertiseName {
  1094. font-weight: 600;
  1095. font-size: 14px;
  1096. color: #101828;
  1097. }
  1098. .advertiseDescribe {
  1099. font-weight: 400;
  1100. font-size: 12px;
  1101. color: #364153;
  1102. margin-top: 4px;
  1103. }
  1104. img {
  1105. width: 72px;
  1106. height: 72px;
  1107. margin-right: 10px;
  1108. }
  1109. &:last-child {
  1110. border-bottom: none;
  1111. }
  1112. }
  1113. }
  1114. .home2-bos {
  1115. width: 474px;
  1116. margin-left: 10px;
  1117. height: 340px;
  1118. background: #ffffff;
  1119. padding: 18px 20px 0 20px;
  1120. display: flex;
  1121. justify-content: space-between;
  1122. .floorName {
  1123. font-weight: 600;
  1124. font-size: 16px;
  1125. color: #101828;
  1126. }
  1127. .home2-box {
  1128. width: 249px;
  1129. .home2-list {
  1130. width: 249px;
  1131. height: 130px;
  1132. border: 1px solid #e5e7eb;
  1133. margin-top: 13px;
  1134. display: flex;
  1135. align-items: center;
  1136. padding: 0 10px;
  1137. cursor: pointer;
  1138. .advertiseName {
  1139. font-weight: 600;
  1140. font-size: 14px;
  1141. color: #101828;
  1142. }
  1143. .advertiseDescribe {
  1144. font-size: 12px;
  1145. color: #364153;
  1146. margin: 4px 0 10px 0;
  1147. }
  1148. .bnt {
  1149. width: 68px;
  1150. height: 24px;
  1151. }
  1152. img {
  1153. width: 72px;
  1154. height: 72px;
  1155. margin-left: 10px;
  1156. }
  1157. }
  1158. }
  1159. .home2-two {
  1160. width: 177px;
  1161. height: 273px;
  1162. border-radius: 0px 0px 0px 0px;
  1163. border: 1px solid #e5e7eb;
  1164. margin-top: 34px;
  1165. padding: 26px 10px;
  1166. cursor: pointer;
  1167. .advertiseName {
  1168. font-weight: 600;
  1169. font-size: 14px;
  1170. color: #101828;
  1171. }
  1172. .advertiseDescribe {
  1173. font-size: 12px;
  1174. color: #364153;
  1175. margin: 4px 0 30px 0;
  1176. display: -webkit-box;
  1177. -webkit-line-clamp: 2;
  1178. line-clamp: 2;
  1179. /* 添加标准属性 */
  1180. -webkit-box-orient: vertical;
  1181. overflow: hidden;
  1182. text-overflow: ellipsis;
  1183. }
  1184. img {
  1185. width: 123px;
  1186. height: 122px;
  1187. margin: 0 17px;
  1188. }
  1189. }
  1190. }
  1191. }
  1192. .shop-bos {
  1193. display: flex;
  1194. margin-top: 14px;
  1195. .shop-nav {
  1196. width: 230px;
  1197. height: 306px;
  1198. background: #ffffff;
  1199. padding: 16px;
  1200. .nav-title {
  1201. font-weight: 600;
  1202. font-size: 16px;
  1203. color: #101828;
  1204. margin-bottom: 10px;
  1205. }
  1206. .nav-bos {
  1207. width: 100%;
  1208. display: flex;
  1209. flex-wrap: wrap;
  1210. justify-content: space-between;
  1211. .nav-list {
  1212. width: 94px;
  1213. height: 32px;
  1214. background: #f4f4f4;
  1215. border-radius: 4px 4px 4px 4px;
  1216. font-size: 14px;
  1217. color: #101828;
  1218. margin-bottom: 10px;
  1219. cursor: pointer;
  1220. &:hover {
  1221. color: var(--el-color-primary);
  1222. }
  1223. &.hig {
  1224. background: var(--el-color-primary);
  1225. color: #ffffff;
  1226. }
  1227. }
  1228. }
  1229. }
  1230. .shop-list {
  1231. width: 230px;
  1232. height: 306px;
  1233. background: #ffffff;
  1234. margin-left: 12.5px;
  1235. padding: 20px;
  1236. cursor: pointer;
  1237. img {
  1238. width: 100%;
  1239. height: 190px;
  1240. }
  1241. .itemName {
  1242. font-weight: 400;
  1243. font-size: 14px;
  1244. color: #101828;
  1245. margin: 27px 0 2px 0;
  1246. }
  1247. .price {
  1248. .memberPrice {
  1249. color: var(--el-color-primary);
  1250. font-size: 16px;
  1251. color: #e7000b;
  1252. }
  1253. .marketPrice {
  1254. font-size: 12px;
  1255. color: #99a1af;
  1256. line-height: 20px;
  1257. text-decoration-line: line-through;
  1258. text-transform: none;
  1259. margin-left: 6px;
  1260. }
  1261. }
  1262. }
  1263. }
  1264. //项目案例
  1265. .project-bos {
  1266. display: flex;
  1267. width: 1200px;
  1268. margin-top: 12px;
  1269. gap: 0 15px;
  1270. .project-list {
  1271. width: 390px;
  1272. height: 350px;
  1273. cursor: pointer;
  1274. border-radius: 10px;
  1275. overflow: hidden;
  1276. .project-box {
  1277. width: 390px;
  1278. height: 156px;
  1279. background: #ffffff;
  1280. border-radius: 10px;
  1281. margin-top: -20px;
  1282. z-index: 2;
  1283. position: absolute;
  1284. padding: 20px;
  1285. }
  1286. img {
  1287. width: 390px;
  1288. height: 180px;
  1289. }
  1290. .project1 {
  1291. font-weight: 600;
  1292. font-size: 16px;
  1293. color: #101828;
  1294. margin-bottom: 14px;
  1295. }
  1296. .project2 {
  1297. font-size: 14px;
  1298. color: #364153;
  1299. display: -webkit-box;
  1300. -webkit-line-clamp: 2;
  1301. line-clamp: 2;
  1302. /* 添加标准属性 */
  1303. -webkit-box-orient: vertical;
  1304. overflow: hidden;
  1305. text-overflow: ellipsis;
  1306. }
  1307. .project-more {
  1308. text-align: right;
  1309. font-size: 14px;
  1310. color: var(--el-color-primary);
  1311. margin-top: 18px;
  1312. }
  1313. }
  1314. }
  1315. }
  1316. </style>