ソースを参照

:sparkles: 账户审核+历史均价;clg消除,最大可买入限额

Ritchie 1 年間 前
コミット
41ee4d96ab

+ 1 - 6
src/assets/language/zh.json

@@ -46,12 +46,7 @@
     "mainland": "大陆",
     "overseas": "港澳台及海外"
   },
-  "navBar": {
-    "homePage": "首页",
-    "tradingInformation": "设备信息",
-    "machineRanking": "机器排行",
-    "personalCenter": "个人中心"
-  },
+  
   "advertManage": {
     "advertisingNameLabel": "广告名称",
     "advertisingNamePlaceholder": "请输入广告名称",

+ 1 - 1
src/router/index.js

@@ -221,7 +221,7 @@ router.beforeEach((to, from, next) => {
       router.push("/login");
     } else {
       const userObject = JSON.parse(user);
-      console.log("userObject >>>", userObject);
+      // console.log("userObject >>>", userObject);
       // 登录信息异常跳转登录页面
       if (!userObject) {
         router.push("/login");

+ 1 - 1
src/views/buyOrSell/BuyConfList.vue

@@ -46,7 +46,7 @@ const getList = async () => {
     const { data } = await getBuyConfList(
         Object.assign({}, searchParams)
     );
-    console.log("买入列表 >>>", data.data);
+    // console.log("买入列表 >>>", data.data);
     if (data.code === "00000") {
         if (searchParams.current === 0) {
             buyConfList.value = [];

+ 1 - 1
src/views/feedback/FeedbackIndex.vue

@@ -11,7 +11,7 @@ let languageName = ref(getLocal("curLang"));
 onMounted(() => {
     // 加载样式
     // styleUrl('feedback');
-    console.log(languageName.value);
+    // console.log(languageName.value);
     if (languageName.value == 'zh') {
         surveyUrl.value = 'https://form.antdv.com/r/666c079f89b600d7';
     } else {

+ 2 - 2
src/views/login/LoginIndex.vue

@@ -107,8 +107,8 @@ export default {
       }
       const { data } = await login(loginParam);
 
-      console.log("记住密码?", checked.value);
-      console.log("data.code", data.code);
+      // console.log("记住密码?", checked.value);
+      // console.log("data.code", data.code);
       if (data.code === "00000") {
         setLocal("loginUser", JSON.stringify(data.data));
         if (checked.value) {

+ 3 - 3
src/views/login/Register.vue

@@ -4,8 +4,8 @@
     <s-header :name="$t('register.header')" :noback="false"></s-header>
     <div class="registerFormBox">
       <van-form @submit="registerSubmit">
-        <!-- 姓名昵称 -->
-        <van-field v-model="userName" name="userName" label="姓名昵称" :placeholder="$t('register.usernamePlaceholder')"
+        <!-- 用户昵称 -->
+        <van-field v-model="userName" name="userName" label="用户昵称" :placeholder="$t('register.usernamePlaceholder')"
           :rules="[{ pattern: /^[a-zA-Z0-9]+$/, message: $t('register.usernameRequired') }]" />
         <br>
         <!-- <van-field v-model="actualName" name="actualName" :label="$t('register.nameLabel')" placeholder="请输入真实姓名"
@@ -276,7 +276,7 @@ export default {
       });
 
       if (data.code === '00000') {
-        showToast('注册成功');
+        showToast('注册成功,待审核');
         router.push({ path: '/login' });
       } else {
         showFailToast(data.message);

+ 1 - 1
src/views/position/PositionIndex.vue

@@ -203,7 +203,7 @@ const getList = async () => {
     finished.value = false;
     const params = Object.assign({}, searchParams);
     const { data } = await listMyOrderHis(params);
-    console.log("data.data >>>", data.data);
+    // console.log("data.data >>>", data.data);
     if (data.code === "00000") {
         if (searchParams.current === 0) {
             orderHisList.value = [];

+ 1 - 1
src/views/taskMessage/PendingOrderList.vue

@@ -66,7 +66,7 @@ const getList = async () => {
     );
     pendingOrderTotal.value = data.data.total;
     if (pendingOrderList.value.length === data.data.total) {
-      console.log("object", pendingOrderTotal.value);
+      // console.log("object", pendingOrderTotal.value);
       finished.value = true;
     }
     loading.value = false;

+ 29 - 9
src/views/taskMessage/TaskAccount.vue

@@ -14,8 +14,8 @@ const allowMaximum = ref('')  // 允许最大份额
 const cardNo = ref('')
 const buyPriorityRank = ref('')  // 买卖优先级/奋斗贡献值,文字
 const level = ref('')  // 买卖优先级/奋斗贡献值,值
-const initStockNum = ref('')  // 初始股票份额
-const initStockPrice = ref('')  // 历史股票均价
+const initStockNum = ref(0)  // 初始股票份额
+const initStockPrice = ref(0)  // 历史股票均价
 const applyId = ref('');
 
 const userStore = useUserStore();
@@ -68,20 +68,34 @@ onBeforeUnmount(() => {
   userStore.clearUserInfo();
 });
 
+const isNumberVaild = (val, regex) => {
+  return regex.test(val) || val === '';
+}
+
 const validateStockNum = (val) => {
   const regex = /^([1-9]\d{0,4}|100000|0)$/;
-  return regex.test(val) || val === '' ? true : '请输入[0,100000]范围内整数';
+  if (!isNumberVaild(val, regex)) {
+    return '请输入[0,100000]范围内整数';
+  }
+  const initStocks = parseInt(val, 10);
+  const maxStocks = parseInt(allowMaximum.value, 10);
+  if (initStocks > maxStocks) {
+    return '初始份额不能大于最大份额'
+  }
+  return true;
 }
 
 const validateHisAverage = (val) => {
   const regex = /^(0|[1-9][0-9]{0,5})(\.[0-9]{1,2})?$/;
-  return regex.test(val) || val === '' ? true : '请输入有效数字,最多保留2位小数';
+  // if (initStockNum.value != 0 && val === 0) {
+  //   return '初始股票分额不为0时,历史均价不能为0'
+  // }
+  if (!isNumberVaild(val, regex)) {
+    return '请输入有效数字,最多保留2位小数'
+  }
+  return true;
 };
 
-// const showHisAverage = computed(() => {
-//   return stockNum.value > 0;
-// });
-
 // 拒绝
 const rejectApply = async () => {
   const userCheck = {
@@ -111,7 +125,13 @@ const approveApply = async () => {
     return;
   }
 
-  console.log("allowMaximum >>>", allowMaximum.value);
+  // 再次打印以确保在条件判断前查看值
+  if (initStockNum.value !== 0 && initStockPrice.value == 0) {
+    showFailToast('初始股票分额不为0时,历史均价不能为0');
+    return;
+  }
+
+  // console.log("allowMaximum >>>", allowMaximum.value);
   const userCheck = {
     allowMaximum: allowMaximum.value,
     level: level.value,

+ 2 - 2
src/views/taskMessage/UserManage.vue

@@ -39,7 +39,7 @@ const minDate = ref(new Date(2024, 4, 1))
 
 onMounted(() => {
     if (userStore.userInfo) {
-        console.log("userStore.userInfo >>>", userStore.userInfo);
+        // console.log("userStore.userInfo >>>", userStore.userInfo);
         userName.value = userStore.userInfo.userName;
         phone.value = userStore.userInfo.phone;
         identityCard.value = userStore.userInfo.identityCard;
@@ -63,7 +63,7 @@ const banUserClc = async () => {
     const startTimeFmt = dateUtil.formateDate(startTimeDate, "yyyy-MM-dd") + " 00:00:00";
     const endTimeFmt = dateUtil.formateDate(endTimeDate, "yyyy-MM-dd") + " 00:00:00";
     
-    console.log("Fmt >>>", startTimeFmt, endTimeFmt);
+    // console.log("Fmt >>>", startTimeFmt, endTimeFmt);
     const userCheck = {
         startTime: startTimeFmt,
         endTime: endTimeFmt,

+ 5 - 4
src/views/trading/TradingBuy.vue

@@ -25,12 +25,13 @@ onMounted(async () => {
 })
 
 
-const onSubmitBuy = async (values) => {
+const onSubmitBuy = async () => {
+  // const onSubmitBuy = async (values) => {
   try {
     const result = await queryAllowPendNum();
     if (result.data.code === "00000") {
       allowMaximum.value = result.data.data.allowBuyNum;
-      console.log("允许挂单份额 >>>", allowMaximum.value);
+      // console.log("允许挂单份额 >>>", allowMaximum.value);
     }
 
     // 等待用户确认对话框
@@ -40,7 +41,7 @@ const onSubmitBuy = async (values) => {
     });
 
     if (confirmation) {
-      console.log('submitBuy', values);
+      // console.log('submitBuy', values);
       const entrustNumber = parseInt(buyNum.value, 10);
       const price = parseFloat(unitPrice.value);
       const params = {
@@ -57,7 +58,7 @@ const onSubmitBuy = async (values) => {
       }
     } else {
       // 用户取消了对话框
-      console.log('用户取消了挂单操作');
+      console.log('Canceled the pending order');
     }
   } catch (error) {
     console.error('处理买入挂单时发生错误:', error);

+ 7 - 6
src/views/trading/TradingSell.vue

@@ -27,12 +27,13 @@ onMounted(async () => {
     }
 })
 
-const onSubmitSell = async (values) => {
+const onSubmitSell = async () => {
+    // const onSubmitSell = async (values) => {
     try {
         const result = await queryAllowPendNum();
         if (result.data.code === "00000") {
             allowMaximum.value = result.data.data.allowSellNum;
-            console.log("允许挂单份额 >>>", allowMaximum.value);
+            // console.log("允许挂单份额 >>>", allowMaximum.value);
         }
 
         // 等待用户确认对话框
@@ -42,10 +43,10 @@ const onSubmitSell = async (values) => {
         });
         // 这里的代码将在确认对话框确定后执行
         if (confirmation) {
-            console.log('submitSell', values);
+            // console.log('submitSell', values);
             const entrustNumber = parseInt(sellNum.value, 10);
             const price = parseFloat(unitPrice.value);
-            console.log("数量+价格", entrustNumber, price);
+            // console.log("数量+价格", entrustNumber, price);
             const params = {
                 entrustNumber: entrustNumber,
                 price: price,
@@ -53,14 +54,14 @@ const onSubmitSell = async (values) => {
             }
             const { data } = await addPendOrder(params);
             if (data.code === '00000') {
-                console.log("data.data >>>", data.data);
+                // console.log("data.data >>>", data.data);
                 showSuccessToast("卖出挂单成功")
             } else {
                 showFailToast(data.message);
             }
         } else {
             // 用户取消了对话框
-            console.log('用户取消了挂单操作');
+            console.log('Canceled the pending order');
         }
 
     } catch (error) {

+ 4 - 4
src/views/user/UserIndex.vue

@@ -15,7 +15,7 @@
           <div class="userId">
             <!-- <p class="userText">{{ accountDetail.stockNum }}</p> -->
             <p class="userText">{{ stockShares }}</p>
-            <p class="userText">最大限额</p>
+            <p class="userText">可买限额</p>
           </div>
           <!-- 竖线 -->
           <div class="userLine"></div>
@@ -218,8 +218,8 @@ export default {
 
     const isAdmin = ref()
 
-    const adminId = ref('')
-    console.log("adminId", adminId);
+    // const adminId = ref('')
+    // console.log("adminId", adminId);
 
     const checkIsAdmin = async () => {
       if (user.phone === "13245678901") {
@@ -411,7 +411,7 @@ export default {
 
     // 选择地区完成
     const areaPopFinish = async (e) => {
-      console.log("e", e);
+      // console.log("e", e);
       accountDetail.value.areaId = e.selectId;
       const params = {
         userId: user.id,