Browse Source

更新tx

main
haptear 3 years ago
parent
commit
6307760c42
  1. 48
      zqjs/zqjs_tx.js

48
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'
}
/**
* 传入对象 ,返回对象的属性数组

Loading…
Cancel
Save