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

讨论 与 笔记 显示审核状态

上级 1bacf432
......@@ -356,6 +356,7 @@ class NoteModel {
this.noteContent,
this.color,
this.chapterName,
this.isMy,
});
NoteModel.fromJson(dynamic json) {
......@@ -368,9 +369,11 @@ class NoteModel {
noteContent = json['note_content'] != null ? NoteContentModel.fromJson(json['note_content']) : null;
color = json['color'];
chapterName = json['chapter_name'];
isMy = json['is_my'];
}
num? notesId;
num? types;
num? isMy;
num? chapterId;
String? content;
String? positioning;
......@@ -382,6 +385,7 @@ class NoteModel {
NoteModel copyWith({
num? notesId,
num? types,
num? isMy,
num? chapterId,
String? content,
String? positioning,
......@@ -392,6 +396,7 @@ class NoteModel {
NoteModel(
notesId: notesId ?? this.notesId,
types: types ?? this.types,
isMy: isMy ?? this.isMy,
chapterId: chapterId ?? this.chapterId,
content: content ?? this.content,
positioning: positioning ?? this.positioning,
......@@ -404,6 +409,7 @@ class NoteModel {
final map = <String, dynamic>{};
map['notes_id'] = notesId;
map['types'] = types;
map['is_my'] = isMy;
map['chapter_id'] = chapterId;
map['content'] = content;
map['positioning'] = positioning;
......@@ -530,6 +536,7 @@ class DiscussModel {
this.personName,
this.commentAll,
this.personPic,
this.isMy,
});
DiscussModel.fromJson(dynamic json) {
......@@ -550,6 +557,8 @@ class DiscussModel {
replacePersonPic = json['replace_person_pic'];
personName = json['person_name'];
personPic = json['person_pic'];
isMy = json['is_my'];
if (json['comment_all'] != null) {
commentAll = [];
json['comment_all'].forEach((v) {
......@@ -569,6 +578,7 @@ class DiscussModel {
num? personId;
num? goodNum;
num? replyNum;
num? isMy;
String? createTime;
String? replacePersonName;
String? replacePersonPic;
......@@ -588,6 +598,7 @@ class DiscussModel {
num? personId,
num? goodNum,
num? replyNum,
num? isMy,
String? createTime,
String? replacePersonName,
String? replacePersonPic,
......@@ -607,6 +618,7 @@ class DiscussModel {
personId: personId ?? this.personId,
goodNum: goodNum ?? this.goodNum,
replyNum: replyNum ?? this.replyNum,
isMy: isMy ?? this.isMy,
createTime: createTime ?? this.createTime,
replacePersonName: replacePersonName ?? this.replacePersonName,
replacePersonPic: replacePersonPic ?? this.replacePersonPic,
......@@ -631,6 +643,7 @@ class DiscussModel {
map['person_id'] = personId;
map['good_num'] = goodNum;
map['reply_num'] = replyNum;
map['is_my'] = isMy;
map['create_time'] = createTime;
map['replace_person_name'] = replacePersonName;
map['replace_person_pic'] = replacePersonPic;
......
......@@ -117,7 +117,7 @@ class _BuildDiscussState extends State<BuildDiscuss> {
type ==0? Column(
crossAxisAlignment: CrossAxisAlignment.start,
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,
_buildImageGridView()
],
......@@ -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){
return ListView.builder(
physics: const NeverScrollableScrollPhysics(),
......@@ -199,7 +233,31 @@ class _BuildDiscussState extends State<BuildDiscuss> {
),
itemBuilder: (BuildContext context, int 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(
// color: Colors.red,
// );
......
......@@ -65,18 +65,12 @@ class BuildNote extends StatelessWidget {
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(model.noteContent?.text?.content??'',style: TextStyle(
Text(_showText(model),style: TextStyle(
fontSize: 14.w,
height: 1.5,
// color: Colors.red,
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,
......@@ -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(){
return GridView.builder(
......@@ -135,7 +164,7 @@ class BuildNote extends StatelessWidget {
bottom: 0,
child: Container(
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),),
)
),
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论