ソースを参照

use hottag old icon

gemercheung 1 年間 前
コミット
9dddcee877

+ 2 - 2
src/components/hotspot/common.ts

@@ -1,6 +1,6 @@
 import { getApp } from '/@/hooks/userApp';
 
-export const changeUrl = (name: string) => {
+export const changeUrl = (name: string, now = false) => {
   if (name.indexOf('http') != -1) {
     return name;
   } else {
@@ -10,7 +10,7 @@ export const changeUrl = (name: string) => {
     ) {
       return name;
     } else {
-      return getApp().resource.getUserResourceURL(name);
+      return getApp().resource.getUserResourceURL(name, false, now);
     }
   }
 };

+ 24 - 0
src/components/hotspot/constant.ts

@@ -0,0 +1,24 @@
+import { ref } from 'vue';
+
+export const defaultStyles = ref([
+  {
+    name: 'hotpot_music.svg',
+    sid: 'hotpot_music.svg',
+    type: 'music',
+  },
+  {
+    name: 'hotpot_pic.svg',
+    sid: 'hotpot_pic.svg',
+    type: 'pic',
+  },
+  {
+    name: 'hotpot_video.svg',
+    sid: 'hotpot_video.svg',
+    type: 'video',
+  },
+  {
+    name: 'hotpot-text.svg',
+    sid: 'hotpot-text.svg',
+    type: 'text',
+  },
+]);

+ 12 - 5
src/components/hotspot/index.vue

@@ -56,7 +56,7 @@
   import { changeUrl } from './common';
 
   import ShowTag from './show-tag.vue';
-
+  import { defaultStyles } from './constant';
   import { ComputedRef } from 'vue';
   import { watch } from 'vue';
   const sceneStore = useSceneStore();
@@ -183,11 +183,18 @@
     });
   });
   const getUrl = (icon) => {
-    let url =
-      icon == '' || !icon ? getApp().resource.getAppURL('images/tag_icon_default.svg') : icon;
-    // debugger;
-    return changeUrl(url);
+    // let url = icon == '' || !icon ? getApp().resource.getAppURL('images/tag_icon_default.svg') : icon
+    let url;
+    if (styleList.value.includes(icon)) {
+      // url = getApp().resource.getAppURL('images/tag/' + icon)
+      url = getApp().resource.getAppURL('images/tag_icon_default.svg');
+    } else {
+      url =
+        icon == '' || !icon ? getApp().resource.getAppURL('images/tag/hotpot-default.svg') : icon;
+    }
+    return changeUrl(url, true);
   };
+  const styleList = computed(() => defaultStyles.value.map((i) => i.name));
 
   const focusTag = (tag: tagType) => {
     nextTick(() => {