|
@@ -15,6 +15,21 @@ export default class Tags extends Emiter {
|
|
|
this.emit('clickHotspot', { sceneCode, id, hid })
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 编码转换
|
|
|
+ */
|
|
|
+ htmlEncode(str) {
|
|
|
+ var s = "";
|
|
|
+ if (str.length == 0) return "";
|
|
|
+ s = str.replace(/\'/g, "'");
|
|
|
+ s = s.replace(/\"/g, """);
|
|
|
+ s = s.replace(/\(/g, "(");
|
|
|
+ s = s.replace(/\)/g, ")");
|
|
|
+ s = s.replace(/,/g, ",");
|
|
|
+ return s;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 添加热点
|
|
|
*/
|
|
@@ -25,7 +40,7 @@ export default class Tags extends Emiter {
|
|
|
this.app.krpanoDom.call(`addImgTextHotSpot(
|
|
|
${param.img.replace('static/','showviewer/').replace('.svg','.png').replace('@2x','')},
|
|
|
${param.name},
|
|
|
- ${param.hotspotTitle},
|
|
|
+ ${this.htmlEncode(param.hotspotTitle)},
|
|
|
${param.ath != '' ? param.ath : ath},
|
|
|
${param.atv != '' ? param.atv : atv},
|
|
|
${param.secne ? param.secne.sceneCode : 'notjump'},
|