Skip to content

Commit

Permalink
Merge pull request #495 from andywang425/dev
Browse files Browse the repository at this point in the history
7.1.4
close #493 close #488
  • Loading branch information
andywang425 authored May 3, 2024
2 parents 0bcc87a + 22dbe84 commit 5a4c3dc
Show file tree
Hide file tree
Showing 62 changed files with 1,347 additions and 6,208 deletions.
1 change: 0 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"recommendations": [
"Vue.volar",
"Vue.vscode-typescript-vue-plugin",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
]
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# 更新日志

## [Unreleased]

## [7.1.4] - 2024-5-3

### 新增

- 移除直播画面上方的排行榜、礼物星球、活动入口、大乱斗入口、礼物栏下方广告、推荐直播间、马赛克

### 修复

- 修复部分情况下点击【编辑名单】按钮时表格中的多选框无法被正确勾选的Bug
- 修复粉丝勋章名单表格无法正确加载的bug
- 修复自动佩戴粉丝勋章、显示高能用户数量模块在第二个及以后的页面无法正确运行的Bug

### 调整

- 移除直播间幻星派对标志模块回归
- Vue的VSCode官方拓展发生变化,修改相关文档和拓展推荐
- 暂时不领取type=14的大会员权益

## [7.1.3] - 2024-2-2

