123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211 |
- <template>
- <div class="i_body">
- <div class="i_top">
- <div class="img">
- <img :src="info.headportrait ? info.headportrait : avator" alt="" />
- </div>
- <div class="name">
- <span>{{ info.username }}</span>
- </div>
- </div>
- <div class="i_bottom">
- <div class="i_bottom_span">
- <span>班级</span>
- <el-tooltip
- :content="info.cname ? info.cname : '暂无'"
- placement="top"
- effect="dark"
- >
- <span>{{ info.cname ? info.cname : "暂无" }}</span>
- </el-tooltip>
- </div>
- <div class="i_bottom_span">
- <span>备注</span>
- <el-tooltip
- :content="info.intro ? info.intro : '暂无'"
- placement="top"
- effect="dark"
- >
- <span>{{ info.intro ? info.intro : "暂无" }}</span>
- </el-tooltip>
- </div>
- <div class="i_bottom_btn" @click="openInfo()">
- <span class="edit"></span>
- <span>编辑个人信息</span>
- </div>
- </div>
- <infoDialog
- :dialogVisibleInfo.sync="dialogVisibleInfo"
- :userid="userid"
- :oid="oid"
- ></infoDialog>
- </div>
- </template>
- <script>
- import avator from "../../../../assets/icon/test/teacher.jpg";
- import infoDialog from "./infoDialog/index.vue";
- export default {
- components: {
- infoDialog,
- },
- props: {
- userid: {
- type: String,
- },
- oid: {
- type: String,
- },
- },
- data() {
- return {
- avator: avator,
- info: {},
- dialogVisibleInfo: false,
- };
- },
- watch: {
- dialogVisibleInfo(newValue, oldValue) {
- this.getData();
- },
- },
- methods: {
- getData() {
- let params = {
- uid: this.userid,
- };
- this.ajax
- .get(this.$store.state.api + "selectSDetail", params)
- .then((res) => {
- this.info = res.data[0][0];
- // 用于存储归类后的数据的对象
- })
- .catch((err) => {
- console.error(err);
- });
- },
- openInfo() {
- this.dialogVisibleInfo = true;
- },
- },
- mounted() {
- this.getData();
- },
- };
- </script>
- <style scoped>
- .i_body {
- width: 100%;
- min-height: auto;
- height: calc(40% - 10px);
- background: #fff;
- border-radius: 10px;
- margin-bottom: 10px;
- overflow: hidden;
- }
- .i_top {
- height: 55%;
- width: calc(100% - 20px);
- margin: 0 auto;
- display: flex;
- flex-direction: column;
- padding: 10px 0px 0px;
- justify-content: center;
- align-items: center;
- box-sizing: border-box;
- border-bottom: 1px solid #efefef;
- }
- .i_top > .img {
- width: 80px;
- height: 80px;
- overflow: hidden;
- border-radius: 50%;
- }
- .i_top > .img > img {
- width: 100%;
- height: 100%;
- object-fit: cover;
- }
- .i_top > .name {
- width: 100%;
- margin: 10px;
- text-align: center;
- }
- .i_top > .name > span {
- display: block;
- max-width: 100%;
- font-size: 22px;
- font-weight: 700;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .i_bottom {
- height: 45%;
- width: calc(100% - 20px);
- margin: 0 auto;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- }
- .i_bottom > .i_bottom_span {
- width: 90%;
- margin: 0 auto;
- display: flex;
- align-items: center;
- font-size: 15px;
- }
- .i_bottom > .i_bottom_span + .i_bottom_span {
- margin-top: 10px;
- }
- .i_bottom > .i_bottom_span > span:nth-child(1) {
- width: 50px;
- min-width: 50px;
- text-align: right;
- color: #a1a1a1;
- }
- .i_bottom > .i_bottom_span > span:nth-child(2) {
- width: calc(100% - 30px);
- overflow: hidden;
- margin-left: 20px;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .i_bottom > .i_bottom_btn {
- cursor: pointer;
- border-radius: 5px;
- border: 1px solid #dbdbdb;
- box-sizing: border-box;
- width: 90%;
- background: rgb(252, 252, 252);
- margin: 30px auto 0;
- height: 35px;
- font-weight: 600;
- font-size: 12px;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .i_bottom > .i_bottom_btn > .edit {
- display: block;
- width: 15px;
- height: 15px;
- background-size: 100% 100%;
- background-image: url("../../../../assets/icon/test/edit-icon.png");
- margin-right: 10px;
- }
- </style>
|