Browse Source

Merge remote-tracking branch 'origin/new_revision_app' into new_revision_app

dart3_last
fmk 2 years ago
parent
commit
f77bd3b5c9
  1. BIN
      assets/image/2x/vip_card.webp
  2. BIN
      assets/image/2x/vip_discount_left.webp
  3. BIN
      assets/image/2x/vip_discount_right.webp
  4. BIN
      assets/image/2x/vip_lock.webp
  5. BIN
      assets/image/2x/vip_shop_hg.webp
  6. BIN
      assets/image/2x/vip_shop_hx.webp
  7. BIN
      assets/image/2x/vip_shop_qj.webp
  8. BIN
      assets/image/2x/vip_wx.webp
  9. BIN
      assets/image/2x/vip_xf.webp
  10. BIN
      assets/image/3x/vip_card.webp
  11. BIN
      assets/image/3x/vip_discount_left.webp
  12. BIN
      assets/image/3x/vip_discount_right.webp
  13. BIN
      assets/image/3x/vip_lock.webp
  14. BIN
      assets/image/3x/vip_shop_hg.webp
  15. BIN
      assets/image/3x/vip_shop_hx.webp
  16. BIN
      assets/image/3x/vip_shop_qj.webp
  17. BIN
      assets/image/3x/vip_wx.webp
  18. BIN
      assets/image/3x/vip_xf.webp
  19. BIN
      assets/image/vip_card.webp
  20. BIN
      assets/image/vip_discount_left.webp
  21. BIN
      assets/image/vip_discount_right.webp
  22. BIN
      assets/image/vip_lock.webp
  23. BIN
      assets/image/vip_shop_hg.webp
  24. BIN
      assets/image/vip_shop_hx.webp
  25. BIN
      assets/image/vip_shop_qj.webp
  26. BIN
      assets/image/vip_wx.webp
  27. BIN
      assets/image/vip_xf.webp
  28. 1
      assets/svg/huixiang_vip.svg
  29. 1
      lib/main.dart
  30. 5
      lib/main_page.dart
  31. 209
      lib/mine/mine_wallet_page.dart
  32. 3
      lib/retrofit/data/findMiNiGroupList.dart
  33. 968
      lib/retrofit/data/vip_card_home.dart
  34. 2
      lib/retrofit/min_api.dart
  35. 13
      lib/retrofit/retrofit_api.dart
  36. 43
      lib/retrofit/retrofit_api.g.dart
  37. 57
      lib/settlement/settlement_view/activity_coupon_remarks.dart
  38. 29
      lib/store/store_view/shop_goods.dart
  39. 2
      lib/store/store_view/shop_goods_car.dart
  40. 118
      lib/vip/vip_page.dart
  41. 132
      lib/vip/vip_view/exclusive_coupon.dart
  42. 208
      lib/vip/vip_view/vip_goods_discount.dart
  43. 733
      lib/vip/vip_view/vip_top.dart
  44. 7
      pubspec.lock
  45. 4
      pubspec.yaml

BIN
assets/image/2x/vip_card.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
assets/image/2x/vip_discount_left.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
assets/image/2x/vip_discount_right.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
assets/image/2x/vip_lock.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 850 B

BIN
assets/image/2x/vip_shop_hg.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
assets/image/2x/vip_shop_hx.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
assets/image/2x/vip_shop_qj.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
assets/image/2x/vip_wx.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 950 B

BIN
assets/image/2x/vip_xf.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 966 B

BIN
assets/image/3x/vip_card.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
assets/image/3x/vip_discount_left.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
assets/image/3x/vip_discount_right.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
assets/image/3x/vip_lock.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1012 B

BIN
assets/image/3x/vip_shop_hg.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
assets/image/3x/vip_shop_hx.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
assets/image/3x/vip_shop_qj.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
assets/image/3x/vip_wx.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
assets/image/3x/vip_xf.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
assets/image/vip_card.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
assets/image/vip_discount_left.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 958 B

BIN
assets/image/vip_discount_right.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 952 B

BIN
assets/image/vip_lock.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 694 B

BIN
assets/image/vip_shop_hg.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
assets/image/vip_shop_hx.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

BIN
assets/image/vip_shop_qj.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

BIN
assets/image/vip_wx.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 746 B

BIN
assets/image/vip_xf.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 738 B

1
assets/svg/huixiang_vip.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="30" height="30" viewBox="0 0 30 30"><g style="mix-blend-mode:passthrough"><g style="mix-blend-mode:passthrough"></g><g style="mix-blend-mode:passthrough"><g><path d="M25.851,11.55611C25.8141,11.49325,25.7688,11.436219999999999,25.7255,11.377600000000001L21.3236,5.415895C21.3151,5.404481,21.3069,5.393232,21.2982,5.382013C21.1218,5.154158,20.8658,5.0231802,20.6008,5.00280455C20.5574,4.999471853,20.5144,4.999694502,20.4711,4.9999186574C20.4602,4.999975048,20.4493,5.000031534,20.4384,5.000031534L8.478860000000001,5.000031534L8.4678,5.0000938062C7.80108,5.00760603,7.42211,5.785347,7.02607,6.32174L3.221741,11.474440000000001C3.212881,11.48644,3.204279,11.497969999999999,3.195716,11.51018C3.165091,11.55386,3.138179,11.59977,3.114979,11.64686C3.063057,11.75225,3.0281276,11.86204,3.0110173,11.97827C2.9694287,12.26079,3.0452709000000002,12.558309999999999,3.243853,12.789570000000001C3.250725,12.79757,3.257491,12.80514,3.264496,12.813030000000001L13.4861,24.3232C13.5974,24.4485,13.6905,24.5906,13.8132,24.7047L13.8144,24.7059C13.8191,24.7103,13.8232,24.714,13.828,24.7183C13.8323,24.7222,13.8366,24.7261,13.8409,24.7299C13.9269,24.8051,14.0254,24.8693,14.1298,24.9159C14.4722,25.0688,14.8834,25.0139,15.1788,24.7449C15.1814,24.7425,15.1836,24.7404,15.1862,24.738C15.3817,24.5551,15.5106,24.304,15.6889,24.1032L25.7053,12.82161C25.7333,12.79006,25.761,12.75965,25.7868,12.7263C25.9457,12.52134,26.0158,12.27031,25.997,12.02519C25.9846,11.86175,25.9339,11.6975,25.851,11.55611ZM14.483,20.2656C14.1847,20.3035,13.8747,20.1887,13.6585,19.927599999999998L13.6579,19.9269L8.77153,14.03608L8.77046,14.03478C8.41302,13.60503,8.441130000000001,12.93914,8.83601,12.54776L8.83778,12.546C9.23132,12.15552,9.84095,12.186679999999999,10.198879999999999,12.61891L10.19916,12.619250000000001L14.483,17.786099999999998L18.7668,12.619250000000001L18.7671,12.61891C19.125,12.18667,19.7346,12.15552,20.1282,12.54602L20.1299,12.547740000000001C20.5248,12.93908,20.5529,13.60491,20.1956,14.03467L20.1943,14.03619L15.3107,19.9265L15.3095,19.928C15.0918,20.1888,14.7814,20.3035,14.483,20.2656Z" fill-rule="evenodd" fill="#32A060" fill-opacity="1"/></g></g></g></svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

