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

提交

... ... @@ -60,7 +60,7 @@ $(document).ready(function() {
`
let title1 = '';
$.each(res.data[i].recommendThrees, function(index, val) {
// console.log(val);
console.log(val);
//左边二级菜单
// let html = '';
// if (index == 0) {
... ... @@ -83,14 +83,7 @@ $(document).ready(function() {
// $("#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'>
<img src='./images/03-4.png'>
<span style='padding-left:10px'>下载实习作业</span>
</a>`
$("#downloadWork").html(work);
ii++;
})
singleItem = title + title1 + `</ul>`
... ... @@ -136,8 +129,6 @@ $('#title-content').on('click', '.leftClick', function(e) {
$(".learn-next-yuan").css('display', 'block')
$(".learn-next-Btn1").css('display', 'none')
}
} else {
if (screenWidth < 768) {
$(".learn-next-Btn").css('display', 'none')
... ... @@ -189,7 +180,7 @@ $('#title-content').on('click', '.leftClick', function(e) {
// let status = ''
for (let i in res.data) {
$.each(res.data[i].recommendThrees, function(index, val) {
//console.log(val);
console.log(val);
// status = val.status
if (val.id == first_id) {
if (val.status == '1') {
... ... @@ -199,6 +190,13 @@ $('#title-content').on('click', '.leftClick', function(e) {
$(".div_show4").hide()
$("#particulars").html(val.particulars)
$("#accomplish").html(val.accomplish)
console.log(val.downloadHomework);
let work = `
<a href="${val.downloadHomework}" target="_blank" class='show1-Btn1-a'>
<img src='./images/03-4.png'>
<span style='padding-left:10px'>下载实习作业</span>
</a>`
$("#downloadWork").html(work);
} else if (val.status == '2') {
$(".div_show1").hide()
$(".div_show2").show()
... ... @@ -417,8 +415,9 @@ function last() {
$('.check').addClass('check');
$('.check').parent('#content-list').prev().trigger('click');
// $('.check').parent('#content-list').parent().prev()
$('.check').parent('#content-list').parent().prev().trigger('click')
$('.check').parent('#content-list').parent().prev().prev().find('#content-list').eq(-1).trigger('click')
$('.check').parent('#content-list').parent().prev().prev().prev().trigger('click')
console.log($('.check').parent('#content-list').parent().prev().prev().find('li'));
$('.check').parent('#content-list').parent().prev().prev().find('li').eq(-1).trigger('click')
... ... @@ -454,11 +453,9 @@ function next() {
}
var workStatus = false
//完成作业
function postData() {
alert("恭喜你,完成了一个作业~")
}
//提交作业
$(".fileTxt").change(function(e) {
//一级标题id
... ... @@ -511,26 +508,28 @@ $(".fileTxt").change(function(e) {
ajax(url1, "POST", header, params, function(res1) {
console.log(res1);
alert('提交成功!')
workStatus = true
}, function(res1) {
console.log(res1);
})
}, function(res) {})
// alert(data.message)
}
},
error: function(response) {
console.log(response);
}
});
}
});
//完成作业
function postData() {
console.log(workStatus);
if(workStatus == true){
alert("恭喜你,完成了一个作业~")
}else{
alert("请您先提交作业!")
}
}
//下载保存
function downloadFile() {
// html2canvas(document.querySelector('#footer_download'), {
... ... @@ -568,8 +567,25 @@ function commitPro() {
var params = { id: newId }
ajax(url, "PUT", header, params, function(res) {
console.log(res);
$('.check').addClass('checkStatus').removeClass('check');
alert("恭喜您完成了一个新项目!")
if(res.data == true){
var first_id = $('.check').attr('data-id');
console.log(first_id);
var url1 = '/userJl/userJlAdd/' + first_id
var header1 = {
"Content-Type": "application/x-www-form-urlencoded",
"token": localStorage.getItem('token'),
}
//改变type的值
ajax(url1, "POST", header1, function(res) {
console.log(res);
}, function(res) {
console.log(res);
$('.check').addClass('checkStatus').removeClass('check');
alert("恭喜您完成了一个新项目!")
})
}
}, function(res) {
console.log(res);
})
... ...
... ... @@ -78,15 +78,38 @@
border: 10px solid #97DAB6;
padding: 3%;
}
.login-cont {
display: flex;
justify-content: space-between;
}
.login_left_img{
position: relative;
left: 50%;
}
@media (min-width: 1200px) {
@media (max-width: 1200px) {
.login-cont {
display: flex;
justify-content: space-between;
}
.login-title-p{
font-size: 14px;
}
.login-title-success,
.login-title-start{
font-size: 28px;
}
.login_left_img{
width: 60%;
position: relative;
left: 40%;
}
}
@media (max-width: 768px) {
.container{
width: 100%;
}
.header-txt1 {
margin: 25px 20px;
place-items: center;
... ... @@ -189,7 +212,9 @@
<p class="login-title-p">Join is to start your visual experience program</p>
<div class="login-title-success">成功职场第一步</div>
<div class="login-title-start">从Start-Line开始!</div>
<img src="img/portfolio/09-1.png" class="login-left-bigImg" alt="" style="position: relative;left: 50%;bottom: 3%;width: 100%;">
<div class="login_left_img">
<img src="img/portfolio/09-1.png" class="login-left-bigImg" alt="" style="width: 100%;">
</div>
</div>
<!-- <div class="col-lg-1"></div> -->
<div class="login-right-all">
... ...
... ... @@ -667,6 +667,7 @@
</div>
</div>
<!-- 二维码模态框 -->
<div class="payStatus"></div>
<div class="personal-pay-button">
<button onclick="payment()" class="lijiPay">立即支付</button>
<div class="hide_box"></div>
... ...
... ... @@ -226,7 +226,7 @@ function payment() {
// 支付下单获取订单号
ajax("/orderLog/orderAdd", "POST", header, params, function(res) {
console.log(res);
console.log(res.data);
console.log(res.data);//订单号
console.log(paymentType);
var params1 = {
id: res.data,
... ... @@ -241,27 +241,59 @@ function payment() {
console.log(res.data);
console.log(screenType);
console.log(params1);
$(".hide_box").fadeToggle();
$(".shang_box").fadeToggle();
//微信支付
ajax("/pay/createNative", "GET", header1, params1, function(res1) {
console.log(res1);
let title = `<img src="${res1.data.codeUrl}" alt="扫码支付" title="扫一扫" >`
$(".shang_payimg").html(title)
//订单号
console.log(res1.data.outTradeNo);
//微信支付轮询
if(screenType == 1){
$(".hide_box").fadeToggle();
$(".shang_box").fadeToggle();
let title = `<img src="${res1.data.codeUrl}" alt="扫码支付" title="扫一扫" >`
$(".shang_payimg").html(title)
//支付轮询
var params3 = { id: res1.data.outTradeNo }
var timeInterval = setInterval(function() {
ajax("/orderLog/test", "GET", header1, params3, function(res2) {
console.log(res2.data);
if (res2.data == '2') {
clearInterval(timeInterval)
window.location.href = 'personalCenter.html'
alert("支付成功,审核通过后即可成为会员!")
window.location.href = 'personalCenter2.html'
$('.payStatus').html("支付成功,审核通过后即可成为会员!")
}
}, function(res) {})
}, 2000)
}, 5000)
}else{
window.location.href = res1.data.codeUrl
//支付轮询
var params3 = { id: res1.data.outTradeNo }
var timeInterval = setInterval(function() {
ajax("/orderLog/test", "GET", header1, params3, function(res2) {
console.log(res2.data);
if (res2.data == '2') {
clearInterval(timeInterval)
window.location.href = 'personalCenter.html'
alert("支付成功,审核通过后即可成为会员!")
$('.payStatus').html("支付成功,审核通过后即可成为会员!")
}
}, function(res) {})
}, 5000)
}
//订单号
console.log(res1.data.outTradeNo);
//支付轮询
// var params3 = { id: res1.data.outTradeNo }
// var timeInterval = setInterval(function() {
// ajax("/orderLog/test", "GET", header1, params3, function(res2) {
// console.log(res2.data);
// if (res2.data == '2') {
// clearInterval(timeInterval)
// window.location.href = 'personalCenter.html'
// alert("支付成功,审核通过后即可成为会员!")
// $('.payStatus').html("支付成功,审核通过后即可成为会员!")
// }
// }, function(res) {})
// }, 2000)
}, function(res) {})
} else if (paymentType == 2) {
// $(".hide_box").fadeToggle();
... ... @@ -275,8 +307,21 @@ function payment() {
}
ajax("/zfbPay/alipay", "GET", header1, params3, function(res) {
console.log(res);
alert("支付成功,审核通过后即可成为会员!")
$(".zhifubao_form").html(res)
//支付轮询
var params3 = { id: res1.data.outTradeNo }
var timeInterval = setInterval(function() {
ajax("/orderLog/test", "GET", header1, params3, function(res2) {
console.log(res2.data);
if (res2.data == '2') {
clearInterval(timeInterval)
window.location.href = 'personalCenter.html'
alert("支付成功,审核通过后即可成为会员!")
$('.payStatus').html("支付成功,审核通过后即可成为会员!")
}
}, function(res) {})
}, 2000)
}, function(res) {})
} else {
alert("请选择支付类型!")
... ...