listItem.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <view class="lis-item x-f es-center es-pt-24 es-pb-30 es-pl-30 es-pr-30 lis-item-line" @click="$navTo('/pages/expert/index?userId='+item.userId)">
  3. <view class="avatar live es-w-112 es-h-112">
  4. <!-- <view class="live-status x-c">直播中</view> -->
  5. <image
  6. :src="item.avatar || 'https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/1d7eb0607a074892964dd32e8735e540.jpg'"
  7. mode="aspectFill"></image>
  8. </view>
  9. <view class="x-f es-center flex">
  10. <view class="es-ml-16">
  11. <view class="title es-mb-20">{{item.nickName}}</view>
  12. <view class="desc" v-show="type=='follow'">{{item.remark}}</view>
  13. <view class="desc" v-show="type=='fans'">{{item.fans || 0}}粉丝 {{item.videoNum || 0}}视频</view>
  14. </view>
  15. <view class="x-c desc" :class="isFollow==1?'follow':'no-follow'" @click.stop="handleFollow">{{isFollow==1? '已关注' : type=='follow'?'关注': '回关'}}</view>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. import { getTalentByToken,getVideoList,doFollow,checkFollow,getTalentByUserId } from "@/api/expert.js"
  21. export default {
  22. props: {
  23. type: {
  24. type: String,
  25. default: 'follow'
  26. },
  27. isFollow: {
  28. type: [String,Number],
  29. default: 0
  30. },
  31. item: {
  32. type: Object,
  33. default: {}
  34. }
  35. },
  36. data() {
  37. return {
  38. }
  39. },
  40. methods: {
  41. handleFollow() {
  42. doFollow({talentId: this.item.talentId}).then(res=>{
  43. if(res.code==200) {
  44. this.$emit('resetData')
  45. }
  46. uni.showToast({
  47. title: res.msg
  48. })
  49. })
  50. },
  51. }
  52. }
  53. </script>
  54. <style scoped lang="scss">
  55. .title {
  56. font-weight: 600;
  57. }
  58. .desc {
  59. font-size: 24rpx;
  60. color: #999999;
  61. }
  62. .avatar {
  63. border-radius: 50%;
  64. position: relative;
  65. box-sizing: border-box;
  66. border: 5rpx solid #FF5030;
  67. image {
  68. border-radius: 50%;
  69. width: 100%;
  70. height: 100%;
  71. position: relative;
  72. z-index: 3;
  73. }
  74. }
  75. .live {
  76. padding: 6rpx;
  77. border: none;
  78. background: linear-gradient(to bottom, #FACC22, #FF5030);
  79. &::after {
  80. position: absolute;
  81. left: 50%;
  82. top: 50%;
  83. transform: translate(-50%, -50%);
  84. content: "";
  85. width: 106rpx;
  86. height: 106rpx;
  87. background-color: #fff;
  88. border-radius: 50%;
  89. }
  90. }
  91. .live-status {
  92. min-width: 96rpx;
  93. padding: 5rpx 0;
  94. box-sizing: border-box;
  95. background: #FF5030;
  96. border-radius: 17rpx;
  97. position: absolute;
  98. left: 50%;
  99. bottom: -14rpx;
  100. transform: translateX(-50%);
  101. z-index: 9;
  102. font-family: MiSans;
  103. font-weight: 400;
  104. font-size: 20rpx;
  105. color: #FFFFFF;
  106. word-break: keep-all;
  107. }
  108. .follow {
  109. width: 150rpx;
  110. height: 51rpx;
  111. background: #E5E5E5;
  112. border-radius: 25rpx;
  113. }
  114. .no-follow {
  115. width: 150rpx;
  116. height: 51rpx;
  117. background: #FFFFFF;
  118. border-radius: 25rpx;
  119. border: 1px solid #FF5030;
  120. color: #FF5030 !important;
  121. }
  122. .lis-item {
  123. overflow: hidden;
  124. }
  125. .lis-item-line {
  126. position: relative;
  127. &::after {
  128. content: "";
  129. position: absolute;
  130. bottom: 0;
  131. left: 136rpx;
  132. border-bottom: 1px solid #F5F7FA;
  133. width: 100%;
  134. transform: scaleY(0.5);
  135. border-top-color: #F5F7FA;
  136. border-right-color: #F5F7FA;
  137. border-left-color: #F5F7FA;
  138. }
  139. }
  140. </style>