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

Function smtgQueryPkTask

jd_superMarket.js:1174–1216  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1172
1173//查询商圈任务列表
1174function smtgQueryPkTask() {
1175 return new Promise((resolve) => {
1176 $.get(taskUrl('smtg_queryPkTask'), async (err, resp, data) => {
1177 try {
1178 if (err) {
1179 console.log('\n东东超市: API查询请求失败 ‼️‼️')
1180 console.log(JSON.stringify(err));
1181 } else {
1182 data = JSON.parse(data);
1183 if (data.code === 0) {
1184 if (data.data.bizCode === 0) {
1185 const {taskList} = data.data.result;
1186 console.log(`\n 商圈任务 状态`)
1187 for (let item of taskList) {
1188 if (item.taskStatus === 1) {
1189 if (item.prizeStatus === 1) {
1190 //任务已做完,但未领取奖励, 现在为您领取奖励
1191 await smtgObtainPkTaskPrize(item.taskId);
1192 } else if (item.prizeStatus === 0) {
1193 console.log(`[${item.title}] 已做完 ${item.finishNum}/${item.targetNum}`);
1194 }
1195 } else {
1196 console.log(`[${item.title}] 未做完 ${item.finishNum}/${item.targetNum}`)
1197 if (item.content) {
1198 const {itemId} = item.content[item.type];
1199 console.log('itemId', itemId)
1200 await smtgDoPkTask(item.taskId, itemId);
1201 }
1202 }
1203 }
1204 } else {
1205 console.log(`${data.data.bizMsg}`)
1206 }
1207 }
1208 }
1209 } catch (e) {
1210 $.logErr(e, resp);
1211 } finally {
1212 resolve(data);
1213 }
1214 })
1215 })
1216}
1217
1218//PK邀请好友
1219function smtgDoAssistPkTask(code) {

Callers

nothing calls this directly

Calls 6

smtgObtainPkTaskPrizeFunction · 0.85
smtgDoPkTaskFunction · 0.85
taskUrlFunction · 0.70
getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected