use-pop.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template>
  2. <view>
  3. <u-popup :show="meunShow" @close="closeClick" mode="left" zIndex="999999" bgColor="#F6F8FA">
  4. <view class="meun-pop">
  5. <view class="use-cont">
  6. <u-avatar :src="userInfo.avatar" size="44"></u-avatar>
  7. <view class="use-cont-name">{{userInfo.username}}</view>
  8. <!-- <image class="edit-img" src="@/static/image/home/edit-icon.png" mode=""></image> -->
  9. </view>
  10. <view class="use-msg">
  11. <view class="use-msg-line">
  12. <image class="label-icon" src="@/static/image/home/phone-icon.png" mode=""></image>
  13. <view class="use-msg-line-cont">
  14. <view>手机号</view>
  15. <view class="line-value">{{userInfo.phonenum}}</view>
  16. </view>
  17. </view>
  18. <view class="use-msg-line">
  19. <image class="label-icon" src="@/static/image/home/role-icon.png" mode=""></image>
  20. <view class="use-msg-line-cont">
  21. <view>角色</view>
  22. <view class="line-value">
  23. <view>{{userInfo.position}}</view>
  24. <!-- <u-icon name="arrow-right" color="#7E838D"></u-icon> -->
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. <button class="toLoginBtn" @click="logout">
  30. 退出登录
  31. </button>
  32. </view>
  33. </u-popup>
  34. </view>
  35. </template>
  36. <script>
  37. export default{
  38. props:{
  39. userInfo:{
  40. type:Object,
  41. default:()=>{}
  42. },
  43. value:{
  44. type:Boolean,
  45. default:false
  46. }
  47. },
  48. watch:{
  49. value(val) {
  50. this.meunShow = val
  51. }
  52. },
  53. data() {
  54. return {
  55. meunShow:false
  56. }
  57. },
  58. methods:{
  59. closeClick() {
  60. this.meunShow = false
  61. this.$emit('close')
  62. },
  63. logout() {
  64. this.$store.dispatch('userLogout')
  65. }
  66. }
  67. }
  68. </script>
  69. <style lang="scss" scoped>
  70. .meun-pop {
  71. padding: 0 32rpx;
  72. padding-top: calc(74rpx + var(--status-bar-height));
  73. width: 80vw;
  74. .use-cont {
  75. display: flex;
  76. align-items: center;
  77. &-name {
  78. color: #0F1828;
  79. font-family: "PingFang SC";
  80. font-size: 32rpx;
  81. font-weight: bold;
  82. margin-left: 20rpx;
  83. margin-right: 8rpx;
  84. }
  85. .edit-img {
  86. width: 32rpx;
  87. height: 32rpx;
  88. }
  89. }
  90. .use-msg {
  91. margin-top: 32rpx;
  92. border-radius: 16rpx;
  93. background: #FFF;
  94. box-shadow: 0px 4rpx 16rpx 0px rgba(207, 223, 232, 0.12);
  95. padding: 0 32rpx;
  96. &-line {
  97. display: flex;
  98. align-items: center;
  99. .label-icon {
  100. width: 48rpx;
  101. height: 48rpx;
  102. }
  103. &-cont {
  104. display: flex;
  105. align-items: center;
  106. justify-content: space-between;
  107. height: 100rpx;
  108. border-bottom: 1px solid rgba(191, 200, 219, 0.50);
  109. margin-left: 24rpx;
  110. flex: 1;
  111. color: #0F1828;
  112. font-family: "PingFang SC";
  113. font-size: 28rpx;
  114. font-weight: 400;
  115. .line-value {
  116. display: flex;
  117. align-items: center;
  118. color: #666;
  119. .u-icon {
  120. margin-left: 24rpx;
  121. }
  122. }
  123. }
  124. }
  125. }
  126. .toLoginBtn {
  127. height: 88rpx;
  128. background: linear-gradient(90deg, #1A65FF 0%, #4287FF 100%);
  129. border-radius: 16rpx;
  130. color: #fff;
  131. margin-bottom: 32rpx;
  132. margin-top: 30rpx;
  133. }
  134. }
  135. </style>