Browse Source

Merge remote-tracking branch 'origin/dev' into remove_uniapp

ff_new
fmk 3 years ago
parent
commit
2acdc40831
  1. BIN
      assets/image/2x/xin_ren.png
  2. BIN
      assets/image/2x/xin_rq.png
  3. BIN
      assets/image/3x/xin_ren.png
  4. BIN
      assets/image/3x/xin_rq.png
  5. BIN
      assets/image/xin_ren.png
  6. BIN
      assets/image/xin_rq.png
  7. 423
      lib/community/community_view/class_details.dart
  8. 3
      lib/community/community_view/class_details_video.dart
  9. 165
      lib/community/community_view/home_class.dart
  10. 128
      lib/community/headlines/article_list.dart
  11. 116
      lib/community/headlines/article_page.dart
  12. 8
      lib/community/headlines/headlines_collection.dart
  13. 424
      lib/community/headlines/headlines_column_details.dart
  14. 1
      lib/generated/intl/messages_en.dart
  15. 1
      lib/generated/intl/messages_zh_CN.dart
  16. 1
      lib/generated/intl/messages_zh_Hans_CN.dart
  17. 1
      lib/generated/intl/messages_zh_Hant_CN.dart
  18. 1
      lib/generated/intl/messages_zh_TW.dart
  19. 10
      lib/generated/l10n.dart
  20. 36
      lib/home/home_page.dart
  21. 6
      lib/home/home_view/featured_acticvity.dart
  22. 1
      lib/l10n/intl_en.arb
  23. 1
      lib/l10n/intl_zh_CN.arb
  24. 1
      lib/l10n/intl_zh_Hans_CN.arb
  25. 1
      lib/l10n/intl_zh_Hant_CN.arb
  26. 1
      lib/l10n/intl_zh_TW.arb
  27. 24
      lib/login/login_page.dart
  28. 12
      lib/main.dart
  29. 14
      lib/main_page.dart
  30. 49
      lib/mine/mine_vip/legal_right_details.dart
  31. 395
      lib/retrofit/data/login_info.dart
  32. 8
      lib/retrofit/min_api.dart
  33. 2
      lib/retrofit/min_api.g.dart
  34. 11
      lib/retrofit/retrofit_api.dart
  35. 2
      lib/retrofit/retrofit_api.g.dart
  36. 6
      lib/view_widget/invite_success_dialog.dart
  37. 193
      lib/view_widget/new_people_reward.dart

BIN
assets/image/2x/xin_ren.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

BIN
assets/image/2x/xin_rq.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
assets/image/3x/xin_ren.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 KiB

BIN
assets/image/3x/xin_rq.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

BIN
assets/image/xin_ren.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

BIN
assets/image/xin_rq.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

423
lib/community/community_view/class_details.dart

@ -1,6 +1,7 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/community/community_view/class_details_video.dart'; import 'package:huixiang/community/community_view/class_details_video.dart';
@ -9,7 +10,6 @@ import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/chapter.dart'; import 'package:huixiang/retrofit/data/chapter.dart';
import 'package:huixiang/retrofit/data/course_details.dart'; import 'package:huixiang/retrofit/data/course_details.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/flutter_utils.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/tips_dialog.dart'; import 'package:huixiang/view_widget/tips_dialog.dart';
import 'package:huixiang/web/web_view/comment_list.dart'; import 'package:huixiang/web/web_view/comment_list.dart';
@ -122,234 +122,237 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return AnnotatedRegion<SystemUiOverlayStyle>(
body: Container( value: SystemUiOverlayStyle.light,
margin: EdgeInsets.only(top:30), child: Material(child: Scaffold(
child: Column( body: Container(
children: [ // margin: EdgeInsets.only(top:25),
Expanded( child: Column(
child: SingleChildScrollView( children: [
physics: BouncingScrollPhysics(), Expanded(
child: Column( child: SingleChildScrollView(
children: [ physics: BouncingScrollPhysics(),
Stack( child: Column(
children: [ children: [
ClassDetailsVideo(key:videoKey,exitFull: (){setState(() {});}, Stack(
coverImg: chapterList.length > chapterIndex
? chapterList[chapterIndex].content.coverImg
: "",isShowImg: this.isShowImg,
changeShowImg: (isShowImg){setState(() {
this.isShowImg = isShowImg;
});},heightFun: (height) {
this.height = height +
MediaQuery
.of(context)
.padding
.top +
kToolbarHeight +
24;
if (mounted) setState(() {});
},),
Container(
margin: EdgeInsets.only(
top: 40.h, left: 16.w, right: 16.w),
decoration: BoxDecoration(
color: Colors.transparent,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
GestureDetector( ClassDetailsVideo(key:videoKey,exitFull: (){setState(() {});},
child: Image.asset( coverImg: chapterList.length > chapterIndex
"assets/image/integral_return.png", ? chapterList[chapterIndex].content.coverImg
width: 24, : "",isShowImg: this.isShowImg,
height: 24, changeShowImg: (isShowImg){setState(() {
this.isShowImg = isShowImg;
});},heightFun: (height) {
this.height = height +
MediaQuery
.of(context)
.padding
.top +
kToolbarHeight +
24;
if (mounted) setState(() {});
},),
Container(
margin: EdgeInsets.only(
top: 40.h, left: 16.w, right: 16.w),
decoration: BoxDecoration(
color: Colors.transparent,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
GestureDetector(
child: Image.asset(
"assets/image/integral_return.png",
width: 24,
height: 24,
),
onTap: () {
Navigator.of(context).pop(
course != null ? course.viewers + 1 : 0);
},
),
],
), ),
onTap: () {
Navigator.of(context).pop(
course != null ? course.viewers + 1 : 0);
},
), ),
], ],
), ),
), Container(
], height: 123,
), margin: EdgeInsets.only(bottom: 16.h),
Container( padding: EdgeInsets.only(left: 16, top: 16, right: 10),
height: 123, decoration: BoxDecoration(
margin: EdgeInsets.only(bottom: 16.h), color: Colors.white,
padding: EdgeInsets.only(left: 16, top: 16, right: 10), boxShadow: [
decoration: BoxDecoration( BoxShadow(
color: Colors.white, color: Colors.black.withAlpha(12),
boxShadow: [ offset: Offset(0, 2),
BoxShadow( blurRadius: 14,
color: Colors.black.withAlpha(12), spreadRadius: 0,
offset: Offset(0, 2), )
blurRadius: 14, ],
spreadRadius: 0, ),
) child: Column(
], mainAxisAlignment: MainAxisAlignment.start,
), crossAxisAlignment: CrossAxisAlignment.start,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [ children: [
Container( Row(
height: 22.h, children: [
padding:EdgeInsets.only(left:2,right:2), Container(
alignment: Alignment.center, height: 22.h,
decoration: BoxDecoration( padding:EdgeInsets.only(left:2,right:2),
borderRadius: BorderRadius.circular(2), alignment: Alignment.center,
border: Border.all( decoration: BoxDecoration(
width: 1, borderRadius: BorderRadius.circular(2),
color: Color(0xFFFF7A1A), border: Border.all(
style: BorderStyle.solid, width: 1,
), color: Color(0xFFFF7A1A),
), style: BorderStyle.solid,
child: Text( ),
(course?.tags != null && ),
child: Text(
(course?.tags != null &&
course.tags.length > 0) course.tags.length > 0)
? course.tags[0] ? course.tags[0]
: "", : "",
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
color: Color(0xFFFF7A1A), color: Color(0xFFFF7A1A),
),
),
),
SizedBox(
width: 6.w,
), ),
Expanded(
child: Text(
course != null ? course.subject : "",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF1A1A1A),
),
),
flex: 1,
)
],
),
SizedBox(
height: 10.h,
),
Padding(
padding: EdgeInsets.only(right: 16),
child: Row(
children: [
Expanded(
child: Text(
"讲师:${course != null ? course.author.name : ""}",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Colors.black,
),
)),
Text(
"播放次数:",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF808080),
),
),
SizedBox(
width: 4,
),
Text(
course != null
? course.viewers.toString()
: "",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF808080),
),
),
],
), ),
), ),
SizedBox( SizedBox(
width: 6.w, height: 10.h,
), ),
Expanded( Text(
child: Text( course != null ? course.introduce : "",
course != null ? course.subject : "", overflow: TextOverflow.ellipsis,
overflow: TextOverflow.ellipsis, maxLines: 2,
maxLines: 2, style: TextStyle(
style: TextStyle( fontSize: 12.sp,
fontSize: 16.sp, fontWeight: MyFontWeight.regular,
fontWeight: MyFontWeight.semi_bold, color: Colors.black,
color: Color(0xFF1A1A1A),
),
), ),
flex: 1, ),
)
], ],
), ),
SizedBox( ),
height: 10.h, anthology(),
), CommentList(
Padding( commentKey,
padding: EdgeInsets.only(right: 16), course?.likes ?? course?.likes ?? 0,
child: Row( widget.arguments["id"],
children: [ 3,
Expanded( isKeyBoardShow,
child: Text( _reply,
"讲师:${course != null ? course.author.name : ""}", _delCommentTips,
overflow: TextOverflow.ellipsis, 12.sp,
maxLines: 2, requestApiFinish: (total) {
style: TextStyle( setState(() {
fontSize: 12.sp, commentTotal = total;
fontWeight: MyFontWeight.regular, });
color: Colors.black, },
), ),
)), if (commentTotal == 0)
Text( Container(
"播放次数:", width: double.infinity,
style: TextStyle( alignment: Alignment.topCenter,
fontSize: 12.sp, margin: EdgeInsets.only(top: 40),
fontWeight: MyFontWeight.regular, padding: EdgeInsets.all(22.h),
color: Color(0xFF808080), child: Text(
), S.of(context).zanwupinglun,
), style: TextStyle(
SizedBox( fontSize: 12,
width: 4, fontWeight: FontWeight.bold,
), color: Color(0xFFA0A0A0),
Text( ),
course != null
? course.viewers.toString()
: "",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF808080),
),
),
],
),
),
SizedBox(
height: 10.h,
),
Text(
course != null ? course.introduce : "",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Colors.black,
), ),
), ),
], ],
),
), ),
anthology(), ),
CommentList( flex: 1,
commentKey,
course?.likes ?? course?.likes ?? 0,
widget.arguments["id"],
3,
isKeyBoardShow,
_reply,
_delCommentTips,
12.sp,
requestApiFinish: (total) {
setState(() {
commentTotal = total;
});
},
),
if (commentTotal == 0)
Container(
width: double.infinity,
alignment: Alignment.topCenter,
margin: EdgeInsets.only(top: 40),
padding: EdgeInsets.all(22.h),
child: Text(
S.of(context).zanwupinglun,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
color: Color(0xFFA0A0A0),
),
),
),
],
), ),
), ///
flex: 1, InputComment(
), inputKey,
/// hintText,
InputComment( isKeyBoardShow,
inputKey, commentFocus,
hintText, commentTextController,
isKeyBoardShow, _toComment,
commentFocus, _queryMemberComment,
commentTextController, _queryCourseLikes,
_toComment, isLike: course?.selfLiked,
_queryMemberComment, ),
_queryCourseLikes, ],
isLike: course?.selfLiked,
), ),
], ),
), ),)
),
); );
} }
@ -365,7 +368,7 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Text(
"选集", S.of(context).xuanji,
style: TextStyle( style: TextStyle(
fontSize: 15.sp, fontSize: 15.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,

3
lib/community/community_view/class_details_video.dart

@ -90,7 +90,8 @@ class ClassDetailsVideoState extends State<ClassDetailsVideo> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container(key: globalKey,child:videoWidget( return Container(
key: globalKey,child:videoWidget(
MediaQuery.of(context).size.width, MediaQuery.of(context).size.width,
videoPlayerController != null videoPlayerController != null
? (MediaQuery.of(context).size.width) / ? (MediaQuery.of(context).size.width) /

165
lib/community/community_view/home_class.dart

@ -9,10 +9,11 @@ import 'package:huixiang/view_widget/custom_image.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
class HomeClass extends StatefulWidget { class HomeClass extends StatefulWidget {
final Map<String,List<CourseList>> collectMap; final Map<String, List<CourseList>> collectMap;
final List<CollectClassList> collectList; final List<CollectClassList> collectList;
HomeClass(this.collectMap,this.collectList); HomeClass(this.collectMap, this.collectList);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
return _HomeClass(); return _HomeClass();
@ -34,7 +35,7 @@ class _HomeClass extends State<HomeClass> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ListView.builder( return ListView.builder(
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
itemCount:widget.collectList == null ? 0 : widget.collectList.length, itemCount: widget.collectList == null ? 0 : widget.collectList.length,
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
@ -50,34 +51,46 @@ class _HomeClass extends State<HomeClass> {
// height: 250, // height: 250,
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(
horizontal: 6.w, horizontal: 6.w,
vertical:10, vertical: 10,
), ),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding(padding: EdgeInsets.only(left: 16,top: 5), Padding(
child: Text( padding: EdgeInsets.only(left: 16, top: 5),
collectList.name, child: Text(
style: TextStyle( collectList.name,
fontSize: 15.sp, style: TextStyle(
fontWeight: MyFontWeight.medium, fontSize: 15.sp,
color: Colors.black, fontWeight: MyFontWeight.medium,
color: Colors.black,
),
), ),
),), ),
Container( Container(
height: 195, height: 195,
margin: EdgeInsets.only(top:10), margin: EdgeInsets.only(top: 10),
child: ListView.builder( child: ListView.builder(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
padding: EdgeInsets.symmetric(horizontal: 10), padding: EdgeInsets.symmetric(horizontal: 10),
itemCount:widget.collectMap[collectList.id] == null ? 0 : widget.collectMap[collectList.id].length, itemCount: widget.collectMap[collectList.id] == null
? 0
: widget.collectMap[collectList.id].length,
itemBuilder: (context, position) { itemBuilder: (context, position) {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
Navigator.of(context).pushNamed('/router/class_details', Navigator.of(context).pushNamed('/router/class_details',
arguments: {"id":widget.collectMap[collectList.id][position].id}) arguments: {
.then((value) => {widget.collectMap[collectList.id][position].viewers = value != null?value:widget.collectMap[collectList.id][position].viewers+1}); "id": widget.collectMap[collectList.id][position].id
}).then((value) => {
widget.collectMap[collectList.id][position].viewers =
value != null
? value
: widget.collectMap[collectList.id][position]
.viewers +
1
});
}, },
child: classItem(widget.collectMap[collectList.id][position]), child: classItem(widget.collectMap[collectList.id][position]),
); );
@ -108,7 +121,7 @@ class _HomeClass extends State<HomeClass> {
color: Colors.white, color: Colors.white,
), ),
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(
horizontal:6, horizontal: 6,
), ),
child: Column( child: Column(
children: [ children: [
@ -116,7 +129,7 @@ class _HomeClass extends State<HomeClass> {
alignment: Alignment.topRight, alignment: Alignment.topRight,
children: [ children: [
Stack( Stack(
alignment: Alignment(0.9,0.9), alignment: Alignment(0.9, 0.9),
children: [ children: [
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
@ -153,7 +166,7 @@ class _HomeClass extends State<HomeClass> {
), ),
Container( Container(
padding: EdgeInsets.only(left: 4), padding: EdgeInsets.only(left: 4),
child:Row( child: Row(
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
@ -165,7 +178,7 @@ class _HomeClass extends State<HomeClass> {
height: 16.h, height: 16.h,
color: Colors.white, color: Colors.white,
), ),
SizedBox(width:5), SizedBox(width: 5),
Text( Text(
collect.viewers.toString(), collect.viewers.toString(),
style: TextStyle( style: TextStyle(
@ -176,7 +189,7 @@ class _HomeClass extends State<HomeClass> {
), ),
], ],
), ),
SizedBox(width:8), SizedBox(width: 8),
// Row( // Row(
// children: [ // children: [
// Image.asset( // Image.asset(
@ -198,72 +211,76 @@ class _HomeClass extends State<HomeClass> {
// ), // ),
], ],
), ),
), ),
], ],
), ),
Row( Row(
children: [ children: [
Spacer(), Spacer(),
Container( Container(
margin: EdgeInsets.only(top: 8,right: 8), margin: EdgeInsets.only(top: 8, right: 8),
padding:EdgeInsets.only(left:2,right:2), padding: EdgeInsets.only(left: 2, right: 2),
height: 16.h, height: 16.h,
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius: BorderRadius.circular(2),
BorderRadius.circular(2), color: Color(0xFFFFCD00),
color: Color(0xFFFFCD00), ),
), child: Text(
child: Text( (collect?.tags != null && collect.tags.length > 0)
( collect?.tags != null && collect.tags.length > 0 )?collect.tags[0] : "", ? collect.tags[0]
style: TextStyle( : "",
fontSize: 12.sp, style: TextStyle(
fontWeight: MyFontWeight.medium, fontSize: 12.sp,
color: Color(0xFF634815), fontWeight: MyFontWeight.medium,
color: Color(0xFF634815),
),
), ),
), ),
), ],
],), ),
], ],
), ),
Expanded(child: Expanded(
Container( child: Container(
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Expanded(child: Text( Expanded(
collect.subject, child: Text(
overflow: TextOverflow.ellipsis, collect.subject,
maxLines: 2, overflow: TextOverflow.ellipsis,
style: TextStyle( maxLines: 2,
fontSize: 14.sp, style: TextStyle(
fontWeight: MyFontWeight.semi_bold, fontSize: 14.sp,
color: Colors.black, fontWeight: MyFontWeight.semi_bold,
color: Colors.black,
),
),
), ),
),), ],
], ),
), SizedBox(height: 2),
SizedBox(height:2), Text(
Text( "讲师:${collect.author.name}",
"讲师:${collect.author.name}", overflow: TextOverflow.ellipsis,
overflow: TextOverflow.ellipsis, maxLines: 2,
maxLines: 2, style: TextStyle(
style: TextStyle( fontSize: 12.sp,
fontSize: 12.sp, fontWeight: MyFontWeight.regular,
fontWeight: MyFontWeight.regular, color: Colors.black,
color: Colors.black, ),
), ),
), ],
], ),
), ),
),), ),
], ],
), ),
); );

