OriginalDetail.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <div class="container original">
  3. <div class="hot-banner">
  4. <a><img src="/images/original/hot-banner.png" alt=""/></a>
  5. </div>
  6. <div class="hot-content">
  7. <div class="warp">
  8. <div class="hot-head"><img src="/images/original/hot.png">热销专区</div>
  9. <div class="hot-center clearfix">
  10. <div class="hot-center-1 clearfix">
  11. <div class="hot-pro" v-for="item in list1">
  12. <a :title="item.code" :href="'/store/' + item.storeid + '/' + item.batchCode" target="_blank">
  13. <p><img :src="item.img" alt=""></p>
  14. <span><em>{{item.code}}</em></span>
  15. </a>
  16. </div>
  17. </div>
  18. <div class="hot-center-2 clearfix">
  19. <ul>
  20. <li v-for="item in list2">
  21. <a :title="item.code" :href="'/store/' + item.storeid + '/' + item.batchCode" target="_blank">
  22. <p><img :src="item.img" alt=""></p>
  23. <span><em>{{item.code}}</em></span>
  24. </a>
  25. </li>
  26. </ul>
  27. </div>
  28. <div class="bg01 hot-head"><img src="/images/original/hot-new.png">人气新品</div>
  29. <div class="hot-center clearfix pad-b10">
  30. <div class="hot-center-1 clearfix">
  31. <div class="hot-pro" v-for="item in list3">
  32. <a title="" :title="item.code" :href="'/store/' + item.storeid + '/' + item.batchCode" target="_blank">
  33. <p><img :src="item.img" alt=""></p>
  34. <span><em>{{item.code}}</em></span>
  35. </a>
  36. </div>
  37. </div>
  38. <div class="hot-center-2 clearfix">
  39. <ul>
  40. <li v-for="item in list4">
  41. <nuxt-link title="" :to="'/store/' + item.storeid + '/' + item.batchCode" target="_blank">
  42. <p><img :src="item.img" alt=""></p>
  43. <span><em>{{item.code}}</em></span>
  44. </nuxt-link>
  45. </li>
  46. </ul>
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. </template>
  54. <script>
  55. import axios from '~plugins/axios'
  56. export default {
  57. name: 'OriginalDetail',
  58. data () {
  59. return {
  60. lists: {}
  61. }
  62. },
  63. mounted () {
  64. axios.get('/api/commodity/latest', {params: { length: 17 }})
  65. .then(response => {
  66. this.lists = response
  67. })
  68. },
  69. computed: {
  70. // lists () {
  71. // return this.$store.state.original.hot
  72. // },
  73. list1 () {
  74. if (this.lists.data) {
  75. return this.lists.data.slice(0, 3)
  76. }
  77. },
  78. list2 () {
  79. if (this.lists.data) {
  80. return this.lists.data.slice(3, 8)
  81. }
  82. },
  83. list3 () {
  84. if (this.lists.data) {
  85. return this.lists.data.slice(8, 11)
  86. }
  87. },
  88. list4 () {
  89. if (this.lists.data) {
  90. return this.lists.data.slice(11, 16)
  91. }
  92. }
  93. // list2 () {
  94. // return this.lists.data.slice(3, 8)
  95. // },
  96. // list3 () {
  97. // return this.lists.data.slice(8, 11)
  98. // },
  99. // list4 () {
  100. // return this.lists.data.slice(11, 16)
  101. // }
  102. }
  103. }
  104. </script>
  105. <style scoped>
  106. .original {box-sizing: border-box;padding: 0;margin:0;}
  107. .original {-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;}
  108. .original {font-size: 12px;background: #fff;color: #323232;}
  109. .original ol,table,tr,td,ul,li,dt,dd,dl,h1,h2,h3,h4,h5,h6,form,input,select,textarea,p,em,i,b,strong,span{font-size: 12px;font-weight: normal;list-style-type:none;font-style: inherit;}
  110. .original a{text-decoration: none; color: #323232;}
  111. .original a:hover{text-decoration: none;}
  112. .original img{border: none;}
  113. .original input,button,select,textarea{outline:none}
  114. .original .clearfix:before,.clearfix:after{display:table;content:'';line-height:0;}
  115. .original .clearfix:after{clear:both;}
  116. .original .clear{clear:both;}
  117. .original .fl{float: left;}
  118. .original .fr{float: right;}
  119. .original .textmore{display: block;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}
  120. .original .no-space{display: flex;}
  121. /*热卖产品*/
  122. .original {width:100%;margin:0 auto;}
  123. .original .hot-banner{width: 100%;height: 336px;background: #ce1a39;text-align: center;line-height: 336px;/* margin-bottom: 16px;*/}
  124. .original .hot-banner img{vertical-align: middle; width: 1190px;height: 336px;}
  125. .original .hot-content{width: 100%;margin: 0 auto;}
  126. .original .hot-content .warp{width: 100%; margin: 0 auto;}
  127. .original .hot-content .hot-head{width: 100%;margin: 0 auto;height: 76px;line-height:90px;background: url("/images/original/hot-headbg.png") no-repeat center center;text-align: center;color: #ffc600;font-size: 28px;}
  128. .original .hot-center{width: 1190px;margin: 0 auto;background: #d1e0fe;padding-top: 10px;}
  129. .original .hot-center-1{width:1176px;margin: 0 auto;}
  130. .original .hot-center-1 .hot-pro, .hot-center-1 .hot-pro a{width: 386px;height: 408px;float: left;display: inline-block;background: #fff;}
  131. .original .hot-center-1 .hot-pro p{width: 100%;height: 344px;margin: 0;text-align: center;line-height: 344px;overflow: hidden;}
  132. .original .hot-center-1 .hot-pro p img{vertical-align: middle; max-width: 300px;max-height: 300px;}
  133. .original .hot-center-1 .hot-pro span{width: 386px;height: 64px;display: inline-block;text-align: center;background: #f2f1f2;overflow: hidden;}
  134. .original .hot-center-1 .hot-pro span em{width: 90%;height: 64px;font-size: 18px;margin: 0 auto;line-height: 64px;color: #787878;display: inline-block;}
  135. .original .hot-center-1 .hot-pro span em.line01{line-height: 64px;margin-top: 0;}
  136. .original .hot-center-1 .hot-pro a:hover p{border: #5078cb 1px solid;}
  137. .original .hot-center-1 .hot-pro a:hover img{transform: scale(1.1); transition: transform 0.1s ease-in;}
  138. .original .hot-center-1 .hot-pro a:hover span{background: #5078cb; transition: background .1s ease-out;}
  139. .original .hot-center-1 .hot-pro a:hover span em{color: #fff;}
  140. .original .hot-center-1 .hot-pro{margin-right: 8px;}
  141. .original .hot-center-1 .hot-pro:last-child{margin-right: 0 !important;}
  142. .original .hot-center-2{width:1176px;margin: 0 auto;margin-top: 16px;background: #fff;}
  143. .original .hot-center-2 ul{width: 100%;margin: 0 auto;padding: 0;}
  144. .original .hot-center-2 ul li{width: 20%;float: left;text-align: center;height:352px;}
  145. .original .hot-center-2 ul li a{width: 100%;height: 100%;display: inline-block;}
  146. .original .hot-center-2 ul li p{width: 100%;height: 260px;display: inline-block;text-align: center;line-height: 250px;overflow: hidden;}
  147. .original .hot-center-2 ul li p img{vertical-align: middle; max-width: 132px;}
  148. .original .hot-center-2 ul li span{width: 100%;height:92px;display: inline-block;text-align: center;overflow: hidden;}
  149. .original .hot-center-2 ul li span em{width: 90%;font-size: 18px;margin: 0 auto;line-height: 25px;color: #787878;display: inline-block;margin-top: 20px;}
  150. .original .hot-center-2 ul li a:hover p img{transform: scale(1.1);}
  151. .original .hot-center-2 ul li a:hover span em{color: #5078cb;}
  152. .original .hot-center-2 ul li a:hover{border: #5078cb 1px solid;}
  153. .original .hot-center-2 ul li a span em.line02{line-height: 92px;margin-top: 0;}
  154. .original .pad-b10{ padding-bottom: 10px;}
  155. </style>