gemercheung 2 سال پیش
والد
کامیت
8d5cb739de

+ 50 - 13
packages/qjkankan-editor/public/static/template/customTooltip.xml

@@ -23,7 +23,7 @@
         set(hotspot[get(hsp_name)].hotlink,%7);
         set(hotspot[get(hsp_name)].ath,%5);
         set(hotspot[get(hsp_name)].atv,%6);
-        set(hotspot[get(hsp_name)].hovering, %9);
+        set(hotspot[get(hsp_name)].hoverstatus, %9);
         set(hotspot[get(hsp_name)].visible,true);
         set(hotspot[get(hsp_name)].alpha,1);
         set(hotspot[get(hsp_name)].scale,1);
@@ -38,13 +38,12 @@
         set(hotspot[get(hsp_name)].pos,pos);
         txtadd(hotspot[get(hsp_name)].onloaded,"add_tooltip_label();add_tooltip_dot();");
 
-        trace('hovering::',%9);
+        trace('hoverstatus::',%9);
 
         if(%2 LE 2,
             set(hotspot[get(hsp_name)].height,%8);
             set(hotspot[get(hsp_name)].width,%8);
             set(hotspot[get(hsp_name)].crop,'');
-        
                
                 if(%2 == 0,
                 txtreplace(iconUrl,'.svg','.png');
@@ -68,6 +67,7 @@
                 set(hotspot[get(hsp_name)].frameNumber,get(frameNumber));
                 set(hotspot[get(hsp_name)].frameRate,calc(1.0 / get(frameNumber)));
                 );
+
         );
         
         <!-- 个性化标签(3) -->
@@ -161,9 +161,6 @@
         set(layer[get(tooltipname)].autowidth, true);
         set(layer[get(tooltipname)].width,'prop');
 
-        <!-- if(hotspottitle == '', trace('title-empty'); set(layer[get(tooltipname)].autoheight,true); );
-        ifnot(hotspottitle == '', trace('title-no-empty');set(layer[get(tooltipname)].autoheight,true);); -->
-
         set(layer[get(tooltipname)].autoheight,true); 
         set(layer[get(tooltipname)].edge,center);
         set(layer[get(tooltipname)].background,false);
