123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- <template>
- <view>
- <view class="info-box">
- <image class="avatar" v-if="childInfo.avatar === '默认'"
- :src="childInfo.gender==='男'?'/static/default_icons/boy_avatar.svg':'/static/default_icons/girl_avatar.svg'">
- </image>
- <image class="avatar" v-if="childInfo.avatar != '默认'" :src="childInfo.avatar"></image>
- <view class="flex-column">
- <view class="info-name">{{childInfo.name}}</view>
- <view class="info-class">{{childInfo.class}}</view>
- </view>
- <view class="capsule-box">
- <view class="time-stamp">
- {{timeStamp}}更新
- </view>
- <view class="sub-tag" @click="navSubscribe">
- <view class="t-icon t-icon-huangguan1"></view>
- <view class="sub-tag-text">
- {{userData.subscribeLevel}}
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- mapState,
- mapMutations
- } from 'vuex'
- export default {
- name: "top-info",
- props: {
- timeStamp: {
- type: String,
- default: false
- }
- },
- computed: {
- ...mapState('m_children', ['childInfo']),
- ...mapState('m_parent', ['userData'])
- },
- data() {
- return {
- capsuleWidth: ''
- };
- },
- created() {
- this.getCapsuleSite()
- },
- methods: {
- getCapsuleSite() {
- let res = uni.getMenuButtonBoundingClientRect()
- this.capsuleWidth = res.width - 14
- },
- navSubscribe() {
- uni.navigateTo({
- url: '/subpkg/mine/subInfo'
- })
- }
- }
- }
- </script>
- <style lang="scss">
- .info-box {
- margin: 560rpx 50rpx 0 50rpx;
- display: flex;
- align-items: center;
- z-index: 3;
- .avatar {
- width: 112rpx;
- height: 112rpx;
- border-radius: 100%;
- border: 4rpx solid #FFF;
- box-shadow: 0 10rpx 20rpx rgba(0, 0, 0, 0.2);
- z-index: 55;
- }
- .flex-column {
- margin-left: 40rpx;
- width: 200rpx;
- height: 120rpx;
- justify-content: space-around;
- .info-name {
- font-size: 55rpx;
- font-family: YSfont;
- color: #FFF;
- z-index: 99;
- }
- .info-class {
- font-size: 40rpx;
- font-family: YSfont;
- color: #FFF;
- z-index: 99;
- }
- }
- .capsule-box {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: space-around;
- margin-left: auto;
- height: 120rpx;
- .sub-tag {
- display: flex;
- align-items: center;
- border-radius: 6rpx;
- padding: 2rpx 12rpx;
- transform: skew(-5deg);
- background: #2f3137;
- z-index: 99;
- .sub-tag-text {
- margin-left: 2rpx;
- font-size: 28rpx;
- font-family: YSfont;
- color: #d0a97e;
- z-index: 99;
- }
- .t-icon {
- width: 28rpx;
- height: 28rpx;
- margin-top: -2rpx;
- margin-right: 2rpx;
- }
- }
- .time-stamp {
- color: #FFF;
- font-size: 24rpx;
- font-family: YSfont;
- }
- }
- }
- </style>
|