wenliming 2 年 前
コミット
ae2e79b0fe

+ 3 - 2
src/view/iframe/publish/tool-box/child/editor.vue

@@ -108,8 +108,8 @@ const searchHandler = async () => {
     guideData: '',
     iconPath: favicon,
     interactType: '',
-    linkImagePath: "",
-    name: siteTitle,
+    linkImagePath: '',
+    name: '',
   }
 
   if (siteRes) {
@@ -124,6 +124,7 @@ const searchHandler = async () => {
         siteTitle = urlObj.hostname;
         currentApp.defaultTit = siteTitle;
       }
+      currentApp.name = siteTitle;
     }
     favicon = urlObj.origin + '/favicon.ico';
   }

+ 18 - 7
src/view/iframe/publish/tool-box/child/preview.vue

@@ -35,14 +35,21 @@
                         </div>
                     </div>
                     <div class="card-wrapper" :style="{ 'zoom': reviewCanvasParams.zoom }">
-                        <img class="cover" :src="previewData.linkImagePath || require('@/assets/svg/img-default-site-cover.svg')" />
-                        <!-- v-if="previewData.linkImagePath && previewData.appId" <iframe class="iframe" 
+                        <img class="cover" v-if="previewData.linkImagePath && previewData.appId" :src="previewData.linkImagePath" />
+                        <iframe class="iframe" 
                             :src="previewData.convertUrl"
-                            v-else></iframe>  -->
+                            v-else></iframe> 
 
                         <div class="bottom-bar">
                             <div class="site-url">DeNet.me</div>
-                            <div class="desc">Install DeNet Plugin to Participate</div>
+                            <div class="desc">
+                                <template v-if="previewData.appId">
+                                    {{previewData.currentApp.linkTitle}}
+                                </template>
+                                <template v-else>
+                                    {{previewData.currentApp.defaultTit ? 'Install DeNet Plugin to Participate' : previewData.currentApp.name}}
+                                </template>
+                            </div>
                         </div>
                     </div>
                 </div>
@@ -139,6 +146,8 @@ const calcPreviewCanvasParams = () => {
 }
 
 const publishHandler = () => {
+    // 去 checkout 有没有封面图 loading ...
+    
     if(submitIng.value) {
         return;
     }
@@ -146,10 +155,13 @@ const publishHandler = () => {
 
     setHistoryData(currentApp);
 
+    let linkTitle = previewData.currentApp.defaultTit ? 'Install DeNet Plugin to Participate' : previewData.currentApp.name;
+
     let postBizData = {
         convertUrl,
         originUrl,
-        appId
+        appId,
+        linkTitle: !appId ? linkTitle : ''
     };
     let data = {
         params: {
@@ -168,8 +180,7 @@ const publishHandler = () => {
             emits("publishFinish", { publishRes });
         } else {
         }
-    })
-    .catch((err) => {
+    }).catch((err) => {
         console.log(err);
     });
 }