更新
This commit is contained in:
parent
d30e4f0d96
commit
207bea46ca
@ -5,6 +5,15 @@
|
||||
|
||||
# CHANGE
|
||||
|
||||
## 1.0.2
|
||||
|
||||
2023年06月15日
|
||||
|
||||
### 修改
|
||||
|
||||
- 错误修复
|
||||
- 菜单样式修改
|
||||
|
||||
## 1.0.1
|
||||
|
||||
2023年06月14日
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "wuhu-torn-helper",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.2",
|
||||
"description": "芜湖助手",
|
||||
"scripts": {
|
||||
"release": "cross-env NODE_ENV=production rollup -c && node build.mjs",
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -35,8 +35,10 @@ const deposit = async (amount: number, action: 'deposit' | 'withdraw' = 'deposit
|
||||
throw new Error('数额不能小于1');
|
||||
}
|
||||
|
||||
let response: string;
|
||||
|
||||
try {
|
||||
await fetch(window.addRFC("https://www.torn.com/companies.php?step=funds"), {
|
||||
response = await (await fetch(window.addRFC("https://www.torn.com/companies.php?step=funds"), {
|
||||
"headers": {
|
||||
"accept": "*/*",
|
||||
"content-type": "application/x-www-form-urlencoded; charset=UTF-8",
|
||||
@ -52,14 +54,35 @@ const deposit = async (amount: number, action: 'deposit' | 'withdraw' = 'deposit
|
||||
"method": "POST",
|
||||
"mode": "cors",
|
||||
"credentials": "include"
|
||||
});
|
||||
})).text();
|
||||
} catch (e) {
|
||||
ElMessage.error('请求出错 ' + e.message);
|
||||
logger.error(e.stack);
|
||||
throw e;
|
||||
}
|
||||
|
||||
ElMessage.success('$' + toThousands(amount) + ' 存取请求完成');
|
||||
let error: string, text: string;
|
||||
try {
|
||||
let json = JSON.parse(response);
|
||||
error = json.error;
|
||||
text = json.text;
|
||||
} catch (e) {
|
||||
}
|
||||
if (error) {
|
||||
ElMessage.error('$' + toThousands(amount) + ' 存取请求失败 ' + text);
|
||||
logger.error('存取请求失败 ' + text);
|
||||
throw new Error('存取请求失败 ' + text);
|
||||
} else {
|
||||
ElMessage.success('$' + toThousands(amount) + ' 存取请求完成');
|
||||
}
|
||||
|
||||
if (action === 'deposit') {
|
||||
inputWithdrawMoney.value = '';
|
||||
} else {
|
||||
inputMoney.value = '';
|
||||
}
|
||||
updateCompany().then();
|
||||
updateCash().then();
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
@ -83,7 +106,7 @@ onMounted(() => {
|
||||
<el-button @click="async () => inputWithdrawMoney = toThousands(await updateCash())">$</el-button>
|
||||
</template>
|
||||
<template #append>
|
||||
<el-button @click="deposit(Number(inputWithdrawMoney.replaceAll(',', '')), 'withdraw')">取出</el-button>
|
||||
<el-button @click="deposit(Number(inputWithdrawMoney.replaceAll(',', '')))">存入</el-button>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
@ -97,7 +120,7 @@ onMounted(() => {
|
||||
<el-button @click="async () => inputMoney = toThousands(await updateCompany())">$</el-button>
|
||||
</template>
|
||||
<template #append>
|
||||
<el-button @click="deposit(Number(inputMoney.replaceAll(',', '')))">存入</el-button>
|
||||
<el-button @click="deposit(Number(inputMoney.replaceAll(',', '')), 'withdraw')">取出</el-button>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
||||
@ -1,80 +1,134 @@
|
||||
<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-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-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"
|
||||
>
|
||||
<template #header>
|
||||
<p>便捷菜单</p>
|
||||
<el-button link>芜湖助手 v{{ globVars.version.startsWith('$') ? '-1' : globVars.version }}</el-button>
|
||||
</template>
|
||||
<el-menu
|
||||
:unique-opened="true"
|
||||
class="el-menu-vertical-demo"
|
||||
>
|
||||
<el-button circle class="wh-menu-button">
|
||||
<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-config-provider>
|
||||
<el-sub-menu index="1">
|
||||
<template #title>
|
||||
<el-icon>✈️</el-icon>
|
||||
<span>起飞</span>
|
||||
</template>
|
||||
<el-sub-menu v-for="(item, i) in travelData" :index="'1-'+(i+1)">
|
||||
<template #title>{{ item.cName }}</template>
|
||||
<el-menu-item :index="'1-'+(i+1)+'1'" @click="travelConfirm(item.index, 0)">
|
||||
普通飞机
|
||||
</el-menu-item>
|
||||
<el-menu-item :index="'1-'+(i+1)+'2'" @click="travelConfirm(item.index, 1)">
|
||||
PI飞机
|
||||
</el-menu-item>
|
||||
<el-menu-item :index="'1-'+(i+1)+'3'" @click="travelConfirm(item.index, 2)">
|
||||
股票飞机
|
||||
</el-menu-item>
|
||||
<el-menu-item :index="'1-'+(i+1)+'4'" @click="travelConfirm(item.index, 3)">
|
||||
商务飞机(机票或内衣店)
|
||||
</el-menu-item>
|
||||
</el-sub-menu>
|
||||
</el-sub-menu>
|
||||
<el-sub-menu index="2">
|
||||
<template #title>
|
||||
<el-icon>💪</el-icon>
|
||||
<span>锻炼</span>
|
||||
</template>
|
||||
<el-menu-item @click="quickGymTrain.doTrain(BATTLE_STAT.STR)">力量
|
||||
</el-menu-item>
|
||||
<el-menu-item @click="quickGymTrain.doTrain(BATTLE_STAT.DEF)">防御
|
||||
</el-menu-item>
|
||||
<el-menu-item @click="quickGymTrain.doTrain(BATTLE_STAT.SPD)">速度
|
||||
</el-menu-item>
|
||||
<el-menu-item @click="quickGymTrain.doTrain(BATTLE_STAT.DEX)">闪避
|
||||
</el-menu-item>
|
||||
</el-sub-menu>
|
||||
<el-menu-item v-for="(item,i) in menuItemList" :index="(3+i).toString()" @click="menuClick(item)">
|
||||
<el-icon>{{ item.title.slice(0, 2) }}</el-icon>
|
||||
<span>{{ item.title.slice(2, item.title.length) }}</span>
|
||||
</el-menu-item>
|
||||
</el-menu>
|
||||
</el-drawer>
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
@ -96,6 +150,7 @@ import PTMarketView from "./PTMarketView.vue";
|
||||
import QuickCrime from "./QuickCrime.vue";
|
||||
import VirusProgramming from "./VirusProgramming.vue";
|
||||
import CompanyWithdraw from "./CompanyWithdraw.vue";
|
||||
import globVars from "../ts/globVars";
|
||||
|
||||
const logger = inject(LoggerKey);
|
||||
const quickGymTrain = inject(QuickGymTrainKey);
|
||||
@ -119,16 +174,16 @@ const useItem = (itemId: string) => {
|
||||
"mode": "cors",
|
||||
"credentials": "include"
|
||||
})
|
||||
.then(res => res.json())
|
||||
.then(res => ElMessage({
|
||||
message: res.text,
|
||||
type: res.success ? 'success' : 'error',
|
||||
dangerouslyUseHTMLString: true
|
||||
}))
|
||||
.catch(e => ElMessage({
|
||||
message: e.toString,
|
||||
type: 'error'
|
||||
}));
|
||||
.then(res => res.json())
|
||||
.then(res => ElMessage({
|
||||
message: res.text,
|
||||
type: res.success ? 'success' : 'error',
|
||||
dangerouslyUseHTMLString: true
|
||||
}))
|
||||
.catch(e => ElMessage({
|
||||
message: e.toString,
|
||||
type: 'error'
|
||||
}));
|
||||
};
|
||||
|
||||
const menuItemList = [
|
||||
@ -140,55 +195,55 @@ const menuItemList = [
|
||||
title: '🍺 喝啤酒',
|
||||
template: () => useItem('180'),
|
||||
},
|
||||
{
|
||||
title: '♻️ REFILL',
|
||||
template: () => 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",
|
||||
"sec-fetch-dest": "empty",
|
||||
"sec-fetch-mode": "cors",
|
||||
"sec-fetch-site": "same-origin",
|
||||
"x-requested-with": "XMLHttpRequest"
|
||||
},
|
||||
"referrer": "https://www.torn.com/points.php",
|
||||
"referrerPolicy": "strict-origin-when-cross-origin",
|
||||
"body": null,
|
||||
"method": "GET",
|
||||
"mode": "cors",
|
||||
"credentials": "include"
|
||||
})
|
||||
.then(res => res.json())
|
||||
.then(res => ElMessage({
|
||||
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'
|
||||
})),
|
||||
},
|
||||
{
|
||||
title: '🚓 快速犯罪',
|
||||
template: QuickCrime,
|
||||
},
|
||||
{
|
||||
title: '🌸 飞花库存',
|
||||
template: ForeignStock,
|
||||
},
|
||||
{
|
||||
title: '📢 浏览通知',
|
||||
template: EventsViewer,
|
||||
},
|
||||
{
|
||||
title: '🚮 地图垃圾',
|
||||
template: CityUItems,
|
||||
},
|
||||
{
|
||||
title: '🩼 配置自动登陆',
|
||||
template: AutoLoginForm,
|
||||
},
|
||||
{
|
||||
title: '♻️ REFILL',
|
||||
template: () => 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",
|
||||
"sec-fetch-dest": "empty",
|
||||
"sec-fetch-mode": "cors",
|
||||
"sec-fetch-site": "same-origin",
|
||||
"x-requested-with": "XMLHttpRequest"
|
||||
},
|
||||
"referrer": "https://www.torn.com/points.php",
|
||||
"referrerPolicy": "strict-origin-when-cross-origin",
|
||||
"body": null,
|
||||
"method": "GET",
|
||||
"mode": "cors",
|
||||
"credentials": "include"
|
||||
})
|
||||
.then(res => res.json())
|
||||
.then(res => ElMessage({
|
||||
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'
|
||||
})),
|
||||
},
|
||||
{
|
||||
title: '🚓 快速犯罪',
|
||||
template: QuickCrime,
|
||||
},
|
||||
{
|
||||
title: '🌸 飞花库存',
|
||||
template: ForeignStock,
|
||||
},
|
||||
{
|
||||
title: '📢 浏览通知',
|
||||
template: EventsViewer,
|
||||
},
|
||||
{
|
||||
title: '🚮 地图垃圾',
|
||||
template: CityUItems,
|
||||
},
|
||||
{
|
||||
title: '🩼 配置自动登陆',
|
||||
template: AutoLoginForm,
|
||||
},
|
||||
{
|
||||
title: '💻 PC',
|
||||
template: VirusProgramming,
|
||||
@ -205,130 +260,139 @@ const menuItemList = [
|
||||
title: '💰 公司存钱',
|
||||
template: CompanyWithdraw,
|
||||
},
|
||||
{
|
||||
title: '🫵 关闭店铺(双击开启)',
|
||||
template: () => bazaarControl.method(),
|
||||
},
|
||||
{
|
||||
title: '⚙️ 插件配置',
|
||||
template: Config,
|
||||
},
|
||||
// {
|
||||
// title: 'test',
|
||||
// template: () => expanded.value = !expanded.value,
|
||||
// },
|
||||
];
|
||||
const drawer = ref(false);
|
||||
const drawerTitle = ref('');
|
||||
const drawerContent = shallowRef(null);
|
||||
const isMobilePhone = ref(false);
|
||||
const documentHeight = ref(0);
|
||||
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 {
|
||||
drawer.value = true;
|
||||
drawerTitle.value = menuItem.title;
|
||||
drawerContent.value = menuItem.template;
|
||||
}
|
||||
if (typeof menuItem.template === 'function') {
|
||||
menuItem.template();
|
||||
} else {
|
||||
drawer.value = true;
|
||||
drawerTitle.value = menuItem.title;
|
||||
drawerContent.value = menuItem.template;
|
||||
}
|
||||
};
|
||||
|
||||
const travelConfirm = (destIndex, typeIndex) => {
|
||||
ElMessageBox.confirm(
|
||||
'即将使用[' + ['普通飞机', 'PI飞机', '股票飞机', '商务飞机(机票或内衣店)'][typeIndex] + ']飞往[' + travelData[destIndex].cName + ']',
|
||||
'确认',
|
||||
{
|
||||
confirmButtonText: '好',
|
||||
cancelButtonText: '算了',
|
||||
type: 'info',
|
||||
}
|
||||
)
|
||||
.then(async () => {
|
||||
await quickFlyBtnHandler.directFly(destIndex, typeIndex);
|
||||
ElMessageBox.confirm('是否转跳页面?', '确认', {
|
||||
confirmButtonText: '好',
|
||||
cancelButtonText: '算了',
|
||||
type: 'info'
|
||||
}
|
||||
).then(() => window.location.href = 'https://www.torn.com')
|
||||
.catch(() => null);
|
||||
})
|
||||
.catch(() => null);
|
||||
ElMessageBox.confirm(
|
||||
'即将使用[' + ['普通飞机', 'PI飞机', '股票飞机', '商务飞机(机票或内衣店)'][typeIndex] + ']飞往[' + travelData[destIndex].cName + ']',
|
||||
'确认',
|
||||
{
|
||||
confirmButtonText: '好',
|
||||
cancelButtonText: '算了',
|
||||
type: 'info',
|
||||
}
|
||||
)
|
||||
.then(async () => {
|
||||
await quickFlyBtnHandler.directFly(destIndex, typeIndex);
|
||||
ElMessageBox.confirm('是否转跳页面?', '确认', {
|
||||
confirmButtonText: '好',
|
||||
cancelButtonText: '算了',
|
||||
type: 'info'
|
||||
}
|
||||
).then(() => window.location.href = 'https://www.torn.com')
|
||||
.catch(() => null);
|
||||
})
|
||||
.catch(() => null);
|
||||
};
|
||||
|
||||
const bazaarControl = {
|
||||
wait: (t) => new Promise(resolve => window.setTimeout(() => resolve(null), t)),
|
||||
count: 0,
|
||||
doGet: async (isClose) => {
|
||||
let response;
|
||||
try {
|
||||
response = await (await fetch(
|
||||
"https://www.torn.com/bazaar.php?sid=bazaarData&step=" + (isClose ? "closeBazaar" : "openBazaar"),
|
||||
{
|
||||
"headers": {
|
||||
"accept": "*/*",
|
||||
"sec-ch-ua-mobile": "?0",
|
||||
"sec-fetch-dest": "empty",
|
||||
"sec-fetch-mode": "cors",
|
||||
"sec-fetch-site": "same-origin",
|
||||
"x-requested-with": "XMLHttpRequest"
|
||||
},
|
||||
"referrer": "https://www.torn.com/bazaar.php",
|
||||
"referrerPolicy": "strict-origin-when-cross-origin",
|
||||
"body": null,
|
||||
"method": "GET",
|
||||
"mode": "cors",
|
||||
"credentials": "include"
|
||||
}
|
||||
)).json();
|
||||
} catch (e) {
|
||||
logger.error(e.stack);
|
||||
ElMessage.error(e.message);
|
||||
throw e;
|
||||
}
|
||||
if (response.success) {
|
||||
ElMessage.success({
|
||||
dangerouslyUseHTMLString: true,
|
||||
message: response.text,
|
||||
});
|
||||
} else {
|
||||
ElMessage.error(response.text);
|
||||
}
|
||||
},
|
||||
method: async () => {
|
||||
bazaarControl.count++;
|
||||
if (bazaarControl.count === 1) await bazaarControl.wait(600);
|
||||
if (bazaarControl.count === 1) {
|
||||
bazaarControl.count = 0;
|
||||
await bazaarControl.doGet(true);
|
||||
}
|
||||
if (bazaarControl.count === 2) {
|
||||
bazaarControl.count = 0;
|
||||
await bazaarControl.doGet(false);
|
||||
}
|
||||
},
|
||||
wait: (t) => new Promise(resolve => window.setTimeout(() => resolve(null), t)),
|
||||
count: 0,
|
||||
doGet: async (isClose) => {
|
||||
let response;
|
||||
try {
|
||||
response = await (await fetch(
|
||||
"https://www.torn.com/bazaar.php?sid=bazaarData&step=" + (isClose ? "closeBazaar" : "openBazaar"),
|
||||
{
|
||||
"headers": {
|
||||
"accept": "*/*",
|
||||
"sec-ch-ua-mobile": "?0",
|
||||
"sec-fetch-dest": "empty",
|
||||
"sec-fetch-mode": "cors",
|
||||
"sec-fetch-site": "same-origin",
|
||||
"x-requested-with": "XMLHttpRequest"
|
||||
},
|
||||
"referrer": "https://www.torn.com/bazaar.php",
|
||||
"referrerPolicy": "strict-origin-when-cross-origin",
|
||||
"body": null,
|
||||
"method": "GET",
|
||||
"mode": "cors",
|
||||
"credentials": "include"
|
||||
}
|
||||
)).json();
|
||||
} catch (e) {
|
||||
logger.error(e.stack);
|
||||
ElMessage.error(e.message);
|
||||
throw e;
|
||||
}
|
||||
if (response.success) {
|
||||
ElMessage.success({
|
||||
dangerouslyUseHTMLString: true,
|
||||
message: response.text,
|
||||
});
|
||||
} else {
|
||||
ElMessage.error(response.text);
|
||||
}
|
||||
},
|
||||
method: async () => {
|
||||
bazaarControl.count++;
|
||||
if (bazaarControl.count === 1) await bazaarControl.wait(600);
|
||||
if (bazaarControl.count === 1) {
|
||||
bazaarControl.count = 0;
|
||||
await bazaarControl.doGet(true);
|
||||
}
|
||||
if (bazaarControl.count === 2) {
|
||||
bazaarControl.count = 0;
|
||||
await bazaarControl.doGet(false);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
if (document.documentElement.scrollWidth < 800) {
|
||||
isMobilePhone.value = true;
|
||||
}
|
||||
if (document.documentElement.scrollWidth < 600) {
|
||||
isMobilePhone.value = true;
|
||||
}
|
||||
documentHeight.value = document.documentElement.scrollHeight;
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.wh-menu-button {
|
||||
position: fixed;
|
||||
top: 32px;
|
||||
left: 10px;
|
||||
position: fixed;
|
||||
top: 32px;
|
||||
left: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user