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

提交

... ... @@ -26,6 +26,49 @@
<link href='http://fonts.googleapis.com/css?family=Asap:400,700' rel='stylesheet' type='text/css'>
<style>
/* 分页插件css */
#page {
margin: 0 auto 60px;
color: #666;
display: block;
text-align: center;
}
#page li {
display: inline-block;
min-width: 30px;
height: 28px;
cursor: pointer;
color: #666;
font-size: 13px;
line-height: 28px;
background-color: #f9f9f9;
border: 1px solid #dce0e0;
text-align: center;
margin: 0 4px;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
.xl-nextPage,
.xl-prevPage {
width: 60px;
color: #66CA94;
height: 28px;
}
#page li.xl-disabled {
opacity: .5;
cursor: no-drop;
}
#page li.xl-active {
background-color: #66CA94;
border-color: #66CA94;
color: #FFF
}
/* 分页插件结束 */
.titleDiv div,
.titleDiv p,
.titleDiv span {
... ... @@ -260,7 +303,7 @@
</head>
<body>
<body ontouchstart="" onmousemove="">
<header>
<nav>
<div class="header-txt1">
... ... @@ -306,7 +349,9 @@
<!-- 实习项目-->
<div class="portfolio-items-container" id="enterpriseProject" href='profile.html'>
</div>
</section>
<div id="page"></div>
<div class="login-footer-all">
<div class="login-footer-img" style="width: 25%;margin-top: 45px;">
<img src="img/portfolio/whiteLogo.png" width="100%">
... ... @@ -364,6 +409,7 @@
<script src="js/classie.js"></script>
<script src="js/cbpAnimatedHeader.js"></script>
<script src="browseMore.js"></script>
<script type="text/javascript" src="xlPaging.js"></script>
<!-- carousel -->
<script src="owl-carousel/owl.carousel.js"></script>
<script>
... ...
... ... @@ -40,22 +40,40 @@ $(document).ready(function() {
$('#title-one').html(res.data.title)
$('#subtitle').html(res.data.subtitle)
})
var pages = ''
var page = 1
var size = 4
// xlPaging.js 使用方法
$("#page").paging({
nowPage: page, // 当前页码
pageNum: pages, // 总页码
buttonNum: size, //要展示的页码数量
callback: function (num) { //回调函数
console.log(num);
page = num
aaaa()
}
});
//浏览更多企业实习项目
var url1 = "/warrantyTwo/warrantyTwoList";
aaaa()
function aaaa(){
var header1 = {
"Content-Type": "application/json",
// "token": localStorage.getItem('token'),
}
var params = JSON.stringify({
current: 1,
size: 4
current: page,//开始页
size: size,//展示条数
})
ajax(url1, "POST", header1, params, function(res) {
var title
ajax("/warrantyTwo/warrantyTwoList", "POST", header1, params, function(res) {
console.log(res);
pages = res.data.pages
$('#enterpriseProject').html("")
$.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})">
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%'>
... ... @@ -86,13 +104,14 @@ $(document).ready(function() {
</div>
</article>
</div>`
$('#enterpriseProject').append(title)
})
}, function(res) {
console.log(res);
})
}
})
//获取用户VIP信息判断是否是VIP
... ...
... ... @@ -90,6 +90,9 @@ var Pagination = {
html.push("<span class=\"page_jump\">到</span><input id='pageInput' class='pageInput' oldpage='' maxlength='" + pageCount + "' type='text' ><span class=\"page_jump\">页</span><button type='button' id='pagebtn' class='pagebtn'>确定</button>");
// html.push("<script>pagination(" + pageCount + ",$('#pageInput'), $('#pagebtn'));</script>");
console.log(pageCount);
console.log(showPageCount);
console.log(HalfPageCount);
return html.join("");
},
... ...
... ... @@ -643,74 +643,8 @@
</div>
<h4 style="color: #fff;">会员权益</h4>
</div>
<!-- 会员信息 -->
<div id="meau_nav">
<!-- <div onclick="clickVIPone()" class="personal-vip-basic">
<div class="personal-vip-info">
<p>基础会员</p>
<a>精彩启程</a>
</div>
<div style="background: #fff;">
<div style="text-align: center;padding: 5%;">
<a style="color: #66CA94;">
<span style="font-size: 2em;">99</span> /单月
</a>
</div>
<ol class="personal-ol">
<li>单月名企实习畅想</li>
<li>单月名企实习畅想</li>
<li>单月名企实习畅想</li>
<li>单月名企实习畅想</li>
<li>单月名企实习畅想</li>
<li>单月名企实习畅想</li>
<li>单月名企实习畅想</li>
</ol>
</div>
</div> -->
<!-- <div onclick="clickVIPtwo()" class="personal-vip-standard">
<div class="personal-vip-info1">
<p>标准会员</p>
<a>乘风破浪</a>
</div>
<div style="background: #fff;">
<div style="text-align: center;padding: 5%;">
<a style="color: #ff8000;">
<span style="font-size: 2em;">399</span> /半年
</a>
</div>
<ol class="personal-ol">
<li>单月名企实习畅想</li>
<li>单月名企实习畅想</li>
<li>单月名企实习畅想</li>
<li>单月名企实习畅想</li>
<li>单月名企实习畅想</li>
<li>单月名企实习畅想</li>
<li>单月名企实习畅想</li>
</ol>
</div>
</div>
<div onclick="clickVIPthree()" class="personal-vip-super">
<div class="personal-vip-info2">
<p>超级会员</p>
<a>职场领航</a>
</div>
<div style="background: #fff;">
<div style="text-align: center;padding: 5%;">
<a style="color: #6F1C0B;">
<span style="font-size: 2em;">699</span> /年度
</a>
</div>
<ol class="personal-ol">
<li>单月名企实习畅想</li>
<li>单月名企实习畅想</li>
<li>单月名企实习畅想</li>
<li>单月名企实习畅想</li>
<li>单月名企实习畅想</li>
<li>单月名企实习畅想</li>
<li>单月名企实习畅想</li>
</ol>
</div>
</div> -->
</div>
<div class="personal-pay">
<div class="personal-pay-zhifubao">
... ... @@ -739,13 +673,9 @@
<div class="shang_box">
<a class="shang_close" href="javascript:void(0)" onclick="payment()" title="关闭"><img src="./images/close.jpg" alt="取消" /></a>
<div class="shang_payimg">
<!-- <img src="http://qr.api.cli.im/qr?data=http%3A%2F%2Fwww.dmaku.com&level=H&transparent=false&bgcolor=%23FFFFFF&forecolor=images%2Fforecolor%2F12.png&blockpixel=12&marginblock=2&logourl=%2F%2Foss-cn-hangzhou.aliyuncs.com%2Fpublic-cli%2Ffree%2F8550d79acfde09ae04d687169d0d9aca1489672062.png&size=400&text=&logoshape=no&fontsize=30&fontfamily=msyh.ttf&fontcolor=&incolor=&outcolor=&qrcode_eyes=pin-3.png&background=&wper=0&hper=0&tper=0&lper=0&eye_use_fore=1&qrpad=10&kid=bizcliim&time=1489672078&key=d59a3fcb09d1cb40b10fd3664b50ae2c"
alt="扫码支付" title="扫一扫" /> -->
</div>
</div>
<button style="color: #70D09D;background-color: #323232;border: 1px solid #70D09D;border-radius: 10em;padding: 0.5% 5%;">续费</button>
<!-- <button style="color: #70D09D;background-color: #323232;border: 1px solid #70D09D;border-radius: 10em;padding: 0.5% 5%;">续费</button> -->
</div>
<!-- 支付宝页面 -->
<div class="zhifubao_form" style="display: none;">
... ...
... ... @@ -257,7 +257,7 @@ function payment() {
console.log(res2.data);
if (res2.data == '2') {
clearInterval(timeInterval)
alert("支付成功!")
alert("支付成功,审核通过后即可成为会员!")
window.location.href = 'personalCenter2.html'
}
}, function(res) {})
... ... @@ -275,6 +275,7 @@ function payment() {
}
ajax("/zfbPay/alipay", "GET", header1, params3, function(res) {
console.log(res);
alert("支付成功,审核通过后即可成为会员!")
$(".zhifubao_form").html(res)
}, function(res) {})
} else {
... ...
... ... @@ -199,32 +199,49 @@ $(document).ready(function() {
})
//添加项目
function setLearingContentId(id) {
var url7 = "/userProgram/userProgramAdd/" + id;
var header = {
"Content-Type": "application/x-www-form-urlencoded",
"token": localStorage.getItem('token'),
}
ajax(url7, "POST", header, function(res) {
var header1 = {
"Content-Type": "application/json",
"token": localStorage.getItem('token'),
}
// 调用公共ajax
ajax("/login/userInfo", "GET", header1, function(res) {
console.log(res);
}, function(res) {
console.log(res);
window.location.href = 'learningContent.html?id=' + id
// console.log(res);
if (res.data.status1 == 2) {
var url7 = "/userProgram/userProgramAdd/" + id;
var header = {
"Content-Type": "application/x-www-form-urlencoded",
"token": localStorage.getItem('token'),
}
ajax(url7, "POST", header, function(res) {
console.log(res);
}, function(res) {
console.log(res);
window.location.href = 'learningContent.html?id=' + id
}, function(res) {
console.log(res);
alert("登录才可以查看项目内容哦!")
})
} else {
alert("请您充值会员才能查看此内容!")
}
}, function(res) {
console.log(res);
alert("登录才可以查看项目内容哦!")
if (res) {
alert("请您先登录!")
}
})
// console.log(id);
}
//获取用户VIP信息判断是否是VIP
function setPersonal() {
var url = "/login/userInfo"; // 接口
function setPersonal() {
var header = {
"Content-Type": "application/json",
"token": localStorage.getItem('token'),
}
// 调用公共ajax
ajax(url, "GET", header, function(res) {
ajax("/login/userInfo", "GET", header, function(res) {
console.log(res);
}, function(res) {
// console.log(res);
... ...
... ... @@ -26,6 +26,51 @@
<link href='http://fonts.googleapis.com/css?family=Asap:400,700' rel='stylesheet' type='text/css'>
<style>
/* 分页插件css */
#page {
/* margin: 0 auto 60px; */
padding: 30px 0;
color: #666;
display: block;
text-align: center;
background: #f0f0f0;
}
#page li {
display: inline-block;
min-width: 30px;
height: 28px;
cursor: pointer;
color: #666;
font-size: 13px;
line-height: 28px;
background-color: #f9f9f9;
border: 1px solid #dce0e0;
text-align: center;
margin: 0 4px;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
.xl-nextPage,
.xl-prevPage {
width: 60px;
color: #66CA94;
height: 28px;
}
#page li.xl-disabled {
opacity: .5;
cursor: no-drop;
}
#page li.xl-active {
background-color: #66CA94;
border-color: #66CA94;
color: #FFF
}
/* 分页插件结束 */
.header-text {
padding: 0 70px;
}
... ... @@ -294,9 +339,6 @@
<div class="intro" style="color: #66CA94;text-align: left;">推荐项目 recommendable projects</div>
<!-- <div style="display: flex; justify-content: space-between;"> -->
<h2 class="par-learning">获得推荐的项目</h2>
<!-- </div> -->
<!-- </div> -->
</div>
</div>
<div class="no-gutter" style="display: flex;flex-wrap: wrap;" id="allProject">
... ... @@ -313,9 +355,8 @@
</div> -->
</div>
</section>
</div>
<div id="page"></div>
<div class="login-footer-all">
<div class="login-footer-img" style="width: 25%;margin-top: 45px;">
<img src="img/portfolio/whiteLogo.png" width="100%">
... ... @@ -371,7 +412,7 @@
<script src="js/jquery.easing.min.js"></script>
<script src="js/classie.js"></script>
<script src="js/cbpAnimatedHeader.js"></script>
<script type="text/javascript" src="xlPaging.js"></script>
<!-- carousel -->
<script src="owl-carousel/owl.carousel.js"></script>
<script>
... ...
$(document).ready(function() {
//查看已推荐的项目
var url = "/warrantyTwo/warrantyTwos"; // 接口
var pages = ''
var page = 1
var size = 4
// xlPaging.js 使用方法
$("#page").paging({
nowPage: page, // 当前页码
pageNum: pages, // 总页码
buttonNum: size, //要展示的页码数量
callback: function (num) { //回调函数
console.log(num);
page = num
aaaa()
}
});
aaaa()
function aaaa(){
var header = {
"Content-Type": "application/json",
"token": localStorage.getItem('token'),
}
var params = JSON.stringify({
current: 1,
size: 4
current: page,//开始页
size: size,//展示条数
})
// 调用公共ajax
ajax(url, "POST", header, params, function(res) {
var title
ajax("/warrantyTwo/warrantyTwos", "POST", header, params, function(res) {
console.log(res);
pages = res.data.pages
$("#recommend-num").html(res.data.records.length)
$.each(res.data.records, function(key, value) {
let title = `
... ... @@ -32,6 +49,7 @@ $(document).ready(function() {
}, function(res) {
console.log(res);
})
}
//查看个人信息赋值名字
var url2 = "/login/userInfo"; // 接口
// 调用公共ajax
... ...
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>分页插件-xiaoluo</title>
<style>
#page {
margin: 20px auto;
color: #666;
display: block;
text-align: center;
}
#page li {
display: inline-block;
min-width: 30px;
height: 28px;
cursor: pointer;
color: #666;
font-size: 13px;
line-height: 28px;
background-color: #f9f9f9;
border: 1px solid #dce0e0;
text-align: center;
margin: 0 4px;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
.xl-nextPage,
.xl-prevPage {
width: 60px;
color: #66CA94;
height: 28px;
}
#page li.xl-disabled {
opacity: .5;
cursor: no-drop;
}
#page li.xl-active {
background-color: #66CA94;
border-color: #66CA94;
color: #FFF
}
</style>
</head>
<body ontouchstart="" onmousemove="">
<div id="page"></div>
</body>
<script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script>
<script type="text/javascript" src="xlPaging.js"></script>
<script>
// xlPaging.js 使用方法
$("#page").paging({
nowPage: 1, // 当前页码
pageNum: 20, // 总页码
buttonNum: 7, //要展示的页码数量
callback: function (num) { //回调函数
console.log(num);
}
});
</script>
</html>
\ No newline at end of file
... ...
;(function ($, window, document, undefined) {
'use strict';
function Paging(element, options) {
this.element = element;
this.options = {
nowPage: options.nowPage || 1, // 当前页码
pageNum: options.pageNum, // 总页码
buttonNum: (options.buttonNum>=5?options.buttonNum:5) || 4,// 页面显示页码数量
callback: options.callback // 回调函数
};
this.init();
}
Paging.prototype = {
constructor : Paging,
init : function() {
this.createHtml();
this.bindClickEvent();
this.disabled();
},
createHtml : function(){
var me = this;
var nowPage = this.options.nowPage;
var pageNum = this.options.pageNum;
var buttonNum = this.options.buttonNum;
var content = [];
content.push("<ul>");
content.push("<li class='xl-prevPage'>上一页</li>");
//页面总数小于等于当前要展示页数总数,展示所有页面
if(pageNum <= buttonNum){
for(var i=1; i<=pageNum; i++){
if (nowPage !== i) {
content.push("<li>"+i+"</li>");
} else {
content.push("<li class='xl-active'>"+i+"</li>");
}
}
}else if(nowPage <= Math.floor(buttonNum / 2)){
//当前页面小于等于展示页数总数的一半(向下取整),从1开始
for(var i=1;i<= buttonNum-2;i++){
if (nowPage !== i) {
content.push("<li>"+i+"</li>");
} else {
content.push("<li class='xl-active'>"+i+"</li>");
}
}
content.push("<li class='xl-disabled'>...</li>");
content.push("<li>" + pageNum + "</li>");
}else if(pageNum - nowPage <= Math.floor(buttonNum / 2)){
//当前页面大于展示页数总数的一半(向下取整)
content.push("<li>"+1+"</li>");
content.push("<li class='xl-disabled'>...</li>");
for(var i=pageNum-buttonNum+3; i<=pageNum; i++){
if (nowPage !== i) {
content.push("<li>"+i+"</li>");
} else {
content.push("<li class='xl-active'>"+i+"</li>");
}
}
}else{
//前半部分页码
if(nowPage - Math.floor(buttonNum / 2) <= 0){
for(var i=1;i<= Math.floor(buttonNum / 2);i++){
if (nowPage !== i) {
content.push("<li>"+i+"</li>");
} else {
content.push("<li class='xl-active'>"+i+"</li>");
}
}
}else{
content.push("<li>"+1+"</li>");
content.push("<li class='xl-disabled'>...</li>");
for(var i=nowPage-Math.floor(buttonNum / 2)+(buttonNum % 2 == 0 ? 3: 2); i<=nowPage; i++){
if (nowPage !== i) {
content.push("<li>"+i+"</li>");
} else {
content.push("<li class='xl-active'>"+i+"</li>");
}
}
}
//后半部分页码
if(pageNum - nowPage <= 0){
for(var i=nowPage+1;i<=pageNum;i++){
content.push("<li>" + i + "</li>");
}
}else{
for(var i=nowPage+1; i<=nowPage+Math.floor(buttonNum / 2)-2; i++){
content.push("<li>"+i+"</li>");
}
content.push("<li class='xl-disabled'>...</li>");
content.push("<li>" + pageNum + "</li>");
}
}
content.push("<li class='xl-nextPage'>下一页</li>");
content.push("</ul>");
me.element.html(content.join(''));
// DOM重新生成后每次调用是否禁用button
setTimeout(function () {
me.disabled();
}, 20);
},
bindClickEvent: function(){
var me = this;
me.element.off('click', 'li');
me.element.on('click', 'li', function () {
var cla = $(this).attr('class');
var num = parseInt($(this).html());
var nowPage = me.options.nowPage;
if( $(this).hasClass('xl-disabled')){
return ;
}
if (cla === 'xl-prevPage') {
if (nowPage !== 1) {
me.options.nowPage -= 1;
}
} else if (cla === 'xl-nextPage') {
if (nowPage !== me.options.pageNum) {
me.options.nowPage += 1;
}
}else {
me.options.nowPage = num;
}
me.createHtml();
if (me.options.callback) {
me.options.callback(me.options.nowPage);
}
});
},
disabled: function () {
var me = this;
var nowPage = me.options.nowPage;
var pageNum = me.options.pageNum;
if (nowPage === 1) {
me.element.children().children('.xl-prevPage').addClass('xl-disabled');
} else if (nowPage === pageNum) {
me.element.children().children('.xl-nextPage').addClass('xl-disabled');
}
}
}
$.fn.paging = function (options) {
return new Paging($(this), options);
}
})(jQuery, window, document);
\ No newline at end of file
... ...