Browse Source

首页ui更改;

订单结算优化;
店铺点单滑动更改;
vip ui更改;
dart3_last
wurong 2 years ago
parent
commit
308fc65e0a
  1. BIN
      assets/image/2x/discount.webp
  2. BIN
      assets/image/2x/home_chi.webp
  3. BIN
      assets/image/2x/home_he.webp
  4. BIN
      assets/image/2x/home_lm.webp
  5. BIN
      assets/image/2x/home_recharge.webp
  6. BIN
      assets/image/2x/home_wan.webp
  7. BIN
      assets/image/2x/home_welfare.webp
  8. BIN
      assets/image/2x/vip_card.webp
  9. BIN
      assets/image/2x/vip_shop_bj.webp
  10. BIN
      assets/image/2x/vip_shop_hg.webp
  11. BIN
      assets/image/2x/vip_shop_hx.webp
  12. BIN
      assets/image/2x/vip_shop_qj.webp
  13. BIN
      assets/image/2x/vip_title.webp
  14. BIN
      assets/image/2x/welfare1.webp
  15. BIN
      assets/image/2x/welfare2.webp
  16. BIN
      assets/image/2x/welfare3.webp
  17. BIN
      assets/image/2x/welfare_spread.webp
  18. BIN
      assets/image/3x/discount.webp
  19. BIN
      assets/image/3x/home_chi.webp
  20. BIN
      assets/image/3x/home_he.webp
  21. BIN
      assets/image/3x/home_lm.webp
  22. BIN
      assets/image/3x/home_recharge.webp
  23. BIN
      assets/image/3x/home_wan.webp
  24. BIN
      assets/image/3x/home_welfare.webp
  25. BIN
      assets/image/3x/vip_card.webp
  26. BIN
      assets/image/3x/vip_shop_bj.webp
  27. BIN
      assets/image/3x/vip_shop_hg.webp
  28. BIN
      assets/image/3x/vip_shop_hx.webp
  29. BIN
      assets/image/3x/vip_shop_qj.webp
  30. BIN
      assets/image/3x/vip_title.webp
  31. BIN
      assets/image/3x/welfare1.webp
  32. BIN
      assets/image/3x/welfare2.webp
  33. BIN
      assets/image/3x/welfare3.webp
  34. BIN
      assets/image/3x/welfare_spread.webp
  35. BIN
      assets/image/discount.webp
  36. BIN
      assets/image/home_chi.webp
  37. BIN
      assets/image/home_he.webp
  38. BIN
      assets/image/home_lm.webp
  39. BIN
      assets/image/home_recharge.webp
  40. BIN
      assets/image/home_wan.webp
  41. BIN
      assets/image/home_welfare.webp
  42. BIN
      assets/image/vip_card.webp
  43. BIN
      assets/image/vip_shop_bj.webp
  44. BIN
      assets/image/vip_shop_hg.webp
  45. BIN
      assets/image/vip_shop_hx.webp
  46. BIN
      assets/image/vip_shop_qj.webp
  47. BIN
      assets/image/vip_title.webp
  48. BIN
      assets/image/welfare1.webp
  49. BIN
      assets/image/welfare2.webp
  50. BIN
      assets/image/welfare3.webp
  51. BIN
      assets/image/welfare_spread.webp
  52. 126
      lib/home/home_page.dart
  53. 80
      lib/home/home_view/discount_zone.dart
  54. 61
      lib/home/home_view/shortcut_operation.dart
  55. 2
      lib/home/home_view/top_selling_list.dart
  56. 32
      lib/home/home_view/union_entry.dart
  57. 302
      lib/home/home_view/welfare_core.dart
  58. 79
      lib/home/points_mall_view/points_goods_view.dart
  59. 2
      lib/home/welfare_exchange.dart
  60. 3
      lib/login/new_login_page.dart
  61. 5
      lib/main_page.dart
  62. 4
      lib/mine/mine_page.dart
  63. 13
      lib/order/order_detail_page.dart
  64. 4
      lib/order/order_view/order_info.dart
  65. 2
      lib/retrofit/min_api.g.dart
  66. 3
      lib/retrofit/retrofit_api.dart
  67. 47
      lib/settlement/settlement.dart
  68. 16
      lib/settlement/settlement_view/activity_coupon_remarks.dart
  69. 17
      lib/settlement/settlement_view/pay_method.dart
  70. 34
      lib/settlement/settlement_view/settlement_order_commodity.dart
  71. 20
      lib/store/store_order.dart
  72. 10
      lib/store/store_view/store_order_list.dart
  73. 3
      lib/union/union_page.dart
  74. 3
      lib/vip/vip_page.dart
  75. 302
      lib/vip/vip_view/exclusive_coupon.dart
  76. 114
      lib/vip/vip_view/vip_goods_discount.dart
  77. 247
      lib/vip/vip_view/vip_top.dart

BIN
assets/image/2x/discount.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

BIN
assets/image/2x/home_chi.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

BIN
assets/image/2x/home_he.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
assets/image/2x/home_lm.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
assets/image/2x/home_recharge.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 746 B

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
assets/image/2x/home_wan.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

BIN
assets/image/2x/home_welfare.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
assets/image/2x/vip_card.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 98 KiB

BIN
assets/image/2x/vip_shop_bj.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
assets/image/2x/vip_shop_hg.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 12 KiB

BIN
assets/image/2x/vip_shop_hx.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 11 KiB

BIN
assets/image/2x/vip_shop_qj.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

BIN
assets/image/2x/vip_title.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
assets/image/2x/welfare1.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
assets/image/2x/welfare2.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
assets/image/2x/welfare3.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
assets/image/2x/welfare_spread.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 22 KiB

BIN
assets/image/3x/discount.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 13 KiB

BIN
assets/image/3x/home_chi.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 14 KiB

BIN
assets/image/3x/home_he.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
assets/image/3x/home_lm.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

BIN
assets/image/3x/home_recharge.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 778 B

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
assets/image/3x/home_wan.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

BIN
assets/image/3x/home_welfare.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
assets/image/3x/vip_card.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 204 KiB

BIN
assets/image/3x/vip_shop_bj.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
assets/image/3x/vip_shop_hg.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 21 KiB

BIN
assets/image/3x/vip_shop_hx.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 20 KiB

BIN
assets/image/3x/vip_shop_qj.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 18 KiB

BIN
assets/image/3x/vip_title.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
assets/image/3x/welfare1.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
assets/image/3x/welfare2.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
assets/image/3x/welfare3.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
assets/image/3x/welfare_spread.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

After

Width:  |  Height:  |  Size: 39 KiB

BIN
assets/image/discount.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
assets/image/home_chi.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
assets/image/home_he.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 928 B

BIN
assets/image/home_lm.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 936 B

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
assets/image/home_recharge.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 664 B

After

Width:  |  Height:  |  Size: 814 B

BIN
assets/image/home_wan.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
assets/image/home_welfare.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 842 B

BIN
assets/image/vip_card.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 31 KiB

BIN
assets/image/vip_shop_bj.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
assets/image/vip_shop_hg.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

BIN
assets/image/vip_shop_hx.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
assets/image/vip_shop_qj.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
assets/image/vip_title.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 930 B

BIN
assets/image/welfare1.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
assets/image/welfare2.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
assets/image/welfare3.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
assets/image/welfare_spread.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

126
lib/home/home_page.dart

@ -42,6 +42,7 @@ import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../utils/flutter_utils.dart';
import 'home_view/shortcut_operation.dart'; import 'home_view/shortcut_operation.dart';
class HomePage extends StatefulWidget { class HomePage extends StatefulWidget {
@ -158,6 +159,8 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
final BaseData brand = final BaseData brand =
await apiService.queryHomeBrand().catchError((onError) { await apiService.queryHomeBrand().catchError((onError) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type),
alignment: Alignment.center);
refreshController.refreshFailed(); refreshController.refreshFailed();
}); });
if (brand != null && brand.isSuccess) { if (brand != null && brand.isSuccess) {
@ -377,10 +380,10 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
} }
} }
_onRefresh(){ _onRefresh() async{
queryHome(); await queryHome();
// queryMsgStats(); // queryMsgStats();
queryCoupon(); await queryCoupon();
} }
@override @override
@ -485,83 +488,78 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
}, },
child: SingleChildScrollView( child: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
child: FutureBuilder( child: Column(
future:queryHome(), children: [
builder: (context, snapshot) { ///banner
return Column( HomeBanner(bannerData, controller),
children: [
///banner
HomeBanner(bannerData, controller),
/// ///
UnionEntry((int jpIndex) { UnionEntry((int jpIndex) {
widget.changeTab(1,jpIndex); widget.changeTab(1,jpIndex);
}), }),
/// ///
ShortcutOperation((int jpIndex) { ShortcutOperation((int jpIndex) {
widget.changeTab(1,jpIndex); widget.changeTab(1,jpIndex);
}), }),
///广 ///广
spread(), spread(),
// /// // ///
// SignView(isSigned, (value) { // SignView(isSigned, (value) {
// setState(() { // setState(() {
// isSigned = value; // isSigned = value;
// }); // });
// }), // }),
/// ///
DiscountZone(coupons), DiscountZone(coupons),
///- ///-
HomeRecommendGoods(homeRank), HomeRecommendGoods(homeRank),
/// ///
WelfareCore(), WelfareCore(),
/// ///
TopSellingList(homeRank), TopSellingList(homeRank),
// /// // ///
// QuickOrder(), // QuickOrder(),
// /// // ///
// CouponView(), // CouponView(),
// /// // ///
// FeaturedActivity(), // FeaturedActivity(),
// /// // ///
// HomeIntegralStore(gooods), // HomeIntegralStore(gooods),
///Tab ///Tab
PointsGoodsTitle( PointsGoodsTitle(
gooodsCategorys, gooodsCategorys,
(orderType, orderDesc) { (orderType, orderDesc) {
this.orderType = orderType; this.orderType = orderType;
this.orderDesc = orderDesc; this.orderDesc = orderDesc;
setState(() {}); setState(() {});
}, },
(index) { (index) {
categoryId = gooodsCategorys[index].id; categoryId = gooodsCategorys[index].id;
pageNum = 1; pageNum = 1;
setState(() {}); setState(() {});
}, },
), ),
/// ///
PointGoods( PointGoods(
goods, goods,
(index) { (index) {
_toDetails(index); _toDetails(index);
}, },
), ),
], ],
);
},
), ),
), ),
), ),

80
lib/home/home_view/discount_zone.dart

@ -30,20 +30,36 @@ 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(top: 14.h,), margin: EdgeInsets.only(top:28.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: [
S.of(context).tehuizhuanqu, Expanded(child: Text(
style: TextStyle( S.of(context).tehuizhuanqu,
color: Color(0xFF0D0D0D), style: TextStyle(
fontSize: 15.sp, color: Color(0xFF0D0D0D),
fontWeight: FontWeight.bold, fontSize: 15.sp,
fontWeight: FontWeight.bold,
),
)),
GestureDetector(
onTap: (){
Navigator.of(context).pushNamed('/router/welfare_page');
},
child: Text(
"更多好券",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF4D4D4D),
),
),
), ),
)), ],
),),
if(widget.coupon.length != 0) if(widget.coupon.length != 0)
Container( Container(
height: 120.h, height: 120.h,
@ -99,29 +115,7 @@ class _DiscountZone extends State<DiscountZone> {
fontSize: 14.sp, fontSize: 14.sp,
height: 1.5.h, height: 1.5.h,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: Color(0xFFFFA607), color: Color(0xFF32A060),
),
),
SizedBox(height:5.w),
(coupon.useStartTime == null &&
coupon.useEndTime == null)?
Text(
S.of(context).quantian,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFFFFA607),
),
):Text(
"发放时间: ${coupon.useEndTime.substring(0, coupon.publishStartTime.indexOf(" "))}",
maxLines:1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFFFFA607),
), ),
), ),
], ],
@ -163,7 +157,7 @@ class _DiscountZone extends State<DiscountZone> {
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFFFFFFFF), color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFF32A060),
), ),
), ),
SizedBox( SizedBox(
@ -177,7 +171,7 @@ class _DiscountZone extends State<DiscountZone> {
style: TextStyle( style: TextStyle(
fontSize: 30.sp, fontSize: 30.sp,
fontWeight: FontWeight.w900, fontWeight: FontWeight.w900,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFFFFFFFF), color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFF32A060),
), ),
), ),
], ],
@ -190,7 +184,7 @@ class _DiscountZone extends State<DiscountZone> {
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFFFFFFFF), color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFF32A060),
), ),
), ),
], ],
@ -207,7 +201,7 @@ class _DiscountZone extends State<DiscountZone> {
style: TextStyle( style: TextStyle(
fontSize: 26.sp, fontSize: 26.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFFFFFFFF), color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFF32A060),
), ),
), ),
), ),
@ -216,7 +210,7 @@ class _DiscountZone extends State<DiscountZone> {
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFFFFFFFF), color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFF32A060),
), ),
), ),
], ],
@ -233,7 +227,7 @@ class _DiscountZone extends State<DiscountZone> {
style: TextStyle( style: TextStyle(
fontSize: 26.sp, fontSize: 26.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFFFFFFFF), color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFF32A060),
), ),
), ),
), ),
@ -242,7 +236,7 @@ class _DiscountZone extends State<DiscountZone> {
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFFFFFFFF), color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFF32A060),
), ),
), ),
], ],
@ -262,7 +256,7 @@ class _DiscountZone extends State<DiscountZone> {
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFFFFFFFF), color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFF32A060),
), ),
), ),
SizedBox( SizedBox(
@ -275,7 +269,7 @@ class _DiscountZone extends State<DiscountZone> {
style: TextStyle( style: TextStyle(
fontSize: 28.sp, fontSize: 28.sp,
fontWeight: FontWeight.w900, fontWeight: FontWeight.w900,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFFFFFFFF), color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFF32A060),
), ),
), ),
], ],
@ -300,7 +294,7 @@ class _DiscountZone extends State<DiscountZone> {
style: TextStyle( style: TextStyle(
fontSize: 30.sp, fontSize: 30.sp,
fontWeight: FontWeight.w900, fontWeight: FontWeight.w900,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFFFFFFFF), color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFF32A060),
), ),
), ),
SizedBox( SizedBox(
@ -311,7 +305,7 @@ class _DiscountZone extends State<DiscountZone> {
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFFFFFFFF), color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFF32A060),
), ),
), ),
], ],

61
lib/home/home_view/shortcut_operation.dart

@ -28,9 +28,9 @@ class _ShortcutOperation extends State<ShortcutOperation> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
height: 75.h, height: 70.h,
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only(bottom: 15.h, left: 9.w, right: 9.w), margin: EdgeInsets.only(bottom:28.h, left: 9.w, right: 9.w),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -45,13 +45,7 @@ class _ShortcutOperation extends State<ShortcutOperation> {
margin: EdgeInsets.symmetric(horizontal: 5), margin: EdgeInsets.symmetric(horizontal: 5),
padding: EdgeInsets.all(10.h), padding: EdgeInsets.all(10.h),
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: new LinearGradient( color: Colors.white,
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [
Color(0xFFD1E8D9),
Color(0xFFE4F7EA),
]),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.black.withAlpha(12), color: Colors.black.withAlpha(12),
@ -75,7 +69,7 @@ class _ShortcutOperation extends State<ShortcutOperation> {
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xFF32A060), color: Colors.black,
), ),
), ),
SizedBox(height: 5.h), SizedBox(height: 5.h),
@ -84,17 +78,18 @@ class _ShortcutOperation extends State<ShortcutOperation> {
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
fontSize: 12.sp, fontSize: 12.sp,
color: Color(0xFF61836F), color: Color(0xff4D4D4D),
), ),
), ),
], ],
), ),
SizedBox(width: 3.w), SizedBox(width:16.w),
Expanded( Expanded(
child: Image.asset( child: Image.asset(
"assets/image/home_lm.webp", "assets/image/home_lm.webp",
width: 36.w, width: 24.w,
height: 36.h, height: 31.h,
fit: BoxFit.fill,
), ),
), ),
], ],
@ -111,13 +106,7 @@ class _ShortcutOperation extends State<ShortcutOperation> {
margin: EdgeInsets.symmetric(horizontal: 5.w), margin: EdgeInsets.symmetric(horizontal: 5.w),
padding: EdgeInsets.all(10.h), padding: EdgeInsets.all(10.h),
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: new LinearGradient( color: Colors.white,
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [
Color(0xFFFAEDCB),
Color(0xFFFAF4E2),
]),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.black.withAlpha(12), color: Colors.black.withAlpha(12),
@ -141,7 +130,7 @@ class _ShortcutOperation extends State<ShortcutOperation> {
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xFFFFBA1B), color: Colors.black,
), ),
), ),
SizedBox(height: 5.h), SizedBox(height: 5.h),
@ -150,17 +139,18 @@ class _ShortcutOperation extends State<ShortcutOperation> {
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
fontSize: 12.sp, fontSize: 12.sp,
color: Color(0xFFA59162), color: Color(0xff4D4D4D),
), ),
), ),
], ],
), ),
SizedBox(width: 3.w), SizedBox(width:16.w),
Expanded( Expanded(
child: Image.asset( child: Image.asset(
"assets/image/home_recharge.webp", "assets/image/home_recharge.webp",
width: 36.w, width: 21.w,
height: 36.h, height: 33.h,
fit: BoxFit.fill,
), ),
), ),
], ],
@ -179,13 +169,7 @@ class _ShortcutOperation extends State<ShortcutOperation> {
margin: EdgeInsets.symmetric(horizontal: 5.w), margin: EdgeInsets.symmetric(horizontal: 5.w),
padding: EdgeInsets.all(10.h), padding: EdgeInsets.all(10.h),
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: new LinearGradient( color: Colors.white,
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [
Color(0xFFFAE5CB),
Color(0xFFFAF1E4),
]),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.black.withAlpha(12), color: Colors.black.withAlpha(12),
@ -209,7 +193,7 @@ class _ShortcutOperation extends State<ShortcutOperation> {
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xFFFF910F), color: Colors.black,
), ),
), ),
SizedBox(height: 5.h), SizedBox(height: 5.h),
@ -218,17 +202,18 @@ class _ShortcutOperation extends State<ShortcutOperation> {
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
fontSize: 12.sp, fontSize: 12.sp,
color: Color(0xFF89755D), color: Color(0xff4D4D4D),
), ),
), ),
], ],
), ),
SizedBox(width: 3.w), SizedBox(width: 16.w),
Expanded( Expanded(
child: Image.asset( child: Image.asset(
"assets/image/home_welfare.webp", "assets/image/home_welfare.webp",
width: 36.w, width: 22.w,
height: 36.h, height: 35.h,
fit: BoxFit.fill,
), ),
), ),
], ],

