From 19061b17591c3a2310348033eb51194f5a9a4527 Mon Sep 17 00:00:00 2001
From: zzzz <690498789@qq.com>
Date: Tue, 09 Apr 2024 11:40:10 +0800
Subject: [PATCH] first commit

---
 src/page/trading/buy.vue |   29 ++++++++++++++++++-----------
 1 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/src/page/trading/buy.vue b/src/page/trading/buy.vue
index 14c23b0..e3edf13 100644
--- a/src/page/trading/buy.vue
+++ b/src/page/trading/buy.vue
@@ -228,6 +228,7 @@
 
 <script>
 import * as api from "@/axios/api";
+import { mapActions } from "vuex";
 
 export default {
   name: "trBuy",
@@ -313,7 +314,7 @@
     } else if (this.bayType == "qh") {
       this.priceTabs = [this.$t("hj108")];
     }
-    this.getUserInfo();
+    this.setUseInfo();
     this.getMoneyData();
     this.getSettingInfo();
   },
@@ -332,6 +333,8 @@
     },
   },
   methods: {
+    ...mapActions(["setUseInfo"]),
+
     async getMoneyData() {
       let data = await api.getMoney();
       let type = this.bayType === "SZHB" ? "US" : this.bayType;
@@ -476,15 +479,7 @@
         this.$router.push("/authentications");
         return;
       }
-      // if (!this.agree) {
-      //   Toast('需同意合作协议才能交易!')
-      // } else if (isNull(this.selectNumber) && isNull(this.autoNumber)) {
-      //   Toast('请选择购买手数')
-      // } else if (isNull(this.selectType)) {
-      //   Toast('请选择买卖方向')
-      // } else if(isNull(this.subaccountNumber)) {
-      //   Toast('请选择子账户')
-      // } else {}
+
       if (this.buying) {
         return;
       }
@@ -538,7 +533,19 @@
           elAlertType: "success",
         });
         this.getUserInfo();
-        this.$router.push("/warehouse?index=0");
+        var buyType = "";
+        if (this.tabsCurrentIndex == 0) {
+          buyType = 1;
+        } else {
+          buyType = 0;
+        }
+        if (this.bayType == "US") {
+          this.$router.push("/warehouse?index=1&buyType=" + buyType);
+        } else if (this.bayType == "MAS") {
+          this.$router.push("/warehouse?index=0&buyType=" + buyType);
+        } else {
+          this.$router.push("/warehouse");
+        }
       } else {
         if (data.msg.indexOf("不在交易时段内") > -1) {
           this.$store.commit("elAlertShow", {

--
Gitblit v1.9.3