attachment-list.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <view class="attachment-box">
  3. <view class="attachment-title sys-color-black">附近精选</view>
  4. <view class="attachment-text sys-color-gray-9">每日推送附近优质用户来场高质量社交</view>
  5. <view class="attachment-list">
  6. <view class="attachment-item" :style="{'background-image':'url('+item.img+')'}" v-for="item in list">
  7. <view class="attachment-data">
  8. <view class="data-name sys-color-white sys-weight-600 sys-webkit-box sys-height-44">{{item.name}}</view>
  9. <view class="data-text sys-height-44">
  10. <text class="sys-height-44 sys-color-white text-item">{{item.age}}</text>
  11. <text class="sys-height-44 sys-color-white text-item">/</text>
  12. <text class="sys-height-44 sys-color-white text-item">{{item.sex}}</text>
  13. <text class="sys-height-44 sys-color-white text-item">/</text>
  14. <text class="sys-height-44 sys-color-white text-item">{{item.constellation}}</text>
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. <view class="attachment-open">
  20. <view class="open-data sys-background-yellow sys-radius-200">
  21. <image class="open-img" src="/static/img/common/lock.png" mode="aspectFill"></image>
  22. <view class="open-text sys-color-black sys-weight-500" >立即解锁</view>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. name: "attachment-list",
  30. components: {},
  31. props: {},
  32. data() {
  33. return {
  34. list:[]
  35. }
  36. },
  37. watch: {},
  38. mounted() {
  39. this.getAttachmentList()
  40. },
  41. methods: {
  42. getAttachmentList(){
  43. let list=[
  44. {'name':'仰看辉煌仰看辉煌仰看辉煌仰看辉煌','age':18,'sex':'女','constellation':'处女座','img':'/static/img/temporary/1.png'},
  45. {'name':'Maple','age':18,'sex':'女','constellation':'处女座','img':'/static/img/temporary/2.png'},
  46. {'name':'仰看辉煌','age':18,'sex':'女','constellation':'处女座','img':'/static/img/temporary/3.png'},
  47. {'name':'Maple','age':18,'sex':'女','constellation':'处女座','img':'/static/img/temporary/1.png'},
  48. {'name':'仰看辉煌','age':18,'sex':'女','constellation':'处女座','img':'/static/img/temporary/2.png'},
  49. {'name':'Maple','age':18,'sex':'女','constellation':'处女座','img':'/static/img/temporary/3.png'},
  50. ];
  51. this.list.push(...list)
  52. }
  53. }
  54. }
  55. </script>
  56. <style scoped lang="scss">
  57. .attachment-box{
  58. .attachment-title{
  59. margin-top: 40rpx;
  60. text-align: center;
  61. font-size: 44rpx;
  62. height: 44rpx;
  63. line-height: 44rpx;
  64. -webkit-background-clip: text;
  65. }
  66. .attachment-text{
  67. text-align: center;
  68. margin-top: 16rpx;
  69. font-size: 32rpx;
  70. height: 44rpx;
  71. line-height: 44rpx;
  72. }
  73. .attachment-list{
  74. padding: 32rpx;
  75. display: flex;
  76. flex-wrap: wrap;
  77. }
  78. .attachment-item{
  79. border-radius: 20rpx;
  80. display: inline-block;
  81. margin-right:18rpx;
  82. width: calc((100vw - 82rpx)/2);
  83. height: 504rpx;
  84. background-repeat: no-repeat;//不平铺
  85. background-position: center center;//居中
  86. background-size: cover;//随容器大小
  87. position: relative;
  88. .attachment-data{
  89. position: absolute;
  90. left: 24rpx;
  91. bottom: 24rpx;
  92. width: calc((100vw - 82rpx)/2 - 48rpx);
  93. .data-name{
  94. font-size: 36rpx;
  95. }
  96. .data-text{
  97. .text-item{
  98. margin-right: 6rpx;
  99. font-size: 24rpx;
  100. }
  101. }
  102. }
  103. }
  104. .attachment-item:nth-of-type(2n+0){
  105. margin-right:0;
  106. }
  107. .attachment-item:nth-of-type(n+3){
  108. margin-top:18rpx;
  109. }
  110. .attachment-open{
  111. position: fixed;
  112. left: 0;
  113. bottom: 0;
  114. width: 100vw;
  115. height: 190rpx;
  116. background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #FFFFFF 100%);
  117. padding: 70rpx 80rpx 30rpx 80rpx;
  118. box-sizing: border-box;
  119. .open-data{
  120. display: flex;
  121. justify-content: center;
  122. height: 88rpx;
  123. padding: 22rpx 0;
  124. box-sizing: border-box;
  125. .open-img{
  126. width: 32rpx;
  127. height: 32rpx;
  128. margin-right: 8rpx;
  129. margin-top: 6rpx;
  130. }
  131. .open-text{
  132. font-size: 32rpx;
  133. //height: 44rpx;
  134. //line-height: 44rpx;
  135. }
  136. }
  137. }
  138. }
  139. </style>