ListDetailsApe.js
4.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
//*
// 列表详情模块
// */
import Loger from "../Loger";
import Ape from "./Ape";
import $ from "jquery";
import ClassDataProxy from "proxy/ClassDataProxy";
let loger = Loger.getLoger('PC-ListDetailsApe');
class ListDetailsApe extends Ape {
constructor() {
super();
this.addEvent();
this.isDate = 0;
this._id = '';
this.init();
}
init() {
$('#themeBox ').on('click','.classifyList',this._curriculumListHandler.bind(this));//详情页
$('#collectYes ').on('click',this._collectYesHandler.bind(this));
$('#collectNo ').on('click',this._collectNoHandler.bind(this));
}
addEvent() {
}
_curriculumListHandler(evt){
let buttonIsCheck = $('#orderBtn').attr('value','1');
if($('#orderBtn').attr('value') == '1'){
$('#orderBtn').attr('disabled',true)
$('#orderBtn').css('background','#3498db')
}
$('#slideshow').hide();
let _id = evt.currentTarget.id;
this._id = _id;
let isDate = $(evt.currentTarget).attr('data');
this.isDate = isDate;
this.detailPage(_id);
}
_collectYesHandler(){
$('#collectYes ').hide();
$('#collectNo ').show();
}
_collectNoHandler(){
$('#collectYes ').show();
$('#collectNo ').hide();
}
detailPage(_id){
let that = this;
let signInfo = {
id: _id,
siteId:'markettest'
}
let _url = ClassDataProxy.locationProtocol + ClassDataProxy.locationProt + '/meeting/getMeeting';
$.ajax({
type: "post",
url: _url,
timeout:5000,
headers: {
siteId:ClassDataProxy.siteId,
'token':'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlhXQnJlRU00T0swYTVqUUIyUTFicGtObHlxOUFWbXZkIiwibmFtZSI6ImFkbWluIiwiY29kZSI6MSwiaWF0IjoxNTAzNDUxODU0LCJleHAiOjIyODEwNTE4NTR9.3kTVzKd_jbP7l69nxOpNaFeSjVnnjZkagYMzRB8fjNo'
},
data:signInfo,
success:function(_data){
//获取课堂数据
if(_data && _data.code == 200){
that._gainClassData(_data);
}
},
error:function(error){
console.log(error,'失败')
}
})
}
_gainClassData(_data){
//切换列表内容
this._classDateContent(_data.returnData.data);
}
_classDateContent(_data){
let _dataList = _data.meetingInfo[0];
if(this.isDate){
this._lanclassRender(_dataList);
}else{
this._liveRender(_dataList);
}
$('#classifyListBox').hide();
}
//互动课堂
_lanclassRender(_dataList){
$('#defaultBox').hide();
$('.curriculumBox').hide();
$('#teacherDetailBox').show();
$('#teacherDetailBox').attr('data',this._id);
$('#teacherDetailInfoImg').attr('src','images/u293.png');//老师授课标题图片
$('#teacherDetailInfoDetailName').text(_dataList.userName);//老师名字
$('#teacherDetailInfoDetailSex').text();//老师性别
$('#teacherDetailInfoDetailPoint').text();//老师专长
$('#teacherDetailInfoDetailAge').text(_dataList.capacity+'年');//老师教龄
$('#teacherDetailInfoDetailGrade').text();//老师评分
$('#teacherDetailReferralContent').text();//老师授课内容
$('#teacherDetailPost').text();//老师职称
$('#teacherDetailEducation').text();//老师学历
$('#teacherDetailAcademy').text();//老师院校
$('#teacherDetailWay').text();//老师授课方式
$('#teacherDetailArea').text();//老师授课地区
$('#teacherDetailSynopsis').text();//老师授课简介
}
//直播课堂
_liveRender(_dataList){
$('#defaultBox').hide();
$('.curriculumBox').hide();
$('#lanclassBox').show();
$('#lanclassBox').attr('data',this._id);
$('#lanclassContentCover').attr('src','images/u373.png');//老师授课标题图片
$('#lanclassContentTitle').text(_dataList.meetingName);//老师授课标题
$('#lanclassContentInfoPortrait').text();//老师授课老师头像
$('#lanclassContentInfoName').text(_dataList.create_user);//老师授课老师名字
$('#lanclassContentInfoTimeStart').text(_dataList.createTime);//老师授课开始时间
$('#lanclassContentInfoTimeEnd').text(_dataList.endTime);//老师授课结束时间
$('#collectYes');//老师授课是否收藏
$('#collectNo');//老师授课是否收藏
$('#lanclassIntroduceDescription').text();//老师授课课程介绍
$('#teacherInfoSchool').text();//老师学院
$('#teacherInfoContent').text();//老师专业等级信息
}
}
export default ListDetailsApe;