index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  1. <template>
  2. <div class="paddy">
  3. <div class="top">
  4. <van-swipe
  5. class="my-swipe"
  6. :autoplay="3000"
  7. indicator-color="#DAAD71"
  8. @change="onChange"
  9. >
  10. <van-swipe-item>
  11. <img
  12. src="@/assets/images/home/swipper/swipper1.png"
  13. alt=""
  14. style="width: 100%"
  15. />
  16. </van-swipe-item>
  17. <van-swipe-item>
  18. <img
  19. src="@/assets/images/home/swipper/swipper2.png"
  20. alt=""
  21. style="width: 100%"
  22. />
  23. </van-swipe-item>
  24. <van-swipe-item>
  25. <img
  26. src="@/assets/images/home/swipper/swipper3.png"
  27. alt=""
  28. style="width: 100%"
  29. />
  30. </van-swipe-item>
  31. <template #indicator>
  32. <ul class="oUl">
  33. <li
  34. :class="
  35. current == 0
  36. ? 'custom-indicator indicator-active'
  37. : 'custom-indicator'
  38. "
  39. ></li>
  40. <li
  41. :class="
  42. current == 1
  43. ? 'custom-indicator indicator-active'
  44. : 'custom-indicator'
  45. "
  46. ></li>
  47. <li
  48. :class="
  49. current == 2
  50. ? 'custom-indicator indicator-active'
  51. : 'custom-indicator'
  52. "
  53. ></li>
  54. </ul>
  55. </template>
  56. </van-swipe>
  57. </div>
  58. <div class="centerBtn">
  59. <li
  60. v-for="(item, index) in centerBtnList"
  61. :key="item.name + index"
  62. @click="goto('/introduce', index + 1)"
  63. >
  64. <img :src="item.img" alt="" />
  65. <p>{{ item.name }}</p>
  66. </li>
  67. </div>
  68. <div class="detail">
  69. <p>产品展示</p>
  70. <ul class="baozhuangBox clear">
  71. <li
  72. v-for="(item, index) in baozhuangBoxList"
  73. :key="index + item.name"
  74. @click="goto('/goods', index)"
  75. >
  76. <div class="riceBag">
  77. <img :src="item.img" alt="" />
  78. <div class="fd">{{ item.name }}</div>
  79. </div>
  80. </li>
  81. </ul>
  82. </div>
  83. <div class="middle">
  84. <p class="middle-title">产品优势</p>
  85. <div class="middle-div clear">
  86. <ul>
  87. <li
  88. v-for="(item, index) in list1"
  89. :key="item.title + index"
  90. @click="goto(index === 0 ? '/live' : '/introduce', index + 3)"
  91. :class="{ left: index === 0 || index === 3, he: index === 0 }"
  92. >
  93. <div class="first">
  94. <div class="title">{{ item.title }}</div>
  95. <div class="desc" v-for="test in item.desc" :key="test + index">
  96. {{ test }}
  97. </div>
  98. <div class="lastP" v-if="index === 0">
  99. <img :src="more" alt="" />
  100. </div>
  101. </div>
  102. <div class="second">
  103. <img :src="item.img" alt="" />
  104. </div>
  105. </li>
  106. </ul>
  107. <ul>
  108. <li
  109. v-for="(item, index) in list2"
  110. :key="item.title + index"
  111. @click="goto('/introduce', index + 6)"
  112. :class="{ left: index === 0, right: index !== 0 }"
  113. >
  114. <div class="first">
  115. <div class="title">{{ item.title }}</div>
  116. <div class="desc" v-for="test in item.desc" :key="test + index">
  117. {{ test }}
  118. </div>
  119. </div>
  120. <div class="second">
  121. <img :src="item.img" alt="" />
  122. </div>
  123. </li>
  124. </ul>
  125. </div>
  126. </div>
  127. <div class="bottom">
  128. <img :src="footer" alt="" />
  129. </div>
  130. </div>
  131. </template>
  132. <script>
  133. export default {
  134. data() {
  135. return {
  136. current: 0,
  137. footer: require("@/assets/images/footer.png"), //用户头像
  138. centerBtnList: [
  139. {
  140. name: "五常大米",
  141. img: require("@/assets/images/home/centerUl/rice.png"),
  142. },
  143. {
  144. name: "金卡权益",
  145. img: require("@/assets/images/home/centerUl/card.png"),
  146. },
  147. {
  148. name: "品牌简介",
  149. img: require("@/assets/images/home/centerUl/infro.png"),
  150. },
  151. ],
  152. baozhuangBoxList: [
  153. {
  154. name: "实惠装",
  155. img: require("@/assets/images/home/detail/bag.png"),
  156. },
  157. {
  158. name: "礼盒装",
  159. img: require("@/assets/images/home/detail/box.png"),
  160. },
  161. ],
  162. more: require("@/assets/images/home/more.png"),
  163. list1: [
  164. {
  165. title: "实时监控",
  166. desc: ["全程溯源", "信赖保证"],
  167. img: require("@/assets/images/home/middle/camera.png"),
  168. },
  169. {
  170. title: "恒温保鲜",
  171. desc: ["带壳归仓", "恒温仓储"],
  172. img: require("@/assets/images/home/middle/keepAlive.png"),
  173. },
  174. {
  175. title: "现磨鲜米",
  176. desc: ["现磨现发", "随享鲜香"],
  177. img: require("@/assets/images/home/middle/freshRice.png"),
  178. },
  179. ],
  180. list2: [
  181. {
  182. title: "自然耕种",
  183. desc: ["农耕记忆", "山水乡愁"],
  184. img: require("@/assets/images/home/middle/normalGrow.png"),
  185. },
  186. {
  187. title: "生态有机",
  188. desc: ["黄金纬度", "黑金厚土"],
  189. img: require("@/assets/images/home/middle/organic.png"),
  190. },
  191. ],
  192. };
  193. },
  194. methods: {
  195. onChange(index) {
  196. this.current = index;
  197. },
  198. goto(url, index) {
  199. window.vm.$router.push({
  200. path: url,
  201. query: {
  202. index: index,
  203. },
  204. });
  205. },
  206. },
  207. };
  208. </script>
  209. <style lang="scss" scoped>
  210. .paddy {
  211. overflow: scroll;
  212. background: #000;
  213. background: url("../../assets/images/home/bgImg.png") no-repeat center !important;
  214. background-size: 100% 100% !important;
  215. padding: 0 16px !important;
  216. width: 100% !important;
  217. box-sizing: border-box !important;
  218. .top {
  219. width: 100%;
  220. margin: 10px auto 0;
  221. img {
  222. display: inline-block;
  223. width: 100%;
  224. }
  225. }
  226. .bottom {
  227. width: 100%;
  228. margin: 20px auto 50px;
  229. img {
  230. width: 100%;
  231. }
  232. }
  233. .oUl {
  234. position: absolute;
  235. padding: 0 0 0 0;
  236. margin: -2vh 0 0 44vw;
  237. }
  238. .custom-indicator {
  239. right: 155px;
  240. bottom: 7.5px;
  241. float: left;
  242. margin: 1px 3px;
  243. width: 6px;
  244. height: 6px;
  245. background: #7c6d5b;
  246. border-radius: 50%;
  247. }
  248. .indicator-active {
  249. background: #daad71;
  250. border-radius: 2px;
  251. width: 16px;
  252. height: 4px;
  253. margin-top: 2px;
  254. }
  255. .centerBtn {
  256. width: calc(100% + 32px);
  257. display: flex;
  258. justify-content: center;
  259. margin: 25px auto 18px -16px;
  260. li {
  261. height: 100%;
  262. margin: 0 auto;
  263. list-style: none;
  264. text-align: center;
  265. img {
  266. width: calc(100% - 60px);
  267. }
  268. p {
  269. margin: 5px 0 15px 0;
  270. font-weight: 200;
  271. color: #dab082;
  272. font-size: 17px;
  273. background: linear-gradient(
  274. -4deg,
  275. #b8925c 0%,
  276. #936e40 28.80859375%,
  277. #f6c684 65.8203125%,
  278. #936e40 100%
  279. );
  280. -webkit-background-clip: text;
  281. -webkit-text-fill-color: transparent;
  282. }
  283. }
  284. }
  285. .detail {
  286. width: 100%;
  287. box-sizing: border-box;
  288. padding: 0 0 0 0;
  289. p {
  290. font-size: 1.4em;
  291. font-weight: 500;
  292. color: #daad70;
  293. line-height: 15px;
  294. }
  295. .baozhuangBox {
  296. width: 100%;
  297. li {
  298. width: calc(50% - 6px);
  299. &:first-child {
  300. float: left;
  301. }
  302. &:last-child {
  303. float: right;
  304. }
  305. .riceBag {
  306. position: relative;
  307. width: 100%;
  308. img {
  309. width: 100%;
  310. position: relative;
  311. }
  312. .fd {
  313. position: absolute;
  314. top: 0;
  315. left: 0;
  316. z-index: 9;
  317. border-bottom-right-radius: 10px;
  318. font-weight: 150;
  319. font-size: 12px;
  320. height: 26px;
  321. text-align: center;
  322. line-height: 26px;
  323. width: 55px;
  324. color: #f1cda9;
  325. background: #613c0c;
  326. }
  327. }
  328. }
  329. }
  330. }
  331. .middle {
  332. width: 100%;
  333. margin: auto;
  334. p.middle-title {
  335. font-size: 1.4em;
  336. font-weight: 500;
  337. color: #daad70;
  338. }
  339. .middle-div {
  340. width: 100%;
  341. ul {
  342. width: 100%;
  343. float: left;
  344. li {
  345. width: calc(50% - 6px);
  346. float: right;
  347. box-sizing: border-box;
  348. border-radius: 8px;
  349. overflow: hidden;
  350. background: linear-gradient(
  351. 0deg,
  352. #a2794d,
  353. #ba9363,
  354. #cba66f,
  355. #d7b27a,
  356. #e3c48a,
  357. #e3d097
  358. );
  359. &.left {
  360. float: left;
  361. }
  362. .first {
  363. float: left;
  364. width: 48%;
  365. height: 100%;
  366. .title {
  367. color: #613c0c;
  368. font-weight: bolder;
  369. }
  370. .desc {
  371. color: #613c0c;
  372. }
  373. .lastP {
  374. background: #0f0b06;
  375. text-align: center;
  376. overflow: hidden;
  377. border-radius: 10px;
  378. padding: 2px 0 0 3px;
  379. margin: 15px 0 0 0;
  380. width: 46px;
  381. height: 13px;
  382. img {
  383. display: inline-block;
  384. width: 100%;
  385. height: 100%;
  386. }
  387. }
  388. }
  389. .second {
  390. width: 52%;
  391. float: left;
  392. img {
  393. display: inline-block;
  394. width: 100%;
  395. }
  396. }
  397. }
  398. }
  399. }
  400. @media screen and (min-width: 0px) {
  401. .middle-div {
  402. ul {
  403. li {
  404. height: 90px;
  405. margin: 0 0 10px 0;
  406. padding: 9px 15px;
  407. &.he {
  408. height: 190px;
  409. }
  410. .first {
  411. padding: 4px 0 0 0;
  412. .title {
  413. font-size: 12px;
  414. line-height: 28px;
  415. height: 28px;
  416. margin: 0 0 1px 0;
  417. }
  418. .desc {
  419. font-size: 12px;
  420. line-height: 16px;
  421. }
  422. }
  423. &.he {
  424. .first {
  425. padding: 42px 0 0 0;
  426. }
  427. .second img {
  428. width: 120%;
  429. margin: 35px 0 0 0;
  430. }
  431. }
  432. &:nth-child(4) {
  433. .second img {
  434. margin: 14px 0 0 7px;
  435. }
  436. }
  437. &:nth-child(5) {
  438. .second img {
  439. margin: 12px 0 0 7px;
  440. }
  441. }
  442. }
  443. }
  444. }
  445. }
  446. @media screen and (min-width: 359px) {
  447. .middle-div {
  448. ul {
  449. li {
  450. height: 105px;
  451. margin: 0 0 10px 0;
  452. padding: 9px 15px;
  453. &.he {
  454. height: 220px;
  455. }
  456. .first {
  457. padding: 7px 0 0 0;
  458. .title {
  459. font-size: 14px;
  460. line-height: 30px;
  461. height: 30px;
  462. margin: 0 0 5px 0;
  463. }
  464. .desc {
  465. font-size: 13px;
  466. line-height: 18px;
  467. }
  468. }
  469. &.he {
  470. .first {
  471. padding: 42px 0 0 0;
  472. }
  473. .second img {
  474. width: 120%;
  475. margin: 35px 0 0 0;
  476. }
  477. }
  478. &:nth-child(4) {
  479. .second img {
  480. margin: 14px 0 0 7px;
  481. }
  482. }
  483. &:nth-child(5) {
  484. .second img {
  485. margin: 12px 0 0 7px;
  486. }
  487. }
  488. }
  489. }
  490. }
  491. }
  492. @media screen and (min-width: 374px) {
  493. .middle-div {
  494. ul {
  495. li {
  496. height: 108px;
  497. margin: 0 0 10px 0;
  498. padding: 9px 15px;
  499. &.he {
  500. height: 226px;
  501. }
  502. .first {
  503. padding: 8px 0 0 0;
  504. .title {
  505. font-size: 16px;
  506. line-height: 30px;
  507. height: 30px;
  508. margin: 0 0 5px 0;
  509. }
  510. .desc {
  511. font-size: 14px;
  512. line-height: 18px;
  513. }
  514. }
  515. &.he {
  516. .first {
  517. padding: 50px 0 0 0;
  518. }
  519. .second img {
  520. width: 120%;
  521. margin: 40px 0 0 0;
  522. }
  523. }
  524. &:nth-child(4) {
  525. .second img {
  526. margin: 14px 0 0 7px;
  527. }
  528. }
  529. &:nth-child(5) {
  530. .second img {
  531. margin: 12px 0 0 7px;
  532. }
  533. }
  534. }
  535. }
  536. }
  537. }
  538. @media screen and (min-width: 413px) {
  539. .middle-div {
  540. ul {
  541. li {
  542. height: 120px;
  543. margin: 0 0 10px 0;
  544. padding: 9px 15px;
  545. &.he {
  546. height: 250px;
  547. }
  548. .first {
  549. padding: 15px 0 0 0;
  550. .title {
  551. font-size: 18px;
  552. line-height: 30px;
  553. height: 30px;
  554. margin: 0 0 5px 0;
  555. }
  556. .desc {
  557. font-size: 16px;
  558. line-height: 18px;
  559. }
  560. }
  561. &.he {
  562. .first {
  563. padding: 70px 0 0 0;
  564. }
  565. .second img {
  566. width: 120%;
  567. margin: 50px 0 0 0;
  568. }
  569. }
  570. &:nth-child(4) {
  571. .second img {
  572. margin: 14px 0 0 7px;
  573. }
  574. }
  575. &:nth-child(5) {
  576. .second img {
  577. margin: 12px 0 0 7px;
  578. }
  579. }
  580. }
  581. }
  582. }
  583. }
  584. }
  585. }
  586. </style>