diff --git a/lib/address/address_map_page.dart b/lib/address/address_map_page.dart index f9c72432..545dafd8 100644 --- a/lib/address/address_map_page.dart +++ b/lib/address/address_map_page.dart @@ -151,9 +151,9 @@ class _AddressMapPage extends State { // await AmapCore.init('feaae7986201b571cace1b83728be5bb'); if (await Permission.locationWhenInUse.serviceStatus.isEnabled) { bool isShown = await Permission.contacts.shouldShowRequestRationale; - if (isShown) { - SmartDialog.showToast("shouldShowRequest"); - } + // if (isShown) { + // SmartDialog.showToast("shouldShowRequest"); + // } if (await Permission.location.isPermanentlyDenied) { //openAppSettings } else if (await Permission.location.isGranted) { diff --git a/lib/address/edit_address_page.dart b/lib/address/edit_address_page.dart index c8a4f97e..06191628 100644 --- a/lib/address/edit_address_page.dart +++ b/lib/address/edit_address_page.dart @@ -154,19 +154,19 @@ class _EditAddressPage extends State { String city = addressController.text; String address = houseNumberController.text; if (name == null || name == "") { - SmartDialog.showToast("请输入收货人姓名"); + SmartDialog.showToast("请输入收货人姓名", alignment: Alignment.center); return; } if (mobile == null || mobile == "") { - SmartDialog.showToast("请输入收货人手机号"); + SmartDialog.showToast("请输入收货人手机号", alignment: Alignment.center); return; } if (city == null || city == "") { - SmartDialog.showToast("请输入收货人地址"); + SmartDialog.showToast("请输入收货人地址", alignment: Alignment.center); return; } if (address == null || address == "") { - SmartDialog.showToast("请输入收货人详细地址"); + SmartDialog.showToast("请输入收货人详细地址", alignment: Alignment.center); return; } BaseData baseData; @@ -202,7 +202,7 @@ class _EditAddressPage extends State { } if (baseData != null && baseData.isSuccess) { - SmartDialog.showToast(preAddress == null ? "保存成功" : "修改成功"); + SmartDialog.showToast(preAddress == null ? "保存成功" : "修改成功", alignment: Alignment.center); Navigator.of(context).pop(); } } diff --git a/lib/article/hot_article_details_page.dart b/lib/article/hot_article_details_page.dart index 308db321..025199ad 100644 --- a/lib/article/hot_article_details_page.dart +++ b/lib/article/hot_article_details_page.dart @@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; class HotArticleDetailsPage extends StatefulWidget { @override @@ -16,255 +17,244 @@ class _HotArticleDetailsPage extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - backgroundColor: Color(0xFFFFFFFF), - elevation: 0, - centerTitle: false, - leading: GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10), - padding: EdgeInsets.all(6), - child: Icon( - Icons.arrow_back_ios, - color: Colors.black, - size: 24, - ), - ), - ), - titleSpacing: 2, - leadingWidth: 56, - automaticallyImplyLeading: true, - actions: [ - Padding(padding: EdgeInsets.only(right: 16),child:Image.asset( + appBar: MyAppBar( + background: Color(0xFFFFFFFF), + leadingColor: Colors.black, + title: S.of(context).wenzhangxiangqing, + titleColor: Colors.black, + titleSize: 16.sp, + action: Padding( + padding: EdgeInsets.only(right: 16.w), + child: Image.asset( "assets/image/icon_share.png", - width: 24, - height: 24, - ),) - ], - title: Text( - S.of(context).wenzhangxiangqing, - style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold), + width: 24.w, + height: 24.h, + ), ), ), - body: Container( - child: SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: Column( - children: [ - Container( - margin: EdgeInsets.only(bottom: 20.h), - padding: EdgeInsets.all(16), - decoration: BoxDecoration( - color: Colors.white, - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 2), - blurRadius: 14, - spreadRadius: 0) - ], - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text("牡丹花的养护知识", - style: TextStyle( - fontSize: 24.sp, - fontWeight: FontWeight.bold, - color: Color(0xff1A1A1A))), - SizedBox( - height: 20.h, + body: Container( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + children: [ + Container( + margin: EdgeInsets.only(bottom: 20.h), + padding: EdgeInsets.all(16), + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 2), + blurRadius: 14, + spreadRadius: 0, + ) + ], + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "牡丹花的养护知识", + style: TextStyle( + fontSize: 24.sp, + fontWeight: FontWeight.bold, + color: Color(0xff1A1A1A), ), - Row( - children: [ - ClipOval( - child: Image.network( - "https://t7.baidu.com/it/u=2841334870,333581502&fm=193&f=GIF", - fit: BoxFit.cover, - width: 44.w, - height: 44.h, - ), - clipBehavior: Clip.hardEdge, - ), - SizedBox( - width: 8.w, + ), + SizedBox( + height: 20.h, + ), + Row( + children: [ + ClipOval( + child: Image.network( + "https://t7.baidu.com/it/u=2841334870,333581502&fm=193&f=GIF", + fit: BoxFit.cover, + width: 44.w, + height: 44.h, ), - Expanded( - child: Container( - height: 60.h, - child: Column( - mainAxisAlignment: - MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text.rich( - TextSpan(children: [ - TextSpan( - text: "百花谷", - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 14.sp, - color: Colors.black), - ), - ]), - textDirection: TextDirection.ltr, - ), - Text( - "2021.04.12 12:12", - overflow: TextOverflow.ellipsis, - maxLines: 2, - style: TextStyle( - fontSize: 12.sp, - color: Color(0xff808080), + clipBehavior: Clip.hardEdge, + ), + SizedBox( + width: 8.w, + ), + Expanded( + child: Container( + height: 60.h, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text.rich( + TextSpan(children: [ + TextSpan( + text: "百花谷", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 14.sp, + color: Colors.black), ), + ]), + textDirection: TextDirection.ltr, + ), + Text( + "2021.04.12 12:12", + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + fontSize: 12.sp, + color: Color(0xff808080), ), - ], - ), + ), + ], ), - flex: 1, - ) - ], - ), - SizedBox( - height: 20.h, - ), - RichText( - text: TextSpan( - text: "文本,是指书面语言的表现形式,从文学角度说,通常是具有完整、系统含义(Message)的一个句子或多个句子的组合。" - "一个文本可以是一个句子(Sentence)、一个段落(Paragraph)或者一个篇章(Discourse)。广义“文本”:" - "任何由书写所固定下来的任何话语。(利科尔) 狭义“文本”:由语言文字组成的文学实体,代指“作品”,相对于作者、世界构成一个独立、自足的系统。", - style: TextStyle(color:Color(0xFF1A1A1A), fontSize: 16.sp), - )), - SizedBox( - height: 16.h, - ), - Image.network( - "https://t7.baidu.com/it/u=2487758541,1861252964&fm=193&f=GIF", - fit: BoxFit.cover, - width: double.infinity, - height: 170.h, - ), - SizedBox( - height: 16.h, - ), - RichText( - text: TextSpan( - text: "文本,是指书面语言的表现形式,从文学角度说,通常是具有完整、系统含义(Message)的一个句子或多个句子的组合。一个文本可以", - style: TextStyle(color:Color(0xFF1A1A1A), fontSize: 16.sp), - )), - ], - ), + ), + flex: 1, + ) + ], + ), + SizedBox( + height: 20.h, + ), + RichText( + text: TextSpan( + text: + "文本,是指书面语言的表现形式,从文学角度说,通常是具有完整、系统含义(Message)的一个句子或多个句子的组合。" + "一个文本可以是一个句子(Sentence)、一个段落(Paragraph)或者一个篇章(Discourse)。广义“文本”:" + "任何由书写所固定下来的任何话语。(利科尔) 狭义“文本”:由语言文字组成的文学实体,代指“作品”,相对于作者、世界构成一个独立、自足的系统。", + style: + TextStyle(color: Color(0xFF1A1A1A), fontSize: 16.sp), + )), + SizedBox( + height: 16.h, + ), + Image.network( + "https://t7.baidu.com/it/u=2487758541,1861252964&fm=193&f=GIF", + fit: BoxFit.cover, + width: double.infinity, + height: 170.h, + ), + SizedBox( + height: 16.h, + ), + RichText( + text: TextSpan( + text: + "文本,是指书面语言的表现形式,从文学角度说,通常是具有完整、系统含义(Message)的一个句子或多个句子的组合。一个文本可以", + style: + TextStyle(color: Color(0xFF1A1A1A), fontSize: 16.sp), + )), + ], ), - Container( - // margin: EdgeInsets.only(bottom: 20), - // padding: EdgeInsets.all(16), - decoration: BoxDecoration( - color: Colors.white, - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 2), - blurRadius: 14, - spreadRadius: 0) - ], - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding(padding: EdgeInsets.all(16),child:Text("评论 (58) 喜欢 (58)", + ), + Container( + // margin: EdgeInsets.only(bottom: 20), + // padding: EdgeInsets.all(16), + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 2), + blurRadius: 14, + spreadRadius: 0) + ], + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.all(16), + child: Text("评论 (58) 喜欢 (58)", style: TextStyle( fontSize: 16.sp, fontWeight: FontWeight.bold, - color: Color(0xff1A1A1A))),), - SizedBox( - height: 600.h, - child: ListView.builder( - itemCount: 6, - scrollDirection: Axis.vertical, - physics: BouncingScrollPhysics(), - itemBuilder: (context, position) { - return _commentItem(position); - - }, - ), + color: Color(0xff1A1A1A))), + ), + SizedBox( + height: 600.h, + child: ListView.builder( + itemCount: 6, + scrollDirection: Axis.vertical, + physics: BouncingScrollPhysics(), + itemBuilder: (context, position) { + return _commentItem(position); + }, ), - - ], - ), - ), - SizedBox( - height: 12.h, - ), - Container( - padding: EdgeInsets.all(16), - decoration: BoxDecoration( - color: Colors.white, - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 2), - blurRadius: 14, - spreadRadius: 0) - ], - borderRadius: new BorderRadius.only( - topLeft: Radius.circular(8.0), - topRight: Radius.circular(8.0), ), + ], + ), + ), + SizedBox( + height: 12.h, + ), + Container( + padding: EdgeInsets.all(16), + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 2), + blurRadius: 14, + spreadRadius: 0) + ], + borderRadius: new BorderRadius.only( + topLeft: Radius.circular(8.0), + topRight: Radius.circular(8.0), ), - child: Row( - children: [ - Expanded( - flex: 1, - child: Container( - decoration: new BoxDecoration( - color: Color(0xffF2F2F2), - borderRadius: BorderRadius.circular(2.0)), - child: Column( - children: [ - Container( - margin: const EdgeInsets.fromLTRB(4, 0, 4, 0), - alignment: Alignment.topLeft, - child: TextField( - maxLines: 8, - minLines: 1, - decoration: InputDecoration( - border: InputBorder.none, - hintText: "留下您精彩的评论吧~", - hintStyle: TextStyle( - fontSize: 14.sp, - color: Color(0xffCDCCCC), - ), + ), + child: Row( + children: [ + Expanded( + flex: 1, + child: Container( + decoration: new BoxDecoration( + color: Color(0xffF2F2F2), + borderRadius: BorderRadius.circular(2.0)), + child: Column( + children: [ + Container( + margin: const EdgeInsets.fromLTRB(4, 0, 4, 0), + alignment: Alignment.topLeft, + child: TextField( + maxLines: 8, + minLines: 1, + decoration: InputDecoration( + border: InputBorder.none, + hintText: "留下您精彩的评论吧~", + hintStyle: TextStyle( + fontSize: 14.sp, + color: Color(0xffCDCCCC), ), ), ), - ], - ), + ), + ], ), ), - Padding( - padding: EdgeInsets.only(left: 20.w, right: 20.w), - child: Text( - "发送", - style: TextStyle( - fontSize: 16.sp, - fontWeight: FontWeight.bold, - color: Color(0XFF1A1A1A)), - ), + ), + Padding( + padding: EdgeInsets.only(left: 20.w, right: 20.w), + child: Text( + "发送", + style: TextStyle( + fontSize: 16.sp, + fontWeight: FontWeight.bold, + color: Color(0XFF1A1A1A)), ), - Image.asset("assets/image/icon_like_h.png") - ], - ), + ), + Image.asset("assets/image/icon_like_h.png") + ], ), - ], - ), + ), + ], ), ), + ), ); } @@ -316,75 +306,79 @@ class _HotArticleDetailsPage extends State { return Container( child: Column( children: [ - Padding(padding: EdgeInsets.all(16),child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - ClipOval( - child: Image.network( - "https://t7.baidu.com/it/u=2841334870,333581502&fm=193&f=GIF", - fit: BoxFit.cover, - width: 40.w, - height: 40.h, + Padding( + padding: EdgeInsets.all(16), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + ClipOval( + child: Image.network( + "https://t7.baidu.com/it/u=2841334870,333581502&fm=193&f=GIF", + fit: BoxFit.cover, + width: 40.w, + height: 40.h, + ), + clipBehavior: Clip.hardEdge, ), - clipBehavior: Clip.hardEdge, - ), - SizedBox( - width: 12.w, - ), - Expanded( - child: Container( - height: 60.h, - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text.rich( - TextSpan(children: [ - TextSpan( - text: "张三", - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 14.sp, - color: Colors.black), + SizedBox( + width: 12.w, + ), + Expanded( + child: Container( + height: 60.h, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text.rich( + TextSpan(children: [ + TextSpan( + text: "张三", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 14.sp, + color: Colors.black), + ), + ]), + textDirection: TextDirection.ltr, + ), + Text( + "2021.04.12 12:12", + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + fontSize: 12.sp, + color: Color(0xff808080), ), - ]), - textDirection: TextDirection.ltr, + ), + ], + ), + ), + flex: 1, + ), + Container( + alignment: Alignment.topRight, + child: Row( + children: [ + Image.asset( + "assets/image/icon_like.png", + width: 16.w, + height: 16.h, ), Text( - "2021.04.12 12:12", - overflow: TextOverflow.ellipsis, - maxLines: 2, + "58", style: TextStyle( - fontSize: 12.sp, - color: Color(0xff808080), - ), + fontSize: 12.sp, color: Color(0xff1A1A1A)), ), ], ), ), - flex: 1, - ), - Container( - alignment: Alignment.topRight, - child: Row( - children: [ - Image.asset( - "assets/image/icon_like.png", - width: 16.w, - height: 16.h, - ), - Text( - "58", - style: TextStyle(fontSize: 12.sp, color: Color(0xff1A1A1A)), - ), - ], - ), - ), - ], - ),), + ], + ), + ), Padding( - padding: EdgeInsets.only(left: 68,right: 16), + padding: EdgeInsets.only(left: 68, right: 16), child: Text( "文本,是指书面语言的表现形式,从文学角度说,通常是具有完整、系统含义(Mess…", style: TextStyle(fontSize: 14.sp, color: Color(0xff1A1A1A)), @@ -395,7 +389,7 @@ class _HotArticleDetailsPage extends State { ), Container( width: double.infinity, - margin: EdgeInsets.only(left: 68.w,right: 16.w), + margin: EdgeInsets.only(left: 68.w, right: 16.w), decoration: new BoxDecoration( color: Color(0xffF2F2F2), borderRadius: BorderRadius.circular(2.0), @@ -409,25 +403,25 @@ class _HotArticleDetailsPage extends State { ), ), if (position == 5) - Container( - height: 63.h, - decoration: BoxDecoration( - color: Color(0xffF2F2F2), - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 2), - blurRadius: 14, - spreadRadius: 0) - ], - ), - margin: EdgeInsets.only(top: 30.h), - alignment: Alignment.center, - child: Text( - "-已显示全部评论-", - style: TextStyle(fontSize: 14.sp, color: Color(0xff353535)), + Container( + height: 63.h, + decoration: BoxDecoration( + color: Color(0xffF2F2F2), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 2), + blurRadius: 14, + spreadRadius: 0) + ], + ), + margin: EdgeInsets.only(top: 30.h), + alignment: Alignment.center, + child: Text( + "-已显示全部评论-", + style: TextStyle(fontSize: 14.sp, color: Color(0xff353535)), + ), ), - ), ], ), ); diff --git a/lib/article/hot_article_item.dart b/lib/article/hot_article_item.dart index f4e13155..0e18a39c 100644 --- a/lib/article/hot_article_item.dart +++ b/lib/article/hot_article_item.dart @@ -8,6 +8,7 @@ import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/hot_item.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_footer.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -77,34 +78,12 @@ class _HotArticlePage extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - backgroundColor: Color(0xFFF7F7F7), - elevation: 0, - title: Text( - S.of(context).huixiangtoutiao, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - ), - ), - centerTitle: false, - leading: GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10), - padding: EdgeInsets.all(6), - child: Icon( - Icons.arrow_back_ios, - color: Colors.black, - size: 24, - ), - ), - ), - titleSpacing: 2, - leadingWidth: 56, + appBar: MyAppBar( + background: Color(0xFFF7F7F7), + leadingColor: Colors.black, + title: S.of(context).huixiangtoutiao, + titleColor: Colors.black, + titleSize: 18.sp, ), body: Container( child: SmartRefresher( diff --git a/lib/generated/intl/messages_en.dart b/lib/generated/intl/messages_en.dart index b0ddc32b..41be63aa 100644 --- a/lib/generated/intl/messages_en.dart +++ b/lib/generated/intl/messages_en.dart @@ -185,6 +185,7 @@ class MessageLookup extends MessageLookupByLibrary { "huiyuandengji" : MessageLookupByLibrary.simpleMessage("会员等级"), "huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("会员等级说明"), "huiyuanjifen" : MessageLookupByLibrary.simpleMessage("会员积分"), + "huiyuanka" : MessageLookupByLibrary.simpleMessage("会员卡"), "huiyuankaxiangqing" : MessageLookupByLibrary.simpleMessage("会员卡详情"), "huiyuanyue" : MessageLookupByLibrary.simpleMessage("会员余额"), "huode" : MessageLookupByLibrary.simpleMessage("获得"), @@ -300,6 +301,7 @@ class MessageLookup extends MessageLookupByLibrary { "qingzhuo" : MessageLookupByLibrary.simpleMessage("清桌"), "qishoupeisongzhongyujisongdashijian" : MessageLookupByLibrary.simpleMessage("骑手配送中,预计送达时间"), "qishouyijiedanquhuozhong" : MessageLookupByLibrary.simpleMessage("骑手已接单、取货中"), + "quanbao" : MessageLookupByLibrary.simpleMessage("券包"), "quanbu" : MessageLookupByLibrary.simpleMessage("全部"), "quanbudingdan" : MessageLookupByLibrary.simpleMessage("全部订单"), "quanbuduihuan" : MessageLookupByLibrary.simpleMessage("全部兑换"), diff --git a/lib/generated/intl/messages_zh_CN.dart b/lib/generated/intl/messages_zh_CN.dart index 2042512a..ca43a9a4 100644 --- a/lib/generated/intl/messages_zh_CN.dart +++ b/lib/generated/intl/messages_zh_CN.dart @@ -184,6 +184,7 @@ class MessageLookup extends MessageLookupByLibrary { "huiyuandengji" : MessageLookupByLibrary.simpleMessage("会员等级"), "huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("会员等级说明"), "huiyuanjifen" : MessageLookupByLibrary.simpleMessage("会员积分"), + "huiyuanka" : MessageLookupByLibrary.simpleMessage("会员卡"), "huiyuankaxiangqing" : MessageLookupByLibrary.simpleMessage("会员卡详情"), "huiyuanyue" : MessageLookupByLibrary.simpleMessage("会员余额"), "huode" : MessageLookupByLibrary.simpleMessage("获得"), @@ -299,6 +300,7 @@ class MessageLookup extends MessageLookupByLibrary { "qingzhuo" : MessageLookupByLibrary.simpleMessage("清桌"), "qishoupeisongzhongyujisongdashijian" : MessageLookupByLibrary.simpleMessage("骑手配送中,预计送达时间"), "qishouyijiedanquhuozhong" : MessageLookupByLibrary.simpleMessage("骑手已接单、取货中"), + "quanbao" : MessageLookupByLibrary.simpleMessage("券包"), "quanbu" : MessageLookupByLibrary.simpleMessage("全部"), "quanbudingdan" : MessageLookupByLibrary.simpleMessage("全部订单"), "quanbuduihuan" : MessageLookupByLibrary.simpleMessage("全部兑换"), diff --git a/lib/generated/intl/messages_zh_Hans_CN.dart b/lib/generated/intl/messages_zh_Hans_CN.dart index f107a3c2..5053bf39 100644 --- a/lib/generated/intl/messages_zh_Hans_CN.dart +++ b/lib/generated/intl/messages_zh_Hans_CN.dart @@ -184,6 +184,7 @@ class MessageLookup extends MessageLookupByLibrary { "huiyuandengji" : MessageLookupByLibrary.simpleMessage("会员等级"), "huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("会员等级说明"), "huiyuanjifen" : MessageLookupByLibrary.simpleMessage("会员积分"), + "huiyuanka" : MessageLookupByLibrary.simpleMessage("会员卡"), "huiyuankaxiangqing" : MessageLookupByLibrary.simpleMessage("会员卡详情"), "huiyuanyue" : MessageLookupByLibrary.simpleMessage("会员余额"), "huode" : MessageLookupByLibrary.simpleMessage("获得"), @@ -299,6 +300,7 @@ class MessageLookup extends MessageLookupByLibrary { "qingzhuo" : MessageLookupByLibrary.simpleMessage("清桌"), "qishoupeisongzhongyujisongdashijian" : MessageLookupByLibrary.simpleMessage("骑手配送中,预计送达时间"), "qishouyijiedanquhuozhong" : MessageLookupByLibrary.simpleMessage("骑手已接单、取货中"), + "quanbao" : MessageLookupByLibrary.simpleMessage("券包"), "quanbu" : MessageLookupByLibrary.simpleMessage("全部"), "quanbudingdan" : MessageLookupByLibrary.simpleMessage("全部订单"), "quanbuduihuan" : MessageLookupByLibrary.simpleMessage("全部兑换"), diff --git a/lib/generated/intl/messages_zh_Hant_CN.dart b/lib/generated/intl/messages_zh_Hant_CN.dart index 1e05a296..6fd9c4d6 100644 --- a/lib/generated/intl/messages_zh_Hant_CN.dart +++ b/lib/generated/intl/messages_zh_Hant_CN.dart @@ -184,6 +184,7 @@ class MessageLookup extends MessageLookupByLibrary { "huiyuandengji" : MessageLookupByLibrary.simpleMessage("會員等級"), "huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("會員等級説明"), "huiyuanjifen" : MessageLookupByLibrary.simpleMessage("會員積分"), + "huiyuanka" : MessageLookupByLibrary.simpleMessage("會員卡"), "huiyuankaxiangqing" : MessageLookupByLibrary.simpleMessage("會員卡詳情"), "huiyuanyue" : MessageLookupByLibrary.simpleMessage("會員餘額"), "huode" : MessageLookupByLibrary.simpleMessage("獲得"), @@ -299,6 +300,7 @@ class MessageLookup extends MessageLookupByLibrary { "qingzhuo" : MessageLookupByLibrary.simpleMessage("清桌"), "qishoupeisongzhongyujisongdashijian" : MessageLookupByLibrary.simpleMessage("騎手配送中,預計送達時間"), "qishouyijiedanquhuozhong" : MessageLookupByLibrary.simpleMessage("騎手已接單、取貨中"), + "quanbao" : MessageLookupByLibrary.simpleMessage("券包"), "quanbu" : MessageLookupByLibrary.simpleMessage("全部"), "quanbudingdan" : MessageLookupByLibrary.simpleMessage("全部訂單"), "quanbuduihuan" : MessageLookupByLibrary.simpleMessage("全部兌換"), diff --git a/lib/generated/intl/messages_zh_TW.dart b/lib/generated/intl/messages_zh_TW.dart index ae7150fc..c46c6318 100644 --- a/lib/generated/intl/messages_zh_TW.dart +++ b/lib/generated/intl/messages_zh_TW.dart @@ -184,6 +184,7 @@ class MessageLookup extends MessageLookupByLibrary { "huiyuandengji" : MessageLookupByLibrary.simpleMessage("會員等級"), "huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("會員等級説明"), "huiyuanjifen" : MessageLookupByLibrary.simpleMessage("會員積分"), + "huiyuanka" : MessageLookupByLibrary.simpleMessage("會員卡"), "huiyuankaxiangqing" : MessageLookupByLibrary.simpleMessage("會員卡詳情"), "huiyuanyue" : MessageLookupByLibrary.simpleMessage("會員餘額"), "huode" : MessageLookupByLibrary.simpleMessage("獲得"), @@ -299,6 +300,7 @@ class MessageLookup extends MessageLookupByLibrary { "qingzhuo" : MessageLookupByLibrary.simpleMessage("清桌"), "qishoupeisongzhongyujisongdashijian" : MessageLookupByLibrary.simpleMessage("騎手配送中,預計送達時間"), "qishouyijiedanquhuozhong" : MessageLookupByLibrary.simpleMessage("騎手已接單、取貨中"), + "quanbao" : MessageLookupByLibrary.simpleMessage("券包"), "quanbu" : MessageLookupByLibrary.simpleMessage("全部"), "quanbudingdan" : MessageLookupByLibrary.simpleMessage("全部訂單"), "quanbuduihuan" : MessageLookupByLibrary.simpleMessage("全部兌換"), diff --git a/lib/generated/l10n.dart b/lib/generated/l10n.dart index 6c7d33d0..c61e0ae6 100644 --- a/lib/generated/l10n.dart +++ b/lib/generated/l10n.dart @@ -4035,6 +4035,26 @@ class S { ); } + /// `会员卡` + String get huiyuanka { + return Intl.message( + '会员卡', + name: 'huiyuanka', + desc: '', + args: [], + ); + } + + /// `券包` + String get quanbao { + return Intl.message( + '券包', + name: 'quanbao', + desc: '', + args: [], + ); + } + /// `并使用本机号码登录` String get privacy_policy4 { return Intl.message( diff --git a/lib/home/founder_story_page.dart b/lib/home/founder_story_page.dart index 8dbcf9da..70084220 100644 --- a/lib/home/founder_story_page.dart +++ b/lib/home/founder_story_page.dart @@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/utils/MyPainter.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/separator.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -18,36 +19,12 @@ class _FounderStoryPage extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - backgroundColor: Color(0xFFFFFFFF), - elevation: 0, - centerTitle: false, - title: Text( - S.of(context).guanyuchuangshiren, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 18.sp, - ), - ), - leading: GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10.w), - padding: EdgeInsets.all(6), - child: Icon( - Icons.arrow_back_ios, - color: Colors.black, - size: 24, - ), - ), - ), - titleSpacing: 2.w, - leadingWidth: 56.w, - automaticallyImplyLeading: true, + appBar: MyAppBar( + background: Color(0xFFFFFFFF), + leadingColor: Colors.black, + title: S.of(context).guanyuchuangshiren, + titleColor: Colors.black, + titleSize: 18.sp, ), body: Container( child: SingleChildScrollView( diff --git a/lib/home/huixiang_brand_page.dart b/lib/home/huixiang_brand_page.dart index a607bfc0..c0e97c5d 100644 --- a/lib/home/huixiang_brand_page.dart +++ b/lib/home/huixiang_brand_page.dart @@ -170,7 +170,6 @@ class _BrandPage extends State assetUriMatcher(): assetImageRender(), networkSourceMatcher(extension: "svg"): svgNetworkImageRender(), networkSourceMatcher(): networkImageRender(loadingWidget: () { - // return Image.asset("assets/image/default_1.png",); return Container(); }), }, diff --git a/lib/home/main_home_page.dart b/lib/home/main_home_page.dart index c0460fc3..ce4685b8 100644 --- a/lib/home/main_home_page.dart +++ b/lib/home/main_home_page.dart @@ -5,6 +5,7 @@ import 'package:huixiang/home/home_page.dart'; import 'package:huixiang/home/points_mall_page.dart'; import 'package:huixiang/main.dart'; import 'package:huixiang/utils/event_type.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_tab.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -52,29 +53,25 @@ class _MainHomePage extends State return DefaultTabController( length: 3, child: Scaffold( - appBar: AppBar( - backgroundColor: Color(0xFFFAFAFA), - elevation: 0, - toolbarOpacity: 0, + appBar: MyAppBar( + background: Color(0xFFFAFAFA), toolbarHeight: 50.h, - automaticallyImplyLeading: false, - actions: [ - Container( - margin: EdgeInsets.only(right: 17.w), - child: GestureDetector( - onTap: () { - // Navigator.of(context).pushNamed("/router/msg_page"); - Navigator.of(context).pushNamed('/router/system_msg_page'); - }, - child: Image.asset( - "assets/image/icon_notices.png", - width: 24.w, - height: 24.h, - ), + leading: false, + action: Container( + margin: EdgeInsets.only(right: 17.w), + child: GestureDetector( + onTap: () { + // Navigator.of(context).pushNamed("/router/msg_page"); + Navigator.of(context).pushNamed('/router/system_msg_page'); + }, + child: Image.asset( + "assets/image/icon_notices.png", + width: 24.w, + height: 24.h, ), - ) - ], - title: TabBar( + ), + ), + titleChild: TabBar( controller: tabcontroller, automaticIndicatorColorAdjustment: true, isScrollable: true, diff --git a/lib/integral/integral_page.dart b/lib/integral/integral_page.dart index 59b71236..02e7dc95 100644 --- a/lib/integral/integral_page.dart +++ b/lib/integral/integral_page.dart @@ -11,6 +11,7 @@ import 'package:huixiang/retrofit/data/sign_info.dart'; import 'package:huixiang/retrofit/data/task.dart'; import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/round_button.dart'; import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -73,51 +74,30 @@ class _IntegralPage extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: Text( - S.of(context).jifenxiangqing, - style: TextStyle(color: Colors.white), - ), - centerTitle: false, - backgroundColor: Color(0xFF3A405A), - elevation: 0, - actions: [ - Container( - alignment: Alignment.center, - margin: EdgeInsets.only(right: 16.w), - child: GestureDetector( - onTap: () { - Navigator.of(context) - .pushNamed('/router/integral_detailed_page'); - }, - child: Text( - S.of(context).mingxi, - style: TextStyle( - color: Colors.white, - fontSize: 18.sp, - fontWeight: FontWeight.bold, - ), + appBar: MyAppBar( + background: Color(0xFF3A405A), + leadingColor: Colors.white, + title: S.of(context).jifenxiangqing, + titleColor: Colors.white, + titleSize: 16.sp, + action: Container( + alignment: Alignment.center, + margin: EdgeInsets.only(right: 16.w), + child: GestureDetector( + onTap: () { + Navigator.of(context) + .pushNamed('/router/integral_detailed_page'); + }, + child: Text( + S.of(context).mingxi, + style: TextStyle( + color: Colors.white, + fontSize: 18.sp, + fontWeight: FontWeight.bold, ), ), - ) - ], - leading: GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10.w), - padding: EdgeInsets.all(6), - child: Icon( - Icons.arrow_back_ios, - color: Colors.white, - size: 24, - ), ), ), - titleSpacing: 2, - leadingWidth: 56.w, ), body: SingleChildScrollView( child: Container( @@ -509,14 +489,14 @@ class _IntegralPage extends State { ///立即签到 signIn() async { if ((signInfo != null && signInfo.todayHasSignin)) { - SmartDialog.showToast("今日已签到了"); + SmartDialog.showToast("今日已签到了", alignment: Alignment.center); return; } SmartDialog.showLoading(msg: S.of(context).zhengzaijiazai); BaseData baseData = await apiService.signIn(); if (baseData != null && baseData.isSuccess) { querySignInfo(); - SmartDialog.showToast("签到成功"); + SmartDialog.showToast("签到成功", alignment: Alignment.center); } } diff --git a/lib/integral_store/integral_store_details_page.dart b/lib/integral_store/integral_store_details_page.dart index 8cb34f24..0bea245d 100644 --- a/lib/integral_store/integral_store_details_page.dart +++ b/lib/integral_store/integral_store_details_page.dart @@ -10,6 +10,7 @@ import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/goods.dart'; import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -60,47 +61,12 @@ class _IntegralStoreDetailsPage extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - backgroundColor: Color(0xFFFFFFFF), - elevation: 0, - leading: GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10), - padding: EdgeInsets.all(6), - child: Icon( - Icons.arrow_back_ios, - color: Colors.black, - size: 24, - ), - ), - ), - title: Text( - S.of(context).shangpinxiangqing, - style: TextStyle( - color: Colors.black, - fontSize: 16.sp, - fontWeight: FontWeight.bold, - ), - ), - titleSpacing: 2, - leadingWidth: 56.w, - // actions: [ - // Container( - // margin: EdgeInsets.only(right: 15.w), - // child: GestureDetector( - // onTap: () {}, - // child: Icon( - // Icons.share, - // size: 24, - // color: Colors.black, - // ), - // ), - // ) - // ], + appBar: MyAppBar( + background: Color(0xFFFFFFFF), + leadingColor: Colors.black, + title: S.of(context).shangpinxiangqing, + titleColor: Colors.black, + titleSize: 16.sp, ), body: Container( child: Column( diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index 1ae07838..f0b83d37 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -418,6 +418,8 @@ "jujue": "拒绝", "yinsizhengce1": " 感谢您使用一心回乡APP。我们非常重视您的个人信息和隐私保护。为了更好地保证您的个人权益,在您使用我们的产品前,请务必仔细阅读一心回乡", "yinsizhengce2": "     在您同意后,我们才会根据您的使用需求,收集部分可能涉及的数据(地理位置、相机、存储等信息)。", + "huiyuanka": "会员卡", + "quanbao": "券包", diff --git a/lib/l10n/intl_zh_CN.arb b/lib/l10n/intl_zh_CN.arb index 485f7460..1cfd02ce 100644 --- a/lib/l10n/intl_zh_CN.arb +++ b/lib/l10n/intl_zh_CN.arb @@ -419,6 +419,8 @@ "jujue": "拒绝", "yinsizhengce1": " 感谢您使用一心回乡APP。我们非常重视您的个人信息和隐私保护。为了更好地保证您的个人权益,在您使用我们的产品前,请务必仔细阅读一心回乡", "yinsizhengce2": "     在您同意后,我们才会根据您的使用需求,收集部分可能涉及的数据(地理位置、相机、存储等信息)。", + "huiyuanka": "会员卡", + "quanbao": "券包", diff --git a/lib/l10n/intl_zh_Hans_CN.arb b/lib/l10n/intl_zh_Hans_CN.arb index 82da1a1e..4371a69d 100644 --- a/lib/l10n/intl_zh_Hans_CN.arb +++ b/lib/l10n/intl_zh_Hans_CN.arb @@ -419,6 +419,8 @@ "jujue": "拒绝", "yinsizhengce1": " 感谢您使用一心回乡APP。我们非常重视您的个人信息和隐私保护。为了更好地保证您的个人权益,在您使用我们的产品前,请务必仔细阅读一心回乡", "yinsizhengce2": "     在您同意后,我们才会根据您的使用需求,收集部分可能涉及的数据(地理位置、相机、存储等信息)。", + "huiyuanka": "会员卡", + "quanbao": "券包", diff --git a/lib/l10n/intl_zh_Hant_CN.arb b/lib/l10n/intl_zh_Hant_CN.arb index f6ca50a3..cbf83aca 100644 --- a/lib/l10n/intl_zh_Hant_CN.arb +++ b/lib/l10n/intl_zh_Hant_CN.arb @@ -413,6 +413,8 @@ "jujue": "拒絕", "yinsizhengce1": " 感謝您使用一心回鄉APP。我們非常的重視您的個人信息和隱私保護。為了更好地保證您的個人權益,在您使用我們的產品前,請務必仔細閱讀一心回鄉", "yinsizhengce2": "     在您同意後,我們才會根據您的使用需求,收集部分可能涉及(地理位置、相機、存儲等信息)的數據。", + "huiyuanka": "會員卡", + "quanbao": "券包", diff --git a/lib/l10n/intl_zh_TW.arb b/lib/l10n/intl_zh_TW.arb index 7f07a049..73810ed1 100644 --- a/lib/l10n/intl_zh_TW.arb +++ b/lib/l10n/intl_zh_TW.arb @@ -411,6 +411,8 @@ "jujue": "拒絕", "yinsizhengce1": " 感謝您使用一心回鄉APP。我們非常的重視您的個人信息和隱私保護。為了更好地保證您的個人權益,在您使用我們的產品前,請務必仔細閱讀一心回鄉", "yinsizhengce2": "     在您同意後,我們才會根據您的使用需求,收集部分可能涉及(地理位置、相機、存儲等信息)的數據。", + "huiyuanka": "會員卡", + "quanbao": "券包", diff --git a/lib/login/login_page.dart b/lib/login/login_page.dart index ba47b58d..9dde6488 100644 --- a/lib/login/login_page.dart +++ b/lib/login/login_page.dart @@ -165,7 +165,7 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { return; } if (!checkStatus) { - SmartDialog.showToast(S.of(context).gouxuanxieyi); + SmartDialog.showToast(S.of(context).gouxuanxieyi, alignment: Alignment.center); return; } var mobile = _controllerPhone.text; @@ -185,12 +185,12 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { { btnText = S.of(context).send_code, _sendCodeStatus = 0, - SmartDialog.showToast("${value.msg}"), + SmartDialog.showToast("${value.msg}", alignment: Alignment.center), refresh() } }) .catchError((error) { - SmartDialog.showToast("$error"); + SmartDialog.showToast("$error", alignment: Alignment.center); }); } } @@ -235,7 +235,7 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { return; } if (!checkStatus) { - SmartDialog.showToast(S.of(context).gouxuanxieyi); + SmartDialog.showToast(S.of(context).gouxuanxieyi, alignment: Alignment.center); return; } var mobile = _controllerPhone.text; @@ -271,7 +271,7 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { SmartDialog.showLoading(msg: S.of(context).zhengzaijiazai); BaseData value = await client.memberLogin(param).catchError((error) { print(error); - SmartDialog.showToast("$error"); + SmartDialog.showToast("$error", alignment: Alignment.center); }); Future.delayed(Duration(seconds: 2), () { SmartDialog.dismiss(); @@ -289,7 +289,7 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { Navigator.of(context).popAndPushNamed('/router/main_page'); } } else { - SmartDialog.showToast("${value.msg}"); + SmartDialog.showToast("${value.msg}", alignment: Alignment.center); } }); } diff --git a/lib/main.dart b/lib/main.dart index 2ac5bada..11c9ac28 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -89,8 +89,6 @@ void main() async { XgFlutterPlugin xgFlutterPlugin = XgFlutterPlugin(); initSdk() async { - print("object: initsdk"); - ///ios 调用startXg前需要调用此方法 xgFlutterPlugin.configureClusterDomainName("tpns.sh.tencent.com"); xgFlutterPlugin.setEnableDebug(true); @@ -171,31 +169,13 @@ class MyApp extends StatelessWidget { final String name = settings.name; final Function pageContentBuilder = routers[name]; if (pageContentBuilder != null) { - final Route route = MaterialPageRoute( + final Route route = CupertinoPageRoute( builder: (context) { return pageContentBuilder(context, arguments: settings.arguments); }, settings: settings, ); - //final Route route = PageRouteBuilder( - // pageBuilder: (context, animation, secondaryAnimation) { - // return pageContentBuilder(context, - // arguments: settings.arguments); - // }, - // transitionsBuilder: - // (context, animation, secondaryAnimation, child) { - // return SlideTransition( - // child: child, - // position: animation.drive( - // Tween(begin: Offset(1.0, 0.0), end: Offset.zero).chain( - // CurveTween(curve: Curves.ease), - // ), - // ), - // ); - // }, - // settings: settings, - // ); return route; } return MaterialPageRoute( diff --git a/lib/message/main_message_page.dart b/lib/message/main_message_page.dart index fc107078..435b1924 100644 --- a/lib/message/main_message_page.dart +++ b/lib/message/main_message_page.dart @@ -3,6 +3,7 @@ import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/message/mine_message.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/round_button.dart'; class MainMessagePage extends StatefulWidget { @@ -26,71 +27,28 @@ class _MainMessagePage extends State @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: Color(0xFFFFFFFF), - appBar: AppBar( - backgroundColor: Color(0xFFFFFFFF), - elevation: 0, - centerTitle: false, - leading: GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10), - padding: EdgeInsets.all(6), - child: Icon( - Icons.arrow_back_ios, - color: Colors.black, - size: 24, - ), - ), - ), - titleSpacing: 2, - leadingWidth: 56, - automaticallyImplyLeading: true, - actions: [rightAction()], - title: Text( - S.of(context).xiaoxi, - style: TextStyle(color: Colors.black), - ), - // bottom: PreferredSize( - // preferredSize: Size(double.infinity, 38), - // child: TabBar( - // controller: tabcontroller, - // isScrollable: true, - // indicatorWeight: 2, - // indicatorColor: Color(0xFF39B54A), - // labelPadding: EdgeInsets.only(left: 25, right: 25), - // indicatorPadding: EdgeInsets.only(left: 25, right: 25, top: 3), - // unselectedLabelStyle: - // TextStyle(fontSize: 16, fontWeight: FontWeight.normal), - // labelStyle: TextStyle( - // color: Colors.black, - // fontSize: 16, - // fontWeight: FontWeight.bold), - // labelColor: Colors.black, - // tabs: [ - // MyTab(text: S.of(context).huodongzixun), - // MyTab( - // text: S.of(context).wodexiaoxi, - // ), - // ]), - // ), - ), - body: MineMessagePage(_status), - // TabBarView( - // children: [ - // RealTimeInfoPage(), - // MineMessagePage(_status, (status) { - // setState(() { - // _bgStatus = status; - // }); - // }) - // ], - // controller: tabcontroller, - // ), - ); + backgroundColor: Color(0xFFFFFFFF), + appBar: MyAppBar( + title: S.of(context).xiaoxi, + titleColor: Colors.black, + titleSize: 18.sp, + background: Color(0xFFF7F7F7), + leadingColor: Colors.black, + action: rightAction(), + ), + body: MineMessagePage(_status), + // TabBarView( + // children: [ + // RealTimeInfoPage(), + // MineMessagePage(_status, (status) { + // setState(() { + // _bgStatus = status; + // }); + // }) + // ], + // controller: tabcontroller, + // ), + ); } var _status = 0; diff --git a/lib/mine/coupons_page.dart b/lib/mine/coupons_page.dart index 7ce8e6de..8c4775c8 100644 --- a/lib/mine/coupons_page.dart +++ b/lib/mine/coupons_page.dart @@ -10,6 +10,7 @@ import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/my_footer.dart'; import 'package:huixiang/view_widget/new_coupon_widget.dart'; +import 'package:huixiang/view_widget/no_data_view.dart'; import 'package:huixiang/view_widget/receive_success.dart'; import 'package:huixiang/view_widget/selector_store_dialog.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; @@ -24,7 +25,6 @@ class CouponsPage extends StatefulWidget { } class _CouponsPage extends State { - ApiService apiService; RefreshController _refreshController; @@ -115,7 +115,8 @@ class _CouponsPage extends State { S.of(context).keyongquan, style: TextStyle( fontSize: 14.sp, - fontWeight: state == 1 ? FontWeight.bold : FontWeight.normal, + fontWeight: + state == 1 ? FontWeight.bold : FontWeight.normal, color: state == 1 ? Colors.black : Color(0xff727272), ), ), @@ -141,7 +142,8 @@ class _CouponsPage extends State { S.of(context).shixiaoquan, style: TextStyle( fontSize: 14.sp, - fontWeight: state == 3 ? FontWeight.bold : FontWeight.normal, + fontWeight: + state == 3 ? FontWeight.bold : FontWeight.normal, color: state == 3 ? Colors.black : Color(0xff727272), ), ), @@ -163,30 +165,46 @@ class _CouponsPage extends State { ), onRefresh: _onRefresh, onLoading: queryCard, - child: ListView.builder( - itemBuilder: (context, position) { - return GestureDetector( - child: NewCouponWidget(coupons[position], (type) { - if (type == 1) { - receiveCoupon(coupons[position].id); - } else { - if (coupons[position].bizType == 5) { - Navigator.of(context).pushNamed('/router/write_off_page',arguments: { - "couponId":coupons[position].id - }); - } else { - showStoreSelector(coupons[position].storeList); - } - } - }, () { - setState(() { - coupons[position].isEx = !coupons[position].isEx; - }); - }, type: 0,), - ); - }, - itemCount: coupons != null ? coupons.length : 0, - ), + child: (coupons != null && coupons.length > 0) + ? ListView.builder( + itemBuilder: (context, position) { + return GestureDetector( + child: NewCouponWidget( + coupons[position], + (type) { + if (type == 1) { + receiveCoupon(coupons[position].id); + } else { + if (coupons[position].bizType == 5) { + Navigator.of(context).pushNamed( + '/router/write_off_page', + arguments: { + "couponId": coupons[position].id + }); + } else { + showStoreSelector( + coupons[position].storeList); + } + } + }, + () { + setState(() { + coupons[position].isEx = + !coupons[position].isEx; + }); + }, + type: 0, + ), + ); + }, + itemCount: coupons != null ? coupons.length : 0, + ) + : NoDataView( + isShowBtn: false, + text: "你还没有券~", + fontSize: 16.sp, + margin: EdgeInsets.only(top: 120.h), + ), ), ), ], @@ -220,5 +238,4 @@ class _CouponsPage extends State { }, ); } - } diff --git a/lib/mine/edit_name.dart b/lib/mine/edit_name.dart index 5900f76f..e5be2603 100644 --- a/lib/mine/edit_name.dart +++ b/lib/mine/edit_name.dart @@ -35,7 +35,7 @@ class _EditName extends State { if(name != null && name != "") { Navigator.of(context).pop(name); } else { - SmartDialog.showToast("请输入用户名"); + SmartDialog.showToast("请输入用户名", alignment: Alignment.center); } }, child: Text( diff --git a/lib/mine/manage_address_page.dart b/lib/mine/manage_address_page.dart index 493c95c1..6dbb1de7 100644 --- a/lib/mine/manage_address_page.dart +++ b/lib/mine/manage_address_page.dart @@ -7,9 +7,11 @@ import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/view_widget/border_text.dart'; import 'package:huixiang/view_widget/icon_text.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/no_data_view.dart'; import 'package:huixiang/view_widget/round_button.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; class ManageAddressPage extends StatefulWidget { final Map arguments; @@ -52,34 +54,12 @@ class _ManageAddressPage extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: Text( - S.of(context).shouhuodizhi, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - ), - ), - centerTitle: false, - backgroundColor: Color(0xFFF7F7F7), - elevation: 0, - leading: GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10), - padding: EdgeInsets.all(6), - child: Icon( - Icons.arrow_back_ios, - color: Colors.black, - size: 24, - ), - ), - ), - titleSpacing: 2, - leadingWidth: 56, + appBar: MyAppBar( + title: S.of(context).shouhuodizhi, + titleColor: Colors.black, + titleSize: 18.sp, + background: Color(0xFFF7F7F7), + leadingColor: Colors.black, ), body: Column( children: [ diff --git a/lib/mine/mine_card_invalid_page.dart b/lib/mine/mine_card_invalid_page.dart index a2236a56..396794ab 100644 --- a/lib/mine/mine_card_invalid_page.dart +++ b/lib/mine/mine_card_invalid_page.dart @@ -7,9 +7,11 @@ import 'package:huixiang/retrofit/data/coupon.dart'; import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/view_widget/coupon_widget.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_footer.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 MineCardInvalidPage extends StatefulWidget { @override @@ -84,34 +86,12 @@ class _MineCardInvalidPage extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: Text( - S.of(context).shixiaoyouhuiquan, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - ), - ), - centerTitle: false, - backgroundColor: Color(0xFFF7F7F7), - elevation: 0, - leading: GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10), - padding: EdgeInsets.all(6), - child: Icon( - Icons.arrow_back_ios, - color: Colors.black, - size: 24, - ), - ), - ), - titleSpacing: 2, - leadingWidth: 56, + appBar: MyAppBar( + title: S.of(context).shixiaoyouhuiquan, + titleColor: Colors.black, + titleSize: 18.sp, + background: Color(0xFFF7F7F7), + leadingColor: Colors.black, ), body: Container( child: SmartRefresher( diff --git a/lib/mine/mine_card_page.dart b/lib/mine/mine_card_page.dart index ad242a80..03ba185d 100644 --- a/lib/mine/mine_card_page.dart +++ b/lib/mine/mine_card_page.dart @@ -1,8 +1,10 @@ - import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/mine/vip_card_page.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/view_widget/my_tab.dart'; import 'coupons_page.dart'; @@ -15,47 +17,27 @@ class MineCardPage extends StatefulWidget { class _MineCardPage extends State with SingleTickerProviderStateMixin { - @override Widget build(BuildContext context) { return DefaultTabController( length: 2, child: Scaffold( - appBar: AppBar( - title: Text( - S.of(context).kaquan, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - ), - ), - centerTitle: false, - backgroundColor: Colors.white, - elevation: 0, - leading: GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10), - padding: EdgeInsets.all(6), - child: Icon( - Icons.arrow_back_ios, - color: Colors.black, - size: 24, - ), - ), - ), - titleSpacing: 2, - leadingWidth: 56, + appBar: MyAppBar( + title: S.of(context).kaquan, + titleColor: Colors.black, + background: Colors.white, + leadingColor: Colors.black, + toolbarHeight: kToolbarHeight + MediaQuery.of(context).padding.top, bottom: TabBar( // isScrollable: true, //可滚动 indicatorColor: Color(0xff39B54A), labelColor: Colors.black, - labelStyle: TextStyle(fontSize: 17, fontWeight: FontWeight.bold), + labelStyle: TextStyle( + fontSize: 17.sp, + fontWeight: FontWeight.bold, + ), unselectedLabelStyle: TextStyle( - fontSize: 16, + fontSize: 16.sp, fontWeight: FontWeight.normal, ), // controller: tabController, @@ -64,8 +46,8 @@ class _MineCardPage extends State indicatorSize: TabBarIndicatorSize.label, //指示器与文字等宽 tabs: [ - Tab(text: "会员卡"), - Tab(text: "券包"), + MyTab(text: S.of(context).huiyuanka), + MyTab(text: S.of(context).quanbao), ], ), ), diff --git a/lib/mine/mine_vip_level_page.dart b/lib/mine/mine_vip_level_page.dart index af1991ac..be3a6ae1 100644 --- a/lib/mine/mine_vip_level_page.dart +++ b/lib/mine/mine_vip_level_page.dart @@ -9,6 +9,7 @@ import 'package:huixiang/retrofit/data/rank.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/view_widget/mine_vip_view.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:shared_preferences/shared_preferences.dart'; class MineVipLevelPage extends StatefulWidget { @@ -52,42 +53,19 @@ class _MineVipLevelPage extends State { }); } else { - SmartDialog.showToast(rankData.msg); + SmartDialog.showToast(rankData.msg, alignment: Alignment.center); } } @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: Text( - S.of(context).wodehuiyuandengji, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 18.sp, - ), - ), - centerTitle: false, - backgroundColor: Color(0xFFFFFFFF), - elevation: 0, - leading: GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10.w), - padding: EdgeInsets.all(6), - child: Icon( - Icons.arrow_back_ios, - color: Colors.black, - size: 24, - ), - ), - ), - titleSpacing: 2.w, - leadingWidth: 56.w, + appBar: MyAppBar( + title: S.of(context).wodehuiyuandengji, + titleColor: Colors.black, + titleSize: 18.sp, + background: Color(0xFFFFFFFF), + leadingColor: Colors.black, ), body: SingleChildScrollView( physics: BouncingScrollPhysics(), diff --git a/lib/mine/mine_wallet_page.dart b/lib/mine/mine_wallet_page.dart index b2442388..2b5a0798 100644 --- a/lib/mine/mine_wallet_page.dart +++ b/lib/mine/mine_wallet_page.dart @@ -10,6 +10,7 @@ import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; 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/round_button.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -102,34 +103,11 @@ class _MineWalletPage extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: Text( - S.of(context).wodeqianbao, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - ), - ), - centerTitle: false, - backgroundColor: Color(0xFFF7F7F7), - elevation: 0, - leading: GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10.w), - padding: EdgeInsets.all(6), - child: Icon( - Icons.arrow_back_ios, - color: Colors.black, - size: 24, - ), - ), - ), - titleSpacing: 2, - leadingWidth: 56.w, + appBar: MyAppBar( + title: S.of(context).wodeqianbao, + titleColor: Colors.black, + background: Color(0xFFF7F7F7), + leadingColor: Colors.black, ), body: SmartRefresher( controller: refreshController, diff --git a/lib/mine/recharge_page.dart b/lib/mine/recharge_page.dart index 02554486..4e568cc3 100644 --- a/lib/mine/recharge_page.dart +++ b/lib/mine/recharge_page.dart @@ -10,6 +10,7 @@ import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/min.dart'; import 'package:huixiang/view_widget/item_input_widget.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/round_button.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -40,35 +41,12 @@ class _RechargePage extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: Text( - S.of(context).chongzhi, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 18.sp, - ), - ), - centerTitle: false, - backgroundColor: Color(0xFFFFFFFF), - elevation: 0, - leading: GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10.w), - padding: EdgeInsets.all(6), - child: Icon( - Icons.arrow_back_ios, - color: Colors.black, - size: 24, - ), - ), - ), - titleSpacing: 2, - leadingWidth: 56.w, + appBar: MyAppBar( + title: S.of(context).chongzhi, + titleColor: Colors.black, + titleSize: 18.sp, + background: Color(0xFFFFFFFF), + leadingColor: Colors.black, ), body: SingleChildScrollView( physics: BouncingScrollPhysics(), @@ -251,7 +229,7 @@ class _RechargePage extends State { recharge() async { String money = controller.text; if (money == null || money == "") { - SmartDialog.showToast(S.of(context).qingshuruchongzhijine); + SmartDialog.showToast(S.of(context).qingshuruchongzhijine, alignment: Alignment.center); return; } int amount = int.tryParse(money); diff --git a/lib/mine/roll_center_page.dart b/lib/mine/roll_center_page.dart index feda3be7..8628bc77 100644 --- a/lib/mine/roll_center_page.dart +++ b/lib/mine/roll_center_page.dart @@ -9,6 +9,7 @@ import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/item_title.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_footer.dart'; import 'package:huixiang/view_widget/new_coupon_widget.dart'; import 'package:huixiang/view_widget/receive_success.dart'; @@ -82,34 +83,11 @@ class _RollCenterPage extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: Text( - S.of(context).lingquanzhongxin, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - ), - ), - centerTitle: false, - backgroundColor: Color(0xFFF7F7F7), - elevation: 0, - leading: GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10.w), - padding: EdgeInsets.all(6), - child: Icon( - Icons.arrow_back_ios, - color: Colors.black, - size: 24, - ), - ), - ), - titleSpacing: 2, - leadingWidth: 56.w, + appBar: MyAppBar( + title: S.of(context).lingquanzhongxin, + titleColor: Colors.black, + background: Color(0xFFF7F7F7), + leadingColor: Colors.black, ), body: Container( child: Column( diff --git a/lib/mine/user_info_page.dart b/lib/mine/user_info_page.dart index 5c7e42b9..e838bfb0 100644 --- a/lib/mine/user_info_page.dart +++ b/lib/mine/user_info_page.dart @@ -11,6 +11,7 @@ import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/flutter_utils.dart'; import 'package:huixiang/view_widget/cupertino_date_picker.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:image_cropper/image_cropper.dart'; import 'package:image_picker_gallery_camera/image_picker_gallery_camera.dart'; import 'package:intl/intl.dart'; @@ -64,34 +65,11 @@ class _UserInfoPage extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: Text( - S.of(context).zhanghaoxinxi, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - ), - ), - centerTitle: false, - backgroundColor: Color(0xFFF7F7F7), - elevation: 0, - leading: GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10), - padding: EdgeInsets.all(6), - child: Icon( - Icons.arrow_back_ios, - color: Colors.black, - size: 24.sp, - ), - ), - ), - titleSpacing: 2, - leadingWidth: 56.w, + appBar: MyAppBar( + title: S.of(context).zhanghaoxinxi, + titleColor: Colors.black, + background: Color(0xFFF7F7F7), + leadingColor: Colors.black, ), body: Container( child: Column( @@ -354,7 +332,7 @@ class _UserInfoPage extends State { var info = await apiService.editInfo(modifyInfo); if (info.isSuccess) { setState(() { - SmartDialog.showToast("用户信息修改成功"); + SmartDialog.showToast("用户信息修改成功", alignment: Alignment.center); }); } } diff --git a/lib/mine/vip_balance_page.dart b/lib/mine/vip_balance_page.dart index 6ee87302..71763f15 100644 --- a/lib/mine/vip_balance_page.dart +++ b/lib/mine/vip_balance_page.dart @@ -6,6 +6,7 @@ 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/my_appbar.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'; @@ -83,34 +84,11 @@ class _VipBalancePage extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: Text( - S.of(context).yuemingxi, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - ), - ), - centerTitle: false, - backgroundColor: Color(0xFFF7F7F7), - elevation: 0, - leading: GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10.w), - padding: EdgeInsets.all(6), - child: Icon( - Icons.arrow_back_ios, - color: Colors.black, - size: 24, - ), - ), - ), - titleSpacing: 2, - leadingWidth: 56.w, + appBar: MyAppBar( + title: S.of(context).yuemingxi, + titleColor: Colors.black, + background: Color(0xFFF7F7F7), + leadingColor: Colors.black, ), body: Container( child: (userBills == null || userBills.length == 0) diff --git a/lib/mine/vip_detail_page.dart b/lib/mine/vip_detail_page.dart index 26844ae7..be768d87 100644 --- a/lib/mine/vip_detail_page.dart +++ b/lib/mine/vip_detail_page.dart @@ -11,6 +11,7 @@ import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/painter_bg.dart'; import 'package:huixiang/utils/status_utils.dart'; import 'package:huixiang/view_widget/custom_image.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_footer.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; @@ -83,32 +84,12 @@ class _VipDetailPage extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: Text( - S.of(context).huiyuankaxiangqing, - style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold), - ), - centerTitle: false, - backgroundColor: Color(0xFF3A405A), - brightness: Brightness.dark, - elevation: 0, - leading: GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10), - padding: EdgeInsets.all(6), - child: Icon( - Icons.arrow_back_ios, - color: Colors.white, - size: 24, - ), - ), - ), - titleSpacing: 2, - leadingWidth: 56.w, + appBar: MyAppBar( + title: S.of(context).huiyuankaxiangqing, + titleColor: Colors.white, + background: Color(0xFF3A405A), + // brightness: Brightness.dark, + leadingColor: Colors.white, ), body: Column( children: [ diff --git a/lib/order/exchange_history_page.dart b/lib/order/exchange_history_page.dart index a16c3727..3fde408d 100644 --- a/lib/order/exchange_history_page.dart +++ b/lib/order/exchange_history_page.dart @@ -8,6 +8,7 @@ import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/icon_text.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_footer.dart'; import 'package:huixiang/view_widget/my_tab.dart'; import 'package:huixiang/view_widget/no_data_view.dart'; @@ -66,35 +67,12 @@ class _ExchangeHistoryPage extends State return DefaultTabController( length: 3, child: Scaffold( - appBar: AppBar( - title: Text( - S.of(context).duihuanlishi, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 18.sp, - ), - ), - centerTitle: false, - backgroundColor: Color(0xFFFFFFFF), - elevation: 0, - leading: GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10.w), - padding: EdgeInsets.all(6), - child: Icon( - Icons.arrow_back_ios, - color: Colors.black, - size: 24, - ), - ), - ), - titleSpacing: 2, - leadingWidth: 56.w, + appBar: MyAppBar( + title: S.of(context).duihuanlishi, + titleColor: Colors.black, + titleSize: 18.sp, + background: Color(0xFFFFFFFF), + leadingColor: Colors.black, bottom: PreferredSize( preferredSize: Size(double.infinity, 38.h), child: TabBar( diff --git a/lib/order/exchange_order_detail_page.dart b/lib/order/exchange_order_detail_page.dart index 10a9816f..0e544d9b 100644 --- a/lib/order/exchange_order_detail_page.dart +++ b/lib/order/exchange_order_detail_page.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/separator.dart'; class ExchangeOrderDetailPage extends StatefulWidget { @@ -13,31 +14,11 @@ class _ExchangeOrderDetailPage extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: Text( - S.of(context).yiwanchengdingdan, - style: TextStyle(color: Colors.black), - ), - centerTitle: false, - backgroundColor: Color(0xFFF7F7F7), - elevation: 0, - leading: GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10), - padding: EdgeInsets.all(6), - child: Icon( - Icons.arrow_back_ios, - color: Colors.black, - size: 24, - ), - ), - ), - titleSpacing: 2, - leadingWidth: 56, + appBar: MyAppBar( + title: S.of(context).yiwanchengdingdan, + titleColor: Colors.black, + leadingColor: Colors.black, + background: Color(0xFFF7F7F7), ), body: SingleChildScrollView( child: Container( diff --git a/lib/order/exchange_order_page.dart b/lib/order/exchange_order_page.dart index dbe174fa..424eaaca 100644 --- a/lib/order/exchange_order_page.dart +++ b/lib/order/exchange_order_page.dart @@ -8,6 +8,7 @@ import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -43,35 +44,12 @@ class _ExchangeOrderPage extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: Text( - S.of(context).dingdanqueren, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 18, - ), - ), - centerTitle: false, - backgroundColor: Color(0xFFFAFAFA), - elevation: 0, - leading: GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10), - padding: EdgeInsets.all(6), - child: Icon( - Icons.arrow_back_ios, - color: Colors.black, - size: 24, - ), - ), - ), - titleSpacing: 2, - leadingWidth: 56, + appBar: MyAppBar( + title: S.of(context).dingdanqueren, + titleColor: Colors.black, + titleSize: 18.sp, + background: Color(0xFFFAFAFA), + leadingColor: Colors.black, ), body: Column( children: [ @@ -426,12 +404,12 @@ class _ExchangeOrderPage extends State { creditOrder() async { if (widget.arguments["useTyped"] == 1 && (storeId == null || storeId == "")) { - SmartDialog.showToast("请选择一个门店"); + SmartDialog.showToast("请选择一个门店", alignment: Alignment.center); return; } if (widget.arguments["useTyped"] == 2 && (userAddressId == null || userAddressId == "")) { - SmartDialog.showToast("请选择一个收货地址"); + SmartDialog.showToast("请选择一个收货地址", alignment: Alignment.center); return; } BaseData baseDate = await apiService.creditOrder({ @@ -449,7 +427,7 @@ class _ExchangeOrderPage extends State { "${int.tryParse(points) - int.tryParse(widget.arguments["price"])}"; Navigator.of(context).pop(); } else { - SmartDialog.showToast(baseDate.msg); + SmartDialog.showToast(baseDate.msg, alignment: Alignment.center); } } } diff --git a/lib/order/exchange_order_success_page.dart b/lib/order/exchange_order_success_page.dart index 25f1ac78..9fff54d9 100644 --- a/lib/order/exchange_order_success_page.dart +++ b/lib/order/exchange_order_success_page.dart @@ -7,6 +7,7 @@ import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/view_widget/border_text.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/round_button.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -45,35 +46,12 @@ class _ExchangeOrderSuccessPage extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: Text( - S.of(context).zhifuxiangqing, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 18.sp, - ), - ), - centerTitle: false, - backgroundColor: Color(0xFFFAFAFA), - elevation: 0, - leading: GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10.w), - padding: EdgeInsets.all(6), - child: Icon( - Icons.arrow_back_ios, - color: Colors.black, - size: 24, - ), - ), - ), - titleSpacing: 2, - leadingWidth: 56.w, + appBar: MyAppBar( + title: S.of(context).zhifuxiangqing, + titleColor: Colors.black, + titleSize: 18.sp, + background: Color(0xFFFAFAFA), + leadingColor: Colors.black, ), body: Container( alignment: Alignment.center, diff --git a/lib/order/logistics_information_page.dart b/lib/order/logistics_information_page.dart index 3ca67b8f..ca18f959 100644 --- a/lib/order/logistics_information_page.dart +++ b/lib/order/logistics_information_page.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; class LogisticsInformationPage extends StatefulWidget { @override @@ -13,34 +14,11 @@ class _LogisticsInformationPage extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - backgroundColor: Color(0xFFF7F7F7), - elevation: 0, - title: Text( - S.of(context).wuliuxinxi, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - ), - ), - centerTitle: false, - leading: GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10), - padding: EdgeInsets.all(6), - child: Icon( - Icons.arrow_back_ios, - color: Colors.black, - size: 24, - ), - ), - ), - titleSpacing: 2, - leadingWidth: 56, + appBar: MyAppBar( + background: Color(0xFFF7F7F7), + title: S.of(context).wuliuxinxi, + titleColor: Colors.black, + leadingColor: Colors.black, ), body:Container( child: SingleChildScrollView( diff --git a/lib/order/order_detail_page.dart b/lib/order/order_detail_page.dart index 2107b6ba..709f0b3b 100644 --- a/lib/order/order_detail_page.dart +++ b/lib/order/order_detail_page.dart @@ -8,6 +8,7 @@ import 'package:huixiang/utils/flutter_utils.dart'; import 'package:huixiang/view_widget/border_text.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/icon_text.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/pay_input_view.dart'; import 'package:huixiang/view_widget/round_button.dart'; import 'package:huixiang/view_widget/separator.dart'; @@ -73,32 +74,11 @@ class _OrderDetailPage extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: Text( - S.of(context).jinxingzhongdedingdan, - style: TextStyle(color: Colors.white), - ), - centerTitle: false, - backgroundColor: Color(0xFF3A405A), - brightness: Brightness.dark, - elevation: 0, - leading: GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10.w), - padding: EdgeInsets.all(6), - child: Icon( - Icons.arrow_back_ios, - color: Colors.white, - size: 24, - ), - ), - ), - titleSpacing: 2, - leadingWidth: 56.w, + appBar: MyAppBar( + title: S.of(context).jinxingzhongdedingdan, + titleColor: Colors.white, + background: Color(0xFF3A405A), + leadingColor: Colors.white, bottom: PreferredSize( preferredSize: Size(double.infinity, orderStatus >= 4 ? 98.h : 108.h), child: Container( @@ -473,14 +453,6 @@ class _OrderDetailPage extends State { } carryOnPay() async { - // if (orderInfo == null) return; - // BaseData baseData = await apiService.continuePay( - // {"orderCode": orderInfo.orderCode}).catchError((onError) {}); - // if (baseData != null && baseData.isSuccess) { - // // queryDetails(); - // } else { - // SmartDialog.showToast(baseData.msg); - // } showDialog( context: context, builder: (context) { diff --git a/lib/order/order_history_page.dart b/lib/order/order_history_page.dart index b42b2f3b..5ad2bacb 100644 --- a/lib/order/order_history_page.dart +++ b/lib/order/order_history_page.dart @@ -8,6 +8,7 @@ import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/status_utils.dart'; import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/custom_image.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_footer.dart'; import 'package:huixiang/view_widget/my_tab.dart'; import 'package:huixiang/view_widget/no_data_view.dart'; @@ -46,35 +47,12 @@ class _OrderHistoryPage extends State return DefaultTabController( length: 3, child: Scaffold( - appBar: AppBar( - title: Text( - S.of(context).dingdan, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 18.sp, - ), - ), - centerTitle: false, - backgroundColor: Color(0xFFFFFFFF), - elevation: 0, - leading: GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10.w), - padding: EdgeInsets.all(6), - child: Icon( - Icons.arrow_back_ios, - color: Colors.black, - size: 24, - ), - ), - ), - titleSpacing: 2.w, - leadingWidth: 56.w, + appBar: MyAppBar( + title: S.of(context).dingdan, + titleColor: Colors.black, + titleSize: 18.sp, + background: Color(0xFFFFFFFF), + leadingColor: Colors.black, bottom: PreferredSize( preferredSize: Size(double.infinity, 38.h), child: TabBar( diff --git a/lib/order/store_selector_page.dart b/lib/order/store_selector_page.dart index 374bac0f..b01aa114 100644 --- a/lib/order/store_selector_page.dart +++ b/lib/order/store_selector_page.dart @@ -10,6 +10,7 @@ import 'package:huixiang/retrofit/data/store.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/view_widget/icon_text.dart'; import 'package:huixiang/view_widget/loading_view.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:amap_flutter_base/amap_flutter_base.dart'; @@ -95,9 +96,9 @@ class _StoreSelectorPage extends State { startLocation() async { if (await Permission.locationWhenInUse.serviceStatus.isEnabled) { bool isShown = await Permission.contacts.shouldShowRequestRationale; - if (isShown) { - SmartDialog.showToast("shouldShowRequestRationale"); - } + // if (isShown) { + // SmartDialog.showToast("shouldShowRequestRationale"); + // } if (await Permission.location.isPermanentlyDenied) { openAppSettings(); getLatLng(); @@ -171,35 +172,12 @@ class _StoreSelectorPage extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: Text( - S.of(context).mendianxuanzhe, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 18.sp, - ), - ), - centerTitle: false, - backgroundColor: Color(0xFFFAFAFA), - elevation: 0, - leading: GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10.w), - padding: EdgeInsets.all(6), - child: Icon( - Icons.arrow_back_ios, - color: Colors.black, - size: 24, - ), - ), - ), - titleSpacing: 2, - leadingWidth: 56.w, + appBar: MyAppBar( + title: S.of(context).mendianxuanzhe, + titleColor: Colors.black, + titleSize: 18.sp, + background: Color(0xFFFAFAFA), + leadingColor: Colors.black, ), body: Container( margin: EdgeInsets.only(top: 18.h), @@ -223,7 +201,7 @@ class _StoreSelectorPage extends State { InkWell( onTap: () { if (groupValue == null) { - SmartDialog.showToast(S.of(context).qingxuanzeyigemendian); + SmartDialog.showToast(S.of(context).qingxuanzeyigemendian, alignment: Alignment.center); return; } Store store = storeList[groupValue]; diff --git a/lib/order/write_off_page.dart b/lib/order/write_off_page.dart index 89a11f94..bd5531b4 100644 --- a/lib/order/write_off_page.dart +++ b/lib/order/write_off_page.dart @@ -1,7 +1,9 @@ import 'package:flutter/material.dart'; import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/round_button.dart'; import 'package:huixiang/view_widget/separator.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; class WriteOffPage extends StatefulWidget { @@ -20,35 +22,12 @@ class _WriteOffPage extends State { Widget build(BuildContext context) { return Scaffold( backgroundColor: Color(0xFF32A060), - appBar: AppBar( - title: Text( - "核销码详情", - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 18, - ), - ), - centerTitle: false, - backgroundColor: Color(0xFF32A060), - elevation: 0, - leading: GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10), - padding: EdgeInsets.all(6), - child: Icon( - Icons.arrow_back_ios, - color: Colors.white, - size: 24, - ), - ), - ), - titleSpacing: 2, - leadingWidth: 56, + appBar: MyAppBar( + title: S.of(context).hexiaomaxiangqing, + titleSize: 18.sp, + titleColor: Colors.white, + background: Color(0xFF32A060), + leadingColor: Colors.white, ), body: Container( alignment: Alignment.topCenter, @@ -72,7 +51,7 @@ class _WriteOffPage extends State { Text( "马克杯兑换核销码", style: TextStyle( - fontSize: 16, + fontSize: 16.sp, fontWeight: FontWeight.bold, color: Color(0xFF353535)), ), @@ -82,7 +61,7 @@ class _WriteOffPage extends State { Text( "有效期:2020.01~2020.01.21", style: TextStyle( - fontSize: 12, color: Color(0xFF353535)), + fontSize: 12.sp, color: Color(0xFF353535)), ), ], mainAxisAlignment: MainAxisAlignment.center, diff --git a/lib/order/write_off_success_page.dart b/lib/order/write_off_success_page.dart index ba9151be..6581b60a 100644 --- a/lib/order/write_off_success_page.dart +++ b/lib/order/write_off_success_page.dart @@ -1,6 +1,8 @@ import 'package:flutter/material.dart'; import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/round_button.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; class WriteOffSuccessPage extends StatefulWidget { @override @@ -13,35 +15,12 @@ class _WriteOffSuccessPage extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: Text( - S.of(context).hexiaomaxiangqing, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 18, - ), - ), - centerTitle: false, - backgroundColor: Color(0xFFFAFAFA), - elevation: 0, - leading: GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10), - padding: EdgeInsets.all(6), - child: Icon( - Icons.arrow_back_ios, - color: Colors.black, - size: 24, - ), - ), - ), - titleSpacing: 2, - leadingWidth: 56, + appBar: MyAppBar( + title: S.of(context).hexiaomaxiangqing, + titleColor: Colors.black, + titleSize: 18.sp, + background: Color(0xFFFAFAFA), + leadingColor: Colors.black, ), body: Container( alignment: Alignment.center, @@ -50,47 +29,47 @@ class _WriteOffSuccessPage extends State { crossAxisAlignment: CrossAxisAlignment.center, children: [ SizedBox( - height: 46, + height: 46.h, ), Image.asset( "assets/image/icon_order_success.png", - width: 76, - height: 76, + width: 76.w, + height: 76.h, fit: BoxFit.contain, ), SizedBox( - height: 16, + height: 16.h, ), Text( S.of(context).hexiaochenggong, style: TextStyle( color: Color(0xFF353535), - fontSize: 21, + fontSize: 21.sp, fontWeight: FontWeight.bold), ), SizedBox( - height: 12, + height: 12.h, ), Text( S.of(context).dangqianshangpinduihuanhexiaoma, style: TextStyle( color: Color(0xFF727272), - fontSize: 12, + fontSize: 12.sp, fontWeight: FontWeight.bold), ), SizedBox( - height: 40, + height: 40.h, ), Container( - margin: EdgeInsets.only(left: 20, right: 20), + margin: EdgeInsets.only(left: 20.w, right: 20.w), child: RoundButton( text: S.of(context).fanhuiduihuanlishi, textColor: Colors.white, backgroup: Color(0xFF32A060), radius: 4, fontWeight: FontWeight.bold, - fontSize: 16, - padding: EdgeInsets.only(top: 12, bottom: 12), + fontSize: 16.sp, + padding: EdgeInsets.only(top: 12.h, bottom: 12.h), ), ) ], diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index dfa089fa..58171d42 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -88,7 +88,7 @@ abstract class ApiService { ); } else if (map["code"] != 0 && response.request.baseUrl == baseUrl) { ///高德地图的poi服务请求不需要toast - SmartDialog.showToast(map["msg"]); + SmartDialog.showToast(map["msg"], alignment: Alignment.center); } debugPrint("======================= 响应数据结束 =======================\n"); }, onError: (DioError e) { diff --git a/lib/setting/about_page.dart b/lib/setting/about_page.dart index 4730c8d6..e2204a6b 100644 --- a/lib/setting/about_page.dart +++ b/lib/setting/about_page.dart @@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:package_info/package_info.dart'; class AboutPage extends StatefulWidget { @@ -27,34 +28,11 @@ class _AboutPage extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: Text( - S.of(context).guanyu, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - ), - ), - centerTitle: false, - backgroundColor: Color(0xFFF7F7F7), - elevation: 0, - leading: GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10.w), - padding: EdgeInsets.all(6), - child: Icon( - Icons.arrow_back_ios, - color: Colors.black, - size: 24, - ), - ), - ), - titleSpacing: 2.w, - leadingWidth: 56.w, + appBar: MyAppBar( + title: S.of(context).guanyu, + titleColor: Colors.black, + background: Color(0xFFF7F7F7), + leadingColor: Colors.black, ), body: Stack( children: [ diff --git a/lib/setting/help_feedback_page.dart b/lib/setting/help_feedback_page.dart index 3b2d2f0f..c3b18d89 100644 --- a/lib/setting/help_feedback_page.dart +++ b/lib/setting/help_feedback_page.dart @@ -1,6 +1,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/round_button.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -17,34 +18,12 @@ class _HelpFeedbackPage extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: Text( - S.of(context).bangzhuyufankui, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - ), - ), - centerTitle: false, - backgroundColor: Color(0xFFF7F7F7), - elevation: 0, - leading: GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10.w), - padding: EdgeInsets.all(6), - child: Icon( - Icons.arrow_back_ios, - color: Colors.black, - size: 24, - ), - ), - ), - titleSpacing: 2.w, - leadingWidth: 56.w, + + appBar: MyAppBar( + title: S.of(context).bangzhuyufankui, + titleColor: Colors.black, + background: Color(0xFFF7F7F7), + leadingColor: Colors.black, ), body: Container( decoration: new BoxDecoration( diff --git a/lib/setting/permission_setting_page.dart b/lib/setting/permission_setting_page.dart index 05c4f970..4199dfaa 100644 --- a/lib/setting/permission_setting_page.dart +++ b/lib/setting/permission_setting_page.dart @@ -4,6 +4,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/request_permission.dart'; import 'package:permission_handler/permission_handler.dart'; @@ -62,34 +63,11 @@ class _PermissionSettingPage extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: Text( - S.of(context).quanxianshezhi, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - ), - ), - centerTitle: false, - backgroundColor: Color(0xFFF7F7F7), - elevation: 0, - leading: GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10.w), - padding: EdgeInsets.all(6), - child: Icon( - Icons.arrow_back_ios, - color: Colors.black, - size: 24, - ), - ), - ), - titleSpacing: 2.w, - leadingWidth: 56.w, + appBar: MyAppBar( + title: S.of(context).quanxianshezhi, + titleColor: Colors.black, + background: Color(0xFFF7F7F7), + leadingColor: Colors.black, ), body: Container( child: ListView.builder( diff --git a/lib/setting/setting_page.dart b/lib/setting/setting_page.dart index bf121f05..d520ebc7 100644 --- a/lib/setting/setting_page.dart +++ b/lib/setting/setting_page.dart @@ -8,6 +8,7 @@ import 'package:huixiang/main.dart'; import 'package:huixiang/utils/event_type.dart'; import 'package:huixiang/utils/flutter_utils.dart'; import 'package:huixiang/utils/min.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/round_button.dart'; import 'package:path_provider/path_provider.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -45,34 +46,11 @@ class _SettingPage extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: Text( - S.of(context).shezhi, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - ), - ), - centerTitle: false, - backgroundColor: Color(0xFFF7F7F7), - elevation: 0, - leading: GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10), - padding: EdgeInsets.all(6), - child: Icon( - Icons.arrow_back_ios, - color: Colors.black, - size: 24, - ), - ), - ), - titleSpacing: 2, - leadingWidth: 56, + appBar: MyAppBar( + title: S.of(context).shezhi, + titleColor: Colors.black, + background: Color(0xFFF7F7F7), + leadingColor: Colors.black, ), body: Container( decoration: new BoxDecoration( diff --git a/lib/setting/treaty_page.dart b/lib/setting/treaty_page.dart index b6d9b49a..b7624098 100644 --- a/lib/setting/treaty_page.dart +++ b/lib/setting/treaty_page.dart @@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; // import 'package:webview_flutter/webview_flutter.dart'; // import 'package:webview_flutter/src/webview_cupertino.dart'; @@ -25,34 +26,11 @@ class _TreatyPage extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: Text( - S.of(context).yinsishengming, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - ), - ), - centerTitle: false, - backgroundColor: Colors.transparent, - elevation: 0, - leading: GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10.w), - padding: EdgeInsets.all(6), - child: Icon( - Icons.arrow_back_ios, - color: Colors.black, - size: 24, - ), - ), - ), - titleSpacing: 2.w, - leadingWidth: 56.w, + appBar: MyAppBar( + title: S.of(context).yinsishengming, + titleColor: Colors.black, + background: Colors.transparent, + leadingColor: Colors.black, ), body: Container( width: MediaQuery.of(context).size.width, diff --git a/lib/union/store_details_page.dart b/lib/union/store_details_page.dart index 7e67b745..d338e49e 100644 --- a/lib/union/store_details_page.dart +++ b/lib/union/store_details_page.dart @@ -81,7 +81,11 @@ class _StoreDetailsPage extends State { : article != null ? article.viceTitle : "", - [], + [activity != null + ? activity.coverImg + : article != null + ? article.coverImg + : "",], activity != null ? activity.coverImg : article != null diff --git a/lib/union/union_details_page.dart b/lib/union/union_details_page.dart index 4ae791e5..3e116642 100644 --- a/lib/union/union_details_page.dart +++ b/lib/union/union_details_page.dart @@ -721,7 +721,7 @@ class _UnionDetailsPage extends State { receiveVip() async { BaseData baseData = await apiService.minLogin(storeInfo.id); if (baseData != null && baseData.isSuccess) { - SmartDialog.showToast(S.of(context).lingquchenggong); + SmartDialog.showToast(S.of(context).lingquchenggong, alignment: Alignment.center); setState(() { isReceive = false; }); @@ -909,7 +909,7 @@ class _UnionDetailsPage extends State { _loginMin() async { if (storeInfo == null) return; if (!isEnable()) { - SmartDialog.showToast(S.of(context).zanbuzhichixianshangdiancan); + SmartDialog.showToast(S.of(context).zanbuzhichixianshangdiancan, alignment: Alignment.center); return; } BaseData baseData = await apiService.minLogin(storeInfo.id); diff --git a/lib/view_widget/my_appbar.dart b/lib/view_widget/my_appbar.dart index da223496..874a96e0 100644 --- a/lib/view_widget/my_appbar.dart +++ b/lib/view_widget/my_appbar.dart @@ -1,8 +1,11 @@ import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; class MyAppBar extends StatelessWidget implements PreferredSizeWidget { final Function onTap; final Widget action; + final Widget bottom; + final Widget titleChild; final String title; final double titleSize; final Color titleColor; @@ -10,16 +13,20 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { final Color background; final Size preferredSize; final double toolbarHeight; + final bool leading; MyAppBar({ Key key, this.onTap, this.action, + this.bottom, + this.titleChild, this.title, this.toolbarHeight, this.background = const Color(0xFFF7F7F7), this.leadingColor = Colors.black, this.titleColor = Colors.black, this.titleSize = 18, + this.leading = true, }) : preferredSize = Size.fromHeight(toolbarHeight ?? kToolbarHeight), super(key: key); @@ -28,13 +35,13 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { return AppBar( backgroundColor: background, elevation: 0, - leading: GestureDetector( + leading: leading ? GestureDetector( onTap: () { Navigator.of(context).pop(); }, child: Container( alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10), + margin: EdgeInsets.only(left: 10.w), padding: EdgeInsets.all(6), child: Icon( Icons.arrow_back_ios, @@ -42,12 +49,12 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { size: 24, ), ), - ), + ) : Container(), titleSpacing: 2, centerTitle: false, - leadingWidth: 56, - title: (title == null || title == "") - ? null + leadingWidth: leading ? 56.w : 10.w, + title: ((title == null || title == "") && titleChild != null) + ? titleChild : Text( title, style: TextStyle( @@ -66,6 +73,7 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { ), ) ], + bottom: bottom, ); } } diff --git a/lib/view_widget/pay_input_view.dart b/lib/view_widget/pay_input_view.dart index 5e0c48b4..c2ac4a25 100644 --- a/lib/view_widget/pay_input_view.dart +++ b/lib/view_widget/pay_input_view.dart @@ -3,6 +3,8 @@ import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/view_widget/keyboard/custom_password_field_widget.dart'; import 'package:huixiang/view_widget/keyboard/keyboard_widget.dart'; import 'package:huixiang/view_widget/keyboard/pay_password.dart' as keyevent; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; class PayInputWidget extends StatefulWidget { @override @@ -16,31 +18,12 @@ class _PayInputWidget extends State { Widget build(BuildContext context) { var height = (MediaQuery.of(context).size.width - (20 * 7.0)) / 6.0; return Scaffold( - appBar: AppBar( - centerTitle: true, - title: Text( - S.of(context).shuruzhifumima, - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.bold, - color: Color(0xFF353535), - ), - ), - backgroundColor: Colors.white, - elevation: 0, - leading: GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - margin: EdgeInsets.only(left: 25), - child: Icon( - Icons.arrow_back_ios, - color: Colors.black, - size: 24, - ), - ), - ), + appBar: MyAppBar( + title: S.of(context).shuruzhifumima, + titleSize: 14.sp, + titleColor: Color(0xFF353535), + background: Colors.white, + leadingColor: Colors.black, ), body: Container( color: Color(0xFFD5D7DD).withAlpha(237),