template4.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <script>
  2. import { HTTP_REQUEST_URL } from '@/config/app';
  3. export default {
  4. props: {
  5. userInfo: {
  6. type: Object,
  7. default: () => {}
  8. },
  9. commission: {
  10. type: Object,
  11. default: () => {}
  12. },
  13. // perShowType 0 手机号 1 ID
  14. perShowType: {
  15. type: Number,
  16. default: 0
  17. }
  18. },
  19. inject: ['intoPage', 'tapQrCode', 'goEdit', 'bindPhone'],
  20. computed: {
  21. headerBg() {
  22. return `url(${HTTP_REQUEST_URL}/statics/images/users/template4_bg.png)`;
  23. }
  24. }
  25. };
  26. </script>
  27. <template>
  28. <view class="">
  29. <view class="acea-row row-middle user">
  30. <image class="avatar" :src="userInfo.avatar" @click="goEdit"></image>
  31. <view class="name-wrap">
  32. <view class="name">{{ userInfo.nickname }}</view>
  33. <view class="bind-phone" v-if="!userInfo.phone" @tap="bindPhone">绑定手机号</view>
  34. <view class="phone" v-else>{{ perShowType ? 'ID:' + userInfo.uid : userInfo.phone }}</view>
  35. </view>
  36. <text class="iconfont icon-a-ic_QRcode fs-40" @click="tapQrCode"><text class="tips">会员码</text></text>
  37. <text class="iconfont icon-a-ic_setup1 fs-40 mx-34" @click="intoPage('/pages/users/user_set/index')"></text>
  38. <view class="iconfont icon-ic_message3 fs-40" @click="intoPage('/pages/users/message_center/index')">
  39. <uni-badge v-if="userInfo.service_num" absolute="rightTop" :custom-style="{background: 'var(--view-theme)',top:'-56rpx'}" :text="userInfo.service_num"></uni-badge>
  40. </view>
  41. </view>
  42. <view class="distribution">
  43. <view class="acea-row row-middle row-between withdraw">
  44. <view>
  45. <view>可提现(元)</view>
  46. <view class="value num-fa-semi">{{ userInfo.commissionCount }}</view>
  47. </view>
  48. <view class="button" @click="intoPage('/pages/users/user_cash/index')">立即提现</view>
  49. </view>
  50. <view class="acea-row">
  51. <view class="item">
  52. <view class="inner">
  53. <view>累计佣金</view>
  54. <view class="value num-fa-semi">{{ commission.brokerage_price || 0 }}</view>
  55. </view>
  56. </view>
  57. <view class="item">
  58. <view class="inner">
  59. <view>推荐人数</view>
  60. <view class="value num-fa-semi">{{ commission.number || 0 }}</view>
  61. </view>
  62. </view>
  63. <view class="item">
  64. <view class="inner">
  65. <view>推荐单数</view>
  66. <view class="value num-fa-semi">{{ commission.order_num || 0 }}</view>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. </template>
  73. <style scoped lang="scss">
  74. .user {
  75. padding: 60rpx 42rpx 56rpx 30rpx;
  76. background-position: bottom;
  77. background-size: 100%;
  78. background-color: #f5f5f5;
  79. .avatar {
  80. width: 112rpx;
  81. height: 112rpx;
  82. border-radius: 50%;
  83. }
  84. .name-wrap {
  85. flex: 1;
  86. padding: 0 32rpx;
  87. color: #333333;
  88. }
  89. .name {
  90. font-weight: 500;
  91. font-size: 32rpx;
  92. line-height: 44rpx;
  93. }
  94. .phone {
  95. margin-top: 10rpx;
  96. font-size: 24rpx;
  97. line-height: 34rpx;
  98. }
  99. .bind-phone {
  100. margin-top: 12rpx;
  101. background: #fff;
  102. border-radius: 30px;
  103. width: max-content;
  104. text-align: center;
  105. font-size: 20rpx;
  106. font-weight: 400;
  107. color: #333333;
  108. line-height: 28rpx;
  109. padding: 6rpx 16rpx;
  110. }
  111. .iconfont {
  112. position: relative;
  113. }
  114. .tips {
  115. position: absolute;
  116. bottom: 100%;
  117. left: 50%;
  118. height: 28rpx;
  119. padding: 0 14rpx;
  120. border-radius: 14rpx;
  121. margin-bottom: 4rpx;
  122. background-color: #ffd89c;
  123. transform: translateX(-50%);
  124. white-space: nowrap;
  125. font-size: 16rpx;
  126. line-height: 28rpx;
  127. color: #9e5e1a;
  128. }
  129. .tips::before {
  130. content: '';
  131. position: absolute;
  132. bottom: -6rpx;
  133. left: calc(50% - 6rpx);
  134. width: 0;
  135. height: 0;
  136. border-left: 6rpx solid transparent;
  137. border-right: 6rpx solid transparent;
  138. border-top: 6rpx solid #ffd89c; /* 修改颜色以改变三角形颜色 */
  139. }
  140. .number {
  141. position: absolute;
  142. top: -8rpx;
  143. right: 0;
  144. min-width: 10rpx;
  145. height: 24rpx;
  146. padding: 0 6rpx;
  147. border: 2rpx solid var(--view-theme);
  148. border-radius: 12rpx;
  149. background-color: #ffffff;
  150. transform: translateX(50%);
  151. font-weight: 500;
  152. font-size: 18rpx;
  153. line-height: 24rpx;
  154. color: var(--view-theme);
  155. }
  156. }
  157. .distribution {
  158. border-radius: 24rpx;
  159. margin: 0 20rpx 20rpx;
  160. background-color: #ffffff;
  161. .withdraw {
  162. height: 176rpx;
  163. padding: 0 56rpx 0 48rpx;
  164. background-image: url('@/static/img/black_user_bg.png');
  165. background-position: center;
  166. background-repeat: no-repeat;
  167. background-size: cover;
  168. font-size: 26rpx;
  169. line-height: 36rpx;
  170. color: rgba(255, 231, 198, 0.8);
  171. .value {
  172. margin-top: 16rpx;
  173. font-family: SemiBold;
  174. font-size: 56rpx;
  175. line-height: 56rpx;
  176. color: #ffe7c6;
  177. }
  178. .button {
  179. height: 56rpx;
  180. padding: 0 24rpx;
  181. border-radius: 28rpx;
  182. background-color: #fce6c8;
  183. font-weight: 500;
  184. font-size: 24rpx;
  185. line-height: 56rpx;
  186. color: #9c5a00;
  187. }
  188. }
  189. .item {
  190. flex: 1;
  191. padding: 40rpx 0;
  192. text-align: center;
  193. font-size: 26rpx;
  194. line-height: 30rpx;
  195. color: #999999;
  196. .inner {
  197. display: inline-block;
  198. }
  199. .value {
  200. margin-top: 20rpx;
  201. text-align: left;
  202. font-family: SemiBold;
  203. font-size: 36rpx;
  204. line-height: 36rpx;
  205. color: #333333;
  206. }
  207. }
  208. }
  209. </style>