Browse Source

Merge branch 'wr_202304' into dev

# Conflicts:
#	lib/login/new_login_page.dart
#	lib/retrofit/data/placeOrderFirst.dart
#	lib/settlement/settlement.dart
#	lib/settlement/settlement_view/activity_coupon_remarks.dart
#	lib/store/store_order.dart
new_revision_app
wurong 2 years ago
parent
commit
4c2af09111
  1. BIN
      assets/image/2x/login_channel.webp
  2. BIN
      assets/image/2x/login_store.webp
  3. BIN
      assets/image/2x/recharge_z.webp
  4. BIN
      assets/image/3x/login_channel.webp
  5. BIN
      assets/image/3x/login_store.webp
  6. BIN
      assets/image/3x/recharge_z.webp
  7. BIN
      assets/image/login_channel.webp
  8. BIN
      assets/image/login_store.webp
  9. BIN
      assets/image/recharge_z.webp
  10. 6
      ios/Runner.xcodeproj/project.pbxproj
  11. 174
      lib/login/login_store_select.dart
  12. 50
      lib/login/new_login_page.dart
  13. 3
      lib/main.dart
  14. 2
      lib/mine/personal_page.dart
  15. 421
      lib/mine/recharge_page.dart
  16. 2
      lib/order/edit_remarks_page.dart
  17. 5
      lib/order/order_view/order_info.dart
  18. 155
      lib/retrofit/data/channels_list.dart
  19. 96
      lib/retrofit/data/findMiNiGroupList.dart
  20. 24
      lib/retrofit/data/member_Infor.dart
  21. 515
      lib/retrofit/data/miNiDetail.dart
  22. 2
      lib/retrofit/data/placeOrderFirst.dart
  23. 155
      lib/retrofit/data/rechargeActLists.dart
  24. 6
      lib/retrofit/data/settleOrderInfo.dart
  25. 18
      lib/retrofit/data/social_info.dart
  26. 8
      lib/retrofit/data/user_info.dart
  27. 10
      lib/retrofit/retrofit_api.dart
  28. 35
      lib/retrofit/retrofit_api.g.dart
  29. 445
      lib/settlement/settlement.dart
  30. 135
      lib/settlement/settlement_view/activity_coupon_remarks.dart
  31. 118
      lib/store/shop_details_page.dart
  32. 41
      lib/store/store_order.dart
  33. 2
      lib/store/store_view/product_sku.dart
  34. 417
      lib/store/store_view/shop_goods.dart
  35. 82
      lib/store/store_view/store_order_list.dart
  36. 8
      lib/view_widget/cupertino_date_picker.dart
  37. 8
      lib/view_widget/recharge_details_dialog.dart
  38. 5
      lib/view_widget/selector_store_dialog.dart
  39. 7
      pubspec.lock
  40. 3
      pubspec.yaml

BIN
assets/image/2x/login_channel.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 996 B

BIN
assets/image/2x/login_store.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
assets/image/2x/recharge_z.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 894 B

BIN
assets/image/3x/login_channel.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
assets/image/3x/login_store.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
assets/image/3x/recharge_z.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
assets/image/login_channel.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 686 B

BIN
assets/image/login_store.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 752 B

BIN
assets/image/recharge_z.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 658 B

6
ios/Runner.xcodeproj/project.pbxproj

@ -667,7 +667,7 @@
"$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/baidu",
"$(PROJECT_DIR)/Runner/baidu", "$(PROJECT_DIR)/Runner/baidu",
); );
MARKETING_VERSION = 3.2.10; MARKETING_VERSION = 3.2.11;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",
@ -869,7 +869,7 @@
"$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/baidu",
"$(PROJECT_DIR)/Runner/baidu", "$(PROJECT_DIR)/Runner/baidu",
); );
MARKETING_VERSION = 3.2.10; MARKETING_VERSION = 3.2.11;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",
@ -962,7 +962,7 @@
"$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/baidu",
"$(PROJECT_DIR)/Runner/baidu", "$(PROJECT_DIR)/Runner/baidu",
); );
MARKETING_VERSION = 3.2.10; MARKETING_VERSION = 3.2.11;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",

174
lib/login/login_store_select.dart

@ -0,0 +1,174 @@
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import '../generated/l10n.dart';
import '../retrofit/data/base_data.dart';
import '../retrofit/data/channels_list.dart';
import '../retrofit/retrofit_api.dart';
import '../utils/flutter_utils.dart';
class LoginStoreSelect extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _LoginStoreSelect();
}
}
class _LoginStoreSelect extends State<LoginStoreSelect> {
ApiService apiService;
ChannelsList channelsList;
int channelIndex = 0;
@override
void initState() {
super.initState();
EasyLoading.show(status: S.current.zhengzaijiazai);
queryChannels();
}
queryChannels() async{
apiService = ApiService(Dio(), context: context);
BaseData<ChannelsList> baseData = await apiService.appChannels().catchError((error) {
print(error.message);
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
alignment: Alignment.center);
});
if (baseData != null && baseData.isSuccess) {
channelsList = baseData.data;
setState((){});
EasyLoading.dismiss();
} else {
if (baseData?.msg != null)
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
appBar: MyAppBar(
title: "渠道来源",
titleColor: Colors.black,
titleSize: 18.sp,
background: Color(0xFFFFFFFF),
leadingColor: Colors.black,
),
body: Container(
color: Color(0xFFFFFFFF),
height: double.infinity,
child: Column(
children: [
Padding(padding:EdgeInsets.only(top:18.h,bottom:20.h,left:18.w),
child: Row(
children: [
Image.asset(
"assets/image/login_channel.webp",
fit: BoxFit.fill,
width:24,
height:24,
),
SizedBox(width:12.w),
Text(
"Hi,您是通过什么途径了解到这款APP的?",
style: TextStyle(
fontWeight: MyFontWeight.bold,
fontSize: 15.sp,
color: Color(0xFF181818),
),
),
],
)),
Expanded(child: ListView.builder(
physics: BouncingScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
setState(() {
channelIndex = position;
});
},
child: channelItem(position),
);
},
itemCount:(channelsList != null && (channelsList?.channels?.length ?? 0) > 0) ? channelsList.channels.length : 0,
)),
if(channelsList != null && (channelsList.channels.length) > 0)
GestureDetector(
onTap: () {
Navigator.pop(context,channelsList.channels[channelIndex]);
},
child: Container(
width: double.infinity,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(27),
),
margin: EdgeInsets.only(
left: 16, right: 16, bottom: 21),
padding: EdgeInsets.symmetric(vertical:18.h),
child: Text(
S.of(context).queren,
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
),
)
],
),
),
);
}
Widget channelItem(index){
return Container(
height:52 ,
margin: EdgeInsets.only(bottom: 12,left: 14,right: 14),
child: Stack(
alignment: Alignment.bottomRight,
children: [
Container(
height: 52.h,
width: double.infinity,
decoration: BoxDecoration(
borderRadius: new BorderRadius.circular(6),
border: Border.all(
color: channelIndex == index ? Color(0xFF32A060) : Color(0xFFF7F7F7),
width: channelIndex == index ? 1 : 0,
),
color:channelIndex == index ? Color(0xFFF0FAF4) : Color(0xFFF7F7F7),
),
alignment: Alignment.centerLeft,
padding: EdgeInsets.only(left: 12,),
child: Text(
channelsList.channels[index],
style: TextStyle(
fontWeight: MyFontWeight.bold,
fontSize: 14.sp,
color: channelIndex == index ? Color(0xFF32A060) : Colors.black,
),
),
),
if (index == channelIndex)
Image.asset(
"assets/image/recharge.webp",
width: 20,
height: 20,
fit: BoxFit.fill,
),
],
),
);
}
}

50
lib/login/new_login_page.dart

