多租户商城-商户小程序端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

116 lines
3.0 KiB

  1. <template>
  2. <div class="productGroup-list warp" :class="'terminal' + terminal">
  3. <h2 class="hom-title" :style="{textAlign:componentContent.textAlign}" v-if="componentContent.title">{{componentContent.title}}</h2>
  4. <div class="content-warp" v-if="componentContent.showType == 1">
  5. <div class="item" @click="jumpProductGroup(item)" v-for="(item) of componentContent.productGroupData" :key="item.id">
  6. <div class="imgBox">
  7. <img ref="getHeight" :src="item.img" v-show="item.img" :alt="item.data.groupName">
  8. </div>
  9. </div>
  10. </div>
  11. <div class="content-parent-warp" v-if="componentContent.showType == 2">
  12. <div class="content-list-warp">
  13. <div class="item" @click="jumpProductGroup(item)" v-for="(item) of componentContent.productGroupData" :key="item.id">
  14. <div class="imgBox">
  15. <img ref="getHeight" :src="item.img" v-show="item.img" :alt="item.data.groupName">
  16. </div>
  17. </div>
  18. </div>
  19. </div>
  20. </div>
  21. </template>
  22. <script>
  23. import {funMixin} from '../config/mixin'
  24. export default {
  25. name: 'productGroupList',
  26. mixins: [funMixin],
  27. props: {
  28. terminal: {
  29. type: Number,
  30. default: 4
  31. },
  32. componentContent: {
  33. type: Object
  34. }
  35. }
  36. }
  37. </script>
  38. <style lang="scss" scoped>
  39. .productGroup-list{
  40. padding: 20upx 0;
  41. .hom-title{
  42. font-size: 22upx;
  43. color: #333;
  44. line-height: 1em;
  45. margin-bottom: 23upx;
  46. font-weight: bold;
  47. text-align: center;
  48. }
  49. .content-warp{
  50. display: flex;
  51. flex-wrap: wrap;
  52. margin: 0upx 40upx 0upx 30upx;
  53. -webkit-box-orient: horizontal;
  54. -webkit-box-direction: normal;
  55. -ms-flex-direction: row;
  56. flex-direction: row;
  57. -ms-flex-line-pack: center;
  58. align-content: center;
  59. -webkit-box-pack: center;
  60. -ms-flex-pack: center;
  61. justify-content: center;
  62. -webkit-box-align: center;
  63. -ms-flex-align: center;
  64. align-items: center;
  65. -webkit-box-sizing: border-box;
  66. box-sizing: border-box;
  67. .item{
  68. width: 25%;
  69. height: auto;
  70. padding-left: 10upx;
  71. .imgBox {
  72. position: relative;
  73. }
  74. img {
  75. width: 100%;
  76. }
  77. }
  78. }
  79. .content-parent-warp{
  80. display: -webkit-box;
  81. -webkit-box-orient: horizontal;
  82. -webkit-box-direction: normal;
  83. -webkit-box-pack: center;
  84. -webkit-box-align: center;
  85. -webkit-box-sizing: border-box;
  86. box-sizing: border-box;
  87. overflow-x: auto;
  88. .content-list-warp{
  89. width: auto;
  90. display: flex;
  91. flex-direction: row;
  92. flex-wrap: nowrap;
  93. align-content: center;
  94. justify-content: center;
  95. align-items: center;
  96. .item{
  97. width: 300upx;
  98. height: auto;
  99. padding-left: 10upx;
  100. .imgBox {
  101. position: relative;
  102. }
  103. img {
  104. width: 100%;
  105. }
  106. }
  107. }
  108. }
  109. }
  110. </style>