index_mall.vue 24 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118
  1. <template>
  2. <view>
  3. <headerSerch :dataConfig="headItem"></headerSerch>
  4. <view class="header-group">
  5. <view class="tabs">
  6. <u-tabs :list="navigationList" @click="clickNav" lineColor="#FFD373" :inactiveStyle="{ color: '#FFF' }"
  7. :activeStyle="{ color: '#FFD373', fontWeight: 'bold' }" keyName="title"></u-tabs>
  8. </view>
  9. </view>
  10. <!-- 内容切换 -->
  11. <view class="tab-content" v-if="current == 0">
  12. <!-- 轮播 -->
  13. <view class="swiper-group">
  14. <u-swiper :list="swiperList" indicator indicatorMode="line" circular></u-swiper>
  15. </view>
  16. <!-- 宫格 -->
  17. <view class="grid-box">
  18. <view class="grid-group">
  19. <view class="grid-item">
  20. <image src="../../../static/menus/秒杀专区.png" mode="aspectFit" @click="menusTap('秒杀专区',0)"></image>
  21. <text>秒杀专区</text>
  22. </view>
  23. <view class="grid-item">
  24. <image src="../../../static/menus/红包商城.png" mode="aspectFit" @click="menusTap('红包商城',3)"></image>
  25. <text>红包商城</text>
  26. </view>
  27. <view class="grid-item">
  28. <image src="../../../static/menus/积分专区.png" mode="aspectFit" @click="menusTap('积分专区',1)"></image>
  29. <text>积分专区</text>
  30. </view>
  31. <view class="grid-item">
  32. <image src="../../../static/menus/创客专区.png" mode="aspectFit" @click="menusTap('创客专区',4)"></image>
  33. <text>创客专区</text>
  34. </view>
  35. <view class="grid-item">
  36. <image src="../../../static/menus/城市合伙人.png" mode="aspectFit" @click="menusTap('城市合伙人',5)">
  37. </image>
  38. <text>城市合伙人</text>
  39. </view>
  40. <view class="grid-item">
  41. <image src="../../../static/menus/积分抵扣专区.png" mode="aspectFit" @click="menusTap('积分抵扣专区',2)">
  42. </image>
  43. <text>抵扣专区</text>
  44. </view>
  45. </view>
  46. </view>
  47. <!-- 通知 -->
  48. <view class="notice">
  49. <u-notice-bar :text="notice" direction="column" duration="3000" @click="goNoticeDetail($event)">
  50. </u-notice-bar>
  51. </view>
  52. <!-- 通知弹框 -->
  53. <view>
  54. <u-modal :show="noticeShow" title="通告" confirmText="我已知晓" confirmColor="#FABA59" @confirm="noticeClose">
  55. <view class="slot-content">
  56. <rich-text :nodes="noticeContent"></rich-text>
  57. </view>
  58. </u-modal>
  59. </view>
  60. <!-- 爆款专区 -->
  61. <view class="sale-group">
  62. <view class="sale-content">
  63. <view class="title">爆款专区 <view class="more">
  64. </view>
  65. </view>
  66. <view class="goods-scroll">
  67. <scroll-view scroll-x="true" v-if="tempArrBao.length > 0">
  68. <view class="goods-item" v-for="(item, index) in tempArrBao" :key="index"
  69. @click="goDetail(item)">
  70. <image :src="item.goodsCover" mode="aspectFit"></image>
  71. <view class="goods-name">
  72. <u-text prefixIcon="bookmark"
  73. iconStyle="font-size: 16px; color:red;min-height: 30px;" :lines="2" bold block
  74. size="12" :text="item.goodsName"></u-text>
  75. <view class="tags">赠送{{ item.obtainIntegral }}红积分</view>
  76. <view class="price">¥{{ item.salePrice - 0 }}</view>
  77. </view>
  78. </view>
  79. </scroll-view>
  80. <u-empty v-else mode="list" icon="http://cdn.uviewui.com/uview/empty/list.png"/>
  81. </view>
  82. </view>
  83. </view>
  84. <!-- 商品推荐列表 -->
  85. <view class="goods-list">
  86. <view class="title">
  87. <view class="line"></view>
  88. 商品推荐
  89. <view class="line"></view>
  90. </view>
  91. <goodListMall @changeTab="changeTab" :tempArr="tempArr" :iSshowH="false" @detail="goDetail"
  92. :isSortType="isSortType"></goodListMall>
  93. </view>
  94. </view>
  95. <view class="tab-content" v-show="current >= 1">
  96. <!-- 轮播 -->
  97. <view class="swiper-group">
  98. <u-swiper :list="swiperTabList" indicator indicatorMode="line" circular></u-swiper>
  99. </view>
  100. <!-- 商品列表 -->
  101. <goodListMall @changeTab="changeTab" :iSshowH="true" @detail="goDetail" :currentId="currentId"
  102. :isSortType="isSortType"></goodListMall>
  103. </view>
  104. </view>
  105. </template>
  106. <script>
  107. import headerSerch from './components/headerSerch';
  108. import goodListMall from './components/goodListMall';
  109. import {
  110. toLogin
  111. } from '@/libs/login.js';
  112. import {
  113. mapGetters
  114. } from "vuex";
  115. import { getAdsList, getNoticeList, getCategoryOne, getGoodsPage, getIndexData, getGoodsInfo } from '../../../api/home.js'
  116. import {
  117. goShopDetail
  118. } from '@/libs/order.js';
  119. export default {
  120. components: {
  121. headerSerch,
  122. goodListMall
  123. },
  124. data() {
  125. return {
  126. currentId: '',
  127. noticeShow: false,
  128. noticeContent: '',
  129. tempArr: [],
  130. tempArrBao: [
  131. {
  132. "id": 72,
  133. "image": "https://demo26.crmeb.net/uploads/attach/2021/11/20211112/mid_1608a6e46f559f11328c544fa05ea10b.png",
  134. "store_name": "COACH/蔻驰女士swinger腋下包单肩包麻将包豌豆包",
  135. "store_info": "COACH/蔻驰女士swinger腋下包单肩包麻将包豌豆包",
  136. "cate_id": "79",
  137. "price": "3000.00",
  138. "ot_price": "2900.00",
  139. "sales": "226",
  140. "unit_name": "件",
  141. "sort": 446,
  142. "activity": [],
  143. "stock": 258,
  144. "vip_price": 0,
  145. "is_vip": 0,
  146. "couponId": [],
  147. "star": [
  148. {
  149. "product_score": 5,
  150. "product_id": 72
  151. }
  152. ],
  153. "checkCoupon": false
  154. },
  155. {
  156. "id": 119,
  157. "image": "https://demo26.crmeb.net/uploads/attach/2021/12/10/mid_738c68638ab29effeff2e98365ec6dd6.jpg",
  158. "store_name": "微星(MSI)GK50Z 机械键盘 红轴 RGB光效 有线 游戏电竞办公键盘 104键 吃鸡键盘 黑色",
  159. "store_info": "ceshi123",
  160. "cate_id": "38",
  161. "price": "0.01",
  162. "ot_price": "199.00",
  163. "sales": "135",
  164. "unit_name": "件",
  165. "sort": 999,
  166. "activity": [],
  167. "stock": 24855,
  168. "vip_price": 0,
  169. "is_vip": 0,
  170. "couponId": [
  171. {
  172. "id": 23,
  173. "product_id": 119,
  174. "issue_coupon_id": 218,
  175. "title": "",
  176. "add_time": 1664522680
  177. }
  178. ],
  179. "star": [
  180. {
  181. "product_score": 5,
  182. "product_id": 119
  183. },
  184. {
  185. "product_score": 5,
  186. "product_id": 119
  187. },
  188. {
  189. "product_score": 5,
  190. "product_id": 119
  191. },
  192. {
  193. "product_score": 4,
  194. "product_id": 119
  195. },
  196. {
  197. "product_score": 4,
  198. "product_id": 119
  199. },
  200. {
  201. "product_score": 5,
  202. "product_id": 119
  203. },
  204. {
  205. "product_score": 5,
  206. "product_id": 119
  207. },
  208. {
  209. "product_score": 5,
  210. "product_id": 119
  211. },
  212. {
  213. "product_score": 5,
  214. "product_id": 119
  215. },
  216. {
  217. "product_score": 4,
  218. "product_id": 119
  219. },
  220. {
  221. "product_score": 5,
  222. "product_id": 119
  223. },
  224. {
  225. "product_score": 2,
  226. "product_id": 119
  227. },
  228. {
  229. "product_score": 5,
  230. "product_id": 119
  231. },
  232. {
  233. "product_score": 5,
  234. "product_id": 119
  235. },
  236. {
  237. "product_score": 5,
  238. "product_id": 119
  239. },
  240. {
  241. "product_score": 5,
  242. "product_id": 119
  243. },
  244. {
  245. "product_score": 5,
  246. "product_id": 119
  247. },
  248. {
  249. "product_score": 3,
  250. "product_id": 119
  251. },
  252. {
  253. "product_score": 5,
  254. "product_id": 119
  255. },
  256. {
  257. "product_score": 5,
  258. "product_id": 119
  259. },
  260. {
  261. "product_score": 5,
  262. "product_id": 119
  263. },
  264. {
  265. "product_score": 5,
  266. "product_id": 119
  267. },
  268. {
  269. "product_score": 5,
  270. "product_id": 119
  271. },
  272. {
  273. "product_score": 5,
  274. "product_id": 119
  275. },
  276. {
  277. "product_score": 5,
  278. "product_id": 119
  279. },
  280. {
  281. "product_score": 5,
  282. "product_id": 119
  283. },
  284. {
  285. "product_score": 5,
  286. "product_id": 119
  287. },
  288. {
  289. "product_score": 4,
  290. "product_id": 119
  291. },
  292. {
  293. "product_score": 4,
  294. "product_id": 119
  295. },
  296. {
  297. "product_score": 3,
  298. "product_id": 119
  299. },
  300. {
  301. "product_score": 4,
  302. "product_id": 119
  303. },
  304. {
  305. "product_score": 5,
  306. "product_id": 119
  307. },
  308. {
  309. "product_score": 4,
  310. "product_id": 119
  311. },
  312. {
  313. "product_score": 5,
  314. "product_id": 119
  315. },
  316. {
  317. "product_score": 5,
  318. "product_id": 119
  319. },
  320. {
  321. "product_score": 4,
  322. "product_id": 119
  323. },
  324. {
  325. "product_score": 5,
  326. "product_id": 119
  327. },
  328. {
  329. "product_score": 5,
  330. "product_id": 119
  331. },
  332. {
  333. "product_score": 5,
  334. "product_id": 119
  335. },
  336. {
  337. "product_score": 4,
  338. "product_id": 119
  339. },
  340. {
  341. "product_score": 5,
  342. "product_id": 119
  343. },
  344. {
  345. "product_score": 5,
  346. "product_id": 119
  347. },
  348. {
  349. "product_score": 5,
  350. "product_id": 119
  351. },
  352. {
  353. "product_score": 4,
  354. "product_id": 119
  355. },
  356. {
  357. "product_score": 5,
  358. "product_id": 119
  359. },
  360. {
  361. "product_score": 4,
  362. "product_id": 119
  363. },
  364. {
  365. "product_score": 5,
  366. "product_id": 119
  367. },
  368. {
  369. "product_score": 5,
  370. "product_id": 119
  371. },
  372. {
  373. "product_score": 5,
  374. "product_id": 119
  375. },
  376. {
  377. "product_score": 5,
  378. "product_id": 119
  379. },
  380. {
  381. "product_score": 5,
  382. "product_id": 119
  383. },
  384. {
  385. "product_score": 5,
  386. "product_id": 119
  387. },
  388. {
  389. "product_score": 2,
  390. "product_id": 119
  391. },
  392. {
  393. "product_score": 5,
  394. "product_id": 119
  395. },
  396. {
  397. "product_score": 5,
  398. "product_id": 119
  399. },
  400. {
  401. "product_score": 5,
  402. "product_id": 119
  403. },
  404. {
  405. "product_score": 5,
  406. "product_id": 119
  407. },
  408. {
  409. "product_score": 5,
  410. "product_id": 119
  411. },
  412. {
  413. "product_score": 5,
  414. "product_id": 119
  415. },
  416. {
  417. "product_score": 5,
  418. "product_id": 119
  419. }
  420. ],
  421. "checkCoupon": false
  422. },
  423. {
  424. "id": 41,
  425. "image": "http://demo26.crmeb.net/uploads/attach/2020/10/13/a23b5bc300cc6a965082368f8c657b3d.jpg",
  426. "store_name": "华为智选摄像头智能家居监控器无线高清网络摄像头家用全景智能摄像机1080P夜间清晰人像AI智能看护",
  427. "store_info": "华为智选摄像头智能家居监控器无线高清网络摄像头家用全景智能摄像机1080P夜间清晰人像AI智能看护",
  428. "cate_id": "11,21",
  429. "price": "500.00",
  430. "ot_price": "1000.00",
  431. "sales": "94",
  432. "unit_name": "件",
  433. "sort": 0,
  434. "activity": [],
  435. "stock": 1981,
  436. "vip_price": 0,
  437. "is_vip": 0,
  438. "couponId": [],
  439. "star": [],
  440. "checkCoupon": false
  441. },
  442. {
  443. "id": 51,
  444. "image": "http://demo26.crmeb.net/uploads/attach/2020/10/20201014/118bccc3d5499881dd7178c43ebb9346.jpg",
  445. "store_name": "极度空间 中秋贺卡 生日卡片 创意3D明信片感恩卡*10",
  446. "store_info": "极度空间 中秋贺卡 生日卡片 创意3D明信片感恩卡*10",
  447. "cate_id": "40,34",
  448. "price": "100.00",
  449. "ot_price": "1000.00",
  450. "sales": "39",
  451. "unit_name": "件",
  452. "sort": 0,
  453. "activity": [],
  454. "stock": 761,
  455. "vip_price": 0,
  456. "is_vip": 0,
  457. "couponId": [],
  458. "star": [
  459. {
  460. "product_score": 5,
  461. "product_id": 51
  462. }
  463. ],
  464. "checkCoupon": true
  465. },
  466. {
  467. "id": 89,
  468. "image": "https://demo26.crmeb.net/uploads/attach/2021/11/20211113/mid_2fbe723632427b0768df24c4f23c6cad.png",
  469. "store_name": "家居梵高系列联名款饭盒袋大容量手拎保温实用方便 星月夜饭盒袋",
  470. "store_info": "",
  471. "cate_id": "35",
  472. "price": "350.00",
  473. "ot_price": "300.00",
  474. "sales": "19",
  475. "unit_name": "件",
  476. "sort": 553,
  477. "activity": [],
  478. "stock": 185,
  479. "vip_price": 0,
  480. "is_vip": 0,
  481. "couponId": [],
  482. "star": [
  483. {
  484. "product_score": 5,
  485. "product_id": 89
  486. }
  487. ],
  488. "checkCoupon": false
  489. },
  490. {
  491. "id": 45,
  492. "image": "http://demo26.crmeb.net/uploads/attach/2020/10/20201014/1bfcaad092adb917739ec681f55fb255.jpg",
  493. "store_name": "Adidas阿迪达斯男装 2020秋季新款运动服户外跑步训练健身透气舒适时尚休闲夹克外套GD5462 GD5462 L",
  494. "store_info": "Adidas阿迪达斯男装 2020秋季新款运动服户外跑步训练健身透气舒适时尚休闲夹克外套GD5462 GD5462 L",
  495. "cate_id": "26,27,50,54",
  496. "price": "200.00",
  497. "ot_price": "500.00",
  498. "sales": "11",
  499. "unit_name": "件",
  500. "sort": 0,
  501. "activity": [],
  502. "stock": 4984,
  503. "vip_price": "120.00",
  504. "is_vip": 1,
  505. "couponId": [],
  506. "star": [
  507. {
  508. "product_score": 5,
  509. "product_id": 45
  510. },
  511. {
  512. "product_score": 5,
  513. "product_id": 45
  514. },
  515. {
  516. "product_score": 2,
  517. "product_id": 45
  518. }
  519. ],
  520. "checkCoupon": false
  521. },
  522. {
  523. "id": 71,
  524. "image": "https://demo26.crmeb.net/uploads/attach/2021/09/03/mid_0b209a475fe7a7118dc964407c98542c.jpg",
  525. "store_name": "Casio卡西欧女表时尚优雅简约指针防水复古石英手表LTP-1094E-1A",
  526. "store_info": "品质保障 全场包邮",
  527. "cate_id": "38",
  528. "price": "265.00",
  529. "ot_price": "265.00",
  530. "sales": "6",
  531. "unit_name": "件",
  532. "sort": 300,
  533. "activity": [],
  534. "stock": 94,
  535. "vip_price": 0,
  536. "is_vip": 0,
  537. "couponId": [],
  538. "star": [
  539. {
  540. "product_score": 5,
  541. "product_id": 71
  542. },
  543. {
  544. "product_score": 5,
  545. "product_id": 71
  546. },
  547. {
  548. "product_score": 5,
  549. "product_id": 71
  550. }
  551. ],
  552. "checkCoupon": false
  553. }
  554. ],
  555. isSortType: 0,
  556. headItem: {
  557. "name": "headerSerch",
  558. "timestamp": "1666235374470000",
  559. "setUp": {
  560. "tabVal": 0
  561. },
  562. "bgColor": {
  563. "title": "背景颜色(渐变)",
  564. "name": "bgColor",
  565. "default": [
  566. {
  567. "item": "#F62C2C"
  568. },
  569. {
  570. "item": "#F96E29"
  571. }
  572. ],
  573. "color": [
  574. {
  575. "item": "rgba(242,16,78,1)"
  576. },
  577. {
  578. "item": "rgba(210,41,87,1)"
  579. }
  580. ]
  581. },
  582. "boxStyle": {
  583. "title": "边框样式",
  584. "name": "boxStyle",
  585. "type": 0,
  586. "list": [
  587. {
  588. "val": "圆角",
  589. "icon": "iconPic_fillet"
  590. },
  591. {
  592. "val": "直角",
  593. "icon": "iconPic_square"
  594. }
  595. ]
  596. },
  597. "txtStyle": {
  598. "title": "文本位置",
  599. "name": "txtStyle",
  600. "type": 1,
  601. "list": [
  602. {
  603. "val": "居左",
  604. "icon": "icondoc_left"
  605. },
  606. {
  607. "val": "居中",
  608. "icon": "icondoc_center"
  609. }
  610. ]
  611. },
  612. "prConfig": {
  613. "title": "背景边距",
  614. "val": 8,
  615. "min": 0
  616. },
  617. "mbConfig": {
  618. "title": "页面间距",
  619. "val": 0,
  620. "min": 0
  621. },
  622. "hotWords": {
  623. "list": [
  624. {
  625. "val": ""
  626. }
  627. ]
  628. },
  629. "logoConfig": {
  630. "type": 1,
  631. "header": "设置logo",
  632. "title": "",
  633. "url": "https://demo26.crmeb.net/uploads/attach/2022/10/20221009/7436ee5680bc5d67c46a6017939475e5.png"
  634. },
  635. "id": "id1665385357481000"
  636. },
  637. current: 0,
  638. noticeList: [],
  639. notice: [
  640. '寒雨连江夜入吴',
  641. '平明送客楚山孤',
  642. '洛阳亲友如相问',
  643. '一片冰心在玉壶'
  644. ],
  645. swiperTabList: [
  646. 'https://cdn.uviewui.com/uview/swiper/swiper3.png',
  647. 'https://cdn.uviewui.com/uview/swiper/swiper2.png',
  648. 'https://cdn.uviewui.com/uview/swiper/swiper1.png',
  649. ],
  650. swiperList: [
  651. 'https://cdn.uviewui.com/uview/swiper/swiper3.png',
  652. 'https://cdn.uviewui.com/uview/swiper/swiper2.png',
  653. 'https://cdn.uviewui.com/uview/swiper/swiper1.png',
  654. ],
  655. navigationList: [{
  656. title: '推荐',
  657. id: '0'
  658. }]
  659. }
  660. },
  661. computed: mapGetters(['isLogin']),
  662. created() {
  663. this.getCategoryOne()
  664. this.getNoticeList()
  665. this.getAdsList()
  666. this.getBroGoodsInfo()
  667. this.getGoodsInfo()
  668. this.getAdsTabList()
  669. },
  670. onMounted(options) {
  671. },
  672. onLoad(options) {
  673. },
  674. onShow(){
  675. },
  676. updated(){
  677. },
  678. watch: {
  679. isLogin: {
  680. deep: true, //深度监听设置为 true
  681. handler: function (newV, oldV) {
  682. this.getCategoryOne()
  683. this.getNoticeList()
  684. this.getAdsList()
  685. this.getBroGoodsInfo()
  686. this.getGoodsInfo()
  687. this.getAdsTabList()
  688. }
  689. }
  690. },
  691. methods: {
  692. getGoodsInfo() {
  693. getGoodsInfo({
  694. current: 1,
  695. size: 50,
  696. isRecom: 1
  697. }).then(res => {
  698. this.tempArr = res.data
  699. })
  700. },
  701. getBroGoodsInfo() {
  702. getGoodsInfo({
  703. current: 1,
  704. size: 50,
  705. zoneType: 6
  706. }).then(res => {
  707. this.tempArrBao = res.data
  708. })
  709. },
  710. getCategoryOne() {
  711. getCategoryOne().then(res => {
  712. this.navigationList = []
  713. let tuiJian = {
  714. title: '推荐',
  715. id: '0'
  716. }
  717. this.navigationList = res.data
  718. this.navigationList.unshift(tuiJian)
  719. })
  720. },
  721. menusTap(url,zoneType) {
  722. // #ifdef H5
  723. location.href = url
  724. // #endif
  725. // #ifdef MP || APP-PLUS
  726. uni.navigateTo({
  727. url: "/pages/goods/goods_list_mall/index?zoneType=" + zoneType + "&title=" + url
  728. });
  729. // #endif
  730. },
  731. noticeClose() {
  732. this.noticeShow = false
  733. },
  734. goNoticeDetail(value) {
  735. this.noticeContent = this.noticeList[value].content
  736. this.noticeShow = true
  737. },
  738. getNoticeList() {
  739. getNoticeList().then(res => {
  740. this.notice = []
  741. this.noticeList = res.data
  742. res.data.forEach(element => {
  743. this.notice.push(element.title)
  744. });
  745. })
  746. },
  747. getAdsList() {
  748. getAdsList({
  749. type: 1
  750. }).then(res => {
  751. if (res.data.length > 0) {
  752. this.swiperList = []
  753. res.data.forEach(element => {
  754. this.swiperList.push(element.imageUrl)
  755. });
  756. }
  757. });
  758. },
  759. getAdsTabList() {
  760. getAdsList({
  761. type: 7
  762. }).then(res => {
  763. if (res.data.length > 0) {
  764. this.swiperTabList = []
  765. res.data.forEach(element => {
  766. this.swiperTabList.push(element.imageUrl)
  767. });
  768. }
  769. });
  770. },
  771. // 促销列表的点击事件;
  772. changeTab(type) {
  773. this.goodType = type;
  774. this.tempArr = [];
  775. this.page = 1;
  776. this.loadend = false;
  777. let onloadH = true;
  778. this.getGroomList(onloadH);
  779. },
  780. // 精品推荐
  781. getGroomList(onloadH) {
  782. let that = this;
  783. let type = that.goodType;
  784. if (that.loadend) return false;
  785. if (that.loading) return false;
  786. if (onloadH) {
  787. that.$set(that, 'iSshowH', true);
  788. }
  789. uni.request({
  790. url: 'api/groom/list',
  791. success: res => {
  792. that.$set(that, 'iSshowH', false);
  793. let maxPage = Math.ceil(this.numConfig / this.limit);
  794. let list = res.data.list,
  795. loadend = list.length < that.limit || that.page >= maxPage;
  796. let tempArr = that.$util.SplitArray(list, that.tempArr);
  797. that.$set(that, 'tempArr', tempArr.slice(0, this.numConfig));
  798. that.loadend = loadend;
  799. that.loadTitle = loadend ? that.$t(`没有更多内容啦~`) : that.$t(`加载更多`);
  800. that.page = that.page + 1;
  801. that.loading = false;
  802. }
  803. })
  804. // getGroomList(type, {
  805. // page: that.page,
  806. // limit: this.numConfig
  807. // })
  808. // .then(({
  809. // data
  810. // }) => {
  811. // that.$set(that, 'iSshowH', false);
  812. // let maxPage = Math.ceil(this.numConfig / this.limit);
  813. // let list = data.list,
  814. // loadend = list.length < that.limit || that.page >= maxPage;
  815. // let tempArr = that.$util.SplitArray(list, that.tempArr);
  816. // that.$set(that, 'tempArr', tempArr.slice(0, this.numConfig));
  817. // that.loadend = loadend;
  818. // that.loadTitle = loadend ? that.$t(`没有更多内容啦~`) : that.$t(`加载更多`);
  819. // that.page = that.page + 1;
  820. // that.loading = false;
  821. // })
  822. // .catch(res => {
  823. // that.loading = false;
  824. // that.loadTitle = that.$t(`加载更多`);
  825. // });
  826. },
  827. goDetail(item) {
  828. goShopDetail(item, this.$store.state.app.uid).then(res => {
  829. uni.navigateTo({
  830. url: `/pages/goods_details/index?id=${item.id}`
  831. });
  832. });
  833. },
  834. // 去商品详情
  835. goGoodsDetail(item) {
  836. goShopDetail(item, this.uid).then(res => {
  837. uni.navigateTo({
  838. url: `/pages/goods_details/index?id=${item.id}`
  839. });
  840. });
  841. },
  842. clickNav(e) {
  843. this.current = e.index
  844. if (e.index > 0) {
  845. this.currentId = e.id
  846. }
  847. }
  848. }
  849. }
  850. </script>
  851. <style lang="scss" scoped>
  852. page {
  853. background-color: #ee4040;
  854. }
  855. .header-group {
  856. background-color: #EB4C63;
  857. .search-group {
  858. display: flex;
  859. align-items: center;
  860. justify-content: space-between;
  861. padding: 30rpx 30rpx 10rpx 30rpx;
  862. .logo {
  863. width: 138rpx;
  864. height: 46rpx;
  865. }
  866. .message {
  867. line-height: 1;
  868. image {
  869. width: 48rpx;
  870. height: 48rpx;
  871. }
  872. }
  873. .search {
  874. flex: 1;
  875. padding: 0 30rpx;
  876. .searchBox {
  877. padding: 0 30rpx;
  878. display: flex;
  879. align-items: center;
  880. background-color: #FFF;
  881. border-radius: 100rpx;
  882. height: 60rpx;
  883. image {
  884. width: 28rpx;
  885. height: 28rpx;
  886. padding-right: 20rpx;
  887. }
  888. text {
  889. font-size: 24rpx;
  890. color: #999;
  891. }
  892. }
  893. }
  894. }
  895. .tabs {
  896. padding: 0 20rpx;
  897. }
  898. }
  899. .tab-content {
  900. .swiper-group {
  901. padding: 20rpx 30rpx 10rpx 30rpx;
  902. background-image: linear-gradient(to bottom, #EB4C63, #F9F9F9);
  903. }
  904. .grid-box {
  905. padding: 10rpx 30rpx 20rpx 30rpx;
  906. .grid-group {
  907. padding: 20rpx 0;
  908. border-radius: 20rpx;
  909. background-color: #FFF;
  910. display: flex;
  911. align-items: center;
  912. flex-wrap: wrap;
  913. .grid-item {
  914. width: 33.333%;
  915. display: flex;
  916. flex-direction: column;
  917. align-items: center;
  918. margin: 10rpx 0;
  919. image {
  920. width: 98rpx;
  921. height: 98rpx;
  922. }
  923. text {
  924. font-size: 24rpx;
  925. color: #666;
  926. margin-top: 10rpx;
  927. }
  928. }
  929. }
  930. }
  931. .notice {
  932. padding: 0 30rpx;
  933. }
  934. .sale-group {
  935. padding: 20rpx 30rpx;
  936. .sale-content {
  937. border-radius: 20rpx;
  938. background-image: linear-gradient(45deg, #EB4C63, #FFA470);
  939. padding: 20rpx 0;
  940. .title {
  941. display: flex;
  942. align-items: center;
  943. justify-content: space-between;
  944. color: #FFF;
  945. font-weight: bold;
  946. padding: 0 30rpx;
  947. .more {
  948. display: flex;
  949. align-items: center;
  950. font-size: 24rpx;
  951. font-weight: normal;
  952. image {
  953. width: 24rpx;
  954. height: 24rpx;
  955. }
  956. }
  957. }
  958. .goods-scroll {
  959. white-space: nowrap;
  960. padding: 20rpx 15rpx 0 15rpx;
  961. .goods-item {
  962. display: inline-block;
  963. width: 240rpx;
  964. padding: 15rpx;
  965. margin: 0 10rpx;
  966. background-color: #FFF;
  967. border-radius: 10rpx;
  968. image {
  969. width: 210rpx;
  970. height: 210rpx;
  971. }
  972. .goods-name {
  973. font-size: 26rpx;
  974. color: #333;
  975. width: 240rpx;
  976. margin: 6rpx 0;
  977. word-break: break-all;
  978. white-space: pre-wrap;
  979. text-overflow: ellipsis;
  980. display: -webkit-box;
  981. line-height: 1.2;
  982. -webkit-box-orient: vertical;
  983. -webkit-line-clamp: 2;
  984. overflow: hidden;
  985. }
  986. .tags {
  987. display: inline-block;
  988. font-size: 20rpx;
  989. padding: 6rpx;
  990. background-color: #FCE9EC;
  991. color: #EB4C63;
  992. margin: 6rpx 0;
  993. }
  994. .price {
  995. font-size: 32rpx;
  996. font-weight: bold;
  997. color: #EB4C63;
  998. }
  999. }
  1000. }
  1001. }
  1002. }
  1003. .goods-list {
  1004. .title {
  1005. text-align: center;
  1006. color: #333;
  1007. display: flex;
  1008. align-items: center;
  1009. justify-content: center;
  1010. font-size: 32rpx;
  1011. font-weight: bold;
  1012. .line {
  1013. display: inline-block;
  1014. width: 200rpx;
  1015. height: 2rpx;
  1016. margin: 0 30rpx;
  1017. background-color: #FFA470;
  1018. }
  1019. }
  1020. .list-group {
  1021. display: flex;
  1022. align-items: center;
  1023. flex-wrap: wrap;
  1024. padding: 15rpx;
  1025. box-sizing: border-box;
  1026. .list-item-content {
  1027. width: 50%;
  1028. padding: 15rpx;
  1029. box-sizing: border-box;
  1030. .list-item {
  1031. padding: 15rpx;
  1032. background-color: #FFF;
  1033. border-radius: 10rpx;
  1034. image {
  1035. width: 100%;
  1036. }
  1037. .goods-name {
  1038. font-size: 28rpx;
  1039. color: #333;
  1040. margin: 6rpx 0;
  1041. word-break: break-all;
  1042. white-space: pre-wrap;
  1043. text-overflow: ellipsis;
  1044. display: -webkit-box;
  1045. line-height: 1.4;
  1046. -webkit-box-orient: vertical;
  1047. -webkit-line-clamp: 2;
  1048. overflow: hidden;
  1049. }
  1050. .tags {
  1051. display: inline-block;
  1052. font-size: 20rpx;
  1053. padding: 6rpx;
  1054. background-color: #FCE9EC;
  1055. color: #EB4C63;
  1056. margin: 6rpx 0;
  1057. }
  1058. .price {
  1059. font-size: 32rpx;
  1060. font-weight: bold;
  1061. color: #EB4C63;
  1062. }
  1063. }
  1064. }
  1065. }
  1066. }
  1067. }
  1068. </style>