2
lib/home/home_view/top_selling_list.dart

@ -44,7 +44,7 @@ class _TopSellingList extends State<TopSellingList> {
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
margin: EdgeInsets.only(left: 14.w,right: 14.w,bottom: 14.h), margin: EdgeInsets.only(left: 14.w,right: 14.w,bottom: 24.h),
padding: EdgeInsets.only(left: 12.w,top: 16.h), padding: EdgeInsets.only(left: 12.w,top: 16.h),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,

32
lib/home/home_view/union_entry.dart

@ -32,7 +32,7 @@ class _UnionEntry extends State<UnionEntry> {
return Container( return Container(
height: 130.h, height: 130.h,
width: double.infinity, width: double.infinity,
margin: EdgeInsets.all(14.h), margin: EdgeInsets.symmetric(horizontal:14.w,vertical: 15.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFFFFFFFF), color: Color(0xFFFFFFFF),
boxShadow: [ boxShadow: [
@ -59,15 +59,15 @@ class _UnionEntry extends State<UnionEntry> {
children: [ children: [
Image.asset( Image.asset(
"assets/image/home_chi.webp", "assets/image/home_chi.webp",
fit: BoxFit.cover, fit: BoxFit.fill,
width: 60.w, width: 53.w,
height: 60.h, height: 52.h,
), ),
SizedBox(height:4.h), SizedBox(height:8.h),
Text( Text(
S.of(context).chijiankang, S.of(context).chijiankang,
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.semi_bold,
fontSize: 15.sp, fontSize: 15.sp,
color: Color(0xFF0D0D0D), color: Color(0xFF0D0D0D),
), ),
@ -85,15 +85,15 @@ class _UnionEntry extends State<UnionEntry> {
children: [ children: [
Image.asset( Image.asset(
"assets/image/home_he.webp", "assets/image/home_he.webp",
fit: BoxFit.cover, fit: BoxFit.fill,
width: 60.w, width: 36.w,
height: 60.h, height: 56.h,
), ),
SizedBox(height:4.h), SizedBox(height:8.h),
Text( Text(
S.of(context).hejiankang, S.of(context).hejiankang,
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.semi_bold,
fontSize: 15.sp, fontSize: 15.sp,
color: Color(0xFF0D0D0D), color: Color(0xFF0D0D0D),
), ),
@ -111,15 +111,15 @@ class _UnionEntry extends State<UnionEntry> {
children: [ children: [
Image.asset( Image.asset(
"assets/image/home_wan.webp", "assets/image/home_wan.webp",
fit: BoxFit.cover, fit: BoxFit.fill,
width: 60.w, width: 58.w,
height: 60.h, height: 52.h,
), ),
SizedBox(height:4.h), SizedBox(height:8.h),
Text( Text(
S.of(context).wanjiankang, S.of(context).wanjiankang,
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.semi_bold,
fontSize: 15.sp, fontSize: 15.sp,
color: Color(0xFF0D0D0D), color: Color(0xFF0D0D0D),
), ),

302
lib/home/home_view/welfare_core.dart

@ -29,163 +29,161 @@ class _WelfareCore extends State<WelfareCore> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Column( return Container(
children: [ margin: EdgeInsets.only(left:10.w,right: 10.w,top: 14.h,bottom: 14.h),
Padding(padding:EdgeInsets.symmetric(horizontal: 14.w), child:Column(
child: Row( children: [
children: [ Row(
Expanded(child: children: [
Text( Expanded(child:
S.of(context).fulizhongxin, Text(
style: TextStyle( S.of(context).fulizhongxin,
color: Color(0xFF0D0D0D),
fontSize: 15.sp,
fontWeight: FontWeight.bold,
),
)),
GestureDetector(
onTap: (){
Navigator.of(context).pushNamed('/router/welfare_page');
},
child: Text(
S.of(context).chakangengduo,
style: TextStyle( style: TextStyle(
color: Color(0xFF4D4D4D), color: Color(0xFF0D0D0D),
fontSize: 12.sp, fontSize: 15.sp,
fontWeight: MyFontWeight.regular, fontWeight: FontWeight.bold,
), ),
), )),
) GestureDetector(
], onTap: (){
),), Navigator.of(context).pushNamed('/router/welfare_page');
Container( },
width: double.infinity, child: Text(
margin: EdgeInsets.only(left:10.w,right: 10.w,top: 14.h,bottom: 14.h), S.of(context).chakangengduo,
child: Row( style: TextStyle(
color: Color(0xFF4D4D4D),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
)
],
),
SizedBox(height: 16.w,),
Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Expanded(child: GestureDetector( Expanded(child: GestureDetector(
onTap: (){ onTap: (){
Navigator.of(context).pushNamed('/router/welfare_page'); Navigator.of(context).pushNamed('/router/welfare_page');
}, },
child:Container( child:Container(
width: double.infinity, width: double.infinity,
height:60.h, height:75.h,
padding: EdgeInsets.only(left: 12.w), decoration: BoxDecoration(
decoration: BoxDecoration( image: DecorationImage(
image: DecorationImage( fit: BoxFit.fill,
fit: BoxFit.fill, image: AssetImage("assets/image/welfare1.webp"),
image: AssetImage("assets/image/welfare1.webp"), ),
), ),
), child: Column(
child: Column( mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ Text(
Text( "本周劵包",
"本周劵包", style: TextStyle(
style: TextStyle( fontSize: 14.sp,
fontSize: 14.sp, fontWeight: MyFontWeight.regular,
fontWeight: MyFontWeight.regular, color: Color(0xFFFFFFFF),
color: Color(0xFFFFFFFF), ),
), ),
), SizedBox(height:5.h),
SizedBox(height: 2.h), Text(
Text( "每周三更新劵包",
"每周三更新劵包", style: TextStyle(
style: TextStyle( fontSize: 11.sp,
fontSize: 10.sp, fontWeight: MyFontWeight.regular,
fontWeight: MyFontWeight.regular, color: Color(0xFFFFFFFF),
color: Color(0xFFFFFFFF), ),
), ),
), ],
], ),
), ),
), )),
)), SizedBox(width: 10.w,),
Expanded(child: GestureDetector( Expanded(child: GestureDetector(
onTap: (){ onTap: (){
Navigator.of(context).pushNamed('/router/welfare_page'); Navigator.of(context).pushNamed('/router/welfare_page');
}, },
child:Container( child:Container(
width: double.infinity, width: double.infinity,
height:60.h, height:75.h,
padding: EdgeInsets.only(left: 12.w), decoration: BoxDecoration(
decoration: BoxDecoration( image: DecorationImage(
image: DecorationImage( fit: BoxFit.fill,
fit: BoxFit.fill, image: AssetImage("assets/image/welfare2.webp"),
image: AssetImage("assets/image/welfare2.webp"), ),
), ),
), child: Column(
child: Column( mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ Text(
Text( S.of(context).yaoqinghaoyou,
S.of(context).yaoqinghaoyou, style: TextStyle(
style: TextStyle( fontSize: 14.sp,
fontSize: 14.sp, fontWeight: MyFontWeight.regular,
fontWeight: MyFontWeight.regular, color: Color(0xFFFFFFFF),
color: Color(0xFFFFFFFF), ),
), ),
), SizedBox(height:5.h),
SizedBox(height: 2.h), Text(
Text( "邀请好友得分",
"邀请好友得分", style: TextStyle(
style: TextStyle( fontSize: 11.sp,
fontSize: 10.sp, fontWeight: MyFontWeight.regular,
fontWeight: MyFontWeight.regular, color: Color(0xFFFFFFFF),
color: Color(0xFFFFFFFF), ),
), ),
), ],
], ),
), ),
), ),),
),), SizedBox(width: 10.w,),
Expanded(child: GestureDetector( Expanded(child: GestureDetector(
onTap: (){ onTap: (){
Navigator.of(context).pushNamed('/router/welfare_page'); Navigator.of(context).pushNamed('/router/welfare_page');
}, },
child:Container( child:Container(
width: double.infinity, width: double.infinity,
height:60.h, height:75.h,
padding: EdgeInsets.only(left: 12.w), decoration: BoxDecoration(
decoration: BoxDecoration( image: DecorationImage(
image: DecorationImage( fit: BoxFit.fill,
fit: BoxFit.fill, image: AssetImage("assets/image/welfare3.webp"),
image: AssetImage("assets/image/welfare3.webp"), ),
), ),
), child: Column(
child: Column( mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ Text(
Text( "积分换券",
"积分换券", style: TextStyle(
style: TextStyle( fontSize: 14.sp,
fontSize: 14.sp, fontWeight: MyFontWeight.regular,
fontWeight: MyFontWeight.regular, color: Color(0xFFFFFFFF),
color: Color(0xFFFFFFFF), ),
), ),
), SizedBox(height:5.h),
SizedBox(height: 2.h), Text(
Text( "多种优惠券等你拿",
"多种优惠券等你拿", style: TextStyle(
style: TextStyle( fontSize: 11.sp,
fontSize: 10.sp, fontWeight: MyFontWeight.regular,
fontWeight: MyFontWeight.regular, color: Color(0xFFFFFFFF),
color: Color(0xFFFFFFFF), ),
), ),
), ],
], ),
), ),
), )),
)), ],
],
), ),
), ],
], ),
); );
} }
} }

79
lib/home/points_mall_view/points_goods_view.dart

@ -40,44 +40,51 @@ class _PointGoods extends State<PointGoods> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return (widget.goods == null || widget.goods.length == 0) return Container(
? NoDataView( // decoration: BoxDecoration(
src: "assets/image/xiao_fei.webp", // borderRadius: BorderRadius.circular(4),
isShowBtn: false, // color: Colors.white,
text: "当前分类暂无商品", // ),
fontSize: 16.sp, // margin: EdgeInsets.only(top: 16.h,right: 14.w,left: 14.w),
margin: EdgeInsets.all(60.h), child:(widget.goods == null || widget.goods.length == 0)
) ? NoDataView(
: GridView.builder( src: "assets/image/xiao_fei.webp",
itemCount: widget.goods == null ? 0 : widget.goods.length, isShowBtn: false,
padding: EdgeInsets.only( text: "当前分类暂无商品",
left: 16.w, fontSize: 16.sp,
right: 16.w, margin: EdgeInsets.all(60.h),
top: 18.h, )
bottom: 16.h, : GridView.builder(
), itemCount: widget.goods == null ? 0 : widget.goods.length,
shrinkWrap: true, padding: EdgeInsets.only(
physics: NeverScrollableScrollPhysics(), left: 16.w,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( right: 16.w,
//Widget数量 top: 18.h,
crossAxisCount: 2, bottom: 16.h,
//Widget之间间距 ),
crossAxisSpacing: 11.w, shrinkWrap: true,
//Widget之间间距 physics: NeverScrollableScrollPhysics(),
mainAxisSpacing: 16.w, gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
//Widget宽高比例 0.59 //Widget数量
childAspectRatio: crossAxisCount: 2,
200 / (285 / 2 + (285 / 2) * AppUtils.textScale(context)), //Widget之间间距
), crossAxisSpacing: 11.w,
itemBuilder: (context, index) { //Widget之间间距
return GestureDetector( mainAxisSpacing: 16.w,
onTap: () { //Widget宽高比例 0.59
widget.onTap(index); childAspectRatio:
}, 200 / (285 / 2 + (285 / 2) * AppUtils.textScale(context)),
child: buildItem(widget.goods[index]), ),
); itemBuilder: (context, index) {
return GestureDetector(
onTap: () {
widget.onTap(index);
}, },
child: buildItem(widget.goods[index]),
); );
},
),
);
} }
Widget buildItem(Goods goods) { Widget buildItem(Goods goods) {

2
lib/home/welfare_exchange.dart

@ -264,7 +264,7 @@ class _WelfareExchange extends State<WelfareExchange> with SingleTickerProvider
body: SmartRefresher( body: SmartRefresher(
controller: refreshController, controller: refreshController,
enablePullDown: true, enablePullDown: true,
enablePullUp: true, enablePullUp: false,
physics: ClampingScrollPhysics(), physics: ClampingScrollPhysics(),
header: MyHeader(), header: MyHeader(),
footer: CustomFooter( footer: CustomFooter(

3
lib/login/new_login_page.dart

@ -137,7 +137,8 @@ class _NewLoginPage extends State<NewLoginPage> {
} }
}) })
.catchError((error) { .catchError((error) {
SmartDialog.showToast("$error", alignment: Alignment.center); SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
alignment: Alignment.center);
}); });
} }
} }

