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:
li
2026-04-05 13:05:27 +08:00
parent 4b2acdf0d8
commit 6b02df55ab
19 changed files with 245 additions and 514 deletions
+1 -1
View File
@@ -1046,7 +1046,7 @@ button.cuIcon.lg {
} }
.cu-load.over::after { .cu-load.over::after {
content: "没有更多了"; content: "No more data";
} }
.cu-load.erro::before { .cu-load.erro::before {
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name" : "H5", "name" : "H5",
"appid" : "__UNI__268C995", "appid" : "__UNI__227C71A",
"description" : "", "description" : "",
"versionName" : "1.0.0", "versionName" : "1.0.0",
"versionCode" : 100, "versionCode" : 100,
+27 -36
View File
@@ -92,6 +92,17 @@
</view> </view>
</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 余额 --> <!-- Fiat 余额 -->
<view @click="current=2" class="accountRow" :style="'background-color:'+theme.fu_bg+';color:'+theme.text"> <view @click="current=2" class="accountRow" :style="'background-color:'+theme.fu_bg+';color:'+theme.text">
<view class="flex align-center justify-between"> <view class="flex align-center justify-between">
@@ -119,7 +130,7 @@
</view> </view>
</view> </view>
<!-- Spot / Fiat / 理财 子页面 --> <!-- Spot / Fiat / Contract / Invest 子页面 -->
<view v-if="current==1||current==2||current==3||current==4" class=""> <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"> <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> <u-switch v-model="ifHideCoin" size="30" active-color="#2DD1AF"></u-switch>
@@ -167,7 +178,7 @@
data() { data() {
return { return {
statusBar: uni.getSystemInfoSync().statusBarHeight, statusBar: uni.getSystemInfoSync().statusBarHeight,
tabList: ['总览', '现货','法币','理财'], tabList: ['Overview', 'Spot','Fiat','Contract','Invest'],
current: 0, current: 0,
userinfo: {}, userinfo: {},
@@ -239,6 +250,9 @@
case 4: case 4:
obj = that.qq obj = that.qq
break; break;
case 5:
obj = that.all
break;
default: default:
obj = that.all obj = that.all
break; break;
@@ -276,13 +290,13 @@
break; break;
case 3: case 3:
if(that.ifHideCoin==true){ if(that.ifHideCoin==true){
if(that.lh.lh_arr){ if(that.lh && that.lh.lh_arr){
obj = that.lh.lh_arr.filter((item)=>{ obj = that.lh.lh_arr.filter((item)=>{
return item.num != 0 return item.num != 0
}) })
} }
}else{ }else{
obj = that.lh.lh_arr obj = (that.lh && that.lh.lh_arr) ? that.lh.lh_arr : []
} }
break; break;
case 4: case 4:
@@ -317,13 +331,13 @@
this.tabList[0]=this.i18n.assets.index.title1 this.tabList[0]=this.i18n.assets.index.title1
this.tabList[1]=this.i18n.assets.index.title2 this.tabList[1]=this.i18n.assets.index.title2
this.tabList[2]=this.i18n.assets.index.title3 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')){ if(uni.getStorageSync('ifHideCoin')){
this.ifHideCoin = uni.getStorageSync('ifHideCoin') this.ifHideCoin = uni.getStorageSync('ifHideCoin')
} }
this.getWallet() this.getWallet()
this.getUserInfo() this.getUserInfo()
this.calcProfit()
}, },
methods: { methods: {
formatNum(val) { formatNum(val) {
@@ -350,35 +364,8 @@
}) })
}, },
calcProfit() { calcProfit() {
// 从资金流水计算盈亏 // totalPnl 固定为 0,不作计算
this.post('/wallet/index_detail', { // totalProfit 由 getWallet 从后端同步
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(){ getWallet(){
this.post('/wallet/wallet_index').then((res) => { this.post('/wallet/wallet_index').then((res) => {
@@ -389,6 +376,10 @@
this.fb = res.data.fb this.fb = res.data.fb
this.lh = res.data.lh this.lh = res.data.lh
this.qq = res.data.qq 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) { tabsChange(index) {
if(index==3){ if(index==4){
uni.navigateTo({ uni.navigateTo({
url:'/pages/index/money/index' url:'/pages/index/money/index'
}) })
+58 -27
View File
@@ -99,11 +99,11 @@
zhuanghu: [], zhuanghu: [],
leftObj: { leftObj: {
id: 1, id: 1,
name: '现货账户' name: 'Spot'
}, },
rightObj: { rightObj: {
id: 1, id: 3,
name: '现货账户' name: 'Contract'
}, },
currList: [], currList: [],
@@ -126,34 +126,34 @@
if(e.id){ if(e.id){
if(e.id==1||e.id==0){ if(e.id==1||e.id==0){
this.leftObj.id = 1 this.leftObj.id = 1
this.leftObj.name = this.i18n.assets.transfer.xh this.leftObj.name = 'Spot'
this.rightObj.id = 2 this.rightObj.id = 3
this.rightObj.name = this.i18n.assets.transfer.fb this.rightObj.name = 'Contract'
} }
if(e.id==2){ if(e.id==2){
this.leftObj.id = e.id this.leftObj.id = e.id
this.leftObj.name = this.i18n.assets.transfer.fb this.leftObj.name = 'Fiat'
this.rightObj.id = 1 this.rightObj.id = 1
this.rightObj.name = this.i18n.assets.transfer.xh this.rightObj.name = 'Spot'
} }
if(e.id==3){ if(e.id==3){
this.leftObj.id = e.id this.leftObj.id = e.id
this.leftObj.name = this.i18n.assets.transfer.lh this.leftObj.name = 'Contract'
this.rightObj.id = 1 this.rightObj.id = 1
this.rightObj.name = this.i18n.assets.transfer.xh this.rightObj.name = 'Spot'
} }
if(e.id==4){ if(e.id==4){
this.leftObj.id = e.id this.leftObj.id = e.id
this.leftObj.name = this.i18n.assets.transfer.qq this.leftObj.name = 'Quantitative'
this.rightObj.id = 1 this.rightObj.id = 1
this.rightObj.name = this.i18n.assets.transfer.xh this.rightObj.name = 'Spot'
} }
} }
if(e.rightid){ if(e.rightid){
this.leftObj.id = 1 this.leftObj.id = 1
this.leftObj.name = this.i18n.assets.transfer.xh this.leftObj.name = 'Spot'
this.rightObj.id = e.rightid this.rightObj.id = Number(e.rightid)
this.rightObj.name = this.i18n.assets.transfer.qq this.rightObj.name = this.getAccountName(Number(e.rightid))
} }
}, },
onShow() { onShow() {
@@ -207,19 +207,33 @@
let rate = parseFloat(this.selectCurr.exchange) || 0 let rate = parseFloat(this.selectCurr.exchange) || 0
if (rate <= 0) return '' if (rate <= 0) return ''
if (this.rightObj.id == 3) { if (this.rightObj.id == 3) {
// 现货→合约:输入BTC/ETH数量,显示USDT等值 // Spot→Contract:输入BTC/ETH数量,显示USDT等值
return (this.inputNum * rate).toFixed(2) + ' USDT (合约)' return (this.inputNum * rate).toFixed(2) + ' USDT (Contract)'
} else { } else {
// 合约→现货:输入USDT数量,显示BTC/ETH等值 // Contract→Spot:输入USDT数量,显示BTC/ETH等值
return (this.inputNum / rate).toFixed(8) + ' ' + this.selectCurr.name + ' (现货)' return (this.inputNum / rate).toFixed(8) + ' ' + this.selectCurr.name + ' (Spot)'
} }
}, },
// 根据来源账户过滤可选货币
filteredCurrList() {
if (!this.currList || this.currList.length === 0) return []
if (this.leftObj.id == 3) {
// 合约账户转出 → 只显示USDT
return this.currList.filter(c => {
return c.curr_id == 1 || (c.name || '').toUpperCase() === 'USDT'
})
}
// 现货账户转出 → 只显示 BTC / ETH / USDT
return this.currList.filter(c => {
return ['BTC', 'ETH', 'USDT'].includes((c.name || '').toUpperCase())
})
},
count_obj() { count_obj() {
let obj = []; let obj = [];
var that = this var that = this
switch (this.showPoup) { switch (this.showPoup) {
case 'currency': case 'currency':
obj = that.currList obj = that.filteredCurrList
break; break;
case 'accountL': case 'accountL':
obj = that.zhuanghu.filter((item) => { obj = that.zhuanghu.filter((item) => {
@@ -232,13 +246,18 @@
}) })
break; break;
default: default:
obj = that.currList obj = that.filteredCurrList
break; break;
} }
return obj return obj
}, },
}, },
methods: { methods: {
// 账户ID → 英文名称映射
getAccountName(id) {
const map = {1:'Spot', 2:'Fiat', 3:'Contract', 4:'Quantitative'}
return map[id] || 'Account'
},
get_transfer() { get_transfer() {
this.post('/wallet/get_transfer').then((res) => { this.post('/wallet/get_transfer').then((res) => {
console.log('划转内容', res) console.log('划转内容', res)
@@ -247,14 +266,19 @@
// 确保 BTC 和 ETH 始终出现在币种列表中 // 确保 BTC 和 ETH 始终出现在币种列表中
let names = currData.map(c => (c.name || '').toUpperCase()) let names = currData.map(c => (c.name || '').toUpperCase())
if (!names.includes('BTC')) { if (!names.includes('BTC')) {
currData.push({ curr_id: 'btc_static', name: 'BTC', num: 0, num_fb: 0, num_lh: 0, num_qq: 0 }) currData.push({ curr_id: 3, name: 'BTC', num: 0, num_fb: 0, num_lh: 0, num_qq: 0 })
} }
if (!names.includes('ETH')) { if (!names.includes('ETH')) {
currData.push({ curr_id: 'eth_static', name: 'ETH', num: 0, num_fb: 0, num_lh: 0, num_qq: 0 }) currData.push({ curr_id: 4, name: 'ETH', num: 0, num_fb: 0, num_lh: 0, num_qq: 0 })
} }
this.currList = currData this.currList = currData
this.transfer_text = res.data.transfer_text this.transfer_text = res.data.transfer_text
this.zhuanghu = res.data.zhuanghu // 统一将账户名称英文化
const nameMap = {1:'Spot', 2:'Fiat', 3:'Contract', 4:'Quantitative'}
this.zhuanghu = (res.data.zhuanghu || []).map(item => ({
...item,
name: nameMap[item.id] || item.name
}))
if (this.selectIndex) { if (this.selectIndex) {
this.selectCurr = this.currList[this.selectIndex] this.selectCurr = this.currList[this.selectIndex]
} }
@@ -328,16 +352,23 @@
}, },
select(index) { select(index) {
if (this.showPoup == 'accountL') { if (this.showPoup == 'accountL') {
this.leftObj = this.count_obj[index] let item = this.count_obj[index]
this.leftObj = { id: item.id, name: this.getAccountName(item.id) }
// 切换来源账户后清空已选币种
this.selectCurr = ''
this.selectIndex = ''
this.inputNum = ''
console.log(this.leftObj.name) console.log(this.leftObj.name)
} }
if (this.showPoup == 'accountR') { if (this.showPoup == 'accountR') {
this.rightObj = this.count_obj[index] let item = this.count_obj[index]
this.rightObj = { id: item.id, name: this.getAccountName(item.id) }
this.inputNum = ''
console.log(this.rightObj.name) console.log(this.rightObj.name)
} }
if (this.showPoup == 'currency') { if (this.showPoup == 'currency') {
this.selectIndex = index this.selectIndex = index
this.selectCurr = this.currList[index] this.selectCurr = this.filteredCurrList[index]
this.inputNum = '' this.inputNum = ''
console.log(this.selectCurr) console.log(this.selectCurr)
} }
+4 -4
View File
@@ -326,19 +326,19 @@
XZ: '/static/imgs/quantify/xuanzhong@2x.png', XZ: '/static/imgs/quantify/xuanzhong@2x.png',
ispay: false, //支付方式弹窗 ispay: false, //支付方式弹窗
payid: 0, //选择的支付方式 payid: 0, //选择的支付方式
payname: '支付方式', payname: 'Payment Method',
paylist: [{ paylist: [{
id: 0, id: 0,
name: '全部' name: 'All'
}, },
{ {
id: 1, id: 1,
name: '银行卡' name: 'Bank Card'
} }
], ],
isnum: false, //交易金额弹窗 isnum: false, //交易金额弹窗
payprice: '', //交易金额 payprice: '', //交易金额
paypriceval: '交易金额', //交易金额文显 paypriceval: 'Transaction Amount',
number: '', number: '',
paypwd: '', paypwd: '',
+30
View File
@@ -891,4 +891,34 @@
.swiper-container ::v-deep .u-swiper-indicator { .swiper-container ::v-deep .u-swiper-indicator {
display: none !important; display: none !important;
} }
/* ========== PC 端适配 — 全宽拉伸 ========== */
@media screen and (min-width: 768px) {
.width-750 {
width: 100% !important;
max-width: 100% !important;
}
.notice-container {
width: calc(100% - 60px) !important;
max-width: 100% !important;
margin: 0 30px 8px 30px !important;
}
.follow-section {
width: calc(100% - 60px) !important;
max-width: 100% !important;
margin: 0 30px !important;
}
.function-area {
width: 100% !important;
max-width: 100% !important;
}
.swiper-container {
width: 100% !important;
max-width: 100% !important;
}
}
</style> </style>
+7 -7
View File
@@ -88,32 +88,32 @@
show: false, show: false,
kindlist1: [{ kindlist1: [{
id: 1, id: 1,
name: '买入' name: 'Buy'
}, },
{ {
id: 2, id: 2,
name: '卖出' name: 'Sell'
} }
], ],
kindlist2: [{ kindlist2: [{
id: 1, id: 1,
name: '待付款' name: 'Pending Payment'
}, },
{ {
id: 2, id: 2,
name: '已付款' name: 'Paid'
}, },
{ {
id: 3, id: 3,
name: '申诉中' name: 'Appealing'
}, },
{ {
id: 4, id: 4,
name: '已完成' name: 'Completed'
}, },
{ {
id: 5, id: 5,
name: '已取消' name: 'Cancelled'
} }
], ],
kind1: '', kind1: '',
+1 -14
View File
@@ -17,19 +17,6 @@
<!-- 身体 --> <!-- 身体 -->
<view class="width-750"> <view class="width-750">
<view class="height-305 bgimg2 padding-t-10 padding-w-30"> <view class="height-305 bgimg2 padding-t-10 padding-w-30">
<!-- 币种 -->
<view style="background-color: rgba(255,255,255,0);"
class="width-100b height-96 radiu-20 padding-w-32 flex align-center justify-between">
<view @click="current=2,voucher_image='',voucher_image_up=''" class="padding-w-18 height-78 radiu-20 text-center line-height-78"
:style="'background-color: '+theme.fu_bg+';color: '+theme.text">
<text :class="current==2?'color-0165EE':''" class="font-28">{{i18n.fastRecord.text9}}</text>
</view>
<view @click="current=1,voucher_image='',voucher_image_up=''" class="padding-w-18 height-78 radiu-20 text-center line-height-78"
:style="'background-color: '+theme.fu_bg+';color: '+theme.text">
<text :class="current==1?'color-0165EE':''" class="font-28">{{i18n.fastRecord.tos2}}</text>
</view>
</view>
<view class=""> <view class="">
<view v-if="current==2" :style="'background-color: '+theme.fu_bg+';color: '+theme.text" <view v-if="current==2" :style="'background-color: '+theme.fu_bg+';color: '+theme.text"
class="width-100b radiu-20 padding-w-32 margin-t-20"> class="width-100b radiu-20 padding-w-32 margin-t-20">
@@ -210,7 +197,7 @@
data() { data() {
return { return {
statusBar: uni.getSystemInfoSync().statusBarHeight, statusBar: uni.getSystemInfoSync().statusBarHeight,
current: 2, current: 1,
show: false, show: false,
bankshow:false, bankshow:false,
+2 -2
View File
@@ -268,9 +268,9 @@
code_m: '', code_m: '',
code_g: '', code_g: '',
flag: true, flag: true,
time: '获取验证码', time: 0,
timeFlag: true, timeFlag: true,
time2: '获取验证码', time2: 0,
timeFlag2: true, timeFlag2: true,
email: '', email: '',
mobile: '', mobile: '',
+1 -1
View File
@@ -55,7 +55,7 @@
pwd2: '', pwd2: '',
captcha: '', captcha: '',
flag: true, flag: true,
time: '获取验证码', time: 0,
timeFlag: true, timeFlag: true,
theme: '', theme: '',
+11 -7
View File
@@ -47,16 +47,18 @@
<!-- 邀请码 --> <!-- 邀请码 -->
<view class="regField"> <view class="regField">
<text class="regLabel">{{i18n.regist.invitation}}</text> <text class="regLabel">{{i18n.regist.invitation}}</text>
<view class="regInputBox"> <view class="regInputBox" :style="codeFromLink?'opacity:0.6':''">
<input class="regInput" type="text" v-model="referral_code" :placeholder="i18n.regist.invitationTag" /> <input class="regInput" type="text" v-model="referral_code"
:disabled="codeFromLink"
:placeholder="i18n.regist.invitationTag" />
</view> </view>
</view> </view>
<!-- 验证码 --> <!-- 验证码 -->
<view class="regField"> <view class="regField">
<text class="regLabel">{{i18n.regist.code}}</text> <text class="regLabel">Verification Code</text>
<view class="regInputBox regInputRow"> <view class="regInputBox regInputRow">
<input class="regInput" type="number" v-model="code" :placeholder="i18n.regist.codeTag" /> <input class="regInput" type="text" v-model="code" :placeholder="i18n.regist.codeTag" />
<image class="regCaptchaImg" :src="captchaImg" mode="aspectFit" @click="loadCaptcha()"></image> <image class="regCaptchaImg" :src="captchaImg" mode="aspectFit" @click="loadCaptcha()"></image>
<text class="regCaptchaRefresh" @click="loadCaptcha()"></text> <text class="regCaptchaRefresh" @click="loadCaptcha()"></text>
</view> </view>
@@ -93,6 +95,7 @@
password2: '', password2: '',
code: '', code: '',
referral_code: '', referral_code: '',
codeFromLink: false,
flag: true, flag: true,
agreed: false, agreed: false,
theme: '', theme: '',
@@ -106,9 +109,10 @@
} }
}, },
onLoad(e) { onLoad(e) {
// 代理专属注册链接: 自动填入邀请码 // 代理专属注册链接: 自动填入邀请码并锁定
if (e && e.code) { if (e && e.code) {
this.referral_code = e.code this.referral_code = e.code
this.codeFromLink = true // 锁定,不允许用户修改
} }
this.loadCaptcha() this.loadCaptcha()
}, },
@@ -263,8 +267,8 @@
} }
.regCaptchaImg { .regCaptchaImg {
width: 200rpx; width: 240rpx;
height: 60rpx; height: 80rpx;
margin-left: 18rpx; margin-left: 18rpx;
flex: 0 0 auto; flex: 0 0 auto;
border-radius: 6rpx; border-radius: 6rpx;
+5 -5
View File
@@ -88,26 +88,26 @@
export default { export default {
data() { data() {
return { return {
time: '获取验证码', time: 0,
timeFlag: true, timeFlag: true,
time2: '获取验证码', time2: 0,
timeFlag2: true, timeFlag2: true,
email: '', email: '',
mobile: '', mobile: '',
list: [{ list: [{
id: 1, id: 1,
name: '只读', name: 'Read Only',
type: false, type: false,
}, },
{ {
id: 2, id: 2,
name: '提现', name: 'Withdraw',
type: false, type: false,
}, },
{ {
id: 3, id: 3,
name: '交易', name: 'Trade',
type: false, type: false,
} }
], ],
+1 -1
View File
@@ -77,7 +77,7 @@
code: '', code: '',
kaiqiChina:true, kaiqiChina:true,
flag: true, flag: true,
time: '获取验证码', time: 0,
timeFlag: true, timeFlag: true,
theme: '', theme: '',
+43 -200
View File
@@ -2,51 +2,6 @@
<view :style="'background-color: '+theme.bg+';color: '+theme.text" style="height: 100vh;"> <view :style="'background-color: '+theme.bg+';color: '+theme.text" style="height: 100vh;">
<myNav :title="i18n.mine.safety.logpwd"></myNav> <myNav :title="i18n.mine.safety.logpwd"></myNav>
<!-- tab选择 -->
<view class="padding-w-40">
<view class="height-52 flex align-center justify-between">
<view @click="tabsChange(index)" class="flex-1 height-52 flex align-center justify-center"
v-for="(item,index) in tablist" :key="index">
<text :class="current==index?'':'color-C3C3C3'"
class="bold-font font-30">{{item}}</text>
</view>
</view>
<view class="height-20 relative">
<view :style="current==0?'left: 142rpx;':'left: 482rpx;'" class="heng"></view>
</view>
</view>
<view v-if="current==0" class="listBox">
<view class="width-100b height-96 line-height-96">
<text class="font-30 bold-font">{{i18n.mine.safety.email}}</text>
</view>
<view class="width-100b height-96 line-height-96">
<text class="font-30 numbold-font color-999999">{{email||i18n.mine.safety.nobangding}}</text>
</view>
</view>
<view v-if="current==1" class="listBox">
<view class="width-100b height-96 line-height-96">
<text class="font-30 bold-font">{{i18n.mine.safety.mobile}}</text>
</view>
<view class="width-100b height-96 flex align-center">
<view class="width-80 height-46 flex align-center justify-center" style="border: 1rpx solid #3ECEB2;border-radius: 6rpx;">
<text class="font-30 numbold-font">+{{seleCountry.value}}</text>
</view>
<text class="font-30 numbold-font color-999999">{{phone||i18n.mine.safety.nobangding}}</text>
</view>
</view>
<view class="listBox">
<view class="width-100b height-96 line-height-96">
<text class="font-30 bold-font">{{i18n.mine.safety.code}}</text>
</view>
<view class="width-100b height-96 flex align-center justify-between">
<input class="flex-1 height-96 font-30 numbold-font" type="text" v-model="captcha"
:placeholder="i18n.mine.safety.codeTag" />
<text @click="cutTime()" class="font-30 bold-font color-0165EE">{{codeText}}</text>
</view>
</view>
<view class="listBox"> <view class="listBox">
<view class="width-100b height-96 line-height-96"> <view class="width-100b height-96 line-height-96">
<text class="font-30 bold-font">{{i18n.mine.safety.logpwd1}}</text> <text class="font-30 bold-font">{{i18n.mine.safety.logpwd1}}</text>
@@ -67,59 +22,43 @@
</view> </view>
</view> </view>
<button @click="forgot" class="cu-btn loginBtn">{{i18n.mine.safety.queren}}</button> <!-- 图形验证码 -->
<view class="listBox">
<view class="width-100b height-96 line-height-96">
<text class="font-30 bold-font">Verification Code</text>
</view>
<view class="width-100b height-96 flex align-center justify-between">
<input class="flex-1 height-96 font-30 numbold-font" type="text" v-model="captchaCode"
placeholder="Enter code" />
<image class="captchaImg" :src="captchaImg" mode="aspectFit" @click="loadCaptcha()"></image>
<text class="font-36 color-0165EE margin-left-sm" @click="loadCaptcha()"></text>
</view>
</view>
<u-picker @columnchange="change" @confirm="selectCountry" v-model="countryType" mode="selector" range-key="name" <button @click="forgot" class="cu-btn loginBtn">{{i18n.mine.safety.queren}}</button>
:range="rangelist" :confirm-text="i18n.cycle.confirm" :cancel-text="i18n.cycle.cancel"
:kaiqiChina="kaiqiChina"></u-picker>
</view> </view>
</template> </template>
<script> <script>
import {
country
} from '../../../components/country.js'
export default { export default {
data() { data() {
return { return {
current: 0,
tablist: ['邮箱', '电话'],
countryType: false,
rangelist: country,
seleCountry: {
value:''
},
phone: '',
email: '',
pwd1: '', pwd1: '',
pwd2: '', pwd2: '',
captcha: '', captchaCode: '',
kaiqiChina: true, captchaKey: '',
captchaImg: '',
flag: true, flag: true,
time: '获取验证码', theme: ''
timeFlag: true,
theme:''
} }
}, },
computed: { computed: {
i18n() { i18n() {
return this.$t('message'); return this.$t('message');
},
codeText() {
if (this.time > 0) {
return this.time + " s"
} else {
return this.i18n.mine.safety.get
}
} }
}, },
onLoad() { onLoad() {
// this.seleCountry = this.rangelist[0] this.loadCaptcha()
this.tablist = this.i18n.mine.safety.tablist
this.getUserinfo()
}, },
onShow() { onShow() {
if (uni.getStorageSync("theme") == "dark") { if (uni.getStorageSync("theme") == "dark") {
@@ -129,37 +68,19 @@
} }
}, },
methods: { methods: {
change(index) { loadCaptcha() {
// console.log(index) this.post('/common/captcha', {}).then(res => {
if (index == 1) {
this.kaiqiChina = false
} else {
this.kaiqiChina = true
}
},
getUserinfo() {
this.post('/my/get_userinfo').then((res) => {
console.log('用户信息', res)
if (res.code == 1) { if (res.code == 1) {
this.phone = res.data.mobile this.captchaImg = res.data.captcha_img
this.email = res.data.email this.captchaKey = res.data.captcha_key
this.seleCountry.value = res.data.m_prefix this.captchaCode = ''
} }
}) })
}, },
selectCountry(index) {
console.log(index)
this.seleCountry = this.rangelist[index]
},
// tabs通知swiper切换
tabsChange(index) {
this.current = index;
},
forgot() { forgot() {
if (!this.flag) return if (!this.flag) return
if (this.captchaCode == '') {
if (this.captcha == '') { this.tos('Please enter verification code')
this.tos(this.i18n.mine.safety.codeTag)
return return
} }
if (this.pwd1 == '') { if (this.pwd1 == '') {
@@ -174,117 +95,39 @@
this.tos(this.i18n.mine.safety.lp3) this.tos(this.i18n.mine.safety.lp3)
return return
} }
uni.showLoading({ uni.showLoading({ title: this.i18n.mine.safety.loading, mask: true })
title: this.i18n.mine.safety.loading,
mask: true
})
var obj = {}
if (this.current == 0) {
obj = {
newpassword: this.pwd2,
captcha: this.captcha,
types: 'pwd',
type: 'email'
}
}
if (this.current == 1) {
obj = {
newpassword: this.pwd2,
captcha: this.captcha,
types: 'pwd',
type: 'mobile'
}
}
this.flag = false this.flag = false
this.post('/user/xiugaipwd', obj).then(res => { this.post('/user/xiugaipwd', {
console.log(res) newpassword: this.pwd2,
captcha: this.captchaCode,
captcha_key: this.captchaKey,
types: 'pwd'
}).then(res => {
uni.hideLoading() uni.hideLoading()
this.flag = true this.flag = true
if (res.code == 1) { if (res.code == 1) {
this.tos(res.msg) this.tos(res.msg)
setTimeout(() => { setTimeout(() => {
uni.reLaunch({ uni.reLaunch({ url: '/pages/login/index' })
url: '/pages/login/index'
})
}, 500) }, 500)
} else {
this.loadCaptcha()
} }
}) })
},
cutTime() {
if (!this.timeFlag) return
if (this.current == 0) {
if (this.email == "") {
this.tos(this.i18n.mine.safety.nobangding)
return
}
uni.showLoading({
title: this.i18n.regist.loading,
mask: true
})
this.timeFlag = false
this.post('/ems/send', {
email: this.email,
event: "resetpwd",
}).then(res => {
uni.hideLoading()
if (res.code == 1) {
this.tos(res.msg)
this.time = 120
var that = this
let timeName = setInterval(() => {
if (that.time > 0) {
that.time--
} else {
that.time = 0
that.timeFlag = true
clearInterval(timeName)
}
}, 1000)
} else {
this.timeFlag = true
}
})
}
if (this.current == 1) {
if (this.phone == "") {
this.tos(this.i18n.mine.safety.nobangding)
return
}
uni.showLoading({
title: this.i18n.regist.loading,
mask: true
})
this.timeFlag = false
this.post('/sms/send', {
mobile: this.phone,
m_prefix:this.seleCountry.value,
event: "resetpwd",
}).then(res => {
uni.hideLoading()
if (res.code == 1) {
this.tos(res.msg)
this.time = 60
var that = this
let timeName = setInterval(() => {
if (that.time > 0) {
that.time--
} else {
that.time = 0
that.timeFlag = true
clearInterval(timeName)
}
}, 1000)
} else {
this.timeFlag = true
}
})
}
} }
} }
} }
</script> </script>
<style> <style>
.captchaImg {
width: 240rpx;
height: 80rpx;
margin-left: 18rpx;
flex: 0 0 auto;
border-radius: 6rpx;
}
.listBox { .listBox {
width: 100%; width: 100%;
/* height: 96rpx; */ /* height: 96rpx; */
+42 -197
View File
@@ -2,51 +2,6 @@
<view :style="'background-color: '+theme.bg+';color: '+theme.text" style="height: 100vh;"> <view :style="'background-color: '+theme.bg+';color: '+theme.text" style="height: 100vh;">
<myNav :title="i18n.mine.safety.paypwd"></myNav> <myNav :title="i18n.mine.safety.paypwd"></myNav>
<!-- tab选择 -->
<view class="padding-w-40">
<view class="height-52 flex align-center justify-between">
<view @click="tabsChange(index)" class="flex-1 height-52 flex align-center justify-center"
v-for="(item,index) in tablist" :key="index">
<text :class="current==index?'':'color-C3C3C3'"
class="bold-font font-30">{{item}}</text>
</view>
</view>
<view class="height-20 relative">
<view :style="current==0?'left: 142rpx;':'left: 482rpx;'" class="heng"></view>
</view>
</view>
<view v-if="current==0" class="listBox">
<view class="width-100b height-96 line-height-96">
<text class="font-30 bold-font">{{i18n.mine.safety.email}}</text>
</view>
<view class="width-100b height-96 line-height-96">
<text class="font-30 numbold-font color-999999">{{email||i18n.mine.safety.nobangding}}</text>
</view>
</view>
<view v-if="current==1" class="listBox">
<view class="width-100b height-96 line-height-96">
<text class="font-30 bold-font">{{i18n.mine.safety.mobile}}</text>
</view>
<view class="width-100b height-96 flex align-center">
<view class="width-80 height-46 flex align-center justify-center" style="border: 1rpx solid #3ECEB2;border-radius: 6rpx;">
<text class="font-30 numbold-font">+{{seleCountry.value}}</text>
</view>
<text class="font-30 numbold-font color-999999">{{phone||i18n.mine.safety.nobangding}}</text>
</view>
</view>
<view class="listBox">
<view class="width-100b height-96 line-height-96">
<text class="font-30 bold-font">{{i18n.mine.safety.code}}</text>
</view>
<view class="width-100b height-96 flex align-center justify-between">
<input class="flex-1 height-96 font-30 numbold-font" type="text" v-model="captcha"
:placeholder="i18n.mine.safety.codeTag" />
<text @click="cutTime()" class="font-30 bold-font color-0165EE">{{codeText}}</text>
</view>
</view>
<view class="listBox"> <view class="listBox">
<view class="width-100b height-96 line-height-96"> <view class="width-100b height-96 line-height-96">
<text class="font-30 bold-font">{{i18n.mine.safety.logpwd1}}</text> <text class="font-30 bold-font">{{i18n.mine.safety.logpwd1}}</text>
@@ -67,59 +22,43 @@
</view> </view>
</view> </view>
<button @click="forgot" class="cu-btn loginBtn">{{i18n.mine.safety.queren}}</button> <!-- 图形验证码 -->
<view class="listBox">
<view class="width-100b height-96 line-height-96">
<text class="font-30 bold-font">Verification Code</text>
</view>
<view class="width-100b height-96 flex align-center justify-between">
<input class="flex-1 height-96 font-30 numbold-font" type="text" v-model="captchaCode"
placeholder="Enter code" />
<image class="captchaImg" :src="captchaImg" mode="aspectFit" @click="loadCaptcha()"></image>
<text class="font-36 color-0165EE margin-left-sm" @click="loadCaptcha()"></text>
</view>
</view>
<u-picker @columnchange="change" @confirm="selectCountry" v-model="countryType" mode="selector" range-key="name" <button @click="forgot" class="cu-btn loginBtn">{{i18n.mine.safety.queren}}</button>
:range="rangelist" :confirm-text="i18n.cycle.confirm" :cancel-text="i18n.cycle.cancel"
:kaiqiChina="kaiqiChina"></u-picker>
</view> </view>
</template> </template>
<script> <script>
import {
country
} from '../../../components/country.js'
export default { export default {
data() { data() {
return { return {
current: 0,
tablist: ['邮箱', '电话'],
countryType: false,
rangelist: country,
seleCountry: {
value:''
},
phone: '',
email: '',
pwd1: '', pwd1: '',
pwd2: '', pwd2: '',
captcha: '', captchaCode: '',
kaiqiChina: true, captchaKey: '',
captchaImg: '',
flag: true, flag: true,
time: '获取验证码', theme: ''
timeFlag: true,
theme:''
} }
}, },
computed: { computed: {
i18n() { i18n() {
return this.$t('message'); return this.$t('message');
},
codeText() {
if (this.time > 0) {
return this.time + " s"
} else {
return this.i18n.mine.safety.get
}
} }
}, },
onLoad() { onLoad() {
// this.seleCountry = this.rangelist[0] this.loadCaptcha()
this.tablist = this.i18n.mine.safety.tablist
this.getUserinfo()
}, },
onShow() { onShow() {
if (uni.getStorageSync("theme") == "dark") { if (uni.getStorageSync("theme") == "dark") {
@@ -129,37 +68,19 @@
} }
}, },
methods: { methods: {
change(index) { loadCaptcha() {
// console.log(index) this.post('/common/captcha', {}).then(res => {
if (index == 1) {
this.kaiqiChina = false
} else {
this.kaiqiChina = true
}
},
getUserinfo() {
this.post('/my/get_userinfo').then((res) => {
console.log('用户信息', res)
if (res.code == 1) { if (res.code == 1) {
this.phone = res.data.mobile this.captchaImg = res.data.captcha_img
this.email = res.data.email this.captchaKey = res.data.captcha_key
this.seleCountry.value = res.data.m_prefix this.captchaCode = ''
} }
}) })
}, },
selectCountry(index) {
console.log(index)
this.seleCountry = this.rangelist[index]
},
// tabs通知swiper切换
tabsChange(index) {
this.current = index;
},
forgot() { forgot() {
if (!this.flag) return if (!this.flag) return
if (this.captchaCode == '') {
if (this.captcha == '') { this.tos('Please enter verification code')
this.tos(this.i18n.mine.safety.codeTag)
return return
} }
if (this.pwd1 == '') { if (this.pwd1 == '') {
@@ -174,30 +95,14 @@
this.tos(this.i18n.mine.safety.lp3) this.tos(this.i18n.mine.safety.lp3)
return return
} }
uni.showLoading({ uni.showLoading({ title: this.i18n.mine.safety.loading, mask: true })
title: this.i18n.mine.safety.loading,
mask: true
})
var obj = {}
if (this.current == 0) {
obj = {
newpassword: this.pwd2,
captcha: this.captcha,
types: 'pay_pwd',
type: 'email'
}
}
if (this.current == 1) {
obj = {
newpassword: this.pwd2,
captcha: this.captcha,
types: 'pay_pwd',
type: 'mobile'
}
}
this.flag = false this.flag = false
this.post('/user/xiugaipwd', obj).then(res => { this.post('/user/xiugaipwd', {
console.log(res) newpassword: this.pwd2,
captcha: this.captchaCode,
captcha_key: this.captchaKey,
types: 'pay_pwd'
}).then(res => {
uni.hideLoading() uni.hideLoading()
this.flag = true this.flag = true
if (res.code == 1) { if (res.code == 1) {
@@ -205,84 +110,24 @@
setTimeout(() => { setTimeout(() => {
uni.navigateBack() uni.navigateBack()
}, 500) }, 500)
} else {
this.loadCaptcha()
} }
}) })
},
cutTime() {
if (!this.timeFlag) return
if (this.current == 0) {
if (this.email == "") {
this.tos(this.i18n.mine.safety.nobangding)
return
}
uni.showLoading({
title: this.i18n.regist.loading,
mask: true
})
this.timeFlag = false
this.post('/ems/send', {
email: this.email,
event: "resetpwd",
}).then(res => {
uni.hideLoading()
if (res.code == 1) {
this.tos(res.msg)
this.time = 120
var that = this
let timeName = setInterval(() => {
if (that.time > 0) {
that.time--
} else {
that.time = 0
that.timeFlag = true
clearInterval(timeName)
}
}, 1000)
} else {
this.timeFlag = true
}
})
}
if (this.current == 1) {
if (this.phone == "") {
this.tos(this.i18n.mine.safety.nobangding)
return
}
uni.showLoading({
title: this.i18n.regist.loading,
mask: true
})
this.timeFlag = false
this.post('/sms/send', {
mobile: this.phone,
m_prefix:this.seleCountry.value,
event: "resetpwd",
}).then(res => {
uni.hideLoading()
if (res.code == 1) {
this.tos(res.msg)
this.time = 60
var that = this
let timeName = setInterval(() => {
if (that.time > 0) {
that.time--
} else {
that.time = 0
that.timeFlag = true
clearInterval(timeName)
}
}, 1000)
} else {
this.timeFlag = true
}
})
}
} }
} }
} }
</script> </script>
<style> <style>
.captchaImg {
width: 240rpx;
height: 80rpx;
margin-left: 18rpx;
flex: 0 0 auto;
border-radius: 6rpx;
}
.listBox { .listBox {
width: 100%; width: 100%;
/* height: 96rpx; */ /* height: 96rpx; */
+2 -2
View File
@@ -202,7 +202,7 @@
</view> </view>
<view @click="moreran = !moreran" class=""> <view @click="moreran = !moreran" class="">
<view class=""> <view class="">
{{moreran?'更多':'收起'}} {{moreran?'More':'Collapse'}}
</view> </view>
</view> </view>
</view> </view>
@@ -451,7 +451,7 @@
"low": 0, "low": 0,
"high": 0, "high": 0,
}, },
list: ['量化信息', 'K线'], list: ['Quantify Info', 'K-Line'],
current: 0, current: 0,
theme: '', theme: '',
@@ -29,7 +29,7 @@
//空数据描述文字 //空数据描述文字
emptyViewText: { emptyViewText: {
type: String, type: String,
default: '没有数据哦~' default: 'No data'
}, },
//空数据图片 //空数据图片
emptyViewImg: { emptyViewImg: {
@@ -34,8 +34,8 @@ const t = {
}, },
loadingMoreNoMoreText: { loadingMoreNoMoreText: {
'en': 'No more data', 'en': 'No more data',
'zh-cn': '没有更多了', 'zh-cn': 'No more data',
'zh-hant-cn': '沒有更多了', 'zh-hant-cn': 'No more data',
}, },
loadingMoreFailText: { loadingMoreFailText: {
'en': 'Load failed,click to reload', 'en': 'Load failed,click to reload',
@@ -114,14 +114,14 @@ function _getPrivateLanguage(myLanguage, followSystemLanguage = true) {
language = language.replace(reg, '-'); language = language.replace(reg, '-');
if (language.indexOf('zh') !== -1) { if (language.indexOf('zh') !== -1) {
if (language === 'zh' || language === 'zh-cn' || language.indexOf('zh-hans') !== -1) { if (language === 'zh' || language === 'zh-cn' || language.indexOf('zh-hans') !== -1) {
return 'zh-cn'; return 'en';
} }
return 'zh-hant-cn'; return 'en';
} }
if (language.indexOf('en') !== -1) { if (language.indexOf('en') !== -1) {
return 'en'; return 'en';
} }
return 'zh-cn'; return 'en';
} }
export default { export default {
@@ -76,9 +76,9 @@
type: Object, type: Object,
default () { default () {
return { return {
loadmore: '加载更多', loadmore: 'Load more',
loading: '正在加载...', loading: 'Loading...',
nomore: '没有更多了' nomore: 'No more data'
} }
} }
}, },