更新
This commit is contained in:
parent
e7effb0881
commit
9c1db27ebe
@ -5,6 +5,15 @@
|
||||
|
||||
# CHANGE
|
||||
|
||||
## 1.0.7
|
||||
|
||||
2023年06月27日
|
||||
|
||||
### 修改
|
||||
|
||||
- 物品功能补充完善
|
||||
- 菜单顺序调整
|
||||
|
||||
## 1.0.6
|
||||
|
||||
2023年06月26日
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "wuhu-torn-helper",
|
||||
"version": "1.0.6",
|
||||
"version": "1.0.7",
|
||||
"description": "芜湖助手",
|
||||
"scripts": {
|
||||
"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-button>
|
||||
</el-button-group>
|
||||
<el-dialog v-model="drawer" :fullscreen="isMobilePhone" :lock-scroll="true"
|
||||
width="65%">
|
||||
<el-dialog v-model="drawer" :fullscreen="isMobilePhone" :lock-scroll="true" width="65%">
|
||||
<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">
|
||||
<component :is="item.content"/>
|
||||
@ -122,12 +121,12 @@ import CityUItems from "./CityUItems.vue";
|
||||
import CompanyWithdraw from "./CompanyWithdraw.vue";
|
||||
import EventsViewer from "./EventsViewer.vue";
|
||||
import ForeignStock from "./ForeignStock.vue";
|
||||
import InventoryView from "./InventoryView.vue";
|
||||
import MarketHelper from "./MarketHelper.vue";
|
||||
import PTMarketView from "./PTMarketView.vue";
|
||||
import QuickCrime from "./QuickCrime.vue";
|
||||
import UpdateDate from "./UpdateScript.vue";
|
||||
import VirusProgramming from "./VirusProgramming.vue";
|
||||
import InventoryView from "./InventoryView.vue";
|
||||
|
||||
const logger = inject(LoggerKey);
|
||||
const quickGymTrain = inject(QuickGymTrainKey);
|
||||
@ -173,10 +172,6 @@ const menuItemList: MenuItem[] = [
|
||||
title: '🚓 快速犯罪',
|
||||
template: QuickCrime,
|
||||
},
|
||||
{
|
||||
title: '🌸 飞花库存',
|
||||
template: ForeignStock,
|
||||
},
|
||||
{
|
||||
title: '📢 浏览通知',
|
||||
template: EventsViewer,
|
||||
@ -185,14 +180,6 @@ const menuItemList: MenuItem[] = [
|
||||
title: '🚮 地图垃圾',
|
||||
template: CityUItems,
|
||||
},
|
||||
{
|
||||
title: '🩼 配置自动登陆',
|
||||
template: AutoLoginForm,
|
||||
},
|
||||
{
|
||||
title: '💻 PC',
|
||||
template: VirusProgramming,
|
||||
},
|
||||
{
|
||||
title: '🛒 购物助手',
|
||||
template: MarketHelper,
|
||||
@ -205,13 +192,25 @@ const menuItemList: MenuItem[] = [
|
||||
title: '💰 公司存钱',
|
||||
template: CompanyWithdraw,
|
||||
},
|
||||
{
|
||||
title: '📦 物品',
|
||||
template: InventoryView,
|
||||
},
|
||||
{
|
||||
title: '🫵 关闭店铺(双击开启)',
|
||||
handler: () => bazaarControl.method(),
|
||||
},
|
||||
{
|
||||
title: '📦 物品',
|
||||
template: InventoryView,
|
||||
title: '🌸 飞花库存',
|
||||
template: ForeignStock,
|
||||
},
|
||||
{
|
||||
title: '💻 PC',
|
||||
template: VirusProgramming,
|
||||
},
|
||||
{
|
||||
title: '🩼 配置自动登陆',
|
||||
template: AutoLoginForm,
|
||||
},
|
||||
{
|
||||
title: '🚀 更新历史',
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
import { Check, Delete, Promotion } from "@element-plus/icons-vue"
|
||||
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 { itemNameDict } from "../ts/dictionary/translation"
|
||||
import Sleep from "../ts/func/utils/Sleep"
|
||||
@ -23,7 +23,9 @@ type Item = {
|
||||
damage: number
|
||||
accuracy: number
|
||||
defence: number
|
||||
type: number
|
||||
// 只赋值可装备物品
|
||||
type?: number
|
||||
bonus: string
|
||||
}
|
||||
|
||||
type ItemDetails = {
|
||||
@ -39,6 +41,7 @@ type ItemDetails = {
|
||||
itemInfoContent: string
|
||||
itemCirculation: string
|
||||
armoryID: boolean
|
||||
// TODO 翻译
|
||||
itemRareIcon: string
|
||||
}
|
||||
|
||||
@ -141,41 +144,42 @@ const parseListHtml = (html: string) => {
|
||||
const ret: Item[] = []
|
||||
let tmp = document.createElement('div')
|
||||
tmp.innerHTML = html
|
||||
tmp.childNodes.forEach(li => {
|
||||
if (li.nodeType === 1) {
|
||||
const item: Item = {
|
||||
type: 0,
|
||||
defence: 0,
|
||||
accuracy: 0, damage: 0,
|
||||
armoryId: 0,
|
||||
details: undefined,
|
||||
isDetailsLoading: false,
|
||||
amount: -1, isEquipped: false, id: -1, name: "", nameZh: ""
|
||||
}
|
||||
let elem = li as HTMLElement
|
||||
// 物品名
|
||||
let name: HTMLElement = elem.querySelector('.name-wrap .name')
|
||||
item.name = name.innerText.trim()
|
||||
item.nameZh = itemNameDict[item.name]
|
||||
// 堆叠数量
|
||||
item.amount = Number(elem.getAttribute('data-qty'))
|
||||
// id
|
||||
item.id = Number(elem.getAttribute('data-item'))
|
||||
// 装备
|
||||
item.isEquipped = elem.getAttribute('data-equipped').trim() === 'true'
|
||||
// 装备id
|
||||
item.armoryId = Number(elem.getAttribute('data-armoryid'))
|
||||
// 武器攻击
|
||||
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.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())
|
||||
|
||||
ret.push(item)
|
||||
tmp.querySelectorAll(':scope > li').forEach(li => {
|
||||
const item: Item = {
|
||||
type: 0,
|
||||
defence: 0,
|
||||
accuracy: 0, damage: 0,
|
||||
armoryId: 0,
|
||||
details: undefined,
|
||||
isDetailsLoading: false,
|
||||
amount: -1, isEquipped: false, id: -1, name: "", nameZh: "",
|
||||
bonus: ""
|
||||
}
|
||||
let elem = li as HTMLElement
|
||||
// 物品名
|
||||
let name: HTMLElement = elem.querySelector('.name-wrap .name')
|
||||
item.name = name.innerText.trim()
|
||||
item.nameZh = itemNameDict[item.name]
|
||||
// 堆叠数量
|
||||
item.amount = Number(elem.getAttribute('data-qty'))
|
||||
// id
|
||||
item.id = Number(elem.getAttribute('data-item'))
|
||||
// 装备
|
||||
item.isEquipped = elem.getAttribute('data-equipped').trim() === 'true'
|
||||
// 装备id
|
||||
item.armoryId = Number(elem.getAttribute('data-armoryid'))
|
||||
// 武器攻击
|
||||
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.defence = Number(elem.querySelector('.bonus-attachment-item-defence-bonus')?.nextElementSibling.innerText?.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)
|
||||
})
|
||||
return ret
|
||||
}
|
||||
@ -227,6 +231,7 @@ const _equipItem = async (item: Item) => {
|
||||
onMounted(async () => {
|
||||
itemList.value = parseListHtml(await fetchList())
|
||||
})
|
||||
watch(itemList, (_cb) => logger.info(_cb))
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -235,16 +240,18 @@ onMounted(async () => {
|
||||
{{ item.label }}
|
||||
</el-button>
|
||||
</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"
|
||||
: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">
|
||||
<template #reference>
|
||||
<el-card :body-style="{ padding: '0px' }" :style="item.isEquipped ? { borderColor: '#32CD32' } : null"
|
||||
shadow="hover">
|
||||
<el-image :alt="item.id.toString()" :mouseover="itemHover(item)"
|
||||
: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-col :span="12">
|
||||
<el-tag>{{ item.damage }}</el-tag>
|
||||
@ -275,9 +282,12 @@ onMounted(async () => {
|
||||
<el-row v-if="item.defence">
|
||||
<el-text>防御: {{ item.defence }}</el-text>
|
||||
</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-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 :span="8">
|
||||
<el-button :icon="Delete" disabled/>
|
||||
@ -286,11 +296,19 @@ onMounted(async () => {
|
||||
<el-button :icon="Promotion" disabled/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div v-if="item.details || item.isDetailsLoading" v-loading="item.isDetailsLoading"
|
||||
v-html="item.details?.itemInfoContent || ''"></div>
|
||||
<el-row v-if="item.details">
|
||||
<el-text>估值: {{ item.details.itemValue }}</el-text>
|
||||
</el-row>
|
||||
<template v-if="item.details">
|
||||
<div v-if="item.isDetailsLoading || item.details?.itemInfoContent"
|
||||
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-row>
|
||||
</template>
|
||||
</el-popover>
|
||||
</el-badge>
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user