my.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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.selfPhotoUrl || '/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>
  59. </view>
  60. </view>
  61. </view>
  62. <view class="flex-col justify-start list">
  63. <uni-list :border="false">
  64. <uni-list-item v-if="userInfo.isManager == 1" :clickable="true" title="我的分组" to="/pages/myGroup/myGroup"
  65. showArrow thumb="/static/my/fenzu.png" thumb-size="sm" rightText="" />
  66. <uni-list-item v-if="userInfo.roleTag == 1" :clickable="true" title="购买优惠券"
  67. to="/pages/purchaseCoupon/purchaseCoupon" showArrow thumb="/static/my/coupon.png" thumb-size="sm"
  68. rightText="" />
  69. </uni-list>
  70. </view>
  71. </view>
  72. </template>
  73. <script>
  74. export default {
  75. data() {
  76. return {
  77. staticsData: {},
  78. userInfo: {},
  79. height: '',
  80. statistics:{},
  81. }
  82. },
  83. onLoad() {
  84. let sysInfo = uni.getSystemInfoSync()
  85. this.height = sysInfo.windowHeight + 'px'
  86. },
  87. onShow() {
  88. this.userInfo = uni.getStorageSync('spreadUserInfo')
  89. this.getImgUrlByOssId(this.userInfo.img)
  90. this.exStatistics()
  91. },
  92. methods: {
  93. exStatistics(){
  94. this.$api.service.exStatistics().then(res=>{
  95. this.statistics = res.data.data
  96. })
  97. },
  98. navigateTo(url) {
  99. uni.navigateTo({
  100. url: url
  101. })
  102. },
  103. getImgUrlByOssId(Id) {
  104. if (Id) {
  105. this.$api.service.getImage(Id).then(res => {
  106. this.userInfo.selfPhotoUrl = res.data.data[0].url.replace(/^http:/, "https:")
  107. this.$set(this.userInfo)
  108. });
  109. }
  110. },
  111. navigateTo(url) {
  112. uni.navigateTo({
  113. url: url
  114. })
  115. },
  116. goUserInfo() {
  117. uni.navigateTo({
  118. url: '/pages/userInfo/userInfo'
  119. })
  120. },
  121. }
  122. }
  123. </script>
  124. <style lang="scss" scoped>
  125. @import './index.rpx.css';
  126. </style>