Browse Source

优化头条列表;

增加新人奖励弹窗;
ff_new
w-R 3 years ago
parent
commit
e523308502
  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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.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/course_details.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/view_widget/tips_dialog.dart';
import 'package:huixiang/web/web_view/comment_list.dart';
@ -122,234 +122,237 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
margin: EdgeInsets.only(top:30),
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
children: [
Stack(
children: [
ClassDetailsVideo(key:videoKey,exitFull: (){setState(() {});},
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,
return AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle.light,
child: Material(child: Scaffold(
body: Container(
// margin: EdgeInsets.only(top:25),
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
children: [
Stack(
children: [
GestureDetector(
child: Image.asset(
"assets/image/integral_return.png",
width: 24,
height: 24,
ClassDetailsVideo(key:videoKey,exitFull: (){setState(() {});},
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: [
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),
padding: EdgeInsets.only(left: 16, top: 16, right: 10),
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 2),
blurRadius: 14,
spreadRadius: 0,
)
],
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
Container(
height: 123,
margin: EdgeInsets.only(bottom: 16.h),
padding: EdgeInsets.only(left: 16, top: 16, right: 10),
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 2),
blurRadius: 14,
spreadRadius: 0,
)
],
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: 22.h,
padding:EdgeInsets.only(left:2,right:2),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
border: Border.all(
width: 1,
color: Color(0xFFFF7A1A),
style: BorderStyle.solid,
),
),
child: Text(
(course?.tags != null &&
Row(
children: [
Container(
height: 22.h,
padding:EdgeInsets.only(left:2,right:2),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
border: Border.all(
width: 1,
color: Color(0xFFFF7A1A),
style: BorderStyle.solid,
),
),
child: Text(
(course?.tags != null &&
course.tags.length > 0)
? course.tags[0]
: "",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFFFF7A1A),
? course.tags[0]
: "",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
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(
width: 6.w,
height: 10.h,
),
Expanded(
child: Text(
course != null ? course.subject : "",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF1A1A1A),
),
Text(
course != null ? course.introduce : "",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Colors.black,
),
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(
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(
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),
),
),
),
],
),
],
),
anthology(),
CommentList(
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,
),
),
flex: 1,
),
///
InputComment(
inputKey,
hintText,
isKeyBoardShow,
commentFocus,
commentTextController,
_toComment,
_queryMemberComment,
_queryCourseLikes,
isLike: course?.selfLiked,
///
InputComment(
inputKey,
hintText,
isKeyBoardShow,
commentFocus,
commentTextController,
_toComment,
_queryMemberComment,
_queryCourseLikes,
isLike: course?.selfLiked,
),
],
),
],
),
),
),
),)
);
}
@ -365,7 +368,7 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"选集",
S.of(context).xuanji,
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.medium,

3
lib/community/community_view/class_details_video.dart

