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

Function taskList

activity/jd_pubg.js:198–257  ·  view source on GitHub ↗
(get=1)

Source from the content-addressed store, hash-verified

196}
197
198function taskList(get=1) {
199 return new Promise(resolve => {
200 $.get(taskUrl("getHomePage", ), async (err, resp, data) => {
201 try {
202 if (err) {
203 console.log(`${JSON.stringify(err)}`)
204 console.log(`${$.name} API请求失败,请检查网路重试`)
205 } else {
206 if (safeGet(data)) {
207 data = JSON.parse(data);
208 let vo = data.data[0]
209 if (vo.shareId) console.log(`您的${$.name}好友助力码为:${vo.shareId}`)
210 for (let i = 0; i< vo.venueList.length;++i){
211 let venue = vo.venueList[i]
212 if(venue.venueStatus === 1) {
213 console.log(`【浏览会场】`)
214 await doTask(`starId=PUBG&type=venue&id=${venue.venueId}&status=1`)
215 await $.wait(10000)
216 await doTask(`starId=PUBG&type=venue&id=${venue.venueId}&status=2`)
217 }
218 }
219 for (let i = 0; i< vo.productList.length;++i){
220 let product = vo.productList[i]
221 if(product.productStatus === 1) {
222 console.log(`【浏览商品】去浏览商品 ${product.productName}`)
223 await doTask(`starId=PUBG&type=product&id=${product.productId}&status=1`)
224 await $.wait(10000)
225 await doTask(`starId=PUBG&type=product&id=${product.productId}&status=2`)
226 } if(product.productStatus === 2) {
227 console.log(`【浏览商品】浏览商品 ${product.productName}未领奖,去领奖`)
228 await doTask(`starId=PUBG&type=product&id=${product.productId}&status=2`)
229 } else{
230 console.log(`【浏览商品】${product.productName}已做过`)
231 }
232 }
233 for (let i = 0; i< vo.shopList.length;++i){
234 let shop = vo.shopList[i]
235 if(shop.shopStatus === 0 || shop.shopStatus === 1) {
236 console.log(`【关注店铺】去关注店铺 ${shop.shopName}`)
237 await doTask(`starId=PUBG&type=shop&id=${shop.shopId}&status=1`)
238 await $.wait(10000)
239 await doTask(`starId=PUBG&type=shop&id=${shop.shopId}&status=2`)
240 } if(shop.shopStatus === 2) {
241 console.log(`【关注店铺】关注店铺 ${shop.shopName}未领奖,去领奖`)
242 await doTask(`starId=PUBG&type=shop&id=${shop.shopId}&status=2`)
243 }else{
244 console.log(`【关注店铺】${shop.shopName} 已做过`)
245 }
246 }
247
248 }
249 }
250 } catch (e) {
251 $.logErr(e, resp)
252 } finally {
253 resolve();
254 }
255 })

Callers 1

jdHealthFunction · 0.70

Calls 7

taskUrlFunction · 0.70
safeGetFunction · 0.70
doTaskFunction · 0.70
getMethod · 0.45
logMethod · 0.45
waitMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected