7e47ce238b
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
295 lines
9.2 KiB
HTML
295 lines
9.2 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="renderer" content="webkit">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
|
<title>3D场景展现-e订通后台</title>
|
|
<link rel="stylesheet" href="layuiadmin/layui/css/layui.css">
|
|
<link rel="stylesheet" href="index.css">
|
|
|
|
<link rel="stylesheet" href="css/pannellum.css"/>
|
|
<script src="layuiadmin/layui/layui.js"></script>
|
|
<script src="js/function.js"></script>
|
|
<script type="text/javascript" src="js/pannellum.js?v=11"></script>
|
|
<style>
|
|
#panorama {
|
|
width: 600px;
|
|
height: 400px;
|
|
}
|
|
div.pnlm-tooltip span{
|
|
visibility:visible;
|
|
}
|
|
/* 半透明的遮罩层 */
|
|
#overlay {
|
|
background: #000;
|
|
filter: alpha(opacity=50); /* IE的透明度 */
|
|
opacity: 0.5; /* 透明度 */
|
|
display: none;
|
|
position: absolute;
|
|
top: 0px;
|
|
left: 0px;
|
|
width: 100%;
|
|
height: 100%;
|
|
z-index: 100; /* 此处的图层要大于页面 */
|
|
display:none;
|
|
cursor:pointer;
|
|
}
|
|
.layui-form-select {
|
|
color:#000000;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<input type="hidden" id="id" name="id" value="">
|
|
<input type="hidden" id="hot_type" name="hot_type" value="">
|
|
<blockquote class="layui-elem-quote" style="line-height:44px;padding:8px;">
|
|
<div class="layui-inline"><a class="layui-btn layui-btn-normal btn_add_sceneto">添加出入口</a></div>
|
|
<div class="layui-inline"><a class="layui-btn layui-btn-normal btn_add_info">添加商品坐标</a></div>
|
|
</blockquote>
|
|
<div id="overlay"></div>
|
|
<div id="panorama">
|
|
|
|
</div>
|
|
<script>
|
|
|
|
document.onkeydown = function(e) {
|
|
var ev = (typeof event!= 'undefined') ? window.event : e;
|
|
if(ev.keyCode == 13) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
var viewShow;
|
|
layui.use(['form','layer'],function(){
|
|
var form = layui.form,
|
|
layer = layui.layer,
|
|
$=layui.jquery;
|
|
var id=get_url_param("id");
|
|
$("#id").val(id);
|
|
|
|
$("#panorama").width($(document).width()-50);
|
|
$("#panorama").height($(document).height()-100);
|
|
|
|
var sceneList;
|
|
var khnoList;
|
|
$.ajax({
|
|
type: "GET",
|
|
dataType: "json",
|
|
url: "./?_m=scene3D&_a=get_sceneDetail&id="+id,
|
|
success: function (result) {
|
|
if(result.code==0){
|
|
//添加参数
|
|
$.each(result.data,function(i,obj){
|
|
obj.clickHandlerFunc=hotspotClick;
|
|
obj.clickHandlerArgs=obj.id;
|
|
});
|
|
sceneList=result.sceneList;
|
|
khnoList=result.khnoList;
|
|
viewShow=pannellum.viewer('panorama', {
|
|
"type": "equirectangular",
|
|
"autoLoad": true,
|
|
"panorama": result.pic,
|
|
"hotSpots": result.data
|
|
});
|
|
}else{
|
|
layer.msg(result.msg);
|
|
}
|
|
},
|
|
error : function() {
|
|
layer.msg('异常,请刷新!', {
|
|
offset: '15px'
|
|
,icon: 3
|
|
,time: 1000
|
|
});
|
|
}
|
|
|
|
})
|
|
|
|
function hotspotClick(hotSpotDiv, args){
|
|
//console.log(args);
|
|
del_hotSpot(args)
|
|
}
|
|
|
|
$("#overlay").click(function(){
|
|
var hot_type=$("#hot_type").val();
|
|
create_hotSpot(hot_type);
|
|
});
|
|
|
|
|
|
$(".btn_add_sceneto").click(function(){
|
|
$("#hot_type").val("scene");
|
|
showOverlay();
|
|
});
|
|
$(".btn_add_info").click(function(){
|
|
$("#hot_type").val("info");
|
|
showOverlay();
|
|
});
|
|
|
|
$("#overlay").click(function(){
|
|
hideOverlay();
|
|
});
|
|
|
|
/* 显示遮罩层 */
|
|
function showOverlay() {
|
|
$("#overlay").height(pageHeight());
|
|
$("#overlay").width(pageWidth());
|
|
|
|
// fadeTo第一个参数为速度,第二个为透明度
|
|
// 多重方式控制透明度,保证兼容性,但也带来修改麻烦的问题
|
|
$("#overlay").fadeTo(200, 0.5);
|
|
}
|
|
|
|
/* 隐藏覆盖层 */
|
|
function hideOverlay() {
|
|
$("#overlay").fadeOut(200);
|
|
}
|
|
|
|
/* 当前页面高度 */
|
|
function pageHeight() {
|
|
return document.body.scrollHeight;
|
|
}
|
|
|
|
/* 当前页面宽度 */
|
|
function pageWidth() {
|
|
return document.body.scrollWidth;
|
|
}
|
|
|
|
function create_hotSpot(hotType){
|
|
var layer_title;
|
|
var e=window.event;
|
|
var wh_list=viewShow.mouseEventToCoords(e);
|
|
//
|
|
spitch = wh_list[0].toFixed(2);
|
|
syaw = wh_list[1].toFixed(2);
|
|
if(hotType=="info"){
|
|
layer_title="添加热点--款号";
|
|
var selHtml='<div class="layui-form-item"><label class="layui-form-label" style="color:#000000;">款号</label><div class="layui-input-inline"><select id="skhno" name="skhno" style="color:#000000;" lay-search=""><option value="">直接选择或搜索选择</option>';
|
|
$.each(khnoList,function(j,obj2){
|
|
selHtml+='<option value="'+obj2.khno+'">'+obj2.khno+'</option>';
|
|
});
|
|
selHtml+='</select></div></div>';
|
|
|
|
layer_content='<div style="padding: 50px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;"><form class="layui-form layui-form-pane" action="">'+selHtml+'<div class="layui-form-item"><label class="layui-form-label" style="color:#000000;">坐标1</label><div class="layui-input-inline"><input type="text" id="spitch" name="spitch" readonly value="'+spitch+'" class="layui-input"></div></div><div class="layui-form-item"><label class="layui-form-label" style="color:#000000;">坐标2</label><div class="layui-input-inline"><input type="text" id="syaw" name="syaw" readonly value="'+syaw+'" class="layui-input"></div></div></form></div>';
|
|
}else{
|
|
layer_title="添加热点--切换场景";
|
|
var selHtml='<div class="layui-form-item"><label class="layui-form-label" style="color:#000000;">选择场景</label><div class="layui-input-inline"><select id="htScene" name="htScene" style="color:#000000;">';
|
|
$.each(sceneList,function(j,obj2){
|
|
selHtml+='<option value="'+obj2.sceneName+'">'+obj2.sceneTitle+'</option>';
|
|
});
|
|
selHtml+='</select></div></div>';
|
|
layer_content='<div style="padding: 50px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;"><form class="layui-form layui-form-pane" action=""><div class="layui-form-item"><label class="layui-form-label" style="color:#000000;">名称</label><div class="layui-input-inline"><input type="text" id="stitle" name="stitle" value="" class="layui-input"></div></div>'+selHtml+'<div class="layui-form-item"><label class="layui-form-label" style="color:#000000;">坐标1</label><div class="layui-input-inline"><input type="text" id="spitch" name="spitch" readonly value="'+spitch+'" class="layui-input"></div></div><div class="layui-form-item"><label class="layui-form-label" style="color:#000000;">坐标2</label><div class="layui-input-inline"><input type="text" id="syaw" name="syaw" readonly value="'+syaw+'" class="layui-input"></div></div></form></div>';
|
|
}
|
|
layer.open({
|
|
type: 1
|
|
,title: layer_title
|
|
,area: '450px;'
|
|
,shade: 0.8
|
|
,id: 'hot_add'
|
|
,btn: ['确认', '关闭']
|
|
,btnAlign: 'c'
|
|
,moveType: 1 //拖拽模式,0或者1
|
|
,content: layer_content
|
|
,success: function(layero){
|
|
form.render();
|
|
}
|
|
,yes: function(index, layero){
|
|
var sid = $("#id").val();
|
|
|
|
if(hotType=="info"){
|
|
var skhno = $("#skhno").val();
|
|
$.ajax({
|
|
type: "POST",
|
|
dataType: "json",
|
|
url: "./?_m=scene3D&_a=add_hotSpot",
|
|
data:{"sid":sid,"hot_type":hotType,"khno":skhno,"hot_pitch":spitch,"hot_yaw":syaw},
|
|
success: function (result) {
|
|
if(result.code==0){
|
|
viewShow.addHotSpot({"id":result.htid,"pitch":spitch, "yaw": syaw,"type": hotType,"text": skhno,"sceneId": "",clickHandlerFunc:hotspotClick,clickHandlerArgs:result.htid})
|
|
}else{
|
|
layer.msg(result.msg);
|
|
}
|
|
layer.closeAll();
|
|
},
|
|
error : function() {
|
|
layer.msg('异常,请刷新!', {
|
|
offset: '15px'
|
|
,icon: 3
|
|
,time: 1000
|
|
});
|
|
layer.closeAll();
|
|
}
|
|
|
|
})
|
|
}else{
|
|
var stitle = $("#stitle").val();
|
|
var htScene = $("#htScene").val();
|
|
$.ajax({
|
|
type: "POST",
|
|
dataType: "json",
|
|
url: "./?_m=scene3D&_a=add_hotSpot2",
|
|
data:{"sid":sid,"hot_type":hotType,"title":stitle,"hot_pitch":spitch,"hot_yaw":syaw,"sceneId":htScene},
|
|
success: function (result) {
|
|
if(result.code==0){
|
|
viewShow.addHotSpot({"id":result.htid,"pitch":spitch, "yaw": syaw,"type": hotType,"text": stitle,"sceneId": "",clickHandlerFunc:hotspotClick,clickHandlerArgs:result.htid})
|
|
}else{
|
|
layer.msg(result.msg);
|
|
}
|
|
layer.closeAll();
|
|
},
|
|
error : function() {
|
|
layer.msg('异常,请刷新!', {
|
|
offset: '15px'
|
|
,icon: 3
|
|
,time: 1000
|
|
});
|
|
layer.closeAll();
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function del_hotSpot(htid){
|
|
layer.confirm('删除这个热点吗?', {icon: 3, title:'提示'}, function(index){
|
|
$.ajax({
|
|
type: "POST",
|
|
dataType: "json",
|
|
url: "./?_m=scene3D&_a=del_hotSpot",
|
|
data:{"htid":htid},
|
|
success: function (result) {
|
|
if(result.code==0){
|
|
viewShow.removeHotSpot(htid);
|
|
}else{
|
|
layer.msg(result.msg);
|
|
}
|
|
layer.close(index);
|
|
},
|
|
error : function() {
|
|
layer.msg('异常,请刷新!', {
|
|
offset: '15px'
|
|
,icon: 3
|
|
,time: 1000
|
|
});
|
|
layer.close(index);
|
|
}
|
|
|
|
})
|
|
});
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
</script>
|
|
</body>
|
|
</html> |