浏览代码

feat:新增计算规则、手续费小于1天按1天算

leo 1 年之前
父节点
当前提交
99b9b94905
共有 1 个文件被更改,包括 4 次插入5 次删除
  1. 4 5
      pages/transferDuration/components/tansferDuration.vue

+ 4 - 5
pages/transferDuration/components/tansferDuration.vue

@@ -206,19 +206,18 @@ export default {
             if (this.countLoading) return
             if (bool) this.countLoading = true
             const arr = this.countObj.list.sort((a, b) => {
-                console.log(a, b)
                 return a.timeConsumingEnd - b.timeConsumingEnd
             })
             let commission = null
             for (const i of arr) {
-                if (this.params.transferTime <= i.timeConsumingEnd) {
+                if (+this.params.transferTime <= i.timeConsumingEnd) {
                     commission = i.commission
                     break
                 }
             }
-
             if (!commission) commission = this.countObj.commissionSet
-            this.serviceCharge = +new BigNumber(this.params.transferTime).times(new BigNumber(commission).div(100))
+            const serviceCharge = +new BigNumber(this.params.transferTime).times(new BigNumber(commission).div(100))
+            this.serviceCharge =  serviceCharge < 1 ? 1 : serviceCharge
             this.countLoading = false
             if (bool) this.changePopUpType(1)
         },
@@ -296,7 +295,7 @@ export default {
     .transfer-btn {
         padding: 0 16px;
         height: 48px;
-
+        margin-top: 20px;
         .van-button {
             height: 100%;
             border-radius: 5px;