BrandList.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <div>
  3. <div id="brandsList" class="container">
  4. <div id="brands">
  5. <div v-for="(brands, initial) in brandList" class="row container brands-page">
  6. <div class="brands-title">{{initial}}</div>
  7. <div class="hr-blue"></div>
  8. <div class="row brands-body">
  9. <div class="simplebrand" v-for="brand in brands">
  10. <div class="brand-name">
  11. <nuxt-link :to="`/product/brand/${brand.uuid}/`">
  12. <span>{{brand.nameEn}}</span>
  13. </nuxt-link>
  14. </div>
  15. <div>
  16. <nuxt-link :to="`/product/brand/${brand.uuid}/`" v-if="brand.nameEn!=brand.nameCn">
  17. <span class="brand-name-cn">{{brand.nameCn}}</span>
  18. </nuxt-link>
  19. </div>
  20. </div>
  21. </div>
  22. </div>
  23. </div>
  24. </div>
  25. </div>
  26. </template>
  27. <script>
  28. // function sortList(letter) {
  29. // return function(a, b) {
  30. // var value1 = a[letter]
  31. // var value2 = b[letter]
  32. // if (value1 > value2) {
  33. // return 1
  34. // } else if (value1 < value2) {
  35. // return -1
  36. // } else {
  37. // return 0
  38. // }
  39. // }
  40. // }
  41. export default {
  42. name: 'brandList',
  43. computed: {
  44. brandList() {
  45. let brandsList = this.baseUtils.deepCopy(this.$store.state.product.brand.brandList.data)
  46. // console.log(this.$store.state.product.brand.brandList.data)
  47. // if (brandsList) {
  48. // for (let i in brandsList) {
  49. // brandsList[i] = brandsList[i].sort(sortList('nameEn'))
  50. // }
  51. // }
  52. let temp = {}
  53. let keys = []
  54. for (let key in brandsList) {
  55. keys.push(key)
  56. }
  57. keys = keys.sort()
  58. for (let i = 0; i < keys.length; i++) {
  59. temp[keys[i]] = brandsList[keys[i]]
  60. }
  61. return temp
  62. }
  63. }
  64. }
  65. </script>
  66. <style>
  67. /** brandList*/
  68. #brandsList {
  69. clear: both;
  70. width: 1190px;
  71. padding: 0;
  72. }
  73. #brandsList .hr-blue {
  74. border-bottom: 2px solid #6493ff;
  75. border-right: 0;
  76. border-top: 0;
  77. border-left: 0;
  78. width: 100%;
  79. }
  80. #brandsList .initials {
  81. margin-top: 3px;
  82. }
  83. #brandsList .row {
  84. margin: 20px 0;
  85. }
  86. #brandsList .row .initial {
  87. display: inline-block;
  88. margin: 0 5px;
  89. font-size: 16px;
  90. color: #787878;
  91. }
  92. #brandsList .row .initial:hover a,
  93. #brandsList .row li.initial.active a {
  94. color: #5078cb;
  95. font-weight: bold;
  96. cursor: pointer;
  97. }
  98. #brandsList .row .initial-active {
  99. color: #5078cb;
  100. font-weight: bold;
  101. }
  102. #brandsList .row .initial a {
  103. font-size: 16px;
  104. color: #787878;
  105. }
  106. #brandsList .row .initial:hover a {
  107. color: #5078cb;
  108. font-weight: bold;
  109. cursor: pointer;
  110. }
  111. #brands .container {
  112. width: 1190px;
  113. padding: 0px;
  114. }
  115. #brands .row .brands-title {
  116. width: 70px;
  117. height: 30px;
  118. padding-top: 5px;
  119. text-align: center;
  120. font-size: 16px;
  121. color: #fff;
  122. background-color: #6493ff;
  123. }
  124. #brands .row .brands-body {
  125. margin-bottom: 30px;
  126. font-size: 14px;
  127. color: #323232;
  128. }
  129. #brands .simplebrand {
  130. height: 30px;
  131. margin: 13px 0px;
  132. width: 25%;
  133. float: left;
  134. }
  135. #brands .simplebrand a {
  136. color: #323232;
  137. text-decoration: none;
  138. }
  139. #brands .simplebrand:hover a {
  140. color: #6493ff;
  141. font-weight: bold;
  142. }
  143. #brands .simplebrand .brand-name {
  144. margin-bottom: 2px;
  145. }
  146. #brands .simplebrand .brand-name-cn {
  147. font-size: 12px;
  148. }
  149. #brandsList ul {
  150. padding-left: 0px;
  151. }
  152. #brandsList ul li {
  153. list-style: none;
  154. }
  155. #carousel li {
  156. width: 12px;
  157. height: 12px;
  158. margin: 3px;
  159. }
  160. </style>