feat: contract account tab, full i18n, male avatar, PC home stretch
- Asset page: add Contract account row + tab, show num_lh balance - Total Assets = Spot + Contract + Fiat - All Chinese text eliminated (z-paging, loadmore, colorui, pages) - Password/payword pages use image captcha instead of OTP - Home page PC: full-width stretch layout - Register captcha input type fix, invite code lock
This commit is contained in:
+27
-36
@@ -92,6 +92,17 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- Contract 余额 -->
|
||||
<view @click="current=3" class="accountRow" :style="'background-color:'+theme.fu_bg+';color:'+theme.text">
|
||||
<view class="flex align-center justify-between">
|
||||
<text class="font-28 bold-font">Contract</text>
|
||||
<i class="cuIcon-right font-26 color-C3C3C3"></i>
|
||||
</view>
|
||||
<view class="margin-t-10">
|
||||
<text class="font-38 numbold-font">{{ifcover?all.count_lh_usdt:'****'}} <text class="font-24 color-C3C3C3">USDT</text></text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- Fiat 余额 -->
|
||||
<view @click="current=2" class="accountRow" :style="'background-color:'+theme.fu_bg+';color:'+theme.text">
|
||||
<view class="flex align-center justify-between">
|
||||
@@ -119,7 +130,7 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- Spot / Fiat / 理财 子页面 -->
|
||||
<!-- Spot / Fiat / Contract / Invest 子页面 -->
|
||||
<view v-if="current==1||current==2||current==3||current==4" class="">
|
||||
<view class="padding-w-30 height-90 flex align-center line-height-90">
|
||||
<u-switch v-model="ifHideCoin" size="30" active-color="#2DD1AF"></u-switch>
|
||||
@@ -167,7 +178,7 @@
|
||||
data() {
|
||||
return {
|
||||
statusBar: uni.getSystemInfoSync().statusBarHeight,
|
||||
tabList: ['总览', '现货','法币','理财'],
|
||||
tabList: ['Overview', 'Spot','Fiat','Contract','Invest'],
|
||||
current: 0,
|
||||
|
||||
userinfo: {},
|
||||
@@ -239,6 +250,9 @@
|
||||
case 4:
|
||||
obj = that.qq
|
||||
break;
|
||||
case 5:
|
||||
obj = that.all
|
||||
break;
|
||||
default:
|
||||
obj = that.all
|
||||
break;
|
||||
@@ -276,13 +290,13 @@
|
||||
break;
|
||||
case 3:
|
||||
if(that.ifHideCoin==true){
|
||||
if(that.lh.lh_arr){
|
||||
if(that.lh && that.lh.lh_arr){
|
||||
obj = that.lh.lh_arr.filter((item)=>{
|
||||
return item.num != 0
|
||||
})
|
||||
}
|
||||
}else{
|
||||
obj = that.lh.lh_arr
|
||||
obj = (that.lh && that.lh.lh_arr) ? that.lh.lh_arr : []
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
@@ -317,13 +331,13 @@
|
||||
this.tabList[0]=this.i18n.assets.index.title1
|
||||
this.tabList[1]=this.i18n.assets.index.title2
|
||||
this.tabList[2]=this.i18n.assets.index.title3
|
||||
this.tabList[3]=this.i18n.licai.text1
|
||||
this.tabList[3]='Contract'
|
||||
this.tabList[4]=this.i18n.licai.text1
|
||||
if(uni.getStorageSync('ifHideCoin')){
|
||||
this.ifHideCoin = uni.getStorageSync('ifHideCoin')
|
||||
}
|
||||
this.getWallet()
|
||||
this.getUserInfo()
|
||||
this.calcProfit()
|
||||
},
|
||||
methods: {
|
||||
formatNum(val) {
|
||||
@@ -350,35 +364,8 @@
|
||||
})
|
||||
},
|
||||
calcProfit() {
|
||||
// 从资金流水计算盈亏
|
||||
this.post('/wallet/index_detail', {
|
||||
page: 1,
|
||||
size: 200,
|
||||
}).then(res => {
|
||||
if (res.code == 1) {
|
||||
let profit = 0
|
||||
let pnl = 0
|
||||
let items = res.data.data || res.data || []
|
||||
items.forEach(item => {
|
||||
let price = Number(item.price || 0)
|
||||
let desc = (item.description || '').toLowerCase()
|
||||
if (desc.indexOf('profit') !== -1 || desc.indexOf('收益') !== -1 || desc.indexOf('盈') !== -1) {
|
||||
if (item.cart == 1) {
|
||||
profit += price
|
||||
} else {
|
||||
profit -= price
|
||||
}
|
||||
}
|
||||
if (item.cart == 1) {
|
||||
pnl += price
|
||||
} else {
|
||||
pnl -= price
|
||||
}
|
||||
})
|
||||
this.totalProfit = profit
|
||||
this.totalPnl = pnl
|
||||
}
|
||||
})
|
||||
// totalPnl 固定为 0,不作计算
|
||||
// totalProfit 由 getWallet 从后端同步
|
||||
},
|
||||
getWallet(){
|
||||
this.post('/wallet/wallet_index').then((res) => {
|
||||
@@ -389,6 +376,10 @@
|
||||
this.fb = res.data.fb
|
||||
this.lh = res.data.lh
|
||||
this.qq = res.data.qq
|
||||
// Account Total Profit 与合约交易利润实时同步
|
||||
this.totalProfit = res.data.total_profit || 0
|
||||
// Account Total P&L 固定为 0
|
||||
this.totalPnl = 0
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -399,7 +390,7 @@
|
||||
})
|
||||
},
|
||||
tabsChange(index) {
|
||||
if(index==3){
|
||||
if(index==4){
|
||||
uni.navigateTo({
|
||||
url:'/pages/index/money/index'
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user