index.vue 11 KB

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