12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <template>
- <view>
- <top-return></top-return>
- <view class="top">
- <view class="YS-title" style="color: #4169E1;">选择您的孩子</view>
- </view>
- <!-- 孩子选择界面 -->
- <view class="card-box">
- <view class="card" v-for="(item,index) in childrenData" :key="index" @click="chooseChild(item)">
- <view class="flex-row" style="width: 100%;">
- <view class="front-tag"></view>
- <view class="card-title">{{item.name}}</view>
- </view>
- <view class="avatar-box">
- <image class="avatar" :src="item.gender==='M'?'/static/default_icons/boy_avatar.svg':item.gender===null?'/static/default_icons/boy_avatar.svg':'/static/default_icons/girl_avatar.svg'"></image>
- </view>
- </view>
- </view>
- <!-- 动画 -->
- <view class="ocean"></view>
- </view>
- </template>
- <script>
- import {
- mapState,
- mapMutations
- } from 'vuex'
- export default {
- computed: {
- ...mapState('m_parent', ['childrenData'])
- },
- data() {
- return {
- };
- },
- onLoad() {},
- methods: {
- ...mapMutations('m_children', ['updateChildInfo']),
- //选择孩子并跳转首页传入id查询显示孩子信息
- async chooseChild(item) {
- this.updateChildInfo(item)
- await this.$initTab()
- uni.switchTab({
- url: '/pages/tab_home/tab_home'
- })
- },
- }
- }
- </script>
- <style lang="scss">
- @import 'startup_pages.scss';
- .card-box {
- display: flex;
- justify-content: center;
- align-items: center;
- flex-wrap: wrap; //元素换行
- margin: 250rpx 0 0 0;
- .card {
- width: 280rpx;
- height: 280rpx;
- margin: 20rpx;
- padding: 20rpx;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- box-shadow: $box-shadow;
- background-color: #FFFFFF;
- border-radius: $border-radius;
- z-index: 99;
- .card-title {
- line-height: 35rpx;
- font-size: 35rpx;
- font-weight: bold;
- color: $title;
- }
- .avatar-box {
- padding-top: 10rpx;
- .avatar {
- width: 240rpx;
- height: 240rpx;
- }
- }
- }
- }
- </style>
|