123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- <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_cloumn">
- <view class="content_name">{{childInfo.name}}</view>
- <view class="content_class">{{childInfo.class}}</view>
- </view>
- <view class="user_data">
- <view class="time_stamp">
- {{timeStamp}}更新
- </view>
- <view class="subscribe_tag" @click="navSubscribe">
- <view class="t-icon t-icon-huangguan1"></view>
- <view class="subscribe_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/userinfo/subscribeinfo'
- })
- }
- }
- }
- </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_cloumn {
- margin-left: 40rpx;
- width: 200rpx;
- height: 120rpx;
- justify-content: space-around;
- .content_name {
- font-size: 55rpx;
- font-family: YSfont;
- color: #FFF;
- z-index: 99;
- }
- .content_class {
- font-size: 40rpx;
- font-family: YSfont;
- color: #FFF;
- z-index: 99;
- }
- }
- .user_data {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: space-around;
- margin-left: auto;
- height: 120rpx;
- .subscribe_tag {
- display: flex;
- align-items: center;
- border-radius: 6rpx;
- padding: 2rpx 12rpx;
- transform: skew(-5deg);
- background: #2f3137;
- z-index: 99;
- .subscribe_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>
|