attachment-list.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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. import {getNearbyList} from "@/api/discovery";
  29. import tools from "@/service/tools";
  30. export default {
  31. name: "attachment-list",
  32. components: {},
  33. props: {},
  34. data() {
  35. return {
  36. page:1,
  37. total:undefined,
  38. isAjax:false,
  39. list:[],
  40. }
  41. },
  42. watch: {},
  43. mounted() {
  44. this.getAttachmentList()
  45. },
  46. methods: {
  47. async getAttachmentList(){
  48. let locationData=await tools.getLocation()
  49. getNearbyList({'pageNo':this.page,'pageSize':20,'longitude':locationData.longitude,'latitude':locationData.latitude}).then((res)=>{
  50. if(res.code===0){
  51. }
  52. })
  53. let list=[
  54. {'name':'仰看辉煌仰看辉煌仰看辉煌仰看辉煌','age':18,'sex':'女','constellation':'处女座','img':'/static/img/temporary/1.png'},
  55. {'name':'Maple','age':18,'sex':'女','constellation':'处女座','img':'/static/img/temporary/2.png'},
  56. {'name':'仰看辉煌','age':18,'sex':'女','constellation':'处女座','img':'/static/img/temporary/3.png'},
  57. {'name':'Maple','age':18,'sex':'女','constellation':'处女座','img':'/static/img/temporary/1.png'},
  58. {'name':'仰看辉煌','age':18,'sex':'女','constellation':'处女座','img':'/static/img/temporary/2.png'},
  59. {'name':'Maple','age':18,'sex':'女','constellation':'处女座','img':'/static/img/temporary/3.png'},
  60. ];
  61. this.list.push(...list)
  62. }
  63. }
  64. }
  65. </script>
  66. <style scoped lang="scss">
  67. .attachment-box{
  68. .attachment-title{
  69. margin-top: 40rpx;
  70. text-align: center;
  71. font-size: 44rpx;
  72. height: 44rpx;
  73. line-height: 44rpx;
  74. -webkit-background-clip: text;
  75. }
  76. .attachment-text{
  77. text-align: center;
  78. margin-top: 16rpx;
  79. font-size: 32rpx;
  80. height: 44rpx;
  81. line-height: 44rpx;
  82. }
  83. .attachment-list{
  84. padding: 32rpx;
  85. display: flex;
  86. flex-wrap: wrap;
  87. }
  88. .attachment-item{
  89. border-radius: 20rpx;
  90. display: inline-block;
  91. margin-right:18rpx;
  92. width: calc((100vw - 82rpx)/2);
  93. height: 504rpx;
  94. background-repeat: no-repeat;//不平铺
  95. background-position: center center;//居中
  96. background-size: cover;//随容器大小
  97. position: relative;
  98. .attachment-data{
  99. position: absolute;
  100. left: 24rpx;
  101. bottom: 24rpx;
  102. width: calc((100vw - 82rpx)/2 - 48rpx);
  103. .data-name{
  104. font-size: 36rpx;
  105. }
  106. .data-text{
  107. .text-item{
  108. margin-right: 6rpx;
  109. font-size: 24rpx;
  110. }
  111. }
  112. }
  113. }
  114. .attachment-item:nth-of-type(2n+0){
  115. margin-right:0;
  116. }
  117. .attachment-item:nth-of-type(n+3){
  118. margin-top:18rpx;
  119. }
  120. .attachment-open{
  121. position: fixed;
  122. left: 0;
  123. bottom: 0;
  124. width: 100vw;
  125. height: 190rpx;
  126. background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #FFFFFF 100%);
  127. padding: 70rpx 80rpx 30rpx 80rpx;
  128. box-sizing: border-box;
  129. .open-data{
  130. display: flex;
  131. justify-content: center;
  132. height: 88rpx;
  133. padding: 22rpx 0;
  134. box-sizing: border-box;
  135. .open-img{
  136. width: 32rpx;
  137. height: 32rpx;
  138. margin-right: 8rpx;
  139. margin-top: 6rpx;
  140. }
  141. .open-text{
  142. font-size: 32rpx;
  143. //height: 44rpx;
  144. //line-height: 44rpx;
  145. }
  146. }
  147. }
  148. }
  149. </style>