-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsup-lessons-services.js
38 lines (38 loc) · 1.32 KB
/
sup-lessons-services.js
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
var basePath = 'https://api.shumengedu.com/';
jQuery(function(){
getUrlPara();
//领取体验课
jQuery("#ImmediatelySubmit").click(function(){
// console.log(jQuery("#joinApplication").serialize(),);
jQuery.ajax(basePath+"trial_course/indexWithoutCode", {
data: {
name:jQuery("#name").val(),
phone:jQuery("#phone").val(),
},
type:"POST",
crossDomain: true,
success: function(response) {
jQuery("#myModal").modal();
jQuery(".modal-body").html(response.msg);
jQuery("#ImmediatelySubmit input[type=reset]").trigger("click");
},
error: function (e) {
jQuery("#myModal").modal();
jQuery(".modal-body").html(e.msg);
}
});
})
})
function getUrlPara(){
var url = document.location.toString();
var arrUrl = url.split("?type=");
var para = arrUrl[1];
// console.log(para);
if(para =1){
$("#supLessonsTitle").html("<span class='font-36' style=''>预约试听</span>");
}
if(para =2){
$("#supLessonsTitle").html("<span class='font-28' style='line-height:35px'>现在留言,即可<span class='c-blue-purple'>免费</span>获取课程体验包</span>");
}
return para;
}