myinfo.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <view style="background-color: #fff;">
  3. <view class="" style="width: 100%;height: 30rpx;background-color: #f7f7f7;">
  4. </view>
  5. <view class="my_infobox">
  6. <view class="my_info_item">
  7. <view class="">
  8. 账号名称
  9. </view>
  10. <view class="">
  11. {{userinfo.username}}
  12. </view>
  13. </view>
  14. <view class="">
  15. <u-collapse>
  16. <u-collapse-item title="隶属海关" name="Docs guide">
  17. <p class="u-collapse-content" v-for="(item,index) in userinfo.org_list" :key="index">
  18. {{index+1+"、"}}{{item.org_name}}</p>
  19. <p v-if="userinfo.org_list.length == 0">暂无组织信息</p>
  20. </u-collapse-item>
  21. </u-collapse>
  22. </view>
  23. <view class="my_info_item">
  24. <view class="">
  25. 角色
  26. </view>
  27. <view class="">
  28. {{userinfo.real_name}}
  29. </view>
  30. </view>
  31. <view class="my_info_item">
  32. <view class="">
  33. 手机号码
  34. </view>
  35. <view class="">
  36. {{userinfo.mobile}}
  37. </view>
  38. </view>
  39. <view class="my_info_item">
  40. <view class="">
  41. 邮箱
  42. </view>
  43. <view class="">
  44. {{userinfo.email}}
  45. </view>
  46. </view>
  47. <view class="my_info_item" @click="toalter">
  48. <view class="">
  49. 密码
  50. </view>
  51. <view class="item_name">
  52. 修改
  53. </view>
  54. </view>
  55. <view class="my_info_item">
  56. <u-button type="primary" text="退出账号" @click="show = true" shape="circle"></u-button>
  57. <u-modal :show="show" :title="title" :content='content' :showCancelButton="true" @confirm="confirm" @cancel="show = false"></u-modal>
  58. </view>
  59. </view>
  60. </view>
  61. </template>
  62. <script>
  63. import store from '@/store/index.js'; //需要引入store
  64. let App = getApp();
  65. var API = App.globalData.socketTask;
  66. export default {
  67. data() {
  68. return {
  69. userinfo: {
  70. org_list:[]
  71. },
  72. orglist: "",
  73. title: "",
  74. show: false,
  75. content: "确定要退出当前账号吗?"
  76. }
  77. },
  78. methods: {
  79. async getinfo() {
  80. const res = await this.$myRequest({
  81. url: '/api/api_gateway?method=sysmenage.usermanager.user_info',
  82. })
  83. console.log(res)
  84. this.userinfo = res
  85. },
  86. toalter() {
  87. uni.navigateTo({
  88. url: './password',
  89. });
  90. },
  91. async confirm() {
  92. const res = await this.$myRequest({
  93. url: '/api/api_gateway?method=sysmenage.usermanager.user_logout',
  94. })
  95. console.log(res)
  96. if(res){
  97. App.close();
  98. uni.removeStorage({
  99. key: 'session_key',
  100. })
  101. uni.reLaunch({
  102. url: '../login/login',
  103. });
  104. }
  105. }
  106. },
  107. onLoad() {
  108. this.getinfo()
  109. }
  110. }
  111. </script>
  112. <style lang="less" scoped>
  113. page{
  114. background-color: #f7f7f7;
  115. }
  116. .my_infobox {
  117. width: 90%;
  118. margin: 0 auto;
  119. .my_info_item {
  120. display: flex;
  121. padding: 30rpx 0;
  122. border-bottom: 1px solid #F6F6F6;
  123. justify-content: space-between;
  124. .item_name {
  125. color: #409eff;
  126. }
  127. }
  128. .my_info_item:first-child {
  129. border-bottom: 0;
  130. }
  131. /deep/.u-line {
  132. border-bottom: 1px solid #F6F6F6 !important;
  133. transform: scaleY(1) !important;
  134. }
  135. /deep/.u-cell__body {
  136. padding-left: 0;
  137. padding-right: 0;
  138. font-size: 32rpx;
  139. .u-cell__title-text {
  140. font-size: 32rpx;
  141. font-family: "微软雅黑";
  142. }
  143. }
  144. }
  145. </style>