@ -53,6 +53,7 @@ class _NewLoginPage extends State<NewLoginPage> {
Timer _timer; Timer _timer;
bool isShowLogin = false; bool isShowLogin = false;
String area = "+86"; String area = "+86";
String channelName;
@override @override
void initState() { void initState() {
@ -211,7 +212,8 @@ class _NewLoginPage extends State<NewLoginPage> {
"capcha": code, "capcha": code,
"mobile": mobile, "mobile": mobile,
"invite": invite, "invite": invite,
"areaCode": area "areaCode": area,
"regChannel":channelName ?? ""
}; };
EasyLoading.show(status: S.of(context).zhengzaijiazai); EasyLoading.show(status: S.of(context).zhengzaijiazai);
BaseData value = await apiService.memberLogin(param).catchError((error) { BaseData value = await apiService.memberLogin(param).catchError((error) {
@ -284,7 +286,7 @@ class _NewLoginPage extends State<NewLoginPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
resizeToAvoidBottomInset:false, resizeToAvoidBottomInset: false,
body: GestureDetector( body: GestureDetector(
behavior: HitTestBehavior.translucent, behavior: HitTestBehavior.translucent,
onTap: () { onTap: () {
@ -417,7 +419,7 @@ class _NewLoginPage extends State<NewLoginPage> {
Container( Container(
height: 30.h, height: 30.h,
width: MediaQuery.of(context).size.width - 100.w, width: MediaQuery.of(context).size.width - 100.w,
margin: EdgeInsets.only(bottom: Platform.isIOS ? 10.h : 5.h), margin: EdgeInsets.only(bottom:10.h),
child: TextField( child: TextField(
style: TextStyle( style: TextStyle(
height: 1.h, height: 1.h,
@ -592,7 +594,47 @@ class _NewLoginPage extends State<NewLoginPage> {
), ),
), ),
SizedBox( SizedBox(
height: 51.h, height: 30.h,
),
GestureDetector(
onTap: (){
Navigator.of(context).pushNamed('/router/login_store_select').then((value) => {
setState(() {
if (value != null) channelName = value;
})
});
},
child:Container(
padding: EdgeInsets.only(left:12.w,right:12.w,top:16.h,bottom:16.h),
margin: EdgeInsets.only(bottom:30.h),
decoration: BoxDecoration(
color: Color(0xFFF1F1F1),
borderRadius: BorderRadius.circular(4),
),
child: Row(
children: [
Image.asset(
"assets/image/login_store.webp",
fit: BoxFit.fill,
width:14,
height:14,
),
SizedBox(width: 3.w,),
Expanded(child:Text(
channelName ?? "邀请来源(选填)",
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
color: Color(0xFF868686),
),
)),
Icon(
Icons.arrow_forward_ios,
size: 16,
),
],
),
),
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,

3
lib/main.dart

@ -95,6 +95,7 @@ import 'home/help_farmers/help_farmers_page.dart';
import 'home/home_view/activity_list.dart'; import 'home/home_view/activity_list.dart';
import 'home/welfare_exchange.dart'; import 'home/welfare_exchange.dart';
import 'home/welfare_page.dart'; import 'home/welfare_page.dart';
import 'login/login_store_select.dart';
import 'login/new_login_page.dart'; import 'login/new_login_page.dart';
import 'login/phone_address_page.dart'; import 'login/phone_address_page.dart';
import 'main_page.dart'; import 'main_page.dart';
@ -429,4 +430,6 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
SystemNotice(), SystemNotice(),
'/router/store_html': (context, {arguments}) => '/router/store_html': (context, {arguments}) =>
StoreHtml(arguments:arguments), StoreHtml(arguments:arguments),
'/router/login_store_select': (context, {arguments}) =>
LoginStoreSelect(),
}; };

2
lib/mine/personal_page.dart

@ -85,6 +85,7 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
BaseData<MemberInfor> baseData = BaseData<MemberInfor> baseData =
await apiService.memberDetail(id).catchError((error) { await apiService.memberDetail(id).catchError((error) {
refreshController.refreshFailed(); refreshController.refreshFailed();
debugPrint(error);
}); });
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
setState(() { setState(() {
@ -126,6 +127,7 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
"pageSize": 10, "pageSize": 10,
"searchKey": searchKey ?? "" "searchKey": searchKey ?? ""
}).catchError((error) { }).catchError((error) {
debugPrint(error);
if (searchKey == null) { if (searchKey == null) {
refreshController.refreshFailed(); refreshController.refreshFailed();
refreshController.loadFailed(); refreshController.loadFailed();

421
lib/mine/recharge_page.dart

@ -10,6 +10,7 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:fluwx/fluwx.dart'; import 'package:fluwx/fluwx.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/rechargeActLists.dart';
import 'package:huixiang/retrofit/data/recharge_list.dart'; import 'package:huixiang/retrofit/data/recharge_list.dart';
import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/data/user_info.dart';
import 'package:huixiang/retrofit/data/vip_benefit_list.dart'; import 'package:huixiang/retrofit/data/vip_benefit_list.dart';
@ -42,12 +43,14 @@ class _RechargePage extends State<RechargePage> {
List<VipBenefitList> vipBenefitList = []; List<VipBenefitList> vipBenefitList = [];
Color color = Colors.black; Color color = Colors.black;
double discount = 100; double discount = 100;
List<RechargeList> rechargeA; // List<RechargeList> rechargeA;
int selectIndex = 0; int selectIndex = 0;
UserInfo userInfo; UserInfo userInfo;
String mBalance = "0"; String mBalance = "0";
dynamic payListen; dynamic payListen;
RechargeActLists rechargeActLists;
int selectStoreIndex = 0;
String recommendName;
@override @override
void initState() { void initState() {
@ -58,7 +61,7 @@ class _RechargePage extends State<RechargePage> {
context: context, token: value.getString("token"), pay: true); context: context, token: value.getString("token"), pay: true);
queryBenefitList(); queryBenefitList();
queryRuleDetails(); queryRuleDetails();
queryRechargeList(); queryRechargeActList();
queryUserBalance(); queryUserBalance();
}); });
payListen = weChatResponseEventHandler.listen((event) async { payListen = weChatResponseEventHandler.listen((event) async {
@ -67,8 +70,7 @@ class _RechargePage extends State<RechargePage> {
queryUserBalance(); queryUserBalance();
Navigator.of(context).pop(); Navigator.of(context).pop();
SmartDialog.showToast("充值成功", alignment: Alignment.center); SmartDialog.showToast("充值成功", alignment: Alignment.center);
} } else {
else{
SmartDialog.showToast("充值失败", alignment: Alignment.center); SmartDialog.showToast("充值失败", alignment: Alignment.center);
return; return;
} }
@ -78,8 +80,7 @@ class _RechargePage extends State<RechargePage> {
@override @override
void dispose() { void dispose() {
super.dispose(); super.dispose();
if(payListen!=null) if (payListen != null) payListen.cancel();
payListen.cancel();
} }
/// ///
@ -125,7 +126,7 @@ class _RechargePage extends State<RechargePage> {
} }
/// ///
queryRechargeList() async { queryRechargeActList() async {
if (apiService == null) { if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance(); SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService( apiService = ApiService(
@ -134,11 +135,11 @@ class _RechargePage extends State<RechargePage> {
token: value.getString("token"), token: value.getString("token"),
); );
} }
BaseData<List<RechargeList>> baseData = BaseData<RechargeActLists> baseData =
await apiService.rechargeAct().catchError((onError) {}); await apiService.rechargeActList().catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
setState(() { setState(() {
rechargeA = baseData.data; rechargeActLists = baseData.data;
}); });
} }
EasyLoading.dismiss(); EasyLoading.dismiss();
@ -215,7 +216,8 @@ class _RechargePage extends State<RechargePage> {
fontSize: 15.sp, fontSize: 15.sp,
color: Color(0xFF181818), color: Color(0xFF181818),
fontFamily: 'JDZhengHT', fontFamily: 'JDZhengHT',
fontWeight: MyFontWeight.semi_bold), fontWeight:
MyFontWeight.semi_bold),
)), )),
Text.rich( Text.rich(
TextSpan(children: [ TextSpan(children: [
@ -269,11 +271,10 @@ class _RechargePage extends State<RechargePage> {
)), )),
Container( Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 16, right: 16),
bottom: 22.h, left: 16, right: 16),
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 20.h, top: 20.h,
bottom: 20.h, bottom: 24.h,
), ),
// decoration: BoxDecoration( // decoration: BoxDecoration(
// color: Colors.white, // color: Colors.white,
@ -327,7 +328,7 @@ class _RechargePage extends State<RechargePage> {
], ],
), ),
), ),
SizedBox(height:10.h), SizedBox(height: 10.h),
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
@ -337,9 +338,9 @@ class _RechargePage extends State<RechargePage> {
}, },
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.start, MainAxisAlignment.start,
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Image.asset( Image.asset(
"assets/image/icon_alipay.webp"), "assets/image/icon_alipay.webp"),
@ -363,6 +364,48 @@ class _RechargePage extends State<RechargePage> {
], ],
), ),
), ),
if((rechargeActLists?.isOpen ?? false) == true)
GestureDetector(
onTap: () {
showRecommendStore();
},
child: Container(
padding: EdgeInsets.only(
left: 14.w,
right: 16.w,
top: 14.h,
bottom: 14.h),
margin: EdgeInsets.only(
bottom: 22.h, left: 14.w, right: 14.w),
decoration: BoxDecoration(
color: Color(0xFFFAFAFA),
borderRadius: BorderRadius.circular(4),
),
child: Row(
children: [
Image.asset(
"assets/image/recharge_z.webp",
width: 16.w,
height: 17.h,
fit: BoxFit.fill,
),
SizedBox(width: 8.w),
Expanded(
child: Text(
recommendName ??"为喜爱门店打call!(可选)",
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
color: (recommendName != null) ?Color(0xFF32A060):Color(0xFF868686),
),
)),
Icon(
Icons.arrow_forward_ios,
size: 16,
),
],
)),
),
Align( Align(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: GestureDetector( child: GestureDetector(
@ -508,7 +551,7 @@ class _RechargePage extends State<RechargePage> {
Widget rechargeList() { Widget rechargeList() {
return ListView.builder( return ListView.builder(
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
itemCount: rechargeA == null ? 0 : rechargeA.length, itemCount: (rechargeActLists != null && (rechargeActLists?.preferentialList?.length ?? 0) > 0) ? rechargeActLists.preferentialList.length : 0,
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
@ -519,22 +562,24 @@ class _RechargePage extends State<RechargePage> {
selectIndex = position; selectIndex = position;
}); });
}, },
child: rechargeItem(rechargeA[position], position)); child: rechargeItem(rechargeActLists.preferentialList[position], position));
}, },
); );
} }
Widget rechargeItem(RechargeList rechargeA, index) { Widget rechargeItem(PreferentialList preferentialList, index) {
return Container( return Container(
width: double.infinity, width: double.infinity,
height: 69.h, height: 69.h,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(4),
border: Border.all( border: Border.all(
color: selectIndex == index ? Color(0xFF32A060) :Color(0xFFFAFAFA), color:
width: selectIndex == index ? 1 :0, selectIndex == index ? Color(0xFF32A060) : Color(0xFFFAFAFA),
width: selectIndex == index ? 1 : 0,
), ),
color: selectIndex == index ? Color(0XFFF0FAF4) :Color(0xFFFAFAFA)), color:
selectIndex == index ? Color(0XFFF0FAF4) : Color(0xFFFAFAFA)),
margin: EdgeInsets.only(bottom: 14.w), margin: EdgeInsets.only(bottom: 14.w),
padding: EdgeInsets.only(left: 16), padding: EdgeInsets.only(left: 16),
child: Flex( child: Flex(
@ -549,16 +594,20 @@ class _RechargePage extends State<RechargePage> {
text: "储值 ", text: "储值 ",
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
color:selectIndex == index ? Color(0xFF4D4D4D):Color(0xFF868686), color: selectIndex == index
? Color(0xFF4D4D4D)
: Color(0xFF868686),
fontWeight: MyFontWeight.regular), fontWeight: MyFontWeight.regular),
), ),
TextSpan( TextSpan(
text: text:
"${AppUtils.calculateDouble(double.tryParse(rechargeA.rechargeMoney) ?? 0)}", "${AppUtils.calculateDouble(double.tryParse(preferentialList.rechargeMoney) ?? 0)}",
style: TextStyle( style: TextStyle(
fontSize: 18.sp, fontSize: 18.sp,
fontFamily: 'JDZhengHT', fontFamily: 'JDZhengHT',
color: selectIndex == index ? Color(0xFF353535) : Color(0xFF868686), color: selectIndex == index
? Color(0xFF353535)
: Color(0xFF868686),
fontWeight: MyFontWeight.semi_bold), fontWeight: MyFontWeight.semi_bold),
), ),
]), ]),
@ -567,74 +616,81 @@ class _RechargePage extends State<RechargePage> {
Container( Container(
width: 1.w, width: 1.w,
height: 37.h, height: 37.h,
color: selectIndex == index ? Color(0xFF32A060):Color(0xFF979797), color:
selectIndex == index ? Color(0xFF32A060) : Color(0xFF979797),
margin: EdgeInsets.only(right: 16.w, left: 12), margin: EdgeInsets.only(right: 16.w, left: 12),
), ),
Expanded( Expanded(
flex: 2, flex: 2,
child:Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text.rich( Text.rich(
TextSpan(children: [ TextSpan(children: [
TextSpan( TextSpan(
text: "实际到账 ", text: "实际到账 ",
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
color: selectIndex == index ? Color(0xFF353535) : Color(0xFF868686), color: selectIndex == index
fontWeight: MyFontWeight.regular), ? Color(0xFF353535)
: Color(0xFF868686),
fontWeight: MyFontWeight.regular),
),
TextSpan(
text:
"${AppUtils.calculateDouble((double.tryParse(preferentialList.rechargeMoney) ?? 0) + (double.tryParse(preferentialList.giftdMoney) ?? 0) + ((double.tryParse(preferentialList.rechargeMoney) ?? 0) - ((double.tryParse(preferentialList.rechargeMoney) ?? 0) * (discount / 100))))}",
style: TextStyle(
fontSize: 18.sp,
fontFamily: 'JDZhengHT',
color: selectIndex == index
? Color(0xFF353535)
: Color(0xFF868686),
fontWeight: MyFontWeight.semi_bold),
),
]),
), ),
TextSpan( SizedBox(
text: height: 4.h,
"${AppUtils.calculateDouble((double.tryParse(rechargeA.rechargeMoney) ?? 0) + (double.tryParse(rechargeA.giftdMoney) ?? 0) + ((double.tryParse(rechargeA.rechargeMoney) ?? 0) - ((double.tryParse(rechargeA.rechargeMoney) ?? 0) * (discount / 100))))}",
style: TextStyle(
fontSize: 18.sp,
fontFamily: 'JDZhengHT',
color: selectIndex == index ? Color(0xFF353535) : Color(0xFF868686),
fontWeight: MyFontWeight.semi_bold),
), ),
]), GestureDetector(
), onTap: () {
SizedBox( setState(() {
height: 4.h, if (selectIndex == index) showRecharge(index);
), });
GestureDetector( },
onTap: (){ child: Row(
setState(() { mainAxisAlignment: MainAxisAlignment.start,
if(selectIndex == index) crossAxisAlignment: CrossAxisAlignment.center,
showRecharge(index); children: [
}); Text(
}, "充值说明",
child: Row( style: TextStyle(
mainAxisAlignment: MainAxisAlignment.start, color: selectIndex == index
crossAxisAlignment: CrossAxisAlignment.center, ? Color(0xFF4D4D4D)
children: [ : Color(0xFF868686),
Text( fontSize: 12.sp,
"充值说明", fontWeight: MyFontWeight.regular,
style: TextStyle( ),
color: selectIndex == index ?Color(0xFF4D4D4D) : Color(0xFF868686), ),
fontSize: 12.sp, Icon(
fontWeight: MyFontWeight.regular, Icons.chevron_right,
), size: 20,
), color: selectIndex == index
Icon( ? Color(0xFF353535)
Icons.chevron_right, : Color(0xFF868686),
size: 20, ),
color: selectIndex == index ? Color(0xFF353535) : Color(0xFF868686), ],
), )),
], ],
) ))
),
],
))
], ],
)); ));
} }
Widget checkView(var index) { Widget checkView(var index) {
return Container( return Container(
padding: EdgeInsets.only(right: 16.w,left: 46.w), padding: EdgeInsets.only(right: 16.w, left: 46.w),
alignment: Alignment.center, alignment: Alignment.center,
child: Image.asset( child: Image.asset(
checkIndex != index checkIndex != index
@ -648,15 +704,153 @@ class _RechargePage extends State<RechargePage> {
/// ///
showRecharge(index) { showRecharge(index) {
showModalBottomSheet( showModalBottomSheet(
context: context, context: context,
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
builder: (context) { builder: (context) {
return RechargeWidget(rechargeA[index]); return RechargeWidget(rechargeActLists.preferentialList[index]);
}); });
} }
///
showRecommendStore() {
showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (BuildContext context) {
return StatefulBuilder(builder: (
context,
state,
) {
return Container(
height: 321.h,
decoration: BoxDecoration(
color: Color(0xFFFAFAFA),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(6),
topRight: Radius.circular(6),
),
),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Container(
alignment: Alignment.center,
margin: EdgeInsets.symmetric(vertical: 12),
child: Text(
"选择推荐门店",
style: TextStyle(
fontWeight: MyFontWeight.bold,
fontSize: 15.sp,
color: Color(0xFF353535),
),
),
)),
GestureDetector(
onTap: () {
setState(() {
Navigator.of(context).pop();
});
},
child: Icon(
Icons.clear,
color: Colors.black,
size: 18,
),
),
SizedBox(width: 14),
],
),
Container(
height: 1,
color: Color(0xFFF2F2F2),
margin: EdgeInsets.only(bottom: 13.h),
),
Expanded(
child: ListView.builder(
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
state(() {
selectStoreIndex = position;
});
},
child: recommendStoreItem(position),
);
},
itemCount: rechargeActLists.channels.length ?? 0,
)),
GestureDetector(
onTap: () {
setState(() {
recommendName =
rechargeActLists.channels[selectStoreIndex];
Navigator.of(context).pop();
});
},
child: Container(
width: double.infinity,
height: 40.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
color: Color(0xFF32A060),
),
alignment: Alignment.center,
margin: EdgeInsets.only(
top: 14.h, bottom: 30.h, left: 16.w, right: 16.w),
child: Text(
S.of(context).queding,
style: TextStyle(
fontWeight: MyFontWeight.bold,
fontSize: 16.sp,
color: Color(0xFFFFFFFF),
),
),
),
),
],
),
);
});
},);
}
Widget recommendStoreItem(index) {
return Container(
height: 52,
margin: EdgeInsets.only(bottom: 12, left: 14, right: 14),
width: double.infinity,
decoration: BoxDecoration(
borderRadius: new BorderRadius.circular(6),
border: Border.all(
color:
selectStoreIndex == index ? Color(0xFF32A060) : Color(0xFFF7F7F7),
width: selectStoreIndex == index ? 1 : 0,
),
color:
selectStoreIndex == index ? Color(0xFFF0FAF4) : Color(0xFFF7F7F7),
),
alignment: Alignment.centerLeft,
padding: EdgeInsets.only(
left: 12,
),
child: Text(
rechargeActLists?.channels[index] ?? "",
style: TextStyle(
fontWeight: MyFontWeight.bold,
fontSize: 14.sp,
color: selectStoreIndex == index ? Color(0xFF32A060) : Colors.black,
),
),
);
}
///
recharge() async { recharge() async {
// String money = controller.text; // String money = controller.text;
// if (money == null || money == "") { // if (money == null || money == "") {
@ -673,11 +867,12 @@ class _RechargePage extends State<RechargePage> {
// } // }
BaseData<dynamic> baseData = await apiService.recharge({ BaseData<dynamic> baseData = await apiService.recharge({
"amount": 0, "amount": 0,
"rechargeActId": rechargeA[selectIndex].id, "rechargeActId": rechargeActLists.preferentialList[selectIndex].id,
"rechargeType": checkIndex "rechargeType": checkIndex,
"channel": recommendName,
}).catchError((error) {}); }).catchError((error) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
if(checkIndex==2){ if (checkIndex == 2) {
if (Platform.isAndroid) { if (Platform.isAndroid) {
if (!(await Min.isInitialize())) { if (!(await Min.isInitialize())) {
// app的充值支付使用同一个WXPayEntryActivity回调 // app的充值支付使用同一个WXPayEntryActivity回调
@ -701,22 +896,26 @@ class _RechargePage extends State<RechargePage> {
timeStamp: int.tryParse(wxPay.timeStamp), timeStamp: int.tryParse(wxPay.timeStamp),
sign: wxPay.sign, sign: wxPay.sign,
); );
}else{ } else {
tobias.isAliPayInstalled().then((value) => { // tobias.isAliPayInstalled().then((value) => {
if (!value) { //
SmartDialog.showToast("请安装支付宝", alignment: Alignment.center) if (!value)
}else{ {SmartDialog.showToast("请安装支付宝", alignment: Alignment.center)}
tobias.aliPay(baseData.data["body"]).then((payRes) { else
if (payRes['resultStatus'] == 9000 || {
payRes['resultStatus'] == '9000') { tobias.aliPay(baseData.data["body"]).then((payRes) {
SmartDialog.showToast("充值成功", alignment: Alignment.center); if (payRes['resultStatus'] == 9000 ||
Navigator.of(context).pop(); payRes['resultStatus'] == '9000') {
} else { SmartDialog.showToast("充值成功",
SmartDialog.showToast(payRes['memo'], alignment: Alignment.center); alignment: Alignment.center);
} Navigator.of(context).pop();
}) } else {
} SmartDialog.showToast(payRes['memo'],
}); alignment: Alignment.center);
}
})
}
});
} }
} else { } else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); SmartDialog.showToast(baseData.msg, alignment: Alignment.center);

2
lib/order/edit_remarks_page.dart

@ -214,7 +214,7 @@ class _EditRemarksPage extends State<EditRemarksPage> {
fontSize: 12.sp, fontSize: 12.sp,
), ),
), ),
),onTap: (){addRemarksCnt("");},), ),onTap: (){addRemarksCnt("软一");},),
]; ];
} }
} }

5
lib/order/order_view/order_info.dart

@ -48,6 +48,9 @@ class _OrderInfoView extends State<OrderInfoView> {
orderInfoItem(S.of(context).peisongfangshi, widget.isTakeOut == 0 orderInfoItem(S.of(context).peisongfangshi, widget.isTakeOut == 0
? S.of(context).ziqu :(widget.orderInfo != null && widget.orderInfo.logisticsName != "") ? widget.orderInfo.logisticsName : "美团配送"), ? S.of(context).ziqu :(widget.orderInfo != null && widget.orderInfo.logisticsName != "") ? widget.orderInfo.logisticsName : "美团配送"),
// orderInfoItem(S.of(context).peisongfangshi,"美团配送"), // orderInfoItem(S.of(context).peisongfangshi,"美团配送"),
if(widget?.orderInfo?.subcribeTime != null && widget?.orderInfo?.subcribeTime != "")
orderInfoItem("预约时间",
widget.orderInfo != null ? widget.orderInfo.subcribeTime : ""),
orderInfoItem( orderInfoItem(
S.of(context).beizhuxinxi, S.of(context).beizhuxinxi,
widget.orderInfo != null widget.orderInfo != null
@ -88,7 +91,7 @@ class _OrderInfoView extends State<OrderInfoView> {
margin: EdgeInsets.only(top: 8.h, bottom: 8.h), margin: EdgeInsets.only(top: 8.h, bottom: 8.h),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
leftText, leftText,

155
lib/retrofit/data/channels_list.dart

@ -0,0 +1,155 @@
/// channels : ["海峡","回乡","boom"]
/// isOpen : true
/// preferentialList : [{"createTime":"2023-04-21 16:15:42","giftdMoney":"0.00","gitfdCouponId":null,"id":"1506553893994102784","isDeleted":0,"rechargeMoney":"0.01","rechargeType":0,"remark":"<p>充值说明:<br />平台充值根据用户在平台的会员等级享有不同的充值权益。<br />银卡用户享1.1倍充值会员权益,即充值100元账户110元。<br />金卡用户享1.2倍充值会员权益,即充值100元账户120元。<br />共创用户享1.3倍充值会员权益,即充值100元账户130元。<br />平台充值金可在平台上所有品牌和门店使用,包含:农场火锅、海峡姐妹、前进麦味、百年川椒、农场煮意、一心回乡生态农场等。<br />储值活动不与其他活动同享</p>","sortValue":1,"tenantCode":"admin"}]
class ChannelsList {
ChannelsList({
List<String> channels,
bool isOpen,
List<PreferentialList> preferentialList,}){
_channels = channels;
_isOpen = isOpen;
_preferentialList = preferentialList;
}
ChannelsList.fromJson(dynamic json) {
_channels = json['channels'] != null ? json['channels'].cast<String>() : [];
_isOpen = json['isOpen'];
if (json['preferentialList'] != null) {
_preferentialList = [];
json['preferentialList'].forEach((v) {
_preferentialList.add(PreferentialList.fromJson(v));
});
}
}
List<String> _channels;
bool _isOpen;
List<PreferentialList> _preferentialList;
ChannelsList copyWith({ List<String> channels,
bool isOpen,
List<PreferentialList> preferentialList,
}) => ChannelsList( channels: channels ?? _channels,
isOpen: isOpen ?? _isOpen,
preferentialList: preferentialList ?? _preferentialList,
);
List<String> get channels => _channels;
bool get isOpen => _isOpen;
List<PreferentialList> get preferentialList => _preferentialList;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['channels'] = _channels;
map['isOpen'] = _isOpen;
if (_preferentialList != null) {
map['preferentialList'] = _preferentialList.map((v) => v.toJson()).toList();
}
return map;
}
}
/// createTime : "2023-04-21 16:15:42"
/// giftdMoney : "0.00"
/// gitfdCouponId : null
/// id : "1506553893994102784"
/// isDeleted : 0
/// rechargeMoney : "0.01"
/// rechargeType : 0
/// remark : "<p>充值说明:<br />平台充值根据用户在平台的会员等级享有不同的充值权益。<br />银卡用户享1.1倍充值会员权益,即充值100元账户110元。<br />金卡用户享1.2倍充值会员权益,即充值100元账户120元。<br />共创用户享1.3倍充值会员权益,即充值100元账户130元。<br />平台充值金可在平台上所有品牌和门店使用,包含:农场火锅、海峡姐妹、前进麦味、百年川椒、农场煮意、一心回乡生态农场等。<br />储值活动不与其他活动同享</p>"
/// sortValue : 1
/// tenantCode : "admin"
class PreferentialList {
PreferentialList({
String createTime,
String giftdMoney,
dynamic gitfdCouponId,
String id,
num isDeleted,
String rechargeMoney,
num rechargeType,
String remark,
num sortValue,
String tenantCode,}){
_createTime = createTime;
_giftdMoney = giftdMoney;
_gitfdCouponId = gitfdCouponId;
_id = id;
_isDeleted = isDeleted;
_rechargeMoney = rechargeMoney;
_rechargeType = rechargeType;
_remark = remark;
_sortValue = sortValue;
_tenantCode = tenantCode;
}
PreferentialList.fromJson(dynamic json) {
_createTime = json['createTime'];
_giftdMoney = json['giftdMoney'];
_gitfdCouponId = json['gitfdCouponId'];
_id = json['id'];
_isDeleted = json['isDeleted'];
_rechargeMoney = json['rechargeMoney'];
_rechargeType = json['rechargeType'];
_remark = json['remark'];
_sortValue = json['sortValue'];
_tenantCode = json['tenantCode'];
}
String _createTime;
String _giftdMoney;
dynamic _gitfdCouponId;
String _id;
num _isDeleted;
String _rechargeMoney;
num _rechargeType;
String _remark;
num _sortValue;
String _tenantCode;
PreferentialList copyWith({ String createTime,
String giftdMoney,
dynamic gitfdCouponId,
String id,
num isDeleted,
String rechargeMoney,
num rechargeType,
String remark,
num sortValue,
String tenantCode,
}) => PreferentialList( createTime: createTime ?? _createTime,
giftdMoney: giftdMoney ?? _giftdMoney,
gitfdCouponId: gitfdCouponId ?? _gitfdCouponId,
id: id ?? _id,
isDeleted: isDeleted ?? _isDeleted,
rechargeMoney: rechargeMoney ?? _rechargeMoney,
rechargeType: rechargeType ?? _rechargeType,
remark: remark ?? _remark,
sortValue: sortValue ?? _sortValue,
tenantCode: tenantCode ?? _tenantCode,
);
String get createTime => _createTime;
String get giftdMoney => _giftdMoney;
dynamic get gitfdCouponId => _gitfdCouponId;
String get id => _id;
num get isDeleted => _isDeleted;
String get rechargeMoney => _rechargeMoney;
num get rechargeType => _rechargeType;
String get remark => _remark;
num get sortValue => _sortValue;
String get tenantCode => _tenantCode;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['createTime'] = _createTime;
map['giftdMoney'] = _giftdMoney;
map['gitfdCouponId'] = _gitfdCouponId;
map['id'] = _id;
map['isDeleted'] = _isDeleted;
map['rechargeMoney'] = _rechargeMoney;
map['rechargeType'] = _rechargeType;
map['remark'] = _remark;
map['sortValue'] = _sortValue;
map['tenantCode'] = _tenantCode;
return map;
}
}

96
lib/retrofit/data/findMiNiGroupList.dart

@ -102,6 +102,7 @@ class ProductListBean {
int setMeal; int setMeal;
String printerFlag; String printerFlag;
dynamic markProductNone; dynamic markProductNone;
SubscribeParam subscribeParam;
static ProductListBean fromJson(Map<String, dynamic> map) { static ProductListBean fromJson(Map<String, dynamic> map) {
if (map == null) return null; if (map == null) return null;
@ -135,6 +136,7 @@ class ProductListBean {
productListBean.setMeal = map['setMeal']; productListBean.setMeal = map['setMeal'];
productListBean.printerFlag = map['printerFlag']; productListBean.printerFlag = map['printerFlag'];
productListBean.markProductNone = map['markProductNone']; productListBean.markProductNone = map['markProductNone'];
productListBean.subscribeParam = SubscribeParam.fromJson(map['subscribeParam']);
return productListBean; return productListBean;
} }
@ -168,5 +170,97 @@ class ProductListBean {
"setMeal": setMeal, "setMeal": setMeal,
"printerFlag": printerFlag, "printerFlag": printerFlag,
"markProductNone": markProductNone, "markProductNone": markProductNone,
"subscribeParam": subscribeParam,
}; };
} }
/// isEnableSubscribe : true
/// dayOrDate : 3
/// startAfterDays : null
/// daysValidate : null
/// subscribeStartTime : "2023-04-20 00:00:00"
/// subscribeEndTime : "2023-04-30 00:00:00"
/// stores : ["海峡姐妹","前进麦味","百年川椒","小吃街"]
class SubscribeParam {
SubscribeParam({
bool isEnableSubscribe,
num dayOrDate,
dynamic startAfterDays,
dynamic daysValidate,
String subscribeStartTime,
String subscribeEndTime,
List<String> stores,}) {
_isEnableSubscribe = isEnableSubscribe;
_dayOrDate = dayOrDate;
_startAfterDays = startAfterDays;
_daysValidate = daysValidate;
_subscribeStartTime = subscribeStartTime;
_subscribeEndTime = subscribeEndTime;
_stores = stores;
}
SubscribeParam.fromJson(dynamic json) {
if(json == null)
return;
_isEnableSubscribe = json['isEnableSubscribe'];
_dayOrDate = json['dayOrDate'];
_startAfterDays = json['startAfterDays'];
_daysValidate = json['daysValidate'];
_subscribeStartTime = json['subscribeStartTime'];
_subscribeEndTime = json['subscribeEndTime'];
_stores = json['stores'] != null ? json['stores'].cast<String>() : [];
}
bool _isEnableSubscribe;
num _dayOrDate;
dynamic _startAfterDays;
dynamic _daysValidate;
String _subscribeStartTime;
String _subscribeEndTime;
List<String> _stores;
SubscribeParam copyWith({ bool isEnableSubscribe,
num dayOrDate,
dynamic startAfterDays,
dynamic daysValidate,
String subscribeStartTime,
String subscribeEndTime,
List<String> stores,
}) =>
SubscribeParam(
isEnableSubscribe: isEnableSubscribe ?? _isEnableSubscribe,
dayOrDate: dayOrDate ?? _dayOrDate,
startAfterDays: startAfterDays ?? _startAfterDays,
daysValidate: daysValidate ?? _daysValidate,
subscribeStartTime: subscribeStartTime ?? _subscribeStartTime,
subscribeEndTime: subscribeEndTime ?? _subscribeEndTime,
stores: stores ?? _stores,
);
bool get isEnableSubscribe => _isEnableSubscribe;
num get dayOrDate => _dayOrDate;
dynamic get startAfterDays => _startAfterDays;
dynamic get daysValidate => _daysValidate;
String get subscribeStartTime => _subscribeStartTime;
String get subscribeEndTime => _subscribeEndTime;
List<String> get stores => _stores;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['isEnableSubscribe'] = _isEnableSubscribe;
map['dayOrDate'] = _dayOrDate;
map['startAfterDays'] = _startAfterDays;
map['daysValidate'] = _daysValidate;
map['subscribeStartTime'] = _subscribeStartTime;
map['subscribeEndTime'] = _subscribeEndTime;
map['stores'] = _stores;
return map;
}
}