128
lib/community/headlines/article_list.dart

@ -21,7 +21,9 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
class ArticleList extends StatefulWidget { class ArticleList extends StatefulWidget {
final List<Article> articles; final List<Article> articles;
ArticleList(this.articles,); ArticleList(
this.articles,
);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -46,56 +48,58 @@ class _ArticleList extends State<ArticleList> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
margin: EdgeInsets.only(top:20,left:16,right: 16), margin: EdgeInsets.only(top: 20, left: 16, right: 16),
child:Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
Padding(padding:EdgeInsets.only(bottom: 12), Padding(
child:Text( padding: EdgeInsets.only(bottom: 12),
"最新文章", child: Text(
overflow: TextOverflow.ellipsis, "最新文章",
maxLines: 2, overflow: TextOverflow.ellipsis,
style: TextStyle( maxLines: 2,
fontSize: 15.sp, style: TextStyle(
fontWeight: MyFontWeight.semi_bold, fontSize: 15.sp,
color: Colors.black, fontWeight: MyFontWeight.semi_bold,
), color: Colors.black,
)), ),
ListView.builder( )),
padding: EdgeInsets.zero, ListView.builder(
itemCount: widget.articles.length, padding: EdgeInsets.zero,
scrollDirection: Axis.vertical, itemCount: widget.articles.length,
shrinkWrap: true, scrollDirection: Axis.vertical,
physics: NeverScrollableScrollPhysics(), shrinkWrap: true,
itemBuilder: (context, position) { physics: NeverScrollableScrollPhysics(),
return GestureDetector( itemBuilder: (context, position) {
onTap: () { return GestureDetector(
Navigator.of(context).pushNamed( onTap: () {
'/router/web_page', Navigator.of(context).pushNamed('/router/web_page',
arguments: {"articleId": widget.articles[position].id}); arguments: {"articleId": widget.articles[position].id});
widget.articles[position].viewers = (widget.articles[position].viewers + 1); widget.articles[position].viewers =
setState(() {}); (widget.articles[position].viewers + 1);
setState(() {});
},
child: articleItem(widget.articles[position], position),
);
}, },
child: articleItem(widget.articles[position],position), ),
); ],
}, ));
),
],
));
} }
Widget articleItem(Article articles,position) { Widget articleItem(Article articles, position) {
return Container( return Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(16), padding: EdgeInsets.all(16),
margin: EdgeInsets.only(bottom: 12), margin: EdgeInsets.only(bottom: 12),
color: Colors.white, color: Colors.white,
child:Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Expanded(child: Container( Expanded(
child: Container(
height: 96, height: 96,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -124,26 +128,30 @@ class _ArticleList extends State<ArticleList> {
// SizedBox(height: 20), // SizedBox(height: 20),
Row( Row(
children: [ children: [
Expanded(child:Text( Expanded(
widget.articles != null?widget.articles[position]?.author?.name??"":"", child: Text(
overflow: TextOverflow.ellipsis, widget.articles != null
maxLines: 1, ? widget.articles[position]?.author?.name ?? ""
style: TextStyle( : "",
fontSize: 12.sp, overflow: TextOverflow.ellipsis,
fontWeight: MyFontWeight.medium, maxLines: 1,
color: Color(0xFF8E8E8E), style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF8E8E8E),
),
), ),
), ), ),
SizedBox(width:8), SizedBox(width: 8),
Image.asset( Image.asset(
"assets/image/browse.png", "assets/image/browse.png",
width: 14, width: 14,
height: 14, height: 14,
color: Color(0xFF808080), color: Color(0xFF808080),
), ),
Expanded(child: Text( Expanded(
"${widget?.articles[position]?.viewers}" child: Text(
?? "", "${widget?.articles[position]?.viewers}" ?? "",
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
@ -151,8 +159,8 @@ class _ArticleList extends State<ArticleList> {
), ),
)), )),
Text( Text(
widget?.articles[position]?.createTime?.split(" ")[0] widget?.articles[position]?.createTime?.split(" ")[0] ??
?? "", "",
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
@ -162,18 +170,18 @@ class _ArticleList extends State<ArticleList> {
], ],
), ),
], ],
),)), ),
SizedBox(width:12), )),
SizedBox(width: 12),
MImage( MImage(
widget?.articles[position]?.coverImg ?? "", widget?.articles[position]?.coverImg ?? "",
fit: BoxFit.cover, fit: BoxFit.cover,
radius: BorderRadius.all(Radius.circular(2)), radius: BorderRadius.all(Radius.circular(2)),
width:96, width: 96,
height:96, height: 96,
), ),
], ],
), ),
); );
} }
} }

116
lib/community/headlines/article_page.dart

