评论数据渲染

This commit is contained in:
guozhigq
2023-04-23 15:50:51 +08:00
parent 2fd1cc422b
commit a0441aa589
20 changed files with 525 additions and 3 deletions

View File

@ -0,0 +1,17 @@
class ReplyConfig {
ReplyConfig({
this.showtopic,
this.showUpFlag,
this.readOnly,
});
int? showtopic;
bool? showUpFlag;
bool? readOnly;
ReplyConfig.fromJson(Map<String, dynamic> json) {
showtopic = json['showtopic'];
showUpFlag = json['show_up_flag'];
readOnly = json['read_only'];
}
}

View File

@ -0,0 +1,23 @@
class ReplyContent {
ReplyContent({
this.message,
this.atNameToMid, // @的用户的mid
this.memebers, // 被@的用户List 如果有的话
this.emote, // 表情包 如果有的话
this.jumpUrl,
});
String? message;
Map? atNameToMid;
List? memebers;
Map? emote;
Map? jumpUrl;
ReplyContent.fromJson(Map<String, dynamic> json) {
message = json['message'];
atNameToMid = json['at_name_to_mid'];
memebers = json['memebers'];
emote = json['emote'];
jumpUrl = json['jumpUrl'];
}
}

View File

@ -0,0 +1,34 @@
import 'package:pilipala/models/video/reply/item.dart';
import 'config.dart';
import 'page.dart';
import 'upper.dart';
class ReplyData {
ReplyData({
this.page,
this.config,
this.replies,
this.topReplies,
this.upper,
});
ReplyPage? page;
ReplyConfig? config;
late List? replies;
late List? topReplies;
ReplyUpper? upper;
ReplyData.fromJson(Map<String, dynamic> json) {
page = ReplyPage.fromJson(json['page']);
config = ReplyConfig.fromJson(json['config']);
replies =
json['replies'].map((item) => ReplyItemModel.fromJson(item)).toList();
topReplies = json['top_replies'] != null
? json['top_replies']
.map((item) => ReplyItemModel.fromJson(item))
.toList()
: [];
upper = ReplyUpper.fromJson(json['upper']);
}
}

View File

@ -0,0 +1,125 @@
import 'content.dart';
import 'member.dart';
class ReplyItemModel {
ReplyItemModel({
this.rpid,
this.oid,
this.type,
this.mid,
this.root,
this.parent,
this.dialog,
this.count,
this.floor,
this.state,
this.fansgrade,
this.attr,
this.ctime,
this.rpidStr,
this.rootStr,
this.parentStr,
this.like,
this.action,
this.member,
this.content,
this.replies,
this.assist,
this.upAction,
this.invisible,
this.replyControl,
});
int? rpid;
int? oid;
int? type;
int? mid;
int? root;
int? parent;
int? dialog;
int? count;
int? floor;
int? state;
int? fansgrade;
int? attr;
int? ctime;
String? rpidStr;
String? rootStr;
String? parentStr;
int? like;
int? action;
ReplyMember? member;
ReplyContent? content;
List? replies;
int? assist;
UpAction? upAction;
bool? invisible;
ReplyControl? replyControl;
ReplyItemModel.fromJson(Map<String, dynamic> json) {
rpid = json['rpid'];
oid = json['oid'];
type = json['type'];
mid = json['mid'];
root = json['root'];
parent = json['parent'];
dialog = json['dialog'];
count = json['count'];
floor = json['floor'];
state = json['state'];
fansgrade = json['fansgrade'];
attr = json['attr'];
ctime = json['ctime'];
rpidStr = json['rpid_str'];
rootStr = json['root_str'];
parentStr = json['parent_str'];
like = json['like'];
action = json['action'];
member = ReplyMember.fromJson(json['member']);
content = ReplyContent.fromJson(json['content']);
replies = json['replies'];
assist = json['assist'];
upAction = UpAction.fromJson(json['up_action']);
invisible = json['invisible'];
replyControl = ReplyControl.fromJson(json['reply_control']);
}
}
class UpAction {
UpAction({this.like, this.reply});
bool? like;
bool? reply;
UpAction.fromJson(Map<String, dynamic> json) {
like = json['like'];
reply = json['reply'];
}
}
class ReplyControl {
ReplyControl({
this.upReply,
this.isUpTop,
this.entryText,
this.titleText,
this.time,
this.location,
});
bool? upReply;
bool? isUpTop;
String? entryText;
String? titleText;
String? time;
String? location;
ReplyControl.fromJson(Map<String, dynamic> json) {
upReply = json['up_reply'];
isUpTop = json['is_up_top'];
entryText = json['sub_reply_entry_text'];
titleText = json['sub_reply_title_text'];
time = json['time_desc'];
location = json['location'];
}
}

View File

@ -0,0 +1,55 @@
import 'dart:convert' as convert;
class ReplyMember {
ReplyMember({
this.mid,
this.uname,
this.sign,
this.avatar,
this.level,
this.pendant,
this.officialVerify,
this.vip,
this.fansDetail,
});
String? mid;
String? uname;
String? sign;
String? avatar;
int? level;
Pendant? pendant;
Map? officialVerify;
Map? vip;
Map? fansDetail;
ReplyMember.fromJson(Map<String, dynamic> json) {
mid = json['mid'];
uname = json['uname'];
sign = json['sign'];
avatar = json['avatar'];
level = json['level_info']['current_level'];
pendant = Pendant.fromJson(json['pendant']);
officialVerify = json['officia_vVerify'];
vip = json['vip'];
fansDetail = json['fans_detail'];
}
}
class Pendant {
Pendant({
this.pid,
this.name,
this.image,
});
int? pid;
String? name;
String? image;
Pendant.fromJson(Map<String, dynamic> json) {
pid = json['pid'];
name = json['name'];
image = json['image'];
}
}

View File

@ -0,0 +1,20 @@
class ReplyPage {
ReplyPage({
this.num,
this.size,
this.count,
this.acount,
});
int? num;
int? size;
int? count;
int? acount;
ReplyPage.fromJson(Map<String, dynamic> json) {
num = json['num'];
size = json['size'];
count = json['count'];
acount = json['acount'];
}
}

View File

@ -0,0 +1 @@
class ReplyTop {}

View File

@ -0,0 +1,18 @@
import 'item.dart';
class ReplyUpper {
ReplyUpper({
this.mid,
this.top,
});
int? mid;
ReplyItemModel? top;
ReplyUpper.fromJson(Map<String, dynamic> json) {
mid = json['mid'];
top = json['top'] != null
? ReplyItemModel.fromJson(json['top'])
: ReplyItemModel();
}
}