Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Commit

Permalink
Merge branch 'refs/heads/dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
wgh136 committed Sep 5, 2024
2 parents eac4a55 + 01c4300 commit 5af9ce0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/components/select.dart
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ class OptionChip extends StatelessWidget {
? context.colorScheme.primaryContainer
: context.colorScheme.surface,
border: isSelected
? Border.all(color: Colors.transparent)
? Border.all(color: context.colorScheme.primaryContainer)
: Border.all(color: context.colorScheme.outline),
borderRadius: BorderRadius.circular(8),
),
Expand Down
10 changes: 8 additions & 2 deletions lib/network/eh_network/eh_main_network.dart
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,14 @@ class EhNetwork {
.elementAtOrNull(0)
?.text ??
"未知";
var time = e.getElementsByClassName("c3")[0].text.subStringOrNull(11, 32) ??
"Unknown";
var time = e.getElementsByClassName("c3").elementAtOrNull(0)
?.text
.split('Posted on')
.elementAtOrNull(1)
?.split('by')
.elementAtOrNull(0)
?.trim()
?? 'unknown';
var content = e.getElementsByClassName("c6")[0].text;
var score = int.parse(e.querySelector("div.c5 > span")?.text ?? '0');
var id = e.previousElementSibling?.attributes['name']?.nums ?? "0";
Expand Down
14 changes: 9 additions & 5 deletions lib/pages/ehentai/eh_comments_page.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:html/dom.dart' as dom;
import 'package:html/parser.dart' as html_parser;
import 'package:pica_comic/comic_source/built_in/ehentai.dart';
import 'package:pica_comic/components/components.dart';
import 'package:pica_comic/foundation/app.dart';
import 'package:pica_comic/foundation/image_loader/cached_image.dart';
import 'package:pica_comic/network/eh_network/eh_main_network.dart';
import 'package:pica_comic/network/eh_network/eh_models.dart';
Expand All @@ -10,9 +13,6 @@ import 'package:pica_comic/tools/extensions.dart';
import 'package:pica_comic/tools/time.dart';
import 'package:pica_comic/tools/translations.dart';
import 'package:url_launcher/url_launcher_string.dart';
import 'package:pica_comic/foundation/app.dart';
import 'package:html/parser.dart' as html_parser;
import 'package:pica_comic/components/components.dart';

class CommentsPageLogic extends StateController {
bool isLoading = true;
Expand Down Expand Up @@ -118,10 +118,14 @@ class _EhCommentWidgetState extends State<_EhCommentWidget> {
downColor = darkMode ? Colors.blue.shade200 : Colors.blue.shade600;
}

var isUploader = uploader == comment.name;

return Card(
margin: const EdgeInsets.fromLTRB(12, 4, 12, 4),
elevation: 0,
color: Theme.of(context).colorScheme.surfaceContainer,
color: isUploader
? Theme.of(context).colorScheme.primaryContainer
: Theme.of(context).colorScheme.surfaceContainer,
child: Padding(
padding: const EdgeInsets.fromLTRB(12, 8, 12, 8),
child: Column(
Expand All @@ -130,7 +134,7 @@ class _EhCommentWidgetState extends State<_EhCommentWidget> {
Row(
children: [
Text(
"${uploader == comment.name ? "(上传者)" : ""}${comment.name}",
"${isUploader ? "(上传者)" : ""}${comment.name}",
style: const TextStyle(
fontSize: 16, fontWeight: FontWeight.w500),
),
Expand Down

0 comments on commit 5af9ce0

Please sign in to comment.