1
0

my.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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.avatar || '/static/logo.png'"></image>
  7. </view>
  8. <view class="usermsg flex-col">
  9. <view class="name">
  10. <text @click="goUserInfo">{{userInfo.nickName}}</text>
  11. </view>
  12. <view class="other flex-row">
  13. <text @click="goUserInfo">{{userInfo.phonenumber}}</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 flex-col ">
  35. <view class="flex-row justify-center">
  36. <u-icon name="/static/my/fuwuTimeLong.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.avgServiceTime || 0}}</text>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. <view class="list">
  48. <uni-list>
  49. <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"/>
  50. </uni-list>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. export default {
  56. data() {
  57. return {
  58. storeId:'',
  59. userInfo:'',
  60. staticsData:'',
  61. sysHeight:'',
  62. group1: [
  63. {thumb: '/static/my/idcard.png', title: '个人信息', rightText: '', to: '/pages/userInfo/userInfo'}
  64. ],
  65. }
  66. },
  67. onLoad(){
  68. let sysInfo = uni.getSystemInfoSync()
  69. this.sysHeight = sysInfo.windowHeight + 'px'
  70. console.log(this.sysHeight)
  71. },
  72. onShow(){
  73. this.storeId = uni.getStorageSync('storeId')
  74. this.getUserInfo()
  75. if (!(this.storeId === '' || this.storeId === null)){
  76. this.statics()
  77. }
  78. },
  79. methods: {
  80. goUserInfo(){
  81. uni.navigateTo({
  82. url: '/pages/userInfo/userInfo'
  83. })
  84. },
  85. getUserInfo(){
  86. this.$api.user.getUserInfo().then(res=>{
  87. this.userInfo = res.data.data.user
  88. })
  89. },
  90. statics(){
  91. this.$api.service.statics({
  92. storeId:this.storeId
  93. }).then(res=>{
  94. this.staticsData = res.data.data
  95. })
  96. },
  97. }
  98. }
  99. </script>
  100. <style lang="scss" scoped>
  101. @import './index.rpx.css';
  102. </style>