@ -78,8 +78,7 @@ class _ArticlePage extends State<ArticlePage>
token: value.getString("token"), token: value.getString("token"),
); );
} }
BaseData<PageInfo<BannerData>> baseData = BaseData<PageInfo<BannerData>> baseData = await apiService.queryBanner({
await apiService.queryBanner({
"model": {"type": "INFORMATION"}, "model": {"type": "INFORMATION"},
}).catchError((onError) { }).catchError((onError) {
refreshController.refreshFailed(); refreshController.refreshFailed();
@ -111,14 +110,14 @@ class _ArticlePage extends State<ArticlePage>
"searchKey": "", "searchKey": "",
"state": 1, "state": 1,
"type": 2 "type": 2
}).catchError((onError){ }).catchError((onError) {
refreshController.refreshFailed(); refreshController.refreshFailed();
refreshController.loadFailed(); refreshController.loadFailed();
}); });
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
refreshController.refreshCompleted(); refreshController.refreshCompleted();
refreshController.loadComplete(); refreshController.loadComplete();
if(pageNum == 1) { if (pageNum == 1) {
articles.clear(); articles.clear();
} }
articles.addAll(baseData.data.list); articles.addAll(baseData.data.list);
@ -144,7 +143,8 @@ class _ArticlePage extends State<ArticlePage>
token: value.getString("token"), token: value.getString("token"),
); );
} }
BaseData<List<HeadlinesList>> baseData = await apiService.headlinesList().catchError((onError) {}); BaseData<List<HeadlinesList>> baseData =
await apiService.headlinesList().catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
setState(() { setState(() {
headlines.clear(); headlines.clear();
@ -157,9 +157,9 @@ class _ArticlePage extends State<ArticlePage>
EasyLoading.dismiss(); EasyLoading.dismiss();
} }
_onRefresh(){ _onRefresh() {
queryHeadlinesBanner(); queryHeadlinesBanner();
queryHeadlinesList();// queryHeadlinesList(); //
queryArticleList(); queryArticleList();
} }
@ -167,77 +167,79 @@ class _ArticlePage extends State<ArticlePage>
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context); super.build(context);
return Stack( return Stack(
children: [ children: [
Positioned( Positioned(
child: Container( child: Container(
child: SmartRefresher( child: SmartRefresher(
controller: refreshController, controller: refreshController,
enablePullDown: true, enablePullDown: true,
enablePullUp: true, enablePullUp: true,
header: MyHeader(), header: MyHeader(),
footer: CustomFooter( footer: CustomFooter(
builder: (context, mode) { builder: (context, mode) {
return MyFooter(mode); return MyFooter(mode);
},
),
onRefresh: _onRefresh,
onLoading: () {
queryArticleList();
}, },
physics: BouncingScrollPhysics(), ),
scrollController: scrollController, onRefresh: _onRefresh,
child: Container( onLoading: () {
child: SingleChildScrollView( queryArticleList();
physics: BouncingScrollPhysics(), },
child: Container( physics: BouncingScrollPhysics(),
color: Color(0xFFF7F7F7), scrollController: scrollController,
margin: EdgeInsets.only(top: 16.h), child: Container(
child: Column( child: SingleChildScrollView(
children: classChildItem(), physics: BouncingScrollPhysics(),
), child: Container(
color: Color(0xFFF7F7F7),
margin: EdgeInsets.only(top: 16.h),
child: Column(
children: classChildItem(),
), ),
), ),
), ),
), ),
), ),
bottom:0, ),
bottom: 0,
top: 0,
left: 0,
right: 0,
),
if (brands != null && brands.length > 0)
Positioned(
child: Container(
color: Colors.white,
child: StoreTitleTab(
brands,
globaKeys,
scrollController,
isScroll: true,
),
),
top: 0, top: 0,
left: 0, left: 0,
right: 0, right: 0,
), ),
if (brands != null && brands.length > 0) ],
Positioned( );
child: Container(
color: Colors.white,
child: StoreTitleTab(
brands,
globaKeys,
scrollController,
isScroll: true,
),
),
top: 0,
left: 0,
right: 0,
),
],
);
} }
List<Widget> classChildItem() { List<Widget> classChildItem() {
var widgets = <Widget>[ var widgets = <Widget>[
///banner ///banner
HeadlinesBanner(bannerData,), HeadlinesBanner(
bannerData,
),
SizedBox(height: 28), SizedBox(height: 28),
/// ///
HeadlinesCollection(headlines,articles), HeadlinesCollection(headlines, articles),
/// ///
ArticleList(articles,), ArticleList(
articles,
),
]; ];
return widgets; return widgets;

8
lib/community/headlines/headlines_collection.dart

@ -9,6 +9,7 @@ import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/custom_image.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/new_people_reward.dart';
class HeadlinesCollection extends StatefulWidget { class HeadlinesCollection extends StatefulWidget {
final List<HeadlinesList> headlines; final List<HeadlinesList> headlines;
@ -46,12 +47,9 @@ class _HeadlinesCollection extends State<HeadlinesCollection> {
itemBuilder: (context, position) { itemBuilder: (context, position) {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
List<Article> articles = [];
articles.addAll(widget.articles);
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/headlines_column_details', '/router/headlines_column_details',
arguments: {"id":widget.headlines[position].id, arguments: {"id":widget.headlines[position].id});
"articles":articles});
}, },
child: headlinesCollectionItem(widget.headlines[position]), child: headlinesCollectionItem(widget.headlines[position]),
); );
@ -95,6 +93,7 @@ class _HeadlinesCollection extends State<HeadlinesCollection> {
), ),
borderRadius: BorderRadius.vertical( borderRadius: BorderRadius.vertical(
top: Radius.circular(4), top: Radius.circular(4),
bottom: Radius.circular(4),
), ),
), ),
Container( Container(
@ -166,4 +165,5 @@ class _HeadlinesCollection extends State<HeadlinesCollection> {
), ),
); );
} }
} }

424
lib/community/headlines/headlines_column_details.dart

@ -1,7 +1,6 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:huixiang/retrofit/data/article.dart'; import 'package:huixiang/retrofit/data/article.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/headlines_list.dart'; import 'package:huixiang/retrofit/data/headlines_list.dart';
@ -13,7 +12,6 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/my_footer.dart'; import 'package:huixiang/view_widget/my_footer.dart';
import 'package:huixiang/view_widget/store_title_tab.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
@ -31,7 +29,7 @@ class HeadlinesColumnDetails extends StatefulWidget {
class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails> class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
with WidgetsBindingObserver { with WidgetsBindingObserver {
ApiService apiService; ApiService apiService;
List<Article> articles; List<Article> articles = [];
HeadlinesListDetails headlinesListDetails; HeadlinesListDetails headlinesListDetails;
List<HeadlinesList> headlines = []; List<HeadlinesList> headlines = [];
final RefreshController refreshController = RefreshController(); final RefreshController refreshController = RefreshController();
@ -41,10 +39,8 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
@override @override
void initState() { void initState() {
super.initState(); super.initState();
articles = widget.arguments["articles"];
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance.addObserver(this);
queryHeadlinesDetails(widget.arguments["id"]); _onRefresh();
queryArticleList(widget.arguments["id"]);
} }
/// ///
@ -58,7 +54,7 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
); );
} }
BaseData<HeadlinesListDetails> baseData = BaseData<HeadlinesListDetails> baseData =
await apiService.headlinesDetails(id).catchError((error) {}); await apiService.headlinesDetails(id).catchError((error) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
setState(() { setState(() {
headlinesListDetails = baseData.data; headlinesListDetails = baseData.data;
@ -82,15 +78,15 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
"searchKey": "", "searchKey": "",
"state": 1, "state": 1,
"type": 2, "type": 2,
"categoryId":categoryId "categoryId": categoryId
}).catchError((onError){ }).catchError((onError) {
refreshController.refreshFailed(); refreshController.refreshFailed();
refreshController.loadFailed(); refreshController.loadFailed();
}); });
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
refreshController.refreshCompleted(); refreshController.refreshCompleted();
refreshController.loadComplete(); refreshController.loadComplete();
if(pageNum == 1) { if (pageNum == 1) {
articles.clear(); articles.clear();
} }
articles.addAll(baseData.data.list); articles.addAll(baseData.data.list);
@ -106,7 +102,7 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
} }
} }
_onRefresh(){ _onRefresh() {
queryHeadlinesDetails(widget.arguments["id"]); queryHeadlinesDetails(widget.arguments["id"]);
queryArticleList(widget.arguments["id"]); queryArticleList(widget.arguments["id"]);
} }
@ -129,7 +125,7 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
), ),
onRefresh: _onRefresh, onRefresh: _onRefresh,
onLoading: () { onLoading: () {
queryArticleList(widget.arguments["id"]); _onRefresh();
}, },
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
scrollController: scrollController, scrollController: scrollController,
@ -145,15 +141,15 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
children: [ children: [
Stack( Stack(
children: [ children: [
Positioned(child: Positioned(
MImage( child: MImage(
headlinesListDetails?.bannerImg ?? "", headlinesListDetails?.bannerImg ?? "",
width:double.infinity, width: double.infinity,
height: 260.h, height: 260.h,
fit: BoxFit.cover, fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png", errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png", fadeSrc: "assets/image/default_1.png",
), ),
), ),
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
@ -162,8 +158,10 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
color: Colors.transparent, color: Colors.transparent,
), ),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.center, MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [ children: [
GestureDetector( GestureDetector(
child: Image.asset( child: Image.asset(
@ -183,17 +181,19 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
Container( Container(
child: Column( child: Column(
children: [ children: [
Padding(padding:EdgeInsets.only(left: 16), Padding(
child:Row( padding: EdgeInsets.only(left: 16),
child: Row(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(right:4), margin: EdgeInsets.only(right: 4),
padding:EdgeInsets.only(left:2,right:2), padding: EdgeInsets.only(
height:20.h, left: 2, right: 2),
height: 20.h,
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius:
BorderRadius.circular(2), BorderRadius.circular(2),
color: Color(0xFF32A060), color: Color(0xFF32A060),
), ),
child: Text( child: Text(
@ -215,14 +215,16 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
maxLines: 2, maxLines: 2,
style: TextStyle( style: TextStyle(
fontSize: 18.sp, fontSize: 18.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight:
MyFontWeight.semi_bold,
color: Colors.white, color: Colors.white,
), ),
), ),
flex: 1, flex: 1,
) )
], ],
),), ),
),
Container( Container(
width: double.infinity, width: double.infinity,
decoration: BoxDecoration( decoration: BoxDecoration(
@ -239,17 +241,20 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
margin: EdgeInsets.only(top: 16), margin: EdgeInsets.only(top: 16),
// padding: EdgeInsets.all(16), // padding: EdgeInsets.all(16),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.start, MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Padding(padding:EdgeInsets.all(16), Padding(
padding: EdgeInsets.all(16),
child: Text( child: Text(
"简介:${headlinesListDetails?.introduce ?? ""}", "简介:${headlinesListDetails?.introduce ?? ""}",
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 2, maxLines: 2,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
fontWeight: MyFontWeight.medium , fontWeight: MyFontWeight.medium,
color: Colors.black, color: Colors.black,
), ),
)), )),
@ -263,19 +268,20 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
), ),
ListView.builder( ListView.builder(
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
itemCount:articles == null ? 0 : articles.length, itemCount: articles == null ? 0 : articles.length,
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) { itemBuilder: (context, position) {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
Navigator.of(context).pushNamed( Navigator.of(context)
'/router/web_page', .pushNamed('/router/web_page', arguments: {
arguments: {"articleId": articles[position].id}); "articleId": articles[position].id
articles[position].viewers = (articles[position].viewers + 1); });
setState(() {} articles[position].viewers =
); (articles[position].viewers + 1);
setState(() {});
}, },
child: articleColumnItem(articles[position]), child: articleColumnItem(articles[position]),
); );
@ -288,194 +294,17 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
), ),
), ),
), ),
bottom:0, bottom: 0,
top: 0, top: 0,
left: 0, left: 0,
right: 0, right: 0,
), ),
], ],
); );
return Scaffold(
body: SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: true,
header: MyHeader(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onRefresh: _onRefresh,
onLoading: () {
},
physics: BouncingScrollPhysics(),
scrollController: scrollController,
child: Container(
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
children: [
Stack(
alignment: Alignment.bottomCenter,
children: [
Stack(
children: [
Positioned(child:
MImage(
headlinesListDetails?.bannerImg ?? "",
width:double.infinity,
height: 260.h,
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
),
),
Container(
margin: EdgeInsets.only(
top: 50.h, left: 16.w, right: 16.w),
decoration: BoxDecoration(
color: Colors.transparent,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
GestureDetector(
child: Image.asset(
"assets/image/integral_return.png",
width: 24,
height: 24,
),
onTap: () {
Navigator.of(context).pop();
},
),
],
),
),
],
),
Container(
child: Column(
children: [
Padding(padding:EdgeInsets.only(left: 16),
child:Row(
children: [
Container(
margin: EdgeInsets.only(right:4),
padding:EdgeInsets.only(left:2,right:2),
height:20.h,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(2),
color: Color(0xFF32A060),
),
child: Text(
"专栏",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
),
SizedBox(
width: 6.w,
),
Expanded(
child: Text(
headlinesListDetails?.name ?? "",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 18.sp,
fontWeight: MyFontWeight.semi_bold,
color: Colors.white,
),
),
flex: 1,
)
],
),),
Container(
width: double.infinity,
decoration: BoxDecoration(
border: Border.all(
width: 0,
color: Colors.white,
),
color: Colors.white,
borderRadius: new BorderRadius.only(
topLeft: Radius.circular(8.0),
topRight: Radius.circular(8.0),
),
),
margin: EdgeInsets.only(top: 16),
// padding: EdgeInsets.all(16),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(padding:EdgeInsets.all(16),
child: Text(
"简介:${headlinesListDetails?.introduce ?? ""}",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.medium ,
color: Colors.black,
),
)),
],
),
),
],
),
),
],
),
ListView.builder(
padding: EdgeInsets.zero,
itemCount:articles == null ? 0 : articles.length,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
Navigator.of(context).pushNamed(
'/router/web_page',
arguments: {"articleId": articles[position].id});
articles[position].viewers = (articles[position].viewers + 1);
setState(() {}
);
},
child: articleColumnItem(articles[position]),
);
},
),
],
),
),
flex: 1,
),
],
),
),
),
);
} }
Widget articleColumn() { Widget articleColumn() {
return Container( return Container();
);
} }
Widget articleColumnItem(Article articles) { Widget articleColumnItem(Article articles) {
@ -483,7 +312,7 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
width: double.infinity, width: double.infinity,
// padding: EdgeInsets.all(16), // padding: EdgeInsets.all(16),
color: Colors.white, color: Colors.white,
child:Column( child: Column(
children: [ children: [
Container( Container(
// margin: EdgeInsets.only(top: 16,bottom: 16), // margin: EdgeInsets.only(top: 16,bottom: 16),
@ -491,85 +320,90 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
height: 0.5.h, height: 0.5.h,
color: Color(0xFFF5F5F5), color: Color(0xFFF5F5F5),
), ),
Padding(padding: EdgeInsets.all(16), Padding(
child:Row( padding: EdgeInsets.all(16),
children: [ child: Row(
Expanded(child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
Text( Expanded(
articles?.mainTitle ?? "", child: Column(
overflow: TextOverflow.ellipsis, crossAxisAlignment: CrossAxisAlignment.start,
maxLines: 1, mainAxisAlignment: MainAxisAlignment.spaceAround,
style: TextStyle( children: [
fontSize: 14.sp, Text(
fontWeight: MyFontWeight.medium, articles?.mainTitle ?? "",
color: Colors.black, overflow: TextOverflow.ellipsis,
), maxLines: 1,
), style: TextStyle(
SizedBox(height:5), fontSize: 14.sp,
Text( fontWeight: MyFontWeight.medium,
articles?.viceTitle ?? "", color: Colors.black,
// overflow: TextOverflow.ellipsis, ),
// maxLines: 1,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF353535),
),
),
SizedBox(height: 10),
Row(
children: [
Expanded(child:Text(
articles?.author?.name ?? "",
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF8E8E8E),
), ),
),), SizedBox(height: 5),
SizedBox(width:8), Text(
Image.asset( articles?.viceTitle ?? "",
"assets/image/browse.png", // overflow: TextOverflow.ellipsis,
width: 14, // maxLines: 1,
height: 14, style: TextStyle(
color: Color(0xFF808080), fontSize: 12.sp,
), fontWeight: MyFontWeight.regular,
Expanded(child: Text( color: Color(0xFF353535),
"${articles?.viewers}" ),
?? "",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF8D8D8D),
), ),
)), SizedBox(height: 10),
Text( Row(
articles?.createTime ?? "", children: [
style: TextStyle( Expanded(
fontSize: 12.sp, child: Text(
fontWeight: MyFontWeight.regular, articles?.author?.name ?? "",
color: Color(0xFF8D8D8D), overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF8E8E8E),
),
),
),
SizedBox(width: 8),
Image.asset(
"assets/image/browse.png",
width: 14,
height: 14,
color: Color(0xFF808080),
),
Expanded(
child: Text(
"${articles?.viewers}" ?? "",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF8D8D8D),
),
)),
Text(
articles?.createTime ?? "",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF8D8D8D),
),
),
],
), ),
), ],
], ),
),
SizedBox(width: 12),
MImage(
articles?.coverImg ?? "",
fit: BoxFit.cover,
radius: BorderRadius.all(Radius.circular(2)),
width: 96,
height: 96,
), ),
], ],
),), )),
SizedBox(width:12),
MImage(
articles?.coverImg ?? "",
fit: BoxFit.cover,
radius: BorderRadius.all(Radius.circular(2)),
width:96,
height:96,
),
],
)),
], ],
), ),
); );

