|
@@ -19,6 +19,23 @@ function reData(data, type) {
|
|
|
return JSON.stringify(data) == type ? null : data
|
|
|
}
|
|
|
|
|
|
+let strictInputNum = function(e, precision, min=0,max){//precision:保留小数位数
|
|
|
+ var value = e.target.value.trim();
|
|
|
+ var lastOne = value[value.length-1];
|
|
|
+ var preContent = value.substr(0,value.length-1)
|
|
|
+ var hasPoint = precision > 0 && lastOne == '.' ;
|
|
|
+
|
|
|
+ var a = Math.pow(10, precision)
|
|
|
+ value = parseFloat(value) || 0;
|
|
|
+ if(isNaN(value)){
|
|
|
+ e.target.value = preContent //还原
|
|
|
+ return
|
|
|
+ }
|
|
|
+ e.target.value = Math.max(min, parseInt(value * a) / a )
|
|
|
+
|
|
|
+ hasPoint && (e.target.value += '.')//补小数点
|
|
|
+}
|
|
|
+
|
|
|
//新编辑界面
|
|
|
var EditTools = function(n) {
|
|
|
//main2018 里面的主要对象
|
|
@@ -216,7 +233,7 @@ EditTools.prototype.initSaveAll = function() {
|
|
|
// 鼠标标志颜色
|
|
|
momentTour: $('#tourSwitch input').is(':checked') ? 'black' : 'walk',
|
|
|
// 导览瞬间过渡
|
|
|
- showHotListSta: $('#hotListSwitch input').is(':checked'),
|
|
|
+ showHotListSta: $('#hotListSwitch').is(':checked'),
|
|
|
// 开启热点列表
|
|
|
hotIconScale: DATA.hotIconScale,
|
|
|
// 热点缩放
|
|
@@ -230,20 +247,16 @@ EditTools.prototype.initSaveAll = function() {
|
|
|
cadBorderWidth: $('#cad-size').val(),
|
|
|
showCad: $('input[name="show-cad"]').is(':checked'),
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- /* console.log("保存数据");
|
|
|
- console.log({
|
|
|
- guides: reData(guides, '[]'),
|
|
|
- info: info,
|
|
|
- })
|
|
|
- console.log(JSON.stringify(guides) )
|
|
|
-
|
|
|
- debugger; */
|
|
|
-
|
|
|
+
|
|
|
|
|
|
-
|
|
|
+ var data = {
|
|
|
+ sceneCode: number,
|
|
|
+ hots: reData(that.hotpoint.getSavingInfo(), '{}'),
|
|
|
+ name: number,
|
|
|
+ guides: reData(guides, '[]'),
|
|
|
+ info: info,
|
|
|
+ }
|
|
|
+ console.log(data)
|
|
|
let url = cmp ? ('/api/scene/edit/' + cmp) : '/manage/scene/edit'
|
|
|
$.ajax({
|
|
|
method: 'POST',
|
|
@@ -254,15 +267,7 @@ EditTools.prototype.initSaveAll = function() {
|
|
|
dataType: 'json',
|
|
|
contentType: 'application/json',
|
|
|
url: ceshi + url,
|
|
|
- data: JSON.stringify({
|
|
|
- sceneCode: number,
|
|
|
- hots: reData(that.hotpoint.getSavingInfo(), '{}'),
|
|
|
- name: number,
|
|
|
- guides: reData(guides, '[]'),
|
|
|
- info: info,
|
|
|
- //tourAudio: reData(that.editGuide.getTourAudio(), '{}'),
|
|
|
- //overlays: reData(overlayInfo, '[]')
|
|
|
- }),
|
|
|
+ data: JSON.stringify(data),
|
|
|
success: function(data) {
|
|
|
if (data.code === 0) {//成功
|
|
|
//manage.showInfo("保存成功")
|
|
@@ -300,9 +305,9 @@ SceneInformation.prototype.init = function(data, data2) {
|
|
|
/*******************方奕卓 其他项需要用到data来初始化, 故一并放到这里 ******************/
|
|
|
let momentTour = $('#tourSwitch input');
|
|
|
// 导览瞬间过渡开关
|
|
|
- let hotListSwitch = $('#hotListSwitch input');
|
|
|
+ let hotListSwitch = $('#hotListSwitch');
|
|
|
// 热点列表开关
|
|
|
- let hotIconScale = $('#hotIconScale input');
|
|
|
+ let hotIconScale = $('#hotIconScale');
|
|
|
// 热点图标缩放
|
|
|
let VRSwitch = $('#VRSwitch input');
|
|
|
// VR功能开启
|
|
@@ -651,38 +656,48 @@ Hotpoint.prototype.init = function() {
|
|
|
|
|
|
this.hotpointDetail.find(".tail .submit").on('click', this.saveHot.bind(this))
|
|
|
|
|
|
+ {
|
|
|
+ let ui = $('#hotIconScale input')
|
|
|
+ let min = parseFloat(ui.attr('min'));
|
|
|
+ let max = parseFloat(ui.attr('max'));
|
|
|
+ ui.on("change", function(e) {
|
|
|
+ var s = THREE.Math.clamp(parseFloat(e.target.value), min, max)
|
|
|
+ if(isNaN(s))s = 1
|
|
|
+ e.target.value = s
|
|
|
+ DATA.hotIconScale = s
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
- $('#hotIconScale input').on("change", function(e) {
|
|
|
- var s = THREE.Math.clamp(parseFloat(e.target.value), 0.1, 100)
|
|
|
- e.target.value = s
|
|
|
- DATA.hotIconScale = s
|
|
|
+ this.isSpriteCheckBox = new CheckBox({dom: $("#isSprite"),
|
|
|
+ uiCallBack : (checked)=>{
|
|
|
+
|
|
|
+ },
|
|
|
+ callbackWhenChose:(checked)=>{
|
|
|
+ that.editSpot.info.isSprite = checked;
|
|
|
+ if(checked) {
|
|
|
+ that.editSpot.update(player)
|
|
|
+ }else{
|
|
|
+ that.editSpot.rotation.copy(that.editSpot.info.rotation)
|
|
|
+ }
|
|
|
+ }
|
|
|
})
|
|
|
-
|
|
|
-
|
|
|
- $("#isSprite").on("change", function(e) {
|
|
|
- that.editSpot.info.isSprite = this.checked;
|
|
|
- if (this.checked) {
|
|
|
- that.editSpot.update(player)
|
|
|
- } else {
|
|
|
- that.editSpot.rotation.copy(that.editSpot.info.rotation)
|
|
|
- /* var curPanoTransform = that.editSpot.transformAtPanos[ getTransformSid()] || {}
|
|
|
- that.editSpot.plane.quaternion.copy(curPanoTransform.qua || that.editSpot.quaternion) */
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
-
|
|
|
- {//clickEvent
|
|
|
- let checkboxs = this.hotpointDetail.find("li[name='clickEvent'] li.editCheckbox input");
|
|
|
- checkboxs.on("change", function(e) {
|
|
|
- var name = $(this).attr('name')
|
|
|
- that.editSpot.info.actionType[name] = !!this.checked;
|
|
|
+
|
|
|
+ //clickEvent
|
|
|
+ this.actionCheckBox = new CheckBox({dom: this.hotpointDetail.find("li[name='clickEvent'] li.editCheckbox input"),
|
|
|
+ uiCallBack : (checked, name)=>{
|
|
|
if(name == 'openHot'){
|
|
|
var content = that.hotpointDetail.find("li[name='content']")
|
|
|
- this.checked ? content.removeClass('hide') : content.addClass('hide')
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
+ checked ? content.removeClass('hide') : content.addClass('hide')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ callbackWhenChose:(checked, name)=>{
|
|
|
+ that.editSpot.info.actionType[name] = !!checked;
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
//点击添加热点按钮
|
|
@@ -734,7 +749,7 @@ Hotpoint.prototype.init = function() {
|
|
|
}
|
|
|
|
|
|
|
|
|
- player.model.hotGroup.children.forEach(hot=>{//还原所有同时修改了的贴图和模型
|
|
|
+ this.tempInfos && player.model.hotGroup.children.forEach(hot=>{//还原所有同时修改了的贴图和模型
|
|
|
var info = this.tempInfos[hot.sid]
|
|
|
if(hot.texType == 'shine'){
|
|
|
hot.changeTexType(hot.texType, info.styleImg )
|
|
@@ -780,9 +795,23 @@ Hotpoint.prototype.init = function() {
|
|
|
})
|
|
|
|
|
|
|
|
|
+ this.panoTransformCheckBox = new CheckBox({dom: $('#setPosForPano input') ,
|
|
|
+ uiCallBack : (checked, name)=>{
|
|
|
+
|
|
|
+ },
|
|
|
+ callbackWhenChose:(checked, name)=>{
|
|
|
+ if(!checked){
|
|
|
+ delete this.editSpot.info.transformAtPanos[getTransformSid()]
|
|
|
+ this.editSpot.position.copy(this.editSpot.info.position)
|
|
|
+ //this.editSpot.quaternion.copy(this.editSpot.quaternion)
|
|
|
+ }else{
|
|
|
+ this.getTransformAtPano('position')
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
|
|
|
-
|
|
|
- $('#setPosForPano input').on("change", ()=>{
|
|
|
+ /* $('#setPosForPano input').on("change", ()=>{
|
|
|
var on = $('#setPosForPano input').is(':checked')
|
|
|
if(!on){
|
|
|
delete this.editSpot.info.transformAtPanos[getTransformSid()]
|
|
@@ -791,11 +820,13 @@ Hotpoint.prototype.init = function() {
|
|
|
}else{
|
|
|
this.getTransformAtPano('position')
|
|
|
}
|
|
|
- })
|
|
|
+ }) */
|
|
|
|
|
|
|
|
|
//是否显示模型线框
|
|
|
this.wireframeModel = new THREE.Object3D;
|
|
|
+
|
|
|
+
|
|
|
$('#wireframeSwitch input').on('change',(e)=>{
|
|
|
var visi = e.target.checked;
|
|
|
if(visi && this.wireframeModel.children.length == 0){
|
|
@@ -823,47 +854,40 @@ Hotpoint.prototype.init = function() {
|
|
|
|
|
|
|
|
|
//动画
|
|
|
- $("#gifSwitch input").on("change", (e)=>{
|
|
|
- var on = e.target.checked
|
|
|
- $("#gifInfoEdit").css({display: on ? 'block' : 'none'})
|
|
|
- if(on){
|
|
|
- that.editSpot.info.animateInfo = {
|
|
|
- cellXcount : parseInt($("#gifXCount").val()),
|
|
|
- cellYcount : parseInt($("#gifYCount").val()),
|
|
|
- voidCount : parseInt($("#voidCount").val()),
|
|
|
- loop : true,
|
|
|
- duration : parseFloat($("#gifDuration").val()) * 1000
|
|
|
- }
|
|
|
- that.editSpot.animation = GifTexDeal.addAnimation(that.editSpot.material_.map, that.editSpot, this.editSpot.info.animateInfo, this.editSpot.sid)
|
|
|
- GifTexDeal.start(that.editSpot.animation)
|
|
|
- }else{
|
|
|
- GifTexDeal.remove(that.editSpot.animation)
|
|
|
- that.editSpot.info.animateInfo = null
|
|
|
+
|
|
|
+ this.gifCheckBox = new CheckBox({dom: $("#gifSwitch input"),
|
|
|
+ uiCallBack : (checked )=>{
|
|
|
+ $("#gifInfoEdit").css({display: checked ? 'block' : 'none'})
|
|
|
+
|
|
|
+ },
|
|
|
+ callbackWhenChose:(checked )=>{
|
|
|
+ if(checked){
|
|
|
+ that.editSpot.info.animateInfo = {
|
|
|
+ cellXcount : parseInt($("#gifXCount").val()),
|
|
|
+ cellYcount : parseInt($("#gifYCount").val()),
|
|
|
+ voidCount : parseInt($("#voidCount").val()),
|
|
|
+ loop : true,
|
|
|
+ duration : parseFloat($("#gifDuration").val()) * 1000
|
|
|
+ }
|
|
|
+ that.editSpot.animation = GifTexDeal.addAnimation(that.editSpot.material_.map, that.editSpot, this.editSpot.info.animateInfo, this.editSpot.sid)
|
|
|
+ GifTexDeal.start(that.editSpot.animation)
|
|
|
+ }else{
|
|
|
+ GifTexDeal.remove(that.editSpot.animation)
|
|
|
+ that.editSpot.info.animateInfo = null
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
- })
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
{//gif动画 input
|
|
|
|
|
|
- let strictInputNum = function(e, precision, min=0,max){//precision:保留小数位数
|
|
|
- var value = e.target.value.trim();
|
|
|
- var lastOne = value[value.length-1];
|
|
|
- var preContent = value.substr(0,value.length-1)
|
|
|
- var hasPoint = precision > 0 && lastOne == '.' ;
|
|
|
-
|
|
|
- var a = Math.pow(10, precision)
|
|
|
- value = parseFloat(value) || 0;
|
|
|
- if(isNaN(value)){
|
|
|
- e.target.value = preContent //还原
|
|
|
- return
|
|
|
- }
|
|
|
- e.target.value = Math.max(min, parseInt(value * a) / a )
|
|
|
-
|
|
|
- hasPoint && (e.target.value += '.')//补小数点
|
|
|
- }
|
|
|
let changeAnimation = function(){
|
|
|
- GifTexDeal.setRepeart(that.editSpot.animation)
|
|
|
-
|
|
|
+ GifTexDeal.setRepeart(that.editSpot.animation.animation)
|
|
|
+ that.useSuitableRatio()
|
|
|
}
|
|
|
let restartAnimation = function(){
|
|
|
GifTexDeal.stop(that.editSpot.animation)
|
|
@@ -973,8 +997,8 @@ Hotpoint.prototype.init = function() {
|
|
|
$("#voidCount").on('change',(e)=>{
|
|
|
strictInputNum(e, 0);
|
|
|
that.editSpot.info.animateInfo.voidCount = parseInt(e.target.value)
|
|
|
- changeFrameCount()
|
|
|
- changeAnimation()
|
|
|
+ changeFrameCount()
|
|
|
+ restartAnimation()
|
|
|
})
|
|
|
|
|
|
|
|
@@ -1023,12 +1047,12 @@ Hotpoint.prototype.init = function() {
|
|
|
this.hotpointDetail.find('[name=boxDepthPanel]').removeClass('hide')
|
|
|
this.updateBoxDepthPanel()
|
|
|
this.hotpointDetail.find('[name=uploadObj]').addClass('hide')
|
|
|
-
|
|
|
+ transformControls.unableScaleZ()
|
|
|
|
|
|
}else{
|
|
|
this.hotpointDetail.find('[name=boxDepthPanel]').addClass('hide')
|
|
|
this.hotpointDetail.find('[name=uploadObj]').removeClass('hide')
|
|
|
- //transformControls.enableScaleZ()
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|
|
@@ -1100,28 +1124,17 @@ Hotpoint.prototype.editHot = function(hot, $li) {
|
|
|
this.getTempInfo(hot)
|
|
|
hot.visible = true
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- this.updatePano()
|
|
|
-
|
|
|
+
|
|
|
|
|
|
-
|
|
|
+ this.updatePano()
|
|
|
this.updateListSelect(hot);
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- /* if(hot.infoAttribute.hotIconScale){
|
|
|
- $("#hotpointDetail .scale .MenuOptions li[index=user]").click()
|
|
|
- }else $("#hotpointDetail .scale .MenuOptions li[index=default]").click() */
|
|
|
-
|
|
|
-
|
|
|
- $("#isSprite")[0].checked = this.editSpot.isSprite
|
|
|
-
|
|
|
- /* this.hotpointDetail.find(".MenuOptions[name='linkType'] li").removeClass("chosen")
|
|
|
- this.hotpointDetail.find(".MenuOptions[name='linkType'] li[index = " + this.editSpot.linkType+"]").addClass("chosen")
|
|
|
- */
|
|
|
+
|
|
|
+ //$("#isSprite")[0].checked = this.editSpot.info.isSprite
|
|
|
+ this.isSpriteCheckBox.updateChoseAtUI(this.editSpot.info.isSprite)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
this.linkTypeMenuOptions.updateChoseAtUI({name:this.editSpot.info.linkType})
|
|
|
|
|
|
|
|
@@ -1181,19 +1194,24 @@ Hotpoint.prototype.getTempInfo = function(hot) { // 编辑前, 从当前状
|
|
|
hot.tempInfo.media = hot.texMedia
|
|
|
hot.tempInfo.objObject = hot.objObject
|
|
|
|
|
|
- this.tempInfos = {}
|
|
|
|
|
|
- player.model.hotGroup.children.forEach(hot=>{
|
|
|
- this.tempInfos[hot.sid] = {
|
|
|
- styleImg : hot.styleImg,
|
|
|
- texMedia : hot.texMedia,
|
|
|
- objObject : hot.objObject,
|
|
|
- scale : hot.scale.clone()
|
|
|
- }
|
|
|
- })
|
|
|
+ this.getTempInfos()
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+Hotpoint.prototype.getTempInfos = function(){
|
|
|
+ if(Hot.allPhotoLoaded && Hot.allModelLoaded){
|
|
|
+ this.tempInfos = {}
|
|
|
+
|
|
|
+ player.model.hotGroup.children.forEach(hot=>{
|
|
|
+ this.tempInfos[hot.sid] = {
|
|
|
+ styleImg : hot.styleImg,
|
|
|
+ texMedia : hot.texMedia,
|
|
|
+ objObject : hot.objObject,
|
|
|
+ scale : hot.scale.clone()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
Hotpoint.prototype.getTransformAtPano = function(type){
|
|
|
/* var name = getTransformSid()
|
|
@@ -1216,7 +1234,7 @@ Hotpoint.prototype.getTransformAtPano = function(type){
|
|
|
}
|
|
|
|
|
|
Hotpoint.prototype.updateTransform = function(type){
|
|
|
- var on = $('#setPosForPano input').is(':checked')
|
|
|
+ var on = this.panoTransformCheckBox.checked() //$('#setPosForPano input').is(':checked')
|
|
|
//var name = getTransformSid()
|
|
|
if(on && type == 'position'){
|
|
|
this.getTransformAtPano(type)
|
|
@@ -1235,8 +1253,8 @@ Hotpoint.prototype.updateTransform = function(type){
|
|
|
|
|
|
Hotpoint.prototype.updatePano = function(){
|
|
|
if(!this.editSpot ) return;
|
|
|
- $('#setPosForPano input').prop('checked', !!this.editSpot.info.transformAtPanos[getTransformSid()]);
|
|
|
-
|
|
|
+ //$('#setPosForPano input').prop('checked', !!this.editSpot.info.transformAtPanos[getTransformSid()]);
|
|
|
+ this.panoTransformCheckBox.updateChoseAtUI(!!this.editSpot.info.transformAtPanos[getTransformSid()])
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1544,12 +1562,13 @@ Hotpoint.prototype.initListSelect = function(){//热点样式图列表
|
|
|
div.css("background-image", 'url("'+media.src+'")')
|
|
|
//应用到热点:
|
|
|
if(!o.dontApplyToHot){
|
|
|
- this.editSpot.changeTexType("photo", media || 'clear' )
|
|
|
- this.useSuitableRatio( )
|
|
|
- this.updateGifPanel({animateInfo: this.photoList.chosenItem[0].animateInfo })
|
|
|
+ this.editSpot.changeTexType("photo", media || 'clear' )
|
|
|
+ this.updateGifPanel({animateInfo: this.photoList.chosenItem[0].animateInfo })
|
|
|
+ this.useSuitableRatio()
|
|
|
}else{
|
|
|
this.updateGifPanel({on: !!this.photoList.chosenItem[0].animateInfo })
|
|
|
}
|
|
|
+
|
|
|
//$('#gifEdit').removeClass('hide');
|
|
|
|
|
|
}else{
|
|
@@ -1955,7 +1974,7 @@ Hotpoint.prototype.initListSelect = function(){//热点样式图列表
|
|
|
|
|
|
this.texLists[editItemInfo.type].addNew()
|
|
|
this.texLists[editItemInfo.type].selectFromOutSide(editItemInfo.$li.index())
|
|
|
-
|
|
|
+ this.texLists[editItemInfo.type].listDom.addClass('hide')
|
|
|
}
|
|
|
}, "photo", e);
|
|
|
|
|
@@ -2078,6 +2097,7 @@ Hotpoint.prototype.initListSelect = function(){//热点样式图列表
|
|
|
this.hotpointDetail.find(" li[name=style] .itemTitle").attr('data-size','')
|
|
|
if(this.editSpot){//已经在编辑了,初始化下
|
|
|
this.updateListSelect(this.editSpot)
|
|
|
+ this.getTempInfos()
|
|
|
}
|
|
|
|
|
|
this.hotpointDetail.find(" li[name=setPos] button[name=setSpace] ").on('click',(e)=>{
|
|
@@ -2113,6 +2133,7 @@ Hotpoint.prototype.switchModel = function(o={}){
|
|
|
transformControls.enableScaleZ()
|
|
|
}
|
|
|
}else if(o.remove){
|
|
|
+ //如果没有出现plane,很可能是因为背面朝向镜头了!
|
|
|
o.spot.addPlane()
|
|
|
if(o.spot == this.editSpot) transformControls.unableScaleZ()
|
|
|
}
|
|
@@ -2186,8 +2207,9 @@ Hotpoint.prototype.updateGifPanel = function(o={}){
|
|
|
|
|
|
|
|
|
if(o.on != void 0){
|
|
|
- $("#gifSwitch input").prop('checked', o.on);
|
|
|
- $("#gifInfoEdit").css({display: o.on ? 'block' : 'none'})
|
|
|
+
|
|
|
+ this.gifCheckBox.updateChoseAtUI(o.on)
|
|
|
+
|
|
|
|
|
|
GifTexDeal.remove(hot.animation)
|
|
|
if(o.on){
|
|
@@ -2280,6 +2302,7 @@ Hotpoint.prototype.updateListSelect = function(hot) { //每次开始编辑热点
|
|
|
if(hasModel){
|
|
|
var info = this.modelList.findChosenByContent(hot.objObject)
|
|
|
this.modelList.selectFromOutSide(info.index, {dontApplyToHot:true})
|
|
|
+ transformControls.enableScaleZ()
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2315,6 +2338,14 @@ Hotpoint.prototype.useSuitableRatio = function(o={}) {//自适应素材比例
|
|
|
mediaW = hot.texMedia.width;
|
|
|
mediaH = hot.texMedia.height;
|
|
|
//动画的话再变
|
|
|
+
|
|
|
+
|
|
|
+ if(hot.info.animateInfo){
|
|
|
+ mediaW /= hot.info.animateInfo.cellXcount
|
|
|
+ mediaH /= hot.info.animateInfo.cellYcount
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}else{
|
|
|
mediaW = hot.texMedia.videoWidth || hot.videoWidth || 1;
|
|
|
mediaH = hot.texMedia.videoHeight || hot.videoHeight || 1;
|
|
@@ -2343,7 +2374,7 @@ Hotpoint.prototype.useSuitableRatio = function(o={}) {//自适应素材比例
|
|
|
|
|
|
Hotpoint.prototype.updateClickEventUI = function() {//根据actionType更新ui
|
|
|
var hot = this.editSpot;
|
|
|
- var checkboxs = this.hotpointDetail.find("li[name='clickEvent'] li.editCheckbox");
|
|
|
+ /* var checkboxs = this.hotpointDetail.find("li[name='clickEvent'] li.editCheckbox");
|
|
|
checkboxs.addClass('hide');
|
|
|
|
|
|
for(let i in hot.info.actionType){
|
|
@@ -2353,7 +2384,13 @@ Hotpoint.prototype.updateClickEventUI = function() {//根据actionType更新ui
|
|
|
}
|
|
|
|
|
|
var content = this.hotpointDetail.find("li[name='content']")
|
|
|
- hot.info.actionType.openHot ? content.removeClass('hide') : content.addClass('hide')
|
|
|
+ hot.info.actionType.openHot ? content.removeClass('hide') : content.addClass('hide') */
|
|
|
+
|
|
|
+ for(let i in hot.info.actionType){
|
|
|
+ this.actionCheckBox.updateChoseAtUI(hot.info.actionType[i], i)
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
//添加图片和视频
|
|
@@ -2584,6 +2621,7 @@ Hotpoint.prototype.addHot = function(that) {
|
|
|
scale: new THREE.Vector3(s,s,0.02),
|
|
|
actionType : CloneObject(settings.hotClickEvent[g_HotStatus])
|
|
|
});
|
|
|
+ hot.photoHasRequestLoad = hot.modelHasRequestLoad = true;//防止requestDownload
|
|
|
player.model.hots[sid] = hot;
|
|
|
hot.hasRequestLoad = true
|
|
|
hot.isNew = true
|
|
@@ -2731,6 +2769,7 @@ Hotpoint.prototype.saveHot = function() {
|
|
|
//获取图片路径
|
|
|
upload($images, 'images', resolve)
|
|
|
}).then(function(imgUrls) {
|
|
|
+ $layout.removeClass('hide');
|
|
|
args.images = imgUrls
|
|
|
//获取视频路径
|
|
|
return new Promise(function(resolve, reject) {
|
|
@@ -2738,6 +2777,7 @@ Hotpoint.prototype.saveHot = function() {
|
|
|
}
|
|
|
)
|
|
|
}).then(function(videoUrls) {
|
|
|
+ $layout.removeClass('hide');
|
|
|
args.video = videoUrls
|
|
|
//获取视频封面路径
|
|
|
return new Promise(function(resolve, reject) {
|
|
@@ -2745,6 +2785,7 @@ Hotpoint.prototype.saveHot = function() {
|
|
|
}
|
|
|
)
|
|
|
}).then(function(thums) {
|
|
|
+ $layout.removeClass('hide');
|
|
|
args.video = args.video.map(function(video, index) {//整合视频+封面
|
|
|
return {
|
|
|
url: video,
|
|
@@ -2754,6 +2795,7 @@ Hotpoint.prototype.saveHot = function() {
|
|
|
}).then(function() {
|
|
|
//获取热点音乐所有的路径
|
|
|
//console.log($miusc)
|
|
|
+ $layout.removeClass('hide');
|
|
|
if ($miusc[0].files.length > 0) {
|
|
|
return new Promise(function(resolve) {
|
|
|
upload($miusc, 'miusc', function(res) {
|
|
@@ -2777,7 +2819,7 @@ Hotpoint.prototype.saveHot = function() {
|
|
|
var doneNum = 0;
|
|
|
var filesNeedSave = [];
|
|
|
var liNeedSave = [], liNeedSave2 = []
|
|
|
-
|
|
|
+ $layout.removeClass('hide');
|
|
|
|
|
|
Array.from(that.styleList.listDom.children()).forEach(li=>{
|
|
|
if(li.sameContentSpots.length == 0)return;//没被热点用到就不保存
|
|
@@ -2827,9 +2869,7 @@ Hotpoint.prototype.saveHot = function() {
|
|
|
spot.info.styleImg = li._styleImg.map(img=>img.src)
|
|
|
}else{
|
|
|
spot.info.texSrc = li._media.src
|
|
|
- spot.texMedia.src = li._media.src // error 跨域
|
|
|
- //spot.texMedia = Texture.load()
|
|
|
- //spot.texMedia.fileSrc = li._media.src
|
|
|
+ spot.texMedia.src = li._media.src
|
|
|
}
|
|
|
})
|
|
|
})
|
|
@@ -2852,6 +2892,7 @@ Hotpoint.prototype.saveHot = function() {
|
|
|
|
|
|
|
|
|
}).then(function() {
|
|
|
+ $layout.removeClass('hide');
|
|
|
//获取热点标题、内容、内嵌网页、模型网页。
|
|
|
args.title = $title.val()
|
|
|
args.content = $content.val()
|
|
@@ -2948,9 +2989,7 @@ Hotpoint.prototype.getSavingInfo = function(){//保存全部
|
|
|
hotData.scale = toPrecision(hot.info.scale.toArray(), 3)
|
|
|
hotData.rotation = toPrecision(hot.info.rotation.toArray().slice(0,3), 4)
|
|
|
hotData.order = index
|
|
|
- /* if(!hot.texType == 'video'){
|
|
|
- hotData.fileName = hot.texMedia.name
|
|
|
- } */
|
|
|
+
|
|
|
hotData.transformAtPanos = {}
|
|
|
for(let i in hot.info.transformAtPanos){
|
|
|
hotData.transformAtPanos[i] = {
|
|
@@ -2966,6 +3005,15 @@ Hotpoint.prototype.getSavingInfo = function(){//保存全部
|
|
|
delete hotData.animateInfo
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ hotData.model = hotData.model.length ? hotData.model : ''
|
|
|
+ hotData.images = hotData.images.length ? hotData.images : ''
|
|
|
+ hotData.video = hotData.video.length ? hotData.video : ''
|
|
|
+ hotData.iframe = hotData.iframe.length ? hotData.iframe : ''
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
hots[hot.sid] = hotData
|
|
|
})
|
|
|
|
|
@@ -3226,7 +3274,28 @@ EditGuide.prototype.init = function(data, data2) {
|
|
|
this.momentMenuOptions = new MenuOptions({ //链接打开方式切换
|
|
|
dom: $(" #tourSwitch_Slice ")
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ this.rotCheckBox = new CheckBox({dom: $('#tourItemEdit [name="rotSwitch"] input') ,
|
|
|
+ uiCallBack : (checked )=>{
|
|
|
+
|
|
|
+ },
|
|
|
+ callbackWhenChose:(checked )=>{
|
|
|
+ this.editingItemLi.tourData.dontRot = checked ? 0 : 1
|
|
|
+ }
|
|
|
+ })
|
|
|
+ {
|
|
|
+ let ui = $('#tourItemEdit [name="rotTime"] input')
|
|
|
+ let min = parseFloat(ui.attr('min'));
|
|
|
+ let max = parseFloat(ui.attr('max'));
|
|
|
+ ui.on("change", function(e) {
|
|
|
+ var s = THREE.Math.clamp(parseFloat(e.target.value), min, max)
|
|
|
+ if(isNaN(s))s = ''
|
|
|
+ e.target.value = s
|
|
|
+ that.editingItemLi.tourData.rotTime = s
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -3339,11 +3408,18 @@ EditGuide.prototype.editItem = function(li) {
|
|
|
$('#tourItemEdit').removeClass('atRight');
|
|
|
$('#tourItemEdit .tourName input').val( $(li).find('.guide-name').text() );
|
|
|
|
|
|
+ $('#tourItemEdit [name="rotTime"] input').val(parseFloat(li.tourData.rotTime))
|
|
|
+
|
|
|
+
|
|
|
var momentTour = li.tourData.momentTour || "default"
|
|
|
/* $("#tourSwitch_Slice li").removeClass('chosen')
|
|
|
$("#tourSwitch_Slice li[index="+ momentTour +"]").addClass('chosen'); */
|
|
|
this.momentMenuOptions.updateChoseAtUI({name:momentTour})
|
|
|
|
|
|
+ this.rotCheckBox.updateChoseAtUI(!li.tourData.dontRot)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
var metadata = JSON.parse(li.tourData.metadata);
|
|
|
if(metadata.scan_id != 'outside'){
|
|
|
var pano = player.model.panos.index[metadata.scan_id]
|
|
@@ -3384,7 +3460,7 @@ EditGuide.prototype.completeFolder = function(){//点击完成
|
|
|
|
|
|
var momentTour = this.momentFolderMenuOptions.getSelectName()//$("#folderTourSwitch li.chosen").attr("index");
|
|
|
this.editingFolderLi.tourData.momentTour = momentTour != 'default' ? momentTour : null;
|
|
|
-
|
|
|
+ this.editingFolderLi.tourData.name = tourName
|
|
|
|
|
|
|
|
|
this.editingFolderLi.tourItemDoms = Array.from($('#tourItemList ul li'));
|
|
@@ -3490,6 +3566,7 @@ EditGuide.prototype.cancelFolder = function(){//放弃编辑
|
|
|
this.editingFolderLi.tourData = this.editingFolderLi.tempData;//还原
|
|
|
this.editingFolderLi.tourItemDoms.forEach((e,i)=>{
|
|
|
e.tourData = this.editingFolderLi.tourData.locations[i]
|
|
|
+ $(e).find('.guide-name').text(e.tourData.name)
|
|
|
$(e).find('#tourBg')[0].style.backgroundImage = 'url(' + e.tourData.thumbnail_signed_src + ')';
|
|
|
})
|
|
|
|
|
@@ -5342,6 +5419,7 @@ var VisiSet = {
|
|
|
player.model.hots[i].material_.depthTest = false;
|
|
|
|
|
|
player.model.hots[i].position.copy(player.model.hots[i].info.position);//覆盖transformAtPanos
|
|
|
+ player.model.hots[i].update(player)
|
|
|
}
|
|
|
this.setDisplay(true)
|
|
|
this.updateFootIconSize()
|
|
@@ -5783,27 +5861,54 @@ class MenuOptions extends ButtonBase{
|
|
|
|
|
|
|
|
|
|
|
|
-class checkBox extends ButtonBase{
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+class CheckBox extends ButtonBase{
|
|
|
constructor(o={}){
|
|
|
super(o)
|
|
|
+ this.dom.on("change",(e)=>{
|
|
|
+ var name = $(e.target).attr('name')
|
|
|
+ this.uiCallBack && this.uiCallBack(e.target.checked, name)
|
|
|
+ this.callbackWhenChose && this.callbackWhenChose(e.target.checked, name)
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ updateChoseAtUI(checked, name){
|
|
|
+ var dom
|
|
|
+ if(name) dom = this.dom.filter('[name='+name+']')[0]
|
|
|
+ else dom = this.dom[0]
|
|
|
+ dom.checked = checked //this.dom.prop("checked")
|
|
|
|
|
|
+ this.uiCallBack && this.uiCallBack(checked, name)
|
|
|
+ }
|
|
|
+
|
|
|
+ checked(name){
|
|
|
+ var dom
|
|
|
+ if(name) dom = this.dom.filter('[name='+name+']')[0]
|
|
|
+ else dom = this.dom[0]
|
|
|
+ return dom.checked
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-class onOffSwitch extends checkBox{
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+/* class OnOffSwitch extends CheckBox{
|
|
|
constructor(o={}){
|
|
|
super(o)
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ */
|
|
|
|
|
|
/*
|
|
|
待加功能:
|
|
|
|
|
|
- 完善onOffSwitch checkBox几个类
|
|
|
-
|
|
|
- 平移时增加setSpace("world") 的onOffSwitch
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
//boxhelper改成粗线
|
|
|
|
|
|
热点可视时改成一样大小
|