소스 검색

[fix] NFT group

wenliming 2 년 전
부모
커밋
9b9ff3a370

+ 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'>

+ 2 - 2
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>
@@ -398,7 +398,7 @@ onUnmounted(() => {
                     top: 90px;
 
                     .iframe {
-                        height: calc(100% - 73px);
+                        height: calc(100% - 71px);
                         width: 100%;
                         border: none;
                         pointer-events: none;

+ 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"

+ 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) {