| | |
| | | // 登录之后才能调用 |
| | | if (this.existToken) { |
| | | this.initContractparams(); |
| | | this.timer = setInterval(() => { |
| | | this.$nextTick(() => { |
| | | // this.timer = setInterval(() => { |
| | | this.initContractparams(); |
| | | }, 2000); |
| | | // }, 2000); |
| | | }); |
| | | } |
| | | |
| | | this.price = this.newPageData.close; |
| | |
| | | }); |
| | | // params:type类型 |
| | | bus.on("getSesstionToken", (type) => { |
| | | setTimeout(() => { |
| | | this.$nextTick(() => { |
| | | // setTimeout(() => { |
| | | this.initContractparams(type); |
| | | }, 2000); //延迟调用 |
| | | // }, 2000); //延迟调用 |
| | | }); |
| | | }); |
| | | bus.on("moneyContract", (val) => { |
| | | if (val) { |
| | |
| | | }, |
| | | // 获取合约金额 |
| | | getContractAmount: function () { |
| | | console.log("获取合约金额", this.initOpen.amount, this.inputAmount); |
| | | const amount = this.inputAmount; |
| | | let data = "0.00"; |
| | | if (amount != undefined && this.lever_rate != undefined) { |
| | | if (this.lever_rate?.length > 0) { |
| | | data = amount * this.initOpen.amount; |
| | | } else if (this.lever_rate.length == 0) { |
| | | data = this.sessionObj?.amount * amount * 1; |
| | | } |
| | | } |
| | | return bigDecimal.round(data, 2); |
| | | // if (amount != undefined && this.lever_rate != undefined) { |
| | | // if (this.lever_rate?.length > 0) { |
| | | data = amount * this.initOpen.amount; |
| | | // } |
| | | // else if (this.lever_rate.length == 0) { |
| | | // data = this.sessionObj?.amount * amount * 1; |
| | | // } |
| | | // } |
| | | return data; |
| | | }, |
| | | // 获取保证金,开仓才需要 |
| | | getMargin: function () { |
| | |
| | | } |
| | | if (this.isActive === 0) { |
| | | // 开仓弹窗 不弹出直接确认 |
| | | this.$refs.openDialog.handleSubmit(); |
| | | this.$refs.openDialog.handleSubmit(type); |
| | | } else { |
| | | // 平仓弹窗 |
| | | this.$refs.closeDialog.handleSubmit(); |
| | | this.$refs.closeDialog.handleSubmit(type); |
| | | } |
| | | } |
| | | }, |