From 766e1af6929ee112e49441b7f92f755367c6d89c Mon Sep 17 00:00:00 2001 From: luyisha Date: Tue, 4 Jul 2023 14:06:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B8=81=E5=B8=81=E5=90=88=E7=BA=A6=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E6=95=B0=E6=8D=AE=E4=BE=A6=E5=90=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/serve/index.js | 2 +- i18n/lang/en.json | 6 +- layout/vDropdwon.vue | 34 +++++++++- pages/auth/primary.vue | 107 ++++++++++++++++++++++++------- pages/exchange/open-position.vue | 58 +++++++++-------- 5 files changed, 153 insertions(+), 54 deletions(-) diff --git a/api/serve/index.js b/api/serve/index.js index bc76a41..7dff4a9 100644 --- a/api/serve/index.js +++ b/api/serve/index.js @@ -86,7 +86,7 @@ x.fn = x.prototype = { if(Cache.get(newMsg).data){ if(newMsg!='_user_walletImage'&& newMsg!='_user_getAuthInfo' && newMsg!='_user_withdrawalBalance' && newMsg!='_article_detail' && newMsg!='_contract_getSymbolDetail' && newMsg!='_categoryList' && newMsg!='_articleList' - && newMsg!='_college' && newMsg!='_exchange_getCoinInfo' + && newMsg!='_college' && newMsg!='_exchange_getCoinInfo' && newMsg!='_user_primaryAuth' && newMsg!='_wallet_getBalance' && newMsg!='_contract_getMarketInfo'&& newMsg!='_contract_openNum'){ resolve(Cache.get(newMsg).data); } diff --git a/i18n/lang/en.json b/i18n/lang/en.json index 854a3f5..68cf119 100644 --- a/i18n/lang/en.json +++ b/i18n/lang/en.json @@ -202,7 +202,7 @@ "a6": "Authentication failed", "a7": "Nationality", "a8": "Please select nationality", - "a9": "Real name", + "a9": "Real Name", "b0": "Please enter your real name", "b1": "Certificate Number", "b2": "Please enter the ID number", @@ -223,7 +223,7 @@ "d2": "ID card", "d3": "Driving License", "d4": "Passport", - "d5": "residential address", + "d5": "Residential Address", "d6": "Please enter residential address", "d7": "City", "d8": "Please enter your city", @@ -232,7 +232,7 @@ "d11": "Phone Number", "d12": "Please enter your phone number", "d13": "Please select", - "SelectAreaCode":"Select area code" + "SelectAreaCode":"Select Area Code" }, "exchange": { "a0": "Spot Trading", diff --git a/layout/vDropdwon.vue b/layout/vDropdwon.vue index cfffc0c..92997bf 100644 --- a/layout/vDropdwon.vue +++ b/layout/vDropdwon.vue @@ -41,7 +41,11 @@ export default { contract: { type: String, default: '' - } + }, + leverShow: { + type: String, + default: '' + }, }, data() { return { @@ -50,6 +54,31 @@ export default { active:2 }; }, + watch:{ + leverShow:{ + deep: true, + handler:function(newVal,oldVal) { + console.log(newVal, '下拉组件leverShow更新'); + this.$nextTick(() => { + this.text=this.list[newVal].label; + }) + } + }, + list:{ + deep: true, + handler:function(newVal,oldVal) { + console.log(newVal, '下拉组件list更新'); + if(this.contract==1&&this.list){ + this.text=this.list[1].label + }else if(this.contract==0&&this.list){ + this.text=this.list[0].label + } + if(this.leverShow){ + this.text=this.list[this.leverShow].label + } + } + } + }, methods: { handlerItem(value,index) { this.showIf = false @@ -70,6 +99,9 @@ export default { }else if(this.contract==0&&this.list){ this.text=this.list[0].label } + if(this.leverShow){ + this.text=this.list[this.leverShow].label + } } }; diff --git a/pages/auth/primary.vue b/pages/auth/primary.vue index 8a35008..3b8a1f5 100644 --- a/pages/auth/primary.vue +++ b/pages/auth/primary.vue @@ -10,25 +10,22 @@ - - - - - - - - - - - - - - - + + {{$t('auth.d0')}} + + + + {{$t('auth.d1')}} - + @@ -105,15 +100,15 @@ export default { detail: {}, countryList: [], form: { - country_id: "", - country_code: "", realname: "", birthday: "", - type: "", + type: "2", id_card: "", address: "", city: "", postal_code: "", + country_id: "", + country_code: "", phone: "", }, single: "2023-06-3", @@ -182,7 +177,63 @@ export default { primaryAuth() { let data = this.form; data.country_code = this.activeCountry.country_code; - Profile.primaryAuth(data,{btn:this.$refs.btn}).then(() => { + if(!data.realname){ + uni.showToast({ + title: this.$t('auth.b0'), + icon: 'none' + }) + return; + } + if(!data.type){ + uni.showToast({ + title: this.$t('auth.d13')+this.$t('auth.d1'), + icon: 'none' + }) + return; + } + if(!data.id_card){ + uni.showToast({ + title: this.$t('auth.b2'), + icon: 'none' + }) + return; + } + if(!data.address){ + uni.showToast({ + title: this.$t('auth.d6'), + icon: 'none' + }) + return; + } + if(!data.city){ + uni.showToast({ + title: this.$t('auth.d8'), + icon: 'none' + }) + return; + } + if(!data.postal_code){ + uni.showToast({ + title: this.$t('auth.d10'), + icon: 'none' + }) + return; + } + if(!data.country_id){ + uni.showToast({ + title: this.$t('auth.SelectAreaCode'), + icon: 'none' + }) + return; + } + if(!data.phone){ + uni.showToast({ + title: this.$t('auth.d12'), + icon: 'none' + }) + return; + } + Profile.primaryAuth(data,{btn:this.$refs.btn}).then((res) => { this.$toast.success(this.$t('auth.b4')); // this.$back(); uni.navigateBack({ @@ -201,5 +252,15 @@ export default { } }; - diff --git a/pages/exchange/open-position.vue b/pages/exchange/open-position.vue index cba86f4..e35dc93 100644 --- a/pages/exchange/open-position.vue +++ b/pages/exchange/open-position.vue @@ -96,7 +96,7 @@ {{ form.lever_rate }} X --> - + @@ -750,6 +750,7 @@ export default { accountInfo: {}, // 杠杆倍数 lever_rage: [], + leverShow: '', // 最多可开张数 maxNum: 0, form: { @@ -1266,39 +1267,44 @@ export default { symbol: this.symbolLeft, }; Contract.getSymbolDetail(data).then((res) => { - console.info(res) - this.unit_amount = res.data.unit_amount; - if (!this.lever_rage.length) { - this.lever_rage = res.data.lever_rage.map((item) => ({ - label: item, - value: item, - })); - // this.form.lever_rate = this.lever_rage[2].value; - console.log(res.data, '----------'); - this.form.lever_rate = res.data.default_lever; - console.info(this.form.lever_rate) - // let e=this.lever_rage[2] - let e=res.data.default_lever - this.openNum(e); - } - this.$emit("getSymbolDetail", res.data); - if (!this.form.lever_rate) { - // this.form.lever_rate = this.lever_rage[2].value; - this.form.lever_rate = res.data.default_lever; - this.openNum(e); - } + console.info('res.data', res.data.default_lever, res.data.lever_rage, res) + this.unit_amount = res.data.unit_amount; + + // if (!this.lever_rage.length) { + this.lever_rage = res.data.lever_rage.map((item) => ({ + label: item, + value: item, + })); + // this.form.lever_rate = res.data.default_lever; + // let e=res.data.default_lever + let e={value:res.data.default_lever, label: res.data.default_lever} + this.openNum(e); + // } + this.$emit("getSymbolDetail", res.data); + // if (!this.form.lever_rate) { + // this.form.lever_rate = res.data.default_lever; + // this.openNum(e); + // } }); }, // 获取可开启张数 openNum(e) { - if(e){ - this.form.lever_rate=e.value - } if (!this.isLogin) return; let data = { symbol: this.symbolLeft, //ETH lever_rate: this.form.lever_rate, //10 }; + if(e){ + this.form.lever_rate=e.value; + data.lever_rate = e.value; + for(let item =0;item { this.maxNum = res.data; }); @@ -1426,7 +1432,7 @@ export default { this.tradeList.unshift(data); this.tradeList.pop(); this.newPrice = data; - console.log(this.newPrice, 898989898988) + // console.log(this.newPrice, 898989898988) break; } });