praiseMe.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <view>
  3. <u-navbar><view class="navbar-tit">谁点赞了我</view></u-navbar>
  4. <view class="friendList">
  5. <view class="friendList-item" v-for="(item ,index) in likeList" :key="item.id" @click="gotoUrl('pages/friend/personal?id='+item.id+'&readStatus=1')">
  6. <view class="friendList-new" v-if="item.isRead == '0'">
  7. new
  8. </view>
  9. <u-image class="friendList-img" :src="item.faceImage+'?x-oss-process=image/resize,m_fill,w_256,h_256'" height="160" width="160" border-radius="10">
  10. </u-image>
  11. <view class="friendList-text">
  12. <view class="friendList-name">
  13. <span>{{item.realName}}</span>
  14. <u-icon v-if="item.gender" custom-prefix="custom-icon" name="women-line" color="#FF695B"></u-icon>
  15. <u-icon v-else custom-prefix="custom-icon" name="men-line" color="#1677FF"></u-icon>
  16. </view>
  17. <view class="friendList-info">
  18. <span>{{item.age}}岁 · {{item.height}}cm{{item.weight?' · '+item.weight+'kg':''}}</span>
  19. </view>
  20. <view class="friendList-label">
  21. <view class="friendList-label-item">
  22. <u-icon custom-prefix="custom-icon" name="map-pin-2-fill"></u-icon>
  23. <span>{{item.orgAreaName}}</span>
  24. </view>
  25. <view class="friendList-label-item">
  26. <span>{{item.educationN}}</span>
  27. </view>
  28. <view class="friendList-label-item">
  29. <span>{{item.industryN}}</span>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. <u-divider color="#B6BDC3" v-if="likeList.length ==recordsTotal" style="margin-top:20px;" bg-color="#f4f0f0">已经到底了</u-divider>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. import * as likesApi from '@/apis/likes.js'
  40. export default {
  41. data() {
  42. return {
  43. likeList: [],
  44. pageIndex: 1,
  45. recordsTotal: 0,
  46. }
  47. },
  48. onReachBottom() {
  49. if (this.likeList.length < this.recordsTotal) {
  50. this.myLoadmore();
  51. }
  52. },
  53. onShow() {
  54. this.getLikeMeList(true);
  55. },
  56. methods: {
  57. getLikeMeList(bl) {
  58. uni.showLoading({
  59. title: "加载中",
  60. mask: true,
  61. })
  62. if (bl) {
  63. this.likeList = [];
  64. this.pageIndex = 1;
  65. }
  66. var data = {
  67. pageSize:5,
  68. pageIndex: this.pageIndex
  69. };
  70. likesApi.likeIList(data).then((res) => {
  71. this.likeList = [
  72. ...this.likeList,
  73. ...res.data.data
  74. ];
  75. this.recordsTotal = res.data.recordsTotal
  76. uni.hideLoading();
  77. }).catch(error => {
  78. uni.showToast({
  79. title: error,icon: "none"
  80. })
  81. })
  82. },
  83. myLoadmore() {
  84. this.pageIndex += 1;
  85. this.getLikeMeList()
  86. },
  87. }
  88. }
  89. </script>
  90. <style>
  91. page {
  92. background-color: #f4f0f0;
  93. }
  94. </style>
  95. <style lang="scss" scoped>
  96. .navbar-tit{
  97. padding-left:15px;
  98. font-size: 24px;
  99. }
  100. .friendList {
  101. padding: 15px;
  102. .friendList-item {
  103. display: flex;
  104. background-color: #fff;
  105. padding: 12px;
  106. border-radius: 12px;
  107. margin-bottom: 15px;
  108. position: relative;
  109. .friendList-new{
  110. position: absolute;
  111. right: 0;
  112. top: 0;
  113. background-color: #FF4F3F;
  114. border-radius: 0 12px 0 8px;
  115. color:#fff;
  116. font-size: 12px;
  117. padding:1px 5px;
  118. }
  119. .friendList-text {
  120. flex: 1;
  121. min-width: 0;
  122. margin-left: 12px;
  123. display: flex;
  124. flex-direction: column;
  125. justify-content: space-between;
  126. .friendList-name {
  127. font-weight: normal;
  128. span {
  129. font-size: 18px;
  130. margin-right: 8px;
  131. }
  132. }
  133. .friendList-info {
  134. color: #999;
  135. font-size: 12px;
  136. }
  137. .friendList-label {
  138. display: flex;
  139. align-items: center;
  140. .friendList-label-item {
  141. background: #F1F3F4;
  142. padding: 2px 8px;
  143. color: #A2A9B5;
  144. border-radius: 4px;
  145. font-size: 12px;
  146. margin-right: 8px;
  147. span {
  148. margin-left: 3px;
  149. }
  150. }
  151. }
  152. }
  153. }
  154. }
  155. </style>