index.vue 36 KB

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