iPraise.vue 3.3 KB

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