Quellcode durchsuchen

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

zhangwei vor 2 Jahren
Ursprung
Commit
c6eec830aa

+ 8 - 0
src/http/publishApi.js

@@ -75,6 +75,14 @@ export function searchCurrencyInfo(params) {
   })
 }
 
+export function getCurrencyInfoBySymbol(params) {
+  return service({
+    url: `/currency/v2/getCurrencyInfoBySymbol`,
+    method: 'post',
+    data: params
+  })
+}
+
 export function syncChainTokenRechargeRecord(params) {
   return service({
     url: `/wallet/recharge/syncChainTokenRechargeRecord`,

+ 2 - 2
src/logic/content/twitter.js

@@ -1268,13 +1268,13 @@ export const showNFTCard = () => {
     if (where) {
         let iframe = document.createElement('iframe');
         iframe.src = chrome.runtime.getURL(`/iframe/nft-card.html`)
-        iframe.style.cssText = 'border:medium none; width:100%; height:297px;';
+        iframe.style.cssText = 'border:medium none; width:100%; height:290px;';
         let nftElement = document.createElement('div');
         nftElement.id = 'de-nft-node';
         nftElement.innerHTML = `
                 ${iframe.outerHTML}
                 <style>
-                    #de-nft-node {height:297px; margin-bottom:17px; display:none;}
+                    #de-nft-node {height:290px; margin-bottom:17px; display:none;}
                 </style>
             `;
 

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

@@ -149,7 +149,7 @@ body {
 
 .nft {
     width: 100%;
-    height:297px;
+    height: 290px;
     user-select:none;
     border-radius:20px;
     background:#F7F9F9;
@@ -210,20 +210,20 @@ body {
 
     .buy {
         position: relative;
-        height: 61px;
+        height: 54px;
         display: flex;
         justify-content: center;
-        align-items: center;
         .guide {
             position: absolute;
-            top: 20px;
+            top: 6px;
             right: 30%;
             width: 26px;
             animation: fade 1s infinite;
         }
         button {
-            width: 310px;
+            width: 100%;
             height: 34px;
+            margin: 0 20px;
             cursor: pointer;
             color: #ffffff;
             font-size: 15px;

+ 17 - 23
src/view/popup/currency-detail.vue

@@ -2,7 +2,7 @@
   <div class="currency-detail-page">
     <v-head :title="currencyInfo.tokenSymbol" 
             :show_more="false"
-            :show_refresh="false"
+            :show_refresh="true"
             :show_list="true"
             :transactionsRouterParams="{
               backUrl: 'back'
@@ -58,7 +58,7 @@ import router from "@/router/popup.js";
 import Report from "@/log-center/log";
 import { getStorage } from "@/uilts/help";
 
-import { syncChainTokenRechargeRecord } from "@/http/publishApi";
+import { getCurrencyInfoBySymbol } from "@/http/publishApi";
 
 import VHead from '@/view/popup/components/head.vue'
 import currencySelect from "@/view/components/currency-select.vue";
@@ -154,30 +154,24 @@ const depositHandle = (_params) => {
 };
 
 const onRefresh = () => {
-    asyncTokenRechRecord(currencyInfo.value, (res) => {
-      if(res.code == 0 && res.data && res.data.length) {
-          let currencyData = res.data[0];
-          if(currencyData.currencyCode == currencyInfo.value.currencyCode) {
-            currencyInfo.value.balance = currencyData.balance;
-            currencyInfo.value.usdEstimateBalance = currencyData.usdEstimateBalance;
-          }
+  getCurrencyInfoBySymbol({
+    params: {
+      symbol: currencyInfo.value.tokenSymbol
+    }
+  }).then(res => {
+    if(res.code == 0) {
+      if(res.data && res.data.currencyCategories && res.data.currencyCategories.length) {
+        let data = res.data.currencyCategories[0].data;
+        if(data.length) {
+          let {totalBalance = '', totalUsdEstimateBalance = ''} = data[0] || {};
+          currencyInfo.value.totalBalance = totalBalance;
+          currencyInfo.value.totalUsdEstimateBalance = totalUsdEstimateBalance;
+        }
       }
-    })
+    }
+  })
 };
 
-
-const asyncTokenRechRecord = (_params, cb) => {
-    let { currencyCode = '' } = _params;
-    if(!currencyCode || currenciesData.value.length > 1) return;
-    syncChainTokenRechargeRecord({
-        params: {
-            currencyCode: currencyCode
-        }
-    }).then(res => {
-        cb && cb(res)
-    })
-}
-
 onMounted(() => {
     let {params = '{}'} = router.currentRoute.value.query;