index.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <view class="top_user">
  3. <view class="user_img">
  4. <view class="user_img1">
  5. <uv-avatar fontSize="20" size = 70 randomBgColor :text=userInfo.userInfo.nickname[0]>
  6. </uv-avatar>
  7. </view>
  8. <view class="user_text">
  9. <view class="user_text1">
  10. {{userInfo.userInfo.nickname}}
  11. </view>
  12. <view class="user_text2">
  13. <text style="float: left;">账号:{{userInfo.userInfo.username}}</text>
  14. <view class="user_sf">{{sf[userInfo.userInfo.group]}}</view>
  15. </view>
  16. </view>
  17. </view>
  18. <uv-cell-group>
  19. <view @click="set">
  20. <uv-cell size="large" icon="setting-fill" title="账号设置" :isLink="true"></uv-cell>
  21. </view>
  22. <view @click="quit">
  23. <uv-cell size="large" icon="warning-fill" title="账号退出" :isLink="true"></uv-cell>
  24. </view>
  25. </uv-cell-group>
  26. </view>
  27. </template>
  28. <script setup>
  29. let userInfo =wx.getStorageSync('userInfos')
  30. const sf =['','超级管理员','实验室管理员','学院领导','教师',]
  31. console.log(userInfo)
  32. // 进详情页
  33. function set(){
  34. wx.navigateTo({
  35. url:'/pages/user/set'
  36. })
  37. }
  38. // 账号退出
  39. function quit(){
  40. wx.removeStorage({
  41. key: 'userInfos',
  42. success () {
  43. wx.showLoading({
  44. title: '退出中',
  45. })
  46. setTimeout(function () {
  47. wx.reLaunch({
  48. url:'/pages/login/index'
  49. })
  50. }, 1000)
  51. }
  52. })
  53. }
  54. </script>
  55. <style lang="less">
  56. page{
  57. background-color: rgb(244,245,249);
  58. }
  59. .user_img{
  60. margin-left: 30rpx;
  61. // height: 200rpx;
  62. }
  63. .user_img1{
  64. float: left;
  65. }
  66. .top_user{
  67. width: 100%;
  68. background-color: #fff;
  69. padding-top: 30rpx;
  70. }
  71. .user_text{
  72. padding-left: 90px;
  73. height: 90px;
  74. }
  75. .user_text1{
  76. margin-bottom: 20rpx;
  77. font-size: 40rpx;
  78. }
  79. .user_text2{
  80. color: #808695;
  81. }
  82. .user_sf{
  83. margin-left: 20rpx;
  84. background-color: #5cadff;
  85. color: #fff;
  86. border-radius: 2rpx;
  87. height: 42rpx;
  88. line-height: 42rpx;
  89. font-size: 20rpx;
  90. float: left;
  91. padding: 0 20rpx;
  92. border-radius: 30rpx;
  93. }
  94. </style>