123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406 |
- <template>
- <view>
- <u-navbar :title="classDetail.className"></u-navbar>
- <u-tabs :list="list" :is-scroll="false" :current="current" @change="change" active-color="#1CBECA"
- bar-width="100"></u-tabs>
- <view class="content-1" v-if="this.current==0">
- <u-cell-group>
- <!-- <u-cell-item title="所属学部" value="文艺部" :arrow="false"></u-cell-item> -->
- <u-cell-item title="所属课程项目" :value="classDetail.courseSortName" :arrow="false"></u-cell-item>
- <!-- <u-cell-item title="上课时间" value="周四晚上18:00-19:30周六上午11:20-12:40" :arrow="false"></u-cell-item> -->
- <u-cell-item title="上课教室" :value="classDetail.classroomName" :arrow="false"></u-cell-item>
- <u-cell-item title="授课老师" :value="classDetail.teacherNames" :arrow="false"></u-cell-item>
- <u-cell-item title="咨询电话" :value="classDetail.consultPhone" :arrow="false"></u-cell-item>
- <u-cell-item title="学员总数" :value="classDetail.crtStudentCount+'人'" :arrow="false"></u-cell-item>
- </u-cell-group>
- </view>
- <view class="content-2" v-if="this.current==1">
- <view class="search">
- <u-search v-model="queryName" placeholder="搜索学员姓名" action-text="查询"
- @custom="queryStudent"></u-search>
- </view>
- <!-- <view class="student-details" @click="gotoUrl('pages/teacher/myClass/studentDetails')">
- <view class="photo">
- <img src="../../../assets/img/photo@1x.png" alt="">
- </view>
- <view class="details">
- <view class="name-tel">
- <view class="name">
- 王紫瑄
- </view>
- <view class="tel">
- <img src="../../../assets/img/riLine-smartphone-line@1x.png" alt="">
- <view class="">17700112233
- </view>
- </view>
- </view>
- </view>
- <view class="more">
- <u-icon name="arrow-right" color="#cccccc"></u-icon>
- </view>
- </view> -->
-
-
- <view class="student-card" v-for="(item,index) in studentList" :key="index">
- <!-- <view class="title">
- <view><img src="../../../assets/img/fas fa-graduation-cap@1x.png" alt=""></view>
- <view>
- 学员详情
- </view>
- </view> -->
- <view class="details">
-
- <view class="photo">
- <u-avatar class="avatar" mode="square"
- :src="item.headPhoto != null ? item.headPhoto : '../../assets/img/head.png'" size="112">
- </u-avatar>
- </view>
- <view class="information">
- <view class="name">
- {{item.studentName}}
- </view>
- <view class="item">
- <view class="item-name">
- 年龄
- </view>
- <view class="item-content">
- {{getAge(item.birthday)}}
- </view>
- </view>
- <view class="item">
- <view class="item-name">
- 联系人手机号
- </view>
- <view class="item-content">
- {{item.firstContactPhone}}
- </view>
- </view>
- <view class="item">
- <view class="item-name">
- 第二联系人手机号
- </view>
- <view class="item-content">
- {{item.secondContactPhone}}
- </view>
- </view>
- <view class="item">
- <view class="item-name">
- 接送家长姓名
- </view>
- <view class="item-content">
- {{item.takerName}}
- </view>
- </view>
- <view class="item">
- <view class="item-name">
- 剩余课时
- </view>
- <view class="item-content">
- {{item.stuRemainNum}}
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import * as myClassApi from '@/apis/teacher/myClass.js'
-
- export default {
- data() {
- return {
- list: [{
- name: '班级信息'
- }, {
- name: '学员信息',
- }],
- current: 0,
- classId: '',
- queryName: '',
- classDetail: {},
- studentList: [],
- }
- },
- onLoad(op) {
- if(op.id) {
- this.classId = op.id;
- this.getLoadMyClass();
- this.getLoadClassStudents();
- }
- },
- methods: {
- queryStudent() {
- this.getLoadClassStudents();
- },
- getAge(str) {
- var r = str.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/);
- if (r == null) return false;
- var d = new Date(r[1], r[3] - 1, r[4]);
- if (d.getFullYear() == r[1] && (d.getMonth() + 1) == r[3] && d.getDate() == r[4]) {
- var date = new Date();
- var Y = date.getFullYear() - r[1];
- var M = date.getMonth() + 1 - r[3];
- var D = date.getDate();
- if (parseInt(D) - parseInt(r[4]) < 0) {
- M--;
- if (M < 0) {
- Y--;
- M = 11;
- }
- }
- if (M < 0) {
- Y--;
- M = 11;
- }
- if(Y != 0 && M != 0) {
- return (Y + "岁" + M + "个月");
- }else if(Y != 0 && M == 0) {
- return (Y + "岁");
- }else {
- return (M + "个月");
- }
- }
- return ("输入的日期格式错误!");
- },
- getLoadClassStudents() {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- myClassApi.loadClassStudents({
- classId: this.classId,
- queryName: this.queryName
- }).then((res) => {
- uni.hideLoading();
- this.studentList = res.data;
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- getLoadMyClass() {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- myClassApi.loadMyClass({
- classId: this.classId
- }).then((res) => {
- uni.hideLoading();
- this.classDetail = res.data[0];
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- change(index) {
- this.current = index;
- },
- }
- }
- </script>
- <style lang="scss" scoped>
-
- .u-tabs{
- position: fixed;
- top: 88rpx;
- left: 0;
- right: 0;
- z-index: 999;
- }
- .content-1{
- margin-top: 80rpx;
- }
- .student-card{
- margin: 0rpx 32rpx 16rpx;
- padding: 2rpx 32rpx 16rpx 32rpx;
- background-color: #fff;
- border-radius: 12px;
- .title{
- display: flex;
- align-items: center;
- color: rgba(51, 51, 51, 1);
- font-weight: bold;
- img{
- vertical-align: middle;
- margin-right: 16rpx;
- }
- }
- .details{
- margin-top: 40rpx;
- display: flex;
- .photo{
- width: 160rpx;
- height: 160px;
- border-radius: 8px;
- margin-right: 32rpx;
- overflow: hidden;
- img{
- width: 100%;
- height: 100%;
- }
- }
- }
- .information{
- .name{
- color: rgba(51, 51, 51, 1);
- font-size: 36rpx;
- font-weight: bold;
- margin-bottom: 20rpx;
- }
- .item{
- display: flex;
- margin-bottom: 16rpx;
- justify-content: space-between;
- font-size: 28rpx;
- .item-name{
- width: 240rpx;
- color: rgba(119, 119, 119, 1);
- }
- .item-content{
- flex: 1;
- color: rgba(51, 51, 51, 1);
- margin-left: 16rpx;
-
- }
-
- }
-
- }
- }
-
-
- ::v-deep.u-tab-item {
- color: #101010 !important;
- }
- ::v-deep.u-cell_title {
- color: rgba(119, 119, 119, 1);
- }
- ::v-deep.u-cell__value {
- color: #333333;
- flex: 0.45;
- margin-left: auto;
- }
- .search {
- // background-color: #fff;
- padding: 16rpx 24rpx;
- margin-top: 80rpx;
- }
- ::v-deep.u-action {
- width: 17.1%;
- text-align: center;
- line-height: 56rpx;
- border-radius: 50px;
- background-color: rgba(13, 186, 199, 1);
- color: rgba(255, 255, 255, 1);
- }
- ::v-deep.u-content {
- height: 56rpx !important;
- background-color: #fff !important;
- }
- ::v-deep.u-input {
- background-color: #fff !important;
- }
- .student-details {
- padding: 24rpx 32rpx;
- background-color: #fff;
- display: flex;
- position: relative;
- border-bottom: 1px solid rgba(229, 231, 234, 1);
- ;
- .photo {
- width: 112rpx;
- height: 112rpx;
- border-radius: 4px;
- overflow: hidden;
- margin-right: 22rpx;
- img {
- width: 100%;
- height: 100%;
- }
- }
- .details {
- display: flex;
- align-items: center;
- .name-tel {
- .name {
- margin-right: 12px;
- color: rgba(51, 51, 51, 1);
- font-size: 18px;
- margin-bottom: 16rpx;
- }
- .tel {
- color: rgba(119, 119, 119, 1);
- // line-height: 24px;
- display: flex;
- align-items: center;
- }
- }
- }
- .more {
- color: #333333;
- position: absolute;
- bottom: 65rpx;
- right: 24rpx;
- }
- }
- @media screen and (max-width:320px){
- .student-card{
- padding: 2rpx 12rpx 0rpx 12rpx;
- margin: 32rpx 16rpx;
- }
- .item-name{
- width: 244rpx !important;
- }
- }
- ::v-deep.uni-input-placeholder{
- font-size: 24rpx
- }
- .content-2{
- margin-top: 180rpx;
- .search{
- position: fixed;
- left: 24rpx;
- right: 24rpx;
- top: 88rpx;
- z-index: 999;
- background-color: #F2F4F4;
- }
-
- }
- </style>
|