From ec58fbc3cc2d91cb2d1eac7a5549857af28f7bb3 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Wed, 3 Jan 2024 23:53:44 +0800 Subject: [PATCH 1/2] =?UTF-8?q?mod:=20web=E7=AB=AF=E6=8E=A8=E8=8D=90?= =?UTF-8?q?=E8=A7=82=E7=9C=8B=E6=95=B0=E5=8D=95=E4=BD=8D=E8=BD=AC=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/models/model_rec_video_item.dart | 4 ++-- lib/models/model_rec_video_item.g.dart | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/models/model_rec_video_item.dart b/lib/models/model_rec_video_item.dart index f857c70f..bd42fd82 100644 --- a/lib/models/model_rec_video_item.dart +++ b/lib/models/model_rec_video_item.dart @@ -77,14 +77,14 @@ class Stat { this.danmu, }); @HiveField(0) - int? view; + String? view; @HiveField(1) int? like; @HiveField(2) int? danmu; Stat.fromJson(Map json) { - view = json["view"]; + view = Utils.numFormat(json["view"]); like = json["like"]; danmu = json['danmaku']; } diff --git a/lib/models/model_rec_video_item.g.dart b/lib/models/model_rec_video_item.g.dart index 99f096c2..1de6ab03 100644 --- a/lib/models/model_rec_video_item.g.dart +++ b/lib/models/model_rec_video_item.g.dart @@ -87,7 +87,7 @@ class StatAdapter extends TypeAdapter { for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), }; return Stat( - view: fields[0] as int?, + view: fields[0] as String?, like: fields[1] as int?, danmu: fields[2] as int?, ); From 483f02c7d2b533dd6476bf8736eca26024ba7573 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Thu, 4 Jan 2024 00:08:42 +0800 Subject: [PATCH 2/2] =?UTF-8?q?mod:=20=E5=8A=A8=E6=80=81=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8A=95=E7=A8=BF=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dynamics/widgets/rich_node_panel.dart | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/lib/pages/dynamics/widgets/rich_node_panel.dart b/lib/pages/dynamics/widgets/rich_node_panel.dart index 8b7dcd69..8f744dd5 100644 --- a/lib/pages/dynamics/widgets/rich_node_panel.dart +++ b/lib/pages/dynamics/widgets/rich_node_panel.dart @@ -1,6 +1,8 @@ import 'package:flutter/material.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:get/get.dart'; import 'package:pilipala/common/widgets/network_img_layer.dart'; +import 'package:pilipala/http/search.dart'; // 富文本 InlineSpan richNode(item, context) { @@ -191,6 +193,39 @@ InlineSpan richNode(item, context) { ), ); } + // 投稿 + if (i.type == 'RICH_TEXT_NODE_TYPE_BV') { + spanChilds.add( + WidgetSpan( + alignment: PlaceholderAlignment.middle, + child: Icon( + Icons.play_circle_outline_outlined, + size: 16, + color: Theme.of(context).colorScheme.primary, + ), + ), + ); + spanChilds.add( + WidgetSpan( + alignment: PlaceholderAlignment.middle, + child: GestureDetector( + onTap: () async { + try { + int cid = await SearchHttp.ab2c(bvid: i.rid); + Get.toNamed('/video?bvid=${i.rid}&cid=$cid', + arguments: {'pic': null, 'heroTag': i.rid}); + } catch (err) { + SmartDialog.showToast(err.toString()); + } + }, + child: Text( + '${i.text} ', + style: authorStyle, + ), + ), + ), + ); + } } // if (contentType == 'major' && // item.modules.moduleDynamic.major.opus.pics.isNotEmpty) {