| 709 | }) |
| 710 | } |
| 711 | function getPetTaskConfig() { |
| 712 | return new Promise(resolve => { |
| 713 | // const url = `${weAppUrl}/getPetTaskConfig?reqSource=weapp`; |
| 714 | // const host = `jdjoy.jd.com`; |
| 715 | // const reqSource = 'h5'; |
| 716 | const host = `draw.jdfcloud.com`; |
| 717 | const reqSource = 'weapp'; |
| 718 | let opt = { |
| 719 | // url: "//jdjoy.jd.com/common/pet/getPetTaskConfig?reqSource=h5", |
| 720 | url: "//draw.jdfcloud.com//common/pet/getPetTaskConfig?reqSource=h5&invokeKey=Oex5GmEuqGep1WLC", |
| 721 | method: "GET", |
| 722 | data: {}, |
| 723 | credentials: "include", |
| 724 | header: {"content-type": "application/json"} |
| 725 | } |
| 726 | const url = "https:"+ taroRequest(opt)['url'] |
| 727 | $.get(taskUrl(url.replace(/reqSource=h5/, 'reqSource=weapp'), host, reqSource), (err, resp, data) => { |
| 728 | try { |
| 729 | if (err) { |
| 730 | console.log('\n京东宠汪汪: API查询请求失败 ‼️‼️') |
| 731 | } else { |
| 732 | // console.log('JSON.parse(data)', JSON.parse(data)) |
| 733 | $.getPetTaskConfigRes = JSON.parse(data); |
| 734 | } |
| 735 | } catch (e) { |
| 736 | $.logErr(e, resp); |
| 737 | } finally { |
| 738 | resolve(); |
| 739 | } |
| 740 | }) |
| 741 | }) |
| 742 | } |
| 743 | //查询赛跑信息API |
| 744 | function getPetRace() { |
| 745 | return new Promise(resolve => { |