index.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <template>
  2. <view class="share-index">
  3. <view class="head-box">
  4. <view class="user-info dir-left-nowrap">
  5. <view class="head-img">
  6. <image :src="userInfo.avatar" alt="" />
  7. </view>
  8. <view class="base-info dir-top-wrap main-center">
  9. <view class="nickname">{{ userInfo.nickname }}</view>
  10. <view class="parent">推荐人: {{ userInfo.parent ? userInfo.parent.nickname : '' }}</view>
  11. </view>
  12. </view>
  13. <view class="withdraw-box main-between cross-center">
  14. <view class="withdraw-item dir-top-wrap main-center" @click="$u.route('/pages/share/withdraw')">
  15. <view class="static-txt main-left cross-center">
  16. 可提现佣金
  17. <view class="badge">提现</view>
  18. </view>
  19. <view class="price main-left cross-center">
  20. {{ userInfo.income }}
  21. <view class="unit">元</view>
  22. </view>
  23. </view>
  24. <view class="withdraw-item dir-top-wrap main-center">
  25. <view class="static-txt">
  26. 已提现佣金
  27. </view>
  28. <view class="price main-left cross-center">
  29. {{ parseFloat(userInfo.total_income - userInfo.income).toFixed(2) }}
  30. <view class="unit">元</view>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. <!--菜单-->
  36. <view class="menu-group">
  37. <button
  38. v-for="(menu,index) in menus"
  39. :key="index"
  40. class="menu-item main-between cross-center"
  41. :open-type="menu.type ? menu.type : ''"
  42. @bindcontact="handleMenu"
  43. @click="handleMenu(menu)"
  44. >
  45. <view class="left-box dir-left-nowrap cross-center">
  46. <view class="icon">
  47. <image :src="menu.icon" />
  48. </view>
  49. <text>{{ menu.name }}</text>
  50. </view>
  51. <u-icon name="arrow-right" :color="$colors.infoColor" bold />
  52. </button>
  53. </view>
  54. </view>
  55. </template>
  56. <script>
  57. import { mapState } from 'vuex'
  58. export default {
  59. data() {
  60. return {
  61. menus: [
  62. { icon: '/static/image/my-page/share.png', name: '分享好友', type: 'share' },
  63. { icon: '/static/image/share/income.png', name: '分享佣金', href: '/pages/share/income' },
  64. { icon: '/static/image/share/order.png', name: '分享订单', href: '/pages/share/order' },
  65. { icon: '/static/image/share/detail.png', name: '提现明细', href: '/pages/share/withdrawDetail' },
  66. { icon: '/static/image/share/team.png', name: '我的团队', href: '/pages/share/team' }
  67. ]
  68. }
  69. },
  70. computed: {
  71. ...mapState({
  72. userInfo: seate => seate.user.info
  73. })
  74. },
  75. methods: {
  76. handleMenu(menu) {
  77. // #ifdef MP-KUAISHOU
  78. if (menu.type === 'contact') {
  79. ks.makePhoneCall({
  80. phoneNumber: this.config.contact,
  81. success(res) {
  82. console.log('-->success', res)
  83. },
  84. fail(err) {
  85. console.log('-->error', err)
  86. }
  87. })
  88. }
  89. // #endif
  90. if (menu.href) {
  91. this.$u.route(menu.href)
  92. }
  93. }
  94. }
  95. }
  96. </script>
  97. <style lang="scss" scoped>
  98. .share-index {
  99. color: #6eebe8;
  100. font-size: 32rpx;
  101. padding: 40rpx 30rpx 80rpx;
  102. .head-box{
  103. background: $bg-op-color;
  104. border-radius: 20rpx;
  105. padding: 40rpx 0;
  106. margin-bottom: 50rpx;
  107. .user-info{
  108. padding: 0 30rpx 40rpx;
  109. border-bottom: 1rpx $border-op-color solid;
  110. .head-img{
  111. width: 120rpx;
  112. height: 120rpx;
  113. border-radius: 50%;
  114. overflow: hidden;
  115. image{
  116. width: 100%;
  117. height: 100%;
  118. }
  119. }
  120. .base-info{
  121. margin-left: 30rpx;
  122. .parent{
  123. font-size: 26rpx;
  124. }
  125. }
  126. }
  127. .withdraw-box{
  128. padding: 40rpx 0 0;
  129. .withdraw-item{
  130. flex: 1;
  131. position: relative;
  132. padding: 0 40rpx;
  133. &:first-child{
  134. &:after{
  135. content: "";
  136. position: absolute;
  137. background: $border-op-color;
  138. right: 0;
  139. top: 50%;
  140. height: 60%;
  141. width: 1rpx;
  142. transform: translateY(-50%);
  143. }
  144. }
  145. .static-txt{
  146. font-size: 26rpx;
  147. .badge{
  148. font-size: 18rpx;
  149. border: 1rpx solid #6eebe8;
  150. border-radius: 30rpx;
  151. padding: 2rpx 20rpx;
  152. margin-left: 30rpx;
  153. }
  154. }
  155. .price{
  156. margin-top: 10rpx;
  157. font-size: 48rpx;
  158. .unit{
  159. font-size: 34rpx;
  160. margin-left: 4rpx;
  161. }
  162. }
  163. }
  164. }
  165. }
  166. .menu-group{
  167. .menu-item{
  168. padding: 20rpx 0;
  169. background: transparent;
  170. border: none;
  171. text-align: unset;
  172. width: 100%;
  173. line-height: initial;
  174. font-size: initial;
  175. justify-content: space-between;
  176. border-bottom: 1rpx solid $border-op-color;
  177. border-radius: 0;
  178. &:after{
  179. content: unset;
  180. }
  181. .left-box{
  182. flex: 1;
  183. .icon{
  184. transform: translateY(4rpx);
  185. image{
  186. width: 55rpx;
  187. height: 55rpx;
  188. }
  189. }
  190. text{
  191. color: #fff;
  192. margin-left: 10rpx;
  193. }
  194. }
  195. }
  196. }
  197. }
  198. </style>