| | |
| | | <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> |
| | |
| | | " |
| | | > |
| | | <img src="@/assets/img/ic_number_add.png" /> |
| | | </div> --> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="num"> |
| | |
| | | /> |
| | | </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 class="bottom_bzz"> |
| | | <span v-if="priceTabsCurrentIndex == 0"> |
| | | {{ |
| | | (nums * selectCycle.replace("X", "") * num) |
| | | (nowPrice * selectCycle.replace("X", "") * num) |
| | | | _toLocaleString |
| | | }} |
| | | </span> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { ActionSheet } from "vant"; |
| | | import * as api from "@/axios/api"; |
| | | import { mapActions } from "vuex"; |
| | | import { Notify } from "vant"; |
| | | |
| | | export default { |
| | | name: "trBuy", |
| | |
| | | this.priceTabsCurrentIndex = index; |
| | | }, |
| | | jjjisua() { |
| | | let numbs = Math.floor( |
| | | this.moneyData.availableBalance / |
| | | this.nowPrice / |
| | | this.selectCycle.replace("X", "") |
| | | ); |
| | | // let numbs = Math.floor( |
| | | // this.moneyData.availableBalance / |
| | | // this.nowPrice / |
| | | // this.selectCycle.replace("X", "") |
| | | // ); |
| | | 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) { |
| | | this.num = numbs; |
| | | } |
| | | // console.log(this.num, numbs); |
| | | // if (this.num >= numbs) { |
| | | // this.num = numbs; |
| | | // } |
| | | }, |
| | | jyslJian() { |
| | | console.log(this.num); |
| | | if (typeof this.num === "string") { |
| | | this.num = 1; |
| | | } else { |
| | |
| | | }, |
| | | async checkcheckStockVip() { |
| | | // this.$refs.closeDialog.show = true; |
| | | let data = await api.checkStockVip({ stockCode: this.code }); |
| | | const opts = { |
| | | stockId: this.id, |
| | | buyNum: this.num, |
| | | lever: this.selectLever, |
| | | } |
| | | if (this.checkedZs) { |
| | | opts.stopLoss = this.zhisun; |
| | | } |
| | | if (this.checkedZy) { |
| | | opts.profitTarget = this.profitTarget; |
| | | } |
| | | if (this.tabsCurrentIndex == 0) { |
| | | opts.buyType = 1; |
| | | } else { |
| | | opts.buyType = 0; |
| | | } |
| | | let data = await api.checkStockVip(opts); |
| | | console.log(data, "data"); |
| | | if (!data.data) { |
| | | if (data.data == 0) { |
| | | this.password = ""; |
| | | this.setBuy(); |
| | | } else if (data.data == 1) { |
| | | this.password = ""; |
| | | Notify({ type: "success", message: this.$t("购买申请成功") }); |
| | | this.$router.push("/warehouse?index=1&buyType=" + this.bayType); |
| | | } else { |
| | | this.show = true; |
| | | } |
| | |
| | | } |
| | | }, |
| | | }, |
| | | components: { ActionSheet, [Notify.Component.name]: Notify.Component }, |
| | | }; |
| | | </script> |
| | | |