|
@@ -8,7 +8,8 @@ var token = window.localStorage.dcj_token
|
|
|
|
|
|
|
|
|
*/
|
|
|
-
|
|
|
+var confirmSnap = $(".confirmSnap.innerBtn");
|
|
|
+var snapshotGui = $(".snapshotGui.overlayGui");
|
|
|
var _musicMaxWeight = 8
|
|
|
//M
|
|
|
var cmp = getQueryVariable('cmp') || ''
|
|
@@ -53,6 +54,8 @@ var EditTools = function(n) {
|
|
|
//初始化界面
|
|
|
//this.init();
|
|
|
this.data = {}
|
|
|
+
|
|
|
+ this.editLabel = new EditLabel();
|
|
|
}
|
|
|
|
|
|
|
|
@@ -84,13 +87,29 @@ EditTools.prototype.init = function() {
|
|
|
// fyz 初始化导览需要两部分数据, 其中data2为data.js中的数据
|
|
|
that.editGuide.init(this.data.data, this.data.data2);
|
|
|
|
|
|
-
|
|
|
+ that.editLabel.init()
|
|
|
|
|
|
$("body").on("click", function() {
|
|
|
$(".DelConfirm").removeClass("active");
|
|
|
})
|
|
|
|
|
|
|
|
|
+ player.on("mode.changing",(currentMode, mode, pano)=>{ //起飞
|
|
|
+ if(this.atPanel != "screen" && !editTool.hotpoint.gettingCameraData) return
|
|
|
+
|
|
|
+ if(currentMode == "panorama") confirmSnap.addClass("unable")
|
|
|
+
|
|
|
+
|
|
|
+ })
|
|
|
+ player.on("flying.ended",(/* toPos, fromPos, pano */)=>{ //飞结束
|
|
|
+ if(this.atPanel != "screen" && !editTool.hotpoint.gettingCameraData) return
|
|
|
+ if(player.mode == "panorama") confirmSnap.removeClass("unable")
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
/* $(" .MenuOptions li").on("click", (e)=>{
|
|
|
var $elem = $(e.target);
|
|
@@ -163,8 +182,7 @@ EditTools.prototype.init = function() {
|
|
|
//点击的时候激活状态
|
|
|
EditTools.prototype.active = function() {
|
|
|
var that = this;
|
|
|
- var confirmSnap = $(".confirmSnap.innerBtn");
|
|
|
- var snapshotGui = $(".snapshotGui.overlayGui");
|
|
|
+
|
|
|
$('.toolBottom .toolLeft li').click(function() {
|
|
|
var name = $(this).data("name");
|
|
|
$('.toolLeft li[data-name=' + name + ']').addClass("active").siblings().removeClass("active");
|
|
@@ -185,14 +203,19 @@ EditTools.prototype.active = function() {
|
|
|
confirmSnap.addClass("hide").removeClass("unable");
|
|
|
snapshotGui.hide();
|
|
|
break;
|
|
|
- case "overlay":
|
|
|
+ /* case "overlay":
|
|
|
EditOverlay.leave()
|
|
|
- break;
|
|
|
+ break; */
|
|
|
case "hotpoint":
|
|
|
$("#hotpointDetail").hasClass("atRight") || $("#hotpointDetail a.close").click();
|
|
|
VisiSet.finishSetTagVisible()
|
|
|
that.hotpoint.wireframeModel.visible = false
|
|
|
break;
|
|
|
+
|
|
|
+ case 'roomLabels':
|
|
|
+ that.editLabel.leave()
|
|
|
+ break;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
@@ -215,16 +238,20 @@ EditTools.prototype.active = function() {
|
|
|
confirmSnap.removeClass("hide");
|
|
|
$('#camera-start').text("点此设置为初始画面")
|
|
|
snapshotGui.show();
|
|
|
- if (player.modeTran.split("-")[1] != "panorama")
|
|
|
- $(".confirmSnap").addClass("unable")
|
|
|
+ if (player.mode != "panorama")
|
|
|
+ confirmSnap.addClass("unable")
|
|
|
break;
|
|
|
- case "overlay":
|
|
|
+ /* case "overlay":
|
|
|
EditOverlay.enter()
|
|
|
- break;
|
|
|
+ break; */
|
|
|
case 'snapTour':
|
|
|
that.editGuide.scroller.tourBlackSpeed.InitOffset()
|
|
|
that.editGuide.scroller.tourWalkSpeed.InitOffset()
|
|
|
- break;
|
|
|
+ break;
|
|
|
+
|
|
|
+ case 'roomLabels':
|
|
|
+ that.editLabel.enter()
|
|
|
+ break;
|
|
|
}
|
|
|
|
|
|
that.atPanel = name;
|
|
@@ -275,7 +302,7 @@ EditTools.prototype.initSaveAll = function() {
|
|
|
backgroundMusic: that.EditBGM.musicBox.getSrc() || '',
|
|
|
bgName: that.EditBGM.musicBox.getName(),
|
|
|
hoticon: JSON.parse($(".hotStyle-item li.active").attr("data-val")),
|
|
|
- camera_start: $('#camera-start')[0].data,
|
|
|
+ camera_start: $(".screen .shotImg.innerBtn")[0].cameraData,
|
|
|
loadlogo: $("#loadlogo").is(':checked'),
|
|
|
special: $("#g_specialScene").is(':checked'),
|
|
|
vision_version: $("#twoData").is(':checked') ? "1.1.562.17209" : false,
|
|
@@ -301,7 +328,8 @@ EditTools.prototype.initSaveAll = function() {
|
|
|
tourWalkSpeed : that.editGuide.scroller.tourWalkSpeed.value,
|
|
|
tourRotTime,
|
|
|
|
|
|
- // 导览瞬间过渡
|
|
|
+ momentTourBlackNewType : $('#newBlack').is(':checked'),
|
|
|
+
|
|
|
showHotListSta: $('#hotListSwitch').is(':checked'),
|
|
|
// 开启热点列表
|
|
|
hotIconScale: DATA.hotIconScale,
|
|
@@ -325,6 +353,7 @@ EditTools.prototype.initSaveAll = function() {
|
|
|
sceneCode: number,
|
|
|
hots: reData(that.hotpoint.getSavingInfo(), '{}'),
|
|
|
//tourAudio: reData(that.editGuide.tourAudio,'{}'),//for 旧版
|
|
|
+ roomLabels: that.editLabel.getSavingInfo(),
|
|
|
name: number,
|
|
|
guides: reData(guides, '[]'),
|
|
|
info: info,
|
|
@@ -360,6 +389,185 @@ EditTools.prototype.initSaveAll = function() {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+class EditLabel{
|
|
|
+ constructor(){
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ init(){
|
|
|
+
|
|
|
+ $('.toolRight .roomLabels .addBtn button').on('click',()=>{//准备添加
|
|
|
+ if(this.editingLabel){
|
|
|
+ this.setEditLabel(false, this.editingLabel)
|
|
|
+ }
|
|
|
+ this.setAddState(true)
|
|
|
+ })
|
|
|
+ $('.toolRight .roomLabels [name="title"] input').on('input',(e)=>{//标题
|
|
|
+ this.editingLabel.setTitle(e.target.value)
|
|
|
+ })
|
|
|
+ $('.toolRight .roomLabels [name="delete"] button').on('click',(e)=>{//删除
|
|
|
+
|
|
|
+ this.deleteLabel(this.editingLabel)
|
|
|
+ this.setEditLabel(false,this.editingLabel)
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ player.on('getIntersect',(intersect, consume)=>{//添加
|
|
|
+ if(this.adding){
|
|
|
+ var position = intersect.point.clone();
|
|
|
+ position.y += 0.5
|
|
|
+ //var floorIndex = player.model.allFloorsVisible ? null : player.model.currentFloor.floorIndex
|
|
|
+ var floorIndex = intersect.object.parent.parent.floorIndex
|
|
|
+ var label = new RoomLabel({position, title:'' , domElement:$(".widgets-doll-labels")[0], shelterByModel:true , autoUpdate : true, floorIndex/* , modes:[] */
|
|
|
+ ,clickFun:()=>{
|
|
|
+ if(this.editing){
|
|
|
+ this.setEditLabel(true,label)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ player.model.roomLabels.push(label)
|
|
|
+ this.setAddState(false)
|
|
|
+ this.setEditLabel(true, label) //开始编辑
|
|
|
+
|
|
|
+
|
|
|
+ //拖拽
|
|
|
+ {
|
|
|
+ let dragElemShift = {}
|
|
|
+ let dragging = false
|
|
|
+ const startDrag = (evt) => {
|
|
|
+ dragging = true
|
|
|
+ $('#player').on("mousemove", drag);
|
|
|
+
|
|
|
+ if(player.mode != 'floorplan'){ //换算到elem的底部
|
|
|
+ let lebelWidth = label.elem.children(0).width()
|
|
|
+ let lebelHeight = label.elem.children(0).height() * (68+24) / 24 ;//
|
|
|
+ dragElemShift = {x: -evt.offsetX + lebelWidth/2, y: 100 /* -evt.offsetY + lebelHeight */} //y向不准确,因为原本添加时提高了0.5,而0.5对应的像素需要根据视角,那就算了吧
|
|
|
+ }else{
|
|
|
+ dragElemShift = {x:0,y:0}
|
|
|
+ }
|
|
|
+
|
|
|
+ CursorDeal.add('moveLabel')
|
|
|
+ };
|
|
|
+
|
|
|
+ const endDrag = (evt) => {
|
|
|
+ dragging = false
|
|
|
+
|
|
|
+ $('#player').off("mousemove", drag);
|
|
|
+
|
|
|
+ CursorDeal.remove('moveLabel')
|
|
|
+ };
|
|
|
+
|
|
|
+ const drag = (evt) => {
|
|
|
+ if (dragging) {
|
|
|
+
|
|
|
+ evt.preventDefault();
|
|
|
+ let mouse = new THREE.Vector3()
|
|
|
+ let meshes = player.model.allFloorsVisible ? player.model.colliders : player.model.currentFloor.collider.children
|
|
|
+ math.convertScreenPositionToNDC(evt.offsetX+dragElemShift.x, evt.offsetY+dragElemShift.y, mouse);
|
|
|
+ var intersect = convertTool.getMouseIntersect(player.camera, meshes, mouse)
|
|
|
+ if(intersect){
|
|
|
+ let position = intersect.point.clone()
|
|
|
+ position.y += 0.5
|
|
|
+ label.setPos(position)
|
|
|
+ var floorIndex = intersect.object.parent.parent.floorIndex
|
|
|
+ label.floorIndex = floorIndex
|
|
|
+ }
|
|
|
+ //this.dispatchEvent({type:'dragged', position: this.position})
|
|
|
+
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ label.elem.on('mousedown', startDrag);
|
|
|
+ $(document).on('mouseup', endDrag);
|
|
|
+ $("#player").on('mouseup', endDrag);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ this.adding = false
|
|
|
+ label.update()
|
|
|
+ consume(true)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ deleteLabel(label){
|
|
|
+ let index = player.model.roomLabels.indexOf(label)
|
|
|
+ index > -1 && player.model.roomLabels.splice(index,1)
|
|
|
+
|
|
|
+ label.dispose()
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ setAddState(state){
|
|
|
+ state ? CursorDeal.add('addLabel') : CursorDeal.remove('addLabel')
|
|
|
+ this.adding = state
|
|
|
+ }
|
|
|
+
|
|
|
+ setEditLabel(state, label){
|
|
|
+ let pannel = $('.toolRight li[name="prop"]')
|
|
|
+
|
|
|
+ if(state){
|
|
|
+ if(this.editingLabel){
|
|
|
+ this.setEditLabel(false, this.editingLabel)
|
|
|
+ }
|
|
|
+ label.elem.addClass('selected')
|
|
|
+ pannel.removeClass('hide')
|
|
|
+ pannel.find('[name="title"] input').val(label.title)
|
|
|
+ label.setEditSelect(true)
|
|
|
+ this.editingLabel = label
|
|
|
+ }else{
|
|
|
+ label.elem.removeClass('selected')
|
|
|
+ pannel.addClass('hide')
|
|
|
+ label.setEditSelect(false)
|
|
|
+ this.editingLabel = null
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ enter(){
|
|
|
+ this.editing = true
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ leave(){
|
|
|
+ this.editing = false
|
|
|
+ this.editingLabel && this.setEditLabel(false, this.editingLabel)
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ getSavingInfo(){
|
|
|
+ var info = player.model.roomLabels.map(e=>{
|
|
|
+ return {
|
|
|
+ title : e.title,
|
|
|
+ position : toPrecision(e.position.toArray(), 4),
|
|
|
+ floorIndex: e.floorIndex
|
|
|
+ }
|
|
|
+ })
|
|
|
+ console.log(info)
|
|
|
+ return info
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
//场景信息编辑
|
|
|
var SceneInformation = function() {}
|
|
|
SceneInformation.prototype.init = function(data, data2) {
|
|
@@ -398,9 +606,11 @@ SceneInformation.prototype.init = function(data, data2) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- $('#camera-start')[0].data = data.camera_start;
|
|
|
- $(".shotImg.innerBtn").on("click", ()=>{
|
|
|
- var EntryInfo = $('#camera-start')[0].data
|
|
|
+ $(".screen .shotImg.innerBtn")[0].cameraData = data.camera_start;
|
|
|
+
|
|
|
+
|
|
|
+ $(".shotImg.innerBtn").on("click", function(){
|
|
|
+ var EntryInfo = this.cameraData
|
|
|
if (EntryInfo) {
|
|
|
var to = player.model.panos.get(EntryInfo.pano.uuid);
|
|
|
var q = new THREE.Quaternion().fromArray(EntryInfo.camera.quaternion);
|
|
@@ -435,6 +645,9 @@ SceneInformation.prototype.init = function(data, data2) {
|
|
|
if (data.showHotListSta) {
|
|
|
hotListSwitch.prop('checked', true);
|
|
|
}
|
|
|
+ if (data.momentTourBlackNewType) {
|
|
|
+ $('#newBlack').prop('checked', true);
|
|
|
+ }
|
|
|
|
|
|
if (data.hotIconScale) {
|
|
|
hotIconScale.val(parseFloat(data.hotIconScale));
|
|
@@ -626,7 +839,7 @@ function loadCAD(data) {
|
|
|
|
|
|
//设置初始界面
|
|
|
function getSeft(seft) {
|
|
|
- $('#camera-start').on('click', function() {
|
|
|
+ $('#camera-start').on('click', function(e) {
|
|
|
|
|
|
if (VisiSet.setPanoVisible) {
|
|
|
return VisiSet.savePanoVisibles()
|
|
@@ -634,9 +847,11 @@ function getSeft(seft) {
|
|
|
return VisiSet.saveTagVisibles()
|
|
|
}
|
|
|
|
|
|
- // 这部分内容需要配合main_2018.js中来进行修改
|
|
|
- var snap = JSON.parse("{" + seft.getSnapAngleInfo() + "}")
|
|
|
- this.data = {
|
|
|
+ var snapType = editTool.hotpoint.editSpot ? 'hot' : 'screen'
|
|
|
+ var preview = snapType == 'screen' ? $(".screen .shotImg.innerBtn")[0] : $('#hotpointDetail .shotImg.innerBtn')[0]
|
|
|
+ var snap = JSON.parse("{" + seft.getSnapAngleInfo() + "}")
|
|
|
+
|
|
|
+ preview.cameraData = {
|
|
|
camera: {
|
|
|
position: snap.metadata.camera_position,
|
|
|
quaternion: snap.metadata.camera_quaternion// 相机朝向
|
|
@@ -646,18 +861,17 @@ function getSeft(seft) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- var ev = document.createEvent("MouseEvent");
|
|
|
- //点击截取视图
|
|
|
- g_snapShotWidth = 240 * 4;
|
|
|
- g_snapShotHeight = 118 * 4;
|
|
|
- window.screenSta = 'startScreen';
|
|
|
+ var ev = document.createEvent("MouseEvent");//截取视图
|
|
|
+ g_snapShotWidth = snapType == 'screen' ? 240 * 4 : 240;
|
|
|
+ g_snapShotHeight = snapType == 'screen' ? 118 * 4 : 118;
|
|
|
+ //window.screenSta = 'startScreen';
|
|
|
ev.initMouseEvent("snapshotBegin", true, true, document.defaultView, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
|
|
|
|
|
|
ev.__callback = (imgData,info)=>{
|
|
|
uploadImg(imgData, (rs)=>{
|
|
|
- if (rs.code === 0) {
|
|
|
- $(".shotImg.innerBtn").css("background-image", "url(" + rs.data + ")")
|
|
|
- this.data.thumbImg = rs.data;
|
|
|
+ if (rs.code === 0) {
|
|
|
+ preview.cameraData.thumbImg = rs.data;
|
|
|
+ preview.style['background-image'] = "url(" + rs.data + ")"
|
|
|
}
|
|
|
}
|
|
|
, "thumbImg.jpg")
|
|
@@ -724,11 +938,39 @@ Hotpoint.prototype.init = function() {
|
|
|
|
|
|
|
|
|
player.model.hotGroup.children.forEach(e=>this.addHotList(e) )//创建列表
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
|
|
|
this.hotpointDetail.find(".tail .submit").on('click', this.saveHot.bind(this))
|
|
|
|
|
|
+
|
|
|
+ this.hotpointDetail.find("[name=info] input").on('change',(e)=>{//标题
|
|
|
+ this.editSpot.info.title = e.target.value
|
|
|
+ this.editSpot.setTitleElem()
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //图片简介
|
|
|
+ {
|
|
|
+ let textarea = this.hotpointDetail.find('li[name="photo"] textarea');
|
|
|
+ textarea.on('change',(e)=>{
|
|
|
+ if(!textarea[0].currentBtn)return
|
|
|
+ textarea[0].currentBtn.desc = e.target.value;
|
|
|
+ this.imgDescBtnUpdate(textarea[0].currentBtn )
|
|
|
+ })
|
|
|
+
|
|
|
+ //应用到所有
|
|
|
+ this.hotpointDetail.find('li[name="photo"] button').on('click',()=>{
|
|
|
+ var choice = confirm("确定将文字应用到此热点的所有图片吗?");
|
|
|
+ if (choice) {
|
|
|
+ Array.from(that.hotpointDetail.find("[name=photo] .list .descBtn")).forEach(btn=>{
|
|
|
+ btn.desc = textarea[0].value
|
|
|
+ this.imgDescBtnUpdate(btn)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
{
|
|
|
let ui = $('#hotIconScale input')
|
|
|
let min = parseFloat(ui.attr('min'));
|
|
@@ -762,7 +1004,10 @@ Hotpoint.prototype.init = function() {
|
|
|
if(name == 'openHot'){
|
|
|
var content = that.hotpointDetail.find("li[name='content']")
|
|
|
checked ? content.removeClass('hide') : content.addClass('hide')
|
|
|
- }
|
|
|
+ }else if(name == 'fastTran'){//瞬间过渡
|
|
|
+ var fastTran = that.hotpointDetail.find("li[name='fastTran']")
|
|
|
+ checked ? fastTran.removeClass('hide') : fastTran.addClass('hide')
|
|
|
+ }
|
|
|
},
|
|
|
callbackWhenChose:(checked, name)=>{
|
|
|
that.editSpot.info.actionType[name] = !!checked;
|
|
@@ -770,13 +1015,34 @@ Hotpoint.prototype.init = function() {
|
|
|
}
|
|
|
})
|
|
|
|
|
|
-
|
|
|
+ this.imgDescCheckBox = new CheckBox({dom: this.hotpointDetail.find("#addImgDesc"),
|
|
|
+ uiCallBack : (checked, name)=>{
|
|
|
+ var textarea = this.hotpointDetail.find('li[name="photo"] textarea');
|
|
|
+ var title = this.hotpointDetail.find('li[name="photo"] [name="descTitle"]')
|
|
|
+ if(!checked){
|
|
|
+ textarea.addClass('hide'), title.addClass('hide')
|
|
|
+ /* textarea.val('');
|
|
|
+ textarea[0].currentBtn = null */
|
|
|
+ }else{
|
|
|
+ textarea.removeClass('hide'), title.removeClass('hide')
|
|
|
+ }
|
|
|
+ var imgArea = this.hotpointDetail.find('li[name="photo"] .edit-fun-images');
|
|
|
+ checked ? imgArea.addClass('hasDescBtn') : imgArea.removeClass('hasDescBtn')
|
|
|
+
|
|
|
+ },
|
|
|
+ callbackWhenChose:(checked, name)=>{
|
|
|
+ that.editSpot.info.useImgDesc = !!checked;
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
|
|
|
|
|
|
//点击添加热点按钮
|
|
|
$('.hotpoint .addBtn button').on("click", function(e) {
|
|
|
g_HotStatus = $(e.target).attr('data-type');
|
|
|
- $("#player").css("cursor", "cell");
|
|
|
+ //$("#player").css("cursor", "cell");
|
|
|
+ CursorDeal.add('addHot' )
|
|
|
+
|
|
|
});
|
|
|
|
|
|
|
|
@@ -810,7 +1076,7 @@ Hotpoint.prototype.init = function() {
|
|
|
});
|
|
|
|
|
|
//关闭、取消
|
|
|
- this.hotpointDetail.find("a.close, button.cancel").on("click", ()=>{
|
|
|
+ this.hotpointDetail.find(".head a.close, .tail button.cancel").on("click", ()=>{
|
|
|
|
|
|
var hot = this.editSpot
|
|
|
if(hot.isNew){
|
|
@@ -1152,6 +1418,65 @@ Hotpoint.prototype.init = function() {
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+
|
|
|
+ this.titleShowOptions = new MenuOptions({ //何时显示
|
|
|
+ dom: this.hotpointDetail.find(".MenuOptions[name=titleShowType]"),
|
|
|
+ uiCallBack : (o)=>{
|
|
|
+
|
|
|
+ },
|
|
|
+ callbackWhenChose:(o)=>{
|
|
|
+ var name = o.name == void 0 ? o.$li.attr('index') : o.name
|
|
|
+ this.editSpot.info.titleShowType = name
|
|
|
+ this.editSpot.setHoverState(false) //update
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ this.titlePosOptions = new MenuOptions({ //相对热点的位置
|
|
|
+ dom: this.hotpointDetail.find(".MenuOptions[name=titlePos]"),
|
|
|
+ uiCallBack : (o)=>{
|
|
|
+
|
|
|
+ },
|
|
|
+ callbackWhenChose:(o)=>{
|
|
|
+ var name = o.name == void 0 ? o.$li.attr('index') : o.name
|
|
|
+ this.editSpot.info.titlePos = name
|
|
|
+ this.editSpot.setTitleDir();
|
|
|
+ this.latestTitlePos = this.editSpot.info.titlePos//最近一次设置的,运用到新的热点中
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ this.hotpointDetail.find("li[name='fastTran'] button").on('click',(e)=>{
|
|
|
+ this.setCameraBtn(!this.gettingCameraData)
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+Hotpoint.prototype.setCameraBtn = function(state){
|
|
|
+ let btn = this.hotpointDetail.find("li[name='fastTran'] button")
|
|
|
+ if(!state){
|
|
|
+ confirmSnap.addClass("hide");
|
|
|
+ snapshotGui.hide();
|
|
|
+ btn.text('设置')
|
|
|
+ this.gettingCameraData = false
|
|
|
+ }else{
|
|
|
+ confirmSnap.removeClass("hide");
|
|
|
+ $('#camera-start').text("点此设置跳转到此方位")
|
|
|
+ snapshotGui.show();
|
|
|
+ if (player.mode != "panorama"){
|
|
|
+ $(".confirmSnap").addClass("unable")
|
|
|
+ }else{
|
|
|
+ $(".confirmSnap").removeClass("unable")
|
|
|
+ }
|
|
|
+ btn.text('结束设置')
|
|
|
+ this.gettingCameraData = true
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
Hotpoint.prototype.updateBoxDepthPanel = function(){
|
|
@@ -1176,6 +1501,7 @@ Hotpoint.prototype.editHot = function(hot, $li) {
|
|
|
if(player.mode == 'panorama'){
|
|
|
hot.examine( {
|
|
|
dontOpen: true, examine:true,
|
|
|
+ dontFastTran: true,
|
|
|
aimDuration : 600,
|
|
|
duration : 600
|
|
|
})
|
|
@@ -1208,7 +1534,7 @@ Hotpoint.prototype.editHot = function(hot, $li) {
|
|
|
//$("#isSprite")[0].checked = this.editSpot.info.isSprite
|
|
|
this.isSpriteCheckBox.updateChoseAtUI(this.editSpot.info.isSprite)
|
|
|
|
|
|
-
|
|
|
+ this.imgDescCheckBox.updateChoseAtUI(this.editSpot.info.useImgDesc)
|
|
|
|
|
|
this.linkTypeMenuOptions.updateChoseAtUI({name:this.editSpot.info.linkType})
|
|
|
|
|
@@ -1225,10 +1551,12 @@ Hotpoint.prototype.editHot = function(hot, $li) {
|
|
|
return this.inputList("请填写网页链接", module)
|
|
|
}.bind(this))
|
|
|
|
|
|
- var imagesHTML = hot.info.images.map(function(image) {
|
|
|
- return '<div class="mediaItem" draggable="true" ><a class=" result success" data-type="photo"><span></span><img src="' + image + '" class="bg"></a></div>'
|
|
|
+ var imagesHTML = hot.info.images.map(function(image,index) {
|
|
|
+ return '<div class="mediaItem" draggable="true" ><a class=" result success" data-type="photo"><span></span><img src="' + image + '" class="bg"></a><div class="descBtn" ></div></div>'
|
|
|
})
|
|
|
|
|
|
+
|
|
|
+
|
|
|
var videosHTML = hot.info.video.map(function(ly) {
|
|
|
var thumb = (!ly.img || ly.img === "undefined") ? '' : '<img src='+ ly.img +' class="bg"></img>'
|
|
|
var thumbResult = (!ly.img || ly.img === "undefined") ? '' : 'success';
|
|
@@ -1237,21 +1565,52 @@ Hotpoint.prototype.editHot = function(hot, $li) {
|
|
|
})
|
|
|
|
|
|
this.hotpointDetail.find(".name > input").val(hot.info.title);
|
|
|
- this.hotpointDetail.find(".editText").val(hot.info.content);
|
|
|
+ this.hotpointDetail.find('[name="intro"] .editText').val(hot.info.content);
|
|
|
this.hotpointDetail.find("[name=photo] .list").html(imagesHTML);
|
|
|
this.hotpointDetail.find("[name=video] .list").html(videosHTML);
|
|
|
this.hotpointDetail.find("[name=modelSrc] .list").html(modulesHTML);
|
|
|
this.hotpointDetail.find("[name=webPage] .list").html(iframesHTML);
|
|
|
+ Array.from(this.hotpointDetail.find("[name=photo] .list .descBtn")).forEach((btn,index)=>{
|
|
|
+ this.imgDescBtnBind(btn, this.editSpot.info.imagesDesc[index])
|
|
|
+ this.imgDescBtnUpdate(btn,index)
|
|
|
+ })
|
|
|
+ this.imgDescBtnChose(null)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
let bgName = hot.info.bgName || '热点背景音乐';
|
|
|
if (hot.info.backgroundMusic) {
|
|
|
this.musicBox.show(/* this.hotpointDetail.find(".audio.mediaUpload"), */bgName, hot.info.backgroundMusic)
|
|
|
} else {
|
|
|
this.musicBox.hide()
|
|
|
- }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ {//跳转方位设置
|
|
|
+ var preview = $('#hotpointDetail .shotImg.innerBtn')[0]
|
|
|
+ preview.cameraData = hot.info.cameraData
|
|
|
+ if(hot.info.cameraData){
|
|
|
+ preview.style['background-image'] = "url(" + hot.info.cameraData.thumbImg + ")"
|
|
|
+ }else{
|
|
|
+ preview.style['background-image'] = ''
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ {//标题显示
|
|
|
+
|
|
|
+ this.titleShowOptions.updateChoseAtUI({name:this.editSpot.info.titleShowType})
|
|
|
+ this.titlePosOptions.updateChoseAtUI({name:this.editSpot.info.titlePos})
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
Hotpoint.prototype.recoverInfo = function(hot) { // 恢復
|
|
|
hot.info = hot.tempInfo;
|
|
|
|
|
@@ -2469,17 +2828,25 @@ Hotpoint.prototype.updateClickEventUI = function() {//根据actionType更新ui
|
|
|
var content = this.hotpointDetail.find("li[name='content']")
|
|
|
hot.info.actionType.openHot ? content.removeClass('hide') : content.addClass('hide') */
|
|
|
|
|
|
- for(let i in hot.info.actionType){
|
|
|
+ /* for(let i in hot.info.actionType){
|
|
|
this.actionCheckBox.updateChoseAtUI(hot.info.actionType[i], i)
|
|
|
|
|
|
- }
|
|
|
+ } */
|
|
|
+
|
|
|
+ settings.hotClickActions.forEach(e=>{
|
|
|
+ this.actionCheckBox.updateChoseAtUI(hot.info.actionType[e], e)
|
|
|
+ })
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
//添加图片和视频
|
|
|
Hotpoint.prototype.addmediaInit = function() {
|
|
|
// 视频预览控制
|
|
|
var $videoLayout = $('.fun-view-video')
|
|
|
+ var that = this
|
|
|
$videoLayout.find('span').on('click', function() {
|
|
|
$videoLayout.hide();
|
|
|
$videoLayout.find('video').attr('src', '')[0].pause()
|
|
@@ -2538,7 +2905,7 @@ Hotpoint.prototype.addmediaInit = function() {
|
|
|
|
|
|
|
|
|
// 图片与视频加载
|
|
|
- function fileHandle() {
|
|
|
+ function fileHandle(that) {
|
|
|
var $seft = $(this) //input
|
|
|
|
|
|
|
|
@@ -2567,6 +2934,16 @@ Hotpoint.prototype.addmediaInit = function() {
|
|
|
$addLayout.addClass("result");
|
|
|
$din.prepend($addLayout);
|
|
|
$layout.find('.edit-fun-images').append($din);
|
|
|
+
|
|
|
+ if (type === 'photo'){
|
|
|
+ var $btn = $('<div class="descBtn">添加描述</div>')
|
|
|
+ $din.append($btn)
|
|
|
+ that.imgDescBtnBind($btn[0])
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}else{//重传
|
|
|
if (type === 'photo'){
|
|
|
this.activeElem.find("img.bg").remove();
|
|
@@ -2607,11 +2984,11 @@ Hotpoint.prototype.addmediaInit = function() {
|
|
|
// 图片与视频加载
|
|
|
$('.upload, .edit-fun-images').on('change', function(ev) {
|
|
|
if (ev.target.tagName.toUpperCase() === 'INPUT') {
|
|
|
- ev.target.files.length && fileHandle.call(ev.target)
|
|
|
+ ev.target.files.length && fileHandle.call(ev.target, that)
|
|
|
}
|
|
|
})
|
|
|
- imgInput.on('change', (ev)=>{fileHandle.call(ev.target)})
|
|
|
- videoInput.on('change', (ev)=>{fileHandle.call(ev.target)})
|
|
|
+ imgInput.on('change', (ev)=>{fileHandle.call(ev.target, that)})
|
|
|
+ videoInput.on('change', (ev)=>{fileHandle.call(ev.target, that)})
|
|
|
|
|
|
|
|
|
|
|
@@ -2658,10 +3035,44 @@ Hotpoint.prototype.addmediaInit = function() {
|
|
|
}
|
|
|
|
|
|
|
|
|
+Hotpoint.prototype.imgDescBtnUpdate = function(btn){//图片描述按钮状态更新
|
|
|
+ var $btn = $(btn)
|
|
|
+ /* if(index == void 0){
|
|
|
+ var btns = Array.from(this.hotpointDetail.find("[name=photo] .list .descBtn"))
|
|
|
+ index = btns.indexOf(btn)
|
|
|
+ } */
|
|
|
+ var desc = btn.desc
|
|
|
+ if(desc == void 0 || desc === ''){
|
|
|
+ $btn.removeClass('hasDesc')
|
|
|
+ $btn.text('添加描述')
|
|
|
+ }else{
|
|
|
+ $btn.addClass('hasDesc')
|
|
|
+ $btn.text('查看描述')
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
|
|
|
+Hotpoint.prototype.imgDescBtnBind = function(btn, desc){//图片描述按钮事件
|
|
|
+ //console.log('imgDescBtnBind',btn)
|
|
|
+ var textarea = this.hotpointDetail.find('li[name="photo"] textarea');
|
|
|
+ var title = this.hotpointDetail.find('li[name="photo"] [name="descTitle"]')
|
|
|
+ btn.addEventListener('click',()=>{
|
|
|
+ this.hotpointDetail.find("[name=photo] .list .descBtn").removeClass('chosen')
|
|
|
+ $(btn).addClass('chosen');
|
|
|
+ textarea.removeClass('hide')
|
|
|
+ title.removeClass('hide')
|
|
|
+ /* textarea.val(btn.desc)
|
|
|
+ textarea[0].currentBtn = btn */
|
|
|
+ this.imgDescBtnChose(btn)
|
|
|
+ })
|
|
|
+ btn.desc = desc || ''
|
|
|
+}
|
|
|
|
|
|
-
|
|
|
+Hotpoint.prototype.imgDescBtnChose = function(btn){
|
|
|
+ var textarea = this.hotpointDetail.find('li[name="photo"] textarea');
|
|
|
+ textarea[0].currentBtn = btn
|
|
|
+ textarea.val(btn ? btn.desc : '');
|
|
|
+}
|
|
|
|
|
|
|
|
|
|
|
@@ -2702,7 +3113,11 @@ Hotpoint.prototype.addHot = function(that) {
|
|
|
position : player.intersect.point.clone() ,
|
|
|
rotation : [0,0,0],
|
|
|
scale: new THREE.Vector3(s,s,0.02),
|
|
|
- actionType : CloneObject(settings.hotClickEvent[g_HotStatus])
|
|
|
+ actionType : CloneObject(settings.hotClickEvent[g_HotStatus]),
|
|
|
+
|
|
|
+ titlePos: this.latestTitlePos,
|
|
|
+ titleShowType: this.latestTitleShowType,
|
|
|
+
|
|
|
});
|
|
|
hot.photoHasRequestLoad = hot.modelHasRequestLoad = true;//防止requestDownload
|
|
|
player.model.hots[sid] = hot;
|
|
@@ -2721,7 +3136,9 @@ Hotpoint.prototype.addHot = function(that) {
|
|
|
|
|
|
g_HotStatus = false;
|
|
|
player.mouseCouldBeClickToMove = false;
|
|
|
- $("#player").css("cursor", "");
|
|
|
+ //$("#player").css("cursor", "");
|
|
|
+ CursorDeal.remove('addHot' )
|
|
|
+ CursorDeal.remove('noIntersect' )
|
|
|
|
|
|
this.addHotList(hot)
|
|
|
this.editHot(hot)
|
|
@@ -2800,7 +3217,10 @@ Hotpoint.prototype.editDone = function(){
|
|
|
hot.isNew = false;
|
|
|
transformControls.detach()
|
|
|
this.hotpointDetail.addClass("atRight");
|
|
|
+ $('#hotpointDetail .shotImg.innerBtn')[0].cameraData = null
|
|
|
|
|
|
+ this.setCameraBtn(false)
|
|
|
+ this.imgDescCheckBox.updateChoseAtUI(false)
|
|
|
|
|
|
}
|
|
|
|
|
@@ -3013,7 +3433,19 @@ Hotpoint.prototype.saveHot = function() {
|
|
|
let info = that.photoList.findChosenByContent(that.photoList, hot.texMedia);
|
|
|
info.item.animateInfo = CloneObject(hot.info.animateInfo)
|
|
|
}
|
|
|
- hot.setTitleElem()//更新名称
|
|
|
+
|
|
|
+ if(that.actionCheckBox.checked('fastTran')){
|
|
|
+ hot.info.cameraData = $('#hotpointDetail .shotImg.innerBtn')[0].cameraData
|
|
|
+ }else{
|
|
|
+ delete hot.info.cameraData
|
|
|
+ }
|
|
|
+
|
|
|
+ hot.info.imagesDesc = Array.from(that.hotpointDetail.find("[name=photo] .list .descBtn")).map(btn=>btn.desc)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //hot.setTitleElem()//更新名称
|
|
|
|
|
|
that.setListLi(hot);
|
|
|
|
|
@@ -3166,7 +3598,7 @@ EditGuide.prototype.snapATourView = function(renew, insideFolder){
|
|
|
ev.initMouseEvent("snapshotBegin", true, true, document.defaultView, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
|
|
|
g_snapShotWidth = 200;
|
|
|
g_snapShotHeight = 140;
|
|
|
- window.screenSta = 'tour';
|
|
|
+ //window.screenSta = 'tour';
|
|
|
// 记录当前哪个功能截屏, 因为导览截屏需要做额外的校对调整, 初始画面截屏不需要
|
|
|
ev.__callback = (imgData, info)=> {
|
|
|
this.uploadGuide(imgData, info, renew, insideFolder)
|