| | |
| | | </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>{{ $t("hj84") }}</span> |
| | | </div> |
| | | |
| | | <div class="mr" @click="handleTradingClick(1)" :class="tabsCurrentIndex === 1 ? 'active' : ''"> |
| | | <div |
| | | class="mr" |
| | | @click="handleTradingClick(1)" |
| | | :class="tabsCurrentIndex === 1 ? 'active' : ''" |
| | | > |
| | | <span>{{ $t("hj85") }}</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> |
| | |
| | | <input type="Number" v-model="nums" /> |
| | | </div> |
| | | <div class="right_sw flexJy" style="width: auto"> |
| | | <div class="addorj" @click="gdJian"> |
| | | <!-- <div class="addorj" @click="gdJian"> |
| | | <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> |
| | | <div class="num"> |
| | |
| | | </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" |
| | | v-model="num" |
| | | @input="numInput" |
| | | /> |
| | | </div> |
| | | <div class="right_sw flexJy" style="width: auto"> |
| | | <div class="addorj" @click="jyslJian"> |
| | | <!-- <div class="addorj" @click="jyslJian"> |
| | | <img src="@/assets/img/ic_number_jian.png" /> |
| | | </div> |
| | | <div class="addorj"></div> |
| | | <div class="addorj" @click="jjjisua"> |
| | | <img src="@/assets/img/ic_number_add.png" /> |
| | | </div> |
| | | </div> --> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="tr_rs gg" @click="showGg = true"> |
| | |
| | | </div> |
| | | |
| | | <div class="bottom_bzz"> |
| | | <span> |
| | | <span v-if="priceTabsCurrentIndex == 0"> |
| | | {{ |
| | | ((nowPrice * selectCycle.replace("X", "")) * num) |
| | | (nums * selectCycle.replace("X", "") * num) |
| | | | _toLocaleString |
| | | }} |
| | | </span> |
| | | <span v-else> |
| | | {{ |
| | | (nums * selectCycle.replace("X", "") * num) |
| | | | _toLocaleString |
| | | }} |
| | | </span> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="switchs"> |
| | | <div class="switchs"> |
| | | <div class="zy"> |
| | | <div class="left_zy"> |
| | | <span>{{ $t("hj104") }}</span> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="zy" v-show="checkedZy"> |
| | | <div class="left_zy"> |
| | | <!-- <div class="left_zy"> |
| | | <input v-model="profitTarget" onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" |
| | | @input="zyInt" /> |
| | | </div> --> |
| | | <div class="left_zy"> |
| | | <input |
| | | v-model.number="profitTarget" |
| | | inputmode="numeric" |
| | | @input="zyInt" |
| | | /> |
| | | </div> |
| | | <div class="right_sw" style="width: auto"> |
| | | <div class="addorj" @click="zYjian"> |
| | | <img src="@/assets/img/ic_number_jian.png" /> |
| | | </div> |
| | | <div class="addorj"></div> |
| | | <div class="addorj" |
| | | @click="tabsCurrentIndex==0?profitTarget = (Number(profitTarget) + 1).toFixed(2):profitTarget = (Number(profitTarget) + 1).toFixed(2)"> |
| | | <div |
| | | class="addorj" |
| | | @click=" |
| | | tabsCurrentIndex == 0 |
| | | ? (profitTarget = (Number(profitTarget) + 1).toFixed(2)) |
| | | : (profitTarget = (Number(profitTarget) + 1).toFixed(2)) |
| | | " |
| | | > |
| | | <img src="@/assets/img/ic_number_add.png" /> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="zy" v-show="checkedZs"> |
| | | <div class="left_zy"> |
| | | <!-- <div class="left_zy"> |
| | | <input v-model="zhisun" onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" @input="zsInt" /> |
| | | </div> --> |
| | | <div class="left_zy"> |
| | | <input inputmode="numeric" v-model.number="zhisun" @input="zsInt" /> |
| | | </div> |
| | | <div class="right_sw" style="width: auto"> |
| | | <div class="addorj" |
| | | @click="zSjian"> |
| | | <div class="addorj" @click="zSjian"> |
| | | <img src="@/assets/img/ic_number_jian.png" /> |
| | | </div> |
| | | <div class="addorj"></div> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> --> |
| | | </div> |
| | | <div class="btn_buy" @click="gdOrSetBuy()"> |
| | | <div :class="tabsCurrentIndex == 0 ? 'maichu' : ''"> |
| | | <span>{{ tabsCurrentIndex == 0 ? $t("hj84") : $t("hj85") }}</span> |
| | | </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" |
| | | /> |
| | | <van-popup |
| | | v-model="show" |
| | | :style="{ |
| | | minHeight: '20%', |
| | | borderTopLeftRadius: '10px', |
| | | borderTopRightRadius: '10px', |
| | | }" |
| | | position="bottom" |
| | | > |
| | | <div class="popup-box"> |
| | | <div class="input-box"> |
| | | <div class="laber">{{ $t("秘钥") }}:</div> |
| | | <input type="text" :maxlength="9" v-model="password" /> |
| | | </div> |
| | | |
| | | <van-button class="but" type="info" @click="setBuy"> |
| | | {{ $t("立即购买") }} |
| | | </van-button> |
| | | </div> |
| | | </van-popup> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import * as api from "@/axios/api"; |
| | | import { |
| | | mapActions |
| | | } from "vuex"; |
| | | import { mapActions } from "vuex"; |
| | | |
| | | export default { |
| | | name: "trBuy", |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | password: "", |
| | | show: false, |
| | | tradingArr: [this.$t("hj84"), this.$t("hj85")], |
| | | tabsCurrentIndex: 0, |
| | | // priceTabs: [this.$t("hj108"), this.$t("hj109")], |
| | | priceTabs: [this.$t("hj108")], |
| | | priceTabs: [this.$t("hj108"), this.$t("hj109")], |
| | | // priceTabs: [this.$t("hj108")], |
| | | priceTabsCurrentIndex: 0, |
| | | num: 1, |
| | | nums: 1, |
| | |
| | | if_us: 0, |
| | | bayType: "", |
| | | id: "", |
| | | actions: [{ |
| | | actions: [ |
| | | { |
| | | name: "100X", |
| | | subname: this.$t("hj102") |
| | | subname: this.$t("hj102"), |
| | | }, |
| | | { |
| | | name: "200X", |
| | | subname: this.$t("hj102") |
| | | subname: this.$t("hj102"), |
| | | }, |
| | | { |
| | | name: "300X", |
| | | subname: this.$t("hj102") |
| | | subname: this.$t("hj102"), |
| | | }, |
| | | ], |
| | | profitArr: [{ |
| | | profitArr: [ |
| | | { |
| | | name: this.$t("hj104"), |
| | | checked: false, |
| | | }, |
| | |
| | | }, |
| | | methods: { |
| | | 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"]), |
| | | numInput(e) { |
| | | // this.nowPrice / this.selectCycle.replace("X", "") |
| | | // this.moneyData.availableBalance |
| | | let numbs = Math.floor( |
| | | this.moneyData.availableBalance / |
| | | this.nowPrice / |
| | | this.selectCycle.replace("X", "") |
| | | ); |
| | | if (e.target.value >= numbs) { |
| | | this.num = numbs; |
| | | } |
| | | // let numbs = Math.floor( |
| | | // this.moneyData.availableBalance / |
| | | // this.nowPrice / |
| | | // this.selectCycle.replace("X", "") |
| | | // ); |
| | | // if (e.target.value >= numbs) { |
| | | // this.num = numbs; |
| | | // } |
| | | // if() |
| | | console.log(e.target.value); |
| | | }, |
| | |
| | | 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++; |
| | |
| | | // } |
| | | }, |
| | | zsInt(e) { |
| | | if (typeof e.target.value === "string") { |
| | | this.zhisun = this.nowPrice; |
| | | } else { |
| | | if (Number(e.target.value) > this.nowPrice) { |
| | | this.zhisun = this.nowPrice; |
| | | } |
| | | } |
| | | console.log(e); |
| | | // if (typeof e.target.value === "string") { |
| | | // this.zhisun = this.nowPrice; |
| | | // } else { |
| | | // if (Number(e.target.value) > this.nowPrice) { |
| | | // this.zhisun = this.nowPrice; |
| | | // } |
| | | // } |
| | | }, |
| | | zyInt(e) { |
| | | if (typeof e.target.value === "string") { |
| | | this.profitTarget = this.nowPrice; |
| | | } else { |
| | | if (Number(e.target.value) < Number(this.nowPrice)) { |
| | | this.profitTarget = Number(this.nowPrice); |
| | | } |
| | | } |
| | | console.log(e); |
| | | // if (typeof e.target.value === "string") { |
| | | // this.profitTarget = this.nowPrice; |
| | | // } else { |
| | | // if (Number(e.target.value) < Number(this.nowPrice)) { |
| | | // this.profitTarget = Number(this.nowPrice); |
| | | // } |
| | | // } |
| | | }, |
| | | onSelect(val) { |
| | | this.selectCycle = val.name; |
| | | this.selectLever = val.label; |
| | | }, |
| | | gdOrSetBuy() { |
| | | if (this.priceTabsCurrentIndex == 0) { |
| | | |
| | | async checkcheckStockVip() { |
| | | // this.$refs.closeDialog.show = true; |
| | | let data = await api.checkStockVip({ stockCode: this.code }); |
| | | console.log(data, "data"); |
| | | if (!data.data) { |
| | | this.password = ""; |
| | | this.setBuy(); |
| | | } else { |
| | | |
| | | this.show = true; |
| | | } |
| | | }, |
| | | gdOrSetBuy() { |
| | | if (this.priceTabsCurrentIndex == 0) { |
| | | this.checkcheckStockVip(); |
| | | } else { |
| | | this.gdBuy(); |
| | | } |
| | | if (navigator.vibrate) { |
| | |
| | | // 股票买入 |
| | | async gpBuy(opts) { |
| | | opts.stockId = this.id; |
| | | opts.password = this.password; |
| | | let data = await api.buy(opts); |
| | | this.buying = false; |
| | | if (data.status === 0) { |
| | |
| | | |
| | | 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 = { |
| | | label: val, |
| | | name: val + "X" |
| | | name: val + "X", |
| | | }; |
| | | this.siteLeverList.push(item); |
| | | } |
| | |
| | | /deep/.van-popup { |
| | | z-index: 10001 !important; |
| | | } |
| | | |
| | | .popup-box { |
| | | padding: 30px 20px; |
| | | .input-box { |
| | | height: 1.3rem; |
| | | background: #f3f3f3; |
| | | border-radius: 0.15rem; |
| | | |
| | | line-height: 1.3rem; |
| | | padding-left: 10px; |
| | | display: flex; |
| | | padding-left: 0.2rem; |
| | | font-size: 0.3975rem; |
| | | .laber { |
| | | margin-right: 10px; |
| | | } |
| | | // margin-top: 0.8rem; |
| | | } |
| | | .but { |
| | | width: 100%; |
| | | height: 1.3rem; |
| | | border-radius: 0.15rem; |
| | | background: #5c288c; |
| | | color: #fff; |
| | | font-size: 0.4615rem; |
| | | margin-top: 0.5rem; |
| | | } |
| | | .shijian { |
| | | width: 100%; |
| | | margin-top: 0.5rem; |
| | | margin-bottom: 0.5rem; |
| | | .xgsj { |
| | | margin-top: 10px; |
| | | font-size: 0.3875rem; |
| | | // font-weight: 600; |
| | | display: -webkit-box; |
| | | display: -ms-flexbox; |
| | | display: flex; |
| | | height: 50%; |
| | | -webkit-box-align: center; |
| | | -ms-flex-align: center; |
| | | align-items: center; |
| | | .sjtlt { |
| | | width: 33%; |
| | | margin-left: 0.4rem; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </style> |