Update jd_task_newUnique.js

This commit is contained in:
可达鸭 2025-07-06 23:40:08 +08:00
parent fec1b921a6
commit a339c5a69c

View File

@ -121,158 +121,177 @@ export class Main extends Template {
p.info.complete = true p.info.complete = true
return return
} }
let status = 1 else if (this.haskey(list, "data.bizCode", -1002)) {
for (let i of this.haskey(list, 'data.result.taskList')) { p.log("活动已结束,等待开奖")
if (i.completionFlag) { let reward = await this.curl({
p.log("任务完成:", i.assignmentName) 'form': `functionId=newunique_get_reward&appid=signed_wh5&body={"channelId":"3","roundId":"${context.roundId}"}&client=ios&clientVersion=15.0.80`,
status = 1 user,
algo: {
appId: 'ba62b'
}
}
)
if (this.haskey(reward, 'dasta.result.awwardInfo.beanNum')) {
p.award(reward.data.result.awardInfo.beanNum, 'bean')
} }
else { else {
status = 0 p.log(this.haskey(reward, 'data.bizMsg') || reward)
let extraType = i.ext.extraType }
if (this.haskey(i, `ext.${i.ext.extraType}`)) { }
let extra = i.ext[extraType] else {
if (extraType == 'sign1') { let status = 1
status = 1 for (let i of this.haskey(list, 'data.result.taskList')) {
} if (i.completionFlag) {
else if (extraType == 'assistTaskDetail') { p.log("任务完成:", i.assignmentName)
try { status = 1
if (this.help.includes(user)) { }
await this.setTemp(user, extra.itemId, 8640000) else {
} status = 0
if (this.inviter.length) { let extraType = i.ext.extraType
let cc = this.inviter[this.n % this.inviter.length] if (this.haskey(i, `ext.${i.ext.extraType}`)) {
this.n++ let extra = i.ext[extraType]
if (cc.user == user && this.inviter[this.n % this.inviter.length]) { if (extraType == 'sign1') {
cc = this.inviter[this.n % this.inviter.length] status = 1
}
p.log("正在助力:", cc.user)
let doIt = await this.curl({
'form': `functionId=newunique_do_task&appid=signed_wh5&body={"channelId":"3","roundId":"${context.roundId}","itemId":"${cc.itemId}","assignmentId":"${i.encryptAssignmentId}","tType":"1"}&eu=8366530373630343&fv=2346134393666303&client=ios&clientVersion=13.2.9`,
user,
algo: {
appId: 'ba62b'
}
}
)
if (this.haskey(doIt, 'data.result.score')) {
status = 1
p.log("助力成功:", doIt.data.result.score)
}
else {
p.log(this.haskey(doIt, 'data.bizMsg') || doIt)
}
}
} catch (e) {
} }
status = 1 else if (extraType == 'assistTaskDetail') {
} try {
else if (['shoppingActivity', 'productsInfo', 'browseShop', 'addCart', 'followShop', 'followChannel'].includes(extraType)) { if (this.help.includes(user)) {
p.log("正在运行:", i.assignmentName) await this.setTemp(user, extra.itemId, 8640000)
for (let j of extra) { }
let doIt = await this.curl({ if (this.inviter.length) {
'form': `functionId=newunique_do_task&appid=signed_wh5&body={"channelId":"3","roundId":"${context.roundId}","itemId":"${j.itemId}","assignmentId":"${i.encryptAssignmentId}","actionType":1,"jumpUrl":"${encodeURIComponent(j.url)}"}&eu=8366530373630343&fv=2346134393666303&client=ios&clientVersion=13.2.9`, let cc = this.inviter[this.n % this.inviter.length]
user, this.n++
algo: { if (cc.user == user && this.inviter[this.n % this.inviter.length]) {
appId: 'ba62b' cc = this.inviter[this.n % this.inviter.length]
} }
} p.log("正在助力:", cc.user)
) let doIt = await this.curl({
if (this.haskey(doIt, 'data.result')) { 'form': `functionId=newunique_do_task&appid=signed_wh5&body={"channelId":"3","roundId":"${context.roundId}","itemId":"${cc.itemId}","assignmentId":"${i.encryptAssignmentId}","tType":"1"}&eu=8366530373630343&fv=2346134393666303&client=ios&clientVersion=13.2.9`,
if (i.ext.waitDuration) {
p.log("正在等待:", i.ext.waitDuration)
await this.wait(i.ext.waitDuration * 1000)
}
if (this.haskey(doIt, 'data.result.awardTimes')) {
status = 1
p.log("获取票数:", doIt.data.result.awardTimes)
}
else {
let reward = await this.curl({
'form': `functionId=newunique_do_task&appid=signed_wh5&body={"channelId":"3","roundId":"${context.roundId}","itemId":"${j.itemId}","assignmentId":"${i.encryptAssignmentId}","actionType":0,"jumpUrl":"${encodeURIComponent(j.url)}"}&eu=8366530373630343&fv=2346134393666303&client=ios&clientVersion=13.2.9`,
user, user,
algo: { algo: {
appId: 'ba62b' appId: 'ba62b'
} }
} }
) )
if (this.haskey(reward, 'data.result')) { if (this.haskey(doIt, 'data.result.score')) {
p.log("获取票数:", reward.data.result.awardTimes)
status = 1 status = 1
p.log("助力成功:", doIt.data.result.score)
} }
else { else {
status = 0 p.log(this.haskey(doIt, 'data.bizMsg') || doIt)
p.log(this.haskey(reward, 'bizMsg') || reward)
} }
} }
} catch (e) {
} }
else { status = 1
status = 0 }
p.log(this.haskey(doIt, 'bizMsg') || doIt) else if (['shoppingActivity', 'productsInfo', 'browseShop', 'addCart', 'followShop', 'followChannel'].includes(extraType)) {
p.log("正在运行:", i.assignmentName)
for (let j of extra) {
let doIt = await this.curl({
'form': `functionId=newunique_do_task&appid=signed_wh5&body={"channelId":"3","roundId":"${context.roundId}","itemId":"${j.itemId}","assignmentId":"${i.encryptAssignmentId}","actionType":1,"jumpUrl":"${encodeURIComponent(j.url)}"}&eu=8366530373630343&fv=2346134393666303&client=ios&clientVersion=13.2.9`,
user,
algo: {
appId: 'ba62b'
}
}
)
if (this.haskey(doIt, 'data.result')) {
if (i.ext.waitDuration) {
p.log("正在等待:", i.ext.waitDuration)
await this.wait(i.ext.waitDuration * 1000)
}
if (this.haskey(doIt, 'data.result.awardTimes')) {
status = 1
p.log("获取票数:", doIt.data.result.awardTimes)
}
else {
let reward = await this.curl({
'form': `functionId=newunique_do_task&appid=signed_wh5&body={"channelId":"3","roundId":"${context.roundId}","itemId":"${j.itemId}","assignmentId":"${i.encryptAssignmentId}","actionType":0,"jumpUrl":"${encodeURIComponent(j.url)}"}&eu=8366530373630343&fv=2346134393666303&client=ios&clientVersion=13.2.9`,
user,
algo: {
appId: 'ba62b'
}
}
)
if (this.haskey(reward, 'data.result')) {
p.log("获取票数:", reward.data.result.awardTimes)
status = 1
}
else {
status = 0
p.log(this.haskey(reward, 'bizMsg') || reward)
}
}
}
else {
status = 0
p.log(this.haskey(doIt, 'bizMsg') || doIt)
}
} }
} }
} else {
else {
}
}
}
}
if (code) {
let ary = []
for (let i of code) {
if (i.voteInfo.status) {
ary.push(i)
}
}
if (ary.length<2) {
let ranCode = this.random(code, 2 - ary.length)
ary = [...ary, ...ranCode]
}
for (let _ of this.range(0, 1)) {
let i = code[_]
p.log("正在投票:", i.name)
let pop = await this.curl({
'form': `functionId=newunique_popup&appid=signed_wh5&body={"channelId":"3","skuId":"${i.skuId}","roundId":"${context.roundId}"}&client=ios&clientVersion=15.0.80`,
user,
algo: {
appId: 'ba62b'
} }
} }
)
let count = this.haskey(pop, 'data.result.myVotes')
if (_ == 0) {
count = parseInt(count / 2)
} }
for (let _ of this.range(1, count)) { }
let vote = await this.curl({ if (code) {
'form': `functionId=newunique_vote&appid=signed_wh5&body={"channelId":"3","roundId":"${context.roundId}","skuId":"${i.skuId}"}&client=ios&clientVersion=15.1.53`, let ary = []
for (let i of code) {
if (i.voteInfo.status) {
ary.push(i)
}
}
if (ary.length<2) {
let ranCode = this.random(code, 2 - ary.length)
ary = [...ary, ...ranCode]
}
for (let _ of this.range(0, 1)) {
let i = code[_]
p.log("正在投票:", i.name)
let pop = await this.curl({
'form': `functionId=newunique_popup&appid=signed_wh5&body={"channelId":"3","skuId":"${i.skuId}","roundId":"${context.roundId}"}&client=ios&clientVersion=15.0.80`,
user, user,
algo: { algo: {
appId: 'ba62b' appId: 'ba62b'
} }
} }
) )
if (this.haskey(vote, 'data.bizCode', -1005)) { let count = this.haskey(pop, 'data.result.myVotes')
p.log("投票商品数已达上限") if (_ == 0) {
break count = parseInt(count / 2)
} }
else if (this.haskey(vote, 'data.bizCode', -1018)) { for (let _ of this.range(1, count)) {
p.log("当前已无可用票数") let vote = await this.curl({
break 'form': `functionId=newunique_vote&appid=signed_wh5&body={"channelId":"3","roundId":"${context.roundId}","skuId":"${i.skuId}"}&client=ios&clientVersion=15.1.53`,
user,
algo: {
appId: 'ba62b'
}
}
)
if (this.haskey(vote, 'data.bizCode', -1005)) {
p.log("投票商品数已达上限")
break
}
else if (this.haskey(vote, 'data.bizCode', -1018)) {
p.log("当前已无可用票数")
break
}
else if (this.haskey(vote, 'data.result')) {
p.log("投票成功")
}
else {
p.log(vote)
break
}
await this.wait(500)
} }
else if (this.haskey(vote, 'data.result')) {
p.log("投票成功")
}
else {
p.log(vote)
break
}
await this.wait(500)
} }
} }
} if (status) {
if (status) { p.info.work = true
p.info.work = true }
} }
} }
} }