1
lib/main.dart

@ -74,6 +74,7 @@ import 'package:huixiang/store/store_view/product_meals_sku.dart';
import 'package:huixiang/test_page.dart'; import 'package:huixiang/test_page.dart';
import 'package:huixiang/union/location_map_page.dart'; import 'package:huixiang/union/location_map_page.dart';
import 'package:huixiang/utils/ImgCachePath.dart'; import 'package:huixiang/utils/ImgCachePath.dart';
import 'package:huixiang/vip/vip_page.dart';
import 'package:huixiang/web/web_page.dart'; import 'package:huixiang/web/web_page.dart';
import 'package:huixiang/union/union_details_page.dart'; import 'package:huixiang/union/union_details_page.dart';

5
lib/main_page.dart

@ -25,6 +25,7 @@ import 'package:huixiang/utils/flutter_utils.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/utils/native_event_handler.dart'; import 'package:huixiang/utils/native_event_handler.dart';
import 'package:huixiang/view_widget/update_dialog.dart'; import 'package:huixiang/view_widget/update_dialog.dart';
import 'package:huixiang/vip/vip_page.dart';
import 'package:package_info/package_info.dart'; import 'package:package_info/package_info.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
@ -53,6 +54,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
final GlobalKey homePageKey = GlobalKey(); final GlobalKey homePageKey = GlobalKey();
final GlobalKey minePageKey = GlobalKey(); final GlobalKey minePageKey = GlobalKey();
final GlobalKey unionPageKey = GlobalKey(); final GlobalKey unionPageKey = GlobalKey();
// final GlobalKey vipPageKey = GlobalKey();
// List<String> iconn; // List<String> iconn;
ApiService apiService; ApiService apiService;
@ -128,6 +130,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
},invite:invite,interviewCouponList:interviewCouponList,firstLoginCouponList:firstLoginCouponList,), },invite:invite,interviewCouponList:interviewCouponList,firstLoginCouponList:firstLoginCouponList,),
// MainHomePage(), // MainHomePage(),
UnionPage(unionPageKey,0), UnionPage(unionPageKey,0),
// VipPage(vipPageKey),
Platform.isAndroid ? (ExamineInstance.instance.isExamine?OrderPage():CommunityPage()) :CommunityPage(), Platform.isAndroid ? (ExamineInstance.instance.isExamine?OrderPage():CommunityPage()) :CommunityPage(),
// CommunityPage(), // CommunityPage(),
MinePage(minePageKey), MinePage(minePageKey),
@ -136,6 +139,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
icons = [ icons = [
"assets/svg/jingbi.svg", "assets/svg/jingbi.svg",
"assets/svg/lianmeng.svg", "assets/svg/lianmeng.svg",
// "assets/svg/huixiang_vip.svg",
"assets/svg/shequn.svg", "assets/svg/shequn.svg",
"assets/svg/wode.svg", "assets/svg/wode.svg",
]; ];
@ -425,6 +429,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
bottomNavigationItem(S.of(context).main_menu1, 0), bottomNavigationItem(S.of(context).main_menu1, 0),
bottomNavigationItem(S.of(context).main_menu2, 1), bottomNavigationItem(S.of(context).main_menu2, 1),
// bottomNavigationItem(S.of(context).main_menu3 , 2), // bottomNavigationItem(S.of(context).main_menu3 , 2),
// bottomNavigationItem("回乡VIP", 2),
bottomNavigationItem(Platform.isAndroid ? (ExamineInstance.instance.isExamine?"订单":S.of(context).main_menu3) :S.of(context).main_menu3, 2), bottomNavigationItem(Platform.isAndroid ? (ExamineInstance.instance.isExamine?"订单":S.of(context).main_menu3) :S.of(context).main_menu3, 2),
bottomNavigationItem(S.of(context).main_menu4, 3), bottomNavigationItem(S.of(context).main_menu4, 3),
], ],

209
lib/mine/mine_wallet_page.dart

