diff --git a/lib/generated/intl/messages_en.dart b/lib/generated/intl/messages_en.dart index a12b4a35..0a965b55 100644 --- a/lib/generated/intl/messages_en.dart +++ b/lib/generated/intl/messages_en.dart @@ -171,6 +171,7 @@ class MessageLookup extends MessageLookupByLibrary { "guanyu" : MessageLookupByLibrary.simpleMessage("关于"), "guanyuchuangshiren" : MessageLookupByLibrary.simpleMessage("关于创始人"), "guojiankangyoujishenghuo" : MessageLookupByLibrary.simpleMessage("过健康有机生活"), + "haimeiyouxiaoxi" : MessageLookupByLibrary.simpleMessage("还没有消息~"), "haixiajiemei" : MessageLookupByLibrary.simpleMessage("海峡姐妹"), "haowu" : MessageLookupByLibrary.simpleMessage("好物"), "heji" : MessageLookupByLibrary.simpleMessage("合计:"), @@ -256,6 +257,7 @@ class MessageLookup extends MessageLookupByLibrary { "mingxi" : MessageLookupByLibrary.simpleMessage("明细"), "morenpaixu" : MessageLookupByLibrary.simpleMessage("默认排序"), "muqianzanwuxingdianhuodong" : MessageLookupByLibrary.simpleMessage("目前暂无星店活动"), + "nihaimeiyouchongzhihuoxiaofeijilu" : MessageLookupByLibrary.simpleMessage("你在这儿还没有消费或充值记录哦~"), "nindingweigongnengweikaiqi" : MessageLookupByLibrary.simpleMessage("您定位功能开关未开启,请点击去打開定位"), "nindingweiquanxianweiyunxu" : MessageLookupByLibrary.simpleMessage("您未开启位置权限,请点击确定申请权限"), "ninweidenglu" : MessageLookupByLibrary.simpleMessage("您未登录,请点击去登录"), diff --git a/lib/generated/intl/messages_zh_CN.dart b/lib/generated/intl/messages_zh_CN.dart index 1eb6d25c..96ecd626 100644 --- a/lib/generated/intl/messages_zh_CN.dart +++ b/lib/generated/intl/messages_zh_CN.dart @@ -170,6 +170,7 @@ class MessageLookup extends MessageLookupByLibrary { "guanlidizhi" : MessageLookupByLibrary.simpleMessage("管理地址"), "guanyu" : MessageLookupByLibrary.simpleMessage("关于"), "guojiankangyoujishenghuo" : MessageLookupByLibrary.simpleMessage("过健康有机生活"), + "haimeiyouxiaoxi" : MessageLookupByLibrary.simpleMessage("还没有消息~"), "haixiajiemei" : MessageLookupByLibrary.simpleMessage("海峡姐妹"), "haowu" : MessageLookupByLibrary.simpleMessage("好物"), "heji" : MessageLookupByLibrary.simpleMessage("合计:"), @@ -255,6 +256,7 @@ class MessageLookup extends MessageLookupByLibrary { "mingxi" : MessageLookupByLibrary.simpleMessage("明细"), "morenpaixu" : MessageLookupByLibrary.simpleMessage("默认排序"), "muqianzanwuxingdianhuodong" : MessageLookupByLibrary.simpleMessage("目前暂无星店活动"), + "nihaimeiyouchongzhihuoxiaofeijilu" : MessageLookupByLibrary.simpleMessage("你在这儿还没有消费或充值记录哦~"), "nindingweigongnengweikaiqi" : MessageLookupByLibrary.simpleMessage("您定位功能开关未开启,请点击去打開定位"), "nindingweiquanxianweiyunxu" : MessageLookupByLibrary.simpleMessage("您未开启位置权限,请点击确定申请权限"), "ninweidenglu" : MessageLookupByLibrary.simpleMessage("您未登录,请点击去登录"), diff --git a/lib/generated/intl/messages_zh_Hans_CN.dart b/lib/generated/intl/messages_zh_Hans_CN.dart index 2288484d..a13fb449 100644 --- a/lib/generated/intl/messages_zh_Hans_CN.dart +++ b/lib/generated/intl/messages_zh_Hans_CN.dart @@ -170,6 +170,7 @@ class MessageLookup extends MessageLookupByLibrary { "guanlidizhi" : MessageLookupByLibrary.simpleMessage("管理地址"), "guanyu" : MessageLookupByLibrary.simpleMessage("关于"), "guojiankangyoujishenghuo" : MessageLookupByLibrary.simpleMessage("过健康有机生活"), + "haimeiyouxiaoxi" : MessageLookupByLibrary.simpleMessage("还没有消息~"), "haixiajiemei" : MessageLookupByLibrary.simpleMessage("海峡姐妹"), "haowu" : MessageLookupByLibrary.simpleMessage("好物"), "heji" : MessageLookupByLibrary.simpleMessage("合计:"), @@ -255,6 +256,7 @@ class MessageLookup extends MessageLookupByLibrary { "mingxi" : MessageLookupByLibrary.simpleMessage("明细"), "morenpaixu" : MessageLookupByLibrary.simpleMessage("默认排序"), "muqianzanwuxingdianhuodong" : MessageLookupByLibrary.simpleMessage("目前暂无星店活动"), + "nihaimeiyouchongzhihuoxiaofeijilu" : MessageLookupByLibrary.simpleMessage("你在这儿还没有消费或充值记录哦~"), "nindingweigongnengweikaiqi" : MessageLookupByLibrary.simpleMessage("您定位功能开关未开启,请点击去打開定位"), "nindingweiquanxianweiyunxu" : MessageLookupByLibrary.simpleMessage("您未开启位置权限,请点击确定申请权限"), "ninweidenglu" : MessageLookupByLibrary.simpleMessage("您未登录,请点击去登录"), diff --git a/lib/generated/intl/messages_zh_Hant_CN.dart b/lib/generated/intl/messages_zh_Hant_CN.dart index 739460c0..084bbef3 100644 --- a/lib/generated/intl/messages_zh_Hant_CN.dart +++ b/lib/generated/intl/messages_zh_Hant_CN.dart @@ -170,6 +170,7 @@ class MessageLookup extends MessageLookupByLibrary { "guanlidizhi" : MessageLookupByLibrary.simpleMessage("管理地址"), "guanyu" : MessageLookupByLibrary.simpleMessage("關於"), "guojiankangyoujishenghuo" : MessageLookupByLibrary.simpleMessage("過健康有機生活"), + "haimeiyouxiaoxi" : MessageLookupByLibrary.simpleMessage("還沒有消息~"), "haixiajiemei" : MessageLookupByLibrary.simpleMessage("海峽姐妹"), "haowu" : MessageLookupByLibrary.simpleMessage("好物"), "heji" : MessageLookupByLibrary.simpleMessage("合計:"), @@ -255,6 +256,7 @@ class MessageLookup extends MessageLookupByLibrary { "mingxi" : MessageLookupByLibrary.simpleMessage("明細"), "morenpaixu" : MessageLookupByLibrary.simpleMessage("默認排序"), "muqianzanwuxingdianhuodong" : MessageLookupByLibrary.simpleMessage("目前暫無星店活動"), + "nihaimeiyouchongzhihuoxiaofeijilu" : MessageLookupByLibrary.simpleMessage("你在這兒還沒有消費或充值紀錄喔~"), "nindingweigongnengweikaiqi" : MessageLookupByLibrary.simpleMessage("您定位功能開關未開啟,請點擊去開啟定位"), "nindingweiquanxianweiyunxu" : MessageLookupByLibrary.simpleMessage("您未开启位置权限,请点击确定申请权限"), "ninweidenglu" : MessageLookupByLibrary.simpleMessage("您未登錄,請點擊去登錄"), diff --git a/lib/generated/intl/messages_zh_TW.dart b/lib/generated/intl/messages_zh_TW.dart index e8152370..2b088491 100644 --- a/lib/generated/intl/messages_zh_TW.dart +++ b/lib/generated/intl/messages_zh_TW.dart @@ -170,6 +170,7 @@ class MessageLookup extends MessageLookupByLibrary { "guanlidizhi" : MessageLookupByLibrary.simpleMessage("管理地址"), "guanyu" : MessageLookupByLibrary.simpleMessage("關於"), "guojiankangyoujishenghuo" : MessageLookupByLibrary.simpleMessage("過健康有機生活"), + "haimeiyouxiaoxi" : MessageLookupByLibrary.simpleMessage("還沒有消息~"), "haixiajiemei" : MessageLookupByLibrary.simpleMessage("海峽姐妹"), "haowu" : MessageLookupByLibrary.simpleMessage("好物"), "heji" : MessageLookupByLibrary.simpleMessage("合計:"), @@ -255,6 +256,7 @@ class MessageLookup extends MessageLookupByLibrary { "mingxi" : MessageLookupByLibrary.simpleMessage("明細"), "morenpaixu" : MessageLookupByLibrary.simpleMessage("默認排序"), "muqianzanwuxingdianhuodong" : MessageLookupByLibrary.simpleMessage("目前暫無星店活動"), + "nihaimeiyouchongzhihuoxiaofeijilu" : MessageLookupByLibrary.simpleMessage("你在這兒還沒有消費或充值紀錄喔~"), "nindingweigongnengweikaiqi" : MessageLookupByLibrary.simpleMessage("您定位功能開關未開啟,請點擊去開啟定位"), "nindingweiquanxianweiyunxu" : MessageLookupByLibrary.simpleMessage("您未开启位置权限,请点击确定申请权限"), "ninweidenglu" : MessageLookupByLibrary.simpleMessage("您未登錄,請點擊去登錄"), diff --git a/lib/generated/l10n.dart b/lib/generated/l10n.dart index 3bb84be3..7740e4cf 100644 --- a/lib/generated/l10n.dart +++ b/lib/generated/l10n.dart @@ -3925,6 +3925,26 @@ class S { ); } + /// `你在这儿还没有消费或充值记录哦~` + String get nihaimeiyouchongzhihuoxiaofeijilu { + return Intl.message( + '你在这儿还没有消费或充值记录哦~', + name: 'nihaimeiyouchongzhihuoxiaofeijilu', + desc: '', + args: [], + ); + } + + /// `还没有消息~` + String get haimeiyouxiaoxi { + return Intl.message( + '还没有消息~', + name: 'haimeiyouxiaoxi', + desc: '', + args: [], + ); + } + /// `并使用本机号码登录` String get privacy_policy4 { return Intl.message( diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index 2ef9e670..03179852 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -407,6 +407,9 @@ "chongzhixiaoxi": "充值消息", "shuaxin": "刷新", "lijichongzhi": "立即充值", + "nihaimeiyouchongzhihuoxiaofeijilu": "你在这儿还没有消费或充值记录哦~", + "haimeiyouxiaoxi": "还没有消息~", + diff --git a/lib/l10n/intl_zh_CN.arb b/lib/l10n/intl_zh_CN.arb index fadf6952..4fd47281 100644 --- a/lib/l10n/intl_zh_CN.arb +++ b/lib/l10n/intl_zh_CN.arb @@ -408,6 +408,8 @@ "chongzhixiaoxi": "充值消息", "shuaxin": "刷新", "lijichongzhi": "立即充值", + "nihaimeiyouchongzhihuoxiaofeijilu": "你在这儿还没有消费或充值记录哦~", + "haimeiyouxiaoxi": "还没有消息~", diff --git a/lib/l10n/intl_zh_Hans_CN.arb b/lib/l10n/intl_zh_Hans_CN.arb index 415dafd6..71e188f3 100644 --- a/lib/l10n/intl_zh_Hans_CN.arb +++ b/lib/l10n/intl_zh_Hans_CN.arb @@ -408,6 +408,8 @@ "chongzhixiaoxi": "充值消息", "shuaxin": "刷新", "lijichongzhi": "立即充值", + "nihaimeiyouchongzhihuoxiaofeijilu": "你在这儿还没有消费或充值记录哦~", + "haimeiyouxiaoxi": "还没有消息~", diff --git a/lib/l10n/intl_zh_Hant_CN.arb b/lib/l10n/intl_zh_Hant_CN.arb index 084f2b0b..a61408b8 100644 --- a/lib/l10n/intl_zh_Hant_CN.arb +++ b/lib/l10n/intl_zh_Hant_CN.arb @@ -402,6 +402,8 @@ "chongzhixiaoxi": "充值消息", "shuaxin": "刷新", "lijichongzhi": "立即充值", + "nihaimeiyouchongzhihuoxiaofeijilu": "你在這兒還沒有消費或充值紀錄喔~", + "haimeiyouxiaoxi": "還沒有消息~", diff --git a/lib/l10n/intl_zh_TW.arb b/lib/l10n/intl_zh_TW.arb index c656b7a0..179f88e1 100644 --- a/lib/l10n/intl_zh_TW.arb +++ b/lib/l10n/intl_zh_TW.arb @@ -400,6 +400,8 @@ "chongzhixiaoxi": "充值消息", "shuaxin": "刷新", "lijichongzhi": "立即充值", + "nihaimeiyouchongzhihuoxiaofeijilu": "你在這兒還沒有消費或充值紀錄喔~", + "haimeiyouxiaoxi": "還沒有消息~", diff --git a/lib/message/system_message.dart b/lib/message/system_message.dart index 98d82217..f1aa7042 100644 --- a/lib/message/system_message.dart +++ b/lib/message/system_message.dart @@ -9,6 +9,7 @@ import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_footer.dart'; +import 'package:huixiang/view_widget/no_data_view.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -62,8 +63,7 @@ class _SystemMessagePage extends State { messages.addAll(pageInfo.list.map((e) => Message.fromJson(e)).toList()); _refreshController.loadComplete(); _refreshController.refreshCompleted(); - if (mounted) - setState(() {}); + if (mounted) setState(() {}); if (pageNum * 10 > int.tryParse(pageInfo.total)) { _refreshController.loadNoData(); } else { @@ -77,7 +77,6 @@ class _SystemMessagePage extends State { RefreshController _refreshController = RefreshController(); - @override Widget build(BuildContext context) { return Scaffold( @@ -104,21 +103,28 @@ class _SystemMessagePage extends State { onLoading: () { queryMessage(); }, - child: ListView.builder( - padding: EdgeInsets.only(top: 16), - itemCount: messages.length, - physics: NeverScrollableScrollPhysics(), - itemBuilder: (context, position) { - return GestureDetector( - onTap: () { - if (messages[position].typed == 2) { - Navigator.of(context) - .pushNamed('/router/exchange_order_details'); - } - }, - child: buildMessageItem(messages[position]), - ); - }), + child: (messages == null || messages.length == 0) + ? NoDataView( + isShowBtn: false, + text: S.of(context).haimeiyouxiaoxi, + fontSize: 16.sp, + margin: EdgeInsets.only(top: 120.h), + ) + : ListView.builder( + padding: EdgeInsets.only(top: 16), + itemCount: messages.length, + physics: NeverScrollableScrollPhysics(), + itemBuilder: (context, position) { + return GestureDetector( + onTap: () { + if (messages[position].typed == 2) { + Navigator.of(context) + .pushNamed('/router/exchange_order_details'); + } + }, + child: buildMessageItem(messages[position]), + ); + }), ), ); } @@ -153,8 +159,8 @@ class _SystemMessagePage extends State { (message.typed == 1) ? "assets/image/icon_system_notices.png" : (message.typed == 2) - ? "assets/image/icon_system_order.png" - : "assets/image/icon_system_recharge.png", + ? "assets/image/icon_system_order.png" + : "assets/image/icon_system_recharge.png", width: 24.w, height: 24.h, ), diff --git a/lib/mine/vip_balance_page.dart b/lib/mine/vip_balance_page.dart index 0cc528e7..6ee87302 100644 --- a/lib/mine/vip_balance_page.dart +++ b/lib/mine/vip_balance_page.dart @@ -6,11 +6,11 @@ import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/data/user_bill.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/view_widget/no_data_view.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; - class VipBalancePage extends StatefulWidget { final arguments; @@ -113,12 +113,19 @@ class _VipBalancePage extends State { leadingWidth: 56.w, ), body: Container( - child: ListView.builder( - itemBuilder: (context, position) { - return balanceItem(userBills[position]); - }, - itemCount: userBills.length, - ), + child: (userBills == null || userBills.length == 0) + ? NoDataView( + isShowBtn: false, + text: S.of(context).nihaimeiyouchongzhihuoxiaofeijilu, + fontSize: 16.sp, + margin: EdgeInsets.only(top: 120.h), + ) + : ListView.builder( + itemBuilder: (context, position) { + return balanceItem(userBills[position]); + }, + itemCount: userBills.length, + ), ), ); } @@ -138,7 +145,9 @@ class _VipBalancePage extends State { margin: EdgeInsets.only(left: 12.w, top: 12.h), alignment: Alignment.center, child: Image.asset( - userBill.pm == 0 ? "assets/image/icon_store_c.png" : "assets/image/icon_wallet_recharge.png", + userBill.pm == 0 + ? "assets/image/icon_store_c.png" + : "assets/image/icon_wallet_recharge.png", ), ), Expanded( @@ -177,7 +186,10 @@ class _VipBalancePage extends State { TextSpan(children: [ TextSpan( text: userBill.createTime, - style: TextStyle(fontSize: 14.sp, color: Color(0xff727272),), + style: TextStyle( + fontSize: 14.sp, + color: Color(0xff727272), + ), ), ]), ), @@ -186,9 +198,10 @@ class _VipBalancePage extends State { TextSpan( text: S.of(context).yue_(userBill.balance), style: TextStyle( - fontSize: 14.sp, - fontWeight: FontWeight.bold, - color: Color(0xff727272),), + fontSize: 14.sp, + fontWeight: FontWeight.bold, + color: Color(0xff727272), + ), ), ]), ),