index.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <template>
  2. <view class="client-my-page">
  3. <view class="my-head-box">
  4. <img class="head-img-box" :src="myInfoData.userImg">
  5. <view class="head-content-box">
  6. <text>{{myInfoData.userName}}</text>
  7. <view class="idcard-row-box">
  8. <icon class="idcard-icon"></icon>
  9. <text class="idcard-text" >{{myInfoData.idcard}}</text>
  10. </view>
  11. </view>
  12. </view>
  13. <view class="my-num-box">
  14. <view class="num-item-box">
  15. <uni-badge class="uni-badge-left-margin" text="1" />
  16. <icon></icon>
  17. <text></text>
  18. </view>
  19. <view class="num-item-box">
  20. <icon></icon>
  21. <text></text>
  22. </view>
  23. <view class="num-item-box">
  24. <icon></icon>
  25. <text></text>
  26. </view>
  27. </view>
  28. </view>
  29. </template>
  30. <script setup>
  31. import {onLoad} from '@dcloudio/uni-app';
  32. import {getMineUser,getMineInfo} from '@/api/my.js'
  33. import {reactive,ref} from "vue";
  34. let myInfoData = reactive({
  35. userImg: '',
  36. userName: '',
  37. idcard: '',
  38. kaoshiCount: '',
  39. kechengCount: '',
  40. lianxiCount: '',
  41. });
  42. function getMyInit() {
  43. getUserInfo();
  44. getNumInfo();
  45. }
  46. function getUserInfo(){
  47. getMineUser({}).then(res => {
  48. myInfoData.userImg= res.data.icon;
  49. myInfoData.userName = res.data.userName;
  50. myInfoData.idcard = res.data.idcard;
  51. })
  52. }
  53. function getNumInfo(){
  54. getMineInfo({}).then(res => {
  55. myInfoData.kaoshiCount = res.data.kaoshiCount;
  56. myInfoData.kechengCount = res.data.kechengCount;
  57. myInfoData.lianxiCount = res.data.lianxiCount;
  58. })
  59. }
  60. onLoad(() => {
  61. getMyInit()
  62. })
  63. </script>
  64. <style>
  65. </style>