identity.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template>
  2. <view>
  3. <!-- 学生选择按钮 -->
  4. <button class="student" open-type="getUserInfo" @click="getStudentId()">
  5. <view class="stu">
  6. 学生
  7. </view>
  8. <view class="stu_point">
  9. 学生用户选择此项
  10. </view>
  11. <view class="stu_img">
  12. <image src="../../static/stu_img.svg" mode=""></image>
  13. </view>
  14. </button>
  15. <!-- 维修人员选择按钮 -->
  16. <button class="worker" @click="getlogin()">
  17. <view class="work">
  18. 维修人员
  19. </view>
  20. <view class="work_point">
  21. 维修人员选择此项
  22. </view>
  23. <view class="work_img">
  24. <image src="../../static/work_img.svg" mode=""></image>
  25. </view>
  26. </button>
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. data() {
  32. return {
  33. dormNumber:'',
  34. studentClazz:'',
  35. studentDprmitory:'',
  36. studentId:'',
  37. studentName:'',
  38. studentPhone:'',
  39. studentOtherPhone:'',
  40. studentSex:'',
  41. homeUrl:"https://jtishfw.ncjti.edu.cn/baoxiu/repairApi"
  42. }
  43. },
  44. methods: {
  45. getlogin(){
  46. uni.reLaunch({
  47. url:'../login/login',
  48. })
  49. },
  50. async getStudentId(){
  51. this.$https.post(`${this.homeUrl}/student/queryByStudentId`)
  52. .then(result=>{
  53. console.log('---------')
  54. console.log(result)
  55. uni.setStorage({
  56. key:"student",
  57. data:result.data,
  58. success:function(){
  59. uni.redirectTo({
  60. url:'../personal-information/personal-information'
  61. })}
  62. })
  63. },err=>{})
  64. },
  65. }
  66. }
  67. </script>
  68. <style>
  69. .student{
  70. position: relative;
  71. width: 351px;
  72. height: 149px;
  73. margin-top: 74px;
  74. margin-left: 12px;
  75. border-radius: 16px;
  76. background-color: rgba(42, 69, 228, 0.89);
  77. }
  78. .student .stu{
  79. position: absolute;
  80. top: 17px;
  81. left: 25px;
  82. font-size: 28px;
  83. font-weight: 700;
  84. color: rgba(255, 255, 255, 1);
  85. }
  86. .student .stu_point{
  87. position: absolute;
  88. top: 69px;
  89. left: 79px;
  90. font: 16px;
  91. color: rgba(255, 255, 255, 1);
  92. }
  93. .student image{
  94. position: absolute;
  95. right: 20px;
  96. top: 36px;
  97. width: 76px;
  98. height: 76px;
  99. }
  100. .worker{
  101. position: relative;
  102. width: 351px;
  103. height: 149px;
  104. margin-top: 57px;
  105. margin-left: 12px;
  106. border-radius: 16px;
  107. background-color: rgba(42, 130, 228, 1);
  108. }
  109. .worker .work {
  110. position: absolute;
  111. top: 17px;
  112. left: 25px;
  113. font-size: 28px;
  114. font-weight: 700;
  115. color: rgba(255, 255, 255, 1);
  116. }
  117. .worker .work_point{
  118. position: absolute;
  119. top: 69px;
  120. left: 79px;
  121. font: 16px;
  122. color: rgba(255, 255, 255, 1);
  123. }
  124. .worker image{
  125. position: absolute;
  126. right: 20px;
  127. top: 36px;
  128. width: 76px;
  129. height: 76px;
  130. }
  131. </style>