| | |
| | | import TradeApi from "@/service/trading.js"; |
| | | import { strToArr } from '@/utils/utis' |
| | | import { mapGetters } from "vuex"; |
| | | import { getStorage, setStorage } from '@/utils/index.js'; |
| | | // import PopupConfirmOrder from '@/components/popup-confirm-order' |
| | | export default { |
| | | name: "perpetualPosition", |
| | |
| | | this.title = this.selectData[0].title |
| | | this.type = this.selectData[0].type |
| | | this.form.order_price_type = 'opponent' |
| | | // 检查是否有从其他页面传递的卖出参数 |
| | | this.checkSellParams() |
| | | }, |
| | | watch: { |
| | | initOpen: { // 处理滚动条初始值 |
| | |
| | | this.title = this.selectData[0].title |
| | | this.type = this.selectData[0].type |
| | | this.form.order_price_type = 'opponent' |
| | | // 检查是否有从其他页面传递的卖出参数 |
| | | this.checkSellParams() |
| | | }, |
| | | methods: { |
| | | strToArr, |
| | | // 检查是否有从其他页面传递的卖出参数 |
| | | checkSellParams() { |
| | | const sellParams = getStorage('tradeSellParams') |
| | | if (sellParams && sellParams.mode === 'close' && sellParams.volume) { |
| | | // 切换到卖出模式 |
| | | this.changeTab('close') |
| | | // 设置数量 |
| | | this.$nextTick(() => { |
| | | this.form.volume = sellParams.volume |
| | | this.isTotal = false |
| | | }) |
| | | // 清除存储的参数 |
| | | window.localStorage.removeItem('tradeSellParams') |
| | | } |
| | | }, |
| | | checkIsTotal(val) { |
| | | this.isTotal = val |
| | | this.percentageVal = 0 |
| | |
| | | |
| | | display: flex; |
| | | |
| | | color: $text_color; |
| | | color: $text_color3; |
| | | |
| | | font-size: 26px; |
| | | align-items: center; |
| | |
| | | .active-bg { |
| | | background: $input_background; |
| | | border-radius: 2.5rem; |
| | | color: $text_color; |
| | | } |
| | | |
| | | .buyandSell { |