1
lib/generated/intl/messages_en.dart

@ -570,6 +570,7 @@ class MessageLookup extends MessageLookupByLibrary {
"xitongxiaoxi" : MessageLookupByLibrary.simpleMessage("系统消息"), "xitongxiaoxi" : MessageLookupByLibrary.simpleMessage("系统消息"),
"xiugaichenggong" : MessageLookupByLibrary.simpleMessage("修改成功"), "xiugaichenggong" : MessageLookupByLibrary.simpleMessage("修改成功"),
"xuanguige" : MessageLookupByLibrary.simpleMessage("选规格"), "xuanguige" : MessageLookupByLibrary.simpleMessage("选规格"),
"xuanji" : MessageLookupByLibrary.simpleMessage("选集"),
"xuni" : MessageLookupByLibrary.simpleMessage("虚拟"), "xuni" : MessageLookupByLibrary.simpleMessage("虚拟"),
"yaoqingrenshoujihao_" : m32, "yaoqingrenshoujihao_" : m32,
"yaoqingwancheng" : MessageLookupByLibrary.simpleMessage("邀请完成"), "yaoqingwancheng" : MessageLookupByLibrary.simpleMessage("邀请完成"),

1
lib/generated/intl/messages_zh_CN.dart

@ -568,6 +568,7 @@ class MessageLookup extends MessageLookupByLibrary {
"xitongxiaoxi" : MessageLookupByLibrary.simpleMessage("系统消息"), "xitongxiaoxi" : MessageLookupByLibrary.simpleMessage("系统消息"),
"xiugaichenggong" : MessageLookupByLibrary.simpleMessage("修改成功"), "xiugaichenggong" : MessageLookupByLibrary.simpleMessage("修改成功"),
"xuanguige" : MessageLookupByLibrary.simpleMessage("选规格"), "xuanguige" : MessageLookupByLibrary.simpleMessage("选规格"),
"xuanji" : MessageLookupByLibrary.simpleMessage("选集"),
"xuni" : MessageLookupByLibrary.simpleMessage("虚拟"), "xuni" : MessageLookupByLibrary.simpleMessage("虚拟"),
"yaoqingrenshoujihao_" : m32, "yaoqingrenshoujihao_" : m32,
"yibangfuka" : MessageLookupByLibrary.simpleMessage("已绑副卡"), "yibangfuka" : MessageLookupByLibrary.simpleMessage("已绑副卡"),

1
lib/generated/intl/messages_zh_Hans_CN.dart

@ -568,6 +568,7 @@ class MessageLookup extends MessageLookupByLibrary {
"xitongxiaoxi" : MessageLookupByLibrary.simpleMessage("系统消息"), "xitongxiaoxi" : MessageLookupByLibrary.simpleMessage("系统消息"),
"xiugaichenggong" : MessageLookupByLibrary.simpleMessage("修改成功"), "xiugaichenggong" : MessageLookupByLibrary.simpleMessage("修改成功"),
"xuanguige" : MessageLookupByLibrary.simpleMessage("选规格"), "xuanguige" : MessageLookupByLibrary.simpleMessage("选规格"),
"xuanji" : MessageLookupByLibrary.simpleMessage("选集"),
"xuni" : MessageLookupByLibrary.simpleMessage("虚拟"), "xuni" : MessageLookupByLibrary.simpleMessage("虚拟"),
"yaoqingrenshoujihao_" : m32, "yaoqingrenshoujihao_" : m32,
"yibangfuka" : MessageLookupByLibrary.simpleMessage("已绑副卡"), "yibangfuka" : MessageLookupByLibrary.simpleMessage("已绑副卡"),

1
lib/generated/intl/messages_zh_Hant_CN.dart

@ -567,6 +567,7 @@ class MessageLookup extends MessageLookupByLibrary {
"xitongxiaoxi" : MessageLookupByLibrary.simpleMessage("系統消息"), "xitongxiaoxi" : MessageLookupByLibrary.simpleMessage("系統消息"),
"xiugaichenggong" : MessageLookupByLibrary.simpleMessage("修改成功"), "xiugaichenggong" : MessageLookupByLibrary.simpleMessage("修改成功"),
"xuanguige" : MessageLookupByLibrary.simpleMessage("選規格"), "xuanguige" : MessageLookupByLibrary.simpleMessage("選規格"),
"xuanji" : MessageLookupByLibrary.simpleMessage("選集"),
"xuni" : MessageLookupByLibrary.simpleMessage("虛擬"), "xuni" : MessageLookupByLibrary.simpleMessage("虛擬"),
"yaoqingrenshoujihao_" : m32, "yaoqingrenshoujihao_" : m32,
"yibangfuka" : MessageLookupByLibrary.simpleMessage("已綁副卡"), "yibangfuka" : MessageLookupByLibrary.simpleMessage("已綁副卡"),

1
lib/generated/intl/messages_zh_TW.dart

@ -568,6 +568,7 @@ class MessageLookup extends MessageLookupByLibrary {
"xitongxiaoxi" : MessageLookupByLibrary.simpleMessage("系統消息"), "xitongxiaoxi" : MessageLookupByLibrary.simpleMessage("系統消息"),
"xiugaichenggong" : MessageLookupByLibrary.simpleMessage("修改成功"), "xiugaichenggong" : MessageLookupByLibrary.simpleMessage("修改成功"),
"xuanguige" : MessageLookupByLibrary.simpleMessage("選規格"), "xuanguige" : MessageLookupByLibrary.simpleMessage("選規格"),
"xuanji" : MessageLookupByLibrary.simpleMessage("選集"),
"xuni" : MessageLookupByLibrary.simpleMessage("虛擬"), "xuni" : MessageLookupByLibrary.simpleMessage("虛擬"),
"yaoqingrenshoujihao_" : m32, "yaoqingrenshoujihao_" : m32,
"yibangfuka" : MessageLookupByLibrary.simpleMessage("已綁副卡"), "yibangfuka" : MessageLookupByLibrary.simpleMessage("已綁副卡"),

10
lib/generated/l10n.dart

@ -5625,6 +5625,16 @@ class S {
); );
} }
/// ``
String get xuanji {
return Intl.message(
'选集',
name: 'xuanji',
desc: '',
args: [],
);
}
/// `使` /// `使`
String get privacy_policy4 { String get privacy_policy4 {
return Intl.message( return Intl.message(

36
lib/home/home_page.dart

@ -27,6 +27,7 @@ import 'package:huixiang/utils/event_type.dart';
import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/invite_success_dialog.dart'; import 'package:huixiang/view_widget/invite_success_dialog.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/new_people_reward.dart';
import 'package:huixiang/view_widget/request_permission.dart'; import 'package:huixiang/view_widget/request_permission.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
@ -38,9 +39,10 @@ import 'home_view/shortcut_operation.dart';
class HomePage extends StatefulWidget { class HomePage extends StatefulWidget {
final Function changeTab; final Function changeTab;
final String invite; final String invite;
final List<CouponList> couponList; final List<InterviewCouponList> interviewCouponList;
final List<NewUserCouponList> newUserCouponList;
HomePage(this.changeTab, {this.invite,this.couponList}); HomePage(this.changeTab, {this.invite,this.interviewCouponList,this.newUserCouponList});
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -61,18 +63,32 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
} }
}); });
if((widget.invite??"") != "" || widget.couponList != null if((widget.invite??"") != "" || widget.interviewCouponList != null
&& widget.couponList.length > 0) && widget.interviewCouponList.length > 0)
showInvite = true; showInvite = true;
if(widget.newUserCouponList != null && widget.newUserCouponList.length > 0)
showNew = true;
} }
/// ///
inviteShowAlertDialog(invite,CouponList couponList) { inviteShowAlertDialog(invite,InterviewCouponList interviewCouponList) {
// //
showDialog( showDialog(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return InviteSuccessDialog(invite,couponList); return InviteSuccessDialog(invite,interviewCouponList);
},
);
}
///
newShowAlertDialog(newUserCouponList) {
//
showDialog(
context: context,
builder: (BuildContext context) {
return NewPeopleReward(newUserCouponList);
}, },
); );
} }
@ -82,6 +98,7 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
String categoryId; String categoryId;
int pageNum = 1; int pageNum = 1;
bool showInvite = false; bool showInvite = false;
bool showNew = false;
//1-2-3- //1-2-3-
int orderType = 1; int orderType = 1;
@ -215,10 +232,13 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
} }
EasyLoading.dismiss(); EasyLoading.dismiss();
if(showInvite){ if(showInvite){
inviteShowAlertDialog(widget.invite,widget.couponList[0]); inviteShowAlertDialog(widget.invite,widget.interviewCouponList[0]);
showInvite = false; showInvite = false;
} }
if(showNew){
newShowAlertDialog(widget.newUserCouponList);
showNew = false;
}
} }
@override @override

