my.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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.imgUrl || '/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" showArrow thumb="/static/my/fenzu.png" thumb-size="sm"/>
  68. <uni-list-item v-if="userInfo.roleTag == 1" :clickable="true" title="购买优惠券" to="/pages/purchaseCoupon/purchaseCoupon" showArrow thumb="/static/my/coupon.png" thumb-size="sm"/>
  69. </uni-list>
  70. </view>
  71. </view>
  72. </template>
  73. <script>
  74. export default {
  75. data() {
  76. return {
  77. isCanWithdraw:true,
  78. staticsData: {},
  79. userInfo: {},
  80. height: '',
  81. statistics:{},
  82. }
  83. },
  84. onLoad() {
  85. let sysInfo = uni.getSystemInfoSync()
  86. this.height = sysInfo.windowHeight + 'px'
  87. },
  88. onShow() {
  89. this.userInfo = uni.getStorageSync('spreadUserInfo')
  90. this.getImgUrlByOssId(this.userInfo.img)
  91. this.exStatistics()
  92. // this.canWithdraw()
  93. },
  94. methods: {
  95. canWithdraw(){
  96. this.$api.service.canWithdraw().then(res=>{
  97. console.log(res)
  98. this.isCanWithdraw = res.data.data
  99. })
  100. },
  101. exStatistics(){
  102. this.$api.service.exStatistics().then(res=>{
  103. this.statistics = res.data.data
  104. })
  105. },
  106. navigateTo(url) {
  107. uni.navigateTo({
  108. url: url
  109. })
  110. },
  111. getImgUrlByOssId(Id) {
  112. if (Id) {
  113. this.$api.service.getImage(Id).then(res => {
  114. this.userInfo.imgUrl = res.data.data[0].url.replace(/^http:/, "https:")
  115. uni.setStorageSync('spreadUserInfo', this.userInfo)
  116. this.$set(this.userInfo)
  117. });
  118. }
  119. },
  120. navigateTo(url) {
  121. uni.navigateTo({
  122. url: url
  123. })
  124. },
  125. goUserInfo() {
  126. uni.navigateTo({
  127. url: '/pages/userInfo/userInfo'
  128. })
  129. },
  130. }
  131. }
  132. </script>
  133. <style lang="scss" scoped>
  134. @import './index.rpx.css';
  135. </style>