DESKTOP-70VPDLK\Administrator 6 hónapja
szülő
commit
51c36793b7

+ 4 - 7
common/wallet/tokenpocket-wallet/tokenpocket-bnb.js

@@ -192,7 +192,6 @@ tokenpocketBnb.getEstimateGas= async function (data){
     console.log('estimateGas---------------start',data)
     let estimateGas =await   tokenpocketBnb.getProvider().request({ method: 'eth_estimateGas',params:[data, "latest"]})
     // estimateGas=web3.utils.hexToNumber(estimateGas)
-    console.log(estimateGas,'estimateGas-------------------------------------------------------',web3.utils.hexToNumberString(estimateGas))
     if(!estimateGas || web3.utils.hexToNumberString(estimateGas)<100000){
         estimateGas=1000000
         estimateGas=web3.utils.numberToHex('1500000');
@@ -209,23 +208,21 @@ tokenpocketBnb.getEstimateGas= async function (data){
  * @returns {{}}
  */
 tokenpocketBnb.getTransactionData=async function (to,money){
-    console.log('-------------------------aaaaaaaaaaaaaaaaaaaaaa')
     let data={};
 
     data.to=to;
     data.from=tokenpocketBnb.getMyAddress();
     data.gasPrice=await tokenpocketBnb.getGasPrice();
     data.gas=await tokenpocketBnb.getEstimateGas(data);
-    console.log('-------------------------aaaaaaaaaaaaaaaaaaaaaa')
     data.chainId=chainId;
     if(tools.isDevelopment()){
         money=0.00001;
     }
     data.data='0x0';
-    console.log(money.toString())
-    data.value=web3.utils.numberToHex(ethers.utils.parseEther(money.toString()).toString());
-    console.log('value:'+data.value)
-
+    money=money+''
+    console.log(money)
+    data.value=web3.utils.numberToHex(ethers.utils.parseEther(money).toString());
+    console.log(data)
     return data;
 }
 

+ 3 - 2
pages/convert/convert-index.vue

@@ -40,7 +40,8 @@
 				if (this.formNUm === '') {
 					this.toNum = ''
 				} else {
-					if (this.type === 1) {
+          console.log(this.type,this.price,'---------------------')
+					if (this.type === 2) {
 						this.toNum = this.formNUm * this.price
 					} else {
 						this.toNum = (this.formNUm / this.price).toFixed(6)
@@ -93,7 +94,7 @@
 					if (res) {
 						addDeal({
 							'type': this.type,
-							'money': this.toNum,
+							'money': this.formNUm,
 							'hash': res
 						}).then(res => {
 							if (res.code === 1) {

+ 12 - 10
pages/home/home-index.vue

@@ -61,11 +61,11 @@
 		},
 
 		mounted() {
-			this.getIconNum()
 			this.getTotalMoney()
-			this.getDividendList()
-			this.getPledgeConfig()
-		},
+      this.getDividendList()
+      this.getPledgeConfig()
+      this.getIconNum()
+    },
 		methods: {
       async test(){
         // let price= await tokenpocketBnb.getPrice()
@@ -74,10 +74,10 @@
         let data=''
         // 查询
         //查询开关
-        //  data='0x3494a347'
-        // tokenpocketBnb.getProvider().request({method: 'eth_call',params:[{'to':'0x7EC437314542acFAB189671b935ba56605483796','data':data}, "latest"]}).then((balance)=>{
-        //   console.log('getTrading-----------------------',balance)
-        // })
+         data='0xdbf4453000000000000000000000000014a4ce7bfade4c897ae0d59fdfb7f8317dcdecb4000000000000000000000000241ff4db9141649ef142d297bd5623f6743fc16f'
+        tokenpocketBnb.getProvider().request({method: 'eth_call',params:[{'to':'0x7EC437314542acFAB189671b935ba56605483796','data':data}, "latest"]}).then((balance)=>{
+          console.log('getTrading-----------------------',balance)
+        })
 
         // 查询系统地址
         //  data='0x7fce276d'
@@ -217,6 +217,7 @@
 					transactionData = await tokenpocketBnb.getContractTransaction(data, 0);
 				} else {
 					//bnb转账
+          console.log('this.bnb_num',this.bnb_num)
 					transactionData = await tokenpocketBnb.getTransactionData(this.pledgeAddress, this.bnb_num);
 				}
 				tokenpocketBnb.sendTransaction(transactionData).then(res => {
@@ -259,11 +260,12 @@
 				})
 			},
 			async getIconNum() {
-				if (this.address === '') {
+        let address=tokenpocketBnb.getMyAddress()
+				if (address === '') {
 					return
 				}
 				setTimeout(async () => {
-					this.coinNum = await tokenpocketBnb.getTokenBalance(this.address, 0)
+					this.coinNum = await tokenpocketBnb.getTokenBalance(address, 0)
 					console.log(this.coinNum, "icon-num----------------------")
 				}, 100)