_uuid.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. <template>
  2. <div class="user-content">
  3. <div class="user-name">
  4. <img src="/images/component/default.png"/>
  5. <p>{{loadUserInfo.userName}}</p>
  6. <span @click="onclick()">{{listName}}<i class="iconfont icon-arrow-down"></i></span>
  7. <ul class="supdown" v-if="down">
  8. <li @click="onDown('-1')">店铺关注</li>
  9. <li @click="onDown('0')">器件收藏</li>
  10. <li @click="onDown('1')">全部收藏</li>
  11. </ul>
  12. </div>
  13. <div class="shop-list" v-if="isShop">
  14. <h3>{{}}</h3>
  15. <div class="list-item">
  16. <div class="item-img">
  17. <i></i>
  18. <img src="/images/component/default.png" alt="">
  19. </div>
  20. <div class="list-item-phone">
  21. <p>电话:<span>0755-1234567</span></p>
  22. <p>传真:<span>0755-1234567</span></p>
  23. <p>商家介绍: <nuxt-link to="/">点击查看</nuxt-link></p>
  24. <i class="iconfont icon-shoucang"></i>
  25. </div>
  26. </div>
  27. </div>
  28. <div class="detail-brand" v-for="(item, index) in collectSave.content" v-if="isDevice">
  29. <nuxt-link :to="'/mobile/brand/componentDetail/'+ item.componentinfo.uuid">
  30. <div class="brand-item">
  31. <p>型号:<span>{{item.componentinfo.code}}</span></p>
  32. <p>品牌:<span>{{item.componentinfo.brand.nameCn}}</span></p>
  33. <p>产品描述:<span>{{item.componentinfo.kind.nameCn}}</span></p>
  34. <i class="iconfont icon-shoucang"></i>
  35. </div>
  36. </nuxt-link>
  37. </div>
  38. </div>
  39. </template>
  40. <script>
  41. export default {
  42. layout: 'main',
  43. data () {
  44. return {
  45. userName: '',
  46. down: false,
  47. count: '',
  48. page: '',
  49. type: '',
  50. listName: '全部收藏',
  51. isShop: true,
  52. isDevice: true
  53. }
  54. },
  55. fetch ({ store }) {
  56. return Promise.all([
  57. store.dispatch('product/saveStores', { count: 25, page: 1, type: 'component' }),
  58. store.dispatch('loadUserInfo'),
  59. store.dispatch('shop/StoreFocusList', { count: 5, page: 1 })
  60. ])
  61. },
  62. methods: {
  63. onclick () {
  64. this.down = !this.down
  65. },
  66. onDown (type) {
  67. if (type === '-1') {
  68. this.listName = '店铺关注'
  69. this.isShop = true
  70. this.isDevice = false
  71. this.down = false
  72. }
  73. if (type === '0') {
  74. this.listName = '器件收藏'
  75. this.isDevice = true
  76. this.isShop = false
  77. this.down = false
  78. }
  79. if (type === '1') {
  80. this.listName = '全部收藏'
  81. this.isDevice = true
  82. this.isShop = true
  83. this.down = false
  84. }
  85. }
  86. },
  87. computed: {
  88. collectSave () {
  89. return this.$store.state.product.common.collectList.data
  90. },
  91. loadUserInfo () {
  92. return this.$store.state.option.user.data
  93. }
  94. }
  95. }
  96. </script>
  97. <style scoped lang="scss">
  98. .user-content{
  99. margin-bottom: .98rem;
  100. margin-top: .88rem;
  101. min-height: 10rem;
  102. background: #e2e4e6;
  103. .user-name{
  104. padding:.14rem .38rem .09rem .34rem;
  105. background:#fff;
  106. display:flex;
  107. align-items: center;
  108. width:100%;
  109. position:relative;
  110. .supdown{
  111. position:absolute;
  112. top:1rem;
  113. right:.3rem;
  114. z-index:1000;
  115. width:1.7rem;
  116. background:#616264;
  117. border-radius:.1rem;
  118. padding-left:.18rem;
  119. li{
  120. font-size: .28rem;
  121. color:#ffffff;
  122. height: .32rem;
  123. line-height: .32rem;
  124. margin: .2rem 0;
  125. }
  126. }
  127. img{
  128. display: inline-block;
  129. width:1.25rem;
  130. height:1.25rem;
  131. border:.04rem solid #c5dbfc;
  132. border-radius: .05rem;
  133. }
  134. p{
  135. font-size:.32rem;
  136. margin:0;
  137. margin-left:.25rem;
  138. flex:1;
  139. }
  140. span{
  141. font-size:.28rem;
  142. color:#53a0f7;
  143. }
  144. }
  145. .shop-list {
  146. background:#fff;
  147. margin-top:.12rem;
  148. padding-bottom:.28rem;
  149. h3{
  150. font-size:.32rem;
  151. line-height: .8rem;
  152. margin:0;
  153. margin-left:.27rem;
  154. margin-bottom:.14rem;
  155. }
  156. .list-item{
  157. width:6.77rem;
  158. margin-left:.39rem;
  159. justify-content: space-around;
  160. display:inline-flex;
  161. .item-img{
  162. width:2.42rem;
  163. i{
  164. display:block;
  165. position:absolute;
  166. width:.65rem;
  167. height:.33rem;
  168. background: url(/imgs/shop/daili@2x.png)no-repeat;
  169. background-size: .65rem .33rem;
  170. }
  171. img{
  172. border:.02rem solid #418bf6;
  173. width:2.4rem;
  174. height:1.69rem;
  175. }
  176. }
  177. .list-item-phone{
  178. width:3.95rem;
  179. padding-top:.18rem;
  180. position:relative;
  181. p{
  182. font-size:.28rem;
  183. line-height: .45rem;
  184. margin:0;
  185. }
  186. i{
  187. display:block;
  188. position:absolute;
  189. top:.1rem;
  190. right:.1rem;
  191. font-size:.4rem;
  192. color:#ff7800;
  193. }
  194. }
  195. }
  196. }
  197. .detail-brand{
  198. background: #f8fcff;
  199. width:100%;
  200. min-height:1.5rem;
  201. padding-top:.2rem;
  202. .brand-item{
  203. width:7rem;
  204. margin:0 auto;
  205. border-radius:.1rem;
  206. background: #fff;
  207. padding:.2rem;
  208. position:relative;
  209. &:active{
  210. background: #e1e1e1;
  211. }
  212. p{
  213. font-size:.28rem;
  214. line-height:.4rem;
  215. color:#333;
  216. margin:0;
  217. span{}
  218. }
  219. i{
  220. display:block;
  221. position:absolute;
  222. top:.2rem;
  223. right:.1rem;
  224. font-size:.4rem;
  225. color:#ff7800;
  226. }
  227. }
  228. div.active{
  229. background: #d4d;
  230. }
  231. }
  232. }
  233. </style>