index.vue 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469
  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 ellipsis2">{{ 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 { getPlatformIndexDiyPcPage } from '@/api/home/diy';
  329. import {
  330. getProductCategoryTree,
  331. getHomeAdList,
  332. getYouYiZiXunPage,
  333. getEnterpriseMemberEquityList,
  334. getHomeThreeAdList,
  335. getHotSchemeTitle,
  336. getHotSchemeList,
  337. getScenePurchaseTitle,
  338. getScenePurchaseList,
  339. getPlatformFlashSaleTitle,
  340. getPlatformFlashSaleList,
  341. getPlatformFlashSaleBrand,
  342. getExpertSelectionTitle,
  343. getPurchaseGuideTitle,
  344. getExpertSelectionList,
  345. getClassificationFloorList,
  346. getClassificationFloorDetail,
  347. getClassificationFloorLabel,
  348. getClassificationFloorDetail2,
  349. getProjectCaseTitle,
  350. getProjectCaseList
  351. } from '@/api/home/index';
  352. const userInfo = ref<any>({});
  353. const classifyList = ref<any>([]);
  354. const classifyShow = ref<any>(false);
  355. const classifyId = ref<any>('');
  356. const classifyInfo = ref<any>([]);
  357. const carouselList = ref<any>([]);
  358. const realList = ref<any>([]);
  359. const interestsList = ref<any>([]);
  360. const AdList = ref<any>([]);
  361. const hotTitle = ref<any>('');
  362. const hotList = ref<any>([]);
  363. const sceneTitle = ref<any>('');
  364. const sceneList = ref<any>([]);
  365. const expertTitle = ref<any>('');
  366. const expertList = ref<any>([{}, {}, {}, {}, {}]);
  367. const procureTitle = ref<any>('');
  368. const procureList = ref<any>([{}, {}, {}, {}, {}]);
  369. const projectTitle = ref<any>('');
  370. const projectList = ref<any>([{}, {}, {}, {}, {}]);
  371. const bigbrandTitle = ref<any>('');
  372. const bigbrandList = ref<any>([]);
  373. const bigbrandOne = ref<any>({});
  374. const homeList = ref<any>([]);
  375. const router = useRouter();
  376. getPlatformIndexDiyPcPage({}).then((res) => {
  377. if (res.code == 200) {
  378. }
  379. });
  380. onMounted(() => {
  381. if (getToken()) {
  382. getInfo().then((res) => {
  383. if (res.code == 200) {
  384. userInfo.value = res.data.user;
  385. }
  386. });
  387. }
  388. });
  389. //移入分类
  390. const enterClassify = (res: any) => {
  391. classifyShow.value = true;
  392. classifyId.value = res.id;
  393. classifyInfo.value = res.children;
  394. };
  395. //移出分类
  396. const leaveClassify = () => {
  397. classifyShow.value = false;
  398. };
  399. //头部分类
  400. import { categoryStore } from '@/store/modules/category';
  401. const categoryStoreStore = categoryStore();
  402. onMounted(async () => {
  403. try {
  404. // 根据当前路由路径获取分类数据
  405. classifyList.value = await categoryStoreStore.fetchCategories('/index');
  406. } catch (error) {
  407. console.error('获取分类失败:', error);
  408. }
  409. });
  410. //头部轮播
  411. getHomeAdList({}).then((res) => {
  412. if (res.code == 200) {
  413. carouselList.value = res.data;
  414. }
  415. });
  416. //头部优易资讯
  417. getYouYiZiXunPage({}).then((res) => {
  418. if (res.code == 200) {
  419. realList.value = res.data;
  420. }
  421. });
  422. //头部会员权益
  423. getEnterpriseMemberEquityList({}).then((res) => {
  424. if (res.code == 200) {
  425. interestsList.value = res.data;
  426. }
  427. });
  428. //首页三联广告(平台装修-楼层广告-首页三联广告)
  429. getHomeThreeAdList({}).then((res) => {
  430. if (res.code == 200) {
  431. AdList.value = res.data;
  432. }
  433. });
  434. //热门方案标题
  435. getHotSchemeTitle({}).then((res) => {
  436. if (res.code == 200) {
  437. hotTitle.value = res.data;
  438. }
  439. });
  440. //热门方案列表
  441. getHotSchemeList({}).then((res) => {
  442. if (res.code == 200) {
  443. hotList.value = res.data;
  444. }
  445. });
  446. //场景采购标题
  447. getScenePurchaseTitle({}).then((res) => {
  448. if (res.code == 200) {
  449. sceneTitle.value = res.data;
  450. }
  451. });
  452. //场景采购列表
  453. getScenePurchaseList({}).then((res) => {
  454. if (res.code == 200) {
  455. sceneList.value = res.data;
  456. }
  457. });
  458. //大牌推荐标题(平台闪购标题)
  459. getPlatformFlashSaleTitle({}).then((res) => {
  460. if (res.code == 200) {
  461. bigbrandTitle.value = res.data;
  462. }
  463. });
  464. //大牌推荐列表(平台闪购列表)
  465. getPlatformFlashSaleList({}).then((res) => {
  466. if (res.code == 200) {
  467. if (res.data.length > 0) {
  468. bigbrandOne.value = res.data[0];
  469. // bigbrandList.value = res.data.slice(1);
  470. }
  471. }
  472. });
  473. //大牌推荐列表(平台闪购列表)-右
  474. getPlatformFlashSaleBrand({}).then((res) => {
  475. if (res.code == 200) {
  476. if (res.data.length > 0) {
  477. bigbrandList.value = res.data;
  478. }
  479. }
  480. });
  481. //行家精选标题
  482. getExpertSelectionTitle({}).then((res) => {
  483. if (res.code == 200) {
  484. expertTitle.value = res.data;
  485. }
  486. });
  487. //行家精选列表
  488. getExpertSelectionList({}).then((res) => {
  489. if (res.code == 200) {
  490. expertList.value = res.data;
  491. }
  492. });
  493. //采购指南标题
  494. getPurchaseGuideTitle({}).then((res) => {
  495. if (res.code == 200) {
  496. procureTitle.value = res.data;
  497. }
  498. });
  499. //项目案例标题(平台装修-项目案例)
  500. getProjectCaseTitle({}).then((res) => {
  501. if (res.code == 200) {
  502. projectTitle.value = res.data;
  503. }
  504. });
  505. //项目案例列表(平台装修-项目案例)
  506. getProjectCaseList({}).then((res) => {
  507. if (res.code == 200) {
  508. projectList.value = res.data;
  509. }
  510. });
  511. //外面循环
  512. getClassificationFloorList({}).then(async (res) => {
  513. if (res.code == 200) {
  514. for (const item of res.data) {
  515. try {
  516. const datas1 = await getClassificationFloorDetail(item.floorNo);
  517. if (datas1.code == 200) {
  518. if (datas1.data.length > 0) {
  519. item.imgOne = datas1.data[0];
  520. if (datas1.data.length > 1) {
  521. item.home1List = datas1.data.slice(1, 4);
  522. }
  523. if (datas1.data.length > 4) {
  524. item.home2List = datas1.data.slice(4, 6);
  525. }
  526. if (datas1.data.length > 6) {
  527. item.infoTwo = datas1.data[6];
  528. }
  529. }
  530. }
  531. const datas2 = await getClassificationFloorLabel(item.floorNo);
  532. if (datas2.code == 200) {
  533. item.navList = datas2.data;
  534. }
  535. const datas3 = await getClassificationFloorDetail2(item.floorNo);
  536. if (datas2.code == 200) {
  537. item.shopList = datas3.data;
  538. }
  539. } catch (error) {}
  540. }
  541. homeList.value = res.data;
  542. console.log(homeList.value);
  543. }
  544. });
  545. const onInfo = (res: any) => {
  546. router.push('/shop/info?id=' + res.id);
  547. };
  548. import { useUserStore } from '@/store/modules/user';
  549. const onlogout = () => {
  550. useUserStore()
  551. .logout()
  552. .then(() => {
  553. onPath('/login');
  554. });
  555. };
  556. </script>
  557. <style lang="scss" scoped>
  558. .home-pages {
  559. width: 1200px;
  560. margin: 0 auto;
  561. // 头部
  562. .home-head {
  563. width: 1200px;
  564. position: relative;
  565. display: flex;
  566. gap: 0px 10px;
  567. margin-top: 10px;
  568. .classify {
  569. width: 234px;
  570. height: 540px;
  571. background: #ffffff;
  572. &.classify-show {
  573. position: absolute;
  574. z-index: 10;
  575. height: auto;
  576. min-height: 540px;
  577. }
  578. .classify-list {
  579. width: 100%;
  580. height: 40px;
  581. cursor: pointer;
  582. display: flex;
  583. align-items: center;
  584. padding-left: 15px;
  585. position: relative;
  586. &.classify-hig {
  587. border: 1px solid var(--el-color-primary);
  588. border-right: 0px solid var(--el-color-primary);
  589. }
  590. .label {
  591. max-width: 100px;
  592. font-weight: 600;
  593. font-size: 14px;
  594. color: #101828;
  595. white-space: nowrap;
  596. margin-right: 10px;
  597. &:hover {
  598. color: var(--el-color-primary);
  599. }
  600. }
  601. .info {
  602. max-width: 50px;
  603. font-size: 12px;
  604. color: #364153;
  605. white-space: nowrap;
  606. &.info1 {
  607. margin-right: 6px;
  608. }
  609. &:hover {
  610. color: var(--el-color-primary);
  611. }
  612. }
  613. .classify-border {
  614. position: absolute;
  615. right: -1px;
  616. top: 0px;
  617. width: 1px;
  618. height: 38px;
  619. background-color: #ffffff;
  620. z-index: 2;
  621. }
  622. }
  623. }
  624. .classify-bos {
  625. position: absolute;
  626. top: 0;
  627. right: 0;
  628. width: 966px;
  629. height: 100%;
  630. border: 1px solid var(--el-color-primary);
  631. background-color: #ffffff;
  632. overflow-y: auto;
  633. padding-left: 30px;
  634. z-index: 10;
  635. .classify-item {
  636. display: flex;
  637. padding-top: 10px;
  638. border-bottom: 1px solid #e5e7eb;
  639. .two-level {
  640. width: 90px;
  641. font-size: 14px;
  642. color: var(--el-color-primary);
  643. cursor: pointer;
  644. }
  645. .classify-icon {
  646. margin: 4px 15px 0 15px;
  647. }
  648. .classify-label {
  649. display: flex;
  650. flex-wrap: wrap;
  651. flex: 1;
  652. font-size: 14px;
  653. color: #364153;
  654. div {
  655. margin-right: 20px;
  656. margin-bottom: 10px;
  657. cursor: pointer;
  658. &:hover {
  659. color: var(--el-color-primary);
  660. }
  661. }
  662. }
  663. }
  664. }
  665. // 头部中间
  666. .head-bos {
  667. width: 756px;
  668. .carousel {
  669. width: 756px;
  670. height: 407px;
  671. background: #ffffff;
  672. img {
  673. width: 756px;
  674. height: 407px;
  675. }
  676. }
  677. .head-box {
  678. width: 756px;
  679. height: 122px;
  680. margin-top: 10px;
  681. display: flex;
  682. gap: 0 10px;
  683. .head-item {
  684. flex: 1;
  685. background-color: #ffffff;
  686. height: 122px;
  687. display: flex;
  688. // padding-left: 20px;
  689. align-items: center;
  690. cursor: pointer;
  691. border-radius: 5px;
  692. overflow: hidden;
  693. img {
  694. width: 100%;
  695. height: 100%;
  696. // width: 84px;
  697. // height: 84px;
  698. // margin-right: 10px;
  699. // border-radius: 10px;
  700. }
  701. .head-title {
  702. .head1 {
  703. font-weight: 550;
  704. font-size: 22px;
  705. color: #101828;
  706. }
  707. .head2 {
  708. width: 76px;
  709. height: 21px;
  710. border-radius: 34px;
  711. border: 1px solid #000000;
  712. font-size: 12px;
  713. color: #000000;
  714. margin-top: 6px;
  715. }
  716. }
  717. }
  718. }
  719. }
  720. //右边
  721. .head-right {
  722. flex: 1;
  723. width: 0;
  724. height: 540px;
  725. background: #ffffff;
  726. display: flex;
  727. flex-direction: column;
  728. .login-bos {
  729. width: calc(100% - 20px);
  730. height: 110px;
  731. border-bottom: 1px solid #e5e7eb;
  732. margin: 0 10px;
  733. display: flex;
  734. flex-direction: column;
  735. justify-content: space-between;
  736. padding: 16px 0;
  737. .login-box {
  738. display: flex;
  739. align-items: center;
  740. img {
  741. width: 40px;
  742. height: 40px;
  743. margin-right: 8px;
  744. border-radius: 40px;
  745. }
  746. .login-btn {
  747. width: 100%;
  748. }
  749. .login1 {
  750. font-size: 13px;
  751. color: #444444;
  752. }
  753. .login2 {
  754. margin-top: 2px;
  755. font-size: 12px;
  756. color: #6a7282;
  757. }
  758. }
  759. }
  760. .real-time {
  761. width: calc(100% - 20px);
  762. height: 227px;
  763. border-bottom: 1px solid #e5e7eb;
  764. margin: 0 10px;
  765. padding-top: 15px;
  766. .real-title {
  767. position: relative;
  768. margin-bottom: 12px;
  769. &::after {
  770. content: '';
  771. top: 3px;
  772. left: 0;
  773. position: absolute;
  774. width: 4px;
  775. height: 14px;
  776. background: var(--el-color-primary);
  777. }
  778. .real1 {
  779. font-weight: 600;
  780. font-size: 14px;
  781. color: #1d2129;
  782. padding-left: 15px;
  783. }
  784. .real2 {
  785. font-size: 13px;
  786. color: #83899f;
  787. cursor: pointer;
  788. }
  789. }
  790. .real-list {
  791. width: 100%;
  792. font-size: 14px;
  793. color: #1d2129;
  794. margin-bottom: 12px;
  795. cursor: pointer;
  796. &:hover {
  797. color: var(--el-color-primary);
  798. }
  799. }
  800. }
  801. .interests {
  802. flex: 1;
  803. width: calc(100% - 20px);
  804. margin: 0 10px;
  805. padding-top: 15px;
  806. .interests-title {
  807. position: relative;
  808. font-weight: 600;
  809. font-size: 14px;
  810. color: #1d2129;
  811. padding-left: 15px;
  812. &::after {
  813. content: '';
  814. top: 3px;
  815. left: 0;
  816. position: absolute;
  817. width: 4px;
  818. height: 14px;
  819. background: var(--el-color-primary);
  820. }
  821. }
  822. .interests-bos {
  823. display: flex;
  824. flex-wrap: wrap;
  825. .interests-item {
  826. width: 33.333%;
  827. font-size: 12px;
  828. color: #101828;
  829. margin-top: 15px;
  830. cursor: pointer;
  831. &:hover {
  832. color: var(--el-color-primary);
  833. }
  834. img {
  835. width: 34px;
  836. height: 34px;
  837. margin-bottom: 7px;
  838. }
  839. }
  840. }
  841. }
  842. }
  843. }
  844. //标题
  845. .home-title {
  846. width: 1200px;
  847. height: 56px;
  848. background: #ffffff;
  849. margin-top: 15px;
  850. padding: 0 20px;
  851. .title1 {
  852. font-weight: 600;
  853. font-size: 20px;
  854. color: #101828;
  855. }
  856. .title2 {
  857. font-size: 14px;
  858. color: #364153;
  859. margin-left: 10px;
  860. }
  861. .title-more {
  862. font-size: 14px;
  863. color: #364153;
  864. cursor: pointer;
  865. &:hover {
  866. color: var(--el-color-primary);
  867. }
  868. }
  869. }
  870. //热门方案
  871. .hot-bos {
  872. height: 176px;
  873. width: 1200px;
  874. display: flex;
  875. gap: 0 18px;
  876. margin-top: 12px;
  877. .hot-list {
  878. flex: 1;
  879. height: 176px;
  880. background: #ffffff;
  881. border-radius: 10px 10px 10px 10px;
  882. cursor: pointer;
  883. .hot1 {
  884. font-weight: 600;
  885. font-size: 16px;
  886. color: #101828;
  887. }
  888. .hot2 {
  889. font-size: 14px;
  890. color: #364153;
  891. margin: 2px 0 14px 0;
  892. }
  893. img {
  894. width: 80px;
  895. height: 80px;
  896. }
  897. }
  898. }
  899. // 场景采购
  900. .scene-bos {
  901. height: 304px;
  902. width: 1200px;
  903. display: flex;
  904. gap: 0 18px;
  905. margin-top: 12px;
  906. .scene-list {
  907. flex: 1;
  908. height: 304px;
  909. background: #ffffff;
  910. position: relative;
  911. cursor: pointer;
  912. .scene-box {
  913. padding-top: 35px;
  914. position: absolute;
  915. z-index: 2;
  916. width: 100%;
  917. .scene1 {
  918. font-weight: 600;
  919. font-size: 30px;
  920. color: #ffffff;
  921. text-align: center;
  922. width: 100%;
  923. }
  924. .scene2 {
  925. font-size: 17px;
  926. color: #ffffff;
  927. text-align: center;
  928. width: 100%;
  929. margin-top: 4px;
  930. }
  931. }
  932. img {
  933. position: absolute;
  934. width: 100%;
  935. height: 100%;
  936. top: 0;
  937. left: 0;
  938. background-color: #f4f4f4;
  939. }
  940. }
  941. }
  942. // 大牌推荐
  943. .big-brand {
  944. height: 334px;
  945. width: 1200px;
  946. margin-top: 12px;
  947. display: flex;
  948. .bigBrand-one {
  949. width: 233px;
  950. height: 334px;
  951. margin-right: 10px;
  952. }
  953. .bigBrand-bos {
  954. flex: 1;
  955. width: 0;
  956. display: flex;
  957. flex-wrap: wrap;
  958. gap: 10px;
  959. .bigBrand-list {
  960. width: 183.4px;
  961. height: 162px;
  962. background: #ffffff;
  963. display: flex;
  964. flex-direction: column;
  965. align-items: center;
  966. padding: 32px 20px 0 20px;
  967. img {
  968. width: 152px;
  969. height: 29px;
  970. }
  971. .bigBrand1 {
  972. font-weight: 600;
  973. font-size: 14px;
  974. color: #101828;
  975. margin: 10px 0 4px 0;
  976. }
  977. .bigBrand2 {
  978. font-weight: 400;
  979. font-size: 12px;
  980. color: #364153;
  981. display: -webkit-box;
  982. -webkit-line-clamp: 2;
  983. line-clamp: 2;
  984. /* 添加标准属性 */
  985. -webkit-box-orient: vertical;
  986. overflow: hidden;
  987. text-overflow: ellipsis;
  988. }
  989. }
  990. }
  991. }
  992. // 行家精选
  993. .expert-bos {
  994. width: 1200px;
  995. display: flex;
  996. margin-top: 12px;
  997. .expert-list {
  998. width: 230px;
  999. height: 306px;
  1000. background: #ffffff;
  1001. margin-left: 12.5px;
  1002. padding: 20px;
  1003. cursor: pointer;
  1004. &:first-child {
  1005. margin-left: 0;
  1006. }
  1007. img {
  1008. width: 100%;
  1009. height: 190px;
  1010. }
  1011. .itemName {
  1012. font-weight: 400;
  1013. font-size: 14px;
  1014. color: #101828;
  1015. margin: 27px 0 2px 0;
  1016. }
  1017. .price {
  1018. .memberPrice {
  1019. color: var(--el-color-primary);
  1020. font-size: 16px;
  1021. color: #e7000b;
  1022. }
  1023. .marketPrice {
  1024. font-size: 12px;
  1025. color: #99a1af;
  1026. line-height: 20px;
  1027. text-decoration-line: line-through;
  1028. text-transform: none;
  1029. margin-left: 6px;
  1030. }
  1031. }
  1032. }
  1033. }
  1034. // 采购指南
  1035. .procure-bos {
  1036. display: flex;
  1037. width: 1200px;
  1038. margin-top: 12px;
  1039. gap: 0 15px;
  1040. .procure-list {
  1041. width: 390px;
  1042. height: 268px;
  1043. background: #ffffff;
  1044. cursor: pointer;
  1045. img {
  1046. width: 390px;
  1047. height: 200px;
  1048. }
  1049. .procure1 {
  1050. padding: 12px 0 4px 20px;
  1051. font-weight: 600;
  1052. font-size: 14px;
  1053. color: #101828;
  1054. }
  1055. .procure2 {
  1056. padding-left: 20px;
  1057. font-size: 12px;
  1058. color: #364153;
  1059. }
  1060. }
  1061. }
  1062. //循环-商品
  1063. .goods-bos {
  1064. height: 340px;
  1065. width: 1200px;
  1066. margin-top: 14px;
  1067. display: flex;
  1068. .goods-img {
  1069. width: 230px;
  1070. height: 340px;
  1071. cursor: pointer;
  1072. }
  1073. .home1-bos {
  1074. width: 476px;
  1075. height: 340px;
  1076. background: #ffffff;
  1077. margin-left: 10px;
  1078. padding: 18px 20px 0 20px;
  1079. display: flex;
  1080. flex-direction: column;
  1081. .floorName {
  1082. font-weight: 600;
  1083. font-size: 16px;
  1084. color: #101828;
  1085. }
  1086. .home1-list {
  1087. flex: 1;
  1088. display: flex;
  1089. border-bottom: 1px solid #e5e7eb;
  1090. align-items: center;
  1091. cursor: pointer;
  1092. .advertiseName {
  1093. font-weight: 600;
  1094. font-size: 14px;
  1095. color: #101828;
  1096. }
  1097. .advertiseDescribe {
  1098. font-weight: 400;
  1099. font-size: 12px;
  1100. color: #364153;
  1101. margin-top: 4px;
  1102. }
  1103. img {
  1104. width: 72px;
  1105. height: 72px;
  1106. margin-right: 10px;
  1107. }
  1108. &:last-child {
  1109. border-bottom: none;
  1110. }
  1111. }
  1112. }
  1113. .home2-bos {
  1114. width: 474px;
  1115. margin-left: 10px;
  1116. height: 340px;
  1117. background: #ffffff;
  1118. padding: 18px 20px 0 20px;
  1119. display: flex;
  1120. justify-content: space-between;
  1121. .floorName {
  1122. font-weight: 600;
  1123. font-size: 16px;
  1124. color: #101828;
  1125. }
  1126. .home2-box {
  1127. width: 249px;
  1128. .home2-list {
  1129. width: 249px;
  1130. height: 130px;
  1131. border: 1px solid #e5e7eb;
  1132. margin-top: 13px;
  1133. display: flex;
  1134. align-items: center;
  1135. padding: 0 10px;
  1136. cursor: pointer;
  1137. .advertiseName {
  1138. font-weight: 600;
  1139. font-size: 14px;
  1140. color: #101828;
  1141. }
  1142. .advertiseDescribe {
  1143. font-size: 12px;
  1144. color: #364153;
  1145. margin: 4px 0 10px 0;
  1146. }
  1147. .bnt {
  1148. width: 68px;
  1149. height: 24px;
  1150. }
  1151. img {
  1152. width: 72px;
  1153. height: 72px;
  1154. margin-left: 10px;
  1155. }
  1156. }
  1157. }
  1158. .home2-two {
  1159. width: 177px;
  1160. height: 273px;
  1161. border-radius: 0px 0px 0px 0px;
  1162. border: 1px solid #e5e7eb;
  1163. margin-top: 34px;
  1164. padding: 26px 10px;
  1165. cursor: pointer;
  1166. .advertiseName {
  1167. font-weight: 600;
  1168. font-size: 14px;
  1169. color: #101828;
  1170. }
  1171. .advertiseDescribe {
  1172. font-size: 12px;
  1173. color: #364153;
  1174. margin: 4px 0 30px 0;
  1175. display: -webkit-box;
  1176. -webkit-line-clamp: 2;
  1177. line-clamp: 2;
  1178. /* 添加标准属性 */
  1179. -webkit-box-orient: vertical;
  1180. overflow: hidden;
  1181. text-overflow: ellipsis;
  1182. }
  1183. img {
  1184. width: 123px;
  1185. height: 122px;
  1186. margin: 0 17px;
  1187. }
  1188. }
  1189. }
  1190. }
  1191. .shop-bos {
  1192. display: flex;
  1193. margin-top: 14px;
  1194. .shop-nav {
  1195. width: 230px;
  1196. height: 306px;
  1197. background: #ffffff;
  1198. padding: 16px;
  1199. .nav-title {
  1200. font-weight: 600;
  1201. font-size: 16px;
  1202. color: #101828;
  1203. margin-bottom: 10px;
  1204. }
  1205. .nav-bos {
  1206. width: 100%;
  1207. display: flex;
  1208. flex-wrap: wrap;
  1209. justify-content: space-between;
  1210. .nav-list {
  1211. width: 94px;
  1212. height: 32px;
  1213. background: #f4f4f4;
  1214. border-radius: 4px 4px 4px 4px;
  1215. font-size: 14px;
  1216. color: #101828;
  1217. margin-bottom: 10px;
  1218. cursor: pointer;
  1219. &:hover {
  1220. color: var(--el-color-primary);
  1221. }
  1222. &.hig {
  1223. background: var(--el-color-primary);
  1224. color: #ffffff;
  1225. }
  1226. }
  1227. }
  1228. }
  1229. .shop-list {
  1230. width: 230px;
  1231. height: 306px;
  1232. background: #ffffff;
  1233. margin-left: 12.5px;
  1234. padding: 20px;
  1235. cursor: pointer;
  1236. img {
  1237. width: 100%;
  1238. height: 190px;
  1239. }
  1240. .itemName {
  1241. font-weight: 400;
  1242. font-size: 14px;
  1243. color: #101828;
  1244. margin: 27px 0 2px 0;
  1245. }
  1246. .price {
  1247. .memberPrice {
  1248. color: var(--el-color-primary);
  1249. font-size: 16px;
  1250. color: #e7000b;
  1251. }
  1252. .marketPrice {
  1253. font-size: 12px;
  1254. color: #99a1af;
  1255. line-height: 20px;
  1256. text-decoration-line: line-through;
  1257. text-transform: none;
  1258. margin-left: 6px;
  1259. }
  1260. }
  1261. }
  1262. }
  1263. //项目案例
  1264. .project-bos {
  1265. display: flex;
  1266. width: 1200px;
  1267. margin-top: 12px;
  1268. gap: 0 15px;
  1269. .project-list {
  1270. width: 390px;
  1271. height: 350px;
  1272. cursor: pointer;
  1273. border-radius: 10px;
  1274. overflow: hidden;
  1275. .project-box {
  1276. width: 390px;
  1277. height: 156px;
  1278. background: #ffffff;
  1279. border-radius: 10px;
  1280. margin-top: -20px;
  1281. z-index: 2;
  1282. position: absolute;
  1283. padding: 20px;
  1284. }
  1285. img {
  1286. width: 390px;
  1287. height: 180px;
  1288. }
  1289. .project1 {
  1290. font-weight: 600;
  1291. font-size: 16px;
  1292. color: #101828;
  1293. margin-bottom: 14px;
  1294. }
  1295. .project2 {
  1296. font-size: 14px;
  1297. color: #364153;
  1298. display: -webkit-box;
  1299. -webkit-line-clamp: 2;
  1300. line-clamp: 2;
  1301. /* 添加标准属性 */
  1302. -webkit-box-orient: vertical;
  1303. overflow: hidden;
  1304. text-overflow: ellipsis;
  1305. }
  1306. .project-more {
  1307. text-align: right;
  1308. font-size: 14px;
  1309. color: var(--el-color-primary);
  1310. margin-top: 18px;
  1311. }
  1312. }
  1313. }
  1314. }
  1315. </style>