Skip to content

Commit

Permalink
change: 变更README.md说明文档
Browse files Browse the repository at this point in the history
add: 新增标识金额设置
add: 新增点击赞助者跳转对应爱发电页面
fix: 修复赞助者名称超长后鼠标移动无法显示完整名称
  • Loading branch information
carolcoral committed May 29, 2024
1 parent af456b5 commit cde558b
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 211 deletions.
216 changes: 12 additions & 204 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=1.2.1
version=1.3.0
5 changes: 5 additions & 0 deletions src/main/java/site/xindu/afdian/config/BaseSettingConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,9 @@ public class BaseSettingConfig {
*/
private String sponsorUrl = "";

/**
* 切换赞助金额显示颜色值
*/
private Double sponsorNumber = 66.00;

}
5 changes: 5 additions & 0 deletions src/main/java/site/xindu/afdian/service/AfdianRouter.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ Mono<ServerResponse> renderPage(ServerRequest request) {
)
.defaultIfEmpty("https://afdian.net/a/carolcoral");
model.put("sponsorUrl", sponsorUrl);
Mono<Double> sponsorNumber = this.settingFetcher.get("basic").map(setting ->
setting.get("sponsorNumber").asDouble(66.0)
)
.defaultIfEmpty(66.0);
model.put("sponsorNumber", sponsorNumber);
log.info(model.toString());
return templateNameResolver.resolveTemplateNameOrDefault(request.exchange(), "afdian")
.flatMap(templateName -> ServerResponse.ok().render(templateName, model));
Expand Down
11 changes: 10 additions & 1 deletion src/main/resources/extensions/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,23 @@ spec:
name: token
label: 用户token
placeholder: 请输入用户TOKEN
validation: required
help: 启用后必填,在 https://afdian.net/dashboard/dev 中 API TOKEN 获取
- $formkit: text
name: userId
label: 用户ID
placeholder: 请输入用户ID
validation: required
help: 启用后必填,在 https://afdian.net/dashboard/dev 中 user_id 获取
- $formkit: text
name: sponsorUrl
label: 赞助地址
placeholder: 请输入跳转赞助地址
help: 启用后必填,否则爱发电页面可能会报错
validation: required
help: 启用后必填,否则爱发电页面可能会报错
- $formkit: text
name: sponsorNumber
label: 切换赞助金额显示颜色值
value: 66
placeholder: 请输入需要切换颜色的赞助金额限制
help: 非必填,默认切换赞助金额颜色的金额值为 66
4 changes: 3 additions & 1 deletion src/main/resources/static/afdian.min.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
--style-border: 1px solid var(--heo-card-border);
--style-border-always: 1px solid var(--heo-card-border);
--heo-radius-full: 50px;
--heo-vip: #e5a80d;
}


[data-theme=light] {
--heo-fontcolor: #363636;
--heo-card-bg: #fff;
--heo-card-border: #e3e8f7;
--heo-vip: #e5a80d;
}


Expand Down Expand Up @@ -164,6 +166,7 @@ html {
position: relative;
padding: 1rem 2rem;
overflow: hidden;
opacity: 0.9;
}

.author-content-item.single {
Expand Down Expand Up @@ -537,4 +540,3 @@ html {
color: #FFFFFF;
white-space: nowrap;
}

11 changes: 7 additions & 4 deletions src/main/resources/templates/afdian.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@
</div>
</div>
<div class="reward-list-all">
<div class="reward-list-item"
th:each="sponsor : ${afdianFinder.listAllSponsor().data.list}">
<div class="reward-list-item" th:each="sponsor : ${afdianFinder.listAllSponsor().data.list}" th:attr="onclick=|sponsorSelf('https://afdian.net/u/'+'${sponsor.user.user_id}')|">
<div>
<div>
<div class="reward-list-item-avatar">
Expand All @@ -95,11 +94,15 @@
data-ll-status="loading">
</div>
<div style="z-index:20;float: left;" class="reward-list-item-avatar-group">
<div class="reward-list-item-name" th:text="${sponsor.user.name}"></div>
<div class="reward-list-item-name" th:text="${sponsor.user.name}" th:attr="title=${sponsor.user.name}"></div>
</div>
</div>
<div class="reward-list-bottom-group">
<div class="reward-list-item-money">
<div th:if="${#conversions.convert(sponsor.all_sum_amount, 'java.math.BigDecimal') < #conversions.convert(sponsorNumber, 'java.math.BigDecimal')}" class="reward-list-item-money">
¥ <b th:text="${sponsor.all_sum_amount}"></b>
</div>
<div th:if="${#conversions.convert(sponsor.all_sum_amount, 'java.math.BigDecimal') >= #conversions.convert(sponsorNumber, 'java.math.BigDecimal')}" class="reward-list-item-money"
style="background: var(--heo-vip);">
¥ <b th:text="${sponsor.all_sum_amount}"></b>
</div>
<time class="datatime reward-list-item-time"
Expand Down

0 comments on commit cde558b

Please sign in to comment.