24
lib/retrofit/data/member_Infor.dart

@ -31,10 +31,10 @@ class MemberInfor {
int age, int age,
String signature, String signature,
String background, String background,
int follow, String follow,
int fans, String fans,
int trendTotal, String trendTotal,
int gainLikeTotal,}){ String gainLikeTotal,}){
_id = id; _id = id;
_nickname = nickname; _nickname = nickname;
_headimg = headimg; _headimg = headimg;
@ -86,10 +86,10 @@ class MemberInfor {
int _age; int _age;
String _signature; String _signature;
String _background; String _background;
int _follow; String _follow;
int _fans; String _fans;
int _trendTotal; String _trendTotal;
int _gainLikeTotal; String _gainLikeTotal;
String get id => _id; String get id => _id;
String get nickname => _nickname; String get nickname => _nickname;
@ -104,10 +104,10 @@ class MemberInfor {
int get age => _age; int get age => _age;
String get signature => _signature; String get signature => _signature;
String get background => _background; String get background => _background;
int get follow => _follow; String get follow => _follow;
int get fans => _fans; String get fans => _fans;
int get trendTotal => _trendTotal; String get trendTotal => _trendTotal;
int get gainLikeTotal => _gainLikeTotal; String get gainLikeTotal => _gainLikeTotal;
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final map = <String, dynamic>{}; final map = <String, dynamic>{};

515
lib/retrofit/data/miNiDetail.dart

@ -86,6 +86,7 @@ class MiNiDetail {
dynamic markProductNone; dynamic markProductNone;
dynamic namePinyin; dynamic namePinyin;
dynamic nameInitials; dynamic nameInitials;
SubscribeParam subscribeParam;
static MiNiDetail fromJson(Map<String, dynamic> map) { static MiNiDetail fromJson(Map<String, dynamic> map) {
if (map == null) return null; if (map == null) return null;
@ -123,16 +124,14 @@ class MiNiDetail {
miNiDetailBean.printerFlag = map['printerFlag']; miNiDetailBean.printerFlag = map['printerFlag'];
miNiDetailBean.thumbnailImg = map['thumbnailImg']; miNiDetailBean.thumbnailImg = map['thumbnailImg'];
miNiDetailBean.materialId = map['materialId']; miNiDetailBean.materialId = map['materialId'];
miNiDetailBean.imgs = []..addAll( miNiDetailBean.imgs = []
(map['imgs'] as List ?? []).map((o) => o.toString()) ..addAll((map['imgs'] as List ?? []).map((o) => o.toString()));
);
miNiDetailBean.storeDTO = StoreDTOBean.fromJson(map['storeDTO']); miNiDetailBean.storeDTO = StoreDTOBean.fromJson(map['storeDTO']);
miNiDetailBean.attrList = []..addAll( miNiDetailBean.attrList = []..addAll(
(map['attrList'] as List ?? []).map((o) => AttrListBean.fromJson(o)) (map['attrList'] as List ?? []).map((o) => AttrListBean.fromJson(o)));
);
miNiDetailBean.productSkuVOList = []..addAll( miNiDetailBean.productSkuVOList = []..addAll(
(map['productSkuVOList'] as List ?? []).map((o) => ProductSkuVOListBean.fromJson(o)) (map['productSkuVOList'] as List ?? [])
); .map((o) => ProductSkuVOListBean.fromJson(o)));
miNiDetailBean.shipAddress = map['shipAddress']; miNiDetailBean.shipAddress = map['shipAddress'];
miNiDetailBean.buyCount = map['buyCount']; miNiDetailBean.buyCount = map['buyCount'];
miNiDetailBean.promotionShowVOList = map['promotionShowVOList']; miNiDetailBean.promotionShowVOList = map['promotionShowVOList'];
@ -141,56 +140,59 @@ class MiNiDetail {
miNiDetailBean.markProductNone = map['markProductNone']; miNiDetailBean.markProductNone = map['markProductNone'];
miNiDetailBean.namePinyin = map['namePinyin']; miNiDetailBean.namePinyin = map['namePinyin'];
miNiDetailBean.nameInitials = map['nameInitials']; miNiDetailBean.nameInitials = map['nameInitials'];
miNiDetailBean.subscribeParam =
SubscribeParam.fromJson(map['subscribeParam']);
return miNiDetailBean; return miNiDetailBean;
} }
Map toJson() => { Map toJson() => {
"id": id, "id": id,
"createTime": createTime, "createTime": createTime,
"createUser": createUser, "createUser": createUser,
"updateTime": updateTime, "updateTime": updateTime,
"updateUser": updateUser, "updateUser": updateUser,
"supplierName": supplierName, "supplierName": supplierName,
"storeId": storeId, "storeId": storeId,
"categoryId": categoryId, "categoryId": categoryId,
"groupId": groupId, "groupId": groupId,
"shortName": shortName, "shortName": shortName,
"productName": productName, "productName": productName,
"sellDesc": sellDesc, "sellDesc": sellDesc,
"productCode": productCode, "productCode": productCode,
"weight": weight, "weight": weight,
"applyPrice": applyPrice, "applyPrice": applyPrice,
"price": price, "price": price,
"stock": stock, "stock": stock,
"sellCount": sellCount, "sellCount": sellCount,
"needLogistics": needLogistics, "needLogistics": needLogistics,
"oversold": oversold, "oversold": oversold,
"organic" : organic, "organic": organic,
"status": status, "status": status,
"posShow": posShow, "posShow": posShow,
"productType": productType, "productType": productType,
"productNumber": productNumber, "productNumber": productNumber,
"setMeal": setMeal, "setMeal": setMeal,
"attrStyle": attrStyle, "attrStyle": attrStyle,
"detail" :detail, "detail": detail,
"details" :details, "details": details,
"isDelete": isDelete, "isDelete": isDelete,
"printerFlag": printerFlag, "printerFlag": printerFlag,
"thumbnailImg": thumbnailImg, "thumbnailImg": thumbnailImg,
"materialId": materialId, "materialId": materialId,
"imgs": imgs, "imgs": imgs,
"storeDTO": storeDTO, "storeDTO": storeDTO,
"attrList": attrList, "attrList": attrList,
"productSkuVOList": productSkuVOList, "productSkuVOList": productSkuVOList,
"shipAddress": shipAddress, "shipAddress": shipAddress,
"buyCount": buyCount, "buyCount": buyCount,
"promotionShowVOList": promotionShowVOList, "promotionShowVOList": promotionShowVOList,
"buyNum": buyNum, "buyNum": buyNum,
"productPlatterInfos": productPlatterInfos, "productPlatterInfos": productPlatterInfos,
"markProductNone": markProductNone, "markProductNone": markProductNone,
"namePinyin": namePinyin, "namePinyin": namePinyin,
"nameInitials": nameInitials, "nameInitials": nameInitials,
}; "subscribeParam": subscribeParam,
};
} }
/// id : "1446382612795883520" /// id : "1446382612795883520"
@ -271,41 +273,41 @@ class ProductSkuVOListBean {
productSkuVOListBean.version = map['version']; productSkuVOListBean.version = map['version'];
productSkuVOListBean.skuAttrCodeDTOList = map['skuAttrCodeDTOList']; productSkuVOListBean.skuAttrCodeDTOList = map['skuAttrCodeDTOList'];
productSkuVOListBean.skuAttrList = []..addAll( productSkuVOListBean.skuAttrList = []..addAll(
(map['skuAttrList'] as List ?? []).map((o) => SkuAttrListBean.fromJson(o)) (map['skuAttrList'] as List ?? [])
); .map((o) => SkuAttrListBean.fromJson(o)));
productSkuVOListBean.productSetMeals = []..addAll( productSkuVOListBean.productSetMeals = []..addAll(
(map['productSetMeals'] as List ?? []).map((o) => ProductSetMeals.fromJson(o)) (map['productSetMeals'] as List ?? [])
); .map((o) => ProductSetMeals.fromJson(o)));
productSkuVOListBean.setMealDTOList = map['setMealDTOList']; productSkuVOListBean.setMealDTOList = map['setMealDTOList'];
return productSkuVOListBean; return productSkuVOListBean;
} }
Map toJson() => { Map toJson() => {
"id": id, "id": id,
"createTime": createTime, "createTime": createTime,
"createUser": createUser, "createUser": createUser,
"updateTime": updateTime, "updateTime": updateTime,
"updateUser": updateUser, "updateUser": updateUser,
"storeId": storeId, "storeId": storeId,
"skuCode": skuCode, "skuCode": skuCode,
"skuNameStr": skuNameStr, "skuNameStr": skuNameStr,
"productId": productId, "productId": productId,
"skuPrice": skuPrice, "skuPrice": skuPrice,
"applyPrice": applyPrice, "applyPrice": applyPrice,
"vipPrice": vipPrice, "vipPrice": vipPrice,
"skuImg": skuImg, "skuImg": skuImg,
"skuStock": skuStock, "skuStock": skuStock,
"sort": sort, "sort": sort,
"setMeal": setMeal, "setMeal": setMeal,
"weight": weight, "weight": weight,
"volume": volume, "volume": volume,
"isDelete": isDelete, "isDelete": isDelete,
"material": material, "material": material,
"version": version, "version": version,
"skuAttrCodeDTOList": skuAttrCodeDTOList, "skuAttrCodeDTOList": skuAttrCodeDTOList,
"skuAttrList": skuAttrList, "skuAttrList": skuAttrList,
"setMealDTOList": setMealDTOList, "setMealDTOList": setMealDTOList,
}; };
} }
/// id : "1446382613043347456" /// id : "1446382613043347456"
@ -348,17 +350,17 @@ class SkuAttrListBean {
} }
Map toJson() => { Map toJson() => {
"id": id, "id": id,
"createTime": createTime, "createTime": createTime,
"createUser": createUser, "createUser": createUser,
"updateTime": updateTime, "updateTime": updateTime,
"updateUser": updateUser, "updateUser": updateUser,
"skuId": skuId, "skuId": skuId,
"attrId": attrId, "attrId": attrId,
"attrValueId": attrValueId, "attrValueId": attrValueId,
"sortOrder": sortOrder, "sortOrder": sortOrder,
"isDelete": isDelete, "isDelete": isDelete,
}; };
} }
/// groupName : "酒水选1" /// groupName : "酒水选1"
@ -371,7 +373,8 @@ class ProductSetMeals {
String groupName, String groupName,
int totalNumber, int totalNumber,
int optionalNumber, int optionalNumber,
List<ProductInfoList> productInfoList,}){ List<ProductInfoList> productInfoList,
}) {
_groupName = groupName; _groupName = groupName;
_totalNumber = totalNumber; _totalNumber = totalNumber;
_optionalNumber = optionalNumber; _optionalNumber = optionalNumber;
@ -389,22 +392,31 @@ class ProductSetMeals {
}); });
} }
} }
String _groupName; String _groupName;
int _totalNumber; int _totalNumber;
int _optionalNumber; int _optionalNumber;
List<ProductInfoList> _productInfoList; List<ProductInfoList> _productInfoList;
ProductSetMeals copyWith({ String groupName,
ProductSetMeals copyWith({
String groupName,
int totalNumber, int totalNumber,
int optionalNumber, int optionalNumber,
List<ProductInfoList> productInfoList, List<ProductInfoList> productInfoList,
}) => ProductSetMeals( groupName: groupName ?? _groupName, }) =>
totalNumber: totalNumber ?? _totalNumber, ProductSetMeals(
optionalNumber: optionalNumber ?? _optionalNumber, groupName: groupName ?? _groupName,
productInfoList: productInfoList ?? _productInfoList, totalNumber: totalNumber ?? _totalNumber,
); optionalNumber: optionalNumber ?? _optionalNumber,
productInfoList: productInfoList ?? _productInfoList,
);
String get groupName => _groupName; String get groupName => _groupName;
int get totalNumber => _totalNumber; int get totalNumber => _totalNumber;
int get optionalNumber => _optionalNumber; int get optionalNumber => _optionalNumber;
List<ProductInfoList> get productInfoList => _productInfoList; List<ProductInfoList> get productInfoList => _productInfoList;
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -417,7 +429,6 @@ class ProductSetMeals {
} }
return map; return map;
} }
} }
/// productId : "1372091668961951744" /// productId : "1372091668961951744"
@ -436,7 +447,8 @@ class ProductInfoList {
bool allSku, bool allSku,
List<SkuInfoList> skuInfoList, List<SkuInfoList> skuInfoList,
List<ProductAttrInfoList> productAttrInfoList, List<ProductAttrInfoList> productAttrInfoList,
int number,}){ int number,
}) {
_productId = productId; _productId = productId;
_productName = productName; _productName = productName;
_productImg = productImg; _productImg = productImg;
@ -465,6 +477,7 @@ class ProductInfoList {
} }
_number = json['number']; _number = json['number'];
} }
String _productId; String _productId;
String _productName; String _productName;
String _productImg; String _productImg;
@ -473,26 +486,36 @@ class ProductInfoList {
List<ProductAttrInfoList> _productAttrInfoList; List<ProductAttrInfoList> _productAttrInfoList;
int _number; int _number;
int _count = 0; int _count = 0;
ProductInfoList copyWith({ String productId,
ProductInfoList copyWith({
String productId,
String productName, String productName,
String productImg, String productImg,
bool allSku, bool allSku,
List<SkuInfoList> skuInfoList, List<SkuInfoList> skuInfoList,
List<ProductAttrInfoList> productAttrInfoList, List<ProductAttrInfoList> productAttrInfoList,
int number, int number,
}) => ProductInfoList( productId: productId ?? _productId, }) =>
productName: productName ?? _productName, ProductInfoList(
productImg: productImg ?? _productImg, productId: productId ?? _productId,
allSku: allSku ?? _allSku, productName: productName ?? _productName,
skuInfoList: skuInfoList ?? _skuInfoList, productImg: productImg ?? _productImg,
productAttrInfoList: productAttrInfoList ?? _productAttrInfoList, allSku: allSku ?? _allSku,
number: number ?? _number, skuInfoList: skuInfoList ?? _skuInfoList,
); productAttrInfoList: productAttrInfoList ?? _productAttrInfoList,
number: number ?? _number,
);
String get productId => _productId; String get productId => _productId;
String get productName => _productName; String get productName => _productName;
String get productImg => _productImg; String get productImg => _productImg;
bool get allSku => _allSku; bool get allSku => _allSku;
List<SkuInfoList> get skuInfoList => _skuInfoList; List<SkuInfoList> get skuInfoList => _skuInfoList;
List<ProductAttrInfoList> get productAttrInfoList => _productAttrInfoList; List<ProductAttrInfoList> get productAttrInfoList => _productAttrInfoList;
int number; int number;
@ -502,8 +525,6 @@ class ProductInfoList {
_count = value; _count = value;
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final map = <String, dynamic>{}; final map = <String, dynamic>{};
map['productId'] = _productId; map['productId'] = _productId;
@ -514,12 +535,12 @@ class ProductInfoList {
map['skuInfoList'] = _skuInfoList.map((v) => v.toJson()).toList(); map['skuInfoList'] = _skuInfoList.map((v) => v.toJson()).toList();
} }
if (_productAttrInfoList != null) { if (_productAttrInfoList != null) {
map['productAttrInfoList'] = _productAttrInfoList.map((v) => v.toJson()).toList(); map['productAttrInfoList'] =
_productAttrInfoList.map((v) => v.toJson()).toList();
} }
map['number'] = _number; map['number'] = _number;
return map; return map;
} }
} }
/// attrId : "1372091668978728960" /// attrId : "1372091668978728960"
@ -530,7 +551,8 @@ class ProductAttrInfoList {
ProductAttrInfoList({ ProductAttrInfoList({
String attrId, String attrId,
String attrName, String attrName,
List<AttrValueList> attrValueList,}){ List<AttrValueList> attrValueList,
}) {
_attrId = attrId; _attrId = attrId;
_attrName = attrName; _attrName = attrName;
_attrValueList = attrValueList; _attrValueList = attrValueList;
@ -546,21 +568,28 @@ class ProductAttrInfoList {
}); });
} }
} }
String _attrId; String _attrId;
String _attrName; String _attrName;
List<AttrValueList> _attrValueList; List<AttrValueList> _attrValueList;
String _selectSku; String _selectSku;
ProductAttrInfoList copyWith({ String attrId,
ProductAttrInfoList copyWith({
String attrId,
String attrName, String attrName,
List<AttrValueList> attrValueList, List<AttrValueList> attrValueList,
}) => ProductAttrInfoList( attrId: attrId ?? _attrId, }) =>
attrName: attrName ?? _attrName, ProductAttrInfoList(
attrValueList: attrValueList ?? _attrValueList, attrId: attrId ?? _attrId,
); attrName: attrName ?? _attrName,
attrValueList: attrValueList ?? _attrValueList,
);
String get attrId => _attrId; String get attrId => _attrId;
String get attrName => _attrName; String get attrName => _attrName;
List<AttrValueList> get attrValueList => _attrValueList;
List<AttrValueList> get attrValueList => _attrValueList;
String get selectSku => _selectSku; String get selectSku => _selectSku;
@ -577,7 +606,6 @@ class ProductAttrInfoList {
} }
return map; return map;
} }
} }
/// attrId : "1372091668987117568" /// attrId : "1372091668987117568"
@ -588,7 +616,8 @@ class AttrValueList {
AttrValueList({ AttrValueList({
String attrId, String attrId,
String attrName, String attrName,
dynamic attrValueList,}){ dynamic attrValueList,
}) {
_attrId = attrId; _attrId = attrId;
_attrName = attrName; _attrName = attrName;
_attrValueList = attrValueList; _attrValueList = attrValueList;
@ -599,18 +628,26 @@ class AttrValueList {
_attrName = json['attrName']; _attrName = json['attrName'];
_attrValueList = json['attrValueList']; _attrValueList = json['attrValueList'];
} }
String _attrId; String _attrId;
String _attrName; String _attrName;
dynamic _attrValueList; dynamic _attrValueList;
AttrValueList copyWith({ String attrId,
AttrValueList copyWith({
String attrId,
String attrName, String attrName,
dynamic attrValueList, dynamic attrValueList,
}) => AttrValueList( attrId: attrId ?? _attrId, }) =>
attrName: attrName ?? _attrName, AttrValueList(
attrValueList: attrValueList ?? _attrValueList, attrId: attrId ?? _attrId,
); attrName: attrName ?? _attrName,
attrValueList: attrValueList ?? _attrValueList,
);
String get attrId => _attrId; String get attrId => _attrId;
String get attrName => _attrName; String get attrName => _attrName;
dynamic get attrValueList => _attrValueList; dynamic get attrValueList => _attrValueList;
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -620,7 +657,6 @@ class AttrValueList {
map['attrValueList'] = _attrValueList; map['attrValueList'] = _attrValueList;
return map; return map;
} }
} }
/// id : "1372091669003894784" /// id : "1372091669003894784"
@ -631,7 +667,8 @@ class SkuInfoList {
SkuInfoList({ SkuInfoList({
String id, String id,
String skuName, String skuName,
List<ProductSkuAttrList> productSkuAttrList,}){ List<ProductSkuAttrList> productSkuAttrList,
}) {
_id = id; _id = id;
_skuName = skuName; _skuName = skuName;
_productSkuAttrList = productSkuAttrList; _productSkuAttrList = productSkuAttrList;
@ -647,19 +684,27 @@ class SkuInfoList {
}); });
} }
} }
String _id; String _id;
String _skuName; String _skuName;
bool _isSelected = false; bool _isSelected = false;
List<ProductSkuAttrList> _productSkuAttrList; List<ProductSkuAttrList> _productSkuAttrList;
SkuInfoList copyWith({ String id,
SkuInfoList copyWith({
String id,
String skuName, String skuName,
List<ProductSkuAttrList> productSkuAttrList, List<ProductSkuAttrList> productSkuAttrList,
}) => SkuInfoList( id: id ?? _id, }) =>
skuName: skuName ?? _skuName, SkuInfoList(
productSkuAttrList: productSkuAttrList ?? _productSkuAttrList, id: id ?? _id,
); skuName: skuName ?? _skuName,
productSkuAttrList: productSkuAttrList ?? _productSkuAttrList,
);
String get id => _id; String get id => _id;
String get skuName => _skuName; String get skuName => _skuName;
List<ProductSkuAttrList> get productSkuAttrList => _productSkuAttrList; List<ProductSkuAttrList> get productSkuAttrList => _productSkuAttrList;
bool get isSelected => _isSelected; bool get isSelected => _isSelected;
@ -673,11 +718,11 @@ class SkuInfoList {
map['id'] = _id; map['id'] = _id;
map['skuName'] = _skuName; map['skuName'] = _skuName;
if (_productSkuAttrList != null) { if (_productSkuAttrList != null) {
map['productSkuAttrList'] = _productSkuAttrList.map((v) => v.toJson()).toList(); map['productSkuAttrList'] =
_productSkuAttrList.map((v) => v.toJson()).toList();
} }
return map; return map;
} }
} }
/// id : "1372091669012283392" /// id : "1372091669012283392"
@ -702,7 +747,8 @@ class ProductSkuAttrList {
String attrId, String attrId,
String attrValueId, String attrValueId,
dynamic sortOrder, dynamic sortOrder,
int isDelete,}){ int isDelete,
}) {
_id = id; _id = id;
_createTime = createTime; _createTime = createTime;
_createUser = createUser; _createUser = createUser;
@ -727,6 +773,7 @@ class ProductSkuAttrList {
_sortOrder = json['sortOrder']; _sortOrder = json['sortOrder'];
_isDelete = json['isDelete']; _isDelete = json['isDelete'];
} }
String _id; String _id;
String _createTime; String _createTime;
String _createUser; String _createUser;
@ -737,7 +784,9 @@ class ProductSkuAttrList {
String _attrValueId; String _attrValueId;
dynamic _sortOrder; dynamic _sortOrder;
int _isDelete; int _isDelete;
ProductSkuAttrList copyWith({ String id,
ProductSkuAttrList copyWith({
String id,
String createTime, String createTime,
String createUser, String createUser,
String updateTime, String updateTime,
@ -747,26 +796,38 @@ class ProductSkuAttrList {
String attrValueId, String attrValueId,
dynamic sortOrder, dynamic sortOrder,
int isDelete, int isDelete,
}) => ProductSkuAttrList( id: id ?? _id, }) =>
createTime: createTime ?? _createTime, ProductSkuAttrList(
createUser: createUser ?? _createUser, id: id ?? _id,
updateTime: updateTime ?? _updateTime, createTime: createTime ?? _createTime,
updateUser: updateUser ?? _updateUser, createUser: createUser ?? _createUser,
skuId: skuId ?? _skuId, updateTime: updateTime ?? _updateTime,
attrId: attrId ?? _attrId, updateUser: updateUser ?? _updateUser,
attrValueId: attrValueId ?? _attrValueId, skuId: skuId ?? _skuId,
sortOrder: sortOrder ?? _sortOrder, attrId: attrId ?? _attrId,
isDelete: isDelete ?? _isDelete, attrValueId: attrValueId ?? _attrValueId,
); sortOrder: sortOrder ?? _sortOrder,
isDelete: isDelete ?? _isDelete,
);
String get id => _id; String get id => _id;
String get createTime => _createTime; String get createTime => _createTime;
String get createUser => _createUser; String get createUser => _createUser;
String get updateTime => _updateTime; String get updateTime => _updateTime;
String get updateUser => _updateUser; String get updateUser => _updateUser;
String get skuId => _skuId; String get skuId => _skuId;
String get attrId => _attrId; String get attrId => _attrId;
String get attrValueId => _attrValueId; String get attrValueId => _attrValueId;
dynamic get sortOrder => _sortOrder; dynamic get sortOrder => _sortOrder;
int get isDelete => _isDelete; int get isDelete => _isDelete;
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -783,7 +844,6 @@ class ProductSkuAttrList {
map['isDelete'] = _isDelete; map['isDelete'] = _isDelete;
return map; return map;
} }
} }
/// productId : "1433994980233314304" /// productId : "1433994980233314304"
@ -815,22 +875,21 @@ class AttrListBean {
attrListBean.isDelete = map['isDelete']; attrListBean.isDelete = map['isDelete'];
attrListBean.attrCode = map['attrCode']; attrListBean.attrCode = map['attrCode'];
attrListBean.id = map['id']; attrListBean.id = map['id'];
attrListBean.attrValueList = []..addAll( attrListBean.attrValueList = []..addAll((map['attrValueList'] as List ?? [])
(map['attrValueList'] as List ?? []).map((o) => AttrValueListBean.fromJson(o)) .map((o) => AttrValueListBean.fromJson(o)));
);
return attrListBean; return attrListBean;
} }
Map toJson() => { Map toJson() => {
"productId": productId, "productId": productId,
"attrName": attrName, "attrName": attrName,
"sortOrder": sortOrder, "sortOrder": sortOrder,
"needImg": needImg, "needImg": needImg,
"isDelete": isDelete, "isDelete": isDelete,
"attrCode": attrCode, "attrCode": attrCode,
"id": id, "id": id,
"attrValueList": attrValueList, "attrValueList": attrValueList,
}; };
} }
/// id : "1434076666832879616" /// id : "1434076666832879616"
@ -865,14 +924,14 @@ class AttrValueListBean {
} }
Map toJson() => { Map toJson() => {
"id": id, "id": id,
"attrId": attrId, "attrId": attrId,
"attrValue": attrValue, "attrValue": attrValue,
"attrValueImg": attrValueImg, "attrValueImg": attrValueImg,
"sortOrder": sortOrder, "sortOrder": sortOrder,
"isDelete": isDelete, "isDelete": isDelete,
"attrValueCode": attrValueCode, "attrValueCode": attrValueCode,
}; };
} }
/// id : "1333246101343436800" /// id : "1333246101343436800"
@ -887,8 +946,8 @@ class StoreDTOBean {
String storeName; String storeName;
String nickName; String nickName;
String logo; String logo;
int productCount; dynamic productCount;
int soldNum; dynamic soldNum;
static StoreDTOBean fromJson(Map<String, dynamic> map) { static StoreDTOBean fromJson(Map<String, dynamic> map) {
if (map == null) return null; if (map == null) return null;
@ -903,11 +962,103 @@ class StoreDTOBean {
} }
Map toJson() => { Map toJson() => {
"id": id, "id": id,
"storeName": storeName, "storeName": storeName,
"nickName": nickName, "nickName": nickName,
"logo": logo, "logo": logo,
"productCount": productCount, "productCount": productCount,
"soldNum": soldNum, "soldNum": soldNum,
}; };
} }
/// isEnableSubscribe : true
/// dayOrDate : 3
/// startAfterDays : null
/// daysValidate : null
/// subscribeStartTime : "2023-04-20 00:00:00"
/// subscribeEndTime : "2023-04-30 00:00:00"
/// stores : ["海峡姐妹","前进麦味","百年川椒","小吃街"]
class SubscribeParam {
SubscribeParam({
bool isEnableSubscribe,
num dayOrDate,
dynamic startAfterDays,
dynamic daysValidate,
String subscribeStartTime,
String subscribeEndTime,
List<String> stores,}) {
_isEnableSubscribe = isEnableSubscribe;
_dayOrDate = dayOrDate;
_startAfterDays = startAfterDays;
_daysValidate = daysValidate;
_subscribeStartTime = subscribeStartTime;
_subscribeEndTime = subscribeEndTime;
_stores = stores;
}
SubscribeParam.fromJson(dynamic json) {
if(json == null)
return;
_isEnableSubscribe = json['isEnableSubscribe'];
_dayOrDate = json['dayOrDate'];
_startAfterDays = json['startAfterDays'];
_daysValidate = json['daysValidate'];
_subscribeStartTime = json['subscribeStartTime'];
_subscribeEndTime = json['subscribeEndTime'];
_stores = json['stores'] != null ? json['stores'].cast<String>() : [];
}
bool _isEnableSubscribe;
num _dayOrDate;
dynamic _startAfterDays;
dynamic _daysValidate;
String _subscribeStartTime;
String _subscribeEndTime;
List<String> _stores;
SubscribeParam copyWith({ bool isEnableSubscribe,
num dayOrDate,
dynamic startAfterDays,
dynamic daysValidate,
String subscribeStartTime,
String subscribeEndTime,
List<String> stores,
}) =>
SubscribeParam(
isEnableSubscribe: isEnableSubscribe ?? _isEnableSubscribe,
dayOrDate: dayOrDate ?? _dayOrDate,
startAfterDays: startAfterDays ?? _startAfterDays,
daysValidate: daysValidate ?? _daysValidate,
subscribeStartTime: subscribeStartTime ?? _subscribeStartTime,
subscribeEndTime: subscribeEndTime ?? _subscribeEndTime,
stores: stores ?? _stores,
);
bool get isEnableSubscribe => _isEnableSubscribe;
num get dayOrDate => _dayOrDate;
dynamic get startAfterDays => _startAfterDays;
dynamic get daysValidate => _daysValidate;
String get subscribeStartTime => _subscribeStartTime;
String get subscribeEndTime => _subscribeEndTime;
List<String> get stores => _stores;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['isEnableSubscribe'] = _isEnableSubscribe;
map['dayOrDate'] = _dayOrDate;
map['startAfterDays'] = _startAfterDays;
map['daysValidate'] = _daysValidate;
map['subscribeStartTime'] = _subscribeStartTime;
map['subscribeEndTime'] = _subscribeEndTime;
map['stores'] = _stores;
return map;
}
}

