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

111 lines
2.0 KiB

4 years ago
  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. overflow: hidden;
  65. border-radius: 5rpx;
  66. &:nth-child(4n){
  67. margin-right: 0rpx;
  68. }
  69. &:nth-child(n+5){
  70. margin-top: 8rpx;
  71. }
  72. .bg-img{
  73. position: absolute;
  74. top: 0;
  75. left: 0;
  76. width: 100%;
  77. height: 100%;
  78. }
  79. .shop{
  80. width: 100%;
  81. height: 100%;
  82. background-color: rgba(0,0,0,0.1);
  83. display: flex;
  84. flex-direction: column;
  85. justify-content: center;
  86. align-items: center;
  87. position: relative;
  88. z-index: 2;
  89. &>image{
  90. width: 70rpx;
  91. height: 70rpx;
  92. border-radius: 50%;
  93. background-color: #FFFFFF;
  94. }
  95. &>view{
  96. font-size: 24rpx;
  97. color: #FFFFFF;
  98. margin-top: 4rpx;
  99. width: 100%;
  100. text-align: center;
  101. }
  102. }
  103. }
  104. }
  105. }
  106. </style>