更新
This commit is contained in:
parent
e7effb0881
commit
9c1db27ebe
@ -5,6 +5,15 @@
|
|||||||
|
|
||||||
# CHANGE
|
# CHANGE
|
||||||
|
|
||||||
|
## 1.0.7
|
||||||
|
|
||||||
|
2023年06月27日
|
||||||
|
|
||||||
|
### 修改
|
||||||
|
|
||||||
|
- 物品功能补充完善
|
||||||
|
- 菜单顺序调整
|
||||||
|
|
||||||
## 1.0.6
|
## 1.0.6
|
||||||
|
|
||||||
2023年06月26日
|
2023年06月26日
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "wuhu-torn-helper",
|
"name": "wuhu-torn-helper",
|
||||||
"version": "1.0.6",
|
"version": "1.0.7",
|
||||||
"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
@ -15,8 +15,7 @@
|
|||||||
</el-badge>
|
</el-badge>
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
<el-dialog v-model="drawer" :fullscreen="isMobilePhone" :lock-scroll="true"
|
<el-dialog v-model="drawer" :fullscreen="isMobilePhone" :lock-scroll="true" width="65%">
|
||||||
width="65%">
|
|
||||||
<el-tabs v-model="editableTabsValue" closable style="margin-top: -1em" type="border-card" @tab-remove="removeTab">
|
<el-tabs v-model="editableTabsValue" closable style="margin-top: -1em" type="border-card" @tab-remove="removeTab">
|
||||||
<el-tab-pane v-for="item in editableTabs" :key="item.name" :label="item.title" :name="item.name">
|
<el-tab-pane v-for="item in editableTabs" :key="item.name" :label="item.title" :name="item.name">
|
||||||
<component :is="item.content"/>
|
<component :is="item.content"/>
|
||||||
@ -122,12 +121,12 @@ import CityUItems from "./CityUItems.vue";
|
|||||||
import CompanyWithdraw from "./CompanyWithdraw.vue";
|
import CompanyWithdraw from "./CompanyWithdraw.vue";
|
||||||
import EventsViewer from "./EventsViewer.vue";
|
import EventsViewer from "./EventsViewer.vue";
|
||||||
import ForeignStock from "./ForeignStock.vue";
|
import ForeignStock from "./ForeignStock.vue";
|
||||||
|
import InventoryView from "./InventoryView.vue";
|
||||||
import MarketHelper from "./MarketHelper.vue";
|
import MarketHelper from "./MarketHelper.vue";
|
||||||
import PTMarketView from "./PTMarketView.vue";
|
import PTMarketView from "./PTMarketView.vue";
|
||||||
import QuickCrime from "./QuickCrime.vue";
|
import QuickCrime from "./QuickCrime.vue";
|
||||||
import UpdateDate from "./UpdateScript.vue";
|
import UpdateDate from "./UpdateScript.vue";
|
||||||
import VirusProgramming from "./VirusProgramming.vue";
|
import VirusProgramming from "./VirusProgramming.vue";
|
||||||
import InventoryView from "./InventoryView.vue";
|
|
||||||
|
|
||||||
const logger = inject(LoggerKey);
|
const logger = inject(LoggerKey);
|
||||||
const quickGymTrain = inject(QuickGymTrainKey);
|
const quickGymTrain = inject(QuickGymTrainKey);
|
||||||
@ -173,10 +172,6 @@ const menuItemList: MenuItem[] = [
|
|||||||
title: '🚓 快速犯罪',
|
title: '🚓 快速犯罪',
|
||||||
template: QuickCrime,
|
template: QuickCrime,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: '🌸 飞花库存',
|
|
||||||
template: ForeignStock,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '📢 浏览通知',
|
title: '📢 浏览通知',
|
||||||
template: EventsViewer,
|
template: EventsViewer,
|
||||||
@ -185,14 +180,6 @@ const menuItemList: MenuItem[] = [
|
|||||||
title: '🚮 地图垃圾',
|
title: '🚮 地图垃圾',
|
||||||
template: CityUItems,
|
template: CityUItems,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: '🩼 配置自动登陆',
|
|
||||||
template: AutoLoginForm,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '💻 PC',
|
|
||||||
template: VirusProgramming,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '🛒 购物助手',
|
title: '🛒 购物助手',
|
||||||
template: MarketHelper,
|
template: MarketHelper,
|
||||||
@ -205,13 +192,25 @@ const menuItemList: MenuItem[] = [
|
|||||||
title: '💰 公司存钱',
|
title: '💰 公司存钱',
|
||||||
template: CompanyWithdraw,
|
template: CompanyWithdraw,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '📦 物品',
|
||||||
|
template: InventoryView,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '🫵 关闭店铺(双击开启)',
|
title: '🫵 关闭店铺(双击开启)',
|
||||||
handler: () => bazaarControl.method(),
|
handler: () => bazaarControl.method(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '📦 物品',
|
title: '🌸 飞花库存',
|
||||||
template: InventoryView,
|
template: ForeignStock,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '💻 PC',
|
||||||
|
template: VirusProgramming,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '🩼 配置自动登陆',
|
||||||
|
template: AutoLoginForm,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '🚀 更新历史',
|
title: '🚀 更新历史',
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import { Check, Delete, Promotion } from "@element-plus/icons-vue"
|
import { Check, Delete, Promotion } from "@element-plus/icons-vue"
|
||||||
import { ElMessage } from "element-plus"
|
import { ElMessage } from "element-plus"
|
||||||
import { inject, onMounted, ref } from "vue"
|
import { inject, onMounted, ref, watch } from "vue"
|
||||||
import { LoggerKey } from "../ts/class/Logger"
|
import { LoggerKey } from "../ts/class/Logger"
|
||||||
import { itemNameDict } from "../ts/dictionary/translation"
|
import { itemNameDict } from "../ts/dictionary/translation"
|
||||||
import Sleep from "../ts/func/utils/Sleep"
|
import Sleep from "../ts/func/utils/Sleep"
|
||||||
@ -23,7 +23,9 @@ type Item = {
|
|||||||
damage: number
|
damage: number
|
||||||
accuracy: number
|
accuracy: number
|
||||||
defence: number
|
defence: number
|
||||||
type: number
|
// 只赋值可装备物品
|
||||||
|
type?: number
|
||||||
|
bonus: string
|
||||||
}
|
}
|
||||||
|
|
||||||
type ItemDetails = {
|
type ItemDetails = {
|
||||||
@ -39,6 +41,7 @@ type ItemDetails = {
|
|||||||
itemInfoContent: string
|
itemInfoContent: string
|
||||||
itemCirculation: string
|
itemCirculation: string
|
||||||
armoryID: boolean
|
armoryID: boolean
|
||||||
|
// TODO 翻译
|
||||||
itemRareIcon: string
|
itemRareIcon: string
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,8 +144,7 @@ const parseListHtml = (html: string) => {
|
|||||||
const ret: Item[] = []
|
const ret: Item[] = []
|
||||||
let tmp = document.createElement('div')
|
let tmp = document.createElement('div')
|
||||||
tmp.innerHTML = html
|
tmp.innerHTML = html
|
||||||
tmp.childNodes.forEach(li => {
|
tmp.querySelectorAll(':scope > li').forEach(li => {
|
||||||
if (li.nodeType === 1) {
|
|
||||||
const item: Item = {
|
const item: Item = {
|
||||||
type: 0,
|
type: 0,
|
||||||
defence: 0,
|
defence: 0,
|
||||||
@ -150,7 +152,8 @@ const parseListHtml = (html: string) => {
|
|||||||
armoryId: 0,
|
armoryId: 0,
|
||||||
details: undefined,
|
details: undefined,
|
||||||
isDetailsLoading: false,
|
isDetailsLoading: false,
|
||||||
amount: -1, isEquipped: false, id: -1, name: "", nameZh: ""
|
amount: -1, isEquipped: false, id: -1, name: "", nameZh: "",
|
||||||
|
bonus: ""
|
||||||
}
|
}
|
||||||
let elem = li as HTMLElement
|
let elem = li as HTMLElement
|
||||||
// 物品名
|
// 物品名
|
||||||
@ -169,13 +172,14 @@ const parseListHtml = (html: string) => {
|
|||||||
item.damage = Number(elem.querySelector('.bonus-attachment-item-damage-bonus')?.nextElementSibling.innerText?.trim())
|
item.damage = Number(elem.querySelector('.bonus-attachment-item-damage-bonus')?.nextElementSibling.innerText?.trim())
|
||||||
// 武器命中
|
// 武器命中
|
||||||
item.accuracy = Number(elem.querySelector('.bonus-attachment-item-accuracy-bonus')?.nextElementSibling.innerText?.trim())
|
item.accuracy = Number(elem.querySelector('.bonus-attachment-item-accuracy-bonus')?.nextElementSibling.innerText?.trim())
|
||||||
// 武器命中
|
// 装备防御
|
||||||
item.defence = Number(elem.querySelector('.bonus-attachment-item-defence-bonus')?.nextElementSibling.innerText?.trim())
|
item.defence = Number(elem.querySelector('.bonus-attachment-item-defence-bonus')?.nextElementSibling.innerText?.trim())
|
||||||
// 装备类型
|
// 装备类型
|
||||||
item.type = Number(elem.querySelector('ul.actions-wrap li[data-type]')?.getAttribute('data-type').trim())
|
item.type = Number(elem.querySelector('li[data-type][data-action="equip"][data-item][data-id]')?.getAttribute('data-type').trim())
|
||||||
|
// 装备特效
|
||||||
|
item.bonus = elem.querySelector('li.bonus i[class*="bonus-attachment"][title]')?.getAttribute('title').trim()
|
||||||
|
|
||||||
ret.push(item)
|
ret.push(item)
|
||||||
}
|
|
||||||
})
|
})
|
||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
@ -227,6 +231,7 @@ const _equipItem = async (item: Item) => {
|
|||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
itemList.value = parseListHtml(await fetchList())
|
itemList.value = parseListHtml(await fetchList())
|
||||||
})
|
})
|
||||||
|
watch(itemList, (_cb) => logger.info(_cb))
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -235,16 +240,18 @@ onMounted(async () => {
|
|||||||
{{ item.label }}
|
{{ item.label }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
<el-space size="default" wrap>
|
<el-skeleton v-if="itemList.length === 0" :rows="5" animated/>
|
||||||
|
<el-space size="default" style="margin-top: 0.5em;" wrap>
|
||||||
<div v-for="item in itemList" v-infinite-scroll="loadMore" :infinite-scroll-delay="500"
|
<div v-for="item in itemList" v-infinite-scroll="loadMore" :infinite-scroll-delay="500"
|
||||||
:infinite-scroll-disabled="disabledInfiniteLoading">
|
:infinite-scroll-disabled="disabledInfiniteLoading">
|
||||||
<el-badge :hidden="item.amount < 2" :value="item.amount">
|
<el-badge :hidden="item.amount < 2" :max="999" :value="item.amount">
|
||||||
<el-popover :show-after="300" :width="240" trigger="hover">
|
<el-popover :show-after="300" :width="240" trigger="hover">
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<el-card :body-style="{ padding: '0px' }" :style="item.isEquipped ? { borderColor: '#32CD32' } : null"
|
<el-card :body-style="{ padding: '0px' }" :style="item.isEquipped ? { borderColor: '#32CD32' } : null"
|
||||||
shadow="hover">
|
shadow="hover">
|
||||||
<el-image :alt="item.id.toString()" :mouseover="itemHover(item)"
|
<el-image :alt="item.id.toString()" :mouseover="itemHover(item)"
|
||||||
:src="`/images/items/${item.id}/medium.png`" style="width: 60px;height: 30px"/>
|
:src="`/images/items/${item.id}/medium.png`" style="width: 60px;height: 30px"/>
|
||||||
|
<el-tag v-if="item.bonus">🌟</el-tag>
|
||||||
<el-row v-if="item.damage > 0 && item.accuracy > 0">
|
<el-row v-if="item.damage > 0 && item.accuracy > 0">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-tag>{{ item.damage }}</el-tag>
|
<el-tag>{{ item.damage }}</el-tag>
|
||||||
@ -275,9 +282,12 @@ onMounted(async () => {
|
|||||||
<el-row v-if="item.defence">
|
<el-row v-if="item.defence">
|
||||||
<el-text>防御: {{ item.defence }}</el-text>
|
<el-text>防御: {{ item.defence }}</el-text>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<el-row v-if="item.bonus">
|
||||||
|
<el-text>特效: <span v-html="item.bonus"></span></el-text>
|
||||||
|
</el-row>
|
||||||
<el-row :gutter="4">
|
<el-row :gutter="4">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-button :icon="Check" @click="item.armoryId ? _equipItem(item) : useItem(item.id.toString())"/>
|
<el-button :icon="Check" @click="item.type ? _equipItem(item) : useItem(item.id.toString())"/>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-button :icon="Delete" disabled/>
|
<el-button :icon="Delete" disabled/>
|
||||||
@ -286,11 +296,19 @@ onMounted(async () => {
|
|||||||
<el-button :icon="Promotion" disabled/>
|
<el-button :icon="Promotion" disabled/>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div v-if="item.details || item.isDetailsLoading" v-loading="item.isDetailsLoading"
|
<template v-if="item.details">
|
||||||
v-html="item.details?.itemInfoContent || ''"></div>
|
<div v-if="item.isDetailsLoading || item.details?.itemInfoContent"
|
||||||
<el-row v-if="item.details">
|
v-html="item.details?.itemInfoContent.replace(item.details?.itemInfo, '') || ''"></div>
|
||||||
|
<el-row v-if="item.details.itemRareIcon">
|
||||||
|
<el-text>稀有度: {{ item.details.itemRareIcon }}</el-text>
|
||||||
|
</el-row>
|
||||||
|
<el-row v-if="item.details.itemCirculation">
|
||||||
|
<el-text>流通数: {{ item.details.itemCirculation }}</el-text>
|
||||||
|
</el-row>
|
||||||
|
<el-row v-if="item.details.itemValue">
|
||||||
<el-text>估值: {{ item.details.itemValue }}</el-text>
|
<el-text>估值: {{ item.details.itemValue }}</el-text>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
</template>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</el-badge>
|
</el-badge>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user