5
lib/main_page.dart

@ -84,6 +84,9 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
pageController = PageController(initialPage: widget.arguments != null && widget.arguments["index"] != null ? widget.arguments["index"]:0);
if(widget.arguments != null && widget.arguments["index"] != null)
clickIndex = widget.arguments["index"];
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance.addObserver(this);
EasyLoading.instance EasyLoading.instance
..indicatorType = EasyLoadingIndicatorType.circle ..indicatorType = EasyLoadingIndicatorType.circle
@ -390,7 +393,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
} }
} }
final PageController pageController = PageController(initialPage: 0); PageController pageController;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

4
lib/mine/mine_page.dart

@ -4,6 +4,7 @@ import 'dart:io';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/main.dart'; import 'package:huixiang/main.dart';
import 'package:huixiang/mine/mine_view/mine_calendar.dart'; import 'package:huixiang/mine/mine_view/mine_calendar.dart';
@ -25,6 +26,7 @@ import 'package:shared_preferences/shared_preferences.dart';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../utils/flutter_utils.dart';
import 'mine_view/mine_item.dart'; import 'mine_view/mine_item.dart';
import 'mine_view/mine_view.dart'; import 'mine_view/mine_view.dart';
@ -99,6 +101,8 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
BaseData<List<Rank>> rankData = BaseData<List<Rank>> rankData =
await apiService.rankList().catchError((onError) { await apiService.rankList().catchError((onError) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type),
alignment: Alignment.center);
_refreshController.refreshFailed(); _refreshController.refreshFailed();
}); });
if (rankData != null && rankData.isSuccess) { if (rankData != null && rankData.isSuccess) {

13
lib/order/order_detail_page.dart

@ -1,5 +1,6 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/order/order_view/order_address.dart'; import 'package:huixiang/order/order_view/order_address.dart';
@ -43,6 +44,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
Dio(), Dio(),
context: context, context: context,
token: value.getString("token"), token: value.getString("token"),
showLoading: true
); );
queryDetails(); queryDetails();
}); });
@ -91,7 +93,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
Dio(), Dio(),
context: context, context: context,
token: value.getString("token"), token: value.getString("token"),
showLoading: true showLoading: false
); );
} }
BaseData<OrderInfo> baseData = await apiService BaseData<OrderInfo> baseData = await apiService
@ -221,9 +223,12 @@ class _OrderDetailPage extends State<OrderDetailPage> {
} }
} }
payResult(BaseData baseData) { payResult(BaseData baseData) async{
queryDetails(); await queryDetails();
SmartDialog.showToast(baseData?.msg == "ok" ?"订单支付成功" :baseData?.msg,alignment: Alignment.center); Future.delayed(Duration(milliseconds: 350), () {
EasyLoading.dismiss();
SmartDialog.showToast(baseData?.msg == "ok" ?"订单支付成功" :baseData?.msg,alignment: Alignment.center);
});
} }
statusTitle() { statusTitle() {

4
lib/order/order_view/order_info.dart

@ -53,8 +53,8 @@ class _OrderInfoView extends State<OrderInfoView> {
widget.orderInfo != null widget.orderInfo != null
? widget.orderInfo.notes ?? S.of(context).qingshurubeizhuyaoqiu ? widget.orderInfo.notes ?? S.of(context).qingshurubeizhuyaoqiu
: S.of(context).qingshurubeizhuyaoqiu), : S.of(context).qingshurubeizhuyaoqiu),
orderInfoItem(S.of(context).zhifufangshi, // orderInfoItem(S.of(context).zhifufangshi,
widget.orderInfo != null ? payChannel() : S.of(context).yue), // widget.orderInfo != null ? payChannel() : S.of(context).yue),
], ],
), ),
); );

