diff --git a/assets/image/2x/qr_share_bg_yq.png b/assets/image/2x/qr_share_bg_yq.png new file mode 100644 index 00000000..1049d60b Binary files /dev/null and b/assets/image/2x/qr_share_bg_yq.png differ diff --git a/assets/image/2x/share_image_bg_yq.png b/assets/image/2x/share_image_bg_yq.png new file mode 100644 index 00000000..607e35fb Binary files /dev/null and b/assets/image/2x/share_image_bg_yq.png differ diff --git a/assets/image/2x/yq.png b/assets/image/2x/yq.png new file mode 100644 index 00000000..2f25e3e2 Binary files /dev/null and b/assets/image/2x/yq.png differ diff --git a/assets/image/2x/yq_qx.png b/assets/image/2x/yq_qx.png new file mode 100644 index 00000000..d40fd34b Binary files /dev/null and b/assets/image/2x/yq_qx.png differ diff --git a/assets/image/3x/qr_share_bg_yq.png b/assets/image/3x/qr_share_bg_yq.png new file mode 100644 index 00000000..9c8a992d Binary files /dev/null and b/assets/image/3x/qr_share_bg_yq.png differ diff --git a/assets/image/3x/share_image_bg_yq.png b/assets/image/3x/share_image_bg_yq.png new file mode 100644 index 00000000..5cc73373 Binary files /dev/null and b/assets/image/3x/share_image_bg_yq.png differ diff --git a/assets/image/3x/yq.png b/assets/image/3x/yq.png new file mode 100644 index 00000000..d46dd544 Binary files /dev/null and b/assets/image/3x/yq.png differ diff --git a/assets/image/3x/yq_qx.png b/assets/image/3x/yq_qx.png new file mode 100644 index 00000000..5d29cf22 Binary files /dev/null and b/assets/image/3x/yq_qx.png differ diff --git a/assets/image/qr_share_bg_yq.png b/assets/image/qr_share_bg_yq.png new file mode 100644 index 00000000..ddf803ac Binary files /dev/null and b/assets/image/qr_share_bg_yq.png differ diff --git a/assets/image/share_image_bg_yq.png b/assets/image/share_image_bg_yq.png new file mode 100644 index 00000000..fbc28f83 Binary files /dev/null and b/assets/image/share_image_bg_yq.png differ diff --git a/assets/image/yq.png b/assets/image/yq.png new file mode 100644 index 00000000..dbbd30c9 Binary files /dev/null and b/assets/image/yq.png differ diff --git a/assets/image/yq_qx.png b/assets/image/yq_qx.png new file mode 100644 index 00000000..52378b57 Binary files /dev/null and b/assets/image/yq_qx.png differ diff --git a/lib/community/headlines/article_list.dart b/lib/community/headlines/article_list.dart index 8560deac..f9e733b9 100644 --- a/lib/community/headlines/article_list.dart +++ b/lib/community/headlines/article_list.dart @@ -57,7 +57,7 @@ class _ArticleList extends State { maxLines: 2, style: TextStyle( fontSize: 15.sp, - fontWeight: MyFontWeight.medium, + fontWeight: MyFontWeight.semi_bold, color: Colors.black, ), )), @@ -91,75 +91,78 @@ class _ArticleList extends State { margin: EdgeInsets.only(bottom: 12), color: Colors.white, child:Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ - Expanded(child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Text( - widget?.articles[position]?.mainTitle ?? "", - overflow: TextOverflow.ellipsis, - maxLines: 1, - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, - color: Colors.black, + Expanded(child: Container( + height: 96, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Text( + widget?.articles[position]?.mainTitle ?? "", + overflow: TextOverflow.ellipsis, + maxLines: 1, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.black, + ), ), - ), - SizedBox(height:5), - Text( - widget?.articles[position]?.viceTitle ?? "", - // overflow: TextOverflow.ellipsis, - // maxLines: 1, - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFF353535), + Text( + widget?.articles[position]?.viceTitle ?? "", + // overflow: TextOverflow.ellipsis, + // maxLines: 1, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF353535), + ), ), - ), - SizedBox(height: 10), - Row( - children: [ - Text( - (widget.articles[position] != null && - widget.articles[position].author != null) - ? widget.articles[position].author.name - : "", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFF8E8E8E), + // SizedBox(height: 20), + Row( + children: [ + Text( + (widget.articles[position] != null && + widget.articles[position].author != null) + ? widget.articles[position].author.name + : "", + 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( - "${widget?.articles[position]?.viewers}" - ?? "", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFF8D8D8D), + SizedBox(width:8), + Image.asset( + "assets/image/browse.png", + width: 14, + height: 14, + color: Color(0xFF808080), ), - )), - Text( - widget?.articles[position]?.createTime?.split(" ")[0] - ?? "", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFF8D8D8D), + Expanded(child: Text( + "${widget?.articles[position]?.viewers}" + ?? "", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF8D8D8D), + ), + )), + Text( + widget?.articles[position]?.createTime?.split(" ")[0] + ?? "", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF8D8D8D), + ), ), - ), - ], - ), - ], - ),), + ], + ), + ], + ),)), SizedBox(width:12), MImage( widget?.articles[position]?.coverImg ?? "", diff --git a/lib/community/headlines/headlines_collection.dart b/lib/community/headlines/headlines_collection.dart index c14f1bbd..f5041e40 100644 --- a/lib/community/headlines/headlines_collection.dart +++ b/lib/community/headlines/headlines_collection.dart @@ -36,7 +36,7 @@ class _HeadlinesCollection extends State { @override Widget build(BuildContext context) { return Container( - height: 100, + height: 60.h, margin: EdgeInsets.only(top:10), child: ListView.builder( scrollDirection: Axis.horizontal, @@ -61,7 +61,7 @@ class _HeadlinesCollection extends State { Widget headlinesCollectionItem(HeadlinesList headlines) { return Container( width: 225.w, - height:110.h, + height:60.h, decoration: BoxDecoration( borderRadius: BorderRadius.circular(4), boxShadow: [ @@ -85,7 +85,7 @@ class _HeadlinesCollection extends State { child: MImage( headlines?.coverImg ?? "", width: 225.w, - height: 110.h, + height: 60.h, fit: BoxFit.fill, errorSrc: "assets/image/default_1.png", fadeSrc: "assets/image/default_1.png", @@ -96,11 +96,12 @@ class _HeadlinesCollection extends State { ), ), Container( - padding: EdgeInsets.all(12), - child: Column(children: [ + padding: EdgeInsets.only(left:12.w,right: 12.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ Expanded(child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Container( margin: EdgeInsets.only(right:4), @@ -132,31 +133,31 @@ class _HeadlinesCollection extends State { ), ),), ],)), - Row( - children: [ - Expanded(child:Text( - "更新3篇", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.medium, - color: Colors.white, - ), - )), - Text( - "查看专栏", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Colors.white, - ), - ), - SizedBox(width: 2), - Image.asset( - "assets/image/t_right.png", - width: 14, - height: 14, - ), - ],), + // Row( + // children: [ + // Expanded(child:Text( + // "更新3篇", + // style: TextStyle( + // fontSize: 12.sp, + // fontWeight: MyFontWeight.medium, + // color: Colors.white, + // ), + // )), + // Text( + // "查看专栏", + // style: TextStyle( + // fontSize: 12.sp, + // fontWeight: MyFontWeight.regular, + // color: Colors.white, + // ), + // ), + // SizedBox(width: 2), + // Image.asset( + // "assets/image/t_right.png", + // width: 14, + // height: 14, + // ), + // ],), ],), ), ], diff --git a/lib/generated/intl/messages_en.dart b/lib/generated/intl/messages_en.dart index ef4445db..5a592d26 100644 --- a/lib/generated/intl/messages_en.dart +++ b/lib/generated/intl/messages_en.dart @@ -111,6 +111,7 @@ class MessageLookup extends MessageLookupByLibrary { "baocun" : MessageLookupByLibrary.simpleMessage("保存"), "baocunchenggong" : MessageLookupByLibrary.simpleMessage("保存成功"), "baocunsaoma" : MessageLookupByLibrary.simpleMessage("截屏保存下方二维码,邀请他人微信扫一扫识别,长按关注后,完成小游戏,领取优惠券后,即邀请成功哦!"), + "beiyaoqingdejiangli" : MessageLookupByLibrary.simpleMessage("每一位被邀请的用户,在输入邀请码之后可获得前进麦味10元代金券一张"), "beizhu" : MessageLookupByLibrary.simpleMessage("备注"), "beizhuxinxi" : MessageLookupByLibrary.simpleMessage("备注信息"), "bianjidizhi" : MessageLookupByLibrary.simpleMessage("编辑地址"), @@ -213,6 +214,7 @@ class MessageLookup extends MessageLookupByLibrary { "fensi" : MessageLookupByLibrary.simpleMessage("粉丝"), "fenxiangdao" : MessageLookupByLibrary.simpleMessage("分享到"), "fenxiangyaoqing" : MessageLookupByLibrary.simpleMessage("也可以直接点击右上方的分享给到你想要邀请的人。"), + "fenxiangyaoqingma" : MessageLookupByLibrary.simpleMessage("将邀请码分享给好友,对方在一心回乡App登录页输入邀请码,即可邀请成功。"), "fenxiangzhiweixin" : MessageLookupByLibrary.simpleMessage("分享至微信"), "fukashoujihao" : MessageLookupByLibrary.simpleMessage("副卡手机号"), "ge" : m5, @@ -238,6 +240,7 @@ class MessageLookup extends MessageLookupByLibrary { "haimeiyouyouhuiquankeyilingqu" : MessageLookupByLibrary.simpleMessage("还没有优惠券可以领取~"), "haixiajiemei" : MessageLookupByLibrary.simpleMessage("海峡姐妹"), "haowu" : MessageLookupByLibrary.simpleMessage("好物"), + "haoyoujiangliguize" : MessageLookupByLibrary.simpleMessage("好友奖励规则"), "heji" : MessageLookupByLibrary.simpleMessage("合计:"), "hexiaochenggong" : MessageLookupByLibrary.simpleMessage("核销成功"), "hexiaomaxiangqing" : MessageLookupByLibrary.simpleMessage("核销码详情"), @@ -269,8 +272,10 @@ class MessageLookup extends MessageLookupByLibrary { "huopinyisongda" : MessageLookupByLibrary.simpleMessage("货品已送达"), "input_code" : MessageLookupByLibrary.simpleMessage("手机验证码"), "input_code_hide" : MessageLookupByLibrary.simpleMessage("请输入验证码"), + "input_invite_code_hide" : MessageLookupByLibrary.simpleMessage("填写邀请码"), "input_phone" : MessageLookupByLibrary.simpleMessage("输入手机号"), "input_phone_hide" : MessageLookupByLibrary.simpleMessage("请输入你的手机号"), + "invite_code_error" : MessageLookupByLibrary.simpleMessage("邀请码输入错误"), "jiajifen" : m11, "jian" : MessageLookupByLibrary.simpleMessage("件"), "jiangli" : MessageLookupByLibrary.simpleMessage("奖励"), @@ -385,6 +390,7 @@ class MessageLookup extends MessageLookupByLibrary { "qingshuruchongzhijine" : MessageLookupByLibrary.simpleMessage("请输入充值金额"), "qingshurushoujihao" : MessageLookupByLibrary.simpleMessage("请输入手机号"), "qingshuruyanzhengma" : MessageLookupByLibrary.simpleMessage("请输入验证码"), + "qingshuruyaoqingma" : MessageLookupByLibrary.simpleMessage("请输入邀请码"), "qingshuruyouxiaoshoujihaoma" : MessageLookupByLibrary.simpleMessage("请输入您的有效手机号"), "qingshuruzhifumima" : MessageLookupByLibrary.simpleMessage("请输入支付密码"), "qingtianxieshoujihao" : MessageLookupByLibrary.simpleMessage("请填写收件人手机号"), @@ -534,6 +540,8 @@ class MessageLookup extends MessageLookupByLibrary { "wodeqianbao" : MessageLookupByLibrary.simpleMessage("我的钱包"), "wodeshengri" : MessageLookupByLibrary.simpleMessage("我的生日"), "wodexiaoxi" : MessageLookupByLibrary.simpleMessage("我的消息"), + "wodeyaoqingma" : MessageLookupByLibrary.simpleMessage("我的邀请码"), + "woyouyaoqingma" : MessageLookupByLibrary.simpleMessage("我有邀请码"), "wuliudanhao" : MessageLookupByLibrary.simpleMessage("物流单号:"), "wuliugongsi" : MessageLookupByLibrary.simpleMessage("物流公司:"), "wuliuxinxi" : MessageLookupByLibrary.simpleMessage("物流信息"), @@ -564,6 +572,7 @@ class MessageLookup extends MessageLookupByLibrary { "xuanguige" : MessageLookupByLibrary.simpleMessage("选规格"), "xuni" : MessageLookupByLibrary.simpleMessage("虚拟"), "yaoqingrenshoujihao_" : m32, + "yaoqingwancheng" : MessageLookupByLibrary.simpleMessage("邀请完成"), "yibangfuka" : MessageLookupByLibrary.simpleMessage("已绑副卡"), "yiduihuan" : MessageLookupByLibrary.simpleMessage("已兑换"), "yiduihuanjian" : m33, diff --git a/lib/generated/intl/messages_zh_CN.dart b/lib/generated/intl/messages_zh_CN.dart index 86c7b3f9..db0fc204 100644 --- a/lib/generated/intl/messages_zh_CN.dart +++ b/lib/generated/intl/messages_zh_CN.dart @@ -111,6 +111,7 @@ class MessageLookup extends MessageLookupByLibrary { "baocun" : MessageLookupByLibrary.simpleMessage("保存"), "baocunchenggong" : MessageLookupByLibrary.simpleMessage("保存成功"), "baocunsaoma" : MessageLookupByLibrary.simpleMessage("截屏保存下方二维码,邀请他人微信扫一扫识别,长按关注后,完成小游戏,领取优惠券后,即邀请成功哦!"), + "beiyaoqingdejiangli" : MessageLookupByLibrary.simpleMessage("每一位被邀请的用户,在输入邀请码之后可获得前进麦味10元代金券一张"), "beizhu" : MessageLookupByLibrary.simpleMessage("备注"), "beizhuxinxi" : MessageLookupByLibrary.simpleMessage("备注信息"), "bianjidizhi" : MessageLookupByLibrary.simpleMessage("编辑地址"), @@ -213,6 +214,7 @@ class MessageLookup extends MessageLookupByLibrary { "fensi" : MessageLookupByLibrary.simpleMessage("粉丝"), "fenxiangdao" : MessageLookupByLibrary.simpleMessage("分享到"), "fenxiangyaoqing" : MessageLookupByLibrary.simpleMessage("也可以直接点击右上方的分享给到你想要邀请的人。"), + "fenxiangyaoqingma" : MessageLookupByLibrary.simpleMessage("将邀请码分享给好友,对方在一心回乡App登录页输入邀请码,即可邀请成功。"), "fenxiangzhiweixin" : MessageLookupByLibrary.simpleMessage("分享至微信"), "fukashoujihao" : MessageLookupByLibrary.simpleMessage("副卡手机号"), "ge" : m5, @@ -237,6 +239,7 @@ class MessageLookup extends MessageLookupByLibrary { "haimeiyouyouhuiquankeyilingqu" : MessageLookupByLibrary.simpleMessage("还没有优惠券可以领取~"), "haixiajiemei" : MessageLookupByLibrary.simpleMessage("海峡姐妹"), "haowu" : MessageLookupByLibrary.simpleMessage("好物"), + "haoyoujiangliguize" : MessageLookupByLibrary.simpleMessage("好友奖励规则"), "heji" : MessageLookupByLibrary.simpleMessage("合计:"), "hexiaochenggong" : MessageLookupByLibrary.simpleMessage("核销成功"), "hexiaomaxiangqing" : MessageLookupByLibrary.simpleMessage("核销码详情"), @@ -267,8 +270,10 @@ class MessageLookup extends MessageLookupByLibrary { "huopinyisongda" : MessageLookupByLibrary.simpleMessage("货品已送达"), "input_code" : MessageLookupByLibrary.simpleMessage("手机验证码"), "input_code_hide" : MessageLookupByLibrary.simpleMessage("请输入验证码"), + "input_invite_code_hide" : MessageLookupByLibrary.simpleMessage("填写邀请码"), "input_phone" : MessageLookupByLibrary.simpleMessage("输入手机号"), "input_phone_hide" : MessageLookupByLibrary.simpleMessage("请输入你的手机号"), + "invite_code_error" : MessageLookupByLibrary.simpleMessage("邀请码输入错误"), "jiajifen" : m11, "jian" : MessageLookupByLibrary.simpleMessage("件"), "jiangli" : MessageLookupByLibrary.simpleMessage("奖励"), @@ -383,6 +388,7 @@ class MessageLookup extends MessageLookupByLibrary { "qingshuruchongzhijine" : MessageLookupByLibrary.simpleMessage("请输入充值金额"), "qingshurushoujihao" : MessageLookupByLibrary.simpleMessage("请输入手机号"), "qingshuruyanzhengma" : MessageLookupByLibrary.simpleMessage("请输入验证码"), + "qingshuruyaoqingma" : MessageLookupByLibrary.simpleMessage("请输入邀请码"), "qingshuruyouxiaoshoujihaoma" : MessageLookupByLibrary.simpleMessage("请输入您的有效手机号"), "qingshuruzhifumima" : MessageLookupByLibrary.simpleMessage("请输入支付密码"), "qingtianxieshoujihao" : MessageLookupByLibrary.simpleMessage("请填写收件人手机号"), @@ -532,6 +538,8 @@ class MessageLookup extends MessageLookupByLibrary { "wodeqianbao" : MessageLookupByLibrary.simpleMessage("我的钱包"), "wodeshengri" : MessageLookupByLibrary.simpleMessage("我的生日"), "wodexiaoxi" : MessageLookupByLibrary.simpleMessage("我的消息"), + "wodeyaoqingma" : MessageLookupByLibrary.simpleMessage("我的邀请码"), + "woyouyaoqingma" : MessageLookupByLibrary.simpleMessage("我有邀请码"), "wuliudanhao" : MessageLookupByLibrary.simpleMessage("物流单号:"), "wuliugongsi" : MessageLookupByLibrary.simpleMessage("物流公司:"), "wuliuxinxi" : MessageLookupByLibrary.simpleMessage("物流信息"), diff --git a/lib/generated/intl/messages_zh_Hans_CN.dart b/lib/generated/intl/messages_zh_Hans_CN.dart index beb46271..d6ac4727 100644 --- a/lib/generated/intl/messages_zh_Hans_CN.dart +++ b/lib/generated/intl/messages_zh_Hans_CN.dart @@ -111,6 +111,7 @@ class MessageLookup extends MessageLookupByLibrary { "baocun" : MessageLookupByLibrary.simpleMessage("保存"), "baocunchenggong" : MessageLookupByLibrary.simpleMessage("保存成功"), "baocunsaoma" : MessageLookupByLibrary.simpleMessage("截屏保存下方二维码,邀请他人微信扫一扫识别,长按关注后,完成小游戏,领取优惠券后,即邀请成功哦!"), + "beiyaoqingdejiangli" : MessageLookupByLibrary.simpleMessage("每一位被邀请的用户,在输入邀请码之后可获得前进麦味10元代金券一张"), "beizhu" : MessageLookupByLibrary.simpleMessage("备注"), "beizhuxinxi" : MessageLookupByLibrary.simpleMessage("备注信息"), "bianjidizhi" : MessageLookupByLibrary.simpleMessage("编辑地址"), @@ -213,6 +214,7 @@ class MessageLookup extends MessageLookupByLibrary { "fensi" : MessageLookupByLibrary.simpleMessage("粉丝"), "fenxiangdao" : MessageLookupByLibrary.simpleMessage("分享到"), "fenxiangyaoqing" : MessageLookupByLibrary.simpleMessage("也可以直接点击右上方的分享给到你想要邀请的人。"), + "fenxiangyaoqingma" : MessageLookupByLibrary.simpleMessage("将邀请码分享给好友,对方在一心回乡App登录页输入邀请码,即可邀请成功。"), "fenxiangzhiweixin" : MessageLookupByLibrary.simpleMessage("分享至微信"), "fukashoujihao" : MessageLookupByLibrary.simpleMessage("副卡手机号"), "ge" : m5, @@ -237,6 +239,7 @@ class MessageLookup extends MessageLookupByLibrary { "haimeiyouyouhuiquankeyilingqu" : MessageLookupByLibrary.simpleMessage("还没有优惠券可以领取~"), "haixiajiemei" : MessageLookupByLibrary.simpleMessage("海峡姐妹"), "haowu" : MessageLookupByLibrary.simpleMessage("好物"), + "haoyoujiangliguize" : MessageLookupByLibrary.simpleMessage("好友奖励规则"), "heji" : MessageLookupByLibrary.simpleMessage("合计:"), "hexiaochenggong" : MessageLookupByLibrary.simpleMessage("核销成功"), "hexiaomaxiangqing" : MessageLookupByLibrary.simpleMessage("核销码详情"), @@ -267,8 +270,10 @@ class MessageLookup extends MessageLookupByLibrary { "huopinyisongda" : MessageLookupByLibrary.simpleMessage("货品已送达"), "input_code" : MessageLookupByLibrary.simpleMessage("手机验证码"), "input_code_hide" : MessageLookupByLibrary.simpleMessage("请输入验证码"), + "input_invite_code_hide" : MessageLookupByLibrary.simpleMessage("填写邀请码"), "input_phone" : MessageLookupByLibrary.simpleMessage("输入手机号"), "input_phone_hide" : MessageLookupByLibrary.simpleMessage("请输入你的手机号"), + "invite_code_error" : MessageLookupByLibrary.simpleMessage("邀请码输入错误"), "jiajifen" : m11, "jian" : MessageLookupByLibrary.simpleMessage("件"), "jiangli" : MessageLookupByLibrary.simpleMessage("奖励"), @@ -383,6 +388,7 @@ class MessageLookup extends MessageLookupByLibrary { "qingshuruchongzhijine" : MessageLookupByLibrary.simpleMessage("请输入充值金额"), "qingshurushoujihao" : MessageLookupByLibrary.simpleMessage("请输入手机号"), "qingshuruyanzhengma" : MessageLookupByLibrary.simpleMessage("请输入验证码"), + "qingshuruyaoqingma" : MessageLookupByLibrary.simpleMessage("请输入邀请码"), "qingshuruyouxiaoshoujihaoma" : MessageLookupByLibrary.simpleMessage("请输入您的有效手机号"), "qingshuruzhifumima" : MessageLookupByLibrary.simpleMessage("请输入支付密码"), "qingtianxieshoujihao" : MessageLookupByLibrary.simpleMessage("请填写收件人手机号"), @@ -532,6 +538,8 @@ class MessageLookup extends MessageLookupByLibrary { "wodeqianbao" : MessageLookupByLibrary.simpleMessage("我的钱包"), "wodeshengri" : MessageLookupByLibrary.simpleMessage("我的生日"), "wodexiaoxi" : MessageLookupByLibrary.simpleMessage("我的消息"), + "wodeyaoqingma" : MessageLookupByLibrary.simpleMessage("我的邀请码"), + "woyouyaoqingma" : MessageLookupByLibrary.simpleMessage("我有邀请码"), "wuliudanhao" : MessageLookupByLibrary.simpleMessage("物流单号:"), "wuliugongsi" : MessageLookupByLibrary.simpleMessage("物流公司:"), "wuliuxinxi" : MessageLookupByLibrary.simpleMessage("物流信息"), diff --git a/lib/generated/intl/messages_zh_Hant_CN.dart b/lib/generated/intl/messages_zh_Hant_CN.dart index 5cbc21e4..bee1d745 100644 --- a/lib/generated/intl/messages_zh_Hant_CN.dart +++ b/lib/generated/intl/messages_zh_Hant_CN.dart @@ -111,6 +111,7 @@ class MessageLookup extends MessageLookupByLibrary { "baocun" : MessageLookupByLibrary.simpleMessage("保存"), "baocunchenggong" : MessageLookupByLibrary.simpleMessage("保存成功"), "baocunsaoma" : MessageLookupByLibrary.simpleMessage("截屏保存下方二維碼,邀請他人微信掃一掃識別,長按關注後,完成小遊戲,領取優惠券後,即邀請成功哦!"), + "beiyaoqingdejiangli" : MessageLookupByLibrary.simpleMessage("每一位被邀請的用戶,在輸入邀請碼之後可獲得前進麥味10元代金券一張"), "beizhu" : MessageLookupByLibrary.simpleMessage("備注"), "beizhuxinxi" : MessageLookupByLibrary.simpleMessage("備注信息"), "bianjidizhi" : MessageLookupByLibrary.simpleMessage("編輯地址"), @@ -213,6 +214,7 @@ class MessageLookup extends MessageLookupByLibrary { "fensi" : MessageLookupByLibrary.simpleMessage("粉絲"), "fenxiangdao" : MessageLookupByLibrary.simpleMessage("分享到"), "fenxiangyaoqing" : MessageLookupByLibrary.simpleMessage("也可以直接點擊右上方的分享給到你想要邀請的人。"), + "fenxiangyaoqingma" : MessageLookupByLibrary.simpleMessage("將邀請碼分享給好友,對方在一心回鄉App登入頁輸入邀請碼,即可邀請成功。"), "fenxiangzhiweixin" : MessageLookupByLibrary.simpleMessage("分享至微信"), "fukashoujihao" : MessageLookupByLibrary.simpleMessage("副卡手機號"), "ge" : m5, @@ -237,6 +239,7 @@ class MessageLookup extends MessageLookupByLibrary { "haimeiyouyouhuiquankeyilingqu" : MessageLookupByLibrary.simpleMessage("還沒有優惠券可以領取~"), "haixiajiemei" : MessageLookupByLibrary.simpleMessage("海峽姐妹"), "haowu" : MessageLookupByLibrary.simpleMessage("好物"), + "haoyoujiangliguize" : MessageLookupByLibrary.simpleMessage("好友獎勵規則"), "heji" : MessageLookupByLibrary.simpleMessage("合計:"), "hexiaochenggong" : MessageLookupByLibrary.simpleMessage("核銷成功"), "hexiaomaxiangqing" : MessageLookupByLibrary.simpleMessage("核銷碼詳情"), @@ -267,8 +270,10 @@ class MessageLookup extends MessageLookupByLibrary { "huopinyisongda" : MessageLookupByLibrary.simpleMessage("貨品已送達"), "input_code" : MessageLookupByLibrary.simpleMessage("手機驗證碼"), "input_code_hide" : MessageLookupByLibrary.simpleMessage("請輸入驗證碼"), + "input_invite_code_hide" : MessageLookupByLibrary.simpleMessage("填寫邀請碼"), "input_phone" : MessageLookupByLibrary.simpleMessage("輸入手機號"), "input_phone_hide" : MessageLookupByLibrary.simpleMessage("請輸入你的手機號"), + "invite_code_error" : MessageLookupByLibrary.simpleMessage("邀請碼輸入錯誤"), "jiajifen" : m11, "jian" : MessageLookupByLibrary.simpleMessage("件"), "jiangli" : MessageLookupByLibrary.simpleMessage("獎勵"), @@ -383,6 +388,7 @@ class MessageLookup extends MessageLookupByLibrary { "qingshuruchongzhijine" : MessageLookupByLibrary.simpleMessage("請輸入充值金額"), "qingshurushoujihao" : MessageLookupByLibrary.simpleMessage("請輸入手機號碼"), "qingshuruyanzhengma" : MessageLookupByLibrary.simpleMessage("請輸入驗證碼"), + "qingshuruyaoqingma" : MessageLookupByLibrary.simpleMessage("請輸入邀請碼"), "qingshuruyouxiaoshoujihaoma" : MessageLookupByLibrary.simpleMessage("請輸入您的有效手機號"), "qingshuruzhifumima" : MessageLookupByLibrary.simpleMessage("請輸入支付密碼"), "qingtianxieshoujihao" : MessageLookupByLibrary.simpleMessage("請填寫收件人手機號"), @@ -531,6 +537,8 @@ class MessageLookup extends MessageLookupByLibrary { "wodeqianbao" : MessageLookupByLibrary.simpleMessage("我的錢包"), "wodeshengri" : MessageLookupByLibrary.simpleMessage("我的生日"), "wodexiaoxi" : MessageLookupByLibrary.simpleMessage("我的消息"), + "wodeyaoqingma" : MessageLookupByLibrary.simpleMessage("我的邀請碼"), + "woyouyaoqingma" : MessageLookupByLibrary.simpleMessage("我有邀請碼"), "wuliudanhao" : MessageLookupByLibrary.simpleMessage("物流單號:"), "wuliugongsi" : MessageLookupByLibrary.simpleMessage("物流公司:"), "wuliuxinxi" : MessageLookupByLibrary.simpleMessage("物流信息"), diff --git a/lib/generated/intl/messages_zh_TW.dart b/lib/generated/intl/messages_zh_TW.dart index b17142c0..648d13d1 100644 --- a/lib/generated/intl/messages_zh_TW.dart +++ b/lib/generated/intl/messages_zh_TW.dart @@ -111,6 +111,7 @@ class MessageLookup extends MessageLookupByLibrary { "baocun" : MessageLookupByLibrary.simpleMessage("保存"), "baocunchenggong" : MessageLookupByLibrary.simpleMessage("保存成功"), "baocunsaoma" : MessageLookupByLibrary.simpleMessage("截屏保存下方二維碼,邀請他人微信掃一掃識別,長按關注後,完成小遊戲,領取優惠券後,即邀請成功哦!"), + "beiyaoqingdejiangli" : MessageLookupByLibrary.simpleMessage("每一位被邀請的用戶,在輸入邀請碼之後可獲得前進麥味10元代金券一張"), "beizhu" : MessageLookupByLibrary.simpleMessage("備注"), "beizhuxinxi" : MessageLookupByLibrary.simpleMessage("備注信息"), "bianjidizhi" : MessageLookupByLibrary.simpleMessage("編輯地址"), @@ -213,6 +214,7 @@ class MessageLookup extends MessageLookupByLibrary { "fensi" : MessageLookupByLibrary.simpleMessage("粉絲"), "fenxiangdao" : MessageLookupByLibrary.simpleMessage("分享到"), "fenxiangyaoqing" : MessageLookupByLibrary.simpleMessage("也可以直接點擊右上方的分享給到你想要邀請的人。"), + "fenxiangyaoqingma" : MessageLookupByLibrary.simpleMessage("將邀請碼分享給好友,對方在一心回鄉App登入頁輸入邀請碼,即可邀請成功。"), "fenxiangzhiweixin" : MessageLookupByLibrary.simpleMessage("分享至微信"), "fukashoujihao" : MessageLookupByLibrary.simpleMessage("副卡手機號"), "ge" : m5, @@ -237,6 +239,7 @@ class MessageLookup extends MessageLookupByLibrary { "haimeiyouyouhuiquankeyilingqu" : MessageLookupByLibrary.simpleMessage("還沒有優惠券可以領取~"), "haixiajiemei" : MessageLookupByLibrary.simpleMessage("海峽姐妹"), "haowu" : MessageLookupByLibrary.simpleMessage("好物"), + "haoyoujiangliguize" : MessageLookupByLibrary.simpleMessage("好友獎勵規則"), "heji" : MessageLookupByLibrary.simpleMessage("合計:"), "hexiaochenggong" : MessageLookupByLibrary.simpleMessage("核銷成功"), "hexiaomaxiangqing" : MessageLookupByLibrary.simpleMessage("核銷碼詳情"), @@ -267,8 +270,10 @@ class MessageLookup extends MessageLookupByLibrary { "huopinyisongda" : MessageLookupByLibrary.simpleMessage("貨品已送達"), "input_code" : MessageLookupByLibrary.simpleMessage("手機驗證碼"), "input_code_hide" : MessageLookupByLibrary.simpleMessage("請輸入驗證碼"), + "input_invite_code_hide" : MessageLookupByLibrary.simpleMessage("填寫邀請碼"), "input_phone" : MessageLookupByLibrary.simpleMessage("輸入手機號"), "input_phone_hide" : MessageLookupByLibrary.simpleMessage("請輸入你的手機號"), + "invite_code_error" : MessageLookupByLibrary.simpleMessage("邀請碼輸入錯誤"), "jiajifen" : m11, "jian" : MessageLookupByLibrary.simpleMessage("件"), "jiangli" : MessageLookupByLibrary.simpleMessage("獎勵"), @@ -383,6 +388,7 @@ class MessageLookup extends MessageLookupByLibrary { "qingshuruchongzhijine" : MessageLookupByLibrary.simpleMessage("請輸入充值金額"), "qingshurushoujihao" : MessageLookupByLibrary.simpleMessage("請輸入手機號碼"), "qingshuruyanzhengma" : MessageLookupByLibrary.simpleMessage("請輸入驗證碼"), + "qingshuruyaoqingma" : MessageLookupByLibrary.simpleMessage("請輸入邀請碼"), "qingshuruyouxiaoshoujihaoma" : MessageLookupByLibrary.simpleMessage("請輸入您的有效手機號"), "qingshuruzhifumima" : MessageLookupByLibrary.simpleMessage("請輸入支付密碼"), "qingtianxieshoujihao" : MessageLookupByLibrary.simpleMessage("請填寫收件人手機號"), @@ -532,6 +538,8 @@ class MessageLookup extends MessageLookupByLibrary { "wodeqianbao" : MessageLookupByLibrary.simpleMessage("我的錢包"), "wodeshengri" : MessageLookupByLibrary.simpleMessage("我的生日"), "wodexiaoxi" : MessageLookupByLibrary.simpleMessage("我的消息"), + "wodeyaoqingma" : MessageLookupByLibrary.simpleMessage("我的邀請碼"), + "woyouyaoqingma" : MessageLookupByLibrary.simpleMessage("我有邀請碼"), "wuliudanhao" : MessageLookupByLibrary.simpleMessage("物流單號:"), "wuliugongsi" : MessageLookupByLibrary.simpleMessage("物流公司:"), "wuliuxinxi" : MessageLookupByLibrary.simpleMessage("物流信息"), diff --git a/lib/generated/l10n.dart b/lib/generated/l10n.dart index ace97d9c..764438ba 100644 --- a/lib/generated/l10n.dart +++ b/lib/generated/l10n.dart @@ -5535,6 +5535,96 @@ class S { ); } + /// `我的邀请码` + String get wodeyaoqingma { + return Intl.message( + '我的邀请码', + name: 'wodeyaoqingma', + desc: '', + args: [], + ); + } + + /// `好友奖励规则` + String get haoyoujiangliguize { + return Intl.message( + '好友奖励规则', + name: 'haoyoujiangliguize', + desc: '', + args: [], + ); + } + + /// `每一位被邀请的用户,在输入邀请码之后可获得前进麦味10元代金券一张` + String get beiyaoqingdejiangli { + return Intl.message( + '每一位被邀请的用户,在输入邀请码之后可获得前进麦味10元代金券一张', + name: 'beiyaoqingdejiangli', + desc: '', + args: [], + ); + } + + /// `将邀请码分享给好友,对方在一心回乡App登录页输入邀请码,即可邀请成功。` + String get fenxiangyaoqingma { + return Intl.message( + '将邀请码分享给好友,对方在一心回乡App登录页输入邀请码,即可邀请成功。', + name: 'fenxiangyaoqingma', + desc: '', + args: [], + ); + } + + /// `我有邀请码` + String get woyouyaoqingma { + return Intl.message( + '我有邀请码', + name: 'woyouyaoqingma', + desc: '', + args: [], + ); + } + + /// `填写邀请码` + String get input_invite_code_hide { + return Intl.message( + '填写邀请码', + name: 'input_invite_code_hide', + desc: '', + args: [], + ); + } + + /// `请输入邀请码` + String get qingshuruyaoqingma { + return Intl.message( + '请输入邀请码', + name: 'qingshuruyaoqingma', + desc: '', + args: [], + ); + } + + /// `邀请码输入错误` + String get invite_code_error { + return Intl.message( + '邀请码输入错误', + name: 'invite_code_error', + desc: '', + args: [], + ); + } + + /// `邀请完成` + String get yaoqingwancheng { + return Intl.message( + '邀请完成', + name: 'yaoqingwancheng', + desc: '', + args: [], + ); + } + /// `并使用本机号码登录` String get privacy_policy4 { return Intl.message( diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index e5e45460..08b23ea3 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -20,10 +20,12 @@ import 'package:huixiang/retrofit/data/brand.dart'; import 'package:huixiang/retrofit/data/founder.dart'; import 'package:huixiang/retrofit/data/goods.dart'; import 'package:huixiang/retrofit/data/goods_category.dart'; +import 'package:huixiang/retrofit/data/login_info.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/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/request_permission.dart'; import 'package:permission_handler/permission_handler.dart'; @@ -35,8 +37,10 @@ import 'home_view/shortcut_operation.dart'; class HomePage extends StatefulWidget { final Function changeTab; + final String invite; + final List couponList; - HomePage(this.changeTab); + HomePage(this.changeTab, {this.invite,this.couponList}); @override State createState() { @@ -56,12 +60,28 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { setState(() {}); } }); + + if((widget.invite??"") != "" || widget.couponList != null + && widget.couponList.length > 0) + showInvite = true; + } + + ///邀请成功弹窗 + inviteShowAlertDialog(invite,CouponList couponList) { + //显示对话框 + showDialog( + context: context, + builder: (BuildContext context) { + return InviteSuccessDialog(invite,couponList); + }, + ); } final SwiperController controller = SwiperController(); String categoryId; int pageNum = 1; + bool showInvite = false; //排序类型枚举:1-自然排序,2-销量,3-价格 int orderType = 1; @@ -194,6 +214,11 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { refreshController.refreshFailed(); } EasyLoading.dismiss(); + if(showInvite){ + inviteShowAlertDialog(widget.invite,widget.couponList[0]); + showInvite = false; + } + } @override diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index af4bf910..331b3524 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -574,6 +574,16 @@ "chakanhexiaoma": "查看核销码", "chakanwuliu": "查看物流", "dangqianzhukadengji": "当前主卡等级", + "wodeyaoqingma": "我的邀请码", + "haoyoujiangliguize": "好友奖励规则", + "beiyaoqingdejiangli": "每一位被邀请的用户,在输入邀请码之后可获得前进麦味10元代金券一张", + "fenxiangyaoqingma": "将邀请码分享给好友,对方在一心回乡App登录页输入邀请码,即可邀请成功。", + "woyouyaoqingma": "我有邀请码", + "input_invite_code_hide": "填写邀请码", + "qingshuruyaoqingma": "请输入邀请码", + "invite_code_error": "邀请码输入错误", + "yaoqingwancheng": "邀请完成", + diff --git a/lib/l10n/intl_zh_CN.arb b/lib/l10n/intl_zh_CN.arb index 461bca21..490eb5f2 100644 --- a/lib/l10n/intl_zh_CN.arb +++ b/lib/l10n/intl_zh_CN.arb @@ -572,6 +572,14 @@ "chakanhexiaoma": "查看核销码", "chakanwuliu": "查看物流", "dangqianzhukadengji": "当前主卡等级", + "wodeyaoqingma": "我的邀请码", + "haoyoujiangliguize": "好友奖励规则", + "beiyaoqingdejiangli": "每一位被邀请的用户,在输入邀请码之后可获得前进麦味10元代金券一张", + "fenxiangyaoqingma": "将邀请码分享给好友,对方在一心回乡App登录页输入邀请码,即可邀请成功。", + "woyouyaoqingma": "我有邀请码", + "input_invite_code_hide": "填写邀请码", + "qingshuruyaoqingma": "请输入邀请码", + "invite_code_error": "邀请码输入错误", diff --git a/lib/l10n/intl_zh_Hans_CN.arb b/lib/l10n/intl_zh_Hans_CN.arb index e098d2c7..e2f839de 100644 --- a/lib/l10n/intl_zh_Hans_CN.arb +++ b/lib/l10n/intl_zh_Hans_CN.arb @@ -572,7 +572,14 @@ "chakanhexiaoma": "查看核销码", "chakanwuliu": "查看物流", "dangqianzhukadengji": "当前主卡等级", - + "wodeyaoqingma": "我的邀请码", + "haoyoujiangliguize": "好友奖励规则", + "beiyaoqingdejiangli": "每一位被邀请的用户,在输入邀请码之后可获得前进麦味10元代金券一张", + "fenxiangyaoqingma": "将邀请码分享给好友,对方在一心回乡App登录页输入邀请码,即可邀请成功。", + "woyouyaoqingma": "我有邀请码", + "input_invite_code_hide": "填写邀请码", + "qingshuruyaoqingma": "请输入邀请码", + "invite_code_error": "邀请码输入错误", diff --git a/lib/l10n/intl_zh_Hant_CN.arb b/lib/l10n/intl_zh_Hant_CN.arb index fd6171b0..70b8b897 100644 --- a/lib/l10n/intl_zh_Hant_CN.arb +++ b/lib/l10n/intl_zh_Hant_CN.arb @@ -566,7 +566,14 @@ "chakanhexiaoma": "查看核銷碼", "chakanwuliu": "查看物流", "dangqianzhukadengji": "當前主卡等級", - + "wodeyaoqingma": "我的邀請碼", + "haoyoujiangliguize": "好友獎勵規則", + "beiyaoqingdejiangli": "每一位被邀請的用戶,在輸入邀請碼之後可獲得前進麥味10元代金券一張", + "fenxiangyaoqingma": "將邀請碼分享給好友,對方在一心回鄉App登入頁輸入邀請碼,即可邀請成功。", + "woyouyaoqingma": "我有邀請碼", + "input_invite_code_hide": "填寫邀請碼", + "qingshuruyaoqingma": "請輸入邀請碼", + "invite_code_error": "邀請碼輸入錯誤", diff --git a/lib/l10n/intl_zh_TW.arb b/lib/l10n/intl_zh_TW.arb index 111be521..23b17805 100644 --- a/lib/l10n/intl_zh_TW.arb +++ b/lib/l10n/intl_zh_TW.arb @@ -566,6 +566,14 @@ "chakanhexiaoma": "查看核銷碼", "chakanwuliu": "查看物流", "dangqianzhukadengji": "當前主卡等級", + "wodeyaoqingma": "我的邀請碼", + "haoyoujiangliguize": "好友獎勵規則", + "beiyaoqingdejiangli": "每一位被邀請的用戶,在輸入邀請碼之後可獲得前進麥味10元代金券一張", + "fenxiangyaoqingma": "將邀請碼分享給好友,對方在一心回鄉App登入頁輸入邀請碼,即可邀請成功。", + "woyouyaoqingma": "我有邀請碼", + "input_invite_code_hide": "填寫邀請碼", + "qingshuruyaoqingma": "請輸入邀請碼", + "invite_code_error": "邀請碼輸入錯誤", diff --git a/lib/login/login_page.dart b/lib/login/login_page.dart index d4c9503a..29c16194 100644 --- a/lib/login/login_page.dart +++ b/lib/login/login_page.dart @@ -7,6 +7,7 @@ import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/main.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/login_info.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/data/user_entity.dart'; import 'package:huixiang/utils/event_type.dart'; @@ -18,6 +19,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:huixiang/view_widget/invite_success_dialog.dart'; import 'package:huixiang/view_widget/round_button.dart'; import 'package:photo_view/photo_view.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -36,14 +38,17 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { var checkStatus = false; var mobileStatus = 0; var verifyStatus = 0; + var invitationCodeStatus = 0; var mobileErrorText = ""; var codeErrorText = ""; + var invitationErrorText = ""; var btnText = S.current.send_code; // var _controllerPhone = TextEditingController(text: "13800138000"); // var _controllerCode = TextEditingController(text: "888888"); var _controllerPhone = TextEditingController(); var _controllerCode = TextEditingController(); + var _controllerInviteCode = TextEditingController(); var _sendCodeStatus = 0; GlobalKey loginKey = GlobalKey(); @@ -55,6 +60,7 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { int changeAlpha = 0; Animation animation; Animation doubleAnimation; + bool invitationCode = true; isLogin() async { SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); @@ -170,6 +176,24 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { statusCodeVisible = false; } }); + + _controllerInviteCode.addListener(() { + if (_controllerInviteCode.text != null && _controllerInviteCode.text != "") { + if (isPhone(_controllerInviteCode.text)) { + statusInviteTextColor = Color(0xFF353535); + statusInviteLineColor = Color(0xFF32A060); + statusInviteVisible = false; + } else { + statusInviteTextColor = Color(0xFFF72626); + statusInviteLineColor = Color(0xFFF72626); + statusInviteVisible = true; + } + } else { + statusInviteTextColor = Color(0xFF353535); + statusInviteLineColor = Color(0xFF32A060); + statusInviteVisible = false; + } + }); } bool statusPhoneVisible = false; @@ -180,6 +204,11 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { Color statusCodeTextColor = Color(0xFF353535); Color statusCodeLineColor = Color(0xFF32A060); + bool statusInviteVisible = false; + Color statusInviteTextColor = Color(0xFF353535); + Color statusInviteLineColor = Color(0xFF32A060); + + _sendCode() async { SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); if (!sharedPreferences.containsKey("isShowPrivacyPolicy") || @@ -278,6 +307,7 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { setState(() {}); return; } + var code = _controllerCode.text; if (code == "") { verifyStatus = 2; @@ -291,29 +321,31 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { setState(() {}); return; } + + var invite = _controllerInviteCode.text; var param = { "capcha": code, "mobile": mobile, + "invite":invite, }; EasyLoading.show(status: S.of(context).zhengzaijiazai); - BaseData value = await client.memberLogin(param).catchError((error) { + BaseData value = await client.memberLogin(param).catchError((error) { print(error); SmartDialog.showToast("$error", alignment: Alignment.center); }); EasyLoading.show(status: S.of(context).zhengzaijiazai); Future.delayed(Duration(seconds:2), () { if (value !=null && value.isSuccess) { - saveUserJson(value.data); + saveUserJson(value.data.authInfo.toJson()); eventBus.fire(EventType(3)); Navigator.of(context).pushNamedAndRemoveUntil( '/router/main_page', - (route) => false, - ); + (route) => false,arguments:{"invite":invite,"couponList":value.data.couponList}); EasyLoading.dismiss(); } else { - SmartDialog.showToast("${value.msg}", alignment: Alignment.center); + SmartDialog.showToast("${value?.msg ??""}", alignment: Alignment.center); } }); } @@ -682,7 +714,7 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { Container( height: 40.h, width: MediaQuery.of(context).size.width - 80.h, - margin: EdgeInsets.only(top: 12.h), + // margin: EdgeInsets.only(top: 12.h), child: TextField( style: TextStyle( height: 1.h, @@ -726,7 +758,7 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { color: statusPhoneLineColor, ), SizedBox( - height: 35.h, + height: 25.h, child: Visibility( visible: statusPhoneVisible, child: Text( @@ -748,7 +780,7 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { ), Container( height: 40.h, - margin: EdgeInsets.only(top: 12.h), + // margin: EdgeInsets.only(top: 12.h), width: MediaQuery.of(context).size.width - 80.h, child: Row( mainAxisAlignment: MainAxisAlignment.end, @@ -850,6 +882,112 @@ 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, + ), + ), + ), + ), + GestureDetector( + onTap: (){ + setState(() { + invitationCode = false; + }); + }, + child: + invitationCode ? + Container(child: + Column(children: [ + Text( + S.of(context).woyouyaoqingma, + style: TextStyle( + fontSize: 12.sp, + fontWeight: FontWeight.bold, + color: Colors.black, + ), + ), + Container( + width: 56.w, + height: 0.5, + color: Colors.black, + ), + ],),):Container(child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + S.of(context).input_invite_code_hide, + style: TextStyle( + fontSize: 16.sp, + fontWeight: FontWeight.bold, + color: Colors.black, + ), + ), + Container( + height: 40.h, + width: MediaQuery.of(context).size.width - 80.h, + child: TextField( + style: TextStyle( + height: 1.h, + fontSize: 16.sp, + color: statusInviteTextColor, + ), + onChanged: (value) { + if (value != null && value.isNotEmpty) { + if (isPhone(value)) { + invitationCodeStatus = 1; + } else { + invitationCodeStatus = 2; + } + } else { + invitationCodeStatus = 0; + } + setState(() {}); + }, + controller: _controllerInviteCode, + keyboardType: TextInputType.phone, + decoration: InputDecoration( + errorBorder: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + hintText: "", + // contentPadding: EdgeInsets.only(top: 12, bottom: 12, left: 12), + hintStyle: TextStyle( + fontSize: 10.sp, + color: Color(0xFFA29E9E), + ), + ), + textInputAction: TextInputAction.next, + inputFormatters: [LengthLimitingTextInputFormatter(11)], + cursorColor: Colors.grey, + maxLines: 1, + ), + ), + Container( + height: 1.h, + width: MediaQuery.of(context).size.width - 80.h, + color: statusInviteLineColor, + margin: EdgeInsets.only(bottom: 10.h), + ), + Visibility( + visible: statusInviteVisible, + child: Text( + S.of(context).invite_code_error, + style: TextStyle( + color: Color(0xFFF72626), + fontSize: 12.sp, + ), + ), + ), + ], + ),), + ), Expanded( flex: 1, child: Container( diff --git a/lib/main.dart b/lib/main.dart index c5af21f7..21e64be9 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -318,7 +318,7 @@ Map routers = { '/router/guide_Page': (context, {arguments}) => GuidePage(), '/router/about_page': (context, {arguments}) => AboutPage(), '/router/qr_share': (context, {arguments}) => QrSharePage(), - '/router/main_page': (context, {arguments}) => MainPage(), + '/router/main_page': (context, {arguments}) => MainPage(arguments: arguments), '/router/test_page': (context, {arguments}) => TestPage(), '/router/communityFollow': (context, {arguments}) => CommunityFollow(), '/router/releasePage': (context, {arguments}) => ReleasePage(), diff --git a/lib/main_page.dart b/lib/main_page.dart index 24ffd0cf..7488d878 100644 --- a/lib/main_page.dart +++ b/lib/main_page.dart @@ -10,6 +10,7 @@ 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'; @@ -23,6 +24,10 @@ import 'package:shared_preferences/shared_preferences.dart'; import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart'; class MainPage extends StatefulWidget { + final Map arguments; + + MainPage({this.arguments}); + @override State createState() { return _MainPage(); @@ -76,13 +81,21 @@ class _MainPage extends State with WidgetsBindingObserver { pushRoute(); + String invite = ""; + var couponList; + + if(widget.arguments != null && (widget.arguments["invite"]??"") != "" + && widget.arguments["couponList"] != null ){ + invite = widget.arguments["invite"]; + couponList = widget.arguments["couponList"]; + } _widgetOptions = [ // BrandPage(), HomePage((index) { setState(() { pageController.jumpToPage(index); }); - }), + },invite:invite,couponList:couponList), // MainHomePage(), UnionPage(), CommunityPage(), @@ -357,6 +370,7 @@ class _MainPage extends State with WidgetsBindingObserver { ); } + // Widget bottomNavigationBigItem(text, index) { // var isSelected = index == clickIndex; // return Expanded( diff --git a/lib/mine/coupons_page.dart b/lib/mine/coupons_page.dart index 4d4bd1c2..65a27988 100644 --- a/lib/mine/coupons_page.dart +++ b/lib/mine/coupons_page.dart @@ -180,15 +180,13 @@ class _CouponsPage extends State { "coupon": coupons[position].toJson(), }); } else { - showStoreSelector( - coupons[position].storeList); + showStoreSelector(coupons[position].storeList); } } }, () { setState(() { - coupons[position].isEx = - !coupons[position].isEx; + coupons[position].isEx = !coupons[position].isEx; }); }, type: 0, diff --git a/lib/mine/mine_vip/legal_right_details.dart b/lib/mine/mine_vip/legal_right_details.dart index 89fc8c3a..9f285d01 100644 --- a/lib/mine/mine_vip/legal_right_details.dart +++ b/lib/mine/mine_vip/legal_right_details.dart @@ -496,7 +496,7 @@ class _LegalRightDetails extends State { ], ), ), - if (!vipBenefitList.actived && !vipBenefitList.have) + if (!vipBenefitList.actived && !vipBenefitList.have || vipBenefitList.actived && !vipBenefitList.have) Container( decoration: new BoxDecoration( color: Color(0xFFA29E9E), diff --git a/lib/mine/mine_vip/mine_vip_core.dart b/lib/mine/mine_vip/mine_vip_core.dart index da6fae11..5845f64b 100644 --- a/lib/mine/mine_vip/mine_vip_core.dart +++ b/lib/mine/mine_vip/mine_vip_core.dart @@ -643,7 +643,8 @@ class _MineVipCore extends State { alignment: Alignment.bottomCenter, children: [ MImage( - vipBenefitList?.icon ?? "", + (vipBenefitList.actived || (vipBenefitList.actived && vipBenefitList.have) ||(vipBenefitList.actived && !vipBenefitList.have))? + (vipBenefitList?.icon ?? ""):(vipBenefitList?.iconGrey ?? ""), width: 36, height: 36, // fit: BoxFit.cover, @@ -678,7 +679,7 @@ class _MineVipCore extends State { ], ), ), - if (!vipBenefitList.actived && !vipBenefitList.have) + if (!vipBenefitList.actived && !vipBenefitList.have || vipBenefitList.actived && !vipBenefitList.have) Container( decoration: new BoxDecoration( color: Color(0xFFA29E9E), diff --git a/lib/qr/qr_share.dart b/lib/qr/qr_share.dart index f5949e4c..dbe08e23 100644 --- a/lib/qr/qr_share.dart +++ b/lib/qr/qr_share.dart @@ -79,7 +79,7 @@ class _QrSharePage extends State { children: [ Positioned( child: Image.asset( - "assets/image/qr_share_bg.png", + "assets/image/qr_share_bg_yq.png", fit: BoxFit.fill, ), top: 0, @@ -111,40 +111,55 @@ class _QrSharePage extends State { mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.center, children: [ - shareTypeTitle(S.of(context).fangshiyi), + shareTypeTitle(S.of(context).wodeyaoqingma), Container( margin: EdgeInsets.only(left: 16.w, right: 24.w), child: Text( - S.of(context).baocunsaoma, + // S.of(context).baocunsaoma, + phone, textAlign: TextAlign.center, style: TextStyle( color: Color(0xFF2E3552), - fontSize: 16.sp, - fontWeight: MyFontWeight.regular, + fontSize: 40.sp, + fontWeight: MyFontWeight.semi_bold, ), ), ), + // Container( + // width: 152.w, + // height: 152.w, + // decoration: BoxDecoration( + // border: Border.all( + // color: Color(0xFF2E3552), + // width: 1, + // ), + // ), + // child: QrImage( + // data: "http://mp.hx.lotus-wallet.com/pages/invite/index?mobile=${phone ?? ""}", + // version: QrVersions.auto, + // size: 200.w, + // gapless: true, + // ), + // ), + shareTypeTitle(S.of(context).haoyoujiangliguize), Container( - width: 152.w, - height: 152.w, - decoration: BoxDecoration( - border: Border.all( + margin: EdgeInsets.only(left: 16.w, right: 24.w), + child: Text( + // S.of(context).fenxiangyaoqing, + S.of(context).fenxiangyaoqingma, + textAlign: TextAlign.center, + style: TextStyle( color: Color(0xFF2E3552), - width: 1, + fontSize: 16.sp, + fontWeight: MyFontWeight.regular, ), ), - child: QrImage( - data: "http://mp.hx.lotus-wallet.com/pages/invite/index?mobile=${phone ?? ""}", - version: QrVersions.auto, - size: 200.w, - gapless: true, - ), ), - shareTypeTitle(S.of(context).fangshier), Container( margin: EdgeInsets.only(left: 16.w, right: 24.w), child: Text( - S.of(context).fenxiangyaoqing, + // S.of(context).fenxiangyaoqing, + S.of(context).beiyaoqingdejiangli, textAlign: TextAlign.center, style: TextStyle( color: Color(0xFF2E3552), @@ -174,13 +189,13 @@ class _QrSharePage extends State { Widget shareTypeTitle(typeText) { return Container( - width: 90.w, + width: 140.w, height: 30.h, child: Text( typeText, style: TextStyle( - fontWeight: MyFontWeight.semi_bold, - fontSize: 18.sp, + fontWeight: MyFontWeight.regular, + fontSize: 16.sp, color: Color(0xFF2E3552), ), ), @@ -199,7 +214,7 @@ class _QrSharePage extends State { double height; buildImageInfo() async { - image = Image.asset("assets/image/qr_share_bg.png"); + image = Image.asset("assets/image/qr_share_bg_yq.png"); image.image .resolve(ImageConfiguration()) .addListener(ImageStreamListener((ImageInfo info, bool _) { diff --git a/lib/qr/qr_share_image.dart b/lib/qr/qr_share_image.dart index 94f265e6..303e5a31 100644 --- a/lib/qr/qr_share_image.dart +++ b/lib/qr/qr_share_image.dart @@ -39,7 +39,7 @@ class _QrShareImagePage extends State { child: Column( children: [ Image.asset( - "assets/image/share_image_bg.png", + "assets/image/share_image_bg_yq.png", height: (MediaQuery.of(context).size.width * 0.8) * 0.47, width: (MediaQuery.of(context).size.width * 0.8), ), @@ -56,10 +56,11 @@ class _QrShareImagePage extends State { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - width: 206.w, + width:90.w, height: 30.h, child: Text( - S.of(context).yaoqingrenshoujihao_("${widget.mobile.substring(0, 3)}****${widget.mobile.substring(7, 11)}"), + // S.of(context).yaoqingrenshoujihao_("${widget.mobile.substring(0, 3)}****${widget.mobile.substring(7, 11)}"), + S.of(context).wodeyaoqingma, style: TextStyle( fontWeight: MyFontWeight.semi_bold, fontSize: 12.sp, @@ -76,27 +77,62 @@ class _QrShareImagePage extends State { ), ), Container( - margin: EdgeInsets.symmetric(horizontal: 68.w), + margin: EdgeInsets.only(left: 16.w, right: 24.w), + child: Text( + // S.of(context).saomashibieguanzhugongzonghao, + widget.mobile, + textAlign: TextAlign.center, + style: TextStyle( + color: Color(0xFF2E3552), + fontSize:30.sp, + fontWeight: MyFontWeight.semi_bold, + ), + ), + ), + // Container( + // margin: EdgeInsets.symmetric(horizontal: 68.w), + // decoration: BoxDecoration( + // border: Border.all( + // color: Color(0xFF2E3552), + // width: 1, + // ), + // ), + // child: AspectRatio( + // aspectRatio: 1, + // child: QrImage( + // data: "http://mp.hx.lotus-wallet.com/pages/invite/index?mobile=${widget.mobile ?? ""}", + // version: QrVersions.auto, + // size: 200.w, + // gapless: true, + // ), + // ), + // ), + Container( + width:140.w, + height: 30.h, + child: Text( + // S.of(context).yaoqingrenshoujihao_("${widget.mobile.substring(0, 3)}****${widget.mobile.substring(7, 11)}"), + S.of(context).haoyoujiangliguize, + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 12.sp, + color: Color(0xFF2E3552), + ), + ), + alignment: Alignment.center, decoration: BoxDecoration( + color: Color(0xFFFFC93B), border: Border.all( color: Color(0xFF2E3552), width: 1, ), ), - child: AspectRatio( - aspectRatio: 1, - child: QrImage( - data: "http://mp.hx.lotus-wallet.com/pages/invite/index?mobile=${widget.mobile ?? ""}", - version: QrVersions.auto, - size: 200.w, - gapless: true, - ), - ), ), Container( margin: EdgeInsets.only(left: 16.w, right: 24.w), child: Text( - S.of(context).saomashibieguanzhugongzonghao, + // S.of(context).saomashibieguanzhugongzonghao, + S.of(context).beiyaoqingdejiangli, textAlign: TextAlign.center, style: TextStyle( color: Color(0xFF2E3552), @@ -163,7 +199,7 @@ class _QrShareImagePage extends State { RenderRepaintBoundary boundary = buildContext.findRenderObject(); ui.Image image = await boundary.toImage(pixelRatio: 3); ByteData byteData = - await image.toByteData(format: ui.ImageByteFormat.png); + await image.toByteData(format: ui.ImageByteFormat.png); String filePath = ""; if (Platform.isAndroid) { @@ -198,12 +234,12 @@ class _QrShareImagePage extends State { ); SharesdkPlugin.share(ShareSDKPlatforms.wechatSession, params, - (state, userData, contentEntity, error) { - print("share state !$state"); - print("share userData !$userData"); - print("share contentEntity !$contentEntity"); - print("share error !$error"); - }); + (state, userData, contentEntity, error) { + print("share state !$state"); + print("share userData !$userData"); + print("share contentEntity !$contentEntity"); + print("share error !$error"); + }); } } } diff --git a/lib/retrofit/data/login_info.dart b/lib/retrofit/data/login_info.dart new file mode 100644 index 00000000..a0107eca --- /dev/null +++ b/lib/retrofit/data/login_info.dart @@ -0,0 +1,371 @@ +/// 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}] + +class LoginInfo { + LoginInfo({ + AuthInfo authInfo, + List couponList,}){ + _authInfo = authInfo; + _couponList = couponList; +} + + 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)); + }); + } + } + AuthInfo _authInfo; + List _couponList; + + AuthInfo get authInfo => _authInfo; + List get couponList => _couponList; + + Map toJson() { + final map = {}; + if (_authInfo != null) { + map['authInfo'] = _authInfo.toJson(); + } + if (_couponList != null) { + map['couponList'] = _couponList.map((v) => v.toJson()).toList(); + } + return map; + } + +} + +/// 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 + +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,}){ + _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; + _centreDisplay = centreDisplay; + _tenantCode = tenantCode; + _isDelete = isDelete; + _storeName = storeName; + _number = number; +} + + CouponList.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']; + _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; + 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; + 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['centreDisplay'] = _centreDisplay; + map['tenantCode'] = _tenantCode; + map['isDelete'] = _isDelete; + map['storeName'] = _storeName; + map['number'] = _number; + return map; + } + +} + +/// 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" + +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,}){ + _token = token; + _tokenType = tokenType; + _refreshToken = refreshToken; + _name = name; + _account = account; + _avatar = avatar; + _workDescribe = workDescribe; + _userId = userId; + _userType = userType; + _expire = expire; + _expiration = expiration; + _mobile = mobile; +} + + AuthInfo.fromJson(dynamic json) { + _token = json['token']; + _tokenType = json['tokenType']; + _refreshToken = json['refreshToken']; + _name = json['name']; + _account = json['account']; + _avatar = json['avatar']; + _workDescribe = json['workDescribe']; + _userId = json['userId']; + _userType = json['userType']; + _expire = json['expire']; + _expiration = json['expiration']; + _mobile = json['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; + + String get token => _token; + String get tokenType => _tokenType; + String get refreshToken => _refreshToken; + String get name => _name; + String get account => _account; + dynamic get avatar => _avatar; + dynamic get workDescribe => _workDescribe; + String get userId => _userId; + String get userType => _userType; + String get expire => _expire; + String get expiration => _expiration; + String get mobile => _mobile; + + Map toJson() { + final map = {}; + map['token'] = _token; + map['tokenType'] = _tokenType; + map['refreshToken'] = _refreshToken; + map['name'] = _name; + map['account'] = _account; + map['avatar'] = _avatar; + map['workDescribe'] = _workDescribe; + map['userId'] = _userId; + map['userType'] = _userType; + map['expire'] = _expire; + map['expiration'] = _expiration; + map['mobile'] = _mobile; + return map; + } + +} \ No newline at end of file diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 1b78be14..8eb3fdb8 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -13,6 +13,7 @@ import 'package:huixiang/retrofit/data/article.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/comunity_comment.dart'; import 'package:huixiang/retrofit/data/coupon.dart'; +import 'package:huixiang/retrofit/data/login_info.dart'; import 'package:huixiang/retrofit/data/order_info.dart'; import 'package:huixiang/view_widget/login_tips_dialog.dart'; import 'package:retrofit/retrofit.dart'; @@ -170,7 +171,7 @@ abstract class ApiService { /// 用户登录 @POST("/auth/platform/memberLogin") - Future memberLogin(@Body() Map param); + Future> memberLogin(@Body() Map param); ///发送验证码 @GET("/auth/sendVerify/{mobile}") diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index 05bf5876..495e870e 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -68,8 +68,30 @@ class _ApiService implements ApiService { return value; } - @override - Future> memberLogin(param) async { + // @override + // Future> memberLogin(param) async { + // ArgumentError.checkNotNull(param, 'param'); + // const _extra = {}; + // final queryParameters = {}; + // final _data = {}; + // _data.addAll(param ?? {}); + // final _result = await _dio.request>( + // '/auth/platform/memberLogin', + // queryParameters: queryParameters, + // options: RequestOptions( + // method: 'POST', + // headers: {}, + // extra: _extra, + // baseUrl: baseUrl), + // data: _data); + // final value = BaseData.fromJson( + // _result.data, + // (json) => json as dynamic, + // ); + // return value; + // } + @override + Future> memberLogin(param) async { ArgumentError.checkNotNull(param, 'param'); const _extra = {}; final queryParameters = {}; @@ -84,9 +106,9 @@ class _ApiService implements ApiService { extra: _extra, baseUrl: baseUrl), data: _data); - final value = BaseData.fromJson( + final value = BaseData.fromJson( _result.data, - (json) => json as dynamic, + (json) => LoginInfo.fromJson(json), ); return value; } diff --git a/lib/view_widget/invite_success_dialog.dart b/lib/view_widget/invite_success_dialog.dart new file mode 100644 index 00000000..5a7d382e --- /dev/null +++ b/lib/view_widget/invite_success_dialog.dart @@ -0,0 +1,120 @@ +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'; + +class InviteSuccessDialog extends StatefulWidget { + final String invite; + final CouponList couponList; + + InviteSuccessDialog(this.invite,this.couponList); + + @override + State createState() { + return _InviteSuccessDialog(); + } + +} + +class _InviteSuccessDialog extends State { + @override + Widget build(BuildContext context) { + return SimpleDialog( + titlePadding: EdgeInsets.all(10), + backgroundColor: Colors.transparent, + elevation: 0, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(6), + ), + children: [ + Column(children: [ + Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.w), + ), + padding: EdgeInsets.only(top:20.h,left: 12,right: 12), + margin: EdgeInsets.only(left:60.w,right:60.w), + child: Container( + padding: EdgeInsets.symmetric(vertical: 10.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/image/yq.png", + width: 61, + height: 65, + ), + SizedBox(height: 9.h,), + Text( + "邀请完成", + style: TextStyle( + color: Color(0xFF353535), + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + ), + ), + SizedBox(height: 6.h), + RichText( + textAlign: TextAlign.center, + text: TextSpan( + text: + "通过${widget.invite.substring(0, 3)}****${widget.invite.substring(7, 11)}的邀请码完成邀请,获得", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + height: 1.5.h), + children: [ + TextSpan( + text:"${widget.couponList.storeName}${widget.couponList.couponName} * ${widget.couponList.bizType}张", + style: TextStyle(color: Color(0xFF32A060),fontSize: 14.sp,fontWeight: MyFontWeight.regular), + ), + ] + ),), + SizedBox(height: 13,), + GestureDetector( + onTap: (){ + Navigator.of(context).pop(); + }, + child:RoundButton( + text: S.of(context).queren, + textColor: Colors.white, + width: 130.w, + height: 34.h, + padding: EdgeInsets.symmetric(vertical: 6.h), + fontSize: 16.sp, + fontWeight: MyFontWeight.semi_bold, + backgroup: Color(0xFF32A060), + radius: 4.w, + callback: () { + SmartDialog.dismiss(); + }, + ), + ), + SizedBox(height:20), + ], + ), + ), + ), + SizedBox(height:35), + GestureDetector(onTap: (){ + setState(() { + Navigator.of(context).pop(); + }); + },child:Image.asset( + "assets/image/yq_qx.png", + width: 34, + height: 34, + ),) + + ],), + ], + ); + } +}