ToggleStore.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  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 v-for="item in formatNumber(originalCount, 4)" v-text="item">1</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 v-for="item in formatNumber(storeCount, 4)" v-text="item">1</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" @click="open('/store/33069557578d44e69bd91ad12d28a8d4')">
  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.stores.storeCount.data
  63. },
  64. originalCount () {
  65. return this.$store.state.provider.stores.originalCount.data
  66. }
  67. },
  68. methods: {
  69. // 切换Store
  70. toggleStore (type) {
  71. this.$store.commit('provider/stores/SET_STORETYPE', type)
  72. this.$store.dispatch('loadBanners', {type: type + '_banner_carousel'})
  73. this.$store.dispatch('provider/findSimilarStoreList', { page: 1, count: 10, type: type === 'factory' ? 'ORIGINAL_FACTORY' : 'AGENCY-DISTRIBUTION' })
  74. },
  75. // 店铺入驻数量
  76. formatNumber (num, key) {
  77. let count = ('0000' + num).substr(-key)
  78. let _arr = []
  79. for (var i = 0; i < count.length; i++) {
  80. _arr.push(count[i])
  81. }
  82. return _arr
  83. },
  84. // 寄售
  85. open (url) {
  86. window.open(url)
  87. }
  88. }
  89. }
  90. </script>
  91. <style lang="scss" scoped>
  92. .toggleStore {
  93. float: left;
  94. width: 220px;
  95. height: 402px;
  96. padding: 0;
  97. .list-item{
  98. width: 100%;
  99. height: 134px;
  100. background: #fff;
  101. border-bottom: 1px solid #ece9ec;
  102. .header {
  103. overflow: hidden;
  104. padding: 10px 8px 0;
  105. .kind{
  106. float: left;
  107. font-size: 16px;
  108. font-weight: bold;
  109. color: #2496f1;
  110. span{
  111. display: inline-block;
  112. margin-right: 4px;
  113. width: 6px;
  114. height: 12px;
  115. background: url('/images/original/angle-blue.png') no-repeat;
  116. }
  117. }
  118. .count{
  119. overflow: hidden;
  120. float: right;
  121. padding: 0 5px;
  122. width: 120px;
  123. height: 26px;
  124. line-height: 24px;
  125. background-color: #fff;
  126. border-radius: 2px;
  127. border: solid 1px #bfbfbf;
  128. span {
  129. float: left;
  130. margin-right: 4px;
  131. font-size: 12px;
  132. letter-spacing: 0;
  133. color: #666;
  134. }
  135. .count_num{
  136. float: left;
  137. margin-top: 3px;
  138. span{
  139. display: inline-block;
  140. width: 14px;
  141. height: 18px;
  142. line-height: 18px;
  143. font-size: 12px;
  144. color: #fff;
  145. text-align: center;
  146. background-color: #a1a0a0;
  147. border-radius: 2px;
  148. &:last-child{
  149. margin-right: 0;
  150. }
  151. }
  152. }
  153. }
  154. .enter{
  155. float: right;
  156. display: inline-block;
  157. width: 72px;
  158. height: 22px;
  159. line-height: 20px;
  160. text-align: center;
  161. font-size: 12px;
  162. color: #2496f1;
  163. background-color: #ffffff;
  164. border-radius: 11px;
  165. border: solid 1px #2496f1;
  166. i{
  167. font-size: 16px;
  168. }
  169. &:hover{
  170. color: #fff;
  171. background: #2496f1;
  172. border: solid 1px #2496f1;
  173. }
  174. }
  175. }
  176. .body {
  177. margin-top: 15px;
  178. padding: 0 20px 0;
  179. p{
  180. width: 195px;
  181. overflow: hidden;
  182. white-space: nowrap;
  183. text-overflow: ellipsis;
  184. font-size: 14px;
  185. letter-spacing: 0;
  186. color: #666666;
  187. }
  188. }
  189. &:hover, &.active{
  190. background: #fa9819;
  191. cursor: pointer;
  192. .kind {
  193. color: #fff;
  194. span{
  195. background: url('/images/original/angle-white.png') no-repeat;
  196. }
  197. }
  198. .count{
  199. background-color: #d87c05;
  200. border: solid 1px #d87c05;
  201. span {
  202. color: #fff;
  203. }
  204. .count_num{
  205. span{
  206. color: #626364;
  207. background-color: #fff;
  208. }
  209. }
  210. }
  211. .body{
  212. p{
  213. color: #fff;
  214. }
  215. }
  216. }
  217. }
  218. }
  219. </style>