2
lib/retrofit/data/placeOrderFirst.dart

@ -137,6 +137,6 @@ class PromotionInfoDTOBean {
"couponId": couponId, "couponId": couponId,
"promotionId": promotionId, "promotionId": promotionId,
"useVipPrice":useVipPrice, "useVipPrice":useVipPrice,
"useBenefit":useBenefit "useBenefit": useBenefit,
}; };
} }

155
lib/retrofit/data/rechargeActLists.dart

@ -0,0 +1,155 @@
/// preferentialList : [{"id":"1506553893994102784","rechargeMoney":"100.00","giftdMoney":"0.00","gitfdCouponId":null,"tenantCode":"admin","createTime":"2022-11-11 10:10:31","isDeleted":0,"rechargeType":0,"remark":"<p>充值说明:<br />平台充值根据用户在平台的会员等级享有不同的充值权益。<br />银卡用户享1.1倍充值会员权益,即充值100元账户110元。<br />金卡用户享1.2倍充值会员权益,即充值100元账户120元。<br />共创用户享1.3倍充值会员权益,即充值100元账户130元。<br />平台充值金可在平台上所有品牌和门店使用,包含:农场火锅、海峡姐妹、前进麦味、百年川椒、农场煮意、一心回乡生态农场等。<br />储值活动不与其他活动同享</p>","sortValue":1},{"id":"1506553858271215616","rechargeMoney":"300.00","giftdMoney":"0.00","gitfdCouponId":null,"tenantCode":"admin","createTime":"2022-11-21 19:56:39","isDeleted":0,"rechargeType":0,"remark":"<p>平台充值根据用户在平台的会员等级享有不同的充值权益。<br />银卡用户享1.1倍充值会员权益,即充值100元账户110元。<br />金卡用户享1.2倍充值会员权益,即充值100元账户120元。<br />共创用户享1.3倍充值会员权益,即充值100元账户130元。<br />平台充值金可在平台上所有品牌和门店使用,包含:农场火锅、海峡姐妹、前进麦味、百年川椒、农场煮意、一心回乡生态农场等。</p>","sortValue":2},{"id":"1506553832157478912","rechargeMoney":"500.00","giftdMoney":"0.00","gitfdCouponId":null,"tenantCode":"admin","createTime":"2022-11-21 19:56:48","isDeleted":0,"rechargeType":0,"remark":"<p>平台充值根据用户在平台的会员等级享有不同的充值权益。<br />银卡用户享1.1倍充值会员权益,即充值100元账户110元。<br />金卡用户享1.2倍充值会员权益,即充值100元账户120元。<br />共创用户享1.3倍充值会员权益,即充值100元账户130元。<br />平台充值金可在平台上所有品牌和门店使用,包含:农场火锅、海峡姐妹、前进麦味、百年川椒、农场煮意、一心回乡生态农场等。</p>","sortValue":3},{"id":"1506553759084314624","rechargeMoney":"800.00","giftdMoney":"0.00","gitfdCouponId":null,"tenantCode":"admin","createTime":"2022-06-10 11:14:39","isDeleted":0,"rechargeType":0,"remark":"<p>平台充值根据用户在平台的会员等级享有不同的充值权益。<br />银卡用户享1.1倍充值会员权益,即充值100元账户110元。<br />金卡用户享1.2倍充值会员权益,即充值100元账户120元。<br />共创用户享1.3倍充值会员权益,即充值100元账户130元。<br />平台充值金可在平台上所有品牌和门店使用,包含:农场火锅、海峡姐妹、前进麦味、百年川椒、农场煮意、一心回乡生态农场等。</p>","sortValue":4},{"id":"1506553705988620288","rechargeMoney":"1000.00","giftdMoney":"0.00","gitfdCouponId":null,"tenantCode":"admin","createTime":"2022-11-21 19:56:55","isDeleted":0,"rechargeType":0,"remark":"<p>充值说明:<br />平台充值根据用户在平台的会员等级享有不同的充值权益。<br />银卡用户享1.1倍充值会员权益,即充值100元账户110元。<br />金卡用户享1.2倍充值会员权益,即充值100元账户120元。<br />共创用户享1.3倍充值会员权益,即充值100元账户130元。<br />平台充值金可在平台上所有品牌和门店使用,包含:农场火锅、海峡姐妹、前进麦味、百年川椒、农场煮意、一心回乡生态农场等。</p>","sortValue":5},{"id":"1506553668529291264","rechargeMoney":"1500.00","giftdMoney":"0.00","gitfdCouponId":null,"tenantCode":"admin","createTime":"2022-06-10 11:14:52","isDeleted":0,"rechargeType":0,"remark":"<p>充值说明:<br />平台充值根据用户在平台的会员等级享有不同的充值权益。<br />银卡用户享1.1倍充值会员权益,即充值100元账户110元。<br />金卡用户享1.2倍充值会员权益,即充值100元账户120元。<br />共创用户享1.3倍充值会员权益,即充值100元账户130元。<br />平台充值金可在平台上所有品牌和门店使用,包含:农场火锅、海峡姐妹、前进麦味、百年川椒、农场煮意、一心回乡生态农场等。</p>","sortValue":6}]
/// channels : ["海峡","回乡","boom"]
/// isOpen : false
class RechargeActLists {
RechargeActLists({
List<PreferentialList> preferentialList,
List<String> channels,
bool isOpen,}){
_preferentialList = preferentialList;
_channels = channels;
_isOpen = isOpen;
}
RechargeActLists.fromJson(dynamic json) {
if (json['preferentialList'] != null) {
_preferentialList = [];
json['preferentialList'].forEach((v) {
_preferentialList.add(PreferentialList.fromJson(v));
});
}
_channels = json['channels'] != null ? json['channels'].cast<String>() : [];
_isOpen = json['isOpen'];
}
List<PreferentialList> _preferentialList;
List<String> _channels;
bool _isOpen;
RechargeActLists copyWith({ List<PreferentialList> preferentialList,
List<String> channels,
bool isOpen,
}) => RechargeActLists( preferentialList: preferentialList ?? _preferentialList,
channels: channels ?? _channels,
isOpen: isOpen ?? _isOpen,
);
List<PreferentialList> get preferentialList => _preferentialList;
List<String> get channels => _channels;
bool get isOpen => _isOpen;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (_preferentialList != null) {
map['preferentialList'] = _preferentialList.map((v) => v.toJson()).toList();
}
map['channels'] = _channels;
map['isOpen'] = _isOpen;
return map;
}
}
/// id : "1506553893994102784"
/// rechargeMoney : "100.00"
/// giftdMoney : "0.00"
/// gitfdCouponId : null
/// tenantCode : "admin"
/// createTime : "2022-11-11 10:10:31"
/// isDeleted : 0
/// rechargeType : 0
/// remark : "<p>充值说明:<br />平台充值根据用户在平台的会员等级享有不同的充值权益。<br />银卡用户享1.1倍充值会员权益,即充值100元账户110元。<br />金卡用户享1.2倍充值会员权益,即充值100元账户120元。<br />共创用户享1.3倍充值会员权益,即充值100元账户130元。<br />平台充值金可在平台上所有品牌和门店使用,包含:农场火锅、海峡姐妹、前进麦味、百年川椒、农场煮意、一心回乡生态农场等。<br />储值活动不与其他活动同享</p>"
/// sortValue : 1
class PreferentialList {
PreferentialList({
String id,
String rechargeMoney,
String giftdMoney,
dynamic gitfdCouponId,
String tenantCode,
String createTime,
num isDeleted,
num rechargeType,
String remark,
num sortValue,}){
_id = id;
_rechargeMoney = rechargeMoney;
_giftdMoney = giftdMoney;
_gitfdCouponId = gitfdCouponId;
_tenantCode = tenantCode;
_createTime = createTime;
_isDeleted = isDeleted;
_rechargeType = rechargeType;
_remark = remark;
_sortValue = sortValue;
}
PreferentialList.fromJson(dynamic json) {
_id = json['id'];
_rechargeMoney = json['rechargeMoney'];
_giftdMoney = json['giftdMoney'];
_gitfdCouponId = json['gitfdCouponId'];
_tenantCode = json['tenantCode'];
_createTime = json['createTime'];
_isDeleted = json['isDeleted'];
_rechargeType = json['rechargeType'];
_remark = json['remark'];
_sortValue = json['sortValue'];
}
String _id;
String _rechargeMoney;
String _giftdMoney;
dynamic _gitfdCouponId;
String _tenantCode;
String _createTime;
num _isDeleted;
num _rechargeType;
String _remark;
num _sortValue;
PreferentialList copyWith({ String id,
String rechargeMoney,
String giftdMoney,
dynamic gitfdCouponId,
String tenantCode,
String createTime,
num isDeleted,
num rechargeType,
String remark,
num sortValue,
}) => PreferentialList( id: id ?? _id,
rechargeMoney: rechargeMoney ?? _rechargeMoney,
giftdMoney: giftdMoney ?? _giftdMoney,
gitfdCouponId: gitfdCouponId ?? _gitfdCouponId,
tenantCode: tenantCode ?? _tenantCode,
createTime: createTime ?? _createTime,
isDeleted: isDeleted ?? _isDeleted,
rechargeType: rechargeType ?? _rechargeType,
remark: remark ?? _remark,
sortValue: sortValue ?? _sortValue,
);
String get id => _id;
String get rechargeMoney => _rechargeMoney;
String get giftdMoney => _giftdMoney;
dynamic get gitfdCouponId => _gitfdCouponId;
String get tenantCode => _tenantCode;
String get createTime => _createTime;
num get isDeleted => _isDeleted;
num get rechargeType => _rechargeType;
String get remark => _remark;
num get sortValue => _sortValue;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = _id;
map['rechargeMoney'] = _rechargeMoney;
map['giftdMoney'] = _giftdMoney;
map['gitfdCouponId'] = _gitfdCouponId;
map['tenantCode'] = _tenantCode;
map['createTime'] = _createTime;
map['isDeleted'] = _isDeleted;
map['rechargeType'] = _rechargeType;
map['remark'] = _remark;
map['sortValue'] = _sortValue;
return map;
}
}

