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

add

上级 c507b566
......@@ -526,7 +526,8 @@ class DiscussModel {
id = json['id'];
chapterId = json['chapter_id'];
chapterName = json['chapter_name'];
content = json['content'];
// content = json['content'];
content = json['content'] != null ? NoteContentModel.fromJson(json['content']) : null;
quoteContent = json['quote_content'];
title = json['title'];
replyId = json['reply_id'];
......@@ -550,7 +551,7 @@ class DiscussModel {
num? id;
num? chapterId;
String? chapterName;
String? content;
NoteContentModel? content;
String? quoteContent;
String? title;
num? replyId;
......@@ -569,7 +570,7 @@ class DiscussModel {
num? id,
num? chapterId,
String? chapterName,
String? content,
NoteContentModel? content,
String? quoteContent,
String? title,
num? replyId,
......@@ -609,7 +610,10 @@ class DiscussModel {
map['id'] = id;
map['chapter_id'] = chapterId;
map['chapter_name'] = chapterName;
map['content'] = content;
// map['content'] = content;
if (content != null) {
map['note_content'] = content?.toJson();
}
map['quote_content'] = quoteContent;
map['title'] = title;
map['reply_id'] = replyId;
......
......@@ -54,7 +54,7 @@ class BookPayController extends GetxController {
/// 使用优惠券
void setUseCoupon(CouponModel model){
useCouponModel = model;
print('使用优惠券。。。。。。。。。。。。。。。。');
print('使用优惠券。。。。。。。。。。。。。。。。${model.couponRecId}');
computeFinalPrice();
}
......
......@@ -47,7 +47,7 @@ class BuildBanner extends StatelessWidget {
},
child: ClipRRect(
borderRadius: BorderRadius.circular(8.w),
child: CustomImage.network(url: item.pic??'')
child: CustomImage.network(url: item.pic??'',fit: BoxFit.contain,)
),
),
// child: CustomImage.asset(
......
......@@ -87,10 +87,10 @@ class LoginController extends GetxController {
// 定时器回调
});
/// 测试账号
// if (kDebugMode) {
// phoneInput.text = '13521054068';
// passwordInput.text = '123456';
// }
if (kDebugMode) {
phoneInput.text = '13521054068';
passwordInput.text = '123456';
}
super.onInit();
}
......
......@@ -63,7 +63,7 @@ class MineController extends GetxController {
link: Routes.point,
icon: 'assets/images/point.png'),
ReadModel(
name: '紫币',
name: '紫币',
value: userInfo.beanNums.toString(),
link: Routes.coin,
icon: 'assets/images/coin.png'),
......
......@@ -90,6 +90,7 @@ class _CouponPageState extends State<CouponPage> with AutomaticKeepAliveClientMi
itemBuilder: (BuildContext context, int index){
CouponModel model = controller.coupons[index];
return BuildItem(model:model,useTap: (){
Console.log('选择优惠券--------------------------------${model.couponRecId}');
widget.payController.setUseCoupon(model);
context.pop();
},);
......
......@@ -39,6 +39,7 @@ class DiscussController extends GetxController {
bookId: bookDetailModel.bookId.toString(),
chapterId: chapterId
);
Console.log('--------------------------------');
// 如果是刷新 清理数据
if (isRefresh) discuss.clear();
discuss.addAll(result);
......@@ -54,6 +55,7 @@ class DiscussController extends GetxController {
refreshController.finishRefresh(IndicatorResult.success);
refreshController.resetFooter();
} catch (error) {
Console.log('--error-----------------------------$error-');
refreshController.finishRefresh(IndicatorResult.fail);
}
}
......
......@@ -73,14 +73,18 @@ class BuildDiscuss extends StatelessWidget {
Widget _buildItem(DiscussModel model,{int type =0}){
return Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ClipRRect(
borderRadius: BorderRadius.circular(17.5.w),
child: Container(
width: 35.w,
height: 35.w,
color: Colors.red,
child: CustomImage.network(url: model.personPic??''),
Container(
margin: EdgeInsets.only(top: 10.w),
child: ClipRRect(
borderRadius: BorderRadius.circular(17.5.w),
child: Container(
width: 35.w,
height: 35.w,
color: Colors.red,
child: CustomImage.network(url: model.personPic??''),
),
),
),
Expanded(
......@@ -96,18 +100,25 @@ class BuildDiscuss extends StatelessWidget {
children: [
Text(model.personName??'',style: TextStyle(fontSize: 12.w,height: 1.5,color: Colours.c9),),
Gaps.hGaps10,
type ==0?const SizedBox(): Text('发起人',style: TextStyle(fontSize: 11.w,height: 1.5,color: AppTheme.primary),)
type ==1?const SizedBox(): Text('发起人',style: TextStyle(fontSize: 11.w,height: 1.5,color: AppTheme.primary),)
],
),
Text(model.createTime??'',style: TextStyle(fontSize: 12.w,height: 1.5,color: Colours.c9),)
],
),
type ==0? Text(model.content??'',style: TextStyle(fontSize: 13.w,height: 1.5,color: Colours.c3),)
type ==0? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(model.content?.text?.content??'',style: TextStyle(fontSize: 13.w,height: 1.5,color: Colours.c3),),
Gaps.vGaps10,
_buildImageGridView()
],
)
:RichText(text: TextSpan(
children: [
TextSpan(text: '回复 ',style: TextStyle(fontSize: 13.w,height: 1.5,color: Colours.c3)),
TextSpan(text: model.replacePersonName??'',style: TextStyle(fontSize: 13.w,height: 1.5,color: Colours.c9)),
TextSpan(text: ':${model.content??''}',style: TextStyle(fontSize: 13.w,height: 1.5,color: Colours.c3)),
TextSpan(text: ':${model.content?.text?.content??''}',style: TextStyle(fontSize: 13.w,height: 1.5,color: Colours.c3)),
]
)),
Row(
......@@ -151,11 +162,72 @@ class BuildDiscuss extends StatelessWidget {
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (BuildContext context,int index){
return _buildItem(data[index]);
return _buildItem(data[index],type: 1);
},
itemCount: data.length,
);
}
// 图片
Widget _buildImageGridView(){
return GridView.builder(
// padding: const EdgeInsets.only(left: 13,top: 10),
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 6,
crossAxisSpacing: 2.w,
mainAxisSpacing: 2.w,
childAspectRatio: 1
),
itemBuilder: (BuildContext context, int index) {
MediaModel? mediaModel = model.content?.image?[index];
return CustomImage.network(url: model?.content?.image?[index].content??'',fit: BoxFit.cover,);
// return Container(
// color: Colors.red,
// );
},
itemCount: model.content?.image?.length,
// itemCount: 2,
);
}
// Widget _buildAudioListView(){
// return ListView.builder(
// physics: const NeverScrollableScrollPhysics(),
// shrinkWrap: true,
// itemBuilder: (BuildContext context, int index) {
// MediaModel mediaModel = model.noteContent!.audio![index];
// return Container(
// height: 20.w,
// margin: EdgeInsets.only(right: 130.w),
// child: Container(
// margin: EdgeInsets.only(top: 5.w),
// padding: EdgeInsets.only(right:20.w,left: 10.w),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(10.w),
// color: Colours.cF9,
// ),
// child: Row(
// // mainAxisSize: MainAxisSize.min,
// mainAxisAlignment:MainAxisAlignment.spaceBetween,
// children: [
// GestureDetector(
// onTap: (){
// if (onTapAudio !=null) onTapAudio!(mediaModel);
// },
// child: Image.asset('assets/images/audio.png')
// ),
// Text('0:00/${mediaModel.duration}',style: TextStyle(fontSize: 10.w,height: 1.4,color: Colours.c9),)
// ],
// ),
// ),
// );
// },
// itemCount: model.noteContent?.audio?.length,
// );
// }
}
......@@ -105,7 +105,7 @@ class BuildNote extends StatelessWidget {
childAspectRatio: 1
),
itemBuilder: (BuildContext context, int index) {
return CustomImage.network(url: model.noteContent!.image![index].content??'',fit: BoxFit.cover,);
return CustomImage.network(url: model.noteContent?.image?[index].content??'',fit: BoxFit.cover,);
},
itemCount: model.noteContent?.image?.length,
);
......
......@@ -91,9 +91,9 @@ class ValidatorTool {
// 密码
static bool isValidPassword(String value) {
RegExp passwordPattern = RegExp(r'^[A-Za-z0-9!@#\$%^&*()_+{}\[\]:;<>,.?~\\/-]{8,12}$');
// RegExp passwordPattern = RegExp(r'^[A-Za-z0-9!@#\$%^&*()_+{}\[\]:;<>,.?~\\/-]{8,12}$');
// RegExp passwordPattern = RegExp(r'^(?=.*[A-Za-z])(?=.*\d)(?=.*[~@#%$*()_+{}\[\]:;<>,.?\\/-])[A-Za-z0-9~@#%$*()_+{}\[\]:;<>,.?\\/-]{8,12}$');
// RegExp passwordPattern = RegExp(r'^\d{6}$');
RegExp passwordPattern = RegExp(r'^\d{6}$');
return passwordPattern.hasMatch(value);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论