浏览代码

roomlabel

xzw 3 年之前
父节点
当前提交
ff349494d7
共有 10 个文件被更改,包括 1902 次插入448 次删除
  1. 71 21
      css/lzb.css
  2. 217 4
      css/main.css
  3. 177 87
      edit.html
  4. 1 1
      index.html
  5. 75 12
      js/Hot.js
  6. 9 2
      js/TransformControls.js
  7. 482 50
      js/edit.js
  8. 291 41
      js/main_2020_edit.js
  9. 38 187
      js/main_2020_show.js
  10. 541 43
      js/manage.js

+ 71 - 21
css/lzb.css

@@ -258,12 +258,18 @@ ul.MenuOptions li {
     transition: color 0.1s;
     width: 100%;
     transition: background-color 0.3s;
+    border-right: 1px solid #303030;
+}
+ul.MenuOptions li:last-child{
+    border-right: none;
 }
-
 ul.MenuOptions li.chosen {
     background-color: #00a2d4;
 }
 
+
+
+
 .toolRight div.content {
     border-color: #737373;
     width: calc(100% + 18px);
@@ -294,7 +300,7 @@ ul.MenuOptions li.chosen {
 }
 
 .toolRight .editText {
-    min-height: 200px !important;
+    min-height: 200px;
     line-height: 130% !important;
     padding: 10px;
     text-align: justify;
@@ -759,17 +765,24 @@ ul.MenuOptions li.chosen {
 }
 
 .toolRight .itemTitle {
-    font-size: 16px;
+    font-size: 17px;
     display: flex;
     line-height: 16px;
     position: relative;
 }
-.toolRight li[name="content"]>ul>li .itemTitle{
-    font-size: 12px;
+.toolRight .secondFontSize{
+    font-size: 15px;
+    line-height: 14px;
+}
+.toolRight .thirdFontSize{
+    font-size: 13px;
+    line-height: 12px;
 }
-
 .toolRight li[name="content"]>ul>li {
-    padding-bottom:15px;
+    background: #212121;
+    padding: 8px 5px 8px 10px;
+    margin: 14px 0;
+    border-radius: 2px;
 }
 
 .toolRight .mediaUpload .itemTitle span {
@@ -968,8 +981,8 @@ ul.MenuOptions li.chosen {
     bottom: -2px;
 }
 
-.toolRight .screen .shotImg {
-    height: 108px;
+.toolRight  .shotImg {
+    height: 108px !important;
     border-radius: 5px;
     cursor: pointer;
     line-height: 105px;
@@ -1215,6 +1228,7 @@ ul.MenuOptions li.chosen {
 }
 .toolRight  .itemTitle button, .toolRight .remark  button{
     padding:0 20px;
+    height: 30px;
 } 
 
 .toolRight .upload input {
@@ -1260,14 +1274,14 @@ ul.MenuOptions li.chosen {
 .edit-fun-images>div {
     vertical-align: top;
     float: left;
-    margin: 5px;
+    margin:0 6px 6px 0;
     position: relative;
 }
 
 .edit-fun-images a {
-    width: 96px;
-    height: 96px;
-    border: 1px dashed #fff;
+    width: 92px;
+    height: 92px;
+    border: 1px solid #353535;
     color: #fff;
     text-align: center;
     position: relative;
@@ -1278,26 +1292,36 @@ ul.MenuOptions li.chosen {
     box-sizing: content-box;
 }
 
-.edit-fun-images a.result>span::after {
+/* .edit-fun-images a.result>span::after {
     content: '+'
-}
+} */
 
 .edit-fun-images a.result>span {
     position: absolute;
-    right: -4px;
-    top: -4px;
+    right: 0px;
+    top: 0px;
     width: 20px;
     height: 20px;
     line-height: 20px;
-    transform: rotateZ(45deg);
-    background: #c77a7a;
-    border-radius: 50%;
+    /* transform: rotateZ(45deg); */
+    background-color: #000000c2;
+    /* border-radius: 50%; */
     z-index:1000;
+    background-image: url("../images/phone_step_01.png");
+    background-size: 52%;
+    background-repeat: no-repeat;
+    background-position: center;
+}
+.edit-fun-images a.result>span:hover{
+    background-color: #f13737c2;
 }
-
 .edit-fun-images a.result>img {
     max-width: 100%;
     max-height: 100%;
+    position: absolute;
+    left: 50%;
+    top: 50%;
+    transform: translate(-50%, -50%);
 }
 
 .edit-fun-images a .play-video{
@@ -1328,7 +1352,33 @@ ul.MenuOptions li.chosen {
     z-index: 1;
     cursor: pointer;
 }
+.edit-fun-images .mediaItem .descBtn {
+    position: absolute;
+    left: 0;
+    bottom: 0;
+    width: 100%;
+    color: #e0e0e0;
+    height: 30px;
+    background: #3a3a3ab0; 
+    display:none;
+}
+.edit-fun-images .mediaItem .descBtn:hover{
+    color: #fff;
+}  
+.edit-fun-images .mediaItem .descBtn.hasDesc{
+    background:#000000e0;
+}
 
+.edit-fun-images .mediaItem .descBtn.chosen{
+    border: 1px dashed #fff;
+}
+   
+
+.edit-fun-images.hasDescBtn .descBtn{
+    display:block;
+    cursor:pointer;
+}    
+  
 /* loading */
 
 .edit-loading {

+ 217 - 4
css/main.css

@@ -7112,13 +7112,34 @@ a.hasHover.tag-link:hover {
     user-select: none;
     border-radius: 5px;
     background-color: rgba(34, 34, 34, 0.3);
-    display:none;
-    padding:10px;
-    transform:translate(20px, -50%);
+    /* display:none; */
+    padding:10px; 
     max-width:400px;
     letter-spacing:1px;
     line-height:20px
-}    
+} 
+
+#hot>div[pos='right']{
+    transform:translate(20px, -50%);
+}
+
+#hot>div[pos='top']{
+    transform:translate(-50%, calc(-100% - 20px));
+}
+
+#hot>div[pos='middle']{
+    transform:translate(-50%, -50%);
+}
+
+#hot>div[pos='bottom']{
+    transform:translate(-50%, 20px);
+}
+
+#hot>div[pos='left']{
+    transform:translate(calc(-100% - 20px), -50%);
+}
+
+   
 .resultBox{
     font-family: "Microsoft YaHei";
     position: absolute;
@@ -7170,3 +7191,195 @@ a.hasHover.tag-link:hover {
         opacity: 0;
     }
 }
+
+
+
+
+
+
+
+
+
+/* 
+从 v3搬过来 */
+ 
+.widgets-doll-labels,
+.widgets-plan-labels {
+  overflow: hidden;
+  position: absolute;
+  pointer-events: none;
+  top: 0;
+  left: 0;
+  bottom: 0;
+  right: 0;
+}
+.widgets-doll-labels .room-label {
+  position: absolute;
+  width: 0;
+  height: 0;
+  /*  display: none; */
+  -webkit-transform: translateZ(0);
+  transform: translateZ(0);
+  -webkit-animation: room-label 0.3s ease 0.1s;
+  animation: room-label 0.3s ease 0.1s;
+  -webkit-animation-fill-mode: both;
+  animation-fill-mode: both;
+  cursor: pointer;
+}
+/* .widgets-doll-labels .room-label.visible {
+    display: block
+} */
+.widgets-doll-labels .room-label:not(.noLine):after {
+  content: "";
+  display: block;
+  position: absolute;
+  width: 4px;
+  height: 68px;
+  background-image: url("../images/labelline.svg");
+  background-size: contain;
+  background-repeat: no-repeat;
+  bottom: 0;
+  left: 50%;
+  -webkit-transform: translate(-50%);
+  transform: translate(-50%);
+}
+.widgets-doll-labels .room-label a {
+  display: block;
+  position: absolute;
+  line-height: 22px;
+  top: -66px;
+  transform: translate(-50%, -100%);
+  text-align: center;
+  white-space: nowrap;
+  font-size: 14px;
+  font-style: normal;
+  pointer-events: auto;
+  background-repeat: no-repeat;
+  background-size: 100% 100%;
+  background: rgba(210, 210, 210, 0.7);
+  border: 1px solid rgba(255, 255, 255, 0.4);
+  border-radius: 3px;
+  text-shadow: 0px 1px 3px #000000;
+  min-height: 24px;
+    
+}
+
+
+.widgets-doll-labels .room-label.selected a{
+    background: rgb(57 72 255 / 88%);
+    border: 2px solid rgb(0 255 231);
+    border-radius: 3px;
+    text-shadow: 0px 1px 3px #04e79ecc;
+    
+}    
+.widgets-doll-labels.noLine .room-label a{
+    top: 0; 
+    translate: translate(-50%, -50%);
+    transition:all 0.5s;
+}
+
+.widgets-doll-labels.noLine .room-label:after { 
+    height:0
+} 
+
+.widgets-doll-labels .room-label a::before {
+  content: "";
+  position: absolute;
+  left: -1px;
+  top: -1px;
+  width: 10px;
+  height: 10px;
+  background-image: url(../images/doll_label_corner.svg);
+  background-repeat: no-repeat;
+  background-position: top left;
+}
+.widgets-doll-labels .room-label a::after {
+  content: "";
+  position: absolute;
+  left: -1px;
+  bottom: -1px;
+  width: 10px;
+  height: 10px;
+  background-image: url(../images/doll_label_corner.svg);
+  background-repeat: no-repeat;
+  background-position: top left;
+  transform: rotate(270deg);
+}
+.widgets-doll-labels .room-label a > p {
+  margin: 0;
+  padding: 6px 14px;
+  width: 100%;
+  height: 100%;
+  line-height: 1.5;
+}
+.widgets-doll-labels .room-label a > p::before {
+  content: "";
+  position: absolute;
+  right: -1px;
+  top: -1px;
+  width: 10px;
+  height: 10px;
+  background-image: url(../images/doll_label_corner.svg);
+  background-repeat: no-repeat;
+  background-position: top left;
+  transform: rotate(90deg);
+}
+.widgets-doll-labels .room-label a > p::after {
+  content: "";
+  position: absolute;
+  right: -1px;
+  bottom: -1px;
+  width: 10px;
+  height: 10px;
+  background-image: url(../images/doll_label_corner.svg);
+  background-repeat: no-repeat;
+  background-position: top left;
+  transform: rotate(180deg);
+}
+ 
+.widgets-doll-labels .room-label.noLine a {
+  top: 16px;
+}
+.widgets-doll-labels .room-label a span {
+  white-space: nowrap;
+  user-select: none;
+}
+.widgets-doll-labels .room-label.with-entrance:after {
+  display: none;
+}
+.widgets-doll-labels .room-label.with-entrance a {
+  top: 50%;
+  width: 38.5px;
+  height: 15.75px;
+  background-size: 38.5px 15.75px;
+  -webkit-transform: translate(-50%, -50%);
+  transform: translate(-50%, -50%);
+}
+.widgets-doll-labels .room-label.with-entrance a span {
+  margin-left: -0.875px;
+  margin-top: -0.875px;
+}
+.widgets-plan-labels .room-label {
+  position: absolute;
+  -webkit-animation: room-label 0.3s ease 0.1s;
+  animation: room-label 0.3s ease 0.1s;
+  -webkit-animation-fill-mode: both;
+  animation-fill-mode: both;
+}
+.widgets-plan-labels .room-label a {
+  display: block;
+  position: absolute;
+  /* width: 38.5px; */
+  line-height: 24px;
+  /* top: -99px; */
+  /* left: 50%; */
+  -webkit-transform: translate(-50%);
+  transform: translate(-50%, -50%);
+  text-align: center;
+  white-space: nowrap;
+  font-size: 14px;
+  font-style: normal;
+  /* pointer-events: auto */
+  /*text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5); */
+}
+ 

+ 177 - 87
edit.html

@@ -107,6 +107,10 @@
                         <span class="panoVisible"></span>
                         <label>漫游点位</label>
                     </li>
+                    <li data-name="roomLabels">
+                        <span class="hotpoint"></span>
+                        <label>房间标签</label>
+                    </li>
                 </ul>
             </div>
             <div class="toolMid">
@@ -114,8 +118,11 @@
                     <!-- 画布区域 -->
                     <div class="webgl-inside">
                         <div class="content">
-                            <div id="hot">
-                            </div>
+                            <div id="hot"> </div>
+                            <div class='widgets-doll-labels'> </div>
+                            <div class='widgets-plan-labels'> </div>
+                            
+                            
                             <div id="popup">
                                 <div class="popup-content">
 
@@ -971,7 +978,25 @@
                                     </div>
                                     <div class="name">
                                         <input spellcheck="false" placeholder="标题" class="right" type="text" minlength="1" maxlength="200" placeholder="">
-                                    </div> 
+                                    </div>
+                                    <div class="itemTitle secondFontSize" >
+                                        <span>何时显示</span>
+                                    </div>
+                                    <ul class="MenuOptions innerBtn" name='titleShowType'>
+                                        <li class="chosen" index="hover">鼠标悬浮时</li>
+                                        <li class="" index="always">一直显示</li>
+                                        <li class="" index="unvisible">不显示</li>
+                                    </ul>
+                                    <div class="itemTitle secondFontSize" >
+                                        <span>相对热点的位置</span>
+                                    </div>
+                                    <ul class="MenuOptions innerBtn" name='titlePos'>
+                                        <li class="" index="top">上</li>
+                                        <li class="" index="bottom">下</li>
+                                        <li class="" index="left">左</li>
+                                        <li class="chosen" index="right">右</li>
+                                        <li class="" index="middle">中</li>
+                                    </ul>
                                 </li>
                                 
                                 
@@ -981,9 +1006,9 @@
                                         <span>贴图样式</span>
                                     </div>
                                     <ul class="MenuOptions innerBtn">
-                                        <li class="halfCell chosen" index="shine">闪烁</li>
-                                        <li class="halfCell" index="photo">图片</li>
-                                        <li class="halfCell" index="video">视频</li>
+                                        <li class=" chosen" index="shine">闪烁</li>
+                                        <li class="" index="photo">图片</li>
+                                        <li class="" index="video">视频</li>
                                     </ul>  
                                     <label class="remark">注:修改样式图会影响到使用该组样式的所有热点。鼠标划到样式时使用它的热点会显示边框。未被使用的样式会在保存发布后被删除。</label>
                                     <div id='shineTexSelect' class='selectList texList'> 
@@ -1053,12 +1078,12 @@
                                         </li>
                                     </ul>
                                     <ul class="MenuOptions innerBtn" name="transform">
-                                        <li class="halfCell chosen" index="translate" data-lang="">位移</li>
-                                        <li class="halfCell" index="scale" data-lang="">缩放</li> 
-                                        <li class="halfCell" index="rotate" data-lang="">旋转</li>
+                                        <li class=" chosen" index="translate" data-lang="">位移</li>
+                                        <li class="" index="scale" data-lang="">缩放</li> 
+                                        <li class="" index="rotate" data-lang="">旋转</li>
                                     </ul>
                                     <div class="buttons">
-                                        <button class="innerBtn" name="setSpace">切换为世界坐标方向</button>
+                                        <button class="innerBtn cancel" name="setSpace">切换为世界坐标方向</button>
                                         <button class="innerBtn" name="useSuitableRatio">自适应缩放比例</button> 
                                         <button class="innerBtn" name="resetRot" style='    width: 100px;'>重置旋转</button>
                                     </div>
@@ -1072,79 +1097,40 @@
                                     
                                     </ul>
                                 </li>
-                                
-                                   
-                                <li name="model" class='unable'>
-                                    <div class="itemTitle">
-                                        <span data-lang="">模型</span>
-                                    </div>
-                                    <ul class="MenuOptions innerBtn" name="modelType">
-                                        <li class="halfCell chosen" index="default" data-lang="">默认</li>
-                                        <li class="halfCell" index="user" data-lang="">自定义</li>  
-                                    </ul>
-                                    <ul>
-                                        <li name='boxDepthPanel'> 
-                                            <div class="itemTitle">
-                                                <span data-lang="">厚度</span>
-                                            </div>
-                                            <div id="boxDepth"></div>
-                                        </li>
-                                        <li name='uploadObj'> 
-                                            <div name='objPannel'>
-                                                <div id='ObjSelect' class='selectList texList text'> 
-                                                    <a class="selection"> 
-                                                    </a>
-                                                    <ul class="list  hide"></ul> 
-                                                </div> 
-                                            </div>
-                                            
-                                        </li>
-                                    </ul>    
-                                </li>                                
-                            
-                                <li name="clickEvent">
-                                    <div class="itemTitle">
-                                        <span>点击事件</span>
-                                    </div>
-                                    <ul>
-                                        <li class="editCheckbox">
-                                            <input name="playAndPause" type="checkbox" value="playAndPause" id="playAndPause">
-                                            <label for="playAndPause"></label>
-                                            <label for="playAndPause">播放/暂停</label>
-                                        </li>
-                                        <li class="editCheckbox">
-                                            <input name="examine" type="checkbox" value="examine" id="examine">
-                                            <label for="examine"></label>
-                                            <label for="examine">校准</label>
-                                        </li>
-                                        <li class="editCheckbox">
-                                            <input name="openHot"  type="checkbox" value="openHot" id="openHot">
-                                            <label for="openHot"></label>
-                                            <label for="openHot">打开热点</label>
-                                        </li>
-                                    </ul>   
-                                </li>
-                                
-                                
                                 <li name='content'>
                                     <div class="itemTitle">
                                         <span>热点内容</span>
                                     </div>
                                     <ul>
                                     <li name="intro">
-                                        <div class="itemTitle" data-size="2000">
+                                        <div class="itemTitle secondFontSize" data-size="2000">
                                             <span>简介</span>
                                         </div>
                                         <textarea placeholder="简介" class="editText" maxlength="2000"></textarea>
                                     </li>
-                                    <li name="photo">
-                                    
-                                        <div class="itemTitle" data-size="<9M">
+                                    <li name="photo"> 
+                                        <div class="itemTitle secondFontSize" data-size="<9M">
                                             <span>图片</span>
                                         </div>
                                         <div class="list edit-fun-images clearfix"></div>
+                                        
+                                        <ul class="switch clearfix thirdFontSize">
+                                            <label><input  id="addImgDesc" class="mui-switch mui-switch-animbg" type="checkbox">
+                                                开启图片描述 
+                                            </label>
+                                        </ul>
+                                       
+                                        <div class="itemTitle thirdFontSize" name='descTitle'>
+                                            <span>描述编辑器</span>
+                                            <div class="buttons"> 
+                                                <button class="innerBtn cancel" style="font-size: 10px;">应用到所有</button>
+                                            </div>
+                                        </div> 
+                                        <textarea placeholder="<=300字" class="editText" maxlength="300" style="min-height:100px"></textarea>
+                                 
+                                        
                                         <div class="upload">
-                                            <div data-type='photo'>
+                                            <div data-type='photo' >
                                                 <span>手动上传</span>
                                                 <div class="buttons">
                                                     <button class="submit innerBtn">更改</button>
@@ -1155,7 +1141,7 @@
                                         </div>
                                     </li>
                                     <li name="video">
-                                        <div class="itemTitle" data-size="MP4">
+                                        <div class="itemTitle secondFontSize" data-size="MP4">
                                             <span>视频</span>
                                         </div>
                                         <div class="list edit-fun-images clearfix"></div>
@@ -1171,7 +1157,7 @@
                                         </div>
                                     </li>
                                     <li name="audio" class='mediaUpload'>
-                                        <div class="itemTitle">
+                                        <div class="itemTitle secondFontSize">
                                             <span>添加音频</span>
                                             <div class="buttons">
                                                 <input type="file" id="upload-hotBgm" accept="audio/*">
@@ -1187,7 +1173,7 @@
                                         </div>
                                     </li>
                                     <li name="modelSrc" class='mediaUpload' >
-                                        <div class="itemTitle">
+                                        <div class="itemTitle secondFontSize">
                                             <span>添加模型链接</span>
                                         </div>
                                         <div class="list"></div>
@@ -1199,13 +1185,13 @@
                                         </div>
                                     </li>
                                     <li name="webPage"> <!-- mediaUpload -->
-                                        <div class="itemTitle">
+                                        <div class="itemTitle secondFontSize">
                                             <span>添加网页链接</span>
                                         </div>  
                                         <ul class="MenuOptions innerBtn" name="linkType">
-                                            <li class="halfCell chosen" index="common" data-lang="">普通</li>
-                                            <li class="halfCell" index="jumpLink" data-lang="">跳转</li>
-                                            <li class="halfCell" index="iframeDiv" data-lang="">iframe</li>
+                                            <li class=" chosen" index="common" data-lang="">普通</li>
+                                            <li class="" index="jumpLink" data-lang="">跳转</li>
+                                            <li class="" index="iframeDiv" data-lang="">iframe</li>
                                         </ul>
                                         <label class="remark">方式1须https, 方式2、3 除当前第一个链接外,其他内容将不展现。</label>
                                         <div class="list"></div>
@@ -1218,6 +1204,76 @@
                                     </li> 
                                     </ul>
                                 </li>
+                                 
+                                <li name="clickEvent">
+                                    <div class="itemTitle">
+                                        <span>点击事件</span>
+                                    </div>
+                                    <ul>
+                                        <li class="editCheckbox">
+                                            <input name="playAndPause" type="checkbox" value="playAndPause" id="playAndPause">
+                                            <label for="playAndPause"></label>
+                                            <label for="playAndPause">播放/暂停</label>
+                                        </li>
+                                        <li class="editCheckbox">
+                                            <input name="examine" type="checkbox" value="examine" id="examine">
+                                            <label for="examine"></label>
+                                            <label for="examine">校准</label>
+                                        </li>
+                                        <li class="editCheckbox">
+                                            <input name="openHot"  type="checkbox" value="openHot" id="openHot">
+                                            <label for="openHot"></label>
+                                            <label for="openHot">打开热点</label>
+                                        </li>
+                                        <li class="editCheckbox">
+                                            <input name="fastTran"  type="checkbox" value="fastTran" id="fastTran">
+                                            <label for="fastTran"></label>
+                                            <label for="fastTran">跳转到固定方位</label>
+                                        </li>
+                                    </ul>   
+                                </li>
+                                <li name='fastTran'>
+                                    <div class="itemTitle">
+                                        <span>跳转方位</span>
+                                    </div> 
+                                    <div class="shotImg innerBtn" ></div>
+                                    <div class="buttons">
+                                        <button class="innerBtn submit ">设置</button> 
+                                    </div>
+                                    
+                                </li>
+                                  
+                                <li name="model" class='unable'>
+                                    <div class="itemTitle">
+                                        <span data-lang="">模型</span>
+                                    </div>
+                                    <ul class="MenuOptions innerBtn" name="modelType">
+                                        <li class=" chosen" index="default" data-lang="">默认</li>
+                                        <li class="" index="user" data-lang="">自定义</li>  
+                                    </ul>
+                                    <ul>
+                                        <li name='boxDepthPanel'> 
+                                            <div class="itemTitle">
+                                                <span data-lang="">厚度</span>
+                                            </div>
+                                            <div id="boxDepth"></div>
+                                        </li>
+                                        <li name='uploadObj'> 
+                                            <div name='objPannel'>
+                                                <div id='ObjSelect' class='selectList texList text'> 
+                                                    <a class="selection"> 
+                                                    </a>
+                                                    <ul class="list  hide"></ul> 
+                                                </div> 
+                                            </div>
+                                            
+                                        </li>
+                                    </ul>    
+                                </li>                                
+                            
+                             
+                             
+                             
                              </ul>
                         </div>
                         <div class="buttons tail">
@@ -1389,11 +1445,11 @@
                                 <span>平面图方向固定</span>
                             </div>
                             <ul class="MenuOptions innerBtn">
-                                <li class="halfCell chosen" index="0">无</li>
-                                <li class="halfCell" index="1">1</li>
-                                <li class="halfCell" index="2">2</li>
-                                <li class="halfCell" index="3">3</li>
-                                <li class="halfCell" index="4">4</li>
+                                <li class=" chosen" index="0">无</li>
+                                <li class="" index="1">1</li>
+                                <li class="" index="2">2</li>
+                                <li class="" index="3">3</li>
+                                <li class="" index="4">4</li>
                             </ul>
                         </li>
                         <li data-name="other">
@@ -1402,6 +1458,12 @@
                             </div>
                             <ul class="other-item">
                                 <li class="editCheckbox">
+                                    <input name="newBlack"  type="checkbox" value="newBlack"
+                                        id="newBlack">
+                                    <label for="newBlack"></label>
+                                    <label for="newBlack">新版瞬间过渡</label>
+                                </li> 
+                                <li class="editCheckbox">
                                     <input name="hotListSwitch"  type="checkbox" value="hotListSwitch"
                                         id="hotListSwitch">
                                     <label for="hotListSwitch"></label>
@@ -1451,6 +1513,10 @@
                                     <label for="twoData"></label>
                                     <label for="twoData">启动二代数据 <i class="colorRed">-请慎重选择</i> </label>
                                 </li>
+                               
+                                
+                                
+                                
                             </ul>
                             <ul>
                                 <li>
@@ -1564,9 +1630,9 @@
                                         </div> 
                                         
                                         <ul id="folderTourSwitch"  class="MenuOptions innerBtn" >
-                                            <li class="halfCell" index="default" data-lang="">同外层</li>
-                                            <li class="halfCell" index="walk" data-lang="">行走</li>
-                                            <li class="halfCell chosen" index="black" data-lang="">瞬间</li>
+                                            <li class="" index="default" data-lang="">同外层</li>
+                                            <li class="" index="walk" data-lang="">行走</li>
+                                            <li class=" chosen" index="black" data-lang="">瞬间</li>
                                         </ul>
                                         
                                         
@@ -1635,9 +1701,9 @@
                                             <span>飞向该片段的过渡效果</span>
                                         </div> 
                                         <ul id="tourSwitch_Slice"  class="MenuOptions innerBtn" >
-                                            <li class="halfCell" index="default" data-lang="">同外层</li>
-                                            <li class="halfCell" index="walk" data-lang="">行走</li>
-                                            <li class="halfCell chosen" index="black" data-lang="">瞬间</li>
+                                            <li class="" index="default" data-lang="">同外层</li>
+                                            <li class="" index="walk" data-lang="">行走</li>
+                                            <li class=" chosen" index="black" data-lang="">瞬间</li>
                                         </ul>  
                                     </li>
                                     <li> 
@@ -1720,6 +1786,30 @@
                     </ul>
                 </div>
                 
+                <div class="roomLabels content hide">
+                    <ul > 
+                        <li class="addBtn"> 
+                            <div class="buttons">
+                                <button class="innerBtn" data-type="shine">添加标签</button> 
+                            </div>   
+                        </li>
+                        <li name='prop' class = 'hide'>
+                            <ul > 
+                                <li name='title'>
+                                    <div class="itemTitle" data-size="30">
+                                        <span>标题</span>
+                                    </div>
+                                    <input spellcheck="false" class="right input" type="text" minlength="1" maxlength="30" placeholder="输入文字">
+                                </li>
+                                <li name='delete'>
+                                    <div class="buttons">
+                                        <button class="innerBtn cancel" >删除</button> 
+                                    </div>   
+                                </li>
+                            </ul> 
+                        </li> 
+                    </ul>
+                </div>
                 
                 
                 

+ 1 - 1
index.html

@@ -6,7 +6,7 @@
     <meta name="viewport"
         content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, minimal-ui">
     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
-    <title></title>
+    <title>1</title>
     <meta name="description" content="四维时代">
     <meta property="og:title" content="四维时代">
     <meta property="og:description" content="四维时代">

+ 75 - 12
js/Hot.js

@@ -583,6 +583,11 @@ window.initHot = function(model){
                 info.video = info.video  || [] 
                 info.iframe = info.iframe || [] 
                 info.styleImg = info.styleImg || [] 
+                info.imagesDesc = info.imagesDesc || []
+                info.titleShowType = info.titleShowType || 'hover'
+                info.titlePos = info.titlePos || 'right'
+                
+                
                 
             }    
             
@@ -756,6 +761,7 @@ window.initHot = function(model){
             }
             
             this.visible = visibility != void 0 ? visibility : (!this.info.visiblePanos || !!panos.find(pano=>this.info.visiblePanos.includes(pano.id)))
+            this.titleElem && this.titleElem.setVisible(this.visible, 'hotVisible')
             
             if (this.texType == 'video'){
                 //this.switchPlay(this.visible,  this.visible ? null : 'stop' );//可见时不操作;不可见时停止
@@ -931,6 +937,7 @@ window.initHot = function(model){
             }
             
             this.updateScale()
+            
         }
                     
         updateScale(e, t) {//自适应调节大小 
@@ -988,19 +995,50 @@ window.initHot = function(model){
             var w = DATA.hotIconScale) * g_HotMeshSize.g_HotMeshWidth
             this.scale.set( w, w, this.scale.z)
         }   */   
-             
-            
+           
+           
+        setTitleElem(){ 
+            var title = this.info.title; 
+            if(title){
+                if(!this.titleElem){ 
+                    this.titleElem = new Label2D({position:this.position, innerHTML:`<div>${title}</div>`, domElement:$("#hot")[0], shelterByModel:true   })
+                }else{
+                    this.titleElem.elem.html(`<div>${title}</div>`)  
+                }                    
+                this.titleElem.setVisible(this.visible, 'hotVisible')  
+                this.setHoverState(false)
+                this.setTitleDir()
+            }else{
+                if(this.titleElem){
+                    this.titleElem.dispose()
+                    this.titleElem = null;
+                }
+            }
+        }    
+        
+        
+        
+        setTitleDir(){
+            this.titleElem.elem.attr('pos',this.info.titlePos)
+        }
         
-        setTitleElem(){
+        
+        updateTitle(){ 
+            this.titleElem && this.titleElem.update()
+        }
+        
+        
+        /* setTitleElem(){
             var root = $("#hot");
             var title = this.info.title;
             if(title){
                 if(!this.titleElem){
                     var elem = $(`<div></div>`)
                     root.append(elem);
-                    this.titleElem = elem;
+                    this.titleElem = elem; 
                 } 
                 this.titleElem.text(title)
+                this.setTitleDir()
             }else{
                 if(this.titleElem){
                     this.titleElem.remove()
@@ -1010,23 +1048,36 @@ window.initHot = function(model){
         } 
         
         
-        showTitle(){
+        setTitleDir(){
+            this.titleElem.attr('pos',this.info.titlePos) 
+        }
+         
+        
+         
+        updateTitle(){ 
             if(!this.titleElem)return;
+            if(!this.visible || this.info.titleShowType == 'unvisible' || 
+                this.info.titleShowType != 'always' && !this.hovered ){ 
+                    return this.titleElem.css("display","none");
+            }
             var pos = math.getPos2d(this.position, player.camera, $("#player")[0])
             if(pos.trueSide){//inSight
                 this.titleElem.css( { "left" : `${pos.pos.x}px`,  "top": `${pos.pos.y}px ` });
                 this.titleElem.css("display","block");
             }else{
                 this.titleElem.css("display","none");
-            }                
-        } 
+            } 
+        } */
         
-        hideTitle(){
-            if(!this.titleElem)return;
-            this.titleElem.css("display","none");
+        setHoverState(state){ 
+            if(!this.titleElem)return
+            this.hovered = !!state
+            
+            var v = this.info.titleShowType != 'unvisible' && (this.info.titleShowType == 'always' || this.hovered)
+            this.titleElem.setVisible(v, 'hoveredVisi')
+            //this.updateTitle()  
         }
         
-        
        
         closestPanoTowardTag(e, t) {
             var i = []
@@ -1092,7 +1143,18 @@ window.initHot = function(model){
         
         examine(options={}) {
             var openHot = this.info.link && this.info.actionType.openHot && !options.dontOpen
-            var needExamine = options.examine || (!settings.dontExamHot && this.info.actionType.examine)  
+            var fastTran = !options.dontFastTran && this.info.actionType.fastTran 
+            if(fastTran){
+                let info = this.info.cameraData 
+                player.blackToPano({
+                    pano: player.model.panos.index[info.pano.uuid],
+                    quaternion: new THREE.Quaternion().fromArray(info.camera.quaternion)
+                })   
+            }
+            
+            
+            
+            var needExamine = !fastTran && (options.examine || (!settings.dontExamHot && this.info.actionType.examine))
             if(!openHot && !needExamine)return;
             
             
@@ -1624,6 +1686,7 @@ window.initHot = function(model){
     
     
     Hot.createHotList = function() {
+        if(!window.DATA.showHotListSta)return
         var docFragment = document.createDocumentFragment();
         var hots = hotGroup.children.filter(hot=>hot.info.actionType.openHot);
         hots = hots.sort((a,b)=>{return a.order - b.order});

+ 9 - 2
js/TransformControls.js

@@ -641,17 +641,24 @@ var TransformControls = function ( camera, domElement, options ) {
 			mouseUpEvent.mode = this.mode;
 			this.dispatchEvent( mouseUpEvent );
 
+            if(this.player.cameraControls.activeControl){
+                //this.player.cameraControls.activeControl.locked = false; //add 
+                this.player.cameraControls.activeControl.pointerDragOn = false //add 
+                this.player.cameraControls.activeControl.enabled = true
+            }
+
+
 		}
 
 		this.dragging = false;
 
 		if ( pointer.button === undefined ) this.axis = null;
 		
-		if(this.player.cameraControls.activeControl){
+		/* if(this.player.cameraControls.activeControl){
 			//this.player.cameraControls.activeControl.locked = false; //add 
 			this.player.cameraControls.activeControl.pointerDragOn = false //add 
 			this.player.cameraControls.activeControl.enabled = true
-		}
+		} */
 		 
 	};
 

+ 482 - 50
js/edit.js

@@ -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)

文件差异内容过多而无法显示
+ 291 - 41
js/main_2020_edit.js


+ 38 - 187
js/main_2020_show.js

@@ -5221,7 +5221,7 @@ window.Modernizr = function(n, e, t) {
         isNaN(c) && (c = 1);
         
         
-        initTransitionPass(n)
+        //initTransitionPass(n)
         
         var h = {
             currentBlur: 0,
@@ -12158,7 +12158,7 @@ window.Modernizr = function(n, e, t) {
                 this.renderTarget2.setSize(e, t)
                 
                 
-                this.passes.forEach(a=>{//add
+                this.passes.forEach(a=>{//add for TransitionPass
                     a.setSize && a.setSize(e, t)
                 })
                 
@@ -17613,7 +17613,7 @@ window.Modernizr = function(n, e, t) {
                     auth: this.isPublic ? null : f.authorizationHeader
                 }).done(function(e) {
                     window.data2 = e;
-                    
+                    this.roomLabels = []
                     if(!e){
                         console.error("data2 is null") 
                     }else{  
@@ -17637,7 +17637,11 @@ window.Modernizr = function(n, e, t) {
                         } 
                         Hot.createHotList();
                         Hot.startLoad()  
-                         
+                        if(e.roomLabels){
+                            e.roomLabels.forEach((data)=>{
+                                this.roomLabels.push(new RoomLabel(data))
+                            })
+                        }
                         
                         g_index = w.valueFromHash("m");
                          
@@ -20514,7 +20518,7 @@ window.Modernizr = function(n, e, t) {
                 .bind(this);
                 
                 
-                if(momentTourBlackNewType){
+                if(window.DATA.momentTourBlackNewType){
                     
                     A(1)
                     
@@ -20764,7 +20768,7 @@ window.Modernizr = function(n, e, t) {
                    
                 }
                 
-                if(momentTourBlackNewType){
+                if(window.DATA.momentTourBlackNewType){
                     player.sceneRenderer.effects.transitionMaskPass.start(player.sceneRenderer)
                    
                     
@@ -20791,7 +20795,7 @@ window.Modernizr = function(n, e, t) {
                 
                 this.warpCommonParameters(t, r, !1, i)
                 this.model.chunks.concat(this.model.skybox).forEach(function(e) {// 改
-                    if(window.momentTourBlackNewType){
+                    if(window.DATA.momentTourBlackNewType){
                         e.material.uniforms.blackout.value = 5//i  改
                         //e.material.defines.newBlack = ''
                         //e.material.needsUpdate = true
@@ -21243,6 +21247,9 @@ window.Modernizr = function(n, e, t) {
                 this.preRenderingEnabled = !1,
                 this.setupCustomProperties(e),
                 this.zoomStats = new L
+                window.player = this
+                
+                window.bus.dispatchEvent({type:'playerBuilded'})
             }
             var r = e("three")
               , o = e("./util/logger")
@@ -21298,7 +21305,7 @@ window.Modernizr = function(n, e, t) {
             });
             n.prototype = Object.create(C.prototype),
             n.prototype.init = function(e) {
-                window.player = this
+                
                 this.modelManager = e.modelManager,
                 this.tileDownloader = e.tileDownloader,
                 this.panoRenderer = e.panoRenderer,
@@ -22141,25 +22148,30 @@ window.Modernizr = function(n, e, t) {
                     if(this.hasChanged(e) ) {
                         this.lastChangeTime = Date.now(),
                         !this.mouseDown && this.containsMouse && this.updateIntersect(),
-                        this.emit(w.ViewChanged),
-                        
-                        this.intersectHot && this.intersectHot.showTitle() 
+                        this.emit(w.ViewChanged, e),
                         
+                         
                         this.intersect && this.magnifier && this.magnifier.update(this.intersect.point)
 
                     }
-
-                    if(e.cameraChanged){
-                        this.mode == "panorama" && window.cad && cad.setSign({ x: this.position.x, y: this.position.z }, this.cameraControls.controls.panorama.lon);
-                        
-                       
-                    }
                     if(e.cameraChanged2){ //变化要更大些
                         for(var i in this.model.hots){
                             this.model.hots[i].update(this)
                         }   
-                        
                     }
+                    if(e.cameraChanged){
+                        this.mode == "panorama" && window.cad && cad.setSign({ x: this.position.x, y: this.position.z }, this.cameraControls.controls.panorama.lon);
+                        for(var i in this.model.hots){
+                            this.model.hots[i].updateTitle(this)
+                        }
+                    }
+                    
+                    
+                    
+                    
+                    
+                    
+                    
                     this.model.supportsTiles && (this.updateTileDownloader(t),
                     this.updatePanoRenderer(t)),
                     this.updatePreRendering(t),
@@ -22376,6 +22388,7 @@ window.Modernizr = function(n, e, t) {
                             modelCenter: this.model.center.clone(),
                             zoomLevel: this.zoomLevel
                         };
+                        e.cameraChanged = e.cameraChanged2 = true;
                         return !0;
                     }
                     //许钟文改 分成相机是否改变cameraChanged 和其他
@@ -22426,7 +22439,7 @@ window.Modernizr = function(n, e, t) {
                   , n = !(e || t || this.isTouchEvent || i.length && i[0].running);
                 
                 {//clear:
-                    if(this.intersectHot) this.intersectHot.hideTitle()
+                    if(this.intersectHot) this.intersectHot.setHoverState(false)
                     this.intersectHot = null
                     $("#player").css("cursor", "")
                 }
@@ -22439,7 +22452,7 @@ window.Modernizr = function(n, e, t) {
                                 this.intersectHot = this.intersectHot.parent
                             } 
                             $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass("active") 
-                            this.intersectHot.showTitle()  
+                            this.intersectHot.setHoverState(true)  
                         }  
                     } 
                 }
@@ -22447,7 +22460,7 @@ window.Modernizr = function(n, e, t) {
                
                 if(this.model.hotGroup){
                     
-                    var hots = this.model.hotGroup.children.filter(e=> e.info.actionType.examine || e.info.actionType.openHot || e.info.actionType.playAndPause)
+                    var hots = this.model.hotGroup.children.filter(e=> e.info.actionType.examine || e.info.actionType.fastTran || e.info.actionType.openHot || e.info.actionType.playAndPause)
                    
                      
                     this.intersect = this.getMouseIntersect(null, hots.concat(this.model.colliders));
@@ -22903,9 +22916,6 @@ window.Modernizr = function(n, e, t) {
                     return void (this.waitingToWarp = !0)
                 
                 this.emit("pano.chosen", oldPano, pano)
-                 
-                /*  if(window.momentTourBlackNewType == 1) { */
-                    
                 
                 this.flying = true
                 this.nextPano = pano //提前加载高清图片
@@ -22924,6 +22934,7 @@ window.Modernizr = function(n, e, t) {
                     this.emit("flying.ended", pano.position, oldPos, pano, oldPano) 
                     this.flying = false
                     this.nextPano = null 
+                    this.updateMarkerVisi();//add
                 } )
                 
             }
@@ -23360,7 +23371,7 @@ window.Modernizr = function(n, e, t) {
                   , C = this.cameraControls.cameras[i];
                 e = g.deepExtend({}, f[i], f[p + "-" + i]);
                 var I = void 0 !== o ? o : e.transitionTime;
-                this.emit(w.ModeChanging, p, i, n),
+                this.emit(w.ModeChanging, p, i, n, I),
                 n && (this.currentPano = n),
                 this.switchCameraMode(i, c),
                 y.cancelById(V.LookTransition);
@@ -26721,7 +26732,7 @@ window.Modernizr = function(n, e, t) {
                     const vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);
                     const vec4 GREY  = vec4(0.5, 0.5, 0.5, 1.0);
                     vec4 colorFromPanos;
-                    if (blackout == 5){
+                    if (blackout == 5){//add for TransitionPass
                         colorFromPanos = textureCube( pano1Map, vWorldPosition1.xyz)                                    ;
                     }else{
                         vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);
@@ -58159,6 +58170,7 @@ window.Modernizr = function(n, e, t) {
         
         window.THREE = n
         getObjLoader()
+        initByTHREE(THREE)
     }
     , {}]
 }, {}, [116]);
@@ -58169,167 +58181,6 @@ window.Modernizr = function(n, e, t) {
 
 
 
-function initTransitionPass(THREE){
-
-    THREE.TransitionPass =  function ( scene, camera ) {
-        this.renderScene = scene;
-        this.renderCamera = camera;
-        
-        
-        this.coverRenderTarget = new THREE.WebGLRenderTarget( 100, 100, { 
-            minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter,
-            format: THREE.RGBAFormat 
-        });
-        
-        this.coverTex = this.coverRenderTarget.texture; 
-        
-        this.enabled = false;
-        
-        
-        this.oldClearColor = new THREE.Color();
-        this.oldClearAlpha = 1;
-
-        this.camera = new THREE.OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );
-        this.scene = new THREE.Scene();
-
-
-        this.material = this.getMaskMaterial()
-        var copyShader = THREE.CopyShader;
-        this.materialCopy = new THREE.ShaderMaterial( {
-            uniforms: this.copyUniforms,
-            vertexShader: copyShader.vertexShader,
-            fragmentShader: copyShader.fragmentShader,
-            blending: THREE.NoBlending,
-            depthTest: false,
-            depthWrite: false,
-            transparent: true
-        } );
-
-
-        this.quad = new THREE.Mesh( new THREE.PlaneBufferGeometry( 2, 2 ), this.material);
-        this.quad.frustumCulled = false; // Avoid getting clipped
-        this.scene.add( this.quad );
-        
-        
-    }
-
-
-    THREE.TransitionPass.prototype = {//波形扩散,出下一个画面
-
-        constructor: THREE.TransitionPass,
-        setSize: function ( width, height ) {
-            
-            this.coverRenderTarget.setSize( width, height );
-            
-        },
-        render: function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {
-            var oldAutoClear = renderer.autoClear; 
-            renderer.autoClear = false;
-            
-            var uniforms = this.quad.material.uniforms
-            uniforms.bgTex.value = readBuffer.texture; 
-            uniforms.coverTex.value = this.coverTex;
-            uniforms.progress.value = player.model.skybox.material.uniforms.progress.value//
-            uniforms.screenRatio.value = player.domElement.clientWidth / player.domElement.clientHeight;// 使波纹为圆形
-            uniforms.screenRatio.value *= uniforms.screenRatio.value
-            
-            renderer.render( this.scene, this.camera);
-            
-            renderer.autoClear = oldAutoClear;
-            
-            
-        },
-        
-        start:function(sceneRenderer){
-            this.enabled = true
-            //draw coverTex
-            this.quad.material.uniforms.progress.value = 1;
-            sceneRenderer.renderer.render( sceneRenderer.scene, sceneRenderer.camera, this.coverRenderTarget, true );
-            
-            
-        },
-        stop:function(){
-            this.enabled = false
-           
-        }
-        ,
-        
-        
-        getMaskMaterial :function(){
-            return new THREE.ShaderMaterial( {
-
-                uniforms: {
-                    coverTex: {
-                        type: "t",
-                        value: null
-                    },
-                    bgTex: {
-                        type: "t",
-                        value: null
-                    },
-                    progress:{
-                        type: "f",
-                        value: 0
-                    },
-                    screenRatio:{
-                        type: "f",
-                        value: 1
-                    }
-                },
-
-                vertexShader: ` 
-                    varying vec2 vUv;
-                     
-                    void main() 
-                    {
-                        vUv = uv;
-                        
-                        gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
-                    } 
-                   
-                `,
-                fragmentShader: ` 
-                    uniform sampler2D coverTex;
-                    uniform sampler2D bgTex;
-                    uniform float progress; 
-                    uniform float screenRatio;
-                    varying vec2 vUv;
-                   
-                    void main() {
-                        
-                        const float maxRadius = 0.708;      // sqrt(0.5^2+0.5^2)
-                        const float minRadius = 0.0 ;
-                         
-                        float radius = screenRatio>1.0 ? sqrt((vUv.x - 0.5)*(vUv.x - 0.5) + (vUv.y - 0.5)*(vUv.y - 0.5)/screenRatio) : sqrt((vUv.x - 0.5)*(vUv.x - 0.5)*screenRatio+ (vUv.y - 0.5)*(vUv.y - 0.5));
-                        float diff = 0.292;    //1.0-maxRadius;
-                        float radiusIn = maxRadius * progress + minRadius * (1.0-progress);
-                        float radiusOut = radiusIn + diff;
-                        if(radius < radiusIn) {
-                            
-                            gl_FragColor = texture2D(bgTex, vUv);
-                            //gl_FragColor = vec4(0.0,0.0,1.0,1.0);//
-                            
-                        }else if(radius>radiusOut){
-                            gl_FragColor = texture2D(coverTex, vUv)  ;
-                            //gl_FragColor = vec4(1.0,1.0,0.0,1.0);//
-                            
-                        }else{
-                            
-                            vec4 color1 = texture2D(bgTex, vUv);
-                            vec4 color2 = texture2D(coverTex, vUv);
-                            float rotio = smoothstep(radiusIn ,radiusOut,radius);
-                           
-                            gl_FragColor = mix(color1, color2, rotio);
-                        }
-                    }
-                 `
-
-            } );
-            
-        },
-        
-    }
-}
 /* 
 var addMagnifier = function(){ 
 

+ 541 - 43
js/manage.js

@@ -76,6 +76,10 @@ var settings = {
             openHot:true  
         }
     },
+     
+    hotClickActions:['playAndPause','examine','openHot','fastTran'],
+   
+    
     //默认的:
     teleportTime:  1500,//瞬间过渡的时间 
     /* flytimeDistanceMultiplier:150, 
@@ -100,12 +104,22 @@ window.easing = null
 window.lerp = null
 window.transitions = null
 window.browser = null
-window.momentTourBlackNewType = 0//=  number == 'TEST'//true
  
 
 
-
-
+function watch(object, propName, initialValue){ //监听某个属性的变化
+    let v = initialValue
+    Object.defineProperty(object, propName, {
+        get: function() {
+            return v
+        },
+        set: function(e) {
+             console.log('watch:',propName, e)
+             v = e 
+        }
+    }) 
+}
+           
 
 
 
@@ -151,6 +165,9 @@ var convertTool = {
 	getPos2d : function(point, camera, dom){//获取一个三维坐标对应屏幕中的二维坐标
 		var camera = camera || player.camera;
 		var dom = dom || player.domElement;
+        
+        
+        if(!camera)return
 		var pos = point.clone().project(camera)	//比之前hotspot的计算方式写得简单  project用于3转2(求法同shader); unproject用于2转3 :new r.Vector3(e.x, e.y, -1).unproject(this.camera);
 		
 		var x,y;
@@ -169,7 +186,7 @@ var convertTool = {
 		};
 	},
 
-	ifShelter: function(pos3d){//检测某点在视线中是否被mesh遮挡 
+	ifShelter: function(pos3d , floorIndex ){//检测某点在视线中是否被mesh遮挡 
 		var ori = player.position
         var dir = pos3d.clone().sub(ori).normalize()
         var ray = new THREE.Raycaster(ori, dir) //由外向里 因为模型从内侧是可见的所以从外侧
@@ -177,7 +194,9 @@ var convertTool = {
 		/* if(config.isEdit && publicObjectSet.editor.mainDesign.editing){
 			var o = ray.intersectObjects(publicObjectSet.editor.mainDesign.wallMeshes);
 		}else{ */
-			var o = ray.intersectObjects(player.model.colliders);
+        let colliders = player.model.allFloorsVisible ? player.model.colliders : (floorIndex != void 0 ? player.model.floors.index[floorIndex] : player.model.currentFloor).collider.children
+        //let colliders = (floorIndex == void 0 ) ? player.model.colliders : player.model.floors.index[floorIndex].collider.children
+        var o = ray.intersectObjects(colliders); 
 		//} 
 		var len = pos3d.distanceTo(ori);
 		if (o && o.length) {
@@ -329,10 +348,80 @@ var convertTool = {
     
         return g  //可能NAN  当相机和position重叠时
          
-    } 
-    
-    
+    } ,
     
+    updateVisible : function(object, reason, ifShow, level=0, type){//当所有加入的条件都不为false时才显示. reason='force'一般是强制、临时的
+        if(!object.unvisibleReasons) object.unvisibleReasons = []; //如果length>0代表不可见
+        if(!object.visibleReasons) object.visibleReasons = []; //在同级时,优先可见
+        
+        
+        var update = function(){
+            
+            //先按从高到低的level排列
+            object.unvisibleReasons = object.unvisibleReasons.sort((a,b)=>b.level-a.level)
+            object.visibleReasons = object.visibleReasons.sort((a,b)=>b.level-a.level)
+            var maxVisiLevel = object.visibleReasons[0] ? object.visibleReasons[0].level : -1
+            var maxunVisiLevel = object.unvisibleReasons[0] ? object.unvisibleReasons[0].level : -1
+            
+            var shouldVisi = maxVisiLevel >= maxunVisiLevel
+            var visiBefore = object.visible
+            
+            
+            if(visiBefore != shouldVisi){
+                object.visible = shouldVisi
+                object.dispatchEvent({
+                    type: 'isVisible',
+                    visible: shouldVisi,
+                    reason,
+                }) 
+            }
+            
+            
+        }    
+        
+        
+        
+        if(ifShow){ 
+
+            var index = object.unvisibleReasons.findIndex(e=>e.reason == reason) 
+            if(index > -1){
+                type = 'cancel'
+                object.unvisibleReasons.splice(index, 1); 
+            }
+            
+            if(type == 'add' ){
+                if(!object.visibleReasons.some(e=>e.reason == reason)){
+                    object.visibleReasons.push({reason,level})
+                }
+            } 
+        }else{ 
+            var index = object.visibleReasons.findIndex(e=>e.reason == reason) 
+            if(index > -1){
+                type = 'cancel'
+                object.visibleReasons.splice(index, 1); 
+            }
+            
+            if(type != 'cancel' ){
+                if(!object.unvisibleReasons.some(e=>e.reason == reason)){
+                    object.unvisibleReasons.push({reason,level})
+                }
+            }
+        }
+          
+        update() 
+        
+    }, 
+     
+         
+         
+         
+    getObjVisiByReason : function(object,reason){//获取在某条件下是否可见.  注: 用户在数据集选择可不可见为"datasetSelection"
+        if(object.visible)return true
+        else{
+            return !object.unvisibleReasons || !object.unvisibleReasons.some(e=>e.reason == reason)  
+        }
+    } 
+        
 }
 
  
@@ -904,59 +993,373 @@ var ifSame = function(object1, object2){
         return true
     }else{
         console.log('isSame出现例外')
-    }
-    
+    } 
     
+}
+
+
+function initByTHREE(THREE){ 
     
     
+    window.bus = new THREE.EventDispatcher();//因为player一开始总是没创建好,所以加一个事件传递器
     
-}
+    THREE.TransitionPass =  function ( scene, camera ) {
+        this.renderScene = scene;
+        this.renderCamera = camera;
+        
+        
+        this.coverRenderTarget = new THREE.WebGLRenderTarget( 100, 100, { 
+            minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter,
+            format: THREE.RGBAFormat 
+        });
+        
+        this.coverTex = this.coverRenderTarget.texture; 
+        
+        this.enabled = false;
+        
+        
+        this.oldClearColor = new THREE.Color();
+        this.oldClearAlpha = 1;
 
+        this.camera = new THREE.OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );
+        this.scene = new THREE.Scene();
 
 
+        this.material = this.getMaskMaterial()
+        var copyShader = THREE.CopyShader;
+        this.materialCopy = new THREE.ShaderMaterial( {
+            uniforms: this.copyUniforms,
+            vertexShader: copyShader.vertexShader,
+            fragmentShader: copyShader.fragmentShader,
+            blending: THREE.NoBlending,
+            depthTest: false,
+            depthWrite: false,
+            transparent: true
+        } );
 
-/* var SoundManager = {//暂不支持同时播放
-    currentAudio:null,//当前正在播放list中的哪一个
-    list:[
-        {
-            name:"bg", 
-            level : 0,//越大优先级越高
-            canBeInterrupted : true ,
+
+        this.quad = new THREE.Mesh( new THREE.PlaneBufferGeometry( 2, 2 ), this.material);
+        this.quad.frustumCulled = false; // Avoid getting clipped
+        this.scene.add( this.quad );
+        
+        
+    }
+
+
+    THREE.TransitionPass.prototype = {//波形扩散,出下一个画面
+        
+        constructor: THREE.TransitionPass,
+        setSize: function ( width, height ) {
+            
+            this.coverRenderTarget.setSize( width, height );
             
         },
-        {
-            name:"boxVideo", 
-            level : 1, 
-            canBeInterrupted : true,
-            checkIfNeedPlay:function(){
-                
-                
-            }
+        render: function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {
+            var oldAutoClear = renderer.autoClear; 
+            renderer.autoClear = false;
+            
+            var uniforms = this.quad.material.uniforms
+            uniforms.bgTex.value = readBuffer.texture; //更新
+            uniforms.coverTex.value = this.coverTex;
+            uniforms.progress.value = player.model.skybox.material.uniforms.progress.value//
+            uniforms.screenRatio.value = player.domElement.clientWidth / player.domElement.clientHeight;// 使波纹为圆形
+            uniforms.screenRatio.value *= uniforms.screenRatio.value
+            
+            renderer.render( this.scene, this.camera);
+            
+            renderer.autoClear = oldAutoClear;
+            
+            
         },
-        {
-            name:"hot", 
-            level : 2, 
-            canBeInterrupted : true
+        
+        start:function(sceneRenderer){
+            this.enabled = true
+            //draw coverTex
+            this.quad.material.uniforms.progress.value = 1;
+            sceneRenderer.renderer.render( sceneRenderer.scene, sceneRenderer.camera, this.coverRenderTarget, true );
+            console.log('start111')
+            
         },
-        {
-            name:"tour", 
-            level : 3, 
-            canBeInterrupted : true
+        stop:function(){
+            this.enabled = false
+            console.log('stop111')
+        }
+        ,
+        
+        
+        getMaskMaterial :function(){
+            return new THREE.ShaderMaterial( {
+
+                uniforms: {
+                    coverTex: {
+                        type: "t",
+                        value: null
+                    },
+                    bgTex: {
+                        type: "t",
+                        value: null
+                    },
+                    progress:{
+                        type: "f",
+                        value: 0
+                    },
+                    screenRatio:{
+                        type: "f",
+                        value: 1
+                    }
+                },
+
+                vertexShader: ` 
+                    varying vec2 vUv;
+                     
+                    void main() 
+                    {
+                        vUv = uv;
+                        
+                        gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
+                    } 
+                   
+                `,
+                fragmentShader: ` 
+                    uniform sampler2D coverTex;
+                    uniform sampler2D bgTex;
+                    uniform float progress; 
+                    uniform float screenRatio;
+                    varying vec2 vUv;
+                   
+                    void main() {
+                        
+                        const float maxRadius = 0.708;      // sqrt(0.5^2+0.5^2)
+                        const float minRadius = 0.0 ;
+                         
+                        float radius = screenRatio>1.0 ? sqrt((vUv.x - 0.5)*(vUv.x - 0.5) + (vUv.y - 0.5)*(vUv.y - 0.5)/screenRatio) : sqrt((vUv.x - 0.5)*(vUv.x - 0.5)*screenRatio+ (vUv.y - 0.5)*(vUv.y - 0.5));
+                        float diff = 0.292;    //1.0-maxRadius;
+                        float radiusIn = maxRadius * progress + minRadius * (1.0-progress);
+                        float radiusOut = radiusIn + diff;
+                        if(radius < radiusIn) {
+                            
+                            gl_FragColor = texture2D(bgTex, vUv);
+                            //gl_FragColor = vec4(0.0,0.0,1.0,1.0);//
+                            
+                        }else if(radius>radiusOut){
+                            gl_FragColor = texture2D(coverTex, vUv)  ;
+                            //gl_FragColor = vec4(1.0,1.0,0.0,1.0);//
+                            
+                        }else{
+                            
+                            vec4 color1 = texture2D(bgTex, vUv);
+                            vec4 color2 = texture2D(coverTex, vUv);
+                            float rotio = smoothstep(radiusIn ,radiusOut,radius);
+                           
+                            gl_FragColor = mix(color1, color2, rotio);
+                        }
+                    }
+                 `
+
+            } );
+            
         },
         
+    }
+
+
+
+
+
+
+    class Label2D  extends THREE.EventDispatcher{
+        constructor(o={}){
+            super()
+            
+            this.position = o.position 
+            this.text = o.text || '';
+            this.elem = $(o.innerHTML || '<div ><a></a></div>');
+              
+            $(o.domElement).append(this.elem)
+            this.pos2d = new THREE.Vector3
+         
+            this.elem.css({position: 'absolute', 'z-index':999})
+            this.clickFun = o.clickFun;
+            this.clickFun && this.elem.on('click',this.clickFun.bind(this))
+            
+            if(o.autoUpdate){
+                let update = (e)=>{if(e.cameraChanged) this.update()}
+                player.on("view.changed",update) //确保player存在
+                     
+                
+                this.addEventListener('dispose',  (e)=>{
+                    player.off("view.changed",update)
+                })
+            } 
+            this.visible = true
+            this.shelterByModel = o.shelterByModel
+            this.floorIndex = o.floorIndex
+            
+             
+            if(window.player.reticule){
+                this.init()
+            }else{
+                window.bus.addEventListener('playerBuilded',this.init.bind(this))
+            }
+            
+        }
         
-    ],
-    switchPlay:function(){
+        init(){
+            if(this.floorIndex != void 0){  
+                player.model.on("floor.changed",(currentFloor, mode, oldFloor)=>{
+                    this.update(currentFloor)  //注: currentFloor 这时候还没成为 model.currentFloor
+                })
+            }
+        }
+
         
-    },
-    register:function(){
         
+        update(currentFloor){
+            if(!this.position || !this.visible)return
+             
+            var p = convertTool.getPos2d(this.position);
+            if(!p || !p.trueSide){
+                this.elem.css('display','none');  return;
+            }
+            
+            //判断label是否被模型遮挡,遮挡则消失(如果是漫游模式最好提前计算visiblePanos)
+            if(player.mode != 'panorama'){
+                currentFloor = currentFloor || player.model.currentFloor 
+                if(!player.model.allFloorsVisible && this.floorIndex != void 0 && this.floorIndex!= currentFloor.floorIndex){
+                    this.elem.css('display','none');	return;
+                }
+                    
+                if(this.shelterByModel && convertTool.ifShelter(this.position , this.floorIndex )){
+                    this.elem.css('display','none');	return; 
+                }
+            }
+            
+            this.elem.css({
+                left: p.pos.x +'px',
+                top: p.pos.y +'px'
+            })
+            
+            /* if(settings.vrEnabled){
+                this.elem.css({transform:'rotate('+window.screenFaceOrient+'deg)'})
+            }else{
+                this.elem.css({transform:''})
+            } */
+            
+            this.elem.css('display','block');
+            this.pos2d = p.vector;
+            
+             
+            
+        }
         
+        setVisible(visi, reason, level=0, type){
+            convertTool.updateVisible(this, reason, visi, level, type  ) 
+             
+            if(!this.visible){
+                this.elem.css('display','none');
+            }else{ 
+                this.update()
+            }
+        } 
         
-    } 
-    
+         
+        setPos(pos){
+            this.position = pos;
+            this.update()
+        }
+        
+        dispose(){
+            this.elem.remove();
+            this._listeners = {} 
+            this.dispatchEvent({type:'dispose'})
+        }
+         
+         
+    }
+
+     
+
+
+
+    window.Label2D = Label2D
+
+
+    class RoomLabel extends Label2D{
+        constructor(o){
+            if(o.position instanceof Array) o.position = new THREE.Vector3().fromArray(o.position)
+            o.innerHTML = `<div class="room-label" ><a><p><span>${o.title}</span></p></a></div>`
+            super(o)
+            this.setTitle(o.title )
+            
+        }
+         
+        init(){
+            super.init()
+            //飞入后不可见
+            player.on("mode.changing",(currentMode, mode, pano, duration)=>{//准备飞
+                this.setStyle(currentMode, mode, duration)
+            })
+            this.setStyle()   
+        } 
+         
+        setStyle(currentMode, mode, duration){
+            if(!mode) mode = player.mode
+            if(mode == 'panorama'){
+                this.setVisible(false, 'isPanorama')
+            }else if(currentMode == 'panorama'){
+                setTimeout(()=>{
+                    this.setVisible(true, 'isPanorama')
+                },duration*0.7) 
+            } 
+        } 
+         
+         
+        setTitle(title){ 
+            this.title = title || ''
+            this.elem.html(`<a><p><span>${this.title}</span></p></a>`)
+        }
+        
+        setEditSelect(state){//编辑页面用
+            this.editing = !!state
+            this.setVisible(state, 'editSelected', 1, state ? 'add':'cancel') //强制可见
+        }
+        
+    }
+    window.RoomLabel = RoomLabel
+
+    window.bus.addEventListener('playerBuilded',()=>{
+        player.on("mode.changing",(currentMode, mode, pano, duration)=>{ 
+            let noLine = mode == 'floorplan';
+            if(noLine){
+                $('.widgets-doll-labels').addClass('noLine')
+            }else{
+                $('.widgets-doll-labels').removeClass('noLine')
+            }
+        
+        })
+    })
 }
- */
+
+
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
  
  
  
@@ -1111,8 +1514,7 @@ function Log(value, color, fontSize){
 }
 
 
-
-
+ 
 
 
 Manage.prototype.loadAudio = function() { //相关:g_tourAudio \  g_playAudio
@@ -1235,8 +1637,104 @@ Manage.prototype.switchBgmState = function(state){//按钮的状态完全代表
 var manage = new Manage();
 
  
+ 
+
+//处理cursor优先级
+
+
+var CursorDeal = {
+    priorityEvent : [//在前面的优先级高
+        {"noIntersect":'not-allowed'},
+        {"addHot":'cell'},  
+        {"hoverFootIcon":'pointer'},
+        {"hoverHot":'pointer'},
+        {"addLabel":'cell'},
+        {"moveLabel":'grab'},
+    ], 
+    domElements :[$('#player')[0]],
+    list:[], //当前存在的cursor状态
+    currentCursorIndex:null,
+    
+    /* init : function(viewer){
+        
+        this.priorityEvent.forEach(e=>{//刚开始Potree.resourcePath没值,现在换
+            for(let i in e){
+                e[i] = Common.replaceAll(e[i],'{Potree.resourcePath}',Potree.resourcePath)
+            }
+        })
+          
+        this.domElements = [viewer.renderArea, viewer.mapViewer.renderArea];
+        
+        viewer.addEventListener("CursorChange",(e)=>{
+            if(e.action == 'add'){
+                this.add(e.name)
+            }else{
+                this.remove(e.name)
+            } 
+        })
+        
+        
+    }, */
+    
+    
+    add : function(name){
+        var priorityItem = this.priorityEvent.find(e=>e[name])
+        if(!priorityItem){
+            console.error('CursorDeal  未定义优先级 name:'+ name);
+            return
+        }
+        
+        
+        if(!this.list.includes(name)){
+            
+            this.judge({addItem: priorityItem, name})
+            
+            this.list.push(name)
+        }
+         
+    },
+    
+    
+    remove : function(name){
+        var index = this.list.indexOf(name);
+        if(index > -1){
+            this.list.splice(index, 1)
+            this.judge()
+        }
+        
+        
+        
+    },
+    
+    judge:function(o={}){
+        //console.log(o,this.list)
+        if(o.addItem){
+            var addIndex = this.priorityEvent.indexOf(o.addItem) 
+            if(addIndex < this.currentCursorIndex || this.currentCursorIndex == void 0){ 
+                this.domElements.forEach(e=>e.style.cursor = o.addItem[o.name] )
+                this.currentCursorIndex = addIndex
+            }  
+        }else{
+            var levelMax = {index:Infinity, cursor:null }
+            this.list.forEach(name=>{
+                var priorityItem = this.priorityEvent.find(e=>e[name])
+                var index = this.priorityEvent.indexOf(priorityItem)
+                if(index < levelMax.index){
+                    levelMax.index = index;
+                    levelMax.cursor = priorityItem[name]
+                }
+            })
+            this.currentCursorIndex = levelMax.index
+            this.domElements.forEach(e=>e.style.cursor = levelMax.cursor || '')
+        }
+        
+    }
+    
+     
+}
 
 
+ 
 
 //兼容一代的場景
 //請求地址統一管理