index.vue 2.4 KB

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