Home.vue 5.6 KB

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