@@ -182,13 +179,36 @@
         txtadd(labelCode, '<div style="display: flex; align-items: center; justify-content: center; position: relative; border: 1px solid ',get(borderColor),'; padding: 6px 10px; white-space: pre; border-radius: 5px; background: ',get(fillColor),'">','            <div style="text-align: left; font-size:',get(fontSize),'px; color: ',get(textColor),'; line-height: 1.4;">',get(hotspottitle),'</div>
         </div>'); 
         
-                                <!-- label方位 -->
+        <!-- label方位 -->
         if(get(hotspottype) LE 2,
        <!-- trace('hotspottype::',get(hotspottype),'::tooltipname::',get(tooltipname),'pos::',get(pos)); -->
         <!-- set_label_pos(get(tooltipname),get(pos)); -->
-        delayedcall(0.1,
+         copy(hoverstatus,hotspot[get(name)].hoverstatus); 
+         trace('hovering-label::',get(hoverstatus));
+         <!-- 0 一直显示  -->
+         if(hoverstatus == 0,
+            delayedcall(0.1,
             txtadd(tooltipname, 'tooltip_', get(name)); 
             set_label_pos(get(tooltipname),get(pos));
+            );
+         );
+        if(hoverstatus == 1,
+            set(layer[get(tooltipname)].visible,false);
+         );
+          <!-- 2 hover  -->
+        if(hoverstatus == 2,
+            trace('测试');
+           set(layer[get(tooltipname)].visible,false);
+            delayedcall(0.1,
+             txtadd(tooltipname, 'tooltip_', get(name)); 
+                set_label_pos(get(tooltipname),get(pos));
+                set(layer[get(tooltipname)].visible,false);
+            );
+            set(hotspot[get(name)].onhover,txtadd(tooltipname, 'tooltip_', get(name)); set(layer[get(tooltipname)].visible,true););
+            set(hotspot[get(name)].onout,
+             txtadd(tooltipname, 'tooltip_', get(name)); 
+             set(layer[get(tooltipname)].visible,false);
+            );
          );
        );
 
@@ -413,6 +433,7 @@
       set(hotspot[get(hsp_name)].keep,true);
       set(hotspot[get(hsp_name)].hotspottitle,%3);
       set(hotspot[get(hsp_name)].hotlink,%7);
+      set(hotspot[get(hsp_name)].hoverstatus,%9);
       set(hotspot[get(hsp_name)].hotspotStyle,%10);
       copy(hotspot[get(hsp_name)].borderWidth,false);
       copy(layer[get(hsLabel)].borderWidth,false);
@@ -447,7 +468,6 @@
         );
         if(isShowLine == 0, 
             set(hotspot[get(hsp_name)].width,0);
-            trace('编辑标注线');
             set(layer[get(hsLabel)].x,0);
             set(layer[get(hsLabel)].y,0);
             set(layer[get(hsLabel)].rotate,0);
@@ -493,8 +513,6 @@
         );
        <!-- 序列化类型编辑 -->
         if(get(hsp_type) == 2, 
-          <!-- set(hotspot[get(hsp_name)].animatiedOn,1); -->
-          <!-- delayedcall(0.2,set(hotspot[get(hsp_name)].animatiedOn,1);); -->
           set(iconUrl,get(calc(iconUrl +'?'+ timestamp)));
           set(hotspot[get(hsp_name)].visible,true);
           calc(frameRate, duration / frameNumber);
@@ -520,8 +538,27 @@
         set(hotspot[get(hsp_name)].url,get(iconUrl));
         set(hotspot[get(hsp_name)].rotate,0);
         set(layer[get(hsLabel)].rotate,0);
-
-        trace('last_edit::',hotspot[get(hsp_name)].onloaded);
+        copy(hoverstatus,hotspot[get(hsp_name)].hoverstatus); 
+        trace('edit-hoverstatus::',get(hoverstatus));
+        if(hoverstatus == 0,
+            set(layer[get(hsLabel)].visible,true);
+            set(hotspot[get(hsp_name)].onhover,'');
+            set(hotspot[get(hsp_name)].onout,'');
+         );
+        if(hoverstatus == 1,
+            set(layer[get(hsLabel)].visible,false);
+            set(hotspot[get(hsp_name)].onhover,'');
+            set(hotspot[get(hsp_name)].onout,'');
+         );
+        if(hoverstatus == 2,
+            set(layer[get(tooltipname)].visible,false);
+            set(hotspot[get(hsp_name)].onhover,txtadd(tooltipname, 'tooltip_', get(hsp_name)); set(layer[get(tooltipname)].visible,true););
+            set(hotspot[get(name)].onout,
+             txtadd(tooltipname, 'tooltip_', get(hsp_name)); 
+             set(layer[get(tooltipname)].visible,false);
+            );
+         );
+        <!-- trace('last_edit::',hotspot[get(hsp_name)].onloaded); -->
        );
       
 

+ 58 - 18
packages/qjkankan-view/public/showviewer/lib/krpano/tooltip.xml

@@ -20,6 +20,7 @@
         set(hotspot[get(hsp_name)].name,%1);
         set(hotspot[get(hsp_name)].hotspottype,%2);
         set(hotspot[get(hsp_name)].hotspottitle,%3);
+        set(hotspot[get(hsp_name)].hoverstatus,%9);
         set(hotspot[get(hsp_name)].hotspotStyle,%10);
         set(hotspot[get(hsp_name)].opentype,%11);
         set(hotspot[get(hsp_name)].hotlink,%7);
@@ -78,33 +79,47 @@
             txtadd(line,'<div style="background-color: ',get(borderColor),';width:1px;height:80px;"></div>');
             copy(hotspot[get(hsp_name)].html,line);
             <!-- txtadd(hotspot[get(hsp_name)].onloaded,"add_tooltip_label();add_tooltip_dot();"); -->
-            set_label_dir(get(hsp_name),get(lineDirection),0);
+            if(isShowLine == 1, set_label_dir(get(hsp_name),get(lineDirection),0););
+           
+             if(isShowLine == 0, 
+                txtadd(tooltipname, 'tooltip_', get(hsp_name)); 
+                txtadd(tooltipdot, 'tooldot_', get(hsp_name)); 
+                <!-- set_label_dir(get(hsp_name),get(lineDirection),0); -->
+                set(hotspot[get(hsp_name)].width,0);
+                trace('隐藏标线::',get(tooltipdot));
+                set(layer[get(tooltipname)].x,0);
+                set(layer[get(tooltipname)].y,0);
+                set(layer[get(tooltipname)].rotate,0);
+                set(hotspot[get(hsp_name)].visible,true);
+                set(layer[get(tooltipname)].visible,true);
+                set(layer[get(tooltipdot)].visible,false);
+             );  
         );
      
         txtadd(hotspot[get(hsp_name)].onloaded,"make_hotsport_animation(get(framewidth),get(framewidth),get(frameRate));");
