index.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <div class="shops bg-F5">
  3. <div class="banner">
  4. <img src="@assets/sccj-banner.png" alt="" />
  5. </div>
  6. <div class="container ">
  7. <load-more
  8. url="/company/list"
  9. :params="params"
  10. v-slot="{
  11. item: {
  12. id,
  13. companyName,
  14. primaryBusiness,
  15. propagandaImgUrl,
  16. defaultImgUrl,
  17. goodsCount
  18. }
  19. }"
  20. >
  21. <router-link class="shop" :to="`/shop/${id}`">
  22. <img class="logo fl" :src="`${$basePath}${defaultImgUrl}`" />
  23. <div class="details fl">
  24. <div class="name">{{ companyName }}</div>
  25. <div class="desc">主营:{{ primaryBusiness }}</div>
  26. <div class="total">共计{{ goodsCount }}件商品</div>
  27. <span class="in">进入店铺</span>
  28. </div>
  29. <div
  30. class="img"
  31. v-for="(img, index) in getImgs(propagandaImgUrl)"
  32. :key="`img${index}`"
  33. >
  34. <img :src="`${$basePath}${img}`" />
  35. </div>
  36. </router-link>
  37. </load-more>
  38. </div>
  39. </div>
  40. </template>
  41. <script lang="ts">
  42. import { Component, Vue, Watch, Prop } from "vue-property-decorator";
  43. @Component
  44. export default class extends Vue {
  45. private params: IAny | null = null;
  46. @Prop(String) private kw!: string;
  47. @Watch("kw", { immediate: true })
  48. kwChange() {
  49. this.params = { companyName: this.kw };
  50. }
  51. getImgs(imgs: string) {
  52. return `${imgs}`.split(",");
  53. }
  54. }
  55. </script>
  56. <style lang="scss" scoped>
  57. .shops {
  58. .banner {
  59. width: 100%;
  60. height: 240px;
  61. line-height: 240px;
  62. color: #fff;
  63. font-size: 2rem;
  64. font-weight: bold;
  65. text-align: center;
  66. background: rgb(220, 220, 220);
  67. img {
  68. width: 100%;
  69. height: 100%;
  70. }
  71. }
  72. .shop {
  73. margin-top: 20px;
  74. background: #fff;
  75. overflow: hidden;
  76. height: 170px;
  77. box-sizing: border-box;
  78. padding: 30px 20px;
  79. display: block;
  80. .logo {
  81. width: 145px;
  82. margin-right: 40px;
  83. position: relative;
  84. top: 50%;
  85. transform: translateY(-50%);
  86. }
  87. .details {
  88. width: 330px;
  89. height: 114px;
  90. border-right: 1px solid #e5e5e5;
  91. font-size: 14px;
  92. .name {
  93. color: rgb(51, 51, 51);
  94. font-size: 16px;
  95. margin-bottom: 5px;
  96. }
  97. .desc {
  98. color: rgb(102, 102, 102);
  99. margin-bottom: 15px;
  100. }
  101. .total {
  102. color: #a5a5a5;
  103. margin-bottom: 5px;
  104. }
  105. .in {
  106. border: 1px solid #fd5522;
  107. color: #fd5522;
  108. display: inline-block;
  109. padding: 5px 10px;
  110. border-radius: 6px;
  111. }
  112. }
  113. .img {
  114. width: 114px;
  115. height: 114px;
  116. float: left;
  117. border: 1px #e5e5e5 solid;
  118. margin-left: 30px;
  119. position: relative;
  120. img {
  121. max-width: 80%;
  122. max-height: 80%;
  123. position: absolute;
  124. top: 50%;
  125. left: 50%;
  126. transform: translate(-50%, -50%);
  127. }
  128. }
  129. }
  130. }
  131. </style>