Browse Source

Merge branch 'master' into dev

# Conflicts:
#	lib/address/edit_address_page.dart
#	lib/generated/intl/messages_en.dart
#	lib/generated/l10n.dart
#	lib/home/points_mall_page.dart
#	lib/l10n/intl_en.arb
#	lib/l10n/intl_zh_CN.arb
#	lib/l10n/intl_zh_Hans_CN.arb
#	lib/l10n/intl_zh_Hant_CN.arb
#	lib/l10n/intl_zh_TW.arb
#	lib/mine/mine_page.dart
null_safety
w-R 4 years ago
parent
commit
5095392f9d
  1. 10
      lib/address/edit_address_page.dart
  2. 54
      lib/home/points_mall_page.dart

10
lib/address/edit_address_page.dart

@ -170,19 +170,19 @@ class _EditAddressPage extends State<EditAddressPage> {
String city = addressController.text; String city = addressController.text;
String address = houseNumberController.text; String address = houseNumberController.text;
if (name == null || name == "") { if (name == null || name == "") {
SmartDialog.showToast(S.of(context).shouhuorenxingming); SmartDialog.showToast(S.of(context).shouhuorenxingming, alignment: Alignment.center);
return; return;
} }
if (mobile == null || mobile == "") { if (mobile == null || mobile == "") {
SmartDialog.showToast(S.of(context).shouhuorenshoujihao); SmartDialog.showToast(S.of(context).shouhuorenshoujihao, alignment: Alignment.center);
return; return;
} }
if (city == null || city == "") { if (city == null || city == "") {
SmartDialog.showToast(S.of(context).shurushouhuorendizhi); SmartDialog.showToast(S.of(context).shurushouhuorendizhi, alignment: Alignment.center);
return; return;
} }
if (address == null || address == "") { if (address == null || address == "") {
SmartDialog.showToast(S.of(context).shouhuorenxiangxidizhi); SmartDialog.showToast(S.of(context).shouhuorenxiangxidizhi, alignment: Alignment.center);
return; return;
} }
BaseData baseData; BaseData baseData;
@ -220,7 +220,7 @@ class _EditAddressPage extends State<EditAddressPage> {
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
SmartDialog.showToast(preAddress == null SmartDialog.showToast(preAddress == null
? S.of(context).baocunchenggong ? S.of(context).baocunchenggong
: S.of(context).xiugaichenggong); : S.of(context).xiugaichenggong, alignment: Alignment.center);
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
} }

54
lib/home/points_mall_page.dart

@ -400,15 +400,8 @@ class _PointsMallPage extends State<PointsMallPage>
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
// Expanded(
// Text( child: Text(
// S.of(context).yiduihuanjian("${goods.sales}"),
// style: TextStyle(
// color: Color(0xFFA29E9E),
// fontSize: 10.sp,
// ),
// ),
Text(
S.of(context).yuan_(goods.worth), S.of(context).yuan_(goods.worth),
style: TextStyle( style: TextStyle(
color: Color(0xFF585858), color: Color(0xFF585858),
@ -417,6 +410,8 @@ class _PointsMallPage extends State<PointsMallPage>
fontSize: 12.sp, fontSize: 12.sp,
), ),
), ),
flex: 1,
),
Text( Text(
S.of(context).jifen_(goods.price), S.of(context).jifen_(goods.price),
style: TextStyle( style: TextStyle(
@ -457,17 +452,10 @@ class _PointsMallPage extends State<PointsMallPage>
return InkWell( return InkWell(
onTap: () { onTap: () {
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null) { if (value.getString("token") == null ||
SmartDialog.show( value.getString("token") == "") {
widget: LoginTips( Navigator.of(context)
click: () { .pushNamed('/router/login_page', arguments: {"login": "login"});
value.clear();
Navigator.of(context).pushNamed('/router/login_page',
arguments: {"login": "login"});
},
),
clickBgDismissTemp: false,
);
} }
}); });
}, },
@ -477,16 +465,16 @@ class _PointsMallPage extends State<PointsMallPage>
children: [ children: [
MImage( MImage(
userinfo != null ? userinfo.headimg : "", userinfo != null ? userinfo.headimg : "",
width: 50, width: 50.w,
height: 50.h, height: 50.h,
radius: BorderRadius.all(Radius.circular(100)), radius: BorderRadius.all(Radius.circular(100)),
fit: BoxFit.cover, fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png", errorSrc: "assets/image/default_user.png",
fadeSrc: "assets/image/default_1.png", fadeSrc: "assets/image/default_user.png",
), ),
Expanded( Expanded(
child: Container( child: Container(
margin: EdgeInsets.only(left: 15), margin: EdgeInsets.only(left: 15.w),
height: 50.h, height: 50.h,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
@ -551,7 +539,7 @@ class _PointsMallPage extends State<PointsMallPage>
color: Colors.black, color: Colors.black,
) )
: Container( : Container(
margin: EdgeInsets.only(left: 15), margin: EdgeInsets.only(left: 15.w),
height: 50.h, height: 50.h,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
@ -560,7 +548,7 @@ class _PointsMallPage extends State<PointsMallPage>
Text( Text(
S.of(context).yiyoujifen, S.of(context).yiyoujifen,
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Color(0xFF4C4C4C), color: Color(0xFF4C4C4C),
), ),
@ -571,7 +559,7 @@ class _PointsMallPage extends State<PointsMallPage>
Text( Text(
(userinfo != null) ? "${userinfo.points}" : "", (userinfo != null) ? "${userinfo.points}" : "",
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16.sp,
color: Color(0xFFF8BA61), color: Color(0xFFF8BA61),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@ -587,7 +575,7 @@ class _PointsMallPage extends State<PointsMallPage>
banner() { banner() {
return Container( return Container(
margin: EdgeInsets.only(top: 16), margin: EdgeInsets.only(top: 16.h),
child: AspectRatio( child: AspectRatio(
aspectRatio: 2.0, aspectRatio: 2.0,
child: Swiper( child: Swiper(
@ -598,7 +586,9 @@ class _PointsMallPage extends State<PointsMallPage>
activeSize: 8, activeSize: 8,
space: 5, space: 5,
activeColor: Colors.black, activeColor: Colors.black,
color: Colors.black.withAlpha(76))), color: Colors.black.withAlpha(76),
),
),
viewportFraction: 0.7, viewportFraction: 0.7,
scale: 0.7, scale: 0.7,
loop: false, loop: false,
@ -610,7 +600,8 @@ class _PointsMallPage extends State<PointsMallPage>
child: Container( child: Container(
margin: EdgeInsets.only(bottom: 40.h), margin: EdgeInsets.only(bottom: 40.h),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(8))), borderRadius: BorderRadius.circular(8),
),
child: MImage( child: MImage(
bannerData != null && position < bannerData.length bannerData != null && position < bannerData.length
? bannerData[position].imgUrl ? bannerData[position].imgUrl
@ -623,7 +614,8 @@ class _PointsMallPage extends State<PointsMallPage>
), ),
); );
}, },
itemCount: bannerData != null ? bannerData.length : 1), itemCount: bannerData != null ? bannerData.length : 1,
),
), ),
); );
} }

Loading…
Cancel
Save