6
lib/retrofit/data/settleOrderInfo.dart

@ -22,6 +22,8 @@ class SettleOrderInfo {
bool isRaise; bool isRaise;
int selectDiscount; int selectDiscount;
bool useVipPriceSelect = false; bool useVipPriceSelect = false;
String vipDiscountAmount;
static SettleOrderInfo fromJson(Map<String, dynamic> map) { static SettleOrderInfo fromJson(Map<String, dynamic> map) {
if (map == null) return null; if (map == null) return null;
@ -51,6 +53,7 @@ class SettleOrderInfo {
settleOrderInfoBean.usePlateMoney = map['usePlateMoney']; settleOrderInfoBean.usePlateMoney = map['usePlateMoney'];
settleOrderInfoBean.isRaise = map['isRaise']; settleOrderInfoBean.isRaise = map['isRaise'];
settleOrderInfoBean.selectDiscount = map['selectDiscount']; settleOrderInfoBean.selectDiscount = map['selectDiscount'];
settleOrderInfoBean.vipDiscountAmount = map['vipDiscountAmount'];
return settleOrderInfoBean; return settleOrderInfoBean;
} }
@ -73,7 +76,8 @@ class SettleOrderInfo {
"memberCouponId": memberCouponId, "memberCouponId": memberCouponId,
"usePlateMoney":usePlateMoney, "usePlateMoney":usePlateMoney,
"isRaise":isRaise, "isRaise":isRaise,
"selectDiscount":selectDiscount "selectDiscount":selectDiscount,
"vipDiscountAmount":vipDiscountAmount
}; };

18
lib/retrofit/data/social_info.dart

@ -3,9 +3,9 @@
class SocialInfo { class SocialInfo {
SocialInfo({ SocialInfo({
int fans, dynamic fans,
int follow, dynamic follow,
int achievementNumber}){ dynamic achievementNumber}){
_fans = fans; _fans = fans;
_follow = follow; _follow = follow;
_achievementNumber = achievementNumber; _achievementNumber = achievementNumber;
@ -16,13 +16,13 @@ class SocialInfo {
_follow = json['follow']; _follow = json['follow'];
_achievementNumber = json['achievementNumber']; _achievementNumber = json['achievementNumber'];
} }
int _fans; dynamic _fans;
int _follow; dynamic _follow;
int _achievementNumber; dynamic _achievementNumber;
int get fans => _fans; dynamic get fans => _fans;
int get follow => _follow; dynamic get follow => _follow;
int get achievementNumber => _achievementNumber; dynamic get achievementNumber => _achievementNumber;
set fans(int value) { set fans(int value) {

8
lib/retrofit/data/user_info.dart

@ -41,8 +41,8 @@ class UserInfo {
String raiseExpireTime; String raiseExpireTime;
bool isBind; bool isBind;
String masterId; String masterId;
int inviteNumber; dynamic inviteNumber;
int todayInviteNumber; dynamic todayInviteNumber;
String masterCardRankName; String masterCardRankName;
MemberRank memberRankVo; MemberRank memberRankVo;
String inviteCode; String inviteCode;
@ -76,8 +76,8 @@ class UserInfo {
..raiseExpireTime = json['raiseExpireTime'] as String ..raiseExpireTime = json['raiseExpireTime'] as String
..isBind = json['isBind'] as bool ..isBind = json['isBind'] as bool
..masterId = json['masterId'] as String ..masterId = json['masterId'] as String
..inviteNumber = json['inviteNumber'] as int ..inviteNumber = json['inviteNumber'] as dynamic
..todayInviteNumber = json['todayInviteNumber'] as int ..todayInviteNumber = json['todayInviteNumber'] as dynamic
..masterCardRankName = json['masterCardRankName'] as String ..masterCardRankName = json['masterCardRankName'] as String
..inviteCode = json['inviteCode'] as String ..inviteCode = json['inviteCode'] as String
..signature = json['signature'] as String ..signature = json['signature'] as String

10
lib/retrofit/retrofit_api.dart

@ -27,6 +27,7 @@ import 'data/app_update.dart';
import 'data/banner.dart'; import 'data/banner.dart';
import 'data/brand_data.dart'; import 'data/brand_data.dart';
import 'data/category_select_list.dart'; import 'data/category_select_list.dart';
import 'data/channels_list.dart';
import 'data/chapter.dart'; import 'data/chapter.dart';
import 'data/collect_class_list.dart'; import 'data/collect_class_list.dart';
import 'data/coupon_detail.dart'; import 'data/coupon_detail.dart';
@ -47,6 +48,7 @@ import 'data/message.dart';
import 'data/msg_stats.dart'; import 'data/msg_stats.dart';
import 'data/page.dart'; import 'data/page.dart';
import 'data/rank.dart'; import 'data/rank.dart';
import 'data/rechargeActLists.dart';
import 'data/recharge_list.dart'; import 'data/recharge_list.dart';
import 'data/second_card_list.dart'; import 'data/second_card_list.dart';
import 'data/sign_info.dart'; import 'data/sign_info.dart';
@ -176,6 +178,10 @@ abstract class ApiService {
@POST("/auth/platform/memberLogin") @POST("/auth/platform/memberLogin")
Future<BaseData> memberLogin(@Body() Map<String, dynamic> param); Future<BaseData> memberLogin(@Body() Map<String, dynamic> param);
///APP门店推广渠道
@GET("/auth/appChannels")
Future<BaseData<ChannelsList>> appChannels();
/// ///
@GET("/auth/sendVerify/{areaCode}/{mobile}") @GET("/auth/sendVerify/{areaCode}/{mobile}")
Future<BaseData> sendVerify(@Path("areaCode") String areaCode, @Path("mobile") String mobile); Future<BaseData> sendVerify(@Path("areaCode") String areaCode, @Path("mobile") String mobile);
@ -215,8 +221,8 @@ abstract class ApiService {
Future<BaseData<dynamic>> recharge(@Body() Map<String, dynamic> param); Future<BaseData<dynamic>> recharge(@Body() Map<String, dynamic> param);
/// ///
@GET("/wallet/rechargeAct") @GET("/wallet/rechargeActList")
Future<BaseData<List<RechargeList>>> rechargeAct(); Future<BaseData<RechargeActLists>> rechargeActList();
/// ///
@GET("/coupon/receive?couponId={couponId}") @GET("/coupon/receive?couponId={couponId}")

35
lib/retrofit/retrofit_api.g.dart

@ -98,6 +98,27 @@ class _ApiService implements ApiService {
return value; return value;
} }
@override
Future<BaseData<ChannelsList>> appChannels() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/auth/appChannels',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<ChannelsList>.fromJson(
_result.data,
(json) => ChannelsList.fromJson(json),
);
return value;
}
@override @override
Future<BaseData<dynamic>> sendVerify(areaCode,mobile) async { Future<BaseData<dynamic>> sendVerify(areaCode,mobile) async {
ArgumentError.checkNotNull(mobile, 'mobile'); ArgumentError.checkNotNull(mobile, 'mobile');
@ -301,12 +322,12 @@ class _ApiService implements ApiService {
} }
@override @override
Future<BaseData<List<RechargeList>>> rechargeAct() async { Future<BaseData<RechargeActLists>> rechargeActList() async {
const _extra = <String, dynamic>{}; const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{}; final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>( final _result = await _dio.request<Map<String, dynamic>>(
'/wallet/rechargeAct', '/wallet/rechargeActList',
queryParameters: queryParameters, queryParameters: queryParameters,
options: RequestOptions( options: RequestOptions(
method: 'GET', method: 'GET',
@ -314,12 +335,10 @@ class _ApiService implements ApiService {
extra: _extra, extra: _extra,
baseUrl: baseUrl), baseUrl: baseUrl),
data: _data); data: _data);
final value = BaseData<List<RechargeList>>.fromJson( final value = BaseData<RechargeActLists>.fromJson(
_result.data, _result.data,
(json) => (json as List<dynamic>) (json) => RechargeActLists.fromJson(json),
.map<RechargeList>( );
(i) => RechargeList.fromJson(i as Map<String, dynamic>))
.toList());
return value; return value;
} }

445
lib/settlement/settlement.dart

@ -88,6 +88,11 @@ class _Settlement extends State<Settlement> {
ShoppingCart shopCarGoods; ShoppingCart shopCarGoods;
String vipLevelName; String vipLevelName;
bool isVips = false; bool isVips = false;
SubscribeParam subscribeParam;
String reservationTime;
String subscribeStoresName;
String subTime;
int storesIndex = 0;
@override @override
void initState() { void initState() {
@ -114,6 +119,7 @@ class _Settlement extends State<Settlement> {
vipLevelName = widget.arguments["vipLevelName"]; vipLevelName = widget.arguments["vipLevelName"];
isVips = widget.arguments["isVips"]; isVips = widget.arguments["isVips"];
subscribeParam = widget?.arguments["subscribeParam"] ?? null;
if (tableId == 0) { if (tableId == 0) {
placeOrder = true; placeOrder = true;
} }
@ -127,16 +133,15 @@ class _Settlement extends State<Settlement> {
token: minToken, token: minToken,
tenant: tenant, tenant: tenant,
storeId: storeId, storeId: storeId,
showLoading: false showLoading: false);
);
queryMemberInfo(); queryMemberInfo();
if (promotions != null && promotions != "" && tableId <= 0) { if (promotions != null && promotions != "" && tableId <= 0) {
queryOrderInfo( queryOrderInfo(
address != null ? address.id : null, address != null ? address.id : null,
selectedBtn, selectedBtn,
null,
0, 0,
widget.arguments["pid"] ?? (productId ?? ""), 0,
widget.arguments["pid"] ?? (productId ?? 0),
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
@ -151,7 +156,7 @@ class _Settlement extends State<Settlement> {
selectedBtn, selectedBtn,
widget.arguments["cid"], widget.arguments["cid"],
0, 0,
productId ?? null, productId ?? 0,
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
@ -164,9 +169,9 @@ class _Settlement extends State<Settlement> {
queryOrderInfo( queryOrderInfo(
null, null,
selectedBtn, selectedBtn,
null,
0, 0,
productId ?? null, 0,
productId ?? 0,
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
@ -277,7 +282,7 @@ class _Settlement extends State<Settlement> {
}); });
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
SharedPreferences.getInstance().then( SharedPreferences.getInstance().then(
(value) => { (value) => {
value.setString('minMember', jsonEncode(baseData.data)), value.setString('minMember', jsonEncode(baseData.data)),
}, },
); );
@ -352,31 +357,31 @@ class _Settlement extends State<Settlement> {
BaseData<List<Address>> baseDate = BaseData<List<Address>> baseDate =
await minService.queryAddress().catchError((error) {}); await minService.queryAddress().catchError((error) {});
BMFCoordinate bmfCoordinate = BMFCoordinate( BMFCoordinate bmfCoordinate = BMFCoordinate(
double.tryParse(storeInfo.latitude), double.tryParse(storeInfo.latitude),
double.tryParse(storeInfo.longitude), double.tryParse(storeInfo.longitude),
); );
if (baseDate != null && baseDate.isSuccess) { if (baseDate != null && baseDate.isSuccess) {
setState(() { setState(() {
address = baseDate.data[0]; address = baseDate.data[0];
}); });
for (int i = 1; i < baseDate.data.length; i++) { for (int i = 1; i < baseDate.data.length; i++) {
Address address1 = baseDate.data[i]; Address address1 = baseDate.data[i];
BMFCoordinate coordinate = await BMFCalculateUtils.coordConvert( BMFCoordinate coordinate = await BMFCalculateUtils.coordConvert(
coordinate: BMFCoordinate( coordinate: BMFCoordinate(
double.tryParse(address.longitude), double.tryParse(address.longitude),
double.tryParse(address.latitude), double.tryParse(address.latitude),
), ),
fromType: BMF_COORD_TYPE.COMMON, fromType: BMF_COORD_TYPE.COMMON,
toType: BMF_COORD_TYPE.BD09LL); toType: BMF_COORD_TYPE.BD09LL);
BMFCoordinate coordinate1 = await BMFCalculateUtils.coordConvert( BMFCoordinate coordinate1 = await BMFCalculateUtils.coordConvert(
coordinate: BMFCoordinate( coordinate: BMFCoordinate(
double.tryParse(address1.longitude), double.tryParse(address1.longitude),
double.tryParse(address1.latitude), double.tryParse(address1.latitude),
), ),
fromType: BMF_COORD_TYPE.COMMON, fromType: BMF_COORD_TYPE.COMMON,
toType: BMF_COORD_TYPE.BD09LL); toType: BMF_COORD_TYPE.BD09LL);
double mi = await BMFCalculateUtils.getLocationDistance( double mi = await BMFCalculateUtils.getLocationDistance(
bmfCoordinate, coordinate); bmfCoordinate, coordinate);
@ -418,9 +423,9 @@ class _Settlement extends State<Settlement> {
queryOrderInfo( queryOrderInfo(
address.id, address.id,
selectedBtn, selectedBtn,
null,
0, 0,
productId ?? null, 0,
productId ?? 0,
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
@ -509,9 +514,16 @@ class _Settlement extends State<Settlement> {
placeOrderFirst.cartNum = settleOrderInfo.orderNum; placeOrderFirst.cartNum = settleOrderInfo.orderNum;
placeOrderFirst.cartSum = settleOrderInfo.price; placeOrderFirst.cartSum = settleOrderInfo.price;
placeOrderFirst.addressId = address == null ? null : address.id; placeOrderFirst.addressId = address == null ? null : address.id;
placeOrderFirst.isSubscribe = false; placeOrderFirst.isSubscribe =
((subscribeParam?.isEnableSubscribe ?? false) == true)
? true
: false; //
placeOrderFirst.isTakeOut = selectedBtn; placeOrderFirst.isTakeOut = selectedBtn;
placeOrderFirst.notes = remakers; placeOrderFirst.notes = remakers +
(reservationTime ?? "") +
((subscribeParam?.isEnableSubscribe ?? false) == true
? "预约门店:${((subscribeParam?.stores?.length ?? 0) == 1 ? (subscribeParam.stores[0]) : (subscribeStoresName ?? ""))}"
: "");
placeOrderFirst.numberOfPeople = "$numberOfPeople"; placeOrderFirst.numberOfPeople = "$numberOfPeople";
placeOrderFirst.orderSource = 2; placeOrderFirst.orderSource = 2;
placeOrderFirst.orderType = "0"; placeOrderFirst.orderType = "0";
@ -534,10 +546,11 @@ class _Settlement extends State<Settlement> {
placeOrderFirst.skuItemDTOList = []; placeOrderFirst.skuItemDTOList = [];
placeOrderFirst.source = 1; placeOrderFirst.source = 1;
placeOrderFirst.storeId = storeInfo.id; placeOrderFirst.storeId = storeInfo.id;
placeOrderFirst.subcribeTime = null; placeOrderFirst.subcribeTime = subTime ?? ""; //
placeOrderFirst.tableId = "$tableId"; placeOrderFirst.tableId = "$tableId";
for(int i = 0;i<shopCarGoods.shoppingCartSkuItemList.length;i++){ for (int i = 0; i < shopCarGoods.shoppingCartSkuItemList.length; i++) {
placeOrderFirst.shoppingCartSkuItemList[i].setMealDataList = shopCarGoods.shoppingCartSkuItemList[i].setMealDataList; placeOrderFirst.shoppingCartSkuItemList[i].setMealDataList =
shopCarGoods.shoppingCartSkuItemList[i].setMealDataList;
} }
if (tableId == 0) { if (tableId == 0) {
@ -580,7 +593,7 @@ class _Settlement extends State<Settlement> {
}); });
} }
} }
orderButton = false; // orderButton = false;
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
placeOrder = true; placeOrder = true;
this.downOrder = DownOrder.fromJson(baseData.data); this.downOrder = DownOrder.fromJson(baseData.data);
@ -588,7 +601,7 @@ class _Settlement extends State<Settlement> {
queryOrderDetails(parentId); queryOrderDetails(parentId);
setState(() {}); setState(() {});
} else { } else {
orderButton = false; // orderButton = false;
SmartDialog.showToast(baseData?.msg, alignment: Alignment.center); SmartDialog.showToast(baseData?.msg, alignment: Alignment.center);
} }
} }
@ -645,13 +658,13 @@ class _Settlement extends State<Settlement> {
toOrderDetails(placeOrderFirst.id); toOrderDetails(placeOrderFirst.id);
} else { } else {
SmartDialog.show( SmartDialog.show(
clickBgDismissTemp: false, clickBgDismissTemp: false,
widget: SettlementTips( widget: SettlementTips(
() { () {
toOrderDetails(placeOrderFirst.id); toOrderDetails(placeOrderFirst.id);
}, },
text: "${baseData?.msg}", text: "${baseData?.msg}",
)); ));
} }
} }
} }
@ -722,7 +735,7 @@ class _Settlement extends State<Settlement> {
'/router/order_details', '/router/order_details',
arguments: { arguments: {
"id": orderId, "id": orderId,
"jumpState":1, "jumpState": 1,
}, },
); );
// Navigator.of(context).pop(); // Navigator.of(context).pop();
@ -777,8 +790,8 @@ class _Settlement extends State<Settlement> {
child: Container( child: Container(
child: Column( child: Column(
children: [ children: [
DistributionMode((addressId, isTake, memberCouponId, DistributionMode((addressId, isTake,
orderId, promotionId) { memberCouponId, orderId, promotionId) {
setState(() { setState(() {
this.selectedBtn = 0; this.selectedBtn = 0;
}); });
@ -787,7 +800,7 @@ class _Settlement extends State<Settlement> {
isTake, isTake,
memberCouponId, memberCouponId,
orderId, orderId,
promotionId ?? (productId ?? ""), promotionId ?? (productId ?? 0),
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
@ -796,8 +809,13 @@ class _Settlement extends State<Settlement> {
count1, count1,
payChannel, payChannel,
tableId ?? 0); tableId ?? 0);
}, queryAddress, storeInfo, address, },
selectedAddress, pageType,widget.arguments["distance"]), queryAddress,
storeInfo,
address,
selectedAddress,
pageType,
widget.arguments["distance"]),
SizedBox( SizedBox(
height: 16, height: 16,
@ -810,43 +828,46 @@ class _Settlement extends State<Settlement> {
// ), // ),
/// ///
if(settleOrderInfo != null || minOrderInfo != null) if (settleOrderInfo != null ||
SettlementOrderCommodity( minOrderInfo != null)
selectedBtn, SettlementOrderCommodity(
settleOrderInfo, selectedBtn,
minOrderInfo, settleOrderInfo,
tableId, minOrderInfo,
pageType, tableId,
(coupons != "" || promotions!="") ? false : useVipPriceSelect, pageType,
this.showVipTips, (coupons != "" || promotions != "")
(coupons != "" || promotions!="") ? false : useBenefitSelect, ? false
placeOrder : useVipPriceSelect,
), this.showVipTips),
///// /////
if(settleOrderInfo != null || minOrderInfo != null) if (settleOrderInfo != null ||
ActivityCouponRemarks( minOrderInfo != null)
couponCart, ActivityCouponRemarks(
activityCart, couponCart,
settleOrderInfo, activityCart,
minOrderInfo, settleOrderInfo,
coupons, minOrderInfo,
promotions, coupons,
couponCount(), promotions,
placeOrder, couponCount(),
remakers, placeOrder,
() { remakers,
Navigator.of(context).pushNamed( () {
'/router/edit_remarks_page', Navigator.of(context).pushNamed(
arguments: {"remake":remakers} '/router/edit_remarks_page',
).then((value) => { arguments: {
setState(() { "remake": remakers
if (value != null) remakers = value; }).then((value) => {
}) setState(() {
});}, if (value != null) remakers = value;
tableId, })
vipPriceSelect, });
(){ },
tableId,
vipPriceSelect,
() {
setState(() { setState(() {
this.showVipTips = true; this.showVipTips = true;
}); });
@ -855,6 +876,13 @@ class _Settlement extends State<Settlement> {
payChannel, payChannel,
vipLevelName, vipLevelName,
), ),
},
subscribeParam,
showDateSelector,
reservationTime,
showAlertDialog,
subscribeStoresName,
),
if (settleOrderInfo != null && placeOrder && joinA != JoinActivity.BargainBug) if (settleOrderInfo != null && placeOrder && joinA != JoinActivity.BargainBug)
/// ///
@ -920,14 +948,30 @@ class _Settlement extends State<Settlement> {
vertical: 5.h, vertical: 5.h,
), ),
callback: () { callback: () {
pageType != null // if (orderButton) {
? bargainOrderId != null // SmartDialog.showToast("订单正在提交中...",
? activityPay() // alignment: Alignment.center);
: joinA == JoinActivity.GoJoin // return;
? queryJoinAct() // } else
: queryLaunchAct() // orderButton = true;
: queryPlaceOrderFirst(); if (subscribeParam != null && ((subscribeParam.isEnableSubscribe ?? false) ==
// } true) &&
(reservationTime == null ||
((subscribeParam.stores.length ==1 ? subscribeParam.stores[0] : subscribeStoresName) == null))) {
SmartDialog.showToast(
(reservationTime == null)
? "请选择预约时间"
: "请选择预约门店",
alignment: Alignment.center);
return;
}
pageType != null
? bargainOrderId != null
? activityPay()
: joinA == JoinActivity.GoJoin
? queryJoinAct()
: queryLaunchAct()
: queryPlaceOrderFirst();
}, },
), ),
SizedBox( SizedBox(
@ -975,9 +1019,9 @@ class _Settlement extends State<Settlement> {
queryOrderInfo( queryOrderInfo(
address?.id, address?.id,
selectedBtn, selectedBtn,
null,
0, 0,
productId ?? null, 0,
productId ?? 0,
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
@ -1006,7 +1050,8 @@ class _Settlement extends State<Settlement> {
useBenefitSelect, useBenefitSelect,
count1, count1,
payChannel, payChannel,
tableId);} tableId);
}
} }
mobileChange(String mobile) { mobileChange(String mobile) {
@ -1046,17 +1091,15 @@ class _Settlement extends State<Settlement> {
// promotions = ""; // promotions = "";
// this.promotion = null; // this.promotion = null;
if (tableId > 0) { if (tableId > 0) {
if(couponBean == null) if (couponBean == null) queryCancelMemberCoupon(parentId);
queryCancelMemberCoupon(parentId); if (couponBean.id != null) queryUseMemberCoupon(couponBean.id);
if (couponBean.id != null)
queryUseMemberCoupon(couponBean.id);
} else { } else {
queryOrderInfo( queryOrderInfo(
address?.id, address?.id,
selectedBtn, selectedBtn,
couponBean?.id, couponBean?.id,
0, 0,
productId ?? null, productId ?? 0,
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
@ -1088,9 +1131,9 @@ class _Settlement extends State<Settlement> {
queryOrderInfo( queryOrderInfo(
address?.id, address?.id,
selectedBtn, selectedBtn,
null,
0, 0,
(pro.id??"")??productId, 0,
(pro.id ?? "") ?? productId,
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
@ -1100,5 +1143,193 @@ class _Settlement extends State<Settlement> {
payChannel, payChannel,
tableId); tableId);
} }
// }
///
showDateSelector() {
var minTime = DateTime.now().isAfter(
DateTime.tryParse(subscribeParam?.subscribeStartTime ?? ""))
? DateTime.now()
: DateTime.tryParse(subscribeParam?.subscribeStartTime ?? "");
DatePicker.showDateTimePicker(context,
showTitleActions: true,
minTime: minTime,
maxTime: DateTime.tryParse(subscribeParam?.subscribeEndTime ?? ""),
theme: DatePickerTheme(
headerColor: Colors.white,
backgroundColor: Colors.white,
itemStyle: TextStyle(
color: Colors.black,
fontWeight: MyFontWeight.bold,
fontSize: 18),
doneStyle: TextStyle(color: Color(0xFF32A060), fontSize: 16.sp)),
onChanged: (date) {
print('change $date in time zone ' +
date.timeZoneOffset.inHours.toString());
}, onConfirm: (date) {
reservationTime = date.toString().substring(0, 16);
subTime = date.toUtc().toIso8601String().toString();
setState(() {});
}, currentTime: minTime, locale: LocaleType.zh);
}
///
showAlertDialog() {
showModalBottomSheet(
builder: (BuildContext context) {
return StatefulBuilder(builder: (
context,
state,
) {
return Container(
width: double.infinity,
height: 280.h,
padding: EdgeInsets.symmetric(horizontal: 14.w, vertical: 16.h),
decoration: new BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
topRight: Radius.circular(8),
),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Container(
// padding: EdgeInsets.symmetric(vertical: 10.h, horizontal: 14.w),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// GestureDetector(
// onTap: () {
// Navigator.of(context).pop();
// },
// child: Text(
// S.of(context).quxiao,
// style:
// TextStyle(fontSize: 18.sp, color: Colors.black),
// ),
// ),
// GestureDetector(
// onTap: () {
// setState(() {
// subscribeStoresName =
// subscribeParam.stores[storesIndex];
// });
// Navigator.of(context).pop();
// },
// child: Text(
// S.of(context).queding,
// style: TextStyle(
// fontSize: 18.sp, color: Color(0xFF32A060)),
// ),
// ),
// ],
// ),
// ),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Container(
alignment: Alignment.center,
margin: EdgeInsets.symmetric(vertical:5.h),
child: Text(
"请选择预约门店",
style: TextStyle(
fontWeight: MyFontWeight.bold,
fontSize: 15.sp,
color: Color(0xFF353535),
),
),
)),
GestureDetector(
onTap: () {
setState(() {
Navigator.of(context).pop();
});
},
child: Icon(
Icons.clear,
color: Colors.black,
size: 18,
),
),
// SizedBox(width:4.w),
],
),
Expanded(
child: ListView.builder(
itemCount: subscribeParam.stores.length ?? 0,
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
state(() {
storesIndex = position;
});
},
child: storesNameItem(position),
);
}),
),
GestureDetector(
onTap: (){
setState(() {
subscribeStoresName = subscribeParam.stores[storesIndex];
});
Navigator.of(context).pop();
},
child: Container(
width: double.infinity,
height: 40.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
color:Color(0xFF32A060),
),
alignment: Alignment.center,
margin: EdgeInsets.only(bottom: 10.h,),
child: Text(
S.of(context).queding,
style: TextStyle(
fontWeight: MyFontWeight.bold,
fontSize: 16.sp,
color: Color(0xFFFFFFFF),
),
),
),
),
],
),
);
});
},
backgroundColor: Colors.transparent,
context: context);
}
Widget storesNameItem(index) {
return Container(
width: double.infinity,
margin: EdgeInsets.symmetric(vertical:8.h),
padding: EdgeInsets.symmetric(vertical: 10.h),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius:BorderRadius.circular(6),
border: Border.all(
color: storesIndex == index ? Color(0xFF32A060):Color(0xFFF7F7F7),
width: storesIndex == index ? 1 :0,
),
color: storesIndex == index ? Color(0xFFF0FAF4) :Color(0xFFF7F7F7),
),
child: Text(
subscribeParam.stores[index],
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 16.sp,
color: storesIndex == index ? Color(0xFF32A060) : Colors.black,
),
),
);
}
} }

135
lib/settlement/settlement_view/activity_coupon_remarks.dart

@ -9,6 +9,8 @@ import 'package:huixiang/retrofit/data/settleOrderInfo.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../retrofit/data/miNiDetail.dart';
import '../../view_widget/settlement_tips_dialog.dart'; import '../../view_widget/settlement_tips_dialog.dart';
class ActivityCouponRemarks extends StatefulWidget { class ActivityCouponRemarks extends StatefulWidget {
@ -29,6 +31,11 @@ class ActivityCouponRemarks extends StatefulWidget {
final Function(bool useBenefitSelect) vipBenefitSelect; final Function(bool useBenefitSelect) vipBenefitSelect;
final int payChannell; final int payChannell;
final String vipLevelName; final String vipLevelName;
final SubscribeParam subscribeParam;
final Function() showDateSelector;
final String reservationTime;
final Function() showAlertDialog;
final String subscribeStoresName;
ActivityCouponRemarks( ActivityCouponRemarks(
this.couponCart, this.couponCart,
@ -47,6 +54,12 @@ class ActivityCouponRemarks extends StatefulWidget {
this.vipBenefitSelect, this.vipBenefitSelect,
this.payChannell, this.payChannell,
this.vipLevelName); this.vipLevelName);
this.showVipTips,
this.subscribeParam,
this.showDateSelector,
this.reservationTime,
this.showAlertDialog,
this.subscribeStoresName);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -257,8 +270,38 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
// ), // ),
// ), // ),
if (widget.placeOrder && if (widget.placeOrder &&
widget.tableId <= 0 && widget?.settleOrderInfo?.benefitDiscountAmount != null &&
!(widget?.settleOrderInfo?.isRaise ?? false)) widget?.settleOrderInfo?.benefitDiscountAmount != "0")
Container(
margin: EdgeInsets.only(bottom: 13),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
flex: 1,
child: Text(
"会员优惠金额",
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 14.sp,
color: Color(0xFF353535),
),
),
),
Text(
widget.settleOrderInfo.benefitDiscountAmount,
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF32A060),
fontWeight: MyFontWeight.semi_bold,
),
),
],
),
),
if (widget.placeOrder && widget.tableId <= 0 && !(widget?.settleOrderInfo?.isRaise ?? false))
InkWell( InkWell(
onTap: () { onTap: () {
if(widget.payChannell == 5){ if(widget.payChannell == 5){
@ -393,6 +436,94 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
], ],
), ),
), ),
if ((widget.subscribeParam?.isEnableSubscribe ?? false) == true)
SizedBox(
height: 13,
),
if ((widget.subscribeParam?.isEnableSubscribe ?? false) == true)
InkWell(
onTap: () {
widget.showDateSelector();
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
flex: 1,
child: Text(
"预约时间",
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 14.sp,
color: Color(0xFF353535),
),
),
),
Expanded(
child: Text(
widget.reservationTime ?? "请选择时间",
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF858585),
fontWeight: MyFontWeight.medium,
),
),
),
Icon(
Icons.keyboard_arrow_right,
size: 16,
),
],
),
),
if ((widget.subscribeParam?.isEnableSubscribe ?? false) == true)
SizedBox(
height: 13,
),
if ((widget.subscribeParam?.isEnableSubscribe ?? false) == true)
InkWell(
onTap: () {
if (widget.subscribeParam.stores.length > 1)
widget.showAlertDialog();
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
flex: 1,
child: Text(
"预约店铺",
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 14.sp,
color: Color(0xFF353535),
),
),
),
Expanded(
child: Text(
((widget.subscribeParam.stores.length == 1)
? widget?.subscribeParam?.stores[0]
: widget.subscribeStoresName) ??
"请选择店铺",
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF858585),
fontWeight: MyFontWeight.medium,
),
),
),
Icon(
Icons.keyboard_arrow_right,
size: 16,
),
],
),
),
], ],
), ),
); );

