Browse Source

首页接口请求报错优化提示更改;

首页ui新增服务套餐试用期,并数据对接调试;
实列新增:服务套餐时间,服务状态;
登录接口实体类新增部分字段;
商家端登录接口更改;
我的页面新增服务套餐购买入口;(数据流程已对接)
我的页面数据接口优化;
新增:服务套餐购买页面,新增商品页面,设置商品规格页面,编辑规格详情页面,设置套餐页面;
门店信息页面数据优化;
选择门店页数据优化;
新增分类查询接口实体类;
新增服务信息接口实体类;
新增服务套餐详情接口实体类;
新增服务套餐列表接口实体类;
wr_2023_new_business
wurong 1 year ago
parent
commit
0656f12c8e
  1. 17
      lib/business_system/home/business_home_page.dart
  2. 36
      lib/business_system/home/select_shop.dart
  3. 11
      lib/business_system/login/business_login_page.dart
  4. 315
      lib/business_system/mine/business_mine_page.dart
  5. 2
      lib/business_system/mine/merchant_info.dart
  6. 1185
      lib/business_system/mine/service_subscription/service_subscription_page.dart
  7. 1
      lib/home/welfare_page.dart
  8. 2
      lib/login/new_login_page.dart
  9. 15
      lib/main.dart
  10. 2
      lib/mine/mine_view/mine_item.dart
  11. 78
      lib/retrofit/business_api.dart
  12. 133
      lib/retrofit/business_api.g.dart
  13. 64
      lib/retrofit/data/business_login_info.dart
  14. 123
      lib/retrofit/data/goods_category_list.dart
  15. 366
      lib/retrofit/data/tenant_info.dart
  16. 51
      lib/retrofit/data/tenant_package_calculate_details.dart
  17. 245
      lib/retrofit/data/tenant_package_list.dart
  18. 16
      lib/utils/business_instance.dart

17
lib/business_system/home/business_home_page.dart

