Skip to content

Commit

Permalink
补充ReadMe
Browse files Browse the repository at this point in the history
  • Loading branch information
OToNaShiAKi committed Jun 28, 2022
1 parent b3b449b commit 9bbb8f3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

### 选择房间界面

支持添加、单选或多选房间。并配置直播间弹幕颜色和位置模式。
支持添加、单选或多选房间。并配置直播间弹幕颜色和位置模式,以及可更换当前使用的粉丝牌

多选情况可用于联动,会将同传弹幕发在多个直播间。

Expand Down
14 changes: 8 additions & 6 deletions src/pages/main/views/Room.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,7 @@
提交
</v-btn>
</section>
<v-chip-group
column
color="primary"
@change="change"
:value="medals[0] && medals[0].value"
>
<v-chip-group column color="primary" @change="change" v-model="medal">
<v-chip v-for="v of medals" outlined :value="v.value" :key="v.value">
{{ v.medal_name }}
</v-chip>
Expand All @@ -92,6 +87,7 @@ export default {
id: "",
modes: { "": { colors: [], modes: [] } },
medals: [],
medal: null,
}),
computed: {
...mapState(["rooms"]),
Expand All @@ -109,6 +105,12 @@ export default {
for (const item of modes) this.modes[item.roomid] = item;
const uid = this.$store.state.cookie.match(/DedeUserID=([^;]+);/);
this.medals = await ipcRenderer.invoke("MedalWall", uid[1]);
for (const item of this.medals) {
if (item.wearing_status) {
this.medal = item.value;
break;
}
}
},
methods: {
...mapMutations(["ChangeSelect", "ChangeRooms", "Notify"]),
Expand Down
11 changes: 5 additions & 6 deletions src/plugins/axios.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,12 +379,11 @@ export const MedalWall = async (event, target_id) => {
const { list } = await Bilibili.get("/xlive/web-ucenter/user/MedalWall", {
params: { target_id },
});
return list
.sort((a, b) => b.wearing_status - a.wearing_status)
.map(({ medal_info }) => ({
value: medal_info.medal_id,
medal_name: medal_info.medal_name,
}));
return list.map(({ medal_info }) => ({
value: medal_info.medal_id,
medal_name: medal_info.medal_name,
wearing_status: medal_info.wearing_status,
}));
} catch (error) {
return [];
}
Expand Down

0 comments on commit 9bbb8f3

Please sign in to comment.