|
|
@@ -45,6 +45,9 @@ const HbcpreConstKey = {
|
|
|
compoundActivityData: 'HbcpreCompoundActivityData',
|
|
|
compoundActivityId: 'HbcpreCompoundActivityId',
|
|
|
|
|
|
+ exchangeActivityData: 'HbcpreExchangeActivityData',
|
|
|
+ exchangeActivityId: 'HbcpreExchangeActivityId',
|
|
|
+
|
|
|
tmpContractData: 'HbcpreTmpContractData',
|
|
|
};
|
|
|
|
|
|
@@ -270,7 +273,9 @@ function checkHandleRequest() {
|
|
|
handleAwardRun();
|
|
|
break;
|
|
|
default:
|
|
|
- if (path.indexOf('/mall/order/detail') > -1) {
|
|
|
+ if (path.indexOf('/mall/works/compositeList') > -1) {
|
|
|
+ handlerCompoundData();
|
|
|
+ } else if (path.indexOf('/mall/order/detail') > -1) {
|
|
|
// 订单详情
|
|
|
handleOrderDetail();
|
|
|
} else if (path.indexOf('/mall/works/info') > -1) {
|
|
|
@@ -289,6 +294,7 @@ function checkHandleRequest() {
|
|
|
//首页数字资产和盲盒推荐
|
|
|
} else if (path.indexOf('/mall/homepage/info')) {//无需登录
|
|
|
//首页信息,包括广告喇叭、banner上多个入口配置
|
|
|
+ handlerHomePageInfo();
|
|
|
} else if (path.indexOf('/mall/application/getBasicInfo')) {//无需登录
|
|
|
//应用基础信息
|
|
|
} else if (path.indexOf('/mall/collector/password/login')) {
|
|
|
@@ -401,6 +407,31 @@ function handleUserInfo() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+function handlerHomePageInfo(){
|
|
|
+ let rspData = getResponsePlainData();
|
|
|
+ if (!rspData) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (rspData.code != 200) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let bannerList = rspData.data.bannerList;
|
|
|
+ for(let i=0; i < bannerList.length; i++){
|
|
|
+ const item = bannerList[i];
|
|
|
+ if(item.url.indexOf('http') == -1){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ const params = magicJS.parseQueryStr(item.url);
|
|
|
+ if(item.name.indexOf('合成') > -1){
|
|
|
+
|
|
|
+ }else if(item.name.indexOf('兑换') > -1){
|
|
|
+
|
|
|
+ }else if(item.name.indexOf('抽奖') > -1){
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
function handleMarketSeriesList() {
|
|
|
let rspData = getResponsePlainData();
|
|
|
if (!rspData) {
|
|
|
@@ -693,71 +724,80 @@ function handlerCompoundData() {
|
|
|
if (!rspData) {
|
|
|
return;
|
|
|
}
|
|
|
+ // 432=无资格
|
|
|
+ let isModify = false;
|
|
|
+ if (rspData.code == 432) {
|
|
|
+ rspData.code = 200;
|
|
|
+ isModify = true;
|
|
|
+ }
|
|
|
if (rspData.code != 200) {
|
|
|
return;
|
|
|
}
|
|
|
let data = rspData.data;
|
|
|
- let collection = data.collection;
|
|
|
- if (isCompoundItemGrabEnabled()) {
|
|
|
- magicJS.data.write(HbcpreConstKey.compoundActivityData, data);
|
|
|
- magicJS.data.write(HbcpreConstKey.compoundActivityId, collection.id);
|
|
|
- magicJS.notification.post(scriptName, "", `🎉[${collection.random_name}]合成采集成功!`);
|
|
|
- }
|
|
|
-
|
|
|
- // id 活动id
|
|
|
- // random_num
|
|
|
- // content 内容html格式
|
|
|
- collection.status = 1;
|
|
|
- // collection.allow_state = 1;
|
|
|
- collection.begin_time = parseInt(new Date().getTime() / 1000) - 3600;
|
|
|
- collection.end_time = parseInt(new Date().getTime() / 1000) + 3600;
|
|
|
- // created_at 创建日期 yyyy-MM-dd hh:mm:ss
|
|
|
- // updated_at 更新日期 yyyy-MM-dd hh:mm:ss
|
|
|
- // all_num 总量
|
|
|
- // sy_num 剩余
|
|
|
- collection.random_name = `${collection.random_name}(${collection.sy_num}/${collection.all_num})`;
|
|
|
- // 固定材料
|
|
|
- let needList = collection.need;
|
|
|
- for (let i = 0; i < needList.length; i++) {
|
|
|
- let iData = needList[i];
|
|
|
- if (iData.count_num == 0) {
|
|
|
- iData.count_num = iData.need_num;
|
|
|
+ // 1=合成 3=兑换
|
|
|
+ let eventsType = data.eventsType;
|
|
|
+ if(eventsType == 1){
|
|
|
+ if (isCompoundItemGrabEnabled()) {
|
|
|
+ magicJS.data.write(HbcpreConstKey.compoundActivityData, data);
|
|
|
+ magicJS.data.write(HbcpreConstKey.compoundActivityId, data.eventsId);
|
|
|
+ magicJS.notification.post(scriptName, "", `🎉[合成]<${data.eventsName}>采集成功!`);
|
|
|
}
|
|
|
- if (iData.user_count == 0) {
|
|
|
- iData.user_count = iData.need_num;
|
|
|
+ } else if(eventsType == 3){
|
|
|
+ if (isExchangeItemGrabEnabled()){
|
|
|
+ magicJS.data.write(HbcpreConstKey.exchangeActivityData, data);
|
|
|
+ magicJS.data.write(HbcpreConstKey.exchangeActivityId, data.eventsId);
|
|
|
+ magicJS.notification.post(scriptName, "", `🎉[兑换]<${data.eventsName}>采集成功!`);
|
|
|
}
|
|
|
}
|
|
|
+ if(isModify){
|
|
|
+ data.eventsName = `${data.eventsName}#无资格`;
|
|
|
+ }
|
|
|
|
|
|
- // 随机材料-需要选择
|
|
|
- let randomList = data.randomcollection;
|
|
|
- if (randomList.length == 0) {
|
|
|
- // data.random_num = 1;
|
|
|
- // data.randomcollection = [
|
|
|
- // [
|
|
|
+ // 固定材料
|
|
|
+ let needList = data.needList;
|
|
|
+ for (let i = 0; i < needList.length; i++) {
|
|
|
+ let iData = needList[i];
|
|
|
+ // iData = {
|
|
|
+ // "bonusFlag": 0,
|
|
|
+ // "bonusRuleList": [],
|
|
|
+ // "groupId": 30,
|
|
|
+ // "num": 8,
|
|
|
+ // "seriesList": [
|
|
|
// {
|
|
|
- // id: 2988,
|
|
|
- // title: '黑卡',
|
|
|
- // count_num: 10000,
|
|
|
- // nums: 1,
|
|
|
- // image: `https://luanshu.hbcpre.com/uploads/collection/96d4bd988be689544757ae1dcc9c8d20.jpg`
|
|
|
+ // "seriesId": 2988,
|
|
|
+ // "seriesType": 0,
|
|
|
+ // "worksList": [],
|
|
|
+ // "worksName": "黑卡",
|
|
|
+ // "worksPic": ""
|
|
|
// }
|
|
|
- // ],
|
|
|
- // ];
|
|
|
- }
|
|
|
-
|
|
|
- // 合成产品
|
|
|
- let collectionList = data.collection_list;
|
|
|
- for (let i = 0; i < collectionList.length; i++) {
|
|
|
- let iData = collectionList[i];
|
|
|
- iData.collection_name = `${iData.collection_name}\n(${iData.num}/${iData.all_num})`;
|
|
|
- }
|
|
|
-
|
|
|
- const baseConfig = getBaseConfig();
|
|
|
- if (baseConfig.encrypt) {
|
|
|
- gRetBody = encryptAES(JSON.stringify(rspData), baseConfig.k, baseConfig.v);
|
|
|
- } else {
|
|
|
- gRetBody = rspData;
|
|
|
+ // ]
|
|
|
+ // }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 个人拥有材料列表
|
|
|
+ let ownList = data.ownList;
|
|
|
+ for (let i = 0; i < ownList.length; i++) {
|
|
|
+ let iData = ownList[i];
|
|
|
+ // iData = {
|
|
|
+ // "bonusRuleList": [],
|
|
|
+ // "groupId": 23,
|
|
|
+ // "num": 4,
|
|
|
+ // "seriesList": [
|
|
|
+ // {
|
|
|
+ // "seriesId": 2988,
|
|
|
+ // "worksList": [
|
|
|
+ // {
|
|
|
+ // "worksId": 4660254,
|
|
|
+ // "worksNo": 1178689
|
|
|
+ // },
|
|
|
+ // ],
|
|
|
+ // "worksName": "黑卡",
|
|
|
+ // "worksPic": ""
|
|
|
+ // }
|
|
|
+ // ]
|
|
|
+ // }
|
|
|
}
|
|
|
+ gRetBody = rspData;
|
|
|
}
|
|
|
|
|
|
function handleAwardIndex() {
|