index.vue 36 KB

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