index_mall.vue 25 KB

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