index.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <view class="mine-page white-wrap">
  3. <view class="top-box flex">
  4. <view>
  5. <open-data class="avatar" type="userAvatarUrl"></open-data>
  6. <!-- <image class="avatar" :src="userInfo.Headimgurl" mode="aspectFill"/> -->
  7. </view>
  8. <view>
  9. <view style="margin-bottom:10rpx">{{userInfo.RealName}}</view>
  10. <view>ID:{{userInfo.AdminName}}</view>
  11. </view>
  12. </view>
  13. <view class="base-info-wrap white-wrap">
  14. <view style="font-size: 16px;font-weight: bold;">基本信息</view>
  15. <view class="info-list">
  16. <view class="info-item flex" id='id' @click="handleClick">
  17. <text class="label">公司名称</text>
  18. <text>弘则弥道(上海)投资咨询有限公司</text>
  19. </view>
  20. <view class="info-item flex">
  21. <text class="label">所属部门</text>
  22. <text>{{userInfo.DepartmentName}}<text v-if="userInfo.GroupName">/{{userInfo.GroupName}}</text></text>
  23. </view>
  24. <view class="info-item flex">
  25. <text class="label">角色</text>
  26. <text>{{userInfo.RoleName}}</text>
  27. </view>
  28. </view>
  29. </view>
  30. <view class="loginout-btn">
  31. <van-button type="info" custom-class="btn" round @click="handleLoginOut">退出登录</van-button>
  32. </view>
  33. <van-dialog id="van-dialog" />
  34. </view>
  35. </template>
  36. <script>
  37. import {shareData} from '@/utils/config.js'
  38. export default{
  39. onShow() {
  40. if(!this.$store.state.token||!this.$store.state.userInfo.ProductName){
  41. // uni.navigateTo({
  42. // url:'/pages/login/login'
  43. // })
  44. this.$store.dispatch('WXLogin')
  45. }
  46. },
  47. computed: {
  48. userInfo() {
  49. return this.$store.state.userInfo
  50. }
  51. },
  52. onShareAppMessage() {
  53. return shareData
  54. },
  55. methods: {
  56. handleLoginOut() {
  57. this.$dialog.confirm({
  58. title: '提示',
  59. message: '是否确认退出',
  60. }).then(()=>{
  61. this.$store.dispatch('loginOut')
  62. }).catch(() => {
  63. console.log('取消退出登录');
  64. });
  65. }
  66. },
  67. }
  68. </script>
  69. <style lang="scss">
  70. .mine-page{
  71. width: 100%;
  72. min-height: 100vh;
  73. }
  74. .top-box{
  75. background: linear-gradient(74deg, #7AB8FF 0%, #2457FF 100%);
  76. height: 300rpx;
  77. align-items: center;
  78. font-size: 16px;
  79. font-weight: bold;
  80. color: #fff;
  81. padding-left: 58rpx;
  82. .avatar{
  83. display: block;
  84. margin-right: 20rpx;
  85. width: 178rpx;
  86. height: 178rpx;
  87. border-radius: 50%;
  88. overflow: hidden;
  89. border: 4px solid #fff;
  90. }
  91. }
  92. .base-info-wrap{
  93. min-height: 200rpx;
  94. padding: 60rpx 30rpx 30rpx 58rpx;
  95. }
  96. .info-list{
  97. margin-top: 40rpx;
  98. .info-item{
  99. margin-bottom: 30rpx;
  100. color: #666;
  101. .label{
  102. width: 200rpx;
  103. display: inline-block;
  104. }
  105. }
  106. }
  107. .loginout-btn{
  108. margin-top: 200rpx;
  109. text-align: center;
  110. .btn{
  111. width: 300rpx;
  112. height: 80rpx;
  113. }
  114. }
  115. </style>