6
lib/home/home_view/featured_acticvity.dart

@ -86,7 +86,7 @@ class _FeaturedActivity extends State<FeaturedActivity> {
image: NetworkImage( image: NetworkImage(
activityList[0].coverImg, activityList[0].coverImg,
), ),
fit: BoxFit.cover, fit: BoxFit.fill,
), ),
), ),
), ),
@ -113,7 +113,7 @@ class _FeaturedActivity extends State<FeaturedActivity> {
image: NetworkImage( image: NetworkImage(
activityList[1].coverImg, activityList[1].coverImg,
), ),
fit: BoxFit.cover, fit: BoxFit.fill,
), ),
), ),
), ),
@ -138,7 +138,7 @@ class _FeaturedActivity extends State<FeaturedActivity> {
image: NetworkImage( image: NetworkImage(
activityList[2].coverImg, activityList[2].coverImg,
), ),
fit: BoxFit.cover, fit: BoxFit.fill,
), ),
), ),
), ),

1
lib/l10n/intl_en.arb

@ -583,6 +583,7 @@
"qingshuruyaoqingma": "请输入邀请码", "qingshuruyaoqingma": "请输入邀请码",
"invite_code_error": "邀请码输入错误", "invite_code_error": "邀请码输入错误",
"yaoqingwancheng": "邀请完成", "yaoqingwancheng": "邀请完成",
"xuanji": "选集",

1
lib/l10n/intl_zh_CN.arb

@ -580,6 +580,7 @@
"input_invite_code_hide": "填写邀请码", "input_invite_code_hide": "填写邀请码",
"qingshuruyaoqingma": "请输入邀请码", "qingshuruyaoqingma": "请输入邀请码",
"invite_code_error": "邀请码输入错误", "invite_code_error": "邀请码输入错误",
"xuanji": "选集",

1
lib/l10n/intl_zh_Hans_CN.arb

@ -580,6 +580,7 @@
"input_invite_code_hide": "填写邀请码", "input_invite_code_hide": "填写邀请码",
"qingshuruyaoqingma": "请输入邀请码", "qingshuruyaoqingma": "请输入邀请码",
"invite_code_error": "邀请码输入错误", "invite_code_error": "邀请码输入错误",
"xuanji": "选集",

1
lib/l10n/intl_zh_Hant_CN.arb

@ -574,6 +574,7 @@
"input_invite_code_hide": "填寫邀請碼", "input_invite_code_hide": "填寫邀請碼",
"qingshuruyaoqingma": "請輸入邀請碼", "qingshuruyaoqingma": "請輸入邀請碼",
"invite_code_error": "邀請碼輸入錯誤", "invite_code_error": "邀請碼輸入錯誤",
"xuanji": "選集",

1
lib/l10n/intl_zh_TW.arb

@ -574,6 +574,7 @@
"input_invite_code_hide": "填寫邀請碼", "input_invite_code_hide": "填寫邀請碼",
"qingshuruyaoqingma": "請輸入邀請碼", "qingshuruyaoqingma": "請輸入邀請碼",
"invite_code_error": "邀請碼輸入錯誤", "invite_code_error": "邀請碼輸入錯誤",
"xuanji": "選集",

24
lib/login/login_page.dart

