| | |
| | | import i18n from "@/i18n"; |
| | | export default { |
| | | // interaction: { |
| | | // // 禁用手势的恢复功能 |
| | | // restore: false, |
| | | // }, |
| | | // 网格线 |
| | | grid: { |
| | | show: true, |
| | |
| | | </template> |
| | | <script> |
| | | import { init, dispose } from 'klinecharts' |
| | | // import KLineChart from 'klinecharts' |
| | | // const chart = new KLineChart(document.getElementById('kline')); |
| | | |
| | | // chart.setOptions({ |
| | | // interaction: { |
| | | // // 禁用手势的恢复功能 |
| | | // restore: false, |
| | | // } |
| | | // }); |
| | | let chart = null |
| | | |
| | | import { _getKline } from '@/API/trade.api' |
| | | import config from './config' |
| | | import { Loading } from 'vant'; |
| | |
| | | chart.applyNewData(data); |
| | | this.$emit('updataLine', false) |
| | | }) |
| | | }, 1000); |
| | | }, 10000); |
| | | }, |
| | | setChartType() { |
| | | let type = 'area' |
| | |
| | | </div> |
| | | <div class="text-right items-end justify-end"> |
| | | <div class="">{{ $t("数量") }}</div> |
| | | <div class="mt-4">({{ symbol | _symbolName() }})</div> |
| | | <div class="mt-4" v-if="symbol=='love'">(ORBITAL)</div> |
| | | <div class="mt-4" v-else>({{ symbol | _symbolName() }})</div> |
| | | </div> |
| | | </div> |
| | | <div |
| | |
| | | @paraId="onParaId" |
| | | /> |
| | | |
| | | <div class="w-440 flex items-center box-show h-76 lh-76 rounded-lg"> |
| | | <div |
| | | v-if="selectIndex == 1" |
| | | class="w-80 flex items-center justify-center" |
| | | style="height: 100%" |
| | | @click="onReduce" |
| | | > |
| | | <img |
| | | src="../../assets/image/public/reduce.png" |
| | | alt="add" |
| | | class="w-30 h-6" |
| | | /> |
| | | <div style="border: 1px solid #a6a6a6; border-radius: 4px;" class="h-76 lh-76 inputBackground2 mb-30 flex pr-20 justify-center rounded-lg textColor" |
| | | v-if="selectIndex == 1"> |
| | | <input v-if="type / 1 === 1" :placeholder="$t('价格最优')" class="w-full pl-20 h-76 border-none text-left rounded-lg" |
| | | :disabled="type / 1 === 1" @focus="focus = true" /> |
| | | <input v-else class="w-full pl-20 h-76 border-none text-left rounded-lg" |
| | | :disabled="type / 1 === 1" @focus="focus = true" v-model="form.price" /> |
| | | <span class="ml-20">USDT</span> |
| | | </div> |
| | | <div v-if="selectIndex == 2" class="w-440 flex items-center inputBackground2 h-76 lh-76 rounded-lg"> |
| | | <div v-if="selectIndex == 1" class="w-80 flex items-center justify-center" style="height: 100%" |
| | | @click="onReduce"> |
| | | <img src="../../assets/image/public/reduce.png" alt="add" class="w-30 h-6" /> |
| | | </div> |
| | | |
| | | <input |
| | | :placeholder=" |
| | | selectIndex == 1 |
| | | ? $t('张数') |
| | | : $t('最少') + initFutrue && initFutrue.para |
| | | ? $t('最小金额') + initFutrue.para[paraIndex].buy_min |
| | | : '' |
| | | " |
| | | class="border-none text-center " |
| | | style="width: 156px" |
| | | v-model="form.amount" |
| | | type="number" |
| | | @input="onInput" |
| | | /> |
| | | <div |
| | | class="w-80 flex items-center justify-center" |
| | | style="height: 100%" |
| | | > |
| | | <input :placeholder="selectIndex == 1 ? $t('交易数量') |
| | | : $t('最少') + initFutrue && initFutrue.para |
| | | ? $t('最小金额') + initFutrue.para[paraIndex].buy_min |
| | | : '' |
| | | " class="border-none text-center textColor" style="width: 156px" v-model="form.amount" |
| | | type="number" @input="onInput" /> |
| | | <div class="w-80 flex items-center justify-center" style="height: 100%"> |
| | | <template v-if="selectIndex == 1"> |
| | | <div @click="onAdd"> |
| | | <img |
| | | src="../../assets/image/public/add.png" |
| | | alt="reduce" |
| | | class="w-30 h-30" |
| | | /> |
| | | </div> |
| | | <img @click="onAdd" src="../../assets/image/public/add.png" alt="reduce" class="w-30 h-30" /> |
| | | </template> |
| | | <template v-else> |
| | | <span class="textColor">USDT</span> |
| | |
| | | {{ (initData.amount * (form.amount / 1)) | nan }} USDT |
| | | </div> |
| | | </div> |
| | | <div class="flex justify-between mt-30"> |
| | | <!-- <div class="flex justify-between mt-30"> |
| | | <div class="newcolor1">{{ $t("建仓手续费") }}</div> |
| | | <div class="textColor"> |
| | | {{ |
| | |
| | | }} |
| | | USDT |
| | | </div> |
| | | </div> |
| | | </div> --> |
| | | </template> |
| | | <div |
| | | class="flex font-24 text-grey justify-between mt-32" |
| | |
| | | <div class="pl-30 pr-30"> |
| | | <div class="flex justify-between pt-45"> |
| | | <div class="flex"> |
| | | <span |
| | | <!-- <span |
| | | @click=" |
| | | kineType |
| | | ? $router.push(`/trade/${symbol}`) |
| | | : $router.push(`/perpetualContract/${symbol}`) |
| | | " |
| | | > |
| | | > --> |
| | | <span |
| | | @click="$router.push(`/trade/${symbol}`)" |
| | | > |
| | | <img |
| | | v-if="isReturn" |
| | | :src="require(`@/assets/theme/${theme}/image/icon_back.png`)" |
| | |
| | | v-model="form.volume" |
| | | @input="onInput" |
| | | /> |
| | | <span class="textColor">{{ newname }}</span> |
| | | <span class="textColor">{{ symbol.toLocaleUpperCase() | newname }}</span> |
| | | </div> |
| | | <div |
| | | v-if="isTotal" |
| | |
| | | percentageVal: 0, |
| | | }; |
| | | }, |
| | | mounted() {}, |
| | | mounted() { |
| | | this.percentageVal = 0 |
| | | // this.exchangeVal(25) |
| | | // this.handleInitSliderOption() |
| | | }, |
| | | methods: { |
| | | checkIsTotal(val) { |
| | | this.isTotal = val; |
| | |
| | | <trade-head |
| | | @openRecord="openRecord" |
| | | :backFunc="() => $router.push('/')" |
| | | :symbol="symbol" |
| | | :symbol="symbol=='love'?'ORBITAL':symbol.toUpperCase()" |
| | | :islevel="true" |
| | | @update-coin="onUpdate" |
| | | @data="quote = $event" |
| | |
| | | <template> |
| | | <div class="assets-box"> |
| | | <div class="typebox" style="display: flex;"> |
| | | <div :class="typeindex==index?'typebox_box':'typebox_boxa'" @click="typeclick(index)" |
| | | v-for="(item,index) in typelist" :key="index">{{item}}</div> |
| | | </div> |
| | | <header> |
| | | <van-row class="title-box"> |
| | | <van-col span="12"> |
| | |
| | | <div class="pt">{{ $t("总资产估值") }}</div> |
| | | <div class="flex ex-bg justify-center my-42 items-center w-100" @click="onSwitch"> |
| | | <!-- <div class="flex ex-bg justify-center my-42 items-center w-100" > --> |
| | | <img src="@/assets/image/exchange/icon_3.png" alt="" class="w-25 h-25" /> |
| | | <!-- <img src="@/assets/image/exchange/icon_3.png" alt="" class="w-25 h-25" /> --> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="pt">{{ assetsFunds.total }}</div> --> |
| | |
| | | return { |
| | | keywords: "", |
| | | loading: true, |
| | | typelist: [this.$t("资金")+this.$t("账户"), this.$t("交易")+this.$t("账户")], |
| | | active: 1, |
| | | typeindex:0, |
| | | tabList2: [ |
| | |
| | | }, |
| | | methods: { |
| | | ...mapActions("user", ["GET_UERS_KYC"]), |
| | | typeclick(e) { |
| | | this.typeindex = e |
| | | // if (e == 0) { |
| | | // this.initParama(this.symbol) |
| | | // } else { |
| | | // // this.symbol = 'wld' |
| | | // this.initParam(this.symbol) |
| | | // } |
| | | // this.$forceUpdate() |
| | | }, |
| | | onInput(e) { |
| | | console.log(333, this.fundsDatra); |
| | | this.funds = this.fundsDatra.filter((item) => |
| | |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .typebox_box { |
| | | width: 50%; |
| | | background-color: #9691fa; |
| | | color: #fff; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | } |
| | | |
| | | .typebox_boxa { |
| | | width: 50%; |
| | | background-color: #fff; |
| | | color: #9691fa; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | } |
| | | |
| | | .no_touch { |
| | | -webkit-user-select: none; |
| | | user-select: none; |
| | | -ms-user-select: none; |
| | | -moz-user-select: none; |
| | | |
| | | @include themify() { |
| | | background: themed("main_background"); |
| | | } |
| | | |
| | | min-height: 100vh; |
| | | } |
| | | |
| | | .typebox { |
| | | width: 100%; |
| | | height: 100px; |
| | | |
| | | } |
| | | .assets-box { |
| | | header { |
| | | // padding: 100px 0 0px; |
| | |
| | | :key="item.title" |
| | | :name="item.type" |
| | | > |
| | | <div class="all-select flex justify-end">yfii |
| | | <div class="all-select flex justify-end"> |
| | | <div class="select-box flex" @click.stop="isAll = !isAll"> |
| | | <div class="flex-1 font-24">{{ symbol.toUpperCase() }}/USDT</div> |
| | | <div class="flex-1 font-24" v-if="symbol=='love'">ORBITAL/USDT</div> |
| | | <div class="flex-1 font-24" v-else>{{ symbol.toUpperCase() }}/USDT</div> |
| | | <van-icon name="arrow-down" /> |
| | | <div class="select-data" v-if="isAll"> |
| | | <div |
| | |
| | | v-for="(item2, index) in currencyList" |
| | | :key="index" |
| | | > |
| | | {{ item2.symbol.toUpperCase() }}/USDT |
| | | <div v-if="item2.symbol=='love'"> |
| | | ORBITAL/USDT |
| | | </div> |
| | | <div v-else> |
| | | {{ item2.symbol.toUpperCase() }}/USDT |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <trade-deep-data :selectValue="selectValue" @getList="getList" :showType="showType" :symbol="symbol" |
| | | v-if="symbol" :price="price" class="w-290 mr-30" /> |
| | | </keep-alive> |
| | | <trade-order-area :symbol="symbol" :init-open="initOpena" :newname="newname" :init-close="initClose" |
| | | <trade-order-area :key="newzuj" :symbol="symbol" :init-open="initOpena" :newname="newname" :init-close="initClose" |
| | | :price="price" @ordered="onOrdereda" /> |
| | | </div> |
| | | |
| | |
| | | range: "", |
| | | stop_price_profit: "", |
| | | stop_price_loss: "", |
| | | newzuj:0, |
| | | initClose: {}, |
| | | asks: initArr, // 卖单 |
| | | bids: initArr, // 买单 |
| | |
| | | } else { |
| | | this.init(symbol); |
| | | } |
| | | // this.handleQoutes() |
| | | }, |
| | | methods: { |
| | | ...mapActions("home", [SET_COIN_LIST]), |
| | |
| | | }, |
| | | fetchDeepData(symbol) { |
| | | console.log("sd"); |
| | | this.newzuj += 1 |
| | | _getDeepData(symbol).then((data) => { |
| | | // 获取深度 |
| | | console.log(data); |
| | |
| | | //console.log('开仓数据') |
| | | Axios.tradeBuyToken({}).then((res) => { |
| | | this.initOpena = res.data; |
| | | console.log(this.initOpen.volume, res.data.volume, type); |
| | | console.log(this.initOpena.volume, res.data.volume, type,111111); |
| | | }); |
| | | } |
| | | if (type === "close" || !type) { |