diff --git a/lib/address/edit_address_page.dart b/lib/address/edit_address_page.dart index eb78c08c..b7e550f5 100644 --- a/lib/address/edit_address_page.dart +++ b/lib/address/edit_address_page.dart @@ -170,19 +170,19 @@ class _EditAddressPage extends State { String city = addressController.text; String address = houseNumberController.text; if (name == null || name == "") { - SmartDialog.showToast(S.of(context).shouhuorenxingming); + SmartDialog.showToast(S.of(context).shouhuorenxingming, alignment: Alignment.center); return; } if (mobile == null || mobile == "") { - SmartDialog.showToast(S.of(context).shouhuorenshoujihao); + SmartDialog.showToast(S.of(context).shouhuorenshoujihao, alignment: Alignment.center); return; } if (city == null || city == "") { - SmartDialog.showToast(S.of(context).shurushouhuorendizhi); + SmartDialog.showToast(S.of(context).shurushouhuorendizhi, alignment: Alignment.center); return; } if (address == null || address == "") { - SmartDialog.showToast(S.of(context).shouhuorenxiangxidizhi); + SmartDialog.showToast(S.of(context).shouhuorenxiangxidizhi, alignment: Alignment.center); return; } BaseData baseData; @@ -220,7 +220,7 @@ class _EditAddressPage extends State { if (baseData != null && baseData.isSuccess) { SmartDialog.showToast(preAddress == null ? S.of(context).baocunchenggong - : S.of(context).xiugaichenggong); + : S.of(context).xiugaichenggong, alignment: Alignment.center); Navigator.of(context).pop(); } } diff --git a/lib/home/points_mall_page.dart b/lib/home/points_mall_page.dart index 1de6b28e..1a609062 100644 --- a/lib/home/points_mall_page.dart +++ b/lib/home/points_mall_page.dart @@ -400,22 +400,17 @@ class _PointsMallPage extends State mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.end, children: [ - // 兑换数量 - // Text( - // S.of(context).yiduihuanjian("${goods.sales}万"), - // style: TextStyle( - // color: Color(0xFFA29E9E), - // fontSize: 10.sp, - // ), - // ), - Text( - S.of(context).yuan_(goods.worth), - style: TextStyle( - color: Color(0xFF585858), - decoration: TextDecoration.lineThrough, - decorationColor: Color(0xFF585858), - fontSize: 12.sp, + Expanded( + child: Text( + S.of(context).yuan_(goods.worth), + style: TextStyle( + color: Color(0xFF585858), + decoration: TextDecoration.lineThrough, + decorationColor: Color(0xFF585858), + fontSize: 12.sp, + ), ), + flex: 1, ), Text( S.of(context).jifen_(goods.price), @@ -457,17 +452,10 @@ class _PointsMallPage extends State return InkWell( onTap: () { SharedPreferences.getInstance().then((value) { - if (value.getString("token") == null) { - SmartDialog.show( - widget: LoginTips( - click: () { - value.clear(); - Navigator.of(context).pushNamed('/router/login_page', - arguments: {"login": "login"}); - }, - ), - clickBgDismissTemp: false, - ); + if (value.getString("token") == null || + value.getString("token") == "") { + Navigator.of(context) + .pushNamed('/router/login_page', arguments: {"login": "login"}); } }); }, @@ -477,16 +465,16 @@ class _PointsMallPage extends State children: [ MImage( userinfo != null ? userinfo.headimg : "", - width: 50, + width: 50.w, height: 50.h, radius: BorderRadius.all(Radius.circular(100)), fit: BoxFit.cover, - errorSrc: "assets/image/default_1.png", - fadeSrc: "assets/image/default_1.png", + errorSrc: "assets/image/default_user.png", + fadeSrc: "assets/image/default_user.png", ), Expanded( child: Container( - margin: EdgeInsets.only(left: 15), + margin: EdgeInsets.only(left: 15.w), height: 50.h, child: Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, @@ -551,7 +539,7 @@ class _PointsMallPage extends State color: Colors.black, ) : Container( - margin: EdgeInsets.only(left: 15), + margin: EdgeInsets.only(left: 15.w), height: 50.h, child: Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, @@ -560,7 +548,7 @@ class _PointsMallPage extends State Text( S.of(context).yiyoujifen, style: TextStyle( - fontSize: 12, + fontSize: 12.sp, fontWeight: FontWeight.bold, color: Color(0xFF4C4C4C), ), @@ -571,7 +559,7 @@ class _PointsMallPage extends State Text( (userinfo != null) ? "${userinfo.points}" : "", style: TextStyle( - fontSize: 16, + fontSize: 16.sp, color: Color(0xFFF8BA61), fontWeight: FontWeight.bold, ), @@ -587,43 +575,47 @@ class _PointsMallPage extends State banner() { return Container( - margin: EdgeInsets.only(top: 16), + margin: EdgeInsets.only(top: 16.h), child: AspectRatio( aspectRatio: 2.0, child: Swiper( - pagination: SwiperPagination( - alignment: Alignment.bottomCenter, - builder: DotSwiperPaginationBuilder( - size: 8, - activeSize: 8, - space: 5, - activeColor: Colors.black, - color: Colors.black.withAlpha(76))), - viewportFraction: 0.7, - scale: 0.7, - loop: false, - itemBuilder: (context, position) { - return InkWell( - onTap: () { - bannerClick(bannerData[position]); - }, - child: Container( - margin: EdgeInsets.only(bottom: 40.h), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(8))), - child: MImage( - bannerData != null && position < bannerData.length - ? bannerData[position].imgUrl - : "", - radius: BorderRadius.circular(8), - fit: BoxFit.cover, - errorSrc: "assets/image/default_2_1.png", - fadeSrc: "assets/image/default_2_1.png", - ), + pagination: SwiperPagination( + alignment: Alignment.bottomCenter, + builder: DotSwiperPaginationBuilder( + size: 8, + activeSize: 8, + space: 5, + activeColor: Colors.black, + color: Colors.black.withAlpha(76), + ), + ), + viewportFraction: 0.7, + scale: 0.7, + loop: false, + itemBuilder: (context, position) { + return InkWell( + onTap: () { + bannerClick(bannerData[position]); + }, + child: Container( + margin: EdgeInsets.only(bottom: 40.h), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), ), - ); - }, - itemCount: bannerData != null ? bannerData.length : 1), + child: MImage( + bannerData != null && position < bannerData.length + ? bannerData[position].imgUrl + : "", + radius: BorderRadius.circular(8), + fit: BoxFit.cover, + errorSrc: "assets/image/default_2_1.png", + fadeSrc: "assets/image/default_2_1.png", + ), + ), + ); + }, + itemCount: bannerData != null ? bannerData.length : 1, + ), ), ); }