diff --git a/assets/image/2x/icon_guide_1.png b/assets/image/2x/icon_guide_1.png new file mode 100644 index 00000000..2ba34331 Binary files /dev/null and b/assets/image/2x/icon_guide_1.png differ diff --git a/assets/image/2x/icon_guide_2.png b/assets/image/2x/icon_guide_2.png new file mode 100644 index 00000000..f016c4fa Binary files /dev/null and b/assets/image/2x/icon_guide_2.png differ diff --git a/assets/image/2x/icon_guide_3.png b/assets/image/2x/icon_guide_3.png new file mode 100644 index 00000000..7edd1819 Binary files /dev/null and b/assets/image/2x/icon_guide_3.png differ diff --git a/assets/image/2x/icon_guide_4.png b/assets/image/2x/icon_guide_4.png new file mode 100644 index 00000000..80003ba5 Binary files /dev/null and b/assets/image/2x/icon_guide_4.png differ diff --git a/assets/image/2x/icon_zan.png b/assets/image/2x/icon_zan.png new file mode 100644 index 00000000..395e0c97 Binary files /dev/null and b/assets/image/2x/icon_zan.png differ diff --git a/assets/image/3x/icon_guide_1.png b/assets/image/3x/icon_guide_1.png new file mode 100644 index 00000000..5ec0a484 Binary files /dev/null and b/assets/image/3x/icon_guide_1.png differ diff --git a/assets/image/3x/icon_guide_2.png b/assets/image/3x/icon_guide_2.png new file mode 100644 index 00000000..01f368f0 Binary files /dev/null and b/assets/image/3x/icon_guide_2.png differ diff --git a/assets/image/3x/icon_guide_33.png b/assets/image/3x/icon_guide_33.png new file mode 100644 index 00000000..f2554a01 Binary files /dev/null and b/assets/image/3x/icon_guide_33.png differ diff --git a/assets/image/3x/icon_guide_4.png b/assets/image/3x/icon_guide_4.png new file mode 100644 index 00000000..e0e78b55 Binary files /dev/null and b/assets/image/3x/icon_guide_4.png differ diff --git a/assets/image/3x/icon_zan.png b/assets/image/3x/icon_zan.png new file mode 100644 index 00000000..869df3f8 Binary files /dev/null and b/assets/image/3x/icon_zan.png differ diff --git a/assets/image/icon_guide_1.png b/assets/image/icon_guide_1.png new file mode 100644 index 00000000..eca67070 Binary files /dev/null and b/assets/image/icon_guide_1.png differ diff --git a/assets/image/icon_guide_2.png b/assets/image/icon_guide_2.png new file mode 100644 index 00000000..871a1b29 Binary files /dev/null and b/assets/image/icon_guide_2.png differ diff --git a/assets/image/icon_guide_3.png b/assets/image/icon_guide_3.png new file mode 100644 index 00000000..238f3712 Binary files /dev/null and b/assets/image/icon_guide_3.png differ diff --git a/assets/image/icon_guide_4.png b/assets/image/icon_guide_4.png new file mode 100644 index 00000000..51570cb1 Binary files /dev/null and b/assets/image/icon_guide_4.png differ diff --git a/assets/image/icon_zan.png b/assets/image/icon_zan.png new file mode 100644 index 00000000..654d865b Binary files /dev/null and b/assets/image/icon_zan.png differ diff --git a/lib/article/hot_article_item.dart b/lib/article/hot_article_item.dart index 0f97e27e..51e42a86 100644 --- a/lib/article/hot_article_item.dart +++ b/lib/article/hot_article_item.dart @@ -80,7 +80,7 @@ class _HotArticlePage extends State { backgroundColor: Color(0xFFF7F7F7), elevation: 0, title: Text( - S.of(context).remenwenzhangshipinliebiao, + S.of(context).huixiangtoutiao, style: TextStyle( color: Colors.black, fontWeight: FontWeight.bold, diff --git a/lib/generated/intl/messages_en.dart b/lib/generated/intl/messages_en.dart index 981a12cf..8b23a50e 100644 --- a/lib/generated/intl/messages_en.dart +++ b/lib/generated/intl/messages_en.dart @@ -166,11 +166,13 @@ class MessageLookup extends MessageLookupByLibrary { "guanyuchuangshiren" : MessageLookupByLibrary.simpleMessage("关于创始人"), "guojiankangyoujishenghuo" : MessageLookupByLibrary.simpleMessage("过健康有机生活"), "haixiajiemei" : MessageLookupByLibrary.simpleMessage("海峡姐妹"), + "haowu" : MessageLookupByLibrary.simpleMessage("好物"), "heji" : MessageLookupByLibrary.simpleMessage("合计:"), "hexiaochenggong" : MessageLookupByLibrary.simpleMessage("核销成功"), "hexiaomaxiangqing" : MessageLookupByLibrary.simpleMessage("核销码详情"), "huangjinhuiyuan" : MessageLookupByLibrary.simpleMessage("黄金会员"), "huixiangrenyimendian" : MessageLookupByLibrary.simpleMessage("适用于:一心回乡任意门店"), + "huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("回乡头条"), "huiyuandengji" : MessageLookupByLibrary.simpleMessage("会员等级"), "huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("会员等级说明"), "huiyuanjifen" : MessageLookupByLibrary.simpleMessage("会员积分"), diff --git a/lib/generated/intl/messages_zh_CN.dart b/lib/generated/intl/messages_zh_CN.dart index 16459dab..bec66f88 100644 --- a/lib/generated/intl/messages_zh_CN.dart +++ b/lib/generated/intl/messages_zh_CN.dart @@ -165,11 +165,13 @@ class MessageLookup extends MessageLookupByLibrary { "guanyu" : MessageLookupByLibrary.simpleMessage("关于"), "guojiankangyoujishenghuo" : MessageLookupByLibrary.simpleMessage("过健康有机生活"), "haixiajiemei" : MessageLookupByLibrary.simpleMessage("海峡姐妹"), + "haowu" : MessageLookupByLibrary.simpleMessage("好物"), "heji" : MessageLookupByLibrary.simpleMessage("合计:"), "hexiaochenggong" : MessageLookupByLibrary.simpleMessage("核销成功"), "hexiaomaxiangqing" : MessageLookupByLibrary.simpleMessage("核销码详情"), "huangjinhuiyuan" : MessageLookupByLibrary.simpleMessage("黄金会员"), "huixiangrenyimendian" : MessageLookupByLibrary.simpleMessage("适用于:一心回乡任意门店"), + "huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("回乡头条"), "huiyuandengji" : MessageLookupByLibrary.simpleMessage("会员等级"), "huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("会员等级说明"), "huiyuanjifen" : MessageLookupByLibrary.simpleMessage("会员积分"), diff --git a/lib/generated/intl/messages_zh_Hans_CN.dart b/lib/generated/intl/messages_zh_Hans_CN.dart index 61a9ac70..cd09a76d 100644 --- a/lib/generated/intl/messages_zh_Hans_CN.dart +++ b/lib/generated/intl/messages_zh_Hans_CN.dart @@ -165,11 +165,13 @@ class MessageLookup extends MessageLookupByLibrary { "guanyu" : MessageLookupByLibrary.simpleMessage("关于"), "guojiankangyoujishenghuo" : MessageLookupByLibrary.simpleMessage("过健康有机生活"), "haixiajiemei" : MessageLookupByLibrary.simpleMessage("海峡姐妹"), + "haowu" : MessageLookupByLibrary.simpleMessage("好物"), "heji" : MessageLookupByLibrary.simpleMessage("合计:"), "hexiaochenggong" : MessageLookupByLibrary.simpleMessage("核销成功"), "hexiaomaxiangqing" : MessageLookupByLibrary.simpleMessage("核销码详情"), "huangjinhuiyuan" : MessageLookupByLibrary.simpleMessage("黄金会员"), "huixiangrenyimendian" : MessageLookupByLibrary.simpleMessage("适用于:一心回乡任意门店"), + "huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("回乡头条"), "huiyuandengji" : MessageLookupByLibrary.simpleMessage("会员等级"), "huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("会员等级说明"), "huiyuanjifen" : MessageLookupByLibrary.simpleMessage("会员积分"), diff --git a/lib/generated/intl/messages_zh_Hant_CN.dart b/lib/generated/intl/messages_zh_Hant_CN.dart index 10f7fd87..2edf6df6 100644 --- a/lib/generated/intl/messages_zh_Hant_CN.dart +++ b/lib/generated/intl/messages_zh_Hant_CN.dart @@ -165,11 +165,13 @@ class MessageLookup extends MessageLookupByLibrary { "guanyu" : MessageLookupByLibrary.simpleMessage("關於"), "guojiankangyoujishenghuo" : MessageLookupByLibrary.simpleMessage("過健康有機生活"), "haixiajiemei" : MessageLookupByLibrary.simpleMessage("海峽姐妹"), + "haowu" : MessageLookupByLibrary.simpleMessage("好物"), "heji" : MessageLookupByLibrary.simpleMessage("合計:"), "hexiaochenggong" : MessageLookupByLibrary.simpleMessage("核銷成功"), "hexiaomaxiangqing" : MessageLookupByLibrary.simpleMessage("核銷碼詳情"), "huangjinhuiyuan" : MessageLookupByLibrary.simpleMessage("黃金會員"), "huixiangrenyimendian" : MessageLookupByLibrary.simpleMessage("适用于:一心回乡任意门店"), + "huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("回鄉頭條"), "huiyuandengji" : MessageLookupByLibrary.simpleMessage("會員等級"), "huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("會員等級説明"), "huiyuanjifen" : MessageLookupByLibrary.simpleMessage("會員積分"), diff --git a/lib/generated/intl/messages_zh_TW.dart b/lib/generated/intl/messages_zh_TW.dart index 8b1d2300..f712df42 100644 --- a/lib/generated/intl/messages_zh_TW.dart +++ b/lib/generated/intl/messages_zh_TW.dart @@ -165,11 +165,13 @@ class MessageLookup extends MessageLookupByLibrary { "guanyu" : MessageLookupByLibrary.simpleMessage("關於"), "guojiankangyoujishenghuo" : MessageLookupByLibrary.simpleMessage("過健康有機生活"), "haixiajiemei" : MessageLookupByLibrary.simpleMessage("海峽姐妹"), + "haowu" : MessageLookupByLibrary.simpleMessage("好物"), "heji" : MessageLookupByLibrary.simpleMessage("合計:"), "hexiaochenggong" : MessageLookupByLibrary.simpleMessage("核銷成功"), "hexiaomaxiangqing" : MessageLookupByLibrary.simpleMessage("核銷碼詳情"), "huangjinhuiyuan" : MessageLookupByLibrary.simpleMessage("黃金會員"), "huixiangrenyimendian" : MessageLookupByLibrary.simpleMessage("适用于:一心回乡任意门店"), + "huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("回鄉頭條"), "huiyuandengji" : MessageLookupByLibrary.simpleMessage("會員等級"), "huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("會員等級説明"), "huiyuanjifen" : MessageLookupByLibrary.simpleMessage("會員積分"), diff --git a/lib/home/guide_page.dart b/lib/home/guide_page.dart new file mode 100644 index 00000000..0ce23763 --- /dev/null +++ b/lib/home/guide_page.dart @@ -0,0 +1,356 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:huixiang/view_widget/border_text.dart'; + +class GuidePage extends StatefulWidget { + @override + State createState() { + return _GuidePage(); + } +} + +class _GuidePage extends State { + + @override + Widget build(BuildContext context) { + return Scaffold( + body: PageView( + scrollDirection: Axis.horizontal, + reverse: false, + controller: PageController( + initialPage: 0, + viewportFraction: 1, + keepPage: true, + ), + physics: BouncingScrollPhysics(), + pageSnapping: true, + onPageChanged: (index) { + //监听事件 + print('index=====$index'); + }, + children: [ + Container( + alignment: Alignment.center, + color: Colors.white, + child: Center( + child: Container( + margin: EdgeInsets.only(top: 120, left: 19, right: 19), + child: Stack( + children: [ + Column( + children: [ + Align( + alignment: Alignment.center, + child: Image.asset( + "assets/image/icon_guide_1.png", + // height: 307, + ), + ), + SizedBox( + height: 66, + ), + Padding( + padding: EdgeInsets.only(left: 37, right: 37), + child: Text( + "会员最新资讯抢先看", + style: TextStyle( + fontSize: 24, + fontWeight: FontWeight.bold, + color: Color(0XFF32A060)), + ), + ), + SizedBox( + height: 23, + ), + Padding( + padding: EdgeInsets.only(left: 19, right: 19), + child: Text( + "新增多项功能,海量优惠资讯实时推送", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 16, + height:1.5, + fontWeight: FontWeight.w600, + color: Color(0XFF727272)), + ), + ), + ], + ), + Container( + alignment: Alignment.bottomCenter, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "●", + style: TextStyle(fontSize: 8, color: Colors.black), + ), + SizedBox( + width: 10, + ), + Text( + "●", + style: TextStyle( + fontSize: 8, color: Color(0xffB2B2B2)), + ), + SizedBox( + width: 10, + ), + Text( + "●", + style: TextStyle( + fontSize: 8, color: Color(0xffB2B2B2)), + ), + SizedBox( + height: 98, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Container( + alignment: Alignment.center, + color: Colors.white, + child: Center( + child: Container( + margin: EdgeInsets.only(top: 120, left: 19, right: 19), + child: Stack( + children: [ + Column( + children: [ + Align( + alignment: Alignment.center, + child: Image.asset( + "assets/image/icon_guide_2.png", + // height: 307, + ), + ), + SizedBox( + height: 66, + ), + Padding( + padding: EdgeInsets.only(left: 37, right: 37), + child: Text( + "全新集团联盟店会员点餐", + style: TextStyle( + fontSize: 24, + fontWeight: FontWeight.bold, + color: Color(0XFF32A060)), + ), + ), + SizedBox( + height: 23, + ), + Padding( + padding: EdgeInsets.only(left: 19, right: 19), + child: Text( + "新增多项功能,使用平台钱包优惠多多,更有充值优惠享不停", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 16, + height:1.5, + fontWeight: FontWeight.w600, + color: Color(0XFF727272)), + ), + ), + ], + ), + Container( + alignment: Alignment.bottomCenter, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "●", + style: TextStyle( + fontSize: 8, color: Color(0xffB2B2B2)), + ), + SizedBox( + width: 10, + ), + Text( + "●", + style: TextStyle(fontSize: 8, color: Colors.black), + ), + SizedBox( + width: 10, + ), + Text( + "●", + style: TextStyle( + fontSize: 8, color: Color(0xffB2B2B2)), + ), + SizedBox( + height: 98, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Container( + alignment: Alignment.center, + color: Colors.white, + child: Center( + child: Container( + margin: EdgeInsets.only(top: 120, left: 19, right: 19), + child: Stack( + children: [ + Column( + children: [ + Align( + alignment: Alignment.center, + child: Image.asset( + "assets/image/icon_guide_3.png", + // height: 307, + ), + ), + SizedBox( + height: 66, + ), + Padding( + padding: EdgeInsets.only(left: 37, right: 37), + child: Text( + "会员活动专区", + style: TextStyle( + fontSize: 24, + fontWeight: FontWeight.bold, + color: Color(0XFF32A060)), + ), + ), + SizedBox( + height: 23, + ), + Padding( + padding: EdgeInsets.only(left: 19, right: 19), + child: Text( + "新增会员任务得积分,消费可得绿金、积分商城换购", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 16, + height:1.5, + fontWeight: FontWeight.w600, + color: Color(0XFF727272)), + ), + ), + ], + ), + Container( + alignment: Alignment.bottomCenter, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "●", + style: TextStyle( + fontSize: 8, color: Color(0xffB2B2B2)), + ), + SizedBox( + width: 10, + ), + Text( + "●", + style: TextStyle( + fontSize: 8, color: Color(0xffB2B2B2)), + ), + SizedBox( + width: 10, + ), + Text( + "●", + style: TextStyle(fontSize: 8, color: Colors.black), + ), + SizedBox( + height: 98, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Container( + alignment: Alignment.center, + color: Colors.white, + child: Center( + child: Container( + margin: EdgeInsets.only(top: 108), + child: + Column( + children: [ + Image.asset( + "assets/image/icon_guide_4.png", + width: double.infinity, + fit: BoxFit.fill, + ), + SizedBox( + height: 66, + ), + Padding( + padding: EdgeInsets.only(left: 104, right: 104), + child: Text( + "会员活动专区", + style: TextStyle( + fontSize: 24, + fontWeight: FontWeight.bold, + color: Color(0XFF32A060)), + ), + ), + SizedBox( + height: 23, + ), + Padding( + padding: EdgeInsets.only(left: 52, right: 52), + child: Text( + "传递友爱纯净健康有机环保智慧理念", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 16, + height:1.5, + fontWeight: FontWeight.w600, + color: Color(0XFF727272)), + ), + ), + SizedBox( + height: 50, + ), + GestureDetector( + onTap: (){ + Navigator.of(context).pushNamed('/router/login_page'); + }, + child:Container( + margin: EdgeInsets.only(left: 71,right: 71), + alignment: Alignment.bottomCenter, + child:BorderText( + padding: EdgeInsets.all(11), + text: "立即体验", + fontSize: 20, + textColor: Color(0xFF32A060), + borderColor: Color(0xFF32A060), + borderWidth: 1, + radius: 26.5, + ), + ), + ), + ], + ), + ), + ), + ) + ], + ), + ); + } +} diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index 2309653d..ebf47a64 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -14,6 +14,7 @@ import 'package:huixiang/retrofit/data/goods.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/view_widget/border_text.dart'; import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/hot_item.dart'; @@ -24,26 +25,30 @@ import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; class HomePage extends StatefulWidget { + final GestureTapCallback callback; + HomePage(this.callback); @override State createState() { - return _HomePage(); + return _HomePage(callback); } } class _HomePage extends State with AutomaticKeepAliveClientMixin { ApiService apiService; + final GestureTapCallback callback; + _HomePage(this.callback); @override void initState() { super.initState(); SharedPreferences.getInstance().then((value) => { - apiService = ApiService(Dio(), - context: context, - token: value.getString('token'), - showLoading: false), - queryHome(), - }); + apiService = ApiService(Dio(), + context: context, + token: value.getString('token'), + showLoading: false), + queryHome(), + }); eventBus.on().listen((event) { if (event.type < 3) { @@ -190,7 +195,7 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { child: signIn(), ), ItemTitle( - text: S.of(context).remenwenzhangshipin, + text: S.of(context).huixiangtoutiao, imgPath: "assets/image/icon_today_video.png", moreText: S.of(context).chakangengduo, onTap: () { @@ -198,10 +203,10 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { }, ), hotList(), - ItemTitle( - text: S.of(context).chuangshirendegushi, - imgPath: "assets/image/icon_founder.png", - ), + // ItemTitle( + // text: S.of(context).chuangshirendegushi, + // imgPath: "assets/image/icon_founder.png", + // ), GestureDetector( onTap: () { Navigator.of(context).pushNamed('/router/founder_story_page'); @@ -213,11 +218,69 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { imgPath: "assets/image/icon_brand_introduction.png", ), brands(), - ItemTitle( - text: S.of(context).jifenshangcheng, - imgPath: "assets/image/icon_points_mall.png", + Container( + margin: EdgeInsets.only(left:16.5,right: 16.5,bottom: 40), + padding: EdgeInsets.only(bottom: 10), + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(4), + ), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + color: Colors.white), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded(flex: 1,child:ItemTitle( + text: S.of(context).jifenshangcheng, + imgPath: "assets/image/icon_points_mall.png", + )), + GestureDetector( + onTap: callback, + child:Container( + padding: EdgeInsets.only(left:8,right: 8,top:3,bottom: 3), + margin:EdgeInsets.only(right: 16), + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(11.5), + ), + color: Color(0xFF32A060)), + child: Row( + children: [ + Text("GO",style: TextStyle( + fontSize: 14,fontWeight: FontWeight.bold,color: Colors.white + ),), + Icon( + Icons.chevron_right, + color: Colors.white, + size: 18, + ), + ], + ), + ), + ), + ], + ), + Divider( + // indent: 0.0, + thickness:1, + color: Color(0xffF2F2F2), + ), + points(), + ], + ), ), - integralStore(), + + // integralStore(), ], ), ), @@ -225,6 +288,7 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { ); } + Widget hotList() { return AspectRatio( aspectRatio: 2.47, @@ -268,7 +332,7 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { MImage( founder != null ? founder.imgUrl : "", aspectRatio: 2, - radius: BorderRadius.circular(4), + // radius: BorderRadius.circular(4), fit: BoxFit.cover, errorSrc: "assets/image/default_2_1.png", fadeSrc: "assets/image/default_2_1.png", @@ -293,49 +357,48 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { crossAxisAlignment: CrossAxisAlignment.baseline, textBaseline: TextBaseline.alphabetic, children: [ - Text( - founder != null ? founder.name : "", - style: TextStyle( - fontSize: 14.sp, - fontWeight: FontWeight.bold, - color: Colors.white, - ), - ), - SizedBox( - width: 10.w, - ), - Text( - S.of(context).jituanchuangshiren, - style: TextStyle( - fontSize: 8.sp, - color: Colors.white, + Expanded( + child: + Row( + children: [ + Text( + "创始人的故事-", + style: TextStyle( + fontSize: 14.sp, + color: Colors.white, + ), + ), + Text( + founder != null ? founder.name : "", + style: TextStyle( + fontSize: 14.sp, + color: Colors.white, + ), + ), + ], ), + flex: 1, ), - SizedBox( - width: 20.w, - ), - Expanded( - child: Text( - S.of(context).jianjie( - "${founder != null ? founder.description : ""}"), - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 10.sp, + Row( + children: [ + Text( + "查看详情", + style: TextStyle( + fontSize: 10.sp, + color: Colors.white, + ), + ), + Icon( + Icons.keyboard_arrow_right, + size: 12, color: Colors.white, ), - ), - flex: 1, - ) + ], + ), ], ), flex: 1, ), - Icon( - Icons.keyboard_arrow_right, - size: 12, - color: Colors.white, - ), ], ), ), @@ -344,6 +407,33 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { ); } + Widget points() { + return Container( + child: Column( + children: [ + Container( + height: 219.h, + child: Swiper( + key: UniqueKey(), + itemCount: articles != null ? articles.length : 0, + viewportFraction: 0.95, + scale: 1, + loop: false, + physics: BouncingScrollPhysics(), + itemBuilder: (context, position) { + return Container( + // margin: EdgeInsets.symmetric(vertical: 15.h, horizontal: 4.5.w), + child:integralStore(), + ); + }, + ), + ) + ], + + ), + ); + } + Widget integralStore() { return GridView.builder( itemCount: gooods != null ? gooods.length : 0, @@ -352,7 +442,7 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { physics: NeverScrollableScrollPhysics(), gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( //一行的Widget数量 - crossAxisCount: 3, + crossAxisCount: 2, //水平子Widget之间间距 crossAxisSpacing: 13, //垂直子Widget之间间距 @@ -363,8 +453,8 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { itemBuilder: (contetx, index) { return GestureDetector( onTap: () { - Navigator.of(context).pushNamed('/router/integral_store_page', - arguments: {"goodsId": gooods[index].id}); + // Navigator.of(context).pushNamed('/router/integral_store_page', + // arguments: {"goodsId": gooods[index].id}); }, child: buildItem(gooods[index]), ); @@ -375,29 +465,31 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { Widget buildItem(Goods goods) { return Container( alignment: Alignment.center, - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(4), - ), - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0, - ) - ], - color: Colors.white), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.all( + // Radius.circular(4), + // ), + // boxShadow: [ + // BoxShadow( + // color: Colors.black.withAlpha(12), + // offset: Offset(0, 3), + // blurRadius: 14, + // spreadRadius: 0, + // ) + // ], + // color: Colors.white), child: Column( children: [ MImage( goods.mainImgPath, - aspectRatio: 1, + aspectRatio: 5/3, radius: BorderRadius.only( topLeft: Radius.circular(4), topRight: Radius.circular(4), + bottomRight: Radius.circular(4), + bottomLeft: Radius.circular(4), ), - fit: BoxFit.fill, + fit: BoxFit.cover, errorSrc: "assets/image/default_1.png", fadeSrc: "assets/image/default_1.png", ), @@ -410,48 +502,42 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - goods.name, - overflow: TextOverflow.ellipsis, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 12.sp, - ), - ), - SizedBox( - height: 4.h, - ), + SizedBox(height: 14,), Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.end, children: [ - Expanded( - child: Text( - S - .of(context) - .yuan_(double.tryParse(goods.worth).toInt()), - overflow: TextOverflow.ellipsis, - style: TextStyle( - color: Color(0xFF585858), - decoration: TextDecoration.lineThrough, - decorationColor: Color(0xFF585858), - fontSize: 10.sp, - ), - ), - flex: 1, - ), - Text( - S.of(context).jifen_(goods.price), + Expanded(flex: 1,child:Text( + goods.name, overflow: TextOverflow.ellipsis, style: TextStyle( - color: Color(0xFF32A060), - fontSize: 14.sp, + color: Color(0xff353535), fontWeight: FontWeight.bold, + fontSize: 14.sp, ), + ) ) + , + BorderText( + padding: EdgeInsets.all(2.h), + text: S.of(context).haowu, + fontSize: 12.sp, + fontWeight: FontWeight.bold, + textColor: Color(0xFF32A060), + borderColor: Color(0xFF32A060), + borderWidth: 1.w, ), ], ), + SizedBox( + height: 5.h, + ), + Text( + goods.description, + maxLines: 2, + style: TextStyle( + color: Color(0xFF727272), + fontSize: 12.sp, + fontWeight: FontWeight.w500 + ), + ), ], ), ) @@ -550,7 +636,7 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { ); }, itemCount: - (brandData != null && brandData.length > 0) ? brandData.length : 0, + (brandData != null && brandData.length > 0) ? brandData.length : 0, ), // child: AspectRatio( // aspectRatio: 4.16, diff --git a/lib/home/main_home_page.dart b/lib/home/main_home_page.dart index 65c67d82..24468e02 100644 --- a/lib/home/main_home_page.dart +++ b/lib/home/main_home_page.dart @@ -28,7 +28,11 @@ class _MainHomePage extends State tabcontroller.addListener(() => () {}); //NoDataView(), - _widgetOptions = [HomePage(), ActivityListPage(), PointsMallPage()]; + _widgetOptions = [HomePage((){ + setState(() { + tabcontroller.index = 2; + }); + }), ActivityListPage(), PointsMallPage()]; eventBus.on().listen((event) { print("object: MainHomePage"); diff --git a/lib/integral_store/integral_store_details_page.dart b/lib/integral_store/integral_store_details_page.dart index b8e9c71c..a50e06b7 100644 --- a/lib/integral_store/integral_store_details_page.dart +++ b/lib/integral_store/integral_store_details_page.dart @@ -254,7 +254,7 @@ class _IntegralStoreDetailsPage extends State { Text( goods == null ? "" - : S.of(context).yiduihuanjian("${goods.sales}万"), + : S.of(context).yiduihuanjian("${goods.sales}"), style: TextStyle( fontSize: 10.sp, color: Color(0xFFA29E9E), diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index 0b092111..9988653e 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -391,6 +391,9 @@ "bangong": "办公", "fenxiangdao": "分享到", "jifenbuzu": "您的积分不足", + "haowu": "好物", + "huixiangtoutiao": "回乡头条", + diff --git a/lib/l10n/intl_zh_Hans_CN.arb b/lib/l10n/intl_zh_Hans_CN.arb index 7b80a685..3d1b41a6 100644 --- a/lib/l10n/intl_zh_Hans_CN.arb +++ b/lib/l10n/intl_zh_Hans_CN.arb @@ -393,6 +393,8 @@ "fenxiangdao": "分享到", "jifenbuzu": "您的积分不足", + "haowu": "好物", + "huixiangtoutiao": "回乡头条", diff --git a/lib/l10n/intl_zh_Hant_CN.arb b/lib/l10n/intl_zh_Hant_CN.arb index a51234b3..77394321 100644 --- a/lib/l10n/intl_zh_Hant_CN.arb +++ b/lib/l10n/intl_zh_Hant_CN.arb @@ -384,6 +384,9 @@ "bangong": "辦公", "fenxiangdao": "分享到", "jifenbuzu": "您的積分不足", + "haowu": "好物", + "huixiangtoutiao": "回鄉頭條", + "privacy_policy4": "并使用本機號碼登錄" diff --git a/lib/l10n/intl_zh_TW.arb b/lib/l10n/intl_zh_TW.arb index a51234b3..77394321 100644 --- a/lib/l10n/intl_zh_TW.arb +++ b/lib/l10n/intl_zh_TW.arb @@ -384,6 +384,9 @@ "bangong": "辦公", "fenxiangdao": "分享到", "jifenbuzu": "您的積分不足", + "haowu": "好物", + "huixiangtoutiao": "回鄉頭條", + "privacy_policy4": "并使用本機號碼登錄" diff --git a/lib/login/login_page.dart b/lib/login/login_page.dart index b0761c5e..851be133 100644 --- a/lib/login/login_page.dart +++ b/lib/login/login_page.dart @@ -17,7 +17,7 @@ import 'package:flutter/services.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:dio/dio.dart'; -import 'package:photo_view/photo_view.dart'; +// import 'package:photo_view/photo_view.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart'; @@ -394,11 +394,11 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { child: Stack( alignment: Alignment.center, children: [ - PhotoView( - imageProvider: AssetImage("assets/image/laoban.png"), - initialScale: Platform.isAndroid ? 1.02 : 1.2, - basePosition: alignmentProgress, - ), + // PhotoView( + // imageProvider: AssetImage("assets/image/laoban.png"), + // initialScale: Platform.isAndroid ? 1.02 : 1.2, + // basePosition: alignmentProgress, + // ), Positioned( top: 54.h, left: 28.w, diff --git a/lib/main.dart b/lib/main.dart index a641364f..cb292866 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -57,6 +57,7 @@ import 'package:sharesdk_plugin/sharesdk_interface.dart'; import 'package:sharesdk_plugin/sharesdk_register.dart'; import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart'; +import 'home/guide_page.dart'; import 'main_page.dart'; import 'mine/manage_address_page.dart'; import 'mine/roll_center_page.dart'; @@ -141,7 +142,7 @@ class MyApp extends StatelessWidget { return appLocale ?? locales[0]; }, supportedLocales: S.delegate.supportedLocales, - home: LoginPage(), + home: GuidePage(), // home: MainPage(), builder: (context, widget) { return MediaQuery( @@ -167,7 +168,7 @@ class MyApp extends StatelessWidget { return MaterialPageRoute( //未找到页面配置进入登录页 builder: (context) { - return LoginPage(); + return GuidePage(); }, settings: settings, ); @@ -178,6 +179,7 @@ class MyApp extends StatelessWidget { } Map routers = { + '/router/guide_Page': (context, {arguments}) => GuidePage(), '/router/login_page': (context, {arguments}) => LoginPage(arguments: arguments), '/router/main_page': (context, {arguments}) => MainPage(), '/router/msg_page': (context, {arguments}) => MainMessagePage(), diff --git a/lib/mine/mine_page.dart b/lib/mine/mine_page.dart index 721d5cb8..952b7b36 100644 --- a/lib/mine/mine_page.dart +++ b/lib/mine/mine_page.dart @@ -52,6 +52,12 @@ class _MinePage extends State with AutomaticKeepAliveClientMixin { ); } + @override + void dispose() { + super.dispose(); + _refreshController.dispose(); + } + @override void initState() { super.initState(); diff --git a/lib/mine/user_info_page.dart b/lib/mine/user_info_page.dart index 938c284f..8e780b9f 100644 --- a/lib/mine/user_info_page.dart +++ b/lib/mine/user_info_page.dart @@ -196,7 +196,7 @@ class _UserInfoPage extends State { (modifyInfo["nickname"]) == "" ? "回乡" : modifyInfo["nickname"]), ), InkWell( - onTap: showDateSelector, + onTap:(modifyInfo["birth"] == "")?showDateSelector:(){}, child: avatarItem( 2, (modifyInfo["birth"] != null && modifyInfo["birth"] != "") @@ -239,7 +239,7 @@ class _UserInfoPage extends State { builder: (_) { return CupertinoDatePickerWidget(); }); - if (dateTime != null) { + if (dateTime != null ) { modifyInfo["birth"] = DateFormat("yyyy-MM-dd").format(dateTime); user.birth = modifyInfo["birth"]; age = AppUtils.getAge(dateTime); diff --git a/lib/view_widget/hot_item.dart b/lib/view_widget/hot_item.dart index c220017d..9558f426 100644 --- a/lib/view_widget/hot_item.dart +++ b/lib/view_widget/hot_item.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/article.dart'; @@ -104,17 +105,28 @@ class HotArticleItem extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( - child: IconText( - article != null - ? (article.createTime.split(" ")[0]) - : "", - textStyle: TextStyle( - fontSize: 10.sp, - color: Color(0xFFB2B2B2), - ), - leftIcon: Icons.access_time_rounded, - iconSize: 10, - iconColor: Color(0xFFB2B2B2), + child: Row( + children: [ + IconText( + article != null + ? (article.createTime.split(" ")[0]) + : "", + textStyle: TextStyle( + fontSize: 10.sp, + color: Color(0xFFB2B2B2), + ), + leftIcon: Icons.access_time_rounded, + iconSize: 10, + iconColor: Color(0xFFB2B2B2), + ), + SizedBox(width: 8,), + Image.asset( + "assets/image/icon_zan.png", + width: 14.w, + height: 14.h, + ), + Text("58",style: TextStyle(fontSize:10,color:Color(0xffB9B9B9)),) + ], ), flex: 1, ), diff --git a/pubspec.lock b/pubspec.lock index d658d848..2bf3bc3c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -56,7 +56,7 @@ packages: name: async url: "https://pub.flutter-io.cn" source: hosted - version: "2.5.0" + version: "2.6.1" barcode: dependency: transitive description: @@ -594,7 +594,7 @@ packages: name: path_provider_linux url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.0" + version: "2.0.2" path_provider_platform_interface: dependency: transitive description: @@ -608,7 +608,7 @@ packages: name: path_provider_windows url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.1" + version: "2.0.3" pedantic: dependency: transitive description: @@ -637,13 +637,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "4.1.0" - photo_view: - dependency: "direct main" - description: - name: photo_view - url: "https://pub.flutter-io.cn" - source: hosted - version: "0.11.1" platform: dependency: transitive description: @@ -741,14 +734,14 @@ packages: name: shared_preferences_linux url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.0" + version: "2.0.2" shared_preferences_macos: dependency: transitive description: name: shared_preferences_macos url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.0" + version: "2.0.2" shared_preferences_platform_interface: dependency: transitive description: @@ -762,14 +755,14 @@ packages: name: shared_preferences_web url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.0" + version: "2.0.1" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.0" + version: "2.0.2" sharesdk_plugin: dependency: "direct main" description: @@ -872,7 +865,7 @@ packages: name: test_api url: "https://pub.flutter-io.cn" source: hosted - version: "0.2.19" + version: "0.3.0" timing: dependency: transitive description: @@ -886,7 +879,7 @@ packages: path: "." ref: "V1.1.2" resolved-ref: b814d62f4b82422459f786671f23dd535062d503 - url: "https://github.com/TencentCloud/TPNS-Flutter-Plugin" + url: "git://github.com/TencentCloud/TPNS-Flutter-Plugin" source: git version: "1.1.2" transformer_page_view: @@ -993,7 +986,7 @@ packages: name: win32 url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.5" + version: "2.2.5" xdg_directories: dependency: transitive description: @@ -1016,5 +1009,5 @@ packages: source: hosted version: "3.1.0" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.13.0 <3.0.0" flutter: ">=2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index a3ae8b1d..99fe6413 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -32,7 +32,7 @@ dependencies: tpns_flutter_plugin: git: - url: https://github.com/TencentCloud/TPNS-Flutter-Plugin + url: git://github.com/TencentCloud/TPNS-Flutter-Plugin ref: V1.1.2 # tpns_flutter_plugin: ^1.1.0 @@ -85,7 +85,7 @@ dependencies: cached_network_image: ^2.0.0 flutter_html: ^1.3.0 #2.1.0 - photo_view: ^0.11.1 +# photo_view: ^0.11.1 chewie: ^0.12.2 video_player: ^1.0.1