@ -2,11 +2,9 @@ import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flare_flutter/base/actor_ellipse.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.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/examine_instance.dart';
import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/data/user_bill.dart'; import 'package:huixiang/retrofit/data/user_bill.dart';
import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/data/user_info.dart';
@ -16,10 +14,13 @@ import 'package:huixiang/view_widget/classic_header.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/no_data_view.dart'; import 'package:huixiang/view_widget/no_data_view.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.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';
import 'package:flutter/material.dart';
import 'package:number_precision/number_precision.dart';
import '../utils/flutter_utils.dart';
class MineWalletPage extends StatefulWidget { class MineWalletPage extends StatefulWidget {
@override @override
@ -52,7 +53,7 @@ class _MineWalletPage extends State<MineWalletPage> {
UserInfo.fromJson(jsonDecode(sharedPreferences.getString('user'))); UserInfo.fromJson(jsonDecode(sharedPreferences.getString('user')));
mgreenMoney = double.tryParse(userInfo.greenMoney); mgreenMoney = double.tryParse(userInfo.greenMoney);
mBalance = double.tryParse(userInfo.money); mBalance = double.tryParse(userInfo.money);
pBalance = mgreenMoney + mBalance; pBalance = mBalance+mgreenMoney;
activityMoney = double.tryParse(userInfo.activityMoney); activityMoney = double.tryParse(userInfo.activityMoney);
if (mounted) setState(() {}); if (mounted) setState(() {});
String token = sharedPreferences.getString("token"); String token = sharedPreferences.getString("token");
@ -73,7 +74,7 @@ class _MineWalletPage extends State<MineWalletPage> {
mgreenMoney = double.tryParse(userInfo.greenMoney); mgreenMoney = double.tryParse(userInfo.greenMoney);
activityMoney = double.tryParse(userInfo.activityMoney); activityMoney = double.tryParse(userInfo.activityMoney);
mBalance = double.tryParse(userInfo.money); mBalance = double.tryParse(userInfo.money);
pBalance = mBalance + mgreenMoney; pBalance = mBalance+mgreenMoney;
if (mounted) setState(() {}); if (mounted) setState(() {});
} }
} }
@ -467,7 +468,7 @@ class _MineWalletPage extends State<MineWalletPage> {
width: 24.w, width: 24.w,
), ),
Text( Text(
"$pBalance", "${NP.plus(mBalance,mgreenMoney)}",
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
fontSize: 50.sp, fontSize: 50.sp,
@ -544,7 +545,7 @@ class _MineWalletPage extends State<MineWalletPage> {
height: 4.h, height: 4.h,
), ),
Text( Text(
"$mBalance", "${NP.strip(mBalance)}",
style: TextStyle( style: TextStyle(
fontSize: 18.sp, fontSize: 18.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
@ -574,7 +575,7 @@ class _MineWalletPage extends State<MineWalletPage> {
height: 4.h, height: 4.h,
), ),
Text( Text(
"$activityMoney", "${NP.strip(activityMoney)}",
style: TextStyle( style: TextStyle(
fontSize: 18.sp, fontSize: 18.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
@ -604,7 +605,7 @@ class _MineWalletPage extends State<MineWalletPage> {
height: 4.h, height: 4.h,
), ),
Text( Text(
"$mgreenMoney", "${NP.strip(mgreenMoney)}",
style: TextStyle( style: TextStyle(
fontSize: 18.sp, fontSize: 18.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
@ -626,198 +627,8 @@ class _MineWalletPage extends State<MineWalletPage> {
); );
} }
// Widget balance1() {
// return Container(
// width: double.infinity,
// margin: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 8.h),
// padding: EdgeInsets.fromLTRB(24.w, 24.h, 24.w, 24.h),
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(8),
// boxShadow: [
// BoxShadow(
// color: Colors.black.withAlpha(25),
// offset: Offset(0, 3),
// blurRadius: 14,
// spreadRadius: 0,
// ),
// ],
// ),
// child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Stack(
// alignment: Alignment.center,
// children: [
// Align(
// alignment: Alignment.center,
// child: Text(
// S.of(context).zongzichan,
// style: TextStyle(
// fontWeight: MyFontWeight.semi_bold,
// color: Color(0xFF353535),
// fontSize: 16.sp,
// ),
// ),
// ),
// // GestureDetector(
// // onTap: () {
// // queryUserBalance();
// // },
// // child: Row(
// // mainAxisAlignment: MainAxisAlignment.end,
// // children: [
// // Icon(
// // Icons.refresh,
// // size: 20,
// // color: Color(0xFF8A8A8A),
// // ),
// // Text(
// // S.of(context).shuaxin,
// // style: TextStyle(
// // color: Color(0xFF353535),
// // fontSize: 12.sp,
// // ),
// // ),
// // ],
// // ),
// // ),
// ],
// ),
// SizedBox(
// height: 16.h,
// ),
// Text(
// "$mBalance",
// style: TextStyle(
// fontWeight: MyFontWeight.medium,
// color: Color(0xFF353535),
// fontSize: 50.sp,
// ),
// ),
// // SizedBox(
// // height: 4.h,
// // ),
// // Text(
// // S.of(context).keyongyue,
// // style: TextStyle(
// // color: Color(0xFF20662A),
// // fontSize: 16.sp,
// // fontWeight: MyFontWeight.regular
// // ),
// // ),
// SizedBox(
// height: 24.h,
// ),
// InkWell(
// onTap: () {
// toRecharge();
// },
// child: RoundButton(
// width: 104.w,
// text: S.of(context).lijichongzhi,
// textColor: Colors.white,
// fontWeight: MyFontWeight.semi_bold,
// radius: 15,
// backgroup: Color(0xFF32A060),
// fontSize: 14.sp,
// padding: EdgeInsets.symmetric(vertical: 5.h),
// ),
// ),
// ],
// ),
// );
// }
toRecharge() async { toRecharge() async {
await Navigator.of(context).pushNamed('/router/recharge_page'); await Navigator.of(context).pushNamed('/router/recharge_page');
loadBillInfo(); loadBillInfo();
} }
///
// Widget rechargeWithdrawal() {
// return Row(
// children: [
// Expanded(
// child: InkWell(
// onTap: () {
// toRecharge();
// },
// child: Container(
// margin: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h),
// padding: EdgeInsets.fromLTRB(0, 7.h, 0, 7.h),
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(8),
// boxShadow: [
// BoxShadow(
// color: Colors.black.withAlpha(12),
// offset: Offset(0, 3),
// blurRadius: 14,
// spreadRadius: 0,
// )
// ]),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Image.asset(
// "assets/image/icon_wallet_recharge.webp",
// width: 40.w,
// height: 40.h,
// ),
// Text(
// S.of(context).chongzhi,
// style: TextStyle(
// fontWeight: FontWeight.bold,
// fontSize: 16.sp,
// color: Colors.black,
// ),
// )
// ],
// ),
// ),
// ),
// flex: 1,
// ),
// Expanded(
// child: Container(
// margin: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h),
// padding: EdgeInsets.fromLTRB(0, 7.h, 0, 7.h),
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.all(Radius.circular(8)),
// boxShadow: [
// BoxShadow(
// color: Colors.black.withAlpha(12),
// offset: Offset(0, 3),
// blurRadius: 14,
// spreadRadius: 0)
// ]),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Image.asset(
// "assets/image/icon_wallet_withdrawal.webp",
// width: 40.w,
// height: 40.w,
// ),
// Text(
// S.of(context).tixian,
// style: TextStyle(
// fontWeight: FontWeight.bold,
// fontSize: 16.sp,
// color: Colors.black,
// ),
// )
// ],
// ),
// ),
// flex: 1,
// ),
// ],
// );
// }
} }

3
lib/retrofit/data/findMiNiGroupList.dart

@ -85,6 +85,7 @@ class ProductListBean {
String weight; String weight;
String applyPrice; String applyPrice;
String price; String price;
String vipPrice;
int stock; int stock;
int sellCount; int sellCount;
int needLogistics; int needLogistics;
@ -117,6 +118,7 @@ class ProductListBean {
productListBean.weight = map['weight']; productListBean.weight = map['weight'];
productListBean.applyPrice = map['applyPrice']; productListBean.applyPrice = map['applyPrice'];
productListBean.price = map['price']; productListBean.price = map['price'];
productListBean.vipPrice = map['vipPrice'];
productListBean.stock = map['stock']; productListBean.stock = map['stock'];
productListBean.sellCount = map['sellCount']; productListBean.sellCount = map['sellCount'];
productListBean.needLogistics = map['needLogistics']; productListBean.needLogistics = map['needLogistics'];
@ -149,6 +151,7 @@ class ProductListBean {
"weight": weight, "weight": weight,
"applyPrice": applyPrice, "applyPrice": applyPrice,
"price": price, "price": price,
"vipPrice":vipPrice,
"stock": stock, "stock": stock,
"sellCount": sellCount, "sellCount": sellCount,
"needLogistics": needLogistics, "needLogistics": needLogistics,

968
lib/retrofit/data/vip_card_home.dart

File diff suppressed because one or more lines are too long

2
lib/retrofit/min_api.dart

@ -26,7 +26,7 @@ import 'data/shopping_home_config.dart';
part 'min_api.g.dart'; part 'min_api.g.dart';
const localBaseUrl = "http://192.168.10.78:8765/app/";/// const localBaseUrl = "http://192.168.10.129:8765/app/";///
// const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";/// // const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///
const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线 const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线

13
lib/retrofit/retrofit_api.dart

@ -56,12 +56,13 @@ import 'data/user_info.dart';
import 'data/vip_badges_list.dart'; import 'data/vip_badges_list.dart';
import 'data/vip_benefit_list.dart'; import 'data/vip_benefit_list.dart';
import 'data/vip_card.dart'; import 'data/vip_card.dart';
import 'data/vip_card_home.dart';
import 'data/vip_rule_details.dart'; import 'data/vip_rule_details.dart';
import 'data/wx_pay.dart'; import 'data/wx_pay.dart';
part 'retrofit_api.g.dart'; part 'retrofit_api.g.dart';
const localBaseUrl = "http://192.168.10.78:8766/app/";/// const localBaseUrl = "http://192.168.10.129:8766/app/";///
// const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";/// // const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///
const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///线 const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///线
@ -530,4 +531,14 @@ abstract class ApiService {
/// ///
@POST("/member/verifyByUpdatePayPwd") @POST("/member/verifyByUpdatePayPwd")
Future<BaseData> verifyByUpdatePayPwd(@Body() Map<String, dynamic> param); Future<BaseData> verifyByUpdatePayPwd(@Body() Map<String, dynamic> param);
///VIP首页
@GET("/vipCard/index")
Future<BaseData<VipCardHome>> vipCardIndex();
///VIP订阅/
@POST("/vipCard/orderVip/{id}")
Future<BaseData<dynamic>> orderVip(@Body() Map<String, dynamic> param);
} }

43
lib/retrofit/retrofit_api.g.dart

@ -2068,4 +2068,47 @@ class _ApiService implements ApiService {
); );
return value; return value;
} }
@override
Future<BaseData<VipCardHome>> vipCardIndex() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/vipCard/index',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<VipCardHome>.fromJson(
_result.data,
(json) => VipCardHome.fromJson(json),
);
return value;
}
@override
Future<BaseData<dynamic>> orderVip(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/vipCard/orderVip',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<dynamic>.fromJson(
_result.data,
(json) => json as dynamic,
);
return value;
}
} }

