forked from Toulu-debug/enen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jd_bean_change.js
3120 lines (2889 loc) · 108 KB
/
jd_bean_change.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
cron "30 21 * * *" jd_bean_change.js, tag:资产变化强化版by-ccwav
*/
//详细说明参考 https://github.com/ccwav/QLScript2
const $ = new Env('京东资产变动');
const notify = $.isNode() ? require('./sendNotify') : '';
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
let allMessage = '';
let allMessage2 = '';
let allReceiveMessage = '';
let allWarnMessage = '';
let ReturnMessage = '';
let ReturnMessageMonth = '';
let allMessageMonth = '';
let MessageUserGp2 = '';
let ReceiveMessageGp2 = '';
let WarnMessageGp2 = '';
let allMessageGp2 = '';
let allMessage2Gp2 = '';
let allMessageMonthGp2 = '';
let IndexGp2 = 0;
let MessageUserGp3 = '';
let ReceiveMessageGp3 = '';
let WarnMessageGp3 = '';
let allMessageGp3 = '';
let allMessage2Gp3 = '';
let allMessageMonthGp3 = '';
let IndexGp3 = 0;
let MessageUserGp4 = '';
let ReceiveMessageGp4 = '';
let WarnMessageGp4 = '';
let allMessageGp4 = '';
let allMessageMonthGp4 = '';
let allMessage2Gp4 = '';
let IndexGp4 = 0;
let IndexAll = 0;
let EnableMonth = "false";
let isSignError = false;
let ReturnMessageTitle = "";
//IOS等用户直接用NobyDa的jd cookie
let cookiesArr = [], cookie = '';
const JD_API_HOST = 'https://api.m.jd.com/client.action';
let intPerSent = 0;
let i = 0;
let llShowMonth = false;
let Today = new Date();
let strAllNotify = "";
let strSubNotify = "";
let llPetError = false;
let strGuoqi = "";
let RemainMessage = '\n';
RemainMessage += "⭕活动攻略:⭕" + '\n';
RemainMessage += '【极速金币】京东极速版->我的->金币(极速版使用)\n';
RemainMessage += '【京东赚赚】微信->京东赚赚小程序->底部赚好礼->提现无门槛红包(京东使用)\n';
RemainMessage += '【京东秒杀】京东->中间频道往右划找到京东秒杀->中间点立即签到->兑换无门槛红包(京东使用)\n';
RemainMessage += '【东东萌宠】京东->我的->东东萌宠,完成是京东红包,可以用于京东app的任意商品\n';
RemainMessage += '【领现金】京东->我的->东东萌宠->领现金(微信提现+京东红包)\n';
RemainMessage += '【东东农场】京东->我的->东东农场,完成是京东红包,可以用于京东app的任意商品\n';
RemainMessage += '【京喜工厂】京喜->我的->京喜工厂,完成是商品红包,用于购买指定商品(不兑换会过期)\n';
RemainMessage += '【京东金融】京东金融app->我的->养猪猪,完成是白条支付券,支付方式选白条支付时立减.\n';
RemainMessage += '【其他】京喜红包只能在京喜使用,其他同理';
let WP_APP_TOKEN_ONE = "";
let TempBaipiao = "";
let llgeterror = false;
let doExJxBeans = "false";
let time = new Date().getHours();
if ($.isNode()) {
if (process.env.WP_APP_TOKEN_ONE) {
WP_APP_TOKEN_ONE = process.env.WP_APP_TOKEN_ONE;
}
if (process.env.BEANCHANGE_ExJxBeans == "true") {
if (time >= 17) {
console.log(`检测到设定了临期京豆转换喜豆...`);
doExJxBeans = process.env.BEANCHANGE_ExJxBeans;
} else {
console.log(`检测到设定了临期京豆转换喜豆,但时间未到17点后,暂不执行转换...`);
}
}
}
if (WP_APP_TOKEN_ONE)
console.log(`检测到已配置Wxpusher的Token,启用一对一推送...`);
else
console.log(`检测到未配置Wxpusher的Token,禁用一对一推送...`);
if ($.isNode() && process.env.BEANCHANGE_PERSENT) {
intPerSent = parseInt(process.env.BEANCHANGE_PERSENT);
console.log(`检测到设定了分段通知:` + intPerSent);
}
if ($.isNode() && process.env.BEANCHANGE_USERGP2) {
MessageUserGp2 = process.env.BEANCHANGE_USERGP2 ? process.env.BEANCHANGE_USERGP2.split('&') : [];
intPerSent = 0; //分组推送,禁用账户拆分
console.log(`检测到设定了分组推送2,将禁用分段通知`);
}
if ($.isNode() && process.env.BEANCHANGE_USERGP3) {
MessageUserGp3 = process.env.BEANCHANGE_USERGP3 ? process.env.BEANCHANGE_USERGP3.split('&') : [];
intPerSent = 0; //分组推送,禁用账户拆分
console.log(`检测到设定了分组推送3,将禁用分段通知`);
}
if ($.isNode() && process.env.BEANCHANGE_USERGP4) {
MessageUserGp4 = process.env.BEANCHANGE_USERGP4 ? process.env.BEANCHANGE_USERGP4.split('&') : [];
intPerSent = 0; //分组推送,禁用账户拆分
console.log(`检测到设定了分组推送4,将禁用分段通知`);
}
//取消月结查询
//if ($.isNode() && process.env.BEANCHANGE_ENABLEMONTH) {
//EnableMonth = process.env.BEANCHANGE_ENABLEMONTH;
//}
if ($.isNode() && process.env.BEANCHANGE_SUBNOTIFY) {
strSubNotify = process.env.BEANCHANGE_SUBNOTIFY;
strSubNotify += "\n";
console.log(`检测到预览置顶内容,将在一对一推送的预览显示...\n`);
}
if ($.isNode() && process.env.BEANCHANGE_ALLNOTIFY) {
strAllNotify = process.env.BEANCHANGE_ALLNOTIFY;
console.log(`检测到设定了公告,将在推送信息中置顶显示...`);
strAllNotify = `【✨✨✨✨公告✨✨✨✨】\n` + strAllNotify;
console.log(strAllNotify + "\n");
strAllNotify += `\n🎏🎏🎏🎏🎏🎏🎏🎏🎏🎏🎏🎏🎏`
}
if (EnableMonth == "true" && Today.getDate() == 1 && Today.getHours() > 17)
llShowMonth = true;
let userIndex2 = -1;
let userIndex3 = -1;
let userIndex4 = -1;
let decExBean = 0;
if ($.isNode()) {
Object.keys(jdCookieNode).forEach((item) => {
cookiesArr.push(jdCookieNode[item])
})
if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false')
console.log = () => {
};
} else {
cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item);
}
//查询开关
let strDisableList = "";
let DisableIndex = -1;
if ($.isNode()) {
strDisableList = process.env.BEANCHANGE_DISABLELIST ? process.env.BEANCHANGE_DISABLELIST.split('&') : [];
}
//喜豆查询
let EnableJxBeans = true;
DisableIndex = strDisableList.findIndex((item) => item === "喜豆查询");
if (DisableIndex !== -1) {
console.log("检测到设定关闭喜豆查询");
EnableJxBeans = false
}
//汪汪乐园
// let EnableJoyPark = true;
let EnableJoyPark = false;
DisableIndex = strDisableList.findIndex((item) => item === "汪汪乐园");
if (DisableIndex !== -1) {
console.log("检测到设定关闭汪汪乐园查询");
EnableJoyPark = false
}
//京东赚赚
// let EnableJdZZ = true;
let EnableJdZZ = false;
DisableIndex = strDisableList.findIndex((item) => item === "京东赚赚");
if (DisableIndex !== -1) {
console.log("检测到设定关闭京东赚赚查询");
EnableJdZZ = false;
}
//京东秒杀
// let EnableJdMs = true;
let EnableJdMs = false;
DisableIndex = strDisableList.findIndex((item) => item === "京东秒杀");
if (DisableIndex !== -1) {
console.log("检测到设定关闭京东秒杀查询");
EnableJdMs = false;
}
//东东农场
let EnableJdFruit = true;
DisableIndex = strDisableList.findIndex((item) => item === "东东农场");
if (DisableIndex !== -1) {
console.log("检测到设定关闭东东农场查询");
EnableJdFruit = false;
}
//极速金币
let EnableJdSpeed = true;
DisableIndex = strDisableList.findIndex((item) => item === "极速金币");
if (DisableIndex !== -1) {
console.log("检测到设定关闭极速金币查询");
EnableJdSpeed = false;
}
//京喜牧场
let EnableJxMC = true;
DisableIndex = strDisableList.findIndex((item) => item === "京喜牧场");
if (DisableIndex !== -1) {
console.log("检测到设定关闭京喜牧场查询");
EnableJxMC = false;
}
//京喜工厂
let EnableJxGC = true;
DisableIndex = strDisableList.findIndex((item) => item === "京喜工厂");
if (DisableIndex !== -1) {
console.log("检测到设定关闭京喜工厂查询");
EnableJxGC = false;
}
// 京东工厂
let EnableJDGC = true;
DisableIndex = strDisableList.findIndex((item) => item === "京东工厂");
if (DisableIndex !== -1) {
console.log("检测到设定关闭京东工厂查询");
EnableJDGC = false;
}
//领现金
// let EnableCash = true;
let EnableCash = false;
DisableIndex = strDisableList.findIndex((item) => item === "领现金");
if (DisableIndex !== -1) {
console.log("检测到设定关闭领现金查询");
EnableCash = false;
}
//金融养猪
let EnablePigPet = true;
DisableIndex = strDisableList.findIndex((item) => item === "金融养猪");
if (DisableIndex !== -1) {
console.log("检测到设定关闭金融养猪查询");
EnablePigPet = false;
}
//东东萌宠
let EnableJDPet = true;
DisableIndex = strDisableList.findIndex((item) => item === "东东萌宠");
if (DisableIndex !== -1) {
console.log("检测到设定关闭东东萌宠查询");
EnableJDPet = false
}
// DisableIndex = strDisableList.findIndex((item) => item === "活动攻略");
// if (DisableIndex !== -1) {
// console.log("检测到设定关闭活动攻略显示");
// RemainMessage = "";
// }
RemainMessage = "";
!(async () => {
if (!cookiesArr[0]) {
$.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', {
"open-url": "https://bean.m.jd.com/bean/signIndex.action"
});
return;
}
for (i = 0; i < cookiesArr.length; i++) {
if (cookiesArr[i]) {
cookie = cookiesArr[i];
$.pt_pin = (cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
$.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
$.CryptoJS = $.isNode() ? require('crypto-js') : CryptoJS;
$.index = i + 1;
$.beanCount = 0;
$.incomeBean = 0;
$.expenseBean = 0;
$.todayIncomeBean = 0;
$.todayOutcomeBean = 0;
$.errorMsg = '';
$.isLogin = true;
$.nickName = '';
$.levelName = '';
$.message = '';
$.balance = 0;
$.expiredBalance = 0;
$.JdzzNum = 0;
$.JdMsScore = 0;
$.JdFarmProdName = '';
$.JdtreeEnergy = 0;
$.JdtreeTotalEnergy = 0;
$.treeState = 0;
$.JdwaterTotalT = 0;
$.JdwaterD = 0;
$.JDwaterEveryDayT = 0;
$.JDtotalcash = 0;
$.JDEggcnt = 0;
$.Jxmctoken = '';
$.DdFactoryReceive = '';
$.jxFactoryInfo = '';
$.jxFactoryReceive = '';
$.jdCash = 0;
$.isPlusVip = 0;
$.JingXiang = "";
$.allincomeBean = 0; //月收入
$.allexpenseBean = 0; //月支出
$.joylevel = 0;
$.beanChangeXi = 0;
$.inJxBean = 0;
$.OutJxBean = 0;
$.todayinJxBean = 0;
$.todayOutJxBean = 0;
$.xibeanCount = 0;
$.PigPet = '';
$.YunFeiTitle = "";
$.YunFeiQuan = 0;
$.YunFeiQuanEndTime = "";
$.YunFeiTitle2 = "";
$.YunFeiQuan2 = 0;
$.YunFeiQuanEndTime2 = "";
TempBaipiao = "";
strGuoqi = "";
console.log(`******开始查询【京东账号${$.index}】${$.nickName || $.UserName}*********`);
await TotalBean();
await TotalBean2();
if (!$.isLogin) {
await isLoginByX1a0He();
}
if (!$.isLogin) {
$.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, {
"open-url": "https://bean.m.jd.com/bean/signIndex.action"
});
if ($.isNode()) {
await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`);
}
continue
}
//汪汪乐园
if (EnableJoyPark)
await getJoyBaseInfo();
//京东赚赚
if (EnableJdZZ)
await getJdZZ();
//京东秒杀
if (EnableJdMs)
await getMs();
//东东农场
if (EnableJdFruit) {
llgeterror = false;
await getjdfruit();
if (llgeterror) {
console.log(`东东农场API查询失败,等待10秒后再次尝试...`)
await $.wait(10 * 1000);
await getjdfruit();
}
if (llgeterror) {
console.log(`东东农场API查询失败,有空重启路由器换个IP吧.`)
}
}
//极速金币
if (EnableJdSpeed)
await cash();
//京喜牧场
if (EnableJxMC) {
await requestAlgo();
await JxmcGetRequest();
}
//京豆查询
await bean();
if (llShowMonth) {
console.log("开始获取月数据,请稍后...");
await Monthbean();
console.log("月数据获取完毕,暂停10秒防止IP被黑...");
await $.wait(10 * 1000);
}
//京喜工厂
if (EnableJxGC)
await getJxFactory();
// 京东工厂
if (EnableJDGC)
await getDdFactoryInfo();
//领现金
if (EnableCash)
await jdCash();
//喜豆查询
if (EnableJxBeans) {
await GetJxBeanInfo();
await jxbean();
}
//金融养猪
if (EnablePigPet)
await GetPigPetInfo();
await showMsg();
if (intPerSent > 0) {
if ((i + 1) % intPerSent == 0) {
console.log("分段通知条件达成,处理发送通知....");
if ($.isNode() && allMessage) {
var TempMessage = allMessage;
if (strAllNotify)
allMessage = strAllNotify + `\n` + allMessage;
await notify.sendNotify(`${$.name}`, `${allMessage}`, {
url: `https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean`
}, `\n\n本通知 By ccwav Mod\n\nJDHelloWorld.ts\n${new Date().Format("yyyy-MM-dd hh:mm:ss")}`, TempMessage)
}
if ($.isNode() && allMessageMonth) {
await notify.sendNotify(`京东月资产变动`, `${allMessageMonth}`, {
url: `https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean`
})
}
allMessage = "";
allMessageMonth = "";
}
}
}
}
//组1通知
if (ReceiveMessageGp4) {
allMessage2Gp4 = `【⏰商品白嫖活动领取提醒⏰】\n` + ReceiveMessageGp4;
}
if (WarnMessageGp4) {
if (allMessage2Gp4) {
allMessage2Gp4 = `\n` + allMessage2Gp4;
}
allMessage2Gp4 = `【⏰商品白嫖活动任务提醒⏰】\n` + WarnMessageGp4 + allMessage2Gp4;
}
//组2通知
if (ReceiveMessageGp2) {
allMessage2Gp2 = `【⏰商品白嫖活动领取提醒⏰】\n` + ReceiveMessageGp2;
}
if (WarnMessageGp2) {
if (allMessage2Gp2) {
allMessage2Gp2 = `\n` + allMessage2Gp2;
}
allMessage2Gp2 = `【⏰商品白嫖活动任务提醒⏰】\n` + WarnMessageGp2 + allMessage2Gp2;
}
//组3通知
if (ReceiveMessageGp3) {
allMessage2Gp3 = `【⏰商品白嫖活动领取提醒⏰】\n` + ReceiveMessageGp3;
}
if (WarnMessageGp3) {
if (allMessage2Gp3) {
allMessage2Gp3 = `\n` + allMessage2Gp3;
}
allMessage2Gp3 = `【⏰商品白嫖活动任务提醒⏰】\n` + WarnMessageGp3 + allMessage2Gp3;
}
//其他通知
if (allReceiveMessage) {
allMessage2 = `【⏰商品白嫖活动领取提醒⏰】\n` + allReceiveMessage;
}
if (allWarnMessage) {
if (allMessage2) {
allMessage2 = `\n` + allMessage2;
}
allMessage2 = `【⏰商品白嫖活动任务提醒⏰】\n` + allWarnMessage + allMessage2;
}
if (intPerSent > 0) {
//console.log("分段通知还剩下" + cookiesArr.length % intPerSent + "个账号需要发送...");
if (allMessage || allMessageMonth) {
console.log("分段通知收尾,处理发送通知....");
if ($.isNode() && allMessage) {
var TempMessage = allMessage;
if (strAllNotify)
allMessage = strAllNotify + `\n` + allMessage;
await notify.sendNotify(`${$.name}`, `${allMessage}`, {
url: `https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean`
}, `\n\n本通知 By ccwav Mod\n\nJDHelloWorld.ts\n${new Date().Format("yyyy-MM-dd hh:mm:ss")}`, TempMessage)
}
if ($.isNode() && allMessageMonth) {
await notify.sendNotify(`京东月资产变动`, `${allMessageMonth}`, {
url: `https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean`
})
}
}
} else {
if ($.isNode() && allMessageGp2) {
var TempMessage = allMessageGp2;
if (strAllNotify)
allMessageGp2 = strAllNotify + `\n` + allMessageGp2;
await notify.sendNotify(`${$.name}#2`, `${allMessageGp2}`, {
url: `https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean`
}, `\n\n本通知 By ccwav Mod\n\nJDHelloWorld.ts\n${new Date().Format("yyyy-MM-dd hh:mm:ss")}`, TempMessage)
await $.wait(10 * 1000);
}
if ($.isNode() && allMessageGp3) {
var TempMessage = allMessageGp3;
if (strAllNotify)
allMessageGp3 = strAllNotify + `\n` + allMessageGp3;
await notify.sendNotify(`${$.name}#3`, `${allMessageGp3}`, {
url: `https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean`
}, `\n\n本通知 By ccwav Mod\n\nJDHelloWorld.ts\n${new Date().Format("yyyy-MM-dd hh:mm:ss")}`, TempMessage)
await $.wait(10 * 1000);
}
if ($.isNode() && allMessageGp4) {
var TempMessage = allMessageGp4;
if (strAllNotify)
allMessageGp4 = strAllNotify + `\n` + allMessageGp4;
await notify.sendNotify(`${$.name}#4`, `${allMessageGp4}`, {
url: `https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean`
}, `\n\n本通知 By ccwav Mod\n\nJDHelloWorld.ts\n${new Date().Format("yyyy-MM-dd hh:mm:ss")}`, TempMessage)
await $.wait(10 * 1000);
}
if ($.isNode() && allMessage) {
var TempMessage = allMessage;
if (strAllNotify)
allMessage = strAllNotify + `\n` + allMessage;
await notify.sendNotify(`${$.name}`, `${allMessage}`, {
url: `https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean`
}, `\n\n本通知 By ccwav Mod\n\nJDHelloWorld.ts\n${new Date().Format("yyyy-MM-dd hh:mm:ss")}`, TempMessage)
await $.wait(10 * 1000);
}
if ($.isNode() && allMessageMonthGp2) {
await notify.sendNotify(`京东月资产变动#2`, `${allMessageMonthGp2}`, {
url: `https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean`
})
await $.wait(10 * 1000);
}
if ($.isNode() && allMessageMonthGp3) {
await notify.sendNotify(`京东月资产变动#3`, `${allMessageMonthGp3}`, {
url: `https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean`
})
await $.wait(10 * 1000);
}
if ($.isNode() && allMessageMonthGp4) {
await notify.sendNotify(`京东月资产变动#4`, `${allMessageMonthGp4}`, {
url: `https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean`
})
await $.wait(10 * 1000);
}
if ($.isNode() && allMessageMonth) {
await notify.sendNotify(`京东月资产变动`, `${allMessageMonth}`, {
url: `https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean`
})
await $.wait(10 * 1000);
}
}
if ($.isNode() && allMessage2Gp2) {
allMessage2Gp2 += RemainMessage;
await notify.sendNotify("京东白嫖榜#2", `${allMessage2Gp2}`, {
url: `https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean`
})
await $.wait(10 * 1000);
}
if ($.isNode() && allMessage2Gp3) {
allMessage2Gp3 += RemainMessage;
await notify.sendNotify("京东白嫖榜#3", `${allMessage2Gp3}`, {
url: `https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean`
})
await $.wait(10 * 1000);
}
if ($.isNode() && allMessage2Gp4) {
allMessage2Gp4 += RemainMessage;
await notify.sendNotify("京东白嫖榜#4", `${allMessage2Gp4}`, {
url: `https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean`
})
await $.wait(10 * 1000);
}
if ($.isNode() && allMessage2) {
allMessage2 += RemainMessage;
await notify.sendNotify("京东白嫖榜", `${allMessage2}`, {
url: `https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean`
})
await $.wait(10 * 1000);
}
})()
.catch((e) => {
$.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
})
.finally(() => {
$.done();
})
async function showMsg() {
//if ($.errorMsg)
//return
ReturnMessageTitle = "";
ReturnMessage = "";
var strsummary = "";
if (MessageUserGp2) {
userIndex2 = MessageUserGp2.findIndex((item) => item === $.pt_pin);
}
if (MessageUserGp3) {
userIndex3 = MessageUserGp3.findIndex((item) => item === $.pt_pin);
}
if (MessageUserGp4) {
userIndex4 = MessageUserGp4.findIndex((item) => item === $.pt_pin);
}
if (userIndex2 !== -1) {
IndexGp2 += 1;
ReturnMessageTitle = `【账号${IndexGp2}🆔】${$.nickName || $.UserName}\n`;
}
if (userIndex3 !== -1) {
IndexGp3 += 1;
ReturnMessageTitle = `【账号${IndexGp3}🆔】${$.nickName || $.UserName}\n`;
}
if (userIndex4 !== -1) {
IndexGp4 += 1;
ReturnMessageTitle = `【账号${IndexGp4}🆔】${$.nickName || $.UserName}\n`;
}
if (userIndex2 == -1 && userIndex3 == -1 && userIndex4 == -1) {
IndexAll += 1;
ReturnMessageTitle = `【账号${IndexAll}🆔】${$.nickName || $.UserName}\n`;
}
if ($.levelName || $.JingXiang) {
ReturnMessage += `【账号信息】`;
if ($.levelName) {
if ($.levelName.length > 2)
$.levelName = $.levelName.substring(0, 2);
if ($.levelName == "注册")
$.levelName = `😊普通`;
if ($.levelName == "钻石")
$.levelName = `💎钻石`;
if ($.levelName == "金牌")
$.levelName = `🥇金牌`;
if ($.levelName == "银牌")
$.levelName = `🥈银牌`;
if ($.levelName == "铜牌")
$.levelName = `🥉铜牌`;
if ($.isPlusVip == 1)
ReturnMessage += `${$.levelName}Plus`;
else
ReturnMessage += `${$.levelName}会员`;
}
if ($.JingXiang) {
if ($.levelName) {
ReturnMessage += ",";
}
ReturnMessage += `${$.JingXiang}`;
}
ReturnMessage += `\n`;
}
if (llShowMonth) {
ReturnMessageMonth = ReturnMessage;
ReturnMessageMonth += `\n【上月收入】:${$.allincomeBean}京豆 🐶\n`;
ReturnMessageMonth += `【上月支出】:${$.allexpenseBean}京豆 🐶\n`;
console.log(ReturnMessageMonth);
if (userIndex2 !== -1) {
allMessageMonthGp2 += ReturnMessageMonth + `\n`;
}
if (userIndex3 !== -1) {
allMessageMonthGp3 += ReturnMessageMonth + `\n`;
}
if (userIndex4 !== -1) {
allMessageMonthGp4 += ReturnMessageMonth + `\n`;
}
if (userIndex2 == -1 && userIndex3 == -1 && userIndex4 == -1) {
allMessageMonth += ReturnMessageMonth + `\n`;
}
if ($.isNode() && WP_APP_TOKEN_ONE) {
await notify.sendNotifybyWxPucher("京东月资产变动", `${ReturnMessageMonth}`, `${$.UserName}`);
}
}
ReturnMessage += `【今日京豆】收${$.todayIncomeBean}豆`;
strsummary += `【今日京豆】收${$.todayIncomeBean}豆`;
if ($.todayOutcomeBean !== 0) {
ReturnMessage += `,支${$.todayOutcomeBean}豆`;
strsummary += `,支${$.todayOutcomeBean}豆`;
}
ReturnMessage += `\n`;
strsummary += `\n`;
ReturnMessage += `【昨日京豆】收${$.incomeBean}豆`;
if ($.expenseBean !== 0) {
ReturnMessage += `,支${$.expenseBean}豆`;
}
ReturnMessage += `\n`;
if ($.beanCount) {
ReturnMessage += `【当前京豆】${$.beanCount - $.beanChangeXi}豆(≈${(($.beanCount - $.beanChangeXi) / 100).toFixed(2)}元)\n`;
strsummary += `【当前京豆】${$.beanCount - $.beanChangeXi}豆(≈${(($.beanCount - $.beanChangeXi) / 100).toFixed(2)}元)\n`;
} else {
if ($.levelName || $.JingXiang)
ReturnMessage += `【当前京豆】获取失败,接口返回空数据\n`;
else {
ReturnMessage += `【当前京豆】${$.beanCount - $.beanChangeXi}豆(≈${(($.beanCount - $.beanChangeXi) / 100).toFixed(2)}元)\n`;
strsummary += `【当前京豆】${$.beanCount - $.beanChangeXi}豆(≈${(($.beanCount - $.beanChangeXi) / 100).toFixed(2)}元)\n`;
}
}
if (EnableJxBeans) {
ReturnMessage += `【今日喜豆】收${$.todayinJxBean}豆`;
if ($.todayOutJxBean !== 0) {
ReturnMessage += `,支${$.todayOutJxBean}豆`;
}
ReturnMessage += `\n`;
ReturnMessage += `【昨日喜豆】收${$.inJxBean}豆`;
if ($.OutJxBean !== 0) {
ReturnMessage += `,支${$.OutJxBean}豆`;
}
ReturnMessage += `\n`;
ReturnMessage += `【当前喜豆】${$.xibeanCount}喜豆(≈${($.xibeanCount / 100).toFixed(2)}元)\n`;
strsummary += `【当前喜豆】${$.xibeanCount}豆(≈${($.xibeanCount / 100).toFixed(2)}元)\n`;
}
if ($.JDEggcnt) {
ReturnMessage += `【京喜牧场】${$.JDEggcnt}枚鸡蛋\n`;
}
if ($.JDtotalcash) {
ReturnMessage += `【极速金币】${$.JDtotalcash}币(≈${($.JDtotalcash / 10000).toFixed(2)}元)\n`;
}
if ($.JdzzNum) {
ReturnMessage += `【京东赚赚】${$.JdzzNum}币(≈${($.JdzzNum / 10000).toFixed(2)}元)\n`;
}
if ($.JdMsScore !== 0) {
ReturnMessage += `【京东秒杀】${$.JdMsScore}币(≈${($.JdMsScore / 1000).toFixed(2)}元)\n`;
}
if ($.joylevel || $.jdCash) {
ReturnMessage += `【其他信息】`;
if ($.joylevel) {
ReturnMessage += `汪汪:${$.joylevel}级`;
if ($.jdCash) {
ReturnMessage += ",";
}
}
if ($.jdCash) {
ReturnMessage += `领现金:${$.jdCash}元`;
}
ReturnMessage += `\n`;
}
if ($.JdFarmProdName !== "") {
if ($.JdtreeEnergy !== 0) {
if ($.treeState === 2 || $.treeState === 3) {
ReturnMessage += `【东东农场】${$.JdFarmProdName} 可以兑换了!\n`;
TempBaipiao += `【东东农场】${$.JdFarmProdName} 可以兑换了!\n`;
if (userIndex2 !== -1) {
ReceiveMessageGp2 += `【账号${IndexGp2} ${$.nickName || $.UserName}】${$.JdFarmProdName} (东东农场)\n`;
}
if (userIndex3 !== -1) {
ReceiveMessageGp3 += `【账号${IndexGp3} ${$.nickName || $.UserName}】${$.JdFarmProdName} (东东农场)\n`;
}
if (userIndex4 !== -1) {
ReceiveMessageGp4 += `【账号${IndexGp4} ${$.nickName || $.UserName}】${$.JdFarmProdName} (东东农场)\n`;
}
if (userIndex2 == -1 && userIndex3 == -1 && userIndex4 == -1) {
allReceiveMessage += `【账号${IndexAll} ${$.nickName || $.UserName}】${$.JdFarmProdName} (东东农场)\n`;
}
} else {
if ($.JdwaterD !== 'Infinity' && $.JdwaterD !== '-Infinity') {
ReturnMessage += `【东东农场】${$.JdFarmProdName}(${(($.JdtreeEnergy / $.JdtreeTotalEnergy) * 100).toFixed(0)}%,${$.JdwaterD}天)\n`;
} else {
ReturnMessage += `【东东农场】${$.JdFarmProdName}(${(($.JdtreeEnergy / $.JdtreeTotalEnergy) * 100).toFixed(0)}%)\n`;
}
}
} else {
if ($.treeState === 0) {
TempBaipiao += `【东东农场】水果领取后未重新种植!\n`;
if (userIndex2 !== -1) {
WarnMessageGp2 += `【账号${IndexGp2} ${$.nickName || $.UserName}】水果领取后未重新种植! (东东农场)\n`;
}
if (userIndex3 !== -1) {
WarnMessageGp3 += `【账号${IndexGp3} ${$.nickName || $.UserName}】水果领取后未重新种植! (东东农场)\n`;
}
if (userIndex4 !== -1) {
WarnMessageGp4 += `【账号${IndexGp4} ${$.nickName || $.UserName}】水果领取后未重新种植! (东东农场)\n`;
}
if (userIndex2 == -1 && userIndex3 == -1 && userIndex4 == -1) {
allWarnMessage += `【账号${IndexAll} ${$.nickName || $.UserName}】水果领取后未重新种植! (东东农场)\n`;
}
} else if ($.treeState === 1) {
ReturnMessage += `【东东农场】${$.JdFarmProdName}种植中...\n`;
} else {
TempBaipiao += `【东东农场】状态异常!\n`;
if (userIndex2 !== -1) {
WarnMessageGp2 += `【账号${IndexGp2} ${$.nickName || $.UserName}】状态异常! (东东农场)\n`;
}
if (userIndex3 !== -1) {
WarnMessageGp3 += `【账号${IndexGp3} ${$.nickName || $.UserName}】状态异常! (东东农场)\n`;
}
if (userIndex4 !== -1) {
WarnMessageGp4 += `【账号${IndexGp4} ${$.nickName || $.UserName}】状态异常! (东东农场)\n`;
}
if (userIndex2 == -1 && userIndex3 == -1 && userIndex4 == -1) {
allWarnMessage += `【账号${IndexAll} ${$.nickName || $.UserName}】状态异常! (东东农场)\n`;
}
//ReturnMessage += `【东东农场】${$.JdFarmProdName}状态异常${$.treeState}...\n`;
}
}
}
if ($.jxFactoryInfo) {
ReturnMessage += `【京喜工厂】${$.jxFactoryInfo}\n`
}
if ($.ddFactoryInfo) {
ReturnMessage += `【东东工厂】${$.ddFactoryInfo}\n`
}
if ($.DdFactoryReceive) {
if (userIndex2 !== -1) {
ReceiveMessageGp2 += `【账号${IndexGp2} ${$.nickName || $.UserName}】${$.DdFactoryReceive} (东东工厂)\n`;
}
if (userIndex3 !== -1) {
ReceiveMessageGp3 += `【账号${IndexGp3} ${$.nickName || $.UserName}】${$.DdFactoryReceive} (东东工厂)\n`;
}
if (userIndex4 !== -1) {
ReceiveMessageGp4 += `【账号${IndexGp4} ${$.nickName || $.UserName}】${$.DdFactoryReceive} (东东工厂)\n`;
}
if (userIndex2 == -1 && userIndex3 == -1 && userIndex4 == -1) {
allReceiveMessage += `【账号${IndexAll} ${$.nickName || $.UserName}】${$.DdFactoryReceive} (东东工厂)\n`;
}
TempBaipiao += `【东东工厂】${$.ddFactoryInfo} 可以兑换了!\n`;
}
if ($.jxFactoryReceive) {
if (userIndex2 !== -1) {
ReceiveMessageGp2 += `【账号${IndexGp2} ${$.nickName || $.UserName}】${$.jxFactoryReceive} (京喜工厂)\n`;
}
if (userIndex3 !== -1) {
ReceiveMessageGp3 += `【账号${IndexGp3} ${$.nickName || $.UserName}】${$.jxFactoryReceive} (京喜工厂)\n`;
}
if (userIndex4 !== -1) {
ReceiveMessageGp4 += `【账号${IndexGp4} ${$.nickName || $.UserName}】${$.jxFactoryReceive} (京喜工厂)\n`;
}
if (userIndex2 == -1 && userIndex3 == -1 && userIndex4 == -1) {
allReceiveMessage += `【账号${IndexAll} ${$.nickName || $.UserName}】${$.jxFactoryReceive} (京喜工厂)\n`;
}
TempBaipiao += `【京喜工厂】${$.jxFactoryReceive} 可以兑换了!\n`;
}
if ($.PigPet) {
if (userIndex2 !== -1) {
ReceiveMessageGp2 += `【账号${IndexGp2} ${$.nickName || $.UserName}】${$.PigPet} (金融养猪)\n`;
}
if (userIndex3 !== -1) {
ReceiveMessageGp3 += `【账号${IndexGp3} ${$.nickName || $.UserName}】${$.PigPet} (金融养猪)\n`;
}
if (userIndex4 !== -1) {
ReceiveMessageGp4 += `【账号${IndexGp4} ${$.nickName || $.UserName}】${$.PigPet} (金融养猪)\n`;
}
if (userIndex2 == -1 && userIndex3 == -1 && userIndex4 == -1) {
allReceiveMessage += `【账号${IndexAll} ${$.nickName || $.UserName}】${$.PigPet} (金融养猪)\n`;
}
TempBaipiao += `【金融养猪】${$.PigPet} 可以兑换了!\n`;
}
if (EnableJDPet) {
llPetError = false;
const response = await PetRequest('energyCollect');
const initPetTownRes = await PetRequest('initPetTown');
if (!llPetError && initPetTownRes) {
if (initPetTownRes.code === '0' && initPetTownRes.resultCode === '0' && initPetTownRes.message === 'success') {
$.petInfo = initPetTownRes.result;
if ($.petInfo.userStatus === 0) {
ReturnMessage += `【东东萌宠】活动未开启!\n`;
} else if ($.petInfo.petStatus === 5) {
ReturnMessage += `【东东萌宠】${$.petInfo.goodsInfo.goodsName}已可领取!\n`;
TempBaipiao += `【东东萌宠】${$.petInfo.goodsInfo.goodsName}已可领取!\n`;
if (userIndex2 !== -1) {
ReceiveMessageGp2 += `【账号${IndexGp2} ${$.nickName || $.UserName}】${$.petInfo.goodsInfo.goodsName}可以兑换了! (东东萌宠)\n`;
}
if (userIndex3 !== -1) {
ReceiveMessageGp3 += `【账号${IndexGp3} ${$.nickName || $.UserName}】${$.petInfo.goodsInfo.goodsName}可以兑换了! (东东萌宠)\n`;
}
if (userIndex4 !== -1) {
ReceiveMessageGp4 += `【账号${IndexGp4} ${$.nickName || $.UserName}】${$.petInfo.goodsInfo.goodsName}可以兑换了! (东东萌宠)\n`;
}
if (userIndex2 == -1 && userIndex3 == -1 && userIndex4 == -1) {
allReceiveMessage += `【账号${IndexAll} ${$.nickName || $.UserName}】${$.petInfo.goodsInfo.goodsName}可以兑换了! (东东萌宠)\n`;
}
} else if ($.petInfo.petStatus === 6) {
TempBaipiao += `【东东萌宠】未选择物品! \n`;
if (userIndex2 !== -1) {
WarnMessageGp2 += `【账号${IndexGp2} ${$.nickName || $.UserName}】未选择物品! (东东萌宠)\n`;
}
if (userIndex3 !== -1) {
WarnMessageGp3 += `【账号${IndexGp3} ${$.nickName || $.UserName}】未选择物品! (东东萌宠)\n`;
}
if (userIndex4 !== -1) {
WarnMessageGp4 += `【账号${IndexGp4} ${$.nickName || $.UserName}】未选择物品! (东东萌宠)\n`;
}
if (userIndex2 == -1 && userIndex3 == -1 && userIndex4 == -1) {
allWarnMessage += `【账号${IndexAll} ${$.nickName || $.UserName}】未选择物品! (东东萌宠)\n`;
}
} else if (response.resultCode === '0') {
ReturnMessage += `【东东萌宠】${$.petInfo.goodsInfo.goodsName}`;
ReturnMessage += `(${(response.result.medalPercent).toFixed(0)}%,${response.result.medalNum}/${response.result.medalNum + response.result.needCollectMedalNum}块)\n`;
} else if (!$.petInfo.goodsInfo) {
ReturnMessage += `【东东萌宠】暂未选购新的商品!\n`;
TempBaipiao += `【东东萌宠】暂未选购新的商品! \n`;
if (userIndex2 !== -1) {
WarnMessageGp2 += `【账号${IndexGp2} ${$.nickName || $.UserName}】暂未选购新的商品! (东东萌宠)\n`;
}
if (userIndex3 !== -1) {
WarnMessageGp3 += `【账号${IndexGp3} ${$.nickName || $.UserName}】暂未选购新的商品! (东东萌宠)\n`;
}
if (userIndex4 !== -1) {
WarnMessageGp4 += `【账号${IndexGp4} ${$.nickName || $.UserName}】暂未选购新的商品! (东东萌宠)\n`;
}
if (userIndex2 == -1 && userIndex3 == -1 && userIndex4 == -1) {
allWarnMessage += `【账号${IndexAll} ${$.nickName || $.UserName}】暂未选购新的商品! (东东萌宠)\n`;
}
}
}
}
}
if (strGuoqi) {
ReturnMessage += `💸💸💸临期京豆明细💸💸💸\n`;
ReturnMessage += `${strGuoqi}`;
}
ReturnMessage += `🧧🧧🧧红包明细🧧🧧🧧\n`;
ReturnMessage += `${$.message}`;
strsummary += `${$.message}`;
if ($.YunFeiQuan) {
var strTempYF = "【免运费券】" + $.YunFeiQuan + "张";
if ($.YunFeiQuanEndTime)
strTempYF += "(有效期至" + $.YunFeiQuanEndTime + ")";
strTempYF += "\n";
ReturnMessage += strTempYF
strsummary += strTempYF;
}
if ($.YunFeiQuan2) {
var strTempYF2 = "【免运费券】" + $.YunFeiQuan2 + "张";
if ($.YunFeiQuanEndTime2)
strTempYF += "(有效期至" + $.YunFeiQuanEndTime2 + ")";
strTempYF2 += "\n";
ReturnMessage += strTempYF2
strsummary += strTempYF2;
}
if (userIndex2 !== -1) {
allMessageGp2 += ReturnMessageTitle + ReturnMessage + `\n`;
}
if (userIndex3 !== -1) {
allMessageGp3 += ReturnMessageTitle + ReturnMessage + `\n`;
}
if (userIndex4 !== -1) {
allMessageGp4 += ReturnMessageTitle + ReturnMessage + `\n`;
}
if (userIndex2 == -1 && userIndex3 == -1 && userIndex4 == -1) {
allMessage += ReturnMessageTitle + ReturnMessage + `\n`;
}
console.log(`${ReturnMessageTitle + ReturnMessage}`);
if ($.isNode() && WP_APP_TOKEN_ONE) {
var strTitle = "京东资产变动";
ReturnMessage = `【账号名称】${$.nickName || $.UserName}\n` + ReturnMessage;
if (TempBaipiao) {
strsummary = strSubNotify + TempBaipiao + strsummary;
TempBaipiao = `【⏰商品白嫖活动提醒⏰】\n` + TempBaipiao;