Bladeren bron

:art: 初始股票分额与历史均价

Ritchie 1 jaar geleden
bovenliggende
commit
b0404df04e
2 gewijzigde bestanden met toevoegingen van 8 en 8 verwijderingen
  1. 1 1
      src/views/position/PositionIndex.vue
  2. 7 7
      src/views/taskMessage/TaskAccount.vue

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

@@ -39,7 +39,7 @@
                                     <div class="main6 flex-col justify-between align-center">
                                         <span :class="{ 'word5': true, 'green-color': isNegative(dailyDiff) }">{{
                                             twoNumber(dailyDiff) }}</span>
-                                        <span class="word6">当日盈亏¥</span>
+                                        <span class="word6">本轮盈亏¥</span>
                                     </div>
                                 </div>
 

+ 7 - 7
src/views/taskMessage/TaskAccount.vue

@@ -14,8 +14,8 @@ const allowMaximum = ref('')  // 允许最大份额
 const cardNo = ref('')
 const buyPriorityRank = ref('')  // 买卖优先级/奋斗贡献值,文字
 const level = ref('')  // 买卖优先级/奋斗贡献值,值
-const stockNum = ref('')  // 初始股票份额
-const hisAverage = ref('')  // 历史股票均价
+const initStockNum = ref('')  // 初始股票份额
+const initStockPrice = ref('')  // 历史股票均价
 const applyId = ref('');
 
 const userStore = useUserStore();
@@ -74,7 +74,7 @@ const validateStockNum = (val) => {
 }
 
 const validateHisAverage = (val) => {
-  const regex = /^(0|[1-9][0-9]{0,5}\.[0-9]{0,2})$/;
+  const regex = /^(0|[1-9][0-9]{0,5})(\.[0-9]{1,2})?$/;
   return regex.test(val) || val === '' ? true : '请输入有效数字,最多保留2位小数';
 };
 
@@ -115,8 +115,8 @@ const approveApply = async () => {
   const userCheck = {
     allowMaximum: allowMaximum.value,
     level: level.value,
-    stockNum: stockNum.value,
-    hisAverage: hisAverage.value,
+    initStockNum: initStockNum.value,
+    initStockPrice: initStockPrice.value,
     applyId: applyId.value,
     pass: true
   }
@@ -156,9 +156,9 @@ const approveApply = async () => {
         </van-popup>
         <van-field v-model="allowMaximum" name="允许买入的最大份额" label="最大买入份额" placeholder="允许买入的最大份额" left-icon="points"
           :rules="[{ required: true, message: '最大份额不能为空' }]" />
-        <van-field v-model="stockNum" name="初始股票份额" label="初始股票份额" placeholder="初始股票份额(默认为0)" left-icon="balance-o"
+        <van-field v-model="initStockNum" name="初始股票份额" label="初始股票份额" placeholder="初始股票份额(默认为0)" left-icon="balance-o"
           :rules="[{ validator: validateStockNum }]" />
-        <van-field v-model="hisAverage" name="历史股票均价" label="历史股票均价" placeholder="历史股票均价(默认为0)"
+        <van-field v-model="initStockPrice" name="历史股票均价" label="历史股票均价" placeholder="历史股票均价(默认为0)"
           left-icon="gold-coin-o" :rules="[{ validator: validateHisAverage }]" />
       </van-cell-group>
       <div style="margin: 20px 30px; display: flex; justify-content: center; align-items: center; gap: 50px;">