118
lib/store/shop_details_page.dart

@ -102,7 +102,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
token: value.getString("token"), token: value.getString("token"),
); );
BaseData baseData = BaseData baseData =
await apiService.queryStoreInfo(storeId).catchError((error) { await apiService.queryStoreInfo(storeId).catchError((error) {
debugPrint(error); debugPrint(error);
}); });
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
@ -129,7 +129,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
String tenant = storeInfo.tenantCode; String tenant = storeInfo.tenantCode;
String storeId = storeInfo.id; String storeId = storeInfo.id;
SharedPreferences.getInstance().then( SharedPreferences.getInstance().then(
(value) => { (value) => {
value.setString('minToken', minToken), value.setString('minToken', minToken),
value.setString('tenant', tenant), value.setString('tenant', tenant),
value.setString('storeId', storeId), value.setString('storeId', storeId),
@ -246,7 +246,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
if (parentId == null || parentId == "") { if (parentId == null || parentId == "") {
if (num == 0) { if (num == 0) {
SmartDialog.showToast("请先选择您要购买的商品!~",alignment: Alignment.center); SmartDialog.showToast("请先选择您要购买的商品!~", alignment: Alignment.center);
return; return;
} }
} }
@ -264,8 +264,16 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
"cid": cid, "cid": cid,
"shoppingCart": shopCarGoods, "shoppingCart": shopCarGoods,
"numberOfPeople": numberOfPeople, "numberOfPeople": numberOfPeople,
"distance": widget.arguments["distance"],
"subscribeParam": miNiDetail?.subscribeParam,
}, },
); );
if ((miNiDetail?.subscribeParam?.isEnableSubscribe ?? false) == true) {
clearShopCar();
this.shopCarGoods = await queryShopCar();
}
if (tableId > 0) { if (tableId > 0) {
getParentInfo(); getParentInfo();
} }
@ -365,6 +373,10 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
.replaceAll("]", "") .replaceAll("]", "")
.replaceAll(",", ""); .replaceAll(",", "");
if ((miNiDetail.subscribeParam.isEnableSubscribe ?? false) == true) {
clearShopCar();
}
if (miNiDetail != null) { if (miNiDetail != null) {
BaseData<List<ShoppingCart>> baseDate = await minService.addShoppingCart({ BaseData<List<ShoppingCart>> baseDate = await minService.addShoppingCart({
"storeId": storeInfo.id, "storeId": storeInfo.id,
@ -391,6 +403,8 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
if (baseDate != null && baseDate.isSuccess) { if (baseDate != null && baseDate.isSuccess) {
queryShopCar().then((value) { queryShopCar().then((value) {
this.shopCarGoods = value; this.shopCarGoods = value;
if ((miNiDetail.subscribeParam.isEnableSubscribe ?? false) == true)
toDownOrder();
setState(() {}); setState(() {});
}); });
} else { } else {
@ -630,7 +644,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: EdgeInsets.only(left: 14.w,top: 16.h), padding: EdgeInsets.only(left: 14.w, top: 16.h),
child: Text( child: Text(
"商品详情", "商品详情",
style: TextStyle( style: TextStyle(
@ -831,9 +845,10 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
)), )),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
if(storeInfo.posType.code == "NORMALSTORE" && tableId == 0){ if (storeInfo.posType.code == "NORMALSTORE" &&
tableId == 0) {
showDeleteDialog(); showDeleteDialog();
}else{ } else {
_queryMiNiDetail(id, counts); _queryMiNiDetail(id, counts);
} }
}, },
@ -859,7 +874,11 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
width: 2, width: 2,
), ),
Text( Text(
"加入购物车", ((miNiDetail?.subscribeParam?.isEnableSubscribe ??
false) ==
true)
? "立即预约"
: "加入购物车",
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
@ -953,12 +972,12 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
showModalBottomSheet( showModalBottomSheet(
builder: (BuildContext context) { builder: (BuildContext context) {
return StatefulBuilder(builder: ( return StatefulBuilder(builder: (
context, context,
state, state,
) { ) {
return Container( return Container(
alignment: Alignment.topCenter, alignment: Alignment.topCenter,
padding: EdgeInsets.symmetric(horizontal: 14.w,vertical: 16), padding: EdgeInsets.symmetric(horizontal: 14.w, vertical: 16),
height: MediaQuery.of(context).size.height / 3 * 2, height: MediaQuery.of(context).size.height / 3 * 2,
width: double.infinity, width: double.infinity,
decoration: BoxDecoration( decoration: BoxDecoration(
@ -992,47 +1011,47 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
), ),
Expanded( Expanded(
child: Container( child: Container(
height: 70, height: 70,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
miNiDetail?.productName ?? "",
style: TextStyle(
fontSize: 13.sp,
fontWeight: FontWeight.bold,
color: Color(0xFF000000),
),
),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Image.asset(
"assets/image/cancel.webp",
fit: BoxFit.cover,
height: 24,
width: 24,
),
),
],
),
Text( Text(
"${miNiDetail?.price ?? ""}", miNiDetail?.productName ?? "",
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 13.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Color(0xFFF65720), color: Color(0xFF000000),
),
),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Image.asset(
"assets/image/cancel.webp",
fit: BoxFit.cover,
height: 24,
width: 24,
), ),
), ),
], ],
), ),
)), Text(
"${miNiDetail?.price ?? ""}",
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.bold,
color: Color(0xFFF65720),
),
),
],
),
)),
], ],
), ),
if (miNiDetail.attrList != null && if (miNiDetail.attrList != null &&
@ -1050,7 +1069,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
itemBuilder: (context, position) { itemBuilder: (context, position) {
return attrItem( return attrItem(
(attrValue) { (attrValue) {
state(() { state(() {
// if(selectSkus.length > position) // if(selectSkus.length > position)
selectSkus[position] = attrValue; selectSkus[position] = attrValue;
@ -1097,8 +1116,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
Icons.remove, Icons.remove,
color: Color(0xFF32A060), color: Color(0xFF32A060),
size: 24, size: 24,
) )),
),
Padding( Padding(
padding: EdgeInsets.only(left: 8, right: 8), padding: EdgeInsets.only(left: 8, right: 8),
child: Text( child: Text(
@ -1132,7 +1150,11 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
RoundButton( RoundButton(
width: double.infinity, width: double.infinity,
height: 54.h, height: 54.h,
text: "加入购物车", text: ((miNiDetail?.subscribeParam?.isEnableSubscribe ??
false) ==
true)
? "立即预约"
: "加入购物车",
textColor: Colors.white, textColor: Colors.white,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
radius: 27, radius: 27,
@ -1310,7 +1332,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
S.of(context).ninxiangjiquanxianweikaiqi, S.of(context).ninxiangjiquanxianweikaiqi,
S.of(context).weilekaipaizhaoxuanzhetouxiang, S.of(context).weilekaipaizhaoxuanzhetouxiang,
S.of(context).kaiqiquanxian, S.of(context).kaiqiquanxian,
(result) async { (result) async {
if (result) { if (result) {
await openAppSettings(); await openAppSettings();
} }

41
lib/store/store_order.dart

@ -35,6 +35,7 @@ import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import '../retrofit/data/settleOrderInfo.dart'; import '../retrofit/data/settleOrderInfo.dart';
import '../settlement/settlement.dart';
import '../view_widget/border_text.dart'; import '../view_widget/border_text.dart';
import '../view_widget/request_permission.dart'; import '../view_widget/request_permission.dart';
@ -69,6 +70,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
int numberOfPeople = 0; int numberOfPeople = 0;
String vipLevelName; String vipLevelName;
MemberVo memberVo; MemberVo memberVo;
MiNiDetail miNiDetail;
///token ///token
String minToken; String minToken;
@ -430,6 +432,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
]; ];
}, },
body: body:
/// ///
TabBarView( TabBarView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
@ -519,12 +522,19 @@ class _StoreOrderPage extends State<StoreOrderPage>
Spacer(), Spacer(),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
// if(AppUtils.compareTime(storeInfo.openStartTime,DateFormat('HH:mm:ss').format(DateTime.now())) if (AppUtils.compareTime(
// &&(!AppUtils.compareTime(storeInfo.openEndTime,DateFormat('HH:mm:ss').format(DateTime.now())))){ storeInfo.openStartTime,
toDownOrder(); DateFormat('HH:mm:ss')
// } .format(DateTime.now())) &&
// else (!AppUtils.compareTime(
// SmartDialog.showToast("营业时间:${storeInfo.openStartTime}-${storeInfo.openEndTime}", alignment: Alignment.center); storeInfo.openEndTime,
DateFormat('HH:mm:ss')
.format(DateTime.now())))) {
toDownOrder();
} else
SmartDialog.showToast(
"营业时间:${storeInfo.openStartTime}-${storeInfo.openEndTime}",
alignment: Alignment.center);
}, },
child: RoundButton( child: RoundButton(
width: 103.w, width: 103.w,
@ -635,7 +645,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
if (parentId == null || parentId == "") { if (parentId == null || parentId == "") {
if (num == 0) { if (num == 0) {
SmartDialog.showToast("请先选择您要购买的商品!~",alignment: Alignment.center); SmartDialog.showToast("请先选择您要购买的商品!~", alignment: Alignment.center);
return; return;
} }
} }
@ -656,8 +666,16 @@ class _StoreOrderPage extends State<StoreOrderPage>
"distance":widget.arguments["distance"], "distance":widget.arguments["distance"],
"vipLevelName":memberVo.memberRankVo.rankName, "vipLevelName":memberVo.memberRankVo.rankName,
"isVips":memberVo.isVip, "isVips":memberVo.isVip,
"distance": widget.arguments["distance"],
"subscribeParam": miNiDetail?.subscribeParam,
}, },
); );
if ((miNiDetail?.subscribeParam?.isEnableSubscribe ?? false) == true) {
clearShopCar();
this.shopCarGoods = await queryShopCar();
}
if (tableId > 0) { if (tableId > 0) {
getParentInfo(); getParentInfo();
} }
@ -747,7 +765,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
_queryMiNiDetail(String id, int count) async { _queryMiNiDetail(String id, int count) async {
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai);
if (count < 0) { if (count < 0) {
shopCarGoods.shoppingCartSkuItemList.forEach((element) async{ shopCarGoods.shoppingCartSkuItemList.forEach((element) async {
if (element.productId == id) { if (element.productId == id) {
await shopCartReduce(element); await shopCartReduce(element);
setState(() {}); setState(() {});
@ -758,6 +776,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
BaseData<MiNiDetail> baseData = await minService.miNiDetail(id); BaseData<MiNiDetail> baseData = await minService.miNiDetail(id);
EasyLoading.dismiss(); EasyLoading.dismiss();
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
miNiDetail = baseData.data;
showStoreSelector(baseData.data, id, count); showStoreSelector(baseData.data, id, count);
} }
} }
@ -810,6 +829,10 @@ class _StoreOrderPage extends State<StoreOrderPage>
.replaceAll("]", "") .replaceAll("]", "")
.replaceAll(",", ""); .replaceAll(",", "");
if ((miNiDetail.subscribeParam.isEnableSubscribe ?? false) == true) {
clearShopCar();
}
if (miNiDetail != null) { if (miNiDetail != null) {
BaseData<List<ShoppingCart>> baseDate = await minService.addShoppingCart({ BaseData<List<ShoppingCart>> baseDate = await minService.addShoppingCart({
"storeId": storeInfo.id, "storeId": storeInfo.id,
@ -835,6 +858,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
// EasyLoading.dismiss(); // EasyLoading.dismiss();
if (baseDate != null && baseDate.isSuccess) { if (baseDate != null && baseDate.isSuccess) {
this.shopCarGoods = await queryShopCar(); this.shopCarGoods = await queryShopCar();
if ((miNiDetail.subscribeParam.isEnableSubscribe ?? false) == true)
toDownOrder();
setState(() {}); setState(() {});
} else { } else {
SmartDialog.showToast(baseDate?.msg, alignment: Alignment.center); SmartDialog.showToast(baseDate?.msg, alignment: Alignment.center);

2
lib/store/store_view/product_sku.dart

@ -292,7 +292,7 @@ class _ProductSku extends State<ProductSku> {
RoundButton( RoundButton(
width: double.infinity, width: double.infinity,
height: 54.h, height: 54.h,
text: "加入购物车", text: (widget?.miNiDetail?.subscribeParam?.isEnableSubscribe ?? false) == true ? "立即预约":"加入购物车",
textColor: Colors.white, textColor: Colors.white,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
radius: 27, radius: 27,

417
lib/store/store_view/shop_goods.dart

@ -42,7 +42,7 @@ class ShopGoods extends StatefulWidget {
this.queryShoppingCart, this.queryShoppingCart,
this.queryMiNiDetail, this.queryMiNiDetail,
this.shoppingCartSkuItemListBean, this.shoppingCartSkuItemListBean,
this.storeInfo this.storeInfo,
}); });
@override @override
@ -51,9 +51,9 @@ class ShopGoods extends StatefulWidget {
} }
} }
class _ShopGoods extends State<ShopGoods> { class _ShopGoods extends State<ShopGoods> {
int _jumpType = -1; int _jumpType = -1;
MiNiDetail miNiDetail;
/// ///
queryMiNiDetail(id) async { queryMiNiDetail(id) async {
@ -62,26 +62,28 @@ class _ShopGoods extends State<ShopGoods> {
String minToken = value.getString("minToken"); String minToken = value.getString("minToken");
String tenant = value.getString("tenant"); String tenant = value.getString("tenant");
String storeId = value.getString("storeId"); String storeId = value.getString("storeId");
minService = MinApiService(Dio(), minService = MinApiService(
Dio(),
context: context, context: context,
token: minToken, token: minToken,
tenant: tenant, tenant: tenant,
storeId: storeId,); storeId: storeId,
);
}); });
BaseData<MiNiDetail> baseData = BaseData<MiNiDetail> baseData =
await minService.miNiDetail(id).catchError((error) { await minService.miNiDetail(id).catchError((error) {});
});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
if(baseData.data.productSkuVOList[0].productSetMeals.length == 0){ miNiDetail = baseData.data;
if (baseData.data.productSkuVOList[0].productSetMeals.length == 0) {
_jumpType = 0; _jumpType = 0;
widget.add(widget.shoppingCartSkuItemListBean); widget.add(widget.shoppingCartSkuItemListBean);
}else{ } else {
_jumpType = 1; _jumpType = 1;
await Navigator.of(context) await Navigator.of(context)
.pushNamed('/router/product_meals_sku', arguments: { .pushNamed('/router/product_meals_sku', arguments: {
"id":widget.productListBean.id, "id": widget.productListBean.id,
"storeId":widget.productListBean.storeId, "storeId": widget.productListBean.storeId,
"tableId":widget.tableId "tableId": widget.tableId
}); });
widget.queryShoppingCart(); widget.queryShoppingCart();
} }
@ -90,7 +92,7 @@ class _ShopGoods extends State<ShopGoods> {
} }
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
color: Colors.white, color: Colors.white,
@ -99,7 +101,7 @@ class _ShopGoods extends State<ShopGoods> {
// // bottom: 20.h, // // bottom: 20.h,
// ), // ),
height: 123.h, height: 123.h,
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
@ -109,8 +111,8 @@ class _ShopGoods extends State<ShopGoods> {
widget.productListBean != null widget.productListBean != null
? widget.productListBean.imgPath ? widget.productListBean.imgPath
: (widget.shoppingCartSkuItemListBean != null : (widget.shoppingCartSkuItemListBean != null
? widget.shoppingCartSkuItemListBean.skuImg ? widget.shoppingCartSkuItemListBean.skuImg
: ""), : ""),
width: 70.h, width: 70.h,
height: 70.h, height: 70.h,
radius: BorderRadius.circular(4), radius: BorderRadius.circular(4),
@ -125,64 +127,68 @@ class _ShopGoods extends State<ShopGoods> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding(padding: EdgeInsets.only(right: 16.w), Padding(
child: Row( padding: EdgeInsets.only(right: 16.w),
children: [ child: Row(
Expanded( children: [
child: Text( Expanded(
widget.productListBean != null child: Text(
? widget.productListBean.productName widget.productListBean != null
: widget.shoppingCartSkuItemListBean.productName, ? widget.productListBean.productName
overflow: TextOverflow.ellipsis, : widget.shoppingCartSkuItemListBean.productName,
maxLines: 2, overflow: TextOverflow.ellipsis,
style: TextStyle( maxLines: 2,
color: Colors.black, style: TextStyle(
fontSize: 13.sp, color: Colors.black,
fontWeight: MyFontWeight.medium, fontSize: 13.sp,
fontWeight: MyFontWeight.medium,
),
), ),
), ),
), // Image.asset(
// Image.asset( // "assets/image/green_leaf.webp",
// "assets/image/green_leaf.webp", // fit: BoxFit.cover,
// fit: BoxFit.cover, // width: 12,
// width: 12, // height: 12,
// height: 12, // ),
// ), // Text(
// Text( // "X300",
// "X300", // style: TextStyle(
// style: TextStyle( // color: Color(0xFF55BC51),
// color: Color(0xFF55BC51), // fontSize: 10.sp,
// fontSize: 10.sp, // fontWeight: MyFontWeight.semi_bold,
// fontWeight: MyFontWeight.semi_bold, // ),
// ), // ),
// ), ],
], ),
),), ),
SizedBox( SizedBox(
height: 2.h, height: 2.h,
), ),
Padding(padding: EdgeInsets.only(right: 16.w), Padding(
padding: EdgeInsets.only(right: 16.w),
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
(widget.productListBean != null (widget.productListBean != null
? widget.productListBean.shortName ? widget.productListBean.shortName
: widget.shoppingCartSkuItemListBean.skuName ?? ""), : widget.shoppingCartSkuItemListBean.skuName ??
overflow: TextOverflow.ellipsis, ""),
maxLines: 2, overflow: TextOverflow.ellipsis,
style: TextStyle( maxLines: 2,
color: Color(0xFF4C4C4C), style: TextStyle(
fontSize: 10.sp, color: Color(0xFF4C4C4C),
fontWeight: MyFontWeight.regular, fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
),
),
), ),
), SizedBox(
), width: 10,
SizedBox( ),
width: 10, ],
), )),
],
)),
SizedBox( SizedBox(
height: 7.h, height: 7.h,
), ),
@ -223,71 +229,90 @@ class _ShopGoods extends State<ShopGoods> {
], ],
), ),
if (!widget.isShopCart && if (!widget.isShopCart &&
(widget.productListBean?.attrStyle ?? 0) == 1) (widget.productListBean?.attrStyle ?? 0) == 1 &&
!(widget?.productListBean?.subscribeParam
?.isEnableSubscribe ??
false))
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () async{ onTap: () async {
if(widget.storeInfo.posType.code == "NORMALSTORE"&& widget.tableId == 0){ if (widget.storeInfo.posType.code ==
"NORMALSTORE" &&
widget.tableId == 0) {
showDeleteDialog(); showDeleteDialog();
}else{ } else {
widget.queryMiNiDetail( widget.queryMiNiDetail(
widget.productListBean != null widget.productListBean != null
? widget.productListBean.id ? widget.productListBean.id
: widget.shoppingCartSkuItemListBean : widget.shoppingCartSkuItemListBean
.productId, .productId,
0); 0);
} }
}, },
child:Container( child: Container(
padding: EdgeInsets.only(right: 16.w), padding: EdgeInsets.only(right: 16.w),
child: Stack( child: Stack(
children: [ children: [
Container( Container(
padding: EdgeInsets.only(left:35.w,top: 4.h,bottom: 4.h,), padding: EdgeInsets.only(
margin: EdgeInsets.only(right: 8, top: 4), left: 35.w,
child: RoundButton( top: 4.h,
text: S.of(context).xuanguige, bottom: 4.h,
textColor: Colors.white, ),
fontWeight: MyFontWeight.medium, margin: EdgeInsets.only(right: 8, top: 4),
radius: 3, child: RoundButton(
backgroup: Color(0xFF32A060), text: S.of(context).xuanguige,
fontSize: 11.sp, textColor: Colors.white,
padding: EdgeInsets.symmetric(vertical: 5.h,horizontal: 3.w), fontWeight: MyFontWeight.medium,
), radius: 3,
), backgroup: Color(0xFF32A060),
Positioned( fontSize: 11.sp,
right: 0, padding: EdgeInsets.symmetric(
child: Visibility( vertical: 5.h, horizontal: 3.w),
visible: widget.count > 0, ),
child: RoundButton( ),
width: 17, Positioned(
height: 17.h, right: 0,
text: "${widget.count}", child: Visibility(
textColor: Color(0xFF32A060), visible: widget.count > 0,
fontWeight: MyFontWeight.regular, child: RoundButton(
backgroup: Colors.white, width: 17,
fontSize: 12.sp, height: 17.h,
radius: 100, text: "${widget.count}",
), textColor: Color(0xFF32A060),
fontWeight: MyFontWeight.regular,
backgroup: Colors.white,
fontSize: 12.sp,
radius: 100,
),
),
),
],
), ),
), )),
],
),)),
if (widget.isShopCart || if (widget.isShopCart ||
(widget.productListBean?.attrStyle ?? 0) == 0) (widget.productListBean?.attrStyle ?? 0) == 0 &&
Spacer(), !(widget?.productListBean?.subscribeParam
?.isEnableSubscribe ??
false))
Spacer(),
if (widget.isShopCart || if (widget.isShopCart ||
(widget.productListBean?.attrStyle ?? 0) == 0) (widget.productListBean?.attrStyle ?? 0) == 0 &&
!(widget?.productListBean?.subscribeParam
?.isEnableSubscribe ??
false))
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () async{ onTap: () async {
if(widget.storeInfo.posType.code == "NORMALSTORE" && widget.tableId == 0){ if (widget.storeInfo.posType.code == "NORMALSTORE" &&
showDeleteDialog(); widget.tableId == 0) {
}else{ showDeleteDialog();
widget.reduce(widget.shoppingCartSkuItemListBean);} } else {
}, widget.reduce(widget.shoppingCartSkuItemListBean);
}
},
child: Container( child: Container(
padding: EdgeInsets.only(left: 15.w,right: 6.w), padding: EdgeInsets.only(left: 15.w, right: 6.w),
child: Image.asset( child: Image.asset(
"assets/image/reduce.webp", "assets/image/reduce.webp",
width: 22, width: 22,
@ -296,7 +321,10 @@ class _ShopGoods extends State<ShopGoods> {
), ),
), ),
if (widget.isShopCart || if (widget.isShopCart ||
(widget.productListBean?.attrStyle ?? 0) == 0) (widget.productListBean?.attrStyle ?? 0) == 0 &&
!(widget?.productListBean?.subscribeParam
?.isEnableSubscribe ??
false))
Container( Container(
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
@ -309,71 +337,117 @@ class _ShopGoods extends State<ShopGoods> {
), ),
), ),
if (widget.isShopCart || if (widget.isShopCart ||
(widget.productListBean?.attrStyle ?? 0) == 0) (widget.productListBean?.attrStyle ?? 0) == 0 &&
GestureDetector( !(widget?.productListBean?.subscribeParam
behavior: HitTestBehavior.opaque, ?.isEnableSubscribe ??
onTap: () async{ false))
if(widget.storeInfo.posType.code == "NORMALSTORE" && widget.tableId == 0){ GestureDetector(
showDeleteDialog(); behavior: HitTestBehavior.opaque,
}else{ onTap: () async {
if(_jumpType == -1) if (widget.storeInfo.posType.code == "NORMALSTORE" &&
queryMiNiDetail(widget.productListBean.id); widget.tableId == 0) {
else if(_jumpType == 0) showDeleteDialog();
widget.add(widget.shoppingCartSkuItemListBean); } else {
else if(_jumpType == 1) if (_jumpType == -1)
await Navigator.of(context) queryMiNiDetail(widget.productListBean.id);
.pushNamed('/router/product_meals_sku', arguments: { else if (_jumpType == 0)
"id":widget.productListBean.id, widget.add(widget.shoppingCartSkuItemListBean);
"storeId":widget.productListBean.storeId, else if (_jumpType == 1)
"tableId":widget.tableId await Navigator.of(context).pushNamed(
}); '/router/product_meals_sku',
widget.queryShoppingCart(); arguments: {
} "id": widget.productListBean.id,
}, "storeId": widget.productListBean.storeId,
child: Container( "tableId": widget.tableId
padding: EdgeInsets.only(left: 6.w,right:16.w), });
child: Image.asset( widget.queryShoppingCart();
"assets/image/add.webp", }
width: 22, },
height: 22.h, child: Container(
padding: EdgeInsets.only(left: 6.w, right: 16.w),
child: Image.asset(
"assets/image/add.webp",
width: 22,
height: 22.h,
),
), ),
), ),
), if ((widget.productListBean.subscribeParam
.isEnableSubscribe ??
false) ==
true)
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () async {
if (widget.storeInfo.posType.code ==
"NORMALSTORE" &&
widget.tableId == 0) {
showDeleteDialog();
} else if (widget.isShopCart ||
(widget.productListBean?.attrStyle ?? 0) == 0) {
queryMiNiDetail(widget.productListBean.id);
} else {
widget.queryMiNiDetail(
widget.productListBean != null
? widget.productListBean.id
: widget.shoppingCartSkuItemListBean
.productId,
0);
}
},
child: Container(
padding: EdgeInsets.only(
left: 35.w,
top: 4.h,
bottom: 4.h,
),
margin: EdgeInsets.only(right: 8, top: 4),
child: RoundButton(
text: "立即预约",
textColor: Colors.white,
fontWeight: MyFontWeight.medium,
radius: 3,
backgroup: Color(0xFF32A060),
fontSize: 11.sp,
padding: EdgeInsets.symmetric(
vertical: 5.h, horizontal: 3.w),
),
)),
], ],
), ),
SizedBox( SizedBox(
height: 4.h, height: 4.h,
), ),
if(widget.productListBean.vipPrice != null ) if (widget.productListBean.vipPrice != null)
Row( Row(
children: [ children: [
Container( Container(
alignment: Alignment.center, alignment: Alignment.center,
padding: EdgeInsets.symmetric(horizontal:2.w), padding: EdgeInsets.symmetric(horizontal: 2.w),
margin: EdgeInsets.only(right: 4.w), margin: EdgeInsets.only(right: 4.w),
decoration: new BoxDecoration( decoration: new BoxDecoration(
color: Color(0xff32A060), color: Color(0xff32A060),
borderRadius: BorderRadius.circular(4)), borderRadius: BorderRadius.circular(4)),
child: Text( child: Text(
"VIP", "VIP",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFFFFFFFF),
),
),
),
Text(
"${AppUtils.calculateDouble(double.tryParse(widget.productListBean.vipPrice ?? "0") ?? 0)}",
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 14.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
color: Color(0xFFFFFFFF), fontFamily: 'JDZhengHT',
color: Color(0xff32A060),
), ),
), ),
), ],
Text( ),
"${AppUtils.calculateDouble(double.tryParse(widget.productListBean.vipPrice ?? "0") ?? 0)}",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
fontFamily: 'JDZhengHT',
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(
@ -477,7 +551,7 @@ class _ShopGoods extends State<ShopGoods> {
S.of(context).ninxiangjiquanxianweikaiqi, S.of(context).ninxiangjiquanxianweikaiqi,
S.of(context).weilekaipaizhaoxuanzhetouxiang, S.of(context).weilekaipaizhaoxuanzhetouxiang,
S.of(context).kaiqiquanxian, S.of(context).kaiqiquanxian,
(result) async { (result) async {
if (result) { if (result) {
await openAppSettings(); await openAppSettings();
} }
@ -512,5 +586,4 @@ class _ShopGoods extends State<ShopGoods> {
await Permission.camera.request(); await Permission.camera.request();
} }
} }
} }

