diff --git a/assets/image/2x/xin_ren.png b/assets/image/2x/xin_ren.png new file mode 100644 index 00000000..2e8e190d Binary files /dev/null and b/assets/image/2x/xin_ren.png differ diff --git a/assets/image/2x/xin_rq.png b/assets/image/2x/xin_rq.png new file mode 100644 index 00000000..c89eb12c Binary files /dev/null and b/assets/image/2x/xin_rq.png differ diff --git a/assets/image/3x/xin_ren.png b/assets/image/3x/xin_ren.png new file mode 100644 index 00000000..6aea2f16 Binary files /dev/null and b/assets/image/3x/xin_ren.png differ diff --git a/assets/image/3x/xin_rq.png b/assets/image/3x/xin_rq.png new file mode 100644 index 00000000..e97aaf0f Binary files /dev/null and b/assets/image/3x/xin_rq.png differ diff --git a/assets/image/xin_ren.png b/assets/image/xin_ren.png new file mode 100644 index 00000000..20de91cf Binary files /dev/null and b/assets/image/xin_ren.png differ diff --git a/assets/image/xin_rq.png b/assets/image/xin_rq.png new file mode 100644 index 00000000..06feb0be Binary files /dev/null and b/assets/image/xin_rq.png differ diff --git a/lib/community/community_view/class_details.dart b/lib/community/community_view/class_details.dart index d97f7d26..ddde6b88 100644 --- a/lib/community/community_view/class_details.dart +++ b/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 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( + 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 with WidgetsBindingObserver { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( - "选集", + S.of(context).xuanji, style: TextStyle( fontSize: 15.sp, fontWeight: MyFontWeight.medium, diff --git a/lib/community/community_view/class_details_video.dart b/lib/community/community_view/class_details_video.dart index 5bfc37a8..a051e0f6 100644 --- a/lib/community/community_view/class_details_video.dart +++ b/lib/community/community_view/class_details_video.dart @@ -90,7 +90,8 @@ class ClassDetailsVideoState extends State { @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) / diff --git a/lib/community/community_view/home_class.dart b/lib/community/community_view/home_class.dart index 6a26b38e..52acdfc8 100644 --- a/lib/community/community_view/home_class.dart +++ b/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> collectMap; + final Map> collectMap; final List collectList; - HomeClass(this.collectMap,this.collectList); + HomeClass(this.collectMap, this.collectList); + @override State createState() { return _HomeClass(); @@ -34,7 +35,7 @@ class _HomeClass extends State { 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 { // 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 { color: Colors.white, ), margin: EdgeInsets.symmetric( - horizontal:6, + horizontal: 6, ), child: Column( children: [ @@ -116,7 +129,7 @@ class _HomeClass extends State { 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 { ), Container( padding: EdgeInsets.only(left: 4), - child:Row( + child: Row( children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceAround, @@ -165,7 +178,7 @@ class _HomeClass extends State { 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 { ), ], ), - SizedBox(width:8), + SizedBox(width: 8), // Row( // children: [ // Image.asset( @@ -198,72 +211,76 @@ class _HomeClass extends State { // ), ], ), - ), ], ), 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, + ), ), - ), - ], + ], + ), ), - ),), + ), ], ), ); diff --git a/lib/community/headlines/article_list.dart b/lib/community/headlines/article_list.dart index eacf14a8..81645697 100644 --- a/lib/community/headlines/article_list.dart +++ b/lib/community/headlines/article_list.dart @@ -21,7 +21,9 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; class ArticleList extends StatefulWidget { final List
articles; - ArticleList(this.articles,); + ArticleList( + this.articles, + ); @override State createState() { @@ -46,56 +48,58 @@ class _ArticleList extends State { @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 { // 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 { ), )), 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 { ], ), ], - ),)), - 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, ), ], ), ); } - } diff --git a/lib/community/headlines/article_page.dart b/lib/community/headlines/article_page.dart index 2ee53e3c..7a1fd383 100644 --- a/lib/community/headlines/article_page.dart +++ b/lib/community/headlines/article_page.dart @@ -78,8 +78,7 @@ class _ArticlePage extends State token: value.getString("token"), ); } - BaseData> baseData = - await apiService.queryBanner({ + BaseData> baseData = await apiService.queryBanner({ "model": {"type": "INFORMATION"}, }).catchError((onError) { refreshController.refreshFailed(); @@ -111,14 +110,14 @@ class _ArticlePage extends State "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 token: value.getString("token"), ); } - BaseData> baseData = await apiService.headlinesList().catchError((onError) {}); + BaseData> baseData = + await apiService.headlinesList().catchError((onError) {}); if (baseData != null && baseData.isSuccess) { setState(() { headlines.clear(); @@ -157,9 +157,9 @@ class _ArticlePage extends State EasyLoading.dismiss(); } - _onRefresh(){ + _onRefresh() { queryHeadlinesBanner(); - queryHeadlinesList();//分类列表 + queryHeadlinesList(); //分类列表 queryArticleList(); } @@ -167,77 +167,79 @@ class _ArticlePage extends State 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 classChildItem() { var widgets = [ ///文章banner - HeadlinesBanner(bannerData,), + HeadlinesBanner( + bannerData, + ), SizedBox(height: 28), ///头条合集列表 - HeadlinesCollection(headlines,articles), + HeadlinesCollection(headlines, articles), ///文章列表 - ArticleList(articles,), - - + ArticleList( + articles, + ), ]; return widgets; diff --git a/lib/community/headlines/headlines_collection.dart b/lib/community/headlines/headlines_collection.dart index a80a2bfe..bbb6cdab 100644 --- a/lib/community/headlines/headlines_collection.dart +++ b/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 headlines; @@ -46,12 +47,9 @@ class _HeadlinesCollection extends State { itemBuilder: (context, position) { return GestureDetector( onTap: () { - List
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 { ), borderRadius: BorderRadius.vertical( top: Radius.circular(4), + bottom: Radius.circular(4), ), ), Container( @@ -166,4 +165,5 @@ class _HeadlinesCollection extends State { ), ); } + } diff --git a/lib/community/headlines/headlines_column_details.dart b/lib/community/headlines/headlines_column_details.dart index 1babbc01..699795d0 100644 --- a/lib/community/headlines/headlines_column_details.dart +++ b/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 with WidgetsBindingObserver { ApiService apiService; - List
articles; + List
articles = []; HeadlinesListDetails headlinesListDetails; List headlines = []; final RefreshController refreshController = RefreshController(); @@ -41,10 +39,8 @@ class _HeadlinesColumnDetails extends State @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 ); } BaseData 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 "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 } } - _onRefresh(){ + _onRefresh() { queryHeadlinesDetails(widget.arguments["id"]); queryArticleList(widget.arguments["id"]); } @@ -129,7 +125,7 @@ class _HeadlinesColumnDetails extends State ), onRefresh: _onRefresh, onLoading: () { - queryArticleList(widget.arguments["id"]); + _onRefresh(); }, physics: BouncingScrollPhysics(), scrollController: scrollController, @@ -145,15 +141,15 @@ class _HeadlinesColumnDetails extends State 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 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 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 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 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 ), 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 ), ), ), - 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 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 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, - ), - ], - )), + )), ], ), ); diff --git a/lib/generated/intl/messages_en.dart b/lib/generated/intl/messages_en.dart index 5a592d26..56650179 100644 --- a/lib/generated/intl/messages_en.dart +++ b/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("邀请完成"), diff --git a/lib/generated/intl/messages_zh_CN.dart b/lib/generated/intl/messages_zh_CN.dart index db0fc204..e1d59ac9 100644 --- a/lib/generated/intl/messages_zh_CN.dart +++ b/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("已绑副卡"), diff --git a/lib/generated/intl/messages_zh_Hans_CN.dart b/lib/generated/intl/messages_zh_Hans_CN.dart index d6ac4727..63b3f40c 100644 --- a/lib/generated/intl/messages_zh_Hans_CN.dart +++ b/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("已绑副卡"), diff --git a/lib/generated/intl/messages_zh_Hant_CN.dart b/lib/generated/intl/messages_zh_Hant_CN.dart index bee1d745..f3a037d6 100644 --- a/lib/generated/intl/messages_zh_Hant_CN.dart +++ b/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("已綁副卡"), diff --git a/lib/generated/intl/messages_zh_TW.dart b/lib/generated/intl/messages_zh_TW.dart index 648d13d1..738e14c7 100644 --- a/lib/generated/intl/messages_zh_TW.dart +++ b/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("已綁副卡"), diff --git a/lib/generated/l10n.dart b/lib/generated/l10n.dart index 764438ba..5976a619 100644 --- a/lib/generated/l10n.dart +++ b/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( diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index 08b23ea3..6d30b07d 100644 --- a/lib/home/home_page.dart +++ b/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; + final List interviewCouponList; + final List newUserCouponList; - HomePage(this.changeTab, {this.invite,this.couponList}); + HomePage(this.changeTab, {this.invite,this.interviewCouponList,this.newUserCouponList}); @override State createState() { @@ -61,18 +63,32 @@ class _HomePage extends State 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 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 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 diff --git a/lib/home/home_view/featured_acticvity.dart b/lib/home/home_view/featured_acticvity.dart index 6843d8d1..f9fe0e74 100644 --- a/lib/home/home_view/featured_acticvity.dart +++ b/lib/home/home_view/featured_acticvity.dart @@ -86,7 +86,7 @@ class _FeaturedActivity extends State { image: NetworkImage( activityList[0].coverImg, ), - fit: BoxFit.cover, + fit: BoxFit.fill, ), ), ), @@ -113,7 +113,7 @@ class _FeaturedActivity extends State { image: NetworkImage( activityList[1].coverImg, ), - fit: BoxFit.cover, + fit: BoxFit.fill, ), ), ), @@ -138,7 +138,7 @@ class _FeaturedActivity extends State { image: NetworkImage( activityList[2].coverImg, ), - fit: BoxFit.cover, + fit: BoxFit.fill, ), ), ), diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index 331b3524..32b382df 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -583,6 +583,7 @@ "qingshuruyaoqingma": "请输入邀请码", "invite_code_error": "邀请码输入错误", "yaoqingwancheng": "邀请完成", + "xuanji": "选集", diff --git a/lib/l10n/intl_zh_CN.arb b/lib/l10n/intl_zh_CN.arb index 490eb5f2..0151ed71 100644 --- a/lib/l10n/intl_zh_CN.arb +++ b/lib/l10n/intl_zh_CN.arb @@ -580,6 +580,7 @@ "input_invite_code_hide": "填写邀请码", "qingshuruyaoqingma": "请输入邀请码", "invite_code_error": "邀请码输入错误", + "xuanji": "选集", diff --git a/lib/l10n/intl_zh_Hans_CN.arb b/lib/l10n/intl_zh_Hans_CN.arb index e2f839de..17bdfa3e 100644 --- a/lib/l10n/intl_zh_Hans_CN.arb +++ b/lib/l10n/intl_zh_Hans_CN.arb @@ -580,6 +580,7 @@ "input_invite_code_hide": "填写邀请码", "qingshuruyaoqingma": "请输入邀请码", "invite_code_error": "邀请码输入错误", + "xuanji": "选集", diff --git a/lib/l10n/intl_zh_Hant_CN.arb b/lib/l10n/intl_zh_Hant_CN.arb index 70b8b897..811a8988 100644 --- a/lib/l10n/intl_zh_Hant_CN.arb +++ b/lib/l10n/intl_zh_Hant_CN.arb @@ -574,6 +574,7 @@ "input_invite_code_hide": "填寫邀請碼", "qingshuruyaoqingma": "請輸入邀請碼", "invite_code_error": "邀請碼輸入錯誤", + "xuanji": "選集", diff --git a/lib/l10n/intl_zh_TW.arb b/lib/l10n/intl_zh_TW.arb index 23b17805..91303103 100644 --- a/lib/l10n/intl_zh_TW.arb +++ b/lib/l10n/intl_zh_TW.arb @@ -574,6 +574,7 @@ "input_invite_code_hide": "填寫邀請碼", "qingshuruyaoqingma": "請輸入邀請碼", "invite_code_error": "邀請碼輸入錯誤", + "xuanji": "選集", diff --git a/lib/login/login_page.dart b/lib/login/login_page.dart index 29c16194..76349a7b 100644 --- a/lib/login/login_page.dart +++ b/lib/login/login_page.dart @@ -341,7 +341,8 @@ class _MyLoginPageState extends State 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 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 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: (){ diff --git a/lib/main.dart b/lib/main.dart index f5363194..72f074a7 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -298,7 +298,8 @@ Map routers = { '/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 routers = { '/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), }; diff --git a/lib/main_page.dart b/lib/main_page.dart index 7488d878..0e31968a 100644 --- a/lib/main_page.dart +++ b/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 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 = [ // BrandPage(), HomePage((index) { setState(() { pageController.jumpToPage(index); }); - },invite:invite,couponList:couponList), + },invite:invite,interviewCouponList:interviewCouponList,newUserCouponList:newUserCouponList,), // MainHomePage(), UnionPage(), CommunityPage(), diff --git a/lib/mine/mine_vip/legal_right_details.dart b/lib/mine/mine_vip/legal_right_details.dart index 47c816fe..709c4e13 100644 --- a/lib/mine/mine_vip/legal_right_details.dart +++ b/lib/mine/mine_vip/legal_right_details.dart @@ -124,7 +124,7 @@ class _LegalRightDetails extends State { // 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 { 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), diff --git a/lib/retrofit/data/login_info.dart b/lib/retrofit/data/login_info.dart index a0107eca..912454e1 100644 --- a/lib/retrofit/data/login_info.dart +++ b/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,}){ + AuthInfo authInfo, + List interviewCouponList, + List 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; + List _interviewCouponList; + List _newUserCouponList; AuthInfo get authInfo => _authInfo; - List get couponList => _couponList; + List get interviewCouponList => _interviewCouponList; + List get newUserCouponList => _newUserCouponList; Map toJson() { final map = {}; 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 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 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 _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 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 toJson() { + final map = {}; + 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 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']; diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index 7c11a416..3a8b91c6 100644 --- a/lib/retrofit/min_api.dart +++ b/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/"; diff --git a/lib/retrofit/min_api.g.dart b/lib/retrofit/min_api.g.dart index 1c1cc751..c9ad7289 100644 --- a/lib/retrofit/min_api.g.dart +++ b/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; diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index aac0a961..fc8414cb 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/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 { diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index d1a64c02..0adf7d45 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/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; diff --git a/lib/view_widget/invite_success_dialog.dart b/lib/view_widget/invite_success_dialog.dart index 3c88367c..ee9fc595 100644 --- a/lib/view_widget/invite_success_dialog.dart +++ b/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 createState() { @@ -72,7 +72,7 @@ class _InviteSuccessDialog extends State { 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), ), ] diff --git a/lib/view_widget/new_people_reward.dart b/lib/view_widget/new_people_reward.dart new file mode 100644 index 00000000..4769d8a2 --- /dev/null +++ b/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; + + NewPeopleReward(this.newUserCouponList); + + @override + State createState() { + return _NewPeopleReward(); + } +} + +class _NewPeopleReward extends State { + @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), + ), + ) + ], + )), + ], + ), + ); + } +}