提交 d99e0482 authored 作者: yueweilu's avatar yueweilu

讨论 与 笔记 显示审核状态

上级 1bacf432
...@@ -356,6 +356,7 @@ class NoteModel { ...@@ -356,6 +356,7 @@ class NoteModel {
this.noteContent, this.noteContent,
this.color, this.color,
this.chapterName, this.chapterName,
this.isMy,
}); });
NoteModel.fromJson(dynamic json) { NoteModel.fromJson(dynamic json) {
...@@ -368,9 +369,11 @@ class NoteModel { ...@@ -368,9 +369,11 @@ class NoteModel {
noteContent = json['note_content'] != null ? NoteContentModel.fromJson(json['note_content']) : null; noteContent = json['note_content'] != null ? NoteContentModel.fromJson(json['note_content']) : null;
color = json['color']; color = json['color'];
chapterName = json['chapter_name']; chapterName = json['chapter_name'];
isMy = json['is_my'];
} }
num? notesId; num? notesId;
num? types; num? types;
num? isMy;
num? chapterId; num? chapterId;
String? content; String? content;
String? positioning; String? positioning;
...@@ -382,6 +385,7 @@ class NoteModel { ...@@ -382,6 +385,7 @@ class NoteModel {
NoteModel copyWith({ NoteModel copyWith({
num? notesId, num? notesId,
num? types, num? types,
num? isMy,
num? chapterId, num? chapterId,
String? content, String? content,
String? positioning, String? positioning,
...@@ -392,6 +396,7 @@ class NoteModel { ...@@ -392,6 +396,7 @@ class NoteModel {
NoteModel( NoteModel(
notesId: notesId ?? this.notesId, notesId: notesId ?? this.notesId,
types: types ?? this.types, types: types ?? this.types,
isMy: isMy ?? this.isMy,
chapterId: chapterId ?? this.chapterId, chapterId: chapterId ?? this.chapterId,
content: content ?? this.content, content: content ?? this.content,
positioning: positioning ?? this.positioning, positioning: positioning ?? this.positioning,
...@@ -404,6 +409,7 @@ class NoteModel { ...@@ -404,6 +409,7 @@ class NoteModel {
final map = <String, dynamic>{}; final map = <String, dynamic>{};
map['notes_id'] = notesId; map['notes_id'] = notesId;
map['types'] = types; map['types'] = types;
map['is_my'] = isMy;
map['chapter_id'] = chapterId; map['chapter_id'] = chapterId;
map['content'] = content; map['content'] = content;
map['positioning'] = positioning; map['positioning'] = positioning;
...@@ -530,6 +536,7 @@ class DiscussModel { ...@@ -530,6 +536,7 @@ class DiscussModel {
this.personName, this.personName,
this.commentAll, this.commentAll,
this.personPic, this.personPic,
this.isMy,
}); });
DiscussModel.fromJson(dynamic json) { DiscussModel.fromJson(dynamic json) {
...@@ -550,6 +557,8 @@ class DiscussModel { ...@@ -550,6 +557,8 @@ class DiscussModel {
replacePersonPic = json['replace_person_pic']; replacePersonPic = json['replace_person_pic'];
personName = json['person_name']; personName = json['person_name'];
personPic = json['person_pic']; personPic = json['person_pic'];
isMy = json['is_my'];
if (json['comment_all'] != null) { if (json['comment_all'] != null) {
commentAll = []; commentAll = [];
json['comment_all'].forEach((v) { json['comment_all'].forEach((v) {
...@@ -569,6 +578,7 @@ class DiscussModel { ...@@ -569,6 +578,7 @@ class DiscussModel {
num? personId; num? personId;
num? goodNum; num? goodNum;
num? replyNum; num? replyNum;
num? isMy;
String? createTime; String? createTime;
String? replacePersonName; String? replacePersonName;
String? replacePersonPic; String? replacePersonPic;
...@@ -588,6 +598,7 @@ class DiscussModel { ...@@ -588,6 +598,7 @@ class DiscussModel {
num? personId, num? personId,
num? goodNum, num? goodNum,
num? replyNum, num? replyNum,
num? isMy,
String? createTime, String? createTime,
String? replacePersonName, String? replacePersonName,
String? replacePersonPic, String? replacePersonPic,
...@@ -607,6 +618,7 @@ class DiscussModel { ...@@ -607,6 +618,7 @@ class DiscussModel {
personId: personId ?? this.personId, personId: personId ?? this.personId,
goodNum: goodNum ?? this.goodNum, goodNum: goodNum ?? this.goodNum,
replyNum: replyNum ?? this.replyNum, replyNum: replyNum ?? this.replyNum,
isMy: isMy ?? this.isMy,
createTime: createTime ?? this.createTime, createTime: createTime ?? this.createTime,
replacePersonName: replacePersonName ?? this.replacePersonName, replacePersonName: replacePersonName ?? this.replacePersonName,
replacePersonPic: replacePersonPic ?? this.replacePersonPic, replacePersonPic: replacePersonPic ?? this.replacePersonPic,
...@@ -631,6 +643,7 @@ class DiscussModel { ...@@ -631,6 +643,7 @@ class DiscussModel {
map['person_id'] = personId; map['person_id'] = personId;
map['good_num'] = goodNum; map['good_num'] = goodNum;
map['reply_num'] = replyNum; map['reply_num'] = replyNum;
map['is_my'] = isMy;
map['create_time'] = createTime; map['create_time'] = createTime;
map['replace_person_name'] = replacePersonName; map['replace_person_name'] = replacePersonName;
map['replace_person_pic'] = replacePersonPic; map['replace_person_pic'] = replacePersonPic;
......
...@@ -117,7 +117,7 @@ class _BuildDiscussState extends State<BuildDiscuss> { ...@@ -117,7 +117,7 @@ class _BuildDiscussState extends State<BuildDiscuss> {
type ==0? Column( type ==0? Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(model.content?.text?.content??'审核中',style: TextStyle(fontSize: 13.w,height: 1.5,color: Colours.c3),), Text(_showText(model),style: TextStyle(fontSize: 13.w,height: 1.5,color: Colours.c3),),
Gaps.vGaps10, Gaps.vGaps10,
_buildImageGridView() _buildImageGridView()
], ],
...@@ -174,6 +174,40 @@ class _BuildDiscussState extends State<BuildDiscuss> { ...@@ -174,6 +174,40 @@ class _BuildDiscussState extends State<BuildDiscuss> {
); );
} }
String _showText(DiscussModel discussModel){
String text = '';
// 是我的
if(discussModel.isMy == 1){
// 审核中
if(discussModel.content?.text?.privacyStatus ==0 ||discussModel.content?.text?.privacyStatus ==2){
text = '${discussModel.content?.text?.content}(审核中)';
}
// 审核未通过
else if(discussModel.content?.text?.privacyStatus ==-1){
text = '${discussModel.content?.text?.content}(审核未通过)';
}
// 审核通过
else {
text = '${discussModel.content?.text?.content}';
}
}
else {
// 审核中
if(discussModel.content?.text?.privacyStatus ==0 ||discussModel.content?.text?.privacyStatus ==2){
text = '(审核中)';
}
// 审核未通过
else if(discussModel.content?.text?.privacyStatus ==-1){
text = '(审核未通过)';
}
// 审核通过
else {
text = '${discussModel.content?.text?.content}';
}
}
return text;
}
Widget _buildListView(List<DiscussModel> data){ Widget _buildListView(List<DiscussModel> data){
return ListView.builder( return ListView.builder(
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
...@@ -199,7 +233,31 @@ class _BuildDiscussState extends State<BuildDiscuss> { ...@@ -199,7 +233,31 @@ class _BuildDiscussState extends State<BuildDiscuss> {
), ),
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
MediaModel? mediaModel = widget.model.content?.image?[index]; MediaModel? mediaModel = widget.model.content?.image?[index];
return CustomImage.network(url: widget.model?.content?.image?[index].content??'',fit: BoxFit.cover,); return Stack(
children: [
Positioned(
left: 0,
right:0,
top:0,
bottom: 0,
child: CustomImage.network(url: mediaModel?.content??'',fit: BoxFit.cover,)
),
Visibility(
visible: mediaModel?.privacyStatus == 0?true:false,
child: Positioned(
left: 0,
right:0,
top:0,
bottom: 0,
child: Container(
alignment: Alignment.center,
color: widget.model.isMy==1?Colours.c9.withOpacity(0.5):Colours.c9.withOpacity(1),
child: Text('(审核中)',style: TextStyle(fontSize: 11.w,height: 1.5,color: AppTheme.primary),),
)
),
),
],
);
// return Container( // return Container(
// color: Colors.red, // color: Colors.red,
// ); // );
......
...@@ -65,18 +65,12 @@ class BuildNote extends StatelessWidget { ...@@ -65,18 +65,12 @@ class BuildNote extends StatelessWidget {
Row( Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text(model.noteContent?.text?.content??'',style: TextStyle( Text(_showText(model),style: TextStyle(
fontSize: 14.w, fontSize: 14.w,
height: 1.5, height: 1.5,
// color: Colors.red, // color: Colors.red,
color:Colours.c3 color:Colours.c3
),), ),),
model.noteContent?.text?.privacyStatus == 0?Text('(审核中)',style: TextStyle(
fontSize: 11.w,
height: 1.5,
// color: Colors.red,
color:AppTheme.primary
),):const SizedBox(),
], ],
), ),
Gaps.vGaps13, Gaps.vGaps13,
...@@ -103,6 +97,41 @@ class BuildNote extends StatelessWidget { ...@@ -103,6 +97,41 @@ class BuildNote extends StatelessWidget {
); );
} }
String _showText(NoteModel discussModel){
String text = '';
// 是我的
if(discussModel.isMy == 1){
// 审核中
if(discussModel.noteContent?.text?.privacyStatus ==0 ||discussModel.noteContent?.text?.privacyStatus ==2){
text = '${discussModel.noteContent?.text?.content}(审核中)';
}
// 审核未通过
else if(discussModel.noteContent?.text?.privacyStatus ==-1){
text = '${discussModel.noteContent?.text?.content}(审核未通过)';
}
// 审核通过
else {
text = '${discussModel.noteContent?.text?.content}';
}
}
else {
// 审核中
if(discussModel.noteContent?.text?.privacyStatus ==0 ||discussModel.noteContent?.text?.privacyStatus ==2){
text = '(审核中)';
}
// 审核未通过
else if(discussModel.noteContent?.text?.privacyStatus ==-1){
text = '(审核未通过)';
}
// 审核通过
else {
text = '${discussModel.noteContent?.text?.content}';
}
}
return text;
}
// 图片 // 图片
Widget _buildImageGridView(){ Widget _buildImageGridView(){
return GridView.builder( return GridView.builder(
...@@ -135,7 +164,7 @@ class BuildNote extends StatelessWidget { ...@@ -135,7 +164,7 @@ class BuildNote extends StatelessWidget {
bottom: 0, bottom: 0,
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
color: Colours.c9.withOpacity(0.5), color: model.isMy==1?Colours.c9.withOpacity(0.5):Colours.c9.withOpacity(1),
child: Text('(审核中)',style: TextStyle(fontSize: 14.w,height: 1.5,color: AppTheme.primary),), child: Text('(审核中)',style: TextStyle(fontSize: 14.w,height: 1.5,color: AppTheme.primary),),
) )
), ),
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论