红包增加详情,京喜红包(过期红包),极速版红包(过期红包)
This commit is contained in:
@@ -1,12 +1,12 @@
|
|||||||
/*
|
/*
|
||||||
* @Author: LXK9301 https://github.com/LXK9301
|
* @Author: lxk0301 https://gitee.com/lxk0301
|
||||||
* @Date: 2020-11-01 16:25:41
|
* @Date: 2020-11-01 16:25:41
|
||||||
* @Last Modified by: LXK9301
|
* @Last Modified by: lxk0301
|
||||||
* @Last Modified time: 2021-02-27 10:25:41
|
* @Last Modified time: 2021-03-14 15:25:41
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
京豆变动通知脚本:https://gitee.com/lxk0301/jd_scripts/raw/master/jd_bean_change.js
|
京豆变动通知脚本:https://gitee.com/lxk0301/jd_scripts/raw/master/jd_bean_change.js
|
||||||
统计昨日京豆的变化情况,包括收入,支出,以及显示当前京豆数量,目前小问题:下单使用京豆后,退款重新购买会出现异常
|
统计昨日京豆的变化情况,包括收入,支出,以及显示当前京豆数量,目前小问题:下单使用京豆后,退款重新购买,计算统计会出现异常
|
||||||
网页查看地址 : https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean
|
网页查看地址 : https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean
|
||||||
支持京东双账号
|
支持京东双账号
|
||||||
脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
|
脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
|
||||||
@@ -85,11 +85,11 @@ if ($.isNode()) {
|
|||||||
})
|
})
|
||||||
async function showMsg() {
|
async function showMsg() {
|
||||||
if ($.errorMsg) return
|
if ($.errorMsg) return
|
||||||
allMessage += `账号${$.index}:${$.nickName || $.UserName}\n昨日收入:${$.incomeBean}京豆 🐶\n昨日支出:${$.expenseBean}京豆 🐶\n当前京豆:${$.beanCount}京豆 🐶${$.message}${$.index !== cookiesArr.length ? '\n\n' : ''}`;
|
allMessage += `账号${$.index}:${$.nickName || $.UserName}\n昨日收入:${$.incomeBean}京豆 🐶\n昨日支出:${$.expenseBean}京豆 🐶\n当前京豆:${$.beanCount}${$.expirejingdou > 0 ? `(今日将过期${$.expirejingdou})` : ''}京豆🐶${$.message}${$.index !== cookiesArr.length ? '\n\n' : ''}`;
|
||||||
// if ($.isNode()) {
|
// if ($.isNode()) {
|
||||||
// await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}`, `账号${$.index}:${$.nickName || $.UserName}\n昨日收入:${$.incomeBean}京豆 🐶\n昨日支出:${$.expenseBean}京豆 🐶\n当前京豆:${$.beanCount}京豆 🐶${$.message}`, { url: `https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean` })
|
// await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}`, `账号${$.index}:${$.nickName || $.UserName}\n昨日收入:${$.incomeBean}京豆 🐶\n昨日支出:${$.expenseBean}京豆 🐶\n当前京豆:${$.beanCount}京豆 🐶${$.message}`, { url: `https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean` })
|
||||||
// }
|
// }
|
||||||
$.msg($.name, '', `账号${$.index}:${$.nickName || $.UserName}\n昨日收入:${$.incomeBean}京豆 🐶\n昨日支出:${$.expenseBean}京豆 🐶\n当前京豆:${$.beanCount}京豆 🐶${$.message}`, {"open-url": "https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean"});
|
$.msg($.name, '', `账号${$.index}:${$.nickName || $.UserName}\n昨日收入:${$.incomeBean}京豆 🐶\n昨日支出:${$.expenseBean}京豆 🐶\n当前京豆:${$.beanCount}${$.expirejingdou > 0 ? `(今日将过期${$.expirejingdou})` : ''}京豆🐶${$.message}`, {"open-url": "https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean"});
|
||||||
}
|
}
|
||||||
async function bean() {
|
async function bean() {
|
||||||
// console.log(`北京时间零点时间戳:${parseInt((Date.now() + 28800000) / 86400000) * 86400000 - 28800000}`);
|
// console.log(`北京时间零点时间戳:${parseInt((Date.now() + 28800000) / 86400000) * 86400000 - 28800000}`);
|
||||||
@@ -230,6 +230,7 @@ function queryexpirejingdou() {
|
|||||||
"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.1 Mobile/15E148 Safari/604.1"
|
"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.1 Mobile/15E148 Safari/604.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$.expirejingdou = 0;
|
||||||
$.get(options, (err, resp, data) => {
|
$.get(options, (err, resp, data) => {
|
||||||
try {
|
try {
|
||||||
if (err) {
|
if (err) {
|
||||||
@@ -244,10 +245,10 @@ function queryexpirejingdou() {
|
|||||||
data['expirejingdou'].map(item => {
|
data['expirejingdou'].map(item => {
|
||||||
console.log(`${timeFormat(item['time'] * 1000)}日过期京豆:${item['expireamount']}\n`);
|
console.log(`${timeFormat(item['time'] * 1000)}日过期京豆:${item['expireamount']}\n`);
|
||||||
})
|
})
|
||||||
const expirejingdou = data['expirejingdou'][0]['expireamount'];
|
$.expirejingdou = data['expirejingdou'][0]['expireamount'];
|
||||||
if (expirejingdou > 0) {
|
// if ($.expirejingdou > 0) {
|
||||||
$.message += `\n今日将过期:${expirejingdou}京豆 🐶`;
|
// $.message += `\n今日将过期:${$.expirejingdou}京豆 🐶`;
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log(`京东服务器返回空数据`)
|
console.log(`京东服务器返回空数据`)
|
||||||
@@ -264,13 +265,13 @@ function queryexpirejingdou() {
|
|||||||
function redPacket() {
|
function redPacket() {
|
||||||
return new Promise(async resolve => {
|
return new Promise(async resolve => {
|
||||||
const options = {
|
const options = {
|
||||||
"url": `https://wq.jd.com/user/info/QueryUserRedEnvelopes?channel=3&type=1&page=0&pageSize=100&orgFlag=JD_PinGou_New&expiredRedFlag=1&sceneval=2&g_login_type=1&g_ty=ls`,
|
"url": `https://m.jingxi.com/user/info/QueryUserRedEnvelopesV2?type=1&orgFlag=JD_PinGou_New&page=1&cashRedType=1&redBalanceFlag=1&channel=1&_=${+new Date()}&sceneval=2&g_login_type=1&g_ty=ls`,
|
||||||
"headers": {
|
"headers": {
|
||||||
'Host': 'wq.jd.com',
|
'Host': 'm.jingxi.com',
|
||||||
'Accept': '*/*',
|
'Accept': '*/*',
|
||||||
'Connection': 'keep-alive',
|
'Connection': 'keep-alive',
|
||||||
'Accept-Language': 'zh-cn',
|
'Accept-Language': 'zh-cn',
|
||||||
'Referer': 'https://wqs.jd.com/my/redpacket.shtml',
|
'Referer': 'https://st.jingxi.com/my/redpacket.shtml?newPg=App&jxsid=16156262265849285961',
|
||||||
'Accept-Encoding': 'gzip, deflate, br',
|
'Accept-Encoding': 'gzip, deflate, br',
|
||||||
"Cookie": cookie,
|
"Cookie": cookie,
|
||||||
'User-Agent': $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0")
|
'User-Agent': $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0")
|
||||||
@@ -284,10 +285,36 @@ function redPacket() {
|
|||||||
} else {
|
} else {
|
||||||
if (data) {
|
if (data) {
|
||||||
data = JSON.parse(data).data
|
data = JSON.parse(data).data
|
||||||
|
$.jxRed = 0, $.jsRed = 0, $.jdRed = 0, $.jxRedExpire = 0, $.jsRedExpire = 0, $.jdRedExpire = 0;
|
||||||
|
let t = new Date()
|
||||||
|
t.setDate(t.getDate() + 1)
|
||||||
|
t.setHours(0, 0, 0, 0)
|
||||||
|
t = parseInt((t - 1) / 1000)
|
||||||
|
for (let vo of data.useRedInfo.redList) {
|
||||||
|
if (vo.activityName.includes("京喜")) {
|
||||||
|
$.jxRed += parseFloat(vo.balance)
|
||||||
|
if (vo['endTime'] === t) {
|
||||||
|
$.jxRedExpire += parseFloat(vo.balance)
|
||||||
|
}
|
||||||
|
} else if (vo.activityName.includes("极速版")) {
|
||||||
|
$.jsRed += parseFloat(vo.balance)
|
||||||
|
if (vo['endTime'] === t) {
|
||||||
|
$.jsRedExpire += parseFloat(vo.balance)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$.jdRed += parseFloat(vo.balance)
|
||||||
|
if (vo['endTime'] === t) {
|
||||||
|
$.jdRedExpire += parseFloat(vo.balance)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$.jxRed = $.jxRed.toFixed(2)
|
||||||
|
$.jsRed = $.jsRed.toFixed(2)
|
||||||
|
$.jdRed = $.jdRed.toFixed(2)
|
||||||
$.balance = data.balance
|
$.balance = data.balance
|
||||||
$.expiredBalance = data.expiredBalance || 0;
|
$.expiredBalance = data.expiredBalance || 0;
|
||||||
$.message += `\n当前红包:${$.balance}元🧧`;
|
$.message += `\n当前总红包:${$.balance}(今日总过期${($.jxRedExpire + $.jsRedExpire + $.jdRedExpire).toFixed(2)})元 🧧\n京喜红包:${$.jxRed}(今日将过期${$.jxRedExpire.toFixed(2)})元 🧧\n极速版红包:${$.jsRed}(今日将过期${$.jsRedExpire.toFixed(2)})元 🧧\n京东红包:${$.jdRed}(今日将过期${$.jdRedExpire.toFixed(2)})元 🧧`;
|
||||||
if ($.expiredBalance > 0) $.message += `\n今明二日过期:${$.expiredBalance}元红包🧧`;
|
// if ($.expiredBalance > 0) $.message += `\n今明二日过期:${$.expiredBalance}元红包🧧`;
|
||||||
} else {
|
} else {
|
||||||
console.log(`京东服务器返回空数据`)
|
console.log(`京东服务器返回空数据`)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user