加了快递信息查询,不用来回看了

This commit is contained in:
yml2213
2022-09-29 18:44:37 +08:00
parent 1e6a089f0a
commit bf05760348
+49 -3
View File
@@ -9,8 +9,9 @@
* 6-10 更新模板,修改部分逻辑!
* 9-12 修复抽奖,增加签到宝箱开启
* 9-21 增加用户信息输出
* 9-22 修复开宝箱错误
* 9-28 修复删除帖子错误
* 9-22 修复开宝箱错误
* 9-28 修复删除帖子错误
* 9-29 增加了快递信息查询,不用来回看了
*
* ========= 青龙--配置文件--贴心复制区域 =========
@@ -35,7 +36,7 @@ let ckStr = process.env[alias_name];
let msg, ck;
let ck_status = true;
//---------------------------------------------------------------------------------------------------------
let VersionCheck = "1.2.5"
let VersionCheck = "1.2.6"
let Change = '修复开宝箱错误'
let thank = `\n感谢 群友 的投稿\n`
//---------------------------------------------------------------------------------------------------------
@@ -57,6 +58,7 @@ async function start() {
await task_list('任务列表');
await unopenlist('宝箱查询');
await Points_Enquiry('积分查询');
await express_check('快递查询');
}
}
@@ -153,6 +155,50 @@ async function Points_Enquiry(name) {
}
// 快递查询 httpGet https://gsp.gacmotor.com/gateway/app-api/shop/shoporder/exchangelist?current=1&size=20&type=2&queryTimeType=0&vin=
async function express_check(name) {
DoubleLog(`\n开始 ${name}`);
try {
let Options = {
url: `${hostname}/gateway/app-api/shop/shoporder/exchangelist?current=1&size=20&type=2&queryTimeType=0&vin=`,
headers: cq_headers2
};
let result = await httpGet(Options, name);
// console.log(result);
if (result.errorCode == 200) {
DoubleLog(`${name}:您当前有 ${result.data.total} 个快递 📦`);
if (result.data.total > 0) {
let express = result.data.records
for (let index = 0; index < express.length; index++) {
let commodityName = express[index].commodityName
let createDate = express[index].createDate
let orderStatusStr = express[index].orderStatusStr
let logisticsCompany = express[index].logisticsCompany
let trackingNumber = express[index].trackingNumber
if (express[index].orderStatus == 1) {
DoubleLog(`快递信息: \n ${commodityName}: 创建时间:${createDate}, 当前状态:${orderStatusStr}`)
} else if (express[index].orderStatus == 2) {
DoubleLog(`快递信息: \n ${commodityName}: 创建时间:${createDate}, 当前状态:${orderStatusStr}, 快递公司:${logisticsCompany}, 单号: ${trackingNumber}`)
} else if (express[index].orderStatus == 3) {
DoubleLog(`快递信息: \n ${commodityName}: 创建时间:${createDate}, 当前状态:${orderStatusStr}`)
}
}
} else if (result.data.total == 0) {
DoubleLog(`您当前无快递信息`)
}
} else {
DoubleLog(`${name}:失败 ❌ 了呢,原因未知!`);
console.log(result);
return ck_status = false;
}
} catch (error) {
console.log(error);
}
}
// 任务列表
async function task_list(name) {