@ -18,6 +18,7 @@ import '../../retrofit/data/business_login_info.dart';
import '../../retrofit/data/day_count.dart';
import '../../utils/flutter_utils.dart';
import '../../utils/font_weight.dart';
import '../../view_widget/settlement_tips_dialog.dart';
class BusinessHomePage extends StatefulWidget {
final BusinessLoginInfo businessLoginInfo;
@ -90,8 +91,13 @@ class _BusinessHomePage extends State<BusinessHomePage> {
BaseData<DayCount> baseData = await businessService.getDayCounts({
"summaryDate": "${DateFormat("yyyy-MM-dd").format(DateTime.now())}"
}).catchError((error) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
alignment: Alignment.center);
SmartDialog.show(
clickBgDismissTemp: false,
widget: SettlementTips(
() {},
text: AppUtils.dioErrorTypeToString(error.type),
color: Color(0xFF30415B),
));
refreshController.refreshFailed();
refreshController.loadFailed();
});
@ -138,6 +144,7 @@ class _BusinessHomePage extends State<BusinessHomePage> {
),
),
),
if(BusinessInstance.instance.serviceStatus == "试用")
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
@ -149,6 +156,10 @@ class _BusinessHomePage extends State<BusinessHomePage> {
? "0"
: widget
.businessLoginInfo.storeList[widget.selectStoreIndex].id
}).then((value){
if(value == 1){
setState((){});
}
});
},
child: Container(
@ -171,7 +182,7 @@ class _BusinessHomePage extends State<BusinessHomePage> {
),
),
TextSpan(
text: "2024-01-02",
text: "${(widget?.businessLoginInfo?.expirationTime ?? "").length > 9 ? (widget?.businessLoginInfo?.expirationTime ?? "").substring(0, 10) : ""}",
style: TextStyle(
color: Color(0xFFFF8F1F),
fontSize: 14.sp,

36
lib/business_system/home/select_shop.dart

@ -38,43 +38,7 @@ class _SelectShop extends State<SelectShop> {
void initState() {
super.initState();
businessLoginInfo = widget.arguments["businessLoginInfo"];
if(widget.arguments["routeSource"] == "单门店")
records = widget.arguments["records"];
if(widget.arguments["routeSource"] == "门店设置")
queryStoreList();
}
///
queryStoreList() async {
try{
EasyLoading.show(
status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
if (businessService == null) {
businessService = BusinessApiService(Dio(),
context: context,
token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant,
storeId: "0");
}
BaseData<BusinessStoreList> baseData = await businessService
.getStoreList(BusinessInstance.instance.businessTenant, "1", "100")
.catchError((error) {
refreshController.refreshFailed();
refreshController.loadFailed();
});
if (!mounted) return;
if (baseData != null && baseData.isSuccess) {
records.clear();
records.addAll((baseData?.data?.records ?? []).reversed);
refreshController.refreshCompleted();
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}finally{
EasyLoading.dismiss();
setState((){});
}
}
@override

11
lib/business_system/login/business_login_page.dart

@ -17,6 +17,7 @@ import '../../retrofit/data/business_login_info.dart';
import '../../utils/font_weight.dart';
import '../../view_widget/border_text.dart';
import '../../view_widget/round_button.dart';
import '../../view_widget/settlement_tips_dialog.dart';
class BusinessLoginPage extends StatefulWidget {
final Map<String, dynamic> arguments;
@ -98,6 +99,8 @@ class _BusinessLoginPage extends State<BusinessLoginPage> {
}
BusinessInstance.instance.businessTenant = businessLoginInfo.tenantCode;
BusinessInstance.instance.businessToken = businessLoginInfo.token;
BusinessInstance.instance.expirationTime = businessLoginInfo.expirationTime;
BusinessInstance.instance.serviceStatus = businessLoginInfo.status.desc;
sharedPreferences.setString('account', _userPhoneController.text);
sharedPreferences.setString('password', _passwordController.text);
sharedPreferences.setString('identitySwitch', "1");
@ -113,7 +116,13 @@ class _BusinessLoginPage extends State<BusinessLoginPage> {
}
} else {
if (baseData.msg != null)
SmartDialog.showToast(baseData?.msg, alignment: Alignment.center);
SmartDialog.show(
clickBgDismissTemp: false,
widget: SettlementTips(
() {},
text: baseData.msg,
color: Color(0xFF30415B),
));
}
EasyLoading.dismiss();
}

315
lib/business_system/mine/business_mine_page.dart

@ -7,19 +7,21 @@ import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:visibility_detector/visibility_detector.dart';
import '../../retrofit/business_api.dart';
import '../../retrofit/data/base_data.dart';
import '../../retrofit/data/business_login_info.dart';
import '../../retrofit/data/business_store_list.dart';
import '../../utils/business_instance.dart';
import '../../utils/flutter_utils.dart';
import '../../utils/font_weight.dart';
import '../../view_widget/settlement_tips_dialog.dart';
class BusinessMinePage extends StatefulWidget {
final BusinessLoginInfo businessLoginInfo;
final String storeId;
BusinessMinePage(Key key, this.businessLoginInfo, this.storeId)
: super(key: key);
BusinessMinePage(Key key,this.businessLoginInfo, this.storeId): super(key: key);
@override
State<StatefulWidget> createState() {
@ -27,18 +29,16 @@ class BusinessMinePage extends StatefulWidget {
}
}
class _BusinessMinePage extends State<BusinessMinePage> {
class _BusinessMinePage extends State<BusinessMinePage>{
final RefreshController refreshController = RefreshController();
BusinessApiService businessService;
List<Records> records = [];
double visiblePercentage;
int networkStatus = 0;
@override
void initState() {
super.initState();
if (widget.businessLoginInfo.storeList.length == 1) {
queryStoreList();
}
}
@override
@ -59,14 +59,22 @@ class _BusinessMinePage extends State<BusinessMinePage> {
BaseData<BusinessStoreList> baseData = await businessService
.getStoreList(BusinessInstance.instance.businessTenant, "1", "100")
.catchError((error) {
SmartDialog.show(
clickBgDismissTemp: false,
widget: SettlementTips(
() {},
text: AppUtils.dioErrorTypeToString(error.type),
color: Color(0xFF30415B),
));
networkStatus = -1;
refreshController.refreshFailed();
refreshController.loadFailed();
});
if (!mounted) return;
if (baseData != null && baseData.isSuccess) {
records.clear();
records.addAll((baseData.data.records ?? []).reversed);
refreshController.refreshCompleted();
networkStatus = 1;
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
@ -74,161 +82,171 @@ class _BusinessMinePage extends State<BusinessMinePage> {
@override
Widget build(BuildContext context) {
return Column(
children: [
Expanded(
child: Container(
child: SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: false,
header: MyHeader(color: Color(0xFF30415B)),
physics: BouncingScrollPhysics(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onRefresh: () {
if (widget.businessLoginInfo != null) {
queryStoreList();
} else
refreshController.refreshFailed();
},
child: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(),
child: Container(
child: Column(
children: [
mineInfo(),
commonFunctions(),
otherFunctions(),
SizedBox(
height: 54.h,
),
Text(
"@回乡信息公司",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF30415B),
fontWeight: MyFontWeight.medium),
return VisibilityDetector(
key: Key('my-widget-key'),
onVisibilityChanged: (visibilityInfo) {
visiblePercentage = visibilityInfo.visibleFraction;
if (visiblePercentage == 1) queryStoreList();
},
child: Column(
children: [
Expanded(
child: Container(
child: SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: false,
header: MyHeader(color: Color(0xFF30415B)),
physics: BouncingScrollPhysics(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onRefresh: () {
if (widget.businessLoginInfo != null) {
queryStoreList();
} else
refreshController.refreshFailed();
},
child: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(),
child: Container(
child: Column(
children: [
mineInfo(),
commonFunctions(),
otherFunctions(),
SizedBox(
height: 54.h,
),
Text(
"@回乡信息公司",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF30415B),
fontWeight: MyFontWeight.medium),
),
],
),
],
),
)),
)),
),
),
),
),
),
SizedBox(
height: 76.h,
),
],
);
SizedBox(
height: 76.h,
),
],
));
}
Widget mineInfo() {
return Container(
child: Stack(
alignment: Alignment.bottomCenter,
alignment:Alignment.bottomCenter,
children: [
Stack(
children: [
Container(
width: double.infinity,
height: 238.h,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(
"assets/image/bs_mine_bg.webp",
),
fit: BoxFit.cover,
children: [
Container(
width: double.infinity,
height: 238.h,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(
"assets/image/bs_mine_bg.webp",
),
fit: BoxFit.cover,
),
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context)
.pushNamed('/router/account_information', arguments: {
"businessLoginInfo": widget.businessLoginInfo,
});
},
child: Container(
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 50, left: 16.w),
child: Row(
children: [
(widget?.businessLoginInfo?.avatar != "")
? MImage(
widget?.businessLoginInfo?.avatar ?? "",
fit: BoxFit.cover,
width: 69.h,
height: 69.h,
radius: BorderRadius.circular(100),
errorSrc: "assets/image/default_2_1.webp",
fadeSrc: "assets/image/default_2_1.webp",
)
: Image.asset(
"assets/image/bs_mine_heading.webp",
width: 69,
height: 69,
fit: BoxFit.fill,
),
SizedBox(
width: 10.w,
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context)
.pushNamed('/router/account_information', arguments: {
"businessLoginInfo": widget.businessLoginInfo,
});
},
child: Container(
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 50, left: 16.w),
child: Row(
children: [
(widget?.businessLoginInfo?.avatar != "")
? MImage(
widget?.businessLoginInfo?.avatar ?? "",
fit: BoxFit.cover,
width: 69.h,
height: 69.h,
radius: BorderRadius.circular(100),
errorSrc: "assets/image/default_2_1.webp",
fadeSrc: "assets/image/default_2_1.webp",
)
: Image.asset(
"assets/image/bs_mine_heading.webp",
width: 69,
height: 69,
fit: BoxFit.fill,
),
SizedBox(
width: 10.w,
),
Container(
height: 69.h,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Text(
widget?.businessLoginInfo?.name ?? "",
style: TextStyle(
fontSize: 18.sp,
color: Color(0xFF374C6C),
fontWeight: MyFontWeight.semi_bold),
),
Text(
'ID:${widget?.businessLoginInfo?.account ?? ""}',
style: TextStyle(
fontSize: 16.sp,
color: Color(0xFF374C6C),
fontWeight: MyFontWeight.regular),
),
],
),
Container(
height: 69.h,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Text(
widget?.businessLoginInfo?.name ?? "",
style: TextStyle(
fontSize: 18.sp,
color: Color(0xFF374C6C),
fontWeight: MyFontWeight.semi_bold),
),
Text(
'ID:${widget?.businessLoginInfo?.account ?? ""}',
style: TextStyle(
fontSize: 16.sp,
color: Color(0xFF374C6C),
fontWeight: MyFontWeight.regular),
),
],
),
)
],
),
)
],
),
),
],
),
),
],
),
if(BusinessInstance.instance.serviceStatus == "正常")
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context)
.pushNamed('/router/service_subscription_page', arguments: {
"storeId": widget.storeId ?? "",
onTap: (){
Navigator.of(context).pushNamed(
'/router/service_subscription_page',
arguments: {
"storeId":widget.storeId ?? "",
}).then((value){
if(value == 1){
setState((){});
}
});
},
child: Container(
padding: EdgeInsets.only(bottom: 12.h, left: 16.w),
padding: EdgeInsets.only(bottom:12.h,left: 16.w),
child: Row(
children: [
Padding(
padding: EdgeInsets.only(right: 14.w),
Padding(padding:EdgeInsets.only(right: 14.w),
child: Text(
"服务有效期:2029-12-23",
"服务有效期:${(BusinessInstance.instance.expirationTime ?? "").length > 9 ? (BusinessInstance.instance.expirationTime ?? "").substring(0, 10) : ""}",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF353535),
fontWeight: MyFontWeight.regular),
)),
Padding(
padding: EdgeInsets.only(right: 4.w),
Padding(padding:EdgeInsets.only(right:4.w),
child: Text(
"去续费",
style: TextStyle(
@ -280,26 +298,24 @@ class _BusinessMinePage extends State<BusinessMinePage> {
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
if (networkStatus == -1) {
if(networkStatus == -1){
queryStoreList();
return;
} else if (widget.businessLoginInfo.storeList.length > 1) {
Navigator.of(context)
.pushNamed('/router/select_shop', arguments: {
"routeSource": "门店设置",
});
}
else if (widget.businessLoginInfo.storeList.length > 1) {
Navigator.of(context).pushNamed('/router/select_shop',
arguments: {"routeSource": "门店设置", "records": records});
} else {
Navigator.of(context)
.pushNamed('/router/merchant_info', arguments: {
"storeId": widget.storeId,
"storeName": records[0].storeName,
"records": records[0],
"routeSource": "单门店"
});
}
},
child: commonFunctionsItem(
"assets/image/bs_shop_logo.webp", "门店设置", "", 20, 20),
"assets/image/bs_shop_logo.webp", "门店设置", "",20,20),
),
Container(
width: double.infinity,
@ -315,7 +331,7 @@ class _BusinessMinePage extends State<BusinessMinePage> {
SmartDialog.showToast("该功能暂未开放!", alignment: Alignment.center);
},
child: commonFunctionsItem(
"assets/image/bs_mine_code.webp", "门店预约二维码", "", 18, 18),
"assets/image/bs_mine_code.webp", "门店预约二维码", "",18,18),
),
Container(
width: double.infinity,
@ -333,7 +349,7 @@ class _BusinessMinePage extends State<BusinessMinePage> {
});
},
child: commonFunctionsItem(
"assets/image/bs_secure.webp", "安全设置", "登录手机号/密码", 18, 22)),
"assets/image/bs_secure.webp", "安全设置", "登录手机号/密码",18,22)),
Container(
width: double.infinity,
height: 1.h,
@ -349,15 +365,14 @@ class _BusinessMinePage extends State<BusinessMinePage> {
});
},
child: commonFunctionsItem(
"assets/image/bs_mine_clerk.webp", "店员管理", "", 18, 20),
"assets/image/bs_mine_clerk.webp", "店员管理", "",18,20),
),
],
),
);
}
Widget commonFunctionsItem(
icon, leftText, rightText, double width, double height) {
Widget commonFunctionsItem(icon, leftText, rightText,double width,double height) {
return Container(
margin: EdgeInsets.only(bottom: 14.h),
child: Row(
@ -370,7 +385,7 @@ class _BusinessMinePage extends State<BusinessMinePage> {
fit: BoxFit.fill,
),
SizedBox(
width: 11.w,
width:11.w,
),
Expanded(
child: Text(
@ -431,8 +446,8 @@ class _BusinessMinePage extends State<BusinessMinePage> {
onTap: () {
Navigator.of(context).pushNamed('/router/user_service_page');
},
child: commonFunctionsItem(
"assets/image/bs_user.webp", "关于我们", "", 24, 24))
child:
commonFunctionsItem("assets/image/bs_user.webp", "关于我们", "",24,24))
],
),
);

2
lib/business_system/mine/merchant_info.dart

@ -134,7 +134,7 @@ class _MerchantInfo extends State<MerchantInfo> {
showShopType();
},
child: textItems(
"店铺类型", serviceType == null ? shopType() : serviceType),
"店铺类型", serviceType == null ? shopType()??"" : serviceType??""),
),
Container(
width: double.infinity,

1185
lib/business_system/mine/service_subscription/service_subscription_page.dart

File diff suppressed because it is too large Load Diff

1
lib/home/welfare_page.dart

@ -19,7 +19,6 @@ import 'package:huixiang/view_widget/custom_image.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:huixiang/view_widget/new_coupon_widget.dart';
import 'package:huixiang/view_widget/no_data_view.dart';
import 'package:huixiang/view_widget/receive_success.dart';
import 'package:huixiang/view_widget/selector_store_dialog.dart';

2
lib/login/new_login_page.dart

@ -311,6 +311,8 @@ class _NewLoginPage extends State<NewLoginPage> {
}
BusinessInstance.instance.businessTenant = businessLoginInfo.tenantCode;
BusinessInstance.instance.businessToken = businessLoginInfo.token;
BusinessInstance.instance.expirationTime = businessLoginInfo.expirationTime;
BusinessInstance.instance.serviceStatus = businessLoginInfo.status.desc;
if (businessLoginInfo.storeList.length > 1) {
Navigator.of(context)
.popAndPushNamed('/router/select_shop', arguments: {

15
lib/main.dart

@ -90,6 +90,10 @@ import 'business_system/date_select/custom_page.dart';
import 'business_system/date_select/day_report_page.dart';
import 'business_system/date_select/monthly_report_page.dart';
import 'business_system/date_select/week_report_page.dart';
import 'business_system/goods/add_goods/add_goods_page.dart';
import 'business_system/goods/add_goods/edit_specs_detail.dart';
import 'business_system/goods/add_goods/set_goods_specs.dart';
import 'business_system/goods/add_goods/set_meal.dart';
import 'business_system/goods/goods_search_page.dart';
import 'business_system/goods/on_sale/add_assort.dart';
import 'business_system/goods/on_sale/batch_shelf.dart';
@ -114,6 +118,7 @@ import 'business_system/mine/clerk_manage/add_new_clerk_page.dart';
import 'business_system/mine/clerk_manage/clerk_manage_page.dart';
import 'business_system/mine/merchant_info.dart';
import 'business_system/mine/security_setting.dart';
import 'business_system/mine/service_subscription/service_subscription_page.dart';
import 'business_system/mine/shop_image_info.dart';
import 'business_system/mine/shop_reservation_code.dart';
import 'business_system/order/business_order_detail.dart';
@ -551,4 +556,14 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
MemberDetailsPage(arguments:arguments),
'/router/record_details': (context, {arguments}) =>
RecordDetails(arguments:arguments),
'/router/service_subscription_page': (context, {arguments}) =>
ServiceSubscriptionPage(arguments:arguments),
'/router/add_goods_page': (context, {arguments}) =>
AddGoodsPage(arguments:arguments),
'/router/set_goods_specs': (context, {arguments}) =>
SetGoodsSpecs(arguments:arguments),
'/router/edit_specs_detail': (context, {arguments}) =>
EditSpecsDetail(arguments:arguments),
'/router/set_meal': (context, {arguments}) =>
SetMeal(arguments:arguments),
};

2
lib/mine/mine_view/mine_item.dart

@ -49,6 +49,8 @@ class _MineItem extends State<MineItem> {
}
BusinessInstance.instance.businessTenant = businessLoginInfo.tenantCode;
BusinessInstance.instance.businessToken = businessLoginInfo.token;
BusinessInstance.instance.expirationTime = businessLoginInfo.expirationTime;
BusinessInstance.instance.serviceStatus = businessLoginInfo.status.desc;
sharedPreferences.setString('identitySwitch', "1");
if (businessLoginInfo.storeList.length > 1) {
Navigator.of(context)

78
lib/retrofit/business_api.dart

@ -24,6 +24,7 @@ import 'data/business_store_list.dart';
import 'data/business_vip_list.dart';
import 'data/clerk_manage_list.dart';
import 'data/day_flow_list.dart';
import 'data/goods_category_list.dart';
import 'data/goods_type_sales_list.dart';
import 'data/order_user_detail.dart';
import 'data/phone_query_member_info.dart';
@ -34,6 +35,9 @@ import 'data/refund_reason_list.dart';
import 'data/single_sales_list.dart';
import 'data/store_time_info_list.dart';
import 'data/store_total_money_info.dart';
import 'data/tenant_info.dart';
import 'data/tenant_package_calculate_details.dart';
import 'data/tenant_package_list.dart';
import 'data/ticket_details.dart';
import 'data/ticket_record.dart';
import 'data/ticket_show.dart';
@ -66,9 +70,13 @@ abstract class BusinessApiService {
String tenant,
String storeId,
bool showErrorToast = true,
bool pay = false,
}) {
Map<String, dynamic> headers =
(token == null || token == "") ? {} : {'token': "Bearer $token"};
if (pay == true) {
headers["Environment"] = "app";
}
if (tenant != null && tenant != "") {
headers["tenant"] = tenant;
}
@ -280,7 +288,8 @@ abstract class BusinessApiService {
///
@POST("ticket/wipedRecord")
Future<BaseData<TicketRecord>> wipedRecord(@Body() Map<String, dynamic> param);
Future<BaseData<TicketRecord>> wipedRecord(
@Body() Map<String, dynamic> param);
///
@POST("ticket/wipedStats")
@ -289,19 +298,23 @@ abstract class BusinessApiService {
///
@POST("member/page")
Future<BaseData<BusinessVipList>> vipDataList(@Body() Map<String, dynamic> param);
Future<BaseData<BusinessVipList>> vipDataList(
@Body() Map<String, dynamic> param);
///
@POST("audit/memberSourceRechargeDetial")
Future<BaseData<RechargeFlowList>> rechargeFlow(@Body() Map<String, dynamic> param);
Future<BaseData<RechargeFlowList>> rechargeFlow(
@Body() Map<String, dynamic> param);
///
@POST("member/getTenantMemberBill")
Future<BaseData<BalanceChangeList>> getTenantMemberBill(@Body() Map<String, dynamic> param);
Future<BaseData<BalanceChangeList>> getTenantMemberBill(
@Body() Map<String, dynamic> param);
////
@GET("store/storeOpenTime/{storeId}")
Future<BaseData<StoreTimeInfoList>> storeOpenTime(@Path("storeId") String storeId);
Future<BaseData<StoreTimeInfoList>> storeOpenTime(
@Path("storeId") String storeId);
///
@POST("product/updateSubscribe")
@ -313,15 +326,18 @@ abstract class BusinessApiService {
///
@GET("order/getOrderUserDetail?orderId={orderId}")
Future<BaseData<OrderUserDetail>> getOrderUserDetail(@Path("orderId") String storeId);
Future<BaseData<OrderUserDetail>> getOrderUserDetail(
@Path("orderId") String storeId);
///
@POST("member/queryMemberInfo")
Future<BaseData<PhoneQueryMemberInfo>> queryMemberInfo(@Body() Map<String, dynamic> param);
Future<BaseData<PhoneQueryMemberInfo>> queryMemberInfo(
@Body() Map<String, dynamic> param);
///
@POST("rechargePreferential/get")
Future<BaseData<BusRechargeList>> getRechargePreferential(@Body() Map<String, dynamic> param);
Future<BaseData<BusRechargeList>> getRechargePreferential(
@Body() Map<String, dynamic> param);
///
@POST("member/posMemberRecharge")
@ -333,11 +349,13 @@ abstract class BusinessApiService {
///
@GET("member/createMemberSourceByMobile?mobile={mobile}&nickName={nickName}")
Future<BaseData<AddVipInfo>> createMemberSourceByMobile(@Path("mobile") String mobile,@Path("nickName") String nickName);
Future<BaseData<AddVipInfo>> createMemberSourceByMobile(
@Path("mobile") String mobile, @Path("nickName") String nickName);
///
@POST("user/userPage")
Future<BaseData<ClerkManageList>> clerkList(@Body() Map<String, dynamic> param);
Future<BaseData<ClerkManageList>> clerkList(
@Body() Map<String, dynamic> param);
///
@POST("user")
@ -353,11 +371,13 @@ abstract class BusinessApiService {
////
@POST("dashBoard/storeMoney")
Future<BaseData<BalanceConsumptionRankingList>> storeMoney(@Body() Map<String, dynamic> param);
Future<BaseData<BalanceConsumptionRankingList>> storeMoney(
@Body() Map<String, dynamic> param);
////
@POST("dashBoard/storeTotalMoney")
Future<BaseData<StoreTotalMoneyInfo>> storeTotalMoney(@Body() Map<String, dynamic> param);
Future<BaseData<StoreTotalMoneyInfo>> storeTotalMoney(
@Body() Map<String, dynamic> param);
///
@POST("order/createOrder")
@ -368,11 +388,39 @@ abstract class BusinessApiService {
Future<BaseData> prePayOrder(@Body() Map<String, dynamic> param);
///
@POST("order/queryOrder/{orderId}?login={login}")
Future<BaseData> queryCashierOrder(@Path("orderId") String orderId,@Path("login") bool login);
@GET("order/queryOrder/{orderId}?login={login}")
Future<BaseData> queryCashierOrder(
@Path("orderId") String orderId, @Path("login") bool login);
///-/
@POST("member/getMemberSourceBillDetials")
Future<BaseData<VipRecordDetailsList>> getMemberSourceBillDetails(@Body() Map<String, dynamic> param);
Future<BaseData<VipRecordDetailsList>> getMemberSourceBillDetails(
@Body() Map<String, dynamic> param);
///
@POST("product/save")
Future<BaseData> productSave(@Body() Map<String, dynamic> param);
///
@GET("productCategory/findCategoryListByDepth/1")
Future<BaseData<List<GoodsCategoryList>>> findCategoryListByDepth();
///
@GET("tenantApply/tenantPackageList")
Future<BaseData<List<TenantPackageList>>> tenantPackage();
///
@POST("tenantApply/tenantPackageCalculate")
Future<BaseData<TenantPackageCalculateDetails>> tenantPackageCalculate(
@Body() Map<String, dynamic> param);
///
@POST("tenantApply/tenantApplyPay")
Future<BaseData> tenantApplyPay(
@Body() Map<String, dynamic> param);
///
@GET("tenant/tenantInfo/{tenantId}")
Future<BaseData<TenantInfo>> tenantInfo(
@Path("tenantId") String tenantId);
}

133
lib/retrofit/business_api.g.dart

@ -1186,4 +1186,137 @@ class _BusinessApiService implements BusinessApiService {
return value;
}
@override
Future<BaseData> productSave(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'product/save',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: param);
final value = BaseData.fromJson(
_result.data,
(json) => (json ?? "") == "" ? null : json,
);
return value;
}
@override
Future<BaseData<List<GoodsCategoryList>>> findCategoryListByDepth() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'productCategory/findCategoryListByDepth/1',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<List<GoodsCategoryList>>.fromJson(
_result.data,
(json) => (json as List<dynamic>)
.map<GoodsCategoryList>(
(i) => GoodsCategoryList.fromJson(i as Map<String, dynamic>))
.toList());
return value;
}
@override
Future<BaseData<List<TenantPackageList>>> tenantPackage() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'tenantApply/tenantPackageList',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<List<TenantPackageList>>.fromJson(
_result.data,
(json) => (json as List<dynamic>)
.map<TenantPackageList>(
(i) => TenantPackageList.fromJson(i as Map<String, dynamic>))
.toList());
return value;
}
@override
Future<BaseData<TenantPackageCalculateDetails>> tenantPackageCalculate(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'tenantApply/tenantPackageCalculate',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<TenantPackageCalculateDetails>.fromJson(
_result.data,
(json) => (json ?? "") == "" ? null : TenantPackageCalculateDetails.fromJson(json),
);
return value;
}
@override
Future<BaseData> tenantApplyPay(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'tenantApply/tenantApplyPay',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: param);
final value = BaseData.fromJson(
_result.data,
(json) => (json ?? "") == "" ? null : json,
);
return value;
}
@override
Future<BaseData<TenantInfo>> tenantInfo(tenantId) async {
ArgumentError.checkNotNull(tenantId, 'tenantId');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'tenant/tenantInfo/$tenantId',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<TenantInfo>.fromJson(
_result.data,
(json) => (json ?? "") == "" ? null : TenantInfo.fromJson(json),
);
return value;
}
}

64
lib/retrofit/data/business_login_info.dart

File diff suppressed because one or more lines are too long

123
lib/retrofit/data/goods_category_list.dart

@ -0,0 +1,123 @@
/// id : "1300687829071822848"
/// categoryName : "火锅餐饮"
/// categoryPath : ""
/// categoryImg : null
/// depth : 1
/// parentName : null
/// parentId : null
/// sortOrder : 1
/// status : 1
/// isDelete : 0
/// childs : null
/// posType : null
class GoodsCategoryList {
GoodsCategoryList({
String id,
String categoryName,
String categoryPath,
dynamic categoryImg,
num depth,
dynamic parentName,
dynamic parentId,
num sortOrder,
num status,
num isDelete,
dynamic childs,
dynamic posType,}){
_id = id;
_categoryName = categoryName;
_categoryPath = categoryPath;
_categoryImg = categoryImg;
_depth = depth;
_parentName = parentName;
_parentId = parentId;
_sortOrder = sortOrder;
_status = status;
_isDelete = isDelete;
_childs = childs;
_posType = posType;
}
GoodsCategoryList.fromJson(dynamic json) {
_id = json['id'];
_categoryName = json['categoryName'];
_categoryPath = json['categoryPath'];
_categoryImg = json['categoryImg'];
_depth = json['depth'];
_parentName = json['parentName'];
_parentId = json['parentId'];
_sortOrder = json['sortOrder'];
_status = json['status'];
_isDelete = json['isDelete'];
_childs = json['childs'];
_posType = json['posType'];
}
String _id;
String _categoryName;
String _categoryPath;
dynamic _categoryImg;
num _depth;
dynamic _parentName;
dynamic _parentId;
num _sortOrder;
num _status;
num _isDelete;
dynamic _childs;
dynamic _posType;
GoodsCategoryList copyWith({ String id,
String categoryName,
String categoryPath,
dynamic categoryImg,
num depth,
dynamic parentName,
dynamic parentId,
num sortOrder,
num status,
num isDelete,
dynamic childs,
dynamic posType,
}) => GoodsCategoryList( id: id ?? _id,
categoryName: categoryName ?? _categoryName,
categoryPath: categoryPath ?? _categoryPath,
categoryImg: categoryImg ?? _categoryImg,
depth: depth ?? _depth,
parentName: parentName ?? _parentName,
parentId: parentId ?? _parentId,
sortOrder: sortOrder ?? _sortOrder,
status: status ?? _status,
isDelete: isDelete ?? _isDelete,
childs: childs ?? _childs,
posType: posType ?? _posType,
);
String get id => _id;
String get categoryName => _categoryName;
String get categoryPath => _categoryPath;
dynamic get categoryImg => _categoryImg;
num get depth => _depth;
dynamic get parentName => _parentName;
dynamic get parentId => _parentId;
num get sortOrder => _sortOrder;
num get status => _status;
num get isDelete => _isDelete;
dynamic get childs => _childs;
dynamic get posType => _posType;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = _id;
map['categoryName'] = _categoryName;
map['categoryPath'] = _categoryPath;
map['categoryImg'] = _categoryImg;
map['depth'] = _depth;
map['parentName'] = _parentName;
map['parentId'] = _parentId;
map['sortOrder'] = _sortOrder;
map['status'] = _status;
map['isDelete'] = _isDelete;
map['childs'] = _childs;
map['posType'] = _posType;
return map;
}
}

366
lib/retrofit/data/tenant_info.dart

@ -0,0 +1,366 @@
/// id : "1739884282001752064"
/// createTime : "2023-12-27 13:41:53"
/// createUser : "1"
/// updateTime : "2023-12-27 13:41:53"
/// updateUser : "1"
/// code : "1197"
/// name : "fff"
/// type : {"desc":"创建","code":"CREATE"}
/// status : {"desc":"正常","code":"NORMAL"}
/// readonly : false
/// usePlatformPay : false
/// usePlatformVip : false
/// money : "0"
/// duty : "fxz"
/// address : "洪山区光谷一路天成美景"
/// expireLimitYear : 3
/// startTime : "2023-12-27 13:41:53"
/// expirationTime : null
/// contactTel : "15827991715"
/// logo : ""
/// describe : ""
/// account : null
/// dianwodaId : ""
/// dadaId : ""
/// showVipCard : true
/// packageId : "1552543966157602816"
/// posType : {"desc":"普通餐饮","code":"NORMALSTORE"}
class TenantInfo {
TenantInfo({
String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
String code,
String name,
Type type,
Status status,
bool readonly,
bool usePlatformPay,
bool usePlatformVip,
String money,
String duty,
String address,
num expireLimitYear,
String startTime,
dynamic expirationTime,
String contactTel,
String logo,
String describe,
dynamic account,
String dianwodaId,
String dadaId,
bool showVipCard,
String packageId,
PosType posType,}){
_id = id;
_createTime = createTime;
_createUser = createUser;
_updateTime = updateTime;
_updateUser = updateUser;
_code = code;
_name = name;
_type = type;
_status = status;
_readonly = readonly;
_usePlatformPay = usePlatformPay;
_usePlatformVip = usePlatformVip;
_money = money;
_duty = duty;
_address = address;
_expireLimitYear = expireLimitYear;
_startTime = startTime;
_expirationTime = expirationTime;
_contactTel = contactTel;
_logo = logo;
_describe = describe;
_account = account;
_dianwodaId = dianwodaId;
_dadaId = dadaId;
_showVipCard = showVipCard;
_packageId = packageId;
_posType = posType;
}
TenantInfo.fromJson(dynamic json) {
_id = json['id'];
_createTime = json['createTime'];
_createUser = json['createUser'];
_updateTime = json['updateTime'];
_updateUser = json['updateUser'];
_code = json['code'];
_name = json['name'];
_type = json['type'] != null ? Type.fromJson(json['type']) : null;
_status = json['status'] != null ? Status.fromJson(json['status']) : null;
_readonly = json['readonly'];
_usePlatformPay = json['usePlatformPay'];
_usePlatformVip = json['usePlatformVip'];
_money = json['money'];
_duty = json['duty'];
_address = json['address'];
_expireLimitYear = json['expireLimitYear'];
_startTime = json['startTime'];
_expirationTime = json['expirationTime'];
_contactTel = json['contactTel'];
_logo = json['logo'];
_describe = json['describe'];
_account = json['account'];
_dianwodaId = json['dianwodaId'];
_dadaId = json['dadaId'];
_showVipCard = json['showVipCard'];
_packageId = json['packageId'];
_posType = json['posType'] != null ? PosType.fromJson(json['posType']) : null;
}
String _id;
String _createTime;
String _createUser;
String _updateTime;
String _updateUser;
String _code;
String _name;
Type _type;
Status _status;
bool _readonly;
bool _usePlatformPay;
bool _usePlatformVip;
String _money;
String _duty;
String _address;
num _expireLimitYear;
String _startTime;
dynamic _expirationTime;
String _contactTel;
String _logo;
String _describe;
dynamic _account;
String _dianwodaId;
String _dadaId;
bool _showVipCard;
String _packageId;
PosType _posType;
TenantInfo copyWith({ String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
String code,
String name,
Type type,
Status status,
bool readonly,
bool usePlatformPay,
bool usePlatformVip,
String money,
String duty,
String address,
num expireLimitYear,
String startTime,
dynamic expirationTime,
String contactTel,
String logo,
String describe,
dynamic account,
String dianwodaId,
String dadaId,
bool showVipCard,
String packageId,
PosType posType,
}) => TenantInfo( id: id ?? _id,
createTime: createTime ?? _createTime,
createUser: createUser ?? _createUser,
updateTime: updateTime ?? _updateTime,
updateUser: updateUser ?? _updateUser,
code: code ?? _code,
name: name ?? _name,
type: type ?? _type,
status: status ?? _status,
readonly: readonly ?? _readonly,
usePlatformPay: usePlatformPay ?? _usePlatformPay,
usePlatformVip: usePlatformVip ?? _usePlatformVip,
money: money ?? _money,
duty: duty ?? _duty,
address: address ?? _address,
expireLimitYear: expireLimitYear ?? _expireLimitYear,
startTime: startTime ?? _startTime,
expirationTime: expirationTime ?? _expirationTime,
contactTel: contactTel ?? _contactTel,
logo: logo ?? _logo,
describe: describe ?? _describe,
account: account ?? _account,
dianwodaId: dianwodaId ?? _dianwodaId,
dadaId: dadaId ?? _dadaId,
showVipCard: showVipCard ?? _showVipCard,
packageId: packageId ?? _packageId,
posType: posType ?? _posType,
);
String get id => _id;
String get createTime => _createTime;
String get createUser => _createUser;
String get updateTime => _updateTime;
String get updateUser => _updateUser;
String get code => _code;
String get name => _name;
Type get type => _type;
Status get status => _status;
bool get readonly => _readonly;
bool get usePlatformPay => _usePlatformPay;
bool get usePlatformVip => _usePlatformVip;
String get money => _money;
String get duty => _duty;
String get address => _address;
num get expireLimitYear => _expireLimitYear;
String get startTime => _startTime;
dynamic get expirationTime => _expirationTime;
String get contactTel => _contactTel;
String get logo => _logo;
String get describe => _describe;
dynamic get account => _account;
String get dianwodaId => _dianwodaId;
String get dadaId => _dadaId;
bool get showVipCard => _showVipCard;
String get packageId => _packageId;
PosType get posType => _posType;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = _id;
map['createTime'] = _createTime;
map['createUser'] = _createUser;
map['updateTime'] = _updateTime;
map['updateUser'] = _updateUser;
map['code'] = _code;
map['name'] = _name;
if (_type != null) {
map['type'] = _type.toJson();
}
if (_status != null) {
map['status'] = _status.toJson();
}
map['readonly'] = _readonly;
map['usePlatformPay'] = _usePlatformPay;
map['usePlatformVip'] = _usePlatformVip;
map['money'] = _money;
map['duty'] = _duty;
map['address'] = _address;
map['expireLimitYear'] = _expireLimitYear;
map['startTime'] = _startTime;
map['expirationTime'] = _expirationTime;
map['contactTel'] = _contactTel;
map['logo'] = _logo;
map['describe'] = _describe;
map['account'] = _account;
map['dianwodaId'] = _dianwodaId;
map['dadaId'] = _dadaId;
map['showVipCard'] = _showVipCard;
map['packageId'] = _packageId;
if (_posType != null) {
map['posType'] = _posType.toJson();
}
return map;
}
}
/// desc : "普通餐饮"
/// code : "NORMALSTORE"
class PosType {
PosType({
String desc,
String code,}){
_desc = desc;
_code = code;
}
PosType.fromJson(dynamic json) {
_desc = json['desc'];
_code = json['code'];
}
String _desc;
String _code;
PosType copyWith({ String desc,
String code,
}) => PosType( desc: desc ?? _desc,
code: code ?? _code,
);
String get desc => _desc;
String get code => _code;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['desc'] = _desc;
map['code'] = _code;
return map;
}
}
/// desc : "正常"
/// code : "NORMAL"
class Status {
Status({
String desc,
String code,}){
_desc = desc;
_code = code;
}
Status.fromJson(dynamic json) {
_desc = json['desc'];
_code = json['code'];
}
String _desc;
String _code;
Status copyWith({ String desc,
String code,
}) => Status( desc: desc ?? _desc,
code: code ?? _code,
);
String get desc => _desc;
String get code => _code;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['desc'] = _desc;
map['code'] = _code;
return map;
}
}
/// desc : "创建"
/// code : "CREATE"
class Type {
Type({
String desc,
String code,}){
_desc = desc;
_code = code;
}
Type.fromJson(dynamic json) {
_desc = json['desc'];
_code = json['code'];
}
String _desc;
String _code;
Type copyWith({ String desc,
String code,
}) => Type( desc: desc ?? _desc,
code: code ?? _code,
);
String get desc => _desc;
String get code => _code;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['desc'] = _desc;
map['code'] = _code;
return map;
}
}

