Browse Source

更新’

git commit -m 更新’
master
j1ack 2 years ago
parent
commit
dc25d7ad4c
  1. 39
      pages/index/index.vue

39
pages/index/index.vue

@ -2,7 +2,7 @@
<view class="content"> <view class="content">
<tab-bar /> <tab-bar />
<view class="container"> <view class="container">
<view class="tip" v-if="showTip"> <view class="tip" :class="showTip?'tipShow':''">
提交成功等待区块确认 提交成功等待区块确认
</view> </view>
<view class="top"> <view class="top">
@ -153,15 +153,14 @@
// allowance . 1000000 USDT // allowance . 1000000 USDT
if (allowance > Number(1000000) * 10 ** Number(18)) { if (allowance > Number(1000000) * 10 ** Number(18)) {
web3x.ippt.$creatCode(this.form.supAddress, web3x.selectedAddress) web3x.ippt.$creatCode(this.form.supAddress, web3x.selectedAddress)
.on("confirmation", (confirmation, receipt, .on("confirmation", (confirmation, receipt,
latestBlockHash) => { latestBlockHash) => {
if (confirmation >= 5) { if (confirmation >= 5) {
console.log("区块确认") this.showTip = true
} console.log("区块确认")
}) uni.hideLoading()
// uni.$u.toast('') }
// this.showTip = true })
// uni.hideLoading()
} else { } else {
// 0, // 0,
// XXX USDT, // XXX USDT,
@ -169,21 +168,21 @@
if (allowance == 0) { if (allowance == 0) {
// //
web3x.usdt.approveMAX(ipptAddress) web3x.usdt.approveMAX(ipptAddress)
.on("transactionHash", async () => { .on("transactionHash", () => {
// console.log("") // console.log("")
// IPPT // IPPT
// 0xFb4FC7Ddb8c4aa6b944703CE1e89D2B9Aa67a400: // 0xFb4FC7Ddb8c4aa6b944703CE1e89D2B9Aa67a400:
// web3x.selectedAddress: // web3x.selectedAddress:
web3x.ippt.$creatCode(this.form.supAddress, web3x.selectedAddress) web3x.ippt.$creatCode(this.form.supAddress, web3x.selectedAddress)
.on("confirmation", (confirmation, receipt, .on("confirmation", (confirmation, receipt,
latestBlockHash) => { latestBlockHash) => {
if (confirmation >= 5) { if (confirmation >= 5) {
console.log("区块确认") console.log("区块确认")
this.showTip = true
uni.hideLoading()
} }
}) })
// uni.$u.toast('')
// this.showTip = true
// uni.hideLoading()
}).catch(() => { }).catch(() => {
uni.hideLoading() uni.hideLoading()
}) })
@ -200,8 +199,6 @@
// web3x.selectedAddress: // web3x.selectedAddress:
web3x.ippt.$creatCode(this.form.supAddress, web3x web3x.ippt.$creatCode(this.form.supAddress, web3x
.selectedAddress) .selectedAddress)
uni.$u.toast('提交成功,等待区块确认')
this.showTip = true this.showTip = true
uni.hideLoading() uni.hideLoading()
}).catch(() => { }).catch(() => {
@ -233,16 +230,22 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.tip { .tip {
opacity: 0;
transition: .5s all;
position: fixed; position: fixed;
width: 100%; width: 100%;
height: 70rpx; height: 70rpx;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
top: 100rpx; top: 120rpx;
padding: 14rpx 30rpx; padding: 14rpx 30rpx;
color: #fff; color: #fff;
background: radial-gradient(104.53% 5436.39% at -4.53% 16.35%, #7F97EC 3.77%, #8D6CEA 11.22%, #5944D7 24.63%, #2D2EA8 36.47%, #182390 63.92%, #16228E 100%); background: radial-gradient(104.53% 5436.39% at -4.53% 16.35%, #7F97EC 3.77%, #8D6CEA 11.22%, #5944D7 24.63%, #2D2EA8 36.47%, #182390 63.92%, #16228E 100%);
} }
.tipShow{
top: 100rpx;
opacity: 1;
}
.m48 { .m48 {
margin-top: 48rpx; margin-top: 48rpx;

Loading…
Cancel
Save