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