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() {
const token=FirebaseInstanceId.getInstance().getToken();
console.log(token,7777777777777777)
const clientInfo = plus.push.getClientInfo()
//
uni.setStorageSync('cid',clientInfo)

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

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

20
utils/WalletUtil.js

@ -102,7 +102,8 @@ let WalletUtil = {
uni.setStorageSync('walletInfo', walletInfo);
},
//助记词新建
mnemonicEstablishWallet: function(type, mnemonic, password) {
mnemonicEstablishWallet: function(type, mnemonic, password) {
let walletInfo = uni.getStorageSync('walletInfo');
console.log(password, 'password', type)
let walletdec;
@ -135,6 +136,11 @@ let WalletUtil = {
wallet.privateKey = walletdec.privateKey;
wallet.mnemonic = mnemonic;
wallet.address = walletdec.address;
wallet.ellipsisAddress = wallet.address.substring(0, 6) + '...' + wallet.address.substring(
wallet.address.length - 6,
wallet.address.length);
@ -144,7 +150,19 @@ let WalletUtil = {
uni.setStorageSync('walletInfo', walletInfo);
uni.setStorageSync('wallet', wallet);
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) {

2
utils/api.js

@ -20,6 +20,8 @@ const api = {
getSearchContract: (params) => Vue.prototype.$axios.get('/api/contract/getSearchContract?' + 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