index.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <template>
  2. <view>
  3. 我的
  4. </view>
  5. </template>
  6. <script setup>
  7. import {reactive,ref} from "vue";
  8. import {toast} from "@/utils/common";
  9. import {getMineInfo} from '@/api/my.js'
  10. import {onLoad,onShow} from '@dcloudio/uni-app';
  11. import cameraCommon from "@/components/dialog/cameraCommon.vue";
  12. import shexiangtoushuoming from "@/components/dialog/shexiangtoushuoming.vue";
  13. let myInfoData = reactive({
  14. userImg: '',
  15. realName: '',
  16. orgName: '',
  17. userName: '',
  18. positionName:'',
  19. credit:'',
  20. countCert:'',
  21. countNotice:'',
  22. });
  23. const cameraCommonRef = ref(null)
  24. const shexiangtoushuomingRef = ref(null)
  25. const messageContent = ref('请在考试前使用摄像头测试功能,测试摄像头是否可以正常工作,在测试前请先确保摄像头设备可以正常使用.')
  26. onLoad(() => {})
  27. onShow(() => {getMyInit()})
  28. function getMyInit() {
  29. getUserInfo();
  30. }
  31. function getUserInfo(){
  32. getMineInfo({}).then(res => {
  33. myInfoData.userImg= res.data.icon;
  34. myInfoData.realName = res.data.realName;
  35. myInfoData.orgName = res.data.orgName;
  36. myInfoData.userName = res.data.userName;
  37. myInfoData.positionName = res.data.positionName;
  38. myInfoData.credit = res.data.credit;
  39. myInfoData.countCert = res.data.countCert;
  40. myInfoData.countNotice = res.data.countNotice;
  41. })
  42. }
  43. function goToPage(data){
  44. switch (data) {
  45. // 学分
  46. case 'xuefen':
  47. uni.navigateTo({
  48. url:'/pages/my/credit'
  49. })
  50. break;
  51. // 消息
  52. case 'xiaoxi':
  53. uni.navigateTo({
  54. url:'/pages/my/mesList?from=my'
  55. })
  56. break;
  57. // 证书
  58. case 'zhengshu':
  59. uni.navigateTo({
  60. url:'/pages/my/zhengshu'
  61. })
  62. break;
  63. // 错题
  64. case 'cuoti':
  65. uni.navigateTo({
  66. url:'/pages/cuoti/index'
  67. })
  68. break;
  69. // 报名
  70. case 'baoming':
  71. uni.navigateTo({
  72. url:'/pages/baoming/index'
  73. })
  74. break;
  75. // 摄像头测试
  76. case 'sxtcs':
  77. cameraCommonRef.value.handleShow()
  78. // uni.navigateTo({
  79. // url:'/pages/admin/my/myInfo?from=my'
  80. // })
  81. break;
  82. // 摄像头说明
  83. case 'sxtsm':
  84. shexiangtoushuomingRef.value.handleShow()
  85. break;
  86. // 设置
  87. case 'shezhi':
  88. uni.navigateTo({
  89. url:'/pages/my/setting'
  90. })
  91. break;
  92. }
  93. }
  94. </script>
  95. <style>
  96. </style>