ToggleStore.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. <template>
  2. <div class="toggleStore">
  3. <!--寄售-->
  4. <div class="sale list-item" @click="open('/store/33069557578d44e69bd91ad12d28a8d4')">
  5. <div class="header">
  6. <div class="kind"><span></span>优软寄售</div>
  7. <a class="enter" @click="open('/store/33069557578d44e69bd91ad12d28a8d4')">进入店铺 <i class="fa fa-angle-right"></i></a>
  8. </div>
  9. <div class="body">
  10. <p>海量库存、不赚差价</p>
  11. </div>
  12. </div>
  13. <!--原厂-->
  14. <div class="factory list-item" :class="{active: storeType === 'factory'}" @click="toggleStore('factory')">
  15. <div class="header">
  16. <div class="kind"><span></span>原&nbsp;&nbsp;&nbsp;&nbsp;厂</div>
  17. <div class="count">
  18. <span>已入驻</span>
  19. <div class="count_num">
  20. <span v-for="item in formatNumber(originalCount, 4)" v-text="item">1</span>
  21. </div>
  22. </div>
  23. </div>
  24. <div class="body">
  25. <p>原厂直营,品质保障</p>
  26. </div>
  27. </div>
  28. <!--代理经销-->
  29. <div class="agent list-item" :class="{active: storeType === 'origin'}" @click="toggleStore('origin')">
  30. <div class="header">
  31. <div class="kind"><span></span>代理经销</div>
  32. <div class="count">
  33. <span>已入驻</span>
  34. <div class="count_num">
  35. <span v-for="item in formatNumber(storeCount, 4)" v-text="item">1</span>
  36. </div>
  37. </div>
  38. </div>
  39. <div class="body">
  40. <p>百强代理,一站找齐</p>
  41. </div>
  42. </div>
  43. <!--供应商-->
  44. <div class="agent list-item" :class="{active: storeType === 'supplier'}" @click="toggleStore('supplier')">
  45. <div class="header">
  46. <div class="kind"><span></span>供应商</div>
  47. <div class="count">
  48. <span>已入驻</span>
  49. <div class="count_num">
  50. <span v-for="item in formatNumber(storeCount, 4)" v-text="item">1</span>
  51. </div>
  52. </div>
  53. </div>
  54. <div class="body">
  55. <p>产业资源,免费共享</p>
  56. </div>
  57. </div>
  58. <!--品牌墙-->
  59. <div class="agent list-item" :class="{active: storeType === 'brand'}" @click="toggleStore('brand')">
  60. <div class="header">
  61. <div class="kind"><span></span>品牌墙</div>
  62. <div class="count">
  63. <span>已入驻</span>
  64. <div class="count_num">
  65. <span v-for="item in formatNumber(storeCount, 4)" v-text="item">1</span>
  66. </div>
  67. </div>
  68. </div>
  69. <div class="body">
  70. <p>全球品牌,自由筛选</p>
  71. </div>
  72. </div>
  73. </div>
  74. </template>
  75. <script>
  76. export default {
  77. name: 'excellent-suppliers',
  78. computed: {
  79. storeType () {
  80. return this.$store.state.provider.stores.storeType.data
  81. },
  82. store () {
  83. return this.$store.state.provider.storeCms.recommendStore.data
  84. },
  85. storeCount () {
  86. return this.$store.state.provider.stores.storeCount.data
  87. },
  88. originalCount () {
  89. return this.$store.state.provider.stores.originalCount.data
  90. }
  91. },
  92. mounted () {
  93. if (this.$route.path === '/product/brand/brandList') {
  94. this.$store.commit('provider/stores/SET_STORETYPE', type)
  95. }
  96. },
  97. methods: {
  98. // 切换Store
  99. toggleStore (type) {
  100. if (type === this.storeType) return
  101. this.$store.commit('provider/stores/SET_STORETYPE', type)
  102. this.$store.dispatch('loadBanners', {type: type + '_banner_carousel'})
  103. this.$store.dispatch('provider/findSimilarStoreList', { page: 1, count: 10, type: type === 'factory' ? 'ORIGINAL_FACTORY' : 'AGENCY-DISTRIBUTION' })
  104. if (type === 'brand') {
  105. this.$router.push('/product/brand/brandList/A')
  106. } else {
  107. if (type === 'origin') {
  108. this.$store.commit('provider/stores/SET_STORETYPE', 'origin')
  109. }
  110. if (type === 'supplier') {
  111. this.$store.commit('provider/stores/SET_STORETYPE', 'supplier')
  112. }
  113. if (type === 'factory') {
  114. this.$store.commit('provider/stores/SET_STORETYPE', 'factory')
  115. }
  116. this.$router.push('/provider/shop')
  117. }
  118. },
  119. // 店铺入驻数量
  120. formatNumber (num, key) {
  121. let count = ('0000' + num).substr(-key)
  122. let _arr = []
  123. for (var i = 0; i < count.length; i++) {
  124. _arr.push(count[i])
  125. }
  126. return _arr
  127. },
  128. // 寄售
  129. open (url) {
  130. window.open(url)
  131. }
  132. }
  133. }
  134. </script>
  135. <style lang="scss" scoped>
  136. .toggleStore {
  137. float: left;
  138. width: 220px;
  139. height: 402px;
  140. padding: 0;
  141. .list-item{
  142. width: 100%;
  143. height: 81px;
  144. background: #fff;
  145. border-bottom: 1px solid #ece9ec;
  146. .header {
  147. overflow: hidden;
  148. padding: 10px 8px 0;
  149. .kind{
  150. float: left;
  151. font-size: 16px;
  152. font-weight: bold;
  153. color: #2496f1;
  154. span{
  155. display: inline-block;
  156. margin-right: 4px;
  157. width: 6px;
  158. height: 12px;
  159. background: url('/images/original/angle-blue.png') no-repeat;
  160. }
  161. }
  162. .count{
  163. overflow: hidden;
  164. float: right;
  165. padding: 0 5px;
  166. width: 120px;
  167. height: 26px;
  168. line-height: 24px;
  169. background-color: #fff;
  170. border-radius: 2px;
  171. border: solid 1px #bfbfbf;
  172. span {
  173. float: left;
  174. margin-right: 4px;
  175. font-size: 12px;
  176. letter-spacing: 0;
  177. color: #666;
  178. }
  179. .count_num{
  180. float: left;
  181. margin-top: 3px;
  182. span{
  183. display: inline-block;
  184. width: 14px;
  185. height: 18px;
  186. line-height: 18px;
  187. font-size: 12px;
  188. color: #fff;
  189. text-align: center;
  190. background-color: #a1a0a0;
  191. border-radius: 2px;
  192. &:last-child{
  193. margin-right: 0;
  194. }
  195. }
  196. }
  197. }
  198. .enter{
  199. float: right;
  200. display: inline-block;
  201. width: 72px;
  202. height: 22px;
  203. line-height: 20px;
  204. text-align: center;
  205. font-size: 12px;
  206. color: #2496f1;
  207. background-color: #ffffff;
  208. border-radius: 11px;
  209. border: solid 1px #2496f1;
  210. i{
  211. font-size: 16px;
  212. }
  213. &:hover{
  214. color: #fff;
  215. background: #2496f1;
  216. border: solid 1px #2496f1;
  217. }
  218. }
  219. }
  220. .body {
  221. margin-top: 15px;
  222. padding: 0 20px 0;
  223. p{
  224. width: 195px;
  225. overflow: hidden;
  226. white-space: nowrap;
  227. text-overflow: ellipsis;
  228. font-size: 14px;
  229. letter-spacing: 0;
  230. color: #666666;
  231. }
  232. }
  233. &:hover, &.active{
  234. background: #fa9819;
  235. cursor: pointer;
  236. .kind {
  237. color: #fff;
  238. span{
  239. background: url('/images/original/angle-white.png') no-repeat;
  240. }
  241. }
  242. .count{
  243. background-color: #d87c05;
  244. border: solid 1px #d87c05;
  245. span {
  246. color: #fff;
  247. }
  248. .count_num{
  249. span{
  250. color: #626364;
  251. background-color: #fff;
  252. }
  253. }
  254. }
  255. .body{
  256. p{
  257. color: #fff;
  258. }
  259. }
  260. }
  261. }
  262. .factory {
  263. border-top-left-radius: 5px;
  264. border-top-right-radius: 5px;
  265. }
  266. .sale{
  267. border-bottom-left-radius: 5px;
  268. border-bottom-right-radius: 5px;
  269. }
  270. }
  271. </style>