51
lib/retrofit/data/tenant_package_calculate_details.dart

@ -0,0 +1,51 @@
/// totalFee : "100"
/// expirationTime : "2034-01-05 11:16:07"
/// duration : 10
/// packageId : "1742842291845857280"
class TenantPackageCalculateDetails {
TenantPackageCalculateDetails({
String totalFee,
String expirationTime,
num duration,
String packageId,}){
_totalFee = totalFee;
_expirationTime = expirationTime;
_duration = duration;
_packageId = packageId;
}
TenantPackageCalculateDetails.fromJson(dynamic json) {
_totalFee = json['totalFee'];
_expirationTime = json['expirationTime'];
_duration = json['duration'];
_packageId = json['packageId'];
}
String _totalFee;
String _expirationTime;
num _duration;
String _packageId;
TenantPackageCalculateDetails copyWith({ String totalFee,
String expirationTime,
num duration,
String packageId,
}) => TenantPackageCalculateDetails( totalFee: totalFee ?? _totalFee,
expirationTime: expirationTime ?? _expirationTime,
duration: duration ?? _duration,
packageId: packageId ?? _packageId,
);
String get totalFee => _totalFee;
String get expirationTime => _expirationTime;
num get duration => _duration;
String get packageId => _packageId;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['totalFee'] = _totalFee;
map['expirationTime'] = _expirationTime;
map['duration'] = _duration;
map['packageId'] = _packageId;
return map;
}
}

