# Conflicts: # lib/community/community_child_page.dart # lib/community/headlines/article_page.dart # lib/generated/l10n.dart # lib/l10n/intl_en.arb # lib/l10n/intl_zh_CN.arb # lib/l10n/intl_zh_Hans_CN.arb # lib/l10n/intl_zh_Hant_CN.arb # lib/l10n/intl_zh_TW.arb # lib/mine/mine_page.dart # lib/retrofit/min_api.dart # lib/retrofit/min_api.g.dart # lib/retrofit/retrofit_api.dart # lib/retrofit/retrofit_api.g.dart # lib/settlement/settlement.dart # lib/utils/flutter_utils.dartzyh
After Width: | Height: | Size: 486 B |
After Width: | Height: | Size: 786 B |
After Width: | Height: | Size: 166 B |
After Width: | Height: | Size: 798 B |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 668 B |
After Width: | Height: | Size: 632 B |
After Width: | Height: | Size: 790 B |
After Width: | Height: | Size: 538 B |
After Width: | Height: | Size: 660 B |
After Width: | Height: | Size: 794 B |
After Width: | Height: | Size: 950 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 980 B |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 493 B |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 9.3 KiB |
After Width: | Height: | Size: 6.6 KiB |
After Width: | Height: | Size: 8.4 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 6.5 KiB |
After Width: | Height: | Size: 6.1 KiB |
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 250 B |
After Width: | Height: | Size: 402 B |
After Width: | Height: | Size: 114 B |
After Width: | Height: | Size: 490 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 818 B |
After Width: | Height: | Size: 822 B |
After Width: | Height: | Size: 448 B |
After Width: | Height: | Size: 404 B |
After Width: | Height: | Size: 442 B |
After Width: | Height: | Size: 348 B |
After Width: | Height: | Size: 380 B |
After Width: | Height: | Size: 394 B |
After Width: | Height: | Size: 494 B |
After Width: | Height: | Size: 688 B |
After Width: | Height: | Size: 748 B |
After Width: | Height: | Size: 504 B |
@ -0,0 +1,476 @@
|
||||
import 'package:dio/dio.dart'; |
||||
import 'package:flutter/cupertino.dart'; |
||||
import 'package:flutter/material.dart'; |
||||
import 'package:flutter_easyloading/flutter_easyloading.dart'; |
||||
import 'package:huixiang/generated/l10n.dart'; |
||||
import 'package:huixiang/retrofit/data/activity.dart'; |
||||
import 'package:huixiang/retrofit/data/activity_order_list.dart'; |
||||
import 'package:huixiang/retrofit/data/base_data.dart'; |
||||
import 'package:huixiang/retrofit/data/store_info.dart'; |
||||
import 'package:huixiang/retrofit/min_api.dart'; |
||||
import 'package:huixiang/retrofit/retrofit_api.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
import 'package:huixiang/view_widget/classic_header.dart'; |
||||
import 'package:huixiang/view_widget/custom_image.dart'; |
||||
import 'package:huixiang/view_widget/my_appbar.dart'; |
||||
import 'package:huixiang/view_widget/my_footer.dart'; |
||||
import 'package:huixiang/view_widget/my_tab.dart'; |
||||
import 'package:huixiang/view_widget/no_data_view.dart'; |
||||
import 'package:huixiang/view_widget/round_button.dart'; |
||||
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
import 'package:shared_preferences/shared_preferences.dart'; |
||||
|
||||
class BargainGroupOrder extends StatefulWidget { |
||||
final Map<String, dynamic> arguments; |
||||
|
||||
BargainGroupOrder({this.arguments}); |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _BargainGroupOrder(); |
||||
} |
||||
} |
||||
|
||||
class _BargainGroupOrder extends State<BargainGroupOrder> |
||||
with SingleTickerProviderStateMixin { |
||||
List<Widget> tabs; |
||||
List<Widget> _pages; |
||||
TabController tabcontroller; |
||||
int type = 0; |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
type = widget.arguments["type"]; |
||||
} |
||||
|
||||
@override |
||||
void didChangeDependencies() { |
||||
super.didChangeDependencies(); |
||||
if (tabcontroller == null) |
||||
tabcontroller = TabController(length: 4, vsync: this); |
||||
tabs = [ |
||||
MyTab( |
||||
text: S.of(context).quanbu, |
||||
), |
||||
MyTab( |
||||
text: "进行中", |
||||
), |
||||
MyTab( |
||||
text: "成功", |
||||
), |
||||
MyTab( |
||||
text: "失败", |
||||
) |
||||
]; |
||||
_pages = [ |
||||
ExchangeHistoryList(0,type), |
||||
ExchangeHistoryList(2,type), |
||||
ExchangeHistoryList(3,type), |
||||
ExchangeHistoryList(4,type) |
||||
]; |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return DefaultTabController( |
||||
length: 4, |
||||
child: Scaffold( |
||||
appBar: MyAppBar( |
||||
title:type == 1 ? S.of(context).wodepintuan :S.of(context).wodekanjia, |
||||
titleColor: Colors.black, |
||||
titleSize: 18.sp, |
||||
background: Color(0xFFFFFFFF), |
||||
leadingColor: Colors.black, |
||||
toolbarHeight: kToolbarHeight + MediaQuery.of(context).padding.top, |
||||
bottom: PreferredSize( |
||||
preferredSize: Size(double.infinity, 38.h), |
||||
child: TabBar( |
||||
controller: tabcontroller, |
||||
indicatorWeight: 2, |
||||
indicatorColor: Color(0xFF39B54A), |
||||
indicatorSize: TabBarIndicatorSize.label, |
||||
indicatorPadding: EdgeInsets.only(top: 3), |
||||
unselectedLabelStyle: TextStyle( |
||||
fontSize: 16.sp, |
||||
fontWeight: FontWeight.normal, |
||||
), |
||||
labelStyle: TextStyle( |
||||
color: Colors.black, |
||||
fontSize: 16.sp, |
||||
fontWeight: MyFontWeight.semi_bold), |
||||
labelColor: Colors.black, |
||||
tabs: tabs, |
||||
), |
||||
), |
||||
), |
||||
body: TabBarView( |
||||
children: _pages, |
||||
controller: tabcontroller, |
||||
), |
||||
), |
||||
); |
||||
} |
||||
} |
||||
|
||||
class ExchangeHistoryList extends StatefulWidget { |
||||
final int orderStatus; |
||||
final int type; |
||||
|
||||
ExchangeHistoryList(this.orderStatus,this.type); |
||||
|
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _ExchangeHistoryList(); |
||||
} |
||||
} |
||||
|
||||
class _ExchangeHistoryList extends State<ExchangeHistoryList> { |
||||
MinApiService minService; |
||||
List<ActivityOrderList> activityOrderList = []; |
||||
RefreshController _refreshController = RefreshController(initialRefresh: false); |
||||
ApiService apiService; |
||||
StoreInfo storeInfo; |
||||
List<Activity> activitys; |
||||
String storeId; |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
SharedPreferences.getInstance().then((value) { |
||||
String minToken = value.getString("minToken"); |
||||
String tenant = value.getString("tenant"); |
||||
String storeId = value.getString("storeId"); |
||||
minService = MinApiService( |
||||
Dio(), |
||||
context: context, |
||||
token: minToken, |
||||
tenant: tenant, |
||||
storeId: storeId, |
||||
showLoading: true |
||||
); |
||||
queryShowMyActList(); |
||||
}); |
||||
} |
||||
|
||||
///查看我的拼团、砍价、列表 |
||||
queryShowMyActList() async { |
||||
BaseData<List<ActivityOrderList>> baseData = |
||||
await minService.showMyActList({ |
||||
"state":widget.orderStatus, |
||||
"type" :widget.type, |
||||
}).catchError((error) { |
||||
_refreshController.loadFailed(); |
||||
_refreshController.refreshFailed(); |
||||
}); |
||||
if (baseData != null && baseData.isSuccess) { |
||||
_refreshController.refreshCompleted(); |
||||
setState(() { |
||||
activityOrderList.clear(); |
||||
if(baseData.data.length > 0) |
||||
activityOrderList.addAll(baseData.data); |
||||
queryStoreInfo(); |
||||
}); |
||||
} else { |
||||
_refreshController.refreshFailed(); |
||||
_refreshController.loadFailed(); |
||||
} |
||||
} |
||||
|
||||
/// 查询店铺信息 |
||||
queryStoreInfo() async { |
||||
if (apiService == null) { |
||||
SharedPreferences value = await SharedPreferences.getInstance(); |
||||
apiService = ApiService( |
||||
Dio(), |
||||
context: context, |
||||
token: value.getString("token"), |
||||
); |
||||
} |
||||
BaseData baseData = |
||||
await apiService.queryStoreInfo(activityOrderList[0].storeId).catchError((error) { |
||||
debugPrint(error.toString()); |
||||
}); |
||||
if (baseData != null && baseData.isSuccess) { |
||||
storeInfo = StoreInfo.fromJson(baseData.data); |
||||
activitys = storeInfo.informationVOPageVO.list |
||||
.map((e) => Activity.fromJson(e)) |
||||
.toList(); |
||||
if (mounted) { |
||||
setState(() {}); |
||||
} |
||||
} |
||||
EasyLoading.dismiss(); |
||||
} |
||||
|
||||
_refresh() { |
||||
queryShowMyActList(); |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Container( |
||||
child: SmartRefresher( |
||||
enablePullDown: true, |
||||
enablePullUp: false, |
||||
header: MyHeader(), |
||||
footer: CustomFooter( |
||||
builder: (BuildContext context, LoadStatus mode) { |
||||
return MyFooter(mode); |
||||
}, |
||||
), |
||||
controller: _refreshController, |
||||
physics: BouncingScrollPhysics(), |
||||
// onLoading: _refresh, |
||||
onRefresh: _refresh, |
||||
child: (activityOrderList != null && activityOrderList.length > 0) |
||||
? |
||||
ListView.builder( |
||||
itemCount: activityOrderList?.length ?? 0, |
||||
shrinkWrap: true, |
||||
physics: NeverScrollableScrollPhysics(), |
||||
itemBuilder: (context, position) { |
||||
return bargainOrder(activityOrderList[position]); |
||||
}, |
||||
):NoDataView( |
||||
src: "assets/image/ding_dan.webp", |
||||
isShowBtn: false, |
||||
text: "还没有订单,快去下一单吧~", |
||||
fontSize: 16.sp, |
||||
margin: EdgeInsets.only(top: 120.h), |
||||
), |
||||
), |
||||
); |
||||
} |
||||
|
||||
|
||||
Widget bargainOrder(ActivityOrderList activityOrderList) { |
||||
return Container( |
||||
margin: EdgeInsets.fromLTRB(16.w, 8.h, 16.w, 8.h), |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
borderRadius: BorderRadius.circular(4), |
||||
boxShadow: [ |
||||
BoxShadow( |
||||
color: Colors.black.withAlpha(25), |
||||
offset: Offset(0, 1), |
||||
blurRadius: 12, |
||||
spreadRadius: 0, |
||||
), |
||||
], |
||||
), |
||||
child: Column( |
||||
mainAxisAlignment: MainAxisAlignment.spaceAround, |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Row( |
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
// Container( |
||||
// width: 19.w, |
||||
// height:21.h, |
||||
// margin: EdgeInsets.only(left: 12.w, top: 12.h), |
||||
// alignment: Alignment.center, |
||||
// decoration: BoxDecoration( |
||||
// color: Color(0xff32A060), |
||||
// borderRadius: BorderRadius.circular(2), |
||||
// ), |
||||
// child: Text( |
||||
// (orderInfo != null && orderInfo.isTakeOut == 0) ? "自" : "外", |
||||
// // "自", |
||||
// style: TextStyle( |
||||
// fontSize: 12.sp, |
||||
// fontWeight: FontWeight.bold, |
||||
// color: Colors.white, |
||||
// ), |
||||
// ), |
||||
// ), |
||||
Expanded( |
||||
child: Container( |
||||
width: double.infinity, |
||||
margin: EdgeInsets.only(left: 6.w, top: 12.h), |
||||
alignment: Alignment.centerLeft, |
||||
child: Text( |
||||
activityOrderList?.storeName ?? "", |
||||
style: TextStyle( |
||||
fontWeight: FontWeight.bold, |
||||
fontSize: 14.sp, |
||||
color: Color(0xFF353535), |
||||
), |
||||
), |
||||
), |
||||
flex: 1, |
||||
), |
||||
Padding( |
||||
padding: EdgeInsets.only(top: 12.h, right: 12.w), |
||||
child:Text( |
||||
(widget.type == 1)?(widget.orderStatus == 4 ? "拼团失败" :(activityOrderList.howManyMore != 0 ? "还差${activityOrderList?.howManyMore ?? 0}人拼团成功" : "拼团成功")) |
||||
:(activityOrderList.actRecordState == 1 ? "待支付" :(widget.orderStatus == 4 ? "砍价失败" : (activityOrderList.howManyMoney != "0.00" ? "还差¥${activityOrderList?.howManyMoney ?? 0}砍价成功" : "砍价成功"))), |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: FontWeight.bold, |
||||
color: widget.orderStatus == 4 ? Color(0xff32A060) : Color(0xffFE951E), |
||||
), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
Container( |
||||
margin: EdgeInsets.only(left: 37.w), |
||||
child: Column( |
||||
mainAxisAlignment: MainAxisAlignment.start, |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Text( |
||||
S.of(context).xiadanshijian_(activityOrderList?.joinTime ?? ""), |
||||
style: TextStyle( |
||||
fontSize: 10.sp, |
||||
color: Color(0xFF727272), |
||||
), |
||||
), |
||||
SizedBox( |
||||
height: 8.h, |
||||
), |
||||
Container( |
||||
height: 81.h, |
||||
margin: EdgeInsets.only(right: 12), |
||||
child: Row( |
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
MImage( |
||||
activityOrderList?.productImg ?? "", |
||||
width: 81.w, |
||||
height: 81.h, |
||||
fit: BoxFit.cover, |
||||
errorSrc: "assets/image/default_1.webp", |
||||
fadeSrc: "assets/image/default_1.webp", |
||||
), |
||||
SizedBox( |
||||
width: 10, |
||||
), |
||||
Expanded( |
||||
child: Column( |
||||
mainAxisAlignment: MainAxisAlignment.spaceAround, |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Text( |
||||
activityOrderList?.storeName ?? "", |
||||
maxLines: 2, |
||||
overflow: TextOverflow.ellipsis, |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF353535), |
||||
), |
||||
), |
||||
Text( |
||||
activityOrderList?.productSkuName ?? "", |
||||
style: TextStyle( |
||||
fontSize: 10.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF727272), |
||||
), |
||||
), |
||||
Row( |
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Text( |
||||
"x1", |
||||
style: TextStyle( |
||||
fontSize: 10.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color: Color(0xFF727272), |
||||
), |
||||
), |
||||
Text.rich( |
||||
TextSpan( |
||||
children: [ |
||||
TextSpan( |
||||
// text: "已砍至:", |
||||
text: S.of(context).heji, |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF868686), |
||||
), |
||||
), |
||||
TextSpan( |
||||
text:activityOrderList?.orderSum ?? "0", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color: Color(0xFF32A060), |
||||
), |
||||
), |
||||
TextSpan( |
||||
text: "元", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF868686), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
], |
||||
), |
||||
], |
||||
)), |
||||
], |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
SizedBox( |
||||
height: 12.h, |
||||
), |
||||
Container( |
||||
margin: EdgeInsets.only(right: 12.w, bottom: 16.h), |
||||
child: Directionality( |
||||
textDirection: TextDirection.rtl, |
||||
child: Row( |
||||
children: [ |
||||
GestureDetector( |
||||
onTap: () { |
||||
if(widget.type == 1) { |
||||
Navigator.of(context) |
||||
.pushNamed('/router/group_details', arguments: { |
||||
"actRecordId": activityOrderList.actRecordId, |
||||
"limitNumber":activityOrderList.successNumber, |
||||
}); |
||||
}else{ |
||||
Navigator.of(context) |
||||
.pushNamed('/router/bargain_details',arguments: { |
||||
"actRecordId": activityOrderList.actRecordId, |
||||
"limitNumber":activityOrderList.successNumber, |
||||
"storeInfo":storeInfo, |
||||
}).then((value) { |
||||
_refresh(); |
||||
setState(() {}); |
||||
}); |
||||
} |
||||
}, |
||||
child: RoundButton( |
||||
height: 25.h, |
||||
text: "查看详情", |
||||
textColor: Colors.white, |
||||
fontSize: 12.sp, |
||||
backgroup: Color(0xFF32A060), |
||||
radius: 2, |
||||
padding: EdgeInsets.fromLTRB(17.w,0, 17.w,0), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,536 @@
|
||||
/// actRecord : {"id":"1496692045555695616","createTime":"2022-02-24 11:42:46","createUser":"1496056013827080192","updateTime":"2022-02-24 11:42:46","updateUser":"1496056013827080192","storeId":"1460885296764682240","type":3,"actTemplateId":"1490572026815971328","actTimeId":"1490572027034075136","actProductId":"1494198261018263552","mid":"1496056013827080192","isDirectBuy":false,"joinNum":1,"startTime":"2022-02-24 11:42:46","endTime":"2022-02-24 13:42:46","state":4,"isDelete":0} |
||||
/// actRecordJoinList : [{"id":"1496692045677330432","createTime":"2022-02-24 11:42:46","createUser":"1496056013827080192","updateTime":"2022-02-24 11:42:46","updateUser":"1496056013827080192","storeId":"1460885296764682240","type":3,"actTemplateId":"1490572026815971328","actTimeId":"1490572027034075136","actRecordId":"1496692045555695616","mid":"1496056013827080192","orderId":null,"isLeader":true,"memberAvatar":"","memberNickname":"","productId":"1494198261018263552","actPrice":"54.45","state":true,"isDelete":0}] |
||||
/// actProduct : {"id":"1494198261018263552","createTime":"2022-02-17 14:33:21","createUser":"1364043181062094848","updateTime":"2022-02-17 14:33:21","updateUser":"1364043181062094848","storeId":"1460885296764682240","templateId":"1490572026815971328","timeId":"1490572027034075136","productId":"1461246266586431488","productName":"野生羊肚菌","productImg":"https://pos.upload.gznl.top/1179/2021/11/298d1e1c-2a5f-4b9d-95a7-87b3f88a9cd1.jpg","productPrice":"150.00","promotionPrice":"11.00","productStock":200,"sellCount":0,"skuJson":[{"skuId":"1461246266661928960","skuPrice":11,"skuStock":100},{"skuId":"1461246266687094784","skuPrice":100,"skuStock":100}],"isDelete":0} |
||||
/// skuName : null |
||||
/// isBargain : true |
||||
|
||||
class ActivityActRecordDetails { |
||||
ActivityActRecordDetails({ |
||||
ActRecord actRecord, |
||||
List<ActRecordJoinList> actRecordJoinList, |
||||
ActProduct actProduct, |
||||
dynamic skuName, |
||||
String skuId, |
||||
bool isBargain, |
||||
int successNumber}){ |
||||
_actRecord = actRecord; |
||||
_actRecordJoinList = actRecordJoinList; |
||||
_actProduct = actProduct; |
||||
_skuName = skuName; |
||||
_skuId = skuId; |
||||
_isBargain = isBargain; |
||||
_successNumber = successNumber; |
||||
|
||||
} |
||||
|
||||
ActivityActRecordDetails.fromJson(dynamic json) { |
||||
_actRecord = json['actRecord'] != null ? ActRecord.fromJson(json['actRecord']) : null; |
||||
if (json['actRecordJoinList'] != null) { |
||||
_actRecordJoinList = []; |
||||
json['actRecordJoinList'].forEach((v) { |
||||
_actRecordJoinList.add(ActRecordJoinList.fromJson(v)); |
||||
}); |
||||
} |
||||
_actProduct = json['actProduct'] != null ? ActProduct.fromJson(json['actProduct']) : null; |
||||
_skuName = json['skuName']; |
||||
_skuId = json['skuId']; |
||||
_isBargain = json['isBargain']; |
||||
_successNumber = json['successNumber']; |
||||
} |
||||
ActRecord _actRecord; |
||||
List<ActRecordJoinList> _actRecordJoinList; |
||||
ActProduct _actProduct; |
||||
dynamic _skuName; |
||||
String _skuId; |
||||
bool _isBargain; |
||||
int _successNumber; |
||||
|
||||
ActRecord get actRecord => _actRecord; |
||||
List<ActRecordJoinList> get actRecordJoinList => _actRecordJoinList; |
||||
ActProduct get actProduct => _actProduct; |
||||
dynamic get skuName => _skuName; |
||||
String get skuId => _skuId; |
||||
bool get isBargain => _isBargain; |
||||
int get successNumber => _successNumber; |
||||
|
||||
Map<String, dynamic> toJson() { |
||||
final map = <String, dynamic>{}; |
||||
if (_actRecord != null) { |
||||
map['actRecord'] = _actRecord.toJson(); |
||||
} |
||||
if (_actRecordJoinList != null) { |
||||
map['actRecordJoinList'] = _actRecordJoinList.map((v) => v.toJson()).toList(); |
||||
} |
||||
if (_actProduct != null) { |
||||
map['actProduct'] = _actProduct.toJson(); |
||||
} |
||||
map['skuId'] = _skuId; |
||||
map['isBargain'] = _isBargain; |
||||
map['successNumber'] = _successNumber; |
||||
return map; |
||||
} |
||||
|
||||
} |
||||
|
||||
/// id : "1494198261018263552" |
||||
/// createTime : "2022-02-17 14:33:21" |
||||
/// createUser : "1364043181062094848" |
||||
/// updateTime : "2022-02-17 14:33:21" |
||||
/// updateUser : "1364043181062094848" |
||||
/// storeId : "1460885296764682240" |
||||
/// templateId : "1490572026815971328" |
||||
/// timeId : "1490572027034075136" |
||||
/// productId : "1461246266586431488" |
||||
/// productName : "野生羊肚菌" |
||||
/// productImg : "https://pos.upload.gznl.top/1179/2021/11/298d1e1c-2a5f-4b9d-95a7-87b3f88a9cd1.jpg" |
||||
/// productPrice : "150.00" |
||||
/// promotionPrice : "11.00" |
||||
/// productStock : 200 |
||||
/// sellCount : 0 |
||||
/// skuJson : [{"skuId":"1461246266661928960","skuPrice":11,"skuStock":100},{"skuId":"1461246266687094784","skuPrice":100,"skuStock":100}] |
||||
/// isDelete : 0 |
||||
|
||||
class ActProduct { |
||||
ActProduct({ |
||||
String id, |
||||
String createTime, |
||||
String createUser, |
||||
String updateTime, |
||||
String updateUser, |
||||
String storeId, |
||||
String templateId, |
||||
String timeId, |
||||
String productId, |
||||
String productName, |
||||
String productImg, |
||||
String productPrice, |
||||
String promotionPrice, |
||||
int productStock, |
||||
int sellCount, |
||||
List<SkuJson> skuJson, |
||||
int isDelete,}){ |
||||
_id = id; |
||||
_createTime = createTime; |
||||
_createUser = createUser; |
||||
_updateTime = updateTime; |
||||
_updateUser = updateUser; |
||||
_storeId = storeId; |
||||
_templateId = templateId; |
||||
_timeId = timeId; |
||||
_productId = productId; |
||||
_productName = productName; |
||||
_productImg = productImg; |
||||
_productPrice = productPrice; |
||||
_promotionPrice = promotionPrice; |
||||
_productStock = productStock; |
||||
_sellCount = sellCount; |
||||
_skuJson = skuJson; |
||||
_isDelete = isDelete; |
||||
} |
||||
|
||||
ActProduct.fromJson(dynamic json) { |
||||
_id = json['id']; |
||||
_createTime = json['createTime']; |
||||
_createUser = json['createUser']; |
||||
_updateTime = json['updateTime']; |
||||
_updateUser = json['updateUser']; |
||||
_storeId = json['storeId']; |
||||
_templateId = json['templateId']; |
||||
_timeId = json['timeId']; |
||||
_productId = json['productId']; |
||||
_productName = json['productName']; |
||||
_productImg = json['productImg']; |
||||
_productPrice = json['productPrice']; |
||||
_promotionPrice = json['promotionPrice']; |
||||
_productStock = json['productStock']; |
||||
_sellCount = json['sellCount']; |
||||
if (json['skuJson'] != null) { |
||||
_skuJson = []; |
||||
json['skuJson'].forEach((v) { |
||||
_skuJson.add(SkuJson.fromJson(v)); |
||||
}); |
||||
} |
||||
_isDelete = json['isDelete']; |
||||
} |
||||
String _id; |
||||
String _createTime; |
||||
String _createUser; |
||||
String _updateTime; |
||||
String _updateUser; |
||||
String _storeId; |
||||
String _templateId; |
||||
String _timeId; |
||||
String _productId; |
||||
String _productName; |
||||
String _productImg; |
||||
String _productPrice; |
||||
String _promotionPrice; |
||||
int _productStock; |
||||
int _sellCount; |
||||
List<SkuJson> _skuJson; |
||||
int _isDelete; |
||||
|
||||
String get id => _id; |
||||
String get createTime => _createTime; |
||||
String get createUser => _createUser; |
||||
String get updateTime => _updateTime; |
||||
String get updateUser => _updateUser; |
||||
String get storeId => _storeId; |
||||
String get templateId => _templateId; |
||||
String get timeId => _timeId; |
||||
String get productId => _productId; |
||||
String get productName => _productName; |
||||
String get productImg => _productImg; |
||||
String get productPrice => _productPrice; |
||||
String get promotionPrice => _promotionPrice; |
||||
int get productStock => _productStock; |
||||
int get sellCount => _sellCount; |
||||
List<SkuJson> get skuJson => _skuJson; |
||||
int get isDelete => _isDelete; |
||||
|
||||
Map<String, dynamic> toJson() { |
||||
final map = <String, dynamic>{}; |
||||
map['id'] = _id; |
||||
map['createTime'] = _createTime; |
||||
map['createUser'] = _createUser; |
||||
map['updateTime'] = _updateTime; |
||||
map['updateUser'] = _updateUser; |
||||
map['storeId'] = _storeId; |
||||
map['templateId'] = _templateId; |
||||
map['timeId'] = _timeId; |
||||
map['productId'] = _productId; |
||||
map['productName'] = _productName; |
||||
map['productImg'] = _productImg; |
||||
map['productPrice'] = _productPrice; |
||||
map['promotionPrice'] = _promotionPrice; |
||||
map['productStock'] = _productStock; |
||||
map['sellCount'] = _sellCount; |
||||
if (_skuJson != null) { |
||||
map['skuJson'] = _skuJson.map((v) => v.toJson()).toList(); |
||||
} |
||||
map['isDelete'] = _isDelete; |
||||
return map; |
||||
} |
||||
|
||||
} |
||||
|
||||
/// skuId : "1461246266661928960" |
||||
/// skuPrice : 11 |
||||
/// skuStock : 100 |
||||
|
||||
class SkuJson { |
||||
SkuJson({ |
||||
String skuId, |
||||
int skuPrice, |
||||
int skuStock,}){ |
||||
_skuId = skuId; |
||||
_skuPrice = skuPrice; |
||||
_skuStock = skuStock; |
||||
} |
||||
|
||||
SkuJson.fromJson(dynamic json) { |
||||
_skuId = json['skuId']; |
||||
_skuPrice = json['skuPrice']; |
||||
_skuStock = json['skuStock']; |
||||
} |
||||
String _skuId; |
||||
int _skuPrice; |
||||
int _skuStock; |
||||
|
||||
String get skuId => _skuId; |
||||
int get skuPrice => _skuPrice; |
||||
int get skuStock => _skuStock; |
||||
|
||||
Map<String, dynamic> toJson() { |
||||
final map = <String, dynamic>{}; |
||||
map['skuId'] = _skuId; |
||||
map['skuPrice'] = _skuPrice; |
||||
map['skuStock'] = _skuStock; |
||||
return map; |
||||
} |
||||
|
||||
} |
||||
|
||||
/// id : "1496692045677330432" |
||||
/// createTime : "2022-02-24 11:42:46" |
||||
/// createUser : "1496056013827080192" |
||||
/// updateTime : "2022-02-24 11:42:46" |
||||
/// updateUser : "1496056013827080192" |
||||
/// storeId : "1460885296764682240" |
||||
/// type : 3 |
||||
/// actTemplateId : "1490572026815971328" |
||||
/// actTimeId : "1490572027034075136" |
||||
/// actRecordId : "1496692045555695616" |
||||
/// mid : "1496056013827080192" |
||||
/// orderId : null |
||||
/// isLeader : true |
||||
/// memberAvatar : "" |
||||
/// memberNickname : "" |
||||
/// productId : "1494198261018263552" |
||||
/// actPrice : "54.45" |
||||
/// state : true |
||||
/// isDelete : 0 |
||||
|
||||
class ActRecordJoinList { |
||||
ActRecordJoinList({ |
||||
String id, |
||||
String createTime, |
||||
String createUser, |
||||
String updateTime, |
||||
String updateUser, |
||||
String storeId, |
||||
int type, |
||||
String actTemplateId, |
||||
String actTimeId, |
||||
String actRecordId, |
||||
String mid, |
||||
dynamic orderId, |
||||
bool isLeader, |
||||
String memberAvatar, |
||||
String memberNickname, |
||||
String productId, |
||||
String actPrice, |
||||
bool state, |
||||
int isDelete,}){ |
||||
_id = id; |
||||
_createTime = createTime; |
||||
_createUser = createUser; |
||||
_updateTime = updateTime; |
||||
_updateUser = updateUser; |
||||
_storeId = storeId; |
||||
_type = type; |
||||
_actTemplateId = actTemplateId; |
||||
_actTimeId = actTimeId; |
||||
_actRecordId = actRecordId; |
||||
_mid = mid; |
||||
_orderId = orderId; |
||||
_isLeader = isLeader; |
||||
_memberAvatar = memberAvatar; |
||||
_memberNickname = memberNickname; |
||||
_productId = productId; |
||||
_actPrice = actPrice; |
||||
_state = state; |
||||
_isDelete = isDelete; |
||||
} |
||||
|
||||
ActRecordJoinList.fromJson(dynamic json) { |
||||
_id = json['id']; |
||||
_createTime = json['createTime']; |
||||
_createUser = json['createUser']; |
||||
_updateTime = json['updateTime']; |
||||
_updateUser = json['updateUser']; |
||||
_storeId = json['storeId']; |
||||
_type = json['type']; |
||||
_actTemplateId = json['actTemplateId']; |
||||
_actTimeId = json['actTimeId']; |
||||
_actRecordId = json['actRecordId']; |
||||
_mid = json['mid']; |
||||
_orderId = json['orderId']; |
||||
_isLeader = json['isLeader']; |
||||
_memberAvatar = json['memberAvatar']; |
||||
_memberNickname = json['memberNickname']; |
||||
_productId = json['productId']; |
||||
_actPrice = json['actPrice']; |
||||
_state = json['state']; |
||||
_isDelete = json['isDelete']; |
||||
} |
||||
String _id; |
||||
String _createTime; |
||||
String _createUser; |
||||
String _updateTime; |
||||
String _updateUser; |
||||
String _storeId; |
||||
int _type; |
||||
String _actTemplateId; |
||||
String _actTimeId; |
||||
String _actRecordId; |
||||
String _mid; |
||||
dynamic _orderId; |
||||
bool _isLeader; |
||||
String _memberAvatar; |
||||
String _memberNickname; |
||||
String _productId; |
||||
String _actPrice; |
||||
bool _state; |
||||
int _isDelete; |
||||
|
||||
String get id => _id; |
||||
String get createTime => _createTime; |
||||
String get createUser => _createUser; |
||||
String get updateTime => _updateTime; |
||||
String get updateUser => _updateUser; |
||||
String get storeId => _storeId; |
||||
int get type => _type; |
||||
String get actTemplateId => _actTemplateId; |
||||
String get actTimeId => _actTimeId; |
||||
String get actRecordId => _actRecordId; |
||||
String get mid => _mid; |
||||
dynamic get orderId => _orderId; |
||||
bool get isLeader => _isLeader; |
||||
String get memberAvatar => _memberAvatar; |
||||
String get memberNickname => _memberNickname; |
||||
String get productId => _productId; |
||||
String get actPrice => _actPrice; |
||||
bool get state => _state; |
||||
int get isDelete => _isDelete; |
||||
|
||||
Map<String, dynamic> toJson() { |
||||
final map = <String, dynamic>{}; |
||||
map['id'] = _id; |
||||
map['createTime'] = _createTime; |
||||
map['createUser'] = _createUser; |
||||
map['updateTime'] = _updateTime; |
||||
map['updateUser'] = _updateUser; |
||||
map['storeId'] = _storeId; |
||||
map['type'] = _type; |
||||
map['actTemplateId'] = _actTemplateId; |
||||
map['actTimeId'] = _actTimeId; |
||||
map['actRecordId'] = _actRecordId; |
||||
map['mid'] = _mid; |
||||
map['orderId'] = _orderId; |
||||
map['isLeader'] = _isLeader; |
||||
map['memberAvatar'] = _memberAvatar; |
||||
map['memberNickname'] = _memberNickname; |
||||
map['productId'] = _productId; |
||||
map['actPrice'] = _actPrice; |
||||
map['state'] = _state; |
||||
map['isDelete'] = _isDelete; |
||||
return map; |
||||
} |
||||
|
||||
} |
||||
|
||||
/// id : "1496692045555695616" |
||||
/// createTime : "2022-02-24 11:42:46" |
||||
/// createUser : "1496056013827080192" |
||||
/// updateTime : "2022-02-24 11:42:46" |
||||
/// updateUser : "1496056013827080192" |
||||
/// storeId : "1460885296764682240" |
||||
/// type : 3 |
||||
/// actTemplateId : "1490572026815971328" |
||||
/// actTimeId : "1490572027034075136" |
||||
/// actProductId : "1494198261018263552" |
||||
/// mid : "1496056013827080192" |
||||
/// isDirectBuy : false |
||||
/// joinNum : 1 |
||||
/// startTime : "2022-02-24 11:42:46" |
||||
/// endTime : "2022-02-24 13:42:46" |
||||
/// state : 4 |
||||
/// isDelete : 0 |
||||
|
||||
class ActRecord { |
||||
ActRecord({ |
||||
String id, |
||||
String createTime, |
||||
String createUser, |
||||
String updateTime, |
||||
String updateUser, |
||||
String storeId, |
||||
int type, |
||||
String actTemplateId, |
||||
String actTimeId, |
||||
String actProductId, |
||||
String mid, |
||||
bool isDirectBuy, |
||||
int joinNum, |
||||
String startTime, |
||||
String endTime, |
||||
int state, |
||||
int isDelete,}){ |
||||
_id = id; |
||||
_createTime = createTime; |
||||
_createUser = createUser; |
||||
_updateTime = updateTime; |
||||
_updateUser = updateUser; |
||||
_storeId = storeId; |
||||
_type = type; |
||||
_actTemplateId = actTemplateId; |
||||
_actTimeId = actTimeId; |
||||
_actProductId = actProductId; |
||||
_mid = mid; |
||||
_isDirectBuy = isDirectBuy; |
||||
_joinNum = joinNum; |
||||
_startTime = startTime; |
||||
_endTime = endTime; |
||||
_state = state; |
||||
_isDelete = isDelete; |
||||
} |
||||
|
||||
ActRecord.fromJson(dynamic json) { |
||||
_id = json['id']; |
||||
_createTime = json['createTime']; |
||||
_createUser = json['createUser']; |
||||
_updateTime = json['updateTime']; |
||||
_updateUser = json['updateUser']; |
||||
_storeId = json['storeId']; |
||||
_type = json['type']; |
||||
_actTemplateId = json['actTemplateId']; |
||||
_actTimeId = json['actTimeId']; |
||||
_actProductId = json['actProductId']; |
||||
_mid = json['mid']; |
||||
_isDirectBuy = json['isDirectBuy']; |
||||
_joinNum = json['joinNum']; |
||||
_startTime = json['startTime']; |
||||
_endTime = json['endTime']; |
||||
_state = json['state']; |
||||
_isDelete = json['isDelete']; |
||||
} |
||||
String _id; |
||||
String _createTime; |
||||
String _createUser; |
||||
String _updateTime; |
||||
String _updateUser; |
||||
String _storeId; |
||||
int _type; |
||||
String _actTemplateId; |
||||
String _actTimeId; |
||||
String _actProductId; |
||||
String _mid; |
||||
bool _isDirectBuy; |
||||
int _joinNum; |
||||
String _startTime; |
||||
String _endTime; |
||||
int _state; |
||||
int _isDelete; |
||||
|
||||
String get id => _id; |
||||
String get createTime => _createTime; |
||||
String get createUser => _createUser; |
||||
String get updateTime => _updateTime; |
||||
String get updateUser => _updateUser; |
||||
String get storeId => _storeId; |
||||
int get type => _type; |
||||
String get actTemplateId => _actTemplateId; |
||||
String get actTimeId => _actTimeId; |
||||
String get actProductId => _actProductId; |
||||
String get mid => _mid; |
||||
bool get isDirectBuy => _isDirectBuy; |
||||
int get joinNum => _joinNum; |
||||
String get startTime => _startTime; |
||||
String get endTime => _endTime; |
||||
int get state => _state; |
||||
int get isDelete => _isDelete; |
||||
|
||||
Map<String, dynamic> toJson() { |
||||
final map = <String, dynamic>{}; |
||||
map['id'] = _id; |
||||
map['createTime'] = _createTime; |
||||
map['createUser'] = _createUser; |
||||
map['updateTime'] = _updateTime; |
||||
map['updateUser'] = _updateUser; |
||||
map['storeId'] = _storeId; |
||||
map['type'] = _type; |
||||
map['actTemplateId'] = _actTemplateId; |
||||
map['actTimeId'] = _actTimeId; |
||||
map['actProductId'] = _actProductId; |
||||
map['mid'] = _mid; |
||||
map['isDirectBuy'] = _isDirectBuy; |
||||
map['joinNum'] = _joinNum; |
||||
map['startTime'] = _startTime; |
||||
map['endTime'] = _endTime; |
||||
map['state'] = _state; |
||||
map['isDelete'] = _isDelete; |
||||
return map; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,657 @@
|
||||
/// actProduct : {"id":"1479377402042777600","createTime":"2022-01-07 17:00:33","createUser":"1364043181062094848","updateTime":"2022-01-07 17:00:33","updateUser":"1364043181062094848","storeId":"1460885296764682240","templateId":"1479377328797646848","timeId":"1479377329099636736","productId":"1460886580993458176","productName":"无花果礼盒","productImg":"https://pos.upload.gznl.top/1179/2021/11/e50b00a1-09a2-4bab-b71f-e26e80006459.png","productPrice":"88.00","promotionPrice":"88.00","productStock":0,"sellCount":0,"skuJson":[{"skuId":"1460886581089927168","skuPrice":88,"skuStock":0}],"isDelete":0} |
||||
/// actRecordAndJoinlDTOList : [{"actRecord":{"id":"1479399513473941504","createTime":"2022-01-07 18:28:25","createUser":"1478548720785031168","updateTime":"2022-01-07 18:28:25","updateUser":"1478548720785031168","storeId":"1460885296764682240","type":1,"actTemplateId":"1479377328797646848","actTimeId":"1479377329099636736","actProductId":"1479377402042777600","mid":"1478548720785031168","joinNum":0,"startTime":"2022-01-07 18:28:25","endTime":"2022-01-08 16:28:25","state":2,"isDelete":0},"actRecordJoinList":[{"id":"1479399514073726976","createTime":"2022-01-07 18:28:25","createUser":"1478548720785031168","updateTime":"2022-01-07 18:28:25","updateUser":"1478548720785031168","storeId":"1460885296764682240","actTemplateId":"1479377328797646848","actTimeId":"1479377329099636736","actRecordId":"1479399513473941504","mid":"1478548720785031168","orderId":"1479399514677706752","isLeader":true,"memberAvatar":"","memberNickname":"斯基","productId":"1479377402042777600","actPrice":"88.00","state":false,"isDelete":0}]},{"actRecord":{"id":"1479401111025614848","createTime":"2022-01-07 18:34:45","createUser":"1468903135782109184","updateTime":"2022-01-07 18:34:45","updateUser":"1468903135782109184","storeId":"1460885296764682240","type":1,"actTemplateId":"1479377328797646848","actTimeId":"1479377329099636736","actProductId":"1479377402042777600","mid":"1468903135782109184","joinNum":0,"startTime":"2022-01-07 18:34:45","endTime":"2022-01-08 16:34:45","state":2,"isDelete":0},"actRecordJoinList":[{"id":"1479401111688314880","createTime":"2022-01-07 18:34:46","createUser":"1468903135782109184","updateTime":"2022-01-07 18:34:46","updateUser":"1468903135782109184","storeId":"1460885296764682240","actTemplateId":"1479377328797646848","actTimeId":"1479377329099636736","actRecordId":"1479401111025614848","mid":"1468903135782109184","orderId":"1479401112292294656","isLeader":true,"memberAvatar":"https://pos.upload.gznl.top/admin/2021/08/1f8d55ed-85d2-42a2-b155-6737a66226e8.jpg","memberNickname":"哈哈哈","productId":"1479377402042777600","actPrice":"88.00","state":false,"isDelete":0}]}] |
||||
|
||||
class ActivityDetails { |
||||
ActivityDetails({ |
||||
String endTime, |
||||
ActProduct actProduct, |
||||
List<ActRecordAndJoinlDTOList> actRecordAndJoinlDTOList, |
||||
}) { |
||||
_endTime = endTime; |
||||
_actProduct = actProduct; |
||||
_actRecordAndJoinlDTOList = actRecordAndJoinlDTOList; |
||||
} |
||||
|
||||
ActivityDetails.fromJson(dynamic json) { |
||||
_endTime = json['endTime']; |
||||
_actProduct = json['actProduct'] != null |
||||
? ActProduct.fromJson(json['actProduct']) |
||||
: null; |
||||
if (json['actRecordAndJoinlDTOList'] != null) { |
||||
_actRecordAndJoinlDTOList = []; |
||||
json['actRecordAndJoinlDTOList'].forEach((v) { |
||||
_actRecordAndJoinlDTOList.add(ActRecordAndJoinlDTOList.fromJson(v)); |
||||
}); |
||||
} |
||||
} |
||||
|
||||
String _endTime; |
||||
ActProduct _actProduct; |
||||
List<ActRecordAndJoinlDTOList> _actRecordAndJoinlDTOList; |
||||
|
||||
String get endTime => _endTime; |
||||
|
||||
ActProduct get actProduct => _actProduct; |
||||
|
||||
List<ActRecordAndJoinlDTOList> get actRecordAndJoinlDTOList => |
||||
_actRecordAndJoinlDTOList; |
||||
|
||||
Map<String, dynamic> toJson() { |
||||
final map = <String, dynamic>{}; |
||||
map['endTime'] = _endTime; |
||||
|
||||
if (_actProduct != null) { |
||||
map['actProduct'] = _actProduct.toJson(); |
||||
} |
||||
if (_actRecordAndJoinlDTOList != null) { |
||||
map['actRecordAndJoinlDTOList'] = |
||||
_actRecordAndJoinlDTOList.map((v) => v.toJson()).toList(); |
||||
} |
||||
return map; |
||||
} |
||||
} |
||||
|
||||
/// actRecord : {"id":"1479399513473941504","createTime":"2022-01-07 18:28:25","createUser":"1478548720785031168","updateTime":"2022-01-07 18:28:25","updateUser":"1478548720785031168","storeId":"1460885296764682240","type":1,"actTemplateId":"1479377328797646848","actTimeId":"1479377329099636736","actProductId":"1479377402042777600","mid":"1478548720785031168","joinNum":0,"startTime":"2022-01-07 18:28:25","endTime":"2022-01-08 16:28:25","state":2,"isDelete":0} |
||||
/// actRecordJoinList : [{"id":"1479399514073726976","createTime":"2022-01-07 18:28:25","createUser":"1478548720785031168","updateTime":"2022-01-07 18:28:25","updateUser":"1478548720785031168","storeId":"1460885296764682240","actTemplateId":"1479377328797646848","actTimeId":"1479377329099636736","actRecordId":"1479399513473941504","mid":"1478548720785031168","orderId":"1479399514677706752","isLeader":true,"memberAvatar":"","memberNickname":"斯基","productId":"1479377402042777600","actPrice":"88.00","state":false,"isDelete":0}] |
||||
|
||||
class ActRecordAndJoinlDTOList { |
||||
ActRecordAndJoinlDTOList({ |
||||
ActRecord actRecord, |
||||
List<ActRecordJoinList> actRecordJoinList, |
||||
}) { |
||||
_actRecord = actRecord; |
||||
_actRecordJoinList = actRecordJoinList; |
||||
} |
||||
|
||||
ActRecordAndJoinlDTOList.fromJson(dynamic json) { |
||||
_actRecord = json['actRecord'] != null |
||||
? ActRecord.fromJson(json['actRecord']) |
||||
: null; |
||||
if (json['actRecordJoinList'] != null) { |
||||
_actRecordJoinList = []; |
||||
json['actRecordJoinList'].forEach((v) { |
||||
_actRecordJoinList.add(ActRecordJoinList.fromJson(v)); |
||||
}); |
||||
} |
||||
} |
||||
|
||||
ActRecord _actRecord; |
||||
List<ActRecordJoinList> _actRecordJoinList; |
||||
|
||||
ActRecord get actRecord => _actRecord; |
||||
|
||||
List<ActRecordJoinList> get actRecordJoinList => _actRecordJoinList; |
||||
|
||||
Map<String, dynamic> toJson() { |
||||
final map = <String, dynamic>{}; |
||||
if (_actRecord != null) { |
||||
map['actRecord'] = _actRecord.toJson(); |
||||
} |
||||
if (_actRecordJoinList != null) { |
||||
map['actRecordJoinList'] = |
||||
_actRecordJoinList.map((v) => v.toJson()).toList(); |
||||
} |
||||
return map; |
||||
} |
||||
} |
||||
|
||||
/// id : "1479399514073726976" |
||||
/// createTime : "2022-01-07 18:28:25" |
||||
/// createUser : "1478548720785031168" |
||||
/// updateTime : "2022-01-07 18:28:25" |
||||
/// updateUser : "1478548720785031168" |
||||
/// storeId : "1460885296764682240" |
||||
/// actTemplateId : "1479377328797646848" |
||||
/// actTimeId : "1479377329099636736" |
||||
/// actRecordId : "1479399513473941504" |
||||
/// mid : "1478548720785031168" |
||||
/// orderId : "1479399514677706752" |
||||
/// isLeader : true |
||||
/// memberAvatar : "" |
||||
/// memberNickname : "斯基" |
||||
/// productId : "1479377402042777600" |
||||
/// actPrice : "88.00" |
||||
/// state : false |
||||
/// isDelete : 0 |
||||
|
||||
class ActRecordJoinList { |
||||
ActRecordJoinList({ |
||||
String id, |
||||
String createTime, |
||||
String createUser, |
||||
String updateTime, |
||||
String updateUser, |
||||
String storeId, |
||||
String actTemplateId, |
||||
String actTimeId, |
||||
String actRecordId, |
||||
String mid, |
||||
String orderId, |
||||
bool isLeader, |
||||
String memberAvatar, |
||||
String memberNickname, |
||||
String productId, |
||||
String actPrice, |
||||
bool state, |
||||
int isDelete, |
||||
}) { |
||||
_id = id; |
||||
_createTime = createTime; |
||||
_createUser = createUser; |
||||
_updateTime = updateTime; |
||||
_updateUser = updateUser; |
||||
_storeId = storeId; |
||||
_actTemplateId = actTemplateId; |
||||
_actTimeId = actTimeId; |
||||
_actRecordId = actRecordId; |
||||
_mid = mid; |
||||
_orderId = orderId; |
||||
_isLeader = isLeader; |
||||
_memberAvatar = memberAvatar; |
||||
_memberNickname = memberNickname; |
||||
_productId = productId; |
||||
_actPrice = actPrice; |
||||
_state = state; |
||||
_isDelete = isDelete; |
||||
} |
||||
|
||||
ActRecordJoinList.fromJson(dynamic json) { |
||||
_id = json['id']; |
||||
_createTime = json['createTime']; |
||||
_createUser = json['createUser']; |
||||
_updateTime = json['updateTime']; |
||||
_updateUser = json['updateUser']; |
||||
_storeId = json['storeId']; |
||||
_actTemplateId = json['actTemplateId']; |
||||
_actTimeId = json['actTimeId']; |
||||
_actRecordId = json['actRecordId']; |
||||
_mid = json['mid']; |
||||
_orderId = json['orderId']; |
||||
_isLeader = json['isLeader']; |
||||
_memberAvatar = json['memberAvatar']; |
||||
_memberNickname = json['memberNickname']; |
||||
_productId = json['productId']; |
||||
_actPrice = json['actPrice']; |
||||
_state = json['state']; |
||||
_isDelete = json['isDelete']; |
||||
} |
||||
|
||||
String _id; |
||||
String _createTime; |
||||
String _createUser; |
||||
String _updateTime; |
||||
String _updateUser; |
||||
String _storeId; |
||||
String _actTemplateId; |
||||
String _actTimeId; |
||||
String _actRecordId; |
||||
String _mid; |
||||
String _orderId; |
||||
bool _isLeader; |
||||
String _memberAvatar; |
||||
String _memberNickname; |
||||
String _productId; |
||||
String _actPrice; |
||||
bool _state; |
||||
int _isDelete; |
||||
|
||||
String get id => _id; |
||||
|
||||
String get createTime => _createTime; |
||||
|
||||
String get createUser => _createUser; |
||||
|
||||
String get updateTime => _updateTime; |
||||
|
||||
String get updateUser => _updateUser; |
||||
|
||||
String get storeId => _storeId; |
||||
|
||||
String get actTemplateId => _actTemplateId; |
||||
|
||||
String get actTimeId => _actTimeId; |
||||
|
||||
String get actRecordId => _actRecordId; |
||||
|
||||
String get mid => _mid; |
||||
|
||||
String get orderId => _orderId; |
||||
|
||||
bool get isLeader => _isLeader; |
||||
|
||||
String get memberAvatar => _memberAvatar; |
||||
|
||||
String get memberNickname => _memberNickname; |
||||
|
||||
String get productId => _productId; |
||||
|
||||
String get actPrice => _actPrice; |
||||
|
||||
bool get state => _state; |
||||
|
||||
int get isDelete => _isDelete; |
||||
|
||||
Map<String, dynamic> toJson() { |
||||
final map = <String, dynamic>{}; |
||||
map['id'] = _id; |
||||
map['createTime'] = _createTime; |
||||
map['createUser'] = _createUser; |
||||
map['updateTime'] = _updateTime; |
||||
map['updateUser'] = _updateUser; |
||||
map['storeId'] = _storeId; |
||||
map['actTemplateId'] = _actTemplateId; |
||||
map['actTimeId'] = _actTimeId; |
||||
map['actRecordId'] = _actRecordId; |
||||
map['mid'] = _mid; |
||||
map['orderId'] = _orderId; |
||||
map['isLeader'] = _isLeader; |
||||
map['memberAvatar'] = _memberAvatar; |
||||
map['memberNickname'] = _memberNickname; |
||||
map['productId'] = _productId; |
||||
map['actPrice'] = _actPrice; |
||||
map['state'] = _state; |
||||
map['isDelete'] = _isDelete; |
||||
return map; |
||||
} |
||||
} |
||||
|
||||
/// id : "1479399513473941504" |
||||
/// createTime : "2022-01-07 18:28:25" |
||||
/// createUser : "1478548720785031168" |
||||
/// updateTime : "2022-01-07 18:28:25" |
||||
/// updateUser : "1478548720785031168" |
||||
/// storeId : "1460885296764682240" |
||||
/// type : 1 |
||||
/// actTemplateId : "1479377328797646848" |
||||
/// actTimeId : "1479377329099636736" |
||||
/// actProductId : "1479377402042777600" |
||||
/// mid : "1478548720785031168" |
||||
/// joinNum : 0 |
||||
/// startTime : "2022-01-07 18:28:25" |
||||
/// endTime : "2022-01-08 16:28:25" |
||||
/// state : 2 |
||||
/// isDelete : 0 |
||||
|
||||
class ActRecord { |
||||
ActRecord({ |
||||
String id, |
||||
String createTime, |
||||
String createUser, |
||||
String updateTime, |
||||
String updateUser, |
||||
String storeId, |
||||
int type, |
||||
String actTemplateId, |
||||
String actTimeId, |
||||
String actProductId, |
||||
String mid, |
||||
int joinNum, |
||||
String startTime, |
||||
String endTime, |
||||
int state, |
||||
int isDelete, |
||||
}) { |
||||
_id = id; |
||||
_createTime = createTime; |
||||
_createUser = createUser; |
||||
_updateTime = updateTime; |
||||
_updateUser = updateUser; |
||||
_storeId = storeId; |
||||
_type = type; |
||||
_actTemplateId = actTemplateId; |
||||
_actTimeId = actTimeId; |
||||
_actProductId = actProductId; |
||||
_mid = mid; |
||||
_joinNum = joinNum; |
||||
_startTime = startTime; |
||||
_endTime = endTime; |
||||
_state = state; |
||||
_isDelete = isDelete; |
||||
} |
||||
|
||||
ActRecord.fromJson(dynamic json) { |
||||
_id = json['id']; |
||||
_createTime = json['createTime']; |
||||
_createUser = json['createUser']; |
||||
_updateTime = json['updateTime']; |
||||
_updateUser = json['updateUser']; |
||||
_storeId = json['storeId']; |
||||
_type = json['type']; |
||||
_actTemplateId = json['actTemplateId']; |
||||
_actTimeId = json['actTimeId']; |
||||
_actProductId = json['actProductId']; |
||||
_mid = json['mid']; |
||||
_joinNum = json['joinNum']; |
||||
_startTime = json['startTime']; |
||||
_endTime = json['endTime']; |
||||
_state = json['state']; |
||||
_isDelete = json['isDelete']; |
||||
} |
||||
|
||||
String _id; |
||||
String _createTime; |
||||
String _createUser; |
||||
String _updateTime; |
||||
String _updateUser; |
||||
String _storeId; |
||||
int _type; |
||||
String _actTemplateId; |
||||
String _actTimeId; |
||||
String _actProductId; |
||||
String _mid; |
||||
int _joinNum; |
||||
String _startTime; |
||||
String _endTime; |
||||
int _state; |
||||
int _isDelete; |
||||
int _tempDay; |
||||
int _tempHour; |
||||
int _tempM; |
||||
int _tempS; |
||||
|
||||
|
||||
int get tempDay => _tempDay; |
||||
|
||||
set tempDay(int value) { |
||||
_tempDay = value; |
||||
} |
||||
|
||||
String get id => _id; |
||||
|
||||
String get createTime => _createTime; |
||||
|
||||
String get createUser => _createUser; |
||||
|
||||
String get updateTime => _updateTime; |
||||
|
||||
String get updateUser => _updateUser; |
||||
|
||||
String get storeId => _storeId; |
||||
|
||||
int get type => _type; |
||||
|
||||
String get actTemplateId => _actTemplateId; |
||||
|
||||
String get actTimeId => _actTimeId; |
||||
|
||||
String get actProductId => _actProductId; |
||||
|
||||
String get mid => _mid; |
||||
|
||||
int get joinNum => _joinNum; |
||||
|
||||
String get startTime => _startTime; |
||||
|
||||
String get endTime => _endTime; |
||||
|
||||
int get state => _state; |
||||
|
||||
int get isDelete => _isDelete; |
||||
|
||||
Map<String, dynamic> toJson() { |
||||
final map = <String, dynamic>{}; |
||||
map['id'] = _id; |
||||
map['createTime'] = _createTime; |
||||
map['createUser'] = _createUser; |
||||
map['updateTime'] = _updateTime; |
||||
map['updateUser'] = _updateUser; |
||||
map['storeId'] = _storeId; |
||||
map['type'] = _type; |
||||
map['actTemplateId'] = _actTemplateId; |
||||
map['actTimeId'] = _actTimeId; |
||||
map['actProductId'] = _actProductId; |
||||
map['mid'] = _mid; |
||||
map['joinNum'] = _joinNum; |
||||
map['startTime'] = _startTime; |
||||
map['endTime'] = _endTime; |
||||
map['state'] = _state; |
||||
map['isDelete'] = _isDelete; |
||||
return map; |
||||
} |
||||
|
||||
int get tempHour => _tempHour; |
||||
|
||||
set tempHour(int value) { |
||||
_tempHour = value; |
||||
} |
||||
|
||||
int get tempM => _tempM; |
||||
|
||||
set tempM(int value) { |
||||
_tempM = value; |
||||
} |
||||
|
||||
int get tempS => _tempS; |
||||
|
||||
set tempS(int value) { |
||||
_tempS = value; |
||||
} |
||||
|
||||
} |
||||
|
||||
/// id : "1479377402042777600" |
||||
/// createTime : "2022-01-07 17:00:33" |
||||
/// createUser : "1364043181062094848" |
||||
/// updateTime : "2022-01-07 17:00:33" |
||||
/// updateUser : "1364043181062094848" |
||||
/// storeId : "1460885296764682240" |
||||
/// templateId : "1479377328797646848" |
||||
/// timeId : "1479377329099636736" |
||||
/// productId : "1460886580993458176" |
||||
/// productName : "无花果礼盒" |
||||
/// productImg : "https://pos.upload.gznl.top/1179/2021/11/e50b00a1-09a2-4bab-b71f-e26e80006459.png" |
||||
/// productPrice : "88.00" |
||||
/// promotionPrice : "88.00" |
||||
/// productStock : 0 |
||||
/// sellCount : 0 |
||||
/// skuJson : [{"skuId":"1460886581089927168","skuPrice":88,"skuStock":0}] |
||||
/// isDelete : 0 |
||||
|
||||
class ActProduct { |
||||
ActProduct({ |
||||
String id, |
||||
String createTime, |
||||
String createUser, |
||||
String updateTime, |
||||
String updateUser, |
||||
String storeId, |
||||
String templateId, |
||||
String timeId, |
||||
String productId, |
||||
String productName, |
||||
String productImg, |
||||
String productPrice, |
||||
String promotionPrice, |
||||
int productStock, |
||||
int sellCount, |
||||
List<SkuJson> skuJson, |
||||
int isDelete, |
||||
String shortName, |
||||
String supplierName, |
||||
String detail, |
||||
String rightImg, |
||||
}) { |
||||
_id = id; |
||||
_createTime = createTime; |
||||
_createUser = createUser; |
||||
_updateTime = updateTime; |
||||
_updateUser = updateUser; |
||||
_storeId = storeId; |
||||
_templateId = templateId; |
||||
_timeId = timeId; |
||||
_productId = productId; |
||||
_productName = productName; |
||||
_productImg = productImg; |
||||
_productPrice = productPrice; |
||||
_promotionPrice = promotionPrice; |
||||
_productStock = productStock; |
||||
_sellCount = sellCount; |
||||
_skuJson = skuJson; |
||||
_isDelete = isDelete; |
||||
_shortName = shortName; |
||||
_supplierName =supplierName; |
||||
_detail = detail; |
||||
_rightImg = rightImg; |
||||
} |
||||
|
||||
ActProduct.fromJson(dynamic json) { |
||||
_id = json['id']; |
||||
_createTime = json['createTime']; |
||||
_createUser = json['createUser']; |
||||
_updateTime = json['updateTime']; |
||||
_updateUser = json['updateUser']; |
||||
_storeId = json['storeId']; |
||||
_templateId = json['templateId']; |
||||
_timeId = json['timeId']; |
||||
_productId = json['productId']; |
||||
_productName = json['productName']; |
||||
_productImg = json['productImg']; |
||||
_productPrice = json['productPrice']; |
||||
_promotionPrice = json['promotionPrice']; |
||||
_productStock = json['productStock']; |
||||
_sellCount = json['sellCount']; |
||||
if (json['skuJson'] != null) { |
||||
_skuJson = []; |
||||
json['skuJson'].forEach((v) { |
||||
_skuJson.add(SkuJson.fromJson(v)); |
||||
}); |
||||
} |
||||
_isDelete = json['isDelete']; |
||||
_shortName = json['shortName']; |
||||
_supplierName = json['supplierName']; |
||||
_detail = json['detail']; |
||||
_rightImg = json['rightImg']; |
||||
} |
||||
|
||||
String _id; |
||||
String _createTime; |
||||
String _createUser; |
||||
String _updateTime; |
||||
String _updateUser; |
||||
String _storeId; |
||||
String _templateId; |
||||
String _timeId; |
||||
String _productId; |
||||
String _productName; |
||||
String _productImg; |
||||
String _productPrice; |
||||
String _promotionPrice; |
||||
int _productStock; |
||||
int _sellCount; |
||||
List<SkuJson> _skuJson; |
||||
int _isDelete; |
||||
String _shortName; |
||||
String _supplierName; |
||||
String _detail; |
||||
String _rightImg; |
||||
|
||||
String get id => _id; |
||||
|
||||
String get createTime => _createTime; |
||||
|
||||
String get createUser => _createUser; |
||||
|
||||
String get updateTime => _updateTime; |
||||
|
||||
String get updateUser => _updateUser; |
||||
|
||||
String get storeId => _storeId; |
||||
|
||||
String get templateId => _templateId; |
||||
|
||||
String get timeId => _timeId; |
||||
|
||||
String get productId => _productId; |
||||
|
||||
String get productName => _productName; |
||||
|
||||
String get productImg => _productImg; |
||||
|
||||
String get productPrice => _productPrice; |
||||
|
||||
String get promotionPrice => _promotionPrice; |
||||
|
||||
int get productStock => _productStock; |
||||
|
||||
int get sellCount => _sellCount; |
||||
|
||||
List<SkuJson> get skuJson => _skuJson; |
||||
|
||||
int get isDelete => _isDelete; |
||||
|
||||
String get shortName => _shortName; |
||||
|
||||
String get supplierName => _supplierName; |
||||
|
||||
String get detail => _detail; |
||||
|
||||
String get rightImg => _rightImg; |
||||
|
||||
Map<String, dynamic> toJson() { |
||||
final map = <String, dynamic>{}; |
||||
map['id'] = _id; |
||||
map['createTime'] = _createTime; |
||||
map['createUser'] = _createUser; |
||||
map['updateTime'] = _updateTime; |
||||
map['updateUser'] = _updateUser; |
||||
map['storeId'] = _storeId; |
||||
map['templateId'] = _templateId; |
||||
map['timeId'] = _timeId; |
||||
map['productId'] = _productId; |
||||
map['productName'] = _productName; |
||||
map['productImg'] = _productImg; |
||||
map['productPrice'] = _productPrice; |
||||
map['promotionPrice'] = _promotionPrice; |
||||
map['productStock'] = _productStock; |
||||
map['sellCount'] = _sellCount; |
||||
if (_skuJson != null) { |
||||
map['skuJson'] = _skuJson.map((v) => v.toJson()).toList(); |
||||
} |
||||
map['isDelete'] = _isDelete; |
||||
map['shortName'] = _shortName; |
||||
map['supplierName'] = _supplierName; |
||||
map['detail'] = _detail; |
||||
map['rightImg'] = _rightImg; |
||||
return map; |
||||
} |
||||
} |
||||
|
||||
/// skuId : "1460886581089927168" |
||||
/// skuPrice : 88 |
||||
/// skuStock : 0 |
||||
|
||||
class SkuJson { |
||||
SkuJson({ |
||||
String skuId, |
||||
String skuPrice, |
||||
int skuStock, |
||||
}) { |
||||
_skuId = skuId; |
||||
_skuPrice = skuPrice; |
||||
_skuStock = skuStock; |
||||
} |
||||
|
||||
SkuJson.fromJson(dynamic json) { |
||||
_skuId = json['skuId']; |
||||
_skuPrice = json['skuPrice']; |
||||
_skuStock = json['skuStock']; |
||||
} |
||||
|
||||
String _skuId; |
||||
String _skuPrice; |
||||
int _skuStock; |
||||
|
||||
String get skuId => _skuId; |
||||
|
||||
String get skuPrice => _skuPrice; |
||||
|
||||
int get skuStock => _skuStock; |
||||
|
||||
Map<String, dynamic> toJson() { |
||||
final map = <String, dynamic>{}; |
||||
map['skuId'] = _skuId; |
||||
map['skuPrice'] = _skuPrice; |
||||
map['skuStock'] = _skuStock; |
||||
return map; |
||||
} |
||||
} |
@ -0,0 +1,111 @@
|
||||
/// storeName : "一心回乡商城" |
||||
/// joinTime : "2022-01-07 18:28:25" |
||||
/// productImg : "https://pos.upload.gznl.top/1179/2021/11/e50b00a1-09a2-4bab-b71f-e26e80006459.png" |
||||
/// productName : "无花果礼盒" |
||||
/// productSkuName : "" |
||||
/// actRecordId : "1479399513473941504" |
||||
/// actRecordState : 4 |
||||
/// actRecordJoinState : false |
||||
/// howManyMore : 2 |
||||
/// orderSum : null |
||||
/// bargainMoney : null |
||||
/// howManyMoney : null |
||||
|
||||
class ActivityOrderList { |
||||
ActivityOrderList({ |
||||
String storeName, |
||||
String storeId, |
||||
String joinTime, |
||||
String productImg, |
||||
String productName, |
||||
String productSkuName, |
||||
String actRecordId, |
||||
int actRecordState, |
||||
bool actRecordJoinState, |
||||
int howManyMore, |
||||
int successNumber, |
||||
dynamic orderSum, |
||||
dynamic bargainMoney, |
||||
dynamic howManyMoney,}){ |
||||
_storeName = storeName; |
||||
_storeId = storeId; |
||||
_joinTime = joinTime; |
||||
_productImg = productImg; |
||||
_productName = productName; |
||||
_productSkuName = productSkuName; |
||||
_actRecordId = actRecordId; |
||||
_actRecordState = actRecordState; |
||||
_actRecordJoinState = actRecordJoinState; |
||||
_howManyMore = howManyMore; |
||||
_successNumber = successNumber; |
||||
_orderSum = orderSum; |
||||
_bargainMoney = bargainMoney; |
||||
_howManyMoney = howManyMoney; |
||||
} |
||||
|
||||
ActivityOrderList.fromJson(dynamic json) { |
||||
_storeName = json['storeName']; |
||||
_storeId = json['storeId']; |
||||
_joinTime = json['joinTime']; |
||||
_productImg = json['productImg']; |
||||
_productName = json['productName']; |
||||
_productSkuName = json['productSkuName']; |
||||
_actRecordId = json['actRecordId']; |
||||
_actRecordState = json['actRecordState']; |
||||
_actRecordJoinState = json['actRecordJoinState']; |
||||
_howManyMore = json['howManyMore']; |
||||
_successNumber = json['successNumber']; |
||||
_orderSum = json['orderSum']; |
||||
_bargainMoney = json['bargainMoney']; |
||||
_howManyMoney = json['howManyMoney']; |
||||
} |
||||
String _storeName; |
||||
String _storeId; |
||||
String _joinTime; |
||||
String _productImg; |
||||
String _productName; |
||||
String _productSkuName; |
||||
String _actRecordId; |
||||
int _actRecordState; |
||||
bool _actRecordJoinState; |
||||
int _howManyMore; |
||||
int _successNumber; |
||||
dynamic _orderSum; |
||||
dynamic _bargainMoney; |
||||
dynamic _howManyMoney; |
||||
|
||||
String get storeName => _storeName; |
||||
String get storeId => _storeId; |
||||
String get joinTime => _joinTime; |
||||
String get productImg => _productImg; |
||||
String get productName => _productName; |
||||
String get productSkuName => _productSkuName; |
||||
String get actRecordId => _actRecordId; |
||||
int get actRecordState => _actRecordState; |
||||
bool get actRecordJoinState => _actRecordJoinState; |
||||
int get howManyMore => _howManyMore; |
||||
int get successNumber => _successNumber; |
||||
dynamic get orderSum => _orderSum; |
||||
dynamic get bargainMoney => _bargainMoney; |
||||
dynamic get howManyMoney => _howManyMoney; |
||||
|
||||
Map<String, dynamic> toJson() { |
||||
final map = <String, dynamic>{}; |
||||
map['storeName'] = _storeName; |
||||
map['storeId'] = _storeId; |
||||
map['joinTime'] = _joinTime; |
||||
map['productImg'] = _productImg; |
||||
map['productName'] = _productName; |
||||
map['productSkuName'] = _productSkuName; |
||||
map['actRecordId'] = _actRecordId; |
||||
map['actRecordState'] = _actRecordState; |
||||
map['actRecordJoinState'] = _actRecordJoinState; |
||||
map['howManyMore'] = _howManyMore; |
||||
map ['successNumber'] = _successNumber; |
||||
map['orderSum'] = _orderSum; |
||||
map['bargainMoney'] = _bargainMoney; |
||||
map['howManyMoney'] = _howManyMoney; |
||||
return map; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,416 @@
|
||||
/// id : "1473532263365869568" |
||||
/// createTime : "2021-12-22 13:54:03" |
||||
/// createUser : "1364043181062094848" |
||||
/// updateTime : "2021-12-22 13:54:03" |
||||
/// updateUser : "1364043181062094848" |
||||
/// supplierName : "测试" |
||||
/// storeId : "1364043181120815104" |
||||
/// categoryId : "1343391656220557312" |
||||
/// groupId : "1473531667711787008" |
||||
/// shortName : "可爱" |
||||
/// productName : "回乡牛公仔" |
||||
/// sellDesc : "" |
||||
/// productCode : "PRO202112221354030000000000004" |
||||
/// weight : "0" |
||||
/// applyPrice : "0.00" |
||||
/// price : "49.00" |
||||
/// stock : 0 |
||||
/// sellCount : 0 |
||||
/// needLogistics : 1 |
||||
/// oversold : 1 |
||||
/// organic : 0 |
||||
/// status : 1 |
||||
/// posShow : true |
||||
/// productType : 0 |
||||
/// productNumber : 1 |
||||
/// setMeal : 1 |
||||
/// attrStyle : 0 |
||||
/// detail : "" |
||||
/// isDelete : 0 |
||||
/// printerFlag : "DEFAULT" |
||||
/// materialId : null |
||||
/// imgs : ["https://pos.upload.gznl.top/1179/2021/12/1bff0936-f2a2-401e-befd-e00b416763ad.png"] |
||||
/// productSkuList : [{"id":"1473532264519303168","createTime":"2021-12-22 13:54:03","createUser":"1364043181062094848","updateTime":"2021-12-22 13:54:03","updateUser":"1364043181062094848","storeId":"1364043181120815104","skuCode":"P202112221354035","skuNameStr":"","productId":"1473532263365869568","skuPrice":"49.00","applyPrice":"0.00","vipPrice":null,"skuImg":null,"skuStock":0,"sort":50,"setMeal":"","weight":0.0,"volume":0.0,"isDelete":0,"material":null,"version":0}] |
||||
|
||||
class HomeRecommendList { |
||||
HomeRecommendList({ |
||||
String id, |
||||
String createTime, |
||||
String createUser, |
||||
String updateTime, |
||||
String updateUser, |
||||
String supplierName, |
||||
String storeId, |
||||
String categoryId, |
||||
String groupId, |
||||
String shortName, |
||||
String productName, |
||||
String sellDesc, |
||||
String productCode, |
||||
String weight, |
||||
String applyPrice, |
||||
String price, |
||||
int stock, |
||||
int sellCount, |
||||
int needLogistics, |
||||
int oversold, |
||||
int organic, |
||||
int status, |
||||
bool posShow, |
||||
int productType, |
||||
int productNumber, |
||||
int setMeal, |
||||
int attrStyle, |
||||
String detail, |
||||
int isDelete, |
||||
String printerFlag, |
||||
dynamic materialId, |
||||
List<String> imgs, |
||||
List<ProductSkuList> productSkuList,}){ |
||||
_id = id; |
||||
_createTime = createTime; |
||||
_createUser = createUser; |
||||
_updateTime = updateTime; |
||||
_updateUser = updateUser; |
||||
_supplierName = supplierName; |
||||
_storeId = storeId; |
||||
_categoryId = categoryId; |
||||
_groupId = groupId; |
||||
_shortName = shortName; |
||||
_productName = productName; |
||||
_sellDesc = sellDesc; |
||||
_productCode = productCode; |
||||
_weight = weight; |
||||
_applyPrice = applyPrice; |
||||
_price = price; |
||||
_stock = stock; |
||||
_sellCount = sellCount; |
||||
_needLogistics = needLogistics; |
||||
_oversold = oversold; |
||||
_organic = organic; |
||||
_status = status; |
||||
_posShow = posShow; |
||||
_productType = productType; |
||||
_productNumber = productNumber; |
||||
_setMeal = setMeal; |
||||
_attrStyle = attrStyle; |
||||
_detail = detail; |
||||
_isDelete = isDelete; |
||||
_printerFlag = printerFlag; |
||||
_materialId = materialId; |
||||
_imgs = imgs; |
||||
_productSkuList = productSkuList; |
||||
} |
||||
|
||||
HomeRecommendList.fromJson(dynamic json) { |
||||
_id = json['id']; |
||||
_createTime = json['createTime']; |
||||
_createUser = json['createUser']; |
||||
_updateTime = json['updateTime']; |
||||
_updateUser = json['updateUser']; |
||||
_supplierName = json['supplierName']; |
||||
_storeId = json['storeId']; |
||||
_categoryId = json['categoryId']; |
||||
_groupId = json['groupId']; |
||||
_shortName = json['shortName']; |
||||
_productName = json['productName']; |
||||
_sellDesc = json['sellDesc']; |
||||
_productCode = json['productCode']; |
||||
_weight = json['weight']; |
||||
_applyPrice = json['applyPrice']; |
||||
_price = json['price']; |
||||
_stock = json['stock']; |
||||
_sellCount = json['sellCount']; |
||||
_needLogistics = json['needLogistics']; |
||||
_oversold = json['oversold']; |
||||
_organic = json['organic']; |
||||
_status = json['status']; |
||||
_posShow = json['posShow']; |
||||
_productType = json['productType']; |
||||
_productNumber = json['productNumber']; |
||||
_setMeal = json['setMeal']; |
||||
_attrStyle = json['attrStyle']; |
||||
_detail = json['detail']; |
||||
_isDelete = json['isDelete']; |
||||
_printerFlag = json['printerFlag']; |
||||
_materialId = json['materialId']; |
||||
_imgs = json['imgs'] != null ? json['imgs'].cast<String>() : []; |
||||
if (json['productSkuList'] != null) { |
||||
_productSkuList = []; |
||||
json['productSkuList'].forEach((v) { |
||||
_productSkuList.add(ProductSkuList.fromJson(v)); |
||||
}); |
||||
} |
||||
} |
||||
String _id; |
||||
String _createTime; |
||||
String _createUser; |
||||
String _updateTime; |
||||
String _updateUser; |
||||
String _supplierName; |
||||
String _storeId; |
||||
String _categoryId; |
||||
String _groupId; |
||||
String _shortName; |
||||
String _productName; |
||||
String _sellDesc; |
||||
String _productCode; |
||||
String _weight; |
||||
String _applyPrice; |
||||
String _price; |
||||
int _stock; |
||||
int _sellCount; |
||||
int _needLogistics; |
||||
int _oversold; |
||||
int _organic; |
||||
int _status; |
||||
bool _posShow; |
||||
int _productType; |
||||
int _productNumber; |
||||
int _setMeal; |
||||
int _attrStyle; |
||||
String _detail; |
||||
int _isDelete; |
||||
String _printerFlag; |
||||
dynamic _materialId; |
||||
List<String> _imgs; |
||||
List<ProductSkuList> _productSkuList; |
||||
|
||||
String get id => _id; |
||||
String get createTime => _createTime; |
||||
String get createUser => _createUser; |
||||
String get updateTime => _updateTime; |
||||
String get updateUser => _updateUser; |
||||
String get supplierName => _supplierName; |
||||
String get storeId => _storeId; |
||||
String get categoryId => _categoryId; |
||||
String get groupId => _groupId; |
||||
String get shortName => _shortName; |
||||
String get productName => _productName; |
||||
String get sellDesc => _sellDesc; |
||||
String get productCode => _productCode; |
||||
String get weight => _weight; |
||||
String get applyPrice => _applyPrice; |
||||
String get price => _price; |
||||
int get stock => _stock; |
||||
int get sellCount => _sellCount; |
||||
int get needLogistics => _needLogistics; |
||||
int get oversold => _oversold; |
||||
int get organic => _organic; |
||||
int get status => _status; |
||||
bool get posShow => _posShow; |
||||
int get productType => _productType; |
||||
int get productNumber => _productNumber; |
||||
int get setMeal => _setMeal; |
||||
int get attrStyle => _attrStyle; |
||||
String get detail => _detail; |
||||
int get isDelete => _isDelete; |
||||
String get printerFlag => _printerFlag; |
||||
dynamic get materialId => _materialId; |
||||
List<String> get imgs => _imgs; |
||||
List<ProductSkuList> get productSkuList => _productSkuList; |
||||
|
||||
Map<String, dynamic> toJson() { |
||||
final map = <String, dynamic>{}; |
||||
map['id'] = _id; |
||||
map['createTime'] = _createTime; |
||||
map['createUser'] = _createUser; |
||||
map['updateTime'] = _updateTime; |
||||
map['updateUser'] = _updateUser; |
||||
map['supplierName'] = _supplierName; |
||||
map['storeId'] = _storeId; |
||||
map['categoryId'] = _categoryId; |
||||
map['groupId'] = _groupId; |
||||
map['shortName'] = _shortName; |
||||
map['productName'] = _productName; |
||||
map['sellDesc'] = _sellDesc; |
||||
map['productCode'] = _productCode; |
||||
map['weight'] = _weight; |
||||
map['applyPrice'] = _applyPrice; |
||||
map['price'] = _price; |
||||
map['stock'] = _stock; |
||||
map['sellCount'] = _sellCount; |
||||
map['needLogistics'] = _needLogistics; |
||||
map['oversold'] = _oversold; |
||||
map['organic'] = _organic; |
||||
map['status'] = _status; |
||||
map['posShow'] = _posShow; |
||||
map['productType'] = _productType; |
||||
map['productNumber'] = _productNumber; |
||||
map['setMeal'] = _setMeal; |
||||
map['attrStyle'] = _attrStyle; |
||||
map['detail'] = _detail; |
||||
map['isDelete'] = _isDelete; |
||||
map['printerFlag'] = _printerFlag; |
||||
map['materialId'] = _materialId; |
||||
map['imgs'] = _imgs; |
||||
if (_productSkuList != null) { |
||||
map['productSkuList'] = _productSkuList.map((v) => v.toJson()).toList(); |
||||
} |
||||
return map; |
||||
} |
||||
|
||||
} |
||||
|
||||
/// id : "1473532264519303168" |
||||
/// createTime : "2021-12-22 13:54:03" |
||||
/// createUser : "1364043181062094848" |
||||
/// updateTime : "2021-12-22 13:54:03" |
||||
/// updateUser : "1364043181062094848" |
||||
/// storeId : "1364043181120815104" |
||||
/// skuCode : "P202112221354035" |
||||
/// skuNameStr : "" |
||||
/// productId : "1473532263365869568" |
||||
/// skuPrice : "49.00" |
||||
/// applyPrice : "0.00" |
||||
/// vipPrice : null |
||||
/// skuImg : null |
||||
/// skuStock : 0 |
||||
/// sort : 50 |
||||
/// setMeal : "" |
||||
/// weight : 0.0 |
||||
/// volume : 0.0 |
||||
/// isDelete : 0 |
||||
/// material : null |
||||
/// version : 0 |
||||
|
||||
class ProductSkuList { |
||||
ProductSkuList({ |
||||
String id, |
||||
String createTime, |
||||
String createUser, |
||||
String updateTime, |
||||
String updateUser, |
||||
String storeId, |
||||
String skuCode, |
||||
String skuNameStr, |
||||
String productId, |
||||
String skuPrice, |
||||
String applyPrice, |
||||
dynamic vipPrice, |
||||
dynamic skuImg, |
||||
int skuStock, |
||||
int sort, |
||||
String setMeal, |
||||
double weight, |
||||
double volume, |
||||
int isDelete, |
||||
dynamic material, |
||||
int version,}){ |
||||
_id = id; |
||||
_createTime = createTime; |
||||
_createUser = createUser; |
||||
_updateTime = updateTime; |
||||
_updateUser = updateUser; |
||||
_storeId = storeId; |
||||
_skuCode = skuCode; |
||||
_skuNameStr = skuNameStr; |
||||
_productId = productId; |
||||
_skuPrice = skuPrice; |
||||
_applyPrice = applyPrice; |
||||
_vipPrice = vipPrice; |
||||
_skuImg = skuImg; |
||||
_skuStock = skuStock; |
||||
_sort = sort; |
||||
_setMeal = setMeal; |
||||
_weight = weight; |
||||
_volume = volume; |
||||
_isDelete = isDelete; |
||||
_material = material; |
||||
_version = version; |
||||
} |
||||
|
||||
ProductSkuList.fromJson(dynamic json) { |
||||
_id = json['id']; |
||||
_createTime = json['createTime']; |
||||
_createUser = json['createUser']; |
||||
_updateTime = json['updateTime']; |
||||
_updateUser = json['updateUser']; |
||||
_storeId = json['storeId']; |
||||
_skuCode = json['skuCode']; |
||||
_skuNameStr = json['skuNameStr']; |
||||
_productId = json['productId']; |
||||
_skuPrice = json['skuPrice']; |
||||
_applyPrice = json['applyPrice']; |
||||
_vipPrice = json['vipPrice']; |
||||
_skuImg = json['skuImg']; |
||||
_skuStock = json['skuStock']; |
||||
_sort = json['sort']; |
||||
_setMeal = json['setMeal']; |
||||
_weight = json['weight']; |
||||
_volume = json['volume']; |
||||
_isDelete = json['isDelete']; |
||||
_material = json['material']; |
||||
_version = json['version']; |
||||
} |
||||
String _id; |
||||
String _createTime; |
||||
String _createUser; |
||||
String _updateTime; |
||||
String _updateUser; |
||||
String _storeId; |
||||
String _skuCode; |
||||
String _skuNameStr; |
||||
String _productId; |
||||
String _skuPrice; |
||||
String _applyPrice; |
||||
dynamic _vipPrice; |
||||
dynamic _skuImg; |
||||
int _skuStock; |
||||
int _sort; |
||||
String _setMeal; |
||||
double _weight; |
||||
double _volume; |
||||
int _isDelete; |
||||
dynamic _material; |
||||
int _version; |
||||
|
||||
String get id => _id; |
||||
String get createTime => _createTime; |
||||
String get createUser => _createUser; |
||||
String get updateTime => _updateTime; |
||||
String get updateUser => _updateUser; |
||||
String get storeId => _storeId; |
||||
String get skuCode => _skuCode; |
||||
String get skuNameStr => _skuNameStr; |
||||
String get productId => _productId; |
||||
String get skuPrice => _skuPrice; |
||||
String get applyPrice => _applyPrice; |
||||
dynamic get vipPrice => _vipPrice; |
||||
dynamic get skuImg => _skuImg; |
||||
int get skuStock => _skuStock; |
||||
int get sort => _sort; |
||||
String get setMeal => _setMeal; |
||||
double get weight => _weight; |
||||
double get volume => _volume; |
||||
int get isDelete => _isDelete; |
||||
dynamic get material => _material; |
||||
int get version => _version; |
||||
|
||||
Map<String, dynamic> toJson() { |
||||
final map = <String, dynamic>{}; |
||||
map['id'] = _id; |
||||
map['createTime'] = _createTime; |
||||
map['createUser'] = _createUser; |
||||
map['updateTime'] = _updateTime; |
||||
map['updateUser'] = _updateUser; |
||||
map['storeId'] = _storeId; |
||||
map['skuCode'] = _skuCode; |
||||
map['skuNameStr'] = _skuNameStr; |
||||
map['productId'] = _productId; |
||||
map['skuPrice'] = _skuPrice; |
||||
map['applyPrice'] = _applyPrice; |
||||
map['vipPrice'] = _vipPrice; |
||||
map['skuImg'] = _skuImg; |
||||
map['skuStock'] = _skuStock; |
||||
map['sort'] = _sort; |
||||
map['setMeal'] = _setMeal; |
||||
map['weight'] = _weight; |
||||
map['volume'] = _volume; |
||||
map['isDelete'] = _isDelete; |
||||
map['material'] = _material; |
||||
map['version'] = _version; |
||||
return map; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,148 @@
|
||||
/// id : "1491606527402835968" |
||||
/// createTime : "2022-02-10 10:54:43" |
||||
/// createUser : "1478548720785031168" |
||||
/// updateTime : "2022-02-10 10:54:43" |
||||
/// updateUser : "1478548720785031168" |
||||
/// storeId : "1460885296764682240" |
||||
/// type : 1 |
||||
/// actTemplateId : "1490571620652154880" |
||||
/// actTimeId : "1490571620887035904" |
||||
/// actRecordId : "1491606526735941632" |
||||
/// mid : "1478548720785031168" |
||||
/// orderId : "1491606528052953088" |
||||
/// isLeader : true |
||||
/// memberAvatar : "" |
||||
/// memberNickname : "斯基" |
||||
/// productId : "1490571670107193344" |
||||
/// actPrice : "60" |
||||
/// state : false |
||||
/// isDelete : null |
||||
|
||||
class LaunchJoinAct { |
||||
LaunchJoinAct({ |
||||
String id, |
||||
String createTime, |
||||
String createUser, |
||||
String updateTime, |
||||
String updateUser, |
||||
String storeId, |
||||
int type, |
||||
String actTemplateId, |
||||
String actTimeId, |
||||
String actRecordId, |
||||
String mid, |
||||
String orderId, |
||||
bool isLeader, |
||||
String memberAvatar, |
||||
String memberNickname, |
||||
String productId, |
||||
String actPrice, |
||||
bool state, |
||||
dynamic isDelete,}){ |
||||
_id = id; |
||||
_createTime = createTime; |
||||
_createUser = createUser; |
||||
_updateTime = updateTime; |
||||
_updateUser = updateUser; |
||||
_storeId = storeId; |
||||
_type = type; |
||||
_actTemplateId = actTemplateId; |
||||
_actTimeId = actTimeId; |
||||
_actRecordId = actRecordId; |
||||
_mid = mid; |
||||
_orderId = orderId; |
||||
_isLeader = isLeader; |
||||
_memberAvatar = memberAvatar; |
||||
_memberNickname = memberNickname; |
||||
_productId = productId; |
||||
_actPrice = actPrice; |
||||
_state = state; |
||||
_isDelete = isDelete; |
||||
} |
||||
|
||||
LaunchJoinAct.fromJson(dynamic json) { |
||||
_id = json['id']; |
||||
_createTime = json['createTime']; |
||||
_createUser = json['createUser']; |
||||
_updateTime = json['updateTime']; |
||||
_updateUser = json['updateUser']; |
||||
_storeId = json['storeId']; |
||||
_type = json['type']; |
||||
_actTemplateId = json['actTemplateId']; |
||||
_actTimeId = json['actTimeId']; |
||||
_actRecordId = json['actRecordId']; |
||||
_mid = json['mid']; |
||||
_orderId = json['orderId']; |
||||
_isLeader = json['isLeader']; |
||||
_memberAvatar = json['memberAvatar']; |
||||
_memberNickname = json['memberNickname']; |
||||
_productId = json['productId']; |
||||
_actPrice = json['actPrice']; |
||||
_state = json['state']; |
||||
_isDelete = json['isDelete']; |
||||
} |
||||
String _id; |
||||
String _createTime; |
||||
String _createUser; |
||||
String _updateTime; |
||||
String _updateUser; |
||||
String _storeId; |
||||
int _type; |
||||
String _actTemplateId; |
||||
String _actTimeId; |
||||
String _actRecordId; |
||||
String _mid; |
||||
String _orderId; |
||||
bool _isLeader; |
||||
String _memberAvatar; |
||||
String _memberNickname; |
||||
String _productId; |
||||
String _actPrice; |
||||
bool _state; |
||||
dynamic _isDelete; |
||||
|
||||
String get id => _id; |
||||
String get createTime => _createTime; |
||||
String get createUser => _createUser; |
||||
String get updateTime => _updateTime; |
||||
String get updateUser => _updateUser; |
||||
String get storeId => _storeId; |
||||
int get type => _type; |
||||
String get actTemplateId => _actTemplateId; |
||||
String get actTimeId => _actTimeId; |
||||
String get actRecordId => _actRecordId; |
||||
String get mid => _mid; |
||||
String get orderId => _orderId; |
||||
bool get isLeader => _isLeader; |
||||
String get memberAvatar => _memberAvatar; |
||||
String get memberNickname => _memberNickname; |
||||
String get productId => _productId; |
||||
String get actPrice => _actPrice; |
||||
bool get state => _state; |
||||
dynamic get isDelete => _isDelete; |
||||
|
||||
Map<String, dynamic> toJson() { |
||||
final map = <String, dynamic>{}; |
||||
map['id'] = _id; |
||||
map['createTime'] = _createTime; |
||||
map['createUser'] = _createUser; |
||||
map['updateTime'] = _updateTime; |
||||
map['updateUser'] = _updateUser; |
||||
map['storeId'] = _storeId; |
||||
map['type'] = _type; |
||||
map['actTemplateId'] = _actTemplateId; |
||||
map['actTimeId'] = _actTimeId; |
||||
map['actRecordId'] = _actRecordId; |
||||
map['mid'] = _mid; |
||||
map['orderId'] = _orderId; |
||||
map['isLeader'] = _isLeader; |
||||
map['memberAvatar'] = _memberAvatar; |
||||
map['memberNickname'] = _memberNickname; |
||||
map['productId'] = _productId; |
||||
map['actPrice'] = _actPrice; |
||||
map['state'] = _state; |
||||
map['isDelete'] = _isDelete; |
||||
return map; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,15 @@
|
||||
enum BargainType { |
||||
BargainZBug, |
||||
BargainBug, |
||||
CollageBug, |
||||
} |
||||
|
||||
enum JoinActivity { |
||||
GoJoin, |
||||
CollageBug, |
||||
CollageZBug, |
||||
BargainZBug, |
||||
MZBug, |
||||
MBug, |
||||
BargainBug, |
||||
} |
@ -0,0 +1,599 @@
|
||||
import 'package:dio/dio.dart'; |
||||
import 'package:flutter/cupertino.dart'; |
||||
import 'package:flutter/material.dart'; |
||||
import 'package:flutter_swiper/flutter_swiper.dart'; |
||||
import 'package:huixiang/generated/l10n.dart'; |
||||
import 'package:huixiang/retrofit/data/base_data.dart'; |
||||
import 'package:huixiang/retrofit/data/shoppingCart.dart'; |
||||
import 'package:huixiang/retrofit/data/store_info.dart'; |
||||
import 'package:huixiang/retrofit/min_api.dart'; |
||||
import 'package:huixiang/retrofit/retrofit_api.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
import 'package:huixiang/view_widget/classic_header.dart'; |
||||
import 'package:huixiang/view_widget/custom_image.dart'; |
||||
import 'package:huixiang/view_widget/my_appbar.dart'; |
||||
import 'package:huixiang/view_widget/no_data_view.dart'; |
||||
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
|
||||
class ShoppingCartPage extends StatefulWidget { |
||||
final String minToken; |
||||
final String storeId; |
||||
final String tenant; |
||||
final StoreInfo storeInfo; |
||||
|
||||
ShoppingCartPage(this.minToken, this.storeId, this.tenant, this.storeInfo); |
||||
|
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _ShoppingCartPage(); |
||||
} |
||||
} |
||||
|
||||
class _ShoppingCartPage extends State<ShoppingCartPage> |
||||
with AutomaticKeepAliveClientMixin { |
||||
ApiService apiService; |
||||
MinApiService minService; |
||||
List<ShoppingCart> shopCarGoods = []; |
||||
String pName; |
||||
String pid; |
||||
String cName; |
||||
String cid; |
||||
int tableId = 0; |
||||
bool topIndex = false; |
||||
bool isAllSelect = false; |
||||
int bIndex = 0; |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
queryShopCar(); |
||||
} |
||||
|
||||
///清空购物车 |
||||
clearShopCar() async { |
||||
shopCarGoods[0].shoppingCartSkuItemList.forEach((element) { |
||||
if (element.selected == 1) { |
||||
shopCartAdd(element, -element.buyNum, element.selected); |
||||
} |
||||
}); |
||||
queryShopCar(); |
||||
} |
||||
|
||||
///去下单结算页面 |
||||
toDownOrder() async { |
||||
await Navigator.of(context).pushNamed( |
||||
'/router/settlement', |
||||
arguments: { |
||||
"storeInfo": widget.storeInfo, |
||||
"tableId": tableId, |
||||
"pName": pName, |
||||
"pid": pid, |
||||
"cName": cName, |
||||
"cid": cid, |
||||
}, |
||||
); |
||||
queryShopCar(); |
||||
} |
||||
|
||||
///查询购物车商品 |
||||
queryShopCar() async { |
||||
if (widget.minToken == null) return; |
||||
if (minService == null) |
||||
minService = MinApiService( |
||||
Dio(), |
||||
context: context, |
||||
token: widget.minToken, |
||||
tenant: widget.tenant, |
||||
storeId: widget.storeId, |
||||
showLoading: false, |
||||
); |
||||
BaseData<List<ShoppingCart>> baseData = |
||||
await minService.getShoppingCart(tableId).catchError((error) { |
||||
refreshController.refreshFailed(); |
||||
}); |
||||
if (baseData != null && baseData.isSuccess) { |
||||
setState(() { |
||||
shopCarGoods.clear(); |
||||
shopCarGoods.addAll(baseData.data); |
||||
refreshController.refreshCompleted(); |
||||
}); |
||||
} else { |
||||
refreshController.refreshFailed(); |
||||
} |
||||
} |
||||
|
||||
///购物车数量修改 |
||||
shopCartAdd( |
||||
ShoppingCartSkuItemListBean cartSkuItem, int count, int selected) async { |
||||
Map<String, dynamic> shopCarTemp = shopCarGoods[0].toJson(); |
||||
cartSkuItem.buyNum += count; |
||||
cartSkuItem.selected = selected; |
||||
shopCarTemp["selected"] = selected; |
||||
shopCarTemp["shoppingCartSkuItemList"] = [cartSkuItem.toJson()]; |
||||
BaseData baseDate = await minService.shoppingCartSingle(shopCarTemp); |
||||
if (baseDate.isSuccess) { |
||||
setState(() { |
||||
queryShopCar(); |
||||
}); |
||||
} |
||||
refreshController.refreshFailed(); |
||||
} |
||||
|
||||
final SwiperController controller = SwiperController(); |
||||
|
||||
@override |
||||
void dispose() { |
||||
super.dispose(); |
||||
if (refreshController != null) refreshController.dispose(); |
||||
} |
||||
|
||||
final RefreshController refreshController = RefreshController(); |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
super.build(context); |
||||
return Stack( |
||||
children: [ |
||||
Column( |
||||
children: [ |
||||
MyAppBar( |
||||
title: "购物车", |
||||
titleColor: Colors.black, |
||||
leadingColor: Colors.black, |
||||
background: Colors.transparent, |
||||
actions: [ |
||||
GestureDetector( |
||||
onTap: () { |
||||
setState(() { |
||||
topIndex = !topIndex; |
||||
}); |
||||
}, |
||||
child: Container( |
||||
alignment: Alignment.centerRight, |
||||
margin: EdgeInsets.only(right: 12.w), |
||||
padding: EdgeInsets.only(left:35,), |
||||
child: Text( |
||||
!topIndex ? "管理" : S.of(context).quxiao, |
||||
style: TextStyle( |
||||
fontSize: 18.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color: Colors.black, |
||||
), |
||||
), |
||||
), |
||||
) |
||||
], |
||||
), |
||||
Expanded( |
||||
child: Container( |
||||
child: SmartRefresher( |
||||
controller: refreshController, |
||||
enablePullDown: true, |
||||
enablePullUp: false, |
||||
header: MyHeader(), |
||||
physics: BouncingScrollPhysics(), |
||||
onRefresh: () { |
||||
setState(() { |
||||
queryShopCar(); |
||||
}); |
||||
}, |
||||
child: SingleChildScrollView( |
||||
physics: NeverScrollableScrollPhysics(), |
||||
child: FutureBuilder( |
||||
// future: queryShopCar(), |
||||
builder: (context, snapshot) { |
||||
return Column( |
||||
children: [ |
||||
///购物车商品列表 |
||||
cartGoodsList(), |
||||
], |
||||
); |
||||
}, |
||||
), |
||||
), |
||||
), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
Align( |
||||
alignment: Alignment(0.8, 0.8), |
||||
child: Container( |
||||
height: 70.h, |
||||
width: double.infinity, |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(8), |
||||
boxShadow: [ |
||||
BoxShadow( |
||||
color: Colors.black.withAlpha(12), |
||||
offset: Offset(0, 3), |
||||
blurRadius: 14, |
||||
spreadRadius: 0, |
||||
), |
||||
], |
||||
color: Color(0xFFFAFAFA), |
||||
), |
||||
padding: EdgeInsets.only(left: 16.w, right: 16.w), |
||||
child: Row( |
||||
mainAxisAlignment: MainAxisAlignment.spaceAround, |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
children: [ |
||||
GestureDetector( |
||||
onTap: () { |
||||
setState(() { |
||||
isAllSelect = !isAllSelect; |
||||
shopCarGoods[0] |
||||
.shoppingCartSkuItemList |
||||
.forEach((element) { |
||||
element.selected = isAllSelect ? 1 : 0; |
||||
shopCartAdd(element, 0, element.selected); |
||||
}); |
||||
}); |
||||
}, |
||||
child: Container( |
||||
height:70, |
||||
child: Image.asset( |
||||
isAllSelect |
||||
? "assets/image/icon_radio_selected.webp" |
||||
: "assets/image/icon_radio_unselected.webp", |
||||
width: 16, |
||||
height: 16, |
||||
),), |
||||
), |
||||
SizedBox(width: 5.w), |
||||
Expanded( |
||||
child: Text( |
||||
"全选", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFFA29E9E), |
||||
), |
||||
), |
||||
), |
||||
!topIndex |
||||
? Row( |
||||
children: [ |
||||
Text.rich( |
||||
TextSpan( |
||||
children: [ |
||||
TextSpan( |
||||
text: "合计:", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Colors.black, |
||||
), |
||||
), |
||||
TextSpan( |
||||
text: ((shopCarGoods?.length ?? 0) > 0) |
||||
? (shopCarGoods[0]?.cartSum ?? "") |
||||
: "", |
||||
style: TextStyle( |
||||
fontSize: 20.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color: Color(0xFF32A060), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
GestureDetector( |
||||
onTap: () { |
||||
toDownOrder(); |
||||
}, |
||||
child: Container( |
||||
alignment: Alignment.center, |
||||
width: 70.w, |
||||
height: 32.h, |
||||
margin: EdgeInsets.only(left: 6.w), |
||||
decoration: BoxDecoration( |
||||
color: Color(0xFF32A060), |
||||
borderRadius: BorderRadius.circular(16), |
||||
boxShadow: [ |
||||
BoxShadow( |
||||
color: Colors.black.withAlpha(12), |
||||
offset: Offset(0, 3), |
||||
blurRadius: 14, |
||||
spreadRadius: 0, |
||||
), |
||||
], |
||||
), |
||||
child: Text( |
||||
"结算", |
||||
style: TextStyle( |
||||
fontSize: 16.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Colors.white, |
||||
), |
||||
), |
||||
), |
||||
), |
||||
], |
||||
) |
||||
: GestureDetector( |
||||
onTap: () { |
||||
if(isAllItemUnSelected()) |
||||
return; |
||||
clearShopCar(); |
||||
}, |
||||
child: Container( |
||||
alignment: Alignment.center, |
||||
width: 70.w, |
||||
height: 32.h, |
||||
margin: EdgeInsets.only(left: 6.w), |
||||
decoration: BoxDecoration( |
||||
color:isAllItemUnSelected()?Color(0xFFE5E5E5):Color(0xFFFB312B), |
||||
borderRadius: BorderRadius.circular(16), |
||||
boxShadow: [ |
||||
BoxShadow( |
||||
color: Colors.black.withAlpha(12), |
||||
offset: Offset(0, 3), |
||||
blurRadius: 14, |
||||
spreadRadius: 0, |
||||
), |
||||
], |
||||
), |
||||
child: Text( |
||||
"删除", |
||||
style: TextStyle( |
||||
fontSize: 16.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Colors.white, |
||||
), |
||||
), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
), |
||||
], |
||||
); |
||||
} |
||||
|
||||
///按钮选中/未选中 |
||||
bool isAllItemUnSelected(){ |
||||
bool unAllSelectedFlag = true; |
||||
bool allSelectedFlag = true; |
||||
if(shopCarGoods == null || shopCarGoods.length == 0){ |
||||
setState(() { |
||||
isAllSelect = false; |
||||
}); |
||||
return unAllSelectedFlag; |
||||
} |
||||
shopCarGoods[0] |
||||
.shoppingCartSkuItemList |
||||
.forEach((element) { |
||||
if(element.selected == 1) |
||||
unAllSelectedFlag = false; |
||||
else allSelectedFlag = false; |
||||
}); |
||||
setState(() { |
||||
isAllSelect = allSelectedFlag; |
||||
}); |
||||
return unAllSelectedFlag; |
||||
} |
||||
|
||||
Widget cartGoodsList() { |
||||
return (shopCarGoods == null || shopCarGoods.length == 0) |
||||
? NoDataView( |
||||
src: "assets/image/shopping_k.webp", |
||||
isShowBtn: false, |
||||
text: "目前暂无商品,要快去买点好吃的哦~", |
||||
fontSize: 16.sp, |
||||
margin: EdgeInsets.only(top: 150.h), |
||||
) |
||||
: Container( |
||||
margin: EdgeInsets.only(bottom: 50.h), |
||||
child: ListView.builder( |
||||
itemCount: ((shopCarGoods?.length ?? 0) > 0) |
||||
? (shopCarGoods[0]?.shoppingCartSkuItemList?.length ?? 0) |
||||
: 0, |
||||
shrinkWrap: true, |
||||
padding: EdgeInsets.only( |
||||
top: 8.h, |
||||
bottom: 84.h, /* + (375.h - 88.h) + 4.h*/ |
||||
), |
||||
physics: BouncingScrollPhysics(), |
||||
itemBuilder: (context, position) { |
||||
return InkWell( |
||||
onTap: () { |
||||
bIndex = position; |
||||
}, |
||||
child: cartGoodsItem(position), |
||||
); |
||||
}), |
||||
); |
||||
} |
||||
|
||||
Widget cartGoodsItem(index) { |
||||
return Container( |
||||
margin: EdgeInsets.all(16), |
||||
padding: EdgeInsets.all(16), |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(8), |
||||
boxShadow: [ |
||||
BoxShadow( |
||||
color: Colors.black.withAlpha(12), |
||||
offset: Offset(0, 3), |
||||
blurRadius: 14, |
||||
spreadRadius: 0, |
||||
), |
||||
], |
||||
color: Colors.white, |
||||
), |
||||
child: Row( |
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
children: [ |
||||
GestureDetector( |
||||
onTap: () { |
||||
setState(() { |
||||
shopCarGoods[0].shoppingCartSkuItemList[index].selected = |
||||
(shopCarGoods[0].shoppingCartSkuItemList[index].selected == |
||||
0) |
||||
? 1 |
||||
: 0; |
||||
shopCartAdd(shopCarGoods[0].shoppingCartSkuItemList[index], 0, |
||||
shopCarGoods[0].shoppingCartSkuItemList[index].selected); |
||||
}); |
||||
}, |
||||
child:Container( |
||||
height: 60, |
||||
child:Image.asset( |
||||
(shopCarGoods[0].shoppingCartSkuItemList[index].selected == 1) |
||||
? "assets/image/icon_radio_selected.webp" |
||||
: "assets/image/icon_radio_unselected.webp", |
||||
width: 16, |
||||
height: 16, |
||||
),), |
||||
), |
||||
SizedBox(width: 16.w), |
||||
MImage( |
||||
shopCarGoods[0].shoppingCartSkuItemList[index]?.skuImg ?? "", |
||||
isCircle: true, |
||||
width: 81, |
||||
height: 81, |
||||
fit: BoxFit.cover, |
||||
errorSrc: "assets/image/default_1.webp", |
||||
fadeSrc: "assets/image/default_1.webp", |
||||
), |
||||
SizedBox(width: 10.w), |
||||
Expanded( |
||||
child: Container( |
||||
height: 81.h, |
||||
child: Column( |
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Text( |
||||
shopCarGoods[0] |
||||
.shoppingCartSkuItemList[index] |
||||
?.productName ?? |
||||
"", |
||||
maxLines: 2, |
||||
overflow: TextOverflow.ellipsis, |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF353535), |
||||
), |
||||
), |
||||
// SizedBox(height: 5.h), |
||||
Text( |
||||
shopCarGoods[0].shoppingCartSkuItemList[index]?.skuName ?? |
||||
"", |
||||
style: TextStyle( |
||||
fontSize: 10.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF727272), |
||||
), |
||||
), |
||||
// SizedBox(height: 5.h), |
||||
Row( |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
crossAxisAlignment: CrossAxisAlignment.end, |
||||
children: [ |
||||
Expanded( |
||||
child: Text.rich( |
||||
TextSpan( |
||||
children: [ |
||||
TextSpan( |
||||
text: "¥", |
||||
style: TextStyle( |
||||
fontSize: 10.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color: Color(0xFF32A060), |
||||
), |
||||
), |
||||
TextSpan( |
||||
text: shopCarGoods[0] |
||||
.shoppingCartSkuItemList[index] |
||||
?.skuPrice ?? |
||||
"", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color: Color(0xFF32A060), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
)), |
||||
Row( |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
children: [ |
||||
InkWell( |
||||
onTap: () { |
||||
setState(() { |
||||
if (shopCarGoods[0] |
||||
.shoppingCartSkuItemList[index] |
||||
.buyNum > |
||||
1) |
||||
shopCartAdd( |
||||
shopCarGoods[0] |
||||
.shoppingCartSkuItemList[index], |
||||
-1, |
||||
shopCarGoods[0] |
||||
.shoppingCartSkuItemList[index] |
||||
.selected); |
||||
}); |
||||
}, |
||||
child: Image.asset( |
||||
"assets/image/reduce.webp", |
||||
width: 22, |
||||
height: 22, |
||||
), |
||||
), |
||||
Container( |
||||
width: 30, |
||||
alignment: Alignment.center, |
||||
child: Text( |
||||
shopCarGoods[0] |
||||
.shoppingCartSkuItemList[index] |
||||
?.buyNum |
||||
.toString() ?? |
||||
0, |
||||
style: TextStyle( |
||||
color: Colors.black, |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
), |
||||
), |
||||
), |
||||
InkWell( |
||||
onTap: () { |
||||
setState(() { |
||||
shopCartAdd( |
||||
shopCarGoods[0] |
||||
.shoppingCartSkuItemList[index], |
||||
1, |
||||
shopCarGoods[0] |
||||
.shoppingCartSkuItemList[index] |
||||
.selected); |
||||
}); |
||||
}, |
||||
child: Image.asset( |
||||
"assets/image/add.webp", |
||||
width: 22, |
||||
height: 22, |
||||
), |
||||
), |
||||
], |
||||
) |
||||
], |
||||
), |
||||
], |
||||
)), |
||||
), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
@override |
||||
bool get wantKeepAlive => true; |
||||
} |