feat: 支持当日盈亏显示与账户盈亏汇总#61
Merged
Merged
Conversation
added 2 commits
March 17, 2026 16:53
- 状态栏展示每只持仓股票的当日盈亏 [+xxx] - 新增账户当日盈亏汇总状态栏项(今日:+xxx) - 悬浮提示区分展示当日盈亏与持仓盈亏 - 优化持仓判断逻辑,仅 hold_number > 0 时显示 - 更新 README 和 CHANGELOG 文档
- provider.ts: price=0时updown返回0,避免未开盘时涨跌额异常 - render.ts: price=0时使用yestclose计算持仓盈亏,避免持仓盈亏异常
Owner
|
感谢你的 PR!麻烦在提交前移除一下编译后的产物文件:
|
Contributor
Author
|
已移除 |
Chef5
reviewed
Mar 18, 2026
| const pnl = Math.round(stock.updown * stock.hold_number); | ||
| totalDailyPnL += pnl; | ||
| const pnlStr = pnl > 0 ? `+${pnl}` : `${pnl}`; | ||
| details.push(`${stock.alias ?? stock.name}:${pnlStr}`); |
Owner
There was a problem hiding this comment.
这里的汇总当日盈亏文案,当alias配置为“”时,无法展示,因此建议调整为 ||
Contributor
Author
|
已按建议修改
请再审阅~ |
Chef5
approved these changes
Mar 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
功能说明
新增当日盈亏计算功能,根据持仓数量和当日涨跌额自动计算并展示盈亏信息。
新增功能
平安 12.50 +1.25% [+250]今日:+xxx,汇总所有持仓股票的当日盈亏计算公式
显示条件
hold_number > 0时显示盈亏相关信息改动文件
src/render.ts:核心渲染逻辑README.md:更新股票配置说明CHANGELOG.md:新增 v1.0.12 变更记录