2
lib/retrofit/min_api.g.dart

@ -123,7 +123,7 @@ class _MinApiService implements MinApiService {
data: _data); data: _data);
final value = BaseData<List<ShoppingCart>>.fromJson( final value = BaseData<List<ShoppingCart>>.fromJson(
_result.data, _result.data,
(json) => (json as List<dynamic>) (json) => ((json??"") == "")?null:(json as List<dynamic>)
.map<ShoppingCart>( .map<ShoppingCart>(
(i) => ShoppingCart.fromJson(i as Map<String, dynamic>)) (i) => ShoppingCart.fromJson(i as Map<String, dynamic>))
.toList()); .toList());

3
lib/retrofit/retrofit_api.dart

@ -18,6 +18,7 @@ import 'package:huixiang/retrofit/data/order_info.dart';
import 'package:huixiang/view_widget/login_tips_dialog.dart'; import 'package:huixiang/view_widget/login_tips_dialog.dart';
import 'package:retrofit/retrofit.dart'; import 'package:retrofit/retrofit.dart';
import '../utils/flutter_utils.dart';
import 'data/achievement_detail_list.dart'; import 'data/achievement_detail_list.dart';
import 'data/activity_pos.dart'; import 'data/activity_pos.dart';
import 'data/address.dart'; import 'data/address.dart';
@ -131,6 +132,8 @@ abstract class ApiService {
if (EasyLoading.isShow) { if (EasyLoading.isShow) {
EasyLoading.dismiss(); EasyLoading.dismiss();
} }
// SmartDialog.showToast(AppUtils.dioErrorTypeToString(e.type),
// alignment: Alignment.center);
debugPrint("\n======================= 错误响应数据 ======================="); debugPrint("\n======================= 错误响应数据 =======================");
debugPrint("type = ${e.type}"); debugPrint("type = ${e.type}");
debugPrint("message = ${e.message}"); debugPrint("message = ${e.message}");

47
lib/settlement/settlement.dart

@ -80,7 +80,8 @@ class _Settlement extends State<Settlement> {
int count1 = 0; int count1 = 0;
String productId; String productId;
bool orderButton = false; bool orderButton = false;
bool useVipPriceSelect = true; bool useVipPriceSelect = false;
bool showVipTips = false;
@override @override
void initState() { void initState() {
@ -116,6 +117,7 @@ class _Settlement extends State<Settlement> {
token: minToken, token: minToken,
tenant: tenant, tenant: tenant,
storeId: storeId, storeId: storeId,
showLoading: true
); );
if (promotions != null && promotions != "" && tableId <= 0) { if (promotions != null && promotions != "" && tableId <= 0) {
queryOrderInfo( queryOrderInfo(
@ -751,7 +753,8 @@ class _Settlement extends State<Settlement> {
minOrderInfo, minOrderInfo,
tableId, tableId,
pageType, pageType,
(coupons != "" || promotions!="") ? false :useVipPriceSelect (coupons != "" || promotions!="") ? false :useVipPriceSelect,
this.showVipTips
), ),
///// /////
@ -776,11 +779,16 @@ class _Settlement extends State<Settlement> {
});}, });},
tableId, tableId,
vipPriceSelect, vipPriceSelect,
(){
setState(() {
this.showVipTips = true;
});
}
), ),
if (placeOrder && joinA != JoinActivity.BargainBug) if (placeOrder && joinA != JoinActivity.BargainBug)
/// ///
PayMethod(payChannelCheck), PayMethod(payChannelCheck,coupons,promotions,useVipPriceSelect),
], ],
), ),
), ),
@ -873,22 +881,23 @@ class _Settlement extends State<Settlement> {
payChannelCheck(int payChannel) { payChannelCheck(int payChannel) {
this.payChannel = payChannel; this.payChannel = payChannel;
if (tableId > 0) { if (tableId > 0) {
queryOrderDetails(parentId); queryOrderDetails(parentId);
} else { } else {
queryOrderInfo( queryOrderInfo(
address?.id, address?.id,
selectedBtn, selectedBtn,
couponListBean?.id, couponListBean?.id,
0, 0,
promotion?.id ?? productId, promotion?.id ?? productId,
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
useVipPriceSelect, useVipPriceSelect,
count1, count1,
payChannel, payChannel,
tableId);} tableId);}
} }
vipPriceSelect(bool useVipPriceSelect) { vipPriceSelect(bool useVipPriceSelect) {

16
lib/settlement/settlement_view/activity_coupon_remarks.dart

@ -1,5 +1,6 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/min_order_info.dart'; import 'package:huixiang/retrofit/data/min_order_info.dart';
import 'package:huixiang/retrofit/data/settleOrderInfo.dart'; import 'package:huixiang/retrofit/data/settleOrderInfo.dart';
@ -20,6 +21,7 @@ class ActivityCouponRemarks extends StatefulWidget {
final String remark; final String remark;
final int tableId; final int tableId;
final Function(bool useVipPriceSelect) vipPriceSelect; final Function(bool useVipPriceSelect) vipPriceSelect;
final Function showVipTips;
ActivityCouponRemarks( ActivityCouponRemarks(
this.couponCart, this.couponCart,
@ -34,6 +36,7 @@ class ActivityCouponRemarks extends StatefulWidget {
this.editRemark, this.editRemark,
this.tableId, this.tableId,
this.vipPriceSelect, this.vipPriceSelect,
this.showVipTips
); );
@override @override
@ -43,7 +46,7 @@ class ActivityCouponRemarks extends StatefulWidget {
} }
class _ActivityCouponRemarks extends State<ActivityCouponRemarks> { class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
bool vipSelect = true; bool vipSelect = false;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -77,7 +80,7 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
if(widget?.settleOrderInfo?.memberVO?.isVip ?? false) // if(widget?.settleOrderInfo?.memberVO?.isVip ?? false)
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -99,8 +102,13 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
activeColor: Color(0xff32A060), activeColor: Color(0xff32A060),
onChanged: (bool value) { onChanged: (bool value) {
setState(() { setState(() {
vipSelect = !vipSelect; if((widget?.settleOrderInfo?.memberVO?.isVip ?? false)){
widget.vipPriceSelect(vipSelect); vipSelect = !vipSelect;
widget.vipPriceSelect(vipSelect);
}else{
widget.showVipTips();
return;
}
}); });
}, },
), ),

17
lib/settlement/settlement_view/pay_method.dart

@ -1,14 +1,20 @@
import 'dart:convert'; import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import '../../view_widget/tips_dialog.dart';
class PayMethod extends StatefulWidget { class PayMethod extends StatefulWidget {
final Function(int payChannel) payChannelCheck; final Function(int payChannel) payChannelCheck;
final String coupons;
final String promotions;
final bool useVipPriceSelect;
PayMethod(this.payChannelCheck); PayMethod(this.payChannelCheck,this.coupons,this.promotions,this.useVipPriceSelect);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -164,6 +170,15 @@ class _PayMethod extends State<PayMethod> {
onTap: () { onTap: () {
setState(() { setState(() {
checkIndex = 3; checkIndex = 3;
if(widget.promotions != "" || widget.coupons != "" || widget.useVipPriceSelect){
SmartDialog.show(
widget: Tips(
() {
},
text: "绿币支付不参与任何活动优惠,请重新选择支付方式",
));
return;
}
}); });
widget.payChannelCheck(5); widget.payChannelCheck(5);
}, },

34
lib/settlement/settlement_view/settlement_order_commodity.dart

@ -18,9 +18,10 @@ class SettlementOrderCommodity extends StatefulWidget {
final MinOrderInfo minOrderInfo; final MinOrderInfo minOrderInfo;
final String pageType; final String pageType;
final bool useVipPriceSelect; final bool useVipPriceSelect;
final bool showVipTips;
SettlementOrderCommodity( SettlementOrderCommodity(
this.isTakeOut, this.settleOrderInfo, this.minOrderInfo,this.tableId,this.pageType,this.useVipPriceSelect); this.isTakeOut, this.settleOrderInfo, this.minOrderInfo,this.tableId,this.pageType,this.useVipPriceSelect,this.showVipTips);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -108,6 +109,36 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
widgets.add(vipItem(Color(0xFFFF7A1A), "VIP优惠", widget?.settleOrderInfo?.discountAmount ?? "")); widgets.add(vipItem(Color(0xFFFF7A1A), "VIP优惠", widget?.settleOrderInfo?.discountAmount ?? ""));
} }
if(widget.showVipTips){
widgets.add(GestureDetector(child: Container(
alignment: Alignment.centerLeft,
child:Text.rich(
TextSpan(
children: [
TextSpan(
text: "您未购买回乡VIP卡,无法享受优惠,",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Colors.black,
),
),
TextSpan(
text: "点击立即购买",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFFFF7A1A),
),
),
],
),
),),onTap: (){
Navigator.of(context)
.pushNamedAndRemoveUntil('/router/main_page', (route) => false,arguments: {"index":2});
},));
}
widgets.add(Container( widgets.add(Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
top: 24.h, top: 24.h,
@ -123,6 +154,7 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
return widgets; return widgets;
} }
Widget commodityItem(OrderProductVOList productList) { Widget commodityItem(OrderProductVOList productList) {
return Container( return Container(
margin: EdgeInsets.only(top: 8.h, bottom: 8.h), margin: EdgeInsets.only(top: 8.h, bottom: 8.h),

20
lib/store/store_order.dart

@ -52,6 +52,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
StoreInfo storeInfo; StoreInfo storeInfo;
List<Activity> activitys; List<Activity> activitys;
StoreOrderListPage storeOrderListPage; StoreOrderListPage storeOrderListPage;
ScrollPhysics scrollPhysics = NeverScrollableScrollPhysics();
ScrollController controller = ScrollController(); ScrollController controller = ScrollController();
ShoppingCart shopCarGoods; ShoppingCart shopCarGoods;
@ -99,9 +100,11 @@ class _StoreOrderPage extends State<StoreOrderPage>
Dio(), Dio(),
context: context, context: context,
token: shared.getString('token'), token: shared.getString('token'),
showLoading: false, showLoading: true,
); );
apiService.minLogin(storeId).catchError((onError) { apiService.minLogin(storeId).catchError((onError) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type),
alignment: Alignment.center);
debugPrint(onError); debugPrint(onError);
}).then((baseData) { }).then((baseData) {
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
@ -121,7 +124,6 @@ class _StoreOrderPage extends State<StoreOrderPage>
token: minToken, token: minToken,
tenant: tenant, tenant: tenant,
storeId: storeId, storeId: storeId,
showLoading: false,
); );
queryMemberInfo(); queryMemberInfo();
@ -272,7 +274,13 @@ class _StoreOrderPage extends State<StoreOrderPage>
controller, controller,
storeInfo != null storeInfo != null
? storeInfo.storeName ? storeInfo.storeName
: ''), : '',(alpha){
setState(() {
if(alpha == 1)
scrollPhysics = BouncingScrollPhysics();
else scrollPhysics = NeverScrollableScrollPhysics();
});
}),
collapseMode: CollapseMode.pin, collapseMode: CollapseMode.pin,
stretchModes: [ stretchModes: [
StretchMode.zoomBackground, StretchMode.zoomBackground,
@ -431,7 +439,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
this.shopCarGoods = value; this.shopCarGoods = value;
setState(() {}); setState(() {});
}); });
}), },scrollPhysics),
///, ///,
// StoreActivity( // StoreActivity(
@ -991,8 +999,9 @@ class _StoreOrderPage extends State<StoreOrderPage>
class Title extends StatefulWidget { class Title extends StatefulWidget {
final ScrollController controller; final ScrollController controller;
final String title; final String title;
final Function scrollChange;
Title(this.controller, this.title); Title(this.controller, this.title,this.scrollChange);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -1023,6 +1032,7 @@ class _Title extends State<Title> {
if (alpha != alphatemp && mounted) { if (alpha != alphatemp && mounted) {
alpha = alphatemp; alpha = alphatemp;
print("object: $alpha"); print("object: $alpha");
widget.scrollChange(alpha);
setState(() {}); setState(() {});
} }
}); });

