|
@@ -164,12 +164,20 @@ async function tryGrab() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
async function doGrabByNormal() {
|
|
async function doGrabByNormal() {
|
|
|
|
|
+ let theAcType = 'AM';
|
|
|
|
|
+ let nowDate = new Date();
|
|
|
|
|
+ if (nowDate.getHours() > 12) {
|
|
|
|
|
+ theAcType = 'PM';
|
|
|
|
|
+ }
|
|
|
let tipsText = ``;
|
|
let tipsText = ``;
|
|
|
let taskInfoList = getTaskInfoList();
|
|
let taskInfoList = getTaskInfoList();
|
|
|
for (let i = 0; i < taskInfoList.length; i++) {
|
|
for (let i = 0; i < taskInfoList.length; i++) {
|
|
|
const taskInfo = taskInfoList[i];
|
|
const taskInfo = taskInfoList[i];
|
|
|
const activityId = taskInfo.acId;
|
|
const activityId = taskInfo.acId;
|
|
|
const activityType = taskInfo.acType;
|
|
const activityType = taskInfo.acType;
|
|
|
|
|
+ if (theAcType != activityType) {
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
const taskList = taskInfo.taskList;
|
|
const taskList = taskInfo.taskList;
|
|
|
let taskLstDict = {};
|
|
let taskLstDict = {};
|
|
|
for (let j = 0; j < taskList.length; j++) {
|
|
for (let j = 0; j < taskList.length; j++) {
|
|
@@ -181,13 +189,15 @@ async function doGrabByNormal() {
|
|
|
}
|
|
}
|
|
|
let urlMap = await getTaskUrlMapData(activityId);
|
|
let urlMap = await getTaskUrlMapData(activityId);
|
|
|
magicJS.logger.info(`${activityId} ${JSON.stringify(urlMap)}`);
|
|
magicJS.logger.info(`${activityId} ${JSON.stringify(urlMap)}`);
|
|
|
- // if (urlMap) {
|
|
|
|
|
- // for (let id in urlMap) {
|
|
|
|
|
- // const task = taskLstDict[id];
|
|
|
|
|
- // const url = urlMap[id];
|
|
|
|
|
- // let result = await grabDiscCoupon(url);
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ if (urlMap) {
|
|
|
|
|
+ for (let id in urlMap) {
|
|
|
|
|
+ const task = taskLstDict[id];
|
|
|
|
|
+ const url = urlMap[id];
|
|
|
|
|
+ magicJS.logger.info(`${id} ${url}`);
|
|
|
|
|
+ magicJS.logger.info(`${JSON.stringify(task)}`);
|
|
|
|
|
+ // let result = await grabDiscCoupon(url);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
if (tipsText.length > 0) {
|
|
if (tipsText.length > 0) {
|
|
|
magicJS.notification.appendNotifyInfo(`领取结果如下:\n${tipsText}`);
|
|
magicJS.notification.appendNotifyInfo(`领取结果如下:\n${tipsText}`);
|