ananzhusen 1 год назад
Родитель
Сommit
bd9d98c432

+ 1 - 0
public/view/meta2d-vue3/index.html

@@ -8,6 +8,7 @@
   </head>
   <body>
     <div id="app"></div>
+    <script src="js/1.js"></script>
     <script src="js/r.js"></script>
     <script src="js/lcjs.iife.js"></script>
     <script src="js/marked.min.js"></script>

+ 5 - 1
public/view/meta2d-vue3/src/components/Meta2d.vue

@@ -50,8 +50,12 @@ onMounted(async () => {
 
   //注册控件
   setTimeout(async()=>{
+    window.userId = meta2d.store.data.userId;
     window.registerIot(window.userId,'/js/2d-components.js');
-    meta2d.render();
+    if (window.meta2dTools && registerToolsNew) {
+      registerToolsNew();
+    }
+    meta2d.fitView(true,0);
   },1000);
 });
 

+ 4 - 4
src/services/download.ts

@@ -355,7 +355,7 @@ export const preFrameDownload = async (type: Frame) => {
       let purchasedList = res.list.map((i) => i.name);
       data.pens.forEach((pen) => {
         if (pen.name === 'svgPath' && pen.svgUrl) {
-          if (purchasedList.includes(pen.svgUrl)) {
+          if (purchasedList.includes(pen.svgUrl.replace(img_cdn, ''))) {
             pen.pathId = null;
           }
         }
@@ -372,7 +372,7 @@ export const preFrameDownload = async (type: Frame) => {
         ? 'meta2d-vue2'
         : 'meta2d-react'
     }/public/json/data.json`,
-    JSON.stringify(data).replaceAll(cdn, '').replaceAll(upCdn, '')
+    JSON.stringify(data).replaceAll(img_cdn, '').replaceAll(img_upCdn, '')
   );
   await Promise.all([
     zipJs(_zip),
@@ -404,7 +404,7 @@ async function zipIotPens(zip: JSZip) {
     js,
     { createFolders: true }
   );
-  const res: Blob = await axios.get('/view/js/r.js', {
+  const res: Blob = await axios.get( cdn+'/view/js/r.js', {
     responseType: 'blob',
   });
   zip.file(
@@ -424,7 +424,7 @@ async function zipJs(zip: JSZip) {
   const files = ['/view/js/marked.min.js', '/view/js/lcjs.iife.js'];
   await Promise.all(
     files.map(async (filePath) => {
-      const res: Blob = await axios.get(filePath, {
+      const res: Blob = await axios.get(cdn+filePath, {
         responseType: 'blob',
       });
       zip.file(

+ 18 - 2
src/views/components/Header.vue

@@ -342,12 +342,17 @@
           <div v-for="pngPen in prePayList.pngs" class="pay-line">
             <div>
               <t-image :src="pngPen" :lazy="true" fit="contain" />
+              <p class="pay-p" :title="pngPen.slice(
+                  pngPen.lastIndexOf('/') + 1,
+                  pngPen.lastIndexOf('.')
+                )">
               {{
                 pngPen.slice(
                   pngPen.lastIndexOf('/') + 1,
                   pngPen.lastIndexOf('.')
                 )
               }}
+              </p>
             </div>
             <div>
               <check-icon
@@ -444,12 +449,17 @@
                   :lazy="true"
                   fit="contain"
                 />
+                <p class="pay-p" :title="svgPen.slice(
+                    svgPen.lastIndexOf('/') + 1,
+                    svgPen.lastIndexOf('.')
+                  )">
                 {{
                   svgPen.slice(
                     svgPen.lastIndexOf('/') + 1,
                     svgPen.lastIndexOf('.')
                   )
                 }}
+                </p>
               </div>
               <div>
                 <check-icon
@@ -1394,7 +1404,7 @@ const saveDownload = async () => {
           let meta2dData = JSON.parse(item.data);
           meta2dData.pens.forEach((pen) => {
             if (pen.name === 'svgPath' && pen.svgUrl) {
-              if (svgnames.includes(pen.svgUrl)) {
+              if (svgnames.includes(pen.svgUrl.replace(img_cdn, ''))) {
                 pen.pathId = null;
               }
             }
@@ -1416,7 +1426,7 @@ const saveDownload = async () => {
     list.map(async (item: any) => {
       if (item.url) {
         //接口请求
-        const res: Blob = await axios.get(item.url, {
+        const res: Blob = await axios.get(item.url.startsWith('/')?(cdn+item.url):item.url, {
           responseType: 'blob',
         });
         zip.file(item.path, res, { createFolders: true });
@@ -2241,6 +2251,12 @@ const onSuccess = (success: boolean) => {
     }
   }
 
+  .pay-p{
+    overflow:hidden;
+    text-overflow:ellipsis;
+    white-space:nowrap;
+  }
+
   & > div:first-child {
     width: 40%;
     display: flex;