作者 杨乐
1 个管道 的构建 通过 耗费 4 秒

提交

$(document).ready(function() {
//查看已完成的项目
var url = "/userProgram/userProgramById"; // 接口
var header = {
"Content-Type": "application/json",
"token": localStorage.getItem('token'),
//查看已完成的项目
var url = "/userProgram/userProgramById"; // 接口
var header = {
"Content-Type": "application/json",
"token": localStorage.getItem('token'),
}
ajax(url, "GET", header, function(res) {
console.log(res);
}, function(res) {
console.log(res);
if (res.data === null) {
let a = ' 0 '
$("#finish-num").html(a)
} else {
$("#finish-num").html(res.data.length)
}
ajax(url, "GET", header, function(res) {
console.log(res);
}, function(res) {
console.log(res);
if (res.data === null) {
let a = ' 0 '
$("#finish-num").html(a)
} else {
$("#finish-num").html(res.data.length)
}
$.each(res.data, function(key, value) {
let title = `
<div class="col-lg-32 col-sm-60 par-pro-one" >
<a class="portfolio-box3" style="display: flex;width:100%">
<div class="par-pro-img1">
<img src="${value.img2}" alt="" style="width:100%">
</div>
<div class="par-proing-title-one">
<h5>${value.field}</h5>
<p>${value.futitle}</p>
</div>
</a>
</div>`
$.each(res.data, function(key, value) {
let title = `
<div class="col-lg-32 col-sm-60 par-pro-one" onClick="checkCompleted(${value.id})">
<a class="portfolio-box3" style="display: flex;width:100%">
<div class="par-pro-img1">
<img src="${value.img2}" alt="" style="width:100%">
</div>
<div class="par-proing-title-one">
<h5>${value.field}</h5>
<p>${value.futitle}</p>
</div>
</a>
</div>`
$('#completeProject').append(title)
})
})
$('#completeProject').append(title)
})
})
//查看个人信息赋值名字
var url1 = '/login/userInfo'
ajax(url1, "GET", header, function(res) {
console.log(res);
}, function(res) {
console.log(res);
console.log(res.data.surname + res.data.userName);
$("#header-name").html(res.data.surname + res.data.userName)
$("#title-name").html(res.data.surname + res.data.userName)
})
//首页
var url3 = "/warranty/warrantyList";
var header3 = {
"Content-Type": "application/x-www-form-urlencoded"
}
ajax(url3, "GET", header3, function(res) {
console.log('1', res);
//查看个人信息赋值名字
var url1 = '/login/userInfo'
ajax(url1, "GET", header, function(res) {
console.log(res);
}, function(res) {
console.log(res);
let EWM = `<img src="${res.data.sevenimg4}" width="100%">`
$('#ewm-footer').html(EWM)
console.log(res.data.surname + res.data.userName);
$("#header-name").html(res.data.surname + res.data.userName)
$("#title-name").html(res.data.surname + res.data.userName)
})
//首页
var url3 = "/warranty/warrantyList";
var header3 = {
"Content-Type": "application/x-www-form-urlencoded"
}
ajax(url3, "GET", header3, function(res) {
console.log('1', res);
}, function(res) {
console.log(res);
let EWM = `<img src="${res.data.sevenimg4}" width="100%">`
$('#ewm-footer').html(EWM)
})
//获取用户VIP信息判断是否是VIP
})
function checkCompleted(id) {
window.location.href = 'learningContent.html?id=' + id
}
//获取用户VIP信息判断是否是VIP
function setPersonal() {
var url2 = '/login/userInfo'
var header = {
... ...
... ... @@ -8,7 +8,6 @@ var header = {
}
var header5 = {
"Content-Type": "application/x-www-form-urlencoded",
}
var params = {
id: newId
... ... @@ -25,17 +24,19 @@ $(document).ready(function() {
// console.log(url);
if (url.indexOf('?') != -1) {
newId = url.substr(4)
// console.log(newId);
//底部二维码
// console.log(newId);
//底部二维码
var url9 = "/warranty/warrantyList"; // 接口
ajax(url9, "GET", header5, function(res) {
console.log('1', res);
}, function(res) {
console.log(res);
let EWM = `<img src="${res.data.sevenimg4}" width="100%">`
$('#ewm-footer').html(EWM)
})
//获取左边实习内容list
console.log('1', res);
}, function(res) {
console.log(res);
let EWM = `<img src="${res.data.sevenimg4}" width="100%">`
$('#ewm-footer').html(EWM)
})
//获取左边实习内容list
var url8 = "/recommend/recommendTwoList"; // 接口
var header = {
"Content-Type": "application/x-www-form-urlencoded",
... ... @@ -58,21 +59,27 @@ $(document).ready(function() {
$.each(res.data[i].recommendThrees, function(index, val) {
// console.log(val);
//左边二级菜单
let html = '';
// let html = '';
// if (index == 0) {
// html = `<div class="noCheck check"` + `data-id='` + val.id + `' style='margin-right:6px'></div>`
// } else {
// html = `<div class="noCheck" ` + `data-id='` + val.id + `' style='margin-right:6px'></div>`
// }
if (val.type) {
var selected = 'checkStatus'
} else {
var selected = ''
}
title1 += `
<li id="content-list" data-index="` + ii + `" class='leftClick' style='display:flex;margin-bottom:8px;cursor: pointer;margin-left: 10px;
place-items: center;'>
<div class="noCheck" ` + `data-id='` + val.id + `' style='margin-right:6px'></div>
<div class="noCheck ` + `${selected}` + `" ` + `data-id='` + val.id + `' style='margin-right:6px'></div>
<a class='learn-erji-title' style='flex:1'>${val.subhead}</a>
</li>`
// $("#content-l").append(title1)
//$('.divClass').eq(0).css('display', 'block').siblings().css('display', 'none')
//右边显示1
// $("#content-l").append(title1)
//$('.divClass').eq(0).css('display', 'block').siblings().css('display', 'none')
//右边显示1
let work = `
<a href="${val.downloadHomework}" target="_blank" class='show1-Btn1-a'>
... ... @@ -378,8 +385,24 @@ function last() {
}
//下一步
function next() {
var first_id = $('.check').attr('data-id');
console.log(first_id);
var url = '/userJl/userJlAdd/' + first_id
var header = {
"Content-Type": "application/x-www-form-urlencoded",
"token": localStorage.getItem('token'),
}
ajax(url, "POST", header, function(res) {
console.log(res);
}, function(res) {
console.log(res);
})
$('.check').addClass('checkStatus').removeClass('check');
console.log($('.checkStatus').eq(-1).parent('#content-list').next().length);
// console.log($('.checkStatus').eq(-1).parent('#content-list').next().length);
$('.checkStatus').eq(-1).parent('#content-list').next().trigger('click');
if ($('.checkStatus').eq(-1).parent('#content-list').next().length == 0) {
console.log(121212)
... ... @@ -387,10 +410,6 @@ function next() {
$('.checkStatus').eq(-1).parent('#content-list').parent().next().trigger('click')
$('.checkStatus').eq(-1).parent('#content-list').parent().next().next().find('#content-list').eq(0).trigger('click')
}
// $("#overchange").hide()
// $("#nextchange").show()
// window.location.href = 'question.html?id=' + newId
// console.log(newId);
}
//完成作业
... ... @@ -401,9 +420,9 @@ function postData() {
//提交作业
$(".fileTxt").change(function(e) {
//二级标题id
var first_id1 = $('.check').parents('#content-l').prev().attr('data-id');
//一级标题id
var first_id1 = $('.check').parents('#content-l').prev().attr('data-id');
//二级标题id
var first_id = $('.check').attr('data-id');
// console.log(newId);项目id
//上传作业
... ...
... ... @@ -546,7 +546,7 @@
<div class="intro" id="threefield1"></div>
<div class="par-pro-title1">
<h2 id="threefield2"></h2>
<h2 class="par-morebro"><a onclick="morebro()">浏览更多></a></h2>
<h2 class="par-morebro"><a onclick="morebro()" style="cursor: pointer;">浏览更多></a></h2>
</div>
</div>
<!-- </div> -->
... ...
... ... @@ -109,7 +109,7 @@ $(document).ready(function() {
console.log(res);
$.each(res.data, function(key, value) {
let title = `
<div class="col-lg-32 col-sm-60 par-pro-one" >
<div class="col-lg-32 col-sm-60 par-pro-one" onClick='learnCenter(${value.id})'>
<a class="portfolio-box3" style="display: flex;width:100%">
<div class="par-pro-img1">
<img src="${value.img2}" alt="" style="width:100%">
... ... @@ -149,8 +149,8 @@ function setPersonal() {
})
}
//跳转实习内容首页
function learnCenter() {
function learnCenter(id) {
window.location.href = 'learningContent.html?id=' + id
}
//浏览更多跳转
function morebro() {
... ...