question_uniapp/pages/wallet/switchnetwork.vue

127 lines
3.9 KiB
Vue
Raw Normal View History

2025-06-06 03:08:19 +08:00
<template>
<view class="page">
<nav-bar title="Select a network" bgColor="#fff"></nav-bar>
<view style="width: 92%; margin: 10px auto; background-color: #F8F8F8; padding: 15px 10px;">
<uni-row :gutter="0">
<uni-col :span="2">
<image src='/static/images/a1.png' style="width: 30rpx; height: 30rpx; margin-top: 4rpx;"></image>
</uni-col>
<uni-col :span="22">
<view style="color: #999; font-size: 14px;">
Please make sure that the recharge network you choose is the same as the network you choose when withdrawing coins, otherwise it may cause loss of assets!
</view>
</uni-col>
</uni-row>
<view style="clear: both;"></view>
</view>
<view style="width: 92%; margin: 10px auto; padding: 15px 10px;">
<uni-row @click.native="switchnetwork('TRC-20')">
<uni-col :span="4">
<image style="width: 33px; height: 33px; margin: 10px 5px;" src="/static/images/s1.png" fit="cover"></image>
</uni-col>
<uni-col :span="18">
<view style="color: #999; font-size: 14px;">
<view style="font-weight: 600;font-size: 16px;color: #333333;">Tron(TRC20)</view>
<view style="font-weight: 400;font-size: 14px;color: #999;" v-if="page=='recharge'">Minimum recharge: 0. 001 USDT</view>
<view style="font-weight: 400;font-size: 14px;color: #999;">Expected to arrive in about 10 minutes</view>
</view>
</uni-col>
<uni-col :span="2">
<uni-icons type="checkbox-filled" size="20" v-if="onchick=='TRC-20'" style="color: rgb(64, 158, 255); margin-top: 40rpx;"></uni-icons>
</uni-col>
</uni-row>
<uni-row style="margin-top: 40px;" @click.native="switchnetwork('BEP-20')">
<uni-col :span="4">
<image style="width: 33px; height: 33px; margin: 10px 5px;" src="/static/images/s2.png" fit="cover"></image>
</uni-col>
<uni-col :span="18">
<view style="color: #999; font-size: 14px;">
<view style="font-weight: 600;font-size: 16px;color: #333333;">BSC-BNB Smart Chain(BEP20)</view>
<view style="font-weight: 400;font-size: 14px;color: #999;" v-if="page=='recharge'">Minimum recharge: 0. 001 USDT</view>
<view style="font-weight: 400;font-size: 14px;color: #999;">Expected to arrive in about 10 minutes</view>
</view>
</uni-col>
<uni-col :span="2">
<uni-icons type="checkbox-filled" size="20" v-if="onchick=='BEP-20'" style="color: rgb(64, 158, 255); margin-top: 40rpx;"></uni-icons>
</uni-col>
</uni-row>
</view>
</view>
</template>
<script>
import zPrompt from '@/components/common/prompt';
import Popup from '@/components/common/popup';
import {
mapState,
mapMutations
} from 'vuex';
export default {
components: {
Popup,
zPrompt
},
data() {
return {
onchick:'TRC-20',
page:"",
};
},
computed: {
...mapState(['userInfo'])
},
//第一次加载
onLoad(e) {
if(e.network != typeof(undefined)){
this.onchick=e.network;
}
this.page=e.page;
},
//页面显示
onShow() {},
//方法
methods: {
onPageJump(url) {
uni.navigateTo({
url: url+""
});
},
onTokenJump(url) {
this.judgeLogin(() => {
uni.navigateTo({
url: url
});
});
},
switchnetwork(network){
this.onchick = network;
uni.navigateTo({
url: "/pages/wallet/"+this.page+"?network="+network
});
}
},
//页面隐藏
onHide() {},
//页面卸载
onUnload() {},
//页面下来刷新
onPullDownRefresh() {},
//页面上拉触底
onReachBottom() {},
//用户点击分享
onShareAppMessage(e) {
return this.wxShare();
}
};
</script>
<style lang="scss" scoped>
@import '@/style/mixin.scss';
body{background-color: #fff;}
.rechargeTitle{
font-weight: 400;font-size: 16px;color: #999999;line-height: 23px; text-align: center; margin-top: 30px;
}
.rechargeNet{
font-weight: 600;font-size: 20px;color: #333;line-height: 23px; text-align: center; margin-top: 20px;
}
</style>