userinfo.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <view>
  3. <view class="user-section">
  4. <image class="bg" :src="imgUrl+'user-bg.jpg'"></image>
  5. <text class="bg-upload-btn yticon icon-paizhao"></text>
  6. <view class="portrait-box">
  7. <image class="portrait" :src="userInfo.portrait || imgUrl+'missing-face.png'"></image>
  8. <text class="pt-upload-btn yticon icon-paizhao"></text>
  9. </view>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. import {
  15. mapState,
  16. mapMutations
  17. } from 'vuex';
  18. export default {
  19. data() {
  20. return {
  21. imgUrl: getApp().globalData.imgUrl
  22. };
  23. },
  24. computed:{
  25. ...mapState(['userInfo']),
  26. }
  27. }
  28. </script>
  29. <style lang="scss">
  30. page{
  31. background: $page-color-base;
  32. }
  33. .user-section{
  34. display:flex;
  35. align-items:center;
  36. justify-content: center;
  37. height: 460upx;
  38. padding: 40upx 30upx 0;
  39. position:relative;
  40. .bg{
  41. position:absolute;
  42. left: 0;
  43. top: 0;
  44. width: 100%;
  45. height: 100%;
  46. filter: blur(1px);
  47. opacity: .7;
  48. }
  49. .portrait-box{
  50. width: 200upx;
  51. height: 200upx;
  52. border:6upx solid #fff;
  53. border-radius: 50%;
  54. position:relative;
  55. z-index: 2;
  56. }
  57. .portrait{
  58. position: relative;
  59. width: 100%;
  60. height: 100%;
  61. border-radius: 50%;
  62. }
  63. .yticon{
  64. position:absolute;
  65. line-height: 1;
  66. z-index: 5;
  67. font-size: 48upx;
  68. color: #fff;
  69. padding: 4upx 6upx;
  70. border-radius: 6upx;
  71. background: rgba(0,0,0,.4);
  72. }
  73. .pt-upload-btn{
  74. right: 0;
  75. bottom: 10upx;
  76. }
  77. .bg-upload-btn{
  78. right: 20upx;
  79. bottom: 16upx;
  80. }
  81. }
  82. </style>