my.vue 4.6 KB

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