()
| 701 | } |
| 702 | |
| 703 | function queryMaterials() { |
| 704 | let body = { |
| 705 | "qryParam": "[{\"type\":\"advertGroup\",\"mapTo\":\"viewLogo\",\"id\":\"05149412\"},{\"type\":\"advertGroup\",\"mapTo\":\"bottomLogo\",\"id\":\"05149413\"}]", |
| 706 | "activityId": "2cKMj86srRdhgWcKonfExzK4ZMBy", |
| 707 | "pageId": "", |
| 708 | "reqSrc": "", |
| 709 | "applyKey": "21beast" |
| 710 | } |
| 711 | return new Promise(resolve => { |
| 712 | $.post(taskPostUrl("qryCompositeMaterials", body, "qryCompositeMaterials"), async (err, resp, data) => { |
| 713 | try { |
| 714 | if (err) { |
| 715 | console.log(`${JSON.stringify(err)}`) |
| 716 | console.log(`${$.name} API请求失败,请检查网路重试`) |
| 717 | } else { |
| 718 | if (safeGet(data)) { |
| 719 | data = JSON.parse(data); |
| 720 | if (data.code === '0') { |
| 721 | let shopList = data.data.viewLogo.list.concat(data.data.bottomLogo.list) |
| 722 | let nameList = [] |
| 723 | for (let vo of shopList) { |
| 724 | if (nameList.includes(vo.name)) continue |
| 725 | nameList.push(vo.name) |
| 726 | console.log(`去做${vo.name}店铺任务`) |
| 727 | await shopLotteryInfo(vo.desc) |
| 728 | await $.wait(2000) |
| 729 | } |
| 730 | } |
| 731 | } |
| 732 | } |
| 733 | } catch (e) { |
| 734 | $.logErr(e, resp) |
| 735 | } finally { |
| 736 | resolve(); |
| 737 | } |
| 738 | }) |
| 739 | }) |
| 740 | } |
| 741 | |
| 742 | function shopLotteryInfo(shopSign) { |
| 743 | let body = {"shopSign": shopSign} |
no test coverage detected