Showing
28 changed files
with
1607 additions
and
212 deletions
| @@ -83,6 +83,11 @@ class CustomerListSunModel extends Object with ISuspensionBean { | @@ -83,6 +83,11 @@ class CustomerListSunModel extends Object with ISuspensionBean { | ||
| 83 | String monthCount; | 83 | String monthCount; |
| 84 | @JsonKey(name: 'label') | 84 | @JsonKey(name: 'label') |
| 85 | String label; | 85 | String label; |
| 86 | + @JsonKey(name: 'nick_name') | ||
| 87 | + String nickName; | ||
| 88 | + @JsonKey(name: 'gid') | ||
| 89 | + String gid; | ||
| 90 | + | ||
| 86 | bool select = false; | 91 | bool select = false; |
| 87 | 92 | ||
| 88 | List<String> pinyinList; //全拼数组 | 93 | List<String> pinyinList; //全拼数组 |
| @@ -112,27 +117,30 @@ class CustomerListSunModel extends Object with ISuspensionBean { | @@ -112,27 +117,30 @@ class CustomerListSunModel extends Object with ISuspensionBean { | ||
| 112 | } | 117 | } |
| 113 | 118 | ||
| 114 | CustomerListSunModel( | 119 | CustomerListSunModel( |
| 115 | - this.id, | ||
| 116 | - this.sellerid, | ||
| 117 | - this.uid, | ||
| 118 | - this.rname, | ||
| 119 | - this.sex, | ||
| 120 | - this.phone, | ||
| 121 | - this.cdate, | ||
| 122 | - this.leiji, | ||
| 123 | - this.attr, | ||
| 124 | - this.ddate, | ||
| 125 | - this.ddateSolt, | ||
| 126 | - this.company, | ||
| 127 | - this.section, | ||
| 128 | - this.position, | ||
| 129 | - this.taboos, | ||
| 130 | - this.like, | ||
| 131 | - this.serve, | ||
| 132 | - this.cDay, | ||
| 133 | - this.udate, | ||
| 134 | - this.monthCount, | ||
| 135 | - this.label); | 120 | + this.id, |
| 121 | + this.sellerid, | ||
| 122 | + this.uid, | ||
| 123 | + this.rname, | ||
| 124 | + this.sex, | ||
| 125 | + this.phone, | ||
| 126 | + this.cdate, | ||
| 127 | + this.leiji, | ||
| 128 | + this.attr, | ||
| 129 | + this.ddate, | ||
| 130 | + this.ddateSolt, | ||
| 131 | + this.company, | ||
| 132 | + this.section, | ||
| 133 | + this.position, | ||
| 134 | + this.taboos, | ||
| 135 | + this.like, | ||
| 136 | + this.serve, | ||
| 137 | + this.cDay, | ||
| 138 | + this.udate, | ||
| 139 | + this.monthCount, | ||
| 140 | + this.label, | ||
| 141 | + this.nickName, | ||
| 142 | + this.gid, | ||
| 143 | + ); | ||
| 136 | 144 | ||
| 137 | factory CustomerListSunModel.fromJson(Map<String, dynamic> srcJson) => | 145 | factory CustomerListSunModel.fromJson(Map<String, dynamic> srcJson) => |
| 138 | _$CustomerListSunModelFromJson(srcJson); | 146 | _$CustomerListSunModelFromJson(srcJson); |
| @@ -48,6 +48,8 @@ CustomerListSunModel _$CustomerListSunModelFromJson(Map<String, dynamic> json) { | @@ -48,6 +48,8 @@ CustomerListSunModel _$CustomerListSunModelFromJson(Map<String, dynamic> json) { | ||
| 48 | json['udate'] as String, | 48 | json['udate'] as String, |
| 49 | json['month_count'] as String, | 49 | json['month_count'] as String, |
| 50 | json['label'] as String, | 50 | json['label'] as String, |
| 51 | + json['nick_name'] as String, | ||
| 52 | + json['id'] as String, | ||
| 51 | ); | 53 | ); |
| 52 | } | 54 | } |
| 53 | 55 | ||
| @@ -74,5 +76,7 @@ Map<String, dynamic> _$CustomerListSunModelToJson( | @@ -74,5 +76,7 @@ Map<String, dynamic> _$CustomerListSunModelToJson( | ||
| 74 | 'c_day': instance.cDay, | 76 | 'c_day': instance.cDay, |
| 75 | 'udate': instance.udate, | 77 | 'udate': instance.udate, |
| 76 | 'month_count': instance.monthCount, | 78 | 'month_count': instance.monthCount, |
| 77 | - 'label': instance.label | 79 | + 'label': instance.label, |
| 80 | + 'nick_name': instance.nickName, | ||
| 81 | + 'gid': instance.gid | ||
| 78 | }; | 82 | }; |
| 1 | +import 'package:json_annotation/json_annotation.dart'; | ||
| 2 | + | ||
| 3 | +part 'get_seller_user_by_sellerid_model.g.dart'; | ||
| 4 | + | ||
| 5 | +@JsonSerializable() | ||
| 6 | +class GetSellerUserBySelleridModel extends Object { | ||
| 7 | + @JsonKey(name: 'ret') | ||
| 8 | + int ret; | ||
| 9 | + | ||
| 10 | + @JsonKey(name: 'data') | ||
| 11 | + List<GetSellerUserBySelleridSunModel> data; | ||
| 12 | + | ||
| 13 | + @JsonKey(name: 'msg') | ||
| 14 | + String msg; | ||
| 15 | + | ||
| 16 | + GetSellerUserBySelleridModel( | ||
| 17 | + this.ret, | ||
| 18 | + this.data, | ||
| 19 | + this.msg, | ||
| 20 | + ); | ||
| 21 | + | ||
| 22 | + factory GetSellerUserBySelleridModel.fromJson(Map<String, dynamic> srcJson) => | ||
| 23 | + _$GetSellerUserBySelleridModelFromJson(srcJson); | ||
| 24 | + | ||
| 25 | + Map<String, dynamic> toJson() => _$GetSellerUserBySelleridModelToJson(this); | ||
| 26 | +} | ||
| 27 | + | ||
| 28 | +@JsonSerializable() | ||
| 29 | +class GetSellerUserBySelleridSunModel extends Object { | ||
| 30 | + @JsonKey(name: 'nick_name') | ||
| 31 | + String nickName; | ||
| 32 | + | ||
| 33 | + @JsonKey(name: 'id') | ||
| 34 | + String id; | ||
| 35 | + | ||
| 36 | + GetSellerUserBySelleridSunModel( | ||
| 37 | + this.nickName, | ||
| 38 | + this.id, | ||
| 39 | + ); | ||
| 40 | + | ||
| 41 | + factory GetSellerUserBySelleridSunModel.fromJson( | ||
| 42 | + Map<String, dynamic> srcJson) => | ||
| 43 | + _$GetSellerUserBySelleridSunModelFromJson(srcJson); | ||
| 44 | + | ||
| 45 | + Map<String, dynamic> toJson() => | ||
| 46 | + _$GetSellerUserBySelleridSunModelToJson(this); | ||
| 47 | +} |
| 1 | +// GENERATED CODE - DO NOT MODIFY BY HAND | ||
| 2 | + | ||
| 3 | +part of 'get_seller_user_by_sellerid_model.dart'; | ||
| 4 | + | ||
| 5 | +// ************************************************************************** | ||
| 6 | +// JsonSerializableGenerator | ||
| 7 | +// ************************************************************************** | ||
| 8 | + | ||
| 9 | +GetSellerUserBySelleridModel _$GetSellerUserBySelleridModelFromJson( | ||
| 10 | + Map<String, dynamic> json) { | ||
| 11 | + return GetSellerUserBySelleridModel( | ||
| 12 | + json['ret'] as int, | ||
| 13 | + (json['data'] as List) | ||
| 14 | + ?.map((e) => e == null | ||
| 15 | + ? null | ||
| 16 | + : GetSellerUserBySelleridSunModel.fromJson( | ||
| 17 | + e as Map<String, dynamic>)) | ||
| 18 | + ?.toList(), | ||
| 19 | + json['msg'] as String, | ||
| 20 | + ); | ||
| 21 | +} | ||
| 22 | + | ||
| 23 | +Map<String, dynamic> _$GetSellerUserBySelleridModelToJson( | ||
| 24 | + GetSellerUserBySelleridModel instance) => | ||
| 25 | + <String, dynamic>{ | ||
| 26 | + 'ret': instance.ret, | ||
| 27 | + 'data': instance.data, | ||
| 28 | + 'msg': instance.msg, | ||
| 29 | + }; | ||
| 30 | + | ||
| 31 | +GetSellerUserBySelleridSunModel _$GetSellerUserBySelleridSunModelFromJson( | ||
| 32 | + Map<String, dynamic> json) { | ||
| 33 | + return GetSellerUserBySelleridSunModel( | ||
| 34 | + json['nick_name'] as String, | ||
| 35 | + json['id'] as String, | ||
| 36 | + ); | ||
| 37 | +} | ||
| 38 | + | ||
| 39 | +Map<String, dynamic> _$GetSellerUserBySelleridSunModelToJson( | ||
| 40 | + GetSellerUserBySelleridSunModel instance) => | ||
| 41 | + <String, dynamic>{ | ||
| 42 | + 'nick_name': instance.nickName, | ||
| 43 | + 'id': instance.id, | ||
| 44 | + }; |
| @@ -99,6 +99,8 @@ class Guest extends Object { | @@ -99,6 +99,8 @@ class Guest extends Object { | ||
| 99 | 99 | ||
| 100 | @JsonKey(name: 'label') | 100 | @JsonKey(name: 'label') |
| 101 | String label; | 101 | String label; |
| 102 | + @JsonKey(name: 'nick_name') | ||
| 103 | + String nickName; | ||
| 102 | 104 | ||
| 103 | String get rnameStr { | 105 | String get rnameStr { |
| 104 | if (rname == null || rname == '') return ""; | 106 | if (rname == null || rname == '') return ""; |
| @@ -138,7 +140,8 @@ class Guest extends Object { | @@ -138,7 +140,8 @@ class Guest extends Object { | ||
| 138 | this.serve, | 140 | this.serve, |
| 139 | this.cDay, | 141 | this.cDay, |
| 140 | this.udate, | 142 | this.udate, |
| 141 | - this.label); | 143 | + this.label, |
| 144 | + this.nickName); | ||
| 142 | 145 | ||
| 143 | factory Guest.fromJson(Map<String, dynamic> srcJson) => | 146 | factory Guest.fromJson(Map<String, dynamic> srcJson) => |
| 144 | _$GuestFromJson(srcJson); | 147 | _$GuestFromJson(srcJson); |
| @@ -70,6 +70,7 @@ Guest _$GuestFromJson(Map<String, dynamic> json) { | @@ -70,6 +70,7 @@ Guest _$GuestFromJson(Map<String, dynamic> json) { | ||
| 70 | ?.toList(), | 70 | ?.toList(), |
| 71 | json['udate'] as String, | 71 | json['udate'] as String, |
| 72 | json['label'] as String, | 72 | json['label'] as String, |
| 73 | + json['nick_name'] as String, | ||
| 73 | ); | 74 | ); |
| 74 | } | 75 | } |
| 75 | 76 | ||
| @@ -90,6 +91,7 @@ Map<String, dynamic> _$GuestToJson(Guest instance) => <String, dynamic>{ | @@ -90,6 +91,7 @@ Map<String, dynamic> _$GuestToJson(Guest instance) => <String, dynamic>{ | ||
| 90 | 'c_day': instance.cDay, | 91 | 'c_day': instance.cDay, |
| 91 | 'udate': instance.udate, | 92 | 'udate': instance.udate, |
| 92 | 'label': instance.label, | 93 | 'label': instance.label, |
| 94 | + 'nick_name': instance.nickName | ||
| 93 | }; | 95 | }; |
| 94 | 96 | ||
| 95 | Cday _$CdayFromJson(Map<String, dynamic> json) { | 97 | Cday _$CdayFromJson(Map<String, dynamic> json) { |
| @@ -214,5 +214,13 @@ class HttpUrl { | @@ -214,5 +214,13 @@ class HttpUrl { | ||
| 214 | "?service=App.GuestManage.PullMarketingByUid"; // 获取推送失败的营销消息 | 214 | "?service=App.GuestManage.PullMarketingByUid"; // 获取推送失败的营销消息 |
| 215 | static const String set_pull_marketing_by_id = | 215 | static const String set_pull_marketing_by_id = |
| 216 | "?service=App.GuestManage.SetPullMarketingByid"; // 修改拉取后消息的状态 | 216 | "?service=App.GuestManage.SetPullMarketingByid"; // 修改拉取后消息的状态 |
| 217 | + static const String del_guest_cday = | ||
| 218 | + "?service=App.GuestManage.DelGuestCday"; // 删除纪念日 | ||
| 219 | + static const String set_marketing_status_by_uid = | ||
| 220 | + "?service=App.GuestManage.SetMarketingStatusByUid"; // 修改完成任务后的状态 | ||
| 221 | + static const String get_seller_user_by_sellerid = | ||
| 222 | + "?service=App.GuestManage.GetSellerUserBySellerid"; // 获取客户经理列表 | ||
| 223 | + static const String send_marketing_msg_by_mid = | ||
| 224 | + "?service=App.GuestManage.SendMarketingMsgByMid"; // 催促未完成任务经理发消息 | ||
| 217 | 225 | ||
| 218 | } | 226 | } |
| @@ -109,7 +109,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -109,7 +109,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 109 | Provider.of<UserModel>(context, listen: false) | 109 | Provider.of<UserModel>(context, listen: false) |
| 110 | .pullMarketingByUidSunModel; | 110 | .pullMarketingByUidSunModel; |
| 111 | if (data != null && data.length > 0) { | 111 | if (data != null && data.length > 0) { |
| 112 | - Future.delayed(Duration(seconds: 300), () { | 112 | + Future.delayed(Duration(milliseconds: 300), () { |
| 113 | DialogUtil.cupertinoAlertDialog(context, | 113 | DialogUtil.cupertinoAlertDialog(context, |
| 114 | title: "全店任务", | 114 | title: "全店任务", |
| 115 | content: "管理员发布了新的任务,请立即查看并完成任务", | 115 | content: "管理员发布了新的任务,请立即查看并完成任务", |
| @@ -88,8 +88,7 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> | @@ -88,8 +88,7 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> | ||
| 88 | WidgetsBinding.instance.addPostFrameCallback((_) async { | 88 | WidgetsBinding.instance.addPostFrameCallback((_) async { |
| 89 | bool first = true; | 89 | bool first = true; |
| 90 | customerProvider.index = tabController.index; | 90 | customerProvider.index = tabController.index; |
| 91 | - if (widget.fromPage == FromPage.FromPageMakeRecord || | ||
| 92 | - widget.fromPage == FromPage.FromPageMyCustomer) { | 91 | + if (widget.fromPage == FromPage.FromPageMakeRecord ) { |
| 93 | customerProvider.selectCustomer = customerMakingProvider.selectCustomer; | 92 | customerProvider.selectCustomer = customerMakingProvider.selectCustomer; |
| 94 | customerProvider.labels = customerMakingProvider.labels; | 93 | customerProvider.labels = customerMakingProvider.labels; |
| 95 | first = false; | 94 | first = false; |
| @@ -190,6 +189,8 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> | @@ -190,6 +189,8 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> | ||
| 190 | // params['reserve_sort'] 1 等于 2 小于 3 大于 | 189 | // params['reserve_sort'] 1 等于 2 小于 3 大于 |
| 191 | 190 | ||
| 192 | await customerProvider.getCustomerList(context, params); | 191 | await customerProvider.getCustomerList(context, params); |
| 192 | + | ||
| 193 | + print(first); | ||
| 193 | // if (customerProvider.userHistorys.length == | 194 | // if (customerProvider.userHistorys.length == |
| 194 | // customerProvider.selectCustomer.length) { | 195 | // customerProvider.selectCustomer.length) { |
| 195 | // customerProvider.checkValue = true; | 196 | // customerProvider.checkValue = true; |
| @@ -38,8 +38,8 @@ class _MyCustomerPageState extends State<MyCustomerPage> { | @@ -38,8 +38,8 @@ class _MyCustomerPageState extends State<MyCustomerPage> { | ||
| 38 | 38 | ||
| 39 | _getMarketingByUid(); | 39 | _getMarketingByUid(); |
| 40 | }); | 40 | }); |
| 41 | - | ||
| 42 | bus.on("refresh_my_customer_home", (arg) { | 41 | bus.on("refresh_my_customer_home", (arg) { |
| 42 | + _getGuestManageData(isShowLoading: false); | ||
| 43 | _getMarketingByUid(); | 43 | _getMarketingByUid(); |
| 44 | }); | 44 | }); |
| 45 | } | 45 | } |
| @@ -52,9 +52,9 @@ class _MyCustomerPageState extends State<MyCustomerPage> { | @@ -52,9 +52,9 @@ class _MyCustomerPageState extends State<MyCustomerPage> { | ||
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | ///我的客户首页 | 54 | ///我的客户首页 |
| 55 | - _getGuestManageData() async { | ||
| 56 | - GuestManageSunModel model = | ||
| 57 | - await customerProvider.getGuestManageData(context); | 55 | + _getGuestManageData({bool isShowLoading = true}) async { |
| 56 | + GuestManageSunModel model = await customerProvider | ||
| 57 | + .getGuestManageData(context, isShowLoading: isShowLoading); | ||
| 58 | // setState(() {}); | 58 | // setState(() {}); |
| 59 | } | 59 | } |
| 60 | 60 |
| @@ -62,6 +62,22 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> { | @@ -62,6 +62,22 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> { | ||
| 62 | } | 62 | } |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | + _delGuestInfocDay(String id) async { | ||
| 66 | + Map<String, String> params = {"id": id}; | ||
| 67 | + bool sucess = | ||
| 68 | + await customerProvider.delGuestCday(context, params, showLoading: true); | ||
| 69 | + if (sucess) { | ||
| 70 | + Utils.showToast('删除成功'); | ||
| 71 | + //刷新当前页 | ||
| 72 | + _getGuestInfoCday(); | ||
| 73 | + // 刷新 | ||
| 74 | + bus.emit('refresh_guest_info'); | ||
| 75 | + bus.emit('refresh_guest_list'); | ||
| 76 | + // Navigator.pop(context); | ||
| 77 | + | ||
| 78 | + } | ||
| 79 | + } | ||
| 80 | + | ||
| 65 | @override | 81 | @override |
| 66 | Widget build(BuildContext context) { | 82 | Widget build(BuildContext context) { |
| 67 | customerProvider = Provider.of<CustomerProvider>(context, listen: true); | 83 | customerProvider = Provider.of<CustomerProvider>(context, listen: true); |
| @@ -140,6 +156,15 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> { | @@ -140,6 +156,15 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> { | ||
| 140 | print(name); | 156 | print(name); |
| 141 | _setGuestInfocDay(model.cday[index].id, name); | 157 | _setGuestInfocDay(model.cday[index].id, name); |
| 142 | // _addCookbookClass(name, showLoading: true); | 158 | // _addCookbookClass(name, showLoading: true); |
| 159 | + }, delCallback: () { | ||
| 160 | + //弹框确认是否删除 | ||
| 161 | + DialogUtil.cupertinoAlertDialog(context, | ||
| 162 | + title: "", | ||
| 163 | + content: "是否确定删除该纪念日", | ||
| 164 | + rTitle: "确定删除", rCallback: () { | ||
| 165 | + Navigator.pop(context); | ||
| 166 | + _delGuestInfocDay(model.cday[index].id); | ||
| 167 | + }); | ||
| 143 | }, | 168 | }, |
| 144 | yearStr: yearStr, | 169 | yearStr: yearStr, |
| 145 | monthStr: monthStr, | 170 | monthStr: monthStr, |
| @@ -183,12 +208,16 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> { | @@ -183,12 +208,16 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> { | ||
| 183 | fontSize: 26, | 208 | fontSize: 26, |
| 184 | isBold: false, | 209 | isBold: false, |
| 185 | onPressed: () { | 210 | onPressed: () { |
| 186 | - DialogUtil.festivalAlertDialog(context, '', 520, | ||
| 187 | - rCallback: (name) { | ||
| 188 | - print(name); | ||
| 189 | - _setGuestInfocDay('', name); | ||
| 190 | - // _addCookbookClass(name, showLoading: true); | ||
| 191 | - }); | 211 | + DialogUtil.festivalAlertDialog( |
| 212 | + context, | ||
| 213 | + '', | ||
| 214 | + 520, | ||
| 215 | + rCallback: (name) { | ||
| 216 | + print(name); | ||
| 217 | + _setGuestInfocDay('', name); | ||
| 218 | + // _addCookbookClass(name, showLoading: true); | ||
| 219 | + }, | ||
| 220 | + ); | ||
| 192 | }, | 221 | }, |
| 193 | ), | 222 | ), |
| 194 | VEmptyView(30) | 223 | VEmptyView(30) |
| @@ -14,6 +14,7 @@ import 'package:one_key/provider/user_model.dart'; | @@ -14,6 +14,7 @@ import 'package:one_key/provider/user_model.dart'; | ||
| 14 | import 'package:one_key/res/colors.dart'; | 14 | import 'package:one_key/res/colors.dart'; |
| 15 | import 'package:one_key/route/navigator_util.dart'; | 15 | import 'package:one_key/route/navigator_util.dart'; |
| 16 | import 'package:one_key/utils/dialog_util.dart'; | 16 | import 'package:one_key/utils/dialog_util.dart'; |
| 17 | +import 'package:one_key/utils/event_bus.dart'; | ||
| 17 | import 'package:one_key/utils/utils.dart'; | 18 | import 'package:one_key/utils/utils.dart'; |
| 18 | import 'package:one_key/widgets/h_empty_view.dart'; | 19 | import 'package:one_key/widgets/h_empty_view.dart'; |
| 19 | import 'package:one_key/widgets/round_button.dart'; | 20 | import 'package:one_key/widgets/round_button.dart'; |
| @@ -34,7 +35,8 @@ class MyMakeMarkingPageOnlyShow extends StatefulWidget { | @@ -34,7 +35,8 @@ class MyMakeMarkingPageOnlyShow extends StatefulWidget { | ||
| 34 | _MyMakeMarkingPageOnlyShowState(); | 35 | _MyMakeMarkingPageOnlyShowState(); |
| 35 | } | 36 | } |
| 36 | 37 | ||
| 37 | -class _MyMakeMarkingPageOnlyShowState extends State<MyMakeMarkingPageOnlyShow> { | 38 | +class _MyMakeMarkingPageOnlyShowState extends State<MyMakeMarkingPageOnlyShow> |
| 39 | + with WidgetsBindingObserver { | ||
| 38 | List<String> couponList = []; | 40 | List<String> couponList = []; |
| 39 | 41 | ||
| 40 | final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); | 42 | final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); |
| @@ -51,7 +53,7 @@ class _MyMakeMarkingPageOnlyShowState extends State<MyMakeMarkingPageOnlyShow> { | @@ -51,7 +53,7 @@ class _MyMakeMarkingPageOnlyShowState extends State<MyMakeMarkingPageOnlyShow> { | ||
| 51 | @override | 53 | @override |
| 52 | void initState() { | 54 | void initState() { |
| 53 | super.initState(); | 55 | super.initState(); |
| 54 | - | 56 | + WidgetsBinding.instance.addObserver(this); |
| 55 | _focusNode.addListener(() { | 57 | _focusNode.addListener(() { |
| 56 | if (_focusNode.hasFocus) { | 58 | if (_focusNode.hasFocus) { |
| 57 | //有焦点 | 59 | //有焦点 |
| @@ -87,8 +89,33 @@ class _MyMakeMarkingPageOnlyShowState extends State<MyMakeMarkingPageOnlyShow> { | @@ -87,8 +89,33 @@ class _MyMakeMarkingPageOnlyShowState extends State<MyMakeMarkingPageOnlyShow> { | ||
| 87 | } | 89 | } |
| 88 | 90 | ||
| 89 | @override | 91 | @override |
| 92 | + void didChangeAppLifecycleState(AppLifecycleState state) async { | ||
| 93 | + // TODO: implement didChangeAppLifecycleState | ||
| 94 | + super.didChangeAppLifecycleState(state); | ||
| 95 | + switch (state) { | ||
| 96 | + case AppLifecycleState.resumed: //应用前台可见 | ||
| 97 | + // _getSmsInfo(context); | ||
| 98 | + print('fff'); | ||
| 99 | + _refresh(); | ||
| 100 | + break; | ||
| 101 | + case AppLifecycleState.inactive: | ||
| 102 | + print('inactive'); | ||
| 103 | + break; | ||
| 104 | + case AppLifecycleState.paused: | ||
| 105 | + print('paused'); | ||
| 106 | + break; | ||
| 107 | + case AppLifecycleState.detached: | ||
| 108 | + print('detached'); | ||
| 109 | + break; | ||
| 110 | + default: | ||
| 111 | + break; | ||
| 112 | + } | ||
| 113 | + } | ||
| 114 | + | ||
| 115 | + @override | ||
| 90 | void dispose() { | 116 | void dispose() { |
| 91 | super.dispose(); | 117 | super.dispose(); |
| 118 | + WidgetsBinding.instance.removeObserver(this); | ||
| 92 | if (needClear) { | 119 | if (needClear) { |
| 93 | customerMakingProvider.clearData(); | 120 | customerMakingProvider.clearData(); |
| 94 | } | 121 | } |
| @@ -172,18 +199,30 @@ class _MyMakeMarkingPageOnlyShowState extends State<MyMakeMarkingPageOnlyShow> { | @@ -172,18 +199,30 @@ class _MyMakeMarkingPageOnlyShowState extends State<MyMakeMarkingPageOnlyShow> { | ||
| 172 | } | 199 | } |
| 173 | } | 200 | } |
| 174 | 201 | ||
| 175 | - _createMarketing() async { | ||
| 176 | - //这块需要调用经理完成全店任务的接口,不是经理创建营销的接口 | ||
| 177 | - // Map<String, String> params = { | ||
| 178 | - // "uid": Provider.of<UserModel>(context, listen: false).user.openid, | ||
| 179 | - // "gid": gid, | ||
| 180 | - // "content": customerMakingProvider.controller.text | ||
| 181 | - // }; | ||
| 182 | - // if (widget.sellerList.aid != null) { | ||
| 183 | - // params['aid'] = widget.sellerList.aid; | 202 | + _setMarketingStatusByUid() async { |
| 203 | + // 这块需要调用经理完成全店任务的接口,不是经理创建营销的接口 | ||
| 204 | + Map<String, String> params = { | ||
| 205 | + "uid": Provider.of<UserModel>(context, listen: false).user.openid, | ||
| 206 | + "gid": gid, | ||
| 207 | + "mid": widget.sellerList.id //任务id | ||
| 208 | + }; | ||
| 209 | + | ||
| 210 | + bool sucess = await customerProvider | ||
| 211 | + .setMarketingStatusByUid(context, params, showLoading: true); | ||
| 212 | + // if (sucess) { | ||
| 213 | + // bus.emit("refresh_my_customer_home"); | ||
| 214 | + // bus.emit('refresh_my_records_page'); | ||
| 215 | + // bus.emit('refresh_my_records_detail_seller_page'); | ||
| 184 | // } | 216 | // } |
| 185 | - // await customerProvider.createMarketing(context, params, showLoading: true); | ||
| 186 | - // _goSms(); | 217 | + // Future.delayed(Duration(milliseconds: 300), () { |
| 218 | + _goSms(); | ||
| 219 | + // }); | ||
| 220 | + } | ||
| 221 | + | ||
| 222 | + _refresh() { | ||
| 223 | + bus.emit("refresh_my_customer_home"); | ||
| 224 | + bus.emit('refresh_my_records_page'); | ||
| 225 | + bus.emit('refresh_my_records_detail_seller_page'); | ||
| 187 | } | 226 | } |
| 188 | 227 | ||
| 189 | _goSms() async { | 228 | _goSms() async { |
| @@ -192,12 +231,13 @@ class _MyMakeMarkingPageOnlyShowState extends State<MyMakeMarkingPageOnlyShow> { | @@ -192,12 +231,13 @@ class _MyMakeMarkingPageOnlyShowState extends State<MyMakeMarkingPageOnlyShow> { | ||
| 192 | // print('取消发送'); | 231 | // print('取消发送'); |
| 193 | // }, rCallback: () async { | 232 | // }, rCallback: () async { |
| 194 | String message = customerMakingProvider.controller.text; | 233 | String message = customerMakingProvider.controller.text; |
| 234 | + bool sucess = false; | ||
| 195 | if (Platform.isIOS) { | 235 | if (Platform.isIOS) { |
| 196 | // List<String> phoneNumber = ['18161963378', '18729572142', '18765432345']; | 236 | // List<String> phoneNumber = ['18161963378', '18729572142', '18765432345']; |
| 197 | 237 | ||
| 198 | try { | 238 | try { |
| 199 | String _result = await sendSMS(message: message, recipients: iosPhone); | 239 | String _result = await sendSMS(message: message, recipients: iosPhone); |
| 200 | - print(_result); | 240 | + // sucess = _result; |
| 201 | } catch (error) { | 241 | } catch (error) { |
| 202 | print(error.toString()); | 242 | print(error.toString()); |
| 203 | } | 243 | } |
| @@ -208,7 +248,7 @@ class _MyMakeMarkingPageOnlyShowState extends State<MyMakeMarkingPageOnlyShow> { | @@ -208,7 +248,7 @@ class _MyMakeMarkingPageOnlyShowState extends State<MyMakeMarkingPageOnlyShow> { | ||
| 208 | // await Sendsms.onGetPermission(); | 248 | // await Sendsms.onGetPermission(); |
| 209 | 249 | ||
| 210 | // if (await Sendsms.hasPermission()) { | 250 | // if (await Sendsms.hasPermission()) { |
| 211 | - await Sendsms.onSendSMS(andriodPhone, message); | 251 | + sucess = await Sendsms.onSendSMS(andriodPhone, message); |
| 212 | } | 252 | } |
| 213 | 253 | ||
| 214 | // } | 254 | // } |
| @@ -476,7 +516,7 @@ class _MyMakeMarkingPageOnlyShowState extends State<MyMakeMarkingPageOnlyShow> { | @@ -476,7 +516,7 @@ class _MyMakeMarkingPageOnlyShowState extends State<MyMakeMarkingPageOnlyShow> { | ||
| 476 | InkWell( | 516 | InkWell( |
| 477 | onTap: () { | 517 | onTap: () { |
| 478 | needClear = false; | 518 | needClear = false; |
| 479 | - NavigatorUtil.goShowCustomerListPage( | 519 | + NavigatorUtil.goMyShowCustomerListPage( |
| 480 | context, | 520 | context, |
| 481 | FromPage.FromPageMakeRecordDetail, | 521 | FromPage.FromPageMakeRecordDetail, |
| 482 | widget.sellerList.gid); | 522 | widget.sellerList.gid); |
| @@ -514,7 +554,7 @@ class _MyMakeMarkingPageOnlyShowState extends State<MyMakeMarkingPageOnlyShow> { | @@ -514,7 +554,7 @@ class _MyMakeMarkingPageOnlyShowState extends State<MyMakeMarkingPageOnlyShow> { | ||
| 514 | isBold: false, | 554 | isBold: false, |
| 515 | onPressed: () { | 555 | onPressed: () { |
| 516 | //群发短信 | 556 | //群发短信 |
| 517 | - _createMarketing(); | 557 | + _setMarketingStatusByUid(); |
| 518 | }, | 558 | }, |
| 519 | ), | 559 | ), |
| 520 | VEmptyView(30), | 560 | VEmptyView(30), |
| @@ -176,7 +176,7 @@ class _MyMarketingRecordsDetailPageState | @@ -176,7 +176,7 @@ class _MyMarketingRecordsDetailPageState | ||
| 176 | HEmptyView(10), | 176 | HEmptyView(10), |
| 177 | InkWell( | 177 | InkWell( |
| 178 | onTap: () { | 178 | onTap: () { |
| 179 | - NavigatorUtil.goShowCustomerListPage( | 179 | + NavigatorUtil.goMyShowCustomerListPage( |
| 180 | context, | 180 | context, |
| 181 | FromPage.FromPageMakeRecordDetail, | 181 | FromPage.FromPageMakeRecordDetail, |
| 182 | widget.selfList.gid); | 182 | widget.selfList.gid); |
| @@ -8,6 +8,7 @@ import 'package:one_key/provider/user_model.dart'; | @@ -8,6 +8,7 @@ import 'package:one_key/provider/user_model.dart'; | ||
| 8 | import 'package:one_key/res/colors.dart'; | 8 | import 'package:one_key/res/colors.dart'; |
| 9 | import 'package:one_key/route/navigator_util.dart'; | 9 | import 'package:one_key/route/navigator_util.dart'; |
| 10 | import 'package:one_key/utils/dialog_util.dart'; | 10 | import 'package:one_key/utils/dialog_util.dart'; |
| 11 | +import 'package:one_key/utils/event_bus.dart'; | ||
| 11 | import 'package:one_key/utils/utils.dart'; | 12 | import 'package:one_key/utils/utils.dart'; |
| 12 | import 'package:one_key/widgets/h_empty_view.dart'; | 13 | import 'package:one_key/widgets/h_empty_view.dart'; |
| 13 | import 'package:one_key/widgets/page_exception.dart'; | 14 | import 'package:one_key/widgets/page_exception.dart'; |
| @@ -46,10 +47,15 @@ class _SellerMyMarketingRecordsDetailPageState | @@ -46,10 +47,15 @@ class _SellerMyMarketingRecordsDetailPageState | ||
| 46 | _getMarketingByUid(); | 47 | _getMarketingByUid(); |
| 47 | // _couponNetworkData(); | 48 | // _couponNetworkData(); |
| 48 | }); | 49 | }); |
| 50 | + | ||
| 51 | + bus.on("refresh_my_records_detail_seller_page", (arg) { | ||
| 52 | + _getMarketingByUid(); | ||
| 53 | + }); | ||
| 49 | } | 54 | } |
| 50 | 55 | ||
| 51 | @override | 56 | @override |
| 52 | void dispose() { | 57 | void dispose() { |
| 58 | + bus.off('refresh_my_records_detail_seller_page'); | ||
| 53 | super.dispose(); | 59 | super.dispose(); |
| 54 | } | 60 | } |
| 55 | 61 | ||
| @@ -239,7 +245,7 @@ class _SellerMyMarketingRecordsDetailPageState | @@ -239,7 +245,7 @@ class _SellerMyMarketingRecordsDetailPageState | ||
| 239 | )), | 245 | )), |
| 240 | InkWell( | 246 | InkWell( |
| 241 | onTap: () { | 247 | onTap: () { |
| 242 | - NavigatorUtil.goShowCustomerListPage( | 248 | + NavigatorUtil.goMyShowCustomerListPage( |
| 243 | context, | 249 | context, |
| 244 | FromPage.FromPageStoreCustomer, | 250 | FromPage.FromPageStoreCustomer, |
| 245 | sellerList.gid); | 251 | sellerList.gid); |
| @@ -27,17 +27,17 @@ import 'package:provider/provider.dart'; | @@ -27,17 +27,17 @@ import 'package:provider/provider.dart'; | ||
| 27 | 27 | ||
| 28 | typedef ClickCallback = void Function(dynamic value); | 28 | typedef ClickCallback = void Function(dynamic value); |
| 29 | 29 | ||
| 30 | -class ShowCustomerListPage extends StatefulWidget { | 30 | +class MyShowCustomerListPage extends StatefulWidget { |
| 31 | final FromPage fromPage; | 31 | final FromPage fromPage; |
| 32 | final String gid; | 32 | final String gid; |
| 33 | 33 | ||
| 34 | - const ShowCustomerListPage({Key key, this.fromPage, this.gid}) | 34 | + const MyShowCustomerListPage({Key key, this.fromPage, this.gid}) |
| 35 | : super(key: key); | 35 | : super(key: key); |
| 36 | @override | 36 | @override |
| 37 | - _ShowCustomerListPageState createState() => _ShowCustomerListPageState(); | 37 | + _MyShowCustomerListPageState createState() => _MyShowCustomerListPageState(); |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | -class _ShowCustomerListPageState extends State<ShowCustomerListPage> | 40 | +class _MyShowCustomerListPageState extends State<MyShowCustomerListPage> |
| 41 | with TickerProviderStateMixin, SingleTickerProviderStateMixin { | 41 | with TickerProviderStateMixin, SingleTickerProviderStateMixin { |
| 42 | List _tabBarTitle; | 42 | List _tabBarTitle; |
| 43 | TabController tabController; | 43 | TabController tabController; |
| @@ -114,15 +114,17 @@ class _ContactListPageState extends State<ContactListPage> { | @@ -114,15 +114,17 @@ class _ContactListPageState extends State<ContactListPage> { | ||
| 114 | GestureDetector( | 114 | GestureDetector( |
| 115 | behavior: HitTestBehavior.opaque, | 115 | behavior: HitTestBehavior.opaque, |
| 116 | onTap: () { | 116 | onTap: () { |
| 117 | - List<CustomerBySellerSunModel> data = | ||
| 118 | - widget.provider.customerBySellerList; | ||
| 119 | - data[index].select = !data[index].select; | ||
| 120 | - if (data[index].select) { | ||
| 121 | - widget.provider.addData(index); | ||
| 122 | - } else { | ||
| 123 | - widget.provider.cancelData(index); | 117 | + if (model.gid != null) { |
| 118 | + List<CustomerBySellerSunModel> data = | ||
| 119 | + widget.provider.customerBySellerList; | ||
| 120 | + data[index].select = !data[index].select; | ||
| 121 | + if (data[index].select) { | ||
| 122 | + widget.provider.addData(index); | ||
| 123 | + } else { | ||
| 124 | + widget.provider.cancelData(index); | ||
| 125 | + } | ||
| 126 | + widget.provider.getCheckValue(); | ||
| 124 | } | 127 | } |
| 125 | - widget.provider.getCheckValue(); | ||
| 126 | }, | 128 | }, |
| 127 | child: Stack( | 129 | child: Stack( |
| 128 | alignment: Alignment.bottomCenter, | 130 | alignment: Alignment.bottomCenter, |
| @@ -144,13 +146,15 @@ class _ContactListPageState extends State<ContactListPage> { | @@ -144,13 +146,15 @@ class _ContactListPageState extends State<ContactListPage> { | ||
| 144 | fontSize: ScreenUtil().setSp(42)), | 146 | fontSize: ScreenUtil().setSp(42)), |
| 145 | ), | 147 | ), |
| 146 | ), | 148 | ), |
| 147 | - Positioned( | ||
| 148 | - left: ScreenUtil().setWidth(-18), | ||
| 149 | - child: Image.asset( | ||
| 150 | - Utils.getImgPath( | ||
| 151 | - model.select ? 'select' : 'unselect'), | ||
| 152 | - width: ScreenUtil().setWidth(36), | ||
| 153 | - )) | 149 | + widget.fromPage == FromPage.FromPageShowCutomerList |
| 150 | + ? SizedBox() | ||
| 151 | + : Positioned( | ||
| 152 | + left: ScreenUtil().setWidth(-18), | ||
| 153 | + child: Image.asset( | ||
| 154 | + Utils.getImgPath( | ||
| 155 | + model.select ? 'select' : 'unselect'), | ||
| 156 | + width: ScreenUtil().setWidth(36), | ||
| 157 | + )) | ||
| 154 | ]), | 158 | ]), |
| 155 | Positioned( | 159 | Positioned( |
| 156 | bottom: ScreenUtil().setWidth(-20), | 160 | bottom: ScreenUtil().setWidth(-20), |
| @@ -189,9 +193,11 @@ class _ContactListPageState extends State<ContactListPage> { | @@ -189,9 +193,11 @@ class _ContactListPageState extends State<ContactListPage> { | ||
| 189 | child: GestureDetector( | 193 | child: GestureDetector( |
| 190 | behavior: HitTestBehavior.opaque, | 194 | behavior: HitTestBehavior.opaque, |
| 191 | onTap: () { | 195 | onTap: () { |
| 192 | - if (model.gid != null) { | 196 | + if (model.gid != null && |
| 197 | + widget.fromPage != | ||
| 198 | + FromPage.FromPageShowCutomerList) { | ||
| 193 | NavigatorUtil.goCustomerDetailPage( | 199 | NavigatorUtil.goCustomerDetailPage( |
| 194 | - context, model, widget.fromPage, model.nickName); | 200 | + context, model, widget.fromPage); |
| 195 | } | 201 | } |
| 196 | }, | 202 | }, |
| 197 | child: Column( | 203 | child: Column( |
| @@ -2,7 +2,9 @@ import 'package:flutter/material.dart'; | @@ -2,7 +2,9 @@ import 'package:flutter/material.dart'; | ||
| 2 | import 'package:flutter_screenutil/screenutil.dart'; | 2 | import 'package:flutter_screenutil/screenutil.dart'; |
| 3 | import 'package:one_key/constant/state.dart'; | 3 | import 'package:one_key/constant/state.dart'; |
| 4 | import 'package:one_key/models/customer_label_model.dart'; | 4 | import 'package:one_key/models/customer_label_model.dart'; |
| 5 | +import 'package:one_key/models/filter_btn_model.dart'; | ||
| 5 | import 'package:one_key/models/guest_info_model.dart'; | 6 | import 'package:one_key/models/guest_info_model.dart'; |
| 7 | +import 'package:one_key/models/store_customer_home_model.dart'; | ||
| 6 | import 'package:one_key/provider/customer_provider.dart'; | 8 | import 'package:one_key/provider/customer_provider.dart'; |
| 7 | import 'package:one_key/provider/user_model.dart'; | 9 | import 'package:one_key/provider/user_model.dart'; |
| 8 | import 'package:one_key/res/colors.dart'; | 10 | import 'package:one_key/res/colors.dart'; |
| @@ -45,6 +47,7 @@ class _CustomerDetailEditPageState extends State<CustomerDetailEditPage> { | @@ -45,6 +47,7 @@ class _CustomerDetailEditPageState extends State<CustomerDetailEditPage> { | ||
| 45 | 47 | ||
| 46 | CustomerProvider customerProvider; | 48 | CustomerProvider customerProvider; |
| 47 | String labelShow = ''; | 49 | String labelShow = ''; |
| 50 | + String manageShow = ''; | ||
| 48 | ScrollController scrollController = ScrollController(); | 51 | ScrollController scrollController = ScrollController(); |
| 49 | @override | 52 | @override |
| 50 | void initState() { | 53 | void initState() { |
| @@ -82,15 +85,16 @@ class _CustomerDetailEditPageState extends State<CustomerDetailEditPage> { | @@ -82,15 +85,16 @@ class _CustomerDetailEditPageState extends State<CustomerDetailEditPage> { | ||
| 82 | xhController.text = widget.guest.like ?? ''; | 85 | xhController.text = widget.guest.like ?? ''; |
| 83 | fwController.text = widget.guest.serve ?? ''; | 86 | fwController.text = widget.guest.serve ?? ''; |
| 84 | labelShow = widget.guest.label ?? ''; | 87 | labelShow = widget.guest.label ?? ''; |
| 88 | + manageShow = widget.guest.nickName ?? ''; | ||
| 85 | setState(() {}); | 89 | setState(() {}); |
| 86 | _getLabelBySellerid(); | 90 | _getLabelBySellerid(); |
| 91 | + _getSellerUserBySellerid(); | ||
| 87 | // scrollController.jumpTo(scrollController.position.minScrollExtent); | 92 | // scrollController.jumpTo(scrollController.position.minScrollExtent); |
| 88 | }); | 93 | }); |
| 89 | } | 94 | } |
| 90 | 95 | ||
| 91 | ///获取商家标签 | 96 | ///获取商家标签 |
| 92 | _getLabelBySellerid() async { | 97 | _getLabelBySellerid() async { |
| 93 | - | ||
| 94 | List<CustomerLabelSunModel> modelLabel = | 98 | List<CustomerLabelSunModel> modelLabel = |
| 95 | await customerProvider.getLabelBySellerid(context); | 99 | await customerProvider.getLabelBySellerid(context); |
| 96 | 100 | ||
| @@ -103,6 +107,17 @@ class _CustomerDetailEditPageState extends State<CustomerDetailEditPage> { | @@ -103,6 +107,17 @@ class _CustomerDetailEditPageState extends State<CustomerDetailEditPage> { | ||
| 103 | } | 107 | } |
| 104 | } | 108 | } |
| 105 | 109 | ||
| 110 | + ///商家编辑页面 ----- 获取经理数据 | ||
| 111 | + _getSellerUserBySellerid() async { | ||
| 112 | + await customerProvider.getSellerUserBySellerid(context); | ||
| 113 | + | ||
| 114 | + for (int i = 0; i < customerProvider.sellerManageList.length; i++) { | ||
| 115 | + if (manageShow == customerProvider.sellerManageList[i].title) { | ||
| 116 | + customerProvider.manageSelIndex = i; | ||
| 117 | + } | ||
| 118 | + } | ||
| 119 | + } | ||
| 120 | + | ||
| 106 | _setGuestInfo() async { | 121 | _setGuestInfo() async { |
| 107 | if (nameStr.trim().length == 0) { | 122 | if (nameStr.trim().length == 0) { |
| 108 | Utils.showToast('请填写客户姓名'); | 123 | Utils.showToast('请填写客户姓名'); |
| @@ -137,6 +152,10 @@ class _CustomerDetailEditPageState extends State<CustomerDetailEditPage> { | @@ -137,6 +152,10 @@ class _CustomerDetailEditPageState extends State<CustomerDetailEditPage> { | ||
| 137 | if (labelShow != '') { | 152 | if (labelShow != '') { |
| 138 | params['label'] = labelShow; | 153 | params['label'] = labelShow; |
| 139 | } | 154 | } |
| 155 | + if (manageShow != '') { | ||
| 156 | + params['uid'] = | ||
| 157 | + customerProvider.sellerManageList[customerProvider.manageSelIndex].id; | ||
| 158 | + } | ||
| 140 | if (jkController.text.trim().length > 0) { | 159 | if (jkController.text.trim().length > 0) { |
| 141 | params['taboos'] = jkController.text; | 160 | params['taboos'] = jkController.text; |
| 142 | } | 161 | } |
| @@ -150,10 +169,11 @@ class _CustomerDetailEditPageState extends State<CustomerDetailEditPage> { | @@ -150,10 +169,11 @@ class _CustomerDetailEditPageState extends State<CustomerDetailEditPage> { | ||
| 150 | await customerProvider.setGuestInfo(context, params, showLoading: true); | 169 | await customerProvider.setGuestInfo(context, params, showLoading: true); |
| 151 | if (sucess) { | 170 | if (sucess) { |
| 152 | Utils.showToast('保存成功'); | 171 | Utils.showToast('保存成功'); |
| 172 | + // 刷新前一页 | ||
| 153 | bus.emit('refresh_guest_info'); | 173 | bus.emit('refresh_guest_info'); |
| 154 | bus.emit('refresh_guest_list'); | 174 | bus.emit('refresh_guest_list'); |
| 175 | + bus.emit('refresh_store_customer_home'); //编辑经理后需要刷新 | ||
| 155 | Navigator.pop(context); | 176 | Navigator.pop(context); |
| 156 | - // 刷新前一页 | ||
| 157 | } | 177 | } |
| 158 | } | 178 | } |
| 159 | 179 | ||
| @@ -568,68 +588,80 @@ class _CustomerDetailEditPageState extends State<CustomerDetailEditPage> { | @@ -568,68 +588,80 @@ class _CustomerDetailEditPageState extends State<CustomerDetailEditPage> { | ||
| 568 | ], | 588 | ], |
| 569 | ), | 589 | ), |
| 570 | )), | 590 | )), |
| 571 | - InkWell( | ||
| 572 | - onTap: () { | ||
| 573 | - // DialogUtil.showSelectCusmanDialog( | ||
| 574 | - // context, couponList, (value) { | ||
| 575 | - // if (value != null) { | ||
| 576 | - // setState(() { | ||
| 577 | - // couponSelectIndex = value.first; | ||
| 578 | - // }); | ||
| 579 | - // } | ||
| 580 | - // }, | ||
| 581 | - // selecteds: couponSelectIndex == null | ||
| 582 | - // ? [] | ||
| 583 | - // : [couponSelectIndex]) | ||
| 584 | - // .then((value) {}); | ||
| 585 | - }, | ||
| 586 | - child: Container( | ||
| 587 | - // height: ScreenUtil().setWidth(60), | ||
| 588 | - padding: EdgeInsets.symmetric( | ||
| 589 | - vertical: ScreenUtil().setWidth(50)), | ||
| 590 | - decoration: BoxDecoration( | ||
| 591 | - border: Border( | ||
| 592 | - bottom: BorderSide( | ||
| 593 | - width: ScreenUtil().setWidth(2), | ||
| 594 | - color: Color.fromRGBO( | ||
| 595 | - 220, 220, 220, 1)))), | ||
| 596 | - child: Row( | ||
| 597 | - mainAxisAlignment: | ||
| 598 | - MainAxisAlignment.spaceBetween, | ||
| 599 | - crossAxisAlignment: | ||
| 600 | - CrossAxisAlignment.center, | ||
| 601 | - children: [ | ||
| 602 | - Container( | ||
| 603 | - // color: Colors.red, | ||
| 604 | - width: ScreenUtil().setWidth(150), | ||
| 605 | - height: ScreenUtil().setWidth(35), | ||
| 606 | - child: Text( | ||
| 607 | - '客户经理', | ||
| 608 | - style: TextStyle( | ||
| 609 | - fontSize: ScreenUtil().setSp(28), | ||
| 610 | - color: MyColours.color_333333), | ||
| 611 | - ), | ||
| 612 | - ), | ||
| 613 | - Expanded( | ||
| 614 | - child: Text( | ||
| 615 | - 'xxxj', | ||
| 616 | - overflow: TextOverflow.ellipsis, | ||
| 617 | - style: TextStyle( | ||
| 618 | - color: MyColours.color_333333, | 591 | + InkWell( |
| 592 | + onTap: () { | ||
| 593 | + FocusScope.of(context) | ||
| 594 | + .requestFocus(FocusNode()); //隐藏键盘 | ||
| 595 | + DialogUtil.showSelectCusmanDialog( | ||
| 596 | + context, | ||
| 597 | + customerProvider.sellerManageList | ||
| 598 | + .map((item) { | ||
| 599 | + return item.title; | ||
| 600 | + }).toList(), (value) { | ||
| 601 | + if (value != null) { | ||
| 602 | + setState(() { | ||
| 603 | + customerProvider.manageSelIndex = | ||
| 604 | + value.first; | ||
| 605 | + manageShow = customerProvider | ||
| 606 | + .sellerManageList[ | ||
| 607 | + customerProvider.manageSelIndex] | ||
| 608 | + .title; | ||
| 609 | + }); | ||
| 610 | + } | ||
| 611 | + }, | ||
| 612 | + selecteds: customerProvider | ||
| 613 | + .manageSelIndex == | ||
| 614 | + null | ||
| 615 | + ? [] | ||
| 616 | + : [customerProvider.manageSelIndex]) | ||
| 617 | + .then((value) {}); | ||
| 618 | + }, | ||
| 619 | + child: Container( | ||
| 620 | + // height: ScreenUtil().setWidth(60), | ||
| 621 | + padding: EdgeInsets.symmetric( | ||
| 622 | + vertical: ScreenUtil().setWidth(50)), | ||
| 623 | + decoration: BoxDecoration( | ||
| 624 | + border: Border( | ||
| 625 | + bottom: BorderSide( | ||
| 626 | + width: ScreenUtil().setWidth(2), | ||
| 627 | + color: Color.fromRGBO( | ||
| 628 | + 220, 220, 220, 1)))), | ||
| 629 | + child: Row( | ||
| 630 | + mainAxisAlignment: | ||
| 631 | + MainAxisAlignment.spaceBetween, | ||
| 632 | + crossAxisAlignment: CrossAxisAlignment.center, | ||
| 633 | + children: [ | ||
| 634 | + Container( | ||
| 635 | + // color: Colors.red, | ||
| 636 | + width: ScreenUtil().setWidth(150), | ||
| 637 | + height: ScreenUtil().setWidth(35), | ||
| 638 | + child: Text( | ||
| 639 | + '客户经理', | ||
| 640 | + style: TextStyle( | ||
| 619 | fontSize: ScreenUtil().setSp(28), | 641 | fontSize: ScreenUtil().setSp(28), |
| 620 | - ), | ||
| 621 | - )), | ||
| 622 | - HEmptyView(10), | ||
| 623 | - Image.asset( | ||
| 624 | - Utils.getImgPath(showLabel | ||
| 625 | - ? 'c_arrow_up' | ||
| 626 | - : 'c_arrow_down'), | ||
| 627 | - width: ScreenUtil().setWidth(24), | ||
| 628 | - // height: ScreenUtil().setWidth(10), | ||
| 629 | - ) | ||
| 630 | - ], | 642 | + color: MyColours.color_333333), |
| 643 | + ), | ||
| 631 | ), | 644 | ), |
| 632 | - )), | 645 | + Expanded( |
| 646 | + child: Text( | ||
| 647 | + manageShow, | ||
| 648 | + overflow: TextOverflow.ellipsis, | ||
| 649 | + style: TextStyle( | ||
| 650 | + color: MyColours.color_333333, | ||
| 651 | + fontSize: ScreenUtil().setSp(28), | ||
| 652 | + ), | ||
| 653 | + )), | ||
| 654 | + HEmptyView(10), | ||
| 655 | + Image.asset( | ||
| 656 | + Utils.getImgPath(showLabel | ||
| 657 | + ? 'c_arrow_up' | ||
| 658 | + : 'c_arrow_down'), | ||
| 659 | + width: ScreenUtil().setWidth(24), | ||
| 660 | + // height: ScreenUtil().setWidth(10), | ||
| 661 | + ) | ||
| 662 | + ], | ||
| 663 | + ), | ||
| 664 | + )), | ||
| 633 | VEmptyView(60), | 665 | VEmptyView(60), |
| 634 | _textMulLine('忌口', '输入忌口的东西', jkController), | 666 | _textMulLine('忌口', '输入忌口的东西', jkController), |
| 635 | VEmptyView(30), | 667 | VEmptyView(30), |
| @@ -21,10 +21,8 @@ import 'package:provider/provider.dart'; | @@ -21,10 +21,8 @@ import 'package:provider/provider.dart'; | ||
| 21 | class CustomerDetailPage extends StatefulWidget { | 21 | class CustomerDetailPage extends StatefulWidget { |
| 22 | final CustomerBySellerSunModel userHistoryEntity; | 22 | final CustomerBySellerSunModel userHistoryEntity; |
| 23 | final FromPage fromPage; | 23 | final FromPage fromPage; |
| 24 | - final String nickName; | ||
| 25 | 24 | ||
| 26 | - CustomerDetailPage( | ||
| 27 | - {Key key, this.userHistoryEntity, this.fromPage, this.nickName}) | 25 | + CustomerDetailPage({Key key, this.userHistoryEntity, this.fromPage}) |
| 28 | : super(key: key); | 26 | : super(key: key); |
| 29 | 27 | ||
| 30 | @override | 28 | @override |
| @@ -159,7 +157,9 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> { | @@ -159,7 +157,9 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> { | ||
| 159 | // widget.userHistoryEntity.rnameStr == '' | 157 | // widget.userHistoryEntity.rnameStr == '' |
| 160 | // ? '未指派经理' | 158 | // ? '未指派经理' |
| 161 | // : widget.userHistoryEntity.rnameStr, | 159 | // : widget.userHistoryEntity.rnameStr, |
| 162 | - '${widget.nickName}经理', | 160 | + customerProvider.guestInfoSunModel.guest.nickName == null |
| 161 | + ? '未指派经理' | ||
| 162 | + : '${customerProvider.guestInfoSunModel.guest.nickName}经理', | ||
| 163 | style: TextStyle( | 163 | style: TextStyle( |
| 164 | color: MyColours.color_333333, | 164 | color: MyColours.color_333333, |
| 165 | fontSize: ScreenUtil().setSp(26)), | 165 | fontSize: ScreenUtil().setSp(26)), |
| @@ -243,7 +243,7 @@ class _CustomerListPageState extends State<CustomerListPage> | @@ -243,7 +243,7 @@ class _CustomerListPageState extends State<CustomerListPage> | ||
| 243 | } | 243 | } |
| 244 | 244 | ||
| 245 | await customerProvider.getCustomerBySeller(context, params); | 245 | await customerProvider.getCustomerBySeller(context, params); |
| 246 | - // if (customerProvider.customerBySellerList.length == | 246 | + print(first); // if (customerProvider.customerBySellerList.length == |
| 247 | // customerProvider.selectCustomerSeller.length) { | 247 | // customerProvider.selectCustomerSeller.length) { |
| 248 | // customerProvider.checkValue = true; | 248 | // customerProvider.checkValue = true; |
| 249 | // } else { | 249 | // } else { |
| @@ -62,6 +62,22 @@ class _FestivalEditPageState extends State<FestivalEditPage> { | @@ -62,6 +62,22 @@ class _FestivalEditPageState extends State<FestivalEditPage> { | ||
| 62 | } | 62 | } |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | + _delGuestInfocDay(String id) async { | ||
| 66 | + Map<String, String> params = {"id": id}; | ||
| 67 | + bool sucess = | ||
| 68 | + await customerProvider.delGuestCday(context, params, showLoading: true); | ||
| 69 | + if (sucess) { | ||
| 70 | + Utils.showToast('删除成功'); | ||
| 71 | + //刷新当前页 | ||
| 72 | + _getGuestInfoCday(); | ||
| 73 | + // 刷新 | ||
| 74 | + bus.emit('refresh_guest_info'); | ||
| 75 | + bus.emit('refresh_guest_list'); | ||
| 76 | + // Navigator.pop(context); | ||
| 77 | + | ||
| 78 | + } | ||
| 79 | + } | ||
| 80 | + | ||
| 65 | @override | 81 | @override |
| 66 | Widget build(BuildContext context) { | 82 | Widget build(BuildContext context) { |
| 67 | customerProvider = Provider.of<CustomerProvider>(context, listen: true); | 83 | customerProvider = Provider.of<CustomerProvider>(context, listen: true); |
| @@ -142,6 +158,15 @@ class _FestivalEditPageState extends State<FestivalEditPage> { | @@ -142,6 +158,15 @@ class _FestivalEditPageState extends State<FestivalEditPage> { | ||
| 142 | print(name); | 158 | print(name); |
| 143 | _setGuestInfocDay(model.cday[index].id, name); | 159 | _setGuestInfocDay(model.cday[index].id, name); |
| 144 | // _addCookbookClass(name, showLoading: true); | 160 | // _addCookbookClass(name, showLoading: true); |
| 161 | + }, delCallback: () { | ||
| 162 | + //弹框确认是否删除 | ||
| 163 | + DialogUtil.cupertinoAlertDialog(context, | ||
| 164 | + title: "", | ||
| 165 | + content: "是否确定删除该纪念日", | ||
| 166 | + rTitle: "确定删除", rCallback: () { | ||
| 167 | + Navigator.pop(context); | ||
| 168 | + _delGuestInfocDay(model.cday[index].id); | ||
| 169 | + }); | ||
| 145 | }, | 170 | }, |
| 146 | yearStr: yearStr, | 171 | yearStr: yearStr, |
| 147 | monthStr: monthStr, | 172 | monthStr: monthStr, |
| @@ -73,6 +73,15 @@ class _MarketingRecordsDetailPageState | @@ -73,6 +73,15 @@ class _MarketingRecordsDetailPageState | ||
| 73 | await customerProvider.getMarketingById(context, params); | 73 | await customerProvider.getMarketingById(context, params); |
| 74 | } | 74 | } |
| 75 | 75 | ||
| 76 | + ///催促未完成任务经理发消息 | ||
| 77 | + _sendMarketingMsgByMid(String mid) async { | ||
| 78 | + Map<String, String> params = {"mid": mid}; //任务id | ||
| 79 | + bool sucess = await customerProvider.sendMarketingMsgByMid(context, params); | ||
| 80 | + if (sucess) { | ||
| 81 | + Utils.showToast('催促成功'); | ||
| 82 | + } | ||
| 83 | + } | ||
| 84 | + | ||
| 76 | ///消费券 | 85 | ///消费券 |
| 77 | _couponNetworkData({bool isShowLoading = true}) async { | 86 | _couponNetworkData({bool isShowLoading = true}) async { |
| 78 | // customerMakingProvider.couponSelectIndex = 0; | 87 | // customerMakingProvider.couponSelectIndex = 0; |
| @@ -318,7 +327,8 @@ class _MarketingRecordsDetailPageState | @@ -318,7 +327,8 @@ class _MarketingRecordsDetailPageState | ||
| 318 | horizontal: ScreenUtil().setWidth(200)), | 327 | horizontal: ScreenUtil().setWidth(200)), |
| 319 | isBold: false, | 328 | isBold: false, |
| 320 | onPressed: () { | 329 | onPressed: () { |
| 321 | - // NavigatorUtil.goEnterStoreEnvironmentPage(context); | 330 | + _sendMarketingMsgByMid( |
| 331 | + model.marketingByIdSunModel.id); | ||
| 322 | }, | 332 | }, |
| 323 | ), | 333 | ), |
| 324 | VEmptyView(10), | 334 | VEmptyView(10), |
| 1 | +import 'package:flutter/material.dart'; | ||
| 2 | + | ||
| 3 | +import 'package:flutter_screenutil/screenutil.dart'; | ||
| 4 | +import 'package:one_key/constant/state.dart'; | ||
| 5 | +import 'package:one_key/pages/my/customer_type/my_customer/my_contant_list_page.dart'; | ||
| 6 | + | ||
| 7 | +import 'package:one_key/pages/my/customer_type/store_customer/contant_list_page.dart'; | ||
| 8 | +import 'package:one_key/provider/customer_making_provider.dart'; | ||
| 9 | + | ||
| 10 | +import 'package:one_key/provider/customer_provider.dart'; | ||
| 11 | +import 'package:one_key/provider/user_model.dart'; | ||
| 12 | +import 'package:one_key/res/colors.dart'; | ||
| 13 | +import 'package:one_key/route/navigator_util.dart'; | ||
| 14 | + | ||
| 15 | +import 'package:one_key/utils/event_bus.dart'; | ||
| 16 | +import 'package:one_key/utils/utils.dart'; | ||
| 17 | +import 'package:one_key/widgets/common_button_flat.dart'; | ||
| 18 | + | ||
| 19 | +import 'package:one_key/widgets/custom_tab_indicator.dart'; | ||
| 20 | +import 'package:one_key/widgets/h_empty_view.dart'; | ||
| 21 | +import 'package:one_key/widgets/page_exception.dart'; | ||
| 22 | + | ||
| 23 | +import 'package:one_key/widgets/system_app_bar.dart'; | ||
| 24 | +import 'package:one_key/widgets/v_empty_view.dart'; | ||
| 25 | + | ||
| 26 | +import 'package:provider/provider.dart'; | ||
| 27 | + | ||
| 28 | +typedef ClickCallback = void Function(dynamic value); | ||
| 29 | + | ||
| 30 | +class ShowCustomerListPage extends StatefulWidget { | ||
| 31 | + final FromPage fromPage; | ||
| 32 | + final String gid; | ||
| 33 | + | ||
| 34 | + const ShowCustomerListPage({Key key, this.fromPage, this.gid}) | ||
| 35 | + : super(key: key); | ||
| 36 | + @override | ||
| 37 | + _ShowCustomerListPageState createState() => _ShowCustomerListPageState(); | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +class _ShowCustomerListPageState extends State<ShowCustomerListPage> | ||
| 41 | + with TickerProviderStateMixin, SingleTickerProviderStateMixin { | ||
| 42 | + List _tabBarTitle; | ||
| 43 | + TabController tabController; | ||
| 44 | + | ||
| 45 | + CustomerProvider customerProvider; | ||
| 46 | + CustomerMakingProvider customerMakingProvider; | ||
| 47 | + bool showFilter = false; | ||
| 48 | + ScrollController _scrollCrl = ScrollController(); | ||
| 49 | + int dropValue = 0; | ||
| 50 | + bool showDrop = true; | ||
| 51 | + List<String> timeTilte = ['大于', '等于', '小于']; | ||
| 52 | + | ||
| 53 | + @override | ||
| 54 | + void initState() { | ||
| 55 | + _tabBarTitle = ['全部', '活跃', '沉睡', '流失']; | ||
| 56 | + // timeTilte = ['大于', '等于', '小于']; | ||
| 57 | + super.initState(); | ||
| 58 | + tabController = TabController(length: 4, vsync: this); | ||
| 59 | + tabController.addListener(() { | ||
| 60 | + if (tabController.index == tabController.animation.value) { | ||
| 61 | + print(tabController.index); | ||
| 62 | + customerProvider.index = tabController.index; | ||
| 63 | + // customerProvider.searchData(customerProvider.controller.text); | ||
| 64 | + } | ||
| 65 | + }); | ||
| 66 | + WidgetsBinding.instance.addPostFrameCallback((_) async { | ||
| 67 | + _getSellerGuestByGid(); | ||
| 68 | + }); | ||
| 69 | + } | ||
| 70 | + | ||
| 71 | + _getSellerGuestByGid() async { | ||
| 72 | + Map<String, String> params = { | ||
| 73 | + "gid": widget.gid, | ||
| 74 | + }; | ||
| 75 | + await customerProvider.getSellerGuestByGid(context, params); | ||
| 76 | + | ||
| 77 | + } | ||
| 78 | + | ||
| 79 | + /// 搜索框 | ||
| 80 | + Widget _searchWidget() { | ||
| 81 | + return Container( | ||
| 82 | + color: MyColours.color_ffffff, | ||
| 83 | + padding: EdgeInsets.symmetric( | ||
| 84 | + horizontal: ScreenUtil().setWidth(40), | ||
| 85 | + ), | ||
| 86 | + height: ScreenUtil().setWidth(45 * 2), | ||
| 87 | + // alignment: Alignment.center, | ||
| 88 | + | ||
| 89 | + child: Container( | ||
| 90 | + alignment: Alignment.center, | ||
| 91 | + padding: EdgeInsets.only( | ||
| 92 | + left: ScreenUtil().setWidth(20 * 2), | ||
| 93 | + ), | ||
| 94 | + decoration: BoxDecoration( | ||
| 95 | + color: MyColours.color_ffffff, | ||
| 96 | + borderRadius: | ||
| 97 | + BorderRadius.circular(ScreenUtil().setWidth(24 * 2)), | ||
| 98 | + border: Border.all(color: Color.fromRGBO(228, 228, 228, 1)), | ||
| 99 | + boxShadow: [ | ||
| 100 | + BoxShadow( | ||
| 101 | + color: Color.fromRGBO(220, 220, 220, 1), //投影颜色 | ||
| 102 | + offset: Offset(2, 3), //x,y轴 | ||
| 103 | + blurRadius: ScreenUtil().setWidth(6) //投影距离 | ||
| 104 | + ) | ||
| 105 | + ]), | ||
| 106 | + child: Row(children: [ | ||
| 107 | + Expanded( | ||
| 108 | + child: TextField( | ||
| 109 | + maxLines: 1, | ||
| 110 | + controller: customerProvider.controller, | ||
| 111 | + // focusNode: _focusNode, | ||
| 112 | + // autofocus: true, | ||
| 113 | + | ||
| 114 | + style: TextStyle( | ||
| 115 | + color: MyColours.color_333333, | ||
| 116 | + fontSize: ScreenUtil().setSp(26)), | ||
| 117 | + // textAlignVertical: TextAlignVertical.center, | ||
| 118 | + decoration: InputDecoration( | ||
| 119 | + hintText: "输入手机号或姓名", | ||
| 120 | + hintStyle: TextStyle( | ||
| 121 | + color: MyColours.color_999999, | ||
| 122 | + fontSize: ScreenUtil().setSp(26), | ||
| 123 | + ), | ||
| 124 | + // isCollapsed: | ||
| 125 | + // true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度 | ||
| 126 | + border: OutlineInputBorder(borderSide: BorderSide.none), | ||
| 127 | + contentPadding: EdgeInsets.zero, | ||
| 128 | + // 左边图标设置 | ||
| 129 | + icon: Image.asset( | ||
| 130 | + Utils.getImgPath('search'), | ||
| 131 | + width: ScreenUtil().setWidth(30), | ||
| 132 | + ), | ||
| 133 | + //右边图标设置 | ||
| 134 | + // suffixIcon: | ||
| 135 | + ), | ||
| 136 | + keyboardType: TextInputType.text, | ||
| 137 | + textInputAction: TextInputAction.done, | ||
| 138 | + | ||
| 139 | + onChanged: (value) { | ||
| 140 | + // setState(() {}); | ||
| 141 | + // _searchSellerLocation(); | ||
| 142 | + // customerProvider.searchData(value); | ||
| 143 | + }, | ||
| 144 | + onEditingComplete: () { | ||
| 145 | + FocusScope.of(context) | ||
| 146 | + .requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 147 | + // contantShowModel.searchData( | ||
| 148 | + // contantShowModel.controller.text); | ||
| 149 | + // _searchSellerLocation(); | ||
| 150 | + // _focusNode.unfocus(); | ||
| 151 | + }, | ||
| 152 | + ), | ||
| 153 | + ), | ||
| 154 | + Offstage( | ||
| 155 | + offstage: customerProvider.controller.text == '', | ||
| 156 | + child: GestureDetector( | ||
| 157 | + child: Container( | ||
| 158 | + padding: EdgeInsets.symmetric( | ||
| 159 | + horizontal: ScreenUtil().setWidth(40), | ||
| 160 | + vertical: ScreenUtil().setWidth(20), | ||
| 161 | + ), | ||
| 162 | + // color: Colors.orange, | ||
| 163 | + alignment: Alignment.centerRight, | ||
| 164 | + child: Image.asset( | ||
| 165 | + Utils.getImgPath('clear'), | ||
| 166 | + width: ScreenUtil().setWidth(30), | ||
| 167 | + height: ScreenUtil().setWidth(30), | ||
| 168 | + ), | ||
| 169 | + ), | ||
| 170 | + onTap: () { | ||
| 171 | + WidgetsBinding.instance.addPostFrameCallback(((_) { | ||
| 172 | + customerProvider.controller.clear(); | ||
| 173 | + // customerProvider.searchData(''); | ||
| 174 | + })); | ||
| 175 | + }, | ||
| 176 | + )), | ||
| 177 | + // Offstage( | ||
| 178 | + // offstage: false, | ||
| 179 | + // child: GestureDetector( | ||
| 180 | + // child: Container( | ||
| 181 | + // padding: EdgeInsets.only( | ||
| 182 | + // right: ScreenUtil().setWidth(30), | ||
| 183 | + // bottom: ScreenUtil().setWidth(20), | ||
| 184 | + // top: ScreenUtil().setWidth(20), | ||
| 185 | + // ), | ||
| 186 | + // child: Text( | ||
| 187 | + // '搜索', | ||
| 188 | + // style: TextStyle( | ||
| 189 | + // color: MyColours.color_199095, | ||
| 190 | + // fontSize: ScreenUtil().setSp(28)), | ||
| 191 | + // ), | ||
| 192 | + // ), | ||
| 193 | + // onTap: () { | ||
| 194 | + // customerProvider.searchData( | ||
| 195 | + // customerProvider.controller.text); | ||
| 196 | + // }, | ||
| 197 | + // )) | ||
| 198 | + ]))); | ||
| 199 | + } | ||
| 200 | + | ||
| 201 | + Widget _menuWidget() { | ||
| 202 | + return Container( | ||
| 203 | + margin: EdgeInsets.symmetric( | ||
| 204 | + horizontal: ScreenUtil().setWidth(40), | ||
| 205 | + vertical: ScreenUtil().setWidth(20)), | ||
| 206 | + decoration: BoxDecoration(color: MyColours.color_ffffff, boxShadow: [ | ||
| 207 | + BoxShadow( | ||
| 208 | + // color: Colors.red, | ||
| 209 | + color: Color.fromRGBO(220, 220, 220, 1), //投影颜色 | ||
| 210 | + offset: Offset(2, 2), //x,y轴 | ||
| 211 | + blurRadius: ScreenUtil().setWidth(6) //投影距离 | ||
| 212 | + ) | ||
| 213 | + ]), | ||
| 214 | + child: Row( | ||
| 215 | + children: [ | ||
| 216 | + Expanded( | ||
| 217 | + child: Container( | ||
| 218 | + padding: EdgeInsets.only(bottom: ScreenUtil().setWidth(10)), | ||
| 219 | + margin: | ||
| 220 | + EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(30)), | ||
| 221 | + child: TabBar( | ||
| 222 | + controller: tabController, | ||
| 223 | + indicator: CustomTabIndicator( | ||
| 224 | + radius: 0, | ||
| 225 | + ), | ||
| 226 | + indicatorColor: MyColours.color_199095, | ||
| 227 | + indicatorSize: TabBarIndicatorSize.tab, | ||
| 228 | + // indicatorPadding: EdgeInsets.symmetric( | ||
| 229 | + // horizontal: ScreenUtil().setWidth(12)), | ||
| 230 | + labelColor: MyColours.color_199095, | ||
| 231 | + labelStyle: TextStyle( | ||
| 232 | + fontSize: ScreenUtil().setSp(32), | ||
| 233 | + fontWeight: FontWeight.bold), | ||
| 234 | + labelPadding: EdgeInsets.zero, | ||
| 235 | + unselectedLabelStyle: TextStyle( | ||
| 236 | + fontWeight: FontWeight.normal, | ||
| 237 | + fontSize: ScreenUtil().setSp(28), | ||
| 238 | + ), | ||
| 239 | + unselectedLabelColor: MyColours.color_999999, | ||
| 240 | + tabs: _tabBarTitle.map((value) { | ||
| 241 | + return Tab( | ||
| 242 | + child: Text(value), | ||
| 243 | + ); | ||
| 244 | + }).toList()), | ||
| 245 | + )), | ||
| 246 | + InkWell( | ||
| 247 | + onTap: () { | ||
| 248 | + setState(() { | ||
| 249 | + showFilter = !showFilter; | ||
| 250 | + }); | ||
| 251 | + if (showFilter) { | ||
| 252 | + _showFilterDialogFromTop(context, onPressedReset: () { | ||
| 253 | + Navigator.of(context).pop(); | ||
| 254 | + setState(() { | ||
| 255 | + showFilter = false; | ||
| 256 | + }); | ||
| 257 | + }, onPressedComplete: () { | ||
| 258 | + Navigator.of(context).pop(); | ||
| 259 | + setState(() { | ||
| 260 | + showFilter = false; | ||
| 261 | + }); | ||
| 262 | + }, tapWhiteBack: () { | ||
| 263 | + // Navigator.of(context).pop(); | ||
| 264 | + // setState(() { | ||
| 265 | + // showFilter = false; | ||
| 266 | + // }); | ||
| 267 | + }); | ||
| 268 | + } | ||
| 269 | + }, | ||
| 270 | + child: Container( | ||
| 271 | + padding: EdgeInsets.only(bottom: ScreenUtil().setWidth(10)), | ||
| 272 | + margin: EdgeInsets.only(right: ScreenUtil().setWidth(30)), | ||
| 273 | + width: ScreenUtil().setWidth(100), | ||
| 274 | + // height: ScreenUtil().setWidth(50), | ||
| 275 | + child: Row( | ||
| 276 | + children: [ | ||
| 277 | + Text( | ||
| 278 | + '筛选', | ||
| 279 | + style: TextStyle( | ||
| 280 | + fontSize: ScreenUtil().setSp(28), | ||
| 281 | + color: MyColours.color_999999), | ||
| 282 | + ), | ||
| 283 | + HEmptyView(10), | ||
| 284 | + Image.asset( | ||
| 285 | + Utils.getImgPath( | ||
| 286 | + showFilter ? 'c_arrow_up' : 'c_arrow_down'), | ||
| 287 | + width: ScreenUtil().setWidth(24), | ||
| 288 | + // height: ScreenUtil().setWidth(10), | ||
| 289 | + ) | ||
| 290 | + ], | ||
| 291 | + )), | ||
| 292 | + ) | ||
| 293 | + ], | ||
| 294 | + )); | ||
| 295 | + } | ||
| 296 | + | ||
| 297 | + ///筛选弹框 | ||
| 298 | + _showFilterDialogFromTop(BuildContext context, | ||
| 299 | + {VoidCallback onPressedReset, | ||
| 300 | + VoidCallback onPressedComplete, | ||
| 301 | + GestureTapCallback tapWhiteBack}) { | ||
| 302 | + showGeneralDialog( | ||
| 303 | + context: context, | ||
| 304 | + barrierDismissible: false, | ||
| 305 | + barrierColor: Colors.transparent, | ||
| 306 | + barrierLabel: | ||
| 307 | + MaterialLocalizations.of(context).modalBarrierDismissLabel, | ||
| 308 | + transitionDuration: const Duration(milliseconds: 150), | ||
| 309 | + pageBuilder: (BuildContext context, Animation animation, | ||
| 310 | + Animation secondaryAnimation) { | ||
| 311 | + return Scaffold( | ||
| 312 | + backgroundColor: Colors.transparent, | ||
| 313 | + // resizeToAvoidBottomInset: false, | ||
| 314 | + body: StatefulBuilder(builder: (context, state) { | ||
| 315 | + return GestureDetector( | ||
| 316 | + // behavior: HitTestBehavior.opaque, | ||
| 317 | + onTap: tapWhiteBack, | ||
| 318 | + child: _filterWidget( | ||
| 319 | + state, | ||
| 320 | + onPressedReset, | ||
| 321 | + onPressedComplete, | ||
| 322 | + )); | ||
| 323 | + })); | ||
| 324 | + }); | ||
| 325 | + } | ||
| 326 | + | ||
| 327 | + ///弹框text | ||
| 328 | + _textWidget(String title, Color textColor, FontWeight fontWeight, int size) { | ||
| 329 | + return Text(title, | ||
| 330 | + style: TextStyle( | ||
| 331 | + color: textColor, | ||
| 332 | + decoration: TextDecoration.none, | ||
| 333 | + fontWeight: fontWeight, | ||
| 334 | + fontSize: ScreenUtil().setSp(size))); | ||
| 335 | + } | ||
| 336 | + | ||
| 337 | + ///客户经理 | ||
| 338 | + Widget _managerWidget() { | ||
| 339 | + return Column( | ||
| 340 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 341 | + children: [ | ||
| 342 | + Row( | ||
| 343 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 344 | + children: [ | ||
| 345 | + _textWidget('客户经理', MyColours.color_333333, FontWeight.bold, 28), | ||
| 346 | + GestureDetector( | ||
| 347 | + onTap: () {}, | ||
| 348 | + child: _textWidget( | ||
| 349 | + '全选', MyColours.color_199095, FontWeight.normal, 24), | ||
| 350 | + ) | ||
| 351 | + ], | ||
| 352 | + ), | ||
| 353 | + VEmptyView(30), | ||
| 354 | + Wrap( | ||
| 355 | + spacing: ScreenUtil().setWidth(20), | ||
| 356 | + runSpacing: ScreenUtil().setWidth(20), | ||
| 357 | + children: _buildFilterItem([ | ||
| 358 | + {'title': 'kkkk', 'select': false}, | ||
| 359 | + {'title': 'kkkk', 'select': true}, | ||
| 360 | + {'title': 'kkkk', 'select': true}, | ||
| 361 | + {'title': 'kkkk', 'select': true}, | ||
| 362 | + {'title': 'k', 'select': true}, | ||
| 363 | + {'title': 'kkkk', 'select': true}, | ||
| 364 | + {'title': 'kkkk', 'select': true}, | ||
| 365 | + {'title': 'k', 'select': true}, | ||
| 366 | + {'title': 'kdsfjsfsdfhjsdfh', 'select': true}, | ||
| 367 | + {'title': 'kkkk', 'select': true}, | ||
| 368 | + ], false)), | ||
| 369 | + ], | ||
| 370 | + ); | ||
| 371 | + } | ||
| 372 | + | ||
| 373 | + ///活跃度 | ||
| 374 | + Widget _activityWidget() { | ||
| 375 | + return Column( | ||
| 376 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 377 | + children: [ | ||
| 378 | + Row( | ||
| 379 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 380 | + children: [ | ||
| 381 | + _textWidget('活跃度', MyColours.color_333333, FontWeight.bold, 28), | ||
| 382 | + GestureDetector( | ||
| 383 | + onTap: () {}, | ||
| 384 | + child: _textWidget( | ||
| 385 | + '全选', MyColours.color_199095, FontWeight.normal, 24), | ||
| 386 | + ) | ||
| 387 | + ], | ||
| 388 | + ), | ||
| 389 | + VEmptyView(30), | ||
| 390 | + Wrap( | ||
| 391 | + spacing: ScreenUtil().setWidth(20), | ||
| 392 | + runSpacing: ScreenUtil().setWidth(20), | ||
| 393 | + children: _buildFilterItem([ | ||
| 394 | + {'title': 'kkkk', 'select': false}, | ||
| 395 | + {'title': 'kkkk', 'select': true}, | ||
| 396 | + {'title': 'kkkk', 'select': true}, | ||
| 397 | + {'title': 'kkkk', 'select': true}, | ||
| 398 | + {'title': 'k', 'select': true}, | ||
| 399 | + {'title': 'kkkk', 'select': true}, | ||
| 400 | + {'title': 'kkkk', 'select': true}, | ||
| 401 | + {'title': 'k', 'select': true}, | ||
| 402 | + {'title': 'kdsfjsfsdfhjsdfh', 'select': true}, | ||
| 403 | + {'title': 'kkkk', 'select': true}, | ||
| 404 | + ], false)), | ||
| 405 | + ], | ||
| 406 | + ); | ||
| 407 | + } | ||
| 408 | + | ||
| 409 | + ///自定义标签 | ||
| 410 | + Widget _labelWidget() { | ||
| 411 | + return Column( | ||
| 412 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 413 | + children: [ | ||
| 414 | + Row( | ||
| 415 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 416 | + children: [ | ||
| 417 | + _textWidget('自定义标签', MyColours.color_333333, FontWeight.bold, 28), | ||
| 418 | + GestureDetector( | ||
| 419 | + onTap: () {}, | ||
| 420 | + child: _textWidget( | ||
| 421 | + '全选', MyColours.color_199095, FontWeight.normal, 24), | ||
| 422 | + ) | ||
| 423 | + ], | ||
| 424 | + ), | ||
| 425 | + VEmptyView(30), | ||
| 426 | + Wrap( | ||
| 427 | + spacing: ScreenUtil().setWidth(20), | ||
| 428 | + runSpacing: ScreenUtil().setWidth(20), | ||
| 429 | + children: _buildFilterItem([ | ||
| 430 | + {'title': 'kkkk', 'select': false}, | ||
| 431 | + {'title': 'kkkk', 'select': true}, | ||
| 432 | + {'title': 'kkkk', 'select': true}, | ||
| 433 | + {'title': 'kkkk', 'select': true}, | ||
| 434 | + {'title': 'k', 'select': true}, | ||
| 435 | + {'title': 'kkkk', 'select': true}, | ||
| 436 | + {'title': 'kkkk', 'select': true}, | ||
| 437 | + {'title': 'k', 'select': true}, | ||
| 438 | + {'title': 'kdsfjsfsdfhjsdfh', 'select': false}, | ||
| 439 | + {'title': 'kkkk', 'select': true}, | ||
| 440 | + ], true)), | ||
| 441 | + ], | ||
| 442 | + ); | ||
| 443 | + } | ||
| 444 | + | ||
| 445 | + ///大于、等于、小于 | ||
| 446 | + List<DropdownMenuItem> _dropdownMenuItem() { | ||
| 447 | + List<DropdownMenuItem> list = []; | ||
| 448 | + for (int i = 0; i < timeTilte.length; i++) { | ||
| 449 | + list.add(DropdownMenuItem( | ||
| 450 | + child: _textWidget( | ||
| 451 | + timeTilte[i], MyColours.color_199095, FontWeight.normal, 24), | ||
| 452 | + value: i)); | ||
| 453 | + } | ||
| 454 | + return list; | ||
| 455 | + } | ||
| 456 | + | ||
| 457 | + _selectWidget(List<String> data, ClickCallback onTap) { | ||
| 458 | + return Container( | ||
| 459 | + decoration: BoxDecoration( | ||
| 460 | + color: MyColours.color_ffffff, | ||
| 461 | + borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10)), | ||
| 462 | + border: Border.all( | ||
| 463 | + color: MyColours.color_cccccc, | ||
| 464 | + width: ScreenUtil().setWidth(2))), | ||
| 465 | + width: ScreenUtil().setWidth(130 * 2), | ||
| 466 | + // constraints: BoxConstraints( | ||
| 467 | + // maxHeight: ScreenUtil().setWidth(130 * 2), | ||
| 468 | + // ), | ||
| 469 | + child: ListView.builder( | ||
| 470 | + shrinkWrap: true, | ||
| 471 | + padding: EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(8)), | ||
| 472 | + itemCount: data.length, | ||
| 473 | + itemBuilder: (context, index) { | ||
| 474 | + return InkWell( | ||
| 475 | + onTap: () { | ||
| 476 | + onTap(index); | ||
| 477 | + }, | ||
| 478 | + child: Container( | ||
| 479 | + padding: | ||
| 480 | + EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(20)), | ||
| 481 | + decoration: BoxDecoration( | ||
| 482 | + border: Border( | ||
| 483 | + bottom: BorderSide( | ||
| 484 | + color: MyColours.color_efefef, | ||
| 485 | + width: data.length - 1 == index | ||
| 486 | + ? 0 | ||
| 487 | + : ScreenUtil().setWidth(2)))), | ||
| 488 | + child: Text(data[index], | ||
| 489 | + style: TextStyle( | ||
| 490 | + color: MyColours.color_199095, | ||
| 491 | + fontWeight: FontWeight.bold, | ||
| 492 | + fontSize: ScreenUtil().setSp(28))), | ||
| 493 | + ), | ||
| 494 | + ); | ||
| 495 | + })); | ||
| 496 | + } | ||
| 497 | + | ||
| 498 | + ///高级筛选 | ||
| 499 | + Widget _advancedFilterWidget(state) { | ||
| 500 | + return Column( | ||
| 501 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 502 | + children: [ | ||
| 503 | + Row( | ||
| 504 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 505 | + children: [ | ||
| 506 | + _textWidget('高级筛选', MyColours.color_333333, FontWeight.bold, 28), | ||
| 507 | + GestureDetector( | ||
| 508 | + onTap: () {}, | ||
| 509 | + child: _textWidget( | ||
| 510 | + '清空', MyColours.color_199095, FontWeight.normal, 24), | ||
| 511 | + ) | ||
| 512 | + ], | ||
| 513 | + ), | ||
| 514 | + VEmptyView(30), | ||
| 515 | + Row( | ||
| 516 | + children: [ | ||
| 517 | + Expanded(child: _textFeildWidget()), | ||
| 518 | + HEmptyView(10), | ||
| 519 | + _textWidget('至', MyColours.color_199095, FontWeight.normal, 24), | ||
| 520 | + HEmptyView(10), | ||
| 521 | + Expanded(child: _textFeildWidget()), | ||
| 522 | + ], | ||
| 523 | + ), | ||
| 524 | + VEmptyView(30), | ||
| 525 | + Wrap( | ||
| 526 | + spacing: ScreenUtil().setWidth(20), | ||
| 527 | + runSpacing: ScreenUtil().setWidth(20), | ||
| 528 | + children: _buildFilterItem([ | ||
| 529 | + {'title': '7天', 'select': true}, | ||
| 530 | + {'title': '30天', 'select': true}, | ||
| 531 | + {'title': '60天', 'select': true}, | ||
| 532 | + {'title': '120天', 'select': true}, | ||
| 533 | + ], true, grayBack: true)), | ||
| 534 | + VEmptyView(30), | ||
| 535 | + _textWidget('时间内预订次数', MyColours.color_333333, FontWeight.normal, 24), | ||
| 536 | + VEmptyView(30), | ||
| 537 | + /** | ||
| 538 | + Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ | ||
| 539 | + Material( | ||
| 540 | + child: Container( | ||
| 541 | + height: ScreenUtil().setWidth(50), | ||
| 542 | + width: ScreenUtil().setWidth(130), | ||
| 543 | + decoration: BoxDecoration( | ||
| 544 | + borderRadius: | ||
| 545 | + BorderRadius.circular(ScreenUtil().setWidth(30)), | ||
| 546 | + color: Color.fromRGBO(239, 239, 239, 1)), | ||
| 547 | + child: _buttonChoose(dropValue, (value) { | ||
| 548 | + state(() { | ||
| 549 | + showDrop = !showDrop; | ||
| 550 | + _scrollCrl.jumpTo(_scrollCrl.position.maxScrollExtent); | ||
| 551 | + }); | ||
| 552 | + | ||
| 553 | + // _scrollCrl.position | ||
| 554 | + // .didUpdateScrollPositionBy(2); //这里触发更新滚动条 | ||
| 555 | + }))), | ||
| 556 | + VEmptyView(10), | ||
| 557 | + Material( | ||
| 558 | + child: Offstage( | ||
| 559 | + offstage: showDrop, | ||
| 560 | + child: _selectWidget(timeTilte, (index) { | ||
| 561 | + print(timeTilte[index]); | ||
| 562 | + state(() { | ||
| 563 | + showDrop = !showDrop; | ||
| 564 | + // _provider.currentIndex = index; | ||
| 565 | + dropValue = timeTilte[index]; | ||
| 566 | + }); | ||
| 567 | + }), | ||
| 568 | + )), | ||
| 569 | + ]), | ||
| 570 | + VEmptyView(50), | ||
| 571 | + */ | ||
| 572 | + Row(children: [ | ||
| 573 | + Material( | ||
| 574 | + child: Container( | ||
| 575 | + height: ScreenUtil().setWidth(50), | ||
| 576 | + // width: ScreenUtil().setWidth(100), | ||
| 577 | + padding: EdgeInsets.symmetric( | ||
| 578 | + horizontal: ScreenUtil().setWidth(20)), | ||
| 579 | + decoration: BoxDecoration( | ||
| 580 | + borderRadius: | ||
| 581 | + BorderRadius.circular(ScreenUtil().setWidth(30)), | ||
| 582 | + color: Color.fromRGBO(239, 239, 239, 1)), | ||
| 583 | + child: DropdownButton( | ||
| 584 | + underline: SizedBox(), | ||
| 585 | + value: dropValue, | ||
| 586 | + isDense: true, | ||
| 587 | + style: TextStyle( | ||
| 588 | + color: MyColours.color_333333, | ||
| 589 | + fontSize: ScreenUtil().setSp(28)), | ||
| 590 | + focusColor: MyColours.color_199095, | ||
| 591 | + items: _dropdownMenuItem(), | ||
| 592 | + icon: Row( | ||
| 593 | + children: [ | ||
| 594 | + HEmptyView(10), | ||
| 595 | + Image.asset( | ||
| 596 | + Utils.getImgPath('c_arrow_down'), | ||
| 597 | + width: ScreenUtil().setWidth(24), | ||
| 598 | + // height: ScreenUtil().setWidth(10), | ||
| 599 | + ) | ||
| 600 | + ], | ||
| 601 | + ), | ||
| 602 | + onChanged: (value) { | ||
| 603 | + print(value); | ||
| 604 | + state(() => dropValue = value); | ||
| 605 | + }))), | ||
| 606 | + HEmptyView(20), | ||
| 607 | + Container( | ||
| 608 | + // padding: EdgeInsets.symmetric( | ||
| 609 | + // horizontal: ScreenUtil().setWidth(20), | ||
| 610 | + // ), | ||
| 611 | + width: ScreenUtil().setWidth(160), | ||
| 612 | + height: ScreenUtil().setWidth(50), | ||
| 613 | + // alignment: Alignment.center, | ||
| 614 | + decoration: BoxDecoration( | ||
| 615 | + border: Border( | ||
| 616 | + bottom: BorderSide( | ||
| 617 | + color: Color.fromRGBO(180, 180, 180, 1), | ||
| 618 | + width: ScreenUtil().setWidth(2))), | ||
| 619 | + ), | ||
| 620 | + child: Material( | ||
| 621 | + color: MyColours.color_ffffff, | ||
| 622 | + child: TextField( | ||
| 623 | + maxLines: 1, | ||
| 624 | + controller: customerProvider.controller, | ||
| 625 | + // focusNode: _focusNode, | ||
| 626 | + // autofocus: true, | ||
| 627 | + | ||
| 628 | + style: TextStyle( | ||
| 629 | + color: MyColours.color_333333, | ||
| 630 | + fontSize: ScreenUtil().setSp(26)), | ||
| 631 | + // textAlignVertical: TextAlignVertical.center, | ||
| 632 | + decoration: InputDecoration( | ||
| 633 | + // hintText: "xxx", | ||
| 634 | + hintStyle: TextStyle( | ||
| 635 | + color: MyColours.color_999999, | ||
| 636 | + fontSize: ScreenUtil().setSp(26), | ||
| 637 | + ), | ||
| 638 | + // isCollapsed: | ||
| 639 | + // true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度 | ||
| 640 | + border: OutlineInputBorder(borderSide: BorderSide.none), | ||
| 641 | + contentPadding: EdgeInsets.zero, | ||
| 642 | + ), | ||
| 643 | + keyboardType: TextInputType.text, | ||
| 644 | + textInputAction: TextInputAction.done, | ||
| 645 | + | ||
| 646 | + onChanged: (value) { | ||
| 647 | + // setState(() {}); | ||
| 648 | + // _searchSellerLocation(); | ||
| 649 | + // customerProvider.searchData(value); | ||
| 650 | + }, | ||
| 651 | + onEditingComplete: () { | ||
| 652 | + FocusScope.of(context) | ||
| 653 | + .requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 654 | + // contantShowModel.searchData( | ||
| 655 | + // contantShowModel.controller.text); | ||
| 656 | + // _searchSellerLocation(); | ||
| 657 | + // _focusNode.unfocus(); | ||
| 658 | + }, | ||
| 659 | + ), | ||
| 660 | + )), | ||
| 661 | + HEmptyView(20), | ||
| 662 | + _textWidget('次预订', MyColours.color_333333, FontWeight.normal, 24), | ||
| 663 | + ]), | ||
| 664 | + VEmptyView(30), | ||
| 665 | + ], | ||
| 666 | + ); | ||
| 667 | + } | ||
| 668 | + | ||
| 669 | + _buttonChoose(String title, ClickCallback callback) { | ||
| 670 | + return InkWell( | ||
| 671 | + onTap: () { | ||
| 672 | + callback(title); | ||
| 673 | + }, | ||
| 674 | + child: Container( | ||
| 675 | + padding: EdgeInsets.symmetric( | ||
| 676 | + horizontal: ScreenUtil().setWidth(20), | ||
| 677 | + vertical: ScreenUtil().setWidth(10)), | ||
| 678 | + height: ScreenUtil().setWidth(60), | ||
| 679 | + decoration: BoxDecoration( | ||
| 680 | + // border: Border.all( | ||
| 681 | + // width: ScreenUtil().setWidth(2), | ||
| 682 | + // color: MyColours.color_199095), | ||
| 683 | + borderRadius: BorderRadius.circular(ScreenUtil().setWidth(30))), | ||
| 684 | + child: Row( | ||
| 685 | + children: [ | ||
| 686 | + Text( | ||
| 687 | + title, | ||
| 688 | + style: TextStyle( | ||
| 689 | + color: title == '时间(选填)' || title == '(选填)' | ||
| 690 | + ? MyColours.color_999999 | ||
| 691 | + : MyColours.color_199095, | ||
| 692 | + fontSize: ScreenUtil().setWidth(28)), | ||
| 693 | + ), | ||
| 694 | + HEmptyView(10), | ||
| 695 | + Image.asset( | ||
| 696 | + Utils.getImgPath('enter_order_arrow'), | ||
| 697 | + width: ScreenUtil().setWidth(20), | ||
| 698 | + height: ScreenUtil().setWidth(10), | ||
| 699 | + ) | ||
| 700 | + ], | ||
| 701 | + ))); | ||
| 702 | + } | ||
| 703 | + | ||
| 704 | + /// 高级筛选输入框 | ||
| 705 | + Widget _textFeildWidget() { | ||
| 706 | + return Container( | ||
| 707 | + padding: EdgeInsets.symmetric( | ||
| 708 | + horizontal: ScreenUtil().setWidth(20), | ||
| 709 | + ), | ||
| 710 | + height: ScreenUtil().setWidth(50), | ||
| 711 | + // alignment: Alignment.center, | ||
| 712 | + decoration: BoxDecoration( | ||
| 713 | + color: Color.fromRGBO(239, 239, 239, 1), | ||
| 714 | + borderRadius: BorderRadius.circular(ScreenUtil().setWidth(30))), | ||
| 715 | + child: Material( | ||
| 716 | + color: Color.fromRGBO(239, 239, 239, 1), | ||
| 717 | + child: Row(children: [ | ||
| 718 | + Expanded( | ||
| 719 | + child: TextField( | ||
| 720 | + maxLines: 1, | ||
| 721 | + controller: customerProvider.controller, | ||
| 722 | + // focusNode: _focusNode, | ||
| 723 | + // autofocus: true, | ||
| 724 | + | ||
| 725 | + style: TextStyle( | ||
| 726 | + color: MyColours.color_333333, | ||
| 727 | + fontSize: ScreenUtil().setSp(26)), | ||
| 728 | + // textAlignVertical: TextAlignVertical.center, | ||
| 729 | + decoration: InputDecoration( | ||
| 730 | + hintText: "xxx", | ||
| 731 | + hintStyle: TextStyle( | ||
| 732 | + color: MyColours.color_999999, | ||
| 733 | + fontSize: ScreenUtil().setSp(26), | ||
| 734 | + ), | ||
| 735 | + // isCollapsed: | ||
| 736 | + // true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度 | ||
| 737 | + border: OutlineInputBorder(borderSide: BorderSide.none), | ||
| 738 | + contentPadding: EdgeInsets.zero, | ||
| 739 | + ), | ||
| 740 | + keyboardType: TextInputType.text, | ||
| 741 | + textInputAction: TextInputAction.done, | ||
| 742 | + | ||
| 743 | + onChanged: (value) { | ||
| 744 | + // setState(() {}); | ||
| 745 | + // _searchSellerLocation(); | ||
| 746 | + // customerProvider.searchData(value); | ||
| 747 | + }, | ||
| 748 | + onEditingComplete: () { | ||
| 749 | + FocusScope.of(context) | ||
| 750 | + .requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 751 | + // contantShowModel.searchData( | ||
| 752 | + // contantShowModel.controller.text); | ||
| 753 | + // _searchSellerLocation(); | ||
| 754 | + // _focusNode.unfocus(); | ||
| 755 | + }, | ||
| 756 | + ), | ||
| 757 | + ), | ||
| 758 | + _textWidget('天', MyColours.color_333333, FontWeight.normal, 24), | ||
| 759 | + ]))); | ||
| 760 | + } | ||
| 761 | + | ||
| 762 | + ///筛选布局 | ||
| 763 | + Widget _filterWidget( | ||
| 764 | + StateSetter state, | ||
| 765 | + VoidCallback onPressedReset, | ||
| 766 | + VoidCallback onPressedComplete, | ||
| 767 | + ) { | ||
| 768 | + return Container( | ||
| 769 | + padding: EdgeInsets.symmetric( | ||
| 770 | + // horizontal: ScreenUtil().setWidth(30), | ||
| 771 | + ), | ||
| 772 | + // height: ScreenUtil().setWidth(100), | ||
| 773 | + margin: EdgeInsets.only( | ||
| 774 | + top: ScreenUtil().setWidth(92 + 52 + 30 * 3 + 90) + | ||
| 775 | + ScreenUtil.statusBarHeight), | ||
| 776 | + color: Color.fromRGBO(00, 00, 00, 0.49), | ||
| 777 | + child: Align( | ||
| 778 | + alignment: Alignment.topCenter, | ||
| 779 | + child: Container( | ||
| 780 | + decoration: BoxDecoration( | ||
| 781 | + color: MyColours.color_ffffff, | ||
| 782 | + borderRadius: BorderRadius.only( | ||
| 783 | + bottomRight: Radius.circular(ScreenUtil().setWidth(20)), | ||
| 784 | + bottomLeft: Radius.circular(ScreenUtil().setWidth(20)))), | ||
| 785 | + margin: EdgeInsets.only( | ||
| 786 | + left: ScreenUtil().setWidth(40), | ||
| 787 | + bottom: ScreenUtil().setWidth(140), | ||
| 788 | + right: ScreenUtil().setWidth(40)), | ||
| 789 | + padding: | ||
| 790 | + EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(40)), | ||
| 791 | + child: Column( | ||
| 792 | + children: [ | ||
| 793 | + Expanded( | ||
| 794 | + child: Scrollbar( | ||
| 795 | + isAlwaysShown: true, //设置滚动条常亮 | ||
| 796 | + controller: _scrollCrl, //必须设置一个controller | ||
| 797 | + | ||
| 798 | + ///添加进度条 | ||
| 799 | + child: SingleChildScrollView( | ||
| 800 | + controller: _scrollCrl, | ||
| 801 | + // primary: true, | ||
| 802 | + // reverse: true, | ||
| 803 | + // physics: BouncingScrollPhysics(), | ||
| 804 | + // padding: EdgeInsets.only( | ||
| 805 | + // bottom: | ||
| 806 | + // MediaQuery.of(context).viewInsets.bottom), | ||
| 807 | + child: Column( | ||
| 808 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 809 | + children: [ | ||
| 810 | + VEmptyView(20), | ||
| 811 | + _managerWidget(), | ||
| 812 | + VEmptyView(30), | ||
| 813 | + _activityWidget(), | ||
| 814 | + VEmptyView(30), | ||
| 815 | + _labelWidget(), | ||
| 816 | + VEmptyView(30), | ||
| 817 | + _advancedFilterWidget(state) | ||
| 818 | + ], | ||
| 819 | + ), | ||
| 820 | + ))), | ||
| 821 | + Row( | ||
| 822 | + children: [ | ||
| 823 | + Container( | ||
| 824 | + width: ScreenUtil.screenWidthDp - | ||
| 825 | + ScreenUtil().setWidth(40 * 4), | ||
| 826 | + height: ScreenUtil().setWidth(100), | ||
| 827 | + // padding: EdgeInsets.symmetric( | ||
| 828 | + // horizontal: ScreenUtil().setWidth(40)), | ||
| 829 | + decoration: BoxDecoration( | ||
| 830 | + boxShadow: [ | ||
| 831 | + BoxShadow( | ||
| 832 | + color: MyColours.color_E0E0E0, | ||
| 833 | + blurRadius: ScreenUtil().setWidth(14)) | ||
| 834 | + ], | ||
| 835 | + color: MyColours.color_ffffff, | ||
| 836 | + borderRadius: BorderRadius.circular( | ||
| 837 | + ScreenUtil().setWidth(20), | ||
| 838 | + )), | ||
| 839 | + child: Row( | ||
| 840 | + // mainAxisAlignment: MainAxisAlignment.spaceEvenly, | ||
| 841 | + // crossAxisAlignment: CrossAxisAlignment.center, | ||
| 842 | + children: <Widget>[ | ||
| 843 | + Expanded( | ||
| 844 | + flex: 1, | ||
| 845 | + child: Material( | ||
| 846 | + child: InkWell( | ||
| 847 | + onTap: onPressedReset, | ||
| 848 | + child: Container( | ||
| 849 | + decoration: BoxDecoration( | ||
| 850 | + color: MyColours.color_ffffff, | ||
| 851 | + borderRadius: BorderRadius.only( | ||
| 852 | + bottomLeft: Radius.circular( | ||
| 853 | + ScreenUtil().setWidth(20)), | ||
| 854 | + topLeft: Radius.circular( | ||
| 855 | + ScreenUtil().setWidth(20)), | ||
| 856 | + )), | ||
| 857 | + child: Align( | ||
| 858 | + alignment: Alignment.center, | ||
| 859 | + child: _textWidget( | ||
| 860 | + '重置', | ||
| 861 | + MyColours.color_333333, | ||
| 862 | + FontWeight.normal, | ||
| 863 | + 30), | ||
| 864 | + ), | ||
| 865 | + ), | ||
| 866 | + ))), | ||
| 867 | + Expanded( | ||
| 868 | + flex: 1, | ||
| 869 | + child: Material( | ||
| 870 | + child: InkWell( | ||
| 871 | + onTap: onPressedComplete, | ||
| 872 | + child: Container( | ||
| 873 | + decoration: BoxDecoration( | ||
| 874 | + color: MyColours.color_199095, | ||
| 875 | + borderRadius: BorderRadius.only( | ||
| 876 | + topRight: Radius.circular( | ||
| 877 | + ScreenUtil().setWidth(20)), | ||
| 878 | + bottomRight: Radius.circular( | ||
| 879 | + ScreenUtil().setWidth(20)), | ||
| 880 | + )), | ||
| 881 | + child: Align( | ||
| 882 | + alignment: Alignment.center, | ||
| 883 | + child: _textWidget( | ||
| 884 | + '确定', | ||
| 885 | + MyColours.color_ffffff, | ||
| 886 | + FontWeight.normal, | ||
| 887 | + 30), | ||
| 888 | + ), | ||
| 889 | + ), | ||
| 890 | + ))) | ||
| 891 | + ], | ||
| 892 | + ), | ||
| 893 | + ), | ||
| 894 | + ], | ||
| 895 | + ), | ||
| 896 | + VEmptyView(30) | ||
| 897 | + ], | ||
| 898 | + ), | ||
| 899 | + ))); | ||
| 900 | + } | ||
| 901 | + | ||
| 902 | + //构建筛选按钮 | ||
| 903 | + List<Widget> _buildFilterItem(List<Map> data, bool round, | ||
| 904 | + {bool grayBack = false}) { | ||
| 905 | + List<Widget> items = []; | ||
| 906 | + | ||
| 907 | + for (Map item in data) { | ||
| 908 | + items.add(Container( | ||
| 909 | + padding: EdgeInsets.symmetric( | ||
| 910 | + horizontal: ScreenUtil().setWidth(20), | ||
| 911 | + vertical: ScreenUtil().setWidth(6)), | ||
| 912 | + decoration: BoxDecoration( | ||
| 913 | + color: grayBack | ||
| 914 | + ? Color.fromRGBO(239, 239, 239, 1) | ||
| 915 | + : item['select'] | ||
| 916 | + ? MyColours.color_199095 | ||
| 917 | + : MyColours.color_ffffff, | ||
| 918 | + border: Border.all( | ||
| 919 | + color: grayBack | ||
| 920 | + ? Color.fromRGBO(239, 239, 239, 1) | ||
| 921 | + : item['select'] | ||
| 922 | + ? MyColours.color_199095 | ||
| 923 | + : round | ||
| 924 | + ? Color.fromRGBO(155, 155, 155, 1) | ||
| 925 | + : MyColours.color_199095, | ||
| 926 | + width: ScreenUtil().setWidth(2)), | ||
| 927 | + borderRadius: BorderRadius.circular( | ||
| 928 | + ScreenUtil().setWidth(round ? 30 : 10))), | ||
| 929 | + child: _textWidget( | ||
| 930 | + item['title'], | ||
| 931 | + grayBack | ||
| 932 | + ? MyColours.color_333333 | ||
| 933 | + : item['select'] | ||
| 934 | + ? MyColours.color_ffffff | ||
| 935 | + : round | ||
| 936 | + ? MyColours.color_333333 | ||
| 937 | + : MyColours.color_199095, | ||
| 938 | + FontWeight.normal, | ||
| 939 | + 24))); | ||
| 940 | + } | ||
| 941 | + return items; | ||
| 942 | + } | ||
| 943 | + | ||
| 944 | + @override | ||
| 945 | + Widget build(BuildContext context) { | ||
| 946 | + customerProvider = Provider.of<CustomerProvider>(context, listen: true); | ||
| 947 | + customerMakingProvider = | ||
| 948 | + Provider.of<CustomerMakingProvider>(context, listen: true); | ||
| 949 | + | ||
| 950 | + return Material( | ||
| 951 | + child: InkWell( | ||
| 952 | + onTap: () { | ||
| 953 | + // FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 954 | + }, | ||
| 955 | + child: Scaffold( | ||
| 956 | + resizeToAvoidBottomInset: false, | ||
| 957 | + backgroundColor: MyColours.color_ffffff, | ||
| 958 | + appBar: SystemAppBar( | ||
| 959 | + '客户', | ||
| 960 | + onTap: () { | ||
| 961 | + Navigator.of(context).pop(); | ||
| 962 | + }, | ||
| 963 | + ), | ||
| 964 | + body: Consumer<CustomerProvider>(builder: (context, model, _) { | ||
| 965 | + if (model.pageStateListShow != PageState.Success) { | ||
| 966 | + return ExceptionPage( | ||
| 967 | + pageState: model.pageStateListShow, | ||
| 968 | + callback: () { | ||
| 969 | + model.pageStateListShow = PageState.Loading; | ||
| 970 | + model.notifyListeners(); | ||
| 971 | + _getSellerGuestByGid(); | ||
| 972 | + }, | ||
| 973 | + emptyMsg: "暂时没有客户哦", | ||
| 974 | + emptyImg: "empty_search", | ||
| 975 | + showMsg: "加载中,请稍后...", | ||
| 976 | + ); | ||
| 977 | + } else { | ||
| 978 | + return ContactListPage( | ||
| 979 | + contacts: customerProvider.selectCustomerSeller, | ||
| 980 | + provider: customerProvider, | ||
| 981 | + fromPage: FromPage.FromPageShowCutomerList); | ||
| 982 | + } | ||
| 983 | + }), | ||
| 984 | + ), | ||
| 985 | + )); | ||
| 986 | + } | ||
| 987 | +} |
| @@ -39,6 +39,7 @@ class _StoreCustomerPageState extends State<StoreCustomerPage> { | @@ -39,6 +39,7 @@ class _StoreCustomerPageState extends State<StoreCustomerPage> { | ||
| 39 | }); | 39 | }); |
| 40 | bus.on("refresh_store_customer_home", (arg) { | 40 | bus.on("refresh_store_customer_home", (arg) { |
| 41 | _getMarketingBySeller(); | 41 | _getMarketingBySeller(); |
| 42 | + _getSellerGuestManage(); | ||
| 42 | }); | 43 | }); |
| 43 | } | 44 | } |
| 44 | 45 |
| 1 | +import 'dart:convert'; | ||
| 2 | + | ||
| 1 | import 'package:azlistview/azlistview.dart'; | 3 | import 'package:azlistview/azlistview.dart'; |
| 2 | import 'package:flutter/material.dart'; | 4 | import 'package:flutter/material.dart'; |
| 3 | import 'package:lpinyin/lpinyin.dart'; | 5 | import 'package:lpinyin/lpinyin.dart'; |
| @@ -9,6 +11,7 @@ import 'package:one_key/models/customer_by_seller_model.dart'; | @@ -9,6 +11,7 @@ import 'package:one_key/models/customer_by_seller_model.dart'; | ||
| 9 | import 'package:one_key/models/customer_label_model.dart'; | 11 | import 'package:one_key/models/customer_label_model.dart'; |
| 10 | import 'package:one_key/models/customer_list_model.dart'; | 12 | import 'package:one_key/models/customer_list_model.dart'; |
| 11 | import 'package:one_key/models/filter_btn_model.dart'; | 13 | import 'package:one_key/models/filter_btn_model.dart'; |
| 14 | +import 'package:one_key/models/get_seller_user_by_sellerid_model.dart'; | ||
| 12 | import 'package:one_key/models/guest_info_model.dart'; | 15 | import 'package:one_key/models/guest_info_model.dart'; |
| 13 | import 'package:one_key/models/guest_manage_model.dart'; | 16 | import 'package:one_key/models/guest_manage_model.dart'; |
| 14 | import 'package:one_key/models/guest_reserve_model.dart'; | 17 | import 'package:one_key/models/guest_reserve_model.dart'; |
| @@ -65,9 +68,12 @@ class CustomerProvider extends ChangeNotifier { | @@ -65,9 +68,12 @@ class CustomerProvider extends ChangeNotifier { | ||
| 65 | 68 | ||
| 66 | MarketingByIdSunModel marketingByIdSunModel; | 69 | MarketingByIdSunModel marketingByIdSunModel; |
| 67 | List<CustomerLabelSunModel> labelList = []; //标签数据 | 70 | List<CustomerLabelSunModel> labelList = []; //标签数据 |
| 71 | + List<FilterBtnModel> sellerManageList = []; //经理数据 ---- 商家编辑页面 | ||
| 68 | 72 | ||
| 69 | int labelSelIndex; | 73 | int labelSelIndex; |
| 70 | 74 | ||
| 75 | + int manageSelIndex; | ||
| 76 | + | ||
| 71 | MarketingByUidsSunModel myRecordData; //我的营销记录数据(包含详情) | 77 | MarketingByUidsSunModel myRecordData; //我的营销记录数据(包含详情) |
| 72 | 78 | ||
| 73 | PageState pageStateListShow = PageState.Loading; | 79 | PageState pageStateListShow = PageState.Loading; |
| @@ -359,39 +365,6 @@ class CustomerProvider extends ChangeNotifier { | @@ -359,39 +365,6 @@ class CustomerProvider extends ChangeNotifier { | ||
| 359 | 365 | ||
| 360 | // userHistorys[i] = item; | 366 | // userHistorys[i] = item; |
| 361 | // } | 367 | // } |
| 362 | - // userHistorysShow = userHistorys; //全部客户列表信息 | ||
| 363 | - // userHistorysShowHuoyue = []; | ||
| 364 | - // userHistorysShowChenshui = []; | ||
| 365 | - // userHistorysShowLiushi = []; | ||
| 366 | - // for (CustomerListSunModel item in userHistorysShow) { | ||
| 367 | - // if (item.attr == '活跃') { | ||
| 368 | - // userHistorysShowHuoyue.add(item); | ||
| 369 | - // } else if (item.attr == '沉睡') { | ||
| 370 | - // userHistorysShowChenshui.add(item); | ||
| 371 | - // } else if (item.attr == '流失') { | ||
| 372 | - // userHistorysShowLiushi.add(item); | ||
| 373 | - // } | ||
| 374 | - // } | ||
| 375 | - // if (userHistorysShowHuoyue.length > 0) { | ||
| 376 | - // pageStateHuoyue = PageState.Success; | ||
| 377 | - // } else { | ||
| 378 | - // pageStateHuoyue = PageState.Empty; | ||
| 379 | - // } | ||
| 380 | - // if (userHistorysShowChenshui.length > 0) { | ||
| 381 | - // pageStateChenshui = PageState.Success; | ||
| 382 | - // } else { | ||
| 383 | - // pageStateChenshui = PageState.Empty; | ||
| 384 | - // } | ||
| 385 | - // if (userHistorysShowLiushi.length > 0) { | ||
| 386 | - // pageStateLiushi = PageState.Success; | ||
| 387 | - // } else { | ||
| 388 | - // pageStateLiushi = PageState.Empty; | ||
| 389 | - // } | ||
| 390 | - // addAll(); | ||
| 391 | - // pageState = PageState.Success; | ||
| 392 | - // } | ||
| 393 | - // notifyListeners(); | ||
| 394 | - // } | ||
| 395 | } | 368 | } |
| 396 | 369 | ||
| 397 | //客户经理营销中的用户列表 | 370 | //客户经理营销中的用户列表 |
| @@ -450,7 +423,7 @@ class CustomerProvider extends ChangeNotifier { | @@ -450,7 +423,7 @@ class CustomerProvider extends ChangeNotifier { | ||
| 450 | if (baseResp != null) { | 423 | if (baseResp != null) { |
| 451 | Utils.showToast(baseResp.msg ?? ""); | 424 | Utils.showToast(baseResp.msg ?? ""); |
| 452 | } | 425 | } |
| 453 | - pageStateGuestInfo = PageState.ConnectivityTimeOut; | 426 | + pageStateListShow = PageState.ConnectivityTimeOut; |
| 454 | } | 427 | } |
| 455 | notifyListeners(); | 428 | notifyListeners(); |
| 456 | } | 429 | } |
| @@ -528,6 +501,33 @@ class CustomerProvider extends ChangeNotifier { | @@ -528,6 +501,33 @@ class CustomerProvider extends ChangeNotifier { | ||
| 528 | } | 501 | } |
| 529 | notifyListeners(); | 502 | notifyListeners(); |
| 530 | } | 503 | } |
| 504 | + | ||
| 505 | + //删除纪念日 | ||
| 506 | + Future<bool> delGuestCday(BuildContext context, Map<String, String> params, | ||
| 507 | + {bool showLoading = false}) async { | ||
| 508 | + BaseResp<dynamic> baseResp = await DioUtil() | ||
| 509 | + .request<dynamic>(context, Method.get, HttpUrl.del_guest_cday, | ||
| 510 | + data: params, showLoading: showLoading) | ||
| 511 | + .catchError((error) { | ||
| 512 | + print(error.toString()); | ||
| 513 | + if (error is MyError) {} | ||
| 514 | + notifyListeners(); | ||
| 515 | + }); | ||
| 516 | + if (baseResp != null && baseResp.code == Constant.status_success) { | ||
| 517 | + // guestReserveSunModel = | ||
| 518 | + // GuestReserveModel.fromJson(baseResp.responseData).data; | ||
| 519 | + if (baseResp.responseData['data'] == 1 || | ||
| 520 | + baseResp.responseData['data'] == 0) { | ||
| 521 | + return true; | ||
| 522 | + } | ||
| 523 | + return false; | ||
| 524 | + } else { | ||
| 525 | + if (baseResp != null) { | ||
| 526 | + Utils.showToast(baseResp.msg ?? ""); | ||
| 527 | + } | ||
| 528 | + return false; | ||
| 529 | + } | ||
| 530 | + } | ||
| 531 | // //获取历史录入 | 531 | // //获取历史录入 |
| 532 | // getUserHistorys(BuildContext context, Map<String, String> params) async { | 532 | // getUserHistorys(BuildContext context, Map<String, String> params) async { |
| 533 | // BaseResp<List> baseResp = await DioUtil() | 533 | // BaseResp<List> baseResp = await DioUtil() |
| @@ -650,6 +650,42 @@ class CustomerProvider extends ChangeNotifier { | @@ -650,6 +650,42 @@ class CustomerProvider extends ChangeNotifier { | ||
| 650 | notifyListeners(); | 650 | notifyListeners(); |
| 651 | } | 651 | } |
| 652 | 652 | ||
| 653 | + ///催促未完成任务经理发消息 | ||
| 654 | + Future<bool> sendMarketingMsgByMid( | ||
| 655 | + BuildContext context, Map<String, String> params, | ||
| 656 | + {bool showLoading = false}) async { | ||
| 657 | + BaseResp<dynamic> baseResp = await DioUtil() | ||
| 658 | + .request<dynamic>( | ||
| 659 | + context, Method.get, HttpUrl.send_marketing_msg_by_mid, | ||
| 660 | + data: params, showLoading: showLoading) | ||
| 661 | + .catchError((error) { | ||
| 662 | + print(error.toString()); | ||
| 663 | + if (error is MyError) {} | ||
| 664 | + notifyListeners(); | ||
| 665 | + }); | ||
| 666 | + if (baseResp != null && baseResp.code == Constant.status_success) { | ||
| 667 | + // guestReserveSunModel = | ||
| 668 | + // GuestReserveModel.fromJson(baseResp.responseData).data; | ||
| 669 | + if (baseResp.responseData['data'] != null && | ||
| 670 | + baseResp.responseData['data'].length == 1) { | ||
| 671 | + String url = baseResp.responseData['data'][0]; | ||
| 672 | + Map map = json.decode(url); | ||
| 673 | + print(map); | ||
| 674 | + String pushId = map['push_id']; | ||
| 675 | + if (pushId.length > 0) { | ||
| 676 | + return true; | ||
| 677 | + } | ||
| 678 | + return false; | ||
| 679 | + } | ||
| 680 | + return false; | ||
| 681 | + } else { | ||
| 682 | + if (baseResp != null) { | ||
| 683 | + Utils.showToast(baseResp.msg ?? ""); | ||
| 684 | + } | ||
| 685 | + return false; | ||
| 686 | + } | ||
| 687 | + } | ||
| 688 | + | ||
| 653 | //修改客户信息 | 689 | //修改客户信息 |
| 654 | Future<bool> setGuestInfo(BuildContext context, Map<String, String> params, | 690 | Future<bool> setGuestInfo(BuildContext context, Map<String, String> params, |
| 655 | {bool showLoading = false}) async { | 691 | {bool showLoading = false}) async { |
| @@ -677,6 +713,35 @@ class CustomerProvider extends ChangeNotifier { | @@ -677,6 +713,35 @@ class CustomerProvider extends ChangeNotifier { | ||
| 677 | } | 713 | } |
| 678 | } | 714 | } |
| 679 | 715 | ||
| 716 | + //修改完成任务后的状态 | ||
| 717 | + Future<bool> setMarketingStatusByUid( | ||
| 718 | + BuildContext context, Map<String, String> params, | ||
| 719 | + {bool showLoading = false}) async { | ||
| 720 | + BaseResp<dynamic> baseResp = await DioUtil() | ||
| 721 | + .request<dynamic>( | ||
| 722 | + context, Method.get, HttpUrl.set_marketing_status_by_uid, | ||
| 723 | + data: params, showLoading: showLoading) | ||
| 724 | + .catchError((error) { | ||
| 725 | + print(error.toString()); | ||
| 726 | + if (error is MyError) {} | ||
| 727 | + notifyListeners(); | ||
| 728 | + }); | ||
| 729 | + if (baseResp != null && baseResp.code == Constant.status_success) { | ||
| 730 | + // guestReserveSunModel = | ||
| 731 | + // GuestReserveModel.fromJson(baseResp.responseData).data; | ||
| 732 | + // if (baseResp.responseData['data']. == 1 || | ||
| 733 | + // baseResp.responseData['data'] == 0) { | ||
| 734 | + // return true; | ||
| 735 | + // } | ||
| 736 | + return true; | ||
| 737 | + } else { | ||
| 738 | + if (baseResp != null) { | ||
| 739 | + Utils.showToast(baseResp.msg ?? ""); | ||
| 740 | + } | ||
| 741 | + return false; | ||
| 742 | + } | ||
| 743 | + } | ||
| 744 | + | ||
| 680 | //修改客户信息纪念日 | 745 | //修改客户信息纪念日 |
| 681 | Future<bool> setGuestInfocDay( | 746 | Future<bool> setGuestInfocDay( |
| 682 | BuildContext context, Map<String, String> params, | 747 | BuildContext context, Map<String, String> params, |
| @@ -1072,7 +1137,7 @@ class CustomerProvider extends ChangeNotifier { | @@ -1072,7 +1137,7 @@ class CustomerProvider extends ChangeNotifier { | ||
| 1072 | return storeSunmodel; | 1137 | return storeSunmodel; |
| 1073 | } | 1138 | } |
| 1074 | 1139 | ||
| 1075 | - //商家营销中的用户列表 | 1140 | + //商家---营销中的用户列表 |
| 1076 | getSellerGuestByGid(BuildContext context, Map<String, String> params) async { | 1141 | getSellerGuestByGid(BuildContext context, Map<String, String> params) async { |
| 1077 | BaseResp<List> baseResp = await DioUtil() | 1142 | BaseResp<List> baseResp = await DioUtil() |
| 1078 | .request<List>(context, Method.get, HttpUrl.get_guest_by_gid, | 1143 | .request<List>(context, Method.get, HttpUrl.get_guest_by_gid, |
| @@ -1096,10 +1161,18 @@ class CustomerProvider extends ChangeNotifier { | @@ -1096,10 +1161,18 @@ class CustomerProvider extends ChangeNotifier { | ||
| 1096 | }); | 1161 | }); |
| 1097 | 1162 | ||
| 1098 | if (baseResp != null && baseResp.code == Constant.status_success) { | 1163 | if (baseResp != null && baseResp.code == Constant.status_success) { |
| 1099 | - List<CustomerBySellerSunModel> user = | ||
| 1100 | - baseResp.data.map<CustomerBySellerSunModel>((value) { | ||
| 1101 | - return CustomerBySellerSunModel.fromJson(value); | 1164 | + List<CustomerListSunModel> data = |
| 1165 | + baseResp.data.map<CustomerListSunModel>((value) { | ||
| 1166 | + return CustomerListSunModel.fromJson(value); | ||
| 1167 | + }).toList(); | ||
| 1168 | + List<CustomerBySellerSunModel> user = data.map((value) { | ||
| 1169 | + print(json.encode(value)); | ||
| 1170 | + return CustomerBySellerSunModel.fromJson( | ||
| 1171 | + json.decode(json.encode(value))); | ||
| 1102 | }).toList(); | 1172 | }).toList(); |
| 1173 | + // for (int i = 0; i < user.length;i++){ | ||
| 1174 | + | ||
| 1175 | + // } | ||
| 1103 | if (user.length == 0) { | 1176 | if (user.length == 0) { |
| 1104 | pageStateListShow = PageState.Empty; | 1177 | pageStateListShow = PageState.Empty; |
| 1105 | } else { | 1178 | } else { |
| @@ -1128,20 +1201,58 @@ class CustomerProvider extends ChangeNotifier { | @@ -1128,20 +1201,58 @@ class CustomerProvider extends ChangeNotifier { | ||
| 1128 | if (baseResp != null) { | 1201 | if (baseResp != null) { |
| 1129 | Utils.showToast(baseResp.msg ?? ""); | 1202 | Utils.showToast(baseResp.msg ?? ""); |
| 1130 | } | 1203 | } |
| 1131 | - pageStateGuestInfo = PageState.ConnectivityTimeOut; | 1204 | + pageStateListShow = PageState.ConnectivityTimeOut; |
| 1132 | } | 1205 | } |
| 1133 | notifyListeners(); | 1206 | notifyListeners(); |
| 1134 | } | 1207 | } |
| 1135 | 1208 | ||
| 1209 | + ///商家详情编辑页面 ------ 获取经理数据 | ||
| 1210 | + Future<List<FilterBtnModel>> getSellerUserBySellerid(BuildContext context, | ||
| 1211 | + {isShowLoading = true}) async { | ||
| 1212 | + Map<String, String> params = { | ||
| 1213 | + 'sellerid': Provider.of<UserModel>(context, listen: false).user.sellerid | ||
| 1214 | + }; | ||
| 1215 | + BaseResp<dynamic> baseResp = await DioUtil() | ||
| 1216 | + .request<dynamic>( | ||
| 1217 | + context, Method.get, HttpUrl.get_seller_user_by_sellerid, | ||
| 1218 | + data: params, showLoading: false) | ||
| 1219 | + .catchError((error) { | ||
| 1220 | + print(error.toString()); | ||
| 1221 | + if (error is MyError) {} | ||
| 1222 | + }); | ||
| 1223 | + if (baseResp.code == Constant.status_success) { | ||
| 1224 | + List<GetSellerUserBySelleridSunModel> sunmodel = | ||
| 1225 | + GetSellerUserBySelleridModel.fromJson(baseResp.responseData).data; | ||
| 1226 | + sellerManageList = []; | ||
| 1227 | + if (sunmodel != null && sunmodel.length > 0) { | ||
| 1228 | + for (GetSellerUserBySelleridSunModel item in sunmodel) { | ||
| 1229 | + if (item.nickName != null) { | ||
| 1230 | + FilterBtnModel model = FilterBtnModel(); | ||
| 1231 | + model.id = item.id; | ||
| 1232 | + model.title = item.nickName; | ||
| 1233 | + sellerManageList.add(model); | ||
| 1234 | + } | ||
| 1235 | + } | ||
| 1236 | + } | ||
| 1237 | + } else { | ||
| 1238 | + if (baseResp != null) { | ||
| 1239 | + Utils.showToast(baseResp.msg ?? ""); | ||
| 1240 | + } | ||
| 1241 | + } | ||
| 1242 | + return sellerManageList; | ||
| 1243 | + } | ||
| 1244 | + | ||
| 1136 | //全选按钮执行“全选” | 1245 | //全选按钮执行“全选” |
| 1137 | addAll() async { | 1246 | addAll() async { |
| 1138 | //把数据状态全部改成true,即选中状态 | 1247 | //把数据状态全部改成true,即选中状态 |
| 1139 | selectCustomerSeller = []; | 1248 | selectCustomerSeller = []; |
| 1140 | for (var i = 0; i < customerBySellerList.length; i++) { | 1249 | for (var i = 0; i < customerBySellerList.length; i++) { |
| 1141 | - customerBySellerList[i].select = true; | ||
| 1142 | - selectCustomerSeller.add(customerBySellerList[i]); | 1250 | + if (customerBySellerList[i].gid != null) { |
| 1251 | + customerBySellerList[i].select = true; | ||
| 1252 | + selectCustomerSeller.add(customerBySellerList[i]); | ||
| 1253 | + } | ||
| 1143 | } | 1254 | } |
| 1144 | - checkValue = true; | 1255 | + getCheckValue(); |
| 1145 | labelsValue(); | 1256 | labelsValue(); |
| 1146 | notifyListeners(); | 1257 | notifyListeners(); |
| 1147 | } | 1258 | } |
| @@ -1187,7 +1298,7 @@ class CustomerProvider extends ChangeNotifier { | @@ -1187,7 +1298,7 @@ class CustomerProvider extends ChangeNotifier { | ||
| 1187 | 1298 | ||
| 1188 | //未选中 | 1299 | //未选中 |
| 1189 | cancelData(int index) { | 1300 | cancelData(int index) { |
| 1190 | - userHistorys[index].select = false; | 1301 | + // userHistorys[index].select = false; |
| 1191 | selectCustomerSeller.removeWhere( | 1302 | selectCustomerSeller.removeWhere( |
| 1192 | (element) => element.gid == customerBySellerList[index].gid); | 1303 | (element) => element.gid == customerBySellerList[index].gid); |
| 1193 | labelsValue(); | 1304 | labelsValue(); |
| @@ -548,7 +548,7 @@ class NavigatorUtil { | @@ -548,7 +548,7 @@ class NavigatorUtil { | ||
| 548 | replace: replace); | 548 | replace: replace); |
| 549 | } | 549 | } |
| 550 | 550 | ||
| 551 | - /// 仅展示客情列表 | 551 | + /// 仅展示客情列表 --- 商家 |
| 552 | static Future<dynamic> goShowCustomerListPage( | 552 | static Future<dynamic> goShowCustomerListPage( |
| 553 | BuildContext context, FromPage fromPage, String gid, | 553 | BuildContext context, FromPage fromPage, String gid, |
| 554 | {replace = false, bool needBtn = false}) { | 554 | {replace = false, bool needBtn = false}) { |
| @@ -557,6 +557,15 @@ class NavigatorUtil { | @@ -557,6 +557,15 @@ class NavigatorUtil { | ||
| 557 | replace: replace); | 557 | replace: replace); |
| 558 | } | 558 | } |
| 559 | 559 | ||
| 560 | + /// 仅展示客情列表 --- 我的 | ||
| 561 | + static Future<dynamic> goMyShowCustomerListPage( | ||
| 562 | + BuildContext context, FromPage fromPage, String gid, | ||
| 563 | + {replace = false, bool needBtn = false}) { | ||
| 564 | + return _navigateTo(context, | ||
| 565 | + "${Routes.my_show_customer_list_page}?fromPage=${FluroConvertUtils.enumToString(fromPage)}&gid=$gid", | ||
| 566 | + replace: replace); | ||
| 567 | + } | ||
| 568 | + | ||
| 560 | /// 客情设置 | 569 | /// 客情设置 |
| 561 | static Future<dynamic> goCustomerSetPage(BuildContext context, | 570 | static Future<dynamic> goCustomerSetPage(BuildContext context, |
| 562 | {replace = false}) { | 571 | {replace = false}) { |
| @@ -598,12 +607,11 @@ class NavigatorUtil { | @@ -598,12 +607,11 @@ class NavigatorUtil { | ||
| 598 | static Future<dynamic> goCustomerDetailPage( | 607 | static Future<dynamic> goCustomerDetailPage( |
| 599 | BuildContext context, | 608 | BuildContext context, |
| 600 | CustomerBySellerSunModel userHistoryEntity, | 609 | CustomerBySellerSunModel userHistoryEntity, |
| 601 | - FromPage fromPage, | ||
| 602 | - String nickName, { | 610 | + FromPage fromPage, { |
| 603 | replace = false, | 611 | replace = false, |
| 604 | }) { | 612 | }) { |
| 605 | return _navigateTo(context, | 613 | return _navigateTo(context, |
| 606 | - "${Routes.customer_detail_page}?userHistoryEntity=${FluroConvertUtils.object2string(userHistoryEntity)}&fromPage=${FluroConvertUtils.enumToString(fromPage)}&nickName=${Uri.encodeComponent(nickName)}", | 614 | + "${Routes.customer_detail_page}?userHistoryEntity=${FluroConvertUtils.object2string(userHistoryEntity)}&fromPage=${FluroConvertUtils.enumToString(fromPage)}", |
| 607 | replace: replace); | 615 | replace: replace); |
| 608 | } | 616 | } |
| 609 | 617 |
| @@ -58,7 +58,8 @@ import 'package:one_key/pages/my/customer_type/my_customer/my_make_marking_page_ | @@ -58,7 +58,8 @@ import 'package:one_key/pages/my/customer_type/my_customer/my_make_marking_page_ | ||
| 58 | import 'package:one_key/pages/my/customer_type/my_customer/my_marketing_records_detail_page.dart'; | 58 | import 'package:one_key/pages/my/customer_type/my_customer/my_marketing_records_detail_page.dart'; |
| 59 | import 'package:one_key/pages/my/customer_type/my_customer/my_marketing_records_detail_page_seller.dart'; | 59 | import 'package:one_key/pages/my/customer_type/my_customer/my_marketing_records_detail_page_seller.dart'; |
| 60 | import 'package:one_key/pages/my/customer_type/my_customer/my_marketing_records_page.dart'; | 60 | import 'package:one_key/pages/my/customer_type/my_customer/my_marketing_records_page.dart'; |
| 61 | -import 'package:one_key/pages/my/customer_type/show_customer_list_page.dart'; | 61 | +import 'package:one_key/pages/my/customer_type/my_customer/my_show_customer_list_page.dart'; |
| 62 | +import 'package:one_key/pages/my/customer_type/store_customer/show_customer_list_page.dart'; | ||
| 62 | 63 | ||
| 63 | import 'package:one_key/pages/my/customer_type/store_customer/customer_detail_edit_page.dart'; | 64 | import 'package:one_key/pages/my/customer_type/store_customer/customer_detail_edit_page.dart'; |
| 64 | import 'package:one_key/pages/my/customer_type/store_customer/customer_detail_page.dart'; | 65 | import 'package:one_key/pages/my/customer_type/store_customer/customer_detail_page.dart'; |
| @@ -884,7 +885,7 @@ var customerListPageHandle = new Handler( | @@ -884,7 +885,7 @@ var customerListPageHandle = new Handler( | ||
| 884 | child: CustomerListPage(fromPage: fromPage, index: index, uidStr: uid)); | 885 | child: CustomerListPage(fromPage: fromPage, index: index, uidStr: uid)); |
| 885 | }); | 886 | }); |
| 886 | 887 | ||
| 887 | -///仅供展示的客情列表 | 888 | +///仅供展示的客情列表 ---商家 |
| 888 | var showCustomerListPageHandle = new Handler( | 889 | var showCustomerListPageHandle = new Handler( |
| 889 | handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) { | 890 | handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) { |
| 890 | FromPage fromPage = FluroConvertUtils.enumFromString<FromPage>( | 891 | FromPage fromPage = FluroConvertUtils.enumFromString<FromPage>( |
| @@ -897,6 +898,19 @@ var showCustomerListPageHandle = new Handler( | @@ -897,6 +898,19 @@ var showCustomerListPageHandle = new Handler( | ||
| 897 | child: ShowCustomerListPage(fromPage: fromPage, gid: gid)); | 898 | child: ShowCustomerListPage(fromPage: fromPage, gid: gid)); |
| 898 | }); | 899 | }); |
| 899 | 900 | ||
| 901 | +///仅供展示的客情列表 --- 我的 | ||
| 902 | +var myShowCustomerListPageHandle = new Handler( | ||
| 903 | + handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) { | ||
| 904 | + FromPage fromPage = FluroConvertUtils.enumFromString<FromPage>( | ||
| 905 | + FromPage.values, params["fromPage"].first); | ||
| 906 | + print(fromPage); | ||
| 907 | + String gid = params["gid"].first; | ||
| 908 | + | ||
| 909 | + return ChangeNotifierProvider<CustomerProvider>( | ||
| 910 | + create: (_) => CustomerProvider(), | ||
| 911 | + child: MyShowCustomerListPage(fromPage: fromPage, gid: gid)); | ||
| 912 | +}); | ||
| 913 | + | ||
| 900 | ///我的客情列表 | 914 | ///我的客情列表 |
| 901 | var myCustomerListPageHandle = new Handler( | 915 | var myCustomerListPageHandle = new Handler( |
| 902 | handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) { | 916 | handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) { |
| @@ -1041,13 +1055,12 @@ var customerDetailPageHandle = new Handler( | @@ -1041,13 +1055,12 @@ var customerDetailPageHandle = new Handler( | ||
| 1041 | FromPage.values, params["fromPage"].first); | 1055 | FromPage.values, params["fromPage"].first); |
| 1042 | print(fromPage); | 1056 | print(fromPage); |
| 1043 | 1057 | ||
| 1044 | - String nickName = params["nickName"].first; | ||
| 1045 | return ChangeNotifierProvider<CustomerProvider>( | 1058 | return ChangeNotifierProvider<CustomerProvider>( |
| 1046 | create: (_) => CustomerProvider(), | 1059 | create: (_) => CustomerProvider(), |
| 1047 | child: CustomerDetailPage( | 1060 | child: CustomerDetailPage( |
| 1048 | - userHistoryEntity: userHistoryEntity, | ||
| 1049 | - fromPage: fromPage, | ||
| 1050 | - nickName: nickName)); | 1061 | + userHistoryEntity: userHistoryEntity, |
| 1062 | + fromPage: fromPage, | ||
| 1063 | + )); | ||
| 1051 | }); | 1064 | }); |
| 1052 | 1065 | ||
| 1053 | ///我的客户详情 | 1066 | ///我的客户详情 |
| @@ -1078,10 +1091,7 @@ var customerDetailEditPageHandle = new Handler( | @@ -1078,10 +1091,7 @@ var customerDetailEditPageHandle = new Handler( | ||
| 1078 | FromPage.values, params["fromPage"].first); | 1091 | FromPage.values, params["fromPage"].first); |
| 1079 | return ChangeNotifierProvider<CustomerProvider>( | 1092 | return ChangeNotifierProvider<CustomerProvider>( |
| 1080 | create: (_) => CustomerProvider(), | 1093 | create: (_) => CustomerProvider(), |
| 1081 | - child: CustomerDetailEditPage( | ||
| 1082 | - guest: guest, | ||
| 1083 | - fromPage: fromPage, | ||
| 1084 | - )); | 1094 | + child: CustomerDetailEditPage(guest: guest, fromPage: fromPage)); |
| 1085 | }); | 1095 | }); |
| 1086 | 1096 | ||
| 1087 | ///我的编辑客户详情 | 1097 | ///我的编辑客户详情 |
| @@ -94,11 +94,14 @@ class Routes { | @@ -94,11 +94,14 @@ class Routes { | ||
| 94 | 94 | ||
| 95 | static String my_festival_edit_page = "/my_festival_edit_page"; //编辑纪念日 | 95 | static String my_festival_edit_page = "/my_festival_edit_page"; //编辑纪念日 |
| 96 | static String my_customer_order_page = "/my_customer_order_page"; //客户订单 | 96 | static String my_customer_order_page = "/my_customer_order_page"; //客户订单 |
| 97 | - static String show_customer_list_page = "/show_customer_list_page"; //仅展示的客户列表 | 97 | + static String show_customer_list_page = "/show_customer_list_page"; //仅展示的客户列表 --- 商家 |
| 98 | static String seller_my_marketing_records_detail_page = | 98 | static String seller_my_marketing_records_detail_page = |
| 99 | "/seller_my_marketing_records_detail_page"; //我的客情---营销详情----全店任务详情 | 99 | "/seller_my_marketing_records_detail_page"; //我的客情---营销详情----全店任务详情 |
| 100 | - static String my_make_marketing_page_only_show = "/my_make_marketing_page_only_show"; //我的--完成全店营销 | ||
| 101 | - | 100 | + static String my_make_marketing_page_only_show = |
| 101 | + "/my_make_marketing_page_only_show"; //我的--完成全店营销 | ||
| 102 | + | ||
| 103 | + static String my_show_customer_list_page = | ||
| 104 | + "/my_show_customer_list_page"; //仅展示的客户列表----我的 | ||
| 102 | 105 | ||
| 103 | static void configureRoutes(FluroRouter router) { | 106 | static void configureRoutes(FluroRouter router) { |
| 104 | router.notFoundHandler = new Handler( | 107 | router.notFoundHandler = new Handler( |
| @@ -202,8 +205,9 @@ class Routes { | @@ -202,8 +205,9 @@ class Routes { | ||
| 202 | router.define(show_customer_list_page, handler: showCustomerListPageHandle); | 205 | router.define(show_customer_list_page, handler: showCustomerListPageHandle); |
| 203 | router.define(seller_my_marketing_records_detail_page, | 206 | router.define(seller_my_marketing_records_detail_page, |
| 204 | handler: sellerMyMarketingRecordsDetailPageHandle); | 207 | handler: sellerMyMarketingRecordsDetailPageHandle); |
| 205 | - router.define(my_make_marketing_page_only_show, | 208 | + router.define(my_make_marketing_page_only_show, |
| 206 | handler: myMakeMarkingPageOnlyShowHandle); | 209 | handler: myMakeMarkingPageOnlyShowHandle); |
| 207 | - | 210 | + router.define(my_show_customer_list_page, |
| 211 | + handler: myShowCustomerListPageHandle); | ||
| 208 | } | 212 | } |
| 209 | } | 213 | } |
| @@ -2346,6 +2346,7 @@ class DialogUtil { | @@ -2346,6 +2346,7 @@ class DialogUtil { | ||
| 2346 | static Future festivalAlertDialog( | 2346 | static Future festivalAlertDialog( |
| 2347 | BuildContext context, String name, double height, | 2347 | BuildContext context, String name, double height, |
| 2348 | {CustomCallBack rCallback, | 2348 | {CustomCallBack rCallback, |
| 2349 | + GestureTapCallback delCallback, | ||
| 2349 | double fontSize = 28, | 2350 | double fontSize = 28, |
| 2350 | String yearStr = '选填', | 2351 | String yearStr = '选填', |
| 2351 | String monthStr = '', | 2352 | String monthStr = '', |
| @@ -2393,12 +2394,20 @@ class DialogUtil { | @@ -2393,12 +2394,20 @@ class DialogUtil { | ||
| 2393 | ), | 2394 | ), |
| 2394 | Positioned( | 2395 | Positioned( |
| 2395 | right: 0, | 2396 | right: 0, |
| 2396 | - top: ScreenUtil().setWidth(36), | ||
| 2397 | - child: Text('删除', | ||
| 2398 | - style: TextStyle( | ||
| 2399 | - decoration: TextDecoration.underline, | ||
| 2400 | - fontSize: ScreenUtil().setSp(26), | ||
| 2401 | - color: MyColours.color_199095))) | 2397 | + top: 0, |
| 2398 | + child: InkWell( | ||
| 2399 | + onTap: delCallback, | ||
| 2400 | + child: Padding( | ||
| 2401 | + padding: EdgeInsets.only( | ||
| 2402 | + top: ScreenUtil().setWidth(36)), | ||
| 2403 | + child: Text('删除', | ||
| 2404 | + style: TextStyle( | ||
| 2405 | + decoration: | ||
| 2406 | + TextDecoration.underline, | ||
| 2407 | + fontSize: | ||
| 2408 | + ScreenUtil().setSp(26), | ||
| 2409 | + color: MyColours.color_199095)), | ||
| 2410 | + ))) | ||
| 2402 | ]), | 2411 | ]), |
| 2403 | 2412 | ||
| 2404 | Container( | 2413 | Container( |
-
Please register or login to post a comment