金诚优选前端代码
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.

109 lines
2.0 KiB

  1. <template>
  2. <view class="content">
  3. <view class="title" v-if="showTitle" @click="$url('/pages/index/category/category')">{{ title }}</view>
  4. <view class="flex-box">
  5. <view class="item" v-for="(item, index) in list" :key="index"
  6. @click="$url('/pages/shop/shopdetail?id='+ item.associate.id)">
  7. <image class="bg-img" :src="item.image"></image>
  8. <view class="shop">
  9. <image :src="item.associate.logo"></image>
  10. <view class="lf-line-1">{{ item.associate.name }}</view>
  11. </view>
  12. </view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. props: {
  19. list: {
  20. type: Array,
  21. default: []
  22. },
  23. showTitle: {
  24. type: [Number, Boolean],
  25. default: 1
  26. },
  27. title: {
  28. type: String,
  29. default: '大牌不停推'
  30. }
  31. },
  32. data(){
  33. return {
  34. }
  35. },
  36. created(){
  37. },
  38. methods: {
  39. }
  40. }
  41. </script>
  42. <style lang="scss" scoped="scoped">
  43. .content{
  44. width: 750rpx;
  45. height: max-content;
  46. box-sizing: border-box;
  47. padding: 60rpx 32rpx 0;
  48. .title{
  49. font-size: 36rpx;
  50. font-weight: bold;
  51. text-align: center;
  52. color: #222222;
  53. margin-bottom: 30rpx;
  54. }
  55. .flex-box{
  56. display: flex;
  57. flex-wrap: wrap;
  58. .item{
  59. width: 165rpx;
  60. height: 165rpx;
  61. border: 1rpx solid #979797;
  62. margin-right: 9rpx;
  63. position: relative;
  64. &:nth-child(4n){
  65. margin-right: 0rpx;
  66. }
  67. &:nth-child(n+5){
  68. margin-top: 8rpx;
  69. }
  70. .bg-img{
  71. position: absolute;
  72. top: 0;
  73. left: 0;
  74. width: 100%;
  75. height: 100%;
  76. }
  77. .shop{
  78. width: 100%;
  79. height: 100%;
  80. background-color: rgba(0,0,0,0.1);
  81. display: flex;
  82. flex-direction: column;
  83. justify-content: center;
  84. align-items: center;
  85. position: relative;
  86. z-index: 2;
  87. &>image{
  88. width: 70rpx;
  89. height: 70rpx;
  90. border-radius: 50%;
  91. background-color: #FFFFFF;
  92. }
  93. &>view{
  94. font-size: 24rpx;
  95. color: #FFFFFF;
  96. margin-top: 4rpx;
  97. width: 100%;
  98. text-align: center;
  99. }
  100. }
  101. }
  102. }
  103. }
  104. </style>