diff --git a/assets/image/2x/vip_card.webp b/assets/image/2x/vip_card.webp new file mode 100644 index 00000000..26396eb4 Binary files /dev/null and b/assets/image/2x/vip_card.webp differ diff --git a/assets/image/2x/vip_discount_left.webp b/assets/image/2x/vip_discount_left.webp new file mode 100644 index 00000000..7861267f Binary files /dev/null and b/assets/image/2x/vip_discount_left.webp differ diff --git a/assets/image/2x/vip_discount_right.webp b/assets/image/2x/vip_discount_right.webp new file mode 100644 index 00000000..0dd2e42a Binary files /dev/null and b/assets/image/2x/vip_discount_right.webp differ diff --git a/assets/image/2x/vip_lock.webp b/assets/image/2x/vip_lock.webp new file mode 100644 index 00000000..493badf7 Binary files /dev/null and b/assets/image/2x/vip_lock.webp differ diff --git a/assets/image/2x/vip_shop_hg.webp b/assets/image/2x/vip_shop_hg.webp new file mode 100644 index 00000000..9424d0a6 Binary files /dev/null and b/assets/image/2x/vip_shop_hg.webp differ diff --git a/assets/image/2x/vip_shop_hx.webp b/assets/image/2x/vip_shop_hx.webp new file mode 100644 index 00000000..29f2e83e Binary files /dev/null and b/assets/image/2x/vip_shop_hx.webp differ diff --git a/assets/image/2x/vip_shop_qj.webp b/assets/image/2x/vip_shop_qj.webp new file mode 100644 index 00000000..daaf44b4 Binary files /dev/null and b/assets/image/2x/vip_shop_qj.webp differ diff --git a/assets/image/2x/vip_wx.webp b/assets/image/2x/vip_wx.webp new file mode 100644 index 00000000..3b4f1471 Binary files /dev/null and b/assets/image/2x/vip_wx.webp differ diff --git a/assets/image/2x/vip_xf.webp b/assets/image/2x/vip_xf.webp new file mode 100644 index 00000000..1ee39825 Binary files /dev/null and b/assets/image/2x/vip_xf.webp differ diff --git a/assets/image/3x/vip_card.webp b/assets/image/3x/vip_card.webp new file mode 100644 index 00000000..85fff480 Binary files /dev/null and b/assets/image/3x/vip_card.webp differ diff --git a/assets/image/3x/vip_discount_left.webp b/assets/image/3x/vip_discount_left.webp new file mode 100644 index 00000000..dcb060f5 Binary files /dev/null and b/assets/image/3x/vip_discount_left.webp differ diff --git a/assets/image/3x/vip_discount_right.webp b/assets/image/3x/vip_discount_right.webp new file mode 100644 index 00000000..88145883 Binary files /dev/null and b/assets/image/3x/vip_discount_right.webp differ diff --git a/assets/image/3x/vip_lock.webp b/assets/image/3x/vip_lock.webp new file mode 100644 index 00000000..d506c686 Binary files /dev/null and b/assets/image/3x/vip_lock.webp differ diff --git a/assets/image/3x/vip_shop_hg.webp b/assets/image/3x/vip_shop_hg.webp new file mode 100644 index 00000000..f8e06e5d Binary files /dev/null and b/assets/image/3x/vip_shop_hg.webp differ diff --git a/assets/image/3x/vip_shop_hx.webp b/assets/image/3x/vip_shop_hx.webp new file mode 100644 index 00000000..1404ca80 Binary files /dev/null and b/assets/image/3x/vip_shop_hx.webp differ diff --git a/assets/image/3x/vip_shop_qj.webp b/assets/image/3x/vip_shop_qj.webp new file mode 100644 index 00000000..cf7f8077 Binary files /dev/null and b/assets/image/3x/vip_shop_qj.webp differ diff --git a/assets/image/3x/vip_wx.webp b/assets/image/3x/vip_wx.webp new file mode 100644 index 00000000..bb114efb Binary files /dev/null and b/assets/image/3x/vip_wx.webp differ diff --git a/assets/image/3x/vip_xf.webp b/assets/image/3x/vip_xf.webp new file mode 100644 index 00000000..49d22244 Binary files /dev/null and b/assets/image/3x/vip_xf.webp differ diff --git a/assets/image/vip_card.webp b/assets/image/vip_card.webp new file mode 100644 index 00000000..c1f899f5 Binary files /dev/null and b/assets/image/vip_card.webp differ diff --git a/assets/image/vip_discount_left.webp b/assets/image/vip_discount_left.webp new file mode 100644 index 00000000..982f307b Binary files /dev/null and b/assets/image/vip_discount_left.webp differ diff --git a/assets/image/vip_discount_right.webp b/assets/image/vip_discount_right.webp new file mode 100644 index 00000000..d64f91fc Binary files /dev/null and b/assets/image/vip_discount_right.webp differ diff --git a/assets/image/vip_lock.webp b/assets/image/vip_lock.webp new file mode 100644 index 00000000..67e92bf2 Binary files /dev/null and b/assets/image/vip_lock.webp differ diff --git a/assets/image/vip_shop_hg.webp b/assets/image/vip_shop_hg.webp new file mode 100644 index 00000000..29a4c2d1 Binary files /dev/null and b/assets/image/vip_shop_hg.webp differ diff --git a/assets/image/vip_shop_hx.webp b/assets/image/vip_shop_hx.webp new file mode 100644 index 00000000..bbb27329 Binary files /dev/null and b/assets/image/vip_shop_hx.webp differ diff --git a/assets/image/vip_shop_qj.webp b/assets/image/vip_shop_qj.webp new file mode 100644 index 00000000..b320f51d Binary files /dev/null and b/assets/image/vip_shop_qj.webp differ diff --git a/assets/image/vip_wx.webp b/assets/image/vip_wx.webp new file mode 100644 index 00000000..5262da69 Binary files /dev/null and b/assets/image/vip_wx.webp differ diff --git a/assets/image/vip_xf.webp b/assets/image/vip_xf.webp new file mode 100644 index 00000000..273a9d72 Binary files /dev/null and b/assets/image/vip_xf.webp differ diff --git a/assets/svg/huixiang_vip.svg b/assets/svg/huixiang_vip.svg new file mode 100644 index 00000000..03816677 --- /dev/null +++ b/assets/svg/huixiang_vip.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index 58838ac9..6c4a2999 100644 --- a/lib/main.dart +++ b/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/union/location_map_page.dart'; import 'package:huixiang/utils/ImgCachePath.dart'; +import 'package:huixiang/vip/vip_page.dart'; import 'package:huixiang/web/web_page.dart'; import 'package:huixiang/union/union_details_page.dart'; diff --git a/lib/main_page.dart b/lib/main_page.dart index 2f61661f..a42d8007 100644 --- a/lib/main_page.dart +++ b/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/native_event_handler.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:permission_handler/permission_handler.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -53,6 +54,7 @@ class _MainPage extends State with WidgetsBindingObserver { final GlobalKey homePageKey = GlobalKey(); final GlobalKey minePageKey = GlobalKey(); final GlobalKey unionPageKey = GlobalKey(); + // final GlobalKey vipPageKey = GlobalKey(); // List iconn; ApiService apiService; @@ -128,6 +130,7 @@ class _MainPage extends State with WidgetsBindingObserver { },invite:invite,interviewCouponList:interviewCouponList,firstLoginCouponList:firstLoginCouponList,), // MainHomePage(), UnionPage(unionPageKey,0), + // VipPage(vipPageKey), Platform.isAndroid ? (ExamineInstance.instance.isExamine?OrderPage():CommunityPage()) :CommunityPage(), // CommunityPage(), MinePage(minePageKey), @@ -136,6 +139,7 @@ class _MainPage extends State with WidgetsBindingObserver { icons = [ "assets/svg/jingbi.svg", "assets/svg/lianmeng.svg", + // "assets/svg/huixiang_vip.svg", "assets/svg/shequn.svg", "assets/svg/wode.svg", ]; @@ -425,6 +429,7 @@ class _MainPage extends State with WidgetsBindingObserver { bottomNavigationItem(S.of(context).main_menu1, 0), bottomNavigationItem(S.of(context).main_menu2, 1), // 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(S.of(context).main_menu4, 3), ], diff --git a/lib/mine/mine_wallet_page.dart b/lib/mine/mine_wallet_page.dart index 96ccbb14..925defd5 100644 --- a/lib/mine/mine_wallet_page.dart +++ b/lib/mine/mine_wallet_page.dart @@ -2,11 +2,9 @@ import 'dart:convert'; import 'dart:io'; import 'package:dio/dio.dart'; -import 'package:flare_flutter/base/actor_ellipse.dart'; import 'package:flutter/material.dart'; import 'package:huixiang/generated/l10n.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/user_bill.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_footer.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:pull_to_refresh/pull_to_refresh.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 { @override @@ -52,7 +53,7 @@ class _MineWalletPage extends State { UserInfo.fromJson(jsonDecode(sharedPreferences.getString('user'))); mgreenMoney = double.tryParse(userInfo.greenMoney); mBalance = double.tryParse(userInfo.money); - pBalance = mgreenMoney + mBalance; + pBalance = mBalance+mgreenMoney; activityMoney = double.tryParse(userInfo.activityMoney); if (mounted) setState(() {}); String token = sharedPreferences.getString("token"); @@ -73,7 +74,7 @@ class _MineWalletPage extends State { mgreenMoney = double.tryParse(userInfo.greenMoney); activityMoney = double.tryParse(userInfo.activityMoney); mBalance = double.tryParse(userInfo.money); - pBalance = mBalance + mgreenMoney; + pBalance = mBalance+mgreenMoney; if (mounted) setState(() {}); } } @@ -467,7 +468,7 @@ class _MineWalletPage extends State { width: 24.w, ), Text( - "$pBalance", + "${NP.plus(mBalance,mgreenMoney)}", style: TextStyle( fontWeight: MyFontWeight.semi_bold, fontSize: 50.sp, @@ -544,7 +545,7 @@ class _MineWalletPage extends State { height: 4.h, ), Text( - "$mBalance", + "${NP.strip(mBalance)}", style: TextStyle( fontSize: 18.sp, fontWeight: MyFontWeight.semi_bold, @@ -574,7 +575,7 @@ class _MineWalletPage extends State { height: 4.h, ), Text( - "$activityMoney", + "${NP.strip(activityMoney)}", style: TextStyle( fontSize: 18.sp, fontWeight: MyFontWeight.semi_bold, @@ -604,7 +605,7 @@ class _MineWalletPage extends State { height: 4.h, ), Text( - "$mgreenMoney", + "${NP.strip(mgreenMoney)}", style: TextStyle( fontSize: 18.sp, fontWeight: MyFontWeight.semi_bold, @@ -626,198 +627,8 @@ class _MineWalletPage extends State { ); } - // 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 { await Navigator.of(context).pushNamed('/router/recharge_page'); 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, -// ), -// ], -// ); -// } } diff --git a/lib/retrofit/data/findMiNiGroupList.dart b/lib/retrofit/data/findMiNiGroupList.dart index 6b5a7d9b..63f453ce 100644 --- a/lib/retrofit/data/findMiNiGroupList.dart +++ b/lib/retrofit/data/findMiNiGroupList.dart @@ -85,6 +85,7 @@ class ProductListBean { String weight; String applyPrice; String price; + String vipPrice; int stock; int sellCount; int needLogistics; @@ -117,6 +118,7 @@ class ProductListBean { productListBean.weight = map['weight']; productListBean.applyPrice = map['applyPrice']; productListBean.price = map['price']; + productListBean.vipPrice = map['vipPrice']; productListBean.stock = map['stock']; productListBean.sellCount = map['sellCount']; productListBean.needLogistics = map['needLogistics']; @@ -149,6 +151,7 @@ class ProductListBean { "weight": weight, "applyPrice": applyPrice, "price": price, + "vipPrice":vipPrice, "stock": stock, "sellCount": sellCount, "needLogistics": needLogistics, diff --git a/lib/retrofit/data/vip_card_home.dart b/lib/retrofit/data/vip_card_home.dart new file mode 100644 index 00000000..8f2f02c8 --- /dev/null +++ b/lib/retrofit/data/vip_card_home.dart @@ -0,0 +1,968 @@ +/// member : {"masterId":"0","masterCardRankName":null,"vipNo":"1379254113602109440","nickname":"哈哈哈","headimg":"https://pos.upload.lotus-wallet.com/admin/2021/08/1f8d55ed-85d2-42a2-b155-6737a66226e8.jpg","userType":true,"sex":"0","level":1,"addressId":"0","remark":"","phone":"13052919193","createTime":"2021-04-06 10:06:21","birth":"1998-09-17","balance":null,"money":"31.12","activityMoney":"0.00","greenMoney":"4872.00","expendAmount":"180.02","organic":0,"points":"741","isBind":true,"memberRankVo":{"id":"1462684050274648064","rankName":"白银会员","rankOrigin":69,"rankContent":"","rankImg":"https://pos.upload.lotus-wallet.com/MDAwMA==/2021/11/7453eb74-661e-42b7-b575-8accc00fcbf5.png","status":true,"nextId":"1462684471177248768","nextName":"黄金会员","nextOrigin":20000},"age":24,"inviteCode":"MFZPXU","inviteNumber":4,"todayInviteNumber":0,"signature":"","background":"https://pos.upload.gznl.top/admin/2022/03/dd0af83c-1f2b-4217-bf0c-cdb7a809caca.jpeg","certification":null,"hasPayPassword":true,"isVip":false,"vipExpire":null,"isVipSubscribe":false,"vipDuration":33} +/// cards : [{"id":"1579679485240803328","createTime":"2022-10-11 11:45:13","createUser":"1","updateTime":"2022-10-11 11:48:48","updateUser":"1","name":"888绿卡","duration":30,"price":"188.00","autoSubscribe":true,"isDelete":true},{"id":"1579731753377988608","createTime":"2022-10-11 15:12:55","createUser":"1","updateTime":"2022-10-11 15:12:55","updateUser":"1","name":"一分钱订阅","duration":90,"price":"0.01","autoSubscribe":true,"isDelete":true}] +/// coupons : [] +/// productVips : [{"id":"1580078947226353664","createTime":"2022-10-12 14:12:32","createUser":"1310841663890915328","updateTime":"2022-10-12 14:12:32","updateUser":"1310841663890915328","supplierName":"58","storeId":"1300372027722432512","categoryId":"1300687829071822848","groupId":"1307148205753892864","shortName":"会员商品原价100 会员价6","productName":"会员商品","sellDesc":"","productCode":"PRO202210121412320000000000001","weight":"0","applyPrice":"100.00","price":"101.00","vipPrice":"6.00","stock":882,"sellCount":6,"needLogistics":0,"oversold":1,"organic":0,"status":1,"posShow":true,"productType":0,"productNumber":1,"setMeal":1,"attrStyle":0,"detail":"","isDelete":0,"printerFlag":"DEFAULT","materials":null,"materialId":null,"details":"

1534

","thumbnailImg":"","info":"会员商品原价100 会员价6","buyCount":0,"sellCountLimit":0,"vipDiscount":"95.00"},{"id":"1578663655623360512","createTime":"2022-10-08 16:28:40","createUser":"1336877238389309440","updateTime":"2022-10-10 10:59:39","updateUser":"1336877238389309440","supplierName":"一杯奶茶","storeId":"1328618782985289728","categoryId":"1300688133322440704","groupId":"1391204546956492800","shortName":"一杯奶茶","productName":"一杯奶茶","sellDesc":"","productCode":"PRO202210081628400000000000001","weight":"0","applyPrice":"100.00","price":"61.00","vipPrice":"8.00","stock":-39,"sellCount":38,"needLogistics":0,"oversold":1,"organic":0,"status":1,"posShow":true,"productType":0,"productNumber":1,"setMeal":1,"attrStyle":0,"detail":"","isDelete":0,"printerFlag":"DEFAULT","materials":null,"materialId":null,"details":"

一杯奶茶

","thumbnailImg":"","info":"一杯奶茶","buyCount":-1,"sellCountLimit":0,"vipDiscount":"53.00"},{"id":"1567029160059076608","createTime":"2022-09-06 13:57:20","createUser":"1333246101196636160","updateTime":"2022-10-10 14:37:40","updateUser":"1333246101196636160","supplierName":"海峡姐妹茶","storeId":"1333246101343436800","categoryId":"1300688133322440704","groupId":"1524327158112059392","shortName":"使用茉莉雪芽为茶底,用自有农场有机洛神花熬制的洛神花汁,洛神花中含有丰富的蛋白质,维生素,氨基酸,花青素,可以排毒养颜,清热祛火,降压,搭配新鲜红石榴,入口石榴的清甜中带着微酸,尾段是茶香。","productName":"霸气红宝石","sellDesc":"","productCode":"PRO202209061357200000000000001","weight":"0","applyPrice":"23.00","price":"23.00","vipPrice":"10.00","stock":99905,"sellCount":67,"needLogistics":0,"oversold":1,"organic":0,"status":1,"posShow":true,"productType":0,"productNumber":1,"setMeal":1,"attrStyle":1,"detail":"","isDelete":0,"printerFlag":"DEFAULT","materials":null,"materialId":null,"details":"","thumbnailImg":"https://pos.upload.lotus-wallet.com/1175/2022/09/b3b773a3-ea3e-4696-bd89-eece441144f1.jpg","info":"","buyCount":-38,"sellCountLimit":0,"vipDiscount":"13.00"},{"id":"1557552263126319104","createTime":"2022-08-11 10:19:32","createUser":"1333246101196636160","updateTime":"2022-08-11 10:19:32","updateUser":"1333246101196636160","supplierName":"前进麦味烘焙","storeId":"1432164681279078400","categoryId":"1343391656220557312","groupId":"1535192671235080192","shortName":"减糖布丁塔壳,加入低温烘烤农场有机南瓜内陷和布丁液,甜而不腻。","productName":"南瓜布丁塔(2入装)","sellDesc":"","productCode":"PRO202208111019320000000000001","weight":"0","applyPrice":"12.00","price":"12.00","vipPrice":null,"stock":990,"sellCount":6,"needLogistics":1,"oversold":1,"organic":0,"status":1,"posShow":true,"productType":0,"productNumber":1,"setMeal":1,"attrStyle":0,"detail":"","isDelete":0,"printerFlag":"DEFAULT","materials":null,"materialId":null,"details":"","thumbnailImg":"https://pos.upload.lotus-wallet.com/1175/2022/08/8db6c09b-c403-4ae7-aa20-07843d292048.png","info":"","buyCount":-4,"sellCountLimit":0,"vipDiscount":"0.00"},{"id":"1555068186037059584","createTime":"2022-08-04 13:48:42","createUser":"1509798398956404736","updateTime":"2022-08-04 14:19:46","updateUser":"1509798398956404736","supplierName":"海峡姐妹","storeId":"1511895265261387776","categoryId":"1460889654206136320","groupId":"1555011116692668416","shortName":"分销","productName":"SIS小酒馆精致单人套餐","sellDesc":"","productCode":"PRO202208041348410000000000001","weight":"0","applyPrice":"118.00","price":"118.00","vipPrice":null,"stock":998,"sellCount":2,"needLogistics":1,"oversold":1,"organic":0,"status":1,"posShow":true,"productType":0,"productNumber":1,"setMeal":1,"attrStyle":0,"detail":"","isDelete":0,"printerFlag":"DEFAULT","materials":null,"materialId":null,"details":"

1.饮品任选一桶(含啤酒,1.5L装).
2.精选冷卤味时令拼盘一份.
3.精选小吃拼盘一份.

","thumbnailImg":"","info":"","buyCount":0,"sellCountLimit":0,"vipDiscount":"0.00"},{"id":"1555070675176128512","createTime":"2022-08-04 13:58:35","createUser":"1509798398956404736","updateTime":"2022-08-15 17:27:07","updateUser":"1509798398956404736","supplierName":"海峡姐妹","storeId":"1511895265261387776","categoryId":"1460889654206136320","groupId":"1555011116692668416","shortName":"分销","productName":"家庭游玩套餐一","sellDesc":"","productCode":"PRO202208041358350000000000003","weight":"0","applyPrice":"318.00","price":"318.00","vipPrice":null,"stock":999,"sellCount":1,"needLogistics":1,"oversold":1,"organic":0,"status":1,"posShow":true,"productType":0,"productNumber":1,"setMeal":1,"attrStyle":0,"detail":"","isDelete":0,"printerFlag":"DEFAULT","materials":null,"materialId":null,"details":"

① 饮品任选4杯(含啤酒).
② 小吃任选4份.
③ 特色冰棒4根.
④ 小酒馆体验票2张
⑤ 玩具兑换券1张(水枪/飞盘二选一

","thumbnailImg":"","info":"","buyCount":0,"sellCountLimit":0,"vipDiscount":"0.00"},{"id":"1555071062826287104","createTime":"2022-08-04 14:00:08","createUser":"1509798398956404736","updateTime":"2022-08-04 14:19:23","updateUser":"1509798398956404736","supplierName":"海峡姐妹","storeId":"1511895265261387776","categoryId":"1460889654206136320","groupId":"1555011116692668416","shortName":"分销","productName":"家庭游玩套餐二","sellDesc":"","productCode":"PRO202208041400070000000000001","weight":"0","applyPrice":"128.00","price":"128.00","vipPrice":null,"stock":998,"sellCount":2,"needLogistics":1,"oversold":1,"organic":0,"status":1,"posShow":true,"productType":0,"productNumber":1,"setMeal":1,"attrStyle":0,"detail":"","isDelete":0,"printerFlag":"DEFAULT","materials":null,"materialId":null,"details":"

1.提供小帐篷一顶,全家不限时使用.
2.园区内餐车在售饮品任选两杯(含啤酒).
3.台湾小吃街摊位在售小吃任选一份.
4.古桑园特色桑椹冰棍两根.

","thumbnailImg":"","info":"","buyCount":0,"sellCountLimit":0,"vipDiscount":"0.00"},{"id":"1555071811366944768","createTime":"2022-08-04 14:03:06","createUser":"1509798398956404736","updateTime":"2022-08-15 17:27:55","updateUser":"1509798398956404736","supplierName":"海峡姐妹","storeId":"1511895265261387776","categoryId":"1460889654206136320","groupId":"1555011116692668416","shortName":"分销","productName":"一家三口.家庭套餐一 (儿童1.2m以下)","sellDesc":"","productCode":"PRO202208041403060000000000001","weight":"0","applyPrice":"80.00","price":"80.00","vipPrice":null,"stock":998,"sellCount":3,"needLogistics":1,"oversold":1,"organic":0,"status":1,"posShow":true,"productType":0,"productNumber":1,"setMeal":1,"attrStyle":0,"detail":"","isDelete":0,"printerFlag":"DEFAULT","materials":null,"materialId":null,"details":"

园区大门

\n

1.成人公园门票两张.
2.儿童身高1.2米以下免票一张.

\n

儿童水上乐园

\n

1.儿童水上乐园,一名儿童不限时畅玩.

","thumbnailImg":"","info":"","buyCount":0,"sellCountLimit":0,"vipDiscount":"0.00"},{"id":"1555072466726944768","createTime":"2022-08-04 14:05:43","createUser":"1509798398956404736","updateTime":"2022-08-15 17:28:22","updateUser":"1509798398956404736","supplierName":"海峡姐妹","storeId":"1511895265261387776","categoryId":"1460889654206136320","groupId":"1555011116692668416","shortName":"分销","productName":"一家三口.家庭套餐二 (儿童1.2m以上)","sellDesc":"","productCode":"PRO202208041405420000000000003","weight":"0","applyPrice":"120.00","price":"120.00","vipPrice":null,"stock":999,"sellCount":1,"needLogistics":1,"oversold":1,"organic":0,"status":1,"posShow":true,"productType":0,"productNumber":1,"setMeal":1,"attrStyle":0,"detail":"","isDelete":0,"printerFlag":"DEFAULT","materials":null,"materialId":null,"details":"

园区大门

\n

1.成人公园门票两张.
2.儿童身高1.2米以上门票一张.

\n

儿童水上乐园

\n

1.儿童水上乐园,一名儿童不限时畅玩.

","thumbnailImg":"","info":"","buyCount":0,"sellCountLimit":0,"vipDiscount":"0.00"},{"id":"1555072974883651584","createTime":"2022-08-04 14:07:44","createUser":"1509798398956404736","updateTime":"2022-08-15 17:28:47","updateUser":"1509798398956404736","supplierName":"海峡姐妹","storeId":"1511895265261387776","categoryId":"1460889654206136320","groupId":"1555011116692668416","shortName":"分销","productName":"一家三口.家庭套餐三 (儿童1.2m以上)","sellDesc":"","productCode":"PRO202208041407430000000000001","weight":"0","applyPrice":"258.00","price":"258.00","vipPrice":null,"stock":994,"sellCount":6,"needLogistics":1,"oversold":1,"organic":0,"status":1,"posShow":true,"productType":0,"productNumber":1,"setMeal":1,"attrStyle":0,"detail":"","isDelete":0,"printerFlag":"DEFAULT","materials":null,"materialId":null,"details":"

园区大门

\n

1.成人公园门票两张.
2.儿童身高1.2米以上门票一张.

\n

三角帐篷/水上乐园

\n

1.提供三角帐篷一顶,全家不限时使用.
2.儿童水上乐园,一名儿童不限时畅玩.
3.古桑园特色桑椹冰棍两根.
4.园区内餐车在售饮品任选两杯+回乡精酿啤酒一杯.
5.台湾小吃街摊位在售小吃任选一份.

","thumbnailImg":"","info":"","buyCount":0,"sellCountLimit":0,"vipDiscount":"0.00"},{"id":"1555075594444603392","createTime":"2022-08-04 14:18:08","createUser":"1509798398956404736","updateTime":"2022-08-04 14:18:08","updateUser":"1509798398956404736","supplierName":"海峡姐妹","storeId":"1511895265261387776","categoryId":"1460889654206136320","groupId":"1555011116692668416","shortName":"分销","productName":"小酒馆体验券","sellDesc":"","productCode":"PRO202208041418080000000000001","weight":"0","applyPrice":"20.00","price":"20.00","vipPrice":null,"stock":991,"sellCount":9,"needLogistics":1,"oversold":1,"organic":0,"status":1,"posShow":true,"productType":0,"productNumber":1,"setMeal":1,"attrStyle":0,"detail":"","isDelete":0,"printerFlag":"DEFAULT","materials":null,"materialId":null,"details":"

小酒馆体验券

","thumbnailImg":"","info":"","buyCount":0,"sellCountLimit":0,"vipDiscount":"0.00"},{"id":"1555519619937075200","createTime":"2022-08-05 19:42:32","createUser":"1347839370706550784","updateTime":"2022-08-05 19:42:40","updateUser":"1347839370706550784","supplierName":"回乡农场火锅","storeId":"1347853925696405504","categoryId":"1300687829071822848","groupId":"1305419452992455656","shortName":"赠送","productName":"锅底赠送卷卷菜","sellDesc":"","productCode":"PRO202208051942320000000000001","weight":"0","applyPrice":"0.00","price":"0.00","vipPrice":null,"stock":0,"sellCount":0,"needLogistics":1,"oversold":1,"organic":0,"status":1,"posShow":false,"productType":0,"productNumber":1,"setMeal":1,"attrStyle":0,"detail":"","isDelete":1,"printerFlag":"DEFAULT","materials":null,"materialId":null,"details":"","thumbnailImg":"","info":"","buyCount":0,"sellCountLimit":0,"vipDiscount":"0.00"},{"id":"1557551663693168640","createTime":"2022-08-11 10:17:09","createUser":"1333246101196636160","updateTime":"2022-09-07 10:19:00","updateUser":"1333246101196636160","supplierName":"前进麦味烘焙","storeId":"1432164681279078400","categoryId":"1343391656220557312","groupId":"1433972467260456960","shortName":"低糖低油南瓜吐司面团,搭配纯天然农场有机南瓜和纯燕麦,南瓜低温烘烤保留营养元素,加入燕麦提升人体膳食纤维,更注重健康营养搭配","productName":"燕麦南瓜吐司","sellDesc":"","productCode":"PRO202208111017090000000000001","weight":"0","applyPrice":"18.00","price":"18.00","vipPrice":null,"stock":956,"sellCount":30,"needLogistics":1,"oversold":1,"organic":0,"status":1,"posShow":false,"productType":0,"productNumber":1,"setMeal":1,"attrStyle":0,"detail":"","isDelete":0,"printerFlag":"DEFAULT","materials":null,"materialId":null,"details":"","thumbnailImg":"https://pos.upload.lotus-wallet.com/1175/2022/08/2e0c14fd-2717-4812-a355-a24fbef9a78a.png","info":"","buyCount":-18,"sellCountLimit":0,"vipDiscount":"0.00"},{"id":"1561985460165672960","createTime":"2022-08-23 15:55:29","createUser":"1347820292432461824","updateTime":"2022-09-04 21:53:26","updateUser":"1347820292432461824","supplierName":"百年川椒","storeId":"1300372027722432512","categoryId":"1300687829071822848","groupId":"1318729689669304320","shortName":"3-4人餐","productName":"虎年暴富晚市套餐","sellDesc":"","productCode":"PRO202208231555280000000000001","weight":"0","applyPrice":"401.00","price":"401.00","vipPrice":null,"stock":-16,"sellCount":16,"needLogistics":0,"oversold":1,"organic":0,"status":1,"posShow":true,"productType":0,"productNumber":1,"setMeal":1,"attrStyle":0,"detail":"","isDelete":0,"printerFlag":"DEFAULT","materials":null,"materialId":null,"details":"","thumbnailImg":"","info":"","buyCount":0,"sellCountLimit":0,"vipDiscount":"0.00"},{"id":"1560106924941246464","createTime":"2022-08-18 11:30:51","createUser":"1347839370706550784","updateTime":"2022-09-19 19:24:09","updateUser":"1347839370706550784","supplierName":"央厨","storeId":"1347853925696405504","categoryId":"1300687829071822848","groupId":"1315891390147724264","shortName":"","productName":"农场南瓜饼","sellDesc":"","productCode":"PRO202208181130500000000000001","weight":"0","applyPrice":"12.00","price":"12.00","vipPrice":null,"stock":-18,"sellCount":15,"needLogistics":1,"oversold":1,"organic":0,"status":1,"posShow":true,"productType":0,"productNumber":1,"setMeal":1,"attrStyle":0,"detail":"","isDelete":0,"printerFlag":"DEFAULT","materials":null,"materialId":null,"details":"","thumbnailImg":"https://pos.upload.lotus-wallet.com/1178/2022/08/e6bbd456-b542-4cfd-ac21-996341756da8.jpg","info":"","buyCount":0,"sellCountLimit":0,"vipDiscount":"0.00"},{"id":"1560107415041474560","createTime":"2022-08-18 11:32:48","createUser":"1347839370706550784","updateTime":"2022-09-19 19:25:02","updateUser":"1347839370706550784","supplierName":"央厨","storeId":"1347853925696405504","categoryId":"1300687829071822848","groupId":"1315891390147724264","shortName":"","productName":"南瓜椰奶糕 ","sellDesc":"","productCode":"PRO202208181132470000000000001","weight":"0","applyPrice":"28.00","price":"28.00","vipPrice":null,"stock":-5,"sellCount":-7,"needLogistics":1,"oversold":1,"organic":0,"status":0,"posShow":false,"productType":0,"productNumber":1,"setMeal":1,"attrStyle":0,"detail":"","isDelete":0,"printerFlag":"DEFAULT","materials":null,"materialId":null,"details":"","thumbnailImg":"https://pos.upload.lotus-wallet.com/1178/2022/08/a27093c5-6774-441f-9347-6e1a0abd0b87.jpg","info":"","buyCount":0,"sellCountLimit":0,"vipDiscount":"0.00"}] + +class VipCardHome { + VipCardHome({ + Member member, + List cards, + List coupons, + List productVips,}){ + _member = member; + _cards = cards; + _coupons = coupons; + _productVips = productVips; +} + + VipCardHome.fromJson(dynamic json) { + _member = json['member'] != null ? Member.fromJson(json['member']) : null; + if (json['cards'] != null) { + _cards = []; + json['cards'].forEach((v) { + _cards.add(Cards.fromJson(v)); + }); + } + // if (json['coupons'] != null) { + // _coupons = []; + // json['coupons'].forEach((v) { + // _coupons.add(Dynamic.fromJson(v)); + // }); + // } + if (json['productVips'] != null) { + _productVips = []; + json['productVips'].forEach((v) { + _productVips.add(ProductVips.fromJson(v)); + }); + } + } + Member _member; + List _cards; + List _coupons; + List _productVips; +VipCardHome copyWith({ Member member, + List cards, + List coupons, + List productVips, +}) => VipCardHome( member: member ?? _member, + cards: cards ?? _cards, + coupons: coupons ?? _coupons, + productVips: productVips ?? _productVips, +); + Member get member => _member; + List get cards => _cards; + List get coupons => _coupons; + List get productVips => _productVips; + + Map toJson() { + final map = {}; + if (_member != null) { + map['member'] = _member.toJson(); + } + if (_cards != null) { + map['cards'] = _cards.map((v) => v.toJson()).toList(); + } + if (_coupons != null) { + map['coupons'] = _coupons.map((v) => v.toJson()).toList(); + } + if (_productVips != null) { + map['productVips'] = _productVips.map((v) => v.toJson()).toList(); + } + return map; + } + +} + +/// id : "1580078947226353664" +/// createTime : "2022-10-12 14:12:32" +/// createUser : "1310841663890915328" +/// updateTime : "2022-10-12 14:12:32" +/// updateUser : "1310841663890915328" +/// supplierName : "58" +/// storeId : "1300372027722432512" +/// categoryId : "1300687829071822848" +/// groupId : "1307148205753892864" +/// shortName : "会员商品原价100 会员价6" +/// productName : "会员商品" +/// sellDesc : "" +/// productCode : "PRO202210121412320000000000001" +/// weight : "0" +/// applyPrice : "100.00" +/// price : "101.00" +/// vipPrice : "6.00" +/// stock : 882 +/// sellCount : 6 +/// needLogistics : 0 +/// oversold : 1 +/// organic : 0 +/// status : 1 +/// posShow : true +/// productType : 0 +/// productNumber : 1 +/// setMeal : 1 +/// attrStyle : 0 +/// detail : "" +/// isDelete : 0 +/// printerFlag : "DEFAULT" +/// materials : null +/// materialId : null +/// details : "

1534

" +/// thumbnailImg : "" +/// info : "会员商品原价100 会员价6" +/// buyCount : 0 +/// sellCountLimit : 0 +/// vipDiscount : "95.00" + +class ProductVips { + ProductVips({ + String id, + String createTime, + String createUser, + String updateTime, + String updateUser, + String supplierName, + String storeId, + String categoryId, + String groupId, + String shortName, + String productName, + String sellDesc, + String productCode, + String weight, + String applyPrice, + String price, + String vipPrice, + num stock, + num sellCount, + num needLogistics, + num oversold, + num organic, + num status, + bool posShow, + num productType, + num productNumber, + num setMeal, + num attrStyle, + String detail, + num isDelete, + String printerFlag, + dynamic materials, + dynamic materialId, + String details, + String thumbnailImg, + String info, + num buyCount, + num sellCountLimit, + String vipDiscount,}){ + _id = id; + _createTime = createTime; + _createUser = createUser; + _updateTime = updateTime; + _updateUser = updateUser; + _supplierName = supplierName; + _storeId = storeId; + _categoryId = categoryId; + _groupId = groupId; + _shortName = shortName; + _productName = productName; + _sellDesc = sellDesc; + _productCode = productCode; + _weight = weight; + _applyPrice = applyPrice; + _price = price; + _vipPrice = vipPrice; + _stock = stock; + _sellCount = sellCount; + _needLogistics = needLogistics; + _oversold = oversold; + _organic = organic; + _status = status; + _posShow = posShow; + _productType = productType; + _productNumber = productNumber; + _setMeal = setMeal; + _attrStyle = attrStyle; + _detail = detail; + _isDelete = isDelete; + _printerFlag = printerFlag; + _materials = materials; + _materialId = materialId; + _details = details; + _thumbnailImg = thumbnailImg; + _info = info; + _buyCount = buyCount; + _sellCountLimit = sellCountLimit; + _vipDiscount = vipDiscount; +} + + ProductVips.fromJson(dynamic json) { + _id = json['id']; + _createTime = json['createTime']; + _createUser = json['createUser']; + _updateTime = json['updateTime']; + _updateUser = json['updateUser']; + _supplierName = json['supplierName']; + _storeId = json['storeId']; + _categoryId = json['categoryId']; + _groupId = json['groupId']; + _shortName = json['shortName']; + _productName = json['productName']; + _sellDesc = json['sellDesc']; + _productCode = json['productCode']; + _weight = json['weight']; + _applyPrice = json['applyPrice']; + _price = json['price']; + _vipPrice = json['vipPrice']; + _stock = json['stock']; + _sellCount = json['sellCount']; + _needLogistics = json['needLogistics']; + _oversold = json['oversold']; + _organic = json['organic']; + _status = json['status']; + _posShow = json['posShow']; + _productType = json['productType']; + _productNumber = json['productNumber']; + _setMeal = json['setMeal']; + _attrStyle = json['attrStyle']; + _detail = json['detail']; + _isDelete = json['isDelete']; + _printerFlag = json['printerFlag']; + _materials = json['materials']; + _materialId = json['materialId']; + _details = json['details']; + _thumbnailImg = json['thumbnailImg']; + _info = json['info']; + _buyCount = json['buyCount']; + _sellCountLimit = json['sellCountLimit']; + _vipDiscount = json['vipDiscount']; + } + String _id; + String _createTime; + String _createUser; + String _updateTime; + String _updateUser; + String _supplierName; + String _storeId; + String _categoryId; + String _groupId; + String _shortName; + String _productName; + String _sellDesc; + String _productCode; + String _weight; + String _applyPrice; + String _price; + String _vipPrice; + num _stock; + num _sellCount; + num _needLogistics; + num _oversold; + num _organic; + num _status; + bool _posShow; + num _productType; + num _productNumber; + num _setMeal; + num _attrStyle; + String _detail; + num _isDelete; + String _printerFlag; + dynamic _materials; + dynamic _materialId; + String _details; + String _thumbnailImg; + String _info; + num _buyCount; + num _sellCountLimit; + String _vipDiscount; +ProductVips copyWith({ String id, + String createTime, + String createUser, + String updateTime, + String updateUser, + String supplierName, + String storeId, + String categoryId, + String groupId, + String shortName, + String productName, + String sellDesc, + String productCode, + String weight, + String applyPrice, + String price, + String vipPrice, + num stock, + num sellCount, + num needLogistics, + num oversold, + num organic, + num status, + bool posShow, + num productType, + num productNumber, + num setMeal, + num attrStyle, + String detail, + num isDelete, + String printerFlag, + dynamic materials, + dynamic materialId, + String details, + String thumbnailImg, + String info, + num buyCount, + num sellCountLimit, + String vipDiscount, +}) => ProductVips( id: id ?? _id, + createTime: createTime ?? _createTime, + createUser: createUser ?? _createUser, + updateTime: updateTime ?? _updateTime, + updateUser: updateUser ?? _updateUser, + supplierName: supplierName ?? _supplierName, + storeId: storeId ?? _storeId, + categoryId: categoryId ?? _categoryId, + groupId: groupId ?? _groupId, + shortName: shortName ?? _shortName, + productName: productName ?? _productName, + sellDesc: sellDesc ?? _sellDesc, + productCode: productCode ?? _productCode, + weight: weight ?? _weight, + applyPrice: applyPrice ?? _applyPrice, + price: price ?? _price, + vipPrice: vipPrice ?? _vipPrice, + stock: stock ?? _stock, + sellCount: sellCount ?? _sellCount, + needLogistics: needLogistics ?? _needLogistics, + oversold: oversold ?? _oversold, + organic: organic ?? _organic, + status: status ?? _status, + posShow: posShow ?? _posShow, + productType: productType ?? _productType, + productNumber: productNumber ?? _productNumber, + setMeal: setMeal ?? _setMeal, + attrStyle: attrStyle ?? _attrStyle, + detail: detail ?? _detail, + isDelete: isDelete ?? _isDelete, + printerFlag: printerFlag ?? _printerFlag, + materials: materials ?? _materials, + materialId: materialId ?? _materialId, + details: details ?? _details, + thumbnailImg: thumbnailImg ?? _thumbnailImg, + info: info ?? _info, + buyCount: buyCount ?? _buyCount, + sellCountLimit: sellCountLimit ?? _sellCountLimit, + vipDiscount: vipDiscount ?? _vipDiscount, +); + String get id => _id; + String get createTime => _createTime; + String get createUser => _createUser; + String get updateTime => _updateTime; + String get updateUser => _updateUser; + String get supplierName => _supplierName; + String get storeId => _storeId; + String get categoryId => _categoryId; + String get groupId => _groupId; + String get shortName => _shortName; + String get productName => _productName; + String get sellDesc => _sellDesc; + String get productCode => _productCode; + String get weight => _weight; + String get applyPrice => _applyPrice; + String get price => _price; + String get vipPrice => _vipPrice; + num get stock => _stock; + num get sellCount => _sellCount; + num get needLogistics => _needLogistics; + num get oversold => _oversold; + num get organic => _organic; + num get status => _status; + bool get posShow => _posShow; + num get productType => _productType; + num get productNumber => _productNumber; + num get setMeal => _setMeal; + num get attrStyle => _attrStyle; + String get detail => _detail; + num get isDelete => _isDelete; + String get printerFlag => _printerFlag; + dynamic get materials => _materials; + dynamic get materialId => _materialId; + String get details => _details; + String get thumbnailImg => _thumbnailImg; + String get info => _info; + num get buyCount => _buyCount; + num get sellCountLimit => _sellCountLimit; + String get vipDiscount => _vipDiscount; + + Map toJson() { + final map = {}; + map['id'] = _id; + map['createTime'] = _createTime; + map['createUser'] = _createUser; + map['updateTime'] = _updateTime; + map['updateUser'] = _updateUser; + map['supplierName'] = _supplierName; + map['storeId'] = _storeId; + map['categoryId'] = _categoryId; + map['groupId'] = _groupId; + map['shortName'] = _shortName; + map['productName'] = _productName; + map['sellDesc'] = _sellDesc; + map['productCode'] = _productCode; + map['weight'] = _weight; + map['applyPrice'] = _applyPrice; + map['price'] = _price; + map['vipPrice'] = _vipPrice; + map['stock'] = _stock; + map['sellCount'] = _sellCount; + map['needLogistics'] = _needLogistics; + map['oversold'] = _oversold; + map['organic'] = _organic; + map['status'] = _status; + map['posShow'] = _posShow; + map['productType'] = _productType; + map['productNumber'] = _productNumber; + map['setMeal'] = _setMeal; + map['attrStyle'] = _attrStyle; + map['detail'] = _detail; + map['isDelete'] = _isDelete; + map['printerFlag'] = _printerFlag; + map['materials'] = _materials; + map['materialId'] = _materialId; + map['details'] = _details; + map['thumbnailImg'] = _thumbnailImg; + map['info'] = _info; + map['buyCount'] = _buyCount; + map['sellCountLimit'] = _sellCountLimit; + map['vipDiscount'] = _vipDiscount; + return map; + } + +} + +/// id : "1579679485240803328" +/// createTime : "2022-10-11 11:45:13" +/// createUser : "1" +/// updateTime : "2022-10-11 11:48:48" +/// updateUser : "1" +/// name : "888绿卡" +/// duration : 30 +/// price : "188.00" +/// autoSubscribe : true +/// isDelete : true + +class Cards { + Cards({ + String id, + String createTime, + String createUser, + String updateTime, + String updateUser, + String name, + num duration, + String price, + bool autoSubscribe, + bool isDelete,}){ + _id = id; + _createTime = createTime; + _createUser = createUser; + _updateTime = updateTime; + _updateUser = updateUser; + _name = name; + _duration = duration; + _price = price; + _autoSubscribe = autoSubscribe; + _isDelete = isDelete; +} + + Cards.fromJson(dynamic json) { + _id = json['id']; + _createTime = json['createTime']; + _createUser = json['createUser']; + _updateTime = json['updateTime']; + _updateUser = json['updateUser']; + _name = json['name']; + _duration = json['duration']; + _price = json['price']; + _autoSubscribe = json['autoSubscribe']; + _isDelete = json['isDelete']; + } + String _id; + String _createTime; + String _createUser; + String _updateTime; + String _updateUser; + String _name; + num _duration; + String _price; + bool _autoSubscribe; + bool _isDelete; +Cards copyWith({ String id, + String createTime, + String createUser, + String updateTime, + String updateUser, + String name, + num duration, + String price, + bool autoSubscribe, + bool isDelete, +}) => Cards( id: id ?? _id, + createTime: createTime ?? _createTime, + createUser: createUser ?? _createUser, + updateTime: updateTime ?? _updateTime, + updateUser: updateUser ?? _updateUser, + name: name ?? _name, + duration: duration ?? _duration, + price: price ?? _price, + autoSubscribe: autoSubscribe ?? _autoSubscribe, + isDelete: isDelete ?? _isDelete, +); + String get id => _id; + String get createTime => _createTime; + String get createUser => _createUser; + String get updateTime => _updateTime; + String get updateUser => _updateUser; + String get name => _name; + num get duration => _duration; + String get price => _price; + bool get autoSubscribe => _autoSubscribe; + bool get isDelete => _isDelete; + + Map toJson() { + final map = {}; + map['id'] = _id; + map['createTime'] = _createTime; + map['createUser'] = _createUser; + map['updateTime'] = _updateTime; + map['updateUser'] = _updateUser; + map['name'] = _name; + map['duration'] = _duration; + map['price'] = _price; + map['autoSubscribe'] = _autoSubscribe; + map['isDelete'] = _isDelete; + return map; + } + +} + +/// masterId : "0" +/// masterCardRankName : null +/// vipNo : "1379254113602109440" +/// nickname : "哈哈哈" +/// headimg : "https://pos.upload.lotus-wallet.com/admin/2021/08/1f8d55ed-85d2-42a2-b155-6737a66226e8.jpg" +/// userType : true +/// sex : "0" +/// level : 1 +/// addressId : "0" +/// remark : "" +/// phone : "13052919193" +/// createTime : "2021-04-06 10:06:21" +/// birth : "1998-09-17" +/// balance : null +/// money : "31.12" +/// activityMoney : "0.00" +/// greenMoney : "4872.00" +/// expendAmount : "180.02" +/// organic : 0 +/// points : "741" +/// isBind : true +/// memberRankVo : {"id":"1462684050274648064","rankName":"白银会员","rankOrigin":69,"rankContent":"","rankImg":"https://pos.upload.lotus-wallet.com/MDAwMA==/2021/11/7453eb74-661e-42b7-b575-8accc00fcbf5.png","status":true,"nextId":"1462684471177248768","nextName":"黄金会员","nextOrigin":20000} +/// age : 24 +/// inviteCode : "MFZPXU" +/// inviteNumber : 4 +/// todayInviteNumber : 0 +/// signature : "" +/// background : "https://pos.upload.gznl.top/admin/2022/03/dd0af83c-1f2b-4217-bf0c-cdb7a809caca.jpeg" +/// certification : null +/// hasPayPassword : true +/// isVip : false +/// vipExpire : null +/// isVipSubscribe : false +/// vipDuration : 33 + +class Member { + Member({ + String masterId, + dynamic masterCardRankName, + String vipNo, + String nickname, + String headimg, + bool userType, + String sex, + num level, + String addressId, + String remark, + String phone, + String createTime, + String birth, + dynamic balance, + String money, + String activityMoney, + String greenMoney, + String expendAmount, + num organic, + String points, + bool isBind, + MemberRankVo memberRankVo, + num age, + String inviteCode, + num inviteNumber, + num todayInviteNumber, + String signature, + String background, + dynamic certification, + bool hasPayPassword, + bool isVip, + dynamic vipExpire, + bool isVipSubscribe, + num vipDuration,}){ + _masterId = masterId; + _masterCardRankName = masterCardRankName; + _vipNo = vipNo; + _nickname = nickname; + _headimg = headimg; + _userType = userType; + _sex = sex; + _level = level; + _addressId = addressId; + _remark = remark; + _phone = phone; + _createTime = createTime; + _birth = birth; + _balance = balance; + _money = money; + _activityMoney = activityMoney; + _greenMoney = greenMoney; + _expendAmount = expendAmount; + _organic = organic; + _points = points; + _isBind = isBind; + _memberRankVo = memberRankVo; + _age = age; + _inviteCode = inviteCode; + _inviteNumber = inviteNumber; + _todayInviteNumber = todayInviteNumber; + _signature = signature; + _background = background; + _certification = certification; + _hasPayPassword = hasPayPassword; + _isVip = isVip; + _vipExpire = vipExpire; + _isVipSubscribe = isVipSubscribe; + _vipDuration = vipDuration; +} + + Member.fromJson(dynamic json) { + _masterId = json['masterId']; + _masterCardRankName = json['masterCardRankName']; + _vipNo = json['vipNo']; + _nickname = json['nickname']; + _headimg = json['headimg']; + _userType = json['userType']; + _sex = json['sex']; + _level = json['level']; + _addressId = json['addressId']; + _remark = json['remark']; + _phone = json['phone']; + _createTime = json['createTime']; + _birth = json['birth']; + _balance = json['balance']; + _money = json['money']; + _activityMoney = json['activityMoney']; + _greenMoney = json['greenMoney']; + _expendAmount = json['expendAmount']; + _organic = json['organic']; + _points = json['points']; + _isBind = json['isBind']; + _memberRankVo = json['memberRankVo'] != null ? MemberRankVo.fromJson(json['memberRankVo']) : null; + _age = json['age']; + _inviteCode = json['inviteCode']; + _inviteNumber = json['inviteNumber']; + _todayInviteNumber = json['todayInviteNumber']; + _signature = json['signature']; + _background = json['background']; + _certification = json['certification']; + _hasPayPassword = json['hasPayPassword']; + _isVip = json['isVip']; + _vipExpire = json['vipExpire']; + _isVipSubscribe = json['isVipSubscribe']; + _vipDuration = json['vipDuration']; + } + String _masterId; + dynamic _masterCardRankName; + String _vipNo; + String _nickname; + String _headimg; + bool _userType; + String _sex; + num _level; + String _addressId; + String _remark; + String _phone; + String _createTime; + String _birth; + dynamic _balance; + String _money; + String _activityMoney; + String _greenMoney; + String _expendAmount; + num _organic; + String _points; + bool _isBind; + MemberRankVo _memberRankVo; + num _age; + String _inviteCode; + num _inviteNumber; + num _todayInviteNumber; + String _signature; + String _background; + dynamic _certification; + bool _hasPayPassword; + bool _isVip; + dynamic _vipExpire; + bool _isVipSubscribe; + num _vipDuration; +Member copyWith({ String masterId, + dynamic masterCardRankName, + String vipNo, + String nickname, + String headimg, + bool userType, + String sex, + num level, + String addressId, + String remark, + String phone, + String createTime, + String birth, + dynamic balance, + String money, + String activityMoney, + String greenMoney, + String expendAmount, + num organic, + String points, + bool isBind, + MemberRankVo memberRankVo, + num age, + String inviteCode, + num inviteNumber, + num todayInviteNumber, + String signature, + String background, + dynamic certification, + bool hasPayPassword, + bool isVip, + dynamic vipExpire, + bool isVipSubscribe, + num vipDuration, +}) => Member( masterId: masterId ?? _masterId, + masterCardRankName: masterCardRankName ?? _masterCardRankName, + vipNo: vipNo ?? _vipNo, + nickname: nickname ?? _nickname, + headimg: headimg ?? _headimg, + userType: userType ?? _userType, + sex: sex ?? _sex, + level: level ?? _level, + addressId: addressId ?? _addressId, + remark: remark ?? _remark, + phone: phone ?? _phone, + createTime: createTime ?? _createTime, + birth: birth ?? _birth, + balance: balance ?? _balance, + money: money ?? _money, + activityMoney: activityMoney ?? _activityMoney, + greenMoney: greenMoney ?? _greenMoney, + expendAmount: expendAmount ?? _expendAmount, + organic: organic ?? _organic, + points: points ?? _points, + isBind: isBind ?? _isBind, + memberRankVo: memberRankVo ?? _memberRankVo, + age: age ?? _age, + inviteCode: inviteCode ?? _inviteCode, + inviteNumber: inviteNumber ?? _inviteNumber, + todayInviteNumber: todayInviteNumber ?? _todayInviteNumber, + signature: signature ?? _signature, + background: background ?? _background, + certification: certification ?? _certification, + hasPayPassword: hasPayPassword ?? _hasPayPassword, + isVip: isVip ?? _isVip, + vipExpire: vipExpire ?? _vipExpire, + isVipSubscribe: isVipSubscribe ?? _isVipSubscribe, + vipDuration: vipDuration ?? _vipDuration, +); + String get masterId => _masterId; + dynamic get masterCardRankName => _masterCardRankName; + String get vipNo => _vipNo; + String get nickname => _nickname; + String get headimg => _headimg; + bool get userType => _userType; + String get sex => _sex; + num get level => _level; + String get addressId => _addressId; + String get remark => _remark; + String get phone => _phone; + String get createTime => _createTime; + String get birth => _birth; + dynamic get balance => _balance; + String get money => _money; + String get activityMoney => _activityMoney; + String get greenMoney => _greenMoney; + String get expendAmount => _expendAmount; + num get organic => _organic; + String get points => _points; + bool get isBind => _isBind; + MemberRankVo get memberRankVo => _memberRankVo; + num get age => _age; + String get inviteCode => _inviteCode; + num get inviteNumber => _inviteNumber; + num get todayInviteNumber => _todayInviteNumber; + String get signature => _signature; + String get background => _background; + dynamic get certification => _certification; + bool get hasPayPassword => _hasPayPassword; + bool get isVip => _isVip; + dynamic get vipExpire => _vipExpire; + bool get isVipSubscribe => _isVipSubscribe; + num get vipDuration => _vipDuration; + + Map toJson() { + final map = {}; + map['masterId'] = _masterId; + map['masterCardRankName'] = _masterCardRankName; + map['vipNo'] = _vipNo; + map['nickname'] = _nickname; + map['headimg'] = _headimg; + map['userType'] = _userType; + map['sex'] = _sex; + map['level'] = _level; + map['addressId'] = _addressId; + map['remark'] = _remark; + map['phone'] = _phone; + map['createTime'] = _createTime; + map['birth'] = _birth; + map['balance'] = _balance; + map['money'] = _money; + map['activityMoney'] = _activityMoney; + map['greenMoney'] = _greenMoney; + map['expendAmount'] = _expendAmount; + map['organic'] = _organic; + map['points'] = _points; + map['isBind'] = _isBind; + if (_memberRankVo != null) { + map['memberRankVo'] = _memberRankVo.toJson(); + } + map['age'] = _age; + map['inviteCode'] = _inviteCode; + map['inviteNumber'] = _inviteNumber; + map['todayInviteNumber'] = _todayInviteNumber; + map['signature'] = _signature; + map['background'] = _background; + map['certification'] = _certification; + map['hasPayPassword'] = _hasPayPassword; + map['isVip'] = _isVip; + map['vipExpire'] = _vipExpire; + map['isVipSubscribe'] = _isVipSubscribe; + map['vipDuration'] = _vipDuration; + return map; + } + +} + +/// id : "1462684050274648064" +/// rankName : "白银会员" +/// rankOrigin : 69 +/// rankContent : "" +/// rankImg : "https://pos.upload.lotus-wallet.com/MDAwMA==/2021/11/7453eb74-661e-42b7-b575-8accc00fcbf5.png" +/// status : true +/// nextId : "1462684471177248768" +/// nextName : "黄金会员" +/// nextOrigin : 20000 + +class MemberRankVo { + MemberRankVo({ + String id, + String rankName, + num rankOrigin, + String rankContent, + String rankImg, + bool status, + String nextId, + String nextName, + num nextOrigin,}){ + _id = id; + _rankName = rankName; + _rankOrigin = rankOrigin; + _rankContent = rankContent; + _rankImg = rankImg; + _status = status; + _nextId = nextId; + _nextName = nextName; + _nextOrigin = nextOrigin; +} + + MemberRankVo.fromJson(dynamic json) { + _id = json['id']; + _rankName = json['rankName']; + _rankOrigin = json['rankOrigin']; + _rankContent = json['rankContent']; + _rankImg = json['rankImg']; + _status = json['status']; + _nextId = json['nextId']; + _nextName = json['nextName']; + _nextOrigin = json['nextOrigin']; + } + String _id; + String _rankName; + num _rankOrigin; + String _rankContent; + String _rankImg; + bool _status; + String _nextId; + String _nextName; + num _nextOrigin; +MemberRankVo copyWith({ String id, + String rankName, + num rankOrigin, + String rankContent, + String rankImg, + bool status, + String nextId, + String nextName, + num nextOrigin, +}) => MemberRankVo( id: id ?? _id, + rankName: rankName ?? _rankName, + rankOrigin: rankOrigin ?? _rankOrigin, + rankContent: rankContent ?? _rankContent, + rankImg: rankImg ?? _rankImg, + status: status ?? _status, + nextId: nextId ?? _nextId, + nextName: nextName ?? _nextName, + nextOrigin: nextOrigin ?? _nextOrigin, +); + String get id => _id; + String get rankName => _rankName; + num get rankOrigin => _rankOrigin; + String get rankContent => _rankContent; + String get rankImg => _rankImg; + bool get status => _status; + String get nextId => _nextId; + String get nextName => _nextName; + num get nextOrigin => _nextOrigin; + + Map toJson() { + final map = {}; + map['id'] = _id; + map['rankName'] = _rankName; + map['rankOrigin'] = _rankOrigin; + map['rankContent'] = _rankContent; + map['rankImg'] = _rankImg; + map['status'] = _status; + map['nextId'] = _nextId; + map['nextName'] = _nextName; + map['nextOrigin'] = _nextOrigin; + return map; + } + +} \ No newline at end of file diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index f7e60731..7e9d7012 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -26,7 +26,7 @@ import 'data/shopping_home_config.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 serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线上 diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index b55cfa21..76c781d1 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -56,12 +56,13 @@ import 'data/user_info.dart'; import 'data/vip_badges_list.dart'; import 'data/vip_benefit_list.dart'; import 'data/vip_card.dart'; +import 'data/vip_card_home.dart'; import 'data/vip_rule_details.dart'; import 'data/wx_pay.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 serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///线上 @@ -530,4 +531,14 @@ abstract class ApiService { ///验证验证码 @POST("/member/verifyByUpdatePayPwd") Future verifyByUpdatePayPwd(@Body() Map param); + + ///VIP首页 + @GET("/vipCard/index") + Future> vipCardIndex(); + + ///VIP订阅/购买 + @POST("/vipCard/orderVip/{id}") + Future> orderVip(@Body() Map param); + + } diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index f6852f20..1c49aecd 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -2068,4 +2068,47 @@ class _ApiService implements ApiService { ); return value; } + + @override + Future> vipCardIndex() async { + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + '/vipCard/index', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => VipCardHome.fromJson(json), + ); + return value; + } + + @override + Future> orderVip(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>('/vipCard/orderVip', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } } diff --git a/lib/settlement/settlement_view/activity_coupon_remarks.dart b/lib/settlement/settlement_view/activity_coupon_remarks.dart index ce610134..050cc083 100644 --- a/lib/settlement/settlement_view/activity_coupon_remarks.dart +++ b/lib/settlement/settlement_view/activity_coupon_remarks.dart @@ -73,6 +73,45 @@ class _ActivityCouponRemarks extends State { mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.center, 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") Container( margin:EdgeInsets.only(bottom: 13), @@ -225,6 +264,22 @@ class _ActivityCouponRemarks extends State { ); } + 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 promotion = ""; if (widget.promotions == null || widget.promotions == "") { @@ -248,7 +303,7 @@ class _ActivityCouponRemarks extends State { if(widget.placeOrder) if(widget.minOrderInfo == null || widget.minOrderInfo.orderInfoVo.couponList == null) - {coupon = "暂无可选优惠券";} + {coupon = "未选择任何优惠券";} else if(widget.promotions != null && widget.promotions != ""){ coupon = "优惠券与活动不可同享"; } diff --git a/lib/store/store_view/shop_goods.dart b/lib/store/store_view/shop_goods.dart index fbd2e0b2..91d9b351 100644 --- a/lib/store/store_view/shop_goods.dart +++ b/lib/store/store_view/shop_goods.dart @@ -309,6 +309,35 @@ class _ShopGoods extends State { SizedBox( 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( "¥${AppUtils.calculateDouble(double.tryParse(widget.isShopCart ? widget.shoppingCartSkuItemListBean.skuPrice : widget.productListBean.applyPrice) ?? 0)}", style: TextStyle( diff --git a/lib/store/store_view/shop_goods_car.dart b/lib/store/store_view/shop_goods_car.dart index f2cd0dba..5195f3f5 100644 --- a/lib/store/store_view/shop_goods_car.dart +++ b/lib/store/store_view/shop_goods_car.dart @@ -316,7 +316,7 @@ class _ShopGoodsCar extends State { Expanded( flex: 1, child: Text( - "x1", + setMealDataList.productInfoList[0].buyNumber.toString(), overflow: TextOverflow.ellipsis, maxLines: 1, style: TextStyle( diff --git a/lib/vip/vip_page.dart b/lib/vip/vip_page.dart new file mode 100644 index 00000000..da5170ac --- /dev/null +++ b/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 createState() { + return _VipPageState(); + } +} + +class _VipPageState extends State 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 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; +} diff --git a/lib/vip/vip_view/exclusive_coupon.dart b/lib/vip/vip_view/exclusive_coupon.dart new file mode 100644 index 00000000..0c3bdd27 --- /dev/null +++ b/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 createState() { + return _ExclusiveCoupon(); + } +} + +class _ExclusiveCoupon extends State { + @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, + ), + ), + ), + ], + ), + ), + ], + ), + ], + ), + ); + } +} diff --git a/lib/vip/vip_view/vip_goods_discount.dart b/lib/vip/vip_view/vip_goods_discount.dart new file mode 100644 index 00000000..c4fd3bbe --- /dev/null +++ b/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 createState() { + return _VipGoodsDiscount(); + } +} + +class _VipGoodsDiscount extends State { + @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, + ),) + ], + ), + ); + } +} diff --git a/lib/vip/vip_view/vip_top.dart b/lib/vip/vip_view/vip_top.dart new file mode 100644 index 00000000..c45d98ef --- /dev/null +++ b/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 createState() { + return _VipTop(); + } +} + +class _VipTop extends State { + 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 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), + ), + ), + ), + ) + ], + ), + ) + ], + ), + )); + } +} diff --git a/pubspec.lock b/pubspec.lock index ea333bca..e80cc94b 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -434,6 +434,13 @@ packages: url: "https://pub.flutter-io.cn" source: hosted 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: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 1b13ed61..45322e1c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: 一心回乡. 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: sdk: ">=2.7.0 <3.0.0" @@ -33,6 +33,8 @@ dependencies: flutter_staggered_grid_view: ^0.4.0 # Null safety pull_to_refresh: ^2.0.0 # Null safety + number_precision: ^2.0.2+1 + permission_handler: ^5.0.1+1 flutter_bmflocation: ^1.0.3