index.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <template>
  2. <view>
  3. <u-navbar :is-back="false" :border-bottom="false"><view class="navbar-tit">点赞</view></u-navbar>
  4. <view class="praise">
  5. <view class="praiseLink">
  6. <view class="praiseLink-item" style="" @click="toIPraise">
  7. <view class="praiseLink-tit">
  8. <h4>我点赞的</h4><span></span>
  9. </view>
  10. </view>
  11. <view class="praiseLink-item praiseLink-bg2" @click="toPraiseMe">
  12. <view class="praiseLink-tit">
  13. <h4>谁点赞了我</h4><span v-if="newLike">+{{newLike}}</span>
  14. </view>
  15. <p>{{likeINum}}人点赞了我</p>
  16. </view>
  17. </view>
  18. <view class="title">互相点赞联系双方</view>
  19. <view class="praiseMain" v-if="homePageList.length > 0">
  20. <view class="praiseMain-item" v-for="(item ,index) in homePageList" :key="item.id">
  21. <view class="praiseMain-tit">恭喜配对成功!</view>
  22. <view class="praiseMain-pic">
  23. <view class="praiseMain-pic-item">
  24. <u-image class="newsList-img" :src="item.beLikeMemberFaceImage+'?x-oss-process=image/resize,m_fill,w_256,h_256'" height="260" width="260" border-radius="10"></u-image>
  25. </view>
  26. <view class="praiseMain-heart">
  27. <u-icon custom-prefix="custom-icon" name="heart-2-fill" size="36px" color="#fff"></u-icon>
  28. </view>
  29. <view class="praiseMain-pic-item">
  30. <view class="praiseMain-add" v-if="item.chatNotReadNum != '0'">
  31. {{item.chatNotReadNum}}条未读消息
  32. </view>
  33. <u-image class="newsList-img" :src="item.likeMemberFaceImage+'?x-oss-process=image/resize,m_fill,w_256,h_256'" height="260" width="260" border-radius="10"></u-image>
  34. </view>
  35. </view>
  36. <view class="praiseMain-pic-text">恭喜!您与「{{item.likeMemberName}}」相互点赞!</view>
  37. <view class="praiseMain-btn">
  38. <u-button type="error" shape="circle" @click="gotoUrl('pages/user/message?id='+item.likeMemberId)" :custom-style="customStyle">联系Ta</u-button>
  39. </view>
  40. </view>
  41. </view>
  42. <view class="jpDefault" v-else>
  43. <u-image width="179px" height="126px" src="/static/img/default1.png"></u-image>
  44. <p>暂无配对成功记录</p>
  45. </view>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. import * as likesApi from '@/apis/likes.js'
  51. export default {
  52. data() {
  53. return {
  54. newLike: '',
  55. likeINum: '',
  56. homePageList: [],
  57. customStyle: {
  58. background: '#FF5E5E'
  59. },
  60. }
  61. },
  62. onShow() {
  63. if(this.carhelp.getPersonInfo().id != null) {
  64. this.getHomePage(true);
  65. }
  66. },
  67. methods: {
  68. toIPraise() {
  69. if(this.carhelp.getPersonInfo().id != null) {
  70. uni.navigateTo({
  71. url: '/pages/praise/iPraise'
  72. });
  73. } else {
  74. uni.showToast({
  75. title: "请用户先登录再浏览本页面",
  76. icon: "none"
  77. })
  78. }
  79. },
  80. toPraiseMe() {
  81. if(this.carhelp.getPersonInfo().id != null) {
  82. uni.navigateTo({
  83. url: '/pages/praise/praiseMe'
  84. });
  85. } else {
  86. uni.showToast({
  87. title: "请用户先登录再浏览本页面",
  88. icon: "none"
  89. })
  90. }
  91. },
  92. getHomePage(bl) {
  93. uni.showLoading({
  94. title: "加载中",
  95. mask: true,
  96. })
  97. if (bl) {
  98. this.likeList = [];
  99. }
  100. likesApi.homePage().then((res) => {
  101. this.newLike = res.data.likeINotReadNum;
  102. this.likeINum = res.data.likeINum;
  103. this.homePageList = res.data.eachOtherPage.data;
  104. uni.hideLoading();
  105. }).catch(error => {
  106. uni.showToast({
  107. title: error,icon: "none"
  108. })
  109. })
  110. },
  111. }
  112. }
  113. </script>
  114. <style>
  115. page{
  116. background-color: #f4f0f0;
  117. }
  118. </style>
  119. <style lang="scss" scoped>
  120. .jpDefault{
  121. padding-top:90px;
  122. display: flex;
  123. flex-direction: column;
  124. align-items: center;
  125. p{
  126. color: #A69F9F;
  127. font-size: 16px;
  128. margin-top: 12px;
  129. }
  130. }
  131. .newsList-img{
  132. z-index: -1;
  133. }
  134. .title{
  135. font-size: 16px;
  136. margin-bottom: 10px;
  137. margin-left: 15px;
  138. }
  139. .praiseMain{
  140. .praiseMain-item{
  141. margin: 15px;
  142. background-color: #fff;
  143. border-radius: 12px;
  144. padding: 20px;
  145. position: relative;
  146. }
  147. .praiseMain-heart{
  148. height: 60px;
  149. width: 60px;
  150. background-color: #FF5E5E;
  151. position: absolute;
  152. border-radius: 50%;
  153. top: 95px;
  154. left: 50%;
  155. margin-left: -30px;
  156. z-index: 99;
  157. line-height: 60px;
  158. text-align: center;
  159. }
  160. .praiseMain-tit{
  161. font-size: 24px;
  162. color:#FF5E5E;
  163. margin-bottom: 10px;
  164. text-align: center;
  165. }
  166. .praiseMain-pic{
  167. display: flex;
  168. justify-content: space-between;
  169. padding: 0 15px;
  170. }
  171. .praiseMain-pic-text{
  172. font-size: 16px;
  173. text-align: center;
  174. margin: 15px 0;
  175. }
  176. .praiseMain-btn{
  177. padding: 0 15px;
  178. }
  179. .praiseMain-pic-item{
  180. position: relative;
  181. }
  182. .praiseMain-add{
  183. position: absolute;
  184. background:rgba(0,0,0,0.5);
  185. height: 20px;
  186. z-index: 9;
  187. border-radius: 0 0 5px 5px;
  188. left: 0;
  189. right: 0;
  190. bottom: 0;
  191. color:#fff;
  192. text-align: center;
  193. font-size: 12px;
  194. line-height: 20px;
  195. backdrop-filter: blur(8px);
  196. /* Note: backdrop-filter has minimal browser support */
  197. }
  198. }
  199. .navbar-tit{
  200. padding-left:15px;
  201. font-size: 24px;
  202. }
  203. .praiseLink{
  204. margin: 16px;
  205. display: flex;
  206. justify-content: space-between;
  207. .praiseLink-item{
  208. height: 80px;
  209. background:url(../../static/img/listbg.png) no-repeat #fff right bottom;
  210. background-size:65px 45px;
  211. flex: 0.47;
  212. padding: 20px;
  213. border-radius: 12px;
  214. .praiseLink-tit{
  215. display: flex;
  216. align-items: center;
  217. span{
  218. font-size: 12px;
  219. color:#fff;
  220. background-color: #FF5E5E ;
  221. padding: 0 4px;
  222. border-radius: 4px;
  223. margin-left: 5px;
  224. }
  225. h4{
  226. font-size: 16px;
  227. font-weight: normal;
  228. }
  229. }
  230. p{
  231. color:#999;
  232. font-size: 12px;
  233. margin-top: 3px;
  234. }
  235. }
  236. .praiseLink-bg2{
  237. background:url(../../static/img/listbg2.png) no-repeat #fff right bottom;
  238. background-size:65px 45px;
  239. }
  240. }
  241. </style>