Browse Source

新版更改

zyh
w-R 3 years ago
parent
commit
6ef311c739
  1. BIN
      assets/image/2x/invite_friends.webp
  2. BIN
      assets/image/2x/week_coupons.webp
  3. BIN
      assets/image/2x/welfare_spread.webp
  4. BIN
      assets/image/3x/invite_friends.webp
  5. BIN
      assets/image/3x/week_coupons.webp
  6. BIN
      assets/image/3x/welfare_spread.webp
  7. BIN
      assets/image/invite_friends.webp
  8. BIN
      assets/image/week_coupons.webp
  9. BIN
      assets/image/welfare_spread.webp
  10. 6
      lib/home/home_page.dart
  11. 108
      lib/home/home_view/discount_zone.dart
  12. 2
      lib/home/home_view/home_recommend_goods.dart
  13. 621
      lib/home/welfare_page.dart
  14. 15
      lib/order/order_history_page.dart
  15. 15
      lib/order/order_view/order_commodity.dart
  16. 4
      lib/qr/invite_friends.dart
  17. 22
      lib/settlement/settlement_view/settlement_order_commodity.dart
  18. 55
      lib/view_widget/new_coupon_widget.dart

BIN
assets/image/2x/invite_friends.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 KiB

BIN
assets/image/2x/week_coupons.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 14 KiB

BIN
assets/image/2x/welfare_spread.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

BIN
assets/image/3x/invite_friends.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 454 KiB

BIN
assets/image/3x/week_coupons.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 31 KiB

BIN
assets/image/3x/welfare_spread.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

BIN
assets/image/invite_friends.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

BIN
assets/image/week_coupons.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 756 B

After

Width:  |  Height:  |  Size: 756 B

BIN
assets/image/welfare_spread.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

6
lib/home/home_page.dart

