use-pop.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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. <!-- #ifdef APP-PLUS -->
  29. <view class="use-msg-line">
  30. <image class="label-icon" src="@/static/image/home/banben-icon.png" mode=""></image>
  31. <view class="use-msg-line-cont">
  32. <view>版本号</view>
  33. <view class="line-value">
  34. <view>V{{appVersion}}</view>
  35. <!-- <u-icon name="arrow-right" color="#7E838D"></u-icon> -->
  36. </view>
  37. </view>
  38. </view>
  39. <!-- #endif -->
  40. </view>
  41. <button class="toLoginBtn" @click="logout">
  42. 退出登录
  43. </button>
  44. </view>
  45. </u-popup>
  46. </view>
  47. </template>
  48. <script>
  49. export default{
  50. props:{
  51. userInfo:{
  52. type:Object,
  53. default:()=>{}
  54. },
  55. value:{
  56. type:Boolean,
  57. default:false
  58. }
  59. },
  60. watch:{
  61. value(val) {
  62. this.meunShow = val
  63. }
  64. },
  65. data() {
  66. return {
  67. meunShow:false
  68. }
  69. },
  70. computed:{
  71. appVersion() {
  72. let text = ''
  73. text = uni.getStorageSync('appVersion') || '1.0.0'
  74. return text
  75. }
  76. },
  77. methods:{
  78. closeClick() {
  79. this.meunShow = false
  80. this.$emit('close')
  81. },
  82. logout() {
  83. this.$store.dispatch('userLogout')
  84. }
  85. }
  86. }
  87. </script>
  88. <style lang="scss" scoped>
  89. .meun-pop {
  90. padding: 0 32rpx;
  91. padding-top: calc(74rpx + var(--status-bar-height));
  92. width: 80vw;
  93. .use-cont {
  94. display: flex;
  95. align-items: center;
  96. &-name {
  97. color: #0F1828;
  98. font-family: "PingFang SC";
  99. font-size: 32rpx;
  100. font-weight: bold;
  101. margin-left: 20rpx;
  102. margin-right: 8rpx;
  103. }
  104. .edit-img {
  105. width: 32rpx;
  106. height: 32rpx;
  107. }
  108. }
  109. .use-msg {
  110. margin-top: 32rpx;
  111. border-radius: 16rpx;
  112. background: #FFF;
  113. box-shadow: 0px 4rpx 16rpx 0px rgba(207, 223, 232, 0.12);
  114. padding: 0 32rpx;
  115. &-line {
  116. display: flex;
  117. align-items: center;
  118. .label-icon {
  119. width: 48rpx;
  120. height: 48rpx;
  121. }
  122. &-cont {
  123. display: flex;
  124. align-items: center;
  125. justify-content: space-between;
  126. height: 100rpx;
  127. border-bottom: 1px solid rgba(191, 200, 219, 0.50);
  128. margin-left: 24rpx;
  129. flex: 1;
  130. color: #0F1828;
  131. font-family: "PingFang SC";
  132. font-size: 28rpx;
  133. font-weight: 400;
  134. .line-value {
  135. display: flex;
  136. align-items: center;
  137. color: #666;
  138. .u-icon {
  139. margin-left: 24rpx;
  140. }
  141. }
  142. }
  143. }
  144. }
  145. .toLoginBtn {
  146. height: 88rpx;
  147. background: linear-gradient(90deg, #1A65FF 0%, #4287FF 100%);
  148. border-radius: 16rpx;
  149. color: #fff;
  150. margin-bottom: 32rpx;
  151. margin-top: 30rpx;
  152. }
  153. }
  154. </style>