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/locales/en.json | 3 ++-
src/locales/zh.json | 3 ++-
src/page/trading/buy.vue | 27 +++++++++++++++++++++++++--
src/locales/hi.json | 3 ++-
4 files changed, 31 insertions(+), 5 deletions(-)
diff --git a/src/locales/en.json b/src/locales/en.json
index 11817c3..fe295b0 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -582,5 +582,6 @@
"当前委托": "Current Commission",
"撤销挂单": "Cancel pending order",
"立即购买": "Buy it now",
- "秘钥": "Secret key"
+ "秘钥": "Secret key",
+ "购买申请成功": "Purchase application successful"
}
diff --git a/src/locales/hi.json b/src/locales/hi.json
index ddf597a..cfe705a 100644
--- a/src/locales/hi.json
+++ b/src/locales/hi.json
@@ -581,5 +581,6 @@
"当前委托": "अभी का ऑर्डर",
"撤销挂单": "लंबित आदेश रद्द करें",
"立即购买": "इसे अभी खरीदें",
- "秘钥": "गुप्त कुंजी"
+ "秘钥": "गुप्त कुंजी",
+ "购买申请成功": "खरीदारी आवेदन सफल"
}
diff --git a/src/locales/zh.json b/src/locales/zh.json
index 446b773..f104325 100644
--- a/src/locales/zh.json
+++ b/src/locales/zh.json
@@ -571,5 +571,6 @@
"当前委托": "当前委托",
"撤销挂单": "撤销挂单",
"立即购买": "立即购买",
- "秘钥": "秘钥"
+ "秘钥": "秘钥",
+ "购买申请成功": "购买申请成功"
}
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