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. 124
      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();
} }
} }

124
lib/home/points_mall_page.dart

@ -400,22 +400,17 @@ 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}"), S.of(context).yuan_(goods.worth),
// style: TextStyle( style: TextStyle(
// color: Color(0xFFA29E9E), color: Color(0xFF585858),
// fontSize: 10.sp, decoration: TextDecoration.lineThrough,
// ), decorationColor: Color(0xFF585858),
// ), fontSize: 12.sp,
Text( ),
S.of(context).yuan_(goods.worth),
style: TextStyle(
color: Color(0xFF585858),
decoration: TextDecoration.lineThrough,
decorationColor: Color(0xFF585858),
fontSize: 12.sp,
), ),
flex: 1,
), ),
Text( Text(
S.of(context).jifen_(goods.price), S.of(context).jifen_(goods.price),
@ -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,43 +575,47 @@ 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(
pagination: SwiperPagination( pagination: SwiperPagination(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
builder: DotSwiperPaginationBuilder( builder: DotSwiperPaginationBuilder(
size: 8, size: 8,
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, ),
scale: 0.7, ),
loop: false, viewportFraction: 0.7,
itemBuilder: (context, position) { scale: 0.7,
return InkWell( loop: false,
onTap: () { itemBuilder: (context, position) {
bannerClick(bannerData[position]); return InkWell(
}, onTap: () {
child: Container( bannerClick(bannerData[position]);
margin: EdgeInsets.only(bottom: 40.h), },
decoration: BoxDecoration( child: Container(
borderRadius: BorderRadius.all(Radius.circular(8))), margin: EdgeInsets.only(bottom: 40.h),
child: MImage( decoration: BoxDecoration(
bannerData != null && position < bannerData.length borderRadius: BorderRadius.circular(8),
? bannerData[position].imgUrl
: "",
radius: BorderRadius.circular(8),
fit: BoxFit.cover,
errorSrc: "assets/image/default_2_1.png",
fadeSrc: "assets/image/default_2_1.png",
),
), ),
); child: MImage(
}, bannerData != null && position < bannerData.length
itemCount: bannerData != null ? bannerData.length : 1), ? 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,
),
), ),
); );
} }

Loading…
Cancel
Save