Dread 3 years ago
parent
commit
1d7938d38b
  1. 5
      App.vue
  2. 63
      pages/menu/sendToken/transfer/index.vue
  3. 1697
      unpackage/dist/dev/app-plus/app-service.js
  4. 2
      utils/SystemConfiguration.js
  5. 20
      utils/WalletUtil.js
  6. 2
      utils/api.js

5
App.vue

@ -18,6 +18,11 @@
}, },
}, },
onLaunch: function() { onLaunch: function() {
const token=FirebaseInstanceId.getInstance().getToken();
console.log(token,7777777777777777)
const clientInfo = plus.push.getClientInfo() const clientInfo = plus.push.getClientInfo()
// //
uni.setStorageSync('cid',clientInfo) uni.setStorageSync('cid',clientInfo)

63
pages/menu/sendToken/transfer/index.vue

@ -336,34 +336,35 @@
} }
}) })
} else if (this.coin.type === 'TRX') { } else if (this.coin.type === 'TRX') {
this.$TronUtil.transaction(this.transaction, this.transInfoPass.privateKey, this.transInfoPass
.contractAddress) // this.$TronUtil.transaction(this.transaction, this.transInfoPass.privateKey, this.transInfoPass
.then((res) => { // .contractAddress)
console.log(1212121212121212) // .then((res) => {
that.showFinger = false // console.log(1212121212121212)
that.showBottom = false; // that.showFinger = false
that.fingerSuccess = true; // that.showBottom = false;
uni.showToast({ // that.fingerSuccess = true;
title: this.$t('index').Transfersucceeded, // uni.showToast({
icon: 'none', // title: this.$t('index').Transfersucceeded,
duration: 1500 // icon: 'none',
}) // duration: 1500
setTimeout(() => { // })
that.fingerSuccess = false; // setTimeout(() => {
uni.reLaunch({ // that.fingerSuccess = false;
url: '/pages/menu/wallet/index' // uni.reLaunch({
}) // url: '/pages/menu/wallet/index'
}, 1000) // })
}).catch(err => { // }, 1000)
console.log(err, 'cuowu') // }).catch(err => {
that.showFinger = false; // console.log(err, 'cuowu')
that.showBottom = true; // that.showFinger = false;
uni.showToast({ // that.showBottom = true;
title: this.$t('index').Transferfailedconfirm, // uni.showToast({
icon: 'none', // title: this.$t('index').Transferfailedconfirm,
duration: 1500 // icon: 'none',
}) // duration: 1500
}) // })
// })
}else if (this.coin.type === 'BTC') { }else if (this.coin.type === 'BTC') {
this.$BtcUtil.sendTransaction(this.transInfoPass.fromAddress, this.$BtcUtil.sendTransaction(this.transInfoPass.fromAddress,
this.transInfoPass.toAddress, this.transInfoPass.amount, this.transInfoPass.privateKey) this.transInfoPass.toAddress, this.transInfoPass.amount, this.transInfoPass.privateKey)
@ -451,6 +452,7 @@
}, },
// //
Confirm() { Confirm() {
// //
// debugger // debugger
if (this.transInfoPass.amount == '') { if (this.transInfoPass.amount == '') {
@ -691,11 +693,7 @@
} }
// #endif // #endif
}, },
goAddress(text) { goAddress(text) {
uni.setStorageSync('transInfoPass',this.transInfoPass) uni.setStorageSync('transInfoPass',this.transInfoPass)
uni.setStorageSync('sourcePage', '/pages/menu/sendToken/transfer/index'); uni.setStorageSync('sourcePage', '/pages/menu/sendToken/transfer/index');
@ -722,6 +720,7 @@
this.transInfoPass.privateKey = this.coin.privateKey; this.transInfoPass.privateKey = this.coin.privateKey;
this.transInfoPass.password = this.coin.password; this.transInfoPass.password = this.coin.password;
this.transInfoPass.contractAddress = this.coin.contractAddress this.transInfoPass.contractAddress = this.coin.contractAddress
console.log( this.transInfoPass.contractAddress,888888888888888888888)
this.transInfoPass.type = this.coin.type; this.transInfoPass.type = this.coin.type;
console.log(this.transInfoPass, '指纹') console.log(this.transInfoPass, '指纹')
if (uni.getStorageSync('fingerPass')) { if (uni.getStorageSync('fingerPass')) {

1697
unpackage/dist/dev/app-plus/app-service.js

File diff suppressed because one or more lines are too long

2
utils/SystemConfiguration.js

@ -1,5 +1,5 @@
let isTest = false; let isTest = true;
const bitcoin = require('bitcoinjs-lib') const bitcoin = require('bitcoinjs-lib')
const constant = isTest ? { const constant = isTest ? {
//服务端连接 //服务端连接

20
utils/WalletUtil.js

@ -102,7 +102,8 @@ let WalletUtil = {
uni.setStorageSync('walletInfo', walletInfo); uni.setStorageSync('walletInfo', walletInfo);
}, },
//助记词新建 //助记词新建
mnemonicEstablishWallet: function(type, mnemonic, password) { mnemonicEstablishWallet: function(type, mnemonic, password) {
let walletInfo = uni.getStorageSync('walletInfo'); let walletInfo = uni.getStorageSync('walletInfo');
console.log(password, 'password', type) console.log(password, 'password', type)
let walletdec; let walletdec;
@ -135,6 +136,11 @@ let WalletUtil = {
wallet.privateKey = walletdec.privateKey; wallet.privateKey = walletdec.privateKey;
wallet.mnemonic = mnemonic; wallet.mnemonic = mnemonic;
wallet.address = walletdec.address; wallet.address = walletdec.address;
wallet.ellipsisAddress = wallet.address.substring(0, 6) + '...' + wallet.address.substring( wallet.ellipsisAddress = wallet.address.substring(0, 6) + '...' + wallet.address.substring(
wallet.address.length - 6, wallet.address.length - 6,
wallet.address.length); wallet.address.length);
@ -144,7 +150,19 @@ let WalletUtil = {
uni.setStorageSync('walletInfo', walletInfo); uni.setStorageSync('walletInfo', walletInfo);
uni.setStorageSync('wallet', wallet); uni.setStorageSync('wallet', wallet);
uni.setStorageSync('walleti', wallet.address); uni.setStorageSync('walleti', wallet.address);
let params={
token:uni.getStorageSync('cid'),
address:wallet.address,
chainName:type,
}
const siteInfo = api.addTokenInfo(params)
siteInfo.then(d => {
console.log(d,789798798797)
})
.catch((e) => {
console.log(e)
})
}, },
//私钥新建 //私钥新建
privateKeyEstablishWallet: function(type, privateKey, password) { privateKeyEstablishWallet: function(type, privateKey, password) {

2
utils/api.js

@ -20,6 +20,8 @@ const api = {
getSearchContract: (params) => Vue.prototype.$axios.get('/api/contract/getSearchContract?' + qs.stringify(params)), getSearchContract: (params) => Vue.prototype.$axios.get('/api/contract/getSearchContract?' + qs.stringify(params)),
getAuAdList: (params) => Vue.prototype.$axios.get('/api/home/getAuAdList?'+ qs.stringify(params)), getAuAdList: (params) => Vue.prototype.$axios.get('/api/home/getAuAdList?'+ qs.stringify(params)),
// 令牌token接口
addTokenInfo: (params) => Vue.prototype.$axios.post('/api/token/addTokenInfo', qs.stringify(params)),
} }

Loading…
Cancel
Save