Skip to content

Commit

Permalink
⚡️ 帖子解析&祈愿记录微调
Browse files Browse the repository at this point in the history
*优化链接样式
*饼图加上集录祈愿
*祈愿刷新后刷新页面
  • Loading branch information
BTMuli committed Mar 17, 2024
1 parent 2f32f4e commit 2b227ea
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
4 changes: 4 additions & 0 deletions src/components/gachaRecord/gro-echarts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ function getPoolData(): EChartsOption {
value: props.modelValue.filter((item) => item.uigfType === "302").length,
name: "武器活动祈愿",
},
{
value: props.modelValue.filter((item) => item.uigfType === "500").length,
name: "集录祈愿",
},
];
data.series[1].data = [
{ value: props.modelValue.filter((item) => item.rank === "3").length, name: "3星" },
Expand Down
18 changes: 9 additions & 9 deletions src/components/post/tp-text.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<template>
<span
<div
v-if="mode == 'link'"
class="tp-text-link"
@click="toLink()"
:title="props.data.attributes?.link"
:style="getTextStyle()"
>
<v-icon size="small">mdi-link-variant</v-icon>{{ props.data.insert }}
</span>
<v-icon size="small">mdi-link-variant</v-icon>
<span>{{ props.data.insert }}</span>
</div>
<span v-else-if="mode == 'emoji'" class="tp-text-emoji">
<img :src="getEmojiUrl()" :alt="getEmojiName()" :title="getEmojiName()" />
</span>
Expand Down Expand Up @@ -102,12 +104,9 @@ function getTextStyle(): StyleValue {
const style = <Array<StyleValue>>[];
let data: TpText;
if (props.data.insert === "\n") {
if (props.data.attributes?.align || props.data.attributes?.header) {
return "display: none";
}
return "display: inline";
}
if (props.next?.insert === "\n") {
if (typeof props.next?.insert === "string" && props.next.insert.includes("\n")) {
data = {
insert: props.data.insert,
attributes: {
Expand All @@ -134,7 +133,8 @@ function getTextStyle(): StyleValue {
}
if (data.attributes.align) {
const ruleAlign: StyleValue = `textAlign: ${data.attributes.align}`;
style.push(ruleAlign);
if (data.attributes.align !== "center") style.push("display: inline");
else style.push(ruleAlign);
}
if (data.attributes.header) {
const ruleHeader: StyleValue = `fontSize: ${headerFontSizes[data.attributes.header - 1]}`;
Expand Down Expand Up @@ -211,7 +211,7 @@ function getEmojiName() {
</script>
<style lang="css" scoped>
.tp-text-link {
display: inline-flex;
display: flex;
align-items: center;
justify-content: center;
color: #00c3ff;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/User/Gacha.vue
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ async function confirmRefresh(force: boolean = false): Promise<void> {
}, 1000);
});
await TGLogger.Info(`[UserGacha][${account.gameUid}][confirmRefresh] 刷新祈愿数据完成`);
// window.location.reload();
window.location.reload();
}
// 获取祈愿数据并写入数据库
Expand Down

0 comments on commit 2b227ea

Please sign in to comment.