浏览代码

Merge branch 'dev_1.1.7.1' of https://git.yishihui.com/DeNet/de-net into dev_1.1.7.1

zhangwei 2 年之前
父节点
当前提交
3f569425be

+ 5 - 3
src/logic/content/ParseCard.js

@@ -586,8 +586,8 @@ class ParseCard {
         if (!dom_card || !dom_card.parentElement) {
             return
         }
-        let dom = dom_card.querySelector('div[id^=jsc_c_]').parentElement
-        dom.style = 'min-height:500px'
+        let card = dom_card.querySelector('div[id^=jsc_c_]');
+        let dom = card && card.parentElement;
         if (dom) {
             for (let i = 0; i < dom.childNodes.length; i++) {
                 if (dom.childNodes[i].dataset && dom.childNodes[i].dataset.testid && dom.childNodes[i].dataset.testid == 'card.wrapper') {
@@ -602,9 +602,11 @@ class ParseCard {
             let post_Id = originUrl.pathname.slice(1);
 
             if (post_Id.indexOf('luckdraw/') >= 0) {
+                dom.style = 'min-height:500px'
                 post_Id = post_Id.replace('luckdraw/', '');
                 dom.appendChild(this.createIframe({ post_Id, tweet_author, page_type: '抽奖' }, true))
-            } else if (!post_Id.includes('/')) {
+            } else if (post_Id.indexOf('/') === -1) {
+                dom.style = 'min-height:500px'
                 dom.appendChild(this.createIframe({ post_Id, tweet_author }, true))
             }
         }

+ 7 - 1
src/logic/content/twitter.js

@@ -558,7 +558,7 @@ const setDialogPublishContent = throttle(function (content) {
         if (inputEle) {
             inputEle.dispatchEvent(event);
         }
-    }, 600)
+    }, 800)
 }, 600);
 
 /**
@@ -2593,6 +2593,12 @@ export const setGroupInfo = (params = {}) => {
     }
 }
 
+export const getExtensionStorgeDataForIframe = (data) => {
+    getChromeStorage(data.key).then((res) => {
+        messageCenter.send(data.iframeID, `IFRAME_GET_EXTENSION_STORGE_DATA-${data.messageID}`, res)
+    });
+}
+
 const getSysTheme = () => {
     const themeMedia = window.matchMedia("(prefers-color-scheme: light)");
     if (themeMedia.matches) {

+ 12 - 1
src/view/components/currency-list.vue

@@ -186,7 +186,18 @@ const searchCurrency = debounce(function (searchWords) {
     }).then(res => {
         if (res.code == 0) {
             if (res.data.currencyCategories && res.data.currencyCategories.length) {
-                let list = res.data.currencyCategories[0];
+                let currencyCategories = res.data.currencyCategories;
+
+                let arr = [];
+                for(let i = 0; i < currencyCategories.length; i++) {
+                  let item = currencyCategories[i];
+                  arr = arr.concat(item.data);
+                }
+
+                currencyCategories[0]['data'] = arr;
+
+                let list = currencyCategories[0];
+
                 if (list && list.data && list.data.length) {
                     searchList.value = list.data;
                 } else {

+ 3 - 3
src/view/components/custom-card-cover.vue

@@ -181,9 +181,9 @@ const props = defineProps({
 watch(() => props.show, (newVal) => {
       if(newVal) {
         zoomCom.value && zoomCom.value.setFontZoom(0);
-        zoomCom1.value && zoomCom.value.setFontZoom(0);
-        zoomCom2.value && zoomCom.value.setFontZoom(0);
-        zoomCom3.value && zoomCom.value.setFontZoom(0);
+        zoomCom1.value && zoomCom1.value.setFontZoom(0);
+        zoomCom2.value && zoomCom2.value.setFontZoom(0);
+        zoomCom3.value && zoomCom3.value.setFontZoom(0);
       }
     },
     {

+ 1 - 1
src/view/iframe/nft/card.vue

@@ -127,7 +127,7 @@ const share = () => {
             tagSearch = `${btoa(tagArr[0])}`
         }
         let url = pageUrl + `/nft/${saleData.value.nftProjectId}/${tagSearch}`
-        let content = `${url} #DNFT \r\r `
+        let content = `#DNFT\r\r${url}`
         chrome.tabs.getCurrent((tab) => {
             chrome.tabs.sendMessage(tab.id, { actionType: "IFRAME_TWITTER_PUBLISH", publishRes: { srcContent: content }  });
         });

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

@@ -240,7 +240,7 @@ const createGuideWindow = (params, isUpdate = false) => {
       width: 500,
       type: 'popup',
       url: guideUrl,
-      left: windowWith,
+      left: window.screen.availLeft > 0 ? windowWith : window.screen.availLeft + windowWith,
       state: 'normal'
     })
     openWindowList.push(window2);

+ 16 - 2
src/view/iframe/publish/tool-box/child/preview.vue

@@ -268,8 +268,22 @@ const submitPublish = () => {
 
     if(!appId) {
         let allowContentTypes = props.contentTypeConfig.allowContentTypes || [];
-        let isSupport = allowContentTypes.indexOf(props.resourceInfo.contentType);
-        if(isSupport < 0) {
+        let isSupport = false;
+
+        if(props.resourceInfo.loadSuccess) {
+          for(let i = 0; i< allowContentTypes.length; i++){
+            let idx = props.resourceInfo.contentType.indexOf(allowContentTypes[i]);
+            if(idx > -1) {
+              isSupport = true;
+              break;
+            }
+          }
+        } else {
+          message.error('Page loading failed');
+          return;
+        }
+
+        if(!isSupport) {
           message.warning(props.contentTypeConfig.unSupportToast);
           return;
         }

+ 3 - 3
src/view/iframe/publish/tool-box/index.vue

@@ -91,6 +91,7 @@ let resourceInfo = ref({
   statusCode: '',
   title: '',
   hasTitle: false,
+  loadSuccess: false
 });
 
 const changeShowCom = (params) => {
@@ -111,6 +112,7 @@ const changeShowCom = (params) => {
       statusCode: '',
       title: '',
       hasTitle: false,
+      loadSuccess: false
     };
 
     if(!params.appId || params.appId && !params.linkImagePath) {
@@ -145,15 +147,13 @@ const changeShowCom = (params) => {
 }
 
 const getResourceInfo = ({url}) => {
-  console.log(url)
   axios.get(url).then(res => {
-
     if(res) {
       resourceInfo.value.isSet = true;
       resourceInfo.value.contentType = res.headers['content-type'];
       resourceInfo.value.statusCode = res.request.status;
       resourceInfo.value.hasTitle = resourceInfo.value.contentType.indexOf('text/html') > -1 ? true : false;
-      console.log(res, resourceInfo.value, 'resourceInfo')
+      resourceInfo.value.loadSuccess = true;
 
       let siteTitle = '';
       if(resourceInfo.value.hasTitle) {

+ 7 - 5
src/view/iframe/red-packet/red-packet.vue

@@ -1195,6 +1195,7 @@ function setFrontConfig() {
 };
 
 function init(initParams) {
+  state.loading_show = true;
   let { type } = initParams || {};
   onPageVisbile();
   onWindowMessage();
@@ -1234,6 +1235,7 @@ function init(initParams) {
       handleErrorCode(res)
     }
   }).finally(() => {
+    state.loading_show = false
     state.loading_redbag = false
   })
 }
@@ -1481,11 +1483,11 @@ function handleFinishRedPacket() {
     if (res.code == 0) {
       if (res.data.finished) {
         state.receiveAmount = res.data.receiveAmount
-        if (state.receiveAmount == 0) {
-          showRabbitPage()
-        } else {
-          state.status = 'success'
-        }
+        // if (state.receiveAmount == 0) {
+        //   showRabbitPage()
+        // } else {
+        //   state.status = 'success'
+        // }
         init()
         // 埋点
         Report.reportLog({