Commit 9539ecbe79f3bbe645483faf9416bc84b4997a02

Authored by wdn127929
1 parent 00f4af6b

全店客情

class Manager{
class Manager {
dynamic id;
String role_name;
String user_name;
... ... @@ -8,30 +8,28 @@ class Manager{
Manager();
String get roleUserName{
String get roleUserName {
return "[$role_name]--$userName";
}
String get userName{
return (nick_name==null||nick_name.isEmpty)?user_name:nick_name;
String get userName {
return (nick_name == null || nick_name.isEmpty) ? user_name : nick_name;
}
factory Manager.fromJson(Map<String,dynamic> json)=>
Manager()
..id=json["id"]
..role_name=json["role_name"]
..user_name=json["user_name"]
..nick_name=json["nick_name"]
..user_phone=json["user_phone"]
..user_wechat=json["user_wechat"];
factory Manager.fromJson(Map<String, dynamic> json) => Manager()
..id = json["id"]
..role_name = json["role_name"]
..user_name = json["user_name"]
..nick_name = json["nick_name"]
..user_phone = json["user_phone"]
..user_wechat = json["user_wechat"];
Map<String,dynamic> toJson()=><String,dynamic>
{
"id":id,
"role_name":role_name,
"user_name":user_name,
"nick_name":nick_name,
"user_phone":user_phone,
"user_wechat":user_wechat,
};
}
\ No newline at end of file
Map<String, dynamic> toJson() => <String, dynamic>{
"id": id,
"role_name": role_name,
"user_name": user_name,
"nick_name": nick_name,
"user_phone": user_phone,
"user_wechat": user_wechat,
};
}
... ...
... ... @@ -37,13 +37,15 @@ class CustomerListPage extends StatefulWidget {
final String index;
final String uidStr;
final bool distribution;
final List<SellerUser> sellerUser;
const CustomerListPage(
{Key key,
this.fromPage,
this.index,
this.uidStr,
this.distribution = false})
this.distribution = false,
this.sellerUser})
: super(key: key);
@override
_CustomerListPageState createState() => _CustomerListPageState();
... ... @@ -64,8 +66,12 @@ class _CustomerListPageState extends State<CustomerListPage>
bool distribution = false;
int page = 1;
String uidAct;
@override
void initState() {
uidAct = widget.uidStr;
distribution = widget.distribution;
_tabBarTitle = ['全部', '活跃', '沉睡', '流失'];
// timeTilte = ['大于', '等于', '小于'];
... ... @@ -119,6 +125,7 @@ class _CustomerListPageState extends State<CustomerListPage>
});
WidgetsBinding.instance.addPostFrameCallback((_) async {
bool first = true;
_getSeller();
customerProvider.index = tabController.index;
if (widget.fromPage == FromPage.FromPageMakeRecord) {
... ... @@ -174,8 +181,8 @@ class _CustomerListPageState extends State<CustomerListPage>
}
_getManagerAndList() async {
await _getSellerGuestManage();
await _getContantData();
_getContantData();
// _getSellerGuestManage();
}
_onload() {
... ... @@ -193,10 +200,10 @@ class _CustomerListPageState extends State<CustomerListPage>
// await customerProvider.getAuthUserLists(context);
// }
///全店客情首页 ----- 获取经理数据
_getSellerGuestManage() async {
StoreCustomerHomeSunModel model =
await customerProvider.getSellerGuestManage(context);
///经理数据重组
_getSeller() async {
// StoreCustomerHomeSunModel model =
// await customerProvider.getSellerGuestManage(context);
customerProvider.filterManageList = [];
FilterBtnModel model1 = FilterBtnModel();
// model.id = item.id;
... ... @@ -206,10 +213,8 @@ class _CustomerListPageState extends State<CustomerListPage>
model1.select = true;
}
customerProvider.filterManageList.add(model1);
if (model != null &&
model.sellerUser != null &&
model.sellerUser.length > 0) {
for (SellerUser item in model.sellerUser) {
if (widget.sellerUser != null && widget.sellerUser.length > 0) {
for (SellerUser item in widget.sellerUser) {
// if (item.nickName != null) {
FilterBtnModel model = FilterBtnModel();
model.id = item.uid;
... ... @@ -309,23 +314,27 @@ class _CustomerListPageState extends State<CustomerListPage>
// if (first && widget.uidStr != null && widget.uidStr != '') {
// params['uid'] = widget.uidStr;
// } else {
String uid = '';
List<FilterBtnModel> tempfilterManage =
List.from(customerProvider.filterManageList);
if (tempfilterManage.length > 0) {
tempfilterManage.removeAt(0);
}
for (FilterBtnModel item in tempfilterManage) {
if (item.select) {
uid += '${item.id},';
}
}
// String uid = '';
// List<FilterBtnModel> tempfilterManage =
// List.from(customerProvider.filterManageList);
// if (tempfilterManage.length > 0) {
// tempfilterManage.removeAt(0);
// }
// for (FilterBtnModel item in tempfilterManage) {
// if (item.select) {
// uid += '${item.id},';
// }
// }
if (uid.length > 0) {
if (uid.endsWith(',')) {
uid = uid.substring(0, uid.length - 1);
}
params['uid'] = uid;
// if (uid.length > 0) {
// if (uid.endsWith(',')) {
// uid = uid.substring(0, uid.length - 1);
// }
// params['uid'] = uid;
// }
if (uidAct != null && uidAct.length > 0) {
params['uid'] = uidAct;
}
// }
... ... @@ -463,7 +472,8 @@ class _CustomerListPageState extends State<CustomerListPage>
customerMakingProvider.selectCustomerSeller =
customerProvider.selectCustomerSeller;
customerMakingProvider.fromPage = widget.fromPage;
NavigatorUtil.goMakeMarkingPage(context,
NavigatorUtil.goMakeMarkingPage(
context, {'object': widget.sellerUser},
fromPage: FromPage.FromPageCustomerList);
} else {
customerMakingProvider.labels = customerProvider.labels;
... ... @@ -909,6 +919,27 @@ class _CustomerListPageState extends State<CustomerListPage>
fontSize: ScreenUtil().setSp(size)));
}
_getUid() {
String uid = '';
List<FilterBtnModel> tempfilterManage =
List.from(customerProvider.filterManageList);
if (tempfilterManage.length > 0) {
tempfilterManage.removeAt(0);
}
for (FilterBtnModel item in tempfilterManage) {
if (item.select) {
uid += '${item.id},';
}
}
if (uid.length > 0) {
if (uid.endsWith(',')) {
uid = uid.substring(0, uid.length - 1);
}
uidAct = uid;
}
}
///客户经理
Widget _managerWidget(state) {
return Column(
... ... @@ -928,11 +959,13 @@ class _CustomerListPageState extends State<CustomerListPage>
in customerProvider.filterManageList) {
item.select = true;
}
_getUid();
} else {
for (FilterBtnModel item
in customerProvider.filterManageList) {
item.select = false;
}
_getUid();
}
});
},
... ... @@ -958,6 +991,7 @@ class _CustomerListPageState extends State<CustomerListPage>
state(() {
item.select = !item.select;
});
_getUid();
customerProvider.getCheckmanageSelAll();
})),
],
... ...
... ... @@ -23,16 +23,20 @@ import 'package:one_key/widgets/system_app_bar.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:provider/provider.dart';
import 'package:sendsms/sendsms.dart';
import 'package:one_key/models/store_customer_home_model.dart'
as storeCustomerHomeModel;
typedef ClickCallback = void Function(dynamic value);
class MakeMarkingPage extends StatefulWidget {
final FromPage fromPage;
final MarketingByIdSunModel marketingByIdSunModel;
final List<storeCustomerHomeModel.SellerUser> sellerUser;
MakeMarkingPage(
{Key key,
this.marketingByIdSunModel,
this.fromPage = FromPage.FromPageCustomerList})
this.fromPage = FromPage.FromPageCustomerList,
this.sellerUser})
: super(key: key);
@override
... ... @@ -566,7 +570,10 @@ class _MakeMarkingPageState extends State<MakeMarkingPage> {
customerProvider.selectCustomerSeller;
await NavigatorUtil.goCustomerListPage(
context, FromPage.FromPageMakeRecord, '');
context,
FromPage.FromPageMakeRecord,
'',
{'object': widget.sellerUser});
// Map temp =
... ...
... ... @@ -16,10 +16,14 @@ import 'package:one_key/widgets/row_multi_text.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:provider/provider.dart';
import 'package:one_key/models/store_customer_home_model.dart'
as storeCustomerHomeModel;
class MarketingRecordsDetailPage extends StatefulWidget {
final String idstr;
MarketingRecordsDetailPage({Key key, this.idstr}) : super(key: key);
final List<storeCustomerHomeModel.SellerUser> sellerUser;
MarketingRecordsDetailPage({Key key, this.idstr, this.sellerUser})
: super(key: key);
@override
_MarketingRecordsDetailPageState createState() =>
... ... @@ -378,7 +382,8 @@ class _MarketingRecordsDetailPageState
// NavigatorUtil.goMyMakeMarkingPage(context,
// selfList: widget.selfList,
// fromPage: FromPage.FromPageMakeRecordDetail);
NavigatorUtil.goMakeMarkingPage(context,
NavigatorUtil.goMakeMarkingPage(
context, {'object': widget.sellerUser},
marketingByIdSunModel:
model.marketingByIdSunModel,
fromPage:
... ...
... ... @@ -13,6 +13,8 @@ import 'package:one_key/widgets/page_exception.dart';
import 'package:one_key/widgets/round_button.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:provider/provider.dart';
import 'package:one_key/models/store_customer_home_model.dart'
as storeCustomerHomeModel;
/**
*
* 全店营销记录
... ... @@ -21,7 +23,9 @@ import 'package:provider/provider.dart';
class MarketingRecordsPage extends StatefulWidget {
final FromPage fromPage;
MarketingRecordsPage({Key key, this.fromPage}) : super(key: key);
final List<storeCustomerHomeModel.SellerUser> sellerUser;
MarketingRecordsPage({Key key, this.fromPage, this.sellerUser})
: super(key: key);
@override
_MarketingRecordsPageState createState() => _MarketingRecordsPageState();
... ... @@ -156,7 +160,9 @@ class _MarketingRecordsPageState extends State<MarketingRecordsPage> {
InkWell(
onTap: () {
NavigatorUtil.goMarketingRecordsDetailPage(
context, data.id);
context,
data.id,
{'object': widget.sellerUser});
},
child: Text('查看详情',
style: TextStyle(
... ...
... ... @@ -97,6 +97,8 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> {
};
await widget.customerProvider
.getSellerCountsList(context, params, isShowLoading: isShowLoading);
widget.customerProvider.pageStateStoreHome = PageState.Success;
setState(() {});
if ((widget.customerProvider.homeStatisticsList == null ||
widget.customerProvider.homeStatisticsList.length == 0) &&
callback != null) {
... ... @@ -121,6 +123,7 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> {
index = '3';
}
NavigatorUtil.goCustomerListPage(context, FromPage.FromPageHome, uid,
{'object': widget.customerProvider.storeSunmodel.sellerUser},
index: index);
},
child: Container(
... ... @@ -165,7 +168,13 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> {
index = '3';
}
NavigatorUtil.goCustomerListPage(
context, FromPage.FromPageHome, uid,
context,
FromPage.FromPageHome,
uid,
{
'object':
widget.customerProvider.storeSunmodel.sellerUser
},
index: index);
},
text: btnTitle,
... ... @@ -414,6 +423,7 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> {
);
}
/*
Widget _monthWidget() {
return Container(
margin: EdgeInsets.symmetric(horizontal: w(10)),
... ... @@ -724,6 +734,7 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> {
),
);
}
*/
Widget _managerWidget(
String pnum, String btnTitle, String percent, String detailStr,
... ... @@ -937,6 +948,7 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> {
callback: () {
// getTableList();
_getSellerGuestManage();
_getSellerCountsList();
},
emptyMsg: "暂时没有全店客情哦",
emptyImg: "empty_search",
... ... @@ -949,147 +961,174 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> {
controller: _controller,
child: Column(
children: [
VEmptyView(10),
// Stack(
// children: [
InkWell(
onTap: () {
NavigatorUtil.goCustomerListPage(
context, FromPage.FromPageHome, '');
},
child: Container(
height: w(80),
color: MyColours.color_ffffff,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
if (widget.customerProvider.storeSunmodel != null)
Column(
children: [
VEmptyView(10),
// Stack(
// children: [
InkWell(
onTap: () {
NavigatorUtil.goCustomerListPage(
context,
FromPage.FromPageHome,
'',
{
'object': widget
.customerProvider.storeSunmodel.sellerUser
},
);
},
child: Container(
height: w(80),
color: MyColours.color_ffffff,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'${widget.customerProvider.storeSunmodel.myCustomer}',
style: TextStyle(
color: MyColours.color_438E93,
fontSize: ScreenUtil().setSp(64),
fontWeight: FontWeight.bold),
),
Text(
'位',
style: TextStyle(
color: MyColours.color_515151,
// fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(32)),
)
],
),
)),
// Positioned(
// top: ScreenUtil().setWidth(30),
// right: ScreenUtil().setWidth(40),
// child: InkWell(
// onTap: () {
// NavigatorUtil.goCustomerSetPage(context);
// },
// child: Image.asset(Utils.getImgPath('c_set'),
// width: ScreenUtil().setWidth(40))))
// ],
// ),
VEmptyView(10),
Row(
children: [
Text(
'${widget.customerProvider.storeSunmodel.myCustomer}',
style: TextStyle(
color: MyColours.color_438E93,
fontSize: ScreenUtil().setSp(64),
fontWeight: FontWeight.bold),
),
Text(
'位',
style: TextStyle(
color: MyColours.color_515151,
// fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(32)),
)
_percentWidget(
'${widget.customerProvider.storeSunmodel.active.count}',
'活跃',
'${widget.customerProvider.storeSunmodel.active.scale}'),
HEmptyView(10),
_percentWidget(
'${widget.customerProvider.storeSunmodel.sleep.count}',
'60天未到店',
'${widget.customerProvider.storeSunmodel.sleep.scale}'),
HEmptyView(10),
_percentWidget(
'${widget.customerProvider.storeSunmodel.drain.count}',
'120天未到店',
'${widget.customerProvider.storeSunmodel.drain.scale}'),
],
),
)),
// Positioned(
// top: ScreenUtil().setWidth(30),
// right: ScreenUtil().setWidth(40),
// child: InkWell(
// onTap: () {
// NavigatorUtil.goCustomerSetPage(context);
// },
// child: Image.asset(Utils.getImgPath('c_set'),
// width: ScreenUtil().setWidth(40))))
// ],
// ),
VEmptyView(10),
Row(
children: [
_percentWidget(
'${widget.customerProvider.storeSunmodel.active.count}',
'活跃',
'${widget.customerProvider.storeSunmodel.active.scale}'),
HEmptyView(10),
_percentWidget(
'${widget.customerProvider.storeSunmodel.sleep.count}',
'60天未到店',
'${widget.customerProvider.storeSunmodel.sleep.scale}'),
HEmptyView(10),
_percentWidget(
'${widget.customerProvider.storeSunmodel.drain.count}',
'120天未到店',
'${widget.customerProvider.storeSunmodel.drain.scale}'),
],
),
// GridView.builder(
// controller: _controller,
// shrinkWrap: true,
// cacheExtent: ScreenUtil().setWidth(0),
// itemCount: 3,
// gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
// crossAxisCount: 3,
// childAspectRatio: 1,
// mainAxisSpacing: ScreenUtil().setWidth(10),
// crossAxisSpacing: ScreenUtil().setWidth(10)),
// itemBuilder: (BuildContext context, int index) {
// // locationState = state;
// return _percentWidget('1999', '活跃客户', '39.20');
// }),
// Row(
// children: [
// _percentWidget('19992', '活跃客户', '90.90'),
// HEmptyView(10),
// _percentWidget('19992', '沉睡客户', '90.90'),
// HEmptyView(10),
// _percentWidget('19992', '流失客户', '5.90'),
// ],
// ),
// Padding(
// padding: EdgeInsets.symmetric(
// vertical: ScreenUtil().setWidth(30)),
// child: Text(
// '客户经理',
// style: TextStyle(
// fontSize: ScreenUtil().setSp(28),
// color: MyColours.color_333333),
// ),
// ),
VEmptyView(10),
GridView.builder(
controller: _controller,
shrinkWrap: true,
cacheExtent: ScreenUtil().setWidth(0),
itemCount: widget.customerProvider.storeSunmodel
.sellerUser.length +
1,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
childAspectRatio: 1.05,
mainAxisSpacing: ScreenUtil().setWidth(10),
crossAxisSpacing: ScreenUtil().setWidth(10)),
itemBuilder: (BuildContext context, int index) {
// locationState = state;
if (index == 0) {
return _managerWidget(
'${widget.customerProvider.storeSunmodel.distribution}',
'未分配经理',
null,
'${widget.customerProvider.storeSunmodel.distributionStr}',
onTap: () {
NavigatorUtil.goCustomerListPage(
context, FromPage.FromPageHome, '',
index: '0', distribution: true);
});
}
// GridView.builder(
// controller: _controller,
// shrinkWrap: true,
// cacheExtent: ScreenUtil().setWidth(0),
// itemCount: 3,
// gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
// crossAxisCount: 3,
// childAspectRatio: 1,
// mainAxisSpacing: ScreenUtil().setWidth(10),
// crossAxisSpacing: ScreenUtil().setWidth(10)),
// itemBuilder: (BuildContext context, int index) {
// // locationState = state;
// return _percentWidget('1999', '活跃客户', '39.20');
// }),
// Row(
// children: [
// _percentWidget('19992', '活跃客户', '90.90'),
// HEmptyView(10),
// _percentWidget('19992', '沉睡客户', '90.90'),
// HEmptyView(10),
// _percentWidget('19992', '流失客户', '5.90'),
// ],
// ),
// Padding(
// padding: EdgeInsets.symmetric(
// vertical: ScreenUtil().setWidth(30)),
// child: Text(
// '客户经理',
// style: TextStyle(
// fontSize: ScreenUtil().setSp(28),
// color: MyColours.color_333333),
// ),
// ),
VEmptyView(10),
GridView.builder(
controller: _controller,
shrinkWrap: true,
cacheExtent: ScreenUtil().setWidth(0),
itemCount: widget.customerProvider.storeSunmodel
.sellerUser.length +
1,
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
childAspectRatio: 1.05,
mainAxisSpacing: ScreenUtil().setWidth(10),
crossAxisSpacing:
ScreenUtil().setWidth(10)),
itemBuilder: (BuildContext context, int index) {
// locationState = state;
if (index == 0) {
return _managerWidget(
'${widget.customerProvider.storeSunmodel.distribution}',
'未分配经理',
null,
'${widget.customerProvider.storeSunmodel.distributionStr}',
onTap: () {
NavigatorUtil.goCustomerListPage(
context,
FromPage.FromPageHome,
'',
{
'object': widget.customerProvider
.storeSunmodel.sellerUser
},
index: '0',
distribution: true);
});
}
return _managerWidget(
'${widget.customerProvider.storeSunmodel.sellerUser[index - 1].count}',
widget.customerProvider.storeSunmodel
.sellerUser[index - 1].account ==
null
? ''
: '${widget.customerProvider.storeSunmodel.sellerUser[index - 1].nickName ?? widget.customerProvider.storeSunmodel.sellerUser[index - 1].account}',
null,
'${widget.customerProvider.storeSunmodel.sellerUser[index - 1].detailStr}',
uid: widget.customerProvider.storeSunmodel
.sellerUser[index - 1].uid, onTap: () {
NavigatorUtil.goCustomerListPage(
context,
FromPage.FromPageHome,
widget.customerProvider.storeSunmodel
.sellerUser[index - 1].uid,
{
'object': widget.customerProvider
.storeSunmodel.sellerUser
},
index: '0',
);
});
}),
],
),
return _managerWidget(
'${widget.customerProvider.storeSunmodel.sellerUser[index - 1].count}',
widget.customerProvider.storeSunmodel
.sellerUser[index - 1].account ==
null
? ''
: '${widget.customerProvider.storeSunmodel.sellerUser[index - 1].nickName ?? widget.customerProvider.storeSunmodel.sellerUser[index - 1].account}',
null,
'${widget.customerProvider.storeSunmodel.sellerUser[index - 1].detailStr}',
uid: widget.customerProvider.storeSunmodel
.sellerUser[index - 1].uid, onTap: () {
NavigatorUtil.goCustomerListPage(
context,
FromPage.FromPageHome,
widget.customerProvider.storeSunmodel
.sellerUser[index - 1].uid,
index: '0');
});
}),
VEmptyView(10),
// ListView.builder(
// shrinkWrap: true,
... ... @@ -1131,28 +1170,37 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> {
// ),
// );
// }),
_chart(),
// _monthWidget(),
ListView.builder(
itemCount:
widget.customerProvider.homeStatisticsList.length,
shrinkWrap: true,
controller: _controller,
padding: EdgeInsets.symmetric(horizontal: w(10)),
itemBuilder: (context, index) {
SellerCountsListSunModel countsListSunModel =
widget.customerProvider.homeStatisticsList[index];
return InkWell(
onTap: () {
NavigatorUtil.goMonthOrderPage(
context,
year.toString(),
countsListSunModel.monthss.toString());
},
child: MonthItem(
countsListSunModel: countsListSunModel));
}),
if (widget.customerProvider.homeStatisticsList != null &&
widget.customerProvider.homeStatisticsList.length > 0)
Column(
children: [
_chart(),
// _monthWidget(),
ListView.builder(
itemCount: widget
.customerProvider.homeStatisticsList.length,
shrinkWrap: true,
controller: _controller,
padding: EdgeInsets.symmetric(horizontal: w(10)),
itemBuilder: (context, index) {
SellerCountsListSunModel countsListSunModel =
widget.customerProvider
.homeStatisticsList[index];
return InkWell(
onTap: () {
NavigatorUtil.goMonthOrderPage(
context,
year.toString(),
countsListSunModel.monthss.toString());
},
child: MonthItem(
countsListSunModel: countsListSunModel));
}),
],
)
/**
ListView.builder(
itemCount: 10,
... ... @@ -1525,44 +1573,48 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> {
],
),
)),
Container(
color: MyColours.color_FAFAFA,
padding: EdgeInsets.only(
top: w(13), bottom: w(26), left: w(45), right: (45)),
child: Stack(
children: [
RoundButton(
onPressed: () {
NavigatorUtil.goMarketingRecordsPage(
context, FromPage.FromPageStoreCustomer);
},
text: '历史营销记录',
fontSize: 32,
isBold: true,
// margin: EdgeInsets.only(
// top: w(13),
// bottom: w(26),
// left: w(45),
// right: (45)),
textColor: MyColours.color_F8F9FD,
gradientStart: MyColours.color_199095,
gradientEnd: MyColours.color_199095,
borderColor: MyColours.color_199095,
height: ScreenUtil().setWidth(86),
// width: ScreenUtil().setWidth(260),
radius: ScreenUtil().setWidth(10),
),
showWarning
? Positioned(
right: ScreenUtil().setWidth(30),
top: ScreenUtil().setWidth(45 / 2),
child: Image.asset(
Utils.getImgPath('warning'),
width: ScreenUtil().setWidth(35),
))
: SizedBox()
],
))
if (widget.customerProvider.storeSunmodel != null)
Container(
color: MyColours.color_FAFAFA,
padding: EdgeInsets.only(
top: w(13), bottom: w(26), left: w(45), right: (45)),
child: Stack(
children: [
RoundButton(
onPressed: () {
NavigatorUtil.goMarketingRecordsPage(
context, FromPage.FromPageStoreCustomer, {
'object':
widget.customerProvider.storeSunmodel.sellerUser
});
},
text: '历史营销记录',
fontSize: 32,
isBold: true,
// margin: EdgeInsets.only(
// top: w(13),
// bottom: w(26),
// left: w(45),
// right: (45)),
textColor: MyColours.color_F8F9FD,
gradientStart: MyColours.color_199095,
gradientEnd: MyColours.color_199095,
borderColor: MyColours.color_199095,
height: ScreenUtil().setWidth(86),
// width: ScreenUtil().setWidth(260),
radius: ScreenUtil().setWidth(10),
),
showWarning
? Positioned(
right: ScreenUtil().setWidth(30),
top: ScreenUtil().setWidth(45 / 2),
child: Image.asset(
Utils.getImgPath('warning'),
width: ScreenUtil().setWidth(35),
))
: SizedBox()
],
))
]);
}
})),
... ...
... ... @@ -77,13 +77,13 @@ class _StoreCustomerHomeRightPageState
}
_couponNetworkData();
_getMarketingByUid();
// _getMarketingByUid();
_getSellerCountsList();
}
});
bus.on("refresh_my_customer_home", (arg) {
// _getGuestManageData(isShowLoading: false);
_getMarketingByUid();
// _getMarketingByUid();
_getSellerCountsList();
});
}
... ... @@ -112,7 +112,7 @@ class _StoreCustomerHomeRightPageState
}
_couponNetworkData();
_getMarketingByUid();
// _getMarketingByUid();
_getSellerCountsList();
}
... ... @@ -130,6 +130,8 @@ class _StoreCustomerHomeRightPageState
};
await widget.customerProvider
.getSellerCountsList(context, params, isShowLoading: isShowLoading);
widget.customerProvider.pageStateMyHome = PageState.Success;
setState(() {});
if ((widget.customerProvider.managerStatisticsList == null ||
widget.customerProvider.managerStatisticsList.length == 0) &&
callback != null) {
... ... @@ -426,7 +428,7 @@ class _StoreCustomerHomeRightPageState
}
menuTitle[index].select = true;
setState(() {});
_getMarketingByUid();
// _getMarketingByUid();
// _getSellerCountsList();
_getSellerCountsList(
isShowLoading: true, callback: () {});
... ... @@ -595,7 +597,7 @@ class _StoreCustomerHomeRightPageState
callback: () {
_couponNetworkData();
_getMarketingByUid();
// _getMarketingByUid();
_getSellerCountsList();
},
emptyMsg: "暂时没有我的客情哦",
... ... @@ -609,83 +611,91 @@ class _StoreCustomerHomeRightPageState
child: Column(
children: [
// VEmptyView(10),
InkWell(
onTap: () {
String uid = '';
menuTitle.forEach((element) {
if (element.select) {
uid = element.uid;
}
});
NavigatorUtil.goMyCustomerListPage(
context, FromPage.FromPageMyCustomer, uid);
},
child: Container(
height: w(80),
color: MyColours.color_ffffff,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
if (widget.customerProvider.guestSunmodel != null)
Column(
children: [
InkWell(
onTap: () {
String uid = '';
menuTitle.forEach((element) {
if (element.select) {
uid = element.uid;
}
});
NavigatorUtil.goMyCustomerListPage(context,
FromPage.FromPageMyCustomer, uid);
},
child: Container(
height: w(80),
color: MyColours.color_ffffff,
child: Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
// Text(
// '累计',
// style: TextStyle(
// color: MyColours.color_515151,
// fontWeight: FontWeight.bold,
// fontSize: ScreenUtil().setSp(32)),
// ),
Text(
'${widget.customerProvider.guestSunmodel.myCustomer}',
style: TextStyle(
color: MyColours.color_199095,
fontSize: ScreenUtil().setSp(64),
fontWeight: FontWeight.bold),
),
Text(
'位',
style: TextStyle(
color: MyColours.color_515151,
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(32)),
)
],
),
)),
VEmptyView(10),
// GridView.builder(
// controller: _controller,
// shrinkWrap: true,
// cacheExtent: ScreenUtil().setWidth(0),
// itemCount: 3,
// gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
// crossAxisCount: 3,
// childAspectRatio: 1,
// mainAxisSpacing: ScreenUtil().setWidth(10),
// crossAxisSpacing: ScreenUtil().setWidth(10)),
// itemBuilder: (BuildContext context, int index) {
// // locationState = state;
// return _percentWidget(
// '${widget.customerProvider.guestSunmodel.active.count}',
// '活跃客户',
// '${widget.customerProvider.guestSunmodel.active.scale}');
// }),
Row(
children: [
// Text(
// '累计',
// style: TextStyle(
// color: MyColours.color_515151,
// fontWeight: FontWeight.bold,
// fontSize: ScreenUtil().setSp(32)),
// ),
Text(
'${widget.customerProvider.guestSunmodel.myCustomer}',
style: TextStyle(
color: MyColours.color_199095,
fontSize: ScreenUtil().setSp(64),
fontWeight: FontWeight.bold),
),
Text(
'位',
style: TextStyle(
color: MyColours.color_515151,
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(32)),
)
_percentWidget(
'${widget.customerProvider.guestSunmodel.active.count}',
'活跃',
'${widget.customerProvider.guestSunmodel.active.scale}'),
HEmptyView(10),
_percentWidget(
'${widget.customerProvider.guestSunmodel.sleep.count}',
'60天未到店',
'${widget.customerProvider.guestSunmodel.sleep.scale}'),
HEmptyView(10),
_percentWidget(
'${widget.customerProvider.guestSunmodel.drain.count}',
'120天未到店',
'${widget.customerProvider.guestSunmodel.drain.scale}'),
],
),
)),
VEmptyView(10),
// GridView.builder(
// controller: _controller,
// shrinkWrap: true,
// cacheExtent: ScreenUtil().setWidth(0),
// itemCount: 3,
// gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
// crossAxisCount: 3,
// childAspectRatio: 1,
// mainAxisSpacing: ScreenUtil().setWidth(10),
// crossAxisSpacing: ScreenUtil().setWidth(10)),
// itemBuilder: (BuildContext context, int index) {
// // locationState = state;
// return _percentWidget(
// '${widget.customerProvider.guestSunmodel.active.count}',
// '活跃客户',
// '${widget.customerProvider.guestSunmodel.active.scale}');
// }),
Row(
children: [
_percentWidget(
'${widget.customerProvider.guestSunmodel.active.count}',
'活跃',
'${widget.customerProvider.guestSunmodel.active.scale}'),
HEmptyView(10),
_percentWidget(
'${widget.customerProvider.guestSunmodel.sleep.count}',
'60天未到店',
'${widget.customerProvider.guestSunmodel.sleep.scale}'),
HEmptyView(10),
_percentWidget(
'${widget.customerProvider.guestSunmodel.drain.count}',
'120天未到店',
'${widget.customerProvider.guestSunmodel.drain.scale}'),
],
),
],
),
// ListView.builder(
// controller: _controller,
// shrinkWrap: true,
... ... @@ -972,34 +982,47 @@ class _StoreCustomerHomeRightPageState
// ],
// );
// }),
_chart(),
ListView.builder(
itemCount: widget
.customerProvider.managerStatisticsList.length,
shrinkWrap: true,
controller: _controller,
padding: EdgeInsets.symmetric(horizontal: w(10)),
itemBuilder: (context, index) {
SellerCountsListSunModel countsListSunModel =
widget.customerProvider
.managerStatisticsList[index];
return InkWell(
onTap: () {
String uid = '';
menuTitle.forEach((element) {
if (element.select) {
uid = element.uid;
}
});
NavigatorUtil.goMonthOrderPage(
context,
year.toString(),
countsListSunModel.monthss.toString(),
uid: uid);
},
child: MonthItem(
countsListSunModel: countsListSunModel));
})
if (widget.customerProvider.managerStatisticsList !=
null &&
widget.customerProvider.managerStatisticsList
.length >
0)
Column(
children: [
_chart(),
ListView.builder(
itemCount: widget.customerProvider
.managerStatisticsList.length,
shrinkWrap: true,
controller: _controller,
padding:
EdgeInsets.symmetric(horizontal: w(10)),
itemBuilder: (context, index) {
SellerCountsListSunModel
countsListSunModel = widget
.customerProvider
.managerStatisticsList[index];
return InkWell(
onTap: () {
String uid = '';
menuTitle.forEach((element) {
if (element.select) {
uid = element.uid;
}
});
NavigatorUtil.goMonthOrderPage(
context,
year.toString(),
countsListSunModel.monthss
.toString(),
uid: uid);
},
child: MonthItem(
countsListSunModel:
countsListSunModel));
})
],
)
],
),
));
... ...
... ... @@ -220,6 +220,7 @@ class CustomerProvider extends ChangeNotifier {
homeStatisticsList = data;
chartHomeDataList = chartDataTemp;
}
notifyListeners();
} else {
if (baseResp != null) {
... ... @@ -266,6 +267,7 @@ class CustomerProvider extends ChangeNotifier {
} else {
manageSelAll = true;
}
notifyListeners();
}
... ...
... ... @@ -588,13 +588,13 @@ class NavigatorUtil {
/// 客情列表
static Future<dynamic> goCustomerListPage(
BuildContext context, FromPage fromPage, String uid,
BuildContext context, FromPage fromPage, String uid, Map object,
{replace = false,
bool needBtn = false,
String index = '0',
bool distribution = false}) {
return _navigateTo(context,
"${Routes.customer_list_page}?fromPage=${FluroConvertUtils.enumToString(fromPage)}&index=$index&uid=$uid&distribution=$distribution",
"${Routes.customer_list_page}?fromPage=${FluroConvertUtils.enumToString(fromPage)}&index=$index&uid=$uid&distribution=$distribution&object=${FluroConvertUtils.object2string(object)}",
replace: replace);
}
... ... @@ -625,31 +625,32 @@ class NavigatorUtil {
/// 全店营销记录
static Future<dynamic> goMarketingRecordsPage(
BuildContext context, FromPage fromPage,
BuildContext context, FromPage fromPage, Map object,
{replace = false}) {
return _navigateTo(context,
"${Routes.marketing_records_page}?fromPage=${FluroConvertUtils.enumToString(fromPage)}",
"${Routes.marketing_records_page}?fromPage=${FluroConvertUtils.enumToString(fromPage)}&object=${FluroConvertUtils.object2string(object)}",
replace: replace);
}
/// 全店营销记录详情
static Future<dynamic> goMarketingRecordsDetailPage(
BuildContext context, String idstr,
BuildContext context, String idstr, Map object,
{replace = false}) {
return _navigateTo(
context, "${Routes.marketing_records_detail_page}?idstr=${idstr}",
return _navigateTo(context,
"${Routes.marketing_records_detail_page}?idstr=${idstr}&object=${FluroConvertUtils.object2string(object)}",
replace: replace);
}
/// 创建营销
static Future<dynamic> goMakeMarkingPage(
BuildContext context, {
BuildContext context,
Map object, {
replace = false,
MarketingByIdSunModel marketingByIdSunModel,
FromPage fromPage,
}) {
return _navigateTo(context,
"${Routes.make_marketing_page}?marketingByIdSunModel=${FluroConvertUtils.object2string(marketingByIdSunModel)}&fromPage=${FluroConvertUtils.enumToString(fromPage)}",
"${Routes.make_marketing_page}?marketingByIdSunModel=${FluroConvertUtils.object2string(marketingByIdSunModel)}&fromPage=${FluroConvertUtils.enumToString(fromPage)}&object=${FluroConvertUtils.object2string(object)}",
replace: replace);
}
... ... @@ -717,7 +718,7 @@ class NavigatorUtil {
/// 我的营销记录
static Future<dynamic> goMyMarketingRecordsPage(
BuildContext context, FromPage fromPage,String uid,
BuildContext context, FromPage fromPage, String uid,
{replace = false}) {
return _navigateTo(context,
"${Routes.my_marketing_records_page}?fromPage=${FluroConvertUtils.enumToString(fromPage)}&uid=$uid",
... ... @@ -726,7 +727,7 @@ class NavigatorUtil {
/// 我的营销记录详情 --- 个人任务
static Future<dynamic> goMyMarketingRecordsDetailPage(
BuildContext context, String idstr, SelfList selfList,String uid,
BuildContext context, String idstr, SelfList selfList, String uid,
{replace = false}) {
return _navigateTo(context,
"${Routes.my_marketing_records_detail_page}?idstr=${idstr}&selfList=${FluroConvertUtils.object2string(selfList)}&uid=$uid",
... ...
... ... @@ -242,6 +242,9 @@ import '../provider/marketing_center_provider.dart';
import '../provider/plan_dish_provider.dart';
import '../provider/store_wine_provider.dart';
import 'package:one_key/models/store_customer_home_model.dart'
as storeCustomerHomeModel;
// 登录页
var loginHandler = new Handler(
handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
... ... @@ -1073,14 +1076,26 @@ var customerListPageHandle = new Handler(
String uid = params["uid"].first;
bool distribution =
FluroConvertUtils.string2bool(params["distribution"].first);
// SellerUser sellerUser = SellerUser.fromJson(json.decode(
// FluroConvertUtils.fluroCnParamsDecode(params["sellerUser"].first)));
Map object = FluroConvertUtils.string2map(params["object"].first);
List temp = object['object'];
List<storeCustomerHomeModel.SellerUser> sellerUser = [];
for (var item in temp) {
sellerUser.add(storeCustomerHomeModel.SellerUser.fromJson(item));
}
// banquetDetail = GetBanquetByIdNewSunModel.fromJson(temp);
return ChangeNotifierProvider<CustomerProvider>(
create: (_) => CustomerProvider(),
child: CustomerListPage(
fromPage: fromPage,
index: index,
uidStr: uid,
distribution: distribution));
distribution: distribution,
sellerUser: sellerUser));
});
///仅供展示的客情列表 ---商家
... ... @@ -1137,9 +1152,16 @@ var marketingRecordsPageHandle = new Handler(
FromPage fromPage = FluroConvertUtils.enumFromString<FromPage>(
FromPage.values, params["fromPage"].first);
print(fromPage);
Map object = FluroConvertUtils.string2map(params["object"].first);
List temp = object['object'];
List<storeCustomerHomeModel.SellerUser> sellerUser = [];
for (var item in temp) {
sellerUser.add(storeCustomerHomeModel.SellerUser.fromJson(item));
}
return ChangeNotifierProvider<CustomerProvider>(
create: (_) => CustomerProvider(),
child: MarketingRecordsPage(fromPage: fromPage));
child: MarketingRecordsPage(fromPage: fromPage, sellerUser: sellerUser));
});
///我的营销记录
... ... @@ -1149,19 +1171,26 @@ var myMarketingRecordsPageHandle = new Handler(
FromPage fromPage = FluroConvertUtils.enumFromString<FromPage>(
FromPage.values, params["fromPage"].first);
print(fromPage);
String uid = params["uid"].first;
String uid = params["uid"].first;
return ChangeNotifierProvider<CustomerProvider>(
create: (_) => CustomerProvider(),
child: MyMarketingRecordsPage(fromPage: fromPage,uid:uid));
child: MyMarketingRecordsPage(fromPage: fromPage, uid: uid));
});
///全店营销记录详情
var marketingRecordsDetailPageHandle = new Handler(
handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
String idstr = params["idstr"].first;
Map object = FluroConvertUtils.string2map(params["object"].first);
List temp = object['object'];
List<storeCustomerHomeModel.SellerUser> sellerUser = [];
for (var item in temp) {
sellerUser.add(storeCustomerHomeModel.SellerUser.fromJson(item));
}
return ChangeNotifierProvider<CustomerProvider>(
create: (_) => CustomerProvider(),
child: MarketingRecordsDetailPage(idstr: idstr));
child: MarketingRecordsDetailPage(idstr: idstr, sellerUser: sellerUser));
});
///我的营销记录详情 ---- 个人任务
... ... @@ -1194,6 +1223,13 @@ var makeMarkingPageHandle = new Handler(
// String gid = params["gid"].first;
FromPage fromPage = FluroConvertUtils.enumFromString<FromPage>(
FromPage.values, params["fromPage"].first);
Map object = FluroConvertUtils.string2map(params["object"].first);
List temp = object['object'];
List<storeCustomerHomeModel.SellerUser> sellerUser = [];
for (var item in temp) {
sellerUser.add(storeCustomerHomeModel.SellerUser.fromJson(item));
}
if (fromPage == FromPage.FromPageMakeRecordDetail) {
MarketingByIdSunModel marketingByIdSunModel =
MarketingByIdSunModel.fromJson(json.decode(
... ... @@ -1202,12 +1238,14 @@ var makeMarkingPageHandle = new Handler(
return ChangeNotifierProvider<CustomerProvider>(
create: (_) => CustomerProvider(),
child: MakeMarkingPage(
marketingByIdSunModel: marketingByIdSunModel, fromPage: fromPage));
marketingByIdSunModel: marketingByIdSunModel,
fromPage: fromPage,
sellerUser: sellerUser));
}
return ChangeNotifierProvider<CustomerProvider>(
create: (_) => CustomerProvider(),
child: MakeMarkingPage(fromPage: fromPage));
child: MakeMarkingPage(fromPage: fromPage, sellerUser: sellerUser));
});
///我的创建营销
... ...