|
@@ -65,10 +65,11 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { ref, defineEmits, reactive, defineProps, onMounted, nextTick, onUnmounted } from "vue";
|
|
|
-import { postPublish } from "@/http/publishApi";
|
|
|
-import installCard from '@/view/content/tool-box/index.vue'
|
|
|
+import { ref, defineEmits, reactive, defineProps, onMounted, nextTick, onUnmounted, watch } from "vue";
|
|
|
+import { message } from "ant-design-vue";
|
|
|
|
|
|
+import installCard from '@/view/content/tool-box/index.vue'
|
|
|
+import { postPublish } from "@/http/publishApi";
|
|
|
import { getChromeStorage, setChromeStorage } from "@/uilts/chromeExtension"
|
|
|
import { getUser } from "@/http/publishApi"
|
|
|
|
|
@@ -83,6 +84,8 @@ let reviewCanvasParams = reactive({
|
|
|
});
|
|
|
let timer = ref(null);
|
|
|
|
|
|
+const loadingHide = null;
|
|
|
+
|
|
|
const props = defineProps({
|
|
|
previewData: {
|
|
|
type: Object,
|
|
@@ -91,6 +94,17 @@ const props = defineProps({
|
|
|
originUrl: '',
|
|
|
appId: ''
|
|
|
}
|
|
|
+ },
|
|
|
+ screenshot: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+watch(() => props.screenshot, (newVal) => {
|
|
|
+ let { appId } = props.previewData;
|
|
|
+ if(loadingHide && newVal && !appId) {
|
|
|
+ submitPublish();
|
|
|
}
|
|
|
})
|
|
|
|
|
@@ -146,13 +160,26 @@ const calcPreviewCanvasParams = () => {
|
|
|
}
|
|
|
|
|
|
const publishHandler = () => {
|
|
|
- // 去 checkout 有没有封面图 loading ...
|
|
|
-
|
|
|
- if(submitIng.value) {
|
|
|
+ let { appId } = props.previewData;
|
|
|
+ if(loadingHide) {
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
+ if(!appId && !props.screenshot) {
|
|
|
+ loadingHide = message.loading('loading...', 0);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ submitPublish();
|
|
|
+}
|
|
|
+
|
|
|
+const submitPublish = () => {
|
|
|
let {convertUrl, originUrl, appId, currentApp} = props.previewData;
|
|
|
|
|
|
+ if(submitIng.value) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
setHistoryData(currentApp);
|
|
|
|
|
|
let linkTitle = previewData.currentApp.defaultTit ? 'Install DeNet Plugin to Participate' : previewData.currentApp.name;
|