feat: 前端全量更新 - 含所有本次需求
- 移除秒合约页面及UI - 合约页Tab改为Position Held/Transaction Record - 存款/提款/转账页增加BTC/ETH - 资产页重构(用户信息+盈亏+多语言) - 注册页改版(匹配新设计稿) - 日文全面翻译+首页菜单多语言 - 代理专属注册链接支持(?code=) - 10个locale文件同步更新
This commit is contained in:
@@ -0,0 +1,193 @@
|
||||
<template>
|
||||
<view :style="'background-color: '+theme.bg+';color: '+theme.text" style="height: 100vh;">
|
||||
<myNav :title="id?i18n.mine.address.modify:i18n.mine.address.add"></myNav>
|
||||
|
||||
<view @click="coinType=true" class="width-100b height-96 padding-w-60 flex align-center justify-between">
|
||||
<text class="font-30 bold-font">{{i18n.mine.address.curr}}</text>
|
||||
<text class="font-30 bold-font color-0165EE">{{curr_id?curr_id:i18n.mine.address.subtit}}</text>
|
||||
</view>
|
||||
|
||||
<view class="width-100b padding-w-60">
|
||||
<view class="width-100b height-96 line-height-96">
|
||||
<text class="font-30 bold-font">{{i18n.mine.address.address}}</text>
|
||||
<text class="font-26 numbold-font color-0165EE margin-l-20">{{address|addressFilter}}</text>
|
||||
</view>
|
||||
<view class="width-100b height-96">
|
||||
<input class="width-100b height-96 font-30" type="text" v-model="address" :placeholder="i18n.mine.address.p1" placeholder-class="color-C3C3C3"/>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="width-100b padding-w-60">
|
||||
<view class="width-100b height-96 line-height-96">
|
||||
<text class="font-30 bold-font">{{i18n.mine.address.remark}}</text>
|
||||
</view>
|
||||
<view class="width-100b height-96">
|
||||
<input class="width-100b height-96 font-30" type="text" v-model="dsc" :placeholder="i18n.mine.address.p2" placeholder-class="color-C3C3C3"/>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<u-picker @confirm="selectCoin" v-model="coinType" mode="selector" range-key="full_name" :range="coinSelector"
|
||||
:confirm-text="i18n.mine.address.confirmText" :cancel-text="i18n.mine.address.cancelText"></u-picker>
|
||||
|
||||
<button @click="add()" class="cu-btn loginBtn">{{i18n.mine.address.save}}</button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
id:"",
|
||||
address:"",
|
||||
dsc:"",
|
||||
// userId:"",
|
||||
curr_id:'',
|
||||
name:'',
|
||||
|
||||
coinType:false,
|
||||
coinSelector: [''],
|
||||
|
||||
flag:true,
|
||||
theme:'',
|
||||
}
|
||||
},
|
||||
onLoad:function(option){
|
||||
// if(getApp().globalData.type = "address"){
|
||||
// this.id = getApp().globalData.data.id
|
||||
// this.dsc = getApp().globalData.data.description
|
||||
// this.address = getApp().globalData.data.address
|
||||
// this.userId = getApp().globalData.data.userId
|
||||
// getApp().globalData.data = ""
|
||||
// getApp().globalData.type = ""
|
||||
// console.log(this.id)
|
||||
// }
|
||||
console.log(option)
|
||||
this.get_curr()
|
||||
if(option.id){
|
||||
this.id = option.id
|
||||
this.getAddress(option.id)
|
||||
}
|
||||
},
|
||||
onShow:function(){
|
||||
if (uni.getStorageSync("theme") == "dark") {
|
||||
this.theme = this.$store.state.darkTheme
|
||||
}else{
|
||||
this.theme = this.$store.state.lightTheme
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
i18n() {
|
||||
return this.$t('message');
|
||||
},
|
||||
},
|
||||
filters:{
|
||||
addressFilter(item){
|
||||
if(item.length < 10) return
|
||||
if(item.slice(0,1) == 'T'){
|
||||
return 'TRC20'
|
||||
}
|
||||
if(item.slice(0,2) == '0x'){
|
||||
return 'ERC20'
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
add(){
|
||||
if(!this.flag) return
|
||||
if(this.curr_id==""){
|
||||
this.tos(this.i18n.mine.address.p0)
|
||||
return
|
||||
}
|
||||
if(this.address==""){
|
||||
this.tos(this.i18n.mine.address.p1)
|
||||
return
|
||||
}
|
||||
if(this.dsc==""){
|
||||
this.tos(this.i18n.mine.address.p2)
|
||||
return
|
||||
}
|
||||
uni.showLoading()
|
||||
this.flag = false
|
||||
if(this.id == ''){
|
||||
this.newData()
|
||||
}else{
|
||||
this.change()
|
||||
}
|
||||
},
|
||||
selectCoin(index){
|
||||
// console.log(this.coinSelector[index])
|
||||
this.curr_id = this.coinSelector[index].full_name
|
||||
// this.name = this.coinSelector[index].name_lian
|
||||
},
|
||||
get_curr(){
|
||||
this.post('/my/get_lian').then(res => {
|
||||
console.log('提现币种列表',res)
|
||||
if(res.code == 1){
|
||||
this.coinSelector = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
getAddress(id){
|
||||
this.post('/my/address_con',{id: id}).then(res => {
|
||||
console.log('地址详情',res)
|
||||
if(res.code == 1){
|
||||
this.curr_id = res.data.full_name
|
||||
this.address = res.data.address
|
||||
this.dsc = res.data.notice
|
||||
// this.name = res.data.name_lian
|
||||
}
|
||||
})
|
||||
},
|
||||
newData(){
|
||||
this.post('/my/add_address', {
|
||||
full_name: this.curr_id,
|
||||
address: this.address,
|
||||
notice: this.dsc,
|
||||
}).then(res => {
|
||||
this.flag = true
|
||||
uni.hideLoading()
|
||||
if(res.code == 1){
|
||||
this.tos(res.msg)
|
||||
setTimeout(()=>{
|
||||
uni.navigateBack()
|
||||
},500)
|
||||
}
|
||||
})
|
||||
},
|
||||
change(){
|
||||
this.post('/my/address_upd', {
|
||||
id: this.id,
|
||||
full_name: this.curr_id,
|
||||
address: this.address,
|
||||
notice: this.dsc,
|
||||
}).then(res => {
|
||||
this.flag = true
|
||||
uni.hideLoading()
|
||||
if(res.code == 1){
|
||||
this.tos(res.msg)
|
||||
setTimeout(()=>{
|
||||
uni.navigateBack()
|
||||
},500)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.loginBtn{
|
||||
width: 600rpx;
|
||||
height: 96rpx;
|
||||
background: linear-gradient(180deg, #52F3C9 0%, #3ECEB2 100%) !important;
|
||||
border-radius: 12rpx;
|
||||
line-height: 96rpx;
|
||||
color: #FFFFFF;
|
||||
font-size: 32rpx;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
bottom: 5%;
|
||||
left: 50%;
|
||||
margin-left: -300rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,103 @@
|
||||
<template>
|
||||
<view :style="'background-color: '+theme.bg+';color: '+theme.text" style="height: 100vh;">
|
||||
<z-paging :language="$i18n.locale" ref="paging" v-model="list" @query="queryList" :pageSize="20" :auto="false">
|
||||
<!-- 下拉刷新 -->
|
||||
<custom-refresher slot="refresher" slot-scope="{refresherStatus}" :status="refresherStatus">
|
||||
</custom-refresher>
|
||||
|
||||
<!-- 头部 -->
|
||||
<myNav slot="top" :title="i18n.mine.address.title" :isRightext="true" :rightText="i18n.mine.address.add"
|
||||
rightextColor="#0165EE" @Jump="router.push('/pages/my/address/add')"></myNav>
|
||||
<!-- 身体 -->
|
||||
<view>
|
||||
<view class="listBox" v-for="(item,index) in list" :key="index" :style="'background-color: '+theme.fu_bg+';color: '+theme.text">
|
||||
<view class="width-500 height-80 flex direction-column align-start justify-between">
|
||||
<text class="width-450 font-30 numbold-font hidden-nowrap-ellipsis-1">{{item.address}}</text>
|
||||
<text class="width-450 font-26 medium-font hidden-nowrap-ellipsis-1">{{item.notice}}</text>
|
||||
</view>
|
||||
<view class="width-120 height-100 flex align-center justify-between">
|
||||
<image @click="del(item.id,index)" class="width-50 height-50"
|
||||
src="/static/imgs/my/delectImg@2x.png" mode=""></image>
|
||||
<image @click="router.push('/pages/my/address/add?id='+item.id)" class="width-50 height-50"
|
||||
src="/static/imgs/my/updataImg@2x.png" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</z-paging>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
theme:'',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
i18n() {
|
||||
return this.$t('message');
|
||||
},
|
||||
},
|
||||
onShow() {
|
||||
if (uni.getStorageSync("theme") == "dark") {
|
||||
this.theme = this.$store.state.darkTheme
|
||||
}else{
|
||||
this.theme = this.$store.state.lightTheme
|
||||
}
|
||||
this.queryList()
|
||||
},
|
||||
methods: {
|
||||
del(id, index) {
|
||||
var that = this
|
||||
uni.showModal({
|
||||
title: this.i18n.mine.address.tishi,
|
||||
content: this.i18n.mine.address.content,
|
||||
cancelText: this.i18n.mine.address.cancelText,
|
||||
confirmText: this.i18n.mine.address.confirmText,
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
uni.showLoading()
|
||||
that.post('/my/address_del', {
|
||||
id: id
|
||||
}).then(res => {
|
||||
console.log('删除提币地址', res)
|
||||
uni.hideLoading()
|
||||
if (res.code == 1) {
|
||||
that.tos(res.msg)
|
||||
that.$refs.paging.reload();
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
queryList(pageNo, pageSize) {
|
||||
this.post('/my/address_list', {
|
||||
page: pageNo,
|
||||
page_num: pageSize
|
||||
}).then(res => {
|
||||
console.log('地址',res)
|
||||
if (res.code == 1) {
|
||||
this.$refs.paging.complete(res.data);
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.listBox {
|
||||
width: 690rpx;
|
||||
height: 140rpx;
|
||||
margin: 24rpx auto;
|
||||
// background: #FFFFFF;
|
||||
border-radius: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user