shawenguan 1 gadu atpakaļ
vecāks
revīzija
0bcb036ee9
2 mainītis faili ar 111 papildinājumiem un 2 dzēšanām
  1. 100 0
      BoxJsSub/wubian.json
  2. 11 2
      Scripts/wubian/wubianHelper.js

+ 100 - 0
BoxJsSub/wubian.json

@@ -0,0 +1,100 @@
+{
+    "id": "jojo.app.wubian",
+    "name": "无边星链应用订阅",
+    "description": "关于无边星链应用脚本订阅集合",
+    "author": "@JoJo",
+    "icon": "https://avatars.githubusercontent.com/u/16010188",
+    "repo": "http://git.jojo21.top/shawenguan/Quantumult-X",
+    "apps": [
+        {
+            "id": "lkWubianHelper",
+            "name": "无边星链助手",
+            "author": "@jojo",
+            "repo": "https://git.jojo21.top/shawenguan/Quantumult-X/raw/master/Scripts/wubian/wubianHelper.js",
+            "script": "https://git.jojo21.top/shawenguan/Quantumult-X/raw/master/Scripts/wubian/wubianHelper.js",
+            "icons": [
+                "https://git.jojo21.top/shawenguan/Quantumult-X/raw/master/Icons/wubian.png",
+                "https://git.jojo21.top/shawenguan/Quantumult-X/raw/master/Icons/wubian.png"
+            ],
+            "scripts": [
+                {
+                    "name": "极速下单",
+                    "script": "https://git.jojo21.top/shawenguan/Quantumult-X/raw/master/Scripts/wubian/wubianOrder.js"
+                },
+                {
+                    "name": "极速兑换",
+                    "script": "https://git.jojo21.top/shawenguan/Quantumult-X/raw/master/Scripts/wubian/wubianSynthesis.js"
+                },
+                {
+                    "name": "首发抢购",
+                    "script": "https://git.jojo21.top/shawenguan/Quantumult-X/raw/master/Scripts/wubian/wubianGrab.js"
+                }
+            ],
+            "keys": [
+                "WubianProToken",
+                "WubianActivityListData"
+            ],
+            "settings": [
+                {
+                    "id": "WubianActivityTaskCaptureEnabled",
+                    "name": "开启/关闭兑换采集",
+                    "val": true,
+                    "type": "boolean",
+                    "desc": "默认开启"
+                },
+                {
+                    "id": "WubianActivityId",
+                    "name": "当前兑换活动ID",
+                    "val": "",
+                    "type": "text",
+                    "desc": "当前兑换活动ID"
+                }
+            ]
+        },
+        {
+            "id": "lkWubianSynthesis",
+            "name": "无边极速兑换",
+            "author": "@jojo",
+            "repo": "https://git.jojo21.top/shawenguan/Quantumult-X/raw/master/Scripts/wubian/wubianSynthesis.js",
+            "script": "https://git.jojo21.top/shawenguan/Quantumult-X/raw/master/Scripts/wubian/wubianSynthesis.js",
+            "icons": [
+                "https://git.jojo21.top/shawenguan/Quantumult-X/raw/master/Icons/wubian.png",
+                "https://git.jojo21.top/shawenguan/Quantumult-X/raw/master/Icons/wubian.png"
+            ],
+            "keys": [
+                "WubianProToken",
+                "WubianActivityCvtGoodsList"
+            ],
+            "settings": [
+                {
+                    "id": "WubianActivityTaskCaptureEnabled",
+                    "name": "开启/关闭兑换采集",
+                    "val": true,
+                    "type": "boolean",
+                    "desc": "默认开启"
+                },
+                {
+                    "id": "WubianActivityActivityTagName",
+                    "name": "当前兑换活动标签关键字",
+                    "val": "",
+                    "type": "text",
+                    "desc": "当前兑换活动标签关键字"
+                },
+                {
+                    "id": "WubianActivityIndexName",
+                    "name": "当前兑换活动标题关键字",
+                    "val": "",
+                    "type": "text",
+                    "desc": "当前兑换活动标题关键字"
+                },
+                {
+                    "id": "WubianActivityId",
+                    "name": "当前兑换活动ID",
+                    "val": "",
+                    "type": "text",
+                    "desc": "当前兑换活动ID"
+                }
+            ]
+        }
+    ]
+}

+ 11 - 2
Scripts/wubian/wubianHelper.js

@@ -19,6 +19,7 @@ const WuBianConstKey = {
     // 基础数据
     Token: 'WubianProToken',
     ActivityListData: 'WubianActivityListData',
+    ActivityTaskCaptureEnabled: 'WubianActivityTaskCaptureEnabled',
     ActivityCvtGoodsList: 'WubianActivityCvtGoodsList',
     ActivityTagName: 'WubianActivityActivityTagName',
     ActivityIndexName: 'WubianActivityIndexName',
@@ -290,6 +291,11 @@ function handleActivityList() {
     gRetBody = rspData;
 }
 
+function isActivityTaskCaptureEnabled() {
+    let isEnabled = magicJS.data.read(WuBianConstKey.ActivityTaskCaptureEnabled, true);
+    return isEnabled;
+}
+
 function handleCvtGoodsList() {
     let rspData = getResponsePlainData();
     if (!rspData) {
@@ -301,8 +307,11 @@ function handleCvtGoodsList() {
     }
     let reqData = getRequestPlainData();
     let activityId = reqData.activityId || 'default';
-    magicJS.data.write(WuBianConstKey.ActivityId, activityId);
-
+    if (isActivityTaskCaptureEnabled()) {
+        magicJS.data.write(WuBianConstKey.ActivityId, activityId);
+        let activityInfo = rspData.data.activityInfo;
+        magicJS.notification.appendNotifyInfo(`🎉[${activityInfo.name}]数据采集成功!`);
+    }
     let key = `${WuBianConstKey.ActivityCvtGoodsList}#${activityId}`;
     magicJS.data.write(key, rspData.data);
 }