my.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <template>
  2. <view class="page" :style="{height:height}">
  3. <view class="flex-row use">
  4. <view class="avatar" @click="goUserInfo">
  5. <image :src="userInfo.img || '/static/ud4.png'"></image>
  6. </view>
  7. <view class="flex-col justify-evenly useMsg">
  8. <view class="flex-row">
  9. <text class="name">{{userInfo.name}}</text>
  10. <view class="tag">{{userInfo.isManager === 1? '拓客经理': userInfo.roleTag == '0' ? '拓客专员':'合作伙伴'}}
  11. </view>
  12. </view>
  13. <view>
  14. <text class="phone">电话:{{userInfo.phone}}</text>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="statistics flex-col">
  19. <view class="flex-row justify-around" v-if="userInfo.isManager == '1'">
  20. <view class="flex-row justify-center out ">
  21. <view class="flex-col statisticsItem "
  22. @click="navigateTo('/pages/specialistsList/specialistsList')">
  23. <view>
  24. <image src="/static/my/fuwuNmber.png" class="statisticsImg"></image>
  25. </view>
  26. <text class="statisticsKey">我的专员(人)</text>
  27. <text class="statisticsValue">{{statistics.myAttache}}</text>
  28. </view>
  29. </view>
  30. <view class="flex-row justify-center out leftBorder">
  31. <view class="flex-col statisticsItem " @click="navigateTo('/pages/cooperation/cooperation')">
  32. <view>
  33. <image src="/static/my/hezuohuoban.png" class="statisticsImg"></image>
  34. </view>
  35. <text class="statisticsKey">合作伙伴(人)</text>
  36. <text class="statisticsValue">{{statistics.myPartner}}</text>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="flex-row justify-around " v-else>
  41. <view class="flex-row justify-center out ">
  42. <view class="flex-col statisticsItem "
  43. @click="navigateTo('/pages/directPromotionList/directPromotionList')">
  44. <!-- <view>-->
  45. <!-- <image src="/static/my/fuwuTimeLong.png" class="statisticsImg"></image>-->
  46. <!-- </view>-->
  47. <text class="statisticsKey">我的直推(人)</text>
  48. <text class="statisticsValue">{{statistics.myMember}}</text>
  49. </view>
  50. </view>
  51. <view class="flex-row justify-center out leftBorder">
  52. <view class="flex-col statisticsItem " @click="navigateTo('/pages/earningsList/earningsList')">
  53. <!-- <view>-->
  54. <!-- <image src="/static/my/benyuerenwu.png" class="statisticsImg"></image>-->
  55. <!-- </view>-->
  56. <text class="statisticsKey">推广收益(人)</text>
  57. <text class="statisticsValue">{{statistics.myEarning}}</text>
  58. <view v-if="isCanWithdraw" @click.stop="navigateTo('/pages/withdraw/withdraw')">
  59. <text class="txbtn">去提现></text>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. <view class="flex-col justify-start list">
  66. <uni-list :border="false">
  67. <uni-list-item v-if="userInfo.isManager == 1" :clickable="true" title="我的分组" to="/pages/myGroup/myGroup"
  68. showArrow thumb="/static/my/fenzu.png" thumb-size="sm" rightText="" />
  69. <uni-list-item v-if="userInfo.roleTag == 1" :clickable="true" title="购买优惠券"
  70. to="/pages/purchaseCoupon/purchaseCoupon" showArrow thumb="/static/my/coupon.png" thumb-size="sm"
  71. rightText="" />
  72. </uni-list>
  73. </view>
  74. </view>
  75. </template>
  76. <script>
  77. export default {
  78. data() {
  79. return {
  80. isCanWithdraw:true,
  81. staticsData: {},
  82. userInfo: {},
  83. height: '',
  84. statistics:{},
  85. }
  86. },
  87. onLoad() {
  88. let sysInfo = uni.getSystemInfoSync()
  89. this.height = sysInfo.windowHeight + 'px'
  90. },
  91. onShow() {
  92. this.userInfo = uni.getStorageSync('spreadUserInfo')
  93. // this.getImgUrlByOssId(this.userInfo.img)
  94. this.exStatistics()
  95. // this.canWithdraw()
  96. },
  97. methods: {
  98. canWithdraw(){
  99. this.$api.service.canWithdraw().then(res=>{
  100. console.log(res)
  101. this.isCanWithdraw = res.data.data
  102. })
  103. },
  104. exStatistics(){
  105. this.$api.service.exStatistics().then(res=>{
  106. this.statistics = res.data.data
  107. })
  108. },
  109. navigateTo(url) {
  110. uni.navigateTo({
  111. url: url
  112. })
  113. },
  114. getImgUrlByOssId(Id) {
  115. if (Id) {
  116. this.$api.service.getImage(Id).then(res => {
  117. this.userInfo.selfPhotoUrl = res.data.data[0].url.replace(/^http:/, "https:")
  118. this.$set(this.userInfo)
  119. });
  120. }
  121. },
  122. navigateTo(url) {
  123. uni.navigateTo({
  124. url: url
  125. })
  126. },
  127. goUserInfo() {
  128. uni.navigateTo({
  129. url: '/pages/userInfo/userInfo'
  130. })
  131. },
  132. }
  133. }
  134. </script>
  135. <style lang="scss" scoped>
  136. @import './index.rpx.css';
  137. </style>