BrandDetail.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <template>
  2. <div class="brand-detail">
  3. <div class="brand-logo">
  4. <img :src="brandDetail.logoUrl || '/images/component/default.png'" :alt="brandDetail.nameEn"/>
  5. </div>
  6. <div class="brand-switch-item">
  7. <span :class="activeType=='detail'?'mobile-switch-btn active':'mobile-switch-btn'" @click="activeType='detail'">品牌</span>
  8. <span :class="activeType=='product'?'mobile-switch-btn active':'mobile-switch-btn'" @click="activeType='product'">产品</span>
  9. </div>
  10. <div class="brand-param-list" v-if="activeType=='detail'">
  11. <div class="brand-param-item" v-if="brandDetail.series">
  12. <span class="remind-tag">| </span>
  13. <span>主营产品</span>
  14. <div class="main-sell">{{brandDetail.series}}</div>
  15. </div>
  16. <div class="brand-param-item" v-if="applications.length>0">
  17. <span class="remind-tag">| </span>
  18. <span>应用领域</span>
  19. <div class="main-sell">
  20. <span v-for="(item, index) in applications"><span>{{item}}</span><span v-show="index+1 < applications.length">|</span></span>
  21. </div>
  22. </div>
  23. <div class="brand-param-item" v-if="brandDetail.brief">
  24. <span class="remind-tag">| </span>
  25. <span>品牌介绍</span>
  26. <div class="main-sell">{{brandDetail.brief}}</div>
  27. </div>
  28. <div class="brand-param-item" v-if="brandDetail.url">
  29. <span class="remind-tag">| </span>
  30. <span>官网地址</span>
  31. <a class="brand-url" v-text="brandDetail.url"></a>
  32. </div>
  33. </div>
  34. <div class="brand-product-list" v-if="activeType=='product'">
  35. <ul>
  36. <li v-for="product in productList.content">
  37. <nuxt-link class="text-left" :to="'/mobile/brand/componentDetail/' + product.uuid">{{product.code}}</nuxt-link>
  38. <a class="text-right">规格书</a>
  39. </li>
  40. </ul>
  41. </div>
  42. </div>
  43. </template>
  44. <script>
  45. export default {
  46. name: 'MobileBrandsDetail',
  47. data () {
  48. return {
  49. applications: [],
  50. activeType: 'product'
  51. }
  52. },
  53. computed: {
  54. brandDetail () {
  55. let list = this.$store.state.brandDetail.detail.data
  56. if (list.application && list.application !== '') {
  57. this.applications = list.application.split(',')
  58. }
  59. return list
  60. },
  61. productList () {
  62. return this.$store.state.brandComponent.component.data || []
  63. }
  64. }
  65. }
  66. </script>
  67. <style lang="scss" scoped>
  68. .brand-detail {
  69. margin: 0 auto;
  70. text-align: center;
  71. .brand-logo {
  72. text-align: center;
  73. height: 2.21rem;
  74. line-height: 2.21rem;
  75. width: 3.73rem;
  76. display: inline-block;
  77. border: .01rem solid #e75610;
  78. margin: .38rem auto;
  79. img {
  80. max-height: 2.21rem;
  81. }
  82. }
  83. .brand-switch-item {
  84. text-align: center;
  85. .mobile-switch-btn {
  86. background: #e75610;
  87. color: #fff;
  88. display: inline-block;
  89. height: .68rem;
  90. font-size: .28rem;
  91. padding: .19rem .53rem;
  92. position: relative;
  93. &:first-child {
  94. background: #fff;
  95. color: #e75610;
  96. border: .01rem solid #e75610;
  97. border-left: none;
  98. padding-left: .30rem;
  99. }
  100. &:first-child.active {
  101. background: #e75610;
  102. color: #fff;
  103. border: .01rem solid #e75610;
  104. padding-left: .30rem;
  105. }
  106. &:last-child {
  107. background: #fff;
  108. color: #e75610;
  109. border: .01rem solid #e75610;
  110. border-right: none;
  111. padding-right: .35rem;
  112. }
  113. &:last-child.active {
  114. background: #e75610;
  115. color: #fff;
  116. border: .01rem solid #e75610;
  117. border-right: none;
  118. padding-right: .35rem;
  119. }
  120. &:first-child:before {
  121. content: '';
  122. background: #fff;
  123. border: .01rem solid #e75610;
  124. width: .64rem;
  125. height: .68rem;
  126. border-radius: 100%;
  127. position: absolute;
  128. left: -.33rem;
  129. top: -.01rem;
  130. z-index: -5;
  131. }
  132. &:first-child.active:before {
  133. content: '';
  134. background: #e75610;
  135. border: .01rem solid #e75610;
  136. width: .64rem;
  137. height: .68rem;
  138. border-radius: 100%;
  139. position: absolute;
  140. left: -.33rem;
  141. top: -.01rem;
  142. }
  143. &:last-child:before {
  144. content: '';
  145. background: #fff;
  146. width: .64rem;
  147. height: .68rem;
  148. border-radius: 100%;
  149. position: absolute;
  150. border: .01rem solid #e75610;
  151. left: 1.04rem;
  152. z-index: -5;
  153. top: -.01rem;
  154. }
  155. &:last-child.active:before {
  156. content: '';
  157. background: #e75610;
  158. width: .64rem;
  159. height: .68rem;
  160. border-radius: 100%;
  161. position: absolute;
  162. border: .01rem solid #e75610;
  163. left: 1.04rem;
  164. z-index: -5;
  165. top: -.01rem;
  166. }
  167. }
  168. }
  169. .brand-param-list {
  170. text-align: left;
  171. padding: 0 .44rem;
  172. margin-top: .28rem;
  173. .brand-param-item {
  174. font-size: .28rem;
  175. margin-bottom: .48rem;
  176. .remind-tag {
  177. color: rgb(4,198,96);
  178. font-size: .24rem;
  179. position: relative;
  180. bottom: .03rem;
  181. }
  182. .main-sell {
  183. color: #666;
  184. margin-top: .19rem;
  185. line-height: .4rem;
  186. max-height: 1.2rem;
  187. overflow: hidden;
  188. text-overflow: ellipsis;
  189. display: -webkit-box;
  190. -webkit-box-orient: vertical;
  191. -webkit-line-clamp: 3;
  192. }
  193. .brand-url {
  194. overflow: hidden;
  195. text-overflow: ellipsis;
  196. white-space: nowrap;
  197. color: #01a44e;
  198. margin-left: .28rem;
  199. }
  200. }
  201. }
  202. .brand-product-list {
  203. margin-top: .28rem;
  204. font-size: .28rem;
  205. ul {
  206. text-align: center;
  207. li {
  208. display: inline-block;
  209. width: 6.66rem;
  210. height: .66rem;
  211. line-height: .66rem;
  212. border: {
  213. top: 1px solid rgb(230,228,228);
  214. bottom: 1px solid rgb(230,228,228);
  215. }
  216. &:nth-child(even) {
  217. background: #f9f9f9;
  218. }
  219. .text-left {
  220. float: left;
  221. color: #333;
  222. }
  223. .text-right {
  224. float: right;
  225. color: #333;
  226. }
  227. }
  228. }
  229. }
  230. }
  231. </style>