Home.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <div>
  3. <div class="home" v-if="!showMainSearch">
  4. <div class="header">
  5. <div v-swiper:mySwiper="swiperOption">
  6. <div class="swiper-wrapper">
  7. <div class="swiper-slide">
  8. <img class="home-bg" src="/images/mobile/@2x/applyPurchase/home/app-banner_01.jpg" alt="">
  9. </div>
  10. <div class="swiper-slide">
  11. <img class="home-bg" src="/images/mobile/@2x/applyPurchase/home/app-banner_02.jpg" alt="">
  12. </div>
  13. </div>
  14. <div class="swiper-pagination swiper-pagination-bullets"></div>
  15. </div>
  16. <div class="search-content">
  17. <input type="text" placeholder="请输入您要查找的型号或品牌" @click="onHomeSearchClick()">
  18. <span>
  19. <i class="iconfont icon-sousuo"></i>
  20. </span>
  21. <img src="/images/mobile/@2x/applyPurchase/home/phone.png" alt="" @click="showStoreInfo = true">
  22. </div>
  23. </div>
  24. <ul class="link-list">
  25. <li>
  26. <nuxt-link to="/mobile/shop">
  27. <img src="/images/mobile/@2x/applyPurchase/home/shop.png" alt="">
  28. <span>店铺列表</span>
  29. <i></i>
  30. </nuxt-link>
  31. </li>
  32. <li>
  33. <nuxt-link to="/mobile/brand/brandCenter/ABCD">
  34. <img src="/images/mobile/@2x/applyPurchase/home/brand.png" alt="">
  35. <span>品牌列表</span>
  36. <i></i>
  37. </nuxt-link>
  38. </li>
  39. <li>
  40. <nuxt-link to="/mobile/applyPurchase/list">
  41. <img src="/images/mobile/@2x/applyPurchase/home/seek.png" alt="">
  42. <span>求购询价</span>
  43. </nuxt-link>
  44. </li>
  45. </ul>
  46. <div class="seek-title">
  47. <img src="/images/mobile/@2x/applyPurchase/home/seek-title.png" alt="">
  48. <span>最新求购信息</span>
  49. <nuxt-link to="/mobile/applyPurchase/list">查看更多 <img src="/images/mobile/@2x/applyPurchase/home/arrow-right.png" alt=""></nuxt-link>
  50. </div>
  51. <seek-list :purchaseManList="purchaseManList"></seek-list>
  52. </div>
  53. <div class="mobile-modal" v-if="showStoreInfo">
  54. <div class="mobile-modal-box">
  55. <div class="mobile-modal-header">联系方式<i @click="showStoreInfo = false" class="icon-guanbi iconfont"></i></div>
  56. <div class="mobile-modal-content">
  57. <div>商家地址:深圳市南山区英唐大厦1楼</div>
  58. <!-- <div class="content-line link-url">在线咨询</div>-->
  59. <div>致电:<a href="tel:4008301818" target="_blank" class="content-line link-url">4008301818</a></div>
  60. <div>邮件:<a href="mailto:yrsc@usoftchina.com" target="_blank" class="content-line link-url">yrsc@usoftchina.com</a></div>
  61. </div>
  62. </div>
  63. </div>
  64. <main-search v-if="showMainSearch" @cancelSearchAction="onCancelSearch"></main-search>
  65. </div>
  66. </template>
  67. <script>
  68. import SeekList from './applyPurchase/SeekList.vue'
  69. import MainSearch from '~/components/mobile/search/MainSearch.vue'
  70. export default {
  71. data () {
  72. return {
  73. showStoreInfo: false,
  74. showMainSearch: false,
  75. swiperOption: {
  76. autoplay: 3000,
  77. initialSlide: 0,
  78. pagination: '.swiper-pagination',
  79. // 解决点击分页器后图片就不能轮播的问题
  80. autoplayDisableOnInteraction: false,
  81. paginationClickable: true,
  82. mousewheelControl: false,
  83. effect: 'fade',
  84. lazyLoading: true,
  85. loop: true,
  86. prevButton: '.swiper-button-prev',
  87. nextButton: '.swiper-button-next'
  88. }
  89. }
  90. },
  91. components: {
  92. SeekList,
  93. MainSearch
  94. },
  95. computed: {
  96. purchaseManList () {
  97. return this.$store.state.applyPurchase.purchaseManList.purchaseHomeList.data.content
  98. }
  99. },
  100. methods: {
  101. onHomeSearchClick () {
  102. this.showMainSearch = true
  103. this.$store.dispatch('searchData/getSearchHistory')
  104. },
  105. onCancelSearch: function () {
  106. this.showMainSearch = false
  107. }
  108. }
  109. }
  110. </script>
  111. <style lang="scss">
  112. .home {
  113. padding-bottom: 1rem;
  114. .header {
  115. height: 3.26rem;
  116. position: relative;
  117. .home-bg {
  118. height: 3.26rem;
  119. width: 100%;
  120. }
  121. .search-content {
  122. position: absolute;
  123. top: 0;
  124. width: 100%;
  125. }
  126. .swiper-container {
  127. height: 3.26rem;
  128. position: absolute;
  129. top: 0;
  130. width: 100%;
  131. z-index: 0;
  132. }
  133. .swiper-pagination-fraction, .swiper-pagination-custom, .swiper-container-horizontal > .swiper-pagination-bullets {
  134. bottom: .1rem !important;
  135. }
  136. .swiper-container-horizontal > .swiper-pagination-bullets .swiper-pagination-bullet {
  137. width: .16rem !important;
  138. height: .16rem !important;
  139. margin: 0 .2rem;
  140. }
  141. }
  142. .link-list {
  143. background: #f3f3f7;
  144. height: 1.36rem;
  145. li {
  146. position: relative;
  147. display: inline-block;
  148. width: 33.3%;
  149. text-align: center;
  150. float: left;
  151. height: 1.36rem;
  152. img {
  153. width: .63rem;
  154. height: .63rem;
  155. margin-top: .2rem;
  156. }
  157. span {
  158. font-size: .22rem;
  159. color: #666;
  160. display: block;
  161. margin-top: .15rem;
  162. }
  163. i {
  164. height: 0.9rem;
  165. width: .01rem;
  166. background: #ddd;
  167. display: block;
  168. position: absolute;
  169. right: 0;
  170. top: .2rem;
  171. }
  172. }
  173. }
  174. }
  175. </style>