57
lib/settlement/settlement_view/activity_coupon_remarks.dart

@ -73,6 +73,45 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
// if ()
// InkWell(
// onTap: () {
// // widget.activityCart();
// },
// child: Row(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Expanded(
// flex: 1,
// child: Text(
// "VIP价格",
// style: TextStyle(
// fontWeight: MyFontWeight.regular,
// fontSize: 14.sp,
// color: Color(0xFF353535),
// ),
// ),
// ),
// Text(
// "使用",
// textAlign: TextAlign.end,
// style: TextStyle(
// fontSize: 14.sp,
// color: Color(0xFF32A060),
// fontWeight: MyFontWeight.semi_bold,
// ),
// ),
// Icon(
// Icons.keyboard_arrow_right,
// size: 16,
// ),
// ],
// ),
// ),
// SizedBox(
// height: 13,
// ),
if (widget.placeOrder && widget?.settleOrderInfo?.benefitDiscountAmount != null && widget?.settleOrderInfo?.benefitDiscountAmount != "0") if (widget.placeOrder && widget?.settleOrderInfo?.benefitDiscountAmount != null && widget?.settleOrderInfo?.benefitDiscountAmount != "0")
Container( Container(
margin:EdgeInsets.only(bottom: 13), margin:EdgeInsets.only(bottom: 13),
@ -225,6 +264,22 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
); );
} }
String vipText() {
String vip = "";
if (widget.promotions == null || widget.promotions == "") {
vip = "使用";
if (widget.settleOrderInfo == null ||
widget.settleOrderInfo.promotionInfoList == null) {
vip = "使用";
} else if (widget.coupons != null && widget.coupons != "") {
vip = "不使用";
}
} else {
vip = widget.promotions;
}
return vip;
}
String activityText() { String activityText() {
String promotion = ""; String promotion = "";
if (widget.promotions == null || widget.promotions == "") { if (widget.promotions == null || widget.promotions == "") {
@ -248,7 +303,7 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
if(widget.placeOrder) if(widget.placeOrder)
if(widget.minOrderInfo == null || if(widget.minOrderInfo == null ||
widget.minOrderInfo.orderInfoVo.couponList == null) widget.minOrderInfo.orderInfoVo.couponList == null)
{coupon = "暂无可选优惠券";} {coupon = "未选择任何优惠券";}
else if(widget.promotions != null && widget.promotions != ""){ else if(widget.promotions != null && widget.promotions != ""){
coupon = "优惠券与活动不可同享"; coupon = "优惠券与活动不可同享";
} }

29
lib/store/store_view/shop_goods.dart

@ -309,6 +309,35 @@ class _ShopGoods extends State<ShopGoods> {
SizedBox( SizedBox(
height: 4.h, height: 4.h,
), ),
// if(widget.productListBean.vipPrice != null )
// Row(
// children: [
// Container(
// alignment: Alignment.center,
// padding: EdgeInsets.symmetric(horizontal:2.w),
// margin: EdgeInsets.only(right: 4.w),
// decoration: new BoxDecoration(
// color: Color(0xff32A060),
// borderRadius: BorderRadius.circular(4)),
// child: Text(
// "VIP",
// style: TextStyle(
// fontSize: 12.sp,
// fontWeight: MyFontWeight.regular,
// color: Color(0xFFFFFFFF),
// ),
// ),
// ),
// Text(
// "${AppUtils.calculateDouble(double.tryParse(widget.productListBean.vipPrice ?? "0") ?? 0)}",
// style: TextStyle(
// fontSize: 16.sp,
// fontWeight: MyFontWeight.medium,
// color: Color(0xff32A060),
// ),
// ),
// ],
// ),
Text( Text(
"${AppUtils.calculateDouble(double.tryParse(widget.isShopCart ? widget.shoppingCartSkuItemListBean.skuPrice : widget.productListBean.applyPrice) ?? 0)}", "${AppUtils.calculateDouble(double.tryParse(widget.isShopCart ? widget.shoppingCartSkuItemListBean.skuPrice : widget.productListBean.applyPrice) ?? 0)}",
style: TextStyle( style: TextStyle(

2
lib/store/store_view/shop_goods_car.dart

@ -316,7 +316,7 @@ class _ShopGoodsCar extends State<ShopGoodsCar> {
Expanded( Expanded(
flex: 1, flex: 1,
child: Text( child: Text(
"x1", setMealDataList.productInfoList[0].buyNumber.toString(),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 1, maxLines: 1,
style: TextStyle( style: TextStyle(

118
lib/vip/vip_page.dart

@ -0,0 +1,118 @@
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/retrofit/data/vip_card_home.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/vip/vip_view/exclusive_coupon.dart';
import 'package:huixiang/vip/vip_view/vip_goods_discount.dart';
import 'package:huixiang/vip/vip_view/vip_top.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../retrofit/data/base_data.dart';
import '../retrofit/retrofit_api.dart';
import '../view_widget/my_appbar.dart';
class VipPage extends StatefulWidget {
VipPage(Key key): super(key: key);
@override
State<StatefulWidget> createState() {
return _VipPageState();
}
}
class _VipPageState extends State<VipPage> with AutomaticKeepAliveClientMixin {
final RefreshController _refreshController = RefreshController();
ApiService apiService;
VipCardHome vipHome;
@override
void dispose() {
super.dispose();
if (_refreshController != null) _refreshController.dispose();
}
@override
void initState() {
super.initState();
queryVipHome();
}
queryVipHome() async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
showLoading: true
);
}
BaseData<VipCardHome> baseData =
await apiService.vipCardIndex().catchError((onError) {
_refreshController.refreshFailed();});
if (baseData != null && baseData.isSuccess) {
vipHome = baseData.data;
_refreshController.refreshCompleted();
}else{
_refreshController.refreshFailed();
SmartDialog.showToast(baseData.msg ?? "", alignment: Alignment.center);
}
}
_onRefresh() {
queryVipHome();
}
@override
Widget build(BuildContext context) {
super.build(context);
return Scaffold(
backgroundColor: Color(0xFFF9FAF7),
body: Container(
padding: EdgeInsets.only(bottom: 76.h),
child: SmartRefresher(
controller: _refreshController,
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
physics: BouncingScrollPhysics(),
onRefresh: () {
setState(() {
_onRefresh();
});
},
child: SingleChildScrollView(
child: Container(
child: FutureBuilder(
future:queryVipHome(),
builder: (context, snapshot) {
return Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
VipTop(vipHome),
VipGoodsDiscount(vipHome),
ExclusiveCoupon(),
],
);
},
),
),
),
),
),
);
}
@override
bool get wantKeepAlive => true;
}

132
lib/vip/vip_view/exclusive_coupon.dart

@ -0,0 +1,132 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class ExclusiveCoupon extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _ExclusiveCoupon();
}
}
class _ExclusiveCoupon extends State<ExclusiveCoupon> {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(left: 16.w, right: 16.w, bottom: 40.h),
width: double.infinity,
padding: EdgeInsets.all(16.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.w),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"专享优惠券",
style: TextStyle(
color: Colors.black,
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
SizedBox(
height: 10.h,
),
Row(
children: [
Expanded(
child: Stack(
alignment: Alignment.bottomCenter,
children: [
Image.asset(
"assets/image/vip_shop_hx.webp",
width: 100.w,
height: 120.h,
fit: BoxFit.fill,
),
Padding(
padding: EdgeInsets.only(bottom: 4.h),
child: Text(
"6折饮品券",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
),
],
)),
SizedBox(
width: 14.w,
),
Expanded(
child: Stack(
alignment: Alignment.bottomCenter,
children: [
Image.asset(
"assets/image/vip_shop_qj.webp",
width: 100.w,
height: 120.h,
fit: BoxFit.fill,
),
Padding(
padding: EdgeInsets.only(bottom: 4.h),
child: Text(
"7折烘焙券",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
),
],
),
),
SizedBox(
width: 14.w,
),
Expanded(
child: Stack(
alignment: Alignment.bottomCenter,
children: [
Image.asset(
"assets/image/vip_shop_hg.webp",
width:100.w,
height: 120.h,
fit: BoxFit.fill,
),
Padding(
padding: EdgeInsets.only(bottom: 4.h),
child: Text(
"8折火锅券",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
),
],
),
),
],
),
],
),
);
}
}

208
lib/vip/vip_view/vip_goods_discount.dart

@ -0,0 +1,208 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../retrofit/data/vip_card_home.dart';
import '../../view_widget/custom_image.dart';
class VipGoodsDiscount extends StatefulWidget {
final VipCardHome vipCardHome;
VipGoodsDiscount(this.vipCardHome);
@override
State<StatefulWidget> createState() {
return _VipGoodsDiscount();
}
}
class _VipGoodsDiscount extends State<VipGoodsDiscount> {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.symmetric(vertical: 25.h,horizontal: 16.w),
child:Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if(widget?.vipCardHome!=null)
(widget?.vipCardHome?.member?.isVip ?? false)?
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
"assets/image/vip_discount_left.webp",
width: 21.w,
height: 39.h,
fit: BoxFit.fill,
),
SizedBox(width: 11.w,),
Text(
"回乡VIP卡专享权益",
style: TextStyle(
color: Color(0xff32A060),
fontSize:15.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
SizedBox(width: 11.w,),
Image.asset(
"assets/image/vip_discount_right.webp",
width: 21.w,
height: 39.h,
fit: BoxFit.fill,
),
],):
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
"assets/image/vip_lock.webp",
width: 20,
height: 20,
fit: BoxFit.cover,
),
SizedBox(width: 2.w,),
Text(
"开通回乡VIP卡获取更多权益",
style: TextStyle(
color: Colors.black,
fontSize:15.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
],
),
vipGoodsRecommend(),
],
),
);
}
Widget vipGoodsRecommend(){
return Container(
margin: EdgeInsets.only(top: 10.h),
height: 200.h,
width: double.infinity,
padding: EdgeInsets.all(16.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.w),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
),
child:Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"会员专享价格",
style: TextStyle(
color: Colors.black,
fontSize:15.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
SizedBox(height:20.h,),
vipGoodsRecommendList(),
],
),
);
}
Widget vipGoodsRecommendList(){
return Container(
height: 126.h,
child: ListView.builder(
scrollDirection: Axis.horizontal,
physics: BouncingScrollPhysics(),
itemCount: widget.vipCardHome?.productVips?.length ?? 0,
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
Navigator.of(context)
.pushNamed('/router/shop_details_page', arguments: {
"id": widget?.vipCardHome?.productVips[position].id,
"storeId": widget?.vipCardHome?.productVips[position].storeId,
});
},
child: vipGoodsRecommendItem(widget.vipCardHome.productVips[position]),
);
},
),
);
}
Widget vipGoodsRecommendItem(ProductVips productVips){
return Container(
width: 70.w,
margin: EdgeInsets.only(right:10.w,left:6.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Stack(
alignment: Alignment.bottomCenter,
children: [
MImage(
productVips.thumbnailImg ?? "",
width: 70,
height: 70,
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp",
),
if(productVips.vipDiscount != "0.00")
Container(
width: 70,
padding: EdgeInsets.symmetric(vertical:2.h),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(4.r),
bottomLeft: Radius.circular(4.r),
),
color: Color(0xff32A060),
),
child: Text(
"${productVips.vipDiscount ?? ""}",
style: TextStyle(
color: Colors.white,
fontSize:13.sp,
fontWeight: MyFontWeight.regular,
),),
),
],
),
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 ?? ""}",
style: TextStyle(
color: Color(0xff0D0D0D),
fontSize:15.sp,
fontWeight: MyFontWeight.medium,
),)
],
),
);
}
}

