examTeamApp/components/headerIndex.vue

98 lines
1.8 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view>
<view class="header">
<view class="top" v-if="userList.length">
<view class="headimg">
<image :src="user.head_pic"></image>
</view>
<view class="info">
<view class="size20 bold">{{user.nickname}}</view>
<view class="mt-5">年龄{{user.age}}</view>
<view>{{$t("index.birthday")}}{{user.birthday}}</view>
</view>
<text class="t-icon t-icon-qiehuan1" @click="$store.commit('changeDrawe', true)" v-if="isLeft"></text>
</view>
<view class="top" v-else @click="handleAddUser">
<view class="info">
暂无成员请先添加~
</view>
<view class="add">
+
</view>
</view>
</view>
<!-- 地区 -->
<view class="area" v-if="isArea">
<view>
<text>当前地区标准</text>
<text>北京</text>
</view>
</view>
<!-- 切换成员 -->
<drawer></drawer>
</view>
</template>
<script>
import {
mapState
} from "vuex";
import drawer from "@/components/drawer.vue"
export default {
name: "headerIndex",
components: {
drawer
},
props: {
isArea: {
type: Boolean,
default: true
},
isLeft: {
type: Boolean,
default: true
},
},
data() {
return {};
},
computed: {
...mapState(["user", "familayList"]),
userList() {
return this.familayList
}
},
methods: {
// 添加成员
handleAddUser() {
uni.navigateTo({
url: "/pages/index/userInfo"
})
},
}
}
</script>
<style lang="scss" scoped>
.info {
display: flex;
flex-wrap: wrap;
margin-left: 15px;
width: calc(100% - 70px);
view {
width: 100%;
}
}
.area {
margin: 15px 10px 0;
padding: 15px 10px 10px;
background-color: #fff;
width: calc(100% - 40px);
display: flex;
border-radius: 10px;
justify-content: space-between;
}
</style>