completed.js
2.6 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
$(document).ready(function() {
//查看已完成的项目
var header = {
"Content-Type": "application/json",
"token": localStorage.getItem('token'),
}
ajax("/userProgram/userProgramById", "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" onClick="checkCompleted(${value.id})">
<a class="portfolio-box3" style="display: flex;">
<div class="par-pro-img1">
<img src="${value.img2}" alt="" style="width:100% ;height:100%">
</div>
<div class="par-proing-title-one">
<div>${value.field}</div>
<p>${value.futitle}</p>
</div>
</a>
</div>`
$('#completeProject').append(title)
})
})
//查看个人信息赋值名字
ajax('/login/userInfo', "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 header3 = {
"Content-Type": "application/x-www-form-urlencoded"
}
ajax("/warranty/warrantyList", "GET", header3, function(res) {
console.log('1', res);
}, function(res) {
console.log(res);
let EWM = `<img src="${res.data.sevenimg4}" style='width:100%'>`
$('#ewm-footer').html(EWM)
})
})
function checkCompleted(id) {
window.location.href = 'learningContent.html?id=' + id
}
//获取用户VIP信息判断是否是VIP
function setPersonal() {
var url2 = '/login/userInfo'
var header = {
"Content-Type": "application/json",
"token": localStorage.getItem('token'),
}
ajax(url2, "GET", header, function(res) {
console.log(res);
}, function(res) {
console.log(res);
if (res.data.status1 == 2) {
window.location.href = 'personalCenter2.html'
} else {
window.location.href = 'personalCenter.html'
}
})
}