index.vue 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526
  1. <template>
  2. <view class="container">
  3. <view class="searchbackground">
  4. <view class="backgroundimg">
  5. <image src="../../static/index/index05.png" mode=""></image>
  6. </view>
  7. </view>
  8. <view class="content flex">
  9. <view class="input-box flex" @click="clickSearch">
  10. <view class=" input-content flex">
  11. <view class="iconfont iconsearch"></view>
  12. <view class="input"><input type="text" disabled placeholder="请输入搜索内容" /></view>
  13. </view>
  14. </view>
  15. <!-- 轮播图 -->
  16. <swiper class="carousel" autoplay="true" :interval="5000" :duration="400">
  17. <swiper-item @click="swiperClick" class="carousel-item" v-for="(item,index) in carouselList"
  18. :key="index">
  19. <image :src="item.pic"></image>
  20. </swiper-item>
  21. <view class="swiper-dots">
  22. </view>
  23. </swiper>
  24. <view class="title-box">
  25. <view class="boxx" @click="navTo('/pages/category/category')">
  26. <view class="boxx-top">
  27. <image src="../../static/index/index06.png" mode=""></image>
  28. </view>
  29. <view class="boxx-bottom">
  30. 全部商品
  31. </view>
  32. </view>
  33. <view class="boxx" @click="navTo('/pages/index/jfgood')">
  34. <view class="boxx-top">
  35. <image src="../../static/index/index08.png" mode=""></image>
  36. </view>
  37. <view class="boxx-bottom">
  38. 积分商城
  39. </view>
  40. </view>
  41. <view class="boxx" @click="navTo('/pages/story/story')">
  42. <view class="boxx-top">
  43. <image src="../../static/index/index02.png" mode=""></image>
  44. </view>
  45. <view class="boxx-bottom">
  46. 公司介绍
  47. </view>
  48. </view>
  49. <view class="boxx" @click="navTo('/pages/user/shareQrCode')">
  50. <view class="boxx-top">
  51. <image src="../../static/index/index01.png" mode=""></image>
  52. </view>
  53. <view class="boxx-bottom">
  54. 邀请有礼
  55. </view>
  56. </view>
  57. </view>
  58. <view class="customs">
  59. <image src="../../static/index/index09.png" mode=""></image>
  60. <view class="vip">
  61. 会员专区
  62. </view>
  63. </view>
  64. <view class="jifen-content">
  65. <view class="jifen-box" v-for="(item,index) in bastList" :key="index"
  66. @click="navTo('/pages/product/product?id=' + item.id)">
  67. <view class="img">
  68. <image class="hlbg" src="../../static/index/index04.png" mode=""></image>
  69. <image class="image" :src="item.image" mode=""></image>
  70. </view>
  71. <view class="jifen-list">
  72. <view class="box-title">
  73. <view class="top clamp2">
  74. {{item.store_name}}
  75. </view>
  76. </view>
  77. <view class="box-price">
  78. <view class="huiyuan">
  79. 会员价
  80. </view>
  81. <view class="price">
  82. </view>
  83. <view class="price-left">
  84. {{(item.price*1).toFixed(0)}}
  85. </view>
  86. </view>
  87. </view>
  88. </view>
  89. </view>
  90. </view>
  91. </view>
  92. </template>
  93. <script>
  94. import {
  95. loadIndexs
  96. } from '@/api/index.js';
  97. import {
  98. mapState
  99. } from 'vuex';
  100. export default {
  101. components: {
  102. },
  103. data() {
  104. return {
  105. carouselList: [], //轮播列表
  106. couponArray: '',
  107. bastList: [], //会员礼包
  108. fugou: '', //复购商品
  109. price: '', //复购价格
  110. }
  111. },
  112. onLoad() {
  113. this.loadData()
  114. },
  115. methods: {
  116. // 请求载入数据
  117. async loadData() {
  118. loadIndexs({})
  119. .then(({
  120. data
  121. }) => {
  122. let goods = data.info;
  123. this.carouselList = data.banner;
  124. this.swiperLength = this.carouselList.length;
  125. this.goodsList = goods.firstList; //最新商品
  126. this.bastList = goods.vipList; //精品推荐
  127. uni.stopPullDownRefresh();
  128. })
  129. .catch(e => {
  130. uni.stopPullDownRefresh();
  131. });
  132. },
  133. swiperClick() {
  134. },
  135. // 点击搜索框
  136. clickSearch() {
  137. console.log('点击')
  138. uni.navigateTo({
  139. url: '/pages/product/search'
  140. });
  141. },
  142. navTo(url) {
  143. uni.navigateTo({
  144. url,
  145. fail() {
  146. uni.switchTab({
  147. url
  148. })
  149. }
  150. })
  151. }
  152. }
  153. }
  154. </script>
  155. <style lang="scss" scoped>
  156. page {
  157. height: auto;
  158. background-color: #FFFFFF;
  159. ;
  160. }
  161. .title-box {
  162. display: flex;
  163. width: 100%;
  164. .boxx {
  165. margin: 40rpx 0 80rpx 0;
  166. width: 25%;
  167. display: flex;
  168. flex-direction: column;
  169. align-items: center;
  170. .boxx-top {
  171. width: 100rpx;
  172. height: 100rpx;
  173. border-radius: 50%;
  174. overflow: hidden;
  175. image {
  176. width: 100%;
  177. height: 100%;
  178. }
  179. }
  180. .boxx-bottom {
  181. margin-top: 15rpx;
  182. font-size: 26rpx;
  183. font-weight: 500;
  184. color: #333333;
  185. }
  186. }
  187. }
  188. .container {
  189. min-height: 100%;
  190. height: auto;
  191. }
  192. .searchbackground {
  193. position: relative;
  194. .backgroundimg {
  195. position: absolute;
  196. width: 750rpx;
  197. image {
  198. width: 100%;
  199. }
  200. }
  201. }
  202. // .fiexd {
  203. // position: fiexd;
  204. // bottom: 0;
  205. // width: 750rpx;
  206. // height: 750rpx;
  207. // image {
  208. // width: 100%;
  209. // height: 100%;
  210. // }
  211. // }
  212. .content {
  213. flex-direction: column;
  214. justify-content: center;
  215. height: 100%;
  216. .input-box {
  217. position: absolute;
  218. left: 0;
  219. top: 0;
  220. margin: 66rpx 25rpx;
  221. justify-content: center;
  222. background: #FFFFFF;
  223. box-shadow: 0rpx 1rpx 21rpx 0rpx rgba(255, 255, 255, 0.12);
  224. border-radius: 35rpx;
  225. width: 700rpx;
  226. height: 70rpx;
  227. .input {
  228. font-size: 28rpx;
  229. font-family: PingFang SC;
  230. font-weight: 500;
  231. color: #C4C4C4;
  232. line-height: 38rpx;
  233. }
  234. }
  235. .carousel {
  236. margin-top: 165rpx;
  237. width: 700rpx;
  238. height: 370rpx;
  239. .carousel-item {
  240. border-radius: 20rpx;
  241. image {
  242. width: 100%;
  243. height: 100%;
  244. }
  245. }
  246. }
  247. .customs {
  248. margin-left: 40rpx;
  249. width: 100%;
  250. display: flex;
  251. margin-top: 20rpx;
  252. align-items: center;
  253. image {
  254. width: 37rpx;
  255. height: 37rpx;
  256. }
  257. .vip {
  258. margin-left: 10rpx;
  259. font-size: 32rpx;
  260. font-weight: bold;
  261. color: #333333;
  262. }
  263. }
  264. .customs-content {
  265. position: relative;
  266. padding-top: 14rpx;
  267. .backgroundimg1 {
  268. width: 700rpx;
  269. height: 300rpx;
  270. image {
  271. height: 100%;
  272. width: 100%;
  273. }
  274. }
  275. .box {
  276. position: absolute;
  277. margin-top: -250rpx;
  278. padding: 0 38rpx;
  279. display: flex;
  280. justify-content: space-between;
  281. align-items: center;
  282. .customs-img {
  283. width: 200rpx;
  284. height: 200rpx;
  285. image {
  286. width: 100%;
  287. height: 100%;
  288. }
  289. }
  290. .customstext {
  291. margin-left: 14rpx;
  292. height: 200rpx;
  293. // display: flex;
  294. // flex-direction: column;
  295. // justify-content: space-around;
  296. position: relative;
  297. .customstext1 {
  298. .customstext-title {
  299. width: 350rpx;
  300. font-size: 34rpx;
  301. font-family: PingFang SC;
  302. font-weight: bold;
  303. color: #3F7C1F;
  304. }
  305. .customstext-product {
  306. // margin-top: 25rpx;
  307. width: 400rpx;
  308. padding-top: 10rpx;
  309. font-size: 26rpx;
  310. font-family: PingFang SC;
  311. font-weight: bold;
  312. color: #ABD56F;
  313. }
  314. }
  315. .customsprice {
  316. position: absolute;
  317. bottom: 0;
  318. left: 0;
  319. display: flex;
  320. align-items: center;
  321. justify-content: flex-start;
  322. width: 100%;
  323. .customsprice-left {
  324. font-size: 28rpx;
  325. font-family: PingFang SC;
  326. font-weight: 500;
  327. color: #FF0000;
  328. flex-shrink: 0;
  329. }
  330. .customsprice-between {
  331. font-size: 42rpx;
  332. font-family: PingFang SC;
  333. font-weight: 500;
  334. color: #FF0000;
  335. flex-shrink: 0;
  336. }
  337. .customsprice-right {
  338. text-align: center;
  339. width: 137rpx;
  340. height: 52rpx;
  341. line-height: 52rpx;
  342. background: #3F7C1F;
  343. border-radius: 26rpx;
  344. font-size: 26rpx;
  345. font-family: PingFang SC;
  346. font-weight: 400;
  347. color: #FFFFFF;
  348. position: absolute;
  349. right: 0;
  350. bottom: 0;
  351. }
  352. }
  353. }
  354. }
  355. }
  356. .jifen-content {
  357. width: 700rpx;
  358. padding-bottom: 20rpx;
  359. display: flex;
  360. flex-wrap: wrap;
  361. justify-content: space-between;
  362. .jifen-box {
  363. position: relative;
  364. margin: 20rpx 0;
  365. display: flex;
  366. flex-direction: column;
  367. align-items: center;
  368. width: 342rpx;
  369. height: 512rpx;
  370. padding-top: 20rpx;
  371. background: #FFFFFF;
  372. // box-shadow: 0px 7px 10px 1px #8BAFAB;
  373. .img {
  374. position: relative;
  375. .hlbg{
  376. border-radius: 10rpx;
  377. z-index: 9;
  378. position: absolute;
  379. width:312rpx ;
  380. height: 312rpx;
  381. top: 0;
  382. left: 0;
  383. }
  384. flex-shrink: 0;
  385. // margin-top: 20rpx;
  386. height: 312rpx;
  387. width: 312rpx;
  388. background-color: #eee;
  389. .image {
  390. height: 100%;
  391. width: 100%;
  392. }
  393. }
  394. .jifen-list {
  395. // margin-left: -80rpx;
  396. width: 312rpx;
  397. height: 100%;
  398. position: relative;
  399. .box-title {
  400. .top {
  401. margin: 20rpx 0 10rpx 0;
  402. // padding: 20rpx 0 10rpx 0;
  403. font-size: 30rpx;
  404. font-family: PingFang SC;
  405. font-weight: bold;
  406. color: #3F7C1F;
  407. line-height: 35rpx;
  408. }
  409. .button {
  410. padding-bottom: 20rpx;
  411. font-size: 26rpx;
  412. font-family: PingFang SC;
  413. font-weight: 500;
  414. color: #3F7C1F;
  415. line-height: 35rpx;
  416. opacity: 0.8;
  417. }
  418. }
  419. .box-price {
  420. display: flex;
  421. align-items: center;
  422. position: absolute;
  423. bottom: 20rpx;
  424. .pricebox {
  425. height: 25rpx;
  426. width: 25rpx;
  427. image {
  428. height: 100%;
  429. width: 100%;
  430. }
  431. }
  432. .huiyuan{
  433. padding: 4rpx 8rpx;
  434. background: linear-gradient(90deg, #C79A4C, #F9DF7F);
  435. border-radius: 5rpx;
  436. font-size: 19rpx;
  437. font-family: Source Han Sans CN;
  438. font-weight: 400;
  439. color: #FFFFFF;
  440. font-weight: 33rpx;
  441. text-align: center;
  442. }
  443. .price-left {
  444. font-size: 36rpx;
  445. font-family: PingFang SC;
  446. font-weight: bold;
  447. color: #FF0000;
  448. line-height: 35rpx;
  449. }
  450. .price{
  451. margin: 0 5rpx;
  452. font-size: 19rpx;
  453. font-weight: bold;
  454. color: #FF4C4C;
  455. }
  456. .price-right {
  457. margin-left: 10rpx;
  458. font-size: 21rpx;
  459. font-family: PingFang SC;
  460. font-weight: 500;
  461. text-decoration: line-through;
  462. color: #999999;
  463. line-height: 35rpx;
  464. }
  465. }
  466. }
  467. }
  468. }
  469. }
  470. </style>