index.vue 2.3 KB

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