top-info.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <view>
  3. <view class="info_box">
  4. <image class="avatar" v-if="childInfo.avatar === '默认'"
  5. :src="childInfo.gender==='男'?'/static/default_icons/boy_avatar.svg':'/static/default_icons/girl_avatar.svg'">
  6. </image>
  7. <image class="avatar" v-if="childInfo.avatar != '默认'" :src="childInfo.avatar"></image>
  8. <view class="flex_cloumn">
  9. <view class="content_name">{{childInfo.name}}</view>
  10. <view class="content_class">{{childInfo.class}}</view>
  11. </view>
  12. <view class="user_data">
  13. <view class="tag_text" style="color: #FFF;font-size: 22rpx;transform: skew(-15deg);">
  14. {{timeStamp}}更新
  15. </view>
  16. <view class="tag" @click="navSubscribe"
  17. style="background-image: linear-gradient(90deg, #ffc87e, #ffd192, #ffddae, #ffe3bc);">
  18. <view class="t-icon t-icon-huangguan1-copy11-copy"
  19. style="width: 30rpx; height: 30rpx;margin-right: 5rpx;"></view>
  20. <view class="tag_text" style="color: #714c1b;font-weight: bold;">
  21. {{userData.subscribeLevel}}
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. import {
  30. mapState,
  31. mapMutations
  32. } from 'vuex'
  33. export default {
  34. name: "top-info",
  35. props: {
  36. timeStamp: {
  37. type: String,
  38. default: false
  39. }
  40. },
  41. computed: {
  42. ...mapState('m_children', ['childInfo']),
  43. ...mapState('m_parent', ['userData'])
  44. },
  45. data() {
  46. return {
  47. capsuleWidth: ''
  48. };
  49. },
  50. created() {
  51. this.getCapsuleSite()
  52. },
  53. methods: {
  54. getCapsuleSite() {
  55. let res = uni.getMenuButtonBoundingClientRect()
  56. this.capsuleWidth = res.width - 14
  57. },
  58. navSubscribe() {
  59. uni.navigateTo({
  60. url: '/subpkg/userinfo/subscribeinfo'
  61. })
  62. }
  63. }
  64. }
  65. </script>
  66. <style lang="scss">
  67. .info_box {
  68. margin: 560rpx 50rpx 0 50rpx;
  69. display: flex;
  70. align-items: center;
  71. z-index: 3;
  72. .avatar {
  73. width: 112rpx;
  74. height: 112rpx;
  75. border-radius: 100%;
  76. border: 4rpx solid #FFF;
  77. box-shadow: 0 10rpx 20rpx rgba(0, 0, 0, 0.2);
  78. z-index: 55;
  79. }
  80. .flex_cloumn {
  81. margin-left: 40rpx;
  82. width: 200rpx;
  83. height: 120rpx;
  84. justify-content: space-around;
  85. .content_name {
  86. // font-family: minifont;
  87. font-weight: bold;
  88. font-size: 50rpx;
  89. transform: skew(-15deg);
  90. color: #FFF;
  91. z-index: 99;
  92. }
  93. .content_class {
  94. // font-family: minifont;
  95. font-size: 30rpx;
  96. transform: skew(-15deg);
  97. color: #FFF;
  98. z-index: 99;
  99. }
  100. }
  101. .user_data {
  102. display: flex;
  103. flex-direction: column;
  104. align-items: center;
  105. justify-content: space-around;
  106. margin-left: auto;
  107. height: 120rpx;
  108. .tag {
  109. border: 1px solid #FFF;
  110. display: flex;
  111. justify-content: center;
  112. align-items: center;
  113. border-radius: 6rpx;
  114. padding: 6rpx 10rpx;
  115. margin-left: 0;
  116. }
  117. }
  118. }
  119. </style>