@ -508,7 +508,7 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
/// ///
DiscountZone(coupons), DiscountZone(coupons),
/// ///-
HomeRecommendGoods(), HomeRecommendGoods(),
/// ///
@ -578,9 +578,9 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
}, },
child: ClipRRect( child: ClipRRect(
child:Image.asset( child:Image.asset(
"assets/image/icon_story_td.webp", "assets/image/welfare_spread.webp",
width:double.infinity, width:double.infinity,
fit: BoxFit.cover, fit: BoxFit.fill,
height:80.h, height:80.h,
), ),
borderRadius: BorderRadius.circular(6.w), borderRadius: BorderRadius.circular(6.w),

108
lib/home/home_view/discount_zone.dart

@ -34,38 +34,21 @@ class _DiscountZone extends State<DiscountZone> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only(bottom: 12.h, top: 16.h), margin: EdgeInsets.only(top: 24.h),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Padding(padding:EdgeInsets.symmetric(horizontal: 14.w), Padding(padding:EdgeInsets.symmetric(horizontal: 14.w),
child: Row( child: Text(
children: [ "特惠专区",
Expanded(child: style: TextStyle(
Text( color: Color(0xFF0D0D0D),
"特惠专区", fontSize: 15.sp,
style: TextStyle( fontWeight: FontWeight.bold,
color: Color(0xFF0D0D0D), ),
fontSize: 15.sp, )),
fontWeight: FontWeight.bold, if(widget.coupon.length != 0)
),
)),
GestureDetector(
onTap: (){
Navigator.of(context).pushNamed('/router/welfare_page');
},
child: Text(
"更多好券",
style: TextStyle(
color: Color(0xFF4D4D4D),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
)
],
),),
Container( Container(
height: 91, height: 91,
margin: EdgeInsets.only(top: 10), margin: EdgeInsets.only(top: 10),
@ -74,9 +57,14 @@ class _DiscountZone extends State<DiscountZone> {
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
padding: EdgeInsets.symmetric(horizontal: 10), padding: EdgeInsets.symmetric(horizontal: 10),
itemBuilder: (context, position) { itemBuilder: (context, position) {
return discountItem(widget.coupon[position]); return GestureDetector(
onTap: (){
Navigator.of(context).pushNamed('/router/welfare_page');
},
child: discountItem(widget.coupon[position]),
);
}, },
itemCount:widget.coupon.length, itemCount:widget.coupon.length>5?5:widget.coupon.length,
), ),
), ),
], ],
@ -104,8 +92,8 @@ class _DiscountZone extends State<DiscountZone> {
child:Container( child:Container(
margin: EdgeInsets.only(top: 12,bottom: 12), margin: EdgeInsets.only(top: 12,bottom: 12),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded(child: Container( Expanded(child: Container(
child:discountWidget(coupon), child:discountWidget(coupon),
@ -215,23 +203,18 @@ class _DiscountZone extends State<DiscountZone> {
); );
} else if (coupon.bizType == 3) { } else if (coupon.bizType == 3) {
return Column( return Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container( Container(
padding: EdgeInsets.only(bottom:10,top: 7), padding: EdgeInsets.only(bottom:10,top: 7,left: 12),
child: Row( child: Text(
mainAxisAlignment: MainAxisAlignment.center, S.of(context).duihuanquan,
children: [ style: TextStyle(
Text( fontSize: 26.sp,
S.of(context).duihuanquan, fontWeight: MyFontWeight.semi_bold,
style: TextStyle( color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
fontSize: 26.sp, ),
fontWeight: MyFontWeight.semi_bold,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
),
),
],
), ),
), ),
Text( Text(
@ -246,23 +229,18 @@ class _DiscountZone extends State<DiscountZone> {
); );
} else if (coupon.bizType == 5) { } else if (coupon.bizType == 5) {
return Column( return Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container( Container(
padding: EdgeInsets.only(bottom:10,top: 7), padding: EdgeInsets.only(bottom:10,top: 7,left: 12),
child: Row( child: Text(
mainAxisAlignment: MainAxisAlignment.center, S.of(context).duihuanquan,
children: [ style: TextStyle(
Text( fontSize: 26.sp,
S.of(context).duihuanquan, fontWeight: MyFontWeight.semi_bold,
style: TextStyle( color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
fontSize: 30.sp, ),
fontWeight: MyFontWeight.semi_bold,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
),
),
],
), ),
), ),
Text( Text(
@ -277,7 +255,7 @@ class _DiscountZone extends State<DiscountZone> {
); );
} else { } else {
return Column( return Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Row( Row(
@ -302,21 +280,13 @@ class _DiscountZone extends State<DiscountZone> {
Text( Text(
"", "",
style: TextStyle( style: TextStyle(
fontSize: 20.sp, fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060), color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
), ),
), ),
], ],
), ),
Text(
S.of(context).quanchangtongyong,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
),
),
], ],
); );
} }

2
lib/home/home_view/home_recommend_goods.dart

@ -40,7 +40,7 @@ class _HomeRecommendGoods extends State<HomeRecommendGoods> {
borderRadius: BorderRadius.circular(6), borderRadius: BorderRadius.circular(6),
color: Colors.white, color: Colors.white,
), ),
margin: EdgeInsets.only(left: 14.w,right: 14.w,top: 12.h,bottom: 24.h), margin: EdgeInsets.only(left: 14.w,right: 14.w,top: 14.h,bottom: 24.h),
child: ListView.builder( child: ListView.builder(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),

621
lib/home/welfare_page.dart

@ -5,6 +5,7 @@ import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/coupon.dart';
import 'package:huixiang/retrofit/data/goods.dart'; import 'package:huixiang/retrofit/data/goods.dart';
import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
@ -15,6 +16,10 @@ import 'package:huixiang/view_widget/custom_image.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/my_footer.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'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
@ -30,6 +35,9 @@ class _WelfarePage extends State<WelfarePage> {
final RefreshController refreshController = RefreshController(); final RefreshController refreshController = RefreshController();
final ScrollController scrollController = ScrollController(); final ScrollController scrollController = ScrollController();
List<Goods> goods = []; List<Goods> goods = [];
List<Coupon> coupons = [];
// List<Coupon> coupon;
List<List<Coupon>> coupon=[];
String categoryId; String categoryId;
bool orderDesc = true; bool orderDesc = true;
int orderType = 1; int orderType = 1;
@ -41,7 +49,14 @@ class _WelfarePage extends State<WelfarePage> {
SharedPreferences.getInstance().then((value) => { SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(), context: context, token: value.getString("token")), apiService = ApiService(Dio(), context: context, token: value.getString("token")),
queryGoods(), queryGoods(),
queryCoupon(),
}); });
for(var i = 0;i < coupons.length~/3+1;i++){
List<Coupon> con = [];
con = coupons.skip(i*3).take((i*3<coupons.length)?3:(coupons.length - (i*3))).toList();
coupon.add(con);
}
} }
queryGoods() async { queryGoods() async {
@ -79,6 +94,35 @@ class _WelfarePage extends State<WelfarePage> {
} }
} }
queryCoupon() async {
BaseData<PageInfo<Coupon>> baseData = await apiService.queryCoupon({
"centre": true,
"pageNum": pageNum,
"pageSize": 10,
"searchKey": "",
"state": 0
}).catchError((onError) {
refreshController.refreshFailed();
refreshController.loadFailed();
});
if (pageNum == 1) coupons.clear();
if (baseData != null && baseData.isSuccess) {
coupons.addAll(baseData.data.list);
refreshController.refreshCompleted();
refreshController.loadComplete();
if (baseData.data.pageNum == baseData.data.pages) {
refreshController.loadNoData();
} else {
pageNum += 1;
}
setState(() {});
} else {
refreshController.refreshFailed();
refreshController.loadFailed();
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Stack( return Stack(
@ -177,7 +221,7 @@ class _WelfarePage extends State<WelfarePage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: EdgeInsets.symmetric(horizontal: 12.w,vertical: 16.h), padding: EdgeInsets.symmetric(horizontal: 17.w,vertical: 16.h),
child: child:
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -221,27 +265,14 @@ class _WelfarePage extends State<WelfarePage> {
return Column( return Column(
children: [ children: [
Container( Container(
// height: 84.h, child: weekList1(),
// child: ListView.builder( // weekList(testList2[position]),
// scrollDirection: Axis.horizontal,
// physics: BouncingScrollPhysics(),
// padding: EdgeInsets.symmetric(horizontal: 12),
// itemCount:3,
// itemBuilder: (context, index) {
// return GestureDetector(
// onTap: () {
//
// },
// child: weekItem(),
// );
// },
// ),
child: weekItem(),
), ),
], ],
); );
}, },
itemCount:3, itemCount:coupon.length,
// testList2.length,
), ),
) )
], ],
@ -287,10 +318,31 @@ class _WelfarePage extends State<WelfarePage> {
); );
} }
Widget weekItem() { List<String> testList = ["1","2","3","4","5","6","7","8","9","10","11"];
List<List<String>> testList2 = [];
Widget weekList(List<String> list){
return Expanded(child: ListView.builder(
padding: EdgeInsets.zero,
itemCount: list.length,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
},
child: weekItem(list[position]),
);
},
));
}
Widget weekItem(String cnt) {
return Container( return Container(
width:double.infinity, width:double.infinity,
height:100.h, height:110.h,
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
fit: BoxFit.fill, fit: BoxFit.fill,
@ -298,12 +350,56 @@ class _WelfarePage extends State<WelfarePage> {
), ),
), ),
padding: EdgeInsets.symmetric(horizontal: 12.w,vertical: 12.h), padding: EdgeInsets.symmetric(horizontal: 12.w,vertical: 12.h),
margin: EdgeInsets.only(bottom:10),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Expanded(child:
Column( Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
cnt,
// "新人满减30元",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF353535),
),
),
SizedBox(height:4.h,),
Text(
"有效期至2022-09-10 12:00:00",
style: TextStyle(
fontSize: 11.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF4D4D4D),
),
),
SizedBox(height:5.h,),
Row(
children: [
Text(
"使用详情",
style: TextStyle(
fontSize: 11.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF4D4D4D),
),
),
Icon(
Icons.keyboard_arrow_right,
color: Color(0xFF4D4D4D),
size: 20,
)
],
),
],
)),
Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text.rich( Text.rich(
@ -336,22 +432,104 @@ class _WelfarePage extends State<WelfarePage> {
color: Color(0xFF32A060), color: Color(0xFF32A060),
), ),
), ),
SizedBox(height: 8,),
Container(
width: 50.w,
height: 19.h,
decoration: BoxDecoration(
color: Color(0xFF32A060),
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(3),
),
alignment: Alignment.center,
child:Text(
"领取",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFFFFFFFF),
),
),
)
], ],
), ),
SizedBox(width: 30,), ],
),
);
}
Widget weekList1(){
return Expanded(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 || coupons[position].bizType == 3) {
Navigator.of(context).pushNamed(
'/router/write_off_page',
arguments: {
"couponId": coupons[position].id,
"coupon": coupons[position].toJson()
});
} else {
showStoreSelector(coupons[position].storeList);
}
}
},
() {
setState((){
coupons[position].isEx = !coupons[position].isEx;
});
},
type: 1,
),
);
},
itemCount: (coupons != null && coupons.length > 0) ? coupons.length : 0,
)
: NoDataView(
src: "assets/image/ka.webp",
isShowBtn: false,
text: S.of(context).haimeiyouyouhuiquankeyilingqu,
fontSize: 16.sp,
));
}
Widget weekItem1() {
return Container(
width:double.infinity,
height:110.h,
decoration: BoxDecoration(
image: DecorationImage(
fit: BoxFit.fill,
image: AssetImage("assets/image/week_coupons.webp"),
),
),
padding: EdgeInsets.symmetric(horizontal: 12.w,vertical: 12.h),
margin: EdgeInsets.only(bottom:10),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(child: Expanded(child:
Column( Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Expanded(child: Text( Text(
"新人满减30元", "新人满减30元",
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF353535), color: Color(0xFF353535),
), ),
)), ),
SizedBox(height:4.h,), SizedBox(height:4.h,),
Text( Text(
"有效期至2022-09-10 12:00:00", "有效期至2022-09-10 12:00:00",
@ -381,29 +559,355 @@ class _WelfarePage extends State<WelfarePage> {
), ),
], ],
)), )),
Container( Column(
width: 50.w, mainAxisAlignment: MainAxisAlignment.spaceAround,
height: 19.h, crossAxisAlignment: CrossAxisAlignment.center,
decoration: BoxDecoration( children: [
color: Color(0xFF32A060), Text.rich(
shape: BoxShape.rectangle, TextSpan(
borderRadius: BorderRadius.circular(3), children: [
), TextSpan(
alignment: Alignment.center, text: "¥",
child:Text( style: TextStyle(
"领取", fontSize: 16.sp,
style: TextStyle( fontWeight: MyFontWeight.semi_bold,
fontSize: 12.sp, color: Color(0xFF32A060),
fontWeight: MyFontWeight.regular, ),
color: Color(0xFFFFFFFF), ),
TextSpan(
text: "30",
style: TextStyle(
fontSize: 26.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF32A060),
),
),
],
),
), ),
), Text(
) "满30.1可用",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF32A060),
),
),
SizedBox(height: 8,),
Container(
width: 50.w,
height: 19.h,
decoration: BoxDecoration(
color: Color(0xFF32A060),
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(3),
),
alignment: Alignment.center,
child:Text(
"领取",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFFFFFFFF),
),
),
)
],
),
], ],
), ),
); );
} }
Widget weekWidget(Coupon coupon) {
if (coupon.bizType == 1) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.baseline,
textBaseline: TextBaseline.alphabetic,
children: [
Text(
"¥",
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.medium,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
),
),
SizedBox(
height: 4.h,
),
Text(
coupon != null
? double.tryParse("${coupon.discountAmount}" ?? "0")
.toInt()
.toString()
: "",
style: TextStyle(
fontSize: 26.sp,
fontWeight: MyFontWeight.semi_bold,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
),
),
],
),
Text(
S.of(context).manyuankeyong(coupon != null
? ("${coupon.fullAmount}" ?? "0")
.toString()
: ""),
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
),
),
],
);
} else if (coupon.bizType == 3) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
padding: EdgeInsets.only(bottom:10,top: 7),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
S.of(context).duihuanquan,
style: TextStyle(
fontSize: 26.sp,
fontWeight: MyFontWeight.semi_bold,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
),
),
],
),
),
Text(
S.of(context).xianshangshiyong,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
),
),
],
);
} else if (coupon.bizType == 5) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
padding: EdgeInsets.only(bottom:10,top: 7),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
S.of(context).duihuanquan,
style: TextStyle(
fontSize: 26.sp,
fontWeight: MyFontWeight.semi_bold,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
),
),
],
),
),
Text(
S.of(context).xianxiashiyong,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
),
),
],
);
} else {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.baseline,
textBaseline: TextBaseline.alphabetic,
children: [
Text(
coupon != null
? "${(coupon.discountPercent / 10.0 >= 10) ? 10 : coupon.discountPercent / 10.0}" ??
"0"
: "",
style: TextStyle(
fontSize: 30.sp,
fontWeight: MyFontWeight.semi_bold,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
),
),
SizedBox(
height: 4.h,
),
Text(
"",
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
),
),
],
),
],
);
}
}
// Widget weekBtn(Coupon coupon) {
// if (type == 1) {
// if (coupon != null && coupon.status == 0) {
// return Align(
// alignment: Alignment.centerRight,
// child: InkWell(
// onTap: () {
// callback(type);
// },
// child: Container(
// padding: EdgeInsets.symmetric(horizontal: 14,vertical: 2),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(3),
// color: Color(0xFF32A060),
// ),
// child: Text(
// S.of(context).lingqu,
// style: TextStyle(
// fontSize: 12.sp,
// fontWeight: MyFontWeight.medium,
// color: Colors.white,
// ),
// ),
// ),
// ),
// );
// } else {
// return Align(
// alignment: Alignment.centerRight,
// child: Container(
// padding: EdgeInsets.symmetric(horizontal:8,vertical: 2),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(3),
// color: Colors.grey,
// ),
// child: Text(
// S.of(context).yilingqu,
// style: TextStyle(
// fontSize: 12.sp,
// fontWeight: MyFontWeight.medium,
// color: Colors.white,
// ),
// ),
// ),
// );
// }
// } else {
// if (coupon != null && coupon.status == 1) {
// return Align(
// alignment: Alignment.centerRight,
// child: InkWell(
// onTap: () {
// callback(type);
// },
// child: Container(
// // width: 56.w,
// height: 19.h,
// // padding: EdgeInsets.symmetric(horizontal:8,vertical: 2),
// decoration: BoxDecoration(
// color: Color(0xFF32A060),
// borderRadius: BorderRadius.circular(3),
// ),
// alignment: Alignment.center,
// child:Text(
// S.of(context).qushiyong,
// maxLines: 1,
// overflow: TextOverflow.ellipsis,
// style: TextStyle(
// fontSize: 12.sp,
// fontWeight: MyFontWeight.regular,
// color: Color(0xFFFFFFFF),
// ),
// ),
// ),
// // Container(
// // padding: EdgeInsets.fromLTRB(16.w, 2.h, 16.w, 2.h),
// // decoration: BoxDecoration(
// // borderRadius: BorderRadius.circular(10.5),
// // color: Color(0xFF32A060),
// // ),
// // child: Text(
// // (coupon.bizType == 5 || coupon.bizType == 3)
// // ? S.of(context).quhexiao
// // : S.of(context).qushiyong,
// // style: TextStyle(
// // fontSize: 12.sp,
// // fontWeight: MyFontWeight.medium,
// // color: Colors.white,
// // ),
// // ),
// // ),
// ),
// );
// } else if (coupon != null && coupon.status == 2) {
// return Align(
// alignment: Alignment.centerRight,
// child: Container(
// padding: EdgeInsets.symmetric(horizontal: 14,vertical: 2),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(3),
// // border: Border.all(
// // width: 1, color: Color(0xFFA0A0A0), style: BorderStyle.solid)
// color: Color(0xFFA0A0A0),
// ),
// child: Text(
// S.of(context).yishiyong,
// style: TextStyle(
// fontSize: 12.sp,
// fontWeight: MyFontWeight.medium,
// color: Colors.white,
// ),
// ),
// ),
// );
// } else {
// return Align(
// alignment: Alignment.centerRight,
// child: Container(
// padding: EdgeInsets.symmetric(horizontal: 14,vertical: 2),
// // decoration: BoxDecoration(
// // borderRadius: BorderRadius.circular(10.5),
// // // border: Border.all(
// // // width: 1, color: Color(0xFFA0A0A0), style: BorderStyle.solid)
// // color: Color(0xFFA0A0A0),
// // ),
// child: Text(
// S.of(context).yishixiao,
// style: TextStyle(
// fontSize: 12.sp,
// fontWeight: MyFontWeight.semi_bold,
// color: Color(0xFFB3B3B3),
// ),
// ),
// ),
// );
// }
// }
// }
/// ///
Widget inviteFriends() { Widget inviteFriends() {
return Container( return Container(
@ -427,10 +931,10 @@ class _WelfarePage extends State<WelfarePage> {
}, },
child:ClipRRect( child:ClipRRect(
child:Image.asset( child:Image.asset(
"assets/image/icon_story_td.webp", "assets/image/welfare_spread.webp",
width:double.infinity, width:double.infinity,
fit: BoxFit.cover, fit: BoxFit.fill,
height:80.h, height:100.h,
), ),
borderRadius: BorderRadius.circular(6.w), borderRadius: BorderRadius.circular(6.w),
), ),
@ -732,5 +1236,32 @@ class _WelfarePage extends State<WelfarePage> {
); );
} }
receiveCoupon(couponId) async {
BaseData baseData = await apiService.receiveCoupon(couponId);
if (baseData != null && baseData.isSuccess) {
queryCoupon();
showAlertDialog();
}
}
showStoreSelector(storeList) {
showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return SelectorStoreWidget(storeList);
},
);
}
showAlertDialog() {
//
showDialog(
context: context,
builder: (BuildContext context) {
return ReceiveSuccess();
},
);
}
} }

