From 8d266864fc30d12419dac13b9f34544004a74c0e Mon Sep 17 00:00:00 2001
From: dcc <dcc@163.com>
Date: Wed, 10 Jul 2024 17:46:42 +0800
Subject: [PATCH] 123

---
 src/page/trading/buy.vue |   27 +++++++++++++++++++++++++--
 1 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/src/page/trading/buy.vue b/src/page/trading/buy.vue
index 4c6a395..dbc81ee 100644
--- a/src/page/trading/buy.vue
+++ b/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>
 

--
Gitblit v1.9.3