index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651
  1. <template>
  2. <view class="center">
  3. <view class="top">
  4. <image class="top-bg" src="../../static/img/top-bg.png" mode=""></image>
  5. <view class="top-main flex">
  6. <view class="search-box flex" @click="clickSearch()">
  7. <image class="search" src="../../static/img/search.png" mode=""></image>
  8. <view class="search-font">输入关键词搜索</view>
  9. </view>
  10. </view>
  11. </view>
  12. <swiper class="carousel" autoplay="true" duration="400" interval="5000" @change="swiperChange">
  13. <swiper-item v-for="(item, index) in carouselList" :key="index" class="carousel-item" @click="bannerNavToUrl(item)"><image :src="item.pic" /></swiper-item>
  14. </swiper>
  15. <view class="tongz flex">
  16. <view>
  17. <view class="tongz-bg"><image src="../../static/img/tongz-bg.png" mode=""></image></view>
  18. <view class="tongz-left flex">
  19. <image class="image-left" src="../../static/img/ling.png" mode=""></image>
  20. <u-notice-bar
  21. style="width: 100%;"
  22. mode="vertical"
  23. type="none"
  24. :volume-icon="false"
  25. :more-icon="true"
  26. :list="text"
  27. @click="goDetails"
  28. @getMore="nav('/pages/index/message')"
  29. ></u-notice-bar>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="navbar flex">
  34. <view class="navbar-item" @click="nav('/pages/product/classify')">
  35. <image class="nitem-image" src="../../static/img/index-inco1.png" mode=""></image>
  36. <view class="nitem-font">随意嗨购</view>
  37. </view>
  38. <view class="navbar-item" @click="nav('/pages/product/classify')">
  39. <image class="nitem-image" src="../../static/img/index-inco2.png" mode=""></image>
  40. <view class="nitem-font">赠艺金券</view>
  41. </view>
  42. <view class="navbar-item" @click="nav('/pages/product/classify')">
  43. <image class="nitem-image" src="../../static/img/index-inco3.png" mode=""></image>
  44. <view class="nitem-font">置换</view>
  45. </view>
  46. <!-- <view class="navbar-item" @click="nav('/pages/product/classify')">
  47. <image class="nitem-image" src="../../static/img/index-inco4.png" mode=""></image>
  48. <view class="nitem-font">趣豆购</view>
  49. </view> -->
  50. <view class="navbar-item" @click="nav('/pages/product/seckill')">
  51. <image class="nitem-image" src="../../static/img/index-inco5.png" mode=""></image>
  52. <view class="nitem-font">秒杀</view>
  53. </view>
  54. <!-- <view class="navbar-item" @click="nav('/pages/product/zero')">
  55. <image class="nitem-image" src="../../static/img/index-inco6.png" mode=""></image>
  56. <view class="nitem-font">0元购</view>
  57. </view> -->
  58. <view class="navbar-item" @click="nav('/pages/store/store')">
  59. <image class="nitem-image" src="../../static/img/index-inco7.png" mode=""></image>
  60. <view class="nitem-font">服务专区</view>
  61. </view>
  62. <view class="navbar-item" @click="nav('/pages/hall/hall')">
  63. <image class="nitem-image" src="../../static/img/index-inco8.png" mode=""></image>
  64. <view class="nitem-font">大品牌区</view>
  65. </view>
  66. </view>
  67. <!-- <view class="product"><image class="product-image" src="../../static/img/index-product.png" mode=""></image></view> -->
  68. <view class="shingle">
  69. <view class="shingle-top flex">
  70. <view class="shingle-title">艺术品挂牌交易区</view>
  71. <view class="shingle-btn" @click="nav('/pages/hall/hall')">
  72. 查看更多趣豆会馆
  73. <text>></text>
  74. </view>
  75. </view>
  76. <view class="shingle-main" @click="nav('/pages/hall/halllist')">
  77. <view class="shingle-bg"><image src="../../static/img/sim-bg.png" mode=""></image></view>
  78. <view class="shinglem-title flex">
  79. <image class="tbg" src="../../static/img/tbg-left.png" mode=""></image>
  80. <view class="shinglemt-center">
  81. <image class="address" src="../../static/img/address.png" mode=""></image>
  82. <view class="shingle-font">浙江馆</view>
  83. </view>
  84. <image class="tbg" src="../../static/img/tbg-right.png" mode=""></image>
  85. </view>
  86. <view class="shingle-mmain flex">
  87. <view class="smmain-item">
  88. <view class="smitem-top">开放中</view>
  89. <view class="smitem-bottom">状态</view>
  90. </view>
  91. <view class="shu"></view>
  92. <view class="smmain-item">
  93. <view class="smitem-top">纯平</view>
  94. <view class="smitem-bottom">馆长</view>
  95. </view>
  96. <view class="shu"></view>
  97. <view class="smmain-item">
  98. <view class="people flex">
  99. <view class="peopleitem" v-for="item in 1"><image src="../../static/img/busy.png" mode=""></image></view>
  100. <view class="peopleitem" v-for="item in 4"><image src="../../static/img/leisure.png" mode=""></image></view>
  101. </view>
  102. <view class="smitem-bottom">流畅</view>
  103. </view>
  104. </view>
  105. <image class="right-bottom" src="../../static/img/right-bottom.png" mode=""></image>
  106. </view>
  107. </view>
  108. <view class="seckill-box">
  109. <view class="seckill-title flex">
  110. <view class="seckill-left flex">
  111. <image class="seckill-inco" src="../../static/img/seckill-inco.png" mode=""></image>
  112. <view class="seckill-font">限时秒杀</view>
  113. <view class="djs flex">
  114. <view>距结束:</view>
  115. <uni-countdowns
  116. color="#FFFFFF"
  117. splitor-color="#000000"
  118. background-color="#000000"
  119. border-color="#000000"
  120. :show-day="false"
  121. :hour="stopTime.stopTimeH"
  122. :minute="stopTime.stopTimeM"
  123. :second="stopTime.stopTimeS"
  124. ></uni-countdowns>
  125. </view>
  126. </view>
  127. <view class="seckill-right" @click="nav('/pages/product/seckill')">
  128. <view class="seckill-rfont">更多</view>
  129. <image class="seckill-back" src="../../static/img/back.png" mode=""></image>
  130. </view>
  131. </view>
  132. <view class="seckill-main-box flex">
  133. <view class="seckill-item" v-for="(item, index) in 3" :key="index">
  134. <image class="item-price" src="" mode=""></image>
  135. <view class="clamp item-title">护肤品套装</view>
  136. <view class="jdt"><u-line-progress :percent="bzb" activeColor="#F13A88"></u-line-progress></view>
  137. <view class="price-box flex">
  138. <view class="new-price">¥69.9</view>
  139. <view class="ot-price">¥89.9</view>
  140. </view>
  141. </view>
  142. </view>
  143. </view>
  144. <view class="ge"></view>
  145. <view class="serve">
  146. <view class="seckill-title flex">
  147. <view class="seckill-left flex">
  148. <image class="seckill-inco" src="../../static/img/serve.png" mode=""></image>
  149. <view class="seckill-font">服务专区推荐</view>
  150. </view>
  151. <view class="seckill-right" @click="nav('/pages/store/store')">
  152. <view class="seckill-rfont">更多</view>
  153. <image class="seckill-back" src="../../static/img/back.png" mode=""></image>
  154. </view>
  155. </view>
  156. <view class="serve-main flex">
  157. <view class="serve-item" @click="nav('/pages/store/store')" v-for="(item, index) in 3" :key="index">
  158. <image class="serve-price" src="" mode=""></image>
  159. <view class="clamp serve-title">护肤品套装</view>
  160. <view class="serve-address flex">
  161. <image class="saddress-inco" src="../../static/img/address.png" mode=""></image>
  162. <view class="saddress-font">距离0.3KM</view>
  163. </view>
  164. </view>
  165. </view>
  166. </view>
  167. <u-tabbar activeColor="#f42b4e" v-model="current" :list="tabbar"></u-tabbar>
  168. </view>
  169. </template>
  170. <script>
  171. import { tabbar1 } from '@/utils/tabbar.js';
  172. import { loadIndexs } from '@/api/index.js';
  173. import uniCountdowns from '@/components/uni-countdown/uni-countdowns.vue';
  174. export default {
  175. components: {
  176. uniCountdowns
  177. },
  178. data() {
  179. return {
  180. current: 0,
  181. tabbar: tabbar1,
  182. titleNViewBackground: '',
  183. swiperCurrent: 0,
  184. swiperLength: 0,
  185. dataList: '',
  186. carouselList: [], //轮播图列表
  187. text: ['恭喜黑白灰用户拼团成功¥353元!', '恭喜黑白灰用户拼团成功¥353元!'],
  188. stopTime: {
  189. stopTimeH: 0,
  190. stopTimeM: 24,
  191. stopTimeS: 59
  192. },
  193. bzb: 30
  194. };
  195. },
  196. onLoad() {
  197. this.loadData();
  198. },
  199. methods: {
  200. loadData() {
  201. loadIndexs({})
  202. .then(({ data }) => {
  203. let goods = data.info;
  204. this.dataList = goods.bastList; //精品推荐
  205. this.carouselList = data.banner;
  206. })
  207. .catch(e => {});
  208. },
  209. goDetails(e) {
  210. console.log(e, '123456');
  211. uni.navigateTo({
  212. url: '/pages/index/messageInfo'
  213. });
  214. },
  215. nav(url) {
  216. uni.navigateTo({
  217. url,
  218. fail() {
  219. uni.switchTab({
  220. url
  221. });
  222. }
  223. });
  224. },
  225. //轮播图切换修改背景色
  226. swiperChange(e) {
  227. const index = e.detail.current;
  228. this.swiperCurrent = index;
  229. this.titleNViewBackground = this.carouselList[index].background;
  230. },
  231. // 點擊搜索框
  232. clickSearch() {
  233. uni.navigateTo({
  234. url: '/pages/product/search'
  235. });
  236. },
  237. //详情页
  238. navToDetailPage(item) {
  239. let id = item.id;
  240. uni.navigateTo({
  241. url: '/pages/product/product?id=' + id
  242. });
  243. }
  244. }
  245. };
  246. </script>
  247. <style lang="scss">
  248. page,
  249. .center {
  250. min-height: 100%;
  251. height: auto;
  252. background: #ffffff;
  253. }
  254. .top {
  255. position: relative;
  256. width: 100%;
  257. height: 400rpx;
  258. .top-bg {
  259. position: absolute;
  260. top: 0;
  261. left: 0;
  262. right: 0;
  263. width: 100%;
  264. height: 100%;
  265. }
  266. .top-main {
  267. position: relative;
  268. z-index: 2;
  269. padding: 30rpx;
  270. .search-box {
  271. justify-content: center;
  272. width: 698rpx;
  273. height: 60rpx;
  274. background: rgba(255, 240, 245, 0.4);
  275. box-shadow: 0px 10rpx 20rpx 0px rgba(4, 114, 69, 0.22);
  276. border-radius: 30rpx;
  277. .search {
  278. width: 34rpx;
  279. height: 34rpx;
  280. }
  281. .search-font {
  282. margin-left: 14rpx;
  283. font-size: 28rpx;
  284. font-family: PingFang SC;
  285. font-weight: 500;
  286. color: #ffffff;
  287. }
  288. }
  289. }
  290. }
  291. .carousel {
  292. width: 700rpx;
  293. height: 300rpx;
  294. margin: -260rpx auto 0;
  295. image {
  296. width: 700rpx;
  297. height: 300rpx;
  298. }
  299. }
  300. .tongz {
  301. width: 690rpx;
  302. height: 70rpx;
  303. margin: 32rpx auto 0;
  304. padding: 18rpx 30rpx 18rpx 24rpx;
  305. align-items: center;
  306. position: relative;
  307. .tongz-bg {
  308. position: absolute;
  309. top: 0;
  310. right: 0;
  311. left: 0;
  312. width: 690rpx;
  313. height: 70rpx;
  314. image {
  315. width: 100%;
  316. height: 100%;
  317. }
  318. }
  319. .tongz-left {
  320. width: 640rpx;
  321. .image-left {
  322. width: 28rpx;
  323. height: 34rpx;
  324. }
  325. .tongz-font {
  326. margin-left: 22rpx;
  327. font-size: 28rpx;
  328. font-family: Source Han Sans CN;
  329. font-weight: 400;
  330. color: #0f253a;
  331. }
  332. }
  333. .tongz-right {
  334. position: relative;
  335. z-index: 11;
  336. width: 12rpx;
  337. height: 26rpx;
  338. image {
  339. width: 100%;
  340. height: 100%;
  341. }
  342. }
  343. }
  344. .navbar {
  345. justify-content: flex-start;
  346. flex-wrap: wrap;
  347. .navbar-item {
  348. margin-top: 42rpx;
  349. width: 25%;
  350. display: flex;
  351. flex-direction: column;
  352. align-items: center;
  353. .nitem-image {
  354. width: 90rpx;
  355. height: 90rpx;
  356. }
  357. .nitem-font {
  358. font-size: 24rpx;
  359. font-family: PingFang SC;
  360. font-weight: 500;
  361. color: #0c1732;
  362. }
  363. }
  364. }
  365. .product {
  366. width: 662rpx;
  367. height: 180rpx;
  368. margin: 44rpx auto;
  369. .product-image {
  370. width: 662rpx;
  371. height: 180rpx;
  372. }
  373. }
  374. .shingle {
  375. width: 750rpx;
  376. background: #f8f8f8;
  377. border-radius: 10rpx;
  378. margin: 60rpx auto 0rpx;
  379. padding: 44rpx 50rpx 40rpx;
  380. .shingle-top {
  381. padding-left: 2rpx;
  382. .shingle-title {
  383. font-size: 36rpx;
  384. font-family: PingFang SC;
  385. font-weight: bold;
  386. color: #dc262b;
  387. }
  388. .shingle-btn {
  389. width: 248rpx;
  390. height: 50rpx;
  391. border: 2rpx solid #dc262b;
  392. border-radius: 10rpx;
  393. padding: 0 16rpx;
  394. text-align: left;
  395. font-size: 24rpx;
  396. font-family: PingFang SC;
  397. font-weight: 500;
  398. color: #dc262b;
  399. line-height: 50rpx;
  400. text {
  401. display: inline-block;
  402. padding-left: 10rpx;
  403. }
  404. }
  405. }
  406. .shingle-main {
  407. margin: 20rpx auto;
  408. width: 650rpx;
  409. height: 206rpx;
  410. position: relative;
  411. .shingle-bg {
  412. position: absolute;
  413. top: 0;
  414. left: 0;
  415. right: 0;
  416. width: 650rpx;
  417. height: 206rpx;
  418. image {
  419. width: 650rpx;
  420. height: 206rpx;
  421. }
  422. }
  423. .shinglem-title {
  424. position: relative;
  425. z-index: 2;
  426. justify-content: center;
  427. height: 70rpx;
  428. .tbg {
  429. height: 70rpx;
  430. width: 40rpx;
  431. }
  432. .shinglemt-center {
  433. display: flex;
  434. align-items: center;
  435. background: rgba(220,38,43,0.66);
  436. }
  437. .address {
  438. width: 28rpx;
  439. height: 30rpx;
  440. }
  441. .shingle-font {
  442. font-size: 36rpx;
  443. font-family: PingFang SC;
  444. font-weight: bold;
  445. color: #ffffff;
  446. line-height: 70rpx;
  447. margin-left: 14rpx;
  448. }
  449. }
  450. .shingle-mmain {
  451. position: relative;
  452. z-index: 2;
  453. margin-top: 30rpx;
  454. .smmain-item {
  455. width: 33%;
  456. display: flex;
  457. flex-direction: column;
  458. align-items: center;
  459. .smitem-top {
  460. font-size: 30rpx;
  461. font-family: PingFang SC;
  462. font-weight: bold;
  463. color: #ffffff;
  464. }
  465. .smitem-bottom {
  466. margin-top: 10rpx;
  467. font-size: 30rpx;
  468. font-family: PingFang SC;
  469. font-weight: 500;
  470. color: #ffffff;
  471. }
  472. .people {
  473. justify-content: center;
  474. .peopleitem {
  475. width: 24rpx;
  476. height: 34rpx;
  477. image {
  478. width: 100%;
  479. height: 100%;
  480. }
  481. }
  482. }
  483. }
  484. .shu {
  485. width: 2rpx;
  486. height: 70rpx;
  487. background: #ffffff;
  488. }
  489. }
  490. .right-bottom {
  491. position: absolute;
  492. z-index: 2;
  493. right: 0;
  494. bottom: 0;
  495. width: 94rpx;
  496. height: 92rpx;
  497. }
  498. }
  499. }
  500. .seckill-left {
  501. justify-content: flex-start;
  502. .seckill-inco {
  503. width: 36rpx;
  504. height: 36rpx;
  505. flex-shrink: 0;
  506. }
  507. .seckill-font {
  508. margin-left: 8rpx;
  509. font-size: 32rpx;
  510. font-family: PingFang SC;
  511. font-weight: bold;
  512. color: #333333;
  513. }
  514. .djs {
  515. margin-left: 12rpx;
  516. font-size: 20rpx;
  517. font-family: PingFang SC;
  518. font-weight: bold;
  519. color: #dc262b;
  520. }
  521. }
  522. .seckill-right {
  523. display: flex;
  524. justify-content: flex-start;
  525. align-items: center;
  526. .seckill-rfont {
  527. font-size: 24rpx;
  528. font-family: PingFang SC;
  529. font-weight: 500;
  530. color: #999999;
  531. margin-right: 8rpx;
  532. }
  533. .seckill-back {
  534. width: 10rpx;
  535. height: 20rpx;
  536. }
  537. }
  538. .seckill-box {
  539. padding: 40rpx 30rpx;
  540. background: #ffffff;
  541. .seckill-main-box {
  542. margin-top: 24rpx;
  543. flex-wrap: wrap;
  544. justify-content: flex-start;
  545. .seckill-item:first-child {
  546. margin-left: 0rpx;
  547. }
  548. .seckill-item {
  549. margin-left: 14rpx;
  550. width: 220rpx;
  551. background: #ffffff;
  552. border: 4rpx solid #f2e6a5;
  553. border-radius: 10rpx;
  554. padding: 40rpx 14rpx 34rpx;
  555. display: flex;
  556. justify-content: center;
  557. flex-direction: column;
  558. align-items: center;
  559. .item-price {
  560. width: 126rpx;
  561. height: 108rpx;
  562. background: #2979ff;
  563. }
  564. .item-title {
  565. margin-top: 20rpx;
  566. text-align: left;
  567. width: 100%;
  568. }
  569. .jdt {
  570. margin-top: 14rpx;
  571. width: 100%;
  572. }
  573. .price-box {
  574. margin-top: 20rpx;
  575. .new-price {
  576. font-size: 32rpx;
  577. font-family: PingFang SC;
  578. font-weight: 800;
  579. color: #dc262b;
  580. }
  581. .ot-price {
  582. margin-left: 8rpx;
  583. font-size: 24rpx;
  584. font-family: PingFang SC;
  585. font-weight: 500;
  586. text-decoration: line-through;
  587. color: #969696;
  588. }
  589. }
  590. }
  591. }
  592. }
  593. .ge {
  594. height: 20rpx;
  595. width: 750rpx;
  596. background: #f8f8f8;
  597. }
  598. .serve {
  599. padding: 32rpx 30rpx;
  600. background: #ffffff;
  601. .serve-main {
  602. margin-top: 24rpx;
  603. flex-wrap: wrap;
  604. justify-content: flex-start;
  605. .serve-item:first-child {
  606. margin-left: 0rpx;
  607. }
  608. .serve-item {
  609. width: 220rpx;
  610. background: #f6f6f6;
  611. border-radius: 10rpx;
  612. margin-left: 14rpx;
  613. padding-bottom: 22rpx;
  614. .serve-price {
  615. width: 220rpx;
  616. height: 220rpx;
  617. border-radius: 10rpx 10rpx 0px 0px;
  618. background: #03a9f4;
  619. }
  620. .serve-title {
  621. margin-top: 16rpx;
  622. padding: 0 14rpx;
  623. font-size: 26rpx;
  624. font-family: PingFang SC;
  625. font-weight: 500;
  626. color: #0a122b;
  627. }
  628. .serve-address {
  629. justify-content: flex-start;
  630. margin-top: 10rpx;
  631. padding: 0 14rpx;
  632. .saddress-inco {
  633. width: 18rpx;
  634. height: 24rpx;
  635. }
  636. .saddress-font {
  637. margin-left: 4rpx;
  638. font-size: 20rpx;
  639. font-family: PingFang SC;
  640. font-weight: 500;
  641. color: #666666;
  642. }
  643. }
  644. }
  645. }
  646. }
  647. </style>