participated.js
5.9 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
$(document).ready(function() {
//首页
var url = "/warranty/warrantyList";
var header = {
"Content-Type": "application/x-www-form-urlencoded",
"token": localStorage.getItem('token'),
}
// 调用公共ajax
ajax(url, "GET", header, function(res) {
console.log(res);
}, function(res) {
// console.log(res);
$('#threefield1').html(res.data.threefield1)
$('#threefield2').html(res.data.threefield2)
let EWM = `<img src="${res.data.sevenimg4}" width="100%">`
$('#ewm-footer').html(EWM)
})
//企业实习项目
var url1 = "/warrantyTwo/warrantyTwoList";
var header1 = {
"Content-Type": "application/json",
"token": localStorage.getItem('token'),
}
var params = JSON.stringify({
current: 1,
size: 4
})
ajax(url1, "POST", header1, params, function(res) {
console.log(res);
$.each(res.data.records, function(key, value) {
// console.log(value)
let title = `
<div class="col-xs-6 col-lg-33 portfolio-post contentClick" id=${value.id} onClick="setProfileId(${value.id})">
<article class="portfolio-post-item" style='height:100%'>
<div style="position: relative;height:100%">
<div style="position: relative;" style='height:100%'>
<img src="${value.img}" alt="" style='height:100%'class='noticeimg-head'>
</div>
<div class='par-headImg-all' >
<div class='par-headImg1'>
<img src="${value.img1}" >
</div>
<div class='par-headTitle'>
<div class='par-headTitle1'>${value.title}</div>
<div class='par-headTitle2'>${value.yyTitle}</div>
</div>
</div>
</div>
<div class="portfolio-content-wrapper">
<div class="portfolio-content ">
<h3 class="portfolio-title "><a>${value.content}</a></h3>
<div style="display: flex;text-align: left;place-items: center;padding-top: 6%; ">
<img src="${value.img1} " style="width: 10%;height: 1%; ">
<div style="display: flex;flex-direction: column;padding-left: 2%; ">
<div class="portfolio-cat" style='padding-bottom:5%'>${value.title}</div>
<div class="portfolio-cat">${value.yyTitle}</div>
</div>
</div>
</div>
</div>
</article>
</div>`
$('#enterpriseProject').append(title)
})
}, function(res) {
console.log(res);
})
//已完成项目
var url2 = "/userProgram/userProgramById";
ajax(url2, "GET", header1, 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)
}
})
//查看已推荐的项目
var url3 = "/warrantyTwo/warrantyTwos";
// 调用公共ajax
ajax(url3, "POST", header1, params, function(res) {
console.log(res);
$("#recommend-num").html(res.data.records.length)
}, function(res) {
console.log(res);
})
//查看个人信息赋值名字
var url4 = "/login/userInfo"; // 接口
// 调用公共ajax
ajax(url4, "GET", header1, function(res) {
console.log(res);
}, function(res) {
// console.log(res);
$("#header-name").html(res.data.surname + res.data.userName)
$("#title-name").html(res.data.surname + res.data.userName)
})
//查看参与的项目
var url5 = "/userProgram/userPrograms"; // 接口
// 调用公共ajax
ajax(url5, "GET", header, function(res) {
console.log(res);
}, function(res) {
console.log(res);
$.each(res.data, function(key, value) {
let title = `
<div class="col-lg-32 col-sm-60 par-pro-one">
<a onclick='learnCenter()' class="portfolio-box3" style="display: flex;" >
<div class="par-pro-img1">
<img src="${value.img2}" alt="" style="width:100%;">
</div>
<div class="par-proing-title-one">
<h5>${value.futitle}</h5>
<p>${value.field}</p>
</div>
</a>
</div>`
$("#canyu-project").append(title)
})
})
});
//获取用户VIP信息判断是否是VIP
function setPersonal() {
var url6 = "/login/userInfo"; // 接口
// 调用公共ajax
ajax(url6, "GET", header1, function(res) {
console.log(res);
if (res.data.status1 == 1) {
window.location.href = 'personalCenter.html'
} else {
window.location.href = 'personalCenter2.html'
}
}, function(res) {
console.log(res);
})
}
//跳转实习内容首页
function learnCenter() {
}
//浏览更多跳转
function morebro() {
window.location.href = 'browseMore.html'
}
//进入项目页
function setProfileId(id) {
// location.href()
console.log('1111', id);
window.location.href = 'profile.html?id=' + id
}