MONSTER-ygh 1 рік тому
батько
коміт
fc8a48bf8a
3 змінених файлів з 31 додано та 34 видалено
  1. 8 15
      package-lock.json
  2. 18 15
      package.json
  3. 5 4
      pages/cash/index.vue

+ 8 - 15
package-lock.json

@@ -1,37 +1,31 @@
 {
-  "requires": true,
+  "name": "滚动列表【自动加载,上拉加载,下拉刷新,可自定义】",
+  "version": "1.1.0",
   "lockfileVersion": 1,
+  "requires": true,
   "dependencies": {
     "base64-arraybuffer": {
       "version": "1.0.2",
       "resolved": "https://registry.npmmirror.com/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz",
-      "integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==",
-      "dev": true
+      "integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ=="
     },
     "css-line-break": {
       "version": "2.1.0",
       "resolved": "https://registry.npmmirror.com/css-line-break/-/css-line-break-2.1.0.tgz",
       "integrity": "sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==",
-      "dev": true,
       "requires": {
         "utrie": "^1.0.2"
       }
     },
-    "html2canvas": {
-      "version": "1.4.1",
-      "resolved": "https://registry.npmmirror.com/html2canvas/-/html2canvas-1.4.1.tgz",
-      "integrity": "sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==",
-      "dev": true,
-      "requires": {
-        "css-line-break": "^2.1.0",
-        "text-segmentation": "^1.0.3"
-      }
+    "decimal.js": {
+      "version": "10.4.3",
+      "resolved": "https://registry.npmmirror.com/decimal.js/-/decimal.js-10.4.3.tgz",
+      "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA=="
     },
     "text-segmentation": {
       "version": "1.0.3",
       "resolved": "https://registry.npmmirror.com/text-segmentation/-/text-segmentation-1.0.3.tgz",
       "integrity": "sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==",
-      "dev": true,
       "requires": {
         "utrie": "^1.0.2"
       }
@@ -40,7 +34,6 @@
       "version": "1.0.2",
       "resolved": "https://registry.npmmirror.com/utrie/-/utrie-1.0.2.tgz",
       "integrity": "sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==",
-      "dev": true,
       "requires": {
         "base64-arraybuffer": "^1.0.2"
       }

+ 18 - 15
package.json

@@ -11,21 +11,24 @@
 		"滚动"
 	],
 	"uni-app": {
-	    "scripts": {
-	        "h5-weixin": { 
-	            "title":"分销测试",
-	            "env": {
-	              "UNI_PLATFORM": "h5",
-	              "H_NODE_ENV": "development"
-	            }
-	        },
+		"scripts": {
+			"h5-weixin": {
+				"title": "分销测试",
+				"env": {
+					"UNI_PLATFORM": "h5",
+					"H_NODE_ENV": "development"
+				}
+			},
 			"h5-weixin1": {
-			    "title":"分销正式",
-			    "env": {
-			      "UNI_PLATFORM": "h5",
-			      "H_NODE_ENV": "production"
-			    }
+				"title": "分销正式",
+				"env": {
+					"UNI_PLATFORM": "h5",
+					"H_NODE_ENV": "production"
+				}
 			}
-	    }    
+		}
+	},
+	"dependencies": {
+		"decimal.js": "^10.4.3"
 	}
-}
+}

+ 5 - 4
pages/cash/index.vue

@@ -26,7 +26,7 @@
 						<view class="cash-content-cash-money">
 							<text class="cash-content-cash-money-icon">¥</text>
 							<view class="cash-content-cash-input">
-								<u--input placeholder="请输入内容" border="none" clearable type="number" v-model="moneyValue"
+								<u--input readonly placeholder="请输入内容" border="none" clearable type="number" v-model="moneyValue"
 									@change="moneyAccountFun"></u--input>
 							</view>
 
@@ -83,6 +83,7 @@
 </template>
 
 <script>
+	import { Decimal } from 'decimal.js';//引入
 	import {
 		navigateTo
 	} from "@/utils/util.js"
@@ -308,7 +309,7 @@
 					}else {
 						let num1 = this.withdrawInfo.serviceCharge;
 						let num = isNaN(num1) ? 0 : (Number(num1) / 100)
-						let money = num ? this.moneyValue * num : Number(this.moneyValue)
+						let money = num ? new Decimal(this.moneyValue).mul(new Decimal(num)) : 0
 						return '¥' + money
 						
 					}
@@ -325,9 +326,9 @@
 				} else if (this.withdrawInfo.serviceType == 2) {
 					let num1 = this.withdrawInfo.serviceCharge;
 					let num = isNaN(num1) ? 0 : (Number(num1) / 100)
-					money = num ? this.moneyValue * num : Number(this.moneyValue)
+					money = num ? new Decimal(this.moneyValue).mul(new Decimal(num)) : 0
 				}
-				this.moneyAccount = money < 0 ? '金额过小于零' : this.moneyValue - money.toFixed(2) 
+				this.moneyAccount = money < 0 ? '金额过小于零' : new Decimal(this.moneyValue).sub(new Decimal(money.toFixed(2)))
 			},
 			browserBack() {
 				console.log(1);