82
lib/store/store_view/store_order_list.dart

@ -29,18 +29,17 @@ class StoreOrderListPage extends StatefulWidget {
ShoppingCart shopCarGoods; ShoppingCart shopCarGoods;
StoreOrderListPage( StoreOrderListPage(
this.arguments, this.arguments,
this.activitys, this.activitys,
this.storeInfo, this.storeInfo,
this.shopCarGoods, this.shopCarGoods,
this.controller, this.controller,
this.minToken, this.minToken,
this.tenant, this.tenant,
this.tableId, this.tableId,
this.queryMiNiDetail, this.queryMiNiDetail,
this.queryShoppingCart, this.queryShoppingCart,
this.scrollPhysics this.scrollPhysics);
);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -88,14 +87,14 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
token: widget.minToken, token: widget.minToken,
tenant: widget.tenant, tenant: widget.tenant,
storeId: widget.arguments["id"], storeId: widget.arguments["id"],
showLoading: true showLoading: true);
);
BaseData<List<FindMiNiGroupList>> baseData = BaseData<List<FindMiNiGroupList>> baseData =
await minService.findMiNiGroupList({ await minService.findMiNiGroupList({
"id": widget.arguments["id"], "id": widget.arguments["id"],
}).catchError((error) { }).catchError((error) {
// refreshController.refreshFailed(); // refreshController.refreshFailed();
debugPrint(error);
}); });
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
// refreshController.refreshCompleted(); // refreshController.refreshCompleted();
@ -139,8 +138,7 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
padding: EdgeInsets.only(top: 0, bottom: 25.h), padding: EdgeInsets.only(top: 0, bottom: 25.h),
itemBuilder: (context, position) { itemBuilder: (context, position) {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {},
},
child: orderItem(position), child: orderItem(position),
); );
}, },
@ -225,9 +223,10 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
width: 2, width: 2,
height: 17.h, height: 17.h,
color: Color(0xFF32A060), color: Color(0xFF32A060),
margin: EdgeInsets.only(right:10.w), margin: EdgeInsets.only(right: 10.w),
), ),
Expanded(child:Text( Expanded(
child: Text(
appletProducts[index].groupName, appletProducts[index].groupName,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
@ -236,7 +235,8 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
: Color(0xFF000000), : Color(0xFF000000),
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: currentIndex != index fontWeight: currentIndex != index
? MyFontWeight.medium : MyFontWeight.semi_bold , ? MyFontWeight.medium
: MyFontWeight.semi_bold,
), ),
)), )),
], ],
@ -267,7 +267,12 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
Widget rightOrderItem(int rightIndex) { Widget rightOrderItem(int rightIndex) {
return Container( return Container(
color: Colors.white, color: Colors.white,
margin: EdgeInsets.only(bottom: (rightIndex == appletProducts.length -1)?(_viewportDimension > appletProducts[rightIndex].height?_viewportDimension-appletProducts[rightIndex].height:30.h):0), margin: EdgeInsets.only(
bottom: (rightIndex == appletProducts.length - 1)
? (_viewportDimension > appletProducts[rightIndex].height
? _viewportDimension - appletProducts[rightIndex].height
: 30.h)
: 0),
padding: EdgeInsets.only( padding: EdgeInsets.only(
right: 16.w, right: 16.w,
), ),
@ -275,30 +280,31 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox(height: 50.h,child: SizedBox(
Padding( height: 50.h,
padding: EdgeInsets.only(left: 16.w,top: 10.h), child: Padding(
child: Text( padding: EdgeInsets.only(left: 16.w, top: 10.h),
appletProducts[rightIndex].groupName, child: Text(
textAlign: TextAlign.center, appletProducts[rightIndex].groupName,
style: TextStyle( textAlign: TextAlign.center,
color: Color(0xFF000000), style: TextStyle(
fontSize: 12.sp, color: Color(0xFF000000),
fontWeight: MyFontWeight.semi_bold, fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold,
),
), ),
), ),
),), ),
Column( Column(
children: appletProducts[rightIndex].productList.map((e) { children: appletProducts[rightIndex].productList.map((e) {
return GestureDetector( return GestureDetector(
onTap: (){ onTap: () {
if (widget.storeInfo.posType.code == if (widget.storeInfo.posType.code == "NORMALSTORE")
"NORMALSTORE")
return; return;
else else
goShopDetailsPage(e); goShopDetailsPage(e);
}, },
child:goodsItem(e), child: goodsItem(e),
); );
}).toList() ?? }).toList() ??
[], [],
@ -346,11 +352,11 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
productListBean: e, productListBean: e,
count: count, count: count,
isShopCart: false, isShopCart: false,
tableId:widget.tableId, tableId: widget.tableId,
queryShoppingCart:widget.queryShoppingCart, queryShoppingCart: widget.queryShoppingCart,
queryMiNiDetail: widget.queryMiNiDetail, queryMiNiDetail: widget.queryMiNiDetail,
shoppingCartSkuItemListBean: shoppingCartSkuItemListBean, shoppingCartSkuItemListBean: shoppingCartSkuItemListBean,
storeInfo:widget.storeInfo storeInfo: widget.storeInfo,
); );
} }
} }

