ToggleStore.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  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(supplierArr, 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(brandArr, 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. data () {
  79. return {
  80. supplierArr: [],
  81. brandArr: []
  82. }
  83. },
  84. computed: {
  85. storeType () {
  86. console.log(this.$route.params.type, '1111')
  87. return this.$route.params.type
  88. },
  89. store () {
  90. return this.$store.state.provider.storeCms.recommendStore.data
  91. },
  92. storeCount () {
  93. return this.$store.state.provider.stores.storeCount.data
  94. },
  95. originalCount () {
  96. return this.$store.state.provider.stores.originalCount.data
  97. },
  98. count () {
  99. // let allCount = this.$store.state.option.counter.data ? this.$store.state.option.counter.data : []
  100. // allCount.forEach((value) => {
  101. // if (value.item === '供应商') {
  102. // this.supplierArr.push(value.count)
  103. // }
  104. // if (value.item === '品 牌') {
  105. // this.brandArr.push(value.count)
  106. // }
  107. // })
  108. }
  109. },
  110. mounted () {
  111. this.$nextTick(() => {
  112. this.count
  113. })
  114. },
  115. create () {
  116. this.$store.dispatch('loadCounterData')
  117. },
  118. methods: {
  119. // 切换Store
  120. toggleStore (type) {
  121. if (type === this.storeType) return
  122. this.$store.dispatch('loadBanners', {type: type + '_banner_carousel'})
  123. this.$store.dispatch('provider/findSimilarStoreList', { page: 1, count: 10, type: type === 'factory' ? 'ORIGINAL_FACTORY' : 'AGENCY-DISTRIBUTION' })
  124. if (type === 'brand') {
  125. this.$router.push('/eCommerce/home/brand/?initial=A')
  126. }
  127. if (type === 'supplier') {
  128. this.$router.push('/eCommerce/home/supplier')
  129. }
  130. if (type === 'factory') {
  131. this.$router.push('/eCommerce/home/factory')
  132. }
  133. if (type === 'origin') {
  134. this.$router.push('/eCommerce/home/origin')
  135. }
  136. },
  137. // 店铺入驻数量
  138. formatNumber (num, key) {
  139. let count = ('0000' + num).substr(-key)
  140. let _arr = []
  141. for (var i = 0; i < count.length; i++) {
  142. _arr.push(count[i])
  143. }
  144. return _arr
  145. },
  146. // 寄售
  147. open (url) {
  148. window.open(url)
  149. }
  150. }
  151. }
  152. </script>
  153. <style lang="scss" scoped>
  154. .toggleStore {
  155. float: left;
  156. width: 220px;
  157. height: 402px;
  158. padding: 0;
  159. .list-item{
  160. width: 100%;
  161. height: 81px;
  162. background: #fff;
  163. border-bottom: 1px solid #ece9ec;
  164. .header {
  165. overflow: hidden;
  166. padding: 10px 8px 0;
  167. .kind{
  168. float: left;
  169. font-size: 16px;
  170. font-weight: bold;
  171. color: #2496f1;
  172. span{
  173. display: inline-block;
  174. margin-right: 4px;
  175. width: 6px;
  176. height: 12px;
  177. background: url('/images/original/angle-blue.png') no-repeat;
  178. }
  179. }
  180. .count{
  181. overflow: hidden;
  182. float: right;
  183. padding: 0 5px;
  184. width: 120px;
  185. height: 26px;
  186. line-height: 24px;
  187. background-color: #fff;
  188. border-radius: 2px;
  189. border: solid 1px #bfbfbf;
  190. span {
  191. float: left;
  192. margin-right: 4px;
  193. font-size: 12px;
  194. letter-spacing: 0;
  195. color: #666;
  196. }
  197. .count_num{
  198. float: left;
  199. margin-top: 3px;
  200. span{
  201. display: inline-block;
  202. width: 14px;
  203. height: 18px;
  204. line-height: 18px;
  205. font-size: 12px;
  206. color: #fff;
  207. text-align: center;
  208. background-color: #a1a0a0;
  209. border-radius: 2px;
  210. &:last-child{
  211. margin-right: 0;
  212. }
  213. }
  214. }
  215. }
  216. .enter{
  217. float: right;
  218. display: inline-block;
  219. width: 72px;
  220. height: 22px;
  221. line-height: 20px;
  222. text-align: center;
  223. font-size: 12px;
  224. color: #2496f1;
  225. background-color: #ffffff;
  226. border-radius: 11px;
  227. border: solid 1px #2496f1;
  228. i{
  229. font-size: 16px;
  230. }
  231. &:hover{
  232. color: #fff;
  233. background: #2496f1;
  234. border: solid 1px #2496f1;
  235. }
  236. }
  237. }
  238. .body {
  239. margin-top: 15px;
  240. padding: 0 20px 0;
  241. p{
  242. width: 195px;
  243. overflow: hidden;
  244. white-space: nowrap;
  245. text-overflow: ellipsis;
  246. font-size: 14px;
  247. letter-spacing: 0;
  248. color: #666666;
  249. }
  250. }
  251. &:hover, &.active{
  252. background: #fa9819;
  253. cursor: pointer;
  254. .kind {
  255. color: #fff;
  256. span{
  257. background: url('/images/original/angle-white.png') no-repeat;
  258. }
  259. }
  260. .count{
  261. background-color: #d87c05;
  262. border: solid 1px #d87c05;
  263. span {
  264. color: #fff;
  265. }
  266. .count_num{
  267. span{
  268. color: #626364;
  269. background-color: #fff;
  270. }
  271. }
  272. }
  273. .body{
  274. p{
  275. color: #fff;
  276. }
  277. }
  278. }
  279. }
  280. .factory {
  281. border-top-left-radius: 5px;
  282. border-top-right-radius: 5px;
  283. }
  284. .sale{
  285. border-bottom-left-radius: 5px;
  286. border-bottom-right-radius: 5px;
  287. }
  288. }
  289. </style>