浏览代码

Merge branch 'fix_220722_1.1.5.1' into dev_1.1.6

wenliming 2 年之前
父节点
当前提交
681d26a923

+ 6 - 1
src/http/fetch.js

@@ -61,7 +61,12 @@ export async function commonFetch({ url = '', method = 'POST' , params = {}, bas
                 resolve(data);
             })
             .catch((error) => {
-                reject({url: _url, error: error, requestParams: bodyObj});
+                if(!error) {
+                    error = {}
+                }
+                reject({url: _url, 
+                        error: { message: error.message, stack: error.stack }, 
+                        requestParams: bodyObj });
             });
     })
 }

+ 1 - 1
src/logic/background/twitter.js

@@ -310,7 +310,7 @@ export function onInstalledCreateTab() {
                         groupTabData: JSON.stringify({
                             deTabVal: 'deGroupTab'
                         })
-                    }, (res) => {
+                    }, (response) => {
                         let url = `https://twitter.com/${res.twitterAccount}`
                         chrome.tabs.create({
                             url

+ 19 - 0
src/logic/content/twitter.js

@@ -927,6 +927,7 @@ export function init() {
     }
 
     if (window.location.host.includes('twitter.com')) {
+        onPageVisbile();
         renderDom();
         showNFTCard()
         showNFTGroupIcon()
@@ -970,6 +971,24 @@ export function init() {
     });
 }
 
+function onPageVisbile() {
+    document.addEventListener('visibilitychange', function () {
+        let isHidden = document.hidden;
+        if (!isHidden) {
+            depositUSShowPopupPage();
+        }
+    });
+}
+
+const depositUSShowPopupPage = async () => {
+    let {form = ''} = await getChromeStorage('achPayData') || {};
+    if(form == 'popupPage') {
+        showPopupPage();
+        chrome.storage.local.remove("achPayData");
+    }
+}
+
+
 function checkHasSliderDeBtn() {
     let deBtn = document.getElementById('de-btn');
     let deBtn3 = document.getElementById('de-btn3');

+ 20 - 3
src/view/iframe/buy-nft/buy/home.vue

@@ -1,5 +1,5 @@
 <template>
-    <div class="dialog">
+    <div class="dialog"  :style="{'height': dialogStyle.height + 'px'}">
         <!-- home -->
         <div class="area-title">
             <img :src="require('@/assets/svg/icon-close.svg')" @click="clickClose" />
@@ -87,6 +87,9 @@ import BtnLoading from '../components/btn-loading.vue'
 import { getQueryString } from "@/uilts/help";
 let pay_info = inject('pay_info');
 const router = useRouter()
+let dialogStyle = reactive({
+    height: '800'
+})
 let state = reactive({
     data: {
         salePlans: [
@@ -118,7 +121,19 @@ const clickJump = (item) => {
     pay_info.home.sale_plan = item
     router.push({ path: '/pay' });
 }
+
+const setDialogStyle = () => {
+    let clientHeight = window.innerHeight;
+    if(clientHeight >= 840) {
+        dialogStyle.height = 800;
+    } else {
+        dialogStyle.height = clientHeight - 40;
+    }
+}
+
 onMounted(() => {
+    setDialogStyle();
+
     let nft_project_Id = router.currentRoute.value.query.nftProjectId
     let nft_group_Id = router.currentRoute.value.query.nft_group_Id
     if(nft_group_Id){
@@ -151,7 +166,6 @@ onMounted(() => {
     max-width: 1000px;
     min-width: 1000px;
     max-height: 90%;
-    min-height: 800px;
     z-index: 23;
     display: flex;
     flex-direction: column;
@@ -184,7 +198,7 @@ onMounted(() => {
 
         img {
             width: 100%;
-            height: 100%;
+            object-fit: contain;
         }
     }
 
@@ -217,6 +231,7 @@ onMounted(() => {
             display: flex;
             padding: 15px 0;
             min-height: 50px;
+            box-sizing: border-box;
 
             .buy5 {
                 border: 1px solid #1D9BF0;
@@ -233,6 +248,7 @@ onMounted(() => {
                 font-size: 14px;
                 cursor: pointer;
                 margin-right: 12px;
+                box-sizing: border-box;
 
                 .left {
                     margin-right: 20px;
@@ -279,6 +295,7 @@ onMounted(() => {
                 justify-content: space-between;
                 padding: 0 15px 0 20px;
                 margin-right: 25px;
+                box-sizing: border-box;
 
                 .left {
                     margin-right: 20px;

+ 16 - 3
src/view/iframe/buy-nft/buy/pay.vue

@@ -1,5 +1,5 @@
 <template>
-    <div class="dialog">
+    <div class="dialog" :style="{'height': dialogStyle.height + 'px'}">
         <!-- home -->
         <div class="area-title">
             <img :src="require('@/assets/svg/icon-back.svg')" @click="clickBack" />
@@ -111,6 +111,10 @@ let currentCurrencyInfo = reactive({
     balance: "",
 });
 
+let dialogStyle = reactive({
+    height: '800'
+})
+
 const updateData = (obj_data) => {
     if (Number(obj_data.balance) >= Number(pay_info.home.sale_plan.price)) {
         state.is_btn_grey = false
@@ -196,9 +200,19 @@ const getCurrencyInfo = async () => {
     }
 }
 
+const setDialogStyle = () => {
+    let clientHeight = window.innerHeight;
+    if(clientHeight >= 840) {
+        dialogStyle.height = 800;
+    } else {
+        dialogStyle.height = clientHeight - 40;
+    }
+}
+
 onMounted(() => {
     currentCurrencyInfo.currencyCode = pay_info.home.sale_plan.currencyCode
-    getLocalCurrencyInfoByCode()
+    getLocalCurrencyInfoByCode();
+    setDialogStyle()
 })
 
 
@@ -210,7 +224,6 @@ onMounted(() => {
     max-width: 1000px;
     min-width: 800px;
     max-height: 90%;
-    min-height: 800px;
     z-index: 23;
     display: flex;
     flex-direction: column;

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

@@ -23,7 +23,7 @@
 </template>
 
 <script setup>
-import { onBeforeMount, ref } from 'vue'
+import { onBeforeMount, ref, onMounted, onBeforeUnmount } from 'vue'
 import { getTwitterSaleNftProjectInfo, getNftProjectInfo } from '@/http/nft'
 import { pageUrl } from "@/http/configAPI.js"
 import { getChromeStorage, setChromeStorage } from '@/uilts/chromeExtension.js'
@@ -109,6 +109,7 @@ const share = () => {
 const buy = () => {
     getChromeStorage('userInfo', (_userInfo) => {
         if (!_userInfo) {
+            setChromeStorage({ buyNFTCardData: JSON.stringify({ action: 'buy' })});
             chrome.runtime.sendMessage(
                 { actionType: "POPUP_LOGIN", data: "" },
                 (response) => {
@@ -128,6 +129,14 @@ const buy = () => {
     })
 }
 
+const loginSuccessHandler = async () => {
+    let {action = ''} = await getChromeStorage('buyNFTCardData') || {};
+    if(action == 'buy') {
+        chrome.storage.local.remove("buyNFTCardData");
+        buy();
+    }
+} 
+
 onBeforeMount(() => {
     let urlParams = new URL(window.location.href);
     let searchParmas = new URLSearchParams(urlParams.search);
@@ -139,6 +148,28 @@ onBeforeMount(() => {
         getSaleInfo()
     }
 })
+
+const onRuntimeMsg = () => {
+    chrome.runtime.onMessage.addListener(msgListener)
+}
+
+
+const msgListener = (req, sender, sendResponse) => {
+    switch (req.actionType) {
+        case 'BG_LOGIN_SET_USERINFO_CB':
+            loginSuccessHandler();
+            break;
+    }
+}
+
+onMounted(() => {
+    onRuntimeMsg();
+})
+
+
+onBeforeUnmount(() => {
+    chrome.runtime.onMessage.removeListener(msgListener);
+})
 </script>
 
 <style lang='scss'>

+ 6 - 0
src/view/iframe/publish/give-dialog.vue

@@ -1018,6 +1018,12 @@ const updateCurrencyBanlce = async () => {
     if(currentCurrencyInfo.value.currencyCode == 'USD') {
         let currencyInfoRes = await getCurrencyByCode({currencyCode: currentCurrencyInfo.value.currencyCode});
 
+        calcRechPayAmount({
+            currencyCode: currentCurrencyInfo.value.currencyCode,
+            orderAmountValue: baseFormData.amountValue,
+            payChannel: 'ach'
+        });
+
         if(currencyInfoRes.code == 0 && currencyInfoRes.data) {
             currentCurrencyInfo.value = currencyInfoRes.data;
         }

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

@@ -153,7 +153,11 @@ const searchHandler = async (_params) => {
   }
   
   let convertRes = await convertUrl({ params: { originUrl: siteUrl.value } });
-  let params = { convertUrl: siteUrl.value, originUrl: siteUrl.value, appId: currentApp.appId, linkImagePath: currentApp.linkImagePath, currentApp };
+  let params = { convertUrl: siteUrl.value, 
+                  originUrl: siteUrl.value, 
+                  appId: currentApp.appId, 
+                  linkImagePath: currentApp.linkImagePath, 
+                  currentApp };
 
   loadingHide();
   clearTimeout(timer);

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

@@ -37,7 +37,7 @@
                     <div class="card-wrapper" :style="{ 'zoom': reviewCanvasParams.zoom }">
                         <img class="cover" v-if="previewData.linkImagePath && previewData.appId"
                             :src="previewData.linkImagePath" />
-                        <iframe class="iframe" :src="previewData.convertUrl" scrolling="no" v-else></iframe>
+                        <iframe class="iframe" sandbox :src="previewData.convertUrl" scrolling="no" v-else></iframe>
 
                         <div class="bottom-bar">
                             <div class="site-url">DeNet.me</div>
@@ -120,7 +120,7 @@ const props = defineProps({
 watch(() => props.screenshotWebsiteData,
     (newVal) => {
         let { appId } = props.previewData;
-        if (loadingHide && !appId && (newVal.url || newVal.status)) {
+        if (loadingHide && (!appId || appId && !props.previewData.linkImagePath ) && (newVal.url || newVal.status)) {
             loadingHide();
             loadingHide = null;
             submitPublish();
@@ -198,7 +198,7 @@ const publishHandler = () => {
         return;
     }
 
-    if (!appId && !props.screenshotWebsiteData.url) {
+    if ((!appId || appId && !props.previewData.linkImagePath) && !props.screenshotWebsiteData.url) {
         loadingHide = message.loading('loading...', 0);
         return;
     }
@@ -398,7 +398,7 @@ onUnmounted(() => {
                     top: 90px;
 
                     .iframe {
-                        height: calc(100% - 73px);
+                        height: calc(100% - 71px);
                         width: 100%;
                         border: none;
                         pointer-events: none;
@@ -408,7 +408,7 @@ onUnmounted(() => {
                     .cover {
                         height: calc(100% - 73px);
                         width: 100%;
-                        object-fit: contain;
+                        object-fit: cover;
                     }
 
                     .bottom-bar {

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

@@ -64,9 +64,9 @@ const changeShowCom = (params) => {
     previewData.linkImagePath = params.linkImagePath || '';
     previewData.currentApp = params.currentApp || {};
 
-    if(!params.appId) {
-        screenshotWebsiteData.url = '';
-        screenshotWebsiteData.status = '';
+    screenshotWebsiteData.url = '';
+    screenshotWebsiteData.status = '';
+    if(!params.appId || params.appId && !params.linkImagePath) {
         screenshotWebsite({
             params: {
                 url: params.convertUrl

+ 1 - 1
src/view/iframe/tool-box/card.vue

@@ -8,7 +8,7 @@
             </div>
         </div>
         <div class="content" v-if="pre_view">
-            <iframe :src="iframe_url" frameborder="0"></iframe>
+            <iframe :src="iframe_url" frameborder="0" sandbox></iframe>
         </div>
         <div class="content" v-else>
             <iframe :src="state.iframe_url" v-show="state.status == 'iframe'" ref="dom_iframe" frameborder="0"

+ 3 - 0
src/view/popup/currency-detail.vue

@@ -294,6 +294,9 @@ const confirmDeposit = (params) => {
   };
   let guideUrl = chrome.runtime.getURL('/iframe/ach-cashier.html');
   setChromeStorage({ achPayInfo : JSON.stringify(achPayInfo)});
+  setChromeStorage({ achPayData : JSON.stringify({
+    form: 'popupPage'
+  })});
 
   chrome.tabs.create({
     url: guideUrl

+ 0 - 1
src/view/popup/tabbar-page/index.vue

@@ -111,7 +111,6 @@ const onRuntimeMsg = () => {
 }
 
 const msgListener = (req, sender, sendResponse) => {
-  ;
   switch (req.actionType) {
     case 'BG_LOGIN_SET_USERINFO_CB':
       if (!userInfo.value.accessToken) {