FansPane.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <view class="item" v-if="fansInfo" @click="$emit('view', fansInfo)">
  3. <view class="avatar-wrapper">
  4. <image class="avatar" :src="fansInfo.headImage"></image>
  5. <view class="mask">{{ fansInfo.role | filterRole }}</view>
  6. </view>
  7. <view class="info">
  8. <view class="name">{{ fansInfo.userName }}
  9. <!-- <tui-icon margin="0 0 0 10upx" :color="fansInfo.gender === 0 ? '#10aeff' : '#f37e7d'" name="friendadd-fill" :size="18"></tui-icon> -->
  10. <!-- <view class="add-time">绑定时间:{{ fansInfo.addTime }}</view> -->
  11. <view class="account-wrapper" style="font-size: 24upx; color: #3d3d3d; "> 产生佣金: <text style="color: #f40;">¥{{
  12. fansInfo.amount }}</text></view>
  13. </view>
  14. <view class="phone">
  15. <view class="phone-number">{{ fansInfo.phone ? fansInfo.phone.slice(0, 3) + '****' + fansInfo.phone.slice(7) : '-'
  16. }}
  17. </view>
  18. <button class="uni-btn" @click="handleCallPhone(fansInfo.phone)">
  19. <tui-icon class="icon" color="#ccc" :size="16" name="voipphone"></tui-icon>
  20. 拨打
  21. </button>
  22. </view>
  23. <view class="fans-wrapper">
  24. <view class="fans-item">
  25. <view class="fans-title">粉丝数:</view>
  26. <view class="numbers">{{ fansInfo.fans }}</view>
  27. </view>
  28. <view class="fans-item">
  29. <view class="fans-title">今日粉丝数:</view>
  30. <view class="numbers">{{ fansInfo.todayFans }}</view>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. export default {
  38. props: {
  39. fansInfo: {
  40. type: Object,
  41. required: true
  42. }
  43. },
  44. filters: {
  45. filterRole(role) {
  46. return { 5: '区代理', 4: '加盟商', 3: '合伙人', 2: '团长', 1: '会员',0: '未知' }[role]
  47. }
  48. },
  49. methods: {
  50. handleCallPhone(phone) {
  51. if (!phone) return;
  52. uni.makePhoneCall({
  53. phoneNumber: phone
  54. });
  55. },
  56. },
  57. }
  58. </script>
  59. <style lang="less" scoped>
  60. .item {
  61. margin-top: 30upx;
  62. padding: 20upx;
  63. box-sizing: border-box;
  64. width: 700upx;
  65. background-color: #fff;
  66. border-radius: 10upx;
  67. display: flex;
  68. align-items: flex-start;
  69. .avatar-wrapper {
  70. position: relative;
  71. border-radius: 10upx;
  72. overflow: hidden;
  73. border: 1upx solid #f3f3f3;
  74. .mask {
  75. position: absolute;
  76. left: 0;
  77. right: 0;
  78. bottom: 0;
  79. width: 100%;
  80. height: 40upx;
  81. background-color: rgba(0, 0, 0, 0.5);
  82. font-size: 24upx;
  83. color: #fff;
  84. text-align: center;
  85. line-height: 40upx;
  86. }
  87. }
  88. .avatar {
  89. flex-shrink: 0;
  90. width: 100upx;
  91. height: 100upx;
  92. border-radius: 10upx;
  93. display: block;
  94. }
  95. .info {
  96. flex: 1;
  97. margin-left: 20upx;
  98. .name {
  99. display: flex;
  100. align-items: center;
  101. justify-content: space-between;
  102. font-size: 28upx;
  103. font-weight: 500;
  104. .add-time {
  105. font-size: 24upx;
  106. }
  107. }
  108. .phone {
  109. display: flex;
  110. align-items: center;
  111. justify-content: space-between;
  112. font-size: 24upx;
  113. margin-top: 16upx;
  114. .uni-btn {
  115. display: flex;
  116. align-items: center;
  117. color: #ccc;
  118. font-size: 24upx;
  119. .icon {
  120. margin-right: 10upx !important;
  121. }
  122. }
  123. }
  124. }
  125. }
  126. .fans-wrapper {
  127. font-size: 24upx;
  128. color: #3d3d3d;
  129. display: flex;
  130. align-items: center;
  131. margin-top: 20upx;
  132. .fans-item {
  133. flex: 1;
  134. color: #000;
  135. display: flex;
  136. &:nth-child(2) {
  137. text-align: right;
  138. justify-content: flex-end;
  139. }
  140. .fans-title {
  141. color: #ccc;
  142. }
  143. }
  144. }
  145. </style>