diff --git a/assets/image/2x/activity_q.png b/assets/image/2x/activity_q.png new file mode 100644 index 00000000..98422818 Binary files /dev/null and b/assets/image/2x/activity_q.png differ diff --git a/assets/image/3x/activity_q.png b/assets/image/3x/activity_q.png new file mode 100644 index 00000000..abd4589d Binary files /dev/null and b/assets/image/3x/activity_q.png differ diff --git a/assets/image/activity_q.png b/assets/image/activity_q.png new file mode 100644 index 00000000..46742d63 Binary files /dev/null and b/assets/image/activity_q.png differ diff --git a/lib/community/headlines/activity_top_list.dart b/lib/community/headlines/activity_top_list.dart index e744c6aa..d5524ecc 100644 --- a/lib/community/headlines/activity_top_list.dart +++ b/lib/community/headlines/activity_top_list.dart @@ -60,7 +60,7 @@ class _ActivityTopList extends State { Widget headlinesCollectionItem(Article articles, index) { return Container( - width: 320.w, + width: 340.w, height: 220.h, decoration: BoxDecoration( borderRadius: BorderRadius.circular(4), @@ -77,89 +77,93 @@ class _ActivityTopList extends State { margin: EdgeInsets.symmetric( horizontal: 6, ), - child: Stack( - alignment: Alignment.bottomLeft, + child:Column( children: [ Stack( + alignment: Alignment.bottomLeft, children: [ - ClipRRect( - child: Opacity( - opacity: 0.8, - child: MImage( - widget?.articleTop[index]?.coverImg ?? "", - width: 320.w, - height: 220.h, - fit: BoxFit.cover, - errorSrc: "assets/image/default_1.png", - fadeSrc: "assets/image/default_1.png", - ), - ), - borderRadius: BorderRadius.vertical( - top: Radius.circular(4), - bottom: Radius.circular(4), - ), - ), - Container( - padding: EdgeInsets.only(left: 12.w, right: 12.w, top: 8), - alignment: Alignment.topLeft, - child: Row( - children: [ - Image.asset( - "assets/image/activity_hot.png", - width: 20, - height: 20, - fit: BoxFit.fill, - ), - SizedBox( - width: 4.w, + Stack( + children: [ + ClipRRect( + child: Opacity( + opacity: 0.8, + child: MImage( + widget?.articleTop[index]?.coverImg ?? "", + width: 340.w, + height: 220.h, + fit: BoxFit.cover, + errorSrc: "assets/image/default_1.png", + fadeSrc: "assets/image/default_1.png", ), - Expanded( - child: Text( - "精选好文", - overflow: TextOverflow.ellipsis, - maxLines: 2, - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.semi_bold, - color: Colors.white, + ), + borderRadius: BorderRadius.vertical( + top: Radius.circular(4), + bottom: Radius.circular(4), + ), + ), + Container( + padding: EdgeInsets.only(left: 12.w, right: 12.w, top: 8), + alignment: Alignment.topLeft, + child: Row( + children: [ + Image.asset( + "assets/image/activity_hot.png", + width: 20, + height: 20, + fit: BoxFit.fill, ), - ), - ), - ], - )), - ], - ), - Positioned( - top:130, - left: 12, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - widget?.articleTop[index]?.mainTitle ?? "", - overflow: TextOverflow.ellipsis, - maxLines: 2, - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.semi_bold, - color: Colors.white, - ), - ), - Text( - widget?.articleTop[index]?.viceTitle ?? "", - overflow: TextOverflow.ellipsis, - maxLines: 2, - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.semi_bold, - color: Colors.white, - ), + SizedBox( + width: 4.w, + ), + Expanded( + child: Text( + "精选好文", + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.white, + ), + ), + ), + ], + )), + ], ), - ], - )) + Padding(padding:EdgeInsets.only(left: 12.w, right: 12.w, bottom: 8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + widget?.articleTop[index]?.mainTitle ?? "", + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.white, + ), + ), + SizedBox(height: 5.h), + Opacity(opacity:0.8, + child: Text( + widget?.articleTop[index]?.viceTitle ?? "", + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Colors.white, + ), + ),) + ], + )), + ], + ), ], - ), + ) ); } } diff --git a/lib/community/headlines/article_page.dart b/lib/community/headlines/article_page.dart index 25e7f92c..a685ef1e 100644 --- a/lib/community/headlines/article_page.dart +++ b/lib/community/headlines/article_page.dart @@ -18,6 +18,7 @@ import 'package:huixiang/retrofit/data/headlines_list_details.dart'; import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/event_type.dart'; +import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/classic_header.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/view_widget/my_footer.dart'; @@ -247,6 +248,21 @@ class _ArticlePage extends State SizedBox(height: 28), + Container( + width: double.infinity, + margin: EdgeInsets.only(left: 16,bottom:5), + child:Text( + "文章专栏", + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.black, + ), + ) + ), + ///头条合集列表 HeadlinesCollection(headlines, articles), diff --git a/lib/community/headlines/headlines_column_details.dart b/lib/community/headlines/headlines_column_details.dart index 0d8e875e..1bf752f8 100644 --- a/lib/community/headlines/headlines_column_details.dart +++ b/lib/community/headlines/headlines_column_details.dart @@ -79,7 +79,7 @@ class _HeadlinesColumnDetails extends State "state": 1, "type": 2, "categoryId": categoryId, - "isHot":"", + "isHot":false, }).catchError((onError) { refreshController.refreshFailed(); refreshController.loadFailed(); @@ -114,6 +114,7 @@ class _HeadlinesColumnDetails extends State children: [ Positioned( child: Container( + color: Colors.white, child: SmartRefresher( controller: refreshController, enablePullDown: true, diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index 4b3e26db..45085a23 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -26,6 +26,7 @@ import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/event_type.dart'; import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/activity_coupons.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'; @@ -302,6 +303,8 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { child: GestureDetector( onTap: () { Navigator.of(context).pushNamed('/router/system_msg_page'); + ///活动优惠券赠送弹窗 + // activityShowAlertDialog(); }, child: Container( height: 24, @@ -523,6 +526,16 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { ); } + activityShowAlertDialog() { + //显示对话框 + showDialog( + context: context, + builder: (BuildContext context) { + return ActivityCoupons(); + }, + ); + } + @override bool get wantKeepAlive => true; } diff --git a/lib/home/home_view/featured_acticvity.dart b/lib/home/home_view/featured_acticvity.dart index 2aea1f43..bab089a3 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.fill, + fit: BoxFit.cover, ), ), ), @@ -114,7 +114,7 @@ class _FeaturedActivity extends State { image: NetworkImage( activityList[1].coverImg, ), - fit: BoxFit.fill, + fit: BoxFit.cover, ), ), ), diff --git a/lib/message/system_details.dart b/lib/message/system_details.dart index 4c474773..af482424 100644 --- a/lib/message/system_details.dart +++ b/lib/message/system_details.dart @@ -110,7 +110,7 @@ class _SystemDetails extends State { ///评论 回复 _reply(messageRelational) { var messageRelational = jsonDecode(messages[indexMsg].relational); - messageRelational["mid"].toString(); + messageRelational["additionId"].toString(); hintText = S.of(context).huifu_("${messageRelational["nickname"]}"); } @@ -119,13 +119,11 @@ class _SystemDetails extends State { var messageRelational = jsonDecode(messages[indexMsg].relational); BaseData baseData = await apiService.memberComment({ "content": content, - "parentId": messageRelational["mid"].toString(), + "parentId": messageRelational["additionId"].toString(), "relationalId":messageRelational["businessId"].toString(), "relationalType":4 }).catchError((error) {}); if (baseData != null && baseData.isSuccess) { - // CommentListState state = commentKey.currentState; - // state.queryMemberCommentList(); commentTextController.text = ""; FocusScope.of(context).unfocus(); Navigator.of(context).pop(); diff --git a/lib/view_widget/activity_coupons.dart b/lib/view_widget/activity_coupons.dart new file mode 100644 index 00000000..50c98c85 --- /dev/null +++ b/lib/view_widget/activity_coupons.dart @@ -0,0 +1,203 @@ +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/receive_success.dart'; +import 'package:huixiang/view_widget/round_button.dart'; +import 'package:huixiang/view_widget/separator.dart'; + +class ActivityCoupons extends StatefulWidget { + // final List newUserCouponList; + // + // ActivityCoupons(this.newUserCouponList); + + @override + State createState() { + return _ActivityCoupons(); + } +} + +class _ActivityCoupons extends State { + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.only(top:150.h), + height: MediaQuery.of(context).size.height / 2, + child: Column( + children: [ + Container( + width: double.infinity, + height:MediaQuery.of(context).size.height / 2, + 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/activity_q.png"), + ), + ), + child: Column( + children: [ + Expanded( + child: reward(), + ), + GestureDetector( + onTap: () { + Navigator.of(context).pop(); + SmartDialog.showToast("领取成功",alignment: Alignment.center); + }, + child: Container( + margin: EdgeInsets.only( + left: 60.w, right: 60.w, top: 20.h, bottom:20.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: 4, + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: BouncingScrollPhysics(), + itemBuilder: (context, position) { + return GestureDetector( + onTap: () {}, + child: rewardItem(), + ); + }, + ); + } + + Widget rewardItem() { + 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: 25.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: double.tryParse( + // "${newUserCouponList.discountAmount}" ?? "0") + // .toInt() + // .toString() ?? + // "", + text: "10", + style: TextStyle( + fontSize: 35.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFFDE5F3B), + ), + ), + ], + ), + ), + Expanded(child:Padding( + padding: EdgeInsets.only(top: 4, bottom: 4,left:10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "海峡姐妹茶吧", + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF181818), + ), + ), + Text( + "10元代金劵一张", + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFFD3623D), + ), + ), + Text( + // "有效期至:${(newUserCouponList.useEndTime != null && newUserCouponList.useEndTime != "") + // ? newUserCouponList.useEndTime.split(" ")[0] + // : "$newUserCouponList.useEndTime"}", + "有效期至:2021-07-30", + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF727272), + ), + ) + ], + ))), + ], + ), + ); + } +} diff --git a/lib/view_widget/login_tips.dart b/lib/view_widget/login_tips.dart index 50574fe7..694a350c 100644 --- a/lib/view_widget/login_tips.dart +++ b/lib/view_widget/login_tips.dart @@ -19,8 +19,11 @@ class LoginTips extends StatelessWidget { type: MaterialType.transparency, child: Center( child: Container( - width: 0.7867.sw, - height: 0.7867.sw / (Platform.isAndroid ? 0.86 : 0.9), + // width: 0.7867.sw, + // height: 0.7867.sw / (Platform.isAndroid ? 0.86 : 0.9), + width:double.infinity, + height:MediaQuery.of(context).size.width / 1, + margin: EdgeInsets.symmetric(horizontal:16.w), padding: EdgeInsets.symmetric(vertical: 20.h, horizontal: 24.w), decoration: BoxDecoration( color: Colors.white, @@ -33,8 +36,8 @@ class LoginTips extends StatelessWidget { children: [ Image.asset( "assets/image/icon_login_tips.png", - width: 0.7867.sw * 0.6, - height: 0.7867.sw * 0.6 * 0.7, + // width: 0.7867.sw * 0.6, + // height: 0.7867.sw * 0.6 * 0.7, fit: BoxFit.fill, ), SizedBox( diff --git a/lib/view_widget/new_people_reward.dart b/lib/view_widget/new_people_reward.dart index 8f1d68bc..abbbb26b 100644 --- a/lib/view_widget/new_people_reward.dart +++ b/lib/view_widget/new_people_reward.dart @@ -1,12 +1,8 @@ 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; diff --git a/lib/view_widget/text_image_dialog.dart b/lib/view_widget/text_image_dialog.dart index 825171fb..119fbddf 100644 --- a/lib/view_widget/text_image_dialog.dart +++ b/lib/view_widget/text_image_dialog.dart @@ -37,7 +37,8 @@ class _TextImageWidget extends State { type: MaterialType.transparency, child: Center( child: Container( - width: widget.width ?? 0.7867.sw, + width: double.infinity, + margin: EdgeInsets.symmetric(horizontal:16.w), padding: EdgeInsets.symmetric(vertical: 20.h, horizontal: 24.w), decoration: BoxDecoration( color: Colors.white, @@ -50,8 +51,8 @@ class _TextImageWidget extends State { children: [ Image.asset( widget.src, - width: 0.7867.sw * 0.9, - height: 0.7867.sw * 0.9 * 0.7, + // width: 0.7867.sw * 0.9, + // height: 0.7867.sw * 0.9 * 0.7, fit: BoxFit.fill, ), SizedBox(