diff --git a/api/serve/index.js b/api/serve/index.js index 9ba029b..243bd05 100755 --- a/api/serve/index.js +++ b/api/serve/index.js @@ -84,9 +84,10 @@ x.fn = x.prototype = { let newMsg=options.url.replace(reg,'_'); console.info(newMsg) if(Cache.get(newMsg).data){ - if(newMsg!='_user_walletImage'&& newMsg!='_user_getAuthInfo' && newMsg!='_user_withdrawalBalance' && newMsg!='_wallet_getBalance' && newMsg!='_contract_getMarketInfo'){ - resolve(Cache.get(newMsg).data); - } + if(newMsg!='_user_walletImage'&& newMsg!='_user_getAuthInfo' && newMsg!='_user_withdrawalBalance' + && newMsg!='_wallet_getBalance' && newMsg!='_contract_getMarketInfo'&& newMsg!='_contract_openNum'){ + resolve(Cache.get(newMsg).data); + } uni.request({ url: this.url, data: this.data, diff --git a/pages/exchange/open-position.vue b/pages/exchange/open-position.vue index 4af9d93..31fa9da 100755 --- a/pages/exchange/open-position.vue +++ b/pages/exchange/open-position.vue @@ -756,7 +756,7 @@ export default { type: 1, entrust_price: "", amount: "", - lever_rate: "", + lever_rate: 50, tp_trigger_price: "", sl_trigger_price: "", }, @@ -782,6 +782,7 @@ export default { progress:[25,50,75,100], progressPing:[25,50,75,100], sliderActive:-1, + sliderActive1:0, pingActive:3, contract:"1", // contract:"0", @@ -860,6 +861,10 @@ export default { } }, watch: { + maxNum(n){ + this.form.amount = Math.round((this.maxNum * this.sliderActive1) / 100); + this.margin=this.form.amount/this.form.lever_rate + }, symbol() { this.$emit("symbols",this.symbol) if (this.unSymbol) { @@ -1337,18 +1342,21 @@ export default { } Contract.openPosition(data, { btn }).then(() => { this.$toast(this.$t("contract.g2")); + console.info(this.form.type) if(this.form.type==1){ this.holdPosition() }else{ this.getCurrentEntrust() } this.contractAccount(); + this.openNum() }); }, sliderChange(n,i) { + console.info(n,i) this.form.amount = Math.round((this.maxNum * n) / 100); this.sliderActive=i - + this.sliderActive1=n this.margin=this.form.amount/this.form.lever_rate }, pingChange(n,i) { @@ -1467,6 +1475,7 @@ export default { this.pingAmount = ""; this.holdPosition(); this.$toast(res.message); + this.openNum() }); }, // 一键平仓 @@ -1536,6 +1545,7 @@ export default { Contract.onekeyAllFlat({}).then(() => { this.holdPosition(true); this.$toast(this.$t("contract.l0")); + this.openNum() }); }); }, @@ -1820,4 +1830,4 @@ export default { .but_text{ font-size: 14px; } - \ No newline at end of file +s \ No newline at end of file