733
lib/vip/vip_view/vip_top.dart

@ -0,0 +1,733 @@
import 'dart:io';
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:fluwx/fluwx.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:tobias/tobias.dart';
import '../../generated/l10n.dart';
import '../../retrofit/data/base_data.dart';
import '../../retrofit/data/vip_card_home.dart';
import '../../retrofit/data/wx_pay.dart';
import '../../retrofit/retrofit_api.dart';
import '../../utils/flutter_utils.dart';
import '../../utils/min.dart';
import 'package:tobias/tobias.dart' as tobias;
class VipTop extends StatefulWidget {
final VipCardHome vipCardHome;
VipTop(this.vipCardHome);
@override
State<StatefulWidget> createState() {
return _VipTop();
}
}
class _VipTop extends State<VipTop> {
int selectIndex = 0;
ApiService apiService;
var payType = 1;
dynamic payListen;
int stateIndex = 0;
@override
void initState() {
super.initState();
payListen = weChatResponseEventHandler.listen((event) async {
print("payCallback: ${event.errCode}");
if (event.errCode == 0) {
SmartDialog.showToast("支付成功", alignment: Alignment.center);
} else {
SmartDialog.showToast("支付失败", alignment: Alignment.center);
return;
}
});
}
recharge() async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(Dio(),
context: context, token: value.getString("token"), showLoading: true);
}
BaseData<dynamic> baseData = await apiService.orderVip({
"cardId": widget?.vipCardHome?.cards[selectIndex]?.id,
"type": payType
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
if (payType == 1) {
if (Platform.isAndroid) {
if (!(await Min.isInitialize())) {
// app的充值支付使用同一个WXPayEntryActivity回调
// getPackage空指针
//
await Min.initialize();
}
}
WxPay wxPay = WxPay.fromJson(baseData.data);
await registerWxApi(
appId: wxPay.appId,
doOnAndroid: true,
universalLink: "https://hx.lotus-wallet.com/app/",
);
payWithWeChat(
appId: wxPay.appId,
partnerId: wxPay.partnerId,
prepayId: wxPay.prepayId,
packageValue: wxPay.packageValue,
nonceStr: wxPay.nonceStr,
timeStamp: int.tryParse(wxPay.timeStamp),
sign: wxPay.sign,
);
} else {
tobias.isAliPayInstalled().then((value) => {
//
if (!value)
{SmartDialog.showToast("请安装支付宝", alignment: Alignment.center)}
else
{
tobias.aliPay(baseData.data["body"]).then((payRes) {
if (payRes['resultStatus'] == 9000 ||
payRes['resultStatus'] == '9000') {
SmartDialog.showToast("支付成功",
alignment: Alignment.center);
} else {
SmartDialog.showToast(payRes['memo'],
alignment: Alignment.center);
}
})
}
});
}
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
@override
Widget build(BuildContext context) {
return Container(
child: Column(
children: [
vipCard(),
SizedBox(
height: 15.h,
),
(!(widget?.vipCardHome?.member?.isVip ?? false) || stateIndex== 1)?
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: "已享会员权益 ",
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(() {
stateIndex = 1;
});
},
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),
),
],
))),
)
],
),
),
],
),
);
}
Widget vipCard() {
return Container(
margin: EdgeInsets.fromLTRB(
16.w, MediaQuery.of(context).padding.top + 25.h, 16.w, 8.h),
height: 167.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
),
child: Stack(
// alignment: Alignment.center,
children: [
Image.asset(
"assets/image/vip_card.webp",
fit: BoxFit.fill, //
height: 167.h,
),
Container(
padding: EdgeInsets.all(16.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
"回乡VIP卡",
style: TextStyle(
color: Color(0xff32A060),
fontSize: 24.sp,
fontWeight: MyFontWeight.semi_bold,
),
)),
Text(
widget?.vipCardHome?.member?.nickname ?? "",
style: TextStyle(
color: Colors.white,
fontSize: 15.sp,
fontWeight: MyFontWeight.regular,
),
),
SizedBox(
height: 15.h,
),
if (widget?.vipCardHome?.member?.isVip ?? false)
Text(
"有效期至 ${(widget?.vipCardHome?.member?.vipExpire ?? "").substring(0,( widget?.vipCardHome?.member?.vipExpire ?? "").indexOf(" "))}",
style: TextStyle(
color: Color(0xffFFFFFF),
fontSize: 13.sp,
fontWeight: MyFontWeight.regular,
),
),
],
),
),
],
),
);
}
Widget vipCardList() {
return Container(
height: 132.h,
margin: EdgeInsets.symmetric(horizontal: 14.w),
child: ListView.builder(
scrollDirection: Axis.horizontal,
physics: BouncingScrollPhysics(),
itemCount: widget?.vipCardHome?.cards?.length ?? 0,
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
setState(() {
selectIndex = position;
if (widget?.vipCardHome?.cards[selectIndex]?.autoSubscribe ??
false) {
vipTreatyShowBottomSheet();
} else {
vipShowBottomSheet();
}
});
},
child: vipCardItem(widget?.vipCardHome?.cards[position], position),
);
},
),
);
}
Widget vipCardItem(Cards cards, index) {
return Expanded(
child: Stack(
alignment: Alignment.topRight,
children: [
Container(
height: double.infinity,
width: 166.w,
alignment: Alignment.center,
padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 25.h),
margin: EdgeInsets.only(right: 15.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.w),
color: Color(selectIndex == index ? 0xffF0FAF4 : 0xffffffff),
border: Border.all(
color: Color(selectIndex == index ? 0xff32A060 : 0xFFEAEAEA),
width: 2,
),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
),
child: Column(
children: [
Row(
children: [
Expanded(
child: Text(
"${cards?.duration.toString() ?? ""}",
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.black,
fontSize: 15.sp,
fontWeight: MyFontWeight.medium,
),
),
),
Expanded(
child: Text(
cards?.name ?? "",
textAlign: TextAlign.center,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Colors.black,
fontSize: 15.sp,
fontWeight: MyFontWeight.medium,
),
),
),
],
),
SizedBox(
height: 10.h,
),
Text(
"${AppUtils.calculateDouble(double.tryParse(cards?.price ?? ""))}",
textAlign: TextAlign.center,
style: TextStyle(
color: Color(0xff32A060),
fontSize: 36.sp,
fontWeight: MyFontWeight.medium,
),
),
],
),
),
if (cards.autoSubscribe)
Container(
padding: EdgeInsets.symmetric(vertical: 4.h, horizontal: 6.w),
margin: EdgeInsets.only(right: 15.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topRight: Radius.circular(6.r),
bottomLeft: Radius.circular(6.r),
),
color: Color(0xff32A060),
),
child: Text(
"更优惠",
style: TextStyle(
color: Colors.white,
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
)
],
));
}
///
vipTreatyShowBottomSheet() {
showModalBottomSheet(
builder: (BuildContext context) {
return treatyBuildBottomSheetWidget(context);
},
backgroundColor: Colors.transparent,
barrierColor: Colors.transparent,
context: context);
}
Widget treatyBuildBottomSheetWidget(BuildContext context) {
return Container(
padding: EdgeInsets.symmetric(vertical: 20.h, horizontal: 14.w),
height: 127.h,
decoration: new BoxDecoration(
color: Colors.white,
borderRadius: new BorderRadius.only(
topLeft: const Radius.circular(6.0),
topRight: const Radius.circular(6.0))),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(left: 4.w),
child: Text.rich(
TextSpan(
children: [
TextSpan(
text: "开通即默认同意",
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
color: Color(0xff4D4D4D),
),
),
TextSpan(
text: "《回乡VIP会员卡规则协议》",
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
color: Color(0xff32A060),
),
),
],
),
textDirection: TextDirection.ltr,
),
),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
vipShowBottomSheet();
},
child: Container(
height: 40.h,
alignment: Alignment.center,
margin: EdgeInsets.only(top: 26.h),
padding: EdgeInsets.symmetric(horizontal: 16.w),
decoration: new BoxDecoration(
color: Color(0xff32A060),
borderRadius: BorderRadius.circular(24)),
child: Text(
"立刻开通",
style: TextStyle(
fontSize: 16.sp,
height: 1.3.h,
fontWeight: MyFontWeight.regular,
color: Color(0xFFFFFFFF),
),
),
),
)
],
));
}
///
vipShowBottomSheet() {
showModalBottomSheet(
builder: (BuildContext context) {
return StatefulBuilder(builder: (
context,
state,
) {
return buildBottomSheetWidget(context, state);
});
},
backgroundColor: Colors.transparent,
context: context);
}
Widget buildBottomSheetWidget(BuildContext context, state) {
return Container(
padding: EdgeInsets.all(16),
decoration: new BoxDecoration(
color: Colors.white,
borderRadius: new BorderRadius.only(
topLeft: const Radius.circular(8.0),
topRight: const Radius.circular(8.0))),
child: Container(
height: 230.h,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
children: [
Expanded(
child: Text(
"支付方式",
textAlign: TextAlign.center,
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 15.sp,
color: Color(0xff0D0D0D),
),
)),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Icon(
Icons.clear,
color: Colors.black,
),
),
],
),
GestureDetector(
onTap: () {
state(() {
payType = 1;
});
},
child: Container(
padding: EdgeInsets.only(
left: 14.w, right: 32.w, top: 11.h, bottom: 11.h),
margin: EdgeInsets.only(top: 17.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.w),
color: Color(payType == 1 ? 0xFFF0FAF4 : 0xffF9F9F9),
border: Border.all(
color: Color(payType == 1 ? 0xFF32A060 : 0xFFFAFAFA),
width: payType == 1 ? 2 : 0,
),
boxShadow: [
BoxShadow(
color: Color(0xffF9F9F9).withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
),
child: Row(
children: [
Image.asset(
"assets/image/icon_we_chat.webp",
width: 20,
fit: BoxFit.fill,
height: 20,
),
SizedBox(
width: 8.w,
),
Text(
S.of(context).weixinzhifu,
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 15.sp,
color: Color(0xff0D0D0D),
),
),
SizedBox(
width: 20.w,
),
],
),
),
),
GestureDetector(
onTap: () {
state(() {
payType = 2;
});
},
child: Container(
padding: EdgeInsets.only(
left: 14.w, right: 32.w, top: 11.h, bottom: 11.h),
margin: EdgeInsets.only(top: 17.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.w),
color: Color(payType == 2 ? 0xFFF0FAF4 : 0xffF9F9F9),
border: Border.all(
color: Color(payType == 2 ? 0xFF32A060 : 0xFFFAFAFA),
width: payType == 2 ? 2 : 0,
),
boxShadow: [
BoxShadow(
color: Color(0xffF9F9F9).withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
),
child: Row(
children: [
Image.asset(
"assets/image/icon_alipay.webp",
width: 20,
fit: BoxFit.fill,
height: 20,
),
SizedBox(
width: 8.w,
),
Text(
"支付宝支付",
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 15.sp,
color: Color(0xff0D0D0D),
),
),
SizedBox(
width: 20.w,
),
],
),
),
),
Container(
width: double.infinity,
height: 40.h,
margin: EdgeInsets.only(top: 30.h),
decoration: new BoxDecoration(
color: Color(0xff383A38),
borderRadius: BorderRadius.circular(24)),
child: Row(
children: [
SizedBox(
width: 16.w,
),
Expanded(
child: Text.rich(
TextSpan(
children: [
TextSpan(
text: "",
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
color: Colors.white,
),
),
TextSpan(
text: AppUtils.calculateDouble(double.tryParse(
widget?.vipCardHome?.cards[selectIndex]
?.price ??
"")),
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 20.sp,
color: Colors.white,
),
),
],
),
textDirection: TextDirection.ltr,
)),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
recharge();
},
child: Container(
height: double.infinity,
alignment: Alignment.center,
padding: EdgeInsets.symmetric(horizontal: 16.w),
decoration: new BoxDecoration(
color: Color(0xff32A060),
borderRadius: BorderRadius.circular(24)),
child: Text(
"立刻支付",
style: TextStyle(
fontSize: 16.sp,
height: 1.3.h,
fontWeight: MyFontWeight.regular,
color: Color(0xFFFFFFFF),
),
),
),
)
],
),
)
],
),
));
}
}

7
pubspec.lock

@ -434,6 +434,13 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "4.0.1" version: "4.0.1"
number_precision:
dependency: "direct main"
description:
name: number_precision
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.2+1"
numerus: numerus:
dependency: transitive dependency: transitive
description: description:

4
pubspec.yaml

@ -3,7 +3,7 @@ description: 一心回乡.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 3.1.4+28 version: 3.1.5+29
environment: environment:
sdk: ">=2.7.0 <3.0.0" sdk: ">=2.7.0 <3.0.0"
@ -33,6 +33,8 @@ dependencies:
flutter_staggered_grid_view: ^0.4.0 # Null safety flutter_staggered_grid_view: ^0.4.0 # Null safety
pull_to_refresh: ^2.0.0 # Null safety pull_to_refresh: ^2.0.0 # Null safety
number_precision: ^2.0.2+1
permission_handler: ^5.0.1+1 permission_handler: ^5.0.1+1
flutter_bmflocation: ^1.0.3 flutter_bmflocation: ^1.0.3

Loading…
Cancel
Save