feat: 前端全量更新 - 含所有本次需求

- 移除秒合约页面及UI
- 合约页Tab改为Position Held/Transaction Record
- 存款/提款/转账页增加BTC/ETH
- 资产页重构(用户信息+盈亏+多语言)
- 注册页改版(匹配新设计稿)
- 日文全面翻译+首页菜单多语言
- 代理专属注册链接支持(?code=)
- 10个locale文件同步更新
This commit is contained in:
li
2026-03-30 20:14:20 +08:00
commit 5f40e4e1b5
605 changed files with 154871 additions and 0 deletions
+223
View File
@@ -0,0 +1,223 @@
<template>
<view>
<z-paging :language="$i18n.locale" ref="paging" v-model="list" @query="queryList" :pageSize="20"
:style="'background-color: '+theme.bg+';color: '+theme.text">
<!-- 下拉刷新 -->
<custom-refresher slot="refresher" slot-scope="{refresherStatus}" :status="refresherStatus">
</custom-refresher>
<!-- 头部 -->
<view slot="top" class="relative" :style="{height: `calc(${statusBar}px + 490rpx)`}">
<view class="width-100b fixed1" :style="{height: `calc(${statusBar}px + 490rpx)`}">
<view class="width-100b flex align-center justify-center"
:style="{paddingTop: statusBar + 'px', height: `calc(${statusBar}px + 55px)`}">
<text class="midetitle">{{i18n.assets.bill.title}}</text>
<i @click="router.goBack()" class="cuIcon-back font-30 color-white"
style="position: absolute;left: 30rpx;"></i>
</view>
<view class="height-240 padding-w-30 padding-b-20">
<view class="height-100 margin-b-20">
<view class="flex-1 height-100 flex direction-column align-start justify-between">
<text class="font-26 color-white"
style="opacity: 0.6;">{{i18n.assets.bill.balance}}</text>
<text class="font-48 numbold-font color-white">{{Number(balance).toFixed(4)}}</text>
</view>
</view>
<view class="height-100 flex align-center justify-between">
<view class="flex-1 height-90 flex direction-column align-start justify-between">
<text class="font-26 color-white"
style="opacity: 0.6;">{{i18n.assets.bill.total}}</text>
<text class="font-28 numbold-font color-white">{{Number(cc_amount).toFixed(4)}}</text>
</view>
<view class="flex-1 height-90 flex direction-column align-center justify-between">
<text class="font-26 color-white"
style="opacity: 0.6;">{{i18n.assets.bill.today}}</text>
<text class="font-28 numbold-font color-white">{{Number(pc_amount).toFixed(4)}}</text>
</view>
<view class="flex-1 height-90 flex direction-column align-end justify-between">
<text class="font-26 color-white" style="opacity: 0.6;">{{i18n.assets.bill.bili}}</text>
<text :class="yk_percent >= 0?'color-00C481':'color-FF4040'"
class="font-28 numbold-font ">{{yk_percent | percentFilter}}%</text>
</view>
</view>
</view>
<view class="absolute" style="bottom: 0;">
<view class="" style="border-radius: 20rpx 20rpx 0 0;"
:style="'background-color: '+theme.bg+';color: '+theme.text">
<view class="height-120 flex align-center justify-between">
<view @click="set(1)"
class="flex-1 height-110 padding-t-30 flex direction-column align-center justify-between">
<text :class="current==1?'color-0165EE':'color-C3C3C3'" class="font-26 "
style="">{{i18n.assets.bill.todayYL}}</text>
<text :class="current==1?'color-0165EE':'color-C3C3C3'"
class="font-30 numbold-font">{{Number(today_num).toFixed(4)}}</text>
</view>
<view class="width-2 height-75" style="background-color: #EAECEF;"></view>
<view @click="set(2)"
class="flex-1 height-110 padding-t-30 flex direction-column align-center justify-between">
<text :class="current==2?'color-0165EE':'color-C3C3C3'" class="font-26"
style="">{{i18n.assets.bill.allYL}}</text>
<text :class="current==2?'color-0165EE':'color-C3C3C3'"
class="font-30 numbold-font">{{Number(all_num).toFixed(4)}}</text>
<!-- <view :style="current==1?'':'visibility: hidden;'" class="width-95 height-4" style="background-color: #0165EE;"></view> -->
</view>
</view>
<view class="height-20 width-750 relative" :style="'background-color: '+theme.bg">
<view :style="current==1?'left: 150rpx;':'left: 530rpx;'" class="huakuai"></view>
</view>
</view>
</view>
</view>
</view>
<!-- 身体 -->
<view>
<view v-if="current==1" class="">
<view class="listBox" v-for="(item,index) in list" :key="index"
:style="'background-color: '+theme.fu_bg+';color: '+theme.text">
<view class="height-100 flex align-center justify-between">
<view class="flex-1 height-80 flex direction-column align-start justify-between">
<text class="font-26">{{i18n.assets.bill.order}}</text>
<text class="font-30 numbold-font color-C3C3C3">{{item.order_sn}}</text>
</view>
<view class="flex-1 height-80 flex direction-column align-start justify-between">
<text class="font-26">{{i18n.assets.bill.curr}}</text>
<text class="font-30 numbold-font color-C3C3C3">{{item.coinname}}</text>
</view>
</view>
<view class="height-100 flex align-center justify-between">
<view class="flex-1 height-80 flex direction-column align-start justify-between">
<text class="font-26">{{i18n.assets.bill.time}}</text>
<text class="font-30 numbold-font color-C3C3C3">{{item.createtime}}</text>
</view>
<view class="flex-1 height-80 flex direction-column align-start justify-between">
<text class="font-26 color-C3C3C3">{{i18n.assets.bill.edu}}</text>
<text class="font-30 numbold-font color-00C481">{{item.income}} USDT</text>
</view>
</view>
</view>
</view>
<view v-if="current==2" class="">
<view class="listBox" v-for="(item,index) in list" :key="index"
:style="'background-color: '+theme.fu_bg+';color: '+theme.text">
<view class="padding-10">
<view class="height-50 flex align-center justify-between">
<text class="font-26">{{i18n.assets.bill.yingli}}</text>
<text class="font-26">{{i18n.assets.bill.data}}</text>
</view>
<view class="height-50 flex align-center justify-between">
<text class="font-30 numbold-font color-00C481">{{item.income}} USDT</text>
<text class="font-30 numbold-font color-C3C3C3">{{item.createtime}}</text>
</view>
</view>
</view>
</view>
</view>
</z-paging>
</view>
</template>
<script>
export default {
data() {
return {
statusBar: uni.getSystemInfoSync().statusBarHeight,
current: 1,
balance: 0, //余额
cc_amount: 0, //当前持仓总量
pc_amount: 0, //今日平仓总量
yk_percent: 0, //今日盈亏比例
today_num: 0, //今日盈利
all_num: 0, //累计盈利
list: [],
theme: '',
}
},
filters: {
// 百分号过滤器(保留小数点后两位)
percentFilter: function(item) {
return (item * 100).toFixed(2)
}
},
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
}
},
methods: {
set(e) {
if (this.current != e) {
this.current = e
this.queryList(1, 10)
}
},
queryList(pageNo, pageSize) {
setTimeout(() => {
this.post('/strategy/get_bill', {
page: pageNo,
page_num: pageSize,
type: this.current
}).then(res => {
if (res.code == 1) {
if (this.current == 1) {
this.balance = res.data.balance
this.cc_amount = res.data.cc_amount
this.pc_amount = res.data.pc_amount
this.yk_percent = res.data.yk_percent
this.today_num = res.data.today_num
this.all_num = res.data.all_num
}
console.log(res)
this.$refs.paging.complete(res.data.data);
}
})
}, 500)
},
}
}
</script>
<style lang="scss">
.fixed1 {
position: fixed;
top: 0;
z-index: 990;
background-color: #0165EE;
}
.midetitle {
font-size: 16px;
font-weight: 700;
color: #fff;
}
.listBox {
width: 100%;
// height: 232rpx;
padding: 10rpx 30rpx;
// background: #FFFFFF;
margin-bottom: 1rpx;
}
.huakuai {
width: 75rpx;
height: 4rpx;
background-color: #0165EE;
position: absolute;
top: 10rpx;
transition: all 0.5s;
}
</style>
+157
View File
@@ -0,0 +1,157 @@
<template>
<view class="">
<z-paging style="padding-bottom: 170rpx;" :language="$i18n.locale" ref="paging" v-model="list" @query="queryList" :pageSize="20"
:style="'background-color: '+theme.bg+';color: '+theme.text">
<!-- 下拉刷新 -->
<custom-refresher slot="refresher" slot-scope="{refresherStatus}" :status="refresherStatus">
</custom-refresher>
<!-- 头部 -->
<myNav slot="top" :title="name"></myNav>
<!-- 身体 -->
<view>
<p class="padding-w-30 font-46 bold-font margin-c-30">
{{i18n.assets.index.detail}}
</p>
<view class="listBox" v-for="(item,index) in list" :key="index"
:style="'background-color: '+theme.fu_bg+';color: '+theme.fu_text">
<view class="width-100b height-82 padding-w-22 flex align-center"
style="border-bottom: 1rpx solid rgba(191, 195, 199, 0.2);">
<text :class="item.cart==1?'color-00C481':'color-FF4040'"
class="font-32 numbold-font">{{item.cart==1?i18n.assets.index.shift:i18n.assets.index.roll}}</text>
</view>
<view class="width-100b padding-w-20">
<view class="height-80 flex align-center justify-between">
<text class="font-26 nummedium-font">{{item.price}}</text>
<text class="font-26 nummedium-font color-C3C3C3">{{item.createtime}}</text>
</view>
<view class="padding-b-20">
<text class="font-26 numbold-font">{{item.description}}</text>
</view>
</view>
</view>
</view>
</z-paging>
<!-- 底部按钮 -->
<view v-if="type==1" class="bottomBox">
<view v-if="curr_obj.is_reg==1" @click="router.push('/pages/index/recharge?id='+curr_id)"
class="juxing chonbi">{{i18n.assets.index.reg}}</view>
<view v-if="curr_obj.is_wid==1" @click="router.push('/pages/index/withdraw?id='+curr_id)" class="juxing">
{{i18n.assets.index.wid}}
</view>
<!-- <view v-if="curr_obj.is_tran==1" @click="router.push('/pages/asset/transfer?id=1')" class="juxing">
{{i18n.assets.index.tran}}
</view> -->
</view>
<!-- <view v-if="type==2&&curr_obj.is_otc==1" class="bottomBox">
<view @click="router.push('/pages/index/releaseTrade?id='+curr_id)" class="juxing chonbi">
{{i18n.assets.index.buy}}
</view>
<view @click="router.push('/pages/index/releaseTrade?id='+curr_id)" class="juxing">
{{i18n.assets.index.sell}}
</view>
</view> -->
</view>
</template>
<script>
export default {
data() {
return {
curr_id: '',
name: '',
type: '',
curr_obj: {
},
list: [],
theme: '',
}
},
computed: {
i18n() {
return this.$t('message');
}
},
onLoad(e) {
this.curr_id = e.curr_id
this.name = e.name
this.type = e.type
this.curr_obj = e
},
onShow() {
if (uni.getStorageSync("theme") == "dark") {
this.theme = this.$store.state.darkTheme
} else {
this.theme = this.$store.state.lightTheme
}
},
methods: {
queryList(pageNo, pageSize) {
setTimeout(() => {
this.post('/wallet/detail_log', {
page: pageNo,
page_num: pageSize,
type: this.type,
curr_id: this.curr_id
}).then(res => {
if (res.code == 1) {
console.log(res)
this.$refs.paging.complete(res.data.data);
}
})
}, 500)
},
}
}
</script>
<style lang="scss">
.listBox {
width: 690rpx;
// height: 183rpx;
margin: 30rpx auto;
// background: #FFFFFF;
box-shadow: 0rpx 4rpx 4rpx rgba(205, 206, 219, 0.2);
border-radius: 10rpx;
}
.bottomBox {
width: 100%;
// height: 120rpx;
padding: 0 30rpx;
/* #ifdef APP-PLUS */
padding: 0 30rpx 40rpx;
/* #endif */
// background: #FFFFFF;
box-shadow: 0rpx 4rpx 10rpx rgba(33, 33, 33, 0.16);
position: fixed;
bottom: 0rpx;
display: flex;
align-items: center;
justify-content: center;
}
.juxing {
// width: 173rpx;
flex: 1;
height: 76rpx;
margin: 30rpx 20rpx;
background: #F6F8FB;
border-radius: 10rpx;
line-height: 76rpx;
text-align: center;
font-size: 32rpx;
color: #17181A;
}
.chonbi {
background: linear-gradient(180deg, #52F3C9 0%, #3ECEB2 100%)!important;
color: #FFFFFF !important;
}
</style>
+473
View File
@@ -0,0 +1,473 @@
<template>
<view class="">
<z-paging ref="paging" v-model="list" @query="queryList"
:style="'background-color: '+theme.bg+';color: '+theme.text">
<custom-refresher slot="refresher" slot-scope="{refresherStatus}" :status="refresherStatus">
</custom-refresher>
<!-- 头部 tab -->
<view slot="top" class="width-100b flex align-center justify-between padding-w-40" :style="{height: `calc(${statusBar}px + 100rpx)`,paddingTop: `calc(${statusBar}px )`}">
<view @click="tabsChange(index)" class="flex-1 height-100b flex align-center justify-center"
v-for="(item,index) in tabList" :key="index">
<text :class="current==index?theme.selectcolor:theme.color" class="font-32">{{item}}</text>
</view>
</view>
<view class="padding-w-30">
<!-- 用户信息卡片 -->
<view class="userCard" :style="'background:'+theme.assetbg">
<view class="width-100b flex align-center justify-between">
<view class="flex align-center">
<image class="width-80 height-80 radiu-50b margin-r-20" :src="userinfo.avatar || '/static/imgs/my/head_ico.png'" mode="aspectFill"></image>
<view class="flex direction-column">
<text class="font-28 color-white bold-font">{{userinfo.email || userinfo.nickname || '--'}}</text>
<text class="font-22 color-white" style="opacity:0.7;">ID: {{userinfo.id || '--'}}</text>
</view>
</view>
<view @click="router.push('/pages/asset/record')" class="recordBtn">
<text class="font-24 color-white">{{i18n.assets.index.record || 'Record'}}</text>
</view>
</view>
<!-- 资产总览 -->
<view class="width-100b margin-t-30 flex align-center justify-between">
<view class="flex-1">
<view class="flex align-center">
<text class="font-22 color-white" style="opacity:0.7;">{{i18n.assets.index.totalAssets || 'Account Total Assets'}}</text>
<view class="margin-l-16" @click="ifcover=!ifcover">
<image class="width-32 height-26" :src="ifcover?ZY:BY" mode=""></image>
</view>
</view>
<view class="flex align-center margin-t-10">
<text v-if="ifcover" class="font-40 numbold-font color-white">${{formatNum(all.count_usdt)}}</text>
<text v-else class="font-40 numbold-font color-white">****</text>
</view>
</view>
<view class="flex-1 text-right">
<text class="font-22 color-white" style="opacity:0.7;">{{i18n.assets.index.totalPnl || 'Account Total P&L'}}</text>
<view class="flex align-center justify-end margin-t-10">
<text v-if="ifcover" class="font-32 numbold-font color-white">$ {{formatNum(totalPnl)}}</text>
<text v-else class="font-32 numbold-font color-white">****</text>
</view>
</view>
</view>
<!-- 总利润 -->
<view class="width-100b margin-t-16">
<text class="font-22 color-white" style="opacity:0.7;">{{i18n.assets.index.totalProfit || 'Account Total Profit'}}</text>
<view class="margin-t-6">
<text v-if="ifcover" class="font-34 numbold-font" :style="'color:'+(totalProfit>=0?'#00C481':'#FF4040')">$ {{formatNum(totalProfit)}}</text>
<text v-else class="font-34 numbold-font color-white">****</text>
</view>
</view>
</view>
<!-- 存款/取款/转账 -->
<view class="height-170 flex align-center justify-between" :style="'color: '+theme.text">
<view @click="router.push('/pages/index/recharge')" class="flex-1 height-100b flex direction-column align-center justify-center">
<image class="width-90 height-90" :src="theme.imgs+'/Group34154@2x.png'" mode=""></image>
<text class="font-26 margin-t-6">{{i18n.assets.index.reg}}</text>
</view>
<view @click="router.push('/pages/index/withdraw')" class="flex-1 height-100b flex direction-column align-center justify-center">
<image class="width-90 height-90" :src="theme.imgs+'/Group34153@2x.png'" mode=""></image>
<text class="font-26 margin-t-6">{{i18n.assets.index.wid}}</text>
</view>
<view @click="router.push('/pages/asset/transfer?id='+current)" class="flex-1 height-100b flex direction-column align-center justify-center">
<image class="width-90 height-90" :src="theme.imgs+'/Group34155@2x.png'" mode=""></image>
<text class="font-26 margin-t-6">{{i18n.assets.index.tran}}</text>
</view>
</view>
</view>
<!-- 总览页面 -->
<view v-if="current==0" class="padding-w-30">
<!-- Spot 余额 -->
<view @click="current=1" class="accountRow" :style="'background-color:'+theme.fu_bg+';color:'+theme.text">
<view class="flex align-center justify-between">
<text class="font-28 bold-font">{{i18n.assets.index.title2}}</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_xh_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">
<text class="font-28 bold-font">{{i18n.assets.index.title3}}</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_fb_usdt:'****'}} <text class="font-24 color-C3C3C3">USDT</text></text>
</view>
</view>
<!-- 资金流水 -->
<view class="margin-t-20">
<view v-for="(item,index) in list" :key="index" class="flowRow" :style="'border-bottom:1rpx solid '+(theme.bg=='#FFFFFF'?'#F0F0F0':'rgba(255,255,255,0.06)')">
<view class="flex align-center justify-between">
<text class="font-26 bold-font">{{item.description}}</text>
<text v-if="item.cart==1" class="numbold-font font-26 color-00C481">{{item.price}} USDT</text>
<text v-if="item.cart==2" class="numbold-font font-26 color-FF4040">-{{item.price}} USDT</text>
</view>
<text class="font-22 color-C3C3C3 margin-t-6">{{item.createtime}}</text>
</view>
</view>
<view v-if="loading" class="width-100b padding-c-50 flex align-center justify-center">
<u-loading show mode="flower" size="40"></u-loading>
</view>
</view>
<!-- Spot / Fiat / 理财 子页面 -->
<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>
<text class="font-24 margin-l-20">{{i18n.assets.index.hide}}</text>
</view>
<view
:class="[toggleDelay?'animation-slide-bottom':'']"
class="coinBox" v-for="(item,index) in datalist" :key="index"
:style="'background-color: '+theme.fu_bg+';color: '+theme.text">
<view @click="naviTo(item)"
class="width-100b height-82 padding-w-22 flex align-center justify-between"
style="border-bottom: 1rpx solid rgba(191, 195, 199, 0.2);">
<view class="flex align-center">
<image class="width-36 height-36" :src="item.thumb_image" mode=""></image>
<text class="font-32 numbold-font margin-w-15">{{item.name}}</text>
<text class="font-24 nummedium-font color-C3C3C3">{{item.full_name}}</text>
</view>
<i class="cuIcon-right font-22 color-D1D3D8"></i>
</view>
<view class="width-100b height-100 padding-w-20 flex align-center justify-between">
<view class="flex-1 height-80 flex direction-column align-start justify-around">
<text class="font-24">{{i18n.assets.index.usable}}</text>
<text class="font-26 numbold-font">{{ifcover?item.num:'****'}}</text>
</view>
<view class="flex-1 height-80 flex direction-column align-center justify-around">
<text class="font-24">{{i18n.assets.index.freeze}}</text>
<text class="font-26 numbold-font">{{ifcover?item.num_dj:'****'}}</text>
</view>
<view class="flex-1 height-80 flex direction-column align-end justify-around">
<text class="font-24">{{i18n.assets.index.convert}}</text>
<text class="font-26 numbold-font">{{ifcover?item.usdt_price:'****'}}</text>
</view>
</view>
</view>
<view v-if="datalist.length == 0" class="height-100 flex align-center justify-center">
<text class="font-24 color-999999 ">{{i18n.assets.index.nodata}}</text>
</view>
</view>
</z-paging>
</view>
</template>
<script>
export default {
data() {
return {
statusBar: uni.getSystemInfoSync().statusBarHeight,
tabList: ['总览', '现货','法币','理财'],
current: 0,
userinfo: {},
totalPnl: 0,
totalProfit: 0,
all:{
count_btc: "0.0000",
count_usdt: "0.0000",
count_xh_usdt: "0.00",
count_lh_usdt: "0.00",
count_fb_usdt: "0.00"
},
xh:{
count_btc: "0.0000",
count_usdt: "0.0000",
xh_arr:[]
},
fb:{
count_btc: "0.0000",
count_usdt: "0.0000",
fb_arr:[]
},
lh:{
count_btc: "0.0000",
count_usdt: "0.0000",
lh_arr:[]
},
qq:{
count_btc: "0.0000",
count_usdt: "0.0000",
qq_arr:[]
},
ZY: '/static/imgs/asset/zhenyan.png',
BY: '/static/imgs/asset/biyan.png',
ifcover: true,
ifHideCoin:false,
toggleDelay: false,
list:[],
loading:true,
theme: '',
}
},
computed:{
i18n() {
return this.$t('message');
},
count_obj() {
let obj = {};
var that = this
switch (this.current) {
case 0:
obj = that.all
break;
case 1:
obj = that.xh
break;
case 2:
obj = that.fb
break;
case 3:
obj = that.lh
break;
case 4:
obj = that.qq
break;
default:
obj = that.all
break;
}
return obj
},
datalist() {
let obj = [];
var that = this
switch (this.current) {
case 0:
obj = []
break;
case 1:
if(that.ifHideCoin==true){
if(that.xh.xh_arr){
obj = that.xh.xh_arr.filter((item)=>{
return item.num != 0
})
}
}else{
obj = that.xh.xh_arr
}
break;
case 2:
if(that.ifHideCoin==true){
if(that.fb.fb_arr){
obj = that.fb.fb_arr.filter((item)=>{
return item.num != 0
})
}
}else{
obj = that.fb.fb_arr
}
break;
case 3:
if(that.ifHideCoin==true){
if(that.lh.lh_arr){
obj = that.lh.lh_arr.filter((item)=>{
return item.num != 0
})
}
}else{
obj = that.lh.lh_arr
}
break;
case 4:
if(that.ifHideCoin==true){
if(that.qq.qq_arr){
obj = that.qq.qq_arr.filter((item)=>{
return item.num != 0
})
}
}else{
obj = that.qq.qq_arr
}
break;
default:
obj = []
break;
}
return obj
},
},
watch:{
ifHideCoin(item){
uni.setStorageSync('ifHideCoin',item)
}
},
onShow() {
if (uni.getStorageSync("theme") == "dark") {
this.theme = this.$store.state.darkTheme
}else{
this.theme = this.$store.state.lightTheme
}
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
if(uni.getStorageSync('ifHideCoin')){
this.ifHideCoin = uni.getStorageSync('ifHideCoin')
}
this.getWallet()
this.getUserInfo()
this.calcProfit()
},
methods: {
formatNum(val) {
let n = Number(val || 0)
return n.toFixed(2)
},
queryList(pageNo, pageSize) {
this.loading = true
this.post('/wallet/index_detail', {
page: pageNo,
}).then(res => {
this.loading = false
console.log('资金动态',res)
if (res.code == 1) {
this.$refs.paging.complete(res.data.data);
}
})
},
getUserInfo() {
this.post('/my/get_userinfo').then((res) => {
if (res.code == 1) {
this.userinfo = res.data
}
})
},
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
}
})
},
getWallet(){
this.post('/wallet/wallet_index').then((res) => {
console.log('我的资产',res)
if (res.code == 1) {
this.all = res.data.all
this.xh = res.data.xh
this.fb = res.data.fb
this.lh = res.data.lh
this.qq = res.data.qq
}
})
},
naviTo(item){
console.log(this.$u.queryParams(item))
uni.navigateTo({
url:'/pages/asset/details'+this.$u.queryParams(item)
})
},
tabsChange(index) {
if(index==3){
uni.navigateTo({
url:'/pages/index/money/index'
})
}else{
this.current = index;
this.ToggleDelay()
}
},
ToggleDelay() {
this.toggleDelay = true;
setTimeout(() => {
this.toggleDelay = false
}, 1000)
}
}
}
</script>
<style lang="scss">
.userCard {
width: 100%;
padding: 30rpx 28rpx;
border-radius: 16rpx;
position: relative;
}
.recordBtn {
padding: 10rpx 24rpx;
background: rgba(255,255,255,0.15);
border-radius: 30rpx;
border: 1rpx solid rgba(255,255,255,0.3);
}
.accountRow {
width: 100%;
padding: 28rpx 30rpx;
border-radius: 16rpx;
margin-bottom: 20rpx;
}
.flowRow {
padding: 24rpx 0;
}
.topBox {
width: 100%;
padding: 22rpx 28rpx;
display: flex;
border-radius: 16rpx;
}
.juxing {
flex: 1;
margin: 0 18rpx;
height: 56rpx;
border: 1rpx solid rgba(255, 255, 255, 0.35);
background: rgba(255, 255, 255, 0.09);
border-radius: 10rpx;
line-height: 56rpx;
text-align: center;
font-size: 28rpx;
color: #fff;
}
.coinBox {
width: 690rpx;
box-shadow: 0rpx 4rpx 4rpx rgba(205, 206, 219, 0.2);
border-radius: 10rpx;
margin: 0rpx auto 30rpx;
}
</style>
+271
View File
@@ -0,0 +1,271 @@
<template>
<view>
<z-paging :language="$i18n.locale" ref="paging" v-model="list" @query="queryList" :pageSize="20"
:style="'background-color: '+theme.fu_bg+';color: '+theme.text">
<!-- 下拉刷新 -->
<custom-refresher slot="refresher" slot-scope="{refresherStatus}" :status="refresherStatus">
</custom-refresher>
<!-- 头部 -->
<view slot="top" class="width-750 relative flex align-center justify-center bj-8EBEFF"
:style="{height: `calc(${statusBar}px + 220rpx)`}">
<view class="width-750 fixed1"
:style="{paddingTop: statusBar + 'px', height: `calc(${statusBar}px + 220rpx)`}">
<view class="width-750 height-100 padding-w-30 bgimg1 flex align-center justify-center">
<view @click="_goback" class="cuIcon-back font-40" style="position: absolute;left: 30rpx;">
</view>
<text class="font-36 weight-bold">{{i18n.TranRecord.title1}}</text>
<image @click="show=true" class="width-36 height-36 absolute" style="right: 30rpx;"
src="/static/imgs/index/shaixuan@2x.png"></image>
</view>
<view class="height-90 margin-10-auto width-690 radiu-10 flex align-center justify-between"
:style="'background-color: '+theme.bg">
<view class="flex-1 height-66 flex direction-column align-center justify-center">
<text class="font-28">{{i18n.assets.record.title1}}</text>
<text class="font-28 color-FF4040">{{order_num}}</text>
</view>
<view class="flex-1 height-66 flex direction-column align-center justify-center">
<text class="font-28">{{i18n.assets.record.title2}}</text>
<text class="font-28 color-00C481">{{win_num}}</text>
</view>
<view class="flex-1 height-66 flex direction-column align-center justify-center">
<text class="font-28">{{i18n.assets.record.title3}}</text>
<text class="font-28 color-FF4040">{{loss_num}}</text>
</view>
</view>
</view>
</view>
<!-- 身体 -->
<view class="width-750 padding-b-40">
<secondListItem :currentIndex="current2"
:list="list" :color="theme.text" :background="theme.bg">
</secondListItem>
</view>
</z-paging>
<!-- 筛选弹窗 -->
<u-popup v-model="show" mode="bottom" border-radius="25">
<view class="width-100b padding-w-20" :style="'background-color: '+theme.bg+';color: '+theme.text"
style="height:730rpx; border-radius: 20rpx 20rpx 0 0;">
<view class="width-100b height-70 text-center line-height-100">
<text class="font-28 weight-bold">{{i18n.TranRecord.text10}}</text>
</view>
<view class="width-100b height-150 margin-c-10 padding-w-30 flex direction-column justify-around">
<text class="font-28 weight-bold line-height-64">{{i18n.TranRecord.text12}} <span
class="font-26">({{i18n.TranRecord.text13}})</span></text>
<input class="width-100b height-86 font-28 numbold-font" :placeholder="i18n.TranRecord.tos2"
type="text" v-model="symbol" />
</view>
<view class="width-100b height-160 margin-c-10 padding-w-30 flex direction-column justify-around">
<text class="font-28 weight-bold">{{i18n.assets.record.title4}}</text>
<view class="width-100b height-70 flex align-center justify-between">
<view @click="trade_result=''" class="selectTime">
<view :class="trade_result==''?'bj-0165EE color-white':''" class="picker">
{{i18n.assets.record.title5}}
</view>
</view>
<view @click="trade_result='win'" class="selectTime">
<view :class="trade_result=='win'?'bj-0165EE color-white':''" class="picker">
{{i18n.assets.record.title6}}
</view>
</view>
<view @click="trade_result='loss'" class="selectTime">
<view :class="trade_result=='loss'?'bj-0165EE color-white':''" class="picker">
{{i18n.assets.record.title7}}
</view>
</view>
</view>
</view>
<view class="width-100b height-160 margin-c-10 padding-w-30 flex direction-column justify-around">
<text class="font-28 weight-bold">{{i18n.assets.record.title8}}</text>
<view class="width-100b height-70 flex align-center justify-between">
<view @click="rise_or_fall=''" class="selectTime">
<view :class="rise_or_fall==''?'bj-0165EE color-white':''" class="picker">
{{i18n.assets.record.title5}}
</view>
</view>
<view @click="rise_or_fall='rise'" class="selectTime">
<view :class="rise_or_fall=='rise'?'bj-0165EE color-white':''" class="picker">
{{i18n.assets.record.title9}}
</view>
</view>
<view @click="rise_or_fall='fall'" class="selectTime">
<view :class="rise_or_fall=='fall'?'bj-0165EE color-white':''" class="picker">
{{i18n.assets.record.title10}}
</view>
</view>
</view>
</view>
<view class="width-100b height-100 padding-30 flex align-center justify-between">
<view class="resetBtn" @click="reset">{{i18n.TranRecord.text15}}</view>
<view class="inquireBtn" @click="chechOrder">{{i18n.TranRecord.text16}}</view>
</view>
</view>
</u-popup>
</view>
</template>
<script>
import secondListItem from '../contract/components/second_list_item.vue'
export default {
components: {
secondListItem,
},
data() {
return {
statusBar: uni.getSystemInfoSync().statusBarHeight,
show: false,
list: [],
theme: '',
loss_num: 0,
order_num: 0,
win_num: 0,
current2:1,
contractOrderList_s: [], //秒合约交易订单列表
loading_s:true,
symbol:'',
trade_result:'',
rise_or_fall:''
}
},
computed: {
i18n() {
return this.$t('message');
}
},
onLoad(e) {
this.order_census()
},
onShow() {
if (uni.getStorageSync("theme") == "dark") {
this.theme = this.$store.state.darkTheme
} else {
this.theme = this.$store.state.lightTheme
}
},
methods: {
order_census() {
this.post('/cycle/order_census').then(res => {
console.log('统计', res)
if (res.code == 1) {
this.loss_num = res.data.loss_num
this.order_num = res.data.order_num
this.win_num = res.data.win_num
}
})
},
chechOrder() {
var obj = {
symbol: this.symbol,
trade_result:this.trade_result,
rise_or_fall:this.rise_or_fall
}
console.log(obj)
this.show = false
this.list = []
this.queryList(1, 20)
},
reset() {
this.symbol = ''
this.trade_result = ''
this.rise_or_fall = ''
},
queryList(pageNo, pageSize) {
let obj = {
page: pageNo,
page_num: pageSize,
symbol: this.symbol,
trade_result:this.trade_result,
rise_or_fall:this.rise_or_fall
}
this.loading_s = true
setTimeout(() => {
this.post('/cycle/get_all_order', obj).then(res => {
this.loading_s = false
if (res.code == 1) {
console.log(res)
this.$refs.paging.complete(res.data.data);
}
})
}, 500)
},
}
}
</script>
<style lang="scss">
.fixed1 {
position: fixed;
top: 0;
z-index: 1010;
}
.selectTime {
flex: 1;
margin: 0 20rpx;
height: 66rpx;
background: rgba(160, 171, 181, 0.2);
box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(255, 255, 255, 0.5);
border-radius: 10rpx;
color: #8B99A2;
font-size: 28rpx;
text-align: center;
line-height: 66rpx;
}
.select_on {
width: 180rpx;
height: 66rpx;
margin-right: 20rpx;
line-height: 66rpx;
background: #0165EE;
border-radius: 10rpx;
color: #FFFFFF;
font-size: 30rpx;
font-weight: 500;
text-align: center;
}
.select_off {
width: 180rpx;
height: 66rpx;
margin-right: 20rpx;
line-height: 66rpx;
background: #8B99A2;
border-radius: 10rpx;
color: #FFFFFF;
font-size: 30rpx;
font-weight: 500;
text-align: center;
}
.resetBtn {
width: 300rpx;
height: 86rpx;
line-height: 86rpx;
background: rgba(160, 171, 181, 0.2);
border-radius: 10rpx;
color: #8B99A2;
font-size: 30rpx;
font-weight: bold;
text-align: center;
}
.inquireBtn {
width: 300rpx;
height: 86rpx;
line-height: 86rpx;
background: #0165EE;
border-radius: 10rpx;
color: #FFFFFF;
font-size: 30rpx;
font-weight: bold;
text-align: center;
}
</style>
+80
View File
@@ -0,0 +1,80 @@
<template>
<view class="">
<z-paging :language="$i18n.locale" ref="paging" v-model="list" @query="queryList" :pageSize="20"
:style="'background-color: '+theme.bg+';color: '+theme.text">
<!-- 下拉刷新 -->
<custom-refresher slot="refresher" slot-scope="{refresherStatus}" :status="refresherStatus">
</custom-refresher>
<!-- 头部 -->
<myNav slot="top" :title="i18n.assets.transfer.jilu"></myNav>
<!-- 身体 -->
<view>
<view class="listBox" v-for="(item,index) in list" :key="index"
:style="'background-color: '+theme.fu_bg">
<view class="width-100b height-82 padding-w-22 flex align-center"
style="border-bottom: 1rpx solid rgba(191, 195, 199, 0.2);">
<text class="font-32 numbold-font">{{item.name}}</text>
</view>
<view class="width-100b padding-w-20">
<view class="height-80 flex align-center justify-between">
<text class="font-26 nummedium-font">{{item.price}}</text>
<text class="font-26 nummedium-font color-C3C3C3">{{item.createtime}}</text>
</view>
<view class="padding-b-20">
<text class="font-26 bold-font">{{item.description}}</text>
</view>
</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
}
},
methods: {
queryList(pageNo, pageSize) {
this.post('/wallet/transfer_log', {
page: pageNo,
page_num: pageSize
}).then(res => {
if (res.code == 1) {
console.log(res)
this.$refs.paging.complete(res.data.data);
}
})
},
}
}
</script>
<style lang="scss">
.listBox {
width: 690rpx;
// height: 183rpx;
margin: 30rpx auto;
// background: #FFFFFF;
box-shadow: 0rpx 4rpx 10rpx rgba(205, 206, 219, 0.3);
border-radius: 10rpx;
}
</style>
+337
View File
@@ -0,0 +1,337 @@
<template>
<view :style="'background-color: '+theme.bg+';color: '+theme.text" style="height: 100vh;">
<myNav :title="i18n.assets.transfer.title" :isRight="true" righturl="/static/imgs/asset/zhuanhuanjilu@2x.png"
@Jump="router.push('/pages/asset/record')"></myNav>
<view class="padding-w-30">
<view class="borderBox" :style="'background-color: '+theme.fu_bg">
<view class="height-260 padding-22 flex align-center justify-between">
<view class="flex-1">
<view @click="showPoup='accountL'"
:class="[animationName?'animation-slide-bottom':'']"
class="width-100b height-110 flex align-center">
<i class="cuIcon-title color-00C481"></i>
<text class="font-32 color-D1D3D8 margin-w-10">{{i18n.assets.transfer.from}}</text>
<text class="font-32">{{leftObj.name}}</text>
</view>
<view class="width-100b height-2 margin-c-4" style="background-color: #D1D3D8;"> </view>
<view @click="showPoup='accountR'"
:class="[animationName?'animation-slide-top':'']"
class="width-100b height-110 flex align-center">
<i class="cuIcon-title color-FF4040"></i>
<text class="font-32 color-D1D3D8 margin-w-10">{{i18n.assets.transfer.to}}</text>
<text class="font-32">{{rightObj.name}}</text>
</view>
</view>
<image @click="exchange" :class="animationName" class="width-62 height-62 margin-l-30"
src="/static/imgs/asset/qiehuan@2x.png" mode=""></image>
</view>
</view>
<view class="borderBox" :style="'background-color: '+theme.fu_bg">
<view @click="showPoup='currency',currType=true" class="padding-22">
<view class="height-65 flex align-center">
<text class="font-32">{{i18n.assets.transfer.curr}}</text>
</view>
<view class="height-65 flex align-center">
<text v-if="selectCurr.curr_id != undefined"
class="font-32 numbold-font">{{selectCurr.name}}</text>
<text v-else class="font-32 color-0165EE">{{i18n.assets.transfer.subtit}}</text>
</view>
</view>
</view>
<view class="borderBox" :style="'background-color: '+theme.fu_bg">
<view class="padding-22">
<view class="height-65 flex align-center">
<text class="font-32">{{i18n.assets.transfer.num}}</text>
</view>
<view class="height-65 flex align-center justify-between">
<input class="height-65 font-26 numbold-font" type="number" v-model="inputNum"
:placeholder="i18n.assets.transfer.inputNum" />
<view class="height-65 line-height-65">
<text @click="allIn" class="font-26 bold-font color-0165EE">{{i18n.assets.transfer.all}}</text>
</view>
</view>
</view>
</view>
<view class="borderBox" :style="'background-color: '+theme.fu_bg">
<view class="padding-22">
<view class="height-65 flex align-center justify-between">
<text class="font-30">{{i18n.assets.transfer.pay_pwd}}</text>
<input class="height-65 font-30 numbold-font text-right" type="text" v-model="pay_pwd" password
:placeholder="i18n.assets.transfer.inputPWD" />
</view>
</view>
</view>
<view v-if="selectCurr.name" class="flex align-center">
<text class="font-26">{{i18n.assets.transfer.usable}}</text>
<u-count-to fontSize="26" :color="theme.text" :endVal="available_num" :decimals="4" :duration="400"></u-count-to>
<text class="font-26">{{selectCurr.name}}</text>
</view>
<!-- <p class="font-26 color-333333">可用 {{available_num}} USDT</p> -->
<view class="borderBox" :style="'background-color: '+theme.fu_bg">
<view class="padding-22" v-html="transfer_text">
</view>
</view>
<view class="width-600 margin-50-auto">
<button @click="transfer" class="cu-btn loginBtn">{{i18n.assets.transfer.sure}}</button>
</view>
</view>
<u-picker @confirm="select" v-model="currType" mode="selector" :range="count_obj" range-key="name"
:confirm-text="i18n.assets.transfer.confirm" :cancel-text="i18n.assets.transfer.cancel"></u-picker>
</view>
</template>
<script>
export default {
data() {
return {
inputNum: '',
pay_pwd: '',
zhuanghu: [],
leftObj: {
id: 1,
name: '现货账户'
},
rightObj: {
id: 1,
name: '现货账户'
},
currList: [],
selectCurr: '',
selectIndex: '',
showPoup: '',
currType: false,
transfer_text: '',
animationName: '',
flag: true,
theme: '',
}
},
onLoad(e) {
console.log(e)
if(e.id){
if(e.id==1||e.id==0){
this.leftObj.id = 1
this.leftObj.name = this.i18n.assets.transfer.xh
this.rightObj.id = 2
this.rightObj.name = this.i18n.assets.transfer.fb
}
if(e.id==2){
this.leftObj.id = e.id
this.leftObj.name = this.i18n.assets.transfer.fb
this.rightObj.id = 1
this.rightObj.name = this.i18n.assets.transfer.xh
}
if(e.id==3){
this.leftObj.id = e.id
this.leftObj.name = this.i18n.assets.transfer.lh
this.rightObj.id = 1
this.rightObj.name = this.i18n.assets.transfer.xh
}
if(e.id==4){
this.leftObj.id = e.id
this.leftObj.name = this.i18n.assets.transfer.qq
this.rightObj.id = 1
this.rightObj.name = this.i18n.assets.transfer.xh
}
}
if(e.rightid){
this.leftObj.id = 1
this.leftObj.name = this.i18n.assets.transfer.xh
this.rightObj.id = e.rightid
this.rightObj.name = this.i18n.assets.transfer.qq
}
},
onShow() {
if (uni.getStorageSync("theme") == "dark") {
this.theme = this.$store.state.darkTheme
} else {
this.theme = this.$store.state.lightTheme
}
this.get_transfer()
},
computed: {
i18n() {
return this.$t('message');
},
available_num() {
if(this.leftObj.id==1){
return this.selectCurr.num || 0 //现货数量
}else if(this.leftObj.id==2){
return this.selectCurr.num_fb || 0 //现货数量
}else if(this.leftObj.id==3){
return this.selectCurr.num_lh || 0 //现货数量
}else if(this.leftObj.id==4){
return this.selectCurr.num_qq || 0 //现货数量
}else{
return 0;
}
},
count_obj() {
let obj = [];
var that = this
switch (this.showPoup) {
case 'currency':
obj = that.currList
break;
case 'accountL':
obj = that.zhuanghu.filter((item) => {
return item.id != that.rightObj.id&&item.id != that.leftObj.id
})
break;
case 'accountR':
obj = that.zhuanghu.filter((item) => {
return item.id != that.leftObj.id&&item.id != that.rightObj.id
})
break;
default:
obj = that.currList
break;
}
return obj
},
},
methods: {
get_transfer() {
this.post('/wallet/get_transfer').then((res) => {
console.log('划转内容', res)
if (res.code == 1) {
let currData = res.data.curr || []
// 确保 BTC 和 ETH 始终出现在币种列表中
let names = currData.map(c => (c.name || '').toUpperCase())
if (!names.includes('BTC')) {
currData.push({ curr_id: 'btc_static', name: 'BTC', num: 0, num_fb: 0, num_lh: 0, num_qq: 0 })
}
if (!names.includes('ETH')) {
currData.push({ curr_id: 'eth_static', name: 'ETH', num: 0, num_fb: 0, num_lh: 0, num_qq: 0 })
}
this.currList = currData
this.transfer_text = res.data.transfer_text
this.zhuanghu = res.data.zhuanghu
if (this.selectIndex) {
this.selectCurr = this.currList[this.selectIndex]
}
}
})
},
allIn() {
if (this.selectCurr.curr_id != undefined) {
this.inputNum = this.available_num
} else {
this.tos(this.i18n.assets.transfer.p0)
}
},
// 划转
transfer() {
if (!this.flag) return
console.log(this.selectCurr.curr_id)
if (this.selectCurr.curr_id == undefined) {
this.tos(this.i18n.assets.transfer.p0)
return
}
if (this.inputNum == '') {
this.tos(this.i18n.assets.transfer.inputNum)
return
}
if (Number(this.inputNum) > Number(this.available_num)) {
this.tos(this.i18n.assets.transfer.maxNum + this.available_num)
return
}
if (this.pay_pwd == '') {
this.tos(this.i18n.assets.transfer.inputPWD)
return
}
uni.showLoading({
title: this.i18n.assets.transfer.loading,
mask:true
})
this.flag = false
this.post('/wallet/transfer_sub', {
left_id: this.leftObj.id,
right_id: this.rightObj.id,
curr_id: this.selectCurr.curr_id,
num: this.inputNum,
pay_pwd: this.pay_pwd,
}).then((res) => {
console.log('划转提交', res)
this.flag = true
uni.hideLoading()
if (res.code == 1) {
this.tos(res.msg)
this.pay_pwd = ''
this.inputNum = ''
setTimeout(() => {
uni.navigateTo({
url: '/pages/asset/record'
})
}, 500)
}
})
},
exchange() {
if (this.animationName) return
this.animationName = 'XZ180'
this.inputNum = ''
let temp = this.leftObj
this.leftObj = this.rightObj
this.rightObj = temp
setTimeout(() => {
this.animationName = ''
}, 500)
},
select(index) {
if (this.showPoup == 'accountL') {
this.leftObj = this.count_obj[index]
console.log(this.leftObj.name)
}
if (this.showPoup == 'accountR') {
this.rightObj = this.count_obj[index]
console.log(this.rightObj.name)
}
if (this.showPoup == 'currency') {
this.selectIndex = index
this.selectCurr = this.currList[index]
this.inputNum = ''
console.log(this.selectCurr)
}
},
}
}
</script>
<style lang="scss">
.borderBox {
width: 690rpx;
// height: 260rpx;
margin: 22rpx auto;
// background: #FFFFFF;
box-shadow: 0rpx 3rpx 6rpx rgba(200, 200, 200, 0.16);
border-radius: 10rpx;
}
.XZ180 {
transition: all 0.5s;
transform: rotate(180deg);
}
.loginBtn {
width: 600rpx;
height: 96rpx;
background: #06C38D !important;
border-radius: 12rpx;
line-height: 96rpx;
color: #FFFFFF;
font-size: 32rpx;
text-align: center;
}
</style>