This commit is contained in:
Liwanyi 2022-11-25 15:49:24 +08:00
parent 7ae676782d
commit 2e3b0a4ca1
7 changed files with 48 additions and 51 deletions

View File

@ -4,6 +4,15 @@
# CHANGE # CHANGE
## 0.7.3
2022年11月25日
### 修改
- 捡垃圾助手调整
- 菜单调整
## 0.7.2 ## 0.7.2
2022年11月22日 2022年11月22日

View File

@ -1,6 +1,6 @@
{ {
"name": "wuhu-torn-helper", "name": "wuhu-torn-helper",
"version": "0.7.2", "version": "0.7.3",
"description": "芜湖助手", "description": "芜湖助手",
"dependencies": {}, "dependencies": {},
"scripts": { "scripts": {

File diff suppressed because one or more lines are too long

View File

@ -31,14 +31,18 @@ export default class UrlPattern extends WuhuBase {
let href = window.location.href; let href = window.location.href;
// 捡垃圾助手 // 捡垃圾助手
if (href.includes('city.php') && WuhuConfig.get('cityFinder')) { if (href.includes('city.php') && WuhuConfig.get('cityFinder')) {
cityFinder(); let _base = new TornStyleBlock('芜湖助手').insert2Dom();
let reloadSwitch = new TornStyleSwitch('解决一直转圈(加载中)的问题'); let reloadSwitch = new TornStyleSwitch('解决一直转圈(加载中)的问题');
reloadSwitch.getInput().checked = WuhuConfig.get('SolveGoogleScriptPendingIssue'); reloadSwitch.getInput().checked = WuhuConfig.get('SolveGoogleScriptPendingIssue');
new TornStyleBlock('芜湖助手').append(reloadSwitch.getBase()).insert2Dom(); _base.append(reloadSwitch.getBase()).insert2Dom();
reloadSwitch.getInput().addEventListener('change', () => { reloadSwitch.getInput().addEventListener('change', () => {
if (reloadSwitch.getInput().checked) window.location.replace(window.location.href); if (reloadSwitch.getInput().checked) window.location.replace(window.location.href);
WuhuConfig.set('SolveGoogleScriptPendingIssue', reloadSwitch.getInput().checked, true); WuhuConfig.set('SolveGoogleScriptPendingIssue', reloadSwitch.getInput().checked, true);
}) });
_base.append(document.createElement('br'));
cityFinder(_base);
} }
// pt一键购买 // pt一键购买

View File

@ -301,38 +301,11 @@ export default class ZhongIcon extends WuhuBase {
clickFunc: () => ItemPriceWatcherHandler.getInstance().handle() clickFunc: () => ItemPriceWatcherHandler.getInstance().handle()
}); });
// 全屏 // 全屏
list.push({ if (!Global.getInstance().isPDA) list.push({
domType: 'button', domId: '', domText: '🖥 进入全屏', clickFunc() { domType: 'button', domId: '', domText: '🖥 进入全屏', clickFunc() {
document.documentElement.requestFullscreen().then(); document.documentElement.requestFullscreen().then();
} }
}); });
// 小窗犯罪
// list.push({
// domType: 'button',
// domId: 'wh-crime-iframe-btn',
// domText: '🤑 小窗犯罪',
// clickFunc: () => IFrameCrimeHandler.getInstance().handle()
// });
// 危险行为开关⚠️
// list.push({
// domType: 'button',
// domId: 'wh-danger-zone',
// domText: '⚠️ 危险功能',
// clickFunc: () => {
// new DialogMsgBox(
// `打开危险功能,使用这些功能可能会造成账号封禁<br/>${ new TornStyleSwitch('知道了,开启', WuhuConfig.get('dangerZone')).getHtml() }`,
// {
// callback(dom) {
// let before = WuhuConfig.get('dangerZone');
// let checked = dom.querySelector('input').checked
// WuhuConfig.set('dangerZone', checked, true);
// if (!before && checked) window.location.reload();
// }
// }
// )
// },
// });
// 传单助手 // 传单助手
list.push({ list.push({
domType: 'button', domType: 'button',

View File

@ -4,7 +4,7 @@ import Log from "../../class/Log";
import CITY_FINDER_CSS from "../../static/css/city_finder.css"; import CITY_FINDER_CSS from "../../static/css/city_finder.css";
import TornStyleBlock from "../../class/utils/TornStyleBlock"; import TornStyleBlock from "../../class/utils/TornStyleBlock";
export default function cityFinder(): void { export default function cityFinder(_base: TornStyleBlock): void {
CommonUtils.addStyle(CITY_FINDER_CSS); CommonUtils.addStyle(CITY_FINDER_CSS);
// 物品名与价格 // 物品名与价格
let items = null; let items = null;
@ -12,16 +12,16 @@ export default function cityFinder(): void {
// base.id = 'wh-city-finder'; // base.id = 'wh-city-finder';
// const container = document.createElement('div'); // const container = document.createElement('div');
// container.id = 'wh-city-finder-cont'; // container.id = 'wh-city-finder-cont';
// const header = document.createElement('div'); const header = document.createElement('div');
// header.id = 'wh-city-finder-header'; // header.id = 'wh-city-finder-header';
// header.innerHTML = '捡垃圾助手'; header.innerHTML = '捡垃圾助手';
const info = document.createElement('div'); const info = document.createElement('div');
info.innerHTML = '已找到物品:'; info.innerHTML = '已找到物品:';
// container.append(info); // container.append(info);
// base.append(header); // base.append(header);
// base.append(container); // base.append(container);
let _base = new TornStyleBlock('捡垃圾助手').insert2Dom().append(info); _base.append(header, info);
document.body.classList.add('wh-city-finds'); document.body.classList.add('wh-city-finds');
CommonUtils.COFetch('https://jjins.github.io/item_price_raw.json') CommonUtils.COFetch('https://jjins.github.io/item_price_raw.json')
@ -38,11 +38,13 @@ export default function cityFinder(): void {
elem.querySelectorAll('img.map-user-item-icon').forEach(node => { elem.querySelectorAll('img.map-user-item-icon').forEach(node => {
const item_id = node.src.split('/')[5]; const item_id = node.src.split('/')[5];
const finder_item = document.createElement('span'); const finder_item = document.createElement('span');
finder_item.id = 'wh-city-finder-item' + item_id; // finder_item.id = 'wh-city-finder-item' + item_id;
finder_item.classList.add('wh-city-finder-item');
finder_item.innerHTML = item_id; finder_item.innerHTML = item_id;
founds.push({ 'id': item_id, 'node': finder_item, 'map_item': node }); founds.push({ 'id': item_id, 'node': finder_item, 'map_item': node });
// container.append(finder_item); // container.append(finder_item);
_base.append(finder_item); // _base.append(finder_item);
info.append(finder_item);
}); });
// 未发现物品 返回 // 未发现物品 返回
if (founds.length === 0) { if (founds.length === 0) {
@ -68,8 +70,8 @@ export default function cityFinder(): void {
else if (value >= 449000000) el.node.style.backgroundColor = '#f44336'; else if (value >= 449000000) el.node.style.backgroundColor = '#f44336';
total += items[el.id]['price']; total += items[el.id]['price'];
}); });
// header.innerHTML = `捡垃圾助手 - ${ founds.length } 个物品,总价值 $${ toThousands(total) }`; header.innerHTML = `捡垃圾助手 - ${ founds.length } 个物品,总价值 $${ toThousands(total) }`;
_base.setTitle(`捡垃圾助手 - ${ founds.length } 个物品,总价值 $${ toThousands(total) }`); // _base.setTitle(`捡垃圾助手 - ${ founds.length } 个物品,总价值 $${ toThousands(total) }`);
}; };
// 未取到数据时添加循环来调用函数 // 未取到数据时添加循环来调用函数
if (items === null) { if (items === null) {

View File

@ -17,10 +17,6 @@
display: none !important; display: none !important;
} }
/*#wh-city-finder{*/
/* box-shadow: 0 0 3px 0px #696969;*/
/* border-radius: 4px;*/
/*}*/
/*#wh-city-finder-header{*/ /*#wh-city-finder-header{*/
/* background-color: #3f51b5;*/ /* background-color: #3f51b5;*/
/* color: white;*/ /* color: white;*/
@ -31,6 +27,11 @@
/* background-image: linear-gradient(90deg,transparent 50%,rgba(0,0,0,.07) 0);*/ /* background-image: linear-gradient(90deg,transparent 50%,rgba(0,0,0,.07) 0);*/
/* background-size: 4px;*/ /* background-size: 4px;*/
/*}*/ /*}*/
/*#wh-city-finder{*/
/* box-shadow: 0 0 3px 0px #696969;*/
/* border-radius: 4px;*/
/*}*/
/*#wh-city-finder-cont{*/ /*#wh-city-finder-cont{*/
/* background: #616161;*/ /* background: #616161;*/
/* padding: 8px;*/ /* padding: 8px;*/
@ -45,4 +46,12 @@
/* background:green;*/ /* background:green;*/
/* color:white;*/ /* color:white;*/
/* display:inline-block;*/ /* display:inline-block;*/
/*}*/ /*}*/
.wh-city-finder-item {
margin: 2px 4px 2px 0;
padding: 2px;
border-radius: 2px;
background: green;
color: white;
display: inline-block;
}