Jelajahi Sumber

提交时后端不要小数点

lifanagju_citu 9 bulan lalu
induk
melakukan
797bf6fca1
1 mengubah file dengan 3 tambahan dan 3 penghapusan
  1. 3 3
      src/utils/position.js

+ 3 - 3
src/utils/position.js

@@ -99,8 +99,8 @@ export const commissionCalculation = (count, type) => {
   return value % 1 === 0 ? Math.floor(value) : value.toFixed(2)
 }
 
-// type: emit-> 提交(需要*100) real-> 回显(需要/100)
+// type: emit-> 提交(需要*100) realPay-> 回显(需要/100)
 export const payCalculation = (count, type) => {
-  const Magnification = type === 'show' ? 1/100 : 100
-  return ((count - 0)*Magnification).toFixed(2)
+  const Magnification = type === 'emit' ? 100 : 1/100 
+  return type === 'emit' ? (count - 0)*Magnification : ((count - 0)*Magnification).toFixed(2)
 }