|
@@ -143,7 +143,7 @@ function checkHandleRequest() {
|
|
|
try {
|
|
try {
|
|
|
switch(txcode){
|
|
switch(txcode){
|
|
|
case 'A3341A038':
|
|
case 'A3341A038':
|
|
|
- // 签到数据
|
|
|
|
|
|
|
+ // 签到活动数据
|
|
|
let notifyCount = checkTodayNotifyCount(txcode);
|
|
let notifyCount = checkTodayNotifyCount(txcode);
|
|
|
if(notifyCount < 2){
|
|
if(notifyCount < 2){
|
|
|
lk.appendNotifyInfo('🎉 建行生活签到数据获取成功');
|
|
lk.appendNotifyInfo('🎉 建行生活签到数据获取成功');
|
|
@@ -492,7 +492,7 @@ function checkAppendActInfo(mid, txcode, data){
|
|
|
lk.setVal(jhshStoreKeyPrefix+'ActInfo-'+txcode, JSON.stringify(allInfo));
|
|
lk.setVal(jhshStoreKeyPrefix+'ActInfo-'+txcode, JSON.stringify(allInfo));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-function getTheActInfo(txcode){
|
|
|
|
|
|
|
+function getTheActInfo(txcode, actId){
|
|
|
const signActInfoStr = lk.getVal(jhshStoreKeyPrefix+'ActInfo-'+txcode);
|
|
const signActInfoStr = lk.getVal(jhshStoreKeyPrefix+'ActInfo-'+txcode);
|
|
|
let signActInfoDict = {};
|
|
let signActInfoDict = {};
|
|
|
if(signActInfoStr){
|
|
if(signActInfoStr){
|
|
@@ -502,9 +502,27 @@ function getTheActInfo(txcode){
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ if(actId){
|
|
|
|
|
+ return signActInfoDict[actId];
|
|
|
|
|
+ }
|
|
|
return signActInfoDict;
|
|
return signActInfoDict;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+function setTheActInfo(txcode, data, actId){
|
|
|
|
|
+ let allInfo = data;
|
|
|
|
|
+ if(actId != void 0){
|
|
|
|
|
+ allInfo = getTheActInfo(txcode);
|
|
|
|
|
+ if(data != void 0){
|
|
|
|
|
+ allInfo[actId] = data;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ delete allInfo[actId];
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ lk.setVal(jhshStoreKeyPrefix+'ActInfo-'+txcode, JSON.stringify(allInfo));
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
async function all() {
|
|
async function all() {
|
|
|
// await getLatestVersion(); // 获取版本信息
|
|
// await getLatestVersion(); // 获取版本信息
|
|
|
const loginInfoStr = lk.getVal(jhshStoreKeyPrefix+'LoginInfo');
|
|
const loginInfoStr = lk.getVal(jhshStoreKeyPrefix+'LoginInfo');
|
|
@@ -536,6 +554,15 @@ async function all() {
|
|
|
lk.done();
|
|
lk.done();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+function getSignInTxCodeByActId(actId){
|
|
|
|
|
+ const TxCodeDict = {
|
|
|
|
|
+ '20230628070000000001': 'A3341A115',//
|
|
|
|
|
+ '20240301090000000002': 'A3341A139',//
|
|
|
|
|
+ };
|
|
|
|
|
+ return TxCodeDict[actId];
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
async function checkSignIn(loginInfo, signActInfo){
|
|
async function checkSignIn(loginInfo, signActInfo){
|
|
|
lk.log("#####checkSignIn#####");
|
|
lk.log("#####checkSignIn#####");
|
|
|
lk.log(`活动唯一标识${signActInfo?.MID}-${signActInfo?.ACT_ID}`);
|
|
lk.log(`活动唯一标识${signActInfo?.MID}-${signActInfo?.ACT_ID}`);
|
|
@@ -546,9 +573,15 @@ async function checkSignIn(loginInfo, signActInfo){
|
|
|
if(!session){
|
|
if(!session){
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- const couponList = await checkSinginReward(signActInfo, session);
|
|
|
|
|
|
|
+ const txcode = getSignInTxCodeByActId(signActInfo.ACT_ID);
|
|
|
|
|
+ if(!txcode){
|
|
|
|
|
+ lk.log(`无对应的处理,活动签到跳过~`);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ lk.log(`开始进行活动签到...`);
|
|
|
|
|
+ const couponList = await checkSinginReward(signActInfo, session, txcode);
|
|
|
if(couponList && couponList.length > 0){
|
|
if(couponList && couponList.length > 0){
|
|
|
- const result = await getSignInReward(signActInfo, couponList[0]);
|
|
|
|
|
|
|
+ const result = await getSignInReward(signActInfo, couponList[0], 'A3341C120');
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
return null;
|
|
return null;
|
|
@@ -611,7 +644,7 @@ async function refreshLogin(loginInfo) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-async function checkSinginReward(signActInfo,session,txcode='A3341A115') {
|
|
|
|
|
|
|
+async function checkSinginReward(signActInfo,session,txcode) {
|
|
|
let options = {
|
|
let options = {
|
|
|
url: `https://yunbusiness.ccb.com/clp_coupon/txCtrl?txcode=${txcode}`,
|
|
url: `https://yunbusiness.ccb.com/clp_coupon/txCtrl?txcode=${txcode}`,
|
|
|
headers: {
|
|
headers: {
|
|
@@ -633,8 +666,10 @@ async function checkSinginReward(signActInfo,session,txcode='A3341A115') {
|
|
|
if (data) {
|
|
if (data) {
|
|
|
let ret = JSON.parse(data);
|
|
let ret = JSON.parse(data);
|
|
|
if (ret.errCode == 0) {
|
|
if (ret.errCode == 0) {
|
|
|
|
|
+ lk.log(data);
|
|
|
if (ret?.data?.IS_AWARD == 1) {
|
|
if (ret?.data?.IS_AWARD == 1) {
|
|
|
const GIFT_BAG = ret?.data?.GIFT_BAG;
|
|
const GIFT_BAG = ret?.data?.GIFT_BAG;
|
|
|
|
|
+ GIFT_BAG = GIFT_BAG || [];
|
|
|
let otherList = [];
|
|
let otherList = [];
|
|
|
GIFT_BAG.forEach(item => {
|
|
GIFT_BAG.forEach(item => {
|
|
|
let body = { "couponId": item.couponId, "nodeDay": item.nodeDay, "couponType": item.couponType, "dccpBscInfSn": item.dccpBscInfSn };
|
|
let body = { "couponId": item.couponId, "nodeDay": item.nodeDay, "couponType": item.couponType, "dccpBscInfSn": item.dccpBscInfSn };
|
|
@@ -656,6 +691,10 @@ async function checkSinginReward(signActInfo,session,txcode='A3341A115') {
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
lk.log(data);
|
|
lk.log(data);
|
|
|
|
|
+ if(ret.errCode == 'YBLA3341A402'){
|
|
|
|
|
+ // 活动不存在
|
|
|
|
|
+ setTheActInfo(txcode, null, signActInfo.ACT_ID);
|
|
|
|
|
+ }
|
|
|
if(ret.errMsg && ret.errMsg.indexOf('已经签到') > 0){
|
|
if(ret.errMsg && ret.errMsg.indexOf('已经签到') > 0){
|
|
|
lk.appendNotifyInfo(`🎉 建行生活今天已经签到,无法重复签到`);
|
|
lk.appendNotifyInfo(`🎉 建行生活今天已经签到,无法重复签到`);
|
|
|
}
|
|
}
|
|
@@ -674,7 +713,7 @@ async function checkSinginReward(signActInfo,session,txcode='A3341A115') {
|
|
|
|
|
|
|
|
|
|
|
|
|
// 领取奖励
|
|
// 领取奖励
|
|
|
-async function getSignInReward(signActInfo, couponItemInfo, txcode='A3341A115') {
|
|
|
|
|
|
|
+async function getSignInReward(signActInfo, couponItemInfo, txcode) {
|
|
|
lk.log('getSignInReward='+JSON.stringify(couponItemInfo));
|
|
lk.log('getSignInReward='+JSON.stringify(couponItemInfo));
|
|
|
let options = {
|
|
let options = {
|
|
|
url: `https://yunbusiness.ccb.com/clp_coupon/txCtrl?txcode=${txcode}`,
|
|
url: `https://yunbusiness.ccb.com/clp_coupon/txCtrl?txcode=${txcode}`,
|