123
dcc
2024-07-10 8d266864fc30d12419dac13b9f34544004a74c0e
src/page/trading/buy.vue
@@ -244,8 +244,10 @@
</template>
<script>
import { ActionSheet } from "vant";
import * as api from "@/axios/api";
import { mapActions } from "vuex";
import { Notify } from "vant";
export default {
  name: "trBuy",
@@ -515,11 +517,31 @@
    },
    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;
      }
@@ -750,6 +772,7 @@
      }
    },
  },
  components: { ActionSheet, [Notify.Component.name]: Notify.Component },
};
</script>