HotCommodity.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <div class="container marketing hot-commodity">
  3. <div class="title">热销器件</div>
  4. <ul class="list-unstyled list-inline">
  5. <li class="hot-commodity-box" v-for="(component, index) in hotComponents" :class="{ 'border-right' : index % 5 == 4 }">
  6. <a :href="'/store/' + component.storeid + '/' + component.batchCode" target="_blank">
  7. <img :src="component.img || '/images/store/common/default.png'"/>
  8. <span>{{component.code}}</span>
  9. </a>
  10. </li>
  11. </ul>
  12. </div>
  13. </template>
  14. <script>
  15. export default {
  16. name: 'hot-commodity',
  17. data () {
  18. return {
  19. hotComponents: {}
  20. }
  21. },
  22. mounted () {
  23. this.$http.get('/api/cms-service/storeCms/inventory')
  24. .then(response => {
  25. this.hotComponents = response.data
  26. })
  27. },
  28. computed: {
  29. // hotComponents () {
  30. // return this.$store.state.provider.storeCms.hotComponents.data
  31. // }
  32. }
  33. }
  34. </script>
  35. <style scoped>
  36. .hot-commodity {
  37. margin-bottom: 40px;
  38. }
  39. .marketing .title {
  40. font-size: 24px;
  41. font-family: "Microsoft Yahei", "微软雅黑";
  42. line-height: 60px;
  43. height: 60px;
  44. font-weight: inherit;
  45. }
  46. .hot-commodity .hot-commodity-box {
  47. width: 238px;
  48. height: 239px;
  49. border-top: 1px solid #D6D3CE;
  50. border-left: 1px solid #D6D3CE;
  51. overflow: hidden;
  52. }
  53. .hot-commodity > ul > li {
  54. /*float: left;*/
  55. }
  56. .hot-commodity > ul > li:hover{
  57. border: #5078cb 1px solid;
  58. }
  59. .hot-commodity > ul > li:hover span{
  60. color: #5078cb;
  61. font-weight: bold;
  62. }
  63. .hot-commodity > ul > li:hover img{
  64. transform: scale(1.1);
  65. }
  66. .hot-commodity ul {
  67. border-bottom: 1px solid #D6D3CE;
  68. font-size: 0px;
  69. }
  70. .hot-commodity-box img {
  71. width: 238px;
  72. height: 180px;
  73. margin-top: 10px;
  74. }
  75. .hot-commodity-box span {
  76. font-size: 14px;
  77. font-family: "Microsoft Yahei", "微软雅黑";
  78. color: #333434;
  79. text-align: center;
  80. display: inline-block;
  81. width: 100%;
  82. height: 30px;
  83. line-height: 30px;
  84. margin-top: 12px;
  85. }
  86. .hot-commodity .border-right {
  87. border-right: 1px solid #D6D3CE;
  88. }
  89. </style>