245
lib/retrofit/data/tenant_package_list.dart

@ -0,0 +1,245 @@
/// id : "1742842291845857280"
/// createTime : "2024-01-04 17:35:57"
/// createUser : "1"
/// updateTime : "2024-01-04 17:35:57"
/// updateUser : "1"
/// name : "测试啊"
/// status : 1
/// remark : ""
/// packagePrice : null
/// packageDiscount : null
/// duration : null
/// enableSale : true
/// sort : 1
/// isDefault : false
/// isDelete : 0
/// tenantPackageSale : [{"packagePrice":"100","originalPackagePrice":"200","duration":10,"packageDiscount":50,"isRecommend":false,"saleName":"销售套餐1","canDiscount":true},{"packagePrice":"300","originalPackagePrice":"600","duration":5,"packageDiscount":50,"isRecommend":true,"saleName":"销售套餐2","canDiscount":true}]
class TenantPackageList {
TenantPackageList({
String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
String name,
num status,
String remark,
dynamic packagePrice,
dynamic packageDiscount,
dynamic duration,
bool enableSale,
num sort,
bool isDefault,
num isDelete,
List<TenantPackageSale> tenantPackageSale,}){
_id = id;
_createTime = createTime;
_createUser = createUser;
_updateTime = updateTime;
_updateUser = updateUser;
_name = name;
_status = status;
_remark = remark;
_packagePrice = packagePrice;
_packageDiscount = packageDiscount;
_duration = duration;
_enableSale = enableSale;
_sort = sort;
_isDefault = isDefault;
_isDelete = isDelete;
_tenantPackageSale = tenantPackageSale;
}
TenantPackageList.fromJson(dynamic json) {
_id = json['id'];
_createTime = json['createTime'];
_createUser = json['createUser'];
_updateTime = json['updateTime'];
_updateUser = json['updateUser'];
_name = json['name'];
_status = json['status'];
_remark = json['remark'];
_packagePrice = json['packagePrice'];
_packageDiscount = json['packageDiscount'];
_duration = json['duration'];
_enableSale = json['enableSale'];
_sort = json['sort'];
_isDefault = json['isDefault'];
_isDelete = json['isDelete'];
if (json['tenantPackageSale'] != null) {
_tenantPackageSale = [];
json['tenantPackageSale'].forEach((v) {
_tenantPackageSale.add(TenantPackageSale.fromJson(v));
});
}
}
String _id;
String _createTime;
String _createUser;
String _updateTime;
String _updateUser;
String _name;
num _status;
String _remark;
dynamic _packagePrice;
dynamic _packageDiscount;
dynamic _duration;
bool _enableSale;
num _sort;
bool _isDefault;
num _isDelete;
List<TenantPackageSale> _tenantPackageSale;
TenantPackageList copyWith({ String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
String name,
num status,
String remark,
dynamic packagePrice,
dynamic packageDiscount,
dynamic duration,
bool enableSale,
num sort,
bool isDefault,
num isDelete,
List<TenantPackageSale> tenantPackageSale,
}) => TenantPackageList( id: id ?? _id,
createTime: createTime ?? _createTime,
createUser: createUser ?? _createUser,
updateTime: updateTime ?? _updateTime,
updateUser: updateUser ?? _updateUser,
name: name ?? _name,
status: status ?? _status,
remark: remark ?? _remark,
packagePrice: packagePrice ?? _packagePrice,
packageDiscount: packageDiscount ?? _packageDiscount,
duration: duration ?? _duration,
enableSale: enableSale ?? _enableSale,
sort: sort ?? _sort,
isDefault: isDefault ?? _isDefault,
isDelete: isDelete ?? _isDelete,
tenantPackageSale: tenantPackageSale ?? _tenantPackageSale,
);
String get id => _id;
String get createTime => _createTime;
String get createUser => _createUser;
String get updateTime => _updateTime;
String get updateUser => _updateUser;
String get name => _name;
num get status => _status;
String get remark => _remark;
dynamic get packagePrice => _packagePrice;
dynamic get packageDiscount => _packageDiscount;
dynamic get duration => _duration;
bool get enableSale => _enableSale;
num get sort => _sort;
bool get isDefault => _isDefault;
num get isDelete => _isDelete;
List<TenantPackageSale> get tenantPackageSale => _tenantPackageSale;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = _id;
map['createTime'] = _createTime;
map['createUser'] = _createUser;
map['updateTime'] = _updateTime;
map['updateUser'] = _updateUser;
map['name'] = _name;
map['status'] = _status;
map['remark'] = _remark;
map['packagePrice'] = _packagePrice;
map['packageDiscount'] = _packageDiscount;
map['duration'] = _duration;
map['enableSale'] = _enableSale;
map['sort'] = _sort;
map['isDefault'] = _isDefault;
map['isDelete'] = _isDelete;
if (_tenantPackageSale != null) {
map['tenantPackageSale'] = _tenantPackageSale.map((v) => v.toJson()).toList();
}
return map;
}
}
/// packagePrice : "100"
/// originalPackagePrice : "200"
/// duration : 10
/// packageDiscount : 50
/// isRecommend : false
/// saleName : "销售套餐1"
/// canDiscount : true
class TenantPackageSale {
TenantPackageSale({
String packagePrice,
String originalPackagePrice,
num duration,
num packageDiscount,
bool isRecommend,
String saleName,
bool canDiscount,}){
_packagePrice = packagePrice;
_originalPackagePrice = originalPackagePrice;
_duration = duration;
_packageDiscount = packageDiscount;
_isRecommend = isRecommend;
_saleName = saleName;
_canDiscount = canDiscount;
}
TenantPackageSale.fromJson(dynamic json) {
_packagePrice = json['packagePrice'];
_originalPackagePrice = json['originalPackagePrice'];
_duration = json['duration'];
_packageDiscount = json['packageDiscount'];
_isRecommend = json['isRecommend'];
_saleName = json['saleName'];
_canDiscount = json['canDiscount'];
}
String _packagePrice;
String _originalPackagePrice;
num _duration;
num _packageDiscount;
bool _isRecommend;
String _saleName;
bool _canDiscount;
TenantPackageSale copyWith({ String packagePrice,
String originalPackagePrice,
num duration,
num packageDiscount,
bool isRecommend,
String saleName,
bool canDiscount,
}) => TenantPackageSale( packagePrice: packagePrice ?? _packagePrice,
originalPackagePrice: originalPackagePrice ?? _originalPackagePrice,
duration: duration ?? _duration,
packageDiscount: packageDiscount ?? _packageDiscount,
isRecommend: isRecommend ?? _isRecommend,
saleName: saleName ?? _saleName,
canDiscount: canDiscount ?? _canDiscount,
);
String get packagePrice => _packagePrice;
String get originalPackagePrice => _originalPackagePrice;
num get duration => _duration;
num get packageDiscount => _packageDiscount;
bool get isRecommend => _isRecommend;
String get saleName => _saleName;
bool get canDiscount => _canDiscount;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['packagePrice'] = _packagePrice;
map['originalPackagePrice'] = _originalPackagePrice;
map['duration'] = _duration;
map['packageDiscount'] = _packageDiscount;
map['isRecommend'] = _isRecommend;
map['saleName'] = _saleName;
map['canDiscount'] = _canDiscount;
return map;
}
}

16
lib/utils/business_instance.dart

@ -9,6 +9,10 @@ class BusinessInstance {
String _businessTenant;
String _expirationTime;
String _serviceStatus;
String get businessToken => _businessToken;
set businessToken(String value) {
@ -31,4 +35,16 @@ class BusinessInstance {
set businessTenant(String value) {
_businessTenant = value;
}
String get expirationTime => _expirationTime;
set expirationTime(String value) {
_expirationTime = value;
}
String get serviceStatus => _serviceStatus;
set serviceStatus(String value) {
_serviceStatus = value;
}
}

Loading…
Cancel
Save