|
|
@@ -28,6 +28,7 @@ const HbcpreConstKey = {
|
|
|
compositeActivityName: 'HbcpreCompositeActivityName',
|
|
|
compositeEntryTitleList: 'HbcpreCompositeEntryTitleList',
|
|
|
compositeEntryTitleCustom: 'HbcpreCompositeEntryTitleCustom',
|
|
|
+ compositeActivityTaskMode: 'HbcpreCompositeActivityTaskMode',
|
|
|
};
|
|
|
|
|
|
const gUserAgent = `Mozilla/5.0 (iPhone; CPU iPhone OS 16_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1`;
|
|
|
@@ -191,6 +192,12 @@ function getWillCompositeTaskSearchKeys() {
|
|
|
return keyArr;
|
|
|
}
|
|
|
|
|
|
+function getCompositeTaskMode(){
|
|
|
+ let mode = magicJS.data.read(HbcpreConstKey.compositeActivityTaskMode);
|
|
|
+ magicJS.logger.error(`mode=${mode}`);
|
|
|
+ return mode;
|
|
|
+}
|
|
|
+
|
|
|
function getActivityIdByName(activityName){
|
|
|
let dataDict = getActivitDataCache(1);
|
|
|
if(!dataDict){
|
|
|
@@ -218,35 +225,49 @@ function getHomeCompositeEntrySelectList(){
|
|
|
if(customStr && customStr.length > 0){
|
|
|
customStr = customStr.trim();
|
|
|
if(customStr.length > 0){
|
|
|
- retArr.push(customStr);
|
|
|
+ let segments = customStr.split(',');
|
|
|
+ retArr = [];
|
|
|
+ for (let vstr of segments) {
|
|
|
+ retArr.push(vstr.trim());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
return retArr;
|
|
|
}
|
|
|
|
|
|
async function tryAllComposite() {
|
|
|
+ let taskMode = getCompositeTaskMode();
|
|
|
let idsList = getWillCompositeTaskIds();
|
|
|
- if(idsList.length == 0){
|
|
|
+ if(taskMode == 1){
|
|
|
magicJS.logger.info(`尝试通过活动名称匹配对应活动ID`);
|
|
|
- let namesList = getWillCompositeTaskSearchKeys();
|
|
|
- for(let name of namesList){
|
|
|
- let actId = getActivityIdByName(name);
|
|
|
- if(actId){
|
|
|
- idsList.push(actId);
|
|
|
+ if(idsList.length == 0){
|
|
|
+ let namesList = getWillCompositeTaskSearchKeys();
|
|
|
+ for(let name of namesList){
|
|
|
+ let actId = getActivityIdByName(name);
|
|
|
+ if(actId){
|
|
|
+ idsList.push(actId);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if(idsList.length == 0){
|
|
|
- magicJS.logger.info(`尝试通过入口名称匹配对应活动ID`);
|
|
|
- idsList = await getActivityIdsByEntryTile();
|
|
|
+ if(taskMode == 2){
|
|
|
+ if(idsList.length == 0){
|
|
|
+ magicJS.logger.info(`尝试通过入口名称匹配对应活动ID`);
|
|
|
+ let newList = await getActivityIdsByEntryTile();
|
|
|
+ idsList = idsList.concat(newList);
|
|
|
+ }
|
|
|
}
|
|
|
if(idsList.length == 0){
|
|
|
magicJS.logger.info(`缺少合成活动ID`);
|
|
|
// magicJS.notification.appendNotifyInfo(`❌合成活动缺少相关参数!`);
|
|
|
return;
|
|
|
}
|
|
|
+ let execFlags = {};
|
|
|
for(let activityId of idsList){
|
|
|
- await tryOneComposite(activityId);
|
|
|
+ if(!execFlags[activityId]){
|
|
|
+ execFlags[activityId] = true;
|
|
|
+ await tryOneComposite(activityId);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|