-        trace('last_add::',hotspot[get(hsp_name)].onloaded);
+        <!-- trace('last_add::',hotspot[get(hsp_name)].onloaded); -->
         addhotspot(get(hsp_name));
     </action>
 
 	<action name="make_hotsport_animation">
     <!-- 1 square:(w/h) 2:imageW 3 imageH 4 frameRate -->
-       trace('imagewidth::',imagewidth,'::imageheight::',imageheight);
+       <!-- trace('imagewidth::',imagewidth,'::imageheight::',imageheight); -->
         registerattribute(xframes, calc((imagewidth / %1) BOR 0));
         registerattribute(yframes, calc((imageheight / %2) BOR 0)); 
         registerattribute(frames, calc(xframes * yframes));
         registerattribute(frame, 0); 
         registerattribute(animatiedOn, 1); 
         registerattribute(frameRate, %3);
-        trace('frameRate::',get(frameRate));
+        <!-- trace('frameRate::',get(frameRate)); -->
         set(crop, '0|0|%1|%2'); 
         clearinterval(calc('crop_anim_' + name));
         if(%3 == '' OR frameRate == 0 OR isNaN(frameRate),
         set(frameRate,calc(1.0 / 60));
-        trace('没有frameRate',get(calc(1.0 / 60)));
-        trace('没有frameRate-1',get(frameRate));
+        <!-- trace('没有frameRate',get(calc(1.0 / 60)));
+        trace('没有frameRate-1',get(frameRate)); -->
         );