### 新增
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ BLTH 是一个基于 [Vue3](https://cn.vuejs.org), [vite-plugin-monkey](https://
- 安装 [Node.js](https://nodejs.org/), [Visual Studio Code](https://code.visualstudio.com/)
- Fork 本项目,然后 Clone 至本地。
- 切换到项目根目录,安装依赖 `npm install`
- 安装以下几个 vscode 拓展:[Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar), [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin), [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint), [Prettier - Code formatter](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)。同时为了更好的开发体验推荐启用 Volar 的 [Take Over Mode](https://cn.vuejs.org/guide/typescript/overview.html#volar-takeover-mode)
- 安装以下几个 vscode 拓展:[Vue - Official](https://marketplace.visualstudio.com/items?itemName=Vue.volar), [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint), [Prettier - Code formatter](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)

## 开始

Expand Down
60 changes: 0 additions & 60 deletions dist/bilibili-live-tasks-helper.min.user.js

This file was deleted.

5,195 changes: 0 additions & 5,195 deletions dist/bilibili-live-tasks-helper.user.js

This file was deleted.

1,444 changes: 741 additions & 703 deletions package-lock.json

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bilibili-live-tasks-helper",
"private": true,
"version": "7.1.3",
"version": "7.1.4",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -24,21 +24,21 @@
"vue": "^3.2.47"
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.2.0",
"@types/crypto-js": "^4.1.1",
"@types/luxon": "^3.3.0",
"@vitejs/plugin-vue": "^5.0.3",
"@rushstack/eslint-patch": "^1.10.1",
"@types/crypto-js": "^4.2.2",
"@types/luxon": "^3.4.2",
"@vitejs/plugin-vue": "^5.0.4",
"@vue/eslint-config-prettier": "^9.0.0",
"@vue/eslint-config-typescript": "^12.0.0",
"@vue/eslint-config-typescript": "^13.0.0",
"@vue/tsconfig": "^0.5.1",
"eslint": "^8.39.0",
"eslint-plugin-vue": "^9.11.0",
"prettier": "^3.0.0",
"svgo": "^3.0.2",
"terser": "^5.18.2",
"typescript": "^5.0.4",
"vite": "^5.0.11",
"vite-plugin-monkey": "^3.5.0",
"vue-tsc": "^1.6.4"
"eslint": "^8.57.0",
"eslint-plugin-vue": "^9.24.0",
"prettier": "^3.2.5",
"svgo": "^3.2.0",
"terser": "^5.30.3",
"typescript": "^5.4.4",
"vite": "^5.2.8",
"vite-plugin-monkey": "^3.5.2",
"vue-tsc": "^2.0.10"
}
}
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ let button: HTMLButtonElement
* 设置控制面板的大小和位置
*/
function setPanelSize() {
const rect: DOMRect = (livePlayer as Element).getBoundingClientRect()
const rect: DOMRect = livePlayer!.getBoundingClientRect()
uiStore.baseStyleValue.top = rect.top + window.scrollY
uiStore.baseStyleValue.left = rect.left + window.scrollX
Expand Down
29 changes: 16 additions & 13 deletions src/components/LiveTasks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Edit, Delete } from '@element-plus/icons-vue'
import { ElMessage, ElMessageBox, ElTable } from 'element-plus'
import { useBiliStore } from '../stores/useBiliStore'
interface ImedalInfoRow {
interface MedalInfoRow {
avatar: string
nick_name: string
medal_name: string
Expand Down Expand Up @@ -67,7 +67,7 @@ const handleAddDanmu = () => {
}
const medalInfoPanelVisible = ref<boolean>(false)
const medalInfoTableData = computed<ImedalInfoRow[] | undefined>(() =>
const medalInfoTableData = computed<MedalInfoRow[] | undefined>(() =>
biliStore.filteredFansMedals?.map((medal) => ({
avatar: medal.anchor_info.avatar,
nick_name: medal.anchor_info.nick_name,
Expand All @@ -90,14 +90,17 @@ const handleEditList = () => {
if (!biliStore.fansMedals) {
medalInfoLoading.value = true
// 等待数据被获取到
const unwatch = watch(medalInfoTableData, (newData) => {
if (newData) {
unwatch()
firstClickEditList = false
initSelection(medalInfoTableData.value)
medalInfoLoading.value = false
const unwatch = watch(
() => medalInfoTableData.value,
(newData) => {
if (newData) {
unwatch()
firstClickEditList = false
initSelection(newData)
medalInfoLoading.value = false
}
}
})
)
// 利用 emitter 通知 FansMedals 模块去获取数据
moduleStore.emitter.emit('Default_FansMedals', {
module: 'LiveTasks'
Expand All @@ -112,16 +115,16 @@ const medalInfoTableRef = ref<InstanceType<typeof ElTable>>()
/** 是否锁住配置 */
let lockConfig = false
/** 初始化多选框选择状态 */
const initSelection = (rows?: ImedalInfoRow[]) => {
const initSelection = (rows?: MedalInfoRow[]) => {
lockConfig = true
if (rows) {
// 如果直接使用 medalInfoTableRef.value,medalInfoTableRef.value 可能为 undefined
const unwatch = watch(
() => medalInfoTableRef.value,
(newValue) => {
// unwatch 可能还未初始化,延迟到下一个空闲时间点执行
setTimeout(() => unwatch(), 0)
if (newValue) {
// unwatch 可能还未初始化,延迟到下一个空闲时间点执行
setTimeout(() => unwatch(), 0)
config.medalTasks.roomidList.forEach((roomid) =>
newValue.toggleRowSelection(
rows.find((row) => row.roomid === roomid),
Expand All @@ -135,7 +138,7 @@ const initSelection = (rows?: ImedalInfoRow[]) => {
}
lockConfig = false
}
function handleSelectionChange(selectedRows: ImedalInfoRow[]) {
function handleSelectionChange(selectedRows: MedalInfoRow[]) {
if (!lockConfig) {
config.medalTasks.roomidList = selectedRows.map((row) => row.roomid)
}
Expand Down
8 changes: 4 additions & 4 deletions src/components/PanelAside.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ import { useUIStore } from '../stores/useUIStore'
const uiStore = useUIStore()
interface menuItem {
interface MenuItem {
icon: string
title: string
index: string
subs?: subMenuItem[]
subs?: SubMenuItem[]
}
interface subMenuItem {
interface SubMenuItem {
title: string
index: string
}
const items: menuItem[] = [
const items: MenuItem[] = [
{
icon: 'Tasks',
title: '每日任务',
Expand Down
51 changes: 51 additions & 0 deletions src/components/RemoveElement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ const config = moduleStore.moduleConfig.RemoveElement
<Info id="RemoveElement.removeShopPopover" />
</el-space>
</el-row>
<el-row>
<el-space wrap>
<el-switch v-model="config.removeGameParty.enabled" active-text="移除直播间幻星派对标志" />
<Info id="RemoveElement.removeGameParty" />
</el-space>
</el-row>
<el-row>
<el-space wrap>
<el-switch v-model="config.removeGiftPopover.enabled" active-text="移除礼物赠送提示弹窗" />
Expand All @@ -46,6 +52,51 @@ const config = moduleStore.moduleConfig.RemoveElement
<Info id="RemoveElement.removeComboCard" />
</el-space>
</el-row>
<el-row>
<el-space wrap>
<el-switch v-model="config.removeRank.enabled" active-text="移除排行榜" />
<Info id="RemoveElement.removeRank" />
</el-space>
</el-row>
<el-row>
<el-space wrap>
<el-switch v-model="config.removeGiftPlanet.enabled" active-text="移除礼物星球" />
<Info id="RemoveElement.removeGiftPlanet" />
</el-space>
</el-row>
<el-row>
<el-space wrap>
<el-switch v-model="config.removeActivityBanner.enabled" active-text="移除活动入口" />
<Info id="RemoveElement.removeActivityBanner" />
</el-space>
</el-row>
<el-row>
<el-space wrap>
<el-switch v-model="config.removePKBanner.enabled" active-text="移除大乱斗入口" />
<Info id="RemoveElement.removePKBanner" />
</el-space>
</el-row>
<el-row>
<el-space wrap>
<el-switch v-model="config.removeFlipView.enabled" active-text="移除礼物栏下方广告" />
<Info id="RemoveElement.removeFlipView" />
</el-space>
</el-row>
<el-row>
<el-space wrap>
<el-switch
v-model="config.removeRecommendRoom.enabled"
active-text="移除礼物栏下方推荐直播间"
/>
<Info id="RemoveElement.removeRecommendRoom" />
</el-space>
</el-row>
<el-row>
<el-space wrap>
<el-switch v-model="config.removeLiveMosaic.enabled" active-text="移除直播间马赛克" />
<Info id="RemoveElement.removeLiveMosaic" />
</el-space>
</el-row>
<el-divider />
</div>
</template>
4 changes: 2 additions & 2 deletions src/components/icons/InfoIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { ElMessageBox } from 'element-plus'
import help_info from '../../library/help-info'
import _ from 'lodash'
import { IhelpInfoItem } from '../../types'
import { HelpInfoItem } from '../../types'
const props = defineProps<{
id: string
Expand All @@ -12,7 +12,7 @@ const props = defineProps<{
* 显示提示弹窗
*/
const open = () => {
const { title, message }: IhelpInfoItem = _.get(help_info, props.id, {
const { title, message }: HelpInfoItem = _.get(help_info, props.id, {
title: '',
message: ''
})
Expand Down
4 changes: 2 additions & 2 deletions src/components/icons/TaskStatusIcon.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script setup lang="ts">
import { moduleStatus } from '../../types/module'
import { ModuleStatusTypes } from '../../types/module'
defineProps<{
status: moduleStatus
status: ModuleStatusTypes
}>()
</script>

Expand Down
7 changes: 4 additions & 3 deletions src/library/bili-api/api.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Request from '../request'
import { Live, LiveTrace, Main, Vc } from './response'

interface Irequests {
interface Requests {
live: Request
liveTrace: Request
passport: Request
Expand All @@ -10,7 +10,7 @@ interface Irequests {
raw: Request
}

interface IbapiMethods {
interface BapiMethods {
live: {
roomGiftConfig: (
room_id?: number,
Expand Down Expand Up @@ -122,6 +122,7 @@ interface IbapiMethods {
vip: {
myPrivilege: () => Promise<Main.Vip.MyPrivilege>
receivePrivilege: (type: number, platform?: string) => Promise<Main.Vip.ReceivePrivilege>
addExperience: () => Promise<Main.Vip.AddExperience>
}
}
vc: {
Expand All @@ -130,4 +131,4 @@ interface IbapiMethods {
}
}

export { Irequests, IbapiMethods }
export { Requests as Irequests, BapiMethods as IbapiMethods }
19 changes: 19 additions & 0 deletions src/library/bili-api/data.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1511,6 +1511,13 @@ declare namespace MainData {
list: List[]
is_short_vip: boolean
is_freight_open: boolean
level: number
cur_exp: number
next_exp: number
is_vip: boolean
is_senior_member: number
format060102: number
is_overdue_vip: boolean
}

interface List {
Expand All @@ -1520,6 +1527,18 @@ declare namespace MainData {
vip_type: number
next_receive_days: number
period_end_unix: number
is_count: boolean
name: string
coupon_code: string
app_describe: string
recive_state: number
salary_type: number
}
}
namespace AddExperience {
interface Data {
type: number
is_grant: boolean
}
}
}
Expand Down
Loading

0 comments on commit 5a4c3dc

Please sign in to comment.