10
lib/store/store_view/store_order_list.dart

@ -24,6 +24,7 @@ class StoreOrderListPage extends StatefulWidget {
final int tableId; final int tableId;
final Function(String id, int count) queryMiNiDetail; final Function(String id, int count) queryMiNiDetail;
final Function queryShoppingCart; final Function queryShoppingCart;
final ScrollPhysics scrollPhysics;
ShoppingCart shopCarGoods; ShoppingCart shopCarGoods;
@ -38,6 +39,7 @@ class StoreOrderListPage extends StatefulWidget {
this.tableId, this.tableId,
this.queryMiNiDetail, this.queryMiNiDetail,
this.queryShoppingCart, this.queryShoppingCart,
this.scrollPhysics
); );
@override @override
@ -86,7 +88,8 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
token: widget.minToken, token: widget.minToken,
tenant: widget.tenant, tenant: widget.tenant,
storeId: widget.arguments["id"], storeId: widget.arguments["id"],
showLoading: true); showLoading: true
);
BaseData<List<FindMiNiGroupList>> baseData = BaseData<List<FindMiNiGroupList>> baseData =
await minService.findMiNiGroupList({ await minService.findMiNiGroupList({
@ -147,8 +150,9 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
width: MediaQuery.of(context).size.width - 100.w, width: MediaQuery.of(context).size.width - 100.w,
child: ListView.builder( child: ListView.builder(
itemCount: appletProducts == null ? 0 : appletProducts.length, itemCount: appletProducts == null ? 0 : appletProducts.length,
padding: EdgeInsets.only(top: 0),
controller: controller, controller: controller,
physics: BouncingScrollPhysics(), physics: widget.scrollPhysics,
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (context, position) { itemBuilder: (context, position) {
return rightOrderItem(position); return rightOrderItem(position);
@ -211,7 +215,7 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
color: currentIndex != index ? Color(0xFFFAFAFA) : Colors.white, color: currentIndex != index ? Color(0xFFFAFAFA) : Colors.white,
alignment: Alignment.center, alignment: Alignment.center,
padding: EdgeInsets.all(15), padding: EdgeInsets.all(15),
margin: EdgeInsets.only(bottom: (index==appletProducts.length - 1)?35.h:0), // margin: EdgeInsets.only(bottom: (index==appletProducts.length - 1)?35.h:0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,

3
lib/union/union_page.dart

@ -8,6 +8,7 @@ import 'package:flutter_baidu_mapapi_map/flutter_baidu_mapapi_map.dart';
import 'package:flutter_baidu_mapapi_utils/flutter_baidu_mapapi_utils.dart'; import 'package:flutter_baidu_mapapi_utils/flutter_baidu_mapapi_utils.dart';
import 'package:flutter_bmflocation/flutter_bmflocation.dart'; import 'package:flutter_bmflocation/flutter_bmflocation.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/main.dart'; import 'package:huixiang/main.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
@ -31,6 +32,8 @@ import 'package:flutter/rendering.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart';
import '../utils/flutter_utils.dart';
class UnionPage extends StatefulWidget { class UnionPage extends StatefulWidget {
final int initialIndex; final int initialIndex;

3
lib/vip/vip_page.dart

@ -13,6 +13,7 @@ import 'package:shared_preferences/shared_preferences.dart';
import '../retrofit/data/base_data.dart'; import '../retrofit/data/base_data.dart';
import '../retrofit/retrofit_api.dart'; import '../retrofit/retrofit_api.dart';
import '../utils/flutter_utils.dart';
import '../view_widget/my_appbar.dart'; import '../view_widget/my_appbar.dart';
@ -56,6 +57,8 @@ class _VipPageState extends State<VipPage> with AutomaticKeepAliveClientMixin {
} }
BaseData<VipCardHome> baseData = BaseData<VipCardHome> baseData =
await apiService.vipCardIndex().catchError((onError) { await apiService.vipCardIndex().catchError((onError) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type),
alignment: Alignment.center);
_refreshController.refreshFailed();}); _refreshController.refreshFailed();});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
vipHome = baseData.data; vipHome = baseData.data;

302
lib/vip/vip_view/exclusive_coupon.dart

@ -18,7 +18,7 @@ class _ExclusiveCoupon extends State<ExclusiveCoupon> {
return Container( return Container(
margin: EdgeInsets.only(left: 14.w, right: 14.w, bottom: 40.h), margin: EdgeInsets.only(left: 14.w, right: 14.w, bottom: 40.h),
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only(top: 16.h,left: 8.h,bottom: 10.h), padding: EdgeInsets.only(top: 20.h,left: 20.h,bottom: 10.h,right: 20.w),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.w), borderRadius: BorderRadius.circular(6.w),
color: Colors.white, color: Colors.white,
@ -35,98 +35,232 @@ class _ExclusiveCoupon extends State<ExclusiveCoupon> {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Row(
S.of(context).zhuanxiangyouhuiquan, children: [
style: TextStyle( SizedBox(width: 7.w,),
color: Colors.black, Image.asset(
fontSize: 15.sp, "assets/image/vip_title.webp",
fontWeight: MyFontWeight.semi_bold, fit: BoxFit.fill, //
), height:13.h,
width: 27.w,
),
SizedBox(width: 4.w,),
Text(
S.of(context).zhuanxiangyouhuiquan,
style: TextStyle(
color: Colors.black,
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
],
), ),
SizedBox( SizedBox(
height: 10.h, height: 10.h,
), ),
Row( Container(
children: [ height: 124.h,
SizedBox(width: 2.w,), margin: EdgeInsets.only(bottom: 16.h),
Expanded( child: Stack(
child: Stack( children: [
alignment: Alignment.bottomCenter, Image.asset(
children: [ "assets/image/vip_shop_bj.webp",
Image.asset( fit: BoxFit.fill, //
"assets/image/vip_shop_hx.webp", height:double.infinity,
width: 100.w, width: double.infinity,
height: 120.h, ),
fit: BoxFit.fill, Container(
), child: Row(
Padding( mainAxisAlignment: MainAxisAlignment.start,
padding: EdgeInsets.only(bottom: 4.h), crossAxisAlignment: CrossAxisAlignment.center,
child: Text( children: [
"6折饮品券", Expanded(child:Padding(
style: TextStyle( padding:EdgeInsets.only(top:25.h,left: 19.w),
fontSize: 14.sp, child: Column(
fontWeight: MyFontWeight.medium, mainAxisAlignment: MainAxisAlignment.start,
color: Colors.white, crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"海峡姐妹饮品券",
style: TextStyle(
color: Color(0xff32A060),
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
SizedBox(height: 5.h,),
Text.rich(
TextSpan(
children: [
TextSpan(
text: "6",
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 36.sp,
color: Color(0xffFF7E12),
),
),
TextSpan(
text: "",
style: TextStyle(
fontSize: 24.sp,
color: Color(0xffFF7E12),
fontWeight: MyFontWeight.semi_bold,
),
),
],
),
textDirection: TextDirection.ltr,
),
],
),)),
Image.asset(
"assets/image/vip_shop_hx.webp",
fit: BoxFit.fill, //
height:85,
width: 85,
), ),
), ],
), ),
], )
)), ],
SizedBox( ),
width: 14.w, ),
), Container(
Expanded( height: 124.h,
child: Stack( margin: EdgeInsets.only(bottom: 16.h),
alignment: Alignment.bottomCenter, child: Stack(
children: [ children: [
Image.asset( Image.asset(
"assets/image/vip_shop_qj.webp", "assets/image/vip_shop_bj.webp",
width: 100.w, fit: BoxFit.fill, //
height: 120.h, height:double.infinity,
fit: BoxFit.fill, width: double.infinity,
),
Padding(
padding: EdgeInsets.only(bottom: 4.h),
child: Text(
"7折烘焙券",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
),
],
), ),
), Container(
SizedBox( child: Row(
width: 14.w, mainAxisAlignment: MainAxisAlignment.start,
), crossAxisAlignment: CrossAxisAlignment.center,
Expanded( children: [
child: Stack( Expanded(child:Padding(
alignment: Alignment.bottomCenter, padding:EdgeInsets.only(top:25.h,left: 19.w),
children: [ child: Column(
Image.asset( mainAxisAlignment: MainAxisAlignment.start,
"assets/image/vip_shop_hg.webp", crossAxisAlignment: CrossAxisAlignment.start,
width:100.w, children: [
height: 120.h, Text(
fit: BoxFit.fill, "前进麦味烘焙券",
), style: TextStyle(
Padding( color: Color(0xff32A060),
padding: EdgeInsets.only(bottom: 4.h), fontSize: 15.sp,
child: Text( fontWeight: MyFontWeight.semi_bold,
"8折火锅券", ),
style: TextStyle( ),
fontSize: 14.sp, SizedBox(height: 5.h,),
fontWeight: MyFontWeight.medium, Text.rich(
color: Colors.white, TextSpan(
), children: [
TextSpan(
text: "7",
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 36.sp,
color: Color(0xffFF7E12),
),
),
TextSpan(
text: "",
style: TextStyle(
fontSize: 24.sp,
color: Color(0xffFF7E12),
fontWeight: MyFontWeight.semi_bold,
),
),
],
),
textDirection: TextDirection.ltr,
),
],
),)),
Image.asset(
"assets/image/vip_shop_qj.webp",
fit: BoxFit.fill, //
height:85,
width: 85,
), ),
), ],
], ),
)
],
),
),
Container(
height: 124.h,
margin: EdgeInsets.only(bottom: 22.h),
child: Stack(
children: [
Image.asset(
"assets/image/vip_shop_bj.webp",
fit: BoxFit.fill, //
height:double.infinity,
width: double.infinity,
), ),
), Container(
], child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(child:Padding(
padding:EdgeInsets.only(top:25.h,left: 19.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"门店火锅券",
style: TextStyle(
color: Color(0xff32A060),
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
SizedBox(height: 5.h,),
Text.rich(
TextSpan(
children: [
TextSpan(
text: "8",
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 36.sp,
color: Color(0xffFF7E12),
),
),
TextSpan(
text: "",
style: TextStyle(
fontSize: 24.sp,
color: Color(0xffFF7E12),
fontWeight: MyFontWeight.semi_bold,
),
),
],
),
textDirection: TextDirection.ltr,
),
],
),)),
Image.asset(
"assets/image/vip_shop_hg.webp",
fit: BoxFit.fill, //
height:85,
width: 85,
),
],
),
)
],
),
), ),
], ],
), ),

114
lib/vip/vip_view/vip_goods_discount.dart

@ -85,9 +85,9 @@ class _VipGoodsDiscount extends State<VipGoodsDiscount> {
Widget vipGoodsRecommend(){ Widget vipGoodsRecommend(){
return Container( return Container(
margin: EdgeInsets.only(top: 12.h), margin: EdgeInsets.only(top: 12.h),
height: 195.h, height: 261.h,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only(top: 16.h,left: 8.h), padding: EdgeInsets.only(top: 16.h,left: 13.h),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.w), borderRadius: BorderRadius.circular(6.w),
color: Colors.white, color: Colors.white,
@ -104,15 +104,27 @@ class _VipGoodsDiscount extends State<VipGoodsDiscount> {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Row(
S.of(context).huiyuanzhuanxiangjiage, children: [
style: TextStyle( SizedBox(width: 7.w,),
color: Colors.black, Image.asset(
fontSize:15.sp, "assets/image/vip_title.webp",
fontWeight: MyFontWeight.semi_bold, fit: BoxFit.fill, //
), height:13.h,
width: 27.w,
),
SizedBox(width: 4.w,),
Text(
S.of(context).huiyuanzhuanxiangjiage,
style: TextStyle(
color: Colors.black,
fontSize:15.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
],
), ),
SizedBox(height:20.h,), SizedBox(height:10.h,),
vipGoodsRecommendList(), vipGoodsRecommendList(),
], ],
), ),
@ -121,7 +133,7 @@ class _VipGoodsDiscount extends State<VipGoodsDiscount> {
Widget vipGoodsRecommendList(){ Widget vipGoodsRecommendList(){
return Container( return Container(
height: 126.h, height: 200.h,
child: ListView.builder( child: ListView.builder(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
@ -147,35 +159,53 @@ class _VipGoodsDiscount extends State<VipGoodsDiscount> {
Widget vipGoodsRecommendItem(ProductVips productVips){ Widget vipGoodsRecommendItem(ProductVips productVips){
return Container( return Container(
width: 70.w, width: 140.w,
margin: EdgeInsets.only(right:40.w,left:6.w), margin: EdgeInsets.only(right:13.w,left:6.w),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Stack( MImage(
alignment: Alignment.bottomCenter, productVips.thumbnailImg ?? "",
width: 140.w,
height: 145.h,
fit: BoxFit.cover,
radius: BorderRadius.circular(6),
errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp",
),
Expanded(child: Padding(padding:EdgeInsets.only(top:10.h,bottom:7.h),
child: Text(
productVips.productName ?? "",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xff0D0D0D),
fontSize:14.sp,
fontWeight: MyFontWeight.regular,
),),
)),
Row(
children: [ children: [
MImage( Text(
productVips.thumbnailImg ?? "", "${productVips.vipPrice ?? "0.00"}",
width: 70, style: TextStyle(
height: 70, color: Color(0xff32A060),
fit: BoxFit.cover, fontSize:14.sp,
radius: BorderRadius.circular(2), fontWeight: MyFontWeight.medium,
errorSrc: "assets/image/default_1.webp", ),),
fadeSrc: "assets/image/default_1.webp",
),
if(productVips.vipDiscount != "0.00") if(productVips.vipDiscount != "0.00")
Container( Container(
width: 70, padding: EdgeInsets.symmetric(vertical: 2.h,horizontal:3.w),
padding: EdgeInsets.symmetric(vertical:2.h), margin: EdgeInsets.only(left: 5.w),
alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xffF96519),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
bottomRight: Radius.circular(2.r), topLeft: Radius.circular(10),
bottomLeft: Radius.circular(2.r), topRight: Radius.circular(10),
), bottomLeft: Radius.circular(0),
color: Color(0xff32A060), bottomRight: Radius.circular(10),
),
), ),
child: Text( child: Text(
"${productVips.vipDiscount ?? "0"}", "${productVips.vipDiscount ?? "0"}",
@ -186,25 +216,7 @@ class _VipGoodsDiscount extends State<VipGoodsDiscount> {
),), ),),
), ),
], ],
), )
Padding(padding:EdgeInsets.only(top:6.h,bottom: 4.h),
child: Text(
productVips.productName ?? "",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xff0D0D0D),
fontSize:14.sp,
fontWeight: MyFontWeight.regular,
),),
),
Text(
"${productVips.vipPrice ?? "0.00"}",
style: TextStyle(
color: Color(0xff0D0D0D),
fontSize:14.sp,
fontWeight: MyFontWeight.medium,
),)
], ],
), ),
); );

