index.vue 36 KB

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