ToggleStore.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. <template>
  2. <div class="toggleStore">
  3. <!--原厂-->
  4. <div class="factory list-item" :class="{active: storeType === 'factory'}" @click="toggleStore('factory')">
  5. <div class="header">
  6. <div class="kind"><span></span>原&nbsp;&nbsp;&nbsp;&nbsp;厂</div>
  7. <div class="count">
  8. <span>已入驻</span>
  9. <div class="count_num">
  10. <span>1</span><span>2</span><span>3</span><span>3</span>
  11. </div>
  12. </div>
  13. </div>
  14. <div class="body">
  15. <p>原厂直营,品质保障</p>
  16. <p>全球品牌,自由筛选</p>
  17. <p>原装现货,买得放心</p>
  18. </div>
  19. </div>
  20. <!--代理经销-->
  21. <div class="agent list-item" :class="{active: storeType === 'origin'}" @click="toggleStore('origin')">
  22. <div class="header">
  23. <div class="kind"><span></span>代理经销</div>
  24. <div class="count">
  25. <span>已入驻</span>
  26. <div class="count_num">
  27. <span>1</span><span>2</span><span>3</span><span>3</span>
  28. </div>
  29. </div>
  30. </div>
  31. <div class="body">
  32. <p>百强代理,资源共享</p>
  33. <p>物料询价,极速响应</p>
  34. <p>千万型号,一站找齐</p>
  35. </div>
  36. </div>
  37. <!--寄售-->
  38. <div class="sale list-item">
  39. <div class="header">
  40. <div class="kind"><span></span>优软寄售</div>
  41. <a class="enter" @click="open('/store/33069557578d44e69bd91ad12d28a8d4')">进入店铺 <i class="fa fa-angle-right"></i></a>
  42. </div>
  43. <div class="body">
  44. <p>海量库存、不赚差价</p>
  45. <p>在线下单、在线跟踪</p>
  46. <p>价格透明、节约成本</p>
  47. </div>
  48. </div>
  49. </div>
  50. </template>
  51. <script>
  52. export default {
  53. name: 'excellent-suppliers',
  54. computed: {
  55. storeType () {
  56. return this.$store.state.provider.stores.storeType.data
  57. },
  58. store () {
  59. return this.$store.state.provider.storeCms.recommendStore.data
  60. },
  61. storeCount () {
  62. return this.$store.state.provider.storeCms.storeCount.data
  63. }
  64. },
  65. methods: {
  66. // 切换Store
  67. toggleStore (type) {
  68. this.$store.commit('provider/stores/SET_STORETYPE', type)
  69. this.$store.dispatch('loadBanners', {type: type + '_banner_carousel'})
  70. this.$store.dispatch('provider/findSimilarStoreList', { page: 1, count: 10, types: type === 'factory' ? 'ORIGINAL_FACTORY' : 'AGENCY-DISTRIBUTION' })
  71. },
  72. // 店铺入驻数量
  73. formatNumber (num, key) {
  74. let count = ('000' + num).substr(-key)
  75. let _arr = []
  76. for (var i = 0; i < count.length; i++) {
  77. _arr.push(count[i])
  78. }
  79. return _arr
  80. },
  81. // 寄售
  82. open (url) {
  83. window.open(url)
  84. }
  85. }
  86. }
  87. </script>
  88. <style lang="scss" scoped>
  89. .toggleStore {
  90. float: left;
  91. width: 220px;
  92. height: 402px;
  93. padding: 0;
  94. .list-item{
  95. width: 100%;
  96. height: 134px;
  97. background: #fff;
  98. border-bottom: 1px solid #ece9ec;
  99. .header {
  100. overflow: hidden;
  101. padding: 10px 8px 0;
  102. .kind{
  103. float: left;
  104. font-size: 16px;
  105. font-weight: bold;
  106. color: #2496f1;
  107. span{
  108. display: inline-block;
  109. margin-right: 4px;
  110. width: 6px;
  111. height: 12px;
  112. background: url('/images/original/angle-blue.png') no-repeat;
  113. }
  114. }
  115. .count{
  116. overflow: hidden;
  117. float: right;
  118. padding: 0 5px;
  119. width: 120px;
  120. height: 26px;
  121. line-height: 24px;
  122. background-color: #fff;
  123. border-radius: 2px;
  124. border: solid 1px #bfbfbf;
  125. span {
  126. float: left;
  127. margin-right: 4px;
  128. font-size: 12px;
  129. letter-spacing: 0;
  130. color: #666;
  131. }
  132. .count_num{
  133. float: left;
  134. margin-top: 3px;
  135. span{
  136. display: inline-block;
  137. width: 14px;
  138. height: 18px;
  139. line-height: 18px;
  140. font-size: 12px;
  141. color: #fff;
  142. text-align: center;
  143. background-color: #a1a0a0;
  144. border-radius: 2px;
  145. &:last-child{
  146. margin-right: 0;
  147. }
  148. }
  149. }
  150. }
  151. .enter{
  152. float: right;
  153. display: inline-block;
  154. width: 72px;
  155. height: 22px;
  156. line-height: 20px;
  157. text-align: center;
  158. font-size: 12px;
  159. color: #2496f1;
  160. background-color: #ffffff;
  161. border-radius: 11px;
  162. border: solid 1px #2496f1;
  163. i{
  164. font-size: 16px;
  165. }
  166. &:hover{
  167. color: #fff;
  168. background: #2496f1;
  169. border: solid 1px #2496f1;
  170. }
  171. }
  172. }
  173. .body {
  174. margin-top: 15px;
  175. padding: 0 20px 0;
  176. p{
  177. width: 195px;
  178. overflow: hidden;
  179. white-space: nowrap;
  180. text-overflow: ellipsis;
  181. font-size: 14px;
  182. letter-spacing: 0;
  183. color: #666666;
  184. }
  185. }
  186. &:hover, &.active{
  187. background: #fa9819;
  188. cursor: pointer;
  189. .kind {
  190. color: #fff;
  191. span{
  192. background: url('/images/original/angle-white.png') no-repeat;
  193. }
  194. }
  195. .count{
  196. background-color: #d87c05;
  197. border: solid 1px #d87c05;
  198. span {
  199. color: #fff;
  200. }
  201. .count_num{
  202. span{
  203. color: #626364;
  204. background-color: #fff;
  205. }
  206. }
  207. }
  208. .body{
  209. p{
  210. color: #fff;
  211. }
  212. }
  213. }
  214. }
  215. }
  216. </style>