247
lib/vip/vip_view/vip_top.dart

@ -114,20 +114,91 @@ class _VipTop extends State<VipTop> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Stack(
child: Column( children: [
children: [ Container(
vipCard(), height: 246.h,
SizedBox( decoration: BoxDecoration(
height: 15.h, color: Color(0xff32A060),
borderRadius: BorderRadius.vertical(
bottom: Radius.circular(8.w),
),
), ),
(!(widget?.vipCardHome?.member?.isVip ?? false)) ),
? vipCardList() Container(
: Padding( child: Column(
padding: EdgeInsets.symmetric(horizontal: 16.w), children: [
child: Row( vipCard(),
children: [ SizedBox(
Expanded( height: 15.h,
),
(!(widget?.vipCardHome?.member?.isVip ?? false))
? vipCardList()
: Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Row(
children: [
Expanded(
child: Container(
alignment: Alignment.center,
padding: EdgeInsets.symmetric(
horizontal: 10.w, vertical: 15.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.w),
color: Color(0xffffffff),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
),
child: Text.rich(
TextSpan(
children: [
TextSpan(
text: S.of(context).yixianghuiyuanquanyi,
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 15.sp,
color: Color(0xff32A060),
),
),
TextSpan(
text: widget
?.vipCardHome?.member?.vipDuration
.toString() ??
"0",
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 18.sp,
color: Color(0xffF96519),
),
),
TextSpan(
text: "",
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 15.sp,
color: Color(0xff32A060),
),
),
],
),
textDirection: TextDirection.ltr,
))),
SizedBox(
width: 10.w,
),
Expanded(
child: GestureDetector(
onTap: () {
setState(() {
vipRenewShowBottomSheet();
});
},
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
@ -144,100 +215,42 @@ class _VipTop extends State<VipTop> {
) )
], ],
), ),
child: Text.rich( child: Row(
TextSpan( mainAxisAlignment: MainAxisAlignment.center,
children: [ crossAxisAlignment: CrossAxisAlignment.center,
TextSpan( children: [
text: S.of(context).yixianghuiyuanquanyi, Text(
style: TextStyle( "${(widget?.vipCardHome?.member?.isVipSubscribe ?? false) ? "已开通自动续费" : "续费回乡VIP"}",
fontWeight: MyFontWeight.semi_bold, style: TextStyle(
fontSize: 15.sp, color: Color((widget?.vipCardHome
color: Color(0xff32A060), ?.member?.isVipSubscribe ??
), false)
), ? 0xff3A3936
TextSpan( : 0xff32A060),
text: widget fontSize: 15.sp,
?.vipCardHome?.member?.vipDuration fontWeight: MyFontWeight.semi_bold,
.toString() ??
"0",
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 18.sp,
color: Color(0xffF96519),
),
),
TextSpan(
text: "",
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 15.sp,
color: Color(0xff32A060),
),
), ),
], ),
), SizedBox(
textDirection: TextDirection.ltr, width: 6.w,
),
Image.asset(
"${(widget?.vipCardHome?.member?.isVipSubscribe ?? false) ? "assets/image/vip_xf.webp" : "assets/image/icon_right.webp"}",
width: 16,
height: 16,
fit: BoxFit.fill,
color: Color(0xff32A060),
),
],
))), ))),
SizedBox( )
width: 10.w, ],
),
Expanded(
child: GestureDetector(
onTap: () {
setState(() {
vipRenewShowBottomSheet();
});
},
child: Container(
alignment: Alignment.center,
padding: EdgeInsets.symmetric(
horizontal: 10.w, vertical: 15.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.w),
color: Color(0xffffffff),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"${(widget?.vipCardHome?.member?.isVipSubscribe ?? false) ? "已开通自动续费" : "续费回乡VIP"}",
style: TextStyle(
color: Color((widget?.vipCardHome
?.member?.isVipSubscribe ??
false)
? 0xff3A3936
: 0xff32A060),
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
SizedBox(
width: 6.w,
),
Image.asset(
"${(widget?.vipCardHome?.member?.isVipSubscribe ?? false) ? "assets/image/vip_xf.webp" : "assets/image/icon_right.webp"}",
width: 16,
height: 16,
fit: BoxFit.fill,
color: Color(0xff32A060),
),
],
))),
)
],
),
), ),
], ),
), ],
),
)
],
); );
} }
@ -245,8 +258,9 @@ class _VipTop extends State<VipTop> {
Widget vipCard() { Widget vipCard() {
return Container( return Container(
margin: EdgeInsets.fromLTRB( margin: EdgeInsets.fromLTRB(
14.w, MediaQuery.of(context).padding.top + 25.h, 14.w, 8.h), 14.w,( MediaQuery.of(context).padding.top + 50.h), 14.w, 8.h),
height: 167.h, width: double.infinity,
height: 207.h,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w), borderRadius: BorderRadius.circular(8.w),
color: Colors.white, color: Colors.white,
@ -265,29 +279,22 @@ class _VipTop extends State<VipTop> {
Image.asset( Image.asset(
"assets/image/vip_card.webp", "assets/image/vip_card.webp",
fit: BoxFit.fill, // fit: BoxFit.fill, //
height: 167.h, height:double.infinity,
width: double.infinity,
), ),
Container( Container(
padding: EdgeInsets.all(16.w), padding: EdgeInsets.only(top: 24.h,right:16.w),
alignment: Alignment.topRight,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Expanded(
child: Text(
S.of(context).huixiangVIPka,
style: TextStyle(
color: Color(0xff32A060),
fontSize: 24.sp,
fontWeight: MyFontWeight.semi_bold,
),
)),
Text( Text(
widget?.vipCardHome?.member?.nickname ?? "", widget?.vipCardHome?.member?.nickname ?? "",
style: TextStyle( style: TextStyle(
color: Colors.white, color: Color(0xff32A060),
fontSize: 15.sp, fontSize: 15.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.medium,
), ),
), ),
SizedBox( SizedBox(
@ -297,7 +304,7 @@ class _VipTop extends State<VipTop> {
Text( Text(
"有效期至 ${(widget?.vipCardHome?.member?.vipExpire ?? "").substring(0, (widget?.vipCardHome?.member?.vipExpire ?? "").indexOf(" "))}", "有效期至 ${(widget?.vipCardHome?.member?.vipExpire ?? "").substring(0, (widget?.vipCardHome?.member?.vipExpire ?? "").indexOf(" "))}",
style: TextStyle( style: TextStyle(
color: Color(0xffFFFFFF), color: Color(0xff32A060),
fontSize: 13.sp, fontSize: 13.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
), ),

Loading…
Cancel
Save