mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-20 17:16:29 +08:00
opt: share article
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'package:PiliPlus/grpc/app/main/community/reply/v1/reply.pb.dart';
|
||||
import 'package:PiliPlus/http/dynamics.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/http/msg.dart';
|
||||
import 'package:PiliPlus/http/user.dart';
|
||||
import 'package:PiliPlus/http/video.dart';
|
||||
import 'package:PiliPlus/models/dynamics/article_content_model.dart'
|
||||
@@ -141,7 +142,7 @@ class ArticleController extends ReplyController<MainListReply> {
|
||||
|
||||
// stats
|
||||
Future _getArticleInfo() async {
|
||||
final res = await DynamicsHttp.articleInfo(cvId: id);
|
||||
final res = await DynamicsHttp.articleInfo(cvId: commentId);
|
||||
if (res['status']) {
|
||||
stats.value = ModuleStatModel(
|
||||
comment: DynamicStat(count: res['data']?['stats']?['reply']),
|
||||
@@ -233,6 +234,19 @@ class ArticleController extends ReplyController<MainListReply> {
|
||||
SmartDialog.showToast(res['msg']);
|
||||
}
|
||||
}
|
||||
|
||||
Future getArticleCover() async {
|
||||
final res = await MsgHttp.feedInfoWeb(articleIds: [commentId]);
|
||||
if (res['status']) {
|
||||
summary.cover = ((res['data']?['article'] as List?)
|
||||
?.firstOrNull?['image_urls'] as List?)
|
||||
?.firstOrNull;
|
||||
// debugPrint('cover: ${summary.cover}');
|
||||
return summary.cover != null;
|
||||
} else {
|
||||
SmartDialog.showToast(res['msg']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class Summary {
|
||||
|
||||
Reference in New Issue
Block a user