index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  1. <template>
  2. <view class="center">
  3. <view class="topcontent padding-b-30">
  4. <view class="top">
  5. <view class="vheigh"></view>
  6. <view class="top-main flex">
  7. <view class="search-box flex" @click="clickSearch()">
  8. <image class="search" src="../../static/img/search.png" mode=""></image>
  9. <view class="search-font">输入关键词搜索</view>
  10. </view>
  11. </view>
  12. </view>
  13. <swiper class="carousel" autoplay="true" duration="400" interval="5000">
  14. <swiper-item v-for="(item, index) in carouselList" :key="index" class="carousel-item"
  15. @click="bannerNavToUrl(item)">
  16. <image :src="item.pic" />
  17. </swiper-item>
  18. </swiper>
  19. <view class="stre flex">
  20. <view class="ic-text flex">
  21. <image class="ic-tubiao" src="../../static/icon/shou-ic.png" mode=""></image>
  22. <view class="ic-wen">自用购物优惠</view>
  23. </view>
  24. <view class="ic-text flex">
  25. <image class="ic-tubiao" src="../../static/icon/shou-ic.png" mode=""></image>
  26. <view class="ic-wen">分享好友赚钱</view>
  27. </view>
  28. <view class="ic-text flex">
  29. <image class="ic-tubiao" src="../../static/icon/shou-ic.png" mode=""></image>
  30. <view class="ic-wen">超值正品优惠</view>
  31. </view>
  32. </view>
  33. <view class="zhishi flex">
  34. <navigator url="/pages/index/category">
  35. <view class="zhishi-item">
  36. <image class="zhishi-ic" src="../../static/img/img-f.png" mode=""></image>
  37. <view class="zhishi-te">全部分类</view>
  38. </view>
  39. </navigator>
  40. <navigator url="/pages/user/shareQrCode">
  41. <view class="zhishi-item">
  42. <image class="zhishi-ic" src="../../static/img/img-d.png" mode=""></image>
  43. <view class="zhishi-te">邀请好友</view>
  44. </view>
  45. </navigator>
  46. <navigator url="/pages/index/artDetail?id=6">
  47. <view class="zhishi-item">
  48. <image class="zhishi-ic" src="../../static/img/img-a.png" mode=""></image>
  49. <view class="zhishi-te">关于我们</view>
  50. </view>
  51. </navigator>
  52. <view class="zhishi-item" @click="openKf">
  53. <image class="zhishi-ic" src="../../static/img/img-b.png" mode=""></image>
  54. <view class="zhishi-te">联系客服</view>
  55. </view>
  56. </view>
  57. <!-- 首购推荐 -->
  58. <view class="tj">
  59. <image class="tj-ic" src="../../static/img/sy-icon.png" mode=""></image>
  60. <view class="sg">首购推荐</view>
  61. </view>
  62. <swiper class="car" autoplay="true" duration="400" interval="5000">
  63. <swiper-item v-for="(item, index) in carouselList" :key="index" class="carousel-item"
  64. @click="bannerNavToUrl(item)">
  65. <image :src="item.pic" />
  66. </swiper-item>
  67. </swiper>
  68. <!-- 列表 -->
  69. <view class="splist flex" v-for="item in 3">
  70. <view class="tp">
  71. <image class="list-iamg" src="../../static/error/errorImage.jpg" mode=""></image>
  72. </view>
  73. <view class="right" >
  74. <view class="list-title">风平乐樱桃姜黄复合肽压片 糖果套盒...</view>
  75. <view class="ysjg flex-start">
  76. <view class="yj">¥139</view>
  77. <view class="dz">直降40元</view>
  78. </view>
  79. <view class="bto flex">
  80. <view class="xj">¥99</view>
  81. <button class="ljgm text-center">立即购买</button>
  82. </view>
  83. </view>
  84. </view>
  85. <!-- 复购专区 -->
  86. <view class="tj">
  87. <image class="tj-ic" src="../../static/img/sy-icon.png" mode=""></image>
  88. <view class="sg">复购专区</view>
  89. </view>
  90. <view class="splist flex" v-for="item in 3">
  91. <view class="tp">
  92. <image class="list-iamg" src="../../static/error/errorImage.jpg" mode=""></image>
  93. </view>
  94. <view class="right" >
  95. <view class="list-title">风平乐樱桃姜黄复合肽压片 糖果套盒...</view>
  96. <view class="ysjg flex-start">
  97. <view class="yj">¥139</view>
  98. <view class="dz">直降40元</view>
  99. </view>
  100. <view class="bto flex">
  101. <view class="xj">¥99</view>
  102. <button class="ljgm text-center">立即购买</button>
  103. </view>
  104. </view>
  105. </view>
  106. </view>
  107. <uni-popup ref="popupkf" type="center">
  108. <view class="popup-box">
  109. <view class="img">
  110. <image src="../../static/img/img009.png" mode=""></image>
  111. </view>
  112. <view class="mian">
  113. <view class="delivery">
  114. <view class="title">已经为您定制专属客服</view>
  115. <image src="../../static/img/img010.png" mode=""></image>
  116. </view>
  117. <view class="nocancel">客服VX:{{ kefu }}</view>
  118. <view class="comfirm-box">
  119. <view class="cancel" @click="cancel">取消</view>
  120. <view class="comfirm" @click="comfirm(kefu)">复制微信</view>
  121. </view>
  122. </view>
  123. </view>
  124. </uni-popup>
  125. <u-tabbar activeColor="#01A6A8" inactive-color='#666666' :list="tabbar"></u-tabbar>
  126. </view>
  127. </template>
  128. <script>
  129. import {
  130. tabbar1
  131. } from '@/utils/tabbar.js'; //底部导航栏
  132. import {
  133. article
  134. } from '@/api/user.js';
  135. import {
  136. getCategoryList,
  137. getProducts
  138. } from '@/api/product.js';
  139. import {
  140. loadIndexs,
  141. store_list
  142. } from '@/api/index.js';
  143. import {
  144. auction_gu
  145. } from '@/api/hall.js';
  146. import {
  147. mapState,
  148. mapMutations
  149. } from 'vuex';
  150. export default {
  151. data() {
  152. return {
  153. current: 0,
  154. tabbar: tabbar1,
  155. carouselList: [], //轮播图列表
  156. kefu: '',
  157. };
  158. },
  159. onShow() {
  160. },
  161. methods: {
  162. ...mapMutations(['setLat', 'setLon', 'setChoose']),
  163. // 底部轮播图切换
  164. changeBottom(res) {
  165. this.actionArtInd = res.detail.current;
  166. console.log(res);
  167. },
  168. // 打开客服
  169. openKf() {
  170. this.$refs.popupkf.open();
  171. },
  172. // 关闭客服
  173. cancel() {
  174. this.$refs.popupkf.close();
  175. },
  176. toBack() {
  177. uni.navigateTo({
  178. url: '/pages/navigation/index'
  179. })
  180. },
  181. nav(url) {
  182. console.log(url, '123456');
  183. uni.navigateTo({
  184. url,
  185. fail() {
  186. uni.switchTab({
  187. url
  188. });
  189. }
  190. });
  191. },
  192. // 點擊搜索框
  193. clickSearch() {
  194. uni.navigateTo({
  195. url: '/pages/index/search'
  196. });
  197. },
  198. navTo(item) {
  199. uni.navigateTo({
  200. url: '/pages/hall/halllist?id=' + item.id + '&name=' + item.name + '&peoplename=' + item
  201. .nickname
  202. });
  203. },
  204. //详情页
  205. navToDetailPage(item) {
  206. let id = item.id;
  207. uni.navigateTo({
  208. url: '/pages/index/product?id=' + id
  209. });
  210. }
  211. }
  212. };
  213. </script>
  214. <style lang="scss">
  215. .center {
  216. padding-bottom: 30rpx;
  217. }
  218. .topcontent {
  219. background-color: #FFFFFF;
  220. }
  221. .vheigh {
  222. height: var(--status-bar-height);
  223. background-color: $base-color;
  224. }
  225. .top {
  226. position: relative;
  227. width: 100%;
  228. height: 120rpx;
  229. .top-main {
  230. position: relative;
  231. z-index: 2;
  232. padding: 30rpx;
  233. .search-box {
  234. justify-content: center;
  235. width: 698rpx;
  236. height: 60rpx;
  237. background: rgba(255, 240, 245, 0.4);
  238. border-radius: 30rpx;
  239. background-color: #EEEEEE;
  240. .search {
  241. width: 34rpx;
  242. height: 34rpx;
  243. }
  244. .search-font {
  245. margin-left: 14rpx;
  246. font-size: 28rpx;
  247. font-family: PingFang SC;
  248. font-weight: 500;
  249. color: #CBCBCB;
  250. }
  251. }
  252. }
  253. }
  254. .carousel {
  255. width: 750rpx;
  256. height: 360rpx;
  257. /* #ifndef APP-PLUS */
  258. // margin: -230rpx auto 0;
  259. // margin: -160rpx auto 0;
  260. /* #endif */
  261. /* #ifdef APP-PLUS */
  262. // margin: -100rpx auto 0;
  263. /* #endif */
  264. image {
  265. width: 100%;
  266. height: 100%;
  267. }
  268. }
  269. .stre {
  270. padding: 0 30rpx;
  271. margin-top:20rpx ;
  272. .ic-text {
  273. .ic-tubiao {
  274. width: 27rpx;
  275. height: 27rpx;
  276. }
  277. .ic-wen {
  278. font-size: 21rpx;
  279. color: #333333;
  280. }
  281. }
  282. }
  283. .zhishi {
  284. padding: 30rpx;
  285. .zhishi-item {
  286. .zhishi-ic {
  287. width: 90rpx;
  288. height: 90rpx;
  289. }
  290. .zhishi-te {
  291. font-size: 24rpx;
  292. color: #666666;
  293. }
  294. }
  295. }
  296. .tj {
  297. .tj-ic {
  298. width: 350rpx;
  299. height: 10rpx;
  300. margin-top: 79rpx;
  301. margin-left: 199rpx;
  302. }
  303. .sg {
  304. font-size: 35rpx;
  305. font-weight: 500;
  306. color: #000000;
  307. text-align: center;
  308. margin-top: -35rpx;
  309. }
  310. }
  311. .car {
  312. width: 750rpx;
  313. height: 240rpx;
  314. image {
  315. width: 100%;
  316. height: 100%;
  317. }
  318. }
  319. .splist {
  320. width: 690rpx;
  321. height: 276rpx;
  322. background: #FFFFFF;
  323. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(50,50,52,0.06);
  324. border-radius: 10rpx;
  325. margin-left: 30rpx;
  326. margin-top: 26rpx;
  327. .tp {
  328. .list-iamg {
  329. width: 235rpx;
  330. height: 235rpx;
  331. padding-left: 15rpx;
  332. padding-top: 20rpx;
  333. }
  334. }
  335. .right {
  336. .list-title {
  337. font-size: 32rpx;
  338. font-weight: bold;
  339. color: #333333;
  340. padding-left: 22rpx;
  341. margin-top: 10rpx;
  342. }
  343. .ysjg {
  344. padding-top: 50rpx;
  345. padding-left: 22rpx;
  346. .yj {
  347. width: 65rpx;
  348. height: 20rpx;
  349. font-size: 26rpx;
  350. text-decoration: line-through;
  351. color: #999999;
  352. }
  353. .dz {
  354. height: 21rpx;
  355. font-size: 24rpx;
  356. color: #B59467;
  357. padding-left: 20rpx;
  358. }
  359. }
  360. .bto {
  361. padding-top: 20rpx;
  362. padding-left: 20rpx;
  363. .xj {
  364. font-size: 36rpx;
  365. color: #FF6F0F;
  366. }
  367. .ljgm {
  368. display: inline-block;
  369. background-color: #01A6A8;
  370. color: #fff;
  371. border-radius: 50rpx;
  372. font-size: $font-base + 2rpx;
  373. text-align: center;
  374. margin-left: 160rpx;
  375. }
  376. }
  377. }
  378. }
  379. .popup-box {
  380. width: 522rpx;
  381. height: 605rpx;
  382. background-color: #ffffff;
  383. border-radius: 20rpx;
  384. position: relative;
  385. .img {
  386. position: relative;
  387. top: -56rpx;
  388. left: 0;
  389. width: 522rpx;
  390. height: 132rpx;
  391. display: flex;
  392. justify-content: center;
  393. image {
  394. border-radius: 20rpx 20rpx 0 0;
  395. width: 450rpx;
  396. height: 132rpx;
  397. }
  398. }
  399. .mian {
  400. margin-top: -44rpx;
  401. display: flex;
  402. flex-direction: column;
  403. align-items: center;
  404. // padding: 32rpx 32rpx;
  405. background-color: #ffffff;
  406. border-radius: 0 0 20rpx 20rpx;
  407. text-align: center;
  408. .delivery {
  409. font-size: 40rpx;
  410. color: #333333;
  411. display: flex;
  412. align-items: center;
  413. flex-direction: column;
  414. .title {}
  415. image {
  416. margin-top: 48rpx;
  417. width: 172rpx;
  418. height: 160rpx;
  419. }
  420. }
  421. .nocancel {
  422. font-size: 32rpx;
  423. color: #333333;
  424. margin-top: 14rpx;
  425. }
  426. .comfirm-box {
  427. margin-top: 52rpx;
  428. display: flex;
  429. // margin-bottom: 32rpx;
  430. // justify-content: space-around;
  431. .cancel {
  432. display: flex;
  433. align-items: center;
  434. justify-content: center;
  435. width: 197rpx;
  436. height: 74rpx;
  437. border: 1px solid #dcc786;
  438. border-radius: 38rpx;
  439. font-size: 32rpx;
  440. color: #605128;
  441. }
  442. .comfirm {
  443. margin-left: 32rpx;
  444. display: flex;
  445. align-items: center;
  446. justify-content: center;
  447. width: 197rpx;
  448. height: 74rpx;
  449. background: linear-gradient(-90deg, #d1ba77 0%, #f7e8ad 100%);
  450. border-radius: 38px;
  451. font-size: 32rpx;
  452. color: #605128;
  453. }
  454. }
  455. }
  456. }
  457. .product-list {
  458. padding: 0 30rpx;
  459. line-height: 0;
  460. align-items: stretch;
  461. .list-left {
  462. .imgleft {
  463. width: 306rpx;
  464. height: 319rpx;
  465. }
  466. }
  467. .list-right {
  468. flex-direction: column;
  469. .imgleft {
  470. width: 366rpx;
  471. height: 152rpx;
  472. }
  473. }
  474. }
  475. .bottom-box {
  476. padding: 30rpx 0;
  477. background-color: #FFFFFF;
  478. .bottom-title {
  479. text-align: center;
  480. .image {
  481. width: 609rpx;
  482. height: 31rpx;
  483. }
  484. }
  485. .product-art-list {
  486. height: 432rpx;
  487. .product-art-item {
  488. .image-box {
  489. text-align: center;
  490. .image {
  491. width: 432rpx;
  492. height: 432rpx;
  493. }
  494. }
  495. }
  496. }
  497. .product-detail {
  498. margin: 30rpx;
  499. height: 4em;
  500. overflow: hidden;
  501. text-indent: 2em;
  502. text-overflow: ellipsis;
  503. display: -webkit-box;
  504. -webkit-line-clamp: 4;
  505. -webkit-box-orient: vertical;
  506. }
  507. }
  508. </style>