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
@@ -0,0 +1,196 @@
<template>
<view>
<view class="listBox" v-for="(item,index) in list" :key="index" :style="'background-color: '+background+';color: '+color">
<view class="width-100b height-100 flex align-center justify-between" style="border-bottom: 1px solid rgba(209,209,209,0.3)">
<view class="height-90 flex direction-column align-start justify-center">
<view class="flex align-center ">
<text v-if="currentIndex==4" class="font-28 bold-font margin-r-10">{{item.coinname}}</text>
<text class="font-28 bold-font numbold-font">{{item.type=='more'?i18n.cycle.long:i18n.cycle.short}}</text>
<text class="font-26 numbold-font" :style="'color:'+fu_color">{{item.coinname}}</text>
</view>
<text class="font-20 numbold-font" :style="'color:'+fu_color">{{item.createtime}}</text>
</view>
<text @click="setCheck(item.id,item.zy_price,item.zs_price)" v-if="currentIndex==1"
class="font-26 numbold-font weight-bold">{{i18n.cycle.set}}</text>
<button v-if="currentIndex==0" @click="revocation(item.id)" class="cu-btn loginBtn"
:style="'border: 1rpx solid '+color+';color: '+color">{{i18n.cycle.revoke}}</button>
<text v-if="currentIndex==4" class="font-26 color-0165EE">{{statusFilter(item.status)}}</text>
</view>
<view class="width-100b margin-t-10 flex flex-wrap">
<view style="width: 33%;" class="height-70 flex direction-column align-start justify-around">
<text class="font-26 nummedium-font">{{Number(item.price).toFixed(price_jd)}}</text>
<text class="font-24 nummedium-font" :style="'color:'+fu_color">{{i18n.cycle.unit}}</text>
</view>
<view style="width: 33%;" class="height-70 flex direction-column align-center justify-around">
<text class="font-26 nummedium-font">{{parseInt(item.num)}}*{{item.multiple}}</text>
<text class="font-24 nummedium-font" :style="'color:'+fu_color">{{i18n.cycle.beishu}}</text>
</view>
<view v-if="item.status==0||item.status==1" style="width: 33%;" class="height-70 flex direction-column align-end justify-around">
<text class="font-26 nummedium-font">{{nowPrice.toFixed(price_jd)}}</text>
<text class="font-24 nummedium-font" :style="'color:'+fu_color">{{i18n.cycle.currPrice}}</text>
</view>
<view v-if="item.status==2" style="width: 33%;" class="height-70 flex direction-column align-end justify-around">
<text class="font-26 nummedium-font">{{Number(item.pc_price).toFixed(price_jd)}}</text>
<text class="font-24 nummedium-font" :style="'color:'+fu_color">{{i18n.cycle.closing}}</text>
</view>
<view v-if="item.status==3" style="width: 33%;" class="height-70 flex direction-column align-end justify-around">
<text class="font-26 nummedium-font">{{item.updatetime}}</text>
<text class="font-24 nummedium-font" :style="'color:'+fu_color">{{i18n.cycle.revokeTime}}</text>
</view>
<view style="width: 33%;" class="margin-t-10 height-70 flex direction-column align-start justify-around">
<text class="font-26 nummedium-font">{{item.promise_fee}}</text>
<text class="font-24 nummedium-font" :style="'color:'+fu_color">{{i18n.cycle.margin}}</text>
</view>
<view style="width: 33%;" class="margin-t-10 height-70 flex direction-column align-center justify-around">
<text class="font-26 nummedium-font">{{item.fee}}</text>
<text class="font-24 nummedium-font" :style="'color:'+fu_color">{{i18n.cycle.service}}</text>
</view>
<view v-if="item.status==0||item.status==3" style="width: 33%;" class="margin-t-10 height-70 flex direction-column align-end justify-around">
<text class="font-26 nummedium-font">{{item.coinname}}</text>
<text class="font-24 nummedium-font" :style="'color:'+fu_color">{{i18n.cycle.currency}}</text>
</view>
<view v-if="item.status==1" style="width: 33%;" class="margin-t-10 height-70 flex direction-column align-end justify-around">
<text v-if="item.type=='more'" :class="nowPrice>=item.price?'color-00C481':'color-FF4040'" class="font-24 nummedium-font">{{((nowPrice - item.price)*item.num*shizhi).toFixed(6)}}</text>
<text v-if="item.type=='free'" :class="item.price>nowPrice?'color-00C481':'color-FF4040'" class="font-24 nummedium-font">{{((item.price - nowPrice)*item.num*shizhi).toFixed(6)}}</text>
<text class="font-24 nummedium-font" :style="'color:'+fu_color">{{i18n.cycle.profit}}</text>
</view>
<view v-if="item.status==2" style="width: 33%;" class="margin-t-10 height-70 flex direction-column align-end justify-around">
<text :class="item.income>=0?'color-00C481':'color-FF4040'" class="font-26 nummedium-font">{{item.income||0}}</text>
<text class="font-24 nummedium-font" :style="'color:'+fu_color">{{i18n.cycle.profit}}</text>
</view>
</view>
<view v-if="currentIndex==1" class="width-100b height-50 margin-t-10 flex align-center justify-end">
<button v-if="currentIndex==1" @click="closeOut(item.id)" class="cu-btn loginBtn1">{{i18n.cycle.close}}</button>
</view>
<view v-if="currentIndex==4" class="">
<view v-if="item.status==0" class="width-100b height-50 margin-t-10 flex align-center justify-end">
<button @click="revocation(item.id)" class="cu-btn loginBtn" :style="'color:'+color+';border: 1rpx solid '+color+';'">{{i18n.cycle.revoke}}</button>
</view>
<view v-if="item.status==1" class="width-100b height-50 margin-t-10 flex align-center justify-between">
<text @click="setCheck(item.id,item.zy_price,item.zs_price)" class="font-26 numbold-font weight-bold">{{i18n.cycle.set}}</text>
<button @click="closeOut(item.id)" class="cu-btn loginBtn1">{{i18n.cycle.close}}</button>
</view>
</view>
</view>
<view class="">
<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 v-if="!loading&&list.length==0" class="width-100b padding-c-50 flex direction-column align-center justify-center">
<text class="font-28 nummedium-font" :style="'color:'+fu_color">{{i18n.cycle.nodata}}</text>
</view>
</view>
</view>
</template>
<script>
export default {
name:'contractListItem',
props: {
//标题
list: {
type: Array,
default: []
},
currentIndex: {
type: Number,
default: 0
},
loading: {
type: Boolean,
default: false
},
nowPrice:{//币种当前价格
type: Number,
default: 0
},
shizhi:{//设备比例
type: Number,
default: 0
},
price_jd:{
type: Number,
default: 4
},
background:{
type: String,
default: '#ffffff'
},
color:{
type: String,
default: '#17181A'
},
fu_color:{
type: String,
default: '#B7B7B7'
}
},
data() {
return {
}
},
computed: {
i18n() {
return this.$t('message');
}
},
methods: {
statusFilter(index){
return this.i18n.cycle.tablist1State[index]
},
// 撤销
revocation(id) {
uni.showLoading({
mask:true
})
setTimeout(()=>{
uni.hideLoading()
this.$emit('revocation',id)
},2500)
},
// 平仓
closeOut(id) {
uni.showLoading({
mask:true
})
setTimeout(()=>{
uni.hideLoading()
this.$emit('closeOut',id)
},2500)
},
// 设置止盈止损
setCheck(id,zy_price,zs_price) {
this.$emit('setCheck',id,zy_price,zs_price)
},
}
}
</script>
<style scoped>
.listBox{
width: 100%;
/* height: 186rpx; */
padding: 20rpx 30rpx;
margin: 0 auto 20rpx;
/* background: #FFFFFF; */
}
.loginBtn{
width: 190rpx;
padding: 0 18rpx;
height: 48rpx;
background: rgba(0,0,0,0) !important;
border-radius: 4rpx;
font-size: 24rpx;
}
.loginBtn1{
width: 190rpx;
padding: 0 18rpx;
height: 48rpx;
border-radius: 4rpx;
color: #FFFFFF;
background: #3ECEB2 !important;
font-size: 24rpx;
}
</style>
+103
View File
@@ -0,0 +1,103 @@
<template>
<view class="">
<text :class="seconds<10?'warning_w':''" :style="'color:'+color" class="title">{{seconds<0?i18n.cycle.closeing:seconds+' s'}}</text>
</view>
</template>
<script>
export default {
name: 'countTime',
props: {
// 倒计时的时间,秒为单位
timestamp: {
type: [Number, String],
default: 0
},
// 是否自动开始倒计时
autoplay: {
type: Boolean,
default: true
},
color:{
type: String,
default: '#fff'
}
},
watch: {
// 监听时间戳的变化
timestamp(newVal, oldVal) {
// 如果倒计时间发生变化,清除定时器,重新开始倒计时
this.clearTimer();
this.start();
}
},
computed: {
i18n() {
return this.$t('message');
}
},
data() {
return {
timer: null ,// 定时器
seconds: 0, // 记录不停倒计过程中变化的秒数
};
},
mounted() {
// 如果自动倒计时
this.autoplay && this.timestamp && this.start();
},
methods: {
// 倒计时
start() {
// 避免可能出现的倒计时重叠情况
this.clearTimer();
if (this.timestamp <= 0) return;
this.seconds = Number(this.timestamp);
this.timer = setInterval(() => {
this.seconds--;
// 发出change事件
// this.$emit('change', this.seconds);
if (this.seconds < 0) {
return this.end();
}
}, 1000);
},
// 停止倒计时
end() {
this.clearTimer();
// 倒计时结束后等待2秒再刷新订单,因为服务器处理订单数据买卖需要时间
setTimeout(()=>{
this.$emit('end', {});
},2500)
},
// 清除定时器
clearTimer() {
if(this.timer) {
// 清除定时器
clearInterval(this.timer);
this.timer = null;
}
}
},
beforeDestroy() {
clearInterval(this.timer);
this.timer = null;
}
};
</script>
<style lang="scss">
.title{
font-size: 24rpx;
font-family: "NumMedium" !important;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.normal_w{
color: #fff;
}
.warning_w{
color: #FF4040;
}
</style>
@@ -0,0 +1,153 @@
<template>
<view>
<view class="listBox" v-for="(item,index) in list" :key="index" :style="'background-color: '+background+';color: '+color">
<view class="width-100b height-60 flex align-center justify-between" style="border-bottom: 1px solid rgba(209,209,209,0.3)">
<view class="height-90 flex direction-column align-start justify-center">
<view class="flex align-center ">
<text class="font-28 bold-font numbold-font">{{item.rise_or_fall=='rise'?i18n.cycle.up:i18n.cycle.down}}</text>
<text class="font-26 numbold-font" :style="'color:'+fu_color">{{item.show_name}}</text>
</view>
</view>
</view>
<view class="width-100b margin-t-10 flex flex-wrap">
<view style="width: 33%;" class="height-70 flex direction-column align-start justify-around">
<text class="font-26 nummedium-font">{{Number(item.current_price).toFixed(price_jd)}}</text>
<text class="font-24 nummedium-font" :style="'color:'+fu_color">{{i18n.cycle.unit}}</text>
</view>
<view style="width: 33%;" class="height-70 flex direction-column align-center justify-around">
<text class="font-26 nummedium-font">{{Number(item.trade_num).toFixed(price_jd)}}</text>
<text class="font-24 nummedium-font" :style="'color:'+fu_color">{{i18n.cycle.tradeNumber}}</text>
</view>
<view v-if="currentIndex==0" style="width: 33%;" class="height-70 flex direction-column align-end justify-around">
<!-- <text class="font-24 nummedium-font">{{timeCount(item.createtime+item.trade_cycle-item.nowtime)}}s</text> -->
<countTime @end="timeCount" :autoplay="true" :timestamp="item.createtime+item.trade_cycle-item.nowtime" ></countTime>
<text class="font-24 nummedium-font" :style="'color:'+fu_color">{{i18n.cycle.countTime}}</text>
</view>
<view v-if="currentIndex==1" style="width: 33%;" class="height-70 flex direction-column align-end justify-around">
<text class="font-26 nummedium-font">{{item.trade_cycle}}s</text>
<text class="font-24 nummedium-font" :style="'color:'+fu_color">{{i18n.cycle.tradingCycle}}</text>
</view>
<view v-if="currentIndex==0" style="width: 33%;" class="margin-t-10 height-70 flex direction-column align-start justify-around">
<text class="font-26 nummedium-font">{{Number(nowPrice).toFixed(price_jd)}}</text>
<text class="font-24 nummedium-font" :style="'color:'+fu_color">{{i18n.cycle.currPrice}}</text>
</view>
<view v-if="currentIndex==1" style="width: 33%;" class="margin-t-10 height-70 flex direction-column align-start justify-around">
<text class="font-26 nummedium-font">{{Number(item.close_price).toFixed(price_jd)}}</text>
<text class="font-24 nummedium-font" :style="'color:'+fu_color">{{i18n.cycle.closing}}</text>
</view>
<view style="width: 33%;" class="margin-t-10 height-70 flex direction-column align-center justify-around">
<text v-if="currentIndex==0" class="font-26 nummedium-font">{{item.open_time}}</text>
<text v-if="currentIndex==1" class="font-26 nummedium-font">{{item.createtime}}</text>
<text class="font-24 nummedium-font" :style="'color:'+fu_color">{{i18n.cycle.complete}}</text>
</view>
<view v-if="currentIndex==0" style="width: 33%;" class="margin-t-10 height-70 flex direction-column align-end justify-around">
<text v-if="item.rise_or_fall=='rise'" :class="nowPrice>item.current_price?'color-00C481':'color-FF4040'" class="font-24 nummedium-font">{{nowPrice>item.current_price?item.expect_income:'-'+item.trade_num}}</text>
<text v-if="item.rise_or_fall=='fall'" :class="item.current_price>nowPrice?'color-00C481':'color-FF4040'" class="font-24 nummedium-font">{{item.current_price>nowPrice?item.expect_income:'-'+item.trade_num}}</text>
<text class="font-24 nummedium-font" :style="'color:'+fu_color">{{i18n.cycle.profit}}</text>
</view>
<view v-if="currentIndex==1" style="width: 33%;" class="margin-t-10 height-70 flex direction-column align-end justify-around">
<text :class="item.trade_result=='win'?'color-00C481':'color-FF4040'" class="font-26 nummedium-font ">{{Number(item.trade_result_num).toFixed(price_jd)}}</text>
<text class="font-24 nummedium-font" :style="'color:'+fu_color">{{i18n.cycle.profit}}</text>
</view>
</view>
</view>
<view class="">
<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 v-if="!loading&&list.length==0"
class="width-100b padding-c-50 flex direction-column align-center justify-center">
<text class="font-28 nummedium-font" :style="'color:'+fu_color">{{i18n.cycle.nodata}}</text>
</view>
</view>
</view>
</template>
<script>
import countTime from './count-time.vue'
export default {
components: {
countTime,
},
name: 'secondListItem',
props: {
//标题
list: {
type: Array,
default: []
},
currentIndex: {
type: Number,
default: 0
},
loading: {
type: Boolean,
default: false
},
nowPrice: { //币种当前价格
type: Number,
default: 0
},
price_jd:{
type: Number,
default: 4
},
background:{
type: String,
default: '#ffffff'
},
color:{
type: String,
default: '#fff'
},
fu_color:{
type: String,
default: '#B7B7B7'
}
},
computed: {
i18n() {
return this.$t('message');
}
},
data() {
return {
}
},
methods: {
timeCount() {
this.$emit('timeOut');
}
}
}
</script>
<style scoped>
.listBox {
width: 100%;
/* height: 186rpx; */
padding: 20rpx 30rpx;
margin: 0 auto 20rpx;
/* background: #FFFFFF; */
}
.loginBtn {
width: 120rpx;
height: 48rpx;
background: #FFFFFF !important;
border: 1rpx solid #0165EE;
border-radius: 4rpx;
color: #0165EE;
font-size: 24rpx;
}
.loginBtn1 {
width: 120rpx;
height: 48rpx;
border-radius: 4rpx;
color: #FFFFFF;
background: #0165EE !important;
font-size: 24rpx;
}
</style>