You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1468 lines
64 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>高校信息综合查询 Ver 1.0.210926</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 rel="stylesheet" href="./lib/jquery-auto-complete/jquery.auto-complete.css"/>
<!--<link rel="stylesheet" href="./lib/pper/css/lightbox.min.css" />-->
<link rel="stylesheet" href="./lib/pper/css/wall2.css"/>
<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">
#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;
}
</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">版权所有:东北师大理想软件股份有限公司 &nbsp&nbsp&nbsp 技术服务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>
<!--<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内无操作无操作可执行 false20s内有操作不执行
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 = '';
// 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', '10rem')
}
// 登录
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>
// 监控页面点击操作
$(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('')
}
});
});
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", "#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);
// 页面层-自定义
layer.open({
type: 1,
title: false,
closeBtn: 1,
shadeClose: false,
skin: 'modalSkin',
shade: 0.7,
content: $('#modal_tpl').html(),
success: function (layerObj, index) {
console.log('ddddd',$('body').data('rid'))
$('#keyword').blur(); // 搜索框设置失去焦点
console.log('modalSkin', $(layerObj).find('.modal-menu [data-key="intro"]').html());
// 自动触发"学校概况"展示
$('.modal-menu [data-key="summary"] img').trigger("click");
}
});
}
}
}
});
});
$("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
console.log('id::', id);
console.log('rid::', rid);
// 页面层-自定义
layer.open({
type: 1,
title: false,
closeBtn: 1,
shadeClose: false,
skin: 'modalSkin',
content: $('#modal_tpl').html(),
end: function () {
//console.log('end...');
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(); // 圆柱体
}
//console.log('effect', effect);
},
success: function (layerObj, index) {
//console.log('modalSkin', $(layerObj).find('.modal-menu [data-key="intro"]').html());
// 自动触发"校园风采"展示
$('.modal-menu [data-key="intro"] img').trigger("click");
}
});
}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", ".modal-menu dt", function (event) {
$('dt.active').removeClass('active');
var target = $(event.target).prop("tagName") === 'IMG' ? $(event.target).parent('dt') : $(event.target);
target.addClass('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
}
})
}
/**
* 学部 / 学院 / 专业
* 采用key方式保存层级关系
*/
var departments = []; // 学部
var colleges = []; // 学院
var majors = []; // 专业
// console.log('dianzhegl',target.data('key'))
switch (target.data('key')) {
case 'intro':
// 校园风采
$.ajax({
type: "GET",
async: false,
url: "/dsideal_yy/zygh/ytj/getResourceList?university_id=" + university_id,
dataType: "json",
success: function (data) {
if (data.success) {
console.log('dddddd')
if (data.list.length === 0) {
$('.modal-content').html('<div class="none"></div><span class="text">数据更新中,请下次再来了...</span>');
} else if (data.list.length > 0) {
laytpl($('#intro_tpl').html()).render(data, function (html) {
$('.modal-content').html(html);
$('.modal-content').scrollTop(0); // 重置滚动
});
console.log('rid', rid);
// 获取索引
var idx = data.list.findIndex(function (item) {
//console.log('item', item);
return String(item.resource_title) === String(rid);
}) || 0;
//console.log('idx', idx);
// 轮播
carousel.render({
elem: '#intro-carousel',
width: '100%',
height: $('#intro').height(),
arrow: 'always',
autoplay: false, // 自动播放
indicator: 'none', // 指示器位置可选值为inside容器内部| outside容器外部| none不显示
index: idx,
});
// $('.pic-item > img').css('min-width','110%'); // 设置宽度100%
}
}
}
});
//
break;
case 'summary':
// 学校概况
/**
* 分类(固定), 全为必填项,如果有一项为空则不显示?
* ---------------------------------------
* 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;
laytpl($('#summary_tpl').html()).render(data, function (html) {
$('.modal-content').html(html);
$('.modal-content').scrollTop(0); // 重置滚动
});
if (sub === '') {
$('#featureMajors').hide()
} else {
$('#featureMajors').show()
}
if (response.subjects === null) {
$('#topMajors').hide()
} else {
$('#topMajors').show()
}
}
}
});
}
}
});
}
}
});
break;
case 'specialty':
// 院系专业
$.ajax({
type: "GET",
async: false,
// url: "/dsideal_yy/zygh/ytj/getMajorList?university_name=" + rid,
url: "/dsideal_yy/zygh/ytj/getUniversityDepartmentMajors?university_id=" + university_id,
dataType: "json",
success: function (data) {
if (data.success) {
if (data.list.length === 0) { // 学校名称必填否则不显示
$('.modal-content').html('<div class="none"></div><span class="text">数据更新中,请下次再来了...</span>');
} else {
// var departments = [];
// var colleges = [];
// var majors = [];
// var history_keys = []; // 历史键HASH防重复
// var key;
// var list = []
// for (var i = 0; i < data.list.length; i++) {
// for (var l = 0; l < data.list[i].list.length; l++) {
// for (var a = 0; a < data.list[i].list[l].list.length; a++) {
// list.push({
// major: data.list[i].list[l].list[a].major,
// faculty: data.list[i].list[l].faculty,
// department: data.list[i].department
// })
// }
// }
// }
// console.log('lisy===', list);
// $.each(list, function (idx, val) {
// // 学部
// k = hex_md5(val.department);
// if (history_keys.indexOf(k) === -1) {
// departments.push({key: k, name: val.department});
// history_keys.push(k); // 追加历史记录
// }
// k = k + '-' + hex_md5(val.faculty);
// if (history_keys.indexOf(k) === -1) {
// colleges.push({key: k, name: val.faculty});
// history_keys.push(k); // 追加历史记录
// }
// k = k + '-' + hex_md5(val.major);
// if (history_keys.indexOf(k) === -1) {
// majors.push({key: k, name: val.major});
// history_keys.push(k); // 追加历史记录
// }
// });
//// console.log('departments',departments)
//// console.log('colleges',colleges)
//// console.log('majors',majors)
// laytpl($('#specialty_tpl').html()).render(data = {
// departments: departments,
// colleges: colleges,
// majors: majors
// }, function (html) {
// $('.modal-content').html(html);
// $('.modal-content').scrollTop(0); // 重置滚动
// });
console.log('data',data)
console.log('data',data.list)
laytpl($('#specialty_tpl').html()).render(data, function (html) {
$('.modal-content').html(html);
$('.modal-content').scrollTop(0); // 重置滚动
});
}
}
}
});
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="modal_tpl" type="text/html">
<div class="modal-container">
<div class="modal-content"></div>
<div class="modal-menu">
<dl>
<dt data-key="summary"><img src="img/summary-r.svg"></dt>
<dd>学校概况</dd>
<dt data-key="specialty"><img src="img/specialty-r.svg"></dt>
<dd>院系专业</dd>
<dt data-key="intro"><img src="img/intro-r.svg"></dt>
<dd>校园风采</dd>
</dl>
</div>
</div>
</script>
<!-- 校园风采模板 -->
<script id="intro_tpl" type="text/html">
<div id="intro">
<div class="layui-carousel" id="intro-carousel">
<div carousel-item>
{{# layui.each(d.list, function(index, item){ }}
<div>
<div class="pic-item"><img src="/dsideal_yy/gxytj/{{ item.resource_address }}.webp"
onerror="this.src='img/picture.svg'"></div>
<p class="txt-item"><span>{{ item.resource_description }}</span></p>
</div>
{{# }); }}
</div>
</div>
</div>
</script>
<!-- 学校概况模板 -->
<script id="summary_tpl" type="text/html">
<div id="summary">
<div class="header">
<div class="summary-logo">
<img src="https://video.edusoa.com/static/images/schoollogo/{{ d.logo }}"
onerror="this.src='img/picture.svg';this.width='100%';" style="max-width: 130px">
</div>
<div class="summary-intro">
<div class="title">{{ d.university_name }}</div>
<div class="text">{{ d.text }}</div>
<div class="tags">
{{# layui.each(d.tags, function(index, item){ }}
<span class="color-{{item.color}}">{{ item.name }}</span>
{{# }); }}
</div>
</div>
</div>
<div class="intro card">
<h3>基本信息</h3>
<div style="line-height: 2rem;border:1px solid #ccc;padding:1rem;box-shadow: 5px 5px 5px #ccc">
<div style="display: flex">
<div style="width: 50%"><img src="img/time.png" style="width: 20px;margin-right: 10px"/>创建时间{{d.set_up_time}}
</div>
<div style="width: 50%"><img src="img/hat.png" style="width: 20px;margin-right: 10px"/>主管部门{{d.university_affiliated}}
</div>
</div>
<div><img src="img/phone.png" style="width: 20px;margin-right: 10px"/>招生电话{{d.university_tel}}</div>
<div><img src="img/local.png" style="width: 20px;margin-right: 10px"/>学校地址{{d.address}}</div>
</div>
</div>
<div class="intro card">
<h3>院校介绍</h3>
<div style="position:relative;border:1px solid #ccc;padding:1rem;box-shadow: 5px 5px 5px #ccc;">
{{# if(d.university_desc){ }}
<div id="description" style="max-height: 10rem;overflow:hidden;">{{ d.university_desc.replace('\n','<br>')
}}
</div>
<div id="down" onclick="unfold()"
style="cursor:pointer;line-height: 2rem;text-align: center;margin-top: 1rem">展开 <img
src="img/down.png" style="width: 20px"/></div>
<div id="up" onclick="packUp()"
style="display:none;cursor:pointer;line-height: 2rem;text-align: center;margin-top: 1rem">收起 <img
src="img/up.png" style="width: 20px"/></div>
{{# }else{ }}
<span class="none">数据更新中请下次再来了...</span>
{{# } }}
</div>
</div>
<div class="intro card" id="featureMajors">
<h3>特色专业</h3>
<div style="position:relative;border:1px solid #ccc;padding:1rem;box-shadow: 5px 5px 5px #ccc;">
{{d.featureMajors}}
</div>
</div>
<div class="intro card" id="topMajors">
<h3>一流学科</h3>
<div style="position:relative;border:1px solid #ccc;padding:1rem;box-shadow: 5px 5px 5px #ccc;">
{{d.topMajors}}
</div>
</div>
<!--<div class="specialty card">-->
<!--<h3>优势专业</h3>-->
<!--{{# if(d.label_list.length > 0){ }}-->
<!--<div class="specialty-tables">-->
<!--{{# layui.each(d.label_list, function(index, item){ }}-->
<!--{{# if(index % Math.ceil(d.label_list.length / 2) === 0){ }}-->
<!--<div class="specialty-table">-->
<!--<table class="layui-table">-->
<!--<colgroup>-->
<!--<col width="60">-->
<!--<col width="200">-->
<!--<col width="100">-->
<!--</colgroup>-->
<!--<thead>-->
<!--<tr>-->
<!--<th>序号</th>-->
<!--<th>专业名称</th>-->
<!--<th>学科评估</th>-->
<!--</tr>-->
<!--</thead>-->
<!--<tbody>-->
<!--{{# } }}-->
<!--<tr>-->
<!--<td style="text-align: center">{{ index + 1 }}</td>-->
<!--<td>{{ item.MAJOR || '' }}</td>-->
<!--<td style="text-align: center">{{ item.SUBJECT_EVALUATION || '' }}</td>-->
<!--</tr>-->
<!--{{# if( (index + 1 === d.label_list.length) ){ }}-->
<!--{{# for(var n=0; n < Math.ceil(d.label_list.length / 2) * 2 - (index+1); n++){ }}-->
<!--<tr>-->
<!--<td>{{ index + 1 + n + 1 }}</td>-->
<!--<td></td>-->
<!--<td></td>-->
<!--</tr>-->
<!--{{# } }}-->
<!--{{# } }}-->
<!--{{# if((index+1) % Math.ceil(d.label_list.length / 2) === 0){ }}-->
<!--</tbody>-->
<!--</table>-->
<!--</div>-->
<!--{{# } }}-->
<!--{{# }); }}-->
<!--</div>-->
<!--{{# }else{ }}-->
<!--<span class="none">数据更新中请下次再来了...</span>-->
<!--{{# } }}-->
<!--</div>-->
</div>
</script>
<!-- 院系专业模板 -->
<script id="specialty_tpl" type="text/html">
<div id="specialty">
{{# layui.each(d.list, function(index, item){ }}
{{# if(item.department!==null){ }}
<h3 title="{{item.department}}" style="font-size:2vh;text-align:center;margin:1rem 0;" id="department" >{{item.department}}</h3>
{{# } }}
<div class="c-flex" style="justify-content: flex-start;">
{{# layui.each(item.faculty_list, function(_index, i){ }}
<div style="box-sizing:border-box; width: 30%; text-align: center; border: 1px solid #B3DBFF;border-radius:5px;margin:3vh 1.5%;padding:2vh;overflow:hidden;">
{{# if(i.faculty!==null){ }}
<h5 id="faculty" title="{{i.faculty}}" class="c-ellipsis" style="text-align: center; color: #3796D7; margin: 2vh 0;font-size:1.7vh;">{{i.faculty}}</h5>
{{# } }}
<div>
{{# layui.each(i.major, function(num, j){ }}
<div class="c-ellipsis" style="border: 1px solid #B7DFFF; padding: 1vh; margin: 1vh; text-align: left; " title="{{j}}">
<img style="width: 2vh;vertical-align:bottom;margin-right: .5rem;"
src="img/label.png"/>{{j}}
</div>
{{# }); }}
</div>
</div>
{{# }); }}
</div>
{{# }); }}
</div>
</script>
</html>