index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575
  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="navTo(list)">
  77. <view class="shingle-bg"><image :src="list.image" 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">{{list.name}}</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">{{list.nickname}}</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. <!-- 秒杀楼层 -->
  109. <seckill></seckill>
  110. <view class="ge"></view>
  111. <view class="serve">
  112. <view class="seckill-title flex">
  113. <view class="seckill-left flex">
  114. <image class="seckill-inco" src="../../static/img/serve.png" mode=""></image>
  115. <view class="seckill-font">服务专区推荐</view>
  116. </view>
  117. <view class="seckill-right" @click="nav('/pages/store/store')">
  118. <view class="seckill-rfont">更多</view>
  119. <image class="seckill-back" src="../../static/img/back.png" mode=""></image>
  120. </view>
  121. </view>
  122. <view class="serve-main flex">
  123. <view class="serve-item" @click="nav('/pages/store/store')" v-for="(item, index) in 3" :key="index">
  124. <image class="serve-price" src="" mode=""></image>
  125. <view class="clamp serve-title">护肤品套装</view>
  126. <view class="serve-address flex">
  127. <image class="saddress-inco" src="../../static/img/address.png" mode=""></image>
  128. <view class="saddress-font">距离0.3KM</view>
  129. </view>
  130. </view>
  131. </view>
  132. </view>
  133. <u-tabbar activeColor="#f42b4e" v-model="current" :list="tabbar"></u-tabbar>
  134. </view>
  135. </template>
  136. <script>
  137. import { tabbar1 } from '@/utils/tabbar.js';
  138. import seckill from '../../components/seckill/seckill.vue';
  139. import { article } from '@/api/user.js'
  140. import { loadIndexs } from '@/api/index.js';
  141. import uniCountdowns from '@/components/uni-countdown/uni-countdowns.vue';
  142. import { auction_gu } from '@/api/hall.js';
  143. export default {
  144. components: {
  145. seckill,
  146. uniCountdowns
  147. },
  148. data() {
  149. return {
  150. current: 0,
  151. tabbar: tabbar1,
  152. titleNViewBackground: '',
  153. swiperCurrent: 0,
  154. swiperLength: 0,
  155. dataList: '',
  156. carouselList: [], //轮播图列表
  157. text: [],
  158. article:[],
  159. list:{},
  160. };
  161. },
  162. onLoad() {
  163. this.loadData();
  164. },
  165. methods: {
  166. loadData() {
  167. article({},1).then(({data}) =>{
  168. data.forEach(e =>{
  169. this.text.push(e.synopsis)
  170. })
  171. this.article = data
  172. })
  173. auction_gu({pages:1,limit:1}).then(({data}) =>{
  174. this.list = data[0]
  175. }).catch(e =>{
  176. console.log(e);
  177. })
  178. loadIndexs({})
  179. .then(({ data }) => {
  180. let goods = data.info;
  181. this.dataList = goods.bastList; //精品推荐
  182. this.carouselList = data.banner;
  183. })
  184. .catch(e => {});
  185. },
  186. goDetails(e) {
  187. uni.navigateTo({
  188. url: '/pages/index/messageInfo?id=' + this.article[e].id
  189. });
  190. },
  191. nav(url) {
  192. uni.navigateTo({
  193. url,
  194. fail() {
  195. uni.switchTab({
  196. url
  197. });
  198. }
  199. });
  200. },
  201. //轮播图切换修改背景色
  202. swiperChange(e) {
  203. const index = e.detail.current;
  204. this.swiperCurrent = index;
  205. this.titleNViewBackground = this.carouselList[index].background;
  206. },
  207. // 點擊搜索框
  208. clickSearch() {
  209. uni.navigateTo({
  210. url: '/pages/product/search'
  211. });
  212. },
  213. navTo(item){
  214. uni.navigateTo({
  215. url: "/pages/hall/halllist?id=" + item.id + '&name=' + item.name + '&peoplename=' + item.nickname
  216. })
  217. },
  218. //详情页
  219. navToDetailPage(item) {
  220. let id = item.id;
  221. uni.navigateTo({
  222. url: '/pages/product/product?id=' + id
  223. });
  224. }
  225. }
  226. };
  227. </script>
  228. <style lang="scss">
  229. page,
  230. .center {
  231. min-height: 100%;
  232. height: auto;
  233. background: #ffffff;
  234. }
  235. .top {
  236. position: relative;
  237. width: 100%;
  238. height: 400rpx;
  239. .top-bg {
  240. position: absolute;
  241. top: 0;
  242. left: 0;
  243. right: 0;
  244. width: 100%;
  245. height: 100%;
  246. }
  247. .top-main {
  248. position: relative;
  249. z-index: 2;
  250. padding: 30rpx;
  251. .search-box {
  252. justify-content: center;
  253. width: 698rpx;
  254. height: 60rpx;
  255. background: rgba(255, 240, 245, 0.4);
  256. box-shadow: 0px 10rpx 20rpx 0px rgba(4, 114, 69, 0.22);
  257. border-radius: 30rpx;
  258. .search {
  259. width: 34rpx;
  260. height: 34rpx;
  261. }
  262. .search-font {
  263. margin-left: 14rpx;
  264. font-size: 28rpx;
  265. font-family: PingFang SC;
  266. font-weight: 500;
  267. color: #ffffff;
  268. }
  269. }
  270. }
  271. }
  272. .carousel {
  273. width: 700rpx;
  274. height: 300rpx;
  275. margin: -260rpx auto 0;
  276. image {
  277. width: 700rpx;
  278. height: 300rpx;
  279. }
  280. }
  281. .tongz {
  282. width: 690rpx;
  283. height: 70rpx;
  284. margin: 32rpx auto 0;
  285. padding: 18rpx 30rpx 18rpx 24rpx;
  286. align-items: center;
  287. position: relative;
  288. .tongz-bg {
  289. position: absolute;
  290. top: 0;
  291. right: 0;
  292. left: 0;
  293. width: 690rpx;
  294. height: 70rpx;
  295. image {
  296. width: 100%;
  297. height: 100%;
  298. }
  299. }
  300. .tongz-left {
  301. width: 640rpx;
  302. .image-left {
  303. width: 28rpx;
  304. height: 34rpx;
  305. }
  306. .tongz-font {
  307. margin-left: 22rpx;
  308. font-size: 28rpx;
  309. font-family: Source Han Sans CN;
  310. font-weight: 400;
  311. color: #0f253a;
  312. }
  313. }
  314. .tongz-right {
  315. position: relative;
  316. z-index: 11;
  317. width: 12rpx;
  318. height: 26rpx;
  319. image {
  320. width: 100%;
  321. height: 100%;
  322. }
  323. }
  324. }
  325. .navbar {
  326. justify-content: flex-start;
  327. flex-wrap: wrap;
  328. .navbar-item {
  329. margin-top: 42rpx;
  330. width: 25%;
  331. display: flex;
  332. flex-direction: column;
  333. align-items: center;
  334. .nitem-image {
  335. width: 90rpx;
  336. height: 90rpx;
  337. }
  338. .nitem-font {
  339. font-size: 24rpx;
  340. font-family: PingFang SC;
  341. font-weight: 500;
  342. color: #0c1732;
  343. }
  344. }
  345. }
  346. .product {
  347. width: 662rpx;
  348. height: 180rpx;
  349. margin: 44rpx auto;
  350. .product-image {
  351. width: 662rpx;
  352. height: 180rpx;
  353. }
  354. }
  355. .shingle {
  356. width: 750rpx;
  357. background: #f8f8f8;
  358. border-radius: 10rpx;
  359. margin: 60rpx auto 0rpx;
  360. padding: 44rpx 50rpx 40rpx;
  361. .shingle-top {
  362. padding-left: 2rpx;
  363. .shingle-title {
  364. font-size: 36rpx;
  365. font-family: PingFang SC;
  366. font-weight: bold;
  367. color: #dc262b;
  368. }
  369. .shingle-btn {
  370. width: 250rpx;
  371. height: 50rpx;
  372. border: 2rpx solid #dc262b;
  373. border-radius: 10rpx;
  374. padding: 0 16rpx;
  375. text-align: left;
  376. font-size: 24rpx;
  377. font-family: PingFang SC;
  378. font-weight: 500;
  379. color: #dc262b;
  380. line-height: 50rpx;
  381. text {
  382. display: inline-block;
  383. padding-left: 6rpx;
  384. }
  385. }
  386. }
  387. .shingle-main {
  388. margin: 20rpx auto;
  389. width: 650rpx;
  390. height: 206rpx;
  391. position: relative;
  392. .shingle-bg {
  393. position: absolute;
  394. top: 0;
  395. left: 0;
  396. right: 0;
  397. width: 650rpx;
  398. height: 206rpx;
  399. image {
  400. width: 650rpx;
  401. height: 206rpx;
  402. }
  403. }
  404. .shinglem-title {
  405. position: relative;
  406. z-index: 2;
  407. justify-content: center;
  408. height: 70rpx;
  409. .tbg {
  410. height: 70rpx;
  411. width: 40rpx;
  412. }
  413. .shinglemt-center {
  414. display: flex;
  415. align-items: center;
  416. background: rgba(220,38,43,0.66);
  417. }
  418. .address {
  419. width: 28rpx;
  420. height: 30rpx;
  421. }
  422. .shingle-font {
  423. font-size: 36rpx;
  424. font-family: PingFang SC;
  425. font-weight: bold;
  426. color: #ffffff;
  427. line-height: 70rpx;
  428. margin-left: 14rpx;
  429. }
  430. }
  431. .shingle-mmain {
  432. position: relative;
  433. z-index: 2;
  434. margin-top: 30rpx;
  435. .smmain-item {
  436. width: 33%;
  437. display: flex;
  438. flex-direction: column;
  439. align-items: center;
  440. .smitem-top {
  441. font-size: 30rpx;
  442. font-family: PingFang SC;
  443. font-weight: bold;
  444. color: #ffffff;
  445. }
  446. .smitem-bottom {
  447. margin-top: 10rpx;
  448. font-size: 30rpx;
  449. font-family: PingFang SC;
  450. font-weight: 500;
  451. color: #ffffff;
  452. }
  453. .people {
  454. justify-content: center;
  455. .peopleitem {
  456. width: 24rpx;
  457. height: 34rpx;
  458. image {
  459. width: 100%;
  460. height: 100%;
  461. }
  462. }
  463. }
  464. }
  465. .shu {
  466. width: 2rpx;
  467. height: 70rpx;
  468. background: #ffffff;
  469. }
  470. }
  471. .right-bottom {
  472. position: absolute;
  473. z-index: 2;
  474. right: 0;
  475. bottom: 0;
  476. width: 94rpx;
  477. height: 92rpx;
  478. }
  479. }
  480. }
  481. .seckill-left {
  482. justify-content: flex-start;
  483. .seckill-inco {
  484. width: 36rpx;
  485. height: 36rpx;
  486. flex-shrink: 0;
  487. }
  488. .seckill-font {
  489. margin-left: 8rpx;
  490. font-size: 32rpx;
  491. font-family: PingFang SC;
  492. font-weight: bold;
  493. color: #333333;
  494. }
  495. .djs {
  496. margin-left: 12rpx;
  497. font-size: 20rpx;
  498. font-family: PingFang SC;
  499. font-weight: bold;
  500. color: #dc262b;
  501. }
  502. }
  503. .seckill-right {
  504. display: flex;
  505. justify-content: flex-start;
  506. align-items: center;
  507. .seckill-rfont {
  508. font-size: 24rpx;
  509. font-family: PingFang SC;
  510. font-weight: 500;
  511. color: #999999;
  512. margin-right: 8rpx;
  513. }
  514. .seckill-back {
  515. width: 10rpx;
  516. height: 20rpx;
  517. }
  518. }
  519. .ge {
  520. height: 20rpx;
  521. width: 750rpx;
  522. background: #f8f8f8;
  523. }
  524. .serve {
  525. padding: 32rpx 30rpx;
  526. background: #ffffff;
  527. .serve-main {
  528. margin-top: 24rpx;
  529. flex-wrap: wrap;
  530. justify-content: flex-start;
  531. .serve-item:first-child {
  532. margin-left: 0rpx;
  533. }
  534. .serve-item {
  535. width: 220rpx;
  536. background: #f6f6f6;
  537. border-radius: 10rpx;
  538. margin-left: 14rpx;
  539. padding-bottom: 22rpx;
  540. .serve-price {
  541. width: 220rpx;
  542. height: 220rpx;
  543. border-radius: 10rpx 10rpx 0px 0px;
  544. background: #03a9f4;
  545. }
  546. .serve-title {
  547. margin-top: 16rpx;
  548. padding: 0 14rpx;
  549. font-size: 26rpx;
  550. font-family: PingFang SC;
  551. font-weight: 500;
  552. color: #0a122b;
  553. }
  554. .serve-address {
  555. justify-content: flex-start;
  556. margin-top: 10rpx;
  557. padding: 0 14rpx;
  558. .saddress-inco {
  559. width: 18rpx;
  560. height: 24rpx;
  561. }
  562. .saddress-font {
  563. margin-left: 4rpx;
  564. font-size: 20rpx;
  565. font-family: PingFang SC;
  566. font-weight: 500;
  567. color: #666666;
  568. }
  569. }
  570. }
  571. }
  572. }
  573. </style>