shawenguan 1 rok pred
rodič
commit
183dc405dc
3 zmenil súbory, kde vykonal 240 pridanie a 140 odobranie
  1. 67 0
      BoxJsSub/hbcpre.json
  2. 157 136
      Scripts/hbcpre/hbcpreDraw.js
  3. 16 4
      Scripts/hbcpre/hbcpreHelper.js

+ 67 - 0
BoxJsSub/hbcpre.json

@@ -32,6 +32,10 @@
                 {
                     "name": "上新兑换",
                     "script": "https://git.jojo21.top/shawenguan/Quantumult-X/raw/master/Scripts/hbcpre/hbcpreExchange.js"
+                },
+                {
+                    "name": "限时抽奖",
+                    "script": "https://git.jojo21.top/shawenguan/Quantumult-X/raw/master/Scripts/hbcpre/hbcpreDraw.js"
                 }
             ],
             "keys": [
@@ -477,6 +481,69 @@
                     "desc": "活动列表"
                 }
             ]
+        },
+        {
+            "id": "jojo.hbcpreDraw",
+            "name": "华文数交抽奖",
+            "author": "@jojo",
+            "repo": "https://git.jojo21.top/shawenguan/Quantumult-X/raw/master/Scripts/hbcpre/hbcpreDraw.js",
+            "script": "https://git.jojo21.top/shawenguan/Quantumult-X/raw/master/Scripts/hbcpre/hbcpreDraw.js",
+            "icons": [
+                "https://git.jojo21.top/shawenguan/Quantumult-X/raw/master/Icons/hbcpre.png",
+                "https://git.jojo21.top/shawenguan/Quantumult-X/raw/master/Icons/hbcpre.png"
+            ],
+            "keys": [
+                "HbcpreUserToken",
+                "HbcpreUserInfo",
+                "HbcpreDrawActivityData",
+                "HbcpreDrawActivityCostSeriesList"
+            ],
+            "settings": [
+                {
+                    "id": "HbcpreDrawItemDataGrabEnabled",
+                    "name": "开启/关闭抽奖采集",
+                    "val": false,
+                    "type": "boolean",
+                    "desc": "默认关闭"
+                },
+                {
+                    "id": "HbcpreDrawActivityId",
+                    "name": "当前抽奖Id",
+                    "val": "",
+                    "type": "text",
+                    "desc": "当前抽奖Id"
+                },
+                {
+                    "id": "HbcpreDrawActivityName",
+                    "name": "当前抽奖名称",
+                    "val": "",
+                    "type": "text",
+                    "desc": "当前抽奖名称"
+                },
+                {
+                    "id": "HbcpreDrawActivityRunCount",
+                    "name": "当前抽奖此次",
+                    "val": 1,
+                    "type": "number",
+                    "desc": "当前抽奖此次"
+                },
+                {
+                    "id": "HbcpreDrawActivityData",
+                    "name": "活动列表",
+                    "val": "{}",
+                    "autoGrow": false,
+                    "type": "textarea",
+                    "desc": "活动列表"
+                },
+                {
+                    "id": "HbcpreDrawActivityCostSeriesList",
+                    "name": "消耗数据",
+                    "val": "{}",
+                    "autoGrow": false,
+                    "type": "textarea",
+                    "desc": "消耗数据"
+                }
+            ]
         }
     ]
 }

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 157 - 136
Scripts/hbcpre/hbcpreDraw.js


+ 16 - 4
Scripts/hbcpre/hbcpreHelper.js

@@ -71,8 +71,10 @@ const HbcpreConstKey = {
     exchangeActivityTaskMode: 'HbcpreExchangeActivityTaskMode',
     exchangeRapidFrequencyCount: 'HbcpreExchangeRapidFrequencyCount',
 
+    // 抽奖相关的
     drawItemDataGrabEnabled: 'HbcpreDrawItemDataGrabEnabled',
     drawActivityData: 'HbcpreDrawActivityData',
+    drawActivityCostSeriesList: 'HbcpreDrawActivityCostSeriesList',
     drawActivityId: 'HbcpreDrawActivityId',
     drawActivityName: 'HbcpreDrawActivityName',
     drawActivityRunCount: 'HbcpreDrawActivityRunCount',
@@ -1224,8 +1226,8 @@ function handleRaffleData() {
     if (rspData.code != 200) {
         return;
     }
-    let reqData = getRequestPlainData();
     if (isDrawItemGrabEnabled()) {
+        let reqData = getRequestPlainData();
         magicJS.data.write(HbcpreConstKey.drawActivityData, rspData.data);
         magicJS.data.write(HbcpreConstKey.drawActivityName, rspData.data.raffleName);
         magicJS.data.write(HbcpreConstKey.drawActivityId, reqData.raffleId);
@@ -1259,6 +1261,14 @@ function handleRaffleSeriesList(){
     if (rspData.code != 200) {
         return;
     }
+    if (isDrawItemGrabEnabled()) {
+        let activityId = magicJS.data.read(HbcpreConstKey.drawActivityId, null);
+        let reqData = getRequestPlainData();
+        if (activityId == reqData.raffleId) {
+            magicJS.data.write(HbcpreConstKey.drawActivityCostSeriesList, rspData.data);
+        }
+    }
+    // amount 价格
     // ownedNum  拥有的数量
     // raffleLimitNum  使用数量
     gRetBody = rspData;
@@ -1269,9 +1279,11 @@ function handleRaffleRun() {
     if (!reqData) {
         return;
     }
-    let activityId = magicJS.data.read(HbcpreConstKey.drawActivityId, null);
-    if (activityId == reqData.raffleId) {
-        magicJS.data.write(HbcpreConstKey.drawActivityRunCount, reqData.raffleNum);
+    if (isDrawItemGrabEnabled()) {
+        let activityId = magicJS.data.read(HbcpreConstKey.drawActivityId, null);
+        if (activityId == reqData.raffleId) {
+            magicJS.data.write(HbcpreConstKey.drawActivityRunCount, reqData.raffleNum);
+        }
     }
     let rspData = getResponsePlainData();
     if (!rspData) {

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov