// import UserScriptEngine from "../../../enum/UserScriptEngine"; // import WuhuBase from "../../../class/WuhuBase"; // import CommonUtils from "../../../class/utils/CommonUtils"; // import Popup from "../../../class/utils/Popup"; // import * as FILTER from "../../../static/json/for_stock_item_filter.json"; // // /** // * @deprecated // */ // export default async function forStock() { // if (CommonUtils.getScriptEngine() === UserScriptEngine.RAW) { // const insert = `stock.png`; // new Popup(insert, '飞花库存'); // } else { // const popup = new Popup(`请稍后${ CommonUtils.loading_gif_html() }`, '飞花库存'); // let table = ``; // const dest = FILTER; // const now = new Date(); // const res = await WuhuBase.glob.fStock.get(); // if (!res['stocks']) return; // dest.forEach(el => { // const update = (now.getTime() - new Date(res.stocks[el.name]['update'] * 1000).getTime()) / 1000 | 0 // table += ``; // let count = 0; // res.stocks[el.name]['stocks'].forEach(stock => { // if (el.stocks[stock.name]) { // table += `${ el.stocks[stock.name] } (${ stock['quantity'] })`; // count++; // } // }); // while (count < 3) { // count++; // table += ''; // } // table += ''; // }); // table += '
目的地 - 更新时间库存
${ el.show }${ update / 60 | 0 }分${ update % 60 | 0 }秒前
'; // popup.getElement().innerHTML = table; // } // }