(type)
| 542 | } |
| 543 | |
| 544 | async function takePostRequest(type) { |
| 545 | let body = ``; |
| 546 | let myRequest = ``; |
| 547 | switch (type) { |
| 548 | case 'activityStarBackGetProgressBarInfo': |
| 549 | body = `functionId=activityStarBackGetProgressBarInfo&body={"starId":"${$.uniqueId}","linkId":"Y2aqxng42hZ0eGxGtbCMiQ"}&_t=${Date.now()}&appid=activities_platform`; |
| 550 | myRequest = getPostRequest(body); |
| 551 | break; |
| 552 | case 'apTaskList': |
| 553 | body = `functionId=apTaskList&body={"uniqueId":"${$.uniqueId}","linkId":"Y2aqxng42hZ0eGxGtbCMiQ"}&_t=${Date.now()}&appid=activities_platform`; |
| 554 | myRequest = getPostRequest(body); |
| 555 | break; |
| 556 | case 'SIGN': |
| 557 | body = `functionId=apDoTask&body={"taskType":"${$.oneTask.taskType}","taskId":${$.oneTask.id},"uniqueId":"${$.uniqueId}","linkId":"Y2aqxng42hZ0eGxGtbCMiQ"}&_t=${Date.now()}&appid=activities_platform`; |
| 558 | myRequest = getPostRequest(body); |
| 559 | break; |
| 560 | case 'apTaskDetail': |
| 561 | body = `functionId=apTaskDetail&body={"taskType":"${$.oneTask.taskType}","taskId":${$.oneTask.id},"uniqueId":"${$.uniqueId}","channel":4,"linkId":"Y2aqxng42hZ0eGxGtbCMiQ"}&_t=${Date.now()}&appid=activities_platform`; |
| 562 | myRequest = getPostRequest(body); |
| 563 | break; |
| 564 | case 'apDoTask': |
| 565 | body = `functionId=apDoTask&body={"taskType":"${$.oneTask.taskType}","taskId":${$.oneTask.id},"uniqueId":"${$.uniqueId}","channel":4,"linkId":"Y2aqxng42hZ0eGxGtbCMiQ","itemId":"${encodeURIComponent($.oneItemInfo.itemId)}"}&_t=${Date.now()}&appid=activities_platform`; |
| 566 | myRequest = getPostRequest(body); |
| 567 | break; |
| 568 | case 'help': |
| 569 | body = `functionId=activityStarBackGetProgressBarInfo&body={"starId":"${$.uniqueId}","sharePin":"${$.oneCode}","taskId":"129","linkId":"Y2aqxng42hZ0eGxGtbCMiQ"}&_t=${Date.now()}&appid=activities_platform`; |
| 570 | myRequest = getPostRequest(body); |
| 571 | break; |
| 572 | case 'activityStarBackDrawPrize': |
| 573 | body = `functionId=activityStarBackDrawPrize&body={"starId":"${$.uniqueId}","poolId":${$.onePrize.id},"pos":${$.onePrize.pos},"linkId":"Y2aqxng42hZ0eGxGtbCMiQ"}&_t=${Date.now()}&appid=activities_platform`; |
| 574 | myRequest = getPostRequest(body); |
| 575 | break; |
| 576 | default: |
| 577 | console.log(`错误${type}`); |
| 578 | } |
| 579 | return new Promise(async resolve => { |
| 580 | $.post(myRequest, (err, resp, data) => { |
| 581 | try { |
| 582 | dealReturn(type, data); |
| 583 | } catch (e) { |
| 584 | $.logErr(e, resp) |
| 585 | } finally { |
| 586 | resolve(); |
| 587 | } |
| 588 | }) |
| 589 | }) |
| 590 | } |
| 591 | |
| 592 | function dealReturn(type, data) { |
| 593 | try { |
no test coverage detected