let base_url = 'https://denettestapi.piaoquantv.com/denet' // 获取红包任务详情 export function getPostDetail() { return new Promise(function (resolve, reject) { let _url = `${base_url}/post/getDetail` fetch(_url, { method: 'POST', // or 'PUT' headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ "baseInfo": { "appVersionCode": 0, "clientTimestamp": 0, "loginUid": 0, "requestId": "string", "token": "string" }, "params": { "postId": "05b2f99bbcfa461db3b053df61ca7ae5" } }), }) .then(response => response.json()) .then(data => { resolve(data); }) .catch((error) => { reject(error); }); }) } // 领取红包任务 export function getRedPacket() { return new Promise(function (resolve, reject) { let _url = `${base_url}/post/luckdrop/receiveLuckdrop` fetch(_url, { method: 'POST', // or 'PUT' headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ "baseInfo": { "appVersionCode": 0, "clientTimestamp": 0, "loginUid": 0, "requestId": "string", "token": "d2ef1b74d4dec5338938a58b7fe783360612b8a5" }, "params": { "postId": "05b2f99bbcfa461db3b053df61ca7ae5" } }), }) .then(response => response.json()) .then(data => { resolve(data); }) .catch((error) => { reject(error); }); }) } // 完成红包任务 export function finishRedPacket() { return new Promise(function (resolve, reject) { let _url = `${base_url}/post/luckdrop/finishLuckdrop` fetch(_url, { method: 'POST', // or 'PUT' headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ "baseInfo": { "appVersionCode": 0, "clientTimestamp": 0, "loginUid": 0, "requestId": "string", "token": "string" }, "params": { "postId": "05b2f99bbcfa461db3b053df61ca7ae5" } }), }) .then(response => response.json()) .then(data => { resolve(data); }) .catch((error) => { reject(error); }); }) }