browseMore.js
5.2 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
$(document).ready(function () {
//判断右上角
var token = localStorage.getItem('token')
// if (token == null) {
// let loginTit1 = `
// <a href='login.html'>
// <div class="header-loginBtn" id="loginTitle">登录</div>
// </a>`
// $("#login-btn").html(loginTit1)
// } else {
// let loginTit2 = `
// <a href='login.html'>
// <div class="header-loginBtn" id="loginTitle">退出登录</div>
// </a>`
// $("#login-btn").html(loginTit2)
// }
//首页底部二维码
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}" style='width:100%'>`
$('#ewm-footer').html(EWM)
})
//浏览更多首页头部内容
var url = "/warrantyFour/warrantyFourList";
var header = {
"Content-Type": "application/x-www-form-urlencoded",
// "token": localStorage.getItem('token'),
}
ajax(url, "GET", header, function (res) {
console.log(res);
}, function (res) {
console.log(res);
$('#title-one').html(res.data.title)
$('#subtitle').html(res.data.subtitle)
})
var pages = 2
var page = 1
var size = 4
//浏览更多企业实习项目
function xlPag() {
var header1 = {
"Content-Type": "application/json",
// "token": localStorage.getItem('token'),
}
var params = JSON.stringify({
current: page,//开始页
size: size,//展示条数
})
var title1
ajax("/warrantyTwo/warrantyTwoList", "POST", header1, params, function (res) {
console.log(res);
if(res.data.pages == 1){
pages = res.data.pages+1
}else{
pages = res.data.pages
}
$('#enterpriseProject').html("")
if(res.data.records == null ||res.data.records == ''){
title = `
<div style='font-size:0.4rem;width:100%;text-align:center'>
暂无数据
</div>`
$('#enterpriseProject').append(title)
}else{
$.each(res.data.records, function (key, value) {
console.log(value)
title1 = `
<div class="proContent" style="background: url('${value.img}') no-repeat;background-size: 100% 100%" id=${value.id} onClick="setProfileId(${value.id})">
<div class="aa_content">
<div class="prowaiImg">
<img src="${value.img1}" style='width:100%;height:100%'>
</div>
<div class="proInfo">
<div class="pro_py">${value.title}</div>
<div class="pro_yy">${value.yyTitle}</div>
</div>
</div>
<div class="box" style="background: url('img/index/5-3.png') no-repeat;background-size: 100% 100%">
<div class="pro_tit">${value.content}</div>
<div class="aa_content">
<div class="prowaiImg">
<img src="${value.img1}" style='width:100%;height:100%'>
</div>
<div class="proInfo">
<div class="pro_py">${value.title}</div>
<div class="pro_yy">${value.yyTitle}</div>
</div>
</div>
</div>
</div>`
$('#enterpriseProject').append(title1)
})
}
}, function (res) {
console.log(res);
})
}
// xlPaging.js 使用方法
$("#page").paging({
nowPage: page, // 当前页码
pageNum: pages, // 总页码
buttonNum: size, //要展示的页码数量
callback: function (num) { //回调函数
console.log(num);
page = num
xlPag()
}
});
xlPag()
})
//获取用户VIP信息判断是否是VIP
function setPersonal() {
var url2 = "/login/userInfo"; // 接口
var header2 = {
"Content-Type": "application/json",
"token": localStorage.getItem('token'),
}
ajax(url2, "GET", header2, function (res) {
}, function (res) {
if (res.data.status1 == 2) {
window.location.href = 'personalCenter2.html'
} else {
window.location.href = 'personalCenter.html'
}
}, function (res) {
if (res) {
alert("请您先登录!")
}
})
}
//浏览更多跳转
function morebro() {
window.location.href = 'browseMore.html'
}
//进入项目页
function setProfileId(id) {
// location.href()
console.log('1111', id);
window.location.href = 'profile.html?id=' + id
}