Browse Source

更改

master
w-R 3 years ago
parent
commit
602aa6a773
  1. 32
      lib/mine/manage_address_page.dart
  2. 7
      lib/mine/mine_page.dart
  3. 77
      lib/view_widget/coupon_widget.dart

32
lib/mine/manage_address_page.dart

@ -143,7 +143,7 @@ class _ManageAddressPage extends State<ManageAddressPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
margin: EdgeInsets.only(left: 10), margin: EdgeInsets.only(left: 10.w),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -157,7 +157,7 @@ class _ManageAddressPage extends State<ManageAddressPage> {
), ),
), ),
SizedBox( SizedBox(
height: 16, height: 16.h,
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -167,7 +167,7 @@ class _ManageAddressPage extends State<ManageAddressPage> {
child: IconText( child: IconText(
address.phone, address.phone,
leftImage: "assets/image/icon_address_call.png", leftImage: "assets/image/icon_address_call.png",
iconSize: 16, iconSize: 16.sp,
), ),
), ),
InkWell( InkWell(
@ -183,14 +183,14 @@ class _ManageAddressPage extends State<ManageAddressPage> {
], ],
), ),
SizedBox( SizedBox(
height: 4, height: 4.h,
), ),
IconText( IconText(
"${address.address}", "${address.address}",
isMax: true, isMax: true,
textAxisAlignment: CrossAxisAlignment.start, textAxisAlignment: CrossAxisAlignment.start,
textStyle: TextStyle( textStyle: TextStyle(
fontSize: 14, fontSize: 14.sp,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
color: Color(0xFF353535), color: Color(0xFF353535),
), ),
@ -199,10 +199,10 @@ class _ManageAddressPage extends State<ManageAddressPage> {
iconSize: 16, iconSize: 16,
), ),
SizedBox( SizedBox(
height: 10, height: 10.h,
), ),
Container( Container(
height: 1, height: 1.h,
color: Color(0xFFF2F2F2), color: Color(0xFFF2F2F2),
) )
], ],
@ -227,7 +227,7 @@ class _ManageAddressPage extends State<ManageAddressPage> {
child: Text( child: Text(
"", "",
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14.sp,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
color: address.isDefault color: address.isDefault
? Color(0xFF39B54A) ? Color(0xFF39B54A)
@ -238,12 +238,12 @@ class _ManageAddressPage extends State<ManageAddressPage> {
InkWell( InkWell(
child: Padding( child: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 5, top: 5.h,
), ),
child: Text( child: Text(
"删除", "删除",
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16.sp,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
color: Colors.black, color: Colors.black,
), ),
@ -267,7 +267,7 @@ class _ManageAddressPage extends State<ManageAddressPage> {
return AlertDialog( return AlertDialog(
content: Container( content: Container(
width: MediaQuery.of(context).size.width - 84, width: MediaQuery.of(context).size.width - 84,
height: 110, height: 110.h,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -275,13 +275,13 @@ class _ManageAddressPage extends State<ManageAddressPage> {
Text( Text(
"您确定要删除收货地址吗?", "您确定要删除收货地址吗?",
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.black,
), ),
), ),
SizedBox( SizedBox(
height: 30, height: 30.h,
), ),
Row( Row(
children: [ children: [
@ -290,7 +290,7 @@ class _ManageAddressPage extends State<ManageAddressPage> {
child: BorderText( child: BorderText(
text: "取消", text: "取消",
textColor: Color(0xFF32A060), textColor: Color(0xFF32A060),
fontSize: 16, fontSize: 16.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
borderColor: Color(0xFF32A060), borderColor: Color(0xFF32A060),
radius: 4, radius: 4,
@ -304,7 +304,7 @@ class _ManageAddressPage extends State<ManageAddressPage> {
flex: 1, flex: 1,
), ),
SizedBox( SizedBox(
width: 16, width: 16.w,
), ),
Expanded( Expanded(
child: InkWell( child: InkWell(
@ -314,7 +314,7 @@ class _ManageAddressPage extends State<ManageAddressPage> {
radius: 4, radius: 4,
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
backgroup: Color(0xFF32A060), backgroup: Color(0xFF32A060),
fontSize: 16, fontSize: 16.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
onTap: () { onTap: () {

7
lib/mine/mine_page.dart

@ -10,6 +10,7 @@ import 'package:huixiang/retrofit/data/rank.dart';
import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/data/user_info.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/event_type.dart'; import 'package:huixiang/utils/event_type.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/login_tips.dart'; import 'package:huixiang/view_widget/login_tips.dart';
@ -99,7 +100,9 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
List<Rank> ranks = []; List<Rank> ranks = [];
queryUserInfo() async { queryUserInfo() async {
SmartDialog.showLoading(msg: S.of(context).zhengzaijiazai, animationDurationTemp: Duration(seconds: 1)); SmartDialog.showLoading(
msg: S.of(context).zhengzaijiazai,
animationDurationTemp: Duration(seconds: 1));
BaseData<List<Rank>> rankData = await apiService.rankList(); BaseData<List<Rank>> rankData = await apiService.rankList();
if (rankData != null && rankData.isSuccess) { if (rankData != null && rankData.isSuccess) {
ranks.clear(); ranks.clear();
@ -434,7 +437,7 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
child: Text( child: Text(
text, text,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w500, fontWeight: MyFontWeight.medium,
fontSize: 16.sp, fontSize: 16.sp,
color: Color(0xFF353535), color: Color(0xFF353535),
), ),

77
lib/view_widget/coupon_widget.dart

@ -6,6 +6,7 @@ import 'package:huixiang/retrofit/data/coupon.dart';
import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/round_button.dart'; import 'package:huixiang/view_widget/round_button.dart';
import 'package:huixiang/view_widget/separator.dart'; import 'package:huixiang/view_widget/separator.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class CouponWidget extends StatelessWidget { class CouponWidget extends StatelessWidget {
final GestureTapCallback callback; final GestureTapCallback callback;
@ -43,14 +44,14 @@ class CouponWidget extends StatelessWidget {
), ),
if (coupon.status == 3) if (coupon.status == 3)
Positioned( Positioned(
top: 10, top: 10.h,
right: 0, right: 0,
child: Transform.rotate( child: Transform.rotate(
angle: pi / 5.0, angle: pi / 5.0,
child: Text( child: Text(
S.of(context).yishijiao, // S.of(context).yishijiao, //
style: TextStyle( style: TextStyle(
fontSize: 8, fontSize: 8.sp,
color: Color(0xFF353535), color: Color(0xFF353535),
), ),
), ),
@ -70,29 +71,29 @@ class CouponWidget extends StatelessWidget {
child: Row( child: Row(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(left: 20), margin: EdgeInsets.only(left: 20),
child: MImage( child: MImage(
(coupon == null || (coupon == null ||
coupon.couponImg == null || coupon.couponImg == null ||
coupon.couponImg == "") coupon.couponImg == "")
? "" ? ""
: coupon.couponImg, : coupon.couponImg,
) )
// Image.network( // Image.network(
// width: 60, // width: 60,
// height: 60, // height: 60,
// fit: BoxFit.cover, // fit: BoxFit.cover,
// errorBuilder: (context, error, e) { // errorBuilder: (context, error, e) {
// return Image.asset( // return Image.asset(
// "assets/image/default_1.png"); // "assets/image/default_1.png");
// }, // },
// ), // ),
), ),
Expanded( Expanded(
flex: 1, flex: 1,
child: Container( child: Container(
height: 60, height: 60.h,
margin: EdgeInsets.only(left: 12), margin: EdgeInsets.only(left: 12),
child: Column( child: Column(
mainAxisAlignment: mainAxisAlignment:
@ -109,7 +110,7 @@ class CouponWidget extends StatelessWidget {
coupon.couponName ?? "", coupon.couponName ?? "",
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14, fontSize: 14.sp,
color: Color(0xFF353535), color: Color(0xFF353535),
), ),
), ),
@ -118,12 +119,12 @@ class CouponWidget extends StatelessWidget {
? Row( ? Row(
children: [ children: [
RoundButton( RoundButton(
width: 42, width: 42.w,
height: 21, height: 21.h,
text: text:
S.of(context).lingqu, S.of(context).lingqu,
textColor: Colors.white, textColor: Colors.white,
fontSize: 12, fontSize: 12.sp,
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 2, top: 2,
bottom: 2, bottom: 2,
@ -148,7 +149,7 @@ class CouponWidget extends StatelessWidget {
style: TextStyle( style: TextStyle(
color: Color( color: Color(
0xFF32A060), 0xFF32A060),
fontSize: 12, fontSize: 12.sp,
), ),
), ),
Icon( Icon(
@ -172,7 +173,7 @@ class CouponWidget extends StatelessWidget {
child: Text( child: Text(
coupon.couponDescription ?? "", coupon.couponDescription ?? "",
style: TextStyle( style: TextStyle(
fontSize: 10, fontSize: 10.sp,
color: Color(0xFF4C4C4C), color: Color(0xFF4C4C4C),
), ),
), ),
@ -201,13 +202,17 @@ class CouponWidget extends StatelessWidget {
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: Text( child: Text(
coupon.status == 0 coupon.status == 0
? S.of(context).faxingshijian(coupon.publishStartTime) ? S
.of(context)
.faxingshijian(coupon.publishStartTime)
: coupon.status == 1 : coupon.status == 1
? S.of(context).lingqushijian(coupon.receiveTime) ? S
.of(context)
.lingqushijian(coupon.receiveTime)
: S.of(context).shiyongriqi, : S.of(context).shiyongriqi,
style: TextStyle( style: TextStyle(
color: Color(0xFF727272), color: Color(0xFF727272),
fontSize: 10, fontSize: 10.sp,
), ),
), ),
), ),
@ -252,14 +257,14 @@ class CouponWidget extends StatelessWidget {
"领取成功", "领取成功",
style: TextStyle( style: TextStyle(
color: Color(0xff353535), color: Color(0xff353535),
fontSize: 16, fontSize: 16.sp,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
), ),
), ),
Text( Text(
"您已成功领取优惠劵,请在", "您已成功领取优惠劵,请在",
style: style: TextStyle(
TextStyle(color: Color(0xff353535), fontSize: 14), color: Color(0xff353535), fontSize: 14.sp),
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -269,7 +274,7 @@ class CouponWidget extends StatelessWidget {
"卡包-可使用", "卡包-可使用",
style: TextStyle( style: TextStyle(
color: Color(0xffFF7A1A), color: Color(0xffFF7A1A),
fontSize: 14, fontSize: 14.sp,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
), ),
onTap: callback, onTap: callback,
@ -277,18 +282,18 @@ class CouponWidget extends StatelessWidget {
Text( Text(
"中查看", "中查看",
style: TextStyle( style: TextStyle(
color: Color(0xff353535), fontSize: 14), color: Color(0xff353535), fontSize: 14.sp),
), ),
], ],
), ),
Padding( Padding(
padding: EdgeInsets.only(top: 30), padding: EdgeInsets.only(top: 30.h),
child: RoundButton( child: RoundButton(
width: 130, width: 130.w,
height: 34, height: 34.h,
text: S.of(context).queren, text: S.of(context).queren,
textColor: Colors.white, textColor: Colors.white,
fontSize: 12, fontSize: 12.sp,
callback: () { callback: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },

Loading…
Cancel
Save