15
lib/order/order_history_page.dart

@ -225,6 +225,16 @@ class _OrderHistoryList extends State<OrderHistoryList>
}); });
} }
String orderAllGoods(OrderInfo orderInfo){
int count = 0;
if(orderInfo.productList != null){
orderInfo.productList.forEach((element) {
count += element.buyNum;
});
}
return count.toString();
}
Widget orderItem(OrderInfo orderInfo) { Widget orderItem(OrderInfo orderInfo) {
return Container( return Container(
margin: EdgeInsets.fromLTRB(16.w, 8.h, 16.w, 8.h), margin: EdgeInsets.fromLTRB(16.w, 8.h, 16.w, 8.h),
@ -415,10 +425,7 @@ class _OrderHistoryList extends State<OrderHistoryList>
), ),
), ),
TextSpan( TextSpan(
text: (orderInfo != null && text: orderAllGoods(orderInfo),
orderInfo.productList != null)
? "${orderInfo.productList.length}"
: "0",
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,

15
lib/order/order_view/order_commodity.dart

@ -389,6 +389,16 @@ class _OrderCommodity extends State<OrderCommodity> {
); );
} }
String buyNumAllGoods(){
int count = 0;
if(widget.orderInfo != null){
widget.orderInfo.productList.forEach((element) {
count += element.buyNum;
});
}
return count.toString();
}
Widget buildTotalPrice() { Widget buildTotalPrice() {
return Container( return Container(
margin: EdgeInsets.only(top: 7.h, bottom: 11.h), margin: EdgeInsets.only(top: 7.h, bottom: 11.h),
@ -399,10 +409,7 @@ class _OrderCommodity extends State<OrderCommodity> {
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
S.of(context).gongjijianshangpin((widget.orderInfo != null && S.of(context).gongjijianshangpin(buyNumAllGoods()),
widget.orderInfo.productList != null)
? widget.orderInfo.productList.length
: "0"),
style: TextStyle( style: TextStyle(
fontSize: 10.sp, fontSize: 10.sp,
color: Color(0xFFA29E9E), color: Color(0xFFA29E9E),

4
lib/qr/invite_friends.dart

@ -203,10 +203,10 @@ class _InviteFriends extends State<InviteFriends> {
child:Column( child:Column(
children: [ children: [
Image.asset( Image.asset(
"assets/image/icon_story_td.webp", "assets/image/invite_friends.webp",
height: 300.h, height: 300.h,
width:double.infinity, width:double.infinity,
fit: BoxFit.cover, fit: BoxFit.fill,
), ),
SizedBox(height: 12.h,), SizedBox(height: 12.h,),
Container( Container(

22
lib/settlement/settlement_view/settlement_order_commodity.dart

@ -318,6 +318,20 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
); );
} }
String countAllGoods(){
int count = 0;
if(widget.minOrderInfo != null){
widget.minOrderInfo.orderProductVOList.forEach((element) {
count += element.buyNum;
});
}else if(widget.settleOrderInfo != null){
widget.settleOrderInfo.orderProductList.forEach((element) {
count += element.buyNum;
});
}
return count.toString();
}
Widget buildTotalPrice() { Widget buildTotalPrice() {
return Container( return Container(
margin: EdgeInsets.only(top: 7.h, bottom: 11.h), margin: EdgeInsets.only(top: 7.h, bottom: 11.h),
@ -328,13 +342,7 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
S.of(context).gongjijianshangpin((widget.minOrderInfo != null) S.of(context).gongjijianshangpin(countAllGoods()),
? ((widget.minOrderInfo != null)
? widget.minOrderInfo.orderProductVOList.length
: "0")
: (widget.settleOrderInfo != null)
? widget.settleOrderInfo.orderProductList.length
: "0"),
style: TextStyle( style: TextStyle(
fontSize: 10.sp, fontSize: 10.sp,
color: Color(0xFFA29E9E), color: Color(0xFFA29E9E),

55
lib/view_widget/new_coupon_widget.dart

@ -381,9 +381,10 @@ class NewCouponWidget extends StatelessWidget {
///ui ///ui
Widget homeCoupon(BuildContext context) { Widget homeCoupon(BuildContext context) {
return Container( return Container(
height: 100.h, height: 110.h,
width: double.infinity, width: double.infinity,
margin: EdgeInsets.fromLTRB(14.w, 6.h, 14.w, 6.h), margin: EdgeInsets.fromLTRB(14.w, 6.h, 14.w, 6.h),
padding:EdgeInsets.symmetric(horizontal: 12),
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
fit: BoxFit.fill, fit: BoxFit.fill,
@ -394,22 +395,8 @@ class NewCouponWidget extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Expanded( Expanded(child: Container(
flex: 1, margin: EdgeInsets.only(top: 12,bottom: 12),
child:Container(
margin: EdgeInsets.only(top: 12,bottom: 12),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(child: Container(
child:homeWidget(context),
)),
],
),
)),
Container(
margin: EdgeInsets.only(top: 12,left: 12,bottom: 12),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -472,13 +459,16 @@ class NewCouponWidget extends StatelessWidget {
) )
], ],
), ),
), )),
Column( Column(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded(child: Container(
child:homeWidget(context),
)),
Container( Container(
margin: EdgeInsets.only(right:12.w,bottom: 12), margin: EdgeInsets.only(bottom: 12),
child: homeBtn(context), child: homeBtn(context),
) )
], ],
@ -539,7 +529,7 @@ class NewCouponWidget extends StatelessWidget {
); );
} else if (coupon.bizType == 3) { } else if (coupon.bizType == 3) {
return Column( return Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container( Container(
@ -570,7 +560,7 @@ class NewCouponWidget extends StatelessWidget {
); );
} else if (coupon.bizType == 5) { } else if (coupon.bizType == 5) {
return Column( return Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container( Container(
@ -581,7 +571,7 @@ class NewCouponWidget extends StatelessWidget {
Text( Text(
S.of(context).duihuanquan, S.of(context).duihuanquan,
style: TextStyle( style: TextStyle(
fontSize: 30.sp, fontSize: 26.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060), color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
), ),
@ -601,7 +591,7 @@ class NewCouponWidget extends StatelessWidget {
); );
} else { } else {
return Column( return Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Row( Row(
@ -633,14 +623,6 @@ class NewCouponWidget extends StatelessWidget {
), ),
], ],
), ),
Text(
S.of(context).quanchangtongyong,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
),
),
], ],
); );
} }
@ -676,7 +658,7 @@ class NewCouponWidget extends StatelessWidget {
return Align( return Align(
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
child: Container( child: Container(
padding: EdgeInsets.symmetric(horizontal: 14,vertical: 2), padding: EdgeInsets.symmetric(horizontal:8,vertical: 2),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(3), borderRadius: BorderRadius.circular(3),
color: Colors.grey, color: Colors.grey,
@ -701,15 +683,16 @@ class NewCouponWidget extends StatelessWidget {
callback(type); callback(type);
}, },
child: Container( child: Container(
width: 56.w, // width: 56.w,
height: 19.h, height: 19.h,
// padding: EdgeInsets.symmetric(horizontal:8,vertical: 2),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFF32A060), color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(3), borderRadius: BorderRadius.circular(3),
), ),
alignment: Alignment.center, alignment: Alignment.center,
child:Text( child:Text(
"立即使用", S.of(context).qushiyong,
maxLines: 1, maxLines: 1,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(

Loading…
Cancel
Save