mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-24 01:58:36 +00:00
@@ -73,6 +73,12 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
},
|
||||
onLongPress: () {
|
||||
feedBack();
|
||||
// showDialog(
|
||||
// context: context,
|
||||
// builder: (context) => AlertDialog(
|
||||
// content: SelectableText(jsonEncode(replyItem.toProto3Json())),
|
||||
// ),
|
||||
// );
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
useSafeArea: true,
|
||||
@@ -113,6 +119,17 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
Positioned(
|
||||
top: 8,
|
||||
right: 12,
|
||||
// child: GestureDetector(
|
||||
// onTap: replyItem.member.garbCardJumpUrl.isNotEmpty
|
||||
// ? () {
|
||||
// Get.toNamed(
|
||||
// 'webview',
|
||||
// parameters: {
|
||||
// 'url': replyItem.member.garbCardJumpUrl
|
||||
// },
|
||||
// );
|
||||
// }
|
||||
// : null,
|
||||
child: Stack(
|
||||
alignment: Alignment.centerRight,
|
||||
children: [
|
||||
@@ -139,6 +156,7 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
// ),
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
child: _buildAuthorPanel(context),
|
||||
@@ -175,11 +193,12 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
/// fix Stack内GestureDetector onTap无效
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
lfAvtar(),
|
||||
const SizedBox(width: 12),
|
||||
Column(
|
||||
@@ -312,8 +331,9 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
if (replyLevel != '') buttonAction(context, replyItem.replyControl),
|
||||
// 一楼的评论
|
||||
if (replyLevel == '1' &&
|
||||
(replyItem.replies.isNotEmpty ||
|
||||
replyItem.replyControl.subReplyEntryText.isNotEmpty)) ...[
|
||||
( //replyItem.replyControl!.isShow! ||
|
||||
replyItem.replies.isNotEmpty ||
|
||||
replyItem.replyControl.subReplyEntryText.isNotEmpty)) ...[
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 5, bottom: 12),
|
||||
child: replyItemRow(
|
||||
@@ -597,15 +617,19 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
var position = textPainter.getPositionForOffset(
|
||||
Offset(
|
||||
textSize.width,
|
||||
maxHeight,
|
||||
maxHeight, // textSize.height,
|
||||
),
|
||||
);
|
||||
// final endOffset = textPainter.getOffsetBefore(position.offset);
|
||||
message = message.substring(0, position.offset);
|
||||
}
|
||||
|
||||
// return TextSpan(text: message);
|
||||
|
||||
// 投票
|
||||
if (content.hasVote()) {
|
||||
message.splitMapJoin(RegExp(r"\{vote:\d+?\}"), onMatch: (Match match) {
|
||||
// String matchStr = match[0]!;
|
||||
spanChildren.add(
|
||||
TextSpan(
|
||||
text: '投票: ${content.vote.title}',
|
||||
@@ -631,7 +655,12 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
message = message.replaceAll(RegExp(r"\{vote:\d+?\}"), "");
|
||||
}
|
||||
message = parse(message).body?.text ?? message;
|
||||
|
||||
// .replaceAll('&', '&')
|
||||
// .replaceAll('<', '<')
|
||||
// .replaceAll('>', '>')
|
||||
// .replaceAll('"', '"')
|
||||
// .replaceAll(''', "'")
|
||||
// .replaceAll(' ', ' ');
|
||||
// 构建正则表达式
|
||||
final List<String> specialTokens = [
|
||||
...content.emote.keys,
|
||||
@@ -657,6 +686,12 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
spanChildren.add(TextSpan(
|
||||
text: str,
|
||||
));
|
||||
// TextSpan(
|
||||
//
|
||||
// text: str,
|
||||
// recognizer: TapGestureRecognizer()
|
||||
// ..onTap = () => replyReply
|
||||
// ?.call(replyItem.root == 0 ? replyItem : fReplyItem)))));
|
||||
}
|
||||
|
||||
late final bool enableWordRe =
|
||||
@@ -965,6 +1000,7 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
}
|
||||
// spanChildren.add(TextSpan(text: matchMember));
|
||||
return TextSpan(children: spanChildren);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ class ZanButtonGrpc extends StatefulWidget {
|
||||
class _ZanButtonGrpcState extends State<ZanButtonGrpc> {
|
||||
Future onHateReply() async {
|
||||
feedBack();
|
||||
// SmartDialog.showLoading(msg: 'piliplus ...');
|
||||
final int oid = widget.replyItem.oid.toInt();
|
||||
final int rpid = widget.replyItem.id.toInt();
|
||||
// 1 已点赞 2 不喜欢 0 未操作
|
||||
@@ -45,6 +46,7 @@ class _ZanButtonGrpcState extends State<ZanButtonGrpc> {
|
||||
}
|
||||
widget.replyItem.replyControl.action = $fixnum.Int64(2);
|
||||
} else {
|
||||
// replyItem.like = replyItem.like! - 1;
|
||||
widget.replyItem.replyControl.action = $fixnum.Int64(0);
|
||||
}
|
||||
setState(() {});
|
||||
@@ -56,6 +58,7 @@ class _ZanButtonGrpcState extends State<ZanButtonGrpc> {
|
||||
// 评论点赞
|
||||
Future onLikeReply() async {
|
||||
feedBack();
|
||||
// SmartDialog.showLoading(msg: 'piliplus ...');
|
||||
final int oid = widget.replyItem.oid.toInt();
|
||||
final int rpid = widget.replyItem.id.toInt();
|
||||
// 1 已点赞 2 不喜欢 0 未操作
|
||||
@@ -67,6 +70,7 @@ class _ZanButtonGrpcState extends State<ZanButtonGrpc> {
|
||||
rpid: rpid,
|
||||
action: action,
|
||||
);
|
||||
// SmartDialog.dismiss();
|
||||
if (res['status']) {
|
||||
SmartDialog.showToast(
|
||||
widget.replyItem.replyControl.action.toInt() != 1 ? '点赞成功' : '取消赞');
|
||||
|
||||
Reference in New Issue
Block a user