|
@@ -1,14 +1,18 @@
|
|
|
<template>
|
|
|
<div class="page-wrapper">
|
|
|
<editor v-show="showCom == 'EDITOR'" :linkInputDescImage="pageData.linkInputDescImage" @changeShowCom="changeShowCom" />
|
|
|
- <preview v-show="showCom == 'PREVIEW'" :previewData="previewData"
|
|
|
- @publishFinish="publishFinish" />
|
|
|
+ <preview v-show="showCom == 'PREVIEW'"
|
|
|
+ :previewData="previewData"
|
|
|
+ :screenshotWebsiteData="screenshotWebsiteData"
|
|
|
+ :showCom="showCom"
|
|
|
+ @publishFinish="publishFinish" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
import { ref, reactive, watch, defineProps, defineEmits } from "vue";
|
|
|
|
|
|
+import { screenshotWebsite } from "@/http/toolBoxApi";
|
|
|
import editor from '@/view/iframe/publish/tool-box/child/editor.vue'
|
|
|
import preview from '@/view/iframe/publish/tool-box/child/preview.vue'
|
|
|
|
|
@@ -45,6 +49,11 @@ let previewData = reactive({
|
|
|
currentApp: {}
|
|
|
})
|
|
|
|
|
|
+let screenshotWebsiteData = reactive({
|
|
|
+ url: '',
|
|
|
+ status: '',
|
|
|
+});
|
|
|
+
|
|
|
const changeShowCom = (params) => {
|
|
|
showCom.value = 'PREVIEW';
|
|
|
previewData.convertUrl = params.convertUrl;
|
|
@@ -53,6 +62,31 @@ const changeShowCom = (params) => {
|
|
|
previewData.linkImagePath = params.linkImagePath || '';
|
|
|
previewData.currentApp = params.currentApp || {};
|
|
|
|
|
|
+ if(!params.appId) {
|
|
|
+ screenshotWebsiteData.url = '';
|
|
|
+ screenshotWebsiteData.status = '';
|
|
|
+ screenshotWebsite({
|
|
|
+ params: {
|
|
|
+ url: params.convertUrl
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ if(showCom.value != 'PREVIEW') {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(res.code == 0) {
|
|
|
+ screenshotWebsiteData.url = res.data;
|
|
|
+ screenshotWebsiteData.status = 1;
|
|
|
+ } else {
|
|
|
+ screenshotWebsiteData.status = 1;
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ if(showCom.value != 'PREVIEW') {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ screenshotWebsiteData.status = 1;
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
emits("onPageChange", {page: showCom.value});
|
|
|
}
|
|
|
|