@ -90,7 +90,8 @@ class ClassDetailsVideoState extends State<ClassDetailsVideo> {
@override
Widget build(BuildContext context) {
return Container(key: globalKey,child:videoWidget(
return Container(
key: globalKey,child:videoWidget(
MediaQuery.of(context).size.width,
videoPlayerController != null
? (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';
class HomeClass extends StatefulWidget {
final Map<String,List<CourseList>> collectMap;
final Map<String, List<CourseList>> collectMap;
final List<CollectClassList> collectList;
HomeClass(this.collectMap,this.collectList);
HomeClass(this.collectMap, this.collectList);
@override
State<StatefulWidget> createState() {
return _HomeClass();
@ -34,7 +35,7 @@ class _HomeClass extends State<HomeClass> {
Widget build(BuildContext context) {
return ListView.builder(
padding: EdgeInsets.zero,
itemCount:widget.collectList == null ? 0 : widget.collectList.length,
itemCount: widget.collectList == null ? 0 : widget.collectList.length,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
@ -50,34 +51,46 @@ class _HomeClass extends State<HomeClass> {
// height: 250,
margin: EdgeInsets.symmetric(
horizontal: 6.w,
vertical:10,
vertical: 10,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(padding: EdgeInsets.only(left: 16,top: 5),
child: Text(
collectList.name,
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.medium,
color: Colors.black,
Padding(
padding: EdgeInsets.only(left: 16, top: 5),
child: Text(
collectList.name,
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.medium,
color: Colors.black,
),
),
),),
),
Container(
height: 195,
margin: EdgeInsets.only(top:10),
margin: EdgeInsets.only(top: 10),
child: ListView.builder(
scrollDirection: Axis.horizontal,
physics: BouncingScrollPhysics(),
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) {
return GestureDetector(
onTap: () {
Navigator.of(context).pushNamed('/router/class_details',
arguments: {"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});
arguments: {
"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]),
);
@ -108,7 +121,7 @@ class _HomeClass extends State<HomeClass> {
color: Colors.white,
),
margin: EdgeInsets.symmetric(
horizontal:6,
horizontal: 6,
),
child: Column(
children: [
@ -116,7 +129,7 @@ class _HomeClass extends State<HomeClass> {
alignment: Alignment.topRight,
children: [
Stack(
alignment: Alignment(0.9,0.9),
alignment: Alignment(0.9, 0.9),
children: [
Container(
decoration: BoxDecoration(
@ -153,7 +166,7 @@ class _HomeClass extends State<HomeClass> {
),
Container(
padding: EdgeInsets.only(left: 4),
child:Row(
child: Row(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
@ -165,7 +178,7 @@ class _HomeClass extends State<HomeClass> {
height: 16.h,
color: Colors.white,
),
SizedBox(width:5),
SizedBox(width: 5),
Text(
collect.viewers.toString(),
style: TextStyle(
@ -176,7 +189,7 @@ class _HomeClass extends State<HomeClass> {
),
],
),
SizedBox(width:8),
SizedBox(width: 8),
// Row(
// children: [
// Image.asset(
@ -198,72 +211,76 @@ class _HomeClass extends State<HomeClass> {
// ),
],
),
),
],
),
Row(
children: [
Spacer(),
Container(
margin: EdgeInsets.only(top: 8,right: 8),
padding:EdgeInsets.only(left:2,right:2),
height: 16.h,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(2),
color: Color(0xFFFFCD00),
),
child: Text(
( collect?.tags != null && collect.tags.length > 0 )?collect.tags[0] : "",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF634815),
Container(
margin: EdgeInsets.only(top: 8, right: 8),
padding: EdgeInsets.only(left: 2, right: 2),
height: 16.h,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
color: Color(0xFFFFCD00),
),
child: Text(
(collect?.tags != null && collect.tags.length > 0)
? collect.tags[0]
: "",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF634815),
),
),
),
),
],),
],
),
],
),
Expanded(child:
Container(
padding: EdgeInsets.all(8),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(child: Text(
collect.subject,
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold,
color: Colors.black,
Expanded(
child: Container(
padding: EdgeInsets.all(8),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
collect.subject,
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold,
color: Colors.black,
),
),
),
),),
],
),
SizedBox(height:2),
Text(
"讲师:${collect.author.name}",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Colors.black,
],
),
SizedBox(height: 2),
Text(
"讲师:${collect.author.name}",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
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 {
final List<Article> articles;
ArticleList(this.articles,);
ArticleList(
this.articles,
);
@override
State<StatefulWidget> createState() {
@ -46,56 +48,58 @@ class _ArticleList extends State<ArticleList> {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(top:20,left:16,right: 16),
child:Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Padding(padding:EdgeInsets.only(bottom: 12),
child:Text(
"最新文章",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
color: Colors.black,
),
)),
ListView.builder(
padding: EdgeInsets.zero,
itemCount: widget.articles.length,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
Navigator.of(context).pushNamed(
'/router/web_page',
arguments: {"articleId": widget.articles[position].id});
widget.articles[position].viewers = (widget.articles[position].viewers + 1);
setState(() {});
margin: EdgeInsets.only(top: 20, left: 16, right: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Padding(
padding: EdgeInsets.only(bottom: 12),
child: Text(
"最新文章",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
color: Colors.black,
),
)),
ListView.builder(
padding: EdgeInsets.zero,
itemCount: widget.articles.length,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
Navigator.of(context).pushNamed('/router/web_page',
arguments: {"articleId": widget.articles[position].id});
widget.articles[position].viewers =
(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(
width: double.infinity,
padding: EdgeInsets.all(16),
margin: EdgeInsets.only(bottom: 12),
color: Colors.white,
child:Row(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(child: Container(
Expanded(
child: Container(
height: 96,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -124,26 +128,30 @@ class _ArticleList extends State<ArticleList> {
// SizedBox(height: 20),
Row(
children: [
Expanded(child:Text(
widget.articles != null?widget.articles[position]?.author?.name??"":"",
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF8E8E8E),
Expanded(
child: Text(
widget.articles != null
? widget.articles[position]?.author?.name ?? ""
: "",
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF8E8E8E),
),
),
), ),
SizedBox(width:8),
),
SizedBox(width: 8),
Image.asset(
"assets/image/browse.png",
width: 14,
height: 14,
color: Color(0xFF808080),
),
Expanded(child: Text(
"${widget?.articles[position]?.viewers}"
?? "",
Expanded(
child: Text(
"${widget?.articles[position]?.viewers}" ?? "",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
@ -151,8 +159,8 @@ class _ArticleList extends State<ArticleList> {
),
)),
Text(
widget?.articles[position]?.createTime?.split(" ")[0]
?? "",
widget?.articles[position]?.createTime?.split(" ")[0] ??
"",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
@ -162,18 +170,18 @@ class _ArticleList extends State<ArticleList> {
],
),
],
),)),
SizedBox(width:12),
),
)),
SizedBox(width: 12),
MImage(
widget?.articles[position]?.coverImg ?? "",
fit: BoxFit.cover,
radius: BorderRadius.all(Radius.circular(2)),
width:96,
height:96,
width: 96,
height: 96,
),
],
),
);
}
}

116
lib/community/headlines/article_page.dart

@ -78,8 +78,7 @@ class _ArticlePage extends State<ArticlePage>
token: value.getString("token"),
);
}
BaseData<PageInfo<BannerData>> baseData =
await apiService.queryBanner({
BaseData<PageInfo<BannerData>> baseData = await apiService.queryBanner({
"model": {"type": "INFORMATION"},
}).catchError((onError) {
refreshController.refreshFailed();
@ -111,14 +110,14 @@ class _ArticlePage extends State<ArticlePage>
"searchKey": "",
"state": 1,
"type": 2
}).catchError((onError){
}).catchError((onError) {
refreshController.refreshFailed();
refreshController.loadFailed();
});
if (baseData != null && baseData.isSuccess) {
refreshController.refreshCompleted();
refreshController.loadComplete();
if(pageNum == 1) {
if (pageNum == 1) {
articles.clear();
}
articles.addAll(baseData.data.list);
@ -144,7 +143,8 @@ class _ArticlePage extends State<ArticlePage>
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) {
setState(() {
headlines.clear();
@ -157,9 +157,9 @@ class _ArticlePage extends State<ArticlePage>
EasyLoading.dismiss();
}
_onRefresh(){
_onRefresh() {
queryHeadlinesBanner();
queryHeadlinesList();//
queryHeadlinesList(); //
queryArticleList();
}
@ -167,77 +167,79 @@ class _ArticlePage extends State<ArticlePage>
Widget build(BuildContext context) {
super.build(context);
return Stack(
children: [
Positioned(
child: Container(
child: SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: true,
header: MyHeader(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onRefresh: _onRefresh,
onLoading: () {
queryArticleList();
children: [
Positioned(
child: Container(
child: SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: true,
header: MyHeader(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
physics: BouncingScrollPhysics(),
scrollController: scrollController,
child: Container(
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
color: Color(0xFFF7F7F7),
margin: EdgeInsets.only(top: 16.h),
child: Column(
children: classChildItem(),
),
),
onRefresh: _onRefresh,
onLoading: () {
queryArticleList();
},
physics: BouncingScrollPhysics(),
scrollController: scrollController,
child: Container(
child: SingleChildScrollView(
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,
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,
left: 0,
right: 0,
),
],
);
],
);
}
List<Widget> classChildItem() {
var widgets = <Widget>[
///banner
HeadlinesBanner(bannerData,),
HeadlinesBanner(
bannerData,
),
SizedBox(height: 28),
///
HeadlinesCollection(headlines,articles),
HeadlinesCollection(headlines, articles),
///
ArticleList(articles,),
ArticleList(
articles,
),
];
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/view_widget/custom_image.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/new_people_reward.dart';
class HeadlinesCollection extends StatefulWidget {
final List<HeadlinesList> headlines;
@ -46,12 +47,9 @@ class _HeadlinesCollection extends State<HeadlinesCollection> {
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
List<Article> articles = [];
articles.addAll(widget.articles);
Navigator.of(context).pushNamed(
'/router/headlines_column_details',
arguments: {"id":widget.headlines[position].id,
"articles":articles});
arguments: {"id":widget.headlines[position].id});
},
child: headlinesCollectionItem(widget.headlines[position]),
);
@ -95,6 +93,7 @@ class _HeadlinesCollection extends State<HeadlinesCollection> {
),
borderRadius: BorderRadius.vertical(
top: Radius.circular(4),
bottom: Radius.circular(4),
),
),
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:flutter/cupertino.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/base_data.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/custom_image.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:shared_preferences/shared_preferences.dart';
@ -31,7 +29,7 @@ class HeadlinesColumnDetails extends StatefulWidget {
class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
with WidgetsBindingObserver {
ApiService apiService;
List<Article> articles;
List<Article> articles = [];
HeadlinesListDetails headlinesListDetails;
List<HeadlinesList> headlines = [];
final RefreshController refreshController = RefreshController();
@ -41,10 +39,8 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
@override
void initState() {
super.initState();
articles = widget.arguments["articles"];
WidgetsBinding.instance.addObserver(this);
queryHeadlinesDetails(widget.arguments["id"]);
queryArticleList(widget.arguments["id"]);
_onRefresh();
}
///
@ -58,7 +54,7 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
);
}
BaseData<HeadlinesListDetails> baseData =
await apiService.headlinesDetails(id).catchError((error) {});
await apiService.headlinesDetails(id).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
setState(() {
headlinesListDetails = baseData.data;
@ -82,15 +78,15 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
"searchKey": "",
"state": 1,
"type": 2,
"categoryId":categoryId
}).catchError((onError){
"categoryId": categoryId
}).catchError((onError) {
refreshController.refreshFailed();
refreshController.loadFailed();
});
if (baseData != null && baseData.isSuccess) {
refreshController.refreshCompleted();
refreshController.loadComplete();
if(pageNum == 1) {
if (pageNum == 1) {
articles.clear();
}
articles.addAll(baseData.data.list);
@ -106,7 +102,7 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
}
}
_onRefresh(){
_onRefresh() {
queryHeadlinesDetails(widget.arguments["id"]);
queryArticleList(widget.arguments["id"]);
}
@ -129,7 +125,7 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
),
onRefresh: _onRefresh,
onLoading: () {
queryArticleList(widget.arguments["id"]);
_onRefresh();
},
physics: BouncingScrollPhysics(),
scrollController: scrollController,
@ -145,15 +141,15 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
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",
),
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(
@ -162,8 +158,10 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
color: Colors.transparent,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
GestureDetector(
child: Image.asset(
@ -183,17 +181,19 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
Container(
child: Column(
children: [
Padding(padding:EdgeInsets.only(left: 16),
child:Row(
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,
margin: EdgeInsets.only(right: 4),
padding: EdgeInsets.only(
left: 2, right: 2),
height: 20.h,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(2),
BorderRadius.circular(2),
color: Color(0xFF32A060),
),
child: Text(
@ -215,14 +215,16 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
maxLines: 2,
style: TextStyle(
fontSize: 18.sp,
fontWeight: MyFontWeight.semi_bold,
fontWeight:
MyFontWeight.semi_bold,
color: Colors.white,
),
),
flex: 1,
)
],
),),
),
),
Container(
width: double.infinity,
decoration: BoxDecoration(
@ -239,17 +241,20 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
margin: EdgeInsets.only(top: 16),
// padding: EdgeInsets.all(16),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Padding(padding:EdgeInsets.all(16),
Padding(
padding: EdgeInsets.all(16),
child: Text(
"简介:${headlinesListDetails?.introduce ?? ""}",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.medium ,
fontWeight: MyFontWeight.medium,
color: Colors.black,
),
)),
@ -263,19 +268,20 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
),
ListView.builder(
padding: EdgeInsets.zero,
itemCount:articles == null ? 0 : articles.length,
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(() {}
);
Navigator.of(context)
.pushNamed('/router/web_page', arguments: {
"articleId": articles[position].id
});
articles[position].viewers =
(articles[position].viewers + 1);
setState(() {});
},
child: articleColumnItem(articles[position]),
);
@ -288,194 +294,17 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
),
),
),
bottom:0,
bottom: 0,
top: 0,
left: 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() {
return Container(
);
return Container();
}
Widget articleColumnItem(Article articles) {
@ -483,7 +312,7 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
width: double.infinity,
// padding: EdgeInsets.all(16),
color: Colors.white,
child:Column(
child: Column(
children: [
Container(
// margin: EdgeInsets.only(top: 16,bottom: 16),
@ -491,85 +320,90 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
height: 0.5.h,
color: Color(0xFFF5F5F5),
),
Padding(padding: EdgeInsets.all(16),
child:Row(
children: [
Expanded(child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround,
Padding(
padding: EdgeInsets.all(16),
child: Row(
children: [
Text(
articles?.mainTitle ?? "",
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
color: Colors.black,
),
),
SizedBox(height:5),
Text(
articles?.viceTitle ?? "",
// 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),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Text(
articles?.mainTitle ?? "",
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
color: Colors.black,
),
),
),),
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),
SizedBox(height: 5),
Text(
articles?.viceTitle ?? "",
// overflow: TextOverflow.ellipsis,
// maxLines: 1,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF353535),
),
),
)),
Text(
articles?.createTime ?? "",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF8D8D8D),
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(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("系统消息"),
"xiugaichenggong" : MessageLookupByLibrary.simpleMessage("修改成功"),
"xuanguige" : MessageLookupByLibrary.simpleMessage("选规格"),
"xuanji" : MessageLookupByLibrary.simpleMessage("选集"),
"xuni" : MessageLookupByLibrary.simpleMessage("虚拟"),
"yaoqingrenshoujihao_" : m32,
"yaoqingwancheng" : MessageLookupByLibrary.simpleMessage("邀请完成"),

1
lib/generated/intl/messages_zh_CN.dart

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

1
lib/generated/intl/messages_zh_Hans_CN.dart

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

1
lib/generated/intl/messages_zh_Hant_CN.dart

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

1
lib/generated/intl/messages_zh_TW.dart

@ -568,6 +568,7 @@ class MessageLookup extends MessageLookupByLibrary {
"xitongxiaoxi" : MessageLookupByLibrary.simpleMessage("系統消息"),
"xiugaichenggong" : MessageLookupByLibrary.simpleMessage("修改成功"),
"xuanguige" : MessageLookupByLibrary.simpleMessage("選規格"),
"xuanji" : MessageLookupByLibrary.simpleMessage("選集"),
"xuni" : MessageLookupByLibrary.simpleMessage("虛擬"),
"yaoqingrenshoujihao_" : m32,
"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 {
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/invite_success_dialog.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:permission_handler/permission_handler.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
@ -38,9 +39,10 @@ import 'home_view/shortcut_operation.dart';
class HomePage extends StatefulWidget {
final Function changeTab;
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
State<StatefulWidget> createState() {
@ -61,18 +63,32 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
}
});
if((widget.invite??"") != "" || widget.couponList != null
&& widget.couponList.length > 0)
if((widget.invite??"") != "" || widget.interviewCouponList != null
&& widget.interviewCouponList.length > 0)
showInvite = true;
if(widget.newUserCouponList != null && widget.newUserCouponList.length > 0)
showNew = true;
}
///
inviteShowAlertDialog(invite,CouponList couponList) {
inviteShowAlertDialog(invite,InterviewCouponList interviewCouponList) {
//
showDialog(
context: 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;
int pageNum = 1;
bool showInvite = false;
bool showNew = false;
//1-2-3-
int orderType = 1;
@ -215,10 +232,13 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
}
EasyLoading.dismiss();
if(showInvite){
inviteShowAlertDialog(widget.invite,widget.couponList[0]);
inviteShowAlertDialog(widget.invite,widget.interviewCouponList[0]);
showInvite = false;
}
if(showNew){
newShowAlertDialog(widget.newUserCouponList);
showNew = false;
}
}
@override

6
lib/home/home_view/featured_acticvity.dart

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

1
lib/l10n/intl_en.arb

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

1
lib/l10n/intl_zh_CN.arb

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

1
lib/l10n/intl_zh_Hans_CN.arb

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

1
lib/l10n/intl_zh_Hant_CN.arb

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

1
lib/l10n/intl_zh_TW.arb

@ -574,6 +574,7 @@
"input_invite_code_hide": "填寫邀請碼",
"qingshuruyaoqingma": "請輸入邀請碼",
"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(
'/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();
} else {
@ -780,7 +781,6 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
),
Container(
height: 40.h,
// margin: EdgeInsets.only(top: 12.h),
width: MediaQuery.of(context).size.width - 80.h,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
@ -884,16 +884,16 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
),
SizedBox(
height:25.h,
child: Visibility(
visible: statusPhoneVisible,
child: Text(
S.of(context).phone_error,
style: TextStyle(
color: Color(0xFFF72626),
fontSize: 12.sp,
),
),
),
// child: Visibility(
// visible: statusPhoneVisible,
// child: Text(
// S.of(context).phone_error,
// style: TextStyle(
// color: Color(0xFFF72626),
// fontSize: 12.sp,
// ),
// ),
// ),
),
GestureDetector(
onTap: (){

12
lib/main.dart

@ -298,7 +298,8 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
'/router/address_map_page': (context, {arguments}) => AddressMapPage(),
'/router/roll_center_page': (context, {arguments}) => RollCenterPage(),
'/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/recharge_page': (context, {arguments}) => RechargePage(),
'/router/mine_wallet': (context, {arguments}) => MineWalletPage(),
@ -318,7 +319,10 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
'/router/communityFollow': (context, {arguments}) => CommunityFollow(),
'/router/releasePage': (context, {arguments}) => ReleasePage(),
'/router/activity_list': (context, {arguments}) => ActivityList(),
'/router/class_details': (context, {arguments}) => ClassDetails(arguments: arguments),
'/router/mine_attainment_page': (context, {arguments}) => MineAttainmentPage(arguments: arguments),
'/router/headlines_column_details': (context, {arguments}) => HeadlinesColumnDetails(arguments: arguments),
'/router/class_details': (context, {arguments}) =>
ClassDetails(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/mine/mine_page.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/retrofit_api.dart';
import 'package:huixiang/union/union_page.dart';
@ -82,20 +81,25 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
pushRoute();
String invite = "";
var couponList;
var interviewCouponList;
var newUserCouponList;
if(widget.arguments != null && (widget.arguments["invite"]??"") != ""
&& widget.arguments["couponList"] != null ){
&& widget.arguments["interviewCouponList"] != null ){
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>[
// BrandPage(),
HomePage((index) {
setState(() {
pageController.jumpToPage(index);
});
},invite:invite,couponList:couponList),
},invite:invite,interviewCouponList:interviewCouponList,newUserCouponList:newUserCouponList,),
// MainHomePage(),
UnionPage(),
CommunityPage(),

49
lib/mine/mine_vip/legal_right_details.dart

@ -124,7 +124,7 @@ class _LegalRightDetails extends State<LegalRightDetails> {
// checkIndex * 85)),
child: ListView.builder(
scrollDirection: Axis.horizontal,
physics: NeverScrollableScrollPhysics(),
physics: BouncingScrollPhysics(),
controller: _scrollController,
shrinkWrap: true,
padding: EdgeInsets.symmetric(horizontal: 10),
@ -134,29 +134,30 @@ class _LegalRightDetails extends State<LegalRightDetails> {
onTap: () {
setState(() {
if (checkIndex == position) return;
offsetOnEnd = position - checkIndex < 0 && position != 0;
int jumpIndex = (position - checkIndex).abs();
int maxCountInWidth =
MediaQuery.of(context).size.width ~/ 80;
int tempPosition = checkIndex;
for (var i = 0; i < jumpIndex; i++) {
if (position - checkIndex < 0)
tempPosition -= 1;
else
tempPosition += 1;
checkIndex = tempPosition;
if (tempPosition <=
vipBenefitList.length - maxCountInWidth) {
if (tempPosition != 0)
_scrollController.jumpTo((_scrollController.offset +
(offsetOnEnd ? -85 : 85))
.toDouble());
} else {
_scrollController.jumpTo(
((vipBenefitList.length - maxCountInWidth) * 85)
.toDouble());
}
}
// offsetOnEnd = position - checkIndex < 0 && position != 0;
// int jumpIndex = (position - checkIndex).abs();
// int maxCountInWidth =
// MediaQuery.of(context).size.width ~/ 80;
// int tempPosition = checkIndex;
// for (var i = 0; i < jumpIndex; i++) {
// if (position - checkIndex < 0)
// tempPosition -= 1;
// else
// tempPosition += 1;
// checkIndex = tempPosition;
// if (tempPosition <=
// vipBenefitList.length - maxCountInWidth) {
// if (tempPosition != 0)
// _scrollController.jumpTo((_scrollController.offset +
// (offsetOnEnd ? -85 : 85))
// .toDouble());
// } else {
// _scrollController.jumpTo(
// ((vipBenefitList.length - maxCountInWidth) * 85)
// .toDouble());
// }
// }
checkIndex = 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"}
/// 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}]
/// 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"}
/// 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 {
LoginInfo({
AuthInfo authInfo,
List<CouponList> couponList,}){
AuthInfo authInfo,
List<InterviewCouponList> interviewCouponList,
List<NewUserCouponList> newUserCouponList,}){
_authInfo = authInfo;
_couponList = couponList;
}
_interviewCouponList = interviewCouponList;
_newUserCouponList = newUserCouponList;
}
LoginInfo.fromJson(dynamic json) {
_authInfo = json['authInfo'] != null ? AuthInfo.fromJson(json['authInfo']) : null;
if (json['couponList'] != null) {
_couponList = [];
json['couponList'].forEach((v) {
_couponList.add(CouponList.fromJson(v));
if (json['interviewCouponList'] != null) {
_interviewCouponList = [];
json['interviewCouponList'].forEach((v) {
_interviewCouponList.add(InterviewCouponList.fromJson(v));
});
}
if (json['newUserCouponList'] != null) {
_newUserCouponList = [];
json['newUserCouponList'].forEach((v) {
_newUserCouponList.add(NewUserCouponList.fromJson(v));
});
}
}
AuthInfo _authInfo;
List<CouponList> _couponList;
List<InterviewCouponList> _interviewCouponList;
List<NewUserCouponList> _newUserCouponList;
AuthInfo get authInfo => _authInfo;
List<CouponList> get couponList => _couponList;
List<InterviewCouponList> get interviewCouponList => _interviewCouponList;
List<NewUserCouponList> get newUserCouponList => _newUserCouponList;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (_authInfo != null) {
map['authInfo'] = _authInfo.toJson();
}
if (_couponList != null) {
map['couponList'] = _couponList.map((v) => v.toJson()).toList();
if (_interviewCouponList != null) {
map['interviewCouponList'] = _interviewCouponList.map((v) => v.toJson()).toList();
}
if (_newUserCouponList != null) {
map['newUserCouponList'] = _newUserCouponList.map((v) => v.toJson()).toList();
}
return map;
}
@ -62,44 +76,46 @@ class LoginInfo {
/// dateOrDay : false
/// startAfterDays : 0
/// daysValidate : 0
/// businessType : 0
/// centreDisplay : true
/// tenantCode : "1175"
/// isDelete : 0
/// storeName : "海峡姐妹奶茶店"
/// number : 1
class CouponList {
CouponList({
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,
bool centreDisplay,
String tenantCode,
int isDelete,
String storeName,
int number,}){
class NewUserCouponList {
NewUserCouponList({
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;
@ -125,14 +141,255 @@ class CouponList {
_dateOrDay = dateOrDay;
_startAfterDays = startAfterDays;
_daysValidate = daysValidate;
_businessType = businessType;
_centreDisplay = centreDisplay;
_tenantCode = tenantCode;
_isDelete = isDelete;
_storeName = storeName;
_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'];
_createTime = json['createTime'];
_createUser = json['createUser'];
@ -163,6 +420,7 @@ class CouponList {
_dateOrDay = json['dateOrDay'];
_startAfterDays = json['startAfterDays'];
_daysValidate = json['daysValidate'];
_businessType = json['businessType'];
_centreDisplay = json['centreDisplay'];
_tenantCode = json['tenantCode'];
_isDelete = json['isDelete'];
@ -194,6 +452,7 @@ class CouponList {
bool _dateOrDay;
int _startAfterDays;
int _daysValidate;
int _businessType;
bool _centreDisplay;
String _tenantCode;
int _isDelete;
@ -225,6 +484,7 @@ class CouponList {
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;
@ -260,6 +520,7 @@ class CouponList {
map['dateOrDay'] = _dateOrDay;
map['startAfterDays'] = _startAfterDays;
map['daysValidate'] = _daysValidate;
map['businessType'] = _businessType;
map['centreDisplay'] = _centreDisplay;
map['tenantCode'] = _tenantCode;
map['isDelete'] = _isDelete;
@ -270,33 +531,33 @@ class CouponList {
}
/// token : "eyJ0eXAiOiJKc29uV2ViVG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX3R5cGUiOiJQTEFURk9STV9BUFAiLCJuYW1lIjoi5pav5Z-65LuUIiwidG9rZW5fdHlwZSI6InRva2VuIiwidXNlcmlkIjoiMTQ2Mzc1MTMwMjYzNzk0NDgzMiIsImFjY291bnQiOiIxNTM5Mjk0OTA5NyIsImV4cCI6MTY0MTAwMzg4NSwibmJmIjoxNjM4NDExODg1fQ.3ioTF8ofxKeoIlT_KriPHjjpJVzB3orh6rNCYrN5auA"
/// token : "eyJ0eXAiOiJKc29uV2ViVG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX3R5cGUiOiJQTEFURk9STV9BUFAiLCJuYW1lIjoi5Zue5LmhXzg4ODg4OCIsInRva2VuX3R5cGUiOiJ0b2tlbiIsInVzZXJpZCI6IjE0NzA3MDI1OTIzMDM1NjI3NTIiLCJhY2NvdW50IjoiMTU2MTU2OTg3NDUiLCJleHAiOjE2NDIwNjk3OTksIm5iZiI6MTYzOTQ3Nzc5OX0.KHiw51SQ2RkARJhGKFTXgI7IrYXOhN-YqFZCwJ1jkEc"
/// tokenType : "token"
/// refreshToken : "eyJ0eXAiOiJKc29uV2ViVG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaF90b2tlbiIsInVzZXJpZCI6IjE0NjM3NTEzMDI2Mzc5NDQ4MzIiLCJleHAiOjE2NDEwMDM4ODUsIm5iZiI6MTYzODQxMTg4NX0.kePPEJDAKhgGyJRzlo4OvZ_OWPYi4O6RFWsSc7cdmhU"
/// name : "斯基仔"
/// account : "15392949097"
/// refreshToken : "eyJ0eXAiOiJKc29uV2ViVG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaF90b2tlbiIsInVzZXJpZCI6IjE0NzA3MDI1OTIzMDM1NjI3NTIiLCJleHAiOjE2NDIwNjk3OTksIm5iZiI6MTYzOTQ3Nzc5OX0.jjI0dTviahPq6p4J_tx_Sn-Fg-q51kE3WPpqdVcEIMw"
/// name : "回乡_888888"
/// account : "15615698745"
/// avatar : null
/// workDescribe : null
/// userId : "1463751302637944832"
/// userId : "1470702592303562752"
/// userType : "PLATFORM_APP"
/// expire : "2592000"
/// expiration : "2022-01-01 10:24:45"
/// mobile : "15392949097"
/// expiration : "2022-01-13 18:29:59"
/// mobile : "15615698745"
class AuthInfo {
AuthInfo({
String token,
String tokenType,
String refreshToken,
String name,
String account,
dynamic avatar,
dynamic workDescribe,
String userId,
String userType,
String expire,
String expiration,
String mobile,}){
String token,
String tokenType,
String refreshToken,
String name,
String account,
dynamic avatar,
dynamic workDescribe,
String userId,
String userType,
String expire,
String expiration,
String mobile,}){
_token = token;
_tokenType = tokenType;
_refreshToken = refreshToken;
@ -309,7 +570,7 @@ class AuthInfo {
_expire = expire;
_expiration = expiration;
_mobile = mobile;
}
}
AuthInfo.fromJson(dynamic json) {
_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 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/";

2
lib/retrofit/min_api.g.dart

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

11
lib/retrofit/retrofit_api.dart

@ -53,8 +53,11 @@ import 'data/wx_pay.dart';
part 'retrofit_api.g.dart';
const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///
const baseUrl = "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 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 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 base_url = "http://192.168.10.130:8766/app/";///
// const baseUrl = "http://192.168.10.130:8766/app/";///
const base_url = "http://192.168.10.142:8766/app/";///
const baseUrl = "http://192.168.10.142:8766/app/";///
@RestApi(baseUrl: baseUrl)
abstract class ApiService {

2
lib/retrofit/retrofit_api.g.dart

@ -9,7 +9,7 @@ part of 'retrofit_api.dart';
class _ApiService implements ApiService {
_ApiService(this._dio, {this.baseUrl}) {
ArgumentError.checkNotNull(_dio, '_dio');
baseUrl ??= 'https://pos.platform.lotus-wallet.com/app/';
baseUrl ??= 'http://192.168.10.142:8766/app/';
}
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 {
final String invite;
final CouponList couponList;
final InterviewCouponList interviewCouponList;
InviteSuccessDialog(this.invite,this.couponList);
InviteSuccessDialog(this.invite,this.interviewCouponList);
@override
State<StatefulWidget> createState() {
@ -72,7 +72,7 @@ class _InviteSuccessDialog extends State<InviteSuccessDialog> {
height: 1.5.h),
children: [
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),
),
]

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