index.vue 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 my-num-badge" v-if="myInfoData.kaoshiCount"
  16. :customStyle="{background: '#ff2527'}" :text="myInfoData.kaoshiCount" />
  17. <icon class="ks-icon"></icon>
  18. <text class="num-title">考试管理</text>
  19. </view>
  20. <view class="num-item-box">
  21. <uni-badge class="uni-badge-left-margin my-num-badge" v-if="myInfoData.lianxiCount"
  22. :customStyle="{background: '#ff2527'}" :text="myInfoData.lianxiCount" />
  23. <icon class="lx-icon"></icon>
  24. <text class="num-title">练习管理</text>
  25. </view>
  26. <view class="num-item-box">
  27. <uni-badge class="uni-badge-left-margin my-num-badge" v-if="myInfoData.kechengCount"
  28. :customStyle="{background: '#ff2527'}" :text="myInfoData.kechengCount" />
  29. <icon class="kc-icon"></icon>
  30. <text class="num-title">课程管理</text>
  31. </view>
  32. </view>
  33. <view class="my-list-box">
  34. <view class="list-row" @click="telClick">
  35. <icon class="list-icon user-icon"></icon>
  36. <text>修改个人信息</text>
  37. </view>
  38. <view class="list-row" @click="checkWrong">
  39. <icon class="list-icon score-icon"></icon>
  40. <text>成绩列表</text>
  41. </view>
  42. <view class="list-row" @click="exitLogin">
  43. <icon class="list-icon login-out-icon"></icon>
  44. <text>退出登录</text>
  45. </view>
  46. </view>
  47. <!-- 底部区域 -->
  48. <customTabbarClient></customTabbarClient>
  49. </view>
  50. </template>
  51. <script setup>
  52. import {onLoad} from '@dcloudio/uni-app';
  53. import {getMineUser,getMineInfo} from '@/api/my.js'
  54. import {reactive,ref} from "vue";
  55. import customTabbarClient from "@/components/custom-tabbar/custom-tabbar-client.vue"
  56. let myInfoData = reactive({
  57. userImg: '',
  58. userName: '',
  59. idcard: '',
  60. kaoshiCount: '',
  61. kechengCount: '',
  62. lianxiCount: '',
  63. });
  64. function getMyInit() {
  65. getUserInfo();
  66. getNumInfo();
  67. }
  68. function getUserInfo(){
  69. getMineUser({}).then(res => {
  70. myInfoData.userImg= res.data.icon;
  71. myInfoData.userName = res.data.userName;
  72. myInfoData.idcard = res.data.idcard;
  73. })
  74. }
  75. function getNumInfo(){
  76. getMineInfo({}).then(res => {
  77. myInfoData.kaoshiCount = res.data.kaoshiCount;
  78. myInfoData.kechengCount = res.data.kechengCount;
  79. myInfoData.lianxiCount = res.data.lianxiCount;
  80. })
  81. }
  82. function exitLogin(){
  83. }
  84. onLoad(() => {
  85. getMyInit()
  86. })
  87. </script>
  88. <style>
  89. </style>