| | |
| | | </div> |
| | | <div class="right_title"> |
| | | <div class="t_t" style="white-space: nowrap"> |
| | | <span>{{ name }}({{ gid }})</span> |
| | | <span v-if="KLine.type == 'HJ'">{{ name }}</span> |
| | | <span v-else>{{ name }}({{ gid }})</span> |
| | | </div> |
| | | <div class="b_t"> |
| | | <span>{{ spell }}</span> |
| | |
| | | </div> |
| | | <div class="rights"> |
| | | <div class="ese"> |
| | | <div class="mc" @click="handleTradingClick(0)" :class="tabsCurrentIndex === 0 ? 'actives' : ''"> |
| | | <div |
| | | class="mc" |
| | | @click="handleTradingClick(0)" |
| | | :class="tabsCurrentIndex === 0 ? 'actives' : ''" |
| | | > |
| | | <span>Short</span> |
| | | </div> |
| | | |
| | | <div class="mr" @click="handleTradingClick(1)" :class="tabsCurrentIndex === 1 ? 'active' : ''"> |
| | | <div |
| | | class="mr" |
| | | @click="handleTradingClick(1)" |
| | | :class="tabsCurrentIndex === 1 ? 'active' : ''" |
| | | > |
| | | <span>Long</span> |
| | | </div> |
| | | </div> |
| | |
| | | |
| | | <div class="price_tabs"> |
| | | <div class="tabs"> |
| | | <div class="tab_item" v-for="(item, index) in priceTabs" :key="index" @click="handleTabsClick(item, index)" |
| | | :class="priceTabsCurrentIndex === index ? 'active' : ''"> |
| | | <div |
| | | class="tab_item" |
| | | v-for="(item, index) in priceTabs" |
| | | :key="index" |
| | | @click="handleTabsClick(item, index)" |
| | | :class="priceTabsCurrentIndex === index ? 'active' : ''" |
| | | > |
| | | <span>{{ item }}</span> |
| | | </div> |
| | | </div> |
| | |
| | | <img src="@/assets/img/ic_number_jian.png" alt /> |
| | | </div> |
| | | <div class="addorj"></div> |
| | | <div class="addorj" @click=" |
| | | <div |
| | | class="addorj" |
| | | @click=" |
| | | typeof nums == 'string' |
| | | ? (nums = Number(Number(nums) + 1).toFixed(2)) |
| | | : (nums = (Number(nums) + 1).toFixed(2)) |
| | | "> |
| | | " |
| | | > |
| | | <img src="@/assets/img/ic_number_add.png" /> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | <div class="tr_es flexJy"> |
| | | <div class="top_input"> |
| | | <input type="number" onkeyup="value=value.replace(/[^\d]/g,'')" v-model="num" @input="numInput" /> |
| | | <input |
| | | type="number" |
| | | onkeyup="value=value.replace(/[^\d]/g,'')" |
| | | v-model="num" |
| | | @input="numInput" |
| | | /> |
| | | </div> |
| | | <div class="right_sw flexJy" style="width: auto"> |
| | | <div class="addorj" @click="jyslJian"> |
| | |
| | | <div class="tr_rs gg" @click="showGg = true"> |
| | | <div class="top_bzz"> |
| | | <span>{{ $t("hj101") }}</span> |
| | | <span>{{ selectCycle }}</span> |
| | | <span>{{ |
| | | KLine.type === "HJ" |
| | | ? selectCycle.replace("X", "") * 100 + "X" |
| | | : selectCycle |
| | | }}</span> |
| | | </div> |
| | | </div> |
| | | <div class="tr_rs"> |
| | | <div class="top_bzz" style="padding-bottom: 0.2rem"> |
| | | <span style="text-align: left"> |
| | | {{ $t("交易总额") }}(₹) |
| | | </span> |
| | | <span style="text-align: right"> |
| | | {{ $t("hj103") }}(₹) |
| | | </span> |
| | | <span style="text-align: left"> {{ $t("交易总额") }}(₹) </span> |
| | | <span style="text-align: right"> {{ $t("hj103") }}(₹) </span> |
| | | </div> |
| | | |
| | | <div class="bottom_bzz"> |
| | | <span> |
| | | ₹{{ |
| | | ((nowPrice * selectCycle.replace("X", "")) * num) |
| | | (nowPrice * selectCycle.replace("X", "") * num) |
| | | | _toLocaleString |
| | | }} |
| | | </span> |
| | |
| | | </div> |
| | | <div class="tr_rs"> |
| | | <div class="top_bzz" style="padding-bottom: 0.2rem"> |
| | | <span style="text-align: left"> |
| | | {{ $t("hj44") }}(₹) |
| | | </span> |
| | | <span style="text-align: right"> |
| | | </span> |
| | | <span style="text-align: left"> {{ $t("hj44") }}(₹) </span> |
| | | <span style="text-align: right"> </span> |
| | | </div> |
| | | |
| | | <div class="bottom_bzz"> |
| | | <span> |
| | | ₹{{( |
| | | ((nowPrice * selectCycle.replace("X", "")) * num)*sxf).toFixed(2)}} |
| | | ₹{{ |
| | | (nowPrice * selectCycle.replace("X", "") * num * sxf).toFixed( |
| | | 2 |
| | | ) |
| | | }} |
| | | </span> |
| | | <span style="white-space: nowarp"> |
| | | </span> |
| | | <span style="white-space: nowarp"> </span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <van-action-sheet v-model="showGg" :actions="siteLeverList" :cancel-text="$t('hj106')" :description="$t('hj107')" |
| | | close-on-click-action @select="onSelect" /> |
| | | <van-action-sheet |
| | | v-model="showGg" |
| | | :actions="siteLeverList" |
| | | :cancel-text="$t('hj106')" |
| | | :description="$t('hj107')" |
| | | close-on-click-action |
| | | @select="onSelect" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import * as api from "@/axios/api"; |
| | | import { |
| | | mapActions |
| | | } from "vuex"; |
| | | import { mapActions } from "vuex"; |
| | | |
| | | export default { |
| | | name: "trBuy", |
| | |
| | | profitTarget: 0, |
| | | if_us: 0, |
| | | bayType: "", |
| | | sxf:'', |
| | | sxf: "", |
| | | id: "", |
| | | actions: [{ |
| | | actions: [ |
| | | { |
| | | name: "100X", |
| | | subname: this.$t("hj102") |
| | | }, |
| | |
| | | { |
| | | name: "300X", |
| | | subname: this.$t("hj102") |
| | | }, |
| | | } |
| | | ], |
| | | profitArr: [{ |
| | | profitArr: [ |
| | | { |
| | | name: this.$t("hj104"), |
| | | checked: false, |
| | | checked: false |
| | | }, |
| | | { |
| | | name: this.$t("hj105"), |
| | | checked: false, |
| | | checked: false |
| | | }, |
| | | { |
| | | name: this.$t("hj110"), |
| | | checked: false, |
| | | }, |
| | | checked: false |
| | | } |
| | | ], |
| | | moneyData: {}, |
| | | gid: "", |
| | | KLine: {} |
| | | }; |
| | | }, |
| | | |
| | | mounted() { |
| | | this.bayType = this.$route.query.bayType; |
| | | this.gid = this.$route.query.gid; |
| | | this.KLine = JSON.parse(window.localStorage.getItem("kLine")); |
| | | if (this.bayType == "in") { |
| | | this.priceTabs = [this.$t("hj108"), this.$t("hj109")]; |
| | | } else if (this.bayType == "qh") { |
| | |
| | | this.setUseInfo(); |
| | | this.getMoneyData(); |
| | | this.getSettingInfo(); |
| | | this.queryStockConfig() |
| | | this.queryStockConfig(); |
| | | }, |
| | | watch: { |
| | | checkedZy(val) { |
| | |
| | | // 支持 |
| | | navigator.vibrate([55]); |
| | | } |
| | | }, |
| | | } |
| | | }, |
| | | methods: { |
| | | async queryStockConfig(){ |
| | | let data = await api.queryStockConfig(); |
| | | if (data.status === 0) { |
| | | this.sxf=data.data.cValue |
| | | this.sxf = data.data.cValue; |
| | | } |
| | | }, |
| | | zSjian(){ |
| | | var newzishu = (Number(this.zhisun)-1).toFixed(2) |
| | | var newzishu = (Number(this.zhisun) - 1).toFixed(2); |
| | | if(Number(newzishu)<1){ |
| | | |
| | | }else{ |
| | | this.zhisun = newzishu |
| | | this.zhisun = newzishu; |
| | | } |
| | | }, |
| | | ...mapActions(["setUseInfo"]), |
| | |
| | | let data = await api.getMoney(); |
| | | let type = this.bayType === "SZHB" ? "US" : this.bayType; |
| | | if (data.status === 0) { |
| | | const newArr = data.data.filter((item) => item.accectType === type); |
| | | const newArr = data.data.filter(item => item.accectType === type); |
| | | |
| | | this.moneyData = newArr[0] || {}; |
| | | // console.log(this.bayType, newArr); |
| | |
| | | this.nowPrice / |
| | | this.selectCycle.replace("X", "") |
| | | ); |
| | | typeof this.num == "string" ? |
| | | (this.num = Number(Number(this.num) + 1)) : |
| | | (this.num = Number(Number(this.num) + 1)); |
| | | typeof this.num == "string" |
| | | ? (this.num = Number(Number(this.num) + 1)) |
| | | : (this.num = Number(Number(this.num) + 1)); |
| | | |
| | | console.log(this.num, numbs); |
| | | if (this.num >= numbs) { |
| | |
| | | } |
| | | }, |
| | | zYjian() { |
| | | var newzishu = (Number(this.profitTarget)-1).toFixed(2) |
| | | var newzishu = (Number(this.profitTarget) - 1).toFixed(2); |
| | | if(Number(newzishu)<1){ |
| | | |
| | | }else{ |
| | | this.profitTarget = newzishu |
| | | this.profitTarget = newzishu; |
| | | } |
| | | // this.profitTarget = (Number(this.profitTarget) - 1).toFixed(2); |
| | | // if(this.tabsCurrentIndex==0){ |
| | |
| | | // this.profitTarget = (Number(this.profitTarget) - 1).toFixed(2); |
| | | // } |
| | | // } |
| | | |
| | | |
| | | }, |
| | | zSjia() { |
| | | this.zhisun++; |
| | |
| | | }, |
| | | gdOrSetBuy() { |
| | | if (this.priceTabsCurrentIndex == 0) { |
| | | |
| | | this.setBuy(); |
| | | } else { |
| | | |
| | | this.gdBuy(); |
| | | } |
| | | if (navigator.vibrate) { |
| | |
| | | stockId: this.code, |
| | | buyNum: this.num, |
| | | lever: this.selectLever, |
| | | targetPrice: this.nums, |
| | | targetPrice: this.nums |
| | | }; |
| | | console.log(this.selectLever, "this.selectLever "); |
| | | |
| | |
| | | this.$store.commit("elAlertShow", { |
| | | elAlertShow: true, |
| | | elAlertText: data.msg, |
| | | elAlertType: "success", |
| | | elAlertType: "success" |
| | | }); |
| | | this.getUserInfo(); |
| | | this.$router.push("/warehouse?index=1&buyType=" + this.bayType); |
| | | } else { |
| | | this.$store.commit("elAlertShow", { |
| | | elAlertShow: true, |
| | | elAlertText: data.msg, |
| | | elAlertText: data.msg |
| | | }); |
| | | } |
| | | }, |
| | |
| | | if (this.$store.state.userInfo.isActive !== 2) { |
| | | this.$store.commit("elAlertShow", { |
| | | elAlertShow: true, |
| | | elAlertText: this.$t("hj111"), |
| | | elAlertText: this.$t("hj111") |
| | | }); |
| | | this.$router.push("/authentications"); |
| | | return; |
| | |
| | | // stockId: this.detail.id, |
| | | // buyNum: this.selectNumber ? this.selectNumber * 100 : 0, // 单位为手 |
| | | // buyType: this.selectType, |
| | | lever: this.selectCycle ? this.selectCycle : 0, |
| | | // lever: this.selectCycle ? this.selectCycle : 0, |
| | | // subaccountNumber:this.subaccountNumber |
| | | |
| | | // 买入是买涨buyType:0, 卖出是买跌buyType:1,卖出的状态是0,买入的状态是1 |
| | | buyNum: this.num, // 单位为手 |
| | | // buyNum: (this.num.match(/\d+/g))[0] * 100, // 单位为手 |
| | | lever: this.selectLever, |
| | | lever: this.selectLever |
| | | }; |
| | | if (this.KLine.type === "HJ") { |
| | | opts.lever = this.selectLever * 100; |
| | | } |
| | | console.log(this.selectLever, "this.selectLever "); |
| | | if (this.tabsCurrentIndex == 0) { |
| | | opts.buyType = 1; |
| | |
| | | // 股票买入 |
| | | async gpBuy(opts) { |
| | | opts.stockId = this.id; |
| | | let data = await api.buy(opts); |
| | | let data; |
| | | |
| | | console.log("bayType: ", this.KLine); |
| | | |
| | | if (this.KLine.type == "HJ") { |
| | | opts.name = this.KLine.name; |
| | | |
| | | data = await api.goldCrudeOilbuy(opts); |
| | | } else { |
| | | data = await api.buy(opts); |
| | | } |
| | | |
| | | this.buying = false; |
| | | if (data.status === 0) { |
| | | this.$store.commit("elAlertShow", { |
| | | elAlertShow: true, |
| | | elAlertText: data.msg, |
| | | elAlertType: "success", |
| | | elAlertType: "success" |
| | | }); |
| | | this.getUserInfo(); |
| | | var buyType = ""; |
| | |
| | | if (data.msg.indexOf("不在交易时段内") > -1) { |
| | | this.$store.commit("elAlertShow", { |
| | | elAlertShow: true, |
| | | elAlertText: this.$t("hj113"), |
| | | elAlertText: this.$t("hj113") |
| | | }); |
| | | } else { |
| | | this.$store.commit("elAlertShow", { |
| | | elAlertShow: true, |
| | | elAlertText: data.msg, |
| | | elAlertText: data.msg |
| | | }); |
| | | } |
| | | } |
| | |
| | | this.$store.commit("elAlertShow", { |
| | | elAlertShow: true, |
| | | elAlertText: data.msg, |
| | | elAlertType: "success", |
| | | elAlertType: "success" |
| | | }); |
| | | this.getUserInfo(); |
| | | this.$router.push("/warehouse?index=1&buyType=" + this.bayType); |
| | | } else { |
| | | this.$store.commit("elAlertShow", { |
| | | elAlertShow: true, |
| | | elAlertText: data.msg, |
| | | elAlertText: data.msg |
| | | }); |
| | | } |
| | | }, |
| | |
| | | } else { |
| | | this.$store.commit("elAlertShow", { |
| | | elAlertShow: true, |
| | | elAlertText: data.msg, |
| | | elAlertText: data.msg |
| | | }); |
| | | } |
| | | this.$store.state.user = this.user; |
| | |
| | | |
| | | this.siteLeverList = []; |
| | | for ( |
| | | let i = 0; i < this.$store.state.userInfo.siteLever.split("/").length; i++ |
| | | let i = 0; |
| | | i < this.$store.state.userInfo.siteLever.split("/").length; |
| | | i++ |
| | | ) { |
| | | let val = this.$store.state.userInfo.siteLever.split("/")[i]; |
| | | let item = { |
| | |
| | | } else { |
| | | this.$store.commit("elAlertShow", { |
| | | elAlertShow: true, |
| | | elAlertText: data.msg, |
| | | elAlertText: data.msg |
| | | }); |
| | | } |
| | | }, |
| | | } |
| | | }, |
| | | filters: { |
| | | getName(name) { |
| | |
| | | } else { |
| | | return name; |
| | | } |
| | | }, |
| | | }, |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |