|
@@ -29,6 +29,7 @@ const WuBianConstKey = {
|
|
|
MyCollectListData: 'WubianMyCollectListData',
|
|
MyCollectListData: 'WubianMyCollectListData',
|
|
|
ConsignmentArtName: 'WubianConsignmentArtName',
|
|
ConsignmentArtName: 'WubianConsignmentArtName',
|
|
|
ConsignmentArtId: 'WubianConsignmentArtId',
|
|
ConsignmentArtId: 'WubianConsignmentArtId',
|
|
|
|
|
+ ConsignmentArtPrice: 'WubianConsignmentArtPrice',
|
|
|
ConsignmentArtAmount: 'WubianConsignmentArtAmount',
|
|
ConsignmentArtAmount: 'WubianConsignmentArtAmount',
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -104,6 +105,11 @@ function getWillSaleArtId() {
|
|
|
return artId;
|
|
return artId;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+function getWillSaleArtPrice() {
|
|
|
|
|
+ let amount = magicJS.data.read(WuBianConstKey.ConsignmentArtPrice, 0);
|
|
|
|
|
+ return amount;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
function getWillSaleArtAmount() {
|
|
function getWillSaleArtAmount() {
|
|
|
let amount = magicJS.data.read(WuBianConstKey.ConsignmentArtAmount, 0);
|
|
let amount = magicJS.data.read(WuBianConstKey.ConsignmentArtAmount, 0);
|
|
|
return amount;
|
|
return amount;
|
|
@@ -115,12 +121,12 @@ function isObjectEmpty(obj) {
|
|
|
|
|
|
|
|
async function tryToSale() {
|
|
async function tryToSale() {
|
|
|
let artData = await getWillConsignmentArtData();
|
|
let artData = await getWillConsignmentArtData();
|
|
|
- magicJS.logger.info(JSON.stringify(artData));
|
|
|
|
|
|
|
+ // magicJS.logger.info(JSON.stringify(artData));
|
|
|
if (artData) {
|
|
if (artData) {
|
|
|
let artTotalList = await queryUserAllCollectVerList(artData.artId);
|
|
let artTotalList = await queryUserAllCollectVerList(artData.artId);
|
|
|
let willAmount = getWillSaleArtAmount();
|
|
let willAmount = getWillSaleArtAmount();
|
|
|
let finallyAmount = Math.min(artTotalList.length, willAmount);
|
|
let finallyAmount = Math.min(artTotalList.length, willAmount);
|
|
|
- let willPrice = 0;
|
|
|
|
|
|
|
+ let willPrice = getWillSaleArtPrice();
|
|
|
let walletType = [];
|
|
let walletType = [];
|
|
|
let retWalletLst = await getOpenWalletList();
|
|
let retWalletLst = await getOpenWalletList();
|
|
|
if (retWalletLst && retWalletLst.code == 200) {
|
|
if (retWalletLst && retWalletLst.code == 200) {
|
|
@@ -143,16 +149,18 @@ async function tryToSale() {
|
|
|
isCanSale = true;
|
|
isCanSale = true;
|
|
|
} else {
|
|
} else {
|
|
|
isCanSale = false;
|
|
isCanSale = false;
|
|
|
|
|
+ magicJS.logger.info(`预设寄售价格超出限制范围${paymentInfo.saleMinPrice}-${paymentInfo.saleMaxPrice}`);
|
|
|
}
|
|
}
|
|
|
if (isCanSale) {
|
|
if (isCanSale) {
|
|
|
let info = artMarketInfo.data.info;
|
|
let info = artMarketInfo.data.info;
|
|
|
if (info.lock || info.status > 0) {
|
|
if (info.lock || info.status > 0) {
|
|
|
isCanSale = false;
|
|
isCanSale = false;
|
|
|
|
|
+ magicJS.logger.info(`当前产品${info.lock ? '锁定中' : '未锁定'},状态码:${info.status}`);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if (!isCanSale) {
|
|
if (!isCanSale) {
|
|
|
- msgTipsText += `[${artData.title}]#(${artTotalList[i].ver})不符合寄售!\n`;
|
|
|
|
|
|
|
+ msgTipsText += `[${artData.title}]#(${artTotalList[i].ver})不符合寄售条件!\n`;
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
let retOrder = await doCreateConsignmentOrder(artData.artId, artHashId, willPrice, walletType, securityPassword);
|
|
let retOrder = await doCreateConsignmentOrder(artData.artId, artHashId, willPrice, walletType, securityPassword);
|