From 6307760c421c1e8a5869ec414602c2759a8f7b2f Mon Sep 17 00:00:00 2001 From: haptear Date: Thu, 23 Jun 2022 16:56:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0tx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zqjs/zqjs_tx.js | 48 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/zqjs/zqjs_tx.js b/zqjs/zqjs_tx.js index 4ac702c..2f79929 100644 --- a/zqjs/zqjs_tx.js +++ b/zqjs/zqjs_tx.js @@ -31,6 +31,9 @@ let userIdx='' for (userIdx = 0; userIdx < userCookieArr.length; userIdx++) { tmpCk = userCookieArr[userIdx] await getBalance(userIdx) + await $.wait(500) + await payMethodList(userIdx) + //break } await showmsg() @@ -102,7 +105,7 @@ function replaceCookie(userCookieItem) { //通知 async function showmsg() { - notifyBody = jsname + "运行通知\n" + notifyStr + notifyBody = jsname + "运行通知\n"+"\n================\n" + notifyStr if (notifyFlag != 1) { console.log(notifyBody); @@ -129,12 +132,12 @@ async function getBalance(userIdx) { //console.log(`${JSON.stringify(result)}\n`); if(result.error_code == 0) { let nowscore=Math.round(result.items.score/100)/100 - if (userIdx>0)notifyStr += `-----------------------\n` - notifyStr += `账户${userIdx+1} ${result.items.nickname}: \n` - notifyStr += `【青豆总数】:${Math.round(result.items.score/100)/100}\n` - notifyStr += `【今日收益】:${Math.round(result.items.today_score/100)/100}\n` + if (userIdx>0)logAndNotify(`-----------------------\n`) + logAndNotify(`账户${userIdx+1} ${result.items.nickname}: `) + logAndNotify(`【青豆总数】:${Math.round(result.items.score/100)/100}`) + logAndNotify(`【今日收益】:${Math.round(result.items.today_score/100)/100}`) let zqstatus=result.items.user_status<1?'黑号':'正常' - notifyStr += `【账号状态】:${zqstatus}\n` + logAndNotify(`【账号状态】:${zqstatus}`) if (nowscore>=5) money=5 else if (nowscore>=1) money=1 else if (nowscore>=0.3) money=0.3 @@ -179,28 +182,43 @@ function encodeStr(str) { async function withdraw(userIdx,withdrawbody,money) { let caller = printCaller() let paymodel=zqkdCashtypeArr[userIdx] - if (!paymodel) paymodel='wechat' + if (!paymodel) paymodel='alipay' console.log('提现到:'+paymodel) let url = 'https://user.youth.cn/v1/Withdraw/wechat.json' if (paymodel=='alipay') url = 'https://user.youth.cn/FastApi/Alipay/withdraw.json' - //console.log(withdrawbody) let urlObject = PopulatePostUrl(url,withdrawbody) await HttpPost(urlObject,caller) let result = httpResult; if(!result) return - //console.log(`${JSON.stringify(result)}\n`); if(result.success == true) { otherts=true; - notifyStr += `用户${userIdx+1} 提现:${money} - ${result.message}🎉\n`; - console.log(`用户${userIdx+1}提现${money}成功🎉`); + logAndNotify(`用户${userIdx+1} 提现:${money} - ${result.message}🎉`); } else { - console.log(`用户${userIdx+1}提现${money}失败:${result.message}`) - notifyStr += `用户${userIdx+1}提现${money}失败:${result.message}\n`; + logAndNotify(`用户${userIdx+1}提现${money}失败:${result.message}`) } } - - +async function payMethodList(userIdx) { + let caller = printCaller() + let tmpCk = userCookieArr[userIdx] + let money=0 + let url = 'https://user.youth.cn/FastApi/Withdraw/payMethodList.json?' + tmpCk + let urlObject = PopulateGetUrl(url) + await HttpGet(urlObject,caller) + let result = httpResult; + if(!result) return + if (result.error_code==0){ + if (result.items&&result.items.wechat.username) + logAndNotify(`[账号${userIdx+1}]绑定微信:${result.items.wechat.username}-${result.items.wechat.nickname}`) + if (result.items&&result.items.alipay.username) + logAndNotify(`[账号${userIdx+1}]绑定支付宝:${result.items.alipay.username}-${result.items.alipay.account}`) + } +} +function logAndNotify(str) { + console.log(str) + notifyStr += str + notifyStr += '\n' +} /** * 传入对象 ,返回对象的属性数组