my.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <view class="page" :style="{'height':sysHeight}">
  3. <uni-nav-bar :fixed="true" background-color="#FFE05C" :border="false" :statusBar="true" title="我的" />
  4. <view class="useInfo flex-row">
  5. <view class="profileView" @click="goUserInfo">
  6. <image class="profile" :src="userInfo.avatarUrl || '/static/ud4.png'"></image>
  7. </view>
  8. <view class="usermsg flex-col">
  9. <view class="name">
  10. <text @click="goUserInfo">{{userInfo.name}}</text>
  11. </view>
  12. <view class="other flex-row">
  13. <text @click="goUserInfo">{{userInfo.post}}</text>
  14. <u-icon name="arrow-right" color="#333333" size="18"></u-icon>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="statistics flex-col">
  19. <view class="statisticsTitle">
  20. <text >业绩统计</text>
  21. </view>
  22. <view class="flex-row justify-center ">
  23. <view class="statisticsItem flex-col ">
  24. <view class="flex-row justify-center">
  25. <u-icon name="/static/my/fuwuNmber.png" size="28"></u-icon>
  26. </view>
  27. <view class="flex-row justify-center statisticsKey">
  28. <text>累计服务(次)</text>
  29. </view>
  30. <view class="flex-row justify-center statisticsValue">
  31. <text>{{staticsData.serviceTotal || 0}}</text>
  32. </view>
  33. </view>
  34. <view class="statisticsItem statisticsItemBorder flex-col ">
  35. <view class="flex-row justify-center">
  36. <u-icon name="/static/my/jinriyeji.png" size="28"></u-icon>
  37. </view>
  38. <view class="flex-row justify-center statisticsKey">
  39. <text>今日业绩(次)</text>
  40. </view>
  41. <view class="flex-row justify-center statisticsValue">
  42. <text>{{staticsData.todayTotal || 0}}</text>
  43. </view>
  44. </view>
  45. <view class="statisticsItem statisticsItemBorder flex-col ">
  46. <view class="flex-row justify-center">
  47. <u-icon name="/static/my/benyueyeji.png" size="28"></u-icon>
  48. </view>
  49. <view class="flex-row justify-center statisticsKey">
  50. <text>本月业绩(次)</text>
  51. </view>
  52. <view class="flex-row justify-center statisticsValue">
  53. <text>{{staticsData.monthTotal || 0}}</text>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. <view class="tuoke ">
  59. <view class="statisticsTitle ">
  60. <text >拓客统计</text>
  61. </view>
  62. <view class="flex-row justify-center ">
  63. <view class="statisticsItem flex-col" :style="{'width':'50%'}">
  64. <view class="flex-row justify-center">
  65. <u-icon name="/static/my/jinrirenwu.png" size="28"></u-icon>
  66. </view>
  67. <view class="flex-row justify-center statisticsKey">
  68. <text>今日任务</text>
  69. </view>
  70. <view class="flex-row justify-center statisticsValue">
  71. <text>{{staticsData.todayTask || 0}}</text>
  72. </view>
  73. </view>
  74. <view class="statisticsItem statisticsItemBorder flex-col" :style="{'width':'50%'}">
  75. <view class="flex-row justify-center">
  76. <u-icon name="/static/my/benyuerenwu.png" size="28"></u-icon>
  77. </view>
  78. <view class="flex-row justify-center statisticsKey">
  79. <text>完成任务</text>
  80. </view>
  81. <view class="flex-row justify-center statisticsValue">
  82. <text>{{staticsData.finishTask || 0}}</text>
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. <!-- <view class="list">-->
  88. <!-- <uni-list>-->
  89. <!-- <uni-list-item :to="item.to" :title="item.title" showArrow :thumb="item.thumb" thumb-size="medium" :rightText="item.rightText" v-for="(item,index) in group1" :key="index"/>-->
  90. <!-- </uni-list>-->
  91. <!-- </view>-->
  92. </view>
  93. </template>
  94. <script>
  95. export default {
  96. data() {
  97. return {
  98. storeId:'',
  99. userInfo:'',
  100. staticsData:'',
  101. sysHeight:'',
  102. group1: [
  103. {thumb: '/static/my/idcard.png', title: '个人信息', rightText: '', to: '/pages/userInfo/userInfo'}
  104. ],
  105. }
  106. },
  107. onLoad(){
  108. let sysInfo = uni.getSystemInfoSync()
  109. this.sysHeight = sysInfo.windowHeight + 'px'
  110. console.log(this.sysHeight)
  111. },
  112. onShow(){
  113. this.storeId = uni.getStorageSync('storeId')
  114. this.getUserInfo()
  115. this.statics()
  116. },
  117. methods: {
  118. goUserInfo(){
  119. uni.navigateTo({
  120. url: '/pages/userInfo/userInfo'
  121. })
  122. },
  123. getUserInfo(){
  124. this.$api.user.getUserInfo().then(res=>{
  125. this.userInfo = res.data.data
  126. uni.setStorageSync('userInfo', this.userInfo )
  127. if (this.userInfo.avatar){
  128. this.getImgUrlByOssId(this.userInfo.avatar)
  129. }
  130. })
  131. },
  132. getImgUrlByOssId(ossId){
  133. this.$api.service.getImgUrlByOssId({ossId:ossId}).then(res=>{
  134. this.$set(this.userInfo,'avatarUrl', res.data.data[0].url.replace(/^http:/, "https:"))
  135. uni.setStorageSync('userInfo', this.userInfo )
  136. })
  137. },
  138. statics(){
  139. this.$api.service.statics({
  140. storeId:this.storeId
  141. }).then(res=>{
  142. this.staticsData = res.data.data
  143. })
  144. },
  145. }
  146. }
  147. </script>
  148. <style lang="scss" scoped>
  149. @import './index.rpx.css';
  150. </style>