-        trace('params::1::',%1,'::2::',%2,'::3::',%3,':frameRate:',get(frameRate));
-        trace('xframes1::',get(xframes),'::yframes1::',get(yframes));
+        <!-- trace('params::1::',%1,'::2::',%2,'::3::',%3,':frameRate:',get(frameRate));
+        trace('xframes1::',get(xframes),'::yframes1::',get(yframes)); -->
    
                
         if(frameRate GE 0,
@@ -134,6 +149,7 @@
 	</action>
 
     <action name="add_tooltip_label">
+        showlog();
         txtadd(tooltipname, 'tooltip_', get(name)); 
       
         txtsplit(hotspotStyle,'|',fontSize,pos,isHover,borderColor,fillColor,textColor,isShowLine,isTextWrap,lineDirection,textDirection,textNumPerLine,duration,frameNumber);
@@ -162,21 +178,45 @@
         
                                 <!-- label方位 -->
         if(get(hotspottype) LE 2,
-       <!-- trace('hotspottype::',get(hotspottype),'::tooltipname::',get(tooltipname),'pos::',get(pos)); -->
-        <!-- set_label_pos(get(tooltipname),get(pos)); -->
-        delayedcall(0.1,
+         copy(hoverstatus,hotspot[get(name)].hoverstatus); 
+         trace('hovering-label::',get(hoverstatus));
+        <!-- delayedcall(0.1,
+            txtadd(tooltipname, 'tooltip_', get(name)); 
+            set_label_pos(get(tooltipname),get(pos));
+         ); -->
+          if(hoverstatus == 0,
+            delayedcall(0.1,
             txtadd(tooltipname, 'tooltip_', get(name)); 
             set_label_pos(get(tooltipname),get(pos));
+            );
+         );
+        if(hoverstatus == 1,
+            set(layer[get(tooltipname)].visible,false);
+         );
+          <!-- 2 hover  -->
+        if(hoverstatus == 2,
+            trace('测试');
+           set(layer[get(tooltipname)].visible,false);
+            delayedcall(0.1,
+             txtadd(tooltipname, 'tooltip_', get(name)); 
+                set_label_pos(get(tooltipname),get(pos));
+                set(layer[get(tooltipname)].visible,false);
+            );
+            set(hotspot[get(name)].onhover,txtadd(tooltipname, 'tooltip_', get(name)); set(layer[get(tooltipname)].visible,true););
+            set(hotspot[get(name)].onout,
+             txtadd(tooltipname, 'tooltip_', get(name)); 
+             set(layer[get(tooltipname)].visible,false);
+            );
          );
        );
 
         <!-- 个性化标签(3) -->
         if(get(hotspottype) == 3,    
-          trace('add_tooltip_label::',get(lineDirection));
+           if(
+            isShowLine==1,
             set(layer[get(tooltipname)].direction,get(lineDirection));
             delayedcall(0.2,txtadd(tooltipname, 'tooltip_', get(name)); set_label_dir(get(tooltipname),get(layer[get(tooltipname)].direction),1); );
-      
-
+          );
         );
         copy(layer[get(tooltipname)].html, labelCode);
         
@@ -210,10 +250,10 @@
 
         <!-- 个性化标签(3) -->
         if(get(hotspottype) == 3,    
-            <!-- trace('lineDirection3::',lineDirection);  -->
-                            <!-- call(set_label_dir); -->
-            set(layer[get(tooldot)].visible,true);
-            set_label_dir(get(tooldot),get(lineDirection),2);            
+    
+            if(isShowLine ==1,set(layer[get(tooldot)].visible,true);set_label_dir(get(tooldot),get(lineDirection),2););
+            if(isShowLine ==0,set(layer[get(tooldot)].visible,false););
+                  
         );
 
     </action>

+ 7 - 2
packages/qjkankan-view/src/sdk/QJKanKan/modules/hotspot.js

@@ -40,14 +40,18 @@ const convertBaseStyle = (dest, origin) => {
         dest.style.position = origin.titlePosition
 
         if (origin && origin.titleDisplayMode == "always") {
-            dest.visible = true
+            dest.visible = 0
         }
         if (origin && origin.titleDisplayMode == "never") {
-            dest.visible = false
+            dest.visible = 1
+        }
+        if (origin && origin.titleDisplayMode == "hover") {
+            dest.visible = 2
         }
         dest.style.borderColor = '';
         dest.style.fillColor = 'rgba(0,0,0,0.8)';
         dest.style.textColor = 'rgba(255,255,255,1)';
+
     }
     //custom
     if (origin && origin.hotspotIconType === 'serial_frame') {
@@ -64,6 +68,7 @@ const convertBaseStyle = (dest, origin) => {
         dest.style.textColor = origin.personalizedTagInfo.textColor
         dest.style.textDirection = origin.personalizedTagInfo.textDirection
         dest.style.textNumPerLine = origin.personalizedTagInfo.textNumPerLine
+        dest.style.isShowLine = origin.personalizedTagInfo.isShowLine
     }
 
 }