Browse Source

金额保留两位小数

王涛 3 years ago
parent
commit
068b47390c
2 changed files with 7 additions and 25 deletions
  1. 4 3
      src/views/amount/index.vue
  2. 3 22
      src/views/recharge/index.vue

+ 4 - 3
src/views/amount/index.vue

@@ -431,7 +431,7 @@ export default {
       }
       if(localStorage.getItem("type")){
         axios.post('/dxtop/order/topScanPayApi', {
-            "money": money,
+            "money": Number(money).toFixed(2),
             "topPayType": topPayType,
             "payType": payType,
             "channelId": channelId,
@@ -459,7 +459,7 @@ export default {
                 channelName = "外包人员充值"
               }
               axios.post('/dxtop/order/topScanPayApi', {
-                  "money": money,
+                  "money": Number(money).toFixed(2),
                   "topPayType": topPayType,
                   "payType": payType,
                   "channelName":channelName,
@@ -475,7 +475,7 @@ export default {
               })
             }else{
               axios.post('/dxtop/order/topScanPayApi', {
-                  "money": money,
+                  "money": Number(money).toFixed(2),
                   "topPayType": topPayType,
                   "payType": payType,
                   "channelId": channelId,
@@ -557,6 +557,7 @@ export default {
       this.isWeixinOrAlipay();
       this.jumpMode();
       if(this.env == "WeiXin" || this.env == "Alipay"){
+        
       }else{
         this.$router.push({
           path: "/recharge",

+ 3 - 22
src/views/recharge/index.vue

@@ -132,7 +132,7 @@ export default {
                 channelName = "外包人员充值"
               }
               axios.post('/dxtop/order/callUnifiedPay', {
-                "money": money,
+                "money": Number(money).toFixed(2),
                 "topPayType": topPayType,
                 "payType": payType,
                 "channelName":channelName,
@@ -150,7 +150,7 @@ export default {
               })
             }else{
               axios.post('/dxtop/order/callUnifiedPay', {
-                "money": money,
+                "money": Number(money).toFixed(2),
                 "topPayType": topPayType,
                 "payType": payType,
                 "scene": 3,
@@ -320,26 +320,7 @@ export default {
 
           }
         }
-        // window.setTimeout(() => {
-        //   const timeOutDateTime = +new Date();
-        //   if (timeOutDateTime - loadDateTime > 2000) {
-        //     window.location.href = url.downI;
-        //     this.loading = false;
-        //   } else {
-        //     window.close();
-        //     this.loading = false;
-        //     Dialog.confirm({
-        //       title: "提示",
-        //       message: "是否已完成充值?",
-        //     })
-        //     .then(() => {
-        //       this.$router.push("/record");
-        //     })
-        //     .catch((e) => {
-        //       console.log(e);
-        //     });
-        //   }
-        // }, 3000);
+        
       }else{
         Toast("请使用手机端支付")
       }