shawenguan 1 tahun lalu
induk
melakukan
c57f31593e
2 mengubah file dengan 17 tambahan dan 54 penghapusan
  1. 9 54
      BoxJsSub/hbcpre.json
  2. 8 0
      Scripts/hbcpre/hbcpreHelper.js

+ 9 - 54
BoxJsSub/hbcpre.json

@@ -29,22 +29,8 @@
             ],
             "settings": [
                 {
-                    "id": "HbcpreDecryptionEnabled",
-                    "name": "开启/关闭采取解密",
-                    "val": true,
-                    "type": "boolean",
-                    "desc": "默认开启"
-                },
-                {
-                    "id": "HbcpreOrderFastModeEnabled",
-                    "name": "开启/关闭下单快捷模式",
-                    "val": true,
-                    "type": "boolean",
-                    "desc": "默认开启"
-                },
-                {
                     "id": "HbcpreOrderItemDataGrabEnabled",
-                    "name": "开启/关闭单采集",
+                    "name": "开启/关闭下单采集",
                     "val": false,
                     "type": "boolean",
                     "desc": "默认关闭"
@@ -101,30 +87,6 @@
                     "val": "",
                     "type": "text",
                     "desc": "拥有的产品数量自定义,格式:id#num|id#num"
-                },
-                {
-                    "id": "HbcpreCastingId",
-                    "name": "当前下单监控Id",
-                    "val": "",
-                    "type": "text",
-                    "placeholder": "",
-                    "desc": "当前下单监控Id"
-                },
-                {
-                    "id": "HbcpreOrderLimitPrice",
-                    "name": "当前下单限制价格",
-                    "val": "",
-                    "type": "text",
-                    "placeholder": "",
-                    "desc": "当前下单限制价格"
-                },
-                {
-                    "id": "HbcpreFloatPriceIntaval",
-                    "name": "当前下单价格上浮空间",
-                    "val": "",
-                    "type": "text",
-                    "placeholder": "",
-                    "desc": "当前下单价格上浮空间"
                 }
             ]
         },
@@ -152,32 +114,25 @@
                     "desc": "默认关闭"
                 },
                 {
-                    "id": "HbcpreCollectionMaxNumLimit",
-                    "name": "开启/关闭检查未支付单数限制",
-                    "val": false,
+                    "id": "HbcpreOrderFastModeEnabled",
+                    "name": "开启/关闭下单快捷模式",
+                    "val": true,
                     "type": "boolean",
-                    "desc": "默认关闭"
-                },
-                {
-                    "id": "HbcpreCollectionLockMaxNum",
-                    "name": "最大允许未支付单数",
-                    "val": 6,
-                    "type": "number",
-                    "desc": "最大允许未支付单数"
+                    "desc": "默认开启"
                 },
                 {
                     "id": "HbcpreCastingId",
-                    "name": "产品铸造品类ID",
+                    "name": "当前下单监控Id",
                     "val": "",
                     "type": "text",
-                    "desc": "产品铸造品类ID"
+                    "desc": "当前下单监控Id"
                 },
                 {
                     "id": "HbcpreCollectionName",
-                    "name": "产品名称",
+                    "name": "当前下单监控名称",
                     "val": "",
                     "type": "text",
-                    "desc": "产品名称"
+                    "desc": "当前下单监控名称"
                 },
                 {
                     "id": "HbcpreOrderLimitPrice",

+ 8 - 0
Scripts/hbcpre/hbcpreHelper.js

@@ -18,6 +18,7 @@ const magicJS = MagicJS(scriptName, "INFO");
 
 const HbcpreConstKey = {
     decryptionEnabled: 'HbcpreDecryptionEnabled',
+    orderItemWatchLocked: 'HbcpreCollectionWatchLocked',
     orderFastModeEnabled: 'HbcpreOrderFastModeEnabled',
     orderItemDataGrabEnabled: 'HbcpreOrderItemDataGrabEnabled',
     drawItemDataGrabEnabled: 'HbcpreDrawItemDataGrabEnabled',
@@ -106,6 +107,11 @@ function isDecryptionEnabled() {
 }
 
 function isOrderItemGrabEnabled() {
+    let isLocked = magicJS.data.read(HbcpreConstKey.orderItemWatchLocked, null);
+    if(isLocked){
+        return true;
+    }
+
     let flag = magicJS.data.read(HbcpreConstKey.orderItemDataGrabEnabled, null);
     if (!flag) {
         return false;
@@ -488,6 +494,7 @@ function handleSeriesInfo() {
             if (seriesId != reqData.seriesId) {
                 magicJS.data.write(HbcpreConstKey.castingId, reqData.seriesId);
                 let collectionName = getCollectionName(reqData.seriesId);
+                magicJS.data.write(HbcpreConstKey.collectionName, collectionName);
                 magicJS.notification.post(scriptName, "", `🎉[${collectionName}#${collectionPrice}]快捷下单数据采集成功!`);
             }
         }
@@ -514,6 +521,7 @@ function handleSeriesInfo() {
 
         if (seriesId != seriesInfo.seriesId) {
             magicJS.data.write(HbcpreConstKey.castingId, seriesInfo.seriesId);
+            magicJS.data.write(HbcpreConstKey.collectionName, seriesInfo.seriesName);
 
             magicJS.notification.post(scriptName, "", `🎉[${seriesInfo.seriesName}#${collectionPrice}]快捷下单数据采集成功!`);
         }