You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

216 lines
5.1 KiB

<template>
<view class="container">
<image class="cbg" :src="base.imgHost('common_bg.png')"></image>
<view class="wrap">
<view v-if="teacher">
<view class="teacher" v-for="tea in teacher">
<view>
<image style="width:97rpx;height:97rpx;margin-right:30rpx"
:src="base.imgHost('txl-teacher.png')"></image>
</view>
<view>
<view class="teacher-name">
<view style="display: flex;align-items: center;">
<text>{{tea.name}}</text>
<text class="courseName">班主任</text>
</view>
</view>
<view class="teacher-mobile">
<image style="width:22rpx;height:22rpx;margin-right:20rpx"
:src="base.imgHost('txl-phone.png')"></image>
<view>{{tea.mobile?tea.mobile:''}}</view>
</view>
</view>
</view>
</view>
<view v-if="!show_mobile" class="showMobile">如需学员联系方式,请联系班主任</view>
<view v-if="studentList.length>0">
<view class="teacher" v-for="item in studentList">
<view>
<image style="width:97rpx;height:97rpx;margin-right:30rpx"
:src="base.imgHost('txl-student.png')"></image>
</view>
<view>
<view class="teacher-name">
<view style="display: flex;align-items: center;">
<text>{{item.name}}</text>
<text class="courseName">{{item.course_signs[0]['position']}}</text>
</view>
</view>
<view class="teacher-company">{{item.company_name?item.company_name:''}}</view>
<view class="teacher-company">{{item.company_position?item.company_position:''}}</view>
<view v-if="show_mobile" class="teacher-company">{{item.mobile?item.mobile:''}}</view>
<!-- <view class="teacher-mobile">
<view style="font-size:24rpx;color:#999;margin-bottom:10rpx">如需联系方式请联系班主任</view>
</view> -->
</view>
</view>
</view>
<!-- <view v-if="list.length>0"> -->
<nextIndexedXlist ref="txllist" :dataList="list" :show-avatar="false">
</nextIndexedXlist>
<!-- </view> -->
<!-- <view class="nodata" v-else>
<u-empty mode="data"></u-empty>
</view> -->
</view>
</view>
</template>
<script>
import nextIndexedXlist from '@/components/next-indexed-xlist/components/next-indexed-xlist/next-indexed-xlist.vue';
export default {
components: {
nextIndexedXlist
},
data() {
return {
list: [],
teacher: [],
studentList: [],
show_mobile: false,
}
},
onLoad(options) {
let that = this
this.show_mobile = options.show_mobile == 1 ? true : false
console.log("this.$refs.txllist",options.show_mobile,this.show_mobile,this.$refs.txllist)
this.$nextTick(function() {
that.$refs.txllist.setShowMobile(options.show_mobile)
})
this.getMyCourseTxl(options.id)
},
methods: {
async getMyCourseTxl(id) {
const res = await this.$u.api.courseUserList({
course_id: id,
type: 2
})
let _student = []
let _other = []
res.list.map(item => {
if (item.course_signs && item.course_signs.length > 0) {
if (!this.base.isNull(item.course_signs[0]['position'])) {
_student.push(item)
} else {
_other.push(item)
}
} else {
_other.push(item)
}
})
this.studentList = _student
this.list = _other
this.teacher = res.teacher
},
}
}
</script>
<style scoped lang="scss">
.container {
padding: 30rpx 60rpx;
width: 100%;
height: 100vh;
overflow: hidden;
.cbg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100vh;
}
.wrap {
position: relative;
height: 100%;
overflow: scroll;
// padding-top: 100rpx;
.nodata {
height: calc(100vh - 160rpx);
}
.showMobile {
font-size: 24rpx;
text-align: left;
padding-left: 30rpx;
color: #999999;
padding-bottom: 20rpx;
}
.teacher {
width: 100%;
background-color: #FFFFFF;
box-sizing: border-box;
padding-left: 24rpx;
margin-bottom: 30rpx;
padding: 30rpx;
background-color: #fff;
border-radius: 20rpx;
display: flex;
align-items: center;
&-name {
font-size: 32rpx;
color: #333;
margin-bottom: 10rpx;
.courseName {
color: #b89155;
margin: 0 20rpx;
font-size: 24rpx;
border-radius: 0rpx 28rpx 28rpx 28rpx;
color: #fff;
padding: 0rpx 15rpx;
background: #b89155;
}
}
&-mobile {
display: flex;
align-items: center;
color: #666666;
font-size: 28rpx;
margin-bottom: 10rpx;
}
&-company {
margin-bottom: 10rpx;
}
}
// &-item {
// margin: 30rpx 0;
// padding: 30rpx;
// background-color: #fff;
// border-radius: 20rpx;
// &>view {
// margin-bottom: 10rpx;
// }
// &-name {
// font-size: 32rpx;
// color: #333;
// .courseName {
// color: #b89155;
// margin: 0 10rpx;
// font-size: 28rpx;
// }
// }
// }
}
}
</style>