|
|
<!DOCTYPE html>
|
|
|
<html>
|
|
|
<head>
|
|
|
<meta charset="utf-8">
|
|
|
<title>高校轮播一体机</title>
|
|
|
<meta name="renderer" content="webkit">
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
|
|
<link rel="stylesheet" href="./lib/layui/css/layui.css" media="all">
|
|
|
<!--<link type="text/css" rel="stylesheet" href="./lib/carousel/css/carousel.css">-->
|
|
|
<link rel="stylesheet" href="./lib/jquery-auto-complete/jquery.auto-complete.css"/>
|
|
|
<link rel="stylesheet" href="./css/swiper.css" >
|
|
|
<!--<link rel="stylesheet" href="./lib/pper/css/lightbox.min.css" />-->
|
|
|
<link rel="stylesheet" href="./lib/pper/css/wall2.css"/>
|
|
|
<!--<script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script>-->
|
|
|
|
|
|
<script src="./lib/jquery/jquery-3.3.1.min.js"></script>
|
|
|
<script src="./lib/pper/wall2/three.js"></script>
|
|
|
<script src="./lib/pper/wall2/dat.gui.min.js"></script>
|
|
|
<script src="./lib/pper/wall2/CSS3DRenderer.js"></script>
|
|
|
<script src="./lib/pper/wall2/OrbitControls.js"></script>
|
|
|
<script src="./lib/pper/wall2/tween.js"></script>
|
|
|
<script src="./lib/jquery-auto-complete/jquery.auto-complete.js"></script>
|
|
|
<script src="./lib/jquery-timer/jquery.timer.js"></script>
|
|
|
<script src="lib/cookie/jquery.cookie.js"></script>
|
|
|
|
|
|
<!--<script src="./lib/pper/js/lightbox.js"></script>-->
|
|
|
<style type="text/css">
|
|
|
.caroursel {
|
|
|
margin: 150px auto;
|
|
|
}
|
|
|
#gui_container {
|
|
|
position: absolute;
|
|
|
bottom: 0rem;
|
|
|
left: 0rem;
|
|
|
z-index: 1;
|
|
|
opacity: 0.65;
|
|
|
}
|
|
|
|
|
|
#gui {
|
|
|
/*transform:translate(-50%, -75px);*/
|
|
|
}
|
|
|
|
|
|
.layui-layer-nobg .layui-layer-content {
|
|
|
text-align: center;
|
|
|
}
|
|
|
|
|
|
.layui-layer-nobg img {
|
|
|
max-width: 100% !important;
|
|
|
max-height: 100% !important;
|
|
|
}
|
|
|
|
|
|
div, p {
|
|
|
cursor: default;
|
|
|
}
|
|
|
|
|
|
a * {
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
|
|
|
.search-form {
|
|
|
min-width: 520px !important;
|
|
|
}
|
|
|
|
|
|
.color-a {
|
|
|
color: #75E0ED ;
|
|
|
border: 1px solid #75E0ED;
|
|
|
}
|
|
|
|
|
|
.color-b {
|
|
|
color: #e550ff ;
|
|
|
border: 1px solid #e550ff;
|
|
|
}
|
|
|
|
|
|
.color-c {
|
|
|
color: #f78b54;
|
|
|
border: 1px solid #f78b54;
|
|
|
}
|
|
|
|
|
|
.color-d {
|
|
|
color: #4cb1f7 ;
|
|
|
border: 1px solid #4cb1f7;
|
|
|
}
|
|
|
|
|
|
.color-e {
|
|
|
color: #ababf7 ;
|
|
|
border: 1px solid #ababf7;
|
|
|
}
|
|
|
|
|
|
.color-f {
|
|
|
color: #87e997 ;
|
|
|
border: 1px solid #87e997;
|
|
|
}
|
|
|
|
|
|
.color-g {
|
|
|
color: #f6c953;
|
|
|
border: 1px solid #f6c953;
|
|
|
}
|
|
|
|
|
|
.color-h {
|
|
|
color: #f793d8 ;
|
|
|
border: 1px solid #f793d8;
|
|
|
}
|
|
|
|
|
|
.color-i {
|
|
|
color: #f7556f ;
|
|
|
border: 1px solid #f7556f;
|
|
|
}
|
|
|
|
|
|
.color-j {
|
|
|
color: #3c16f7;
|
|
|
border: 1px solid #3c16f7;
|
|
|
}
|
|
|
.message{
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
position: fixed;
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
|
align-items: center;
|
|
|
background: rgba(0, 0, 0, .3);
|
|
|
top: 0;
|
|
|
left: 0;
|
|
|
z-index: 999;
|
|
|
}
|
|
|
.message-box{
|
|
|
/*padding: 20px 40px;*/
|
|
|
width: 20rem;
|
|
|
height: 9rem;
|
|
|
border-radius:8px;
|
|
|
overflow: auto;
|
|
|
background: #ffffff;
|
|
|
box-shadow: 3px 2px 5px #7777;
|
|
|
}
|
|
|
.message-header{
|
|
|
height: 1.6rem;
|
|
|
line-height: 1.6rem;
|
|
|
text-align: left;
|
|
|
font-size: 13px;
|
|
|
padding: 0 .5rem;
|
|
|
color: #fff;
|
|
|
background: #2C88ED;
|
|
|
border-bottom: 1px solid #B6BEC5;
|
|
|
}
|
|
|
.message-content{
|
|
|
padding: 0 1rem;
|
|
|
height:4.3rem;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
}
|
|
|
.message-footer{
|
|
|
height: 2rem;
|
|
|
display: flex;
|
|
|
justify-content: flex-end;
|
|
|
margin-right: 1rem;
|
|
|
}
|
|
|
.message-footer .button{
|
|
|
text-align: center;
|
|
|
padding: 0 1rem;
|
|
|
background:#2C88ED ;
|
|
|
color: #fff;
|
|
|
line-height: 2rem;
|
|
|
font-size: 13px;
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
.details{
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
position: relative;
|
|
|
top:0;
|
|
|
left:0;
|
|
|
background: rgba(0, 0, 0, .7);
|
|
|
z-index: 30000000;
|
|
|
|
|
|
}
|
|
|
.details-title{
|
|
|
/*padding: 20px 40px;*/
|
|
|
display: flex;
|
|
|
height: 15vh;
|
|
|
width: 100%;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
}
|
|
|
.details-title .details-name{
|
|
|
color: #fff;
|
|
|
text-align: center;
|
|
|
font-size: 4vh;
|
|
|
|
|
|
}
|
|
|
.details-title .school-logo{
|
|
|
max-width: 80px;
|
|
|
border-radius: 40px;
|
|
|
margin-right: 25px;
|
|
|
}
|
|
|
.details-title .close-btn{
|
|
|
width: 30px;
|
|
|
position: fixed;
|
|
|
right: 2vh;
|
|
|
top:2vh;
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
.details-content{
|
|
|
height: calc(100% - 30vh );
|
|
|
/*background: #054D6A;*/
|
|
|
background:linear-gradient(-23.1667deg, rgba(10, 38, 92, 0.64) 27.1699%, rgba(2, 174, 203, 0.63) 136.243%);
|
|
|
width: 100%;
|
|
|
/*border-bottom: 1px solid #1B9FCA;*/
|
|
|
/*border-top: 1px solid #1B9FCA;*/
|
|
|
}
|
|
|
.details-content .border-style-left{
|
|
|
width: 50%;
|
|
|
height: 2px;
|
|
|
background:linear-gradient(to right,rgba(0,0,0,0)0%,#55DAFA 80%,rgba(0,0,0,0)100%)
|
|
|
}
|
|
|
.details-content .border-style-right{
|
|
|
width: 50%;
|
|
|
height: 2px;
|
|
|
background:linear-gradient(to right,rgba(0,0,0,0)0%,#55DAFA 20%,rgba(0,0,0,0)100%)
|
|
|
}
|
|
|
.details-content .school-content{
|
|
|
height: calc(100% - 4px);
|
|
|
}
|
|
|
.details-footer{
|
|
|
height: 15vh;
|
|
|
color:#fff;
|
|
|
/*background: #e484ff;*/
|
|
|
width: 100%;
|
|
|
position: absolute;
|
|
|
bottom: 1vh;
|
|
|
}
|
|
|
.details-footer .school-menu{
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
|
color: #29778A;
|
|
|
|
|
|
}
|
|
|
.details-footer .school-menu li{
|
|
|
margin: 0 70px;
|
|
|
font-size: 20px;
|
|
|
cursor: pointer;
|
|
|
text-align: center;
|
|
|
}
|
|
|
.details-footer .school-menu li .circle{
|
|
|
width: 6px;
|
|
|
height: 6px;
|
|
|
padding: 2px;
|
|
|
border-radius: 8px;
|
|
|
background:#55DAFA ;
|
|
|
border: 3px solid #000;
|
|
|
margin: 0 auto;
|
|
|
pointer-events: none;
|
|
|
}
|
|
|
.details-footer .school-menu li .menu-name{
|
|
|
cursor: pointer;
|
|
|
margin-top: 1vh
|
|
|
}
|
|
|
.menu-active{
|
|
|
color: #55DAFA;
|
|
|
font-size: 22px;
|
|
|
}
|
|
|
|
|
|
#summary_new {
|
|
|
width: 80%;
|
|
|
height:calc(100% - 8vh);
|
|
|
padding: 3vh 0;
|
|
|
overflow: auto;
|
|
|
margin: 0 auto;
|
|
|
color:#55DAFA;
|
|
|
font-size: 15px;
|
|
|
}
|
|
|
#summary_new .tags{
|
|
|
display: inline-block;
|
|
|
border: 1px solid ;
|
|
|
padding: 5px 10px;
|
|
|
margin-right: 1vh;
|
|
|
border-image: linear-gradient(to right, #27518F, #32DAE7) 4 ;
|
|
|
}
|
|
|
#summary_new h4{
|
|
|
font-size: 18px;
|
|
|
font-weight: bold;
|
|
|
margin-top: 2vh;
|
|
|
margin-bottom: 1vh;
|
|
|
}
|
|
|
#specialty_new{
|
|
|
padding: 3vh 0;
|
|
|
width: 80%;
|
|
|
height:calc(100% - 8vh);
|
|
|
overflow: auto;
|
|
|
margin: 0 auto;
|
|
|
color:#55DAFA;
|
|
|
}
|
|
|
#specialty_new .specialty-header{
|
|
|
display: flex;
|
|
|
margin-top: 2vh;
|
|
|
justify-content: center;
|
|
|
}
|
|
|
#specialty_new .specialty-header select{
|
|
|
background-color: transparent;
|
|
|
color:#55DAFA;
|
|
|
border:none;
|
|
|
font-size: 16px;
|
|
|
border-bottom: 1px solid #55DAFA;
|
|
|
}
|
|
|
#specialty_new .specialty-header option{
|
|
|
appearance:none;
|
|
|
-moz-appearance:none;
|
|
|
-webkit-appearance:none;
|
|
|
background-color: #0C425E;
|
|
|
color:#55DAFA;
|
|
|
}
|
|
|
#specialty_new .specialty-header input{
|
|
|
background-color: transparent;
|
|
|
color:#55DAFA;
|
|
|
border:none;
|
|
|
font-size: 16px;
|
|
|
border-bottom: 1px solid #55DAFA;
|
|
|
margin: 0 1rem;
|
|
|
}
|
|
|
#specialty_new .specialty-header input::placeholder{
|
|
|
color: rgba(54, 231, 239, 0.5);
|
|
|
font-size: 16px;
|
|
|
}
|
|
|
#specialty_new .specialty-body{
|
|
|
margin-top: 6vh;
|
|
|
height: 48vh;
|
|
|
}
|
|
|
#specialty_new .specialty-body .none{
|
|
|
text-align: center;
|
|
|
padding-top: 10rem;
|
|
|
font-size: 20px;
|
|
|
color:#55DAFA;
|
|
|
}
|
|
|
#specialty_new .specialty-body .major-box{
|
|
|
display: inline-block;
|
|
|
border: 3px solid;
|
|
|
width: calc((100% - 27vh - 40px) / 4);
|
|
|
margin-right: 3vh;
|
|
|
margin-bottom: 4vh;
|
|
|
border-image: linear-gradient(to right, #27518F, #32DAE7) 4;
|
|
|
height: 14vh;
|
|
|
padding: 1vh 2vh;
|
|
|
font-size: 15px;
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
#specialty_new .specialty-body .major-box:nth-child(4n){
|
|
|
margin-right: 0;
|
|
|
}
|
|
|
#specialty_new .specialty-body .major-box .major-name{
|
|
|
font-size: 20px;
|
|
|
margin: 1vh 2vh;
|
|
|
overflow: hidden;
|
|
|
text-overflow: ellipsis;
|
|
|
white-space: nowrap;
|
|
|
margin-bottom: 2vh;
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
#specialty_new .specialty-body .major-box .major-item{
|
|
|
margin: 1vh 2vh;
|
|
|
cursor: pointer;
|
|
|
|
|
|
}
|
|
|
|
|
|
#specialty_new .content2 .border-style{
|
|
|
border: 1px solid;
|
|
|
border-image: linear-gradient(to right, #27518F, #32DAE7) 4;
|
|
|
margin-right: 1vh;
|
|
|
padding: .3vh 2vh;
|
|
|
}
|
|
|
#specialty_new h4{
|
|
|
font-size: 18px;
|
|
|
font-weight: bold;
|
|
|
margin-top: 2vh;
|
|
|
margin-bottom: 2vh;
|
|
|
|
|
|
}
|
|
|
.rb_bottom,.rb_bottom .fy_y,.rb_bottom .pnbtn,.rb_bottom .previous,.rb_bottom .next {
|
|
|
display:flex;
|
|
|
justify-content:center;
|
|
|
align-items:center;
|
|
|
}
|
|
|
.fy_y {
|
|
|
width:24px;
|
|
|
height:24px;
|
|
|
box-sizing:border-box;
|
|
|
background:#fff;
|
|
|
border:1px solid #7baaa0;
|
|
|
border-radius:50%;
|
|
|
color:#4f4f4f;
|
|
|
font-size:14px;
|
|
|
font-weight:500;
|
|
|
margin-right:12px;
|
|
|
cursor:pointer;
|
|
|
}
|
|
|
.fy_d {
|
|
|
width:8px;
|
|
|
height:8px;
|
|
|
border-radius:50%;
|
|
|
background:#fff;
|
|
|
margin-right:12px;
|
|
|
}
|
|
|
.selected {
|
|
|
background:#164c86;
|
|
|
color:#fff;
|
|
|
border:0;
|
|
|
}
|
|
|
.pnbtn,.previous,.nextPage {
|
|
|
width:62px;
|
|
|
height:31px;
|
|
|
box-sizing:border-box;
|
|
|
border:3px solid #fff;
|
|
|
border-radius:10px;
|
|
|
font-weight:500;
|
|
|
font-size:14px;
|
|
|
cursor:pointer;
|
|
|
color:#fff;
|
|
|
}
|
|
|
.previous {
|
|
|
margin:0 2px;
|
|
|
}
|
|
|
|
|
|
</style>
|
|
|
<link rel="stylesheet" href="./css/style.css?v=1.0.0.2108200838" media="all">
|
|
|
|
|
|
|
|
|
|
|
|
</head>
|
|
|
<body>
|
|
|
<div id="btn_search" data-state="closed"><img src="img/search_black.svg"></div>
|
|
|
<div class="logo" onclick="window.location.reload();"><img src="./img/logo.png"></div>
|
|
|
<div onclick="showModal()" id="login" style="display:none;z-index:2;color:#3499FB;font-size: 1.2rem;cursor: pointer; border: 2px solid #3499FB;border-radius: 5px;padding: .5rem 1.5rem;position:absolute;right:50px;top: 50px;">登录</div>
|
|
|
<div id="logout" style="display:none;z-index:2;color:#3499FB;font-size: 1.2rem;position:absolute;right:50px;top: 50px;">
|
|
|
<img src="img/tx.png" style="display:inline-block;width:3rem;vertical-align: middle"/>
|
|
|
<div style="display:inline-block;margin:0 1rem" id="name"></div>
|
|
|
<div style="display:inline-block;cursor: pointer" onclick="doLogout()">退出</div>
|
|
|
</div>
|
|
|
<div class="copyright">版权所有:东北师大理想软件股份有限公司     技术服务:400-0400-662</div>
|
|
|
<div class="model" style="display: none">
|
|
|
<div class="modelFixed" >
|
|
|
<div style="position: relative;height: 10vh">
|
|
|
<div ><img onclick="closeModal()" style="position:absolute;top:0;right:-2vh;width: 1.5rem;cursor:pointer" src="img/closeModal.png"/></div>
|
|
|
<div class="title">用户登录</div>
|
|
|
</div>
|
|
|
<div style="position: relative;text-align: center">
|
|
|
<input class="input-box" style="margin-bottom: 1rem" autocomplete="off" type="text" id="personName" placeholder="请输入用户名" />
|
|
|
<img style="width: 1.5rem;position: absolute;left: 4.2rem;top: .6rem;" src="img/user.png"/>
|
|
|
</div>
|
|
|
<div style="position: relative;text-align: center">
|
|
|
<input class="input-box" type="password" id="password" placeholder="请输入密码" />
|
|
|
<img style="width: 1.5rem;position: absolute;left: 4.2rem;top: .6rem;" src="img/lock.png"/>
|
|
|
</div>
|
|
|
<div style="font-size: 13px;margin-top:5px;color:red;text-align: center" id="tip"></div>
|
|
|
<div style="display: flex;justify-content: center;text-align: center">
|
|
|
<div class="btn" onclick="doLogin()">登录</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="message" style="display: none">
|
|
|
<div class="message-box">
|
|
|
<div class="message-header">提示</div>
|
|
|
<div class="message-content">
|
|
|
<img src="img/attention.png" style="margin: 0 1rem;width: 1.5rem"/>
|
|
|
<div class="info"></div>
|
|
|
</div>
|
|
|
<div class="message-footer">
|
|
|
<div class="button" onclick="okButton()">确定</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="details" style="display: none">
|
|
|
<div class="details-title">
|
|
|
<img class="school-logo" onerror="this.src='img/picture.svg';this.width='100%';" />
|
|
|
<div class="details-name"></div>
|
|
|
<img src="img/close.png" class="close-btn" onclick="closeSchoolDetails()"/>
|
|
|
</div>
|
|
|
<div class="details-content">
|
|
|
<div style="display: flex">
|
|
|
<div class="border-style-left"></div>
|
|
|
<div class="border-style-right"></div>
|
|
|
</div>
|
|
|
<div class="school-content">
|
|
|
|
|
|
</div>
|
|
|
<div style="display: flex;">
|
|
|
<div class="border-style-left"></div>
|
|
|
<div class="border-style-right"></div>
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
<div class="details-footer">
|
|
|
<ul class="school-menu">
|
|
|
<li>
|
|
|
<div class="circle"></div>
|
|
|
<div data-key="summary_new" class="menu-name">学校概况</div>
|
|
|
</li>
|
|
|
<li>
|
|
|
<div class="circle"></div>
|
|
|
<div data-key="specialty_new" class="menu-name">开设专业</div>
|
|
|
</li>
|
|
|
<li>
|
|
|
<div class="circle"></div>
|
|
|
<div data-key="intro_new" class="menu-name menu-active">校园风采</div>
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!--<img src="./img/config.png" onclick="window.chrome.webview.postMessage('admin')" style="left: 10px; bottom: 10px; width: 64px; height: 64px; position: fixed; z-index: 90000000; opacity: .3;"/>-->
|
|
|
<script src="./lib/layui/layui.js" charset="utf-8"></script>
|
|
|
<script src="./lib/md5.js"></script>
|
|
|
<script>
|
|
|
// console.log('XGKYTJ 202109291410');
|
|
|
// global variables
|
|
|
var flagTimer = false; // true: 20s内无操作无操作可执行 false:20s内有操作不执行
|
|
|
var times = 0; // 切换次数
|
|
|
|
|
|
var timer = $.timer(20000, function () {
|
|
|
if (flagTimer) {
|
|
|
if (times === 12) {
|
|
|
window.location.reload(); // 如果运行切换效果10次
|
|
|
}
|
|
|
if (effect === 0) {
|
|
|
effect = 1;
|
|
|
control.toPlane(); // 平面
|
|
|
} else if (effect === 1) {
|
|
|
effect = 2;
|
|
|
control.toCube(); // 立方体
|
|
|
} else if (effect === 2) {
|
|
|
effect = 3;
|
|
|
control.toSphere(); // 球体
|
|
|
} else if (effect === 3) {
|
|
|
effect = 0;
|
|
|
control.toCylinder(); // 圆柱体
|
|
|
}
|
|
|
times++;
|
|
|
} else {
|
|
|
flagTimer = true;
|
|
|
}
|
|
|
|
|
|
}, false);
|
|
|
|
|
|
var effect = 0; // 展示效果编号
|
|
|
var renderer;
|
|
|
var scene;
|
|
|
var camera;
|
|
|
var control;
|
|
|
var controls;
|
|
|
var stats;
|
|
|
var university_id = '';
|
|
|
var university_data = '';
|
|
|
|
|
|
// src: '/' + item.Address + '.thumb.webp',
|
|
|
// resource: '/' + item.Address
|
|
|
var table = [];
|
|
|
var offset = 40;
|
|
|
var offscreen = new THREE.Vector3(1000, 0, 1000);
|
|
|
var currentElements = [];
|
|
|
var newlyAddedElements = [];
|
|
|
var toBeRemovedElements = [];
|
|
|
var positionAndRotation = [];
|
|
|
|
|
|
/**
|
|
|
* Initializes the scene, camera and objects. Called when the window is
|
|
|
* loaded by using window.onload (see below)
|
|
|
*/
|
|
|
function init() {
|
|
|
// create a scene, that will hold all our elements such as objects, cameras and lights.
|
|
|
scene = new THREE.Scene();
|
|
|
|
|
|
// create a camera, which defines where we're looking at.
|
|
|
camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 1000);
|
|
|
|
|
|
// create a render, sets the background color and the size
|
|
|
|
|
|
renderer = new THREE.CSS3DRenderer();
|
|
|
renderer.setSize(window.innerWidth, window.innerHeight);
|
|
|
renderer.domElement.style.position = 'absolute';
|
|
|
renderer.domElement.style.top = 0;
|
|
|
|
|
|
// position and point the camera to the center of the scene
|
|
|
camera.position.x = 1200;
|
|
|
camera.position.y = 1200;
|
|
|
camera.position.z = 1200;
|
|
|
camera.lookAt(scene.position);
|
|
|
|
|
|
controls = new THREE.OrbitControls(camera, renderer.domElement);
|
|
|
controls.autoRotate = true;
|
|
|
|
|
|
// setup the control object for the control gui
|
|
|
control = new function () {
|
|
|
this.toCube = function (e) {
|
|
|
updateStructure(new THREE.BoxGeometry(20, 14, 20, 5, 3, 5), 40);
|
|
|
};
|
|
|
this.toCylinder = function () {
|
|
|
updateStructure(new THREE.CylinderGeometry(12, 12, 27, 15, 7, true), 40);
|
|
|
};
|
|
|
this.toSphere = function () {
|
|
|
updateStructure(new THREE.SphereGeometry(17, 10, 10), 40);
|
|
|
};
|
|
|
this.toPlane = function () {
|
|
|
// updateStructure(new THREE.PlaneGeometry(30, 30, 8, 8), 40);
|
|
|
updateStructure(new THREE.TorusGeometry(20, 10, 8, 10), 25);
|
|
|
|
|
|
};
|
|
|
};
|
|
|
|
|
|
// add extras
|
|
|
|
|
|
///addStatsObject();
|
|
|
|
|
|
// add the output of the renderer to the html element
|
|
|
document.body.appendChild(renderer.domElement);
|
|
|
|
|
|
///addControlGui(control);
|
|
|
|
|
|
updateStructure(new THREE.PlaneGeometry(30, 30, 8, 8), 40);
|
|
|
// call the render function, after the first render, interval is determined
|
|
|
// by requestAnimationFrame
|
|
|
render();
|
|
|
}
|
|
|
|
|
|
function createCSS3DObject(imgInfo) {
|
|
|
var div = document.createElement('div');
|
|
|
var img = document.createElement('img');
|
|
|
var a = document.createElement('a');
|
|
|
|
|
|
// var nrString = ("000" + iFace * 4).substr(-3, 3);
|
|
|
// img.src = '../assets/screens/WALL-E-' + nrString + ".jpg";
|
|
|
img.src = imgUrl = imgInfo.src;
|
|
|
img.width = 140;
|
|
|
img.height = 140;
|
|
|
|
|
|
//console.log('info', imgInfo);
|
|
|
|
|
|
//a.href = imgInfo.resource;
|
|
|
a.className = 'pper-item';
|
|
|
a.setAttribute('data-id', imgInfo.unique_id);
|
|
|
//a.setAttribute('data-name', imgInfo.name);
|
|
|
a.setAttribute('data-rid', imgInfo.rid);
|
|
|
|
|
|
//a.setAttribute('data-lightbox','roadtrip');
|
|
|
//a.setAttribute('title',a.href.substr(a.href.lastIndexOf('/')+1));
|
|
|
|
|
|
div.appendChild(img);
|
|
|
div.style.opacity = 0.7;
|
|
|
a.appendChild(div);
|
|
|
|
|
|
var object = new THREE.CSS3DObject(a);
|
|
|
object.name = imgUrl.substring(imgUrl.lastIndexOf('/') + 1);
|
|
|
|
|
|
return object;
|
|
|
}
|
|
|
|
|
|
function updateStructure(geometry, offset) {
|
|
|
// get the position where we need to move elements to
|
|
|
positionAndRotation = getPositionAndRotation(geometry, offset);
|
|
|
|
|
|
// the tweein, will be used to make all the new elements
|
|
|
// slowly visible
|
|
|
var tweenIn = new TWEEN.Tween({opacity: 0})
|
|
|
.to({pos: 1.0}, 3000)
|
|
|
.easing(TWEEN.Easing.Sinusoidal.InOut)
|
|
|
.onUpdate(function () {
|
|
|
var toSet = this.pos;
|
|
|
newlyAddedElements.forEach(function (cssObject) {
|
|
|
cssObject.element.style.opacity = toSet;
|
|
|
});
|
|
|
|
|
|
var i = 0;
|
|
|
currentElements.forEach(function (cssObject) {
|
|
|
// get the elements start position and target position
|
|
|
var currentPos = positionAndRotation[i].currentPos;
|
|
|
var targetPos = positionAndRotation[i].pos;
|
|
|
|
|
|
// also get the elements start rotation and end rotations
|
|
|
var currentRotation = positionAndRotation[i].currentRotation;
|
|
|
var targetRotation = new THREE.Euler();
|
|
|
targetRotation.setFromRotationMatrix(positionAndRotation[i].rot);
|
|
|
|
|
|
// use the tween to slowly move the elements around.
|
|
|
if (currentPos) {
|
|
|
cssObject.position.x = currentPos.x + (targetPos.x - currentPos.x) * toSet;
|
|
|
cssObject.position.y = currentPos.y + (targetPos.y - currentPos.y) * toSet;
|
|
|
cssObject.position.z = currentPos.z + (targetPos.z - currentPos.z) * toSet;
|
|
|
|
|
|
cssObject.rotation.x = currentRotation.x + (targetRotation.x - currentRotation.x) * toSet;
|
|
|
cssObject.rotation.y = currentRotation.y + (targetRotation.y - currentRotation.y) * toSet;
|
|
|
cssObject.rotation.z = currentRotation.z + (targetRotation.z - currentRotation.z) * toSet;
|
|
|
}
|
|
|
i++;
|
|
|
});
|
|
|
});
|
|
|
|
|
|
tweenIn.start();
|
|
|
|
|
|
// some cleanup
|
|
|
newlyAddedElements = [];
|
|
|
toBeRemovedElements = [];
|
|
|
|
|
|
// walk through the positionAndRotation set and either move or create the elements
|
|
|
for (var i = 0; i < positionAndRotation.length; i++) {
|
|
|
|
|
|
if (currentElements.length > i) {
|
|
|
// we need to move one of the existing ones.
|
|
|
var element = currentElements[i];
|
|
|
positionAndRotation[i].currentPos = element.position.clone();
|
|
|
positionAndRotation[i].currentRotation = element.rotation.clone();
|
|
|
} else {
|
|
|
// create a new one, and set it's position of screen
|
|
|
var imgData = table[i];
|
|
|
var element = createCSS3DObject(imgData);
|
|
|
|
|
|
element.position = offscreen.clone();
|
|
|
|
|
|
positionAndRotation[i].currentPos = element.position.clone();
|
|
|
positionAndRotation[i].currentRotation = element.rotation.clone();
|
|
|
|
|
|
// set initial opacity to 0.
|
|
|
element.element.style.opacity = 0;
|
|
|
|
|
|
// add to the array to keep track of.
|
|
|
currentElements.push(element);
|
|
|
newlyAddedElements.push(element);
|
|
|
scene.add(element);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// finally remove the elements that aren't needed anymore
|
|
|
for (var i = positionAndRotation.length; i < currentElements.length; i++) {
|
|
|
toBeRemovedElements.push(currentElements[i]);
|
|
|
}
|
|
|
|
|
|
// and remove them from the scene
|
|
|
for (var i = 0; i < toBeRemovedElements.length; i++) {
|
|
|
scene.remove(currentElements.pop());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* The first thing we need when we want to map the divs to a new model, is the position and the rotation
|
|
|
* matrix that needs to be applied to move the object to its new position. To calculate this we analyze
|
|
|
* the provided geometry, and use the faces to calculate the rotation and the position. This return an
|
|
|
* array with the following elements:
|
|
|
*
|
|
|
* {
|
|
|
* pos: THREE.Vector3(),
|
|
|
* rot: THREE.Matrix4()
|
|
|
* }
|
|
|
*
|
|
|
* @param geometry
|
|
|
*/
|
|
|
function getPositionAndRotation(geometry, offset) {
|
|
|
var result = [];
|
|
|
|
|
|
for (var iFace = 0; iFace < geometry.faces.length; iFace += 2) {
|
|
|
var newPosition = new THREE.Vector3(0, 0, 0);
|
|
|
|
|
|
// get this face and the next which both make the cube
|
|
|
var face = geometry.faces[iFace];
|
|
|
var faceNext = geometry.faces[iFace + 1];
|
|
|
|
|
|
// calculate the position of where the elements need to go to.
|
|
|
var centroid = new THREE.Vector3();
|
|
|
centroid.copy(geometry.vertices[face.a])
|
|
|
.add(geometry.vertices[face.b])
|
|
|
.add(geometry.vertices[face.c])
|
|
|
.add(geometry.vertices[faceNext.a])
|
|
|
.add(geometry.vertices[faceNext.b])
|
|
|
.add(geometry.vertices[faceNext.c])
|
|
|
.divideScalar(6).multiplyScalar(offset);
|
|
|
|
|
|
newPosition = centroid.clone();
|
|
|
|
|
|
// Now we need to rotate the div to the correct position
|
|
|
var up = new THREE.Vector3(0, 0, 1);
|
|
|
|
|
|
// we get the vector from both of the triangle, and use the average
|
|
|
var normal = new THREE.Vector3();
|
|
|
normal.addVectors(face.normal, faceNext.normal);
|
|
|
normal.divideScalar(2);
|
|
|
|
|
|
// We calculate the axis on which to rotate by
|
|
|
// selecting the cross of the vectors
|
|
|
var axis = new THREE.Vector3();
|
|
|
axis.crossVectors(up, normal);
|
|
|
|
|
|
// based on the axis, in relation to our normal vector
|
|
|
// we can calculate the angle.
|
|
|
var angle = Math.atan2(axis.length(), up.dot(normal));
|
|
|
axis.normalize();
|
|
|
|
|
|
// now we can use matrix function to rotate the object so
|
|
|
// it is aligned with the normal from the face
|
|
|
var rotationToApply = new THREE.Matrix4();
|
|
|
rotationToApply.makeRotationAxis(axis, angle);
|
|
|
|
|
|
result.push({pos: newPosition, rot: rotationToApply});
|
|
|
}
|
|
|
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
function getCenter(object, face) {
|
|
|
|
|
|
console.log(face);
|
|
|
var a = object.vertices[face.a];
|
|
|
var b = object.vertices[face.b];
|
|
|
var c = object.vertices[face.c];
|
|
|
|
|
|
var added = new THREE.Vector3();
|
|
|
added.add(a);
|
|
|
added.add(b);
|
|
|
added.add(c);
|
|
|
|
|
|
console.log(added);
|
|
|
|
|
|
return added;
|
|
|
}
|
|
|
|
|
|
function addControlGui(controlObject) {
|
|
|
var gui = new dat.GUI({autoPlace: false});
|
|
|
gui.domElement.id = 'gui';
|
|
|
gui.add(controlObject, "toCube");
|
|
|
gui.add(controlObject, "toSphere");
|
|
|
gui.add(controlObject, "toCylinder");
|
|
|
gui.add(controlObject, "toPlane");
|
|
|
var gui_container = document.getElementById("gui_container");
|
|
|
gui_container.appendChild(gui.domElement);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Called when the scene needs to be rendered. Delegates to requestAnimationFrame
|
|
|
* for future renders
|
|
|
*/
|
|
|
function render() {
|
|
|
|
|
|
TWEEN.update();
|
|
|
|
|
|
// update stats
|
|
|
///stats.update();
|
|
|
|
|
|
controls.update();
|
|
|
|
|
|
// and render the scene
|
|
|
renderer.render(scene, camera);
|
|
|
|
|
|
// render using requestAnimationFrame
|
|
|
requestAnimationFrame(render);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Function handles the resize event. This make sure the camera and the renderer
|
|
|
* are updated at the correct moment.
|
|
|
*/
|
|
|
function handleResize() {
|
|
|
camera.aspect = window.innerWidth / window.innerHeight;
|
|
|
camera.updateProjectionMatrix();
|
|
|
renderer.setSize(window.innerWidth, window.innerHeight);
|
|
|
}
|
|
|
|
|
|
function handleSubmit(e) {
|
|
|
if (e.keyCode == 13) {
|
|
|
// console.log(document.getElementById("queryField").value);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
//获得指定文件夹图片名称列表,同时设置图片的位置
|
|
|
function getPics() {
|
|
|
var _data = [];
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
async: false,
|
|
|
url: "/dsideal_yy/zygh/ytj/getRandomUniversityList?page_size=" + COUNT,
|
|
|
dataType: "json",
|
|
|
success: function (data) {
|
|
|
if (data.success) {
|
|
|
$.each(data.list, function (idx, item) {
|
|
|
if (item.resource_address !== null) {
|
|
|
_data.push({
|
|
|
id: item.university_id,
|
|
|
rid: item.university_name,
|
|
|
type: "image",
|
|
|
src: '/dsideal_yy/gxytj/' + item.first_resource_address + '.thumb.webp',
|
|
|
resource: '/' + item.first_resource_address,
|
|
|
|
|
|
})
|
|
|
} else {
|
|
|
_data.push({
|
|
|
id: item.university_id,
|
|
|
rid: item.university_name,
|
|
|
type: "image",
|
|
|
src: "img/picture.svg",
|
|
|
resource: "img/picture.svg"
|
|
|
})
|
|
|
}
|
|
|
|
|
|
});
|
|
|
for (i = 0; i < 110 - _data.length; i++) {
|
|
|
_data.push({
|
|
|
id: '',
|
|
|
rid: '',
|
|
|
type: "image",
|
|
|
src: "img/picture.svg",
|
|
|
resource: "img/picture.svg"
|
|
|
})
|
|
|
}
|
|
|
|
|
|
// console.log('_data-----',_data);
|
|
|
table = _data;
|
|
|
|
|
|
init();
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
//展开
|
|
|
function unfold() {
|
|
|
$('#up').show();
|
|
|
$('#down').hide();
|
|
|
$('#description').css('max-height', 'none')
|
|
|
}
|
|
|
|
|
|
//收起
|
|
|
function packUp() {
|
|
|
$('#up').hide();
|
|
|
$('#down').show();
|
|
|
$('#description').css('max-height', '29vh')
|
|
|
}
|
|
|
|
|
|
// 登录
|
|
|
function showModal() {
|
|
|
$('.model').show()
|
|
|
}
|
|
|
function closeModal() {
|
|
|
$('.model').hide();
|
|
|
$('#personName').text('');
|
|
|
$('#password').text('')
|
|
|
}
|
|
|
function doLogin() {
|
|
|
var personName=$('#personName').val();
|
|
|
var password=$('#password').val();
|
|
|
if(personName.replace(/(^\s*)|(\s*$)/g, "")===''){//去除首尾两端空格
|
|
|
$('#tip').text('请输入用户名');
|
|
|
}else if(password.replace(/(^\s*)|(\s*$)/g, "")===''){
|
|
|
$('#tip').text('请输入密码')
|
|
|
}else {
|
|
|
$.ajax({
|
|
|
type: "POST",
|
|
|
async: false,
|
|
|
url: "/dsideal_yy/login/doLogin?login_type=" + 1+'&user='+personName+'&pwd='+password,
|
|
|
dataType: "json",
|
|
|
success: function (data) {
|
|
|
if (data.success) {
|
|
|
localStorage.setItem("login_name_local", data.login_name);
|
|
|
localStorage.setItem("login_pwd_local", password);
|
|
|
localStorage.setItem("person_id_local", data.person_id);
|
|
|
localStorage.setItem("identity_id_local", data.identity);
|
|
|
localStorage.setItem("person_name_local", data.person_name);
|
|
|
localStorage.setItem("bureau_name_local", data.bureau_name);
|
|
|
localStorage.setItem("class_id_local", data.class_id);
|
|
|
localStorage.setItem("token_local", data.token);
|
|
|
localStorage.setItem("bureau_id", data.bureau_id);
|
|
|
localStorage.setItem("class_id", data.class_id);
|
|
|
// localStorage.setItem("province_id", response.province_id);
|
|
|
// parent.getCrmInfoByPerson();
|
|
|
// parent.isCookie=$.cookie("person_id")===undefined;
|
|
|
// parent.userName=$.cookie("person_name");
|
|
|
|
|
|
$('.model').hide();
|
|
|
$('#name').text($.cookie("person_name"));
|
|
|
$('#login').hide()
|
|
|
$('#logout').show()
|
|
|
}else {
|
|
|
$('#tip').text(data.info)
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
|
|
|
function doLogout() {
|
|
|
$.ajax({
|
|
|
type: "POST",
|
|
|
async: false,
|
|
|
url: "/dsideal_yy/login/doLogout?type=" + 1,
|
|
|
dataType: "json",
|
|
|
success: function (data) {
|
|
|
if (data.success) {
|
|
|
localStorage.clear();
|
|
|
$('#login').show()
|
|
|
$('#logout').hide()
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
function okButton() {
|
|
|
$('.message').hide()
|
|
|
}
|
|
|
|
|
|
// calls the init function when the window is done loading.
|
|
|
// window.onload = getImgs;
|
|
|
// calls the handleResize function when the window is resized
|
|
|
window.addEventListener('resize', handleResize, false);
|
|
|
|
|
|
$(function () {
|
|
|
// aa()
|
|
|
getPics()
|
|
|
// getImgs();
|
|
|
// init();
|
|
|
//lazyload();
|
|
|
})
|
|
|
</script>
|
|
|
<script>
|
|
|
var category='';
|
|
|
var categoryList=[];
|
|
|
var major_name='';
|
|
|
var majorList=[];
|
|
|
var majorData=[];
|
|
|
var pageSize=8;
|
|
|
var pageNumber=1;
|
|
|
var totalPage=0;
|
|
|
var maxVisiblePages=5
|
|
|
// 监控页面点击操作
|
|
|
$(document).on('click', 'body', function () {
|
|
|
flagTimer = false; // 不执行
|
|
|
// console.log('click');
|
|
|
});
|
|
|
|
|
|
$(document).ready(function(){
|
|
|
if($.cookie("person_id")===undefined){
|
|
|
$('#login').show();
|
|
|
$('#logout').hide()
|
|
|
}else {
|
|
|
$('#name').text($.cookie("person_name"));
|
|
|
$('#login').hide()
|
|
|
$('#logout').show()
|
|
|
}
|
|
|
$('#personName').on('input', function() {
|
|
|
var personName = $(this).val();
|
|
|
console.log(personName);
|
|
|
if(personName.trim()!==''){
|
|
|
$('#tip').text('')
|
|
|
}
|
|
|
|
|
|
});
|
|
|
$('#password').on('input', function() {
|
|
|
var password = $(this).val();
|
|
|
console.log(password);
|
|
|
if(password.trim()!==''){
|
|
|
$('#tip').text('')
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
function categoryChange() {
|
|
|
console.log('qiowejuej')
|
|
|
$('#specialty_new [data-key="professional_search"]').trigger("click");
|
|
|
}
|
|
|
|
|
|
function closeSchoolDetails() {
|
|
|
$('.details').hide()
|
|
|
$('#professional_name').val('');
|
|
|
major_name='';
|
|
|
category='';
|
|
|
pageNumber=1;
|
|
|
}
|
|
|
|
|
|
function changeContent(id) {
|
|
|
console.log('id',id)
|
|
|
}
|
|
|
//校园风采轮播墙
|
|
|
function getSwiper() {
|
|
|
var swiper = document.querySelector(" .swiper");
|
|
|
var pic = swiper.querySelectorAll(".pic li");
|
|
|
var btns = swiper.querySelector(".btns");
|
|
|
var cricle = swiper.querySelector(".cricle");
|
|
|
var leftbtn = swiper.querySelector(".leftbtn");
|
|
|
var rightbtn = swiper.querySelector(".rightbtn");
|
|
|
var leftBox = swiper.querySelector(".leftBox");
|
|
|
var rightBox = swiper.querySelector(".rightBox");
|
|
|
|
|
|
//清除图片类名
|
|
|
function clearPicName() {
|
|
|
// pic.forEach(function (ele) {
|
|
|
// ele.className = "";
|
|
|
// });
|
|
|
for (var i = 0; i < pic.length; i++) {
|
|
|
pic[i].className = "";
|
|
|
}
|
|
|
}
|
|
|
function leave() {
|
|
|
btns.style.display = "none";
|
|
|
timer = setInterval(function () {
|
|
|
rightbtn.click();
|
|
|
}, 3000);
|
|
|
}
|
|
|
|
|
|
var timer = setInterval(function () {
|
|
|
rightbtn.click();
|
|
|
}, 3000);
|
|
|
swiper.addEventListener("mouseenter", function () {
|
|
|
btns.style.display = "block";
|
|
|
clearInterval(timer);
|
|
|
swiper.removeEventListener("mouseleave", leave);
|
|
|
swiper.addEventListener("mouseleave", leave);
|
|
|
});
|
|
|
//动态生成小圆点
|
|
|
var lili = "";
|
|
|
// pic.forEach(function () {
|
|
|
// lis += "<li></li>";
|
|
|
// });
|
|
|
for (var j = 0; j < pic.length; j++) {
|
|
|
lili += "<li></li>";
|
|
|
}
|
|
|
cricle.innerHTML = lili;
|
|
|
//获取动态生成的小圆点
|
|
|
var lis = cricle.querySelectorAll("li");
|
|
|
lis[0].className = "_bg";
|
|
|
//清楚小圆点类名
|
|
|
function clearCricleName() {
|
|
|
// lis.forEach(function (ele) {
|
|
|
// ele.className = "";
|
|
|
// });
|
|
|
for (var i = 0; i < lis.length; i++) {
|
|
|
lis[i].className = "";
|
|
|
}
|
|
|
}
|
|
|
var pic_index = 0;
|
|
|
//满足ie的特殊癖好
|
|
|
var lisArr = [];
|
|
|
for (var i = 0; i < lis.length; i++) {
|
|
|
lisArr.push(lis[i]);
|
|
|
}
|
|
|
|
|
|
console.log('li',lis)
|
|
|
// lis.addEventListener("click", function () {
|
|
|
// console.log('li')
|
|
|
// })
|
|
|
$('.pic').on('click', '.next', function() {
|
|
|
// 处理逻辑
|
|
|
alert('You clicked an li with the class "my-class"!');
|
|
|
});
|
|
|
|
|
|
lisArr.forEach(function (ele, i) {
|
|
|
console.log('i',i)
|
|
|
ele.addEventListener("mouseenter", function () {
|
|
|
clearCricleName();
|
|
|
ele.className = "_bg";
|
|
|
//记住索引值
|
|
|
var index = i;
|
|
|
clearPicName();
|
|
|
|
|
|
//上一张
|
|
|
i = i == 0 ? lisArr.length : i;
|
|
|
pic[i - 1].className = "prev";
|
|
|
//恢复索引
|
|
|
i = index;
|
|
|
|
|
|
//当前
|
|
|
pic[i].className = "now";
|
|
|
|
|
|
//下一张
|
|
|
i = i == lisArr.length - 1 ? -1 : i;
|
|
|
pic[i + 1].className = "next";
|
|
|
//恢复索引
|
|
|
i = index;
|
|
|
pic_index = i;
|
|
|
});
|
|
|
});
|
|
|
//左按钮
|
|
|
leftbtn.addEventListener("click", function () {
|
|
|
console.log('aaa')
|
|
|
pic_index--;
|
|
|
pic_index = pic_index < 0 ? pic.length - 1 : pic_index;
|
|
|
|
|
|
var index = pic_index;
|
|
|
clearPicName();
|
|
|
|
|
|
//上一张;
|
|
|
pic_index = pic_index == 0 ? pic.length : pic_index;
|
|
|
pic[pic_index - 1].className = "prev";
|
|
|
pic_index = index;
|
|
|
|
|
|
//当前
|
|
|
pic[pic_index].className = "now";
|
|
|
clearCricleName();
|
|
|
lis[pic_index].className = "_bg";
|
|
|
|
|
|
//下一张
|
|
|
pic_index = pic_index == pic.length - 1 ? -1 : pic_index;
|
|
|
pic[pic_index + 1].className = "next";
|
|
|
pic_index = index;
|
|
|
});
|
|
|
|
|
|
// var prev = swiper.querySelector(".prev");
|
|
|
var next = swiper.querySelector(".next");
|
|
|
// console.log('prev',prev)
|
|
|
console.log('next',next)
|
|
|
next.addEventListener("click", function (){
|
|
|
console.log('dianji')
|
|
|
});
|
|
|
rightbtn.addEventListener("click", function () {
|
|
|
console.log('aaass')
|
|
|
pic_index++;
|
|
|
pic_index = pic_index == pic.length ? 0 : pic_index;
|
|
|
var index = pic_index;
|
|
|
clearPicName();
|
|
|
//上一张
|
|
|
pic_index = pic_index == 0 ? pic.length : pic_index;
|
|
|
pic[pic_index - 1].className = "prev";
|
|
|
pic_index = index;
|
|
|
//当前
|
|
|
pic[pic_index].className = "now";
|
|
|
clearCricleName();
|
|
|
lis[pic_index].className = "_bg";
|
|
|
|
|
|
//下一张
|
|
|
pic_index = pic_index == pic.length - 1 ? -1 : pic_index;
|
|
|
pic[pic_index + 1].className = "next";
|
|
|
});
|
|
|
//点击图片轮播
|
|
|
leftBox.addEventListener("click", function () {
|
|
|
leftbtn.click();
|
|
|
});
|
|
|
rightBox.addEventListener("click", function () {
|
|
|
rightbtn.click();
|
|
|
});
|
|
|
}
|
|
|
|
|
|
function goPreviousPage() {
|
|
|
major_name='';
|
|
|
category='';
|
|
|
$('.school-menu [data-key="specialty_new"]').trigger("click");
|
|
|
$('.content2').hide();
|
|
|
$('.content1').show();
|
|
|
|
|
|
}
|
|
|
|
|
|
function makePage(total, page) {
|
|
|
var pageHtml = '';
|
|
|
//点点点的html
|
|
|
var ddd = '<div class="fy_d"></div><div class="fy_d"></div><div class="fy_d"></div>';
|
|
|
|
|
|
function createPage(index) { //单页码生成
|
|
|
if (page == index) {
|
|
|
//当前页(或选中)样式 多了个selected(换背景色字体色的)
|
|
|
pageHtml += '<div class="fy_y selected" data-key="page">' + page + '</div>';
|
|
|
} else {
|
|
|
pageHtml += '<div class="fy_y" onclick="pageClick(this)">' + index + '</div>';
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (total <= maxVisiblePages) { //总页数小于10
|
|
|
for (var i = 1; i <= total; i++) {
|
|
|
//正常生成排列
|
|
|
createPage(i);
|
|
|
}
|
|
|
} else {
|
|
|
if (page <= 4) { //总页数大于10且当前页远离总页数(小于4)
|
|
|
for (var i = 1; i <= 4 + 1; i++) { //显示1-5
|
|
|
createPage(i);
|
|
|
}
|
|
|
//三个点...
|
|
|
pageHtml += ddd;
|
|
|
//三个点后面 生成最后一个页数
|
|
|
createPage(total);
|
|
|
|
|
|
} else if (page > total - 4) { //总页数大于10且当前页接近总页数(大于总页数-4)
|
|
|
//第一页
|
|
|
createPage(1);
|
|
|
//三个点...
|
|
|
pageHtml += ddd;
|
|
|
//生成最后5个页数
|
|
|
for (var i = total - 4; i <= total; i++) {
|
|
|
createPage(i);
|
|
|
}
|
|
|
} else { //除开上面两个情况 当前页在中间
|
|
|
//页数1
|
|
|
createPage(1);
|
|
|
//三个点...
|
|
|
pageHtml += ddd;
|
|
|
//生成当前页和 前跟后一个页数
|
|
|
for (var i = page - 1; i <= page + 1; i++) {
|
|
|
createPage(i);
|
|
|
}
|
|
|
//三个点...
|
|
|
pageHtml += ddd;
|
|
|
//最后一个页数
|
|
|
createPage(total);
|
|
|
}
|
|
|
}
|
|
|
//赋值生成html
|
|
|
$('.rb_bottom').html(pageHtml);
|
|
|
}
|
|
|
|
|
|
function pageClick(that) {
|
|
|
var page = $(that).html();
|
|
|
// makePage(totalPage, page * 1);
|
|
|
pageNumber=page;
|
|
|
$('#specialty_new [data-key="page"]').trigger("click");
|
|
|
}
|
|
|
|
|
|
|
|
|
var COUNT = 110; // 初始化图片数量
|
|
|
layui.use(['jquery', 'laytpl', 'carousel', 'form'], function () {
|
|
|
// 由于layer弹层依赖jQuery,所以可以直接得到
|
|
|
var $ = layui.$, layer = layui.layer;
|
|
|
var laytpl = layui.laytpl;
|
|
|
var carousel = layui.carousel, form = layui.form;
|
|
|
$('#btn_search').click(function () {
|
|
|
if($.cookie('person_id')!==undefined){
|
|
|
var target = $(this);
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
async: false,
|
|
|
url: "/dsideal_yy/base/crm/getCrmInfoByPerson",
|
|
|
data: {
|
|
|
"person_id":$.cookie('person_id'),
|
|
|
"identity_id": $.cookie('identity_id'),
|
|
|
"user_type": 5,
|
|
|
"code": 'gxlbytj',
|
|
|
"plat": 1
|
|
|
},
|
|
|
dataType: "json",
|
|
|
success: function (res) {
|
|
|
if (res.success) {
|
|
|
layer.closeAll(); // 关闭所有层
|
|
|
if (target.data('state') === 'closed') {
|
|
|
// 页面层-自定义
|
|
|
layer.open({
|
|
|
type: 1,
|
|
|
title: false,
|
|
|
closeBtn: 0,
|
|
|
shadeClose: false,
|
|
|
skin: 'searchSkin',
|
|
|
shade: 0.7,
|
|
|
content: $('#search_tpl').html(),
|
|
|
success: function (layerObj, index) {
|
|
|
layer.style(index, {
|
|
|
top: '33%'
|
|
|
});
|
|
|
//console.log('autoComplete', $('#keyword').attr('placeholder'));
|
|
|
$('#keyword').autoComplete({
|
|
|
minChars: 1,
|
|
|
source: function (term, suggest) {
|
|
|
//try { xhr.abort(); } catch(e){}
|
|
|
xhr = $.ajax({
|
|
|
type: "GET",
|
|
|
async: false,
|
|
|
url: "/dsideal_yy/zygh/university/getAllUniversityList?university_name=" + term,
|
|
|
dataType: "json",
|
|
|
success: function (data) {
|
|
|
var suggestions = [];
|
|
|
$.each(data.university_list, function (idx, item) {
|
|
|
suggestions.push(item.university_name);
|
|
|
});
|
|
|
//console.log('suggestions', suggestions);
|
|
|
suggest(suggestions);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
|
|
|
//console.log(layerObj, index);
|
|
|
$('#btn_search img').attr('src', 'img/close_black.svg')
|
|
|
}
|
|
|
});
|
|
|
target.data('state', 'open');
|
|
|
} else {
|
|
|
layer.close(layer.index); // 它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
|
|
$('#btn_search img').attr('src', 'img/search_black.svg'); //
|
|
|
target.data('state', 'closed');
|
|
|
}
|
|
|
}else {
|
|
|
$('.info').text('对不起,您没有访问权限!');
|
|
|
$('.message').show();
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
|
|
|
}else {
|
|
|
$('.model').show()
|
|
|
}
|
|
|
|
|
|
|
|
|
});
|
|
|
$("body").on("click", "#professional_search", function (event) {
|
|
|
|
|
|
category=$('#professional_category option:selected').val();
|
|
|
major_name=$('#professional_name').val();
|
|
|
pageNumber=1;
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
async: false,
|
|
|
url: "/dsideal_yy/zygh/ytj/getUniversityMajorList?university_id=" + university_id+'&major_name='+major_name+'&professional_category_id='+category+'&page_number='+pageNumber+"&page_size="+pageSize,
|
|
|
dataType: "json",
|
|
|
success: function (data) {
|
|
|
if (data.success) {
|
|
|
totalPage=data.totalPage;
|
|
|
majorData.majorList=data.table_List;
|
|
|
majorData.major_name=major_name;
|
|
|
majorData.category=category;
|
|
|
// majorData.categoryList=categoryList;
|
|
|
console.log('majorData',majorData)
|
|
|
laytpl($('#specialty_tpl').html()).render(majorData, function (html) {
|
|
|
$('.school-content').html(html);
|
|
|
$('.school-content').scrollTop(0); // 重置滚动
|
|
|
});
|
|
|
makePage(totalPage,parseInt(pageNumber))
|
|
|
$("#professional_category").val(category)
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
$("body").on("click", "#professional_refresh", function (event) {
|
|
|
|
|
|
category='';
|
|
|
major_name='';
|
|
|
pageNumber=1;
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
async: false,
|
|
|
url: "/dsideal_yy/zygh/ytj/getUniversityMajorList?university_id=" + university_id+'&major_name='+major_name+'&professional_category_id='+category+'&page_number='+pageNumber+"&page_size="+pageSize,
|
|
|
dataType: "json",
|
|
|
success: function (data) {
|
|
|
if (data.success) {
|
|
|
totalPage=data.totalPage;
|
|
|
majorData.majorList=data.table_List;
|
|
|
majorData.major_name=major_name;
|
|
|
majorData.category=category;
|
|
|
// majorData.categoryList=categoryList;
|
|
|
laytpl($('#specialty_tpl').html()).render(majorData, function (html) {
|
|
|
$('.school-content').html(html);
|
|
|
$('.school-content').scrollTop(0); // 重置滚动
|
|
|
});
|
|
|
makePage(totalPage,parseInt(pageNumber))
|
|
|
$("#professional_category").val(category)
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
$("body").on("click", ".fy_y", function (event) {
|
|
|
console.log(22)
|
|
|
category=$('#professional_category option:selected').val();
|
|
|
major_name=$('#professional_name').val();
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
async: false,
|
|
|
url: "/dsideal_yy/zygh/ytj/getUniversityMajorList?university_id=" + university_id+'&major_name='+major_name+'&professional_category_id='+category+'&page_number='+pageNumber+"&page_size="+pageSize,
|
|
|
dataType: "json",
|
|
|
success: function (data) {
|
|
|
if (data.success) {
|
|
|
totalPage=data.totalPage;
|
|
|
majorData.majorList=data.table_List;
|
|
|
majorData.major_name=major_name;
|
|
|
majorData.category=category;
|
|
|
laytpl($('#specialty_tpl').html()).render(majorData, function (html) {
|
|
|
$('.school-content').html(html);
|
|
|
$('.school-content').scrollTop(0); // 重置滚动
|
|
|
});
|
|
|
makePage(totalPage,parseInt(pageNumber))
|
|
|
$("#professional_category").val(category)
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
$("body").on('click', '.major-box', function(){
|
|
|
var id = $(this).data('id'); // 获取当前点击项的id
|
|
|
console.log('Selected item ID:', id); // 在控制台输出id
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
async: false,
|
|
|
url: "/dsideal_yy/zygh/major/getMajorInfoByMajorId?major_id=" + id,
|
|
|
dataType: "json",
|
|
|
success: function (data) {
|
|
|
if (data.success) {
|
|
|
|
|
|
majorData.majorDetails=data;
|
|
|
|
|
|
console.log('majorData',majorData)
|
|
|
laytpl($('#specialty_tpl').html()).render(majorData, function (html) {
|
|
|
$('.school-content').html(html);
|
|
|
$('.school-content').scrollTop(0); // 重置滚动
|
|
|
});
|
|
|
$('.content1').hide();
|
|
|
$('.content2').show();
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
|
|
|
// 搜索点击事件委托
|
|
|
$("body").on("click", "#btn_search_form", function (event) {
|
|
|
var keyword = $('#keyword').val();
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
async: false,
|
|
|
url: "/dsideal_yy/zygh/university/getAllUniversityList?university_name=" + keyword,
|
|
|
dataType: "json",
|
|
|
success: function (data) {
|
|
|
if (data.university_list.length === 0) {
|
|
|
layer.tips('未能检索到相关内容', '#keyword', {tips: 3});
|
|
|
} else {
|
|
|
var school = [];
|
|
|
for (var i = 0; i < data.university_list.length; i++) {
|
|
|
if (data.university_list[i].university_name.toString() === keyword.toString()) {
|
|
|
school.push(data.university_list[i]);
|
|
|
university_id=data.university_list[i].university_id
|
|
|
}
|
|
|
}
|
|
|
if (school.length === 0) {
|
|
|
// alert(2)
|
|
|
// layer.tips('未能检索到相关内容', '#keyword', {tips: 3});
|
|
|
|
|
|
} else {
|
|
|
var target = keyword;
|
|
|
var id = university_id;
|
|
|
var name = keyword;
|
|
|
$('body').data('id', id);
|
|
|
$('body').data('rid', id);
|
|
|
$('body').data('name', name);
|
|
|
// 页面层-自定义
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
async: false,
|
|
|
url: "/dsideal_yy/zygh/university/getUniversityInfoById?university_id=" + university_id,
|
|
|
dataType: "json",
|
|
|
success: function (data) {
|
|
|
if (data.success) {
|
|
|
$('#keyword').blur();
|
|
|
layer.closeAll();
|
|
|
// layer.close(layer.index); // 它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
|
|
$('#btn_search img').attr('src', 'img/search_black.svg');
|
|
|
console.log('keyword')
|
|
|
$('.school-menu [data-key="intro_new"]').trigger("click");
|
|
|
$('.details-name').html(data.university_name);
|
|
|
$('.school-logo').attr("src","https://video.edusoa.com/static/images/schoollogo/"+data.logo);
|
|
|
$('.details').show()
|
|
|
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
|
|
|
$("body").on("submit", ".search-form", function (event) {
|
|
|
$("#btn_search_form").trigger("click");
|
|
|
event.preventDefault();
|
|
|
});
|
|
|
|
|
|
// 照片墙点击事件委托
|
|
|
$("body").on("click", ".pper-item", function (event) {
|
|
|
// 从DOM标签获取属性值
|
|
|
if($.cookie('person_id')!==undefined){
|
|
|
var target = $(this);
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
async: false,
|
|
|
url: "/dsideal_yy/base/crm/getCrmInfoByPerson",
|
|
|
data: {
|
|
|
"person_id":$.cookie('person_id'),
|
|
|
"identity_id": $.cookie('identity_id'),
|
|
|
"user_type": 5,
|
|
|
"code": 'gxlbytj',
|
|
|
"plat": 1
|
|
|
},
|
|
|
dataType: "json",
|
|
|
success: function (res) {
|
|
|
if (res.success) {
|
|
|
|
|
|
var id = target.data('id'); // 学校Id
|
|
|
// var name = target.data('name'); // 学校Name
|
|
|
var rid = target.data('rid'); // 资源Id
|
|
|
|
|
|
$('body').data('id', id); // 院校Id
|
|
|
// $('body').data('name', name); // 注:现改用id判断
|
|
|
$('body').data('rid', rid); // 资源Id
|
|
|
if (table.length !== 0) {
|
|
|
table.forEach((item) => {
|
|
|
if (rid === item.rid) {
|
|
|
university_id = item.id
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
console.log('university_id',university_id);
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
async: false,
|
|
|
url: "/dsideal_yy/zygh/university/getUniversityInfoById?university_id=" + university_id,
|
|
|
dataType: "json",
|
|
|
success: function (data) {
|
|
|
if (data.success) {
|
|
|
$('.school-menu [data-key="intro_new"]').trigger("click");
|
|
|
$('.details-name').html(data.university_name);
|
|
|
$('.school-logo').attr("src","https://video.edusoa.com/static/images/schoollogo/"+data.logo);
|
|
|
$('.details').show()
|
|
|
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
$('.info').text('对不起,您没有访问权限!');
|
|
|
$('.message').show();
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
$('.model').show()
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
// 校园风采轮播图片点击事件委托
|
|
|
$("body").on("click", ".pic-item img", function (event) {
|
|
|
//console.log('pic:', $(event.target).parent('.pic-item').html());
|
|
|
layer.open({
|
|
|
type: 1,
|
|
|
title: false,
|
|
|
closeBtn: 0,
|
|
|
area: 'auto',
|
|
|
shade: 0.9,
|
|
|
skin: 'layui-layer-nobg', //没有背景色
|
|
|
shadeClose: true,
|
|
|
content: $(event.target).parent('.pic-item').html(),
|
|
|
success: function (layerObj, index) {
|
|
|
$(layerObj).click(function () {
|
|
|
layer.close(index);
|
|
|
})
|
|
|
// 适配窗口大小
|
|
|
console.log('layui-layer-nobg::', $(layerObj).width);
|
|
|
$(window).height()
|
|
|
console.log(layerObj);
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
|
|
|
// 菜单点击
|
|
|
$("body").on("click", ".school-menu li div", function (event) {
|
|
|
$('li .menu-active').removeClass('menu-active');
|
|
|
$('li .menu-active').removeClass('menu-active');
|
|
|
var target = $(event.target).prop("tagName") === 'IMG' ? $(event.target).parent('li') : $(event.target);
|
|
|
target.addClass('menu-active');
|
|
|
var id = $('body').data('id');
|
|
|
// var name = $('body').data('name');
|
|
|
var rid = $('body').data('rid'); // 资源Id
|
|
|
if (table.length !== 0) {
|
|
|
table.forEach((item) => {
|
|
|
if (rid === item.rid) {
|
|
|
university_id = item.id
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
major_name='';
|
|
|
category='';
|
|
|
pageNumber=1;
|
|
|
// console.log('1q12',target.data('key'))
|
|
|
/**
|
|
|
* 学部 / 学院 / 专业
|
|
|
* 采用key方式保存层级关系
|
|
|
*/
|
|
|
var departments = []; // 学部
|
|
|
var colleges = []; // 学院
|
|
|
var majors = []; // 专业
|
|
|
// console.log('dianzhegl',target.data('key'))
|
|
|
switch (target.data('key')) {
|
|
|
|
|
|
case 'intro_new':
|
|
|
// 校园风采
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
async: false,
|
|
|
url: "/dsideal_yy/zygh/ytj/getResourceListNew?university_id=" + university_id,
|
|
|
dataType: "json",
|
|
|
success: function (data) {
|
|
|
if (data.success) {
|
|
|
if (data.list.length === 0) {
|
|
|
|
|
|
|
|
|
$('.school-content').html('<div style="text-align: center;padding-top: 10rem;font-size: 20px;color:#55DAFA;">暂无数据</div>');
|
|
|
}else {
|
|
|
console.log('data',data)
|
|
|
laytpl($('#intro_tpl').html()).render(data, function (html) {
|
|
|
$('.school-content').html(html);
|
|
|
$('.school-content').scrollTop(0); // 重置滚动
|
|
|
});
|
|
|
if(data.list.length!==1){
|
|
|
getSwiper();
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
//
|
|
|
break;
|
|
|
case 'summary_new':
|
|
|
// 学校概况
|
|
|
/**
|
|
|
* 分类(固定), 全为必填项,如果有一项为空则不显示?
|
|
|
* ---------------------------------------
|
|
|
* Key: | 院校所属 | 院校类型 | 办学类型 | 学历类别
|
|
|
* ---------------------------------------
|
|
|
* Val: | 北京 | 综合类 | 公办院校 | 本科
|
|
|
* ---------------------------------------
|
|
|
* */
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
async: false,
|
|
|
url: "/dsideal_yy/zygh/university/getUniversitySpecialMajor?university_id=" + university_id,
|
|
|
dataType: "json",
|
|
|
success: function (res) {
|
|
|
if (res.success) {
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
async: false,
|
|
|
url: "/dsideal_yy/zygh/university/getUniversityLeadingSubject?university_id=" + university_id + '&round=1',
|
|
|
dataType: "json",
|
|
|
success: function (response) {
|
|
|
if (response.success) {
|
|
|
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
async: false,
|
|
|
url: "/dsideal_yy/zygh/university/getUniversityInfoById?university_id=" + university_id,
|
|
|
dataType: "json",
|
|
|
success: function (data) {
|
|
|
if (data.success) {
|
|
|
let arr = [];
|
|
|
if (data.label_list.length !== 0) {
|
|
|
data.label_list.forEach((i) => {
|
|
|
switch (i.detail) {
|
|
|
case '985':
|
|
|
return arr.push({
|
|
|
name: i.detail,
|
|
|
color: 'a'
|
|
|
});
|
|
|
case '211':
|
|
|
return arr.push({
|
|
|
name: i.detail,
|
|
|
color: 'b'
|
|
|
});
|
|
|
case 'C9':
|
|
|
return arr.push({
|
|
|
name: i.detail,
|
|
|
color: 'c'
|
|
|
});
|
|
|
case '强基计划':
|
|
|
return arr.push({
|
|
|
name: i.detail,
|
|
|
color: 'd'
|
|
|
});
|
|
|
case '双一流':
|
|
|
return arr.push({
|
|
|
name: i.detail,
|
|
|
color: 'e'
|
|
|
});
|
|
|
case '教育部直属':
|
|
|
return arr.push({
|
|
|
name: i.detail,
|
|
|
color: 'f'
|
|
|
});
|
|
|
case '研究生院':
|
|
|
return arr.push({
|
|
|
name: i.detail,
|
|
|
color: 'g'
|
|
|
});
|
|
|
case '示范性高职':
|
|
|
return arr.push({
|
|
|
name: i.detail,
|
|
|
color: 'h'
|
|
|
});
|
|
|
case '骨干高职':
|
|
|
return arr.push({
|
|
|
name: i.detail,
|
|
|
color: 'i'
|
|
|
});
|
|
|
case '双高计划':
|
|
|
return arr.push({
|
|
|
name: i.detail,
|
|
|
color: 'j'
|
|
|
});
|
|
|
|
|
|
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
data.tags = arr;
|
|
|
var text = '';
|
|
|
if (data.province_name !== null) {
|
|
|
text += data.province_name + ' / '
|
|
|
}
|
|
|
if (data.university_classification_name !== null) {
|
|
|
text += data.university_classification_name + ' / '
|
|
|
}
|
|
|
if (data.university_property_name !== null) {
|
|
|
text += data.university_property_name + ' / '
|
|
|
}
|
|
|
if (data.university_type_name !== null) {
|
|
|
text += data.university_type_name
|
|
|
}
|
|
|
data.text = text;
|
|
|
data.topMajors = response.subjects;
|
|
|
let sub = '';
|
|
|
if (res.list.length !== 0) {
|
|
|
res.list.forEach((i, index) => {
|
|
|
if (index === res.list.length - 1) {
|
|
|
return sub += i.major_name
|
|
|
} else {
|
|
|
return sub += i.major_name + '、'
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
data.featureMajors = sub;
|
|
|
console.log('university_name')
|
|
|
laytpl($('#summary_tpl').html()).render(data, function (html) {
|
|
|
$('.school-content').html(html);
|
|
|
$('.school-content').scrollTop(0); // 重置滚动
|
|
|
});
|
|
|
if (sub === '') {
|
|
|
$('#featureMajors').hide()
|
|
|
} else {
|
|
|
$('#featureMajors').show()
|
|
|
}
|
|
|
if (response.subjects === null) {
|
|
|
$('#topMajors').hide()
|
|
|
} else {
|
|
|
$('#topMajors').show()
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
break;
|
|
|
case 'specialty_new':
|
|
|
// 院系专业
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
async: false,
|
|
|
url: "/dsideal_yy/zygh/ytj/getUniversityProfessionalCategory?university_id=" + university_id,
|
|
|
dataType: "json",
|
|
|
success: function (res) {
|
|
|
if (res.success) {
|
|
|
var arr=[{professional_category_id:'',professional_category:'全部类别'}];
|
|
|
categoryList=arr.concat(res.list)
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
async: false,
|
|
|
url: "/dsideal_yy/zygh/ytj/getUniversityMajorList?university_id=" + university_id+'&major_name='+major_name+'&professional_category_id='+category+'&page_number='+pageNumber+"&page_size="+pageSize,
|
|
|
dataType: "json",
|
|
|
success: function (data) {
|
|
|
if (data.success) {
|
|
|
totalPage=data.totalPage;
|
|
|
majorData.majorList=data.table_List;
|
|
|
majorData.categoryList=categoryList;
|
|
|
majorData.category=category;
|
|
|
majorData.major_name=major_name;
|
|
|
console.log('majorData',majorData)
|
|
|
laytpl($('#specialty_tpl').html()).render(majorData, function (html) {
|
|
|
$('.school-content').html(html);
|
|
|
$('.school-content').scrollTop(0); // 重置滚动
|
|
|
});
|
|
|
makePage(totalPage,pageNumber)
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
break;
|
|
|
default:
|
|
|
// 默认
|
|
|
}
|
|
|
|
|
|
})
|
|
|
});
|
|
|
</script>
|
|
|
</body>
|
|
|
|
|
|
|
|
|
<!-- 搜索模板 -->
|
|
|
<script id="search_tpl" type="text/html">
|
|
|
<form class="search-form" action="">
|
|
|
<input type="text" id="keyword" name="keyword" required lay-verify="required" placeholder="输入学校名称"
|
|
|
autocomplete="off" class="search-form-keyword">
|
|
|
<a id="btn_search_form">
|
|
|
<img src='img/search_black.svg' class="inverted">
|
|
|
</a>
|
|
|
</form>
|
|
|
</script>
|
|
|
|
|
|
|
|
|
<!-- 校园风采模板 -->
|
|
|
<script id="intro_tpl" type="text/html">
|
|
|
<div id="intro_new" style="height:100%">
|
|
|
{{# if(d.list.length==1){ }}
|
|
|
<div class="swiper">
|
|
|
<ul class="pic">
|
|
|
<li class="now"><a href="#"><img src="/dsideal_yy/gxytj/{{ d.list[0].resource_address }}"
|
|
|
onerror="this.src='img/picture.svg'" alt="" /></a></li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
{{# }else{ }}
|
|
|
<div class="swiper">
|
|
|
<ul class="pic">
|
|
|
<li class="now"><a href="#"><img src="/dsideal_yy/gxytj/{{ d.list[0].resource_address }}"
|
|
|
onerror="this.src='img/picture.svg'" alt="" /></a></li>
|
|
|
<li class="next"><a href="#"><img src="/dsideal_yy/gxytj/{{ d.list[1].resource_address }}"
|
|
|
onerror="this.src='img/picture.svg'" alt="" /></a></li>
|
|
|
{{# layui.each(d.list.slice(2), function(index, item){ }}
|
|
|
<li><a href="#"><img src="/dsideal_yy/gxytj/{{ item.resource_address }}"
|
|
|
onerror="this.src='img/picture.svg'" alt="" /></a></li>
|
|
|
{{# }); }}
|
|
|
|
|
|
</ul>
|
|
|
<ol class="cricle" style="display: none"></ol>
|
|
|
<div class="btns">
|
|
|
<a href="javascript:;" class="leftbtn" style="float: left; margin-left: 6px;"></a>
|
|
|
<a href="javascript:;" class="rightbtn" style="float: right; margin-right: 6px;"></a>
|
|
|
</div>
|
|
|
<div class="leftBox"></div>
|
|
|
<div class="rightBox"></div>
|
|
|
</div>
|
|
|
{{# } }}
|
|
|
|
|
|
|
|
|
</div>
|
|
|
</script>
|
|
|
|
|
|
<!-- 学校概况模板 -->
|
|
|
<script id="summary_tpl" type="text/html">
|
|
|
<div id="summary_new" >
|
|
|
<div style="display: flex;justify-content: space-between;align-items: center">
|
|
|
<div>
|
|
|
{{# layui.each(d.label_list, function(index, item){ }}
|
|
|
<div class="tags">{{item.detail}}</div>
|
|
|
{{# }); }}
|
|
|
</div>
|
|
|
<div><strong>{{d.text}}</strong></div>
|
|
|
</div>
|
|
|
<h4>基本信息</h4>
|
|
|
<div style="display: flex;line-height: 30px">
|
|
|
<div style="width: 30%">创建时间:{{d.set_up_time}}</div>
|
|
|
<div style="width: 70%">主管部门:{{d.university_affiliated}}</div>
|
|
|
</div>
|
|
|
<div style="display: flex;line-height: 30px">
|
|
|
<div style="width: 30%">招生电话:{{d.university_tel}}</div>
|
|
|
<div style="width: 70%">学校地址:{{d.address}}</div>
|
|
|
</div>
|
|
|
<h4>院校介绍</h4>
|
|
|
<div style="position:relative;">
|
|
|
{{# if(d.university_desc){ }}
|
|
|
<div id="description" style="max-height: 29vh;overflow:hidden;line-height: 30px">{{ d.university_desc.replace('\n','<br>')
|
|
|
}}
|
|
|
</div>
|
|
|
|
|
|
<div id="down" onclick="unfold()"
|
|
|
style="cursor:pointer;line-height: 2rem;text-align: center;color: #fff">展开 <img
|
|
|
src="img/down-white.png" style="width: 20px"/></div>
|
|
|
<div id="up" onclick="packUp()"
|
|
|
style="display:none;cursor:pointer;line-height: 2rem;text-align: center;color: #fff">收起 <img
|
|
|
src="img/up-white.png" style="width: 20px"/></div>
|
|
|
{{# }else{ }}
|
|
|
<div style="text-align: center;padding-top: 10rem;font-size: 20px;color:#55DAFA;">暂无数据</div>
|
|
|
|
|
|
|
|
|
{{# } }}
|
|
|
</div>
|
|
|
<div class="intro card" id="featureMajors">
|
|
|
<h4>特色专业</h4>
|
|
|
<div >
|
|
|
{{d.featureMajors}}
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="intro card" id="topMajors">
|
|
|
<h4>一流学科</h4>
|
|
|
<div >
|
|
|
{{d.topMajors}}
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</script>
|
|
|
|
|
|
<!-- 院系专业模板 -->
|
|
|
<script id="specialty_tpl" type="text/html">
|
|
|
<div id="specialty_new">
|
|
|
<div class="content1">
|
|
|
<div class="specialty-header">
|
|
|
<select id="professional_category" onchange="categoryChange()" >
|
|
|
{{# layui.each(d.categoryList, function(index, item){ }}
|
|
|
<option value="{{item.professional_category_id}}">{{item.professional_category}}</option>
|
|
|
{{# }); }}
|
|
|
</select>
|
|
|
<input id="professional_name" value="{{d.major_name}}" onkeyup="this.value=this.value.replace(/[, ]/g,'')"
|
|
|
autocomplete="off" placeholder="请输入专业名称"/>
|
|
|
<img src="img/search.png" data-key="professional_search" id="professional_search" style="width:25px;cursor: pointer"/>
|
|
|
<img src="img/refresh.png" data-key="professional_refresh" id="professional_refresh" style="width:25px;cursor: pointer;margin-left: 1rem"/>
|
|
|
</div>
|
|
|
<div class="specialty-body">
|
|
|
{{# if(d.majorList.length!==0){ }}
|
|
|
{{# layui.each(d.majorList, function(index, item){ }}
|
|
|
<div class="major-box" data-id="{{item.major_id}}">
|
|
|
<div class="major-name" title="{{item.major_name}}"><strong>{{item.major_name}}</strong></div>
|
|
|
<div class="major-item"><img style="width: 2.3vh;margin-right: 1.5vh" src="img/major_hat.png" />{{item.major_type_name}} - {{item.years}}</div>
|
|
|
<div class="major-item"><img style="width: 2.1vh;margin-right: 1.5vh" src="img/book.png" />{{item.professional_category}}</div>
|
|
|
</div>
|
|
|
{{# }); }}
|
|
|
{{# }else{ }}
|
|
|
<div class="none">暂无数据</div>
|
|
|
|
|
|
|
|
|
{{# } }}
|
|
|
</div>
|
|
|
<div class="specialty-footer" >
|
|
|
<div class="rb_bottom">
|
|
|
<div class="fy_y selected">1</div>
|
|
|
<div class="fy_y">2</div>
|
|
|
<div class="fy_y">3</div>
|
|
|
<div class="fy_y">4</div>
|
|
|
<div class="fy_y">5</div>
|
|
|
<div class="fy_d"></div>
|
|
|
<div class="fy_d"></div>
|
|
|
<div class="fy_d"></div>
|
|
|
<div class="fy_y">10</div>
|
|
|
<div class="previous">上一页</div>
|
|
|
<div class="nextPage">下一页</div>
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="content2" style="display: none">
|
|
|
<div onclick="goPreviousPage()" style="display: flex;justify-content: flex-end;color: #fff;cursor: pointer">
|
|
|
<img src="img/back.png" style="width: 1.2rem;margin-right: 1vh">
|
|
|
<span>返回</span>
|
|
|
</div>
|
|
|
{{# if(d.majorDetails){ }}
|
|
|
<div style="font-size: 3vh"><strong>{{d.majorDetails.major_name}}</strong></div>
|
|
|
<div style="display: flex;margin-top: 3vh">
|
|
|
<div class="border-style">{{d.majorDetails.major_type_name}}</div>
|
|
|
<div class="border-style">{{d.majorDetails.years}}</div>
|
|
|
<div class="border-style">{{d.majorDetails.degree}}</div>
|
|
|
</div>
|
|
|
<h4 >专业介绍</h4>
|
|
|
<div>{{d.majorDetails.description===''?'--':d.majorDetails.description}}</div>
|
|
|
<h4>开设课程</h4>
|
|
|
<div>{{d.majorDetails.courses!==undefined?d.majorDetails.courses:'--'}}</div>
|
|
|
<h4>就业方向</h4>
|
|
|
<div>{{d.majorDetails.employment_direction!==undefined?d.majorDetails.employment_direction:'--'}}</div>
|
|
|
{{# } }}
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
</script>
|
|
|
</html> |