更新
This commit is contained in:
parent
207bea46ca
commit
0a255f0e51
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "wuhu-torn-helper",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.3",
|
||||
"description": "芜湖助手",
|
||||
"scripts": {
|
||||
"release": "cross-env NODE_ENV=production rollup -c && node build.mjs",
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -61,7 +61,7 @@ export default class QuickFlyBtnHandler {
|
||||
}
|
||||
|
||||
// 起飞目的地id
|
||||
private static getDestId(dest): number {
|
||||
private static getDestId(dest: number): number {
|
||||
// 墨、开、加、夏、英、阿、瑞s、立本、祖、迪、南
|
||||
return [2, 12, 9, 3, 10, 7, 8, 5, 6, 11, 4][dest];
|
||||
}
|
||||
@ -121,7 +121,7 @@ export default class QuickFlyBtnHandler {
|
||||
yaoCD.innerHTML = `药CD剩余:${ CommonUtils.getYaoCD() }`;
|
||||
}
|
||||
|
||||
public async directFly(destIndex, typeIndex) {
|
||||
public async directFly(destIndex: number, typeIndex: number) {
|
||||
// 获取key
|
||||
let key;
|
||||
try {
|
||||
|
||||
@ -99,7 +99,7 @@ onMounted(() => {
|
||||
<el-form-item :label="'现金 $' + toThousands(formModel.cash)">
|
||||
<el-input
|
||||
v-model="inputWithdrawMoney"
|
||||
:formatter="toThousands"
|
||||
:formatter="toThousands" clearable
|
||||
:parser="(value) => value.replaceAll(',', '')"
|
||||
>
|
||||
<template #prepend>
|
||||
@ -113,7 +113,7 @@ onMounted(() => {
|
||||
<el-form-item :label="'公司可用余额 $' + toThousands(formModel.company)">
|
||||
<el-input
|
||||
v-model="inputMoney"
|
||||
:formatter="toThousands"
|
||||
:formatter="toThousands" clearable
|
||||
:parser="(value) => value.replaceAll(',', '')"
|
||||
>
|
||||
<template #prepend>
|
||||
@ -127,4 +127,8 @@ onMounted(() => {
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
<style scoped>
|
||||
.el-input {
|
||||
max-width: 400px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -1,92 +1,20 @@
|
||||
<template>
|
||||
<el-config-provider :size="'default'" :z-index="1000000">
|
||||
<!-- <el-dropdown-->
|
||||
<!-- :hide-on-click="false"-->
|
||||
<!-- :max-height="(documentHeight * 0.8 | 0) + 'px'" size="small" style="z-index: 1000000;user-select: none"-->
|
||||
<!-- trigger="click"-->
|
||||
<!-- >-->
|
||||
<el-button circle class="wh-menu-button" @click="expanded=!expanded">
|
||||
<el-button circle class="wh-menu-button" style="z-index: 1000000;" @click="expanded = !expanded">
|
||||
<el-icon>
|
||||
<MoonNight/>
|
||||
</el-icon>
|
||||
</el-button>
|
||||
<!-- <template #dropdown>-->
|
||||
<!-- <el-dropdown-menu>-->
|
||||
<!-- <el-dropdown-item>芜湖助手</el-dropdown-item>-->
|
||||
<!-- <el-dropdown-item divided>-->
|
||||
<!-- <el-dropdown placement="bottom-end" size="small" style="width: 100%" trigger="click">-->
|
||||
<!-- <el-button link size="small" style="width: 100%;text-align: left;">💪 快速锻炼 ></el-button>-->
|
||||
<!-- <template #dropdown>-->
|
||||
<!-- <el-dropdown-item @click="quickGymTrain.doTrain(BATTLE_STAT.STR)">力量-->
|
||||
<!-- </el-dropdown-item>-->
|
||||
<!-- <el-dropdown-item @click="quickGymTrain.doTrain(BATTLE_STAT.DEF)">防御-->
|
||||
<!-- </el-dropdown-item>-->
|
||||
<!-- <el-dropdown-item @click="quickGymTrain.doTrain(BATTLE_STAT.SPD)">速度-->
|
||||
<!-- </el-dropdown-item>-->
|
||||
<!-- <el-dropdown-item @click="quickGymTrain.doTrain(BATTLE_STAT.DEX)">闪避-->
|
||||
<!-- </el-dropdown-item>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-dropdown>-->
|
||||
<!-- </el-dropdown-item>-->
|
||||
<!-- <el-dropdown-item>-->
|
||||
<!-- <el-dropdown placement="bottom-end" size="small" style="width: 100%" trigger="click">-->
|
||||
<!-- <el-button link size="small" style="width: 100%;text-align: left;">✈️ 一键起飞 ></el-button>-->
|
||||
<!-- <template #dropdown>-->
|
||||
<!-- <template v-for="travel in travelData">-->
|
||||
<!-- <el-dropdown-item>-->
|
||||
<!-- <el-dropdown placement="bottom-end" size="small" style="width: 100%"-->
|
||||
<!-- trigger="click">-->
|
||||
<!-- <div style="width: 100%">{{ travel.cName }} ></div>-->
|
||||
<!-- <template #dropdown>-->
|
||||
<!-- <el-dropdown-item @click="travelConfirm(travel.index, 0)">-->
|
||||
<!-- 普通飞机-->
|
||||
<!-- </el-dropdown-item>-->
|
||||
<!-- <el-dropdown-item @click="travelConfirm(travel.index, 1)">-->
|
||||
<!-- PI飞机-->
|
||||
<!-- </el-dropdown-item>-->
|
||||
<!-- <el-dropdown-item @click="travelConfirm(travel.index, 2)">-->
|
||||
<!-- 股票飞机-->
|
||||
<!-- </el-dropdown-item>-->
|
||||
<!-- <el-dropdown-item @click="travelConfirm(travel.index, 3)">-->
|
||||
<!-- 商务飞机(机票或内衣店)-->
|
||||
<!-- </el-dropdown-item>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-dropdown>-->
|
||||
<!-- </el-dropdown-item>-->
|
||||
<!-- </template>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-dropdown>-->
|
||||
<!-- </el-dropdown-item>-->
|
||||
<!-- <template v-for="(item, i) in menuItemList">-->
|
||||
<!-- <el-dropdown-item v-if="i === 0" divided @click="menuClick(item)">-->
|
||||
<!-- {{ item.title }}-->
|
||||
<!-- </el-dropdown-item>-->
|
||||
<!-- <el-dropdown-item v-else @click="menuClick(item)">-->
|
||||
<!-- {{ item.title }}-->
|
||||
<!-- </el-dropdown-item>-->
|
||||
<!-- </template>-->
|
||||
<!-- <el-dropdown-item @click="bazaarControl.method()">🫵 关闭店铺(双击开启)-->
|
||||
<!-- </el-dropdown-item>-->
|
||||
<!-- </el-dropdown-menu>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-dropdown>-->
|
||||
<el-dialog v-model="drawer" :destroy-on-close="true" :fullscreen="isMobilePhone" :lock-scroll="true"
|
||||
:title="drawerTitle" width="65%">
|
||||
<component :is="drawerContent"/>
|
||||
</el-dialog>
|
||||
<el-drawer
|
||||
v-model="expanded"
|
||||
:size="isMobilePhone?'85%':'30%'"
|
||||
direction="rtl"
|
||||
>
|
||||
<el-drawer v-model="expanded" :size="isMobilePhone ? '85%' : '30%'" direction="rtl">
|
||||
<template #header>
|
||||
<p>便捷菜单</p>
|
||||
<el-button link>芜湖助手 v{{ globVars.version.startsWith('$') ? '-1' : globVars.version }}</el-button>
|
||||
<el-button link>芜湖助手 {{ globVars.version.startsWith('$') ? 'dev' : 'v' + globVars.version }}</el-button>
|
||||
</template>
|
||||
<el-menu
|
||||
:unique-opened="true"
|
||||
class="el-menu-vertical-demo"
|
||||
>
|
||||
<el-menu :unique-opened="true" class="el-menu-vertical-demo">
|
||||
<el-sub-menu index="1">
|
||||
<template #title>
|
||||
<el-icon>✈️</el-icon>
|
||||
@ -135,7 +63,7 @@
|
||||
|
||||
import { MoonNight } from "@element-plus/icons-vue";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import { inject, onMounted, ref, shallowRef } from 'vue';
|
||||
import { Component, inject, onMounted, ref, shallowRef } from 'vue';
|
||||
import { LoggerKey } from "../ts/class/Logger";
|
||||
import { QuickGymTrainKey } from "../ts/class/action/QuickGymTrain";
|
||||
import { QuickFlyBtnHandlerKey } from "../ts/class/handler/QuickFlyBtnHandler";
|
||||
@ -186,18 +114,19 @@ const useItem = (itemId: string) => {
|
||||
}));
|
||||
};
|
||||
|
||||
const menuItemList = [
|
||||
type MenuItem = { title: string, template?: Component, handler?: Function };
|
||||
const menuItemList: MenuItem[] = [
|
||||
{
|
||||
title: '💊 吃 XAN',
|
||||
template: () => useItem('206'),
|
||||
handler: () => useItem('206'),
|
||||
},
|
||||
{
|
||||
title: '🍺 喝啤酒',
|
||||
template: () => useItem('180'),
|
||||
handler: () => useItem('180'),
|
||||
},
|
||||
{
|
||||
title: '♻️ REFILL',
|
||||
template: () => fetch(window.addRFC("https://www.torn.com/points.php?step=pointsbuy&action=energyrefill2"), {
|
||||
handler: () => fetch(window.addRFC("https://www.torn.com/points.php?step=pointsbuy&action=energyrefill2"), {
|
||||
"headers": {
|
||||
"accept": "text/plain, */*; q=0.01",
|
||||
"sec-ch-ua-mobile": "?0",
|
||||
@ -215,14 +144,11 @@ const menuItemList = [
|
||||
})
|
||||
.then(res => res.json())
|
||||
.then(res => ElMessage({
|
||||
message: `<p>${ res.msg }</p><p>剩余refill: ${ res.refills }</p>`,
|
||||
message: `<p>${ res.msg }</p><p>剩余refill: ${ res["refills"] }</p>`,
|
||||
type: res.state === 'done' ? 'success' : 'error',
|
||||
dangerouslyUseHTMLString: true
|
||||
}))
|
||||
.catch(e => ElMessage({
|
||||
message: e.toString,
|
||||
type: 'error'
|
||||
})),
|
||||
.catch(e => ElMessage.error(e.toString)),
|
||||
},
|
||||
{
|
||||
title: '🚓 快速犯罪',
|
||||
@ -262,16 +188,12 @@ const menuItemList = [
|
||||
},
|
||||
{
|
||||
title: '🫵 关闭店铺(双击开启)',
|
||||
template: () => bazaarControl.method(),
|
||||
handler: () => bazaarControl.method(),
|
||||
},
|
||||
{
|
||||
title: '⚙️ 插件配置',
|
||||
template: Config,
|
||||
},
|
||||
// {
|
||||
// title: 'test',
|
||||
// template: () => expanded.value = !expanded.value,
|
||||
// },
|
||||
];
|
||||
const drawer = ref(false);
|
||||
const drawerTitle = ref('');
|
||||
@ -282,32 +204,34 @@ const expanded = ref(false);
|
||||
|
||||
// fast travel
|
||||
const travelData = [
|
||||
{ cName: "墨西哥", index: "0" },
|
||||
{ cName: "开曼", index: "1" },
|
||||
{ cName: "加拿大", index: "2" },
|
||||
{ cName: "夏威夷", index: "3" },
|
||||
{ cName: "嘤国", index: "4" },
|
||||
{ cName: "阿根廷", index: "5" },
|
||||
{ cName: "瑞士 (解毒)", index: "6" },
|
||||
{ cName: "立本", index: "7" },
|
||||
{ cName: "祖国", index: "8" },
|
||||
{ cName: "阿联酋 (UAE)", index: "9" },
|
||||
{ cName: "南非", index: "10" },
|
||||
{ cName: "墨西哥", index: 0 },
|
||||
{ cName: "开曼", index: 1 },
|
||||
{ cName: "加拿大", index: 2 },
|
||||
{ cName: "夏威夷", index: 3 },
|
||||
{ cName: "嘤国", index: 4 },
|
||||
{ cName: "阿根廷", index: 5 },
|
||||
{ cName: "瑞士 (解毒)", index: 6 },
|
||||
{ cName: "立本", index: 7 },
|
||||
{ cName: "祖国", index: 8 },
|
||||
{ cName: "阿联酋 (UAE)", index: 9 },
|
||||
{ cName: "南非", index: 10 },
|
||||
];
|
||||
|
||||
const menuClick = (menuItem) => {
|
||||
if (typeof menuItem.template === 'function') {
|
||||
menuItem.template();
|
||||
} else {
|
||||
const menuClick = (menuItem: MenuItem) => {
|
||||
if (menuItem.handler) {
|
||||
menuItem.handler();
|
||||
} else if (menuItem.template) {
|
||||
drawer.value = true;
|
||||
drawerTitle.value = menuItem.title;
|
||||
drawerContent.value = menuItem.template;
|
||||
}
|
||||
};
|
||||
|
||||
const travelConfirm = (destIndex, typeIndex) => {
|
||||
const travelConfirm = (destIndex: number, typeIndex: number) => {
|
||||
const destName = travelData[destIndex].cName;
|
||||
const typeName = ['普通飞机', 'PI飞机', '股票飞机', '商务飞机(机票或内衣店)'][typeIndex];
|
||||
ElMessageBox.confirm(
|
||||
'即将使用[' + ['普通飞机', 'PI飞机', '股票飞机', '商务飞机(机票或内衣店)'][typeIndex] + ']飞往[' + travelData[destIndex].cName + ']',
|
||||
'即将使用「' + typeName + '」飞往「' + destName + '」',
|
||||
'确认',
|
||||
{
|
||||
confirmButtonText: '好',
|
||||
@ -329,9 +253,9 @@ const travelConfirm = (destIndex, typeIndex) => {
|
||||
};
|
||||
|
||||
const bazaarControl = {
|
||||
wait: (t) => new Promise(resolve => window.setTimeout(() => resolve(null), t)),
|
||||
wait: (t: number) => new Promise(resolve => window.setTimeout(() => resolve(null), t)),
|
||||
count: 0,
|
||||
doGet: async (isClose) => {
|
||||
doGet: async (isClose: boolean) => {
|
||||
let response;
|
||||
try {
|
||||
response = await (await fetch(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user