use-pop.vue 4.0 KB

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