@ -341,7 +341,8 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
Navigator.of(context).pushNamedAndRemoveUntil( Navigator.of(context).pushNamedAndRemoveUntil(
'/router/main_page', '/router/main_page',
(route) => false,arguments:{"invite":invite,"couponList":value.data.couponList}); (route) => false,arguments:{"invite":invite,"interviewCouponList":value.data.interviewCouponList,
"newUserCouponList":value.data.newUserCouponList});
EasyLoading.dismiss(); EasyLoading.dismiss();
} else { } else {
@ -780,7 +781,6 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
), ),
Container( Container(
height: 40.h, height: 40.h,
// margin: EdgeInsets.only(top: 12.h),
width: MediaQuery.of(context).size.width - 80.h, width: MediaQuery.of(context).size.width - 80.h,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
@ -884,16 +884,16 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
), ),
SizedBox( SizedBox(
height:25.h, height:25.h,
child: Visibility( // child: Visibility(
visible: statusPhoneVisible, // visible: statusPhoneVisible,
child: Text( // child: Text(
S.of(context).phone_error, // S.of(context).phone_error,
style: TextStyle( // style: TextStyle(
color: Color(0xFFF72626), // color: Color(0xFFF72626),
fontSize: 12.sp, // fontSize: 12.sp,
), // ),
), // ),
), // ),
), ),
GestureDetector( GestureDetector(
onTap: (){ onTap: (){

12
lib/main.dart

@ -298,7 +298,8 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
'/router/address_map_page': (context, {arguments}) => AddressMapPage(), '/router/address_map_page': (context, {arguments}) => AddressMapPage(),
'/router/roll_center_page': (context, {arguments}) => RollCenterPage(), '/router/roll_center_page': (context, {arguments}) => RollCenterPage(),
'/router/release_dynamic': (context, {arguments}) => ReleaseDynamic(), '/router/release_dynamic': (context, {arguments}) => ReleaseDynamic(),
'/router/community_details': (context, {arguments}) => CommunityDetails(arguments: arguments), '/router/community_details': (context, {arguments}) =>
CommunityDetails(arguments: arguments),
'/router/user_info_page': (context, {arguments}) => UserInfoPage(), '/router/user_info_page': (context, {arguments}) => UserInfoPage(),
'/router/recharge_page': (context, {arguments}) => RechargePage(), '/router/recharge_page': (context, {arguments}) => RechargePage(),
'/router/mine_wallet': (context, {arguments}) => MineWalletPage(), '/router/mine_wallet': (context, {arguments}) => MineWalletPage(),
@ -318,7 +319,10 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
'/router/communityFollow': (context, {arguments}) => CommunityFollow(), '/router/communityFollow': (context, {arguments}) => CommunityFollow(),
'/router/releasePage': (context, {arguments}) => ReleasePage(), '/router/releasePage': (context, {arguments}) => ReleasePage(),
'/router/activity_list': (context, {arguments}) => ActivityList(), '/router/activity_list': (context, {arguments}) => ActivityList(),
'/router/class_details': (context, {arguments}) => ClassDetails(arguments: arguments), '/router/class_details': (context, {arguments}) =>
'/router/mine_attainment_page': (context, {arguments}) => MineAttainmentPage(arguments: arguments), ClassDetails(arguments: arguments),
'/router/headlines_column_details': (context, {arguments}) => HeadlinesColumnDetails(arguments: arguments), '/router/mine_attainment_page': (context, {arguments}) =>
MineAttainmentPage(arguments: arguments),
'/router/headlines_column_details': (context, {arguments}) =>
HeadlinesColumnDetails(arguments: arguments),
}; };

14
lib/main_page.dart

@ -10,7 +10,6 @@ import 'package:huixiang/home/home_page.dart';
import 'package:huixiang/main.dart'; import 'package:huixiang/main.dart';
import 'package:huixiang/mine/mine_page.dart'; import 'package:huixiang/mine/mine_page.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/login_info.dart';
import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/data/user_info.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/union/union_page.dart'; import 'package:huixiang/union/union_page.dart';
@ -82,20 +81,25 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
pushRoute(); pushRoute();
String invite = ""; String invite = "";
var couponList; var interviewCouponList;
var newUserCouponList;
if(widget.arguments != null && (widget.arguments["invite"]??"") != "" if(widget.arguments != null && (widget.arguments["invite"]??"") != ""
&& widget.arguments["couponList"] != null ){ && widget.arguments["interviewCouponList"] != null ){
invite = widget.arguments["invite"]; invite = widget.arguments["invite"];
couponList = widget.arguments["couponList"]; interviewCouponList = widget.arguments["interviewCouponList"];
} }
if(widget.arguments != null && widget.arguments["newUserCouponList"] != null ){
newUserCouponList = widget.arguments["newUserCouponList"];
}
_widgetOptions = <Widget>[ _widgetOptions = <Widget>[
// BrandPage(), // BrandPage(),
HomePage((index) { HomePage((index) {
setState(() { setState(() {
pageController.jumpToPage(index); pageController.jumpToPage(index);
}); });
},invite:invite,couponList:couponList), },invite:invite,interviewCouponList:interviewCouponList,newUserCouponList:newUserCouponList,),
// MainHomePage(), // MainHomePage(),
UnionPage(), UnionPage(),
CommunityPage(), CommunityPage(),

49
lib/mine/mine_vip/legal_right_details.dart

@ -124,7 +124,7 @@ class _LegalRightDetails extends State<LegalRightDetails> {
// checkIndex * 85)), // checkIndex * 85)),
child: ListView.builder( child: ListView.builder(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
physics: NeverScrollableScrollPhysics(), physics: BouncingScrollPhysics(),
controller: _scrollController, controller: _scrollController,
shrinkWrap: true, shrinkWrap: true,
padding: EdgeInsets.symmetric(horizontal: 10), padding: EdgeInsets.symmetric(horizontal: 10),
@ -134,29 +134,30 @@ class _LegalRightDetails extends State<LegalRightDetails> {
onTap: () { onTap: () {
setState(() { setState(() {
if (checkIndex == position) return; if (checkIndex == position) return;
offsetOnEnd = position - checkIndex < 0 && position != 0; // offsetOnEnd = position - checkIndex < 0 && position != 0;
int jumpIndex = (position - checkIndex).abs(); // int jumpIndex = (position - checkIndex).abs();
int maxCountInWidth = // int maxCountInWidth =
MediaQuery.of(context).size.width ~/ 80; // MediaQuery.of(context).size.width ~/ 80;
int tempPosition = checkIndex; // int tempPosition = checkIndex;
for (var i = 0; i < jumpIndex; i++) { // for (var i = 0; i < jumpIndex; i++) {
if (position - checkIndex < 0) // if (position - checkIndex < 0)
tempPosition -= 1; // tempPosition -= 1;
else // else
tempPosition += 1; // tempPosition += 1;
checkIndex = tempPosition; // checkIndex = tempPosition;
if (tempPosition <= // if (tempPosition <=
vipBenefitList.length - maxCountInWidth) { // vipBenefitList.length - maxCountInWidth) {
if (tempPosition != 0) // if (tempPosition != 0)
_scrollController.jumpTo((_scrollController.offset + // _scrollController.jumpTo((_scrollController.offset +
(offsetOnEnd ? -85 : 85)) // (offsetOnEnd ? -85 : 85))
.toDouble()); // .toDouble());
} else { // } else {
_scrollController.jumpTo( // _scrollController.jumpTo(
((vipBenefitList.length - maxCountInWidth) * 85) // ((vipBenefitList.length - maxCountInWidth) * 85)
.toDouble()); // .toDouble());
} // }
} // }
checkIndex = position;
}); });
}, },
child: legalRightItem(vipBenefitList[position], position), child: legalRightItem(vipBenefitList[position], position),

395
lib/retrofit/data/login_info.dart

@ -1,36 +1,50 @@
/// authInfo : {"token":"eyJ0eXAiOiJKc29uV2ViVG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX3R5cGUiOiJQTEFURk9STV9BUFAiLCJuYW1lIjoi5pav5Z-65LuUIiwidG9rZW5fdHlwZSI6InRva2VuIiwidXNlcmlkIjoiMTQ2Mzc1MTMwMjYzNzk0NDgzMiIsImFjY291bnQiOiIxNTM5Mjk0OTA5NyIsImV4cCI6MTY0MTAwMzg4NSwibmJmIjoxNjM4NDExODg1fQ.3ioTF8ofxKeoIlT_KriPHjjpJVzB3orh6rNCYrN5auA","tokenType":"token","refreshToken":"eyJ0eXAiOiJKc29uV2ViVG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaF90b2tlbiIsInVzZXJpZCI6IjE0NjM3NTEzMDI2Mzc5NDQ4MzIiLCJleHAiOjE2NDEwMDM4ODUsIm5iZiI6MTYzODQxMTg4NX0.kePPEJDAKhgGyJRzlo4OvZ_OWPYi4O6RFWsSc7cdmhU","name":"斯基仔","account":"15392949097","avatar":null,"workDescribe":null,"userId":"1463751302637944832","userType":"PLATFORM_APP","expire":"2592000","expiration":"2022-01-01 10:24:45","mobile":"15392949097"} /// authInfo : {"token":"eyJ0eXAiOiJKc29uV2ViVG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX3R5cGUiOiJQTEFURk9STV9BUFAiLCJuYW1lIjoi5Zue5LmhXzg4ODg4OCIsInRva2VuX3R5cGUiOiJ0b2tlbiIsInVzZXJpZCI6IjE0NzA3MDI1OTIzMDM1NjI3NTIiLCJhY2NvdW50IjoiMTU2MTU2OTg3NDUiLCJleHAiOjE2NDIwNjk3OTksIm5iZiI6MTYzOTQ3Nzc5OX0.KHiw51SQ2RkARJhGKFTXgI7IrYXOhN-YqFZCwJ1jkEc","tokenType":"token","refreshToken":"eyJ0eXAiOiJKc29uV2ViVG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaF90b2tlbiIsInVzZXJpZCI6IjE0NzA3MDI1OTIzMDM1NjI3NTIiLCJleHAiOjE2NDIwNjk3OTksIm5iZiI6MTYzOTQ3Nzc5OX0.jjI0dTviahPq6p4J_tx_Sn-Fg-q51kE3WPpqdVcEIMw","name":"回乡_888888","account":"15615698745","avatar":null,"workDescribe":null,"userId":"1470702592303562752","userType":"PLATFORM_APP","expire":"2592000","expiration":"2022-01-13 18:29:59","mobile":"15615698745"}
/// couponList : [{"id":"1463398002331746304","createTime":"2021-11-24 14:44:07","createUser":"1333246101196636160","updateTime":"2021-11-24 14:44:07","updateUser":"1333246101196636160","storeId":"0","couponName":"满10-2","bizType":1,"allProduct":true,"productSkuId":[],"fullAmount":"10.00","discountAmount":"2.00","fullNumber":1,"discountPercent":100,"sellPrice":"0.00","sellCount":0,"bizId":"","publishStartTime":"2021-11-24 12:00:00","publishEndTime":"2021-11-30 12:00:00","useStartTime":"2021-11-24 12:00:00","useEndTime":"2021-11-30 12:00:00","promotionId":"0","dateOrDay":false,"startAfterDays":0,"daysValidate":0,"centreDisplay":true,"tenantCode":"1175","isDelete":0,"storeName":"海峡姐妹奶茶店","number":1}] /// interviewCouponList : [{"id":"1463398002331746304","createTime":"2021-11-24 14:44:07","createUser":"1333246101196636160","updateTime":"2021-11-24 14:44:07","updateUser":"1333246101196636160","storeId":"0","couponName":"满10-2","bizType":1,"allProduct":true,"productSkuId":[],"fullAmount":"10.00","discountAmount":"2.00","fullNumber":1,"discountPercent":100,"sellPrice":"0.00","sellCount":0,"bizId":"","publishStartTime":"2021-11-24 12:00:00","publishEndTime":"2021-11-30 12:00:00","useStartTime":"2021-11-24 12:00:00","useEndTime":"2021-11-30 12:00:00","promotionId":"0","dateOrDay":false,"startAfterDays":0,"daysValidate":0,"businessType":0,"centreDisplay":true,"tenantCode":"1175","isDelete":0,"storeName":"海峡姐妹奶茶店","number":1}]
/// newUserCouponList : [{"id":"1463398002331746304","createTime":"2021-11-24 14:44:07","createUser":"1333246101196636160","updateTime":"2021-11-24 14:44:07","updateUser":"1333246101196636160","storeId":"0","couponName":"满10-2","bizType":1,"allProduct":true,"productSkuId":[],"fullAmount":"10.00","discountAmount":"2.00","fullNumber":1,"discountPercent":100,"sellPrice":"0.00","sellCount":0,"bizId":"","publishStartTime":"2021-11-24 12:00:00","publishEndTime":"2021-11-30 12:00:00","useStartTime":"2021-11-24 12:00:00","useEndTime":"2021-11-30 12:00:00","promotionId":"0","dateOrDay":false,"startAfterDays":0,"daysValidate":0,"businessType":0,"centreDisplay":true,"tenantCode":"1175","isDelete":0,"storeName":"海峡姐妹奶茶店","number":1},{"id":"1463398002331746304","createTime":"2021-11-24 14:44:07","createUser":"1333246101196636160","updateTime":"2021-11-24 14:44:07","updateUser":"1333246101196636160","storeId":"0","couponName":"满10-2","bizType":1,"allProduct":true,"productSkuId":[],"fullAmount":"10.00","discountAmount":"2.00","fullNumber":1,"discountPercent":100,"sellPrice":"0.00","sellCount":0,"bizId":"","publishStartTime":"2021-11-24 12:00:00","publishEndTime":"2021-11-30 12:00:00","useStartTime":"2021-11-24 12:00:00","useEndTime":"2021-11-30 12:00:00","promotionId":"0","dateOrDay":false,"startAfterDays":0,"daysValidate":0,"businessType":0,"centreDisplay":true,"tenantCode":"1175","isDelete":0,"storeName":"海峡姐妹奶茶店","number":1},{"id":"1463398002331746304","createTime":"2021-11-24 14:44:07","createUser":"1333246101196636160","updateTime":"2021-11-24 14:44:07","updateUser":"1333246101196636160","storeId":"0","couponName":"满10-2","bizType":1,"allProduct":true,"productSkuId":[],"fullAmount":"10.00","discountAmount":"2.00","fullNumber":1,"discountPercent":100,"sellPrice":"0.00","sellCount":0,"bizId":"","publishStartTime":"2021-11-24 12:00:00","publishEndTime":"2021-11-30 12:00:00","useStartTime":"2021-11-24 12:00:00","useEndTime":"2021-11-30 12:00:00","promotionId":"0","dateOrDay":false,"startAfterDays":0,"daysValidate":0,"businessType":0,"centreDisplay":true,"tenantCode":"1175","isDelete":0,"storeName":"海峡姐妹奶茶店","number":1}]
class LoginInfo { class LoginInfo {
LoginInfo({ LoginInfo({
AuthInfo authInfo, AuthInfo authInfo,
List<CouponList> couponList,}){ List<InterviewCouponList> interviewCouponList,
List<NewUserCouponList> newUserCouponList,}){
_authInfo = authInfo; _authInfo = authInfo;
_couponList = couponList; _interviewCouponList = interviewCouponList;
} _newUserCouponList = newUserCouponList;
}
LoginInfo.fromJson(dynamic json) { LoginInfo.fromJson(dynamic json) {
_authInfo = json['authInfo'] != null ? AuthInfo.fromJson(json['authInfo']) : null; _authInfo = json['authInfo'] != null ? AuthInfo.fromJson(json['authInfo']) : null;
if (json['couponList'] != null) { if (json['interviewCouponList'] != null) {
_couponList = []; _interviewCouponList = [];
json['couponList'].forEach((v) { json['interviewCouponList'].forEach((v) {
_couponList.add(CouponList.fromJson(v)); _interviewCouponList.add(InterviewCouponList.fromJson(v));
});
}
if (json['newUserCouponList'] != null) {
_newUserCouponList = [];
json['newUserCouponList'].forEach((v) {
_newUserCouponList.add(NewUserCouponList.fromJson(v));
}); });
} }
} }
AuthInfo _authInfo; AuthInfo _authInfo;
List<CouponList> _couponList; List<InterviewCouponList> _interviewCouponList;
List<NewUserCouponList> _newUserCouponList;
AuthInfo get authInfo => _authInfo; AuthInfo get authInfo => _authInfo;
List<CouponList> get couponList => _couponList; List<InterviewCouponList> get interviewCouponList => _interviewCouponList;
List<NewUserCouponList> get newUserCouponList => _newUserCouponList;
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final map = <String, dynamic>{}; final map = <String, dynamic>{};
if (_authInfo != null) { if (_authInfo != null) {
map['authInfo'] = _authInfo.toJson(); map['authInfo'] = _authInfo.toJson();
} }
if (_couponList != null) { if (_interviewCouponList != null) {
map['couponList'] = _couponList.map((v) => v.toJson()).toList(); map['interviewCouponList'] = _interviewCouponList.map((v) => v.toJson()).toList();
}
if (_newUserCouponList != null) {
map['newUserCouponList'] = _newUserCouponList.map((v) => v.toJson()).toList();
} }
return map; return map;
} }
@ -62,44 +76,46 @@ class LoginInfo {
/// dateOrDay : false /// dateOrDay : false
/// startAfterDays : 0 /// startAfterDays : 0
/// daysValidate : 0 /// daysValidate : 0
/// businessType : 0
/// centreDisplay : true /// centreDisplay : true
/// tenantCode : "1175" /// tenantCode : "1175"
/// isDelete : 0 /// isDelete : 0
/// storeName : "海峡姐妹奶茶店" /// storeName : "海峡姐妹奶茶店"
/// number : 1 /// number : 1
class CouponList { class NewUserCouponList {
CouponList({ NewUserCouponList({
String id, String id,
String createTime, String createTime,
String createUser, String createUser,
String updateTime, String updateTime,
String updateUser, String updateUser,
String storeId, String storeId,
String couponName, String couponName,
int bizType, int bizType,
bool allProduct, bool allProduct,
// List<dynamic> productSkuId, List<dynamic> productSkuId,
String fullAmount, String fullAmount,
String discountAmount, String discountAmount,
int fullNumber, int fullNumber,
int discountPercent, int discountPercent,
String sellPrice, String sellPrice,
int sellCount, int sellCount,
String bizId, String bizId,
String publishStartTime, String publishStartTime,
String publishEndTime, String publishEndTime,
String useStartTime, String useStartTime,
String useEndTime, String useEndTime,
String promotionId, String promotionId,
bool dateOrDay, bool dateOrDay,
int startAfterDays, int startAfterDays,
int daysValidate, int daysValidate,
bool centreDisplay, int businessType,
String tenantCode, bool centreDisplay,
int isDelete, String tenantCode,
String storeName, int isDelete,
int number,}){ String storeName,
int number,}){
_id = id; _id = id;
_createTime = createTime; _createTime = createTime;
_createUser = createUser; _createUser = createUser;
@ -125,14 +141,255 @@ class CouponList {
_dateOrDay = dateOrDay; _dateOrDay = dateOrDay;
_startAfterDays = startAfterDays; _startAfterDays = startAfterDays;
_daysValidate = daysValidate; _daysValidate = daysValidate;
_businessType = businessType;
_centreDisplay = centreDisplay; _centreDisplay = centreDisplay;
_tenantCode = tenantCode; _tenantCode = tenantCode;
_isDelete = isDelete; _isDelete = isDelete;
_storeName = storeName; _storeName = storeName;
_number = number; _number = number;
}
NewUserCouponList.fromJson(dynamic json) {
_id = json['id'];
_createTime = json['createTime'];
_createUser = json['createUser'];
_updateTime = json['updateTime'];
_updateUser = json['updateUser'];
_storeId = json['storeId'];
_couponName = json['couponName'];
_bizType = json['bizType'];
_allProduct = json['allProduct'];
// if (json['productSkuId'] != null) {
// _productSkuId = [];
// json['productSkuId'].forEach((v) {
// _productSkuId.add(dynamic.fromJson(v));
// });
// }
_fullAmount = json['fullAmount'];
_discountAmount = json['discountAmount'];
_fullNumber = json['fullNumber'];
_discountPercent = json['discountPercent'];
_sellPrice = json['sellPrice'];
_sellCount = json['sellCount'];
_bizId = json['bizId'];
_publishStartTime = json['publishStartTime'];
_publishEndTime = json['publishEndTime'];
_useStartTime = json['useStartTime'];
_useEndTime = json['useEndTime'];
_promotionId = json['promotionId'];
_dateOrDay = json['dateOrDay'];
_startAfterDays = json['startAfterDays'];
_daysValidate = json['daysValidate'];
_businessType = json['businessType'];
_centreDisplay = json['centreDisplay'];
_tenantCode = json['tenantCode'];
_isDelete = json['isDelete'];
_storeName = json['storeName'];
_number = json['number'];
}
String _id;
String _createTime;
String _createUser;
String _updateTime;
String _updateUser;
String _storeId;
String _couponName;
int _bizType;
bool _allProduct;
// List<dynamic> _productSkuId;
String _fullAmount;
String _discountAmount;
int _fullNumber;
int _discountPercent;
String _sellPrice;
int _sellCount;
String _bizId;
String _publishStartTime;
String _publishEndTime;
String _useStartTime;
String _useEndTime;
String _promotionId;
bool _dateOrDay;
int _startAfterDays;
int _daysValidate;
int _businessType;
bool _centreDisplay;
String _tenantCode;
int _isDelete;
String _storeName;
int _number;
String get id => _id;
String get createTime => _createTime;
String get createUser => _createUser;
String get updateTime => _updateTime;
String get updateUser => _updateUser;
String get storeId => _storeId;
String get couponName => _couponName;
int get bizType => _bizType;
bool get allProduct => _allProduct;
// List<dynamic> get productSkuId => _productSkuId;
String get fullAmount => _fullAmount;
String get discountAmount => _discountAmount;
int get fullNumber => _fullNumber;
int get discountPercent => _discountPercent;
String get sellPrice => _sellPrice;
int get sellCount => _sellCount;
String get bizId => _bizId;
String get publishStartTime => _publishStartTime;
String get publishEndTime => _publishEndTime;
String get useStartTime => _useStartTime;
String get useEndTime => _useEndTime;
String get promotionId => _promotionId;
bool get dateOrDay => _dateOrDay;
int get startAfterDays => _startAfterDays;
int get daysValidate => _daysValidate;
int get businessType => _businessType;
bool get centreDisplay => _centreDisplay;
String get tenantCode => _tenantCode;
int get isDelete => _isDelete;
String get storeName => _storeName;
int get number => _number;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = _id;
map['createTime'] = _createTime;
map['createUser'] = _createUser;
map['updateTime'] = _updateTime;
map['updateUser'] = _updateUser;
map['storeId'] = _storeId;
map['couponName'] = _couponName;
map['bizType'] = _bizType;
map['allProduct'] = _allProduct;
// if (_productSkuId != null) {
// map['productSkuId'] = _productSkuId.map((v) => v.toJson()).toList();
// }
map['fullAmount'] = _fullAmount;
map['discountAmount'] = _discountAmount;
map['fullNumber'] = _fullNumber;
map['discountPercent'] = _discountPercent;
map['sellPrice'] = _sellPrice;
map['sellCount'] = _sellCount;
map['bizId'] = _bizId;
map['publishStartTime'] = _publishStartTime;
map['publishEndTime'] = _publishEndTime;
map['useStartTime'] = _useStartTime;
map['useEndTime'] = _useEndTime;
map['promotionId'] = _promotionId;
map['dateOrDay'] = _dateOrDay;
map['startAfterDays'] = _startAfterDays;
map['daysValidate'] = _daysValidate;
map['businessType'] = _businessType;
map['centreDisplay'] = _centreDisplay;
map['tenantCode'] = _tenantCode;
map['isDelete'] = _isDelete;
map['storeName'] = _storeName;
map['number'] = _number;
return map;
}
} }
CouponList.fromJson(dynamic json) { /// id : "1463398002331746304"
/// createTime : "2021-11-24 14:44:07"
/// createUser : "1333246101196636160"
/// updateTime : "2021-11-24 14:44:07"
/// updateUser : "1333246101196636160"
/// storeId : "0"
/// couponName : "满10-2"
/// bizType : 1
/// allProduct : true
/// productSkuId : []
/// fullAmount : "10.00"
/// discountAmount : "2.00"
/// fullNumber : 1
/// discountPercent : 100
/// sellPrice : "0.00"
/// sellCount : 0
/// bizId : ""
/// publishStartTime : "2021-11-24 12:00:00"
/// publishEndTime : "2021-11-30 12:00:00"
/// useStartTime : "2021-11-24 12:00:00"
/// useEndTime : "2021-11-30 12:00:00"
/// promotionId : "0"
/// dateOrDay : false
/// startAfterDays : 0
/// daysValidate : 0
/// businessType : 0
/// centreDisplay : true
/// tenantCode : "1175"
/// isDelete : 0
/// storeName : "海峡姐妹奶茶店"
/// number : 1
class InterviewCouponList {
InterviewCouponList({
String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
String storeId,
String couponName,
int bizType,
bool allProduct,
List<dynamic> productSkuId,
String fullAmount,
String discountAmount,
int fullNumber,
int discountPercent,
String sellPrice,
int sellCount,
String bizId,
String publishStartTime,
String publishEndTime,
String useStartTime,
String useEndTime,
String promotionId,
bool dateOrDay,
int startAfterDays,
int daysValidate,
int businessType,
bool centreDisplay,
String tenantCode,
int isDelete,
String storeName,
int number,}){
_id = id;
_createTime = createTime;
_createUser = createUser;
_updateTime = updateTime;
_updateUser = updateUser;
_storeId = storeId;
_couponName = couponName;
_bizType = bizType;
_allProduct = allProduct;
// _productSkuId = productSkuId;
_fullAmount = fullAmount;
_discountAmount = discountAmount;
_fullNumber = fullNumber;
_discountPercent = discountPercent;
_sellPrice = sellPrice;
_sellCount = sellCount;
_bizId = bizId;
_publishStartTime = publishStartTime;
_publishEndTime = publishEndTime;
_useStartTime = useStartTime;
_useEndTime = useEndTime;
_promotionId = promotionId;
_dateOrDay = dateOrDay;
_startAfterDays = startAfterDays;
_daysValidate = daysValidate;
_businessType = businessType;
_centreDisplay = centreDisplay;
_tenantCode = tenantCode;
_isDelete = isDelete;
_storeName = storeName;
_number = number;
}
InterviewCouponList.fromJson(dynamic json) {
_id = json['id']; _id = json['id'];
_createTime = json['createTime']; _createTime = json['createTime'];
_createUser = json['createUser']; _createUser = json['createUser'];
@ -163,6 +420,7 @@ class CouponList {
_dateOrDay = json['dateOrDay']; _dateOrDay = json['dateOrDay'];
_startAfterDays = json['startAfterDays']; _startAfterDays = json['startAfterDays'];
_daysValidate = json['daysValidate']; _daysValidate = json['daysValidate'];
_businessType = json['businessType'];
_centreDisplay = json['centreDisplay']; _centreDisplay = json['centreDisplay'];
_tenantCode = json['tenantCode']; _tenantCode = json['tenantCode'];
_isDelete = json['isDelete']; _isDelete = json['isDelete'];
@ -194,6 +452,7 @@ class CouponList {
bool _dateOrDay; bool _dateOrDay;
int _startAfterDays; int _startAfterDays;
int _daysValidate; int _daysValidate;
int _businessType;
bool _centreDisplay; bool _centreDisplay;
String _tenantCode; String _tenantCode;
int _isDelete; int _isDelete;
@ -225,6 +484,7 @@ class CouponList {
bool get dateOrDay => _dateOrDay; bool get dateOrDay => _dateOrDay;
int get startAfterDays => _startAfterDays; int get startAfterDays => _startAfterDays;
int get daysValidate => _daysValidate; int get daysValidate => _daysValidate;
int get businessType => _businessType;
bool get centreDisplay => _centreDisplay; bool get centreDisplay => _centreDisplay;
String get tenantCode => _tenantCode; String get tenantCode => _tenantCode;
int get isDelete => _isDelete; int get isDelete => _isDelete;
@ -260,6 +520,7 @@ class CouponList {
map['dateOrDay'] = _dateOrDay; map['dateOrDay'] = _dateOrDay;
map['startAfterDays'] = _startAfterDays; map['startAfterDays'] = _startAfterDays;
map['daysValidate'] = _daysValidate; map['daysValidate'] = _daysValidate;
map['businessType'] = _businessType;
map['centreDisplay'] = _centreDisplay; map['centreDisplay'] = _centreDisplay;
map['tenantCode'] = _tenantCode; map['tenantCode'] = _tenantCode;
map['isDelete'] = _isDelete; map['isDelete'] = _isDelete;
@ -270,33 +531,33 @@ class CouponList {
} }
/// token : "eyJ0eXAiOiJKc29uV2ViVG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX3R5cGUiOiJQTEFURk9STV9BUFAiLCJuYW1lIjoi5pav5Z-65LuUIiwidG9rZW5fdHlwZSI6InRva2VuIiwidXNlcmlkIjoiMTQ2Mzc1MTMwMjYzNzk0NDgzMiIsImFjY291bnQiOiIxNTM5Mjk0OTA5NyIsImV4cCI6MTY0MTAwMzg4NSwibmJmIjoxNjM4NDExODg1fQ.3ioTF8ofxKeoIlT_KriPHjjpJVzB3orh6rNCYrN5auA" /// token : "eyJ0eXAiOiJKc29uV2ViVG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX3R5cGUiOiJQTEFURk9STV9BUFAiLCJuYW1lIjoi5Zue5LmhXzg4ODg4OCIsInRva2VuX3R5cGUiOiJ0b2tlbiIsInVzZXJpZCI6IjE0NzA3MDI1OTIzMDM1NjI3NTIiLCJhY2NvdW50IjoiMTU2MTU2OTg3NDUiLCJleHAiOjE2NDIwNjk3OTksIm5iZiI6MTYzOTQ3Nzc5OX0.KHiw51SQ2RkARJhGKFTXgI7IrYXOhN-YqFZCwJ1jkEc"
/// tokenType : "token" /// tokenType : "token"
/// refreshToken : "eyJ0eXAiOiJKc29uV2ViVG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaF90b2tlbiIsInVzZXJpZCI6IjE0NjM3NTEzMDI2Mzc5NDQ4MzIiLCJleHAiOjE2NDEwMDM4ODUsIm5iZiI6MTYzODQxMTg4NX0.kePPEJDAKhgGyJRzlo4OvZ_OWPYi4O6RFWsSc7cdmhU" /// refreshToken : "eyJ0eXAiOiJKc29uV2ViVG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaF90b2tlbiIsInVzZXJpZCI6IjE0NzA3MDI1OTIzMDM1NjI3NTIiLCJleHAiOjE2NDIwNjk3OTksIm5iZiI6MTYzOTQ3Nzc5OX0.jjI0dTviahPq6p4J_tx_Sn-Fg-q51kE3WPpqdVcEIMw"
/// name : "斯基仔" /// name : "回乡_888888"
/// account : "15392949097" /// account : "15615698745"
/// avatar : null /// avatar : null
/// workDescribe : null /// workDescribe : null
/// userId : "1463751302637944832" /// userId : "1470702592303562752"
/// userType : "PLATFORM_APP" /// userType : "PLATFORM_APP"
/// expire : "2592000" /// expire : "2592000"
/// expiration : "2022-01-01 10:24:45" /// expiration : "2022-01-13 18:29:59"
/// mobile : "15392949097" /// mobile : "15615698745"
class AuthInfo { class AuthInfo {
AuthInfo({ AuthInfo({
String token, String token,
String tokenType, String tokenType,
String refreshToken, String refreshToken,
String name, String name,
String account, String account,
dynamic avatar, dynamic avatar,
dynamic workDescribe, dynamic workDescribe,
String userId, String userId,
String userType, String userType,
String expire, String expire,
String expiration, String expiration,
String mobile,}){ String mobile,}){
_token = token; _token = token;
_tokenType = tokenType; _tokenType = tokenType;
_refreshToken = refreshToken; _refreshToken = refreshToken;
@ -309,7 +570,7 @@ class AuthInfo {
_expire = expire; _expire = expire;
_expiration = expiration; _expiration = expiration;
_mobile = mobile; _mobile = mobile;
} }
AuthInfo.fromJson(dynamic json) { AuthInfo.fromJson(dynamic json) {
_token = json['token']; _token = json['token'];

8
lib/retrofit/min_api.dart

@ -24,8 +24,12 @@ part 'min_api.g.dart';
// const base_url = "https://pos.api.lotus-wallet.com/app/"; /// // const base_url = "https://pos.api.lotus-wallet.com/app/"; ///
// const baseUrl = "https://pos.api.lotus-wallet.com/app/"; /// // const baseUrl = "https://pos.api.lotus-wallet.com/app/"; ///
const base_url = "http://192.168.10.236:8765/app/";///
const baseUrl = "http://192.168.10.236:8765/app/";/// const base_url = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222
const baseUrl = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222
// const base_url = "http://192.168.10.236:8765/app/";///
// const baseUrl = "http://192.168.10.236:8765/app/";///
// const base_url = "http://192.168.10.37:8766/app/"; // const base_url = "http://192.168.10.37:8766/app/";

2
lib/retrofit/min_api.g.dart

@ -9,7 +9,7 @@ part of 'min_api.dart';
class _MinApiService implements MinApiService { class _MinApiService implements MinApiService {
_MinApiService(this._dio, {this.baseUrl}) { _MinApiService(this._dio, {this.baseUrl}) {
ArgumentError.checkNotNull(_dio, '_dio'); ArgumentError.checkNotNull(_dio, '_dio');
baseUrl ??= 'http://192.168.10.236:8765/app/'; baseUrl ??= 'http://user.prod.kunqi.lotus-wallet.com/app/';
} }
final Dio _dio; final Dio _dio;

11
lib/retrofit/retrofit_api.dart

@ -53,8 +53,11 @@ import 'data/wx_pay.dart';
part 'retrofit_api.g.dart'; part 'retrofit_api.g.dart';
const base_url = "https://pos.platform.lotus-wallet.com/app/"; /// // const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///
const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; /// // const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///
// const base_url = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222
// const baseUrl = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222
// const base_url = "http://192.168.10.236:8766/app/"; /// // const base_url = "http://192.168.10.236:8766/app/"; ///
// const baseUrl = "http://192.168.10.236:8766/app/"; /// // const baseUrl = "http://192.168.10.236:8766/app/"; ///
@ -63,8 +66,8 @@ const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///正式
// const baseUrl = "http://192.168.10.37:8766/app/"; // const baseUrl = "http://192.168.10.37:8766/app/";
// const base_url = "http://192.168.10.130:8766/app/";/// const base_url = "http://192.168.10.142:8766/app/";///
// const baseUrl = "http://192.168.10.130:8766/app/";/// const baseUrl = "http://192.168.10.142:8766/app/";///
@RestApi(baseUrl: baseUrl) @RestApi(baseUrl: baseUrl)
abstract class ApiService { abstract class ApiService {

2
lib/retrofit/retrofit_api.g.dart

@ -9,7 +9,7 @@ part of 'retrofit_api.dart';
class _ApiService implements ApiService { class _ApiService implements ApiService {
_ApiService(this._dio, {this.baseUrl}) { _ApiService(this._dio, {this.baseUrl}) {
ArgumentError.checkNotNull(_dio, '_dio'); ArgumentError.checkNotNull(_dio, '_dio');
baseUrl ??= 'https://pos.platform.lotus-wallet.com/app/'; baseUrl ??= 'http://192.168.10.142:8766/app/';
} }
final Dio _dio; final Dio _dio;

6
lib/view_widget/invite_success_dialog.dart

@ -9,9 +9,9 @@ import 'package:huixiang/view_widget/round_button.dart';
class InviteSuccessDialog extends StatefulWidget { class InviteSuccessDialog extends StatefulWidget {
final String invite; final String invite;
final CouponList couponList; final InterviewCouponList interviewCouponList;
InviteSuccessDialog(this.invite,this.couponList); InviteSuccessDialog(this.invite,this.interviewCouponList);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -72,7 +72,7 @@ class _InviteSuccessDialog extends State<InviteSuccessDialog> {
height: 1.5.h), height: 1.5.h),
children: [ children: [
TextSpan( TextSpan(
text:"${widget.couponList.storeName}${widget.couponList.couponName} * ${widget.couponList.bizType}", text:"${widget.interviewCouponList.storeName}${widget.interviewCouponList.couponName} * ${widget.interviewCouponList.bizType}",
style: TextStyle(color: Color(0xFF32A060),fontSize: 14.sp,fontWeight: MyFontWeight.regular), style: TextStyle(color: Color(0xFF32A060),fontSize: 14.sp,fontWeight: MyFontWeight.regular),
), ),
] ]

193
lib/view_widget/new_people_reward.dart

@ -0,0 +1,193 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/login_info.dart';
import 'package:huixiang/utils/flutter_utils.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:huixiang/view_widget/separator.dart';
class NewPeopleReward extends StatefulWidget {
final List<NewUserCouponList> newUserCouponList;
NewPeopleReward(this.newUserCouponList);
@override
State<StatefulWidget> createState() {
return _NewPeopleReward();
}
}
class _NewPeopleReward extends State<NewPeopleReward> {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(top: 70.h),
child: Column(
children: [
Container(
width: double.infinity,
height: 500.h,
padding: EdgeInsets.only(top: 210.h),
margin: EdgeInsets.only(top: 20.h, left: 20, right: 20),
decoration: BoxDecoration(
image: DecorationImage(
fit: BoxFit.fill,
image: AssetImage("assets/image/xin_ren.png"),
),
),
child: Column(
children: [
Expanded(
child: reward(),
),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
SmartDialog.showToast("领取成功");
},
child: Container(
margin: EdgeInsets.only(
left: 60.w, right: 60.w, top: 20.h, bottom: 10.h),
decoration: BoxDecoration(
gradient: new LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [
Color(0xFFFFDCA1),
Color(0xFFFAE4C0),
]),
borderRadius: BorderRadius.circular(22.5),
),
width: MediaQuery.of(context).size.width,
height: 40,
alignment: Alignment.center,
child: Text(
"立即领取",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14.sp,
color: Color(0xFF4A4748),
),
),
),
),
],
),
),
SizedBox(height: 35),
GestureDetector(
onTap: () {
setState(() {
Navigator.of(context).pop();
});
},
child: Image.asset(
"assets/image/yq_qx.png",
width: 34,
height: 34,
),
)
],
),
);
}
Widget reward() {
return ListView.builder(
padding: EdgeInsets.zero,
itemCount: widget.newUserCouponList.length,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {},
child: rewardItem(widget.newUserCouponList[position]),
);
},
);
}
Widget rewardItem(NewUserCouponList newUserCouponList) {
return Container(
height: 69.h,
width: double.infinity,
decoration: BoxDecoration(
image: DecorationImage(
fit: BoxFit.fill,
image: AssetImage("assets/image/xin_rq.png"),
),
),
margin: EdgeInsets.symmetric(horizontal: 60, vertical: 5),
padding: EdgeInsets.only(left: 16.w, right: 33.w),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text.rich(
TextSpan(
children: [
TextSpan(
text: "¥",
style: TextStyle(
fontSize: 25.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFFDE5F3B),
),
),
TextSpan(
text:newUserCouponList.discountAmount,
style: TextStyle(
fontSize: 35.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFFDE5F3B),
),
),
],
),
),
Padding(
padding: EdgeInsets.only(top: 4, bottom: 4),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
newUserCouponList.storeName,
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF181818),
),
),
Text(
newUserCouponList.couponName,
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFFD3623D),
),
),
Text(
"有效期至:${newUserCouponList.useEndTime}",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF727272),
),
)
],
)),
],
),
);
}
}
Loading…
Cancel
Save