huangbin vor 4 Jahren
Ursprung
Commit
8933cb299c
2 geänderte Dateien mit 4 neuen und 13 gelöschten Zeilen
  1. 1 1
      public/config/app.config.json
  2. 3 12
      src/services/socket/quota/adapter/index.ts

+ 1 - 1
public/config/app.config.json

@@ -1,3 +1,3 @@
 {
-    "apiUrl": "http://192.168.31.204:8080/cfg?key=test_204"
+    "apiUrl": "http://192.168.31.139:8080/cfg?key=test_139"
 }

+ 3 - 12
src/services/socket/quota/adapter/index.ts

@@ -137,21 +137,12 @@ export function parseReceivePush(quotationData: any) {
                 //
                 // 处理 报价小数位
                 const handleDeimalplace = (key: string) => {
-                    // if (key === 'totalturnover' && decimalplace === 2) {
-                    //     console.log('decimalplace', decimalplace, goodsQuoteTik[key], fn(goodsQuoteTik[key]), itemQuote[key])
-                    //     1130500000000
-                    //     11305000000
-                    //     1003800000000
-                    //     11305000000
-                    //     1130500000000
-                    //     11305000000
-                    //     11305000000
-                    // }
-                    return goodsQuoteTik[key] ? fn(goodsQuoteTik[key]) : itemQuote[key]
+                    return Reflect.has(goodsQuoteTik, key) ? fn(goodsQuoteTik[key]) : itemQuote[key]
                 }
                 // 处理 如果有值则更新值,没有的话,则取上次的值
+                // 注意: 0 也是有效数字
                 const handleNoneValue = (key: string) => {
-                    return goodsQuoteTik[key] ? goodsQuoteTik[key] : itemQuote[key]
+                    return Reflect.has(goodsQuoteTik, key) ? goodsQuoteTik[key] : itemQuote[key]
                 }
 
                 const changeValue = () => {