diff --git a/assets/image/2x/activity_hot.png b/assets/image/2x/activity_hot.png new file mode 100644 index 00000000..99d96f82 Binary files /dev/null and b/assets/image/2x/activity_hot.png differ 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_hot.png b/assets/image/3x/activity_hot.png new file mode 100644 index 00000000..65abff9d Binary files /dev/null and b/assets/image/3x/activity_hot.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_hot.png b/assets/image/activity_hot.png new file mode 100644 index 00000000..c7eb44da Binary files /dev/null and b/assets/image/activity_hot.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/community_view/class_details.dart b/lib/community/community_view/class_details.dart index 892b62e6..7cfbf095 100644 --- a/lib/community/community_view/class_details.dart +++ b/lib/community/community_view/class_details.dart @@ -200,7 +200,7 @@ class _ClassDetails extends State with WidgetsBindingObserver { Row( children: [ Container( - height: 22.h, + // height: 22.h, padding:EdgeInsets.only(left:2,right:2), alignment: Alignment.center, decoration: BoxDecoration( @@ -216,6 +216,7 @@ class _ClassDetails extends State with WidgetsBindingObserver { course.tags.length > 0) ? course.tags[0] : "", + overflow:TextOverflow.ellipsis, style: TextStyle( fontSize: 14.sp, fontWeight: MyFontWeight.medium, diff --git a/lib/community/community_view/home_class.dart b/lib/community/community_view/home_class.dart index 83d8e254..2d960d4f 100644 --- a/lib/community/community_view/home_class.dart +++ b/lib/community/community_view/home_class.dart @@ -220,7 +220,7 @@ class _HomeClass extends State { Container( margin: EdgeInsets.only(top: 8, right: 8), padding: EdgeInsets.only(left: 2, right: 2), - height: 16.h, + height: 20.h, alignment: Alignment.center, decoration: BoxDecoration( borderRadius: BorderRadius.circular(2), @@ -230,8 +230,9 @@ class _HomeClass extends State { (collect?.tags != null && collect.tags.length > 0) ? collect.tags[0] : "", + overflow:TextOverflow.ellipsis, style: TextStyle( - fontSize: 12.sp, + fontSize: 11.sp, fontWeight: MyFontWeight.medium, color: Color(0xFF634815), ), diff --git a/lib/community/headlines/activity_top_list.dart b/lib/community/headlines/activity_top_list.dart new file mode 100644 index 00000000..d5524ecc --- /dev/null +++ b/lib/community/headlines/activity_top_list.dart @@ -0,0 +1,169 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; +import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; +import 'package:huixiang/retrofit/data/article.dart'; +import 'package:huixiang/retrofit/data/collect_class_list.dart'; +import 'package:huixiang/retrofit/data/course_list.dart'; +import 'package:huixiang/retrofit/data/headlines_list.dart'; +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 ActivityTopList extends StatefulWidget { + final List
articleTop; + + ActivityTopList(this.articleTop); + + @override + State createState() { + return _ActivityTopList(); + } +} + +class _ActivityTopList extends State { + ApiService apiService; + BMFCoordinate latLng; + + final TextEditingController editingController = TextEditingController(); + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Container( + height: 220.h, + margin: EdgeInsets.only(top: 10), + child: ListView.builder( + scrollDirection: Axis.horizontal, + physics: BouncingScrollPhysics(), + padding: EdgeInsets.symmetric(horizontal: 10), + itemCount: widget.articleTop == null ? 0 : widget.articleTop.length, + itemBuilder: (context, position) { + return GestureDetector( + onTap: () { + Navigator.of(context).pushNamed( + '/router/headlines_column_details', + arguments: {"id": widget.articleTop[position].id}); + }, + child: headlinesCollectionItem(widget.articleTop[position], position), + ); + }, + ), + ); + } + + Widget headlinesCollectionItem(Article articles, index) { + return Container( + width: 340.w, + height: 220.h, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(10), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + color: Colors.black, + ), + margin: EdgeInsets.symmetric( + horizontal: 6, + ), + child:Column( + children: [ + Stack( + alignment: Alignment.bottomLeft, + children: [ + 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", + ), + ), + 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, + ), + 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 6c6f928d..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'; @@ -25,6 +26,7 @@ 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'; +import 'activity_top_list.dart'; import 'article_list.dart'; class ArticlePage extends StatefulWidget { @@ -44,6 +46,7 @@ class _ArticlePage extends State List brands = []; List bannerData = []; List
articles = []; + List
articleTop = []; List headlines = []; int pageNum = 1; @@ -57,7 +60,8 @@ class _ArticlePage extends State setState(() {}); } }); - queryArticleList(); + queryArticleList(false); + queryArticleList(true); queryHeadlinesBanner(); queryHeadlinesList(); } @@ -95,7 +99,7 @@ class _ArticlePage extends State } ///文章列表 - queryArticleList() async { + queryArticleList(bool isHot) async { if (apiService == null) { SharedPreferences value = await SharedPreferences.getInstance(); apiService = ApiService( @@ -109,7 +113,9 @@ class _ArticlePage extends State "pageSize": 10, "searchKey": "", "state": 1, - "type": 2 + "type": 2, + "storeId":"", + "isHot":isHot }).catchError((onError) { refreshController.refreshFailed(); refreshController.loadFailed(); @@ -118,9 +124,15 @@ class _ArticlePage extends State refreshController.refreshCompleted(); refreshController.loadComplete(); if (pageNum == 1) { + if(!isHot) articles.clear(); + else + articleTop.clear(); } + if(!isHot) articles.addAll(baseData.data.list); + else + articleTop.addAll(baseData.data.list); if (baseData.data.pageNum == baseData.data.pages) { refreshController.loadNoData(); } else { @@ -160,7 +172,8 @@ class _ArticlePage extends State _onRefresh() { queryHeadlinesBanner(); queryHeadlinesList(); //分类列表 - queryArticleList(); + queryArticleList(false); + queryArticleList(true); } @override @@ -182,7 +195,7 @@ class _ArticlePage extends State ), onRefresh: _onRefresh, onLoading: () { - queryArticleList(); + queryArticleList(false); }, physics: BouncingScrollPhysics(), scrollController: scrollController, @@ -227,12 +240,29 @@ class _ArticlePage extends State List classChildItem() { var widgets = [ ///文章banner - HeadlinesBanner( - bannerData, - ), + // HeadlinesBanner( + // bannerData, + // ), + + ActivityTopList(articleTop), 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 ebf21fd3..1bf752f8 100644 --- a/lib/community/headlines/headlines_column_details.dart +++ b/lib/community/headlines/headlines_column_details.dart @@ -78,7 +78,8 @@ class _HeadlinesColumnDetails extends State "searchKey": "", "state": 1, "type": 2, - "categoryId": categoryId + "categoryId": categoryId, + "isHot":false, }).catchError((onError) { refreshController.refreshFailed(); refreshController.loadFailed(); @@ -113,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 3e436c43..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'; @@ -66,6 +67,7 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { setState(() {}); } }); + queryMsgStats(); if ((widget.invite ?? "") != "" || widget.interviewCouponList != null && @@ -259,12 +261,13 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { BaseData> baseData = await apiService.stats().catchError((onError) {}); if (baseData != null && baseData.isSuccess) { setState(() { + totalMsg = 0; baseData.data.forEach((element) { totalMsg += element.number; }); }); - refreshController.loadComplete(); - refreshController.refreshCompleted(); + // refreshController.loadComplete(); + // refreshController.refreshCompleted(); } EasyLoading.dismiss(); } @@ -300,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, @@ -521,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 d6efc02d..af482424 100644 --- a/lib/message/system_details.dart +++ b/lib/message/system_details.dart @@ -37,13 +37,14 @@ class _SystemDetails extends State { int pageNum = 1; List messages = []; int msgType = 0; - String parenId = "0"; + // String parenId = "0"; var commentFocus = FocusNode(); String hintText = S.current.liuxianinjingcaidepinglunba; bool isKeyBoardShow = false; final GlobalKey commentKey = GlobalKey(); final GlobalKey inputKey = GlobalKey(); final TextEditingController commentTextController = TextEditingController(); + int indexMsg = 0; @override @@ -108,29 +109,28 @@ class _SystemDetails extends State { ///评论 回复 _reply(messageRelational) { - var messageRelational = jsonDecode(messages[0].relational), - parenId = messageRelational["mid"].toString(); + var messageRelational = jsonDecode(messages[indexMsg].relational); + messageRelational["additionId"].toString(); hintText = S.of(context).huifu_("${messageRelational["nickname"]}"); } ///动态发布评论 _queryMemberComment(String content) async { + var messageRelational = jsonDecode(messages[indexMsg].relational); BaseData baseData = await apiService.memberComment({ "content": content, - "parentId": parenId, - "relationalId": messages[0].mid, + "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(); SmartDialog.showToast("发布成功", alignment: Alignment.center); } else{ - SmartDialog.showToast("发布失败", alignment: Alignment.center); + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); } } @@ -627,14 +627,14 @@ class _SystemDetails extends State { }, ); }, - child: commentMessageItem(messages[position]), + child: commentMessageItem(messages[position],position), ); }), ], ) ); } - Widget commentMessageItem(Message message) { + Widget commentMessageItem(Message message,index) { var messageRelational = jsonDecode(message.relational); return Container( child: @@ -697,6 +697,7 @@ class _SystemDetails extends State { GestureDetector( onTap: (){ setState(() { + indexMsg = index; showDeleteDialog(); _reply(messageRelational); }); diff --git a/lib/message/system_message.dart b/lib/message/system_message.dart index 9be81392..f8276451 100644 --- a/lib/message/system_message.dart +++ b/lib/message/system_message.dart @@ -28,7 +28,6 @@ class _SystemMessagePage extends State { ApiService apiService; int pageNum = 1; List messages = []; - List msgStats = []; Map msgNumber = { "1":0, "2":0, @@ -106,9 +105,10 @@ class _SystemMessagePage extends State { BaseData> baseData = await apiService.stats().catchError((onError) {}); if (baseData != null && baseData.isSuccess) { setState(() { - msgStats.clear(); - msgStats = baseData.data; - msgStats.forEach((element) { + msgNumber.forEach((key, value) { + msgNumber[key] = 0; + }); + baseData.data.forEach((element) { if(msgNumber.containsKey(element.name)){ msgNumber[element.name] = element.number; } diff --git a/lib/mine/mine_view/wallet_coupon_view.dart b/lib/mine/mine_view/wallet_coupon_view.dart index 0702b853..8ea70420 100644 --- a/lib/mine/mine_view/wallet_coupon_view.dart +++ b/lib/mine/mine_view/wallet_coupon_view.dart @@ -1,3 +1,4 @@ +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/utils/font_weight.dart'; @@ -30,11 +31,8 @@ class _WalletCoupon extends State { ), ], ), - child: Row( - children: [ - Expanded( - flex: 1, - child: GestureDetector( + child: (Theme.of(context).platform == TargetPlatform.android) + ? GestureDetector( onTap: () { SharedPreferences.getInstance().then((value) { if (value.getString("token") == null || @@ -46,8 +44,6 @@ class _WalletCoupon extends State { }); }, child: Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, children: [ Image.asset( "assets/image/icon_mine_invoice_assistant.png", @@ -58,70 +54,128 @@ class _WalletCoupon extends State { width: 12.w, ), Expanded( - child: Text( - S.of(context).lingquanzhongxin, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 16.sp, - color: Color(0xFF353535), - ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + S.of(context).lingquanzhongxin, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 16.sp, + color: Color(0xFF353535), + ), + ), + SizedBox( + height: 3, + ), + Text( + "联盟下单享不停、海量优惠券等你来领!", + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 12.sp, + color: Color(0xFF7B7B7B), + ), + ), + ], ), - flex: 1, - ), + ) ], - ), - ), - ), - Container( - width: 2.w, - height: 32.h, - margin: EdgeInsets.only(left: 20.w, right: 20.w), - color: Color(0xFFF7F7F7), - ), - Expanded( - flex: 1, - child: GestureDetector( - onTap: () { - SharedPreferences.getInstance().then((value) { - if (value.getString("token") == null || - value.getString("token") == "") { - LoginTipsDialog().show(context); - return; - } - Navigator.of(context).pushNamed('/router/mine_wallet'); - }); - }, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - "assets/image/icon_mine_wallet.png", - width: 48.h, - height: 48.h, - ), - SizedBox( - width: 12.w, + )) + : Row( + children: [ + Expanded( + flex: 1, + child: GestureDetector( + onTap: () { + SharedPreferences.getInstance().then((value) { + if (value.getString("token") == null || + value.getString("token") == "") { + LoginTipsDialog().show(context); + return; + } + Navigator.of(context) + .pushNamed('/router/roll_center_page'); + }); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/image/icon_mine_invoice_assistant.png", + width: 48.h, + height: 48.h, + ), + SizedBox( + width: 12.w, + ), + Expanded( + child: Text( + S.of(context).lingquanzhongxin, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 16.sp, + color: Color(0xFF353535), + ), + ), + flex: 1, + ), + ], + ), ), - Expanded( - child: Text( - S.of(context).wodeqianbao, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 16.sp, - color: Color(0xFF353535), - ), + ), + Container( + width: 2.w, + height: 32.h, + margin: EdgeInsets.only(left: 20.w, right: 20.w), + color: Color(0xFFF7F7F7), + ), + Expanded( + flex: 1, + child: GestureDetector( + onTap: () { + SharedPreferences.getInstance().then((value) { + if (value.getString("token") == null || + value.getString("token") == "") { + LoginTipsDialog().show(context); + return; + } + Navigator.of(context).pushNamed('/router/mine_wallet'); + }); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/image/icon_mine_wallet.png", + width: 48.h, + height: 48.h, + ), + SizedBox( + width: 12.w, + ), + Expanded( + child: Text( + S.of(context).wodeqianbao, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 16.sp, + color: Color(0xFF353535), + ), + ), + flex: 1, + ), + ], ), - flex: 1, ), - ], - ), + ), + ], ), - ), - ], - ), ); } } diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 24fa7fba..b08fd3cd 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -54,14 +54,14 @@ 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/"; ///费韬 +const base_url = "http://192.168.10.236:8766/app/"; ///费韬 +const baseUrl = "http://192.168.10.236:8766/app/"; ///费韬 // const base_url = "http://192.168.10.159:8766/app/"; ///费韬 // const baseUrl = "http://192.168.10.159:8766/app/"; ///费韬 diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index 5735110a..71083690 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.236:8766/app/'; } final Dio _dio; 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(