Home.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  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. <a @click="goOpportunity">
  33. <img src="/images/mobile/@2x/home/seek.png" alt="">
  34. <span>我的商机</span>
  35. </a>
  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. <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
  71. <login-box @onLoginBoxClose="showLoginBox = false" v-if="showLoginBox"></login-box>
  72. </div>
  73. </template>
  74. <script>
  75. import SeekList from './applyPurchase/SeekList.vue'
  76. import MainSearch from '~/components/mobile/search/MainSearch.vue'
  77. import { RemindBox, LoginBox } from '~components/mobile/common'
  78. export default {
  79. data () {
  80. return {
  81. showStoreInfo: false,
  82. showMainSearch: false,
  83. swiperOption: {
  84. autoplay: 3000,
  85. initialSlide: 0,
  86. pagination: '.swiper-pagination',
  87. // 解决点击分页器后图片就不能轮播的问题
  88. autoplayDisableOnInteraction: false,
  89. paginationClickable: true,
  90. mousewheelControl: false,
  91. effect: 'fade',
  92. lazyLoading: true,
  93. loop: true,
  94. prevButton: '.swiper-button-prev',
  95. nextButton: '.swiper-button-next'
  96. },
  97. remindText: '',
  98. timeoutCount: 0,
  99. showLoginBox: false
  100. }
  101. },
  102. components: {
  103. SeekList,
  104. MainSearch,
  105. RemindBox,
  106. LoginBox
  107. },
  108. computed: {
  109. purchaseManList () {
  110. return this.$store.state.applyPurchase.purchaseManList.purchaseHomeList.data.content
  111. }
  112. },
  113. methods: {
  114. onHomeSearchClick () {
  115. this.showMainSearch = true
  116. this.$store.dispatch('searchData/getSearchHistory')
  117. },
  118. onCancelSearch: function () {
  119. this.showMainSearch = false
  120. },
  121. goOpportunity () {
  122. if (this.user.logged) {
  123. if (this.user.data.enterprise.uu) {
  124. this.$router.push('/mobile/applyPurchase/list/businessOpportunity')
  125. } else if (this.user.data.enterprise.isVendor !== 313) {
  126. this.onRemind('抱歉,您暂未开通卖家中心,可前往PC端开通')
  127. }
  128. } else {
  129. this.showLoginBox = true
  130. }
  131. },
  132. onRemind: function (str) {
  133. this.remindText = str
  134. this.timeoutCount ++
  135. }
  136. }
  137. }
  138. </script>
  139. <style lang="scss">
  140. .home {
  141. padding-bottom: 1rem;
  142. background: #f3f3f7;
  143. .header {
  144. height: 3.26rem;
  145. position: relative;
  146. .home-bg {
  147. height: 3.26rem;
  148. width: 100%;
  149. }
  150. .search-content {
  151. position: absolute;
  152. top: 0;
  153. width: 100%;
  154. }
  155. .swiper-container {
  156. height: 3.26rem;
  157. position: absolute;
  158. top: 0;
  159. width: 100%;
  160. z-index: 0;
  161. }
  162. .swiper-pagination-fraction, .swiper-pagination-custom, .swiper-container-horizontal > .swiper-pagination-bullets {
  163. bottom: .1rem !important;
  164. }
  165. .swiper-container-horizontal > .swiper-pagination-bullets .swiper-pagination-bullet {
  166. width: .16rem !important;
  167. height: .16rem !important;
  168. margin: 0 .2rem;
  169. }
  170. }
  171. .link-list {
  172. background: #fff;
  173. height: 1.56rem;
  174. margin-bottom: .2rem;
  175. li {
  176. position: relative;
  177. display: inline-block;
  178. width: 25%;
  179. text-align: center;
  180. float: left;
  181. height: 1.56rem;
  182. img {
  183. width: .7rem;
  184. height: .7rem;
  185. margin-top: .2rem;
  186. }
  187. span {
  188. font-size: .26rem;
  189. color: #666;
  190. display: block;
  191. margin-top: .15rem;
  192. }
  193. i {
  194. height: 0.9rem;
  195. width: .01rem;
  196. background: #ddd;
  197. display: block;
  198. position: absolute;
  199. right: 0;
  200. top: .2rem;
  201. }
  202. }
  203. }
  204. }
  205. </style>