Browse Source

修改

master
vee 4 years ago
parent
commit
e7c24f8e31
  1. 161
      pages/menu/sendToken/transfer/index.vue
  2. 19
      pages/menu/wallet/index.vue
  3. 25
      pages/menu/wallet/otherCoin/index.vue
  4. 16641
      unpackage/dist/dev/app-plus/app-service.js
  5. 7718
      unpackage/dist/dev/app-plus/app-view.js
  6. 0
      unpackage/dist/dev/app-plus/static/img/copy_24px_outlined.8dca7e38.svg
  7. 0
      unpackage/dist/dev/app-plus/static/img/more_vert_24px_outlined.266aaa48.svg
  8. 2
      utils/WalletUtil.js
  9. 3
      utils/api.js
  10. 11
      utils/axios.js

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

@ -25,7 +25,9 @@
</view> </view>
</view> </view>
<view class="inputcon"> <view class="inputcon">
<input type="text" value="" placeholder-style="font-size: 30rpx; color: #D0D0D2;" placeholder="Please enter the recipient address" class="input1" v-model="recipientAddress" /> <input type="text" value="" placeholder-style="font-size: 30rpx; color: #D0D0D2;"
placeholder="Please enter the recipient address" class="input1"
v-model="recipientAddress" />
<image src="../../../../static/tongyonh/Frame330.png" mode="aspectFit" class="img1"></image> <image src="../../../../static/tongyonh/Frame330.png" mode="aspectFit" class="img1"></image>
</view> </view>
</view> </view>
@ -41,14 +43,16 @@
<view class="textt"> <view class="textt">
{{addressInfo.type}} {{addressInfo.type}}
</view> </view>
<input type="text" value="" placeholder-style="font-size: 30rpx; color: #D0D0D2;" placeholder="0.0000000" class="input3" v-model="transAmount"/> <input type="text" value="" placeholder-style="font-size: 30rpx; color: #D0D0D2;"
placeholder="0.0000000" class="input3" v-model="transAmount" />
</view> </view>
<text></text> <text></text>
<view class="inputc flex"> <view class="inputc flex">
<view class="textt"> <view class="textt">
USD USD
</view> </view>
<input type="text" value="" placeholder-style="font-size: 30rpx; color: #D0D0D2;" placeholder="0.0000000" class="input3"/> <input type="text" value="" placeholder-style="font-size: 30rpx; color: #D0D0D2;"
placeholder="0.0000000" class="input3" />
</view> </view>
</view> </view>
<view class="top flex bottom"> <view class="top flex bottom">
@ -69,7 +73,8 @@
</view> </view>
<view class="inputcon"> <view class="inputcon">
<input type="text" value="" placeholder-style="font-size: 30rpx; color: #D0D0D2;" placeholder="Please enter a note (off-chain)" class="input1"/> <input type="text" value="" placeholder-style="font-size: 30rpx; color: #D0D0D2;"
placeholder="Please enter a note (off-chain)" class="input1" />
</view> </view>
</view> </view>
@ -81,7 +86,8 @@
</view> </view>
<view class="inputcon"> <view class="inputcon">
<input type="text" v-model="fee" value="" placeholder-style="font-size: 30rpx; color: #D0D0D2;" placeholder="Please enter a note (off-chain)" class="input2"/> <input type="text" v-model="fee" value="" placeholder-style="font-size: 30rpx; color: #D0D0D2;"
placeholder="Please enter a note (off-chain)" class="input2" />
<view class="rig"> <view class="rig">
<text class="text1 ac">{{addressInfo.type}}</text> | <text class="text2">USDT</text> <text class="text1 ac">{{addressInfo.type}}</text> | <text class="text2">USDT</text>
</view> </view>
@ -91,7 +97,7 @@
</view> </view>
<view class="big_con" v-if="showBottom"> <view class="big_con" v-if="showBottom">
<view class="tiao" @click="show=false"> <view class="tiao" @click="cancelAll">
</view> </view>
<view class="bigtitle"> <view class="bigtitle">
Transfer confirmation Transfer confirmation
@ -183,13 +189,13 @@
<view class="bottom_con"> <view class="bottom_con">
<image src="../../../../static/tongyonh/alert-circle.png" mode="aspectFit" class="img1"></image> <image src="../../../../static/tongyonh/alert-circle.png" mode="aspectFit" class="img1"></image>
<view class="text1 red"> <view class="text1 red">
Fingerprint not recognized. <br><text @click="">Try again</text> . Fingerprint not recognized. <br><text @click="confirmTo('try')">Try again</text> .
</view> </view>
<view class="flex con"> <view class="flex con">
<view class="textt1" @click="goPassword"> <view class="textt1" @click="goPassword">
Use Password Use Password
</view> </view>
<view class="textt2"> <view class="textt2" @click="cancelFail">
Cancel Cancel
</view> </view>
</view> </view>
@ -259,9 +265,19 @@
} }
}, },
methods: { methods: {
cancelAll(){
this.show=false;
this.showBottom=false;
},
cancelFail() {
this.$walletUtil.printCancel()
this.fingerFail = false
this.showBottom = true;
this.showFinger = false;
},
cancel() { cancel() {
this.show=false
this.showFinger = false this.showFinger = false
this.showBottom=true;
this.$walletUtil.printCancel() this.$walletUtil.printCancel()
}, },
// //
@ -273,7 +289,10 @@
}) })
}, },
// //
confirmTo(){ confirmTo(type) {
if (type == 'try') {
this.fingerFail = false;
}
this.show = true this.show = true
this.showFinger = true this.showFinger = true
this.showBottom = false; this.showBottom = false;
@ -385,18 +404,129 @@
// #ifdef APP-PLUS // #ifdef APP-PLUS
plus.fingerprint.authenticate(function() { plus.fingerprint.authenticate(function() {
plus.nativeUI.closeWaiting(); //Android plus.nativeUI.closeWaiting(); //Android
console.log(that.transInfoPass,5656)
console.log(that.addressInfo,56556656)
if (that.addressInfo.type == 'TRX') {
console.log(that.addressInfo.type,11111)
console.log(that.transInfoPass,2222)
// if (!this.contractAddress) {
//
that.$TronUtil.sendTransaction(that.transInfoPass.fromAddress,that.transInfoPass.privateKey,that.transInfoPass.toAddress,that.transInfoPass.amount )
.then((res) => {
console.log(2222211111)
that.showFinger = false
that.showBottom = false;
that.fingerSuccess = true;
uni.showToast({
title: 'Transfer succeeded',
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: 'Transfer failed, please confirm the information is correct',
icon: 'none',
duration: 1500
})
})
// }else{
// this.$TronUtil.sendRawTransaction(this.info.address, this.info.privateKey, this.toAddress, this.toValue,'',this.contractAddress )
// .then((res) => {
// uni.showToast({
// title: 'Successfully',
// icon: 'success',
// duration: 2000
// })
// this.show2 = false;
// uni.reLaunch({
// url: '/pages/menu/wallet/index'
// })
// }).catch(err => {
// console.log(err)
// uni.showToast({ // uni.showToast({
// title: 'Fingerprint identification succeeded', // title: err,
// icon: 'none', // icon: 'none',
// duration: 1500, // duration: 2000
// }) // })
// 使 // })
// }
}
// uni.setStorageSync('fingerPass',true)
if (that.addressInfo.type == 'ETH') {
console.log(that.addressInfo.type,11111)
console.log(that.transInfoPass,2222)
// if (!this.contractAddress) {
//
that.$EthUtil.transaction(that.transInfoPass.fromAddress,that.transInfoPass.privateKey,that.transInfoPass.toAddress,that.transInfoPass.amount )
.then((res) => {
console.log(2222211111)
that.showFinger = false
that.showBottom = false; that.showBottom = false;
that.fingerSuccess = true; that.fingerSuccess = true;
console.log(that.fingerSuccess,454545) uni.showToast({
title: 'Transfer succeeded',
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: 'Transfer failed, please confirm the information is correct',
icon: 'none',
duration: 1500
})
})
// }else{
// this.$TronUtil.sendRawTransaction(this.info.address, this.info.privateKey, this.toAddress, this.toValue,'',this.contractAddress )
// .then((res) => {
// uni.showToast({
// title: 'Successfully',
// icon: 'success',
// duration: 2000
// })
// this.show2 = false;
// uni.reLaunch({
// url: '/pages/menu/wallet/index'
// })
// }).catch(err => {
// console.log(err)
// uni.showToast({
// title: err,
// icon: 'none',
// duration: 2000
// })
// })
// }
}
}, function(e) { }, function(e) {
switch (e.code) { switch (e.code) {
case e.AUTHENTICATE_MISMATCH: case e.AUTHENTICATE_MISMATCH:
@ -476,6 +606,7 @@
// //
if (uni.getStorageSync('myTransAddress')) { if (uni.getStorageSync('myTransAddress')) {
this.recipientAddress = uni.getStorageSync('myTransAddress').address this.recipientAddress = uni.getStorageSync('myTransAddress').address
uni.removeStorageSync('myTransAddress')
} }
// //
if (uni.getStorageSync('fingerPass')) { if (uni.getStorageSync('fingerPass')) {

19
pages/menu/wallet/index.vue

@ -120,21 +120,32 @@
methods: { methods: {
updateData() { updateData() {
let thar = this; let thar = this;
setTimeout( // setTimeout(
function() { // function() {
console.log(uni.getStorageSync('wallet'),'钱包'); console.log(uni.getStorageSync('wallet'),'钱包');
thar.userObj = uni.getStorageSync('wallet'); thar.userObj = uni.getStorageSync('wallet');
thar.userObj2 = uni.getStorageSync('wallet'); thar.userObj2 = uni.getStorageSync('wallet');
// thar.userObj.address = thar.userObj.ellipsisAddress;
// thar.userObj.address =thar.userObj.address.substring(0, 6) + '...' + thar.userObj.address.substring(25,
// thar.userObj.address.length);
// thar.$walletUtil.updateBalance();
// thar.updateData();
// }, 100);
thar.userObj.address = thar.userObj.address.substring(0, 6) + '...' + thar.userObj.address thar.userObj.address = thar.userObj.address.substring(0, 6) + '...' + thar.userObj.address
.substring(25, .substring(25,
thar.userObj.address.length); thar.userObj.address.length);
thar.$walletUtil.updateBalance(); // thar.$walletUtil.updateBalance();
if (!thar.isStop) { if (!thar.isStop) {
thar.updateData() thar.updateData()
} }
}, 2000);
// }, 2000);
}, },
goOther() { goOther() {

25
pages/menu/wallet/otherCoin/index.vue

@ -83,22 +83,23 @@
// //
addOther(item,index){ addOther(item,index){
console.log(item,444) console.log(item,444)
if(uni.getStorageSync('imgindex').length>0){ // if(uni.getStorageSync('imgindex').length>0){
this.imgindex.push(index) // this.imgindex.push(index)
this.toTop=true // this.toTop=true
setTimeout(()=>{ // setTimeout(()=>{
this.toTop=false // this.toTop=false
},1500) // },1500)
uni.setStorageSync('imgindex',this.imgindex) // uni.setStorageSync('imgindex',this.imgindex)
}else{ // }else{
this.imgindex.push(index) this.imgindex.push(index)
this.toTop=true this.toTop=true
setTimeout(()=>{ setTimeout(()=>{
this.toTop=false this.toTop=false
},1500) },1500)
uni.setStorageSync('imgindex',this.imgindex) uni.setStorageSync('imgindex',this.imgindex)
} // }
console.log(this.coinType,444444)
if(this.coinType=='ETH'){ if(this.coinType=='ETH'){
const walleti=uni.getStorageSync('walleti') const walleti=uni.getStorageSync('walleti')
const walletInfo=uni.getStorageSync('walletInfo') const walletInfo=uni.getStorageSync('walletInfo')
@ -121,7 +122,6 @@
walletInfo[this.coinType][i].coinList.push(b) walletInfo[this.coinType][i].coinList.push(b)
console.log(walletInfo[this.coinType][i],22222) console.log(walletInfo[this.coinType][i],22222)
uni.setStorageSync('walletInfo',walletInfo) uni.setStorageSync('walletInfo',walletInfo)
uni.setStorageSync('wallet',walletInfo[this.coinType][i]) uni.setStorageSync('wallet',walletInfo[this.coinType][i])
} }
@ -136,8 +136,9 @@
// //
async getCoin(){ async getCoin(){
let params = { let params = {
chainName: this.coinType chainName: uni.getStorageSync('wallet').type
} }
console.log(params,888888888,this.coinType)
const response = await this.$api.getContractInfoList(params) const response = await this.$api.getContractInfoList(params)
this.coinInfo=response.data this.coinInfo=response.data

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

File diff suppressed because one or more lines are too long

7718
unpackage/dist/dev/app-plus/app-view.js

File diff suppressed because one or more lines are too long

0
unpackage/dist/dev/app-plus/static/img/copy_24px_outlined.e8932d3c.svg → unpackage/dist/dev/app-plus/static/img/copy_24px_outlined.8dca7e38.svg

Before

Width:  |  Height:  |  Size: 629 B

After

Width:  |  Height:  |  Size: 629 B

0
unpackage/dist/dev/app-plus/static/img/more_vert_24px_outlined.427f4df0.svg → unpackage/dist/dev/app-plus/static/img/more_vert_24px_outlined.266aaa48.svg

Before

Width:  |  Height:  |  Size: 526 B

After

Width:  |  Height:  |  Size: 526 B

2
utils/WalletUtil.js

@ -201,7 +201,7 @@ let WalletUtil = {
} }
} }
// this.updateBalance(); this.updateBalance();
}, },
updateBalance:function() { updateBalance:function() {
const wallet = uni.getStorageSync('wallet'); const wallet = uni.getStorageSync('wallet');

3
utils/api.js

@ -7,8 +7,7 @@ const api = {
addNftCollection: (params) => Vue.prototype.$axios.post('/api/nft/addNftCollection', qs.stringify(params)), addNftCollection: (params) => Vue.prototype.$axios.post('/api/nft/addNftCollection', qs.stringify(params)),
getNftCollectionList: (params) => Vue.prototype.$axios.get('/api/nft/getNftCollectionList?' + qs.stringify( getNftCollectionList: (params) => Vue.prototype.$axios.get('/api/nft/getNftCollectionList?' + qs.stringify(
params)), params)),
getContractInfoList: (params) => Vue.prototype.$axios.get('/api/contract/getContractInfoList?' + qs.stringify( getContractInfoList: (params) => Vue.prototype.$axios.get('/api/contract/getContractInfoList?' + qs.stringify(params)),
params)),
//--------------------------------- free --------------------------------- //--------------------------------- free ---------------------------------
} }

11
utils/axios.js

@ -27,7 +27,8 @@ service.interceptors.request.use(
// config.url = baseURL.serverUrl + config.url // config.url = baseURL.serverUrl + config.url
// } // }
config.url = baseURL.serverUrl + config.url config.baseURL=baseURL.serverUrl
config.url = config.url
// if (token) { // if (token) {
// // config.headers['Authori-zation'] = token // // config.headers['Authori-zation'] = token
@ -73,19 +74,21 @@ service.interceptors.response.use(res => {
axios.defaults.adapter = function(config) { //自己定义个适配器,用来适配uniapp的语法 axios.defaults.adapter = function(config) { //自己定义个适配器,用来适配uniapp的语法
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
console.log(config) console.log(config,'我请求的')
var settle = require('axios/lib/core/settle'); var settle = require('axios/lib/core/settle');
var buildURL = require('axios/lib/helpers/buildURL'); var buildURL = require('axios/lib/helpers/buildURL');
uni.request({ uni.request({
method: config.method.toUpperCase(), method: config.method.toUpperCase(),
url: (config.baseURL?config.baseURL+'/':'') + buildURL(config.url, config.params, config.paramsSerializer), url: config.baseURL+'/' + buildURL(config.url, config.params, config.paramsSerializer),
header: config.headers, header: config.headers,
data: config.data, data: config.data,
dataType: config.dataType, dataType: config.dataType,
responseType: config.responseType, responseType: config.responseType,
sslVerify: config.sslVerify, sslVerify: config.sslVerify,
complete: function complete(response) { complete: function complete(response) {
console.log("执行完成:",config.baseURL+'/' + buildURL(config.url, config.params, config.paramsSerializer),response.data) //console.log("执行完成:",config.baseURL+'/' + buildURL(config.url, config.params, config.paramsSerializer),response.data)
response = { response = {
data: response.data, data: response.data,
status: response.statusCode, status: response.statusCode,

Loading…
Cancel
Save