question_uniapp/pages/wallet/switchnetwork.vue

149 lines
4.8 KiB
Vue
Raw Normal View History

2025-06-06 03:08:19 +08:00
<template>
<view class="page">
2025-06-10 00:51:49 +08:00
<uni-nav-bar @clickLeft="goto(1, 1)" left-icon="back" :border="false" :shadow="false" :fixed="true"
:title="$t('SelectNetwork.title')" backgroundColor="#fff"></uni-nav-bar>
<view style="width: 92%; margin: 20rpx auto; background-color: #F8F8F8; padding: 30rpx 20rpx;">
2025-06-06 03:08:19 +08:00
<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">
2025-06-10 00:51:49 +08:00
<view style="color: #999; font-size: 28rpx;">
2025-06-07 23:12:35 +08:00
{{$t('SelectNetwork.text1')}}
2025-06-06 03:08:19 +08:00
</view>
</uni-col>
</uni-row>
<view style="clear: both;"></view>
</view>
2025-06-10 00:51:49 +08:00
<view style="width: 92%; margin: 20rpx auto; padding: 30rpx 20rpx;">
2025-06-06 03:08:19 +08:00
<uni-row @click.native="switchnetwork('TRC-20')">
<uni-col :span="4">
2025-06-10 00:51:49 +08:00
<image style="width: 66rpx; height: 66rpx; margin: 20rpx 10rpx;" src="/static/images/s1.png" fit="cover"></image>
2025-06-06 03:08:19 +08:00
</uni-col>
<uni-col :span="18">
2025-06-10 00:51:49 +08:00
<view style="color: #999; font-size: 28rpx;">
<view style="font-weight: 600;font-size: 32rpx;color: #333333;">Tron(TRC20)</view>
<view style="font-weight: 400;font-size: 28rpx;color: #999;" v-if="page=='recharge'">{{$t('SelectNetwork.text2')}}: {{recharge_minimum}} USDT</view>
<view style="font-weight: 400;font-size: 28rpx;color: #999;" v-if="page=='putforward'">{{$t('SelectNetwork.text3')}}: {{withdrawl_minimum['TRC-20']}} USDT</view>
<view style="font-weight: 400;font-size: 28rpx;color: #999;">{{$t('SelectNetwork.text4')}}</view>
2025-06-06 03:08:19 +08:00
</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>
2025-06-10 00:51:49 +08:00
<uni-row style="margin-top: 80rpx;" @click.native="switchnetwork('BEP-20')">
2025-06-06 03:08:19 +08:00
<uni-col :span="4">
2025-06-10 00:51:49 +08:00
<image style="width: 66rpx; height: 66rpx; margin: 20rpx 10rpx;" src="/static/images/s2.png" fit="cover"></image>
2025-06-06 03:08:19 +08:00
</uni-col>
<uni-col :span="18">
2025-06-10 00:51:49 +08:00
<view style="color: #999; font-size: 28rpx;">
<view style="font-weight: 600;font-size: 32rpx;color: #333333;">BSC-BNB Smart Chain(BEP20)</view>
<view style="font-weight: 400;font-size: 28rpx;color: #999;" v-if="page=='recharge'">{{$t('SelectNetwork.text2')}}: {{recharge_minimum}} USDT</view>
<view style="font-weight: 400;font-size: 28rpx;color: #999;" v-if="page=='putforward'">{{$t('SelectNetwork.text3')}}: {{withdrawl_minimum['BEP-20']}} USDT</view>
<view style="font-weight: 400;font-size: 28rpx;color: #999;">{{$t('SelectNetwork.text4')}}</view>
2025-06-06 03:08:19 +08:00
</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:"",
2025-06-07 23:12:35 +08:00
withdrawl_minimum: 0,
recharge_minimum: 0,
2025-06-06 03:08:19 +08:00
};
},
computed: {
...mapState(['userInfo'])
},
//第一次加载
onLoad(e) {
if(e.network != typeof(undefined)){
this.onchick=e.network;
}
this.page=e.page;
2025-06-07 23:12:35 +08:00
this.$http.get('/api/common/init?lang='+this.$i18n.locale).then(res => {
if(this.page=='recharge'){
this.recharge_minimum = res.data.recharge_minimum;
}else if(this.page=="putforward"){
this.withdrawl_minimum = res.data.withdrawl_minimum;
}
});
2025-06-06 03:08:19 +08:00
},
//页面显示
onShow() {},
//方法
methods: {
onPageJump(url) {
uni.navigateTo({
url: url+""
});
},
2025-06-10 00:51:49 +08:00
goto(url, type) {
if (type == 2) {
return uni.switchTab({ url: url })
}
if (type == 1) {
return uni.navigateBack({ delta: url });
}
uni.navigateTo({
url: url
})
},
2025-06-06 03:08:19 +08:00
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{
2025-06-10 00:51:49 +08:00
font-weight: 400;font-size: 32rpx;color: #999999;line-height: 46rpx; text-align: center; margin-top: 60rpx;
2025-06-06 03:08:19 +08:00
}
.rechargeNet{
2025-06-10 00:51:49 +08:00
font-weight: 600;font-size: 40rpx;color: #333;line-height: 46rpx; text-align: center; margin-top: 40rpx;
2025-06-06 03:08:19 +08:00
}
</style>