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

add

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