8
lib/view_widget/cupertino_date_picker.dart

@ -5,7 +5,9 @@ import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
class CupertinoDatePickerWidget extends StatelessWidget { class CupertinoDatePickerWidget extends StatelessWidget {
final DateTime minimumDate;
final DateTime maximumDate;
CupertinoDatePickerWidget({this.minimumDate,this.maximumDate});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -72,8 +74,8 @@ class CupertinoDatePickerWidget extends StatelessWidget {
mode: CupertinoDatePickerMode.date, mode: CupertinoDatePickerMode.date,
backgroundColor: Colors.white, backgroundColor: Colors.white,
initialDateTime: DateTime.now(), initialDateTime: DateTime.now(),
minimumDate: DateTime(1900), minimumDate: minimumDate ?? DateTime(1900),
maximumDate: DateTime.now(), maximumDate: maximumDate ?? DateTime.now(),
onDateTimeChanged: (data) { onDateTimeChanged: (data) {
dateTime = data; dateTime = data;
}, },

8
lib/view_widget/recharge_details_dialog.dart

@ -11,9 +11,11 @@ import 'package:huixiang/view_widget/border_text.dart';
import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/round_button.dart'; import 'package:huixiang/view_widget/round_button.dart';
import '../retrofit/data/rechargeActLists.dart';
class RechargeWidget extends StatefulWidget { class RechargeWidget extends StatefulWidget {
final RechargeList rechargeA; final PreferentialList preferentialList;
RechargeWidget(this.rechargeA); RechargeWidget(this.preferentialList);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
return _RechargeWidget(); return _RechargeWidget();
@ -87,7 +89,7 @@ class _RechargeWidget extends State<RechargeWidget> {
child: Container( child: Container(
color: Colors.white, color: Colors.white,
child: Html( child: Html(
data: widget.rechargeA.remark ?? "", data: widget.preferentialList.remark ?? "",
customImageRenders: { customImageRenders: {
networkSourceMatcher(): networkImageRender( networkSourceMatcher(): networkImageRender(
loadingWidget: () { loadingWidget: () {

5
lib/view_widget/selector_store_dialog.dart

@ -244,8 +244,9 @@ class _SelectorStoreWidget extends State<SelectorStoreWidget> {
if (position == selectIndex) if (position == selectIndex)
Image.asset( Image.asset(
"assets/image/recharge.webp", "assets/image/recharge.webp",
width: 20.w, width: 20,
height: 20.h, height: 20,
fit: BoxFit.fill,
), ),
// MImage( // MImage(
// store.logo, // store.logo,

7
pubspec.lock

@ -202,6 +202,13 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "3.2.1" version: "3.2.1"
flutter_datetime_picker:
dependency: "direct main"
description:
name: flutter_datetime_picker
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.5.1"
flutter_easyloading: flutter_easyloading:
dependency: "direct main" dependency: "direct main"
description: description:

3
pubspec.yaml

@ -105,6 +105,9 @@ dependencies:
mqtt_client: ^9.6.8 mqtt_client: ^9.6.8
# 时间选择器
flutter_datetime_picker: ^1.5.1
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter

Loading…
Cancel
Save