|
|
@@ -17,28 +17,36 @@ const scriptName = `华文数交助手`;
|
|
|
const magicJS = MagicJS(scriptName, "INFO");
|
|
|
|
|
|
const HbcpreConstKey = {
|
|
|
+ // 基础数据
|
|
|
decryptionEnabled: 'HbcpreDecryptionEnabled',
|
|
|
- orderItemWatchLocked: 'HbcpreCollectionWatchLocked',
|
|
|
- orderFastModeEnabled: 'HbcpreOrderFastModeEnabled',
|
|
|
- orderItemDataGrabEnabled: 'HbcpreOrderItemDataGrabEnabled',
|
|
|
- drawItemDataGrabEnabled: 'HbcpreDrawItemDataGrabEnabled',
|
|
|
- compoundItemDataGrabEnabled: 'HbcpreCompoundItemDataGrabEnabled',
|
|
|
- exchangeItemDataGrabEnabled: 'HbcpreExchangeItemDataGrabEnabled',
|
|
|
-
|
|
|
token: 'HbcpreUserToken',
|
|
|
userPhone: 'HbcpreUserPhoneNum',
|
|
|
userId: 'HbcpreUserId',
|
|
|
userInfo: 'HbcpreUserInfo',
|
|
|
- collectionClassList: 'HbcpreCollectionClassList',
|
|
|
- collectionClassDetail: 'HbcpreCollectionClassDetail',
|
|
|
- collectionMaxNumLimit: 'HbcpreCollectionMaxNumLimit',
|
|
|
- collectionLockMaxNum: 'HbcpreCollectionLockMaxNum',
|
|
|
- castingId: 'HbcpreCastingId',
|
|
|
- collectionName: 'HbcpreCollectionName',
|
|
|
- orderLimitPrice: 'HbcpreOrderLimitPrice',
|
|
|
- floatPriceIntaval: 'HbcpreFloatPriceIntaval',
|
|
|
- itemCntRwData: 'HbcpreItemCntRwData',
|
|
|
- walletPayPassword: 'HbcpreWalletPayPassword',
|
|
|
+ walletPayPassword: 'HbcpreWalletPayPassword',// 钱包支付密码
|
|
|
+ mySeriesOwnCntFakeData: 'HbcpreItemCntRwData', // 资产的伪装数据
|
|
|
+
|
|
|
+ // 下单相关的
|
|
|
+ marketSeriesDataGrabEnabled: 'HbcpreOrderItemDataGrabEnabled',
|
|
|
+ marketItemWatchLocked: 'HbcpreCollectionWatchLocked',
|
|
|
+ marketFastModeEnabled: 'HbcpreOrderFastModeEnabled',
|
|
|
+ marketSeriesList: 'HbcpreCollectionClassList',
|
|
|
+ marketSeriesDetail: 'HbcpreCollectionClassDetail',
|
|
|
+ marketSeriesId: 'HbcpreCastingId',
|
|
|
+ marketSeriesName: 'HbcpreCollectionName',
|
|
|
+ marketOrderLimitPrice: 'HbcpreOrderLimitPrice',
|
|
|
+ marketOrderPriceInterval: 'HbcpreFloatPriceIntaval',
|
|
|
+
|
|
|
+ // 首发相关的
|
|
|
+ homeSeriesOpenTimeOffset: 'HbcpreOpeningTimeOffset',
|
|
|
+ homeSeriesList: 'HbcpreHomeSeriesList',
|
|
|
+ homeSeriesId: 'HbcpreHomeSeriesId',
|
|
|
+ homeSeriesName: 'HbcpreHomeSeriesName',
|
|
|
+
|
|
|
+
|
|
|
+ drawItemDataGrabEnabled: 'HbcpreDrawItemDataGrabEnabled',
|
|
|
+ compoundItemDataGrabEnabled: 'HbcpreCompoundItemDataGrabEnabled',
|
|
|
+ exchangeItemDataGrabEnabled: 'HbcpreExchangeItemDataGrabEnabled',
|
|
|
|
|
|
drawActivityData: 'HbcpreDrawActivityData',
|
|
|
drawActivityId: 'HbcpreDrawActivityId',
|
|
|
@@ -50,8 +58,7 @@ const HbcpreConstKey = {
|
|
|
exchangeActivityData: 'HbcpreExchangeActivityData',
|
|
|
exchangeActivityId: 'HbcpreExchangeActivityId',
|
|
|
|
|
|
- openingTimeOffset: 'HbcpreOpeningTimeOffset',
|
|
|
-
|
|
|
+ // 临时
|
|
|
tmpContractData: 'HbcpreTmpContractData',
|
|
|
};
|
|
|
|
|
|
@@ -108,8 +115,8 @@ function isDecryptionEnabled() {
|
|
|
return JSON.parse(flag);
|
|
|
}
|
|
|
|
|
|
-function isOrderItemGrabEnabled() {
|
|
|
- let isLocked = magicJS.data.read(HbcpreConstKey.orderItemWatchLocked, null);
|
|
|
+function isSeriesDataGrabEnabled() {
|
|
|
+ let isLocked = magicJS.data.read(HbcpreConstKey.marketItemWatchLocked, null);
|
|
|
if(isLocked){
|
|
|
isLocked = JSON.parse(isLocked);
|
|
|
}
|
|
|
@@ -117,7 +124,7 @@ function isOrderItemGrabEnabled() {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- let flag = magicJS.data.read(HbcpreConstKey.orderItemDataGrabEnabled, null);
|
|
|
+ let flag = magicJS.data.read(HbcpreConstKey.marketSeriesDataGrabEnabled, null);
|
|
|
if (flag == null) {
|
|
|
return false;
|
|
|
}
|
|
|
@@ -148,9 +155,9 @@ function isExchangeItemGrabEnabled() {
|
|
|
return JSON.parse(flag);
|
|
|
}
|
|
|
|
|
|
-function readItemCntRwDict() {
|
|
|
+function readMySeriesOwnCntFakeData() {
|
|
|
gItemCntRwDict = {};
|
|
|
- let text = magicJS.data.read(HbcpreConstKey.itemCntRwData, null);
|
|
|
+ let text = magicJS.data.read(HbcpreConstKey.mySeriesOwnCntFakeData, null);
|
|
|
if (text) {
|
|
|
let segments = text.split('|');
|
|
|
for (let i = segments.length - 1; i >= 0; i--) {
|
|
|
@@ -165,8 +172,8 @@ function readItemCntRwDict() {
|
|
|
return gItemCntRwDict;
|
|
|
}
|
|
|
|
|
|
-function getCollectionIndexData(seriesId) {
|
|
|
- let dataList = magicJS.data.read(HbcpreConstKey.collectionClassList, []);
|
|
|
+function getSeriesData(seriesId) {
|
|
|
+ let dataList = magicJS.data.read(HbcpreConstKey.marketSeriesList, []);
|
|
|
for (let i = 0; i < dataList.length; i++) {
|
|
|
if (seriesId == dataList[i].seriesId) {
|
|
|
return dataList[i];
|
|
|
@@ -175,16 +182,16 @@ function getCollectionIndexData(seriesId) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
-function getCollectionName(seriesId) {
|
|
|
- let data = getCollectionIndexData(seriesId);
|
|
|
+function getSeriesName(seriesId) {
|
|
|
+ let data = getSeriesData(seriesId);
|
|
|
if (data) {
|
|
|
return `${data.seriesName}`;
|
|
|
}
|
|
|
return `${seriesId}`;
|
|
|
}
|
|
|
|
|
|
-function getCollectionPrice(seriesId) {
|
|
|
- let data = getCollectionIndexData(seriesId);
|
|
|
+function getSeriesPrice(seriesId) {
|
|
|
+ let data = getSeriesData(seriesId);
|
|
|
if (data) {
|
|
|
return parseInt(data.amount || 99999.99);
|
|
|
}
|
|
|
@@ -432,7 +439,7 @@ function handlerHomeSeriesList(){
|
|
|
if (rspData.code != 200) {
|
|
|
return;
|
|
|
}
|
|
|
- let otimeOffset = magicJS.data.read(HbcpreConstKey.openingTimeOffset, 60000);
|
|
|
+ let otimeOffset = magicJS.data.read(HbcpreConstKey.homeSeriesOpenTimeOffset, 60000);
|
|
|
let seriesList = rspData.data.list || [];
|
|
|
for(let i=0; i < seriesList.length; i++){
|
|
|
const item = seriesList[i];
|
|
|
@@ -480,7 +487,7 @@ function handleMarketSeriesList() {
|
|
|
if (rspData.code != 200) {
|
|
|
return;
|
|
|
}
|
|
|
- let dataList = magicJS.data.read(HbcpreConstKey.collectionClassList, []);
|
|
|
+ let dataList = magicJS.data.read(HbcpreConstKey.marketSeriesList, []);
|
|
|
let reqData = getQueryPlainData();
|
|
|
let nftType = reqData.nftType || 0;//0=数字资产 1=盲盒
|
|
|
|
|
|
@@ -511,24 +518,24 @@ function handleMarketSeriesList() {
|
|
|
for (let k in tmpItemDict) {
|
|
|
dataList.push(tmpItemDict[k]);
|
|
|
}
|
|
|
- magicJS.data.write(HbcpreConstKey.collectionClassList, dataList);
|
|
|
+ magicJS.data.write(HbcpreConstKey.marketSeriesList, dataList);
|
|
|
|
|
|
gRetBody = rspData;
|
|
|
}
|
|
|
|
|
|
function handleSeriesInfo() {
|
|
|
- if (isOrderItemGrabEnabled()) {
|
|
|
+ if (isSeriesDataGrabEnabled()) {
|
|
|
let reqData = getRequestPlainData();
|
|
|
if (reqData) {
|
|
|
- let seriesId = magicJS.data.read(HbcpreConstKey.castingId, null);
|
|
|
- let collectionPrice = getCollectionPrice(reqData.seriesId);
|
|
|
- magicJS.data.write(HbcpreConstKey.orderLimitPrice, collectionPrice);
|
|
|
+ let seriesId = magicJS.data.read(HbcpreConstKey.marketSeriesId, null);
|
|
|
+ let collectionPrice = getSeriesPrice(reqData.seriesId);
|
|
|
+ magicJS.data.write(HbcpreConstKey.marketOrderLimitPrice: '',, collectionPrice);
|
|
|
|
|
|
if (seriesId != reqData.seriesId) {
|
|
|
- magicJS.data.write(HbcpreConstKey.castingId, reqData.seriesId);
|
|
|
- let collectionName = getCollectionName(reqData.seriesId);
|
|
|
- magicJS.data.write(HbcpreConstKey.collectionName, collectionName);
|
|
|
- magicJS.notification.post(scriptName, "", `🎉[${collectionName}-¥${collectionPrice}]快捷下单数据采集成功!`);
|
|
|
+ magicJS.data.write(HbcpreConstKey.marketSeriesId, reqData.seriesId);
|
|
|
+ let seriesName = getSeriesName(reqData.seriesId);
|
|
|
+ magicJS.data.write(HbcpreConstKey.marketSeriesName, seriesName);
|
|
|
+ magicJS.notification.post(scriptName, "", `🎉[${seriesName}-¥${collectionPrice}]快捷下单数据采集成功!`);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -544,7 +551,7 @@ function handleSeriesInfo() {
|
|
|
// circulationNumber //流通
|
|
|
if(seriesInfo.openingTime > 0){
|
|
|
// 上新提前开放时间
|
|
|
- let otimeOffset = magicJS.data.read(HbcpreConstKey.openingTimeOffset, 60000);
|
|
|
+ let otimeOffset = magicJS.data.read(HbcpreConstKey.homeSeriesOpenTimeOffset, 60000);
|
|
|
seriesInfo.openingTime -= otimeOffset;
|
|
|
// 强开限制可购买数
|
|
|
if(seriesInfo.circulationNumber >= seriesInfo.quantityNumber){
|
|
|
@@ -558,14 +565,14 @@ function handleSeriesInfo() {
|
|
|
seriesInfo.canQuick = 1;
|
|
|
|
|
|
|
|
|
- if (isOrderItemGrabEnabled()) {
|
|
|
- let seriesId = magicJS.data.read(HbcpreConstKey.castingId, null);
|
|
|
- let collectionPrice = getCollectionPrice(seriesId);
|
|
|
- magicJS.data.write(HbcpreConstKey.orderLimitPrice, collectionPrice);
|
|
|
+ if (isSeriesDataGrabEnabled()) {
|
|
|
+ let seriesId = magicJS.data.read(HbcpreConstKey.marketSeriesId, null);
|
|
|
+ let collectionPrice = getSeriesPrice(seriesId);
|
|
|
+ magicJS.data.write(HbcpreConstKey.marketOrderLimitPrice: '',, collectionPrice);
|
|
|
|
|
|
if (seriesId != seriesInfo.seriesId) {
|
|
|
- magicJS.data.write(HbcpreConstKey.castingId, seriesInfo.seriesId);
|
|
|
- magicJS.data.write(HbcpreConstKey.collectionName, seriesInfo.seriesName);
|
|
|
+ magicJS.data.write(HbcpreConstKey.marketSeriesId, seriesInfo.seriesId);
|
|
|
+ magicJS.data.write(HbcpreConstKey.marketSeriesName, seriesInfo.seriesName);
|
|
|
|
|
|
magicJS.notification.post(scriptName, "", `🎉[${seriesInfo.seriesName}-¥${collectionPrice}]快捷下单数据采集成功!`);
|
|
|
}
|
|
|
@@ -647,12 +654,12 @@ function handlerMySeriesList() {
|
|
|
let currPage = rspData.data.currPage;
|
|
|
let mySeriesData = {};
|
|
|
if (currPage > 1) {
|
|
|
- mySeriesData = magicJS.data.read(HbcpreConstKey.collectionClassList, {});
|
|
|
+ mySeriesData = magicJS.data.read(HbcpreConstKey.marketSeriesList, {});
|
|
|
}
|
|
|
// reqData.type 0=数字资产 1=盲盒 5=我的寄售 4=已卖出
|
|
|
if (reqData.type == 0 || reqData.type == 1) {
|
|
|
let itemList = rspData.data.list;
|
|
|
- let cntDict = readItemCntRwDict();
|
|
|
+ let cntDict = readMySeriesOwnCntFakeData();
|
|
|
for (let i = 0; i < itemList.length; i++) {
|
|
|
const item = itemList[i];
|
|
|
const seriesId = item.seriesId;
|
|
|
@@ -667,7 +674,7 @@ function handlerMySeriesList() {
|
|
|
item.seriesName = `${seriesName}#¥${parseFloat(item.avgPrice).toFixed(2)}`;
|
|
|
item.authorName = `存量(${formatNumberWithKAndW(item.soldNum)}/${formatNumberWithKAndW(item.issueNum)})`;
|
|
|
}
|
|
|
- magicJS.data.write(HbcpreConstKey.collectionClassList, mySeriesData);
|
|
|
+ magicJS.data.write(HbcpreConstKey.marketSeriesList, mySeriesData);
|
|
|
gRetBody = rspData;
|
|
|
}
|
|
|
}
|
|
|
@@ -684,7 +691,7 @@ function handlerMyWorksList() {
|
|
|
let seriesId = reqData.seriesId;
|
|
|
let currPage = rspData.data.currPage;
|
|
|
let myWorksData = {};
|
|
|
- let storeKey = `${HbcpreConstKey.collectionClassDetail}#${seriesId}`;
|
|
|
+ let storeKey = `${HbcpreConstKey.marketSeriesDetail}#${seriesId}`;
|
|
|
if (currPage > 1) {
|
|
|
myWorksData = magicJS.data.read(storeKey, {});
|
|
|
}
|