From fe2f88e392c89c2e977237c48938c1de708901a2 Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Thu, 26 Nov 2020 18:22:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E7=BA=A2=E5=8C=85=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=20=EF=BC=8C=E6=B5=8B=E8=AF=95=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jd_dreamFactory.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/jd_dreamFactory.js b/jd_dreamFactory.js index b5fe9fdd..eca65280 100644 --- a/jd_dreamFactory.js +++ b/jd_dreamFactory.js @@ -425,6 +425,7 @@ function userInfo() { productionId = production.productionId;//商品ID subTitle = data.user.pin; await GetCommodityDetails(production.commodityDimId); + await DrawProductionStagePrize(productionId); console.log(`当前电力:${data.user.electric}`) console.log(`分享码: ${data.user.encryptPin}`); console.log(`生产进度:${(production.investedElectric / production.needElectric).toFixed(2) * 100}%`); @@ -464,7 +465,21 @@ function GetCommodityDetails(commodityDimId) { }) }) } - +//领取红包 +function DrawProductionStagePrize(productionId) { + return new Promise(async resolve => { + const url = `/dreamfactory/userinfo/DrawProductionStagePrize?zone=dream_factory&sceneval=2&g_login_type=1&productionId=${productionId}`; + $.get(taskurl(url), (err, resp, data) => { + console.log(`领取红包(测试中)结果:${data}`) + data = JSON.parse(data); + if (data['ret'] === 0) { + // data = data['data']; + // $.productName = data['commodityList'][0].name; + } + resolve() + }) + }) +} function stealFriend() { return new Promise(async resolve => { const url = `//dreamfactory/friend/QueryFactoryManagerList?zone=dream_factory&sceneval=2`;