diff --git a/completed.html b/completed.html index 7bda752..cb6cfc2 100644 --- a/completed.html +++ b/completed.html @@ -25,12 +25,7 @@ <link rel="stylesheet" href="font-awesome-4.4.0/css/font-awesome.min.css" type="text/css"> <link href='http://fonts.googleapis.com/css?family=Asap:400,700' rel='stylesheet' type='text/css'> - <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> - <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> - <!--[if lt IE 9]> - <script src="js/html5shiv.js"></script> - <script src="js/respond.min.js"></script> - <![endif]--> + </head> @@ -70,7 +65,8 @@ <div style="width: 20%;"> <img src='img/portfolio/13-1.png' style='width:100%;'> </div> - <p>你已完成<a style="color: #66CA94;">3</a>个实习项目</p> + <p>你已完成 + <a style="color: #66CA94;" id="finish-num"></a>个实习项目</p> <p style="font-size: 0.5em;">完成更多项目,以获得实践经验,<br/>增加你的简历和获得你的品牌完成证书。</p> </div> </div> diff --git a/completed.js b/completed.js index cf25081..fab6e3f 100644 --- a/completed.js +++ b/completed.js @@ -10,7 +10,12 @@ $(document).ready(function() { success: 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" style="display: flex;place-content: center;background-color: #fff;"> <a href="#" class="portfolio-box3" style="display: flex;"> diff --git a/index.html b/index.html index 74b9a69..ae68248 100644 --- a/index.html +++ b/index.html @@ -112,7 +112,7 @@ <div class="intro" style="color: #66CA94;text-align: left;" id="threefield1"></div> <div style="display: flex; justify-content: space-between;"> <h2 id="threefield2"></h2> - <h2><a href="./browseMore.html" target="_self">浏览更多></a></h2> + <h2><a onclick="morebro()">浏览更多></a></h2> </div> </div> <!-- </div> --> diff --git a/index.js b/index.js index 8a386ac..d769594 100644 --- a/index.js +++ b/index.js @@ -187,4 +187,8 @@ function setPersonal() { } } }) +} +//浏览更多跳转 +function morebro() { + window.location.href = 'browseMore.html' } \ No newline at end of file diff --git a/login.js b/login.js index 19afc82..434412d 100644 --- a/login.js +++ b/login.js @@ -55,17 +55,42 @@ $(document).ready(function() { }), success: function(res) { console.log(res); - console.log(res.data.status); - - if (res.data.status === 1) { - localStorage.setItem("token", res.data.token); - localStorage.setItem("userId", res.data.user); - window.location.href = 'save.html' - } else { - localStorage.setItem("token", res.data.token); - localStorage.setItem("userId", res.data.user); - window.location.href = 'index.html' + localStorage.setItem("token", res.data.token); + localStorage.setItem("userId", res.data.user); + if (res.statusCode !== '0') { + alert(res.msg) + return false } + $.ajax({ + type: "GET", + url: "http://192.168.1.241:9004/login/userInfo", + headers: { + "Content-Type": "application/x-www-form-urlencoded", + "token": localStorage.getItem('token'), + }, + success: function(data) { + console.log(data); + if (res.data.status == '1') { + window.location.href = 'save.html' + } else if (data.status1 == '2') { + window.location.href = 'browseMore.html' + } else { + window.location.href = 'index.html' + } + } + }) + + + + // if (res.data.status === 1) { + // localStorage.setItem("token", res.data.token); + // localStorage.setItem("userId", res.data.user); + // window.location.href = 'save.html' + // } else { + // localStorage.setItem("token", res.data.token); + // localStorage.setItem("userId", res.data.user); + // window.location.href = 'index.html' + // } }, error: function(res) {} diff --git a/participated.html b/participated.html index 2467b20..22fe2ae 100644 --- a/participated.html +++ b/participated.html @@ -25,12 +25,7 @@ <link rel="stylesheet" href="font-awesome-4.4.0/css/font-awesome.min.css" type="text/css"> <link href='http://fonts.googleapis.com/css?family=Asap:400,700' rel='stylesheet' type='text/css'> - <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> - <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> - <!--[if lt IE 9]> - <script src="js/html5shiv.js"></script> - <script src="js/respond.min.js"></script> - <![endif]--> + </head> @@ -50,12 +45,7 @@ <div class="header-loginBtn">退出登录</div> </a> <a class="header-right-btn" onclick="setPersonal()"> - <h1 class="header-h1-btn" style="background-color: #66CA94;position: absolute;width: 40px;height: 40px; border-radius: 50%;"> </h1> - - <div class="header-xian"> - <div class="header-xian1"> </div> - <div class="header-xian2"> </div> - </div> + <img src="./img/portfolio/circle.png" style="width: 50px;height: 50px;"> </a> </div> </div> @@ -64,8 +54,12 @@ <div class="header-text hidden-xs" style="padding: 0 70px;"> <div class="col-md-12 text-center" style='display:flex;'> <div style="flex: 1.5;"> - <h3>你好,李雯</h3> - <h3>在这里开始你精彩的职场实习体验吧!</h3> + <div style="display: flex;"> + <h2>你好,</h2> + <h2 id="title-name">李雯</h2> + </div> + + <h2>在这里开始你精彩的职场实习体验吧!</h2> </div> <!-- <hr> --> @@ -75,13 +69,15 @@ <div style="display: flex;"> <div style="flex: 1;"> <img src='img/portfolio/13-1.png' style='width:30%;'> - <p>你已完成<a style="color: #66CA94;">3</a>个实习项目</p> + <p>你已完成 + <a style="color: #66CA94;" id="finish-num"></a> 个实习项目</p> <p style="font-size: 0.5em;">完成更多项目,以获得实践经验,<br/>增加你的简历和获得你的品牌完成证书。</p> <a style="color:#66CA94 ;" href="./completed.html">查看你完成的实习项目></a> </div> <div style="flex: 1;"> <img src='img/portfolio/13-2.png' style='width:30%;'> - <p>你获得了<a style="color: #66CA94;">3</a>个推荐</p> + <p>你获得了 + <a style="color: #66CA94;" id="recommend-num"></a> 个推荐</p> <p style="font-size: 0.5em;">获得来自行业前辈的推荐,让更多行业领域<br/>能看见你的出色的成果展示,以及你的简历和个人资料。</p> <a style="color: #66CA94;" href="./recommend.html">查看获得的推荐></a> </div> diff --git a/participated.js b/participated.js index ad49b31..39dcac6 100644 --- a/participated.js +++ b/participated.js @@ -1,23 +1,3 @@ -//获取用户VIP信息判断是否是VIP -function setPersonal() { - $.ajax({ - type: 'GET', - url: 'http://192.168.1.241:9004/login/userInfo', - headers: { - "Content-Type": "application/json", - "token": localStorage.getItem('token'), - }, - success: function(res) { - console.log(res); - if (res.data.status1 == 1) { - window.location.href = 'personalCenter.html' - } else { - window.location.href = 'personalCenter2.html' - } - } - }) -} - $(document).ready(function() { //首页 $.ajax({ @@ -29,25 +9,8 @@ $(document).ready(function() { }, success: function(res) { console.log('1', res); - // $('#onefields1').html(res.data.onefields1) - // $('#onefields2').html(res.data.onefields2) - // $('#twofields1').html(res.data.twofields1) - // $('#twofields2').html(res.data.twofields2) - // $('#twofields3').html(res.data.twofields3) $('#threefield1').html(res.data.threefield1) $('#threefield2').html(res.data.threefield2) - // $('#fourfields1').html(res.data.fourfields1) - // $('#fourfields2').html(res.data.fourfields2) - // $('#fourfields3').html(res.data.fourfields3) - // $('#fivefields1').html(res.data.fivefields1) - // $('#fivefields2').html(res.data.fivefields2) - // $('#sixfields1').html(res.data.sixfields1) - // $('#sixfields2').html(res.data.sixfields2) - // $('#sevenfields1').html(res.data.sevenfields1) - // $('#sevenfields2').html(res.data.sevenfields2) - //图片 - // let str = `<img src="${res.data.oneimg1}" class="rounded img-fluid d-block mx-auto" alt="" >` - // $('#oneimg1').html(str) } }) //企业实习项目 @@ -104,5 +67,75 @@ $(document).ready(function() { } }) + //已完成项目 + $.ajax({ + type: 'GET', + url: 'http://192.168.1.241:9004/userProgram/userProgramById', + headers: { + "Content-Type": "application/json", + "token": localStorage.getItem('token'), + }, + success: function(res) { + console.log(res); + console.log(res.data); + if (res.data === null) { + let a = ' 0 ' + $("#finish-num").html(a) + } else { + $("#finish-num").html(res.data.length) + } + } + }) + //查看已推荐的项目 + $.ajax({ + type: 'POST', + url: 'http://192.168.1.241:9004/warrantyTwo/warrantyTwos', + headers: { + "Content-Type": "application/json", + "token": localStorage.getItem('token'), + }, + data: JSON.stringify({ + current: 1, + size: 4 + }), + success: function(res) { + console.log(res.data.records.length); + + $("#recommend-num").html(res.data.records.length) + } + }) + //查看个人信息 + $.ajax({ + type: 'GET', + url: 'http://192.168.1.241:9004/login/userInfo', + headers: { + "Content-Type": "application/json", + "token": localStorage.getItem('token'), + }, + success: function(res) { + console.log(res); + + } + }) +}); + -}); \ No newline at end of file +//获取用户VIP信息判断是否是VIP +function setPersonal() { + $.ajax({ + type: 'GET', + url: 'http://192.168.1.241:9004/login/userInfo', + headers: { + "Content-Type": "application/json", + "token": localStorage.getItem('token'), + }, + success: function(res) { + console.log(res); + if (res.data.status1 == 1) { + window.location.href = 'personalCenter.html' + } else { + window.location.href = 'personalCenter2.html' + } + } + }) +} \ No newline at end of file diff --git a/recommend.html b/recommend.html index ece98b0..7553b69 100644 --- a/recommend.html +++ b/recommend.html @@ -25,12 +25,7 @@ <link rel="stylesheet" href="font-awesome-4.4.0/css/font-awesome.min.css" type="text/css"> <link href='http://fonts.googleapis.com/css?family=Asap:400,700' rel='stylesheet' type='text/css'> - <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> - <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> - <!--[if lt IE 9]> - <script src="js/html5shiv.js"></script> - <script src="js/respond.min.js"></script> - <![endif]--> + </head> @@ -49,12 +44,7 @@ <div class="header-loginBtn">退出登录</div> </a> <a class="header-right-btn" onclick="setPersonal()"> - <h1 class="header-h1-btn" style="background-color: #66CA94;position: absolute;width: 40px;height: 40px; border-radius: 50%;"> </h1> - - <div class="header-xian"> - <div class="header-xian1"> </div> - <div class="header-xian2"> </div> - </div> + <img src="./img/portfolio/circle.png" style="width: 50px;height: 50px;"> </a> </div> </div> @@ -70,7 +60,8 @@ <div style="width: 20%;"> <img src='img/portfolio/13-2.png' style='width:100%;'> </div> - <p>你获得了<a style="color: #66CA94;">3</a>个推荐</p> + <p>你获得了 + <a style="color: #66CA94;" id="recommend-num"></a> 个推荐</p> <p style="font-size: 0.5em;">获得来自行业前辈的推荐,让更多行业领域<br/>能看见你的出色的成果展示,以及你的简历和个人资料。</p> </div> </div> diff --git a/recommend.js b/recommend.js index 8a2f4d4..8bc8219 100644 --- a/recommend.js +++ b/recommend.js @@ -13,6 +13,7 @@ $(document).ready(function() { }), success: function(res) { console.log(res); + $("#recommend-num").html(res.data.records.length) $.each(res.data.records, function(key, value) { let title = `<div class="col-lg-32 col-sm-60" style="display: flex;place-content: center;background-color: #fff;"> <a href="#" class="portfolio-box3" style="display: flex;">