Commit 7d59ce6af3b7c9c289f6ee3e37007ebabe57c86f
1 parent
6f686dba
预订数据导出需开通客情维护功能&&消息中心不显示其他经理取消预订的消息
Showing
4 changed files
with
65 additions
and
28 deletions
| @@ -21,6 +21,8 @@ import 'package:one_key/widgets/system_app_bar.dart'; | @@ -21,6 +21,8 @@ import 'package:one_key/widgets/system_app_bar.dart'; | ||
| 21 | import 'package:one_key/widgets/v_empty_view.dart'; | 21 | import 'package:one_key/widgets/v_empty_view.dart'; |
| 22 | import 'package:provider/provider.dart'; | 22 | import 'package:provider/provider.dart'; |
| 23 | 23 | ||
| 24 | +import '../../../../provider/collect_store_provider.dart'; | ||
| 25 | +import '../../../../utils/dialog_util.dart'; | ||
| 24 | import '../../../../utils/screen_util.dart'; | 26 | import '../../../../utils/screen_util.dart'; |
| 25 | import '../../../../widgets/page_loading.dart'; | 27 | import '../../../../widgets/page_loading.dart'; |
| 26 | import '../month_item.dart'; | 28 | import '../month_item.dart'; |
| @@ -41,6 +43,8 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { | @@ -41,6 +43,8 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { | ||
| 41 | int year; | 43 | int year; |
| 42 | int month; | 44 | int month; |
| 43 | 45 | ||
| 46 | + CollectStoreProvider collectStoreProvider; | ||
| 47 | + | ||
| 44 | @override | 48 | @override |
| 45 | void initState() { | 49 | void initState() { |
| 46 | super.initState(); | 50 | super.initState(); |
| @@ -51,6 +55,8 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { | @@ -51,6 +55,8 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { | ||
| 51 | // _getSellerGuestManage(); | 55 | // _getSellerGuestManage(); |
| 52 | _getMarketingBySeller(); | 56 | _getMarketingBySeller(); |
| 53 | _getSellerCountsList(); | 57 | _getSellerCountsList(); |
| 58 | + | ||
| 59 | + getSellerVersion(); | ||
| 54 | }); | 60 | }); |
| 55 | bus.on("refresh_store_customer_home", (arg) { | 61 | bus.on("refresh_store_customer_home", (arg) { |
| 56 | _getMarketingBySeller(); | 62 | _getMarketingBySeller(); |
| @@ -66,6 +72,12 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { | @@ -66,6 +72,12 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { | ||
| 66 | super.dispose(); | 72 | super.dispose(); |
| 67 | } | 73 | } |
| 68 | 74 | ||
| 75 | + getSellerVersion() async { | ||
| 76 | + await collectStoreProvider.getSellerVersion(context); | ||
| 77 | + | ||
| 78 | + setState(() {}); | ||
| 79 | + } | ||
| 80 | + | ||
| 69 | ///全店客情首页 | 81 | ///全店客情首页 |
| 70 | _getSellerGuestManage() async { | 82 | _getSellerGuestManage() async { |
| 71 | StoreCustomerHomeSunModel model = | 83 | StoreCustomerHomeSunModel model = |
| @@ -845,7 +857,8 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { | @@ -845,7 +857,8 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { | ||
| 845 | 857 | ||
| 846 | @override | 858 | @override |
| 847 | Widget build(BuildContext context) { | 859 | Widget build(BuildContext context) { |
| 848 | - // widget.customerProvider = Provider.of<widget.customerProvider>(context, listen: true); | 860 | + collectStoreProvider = |
| 861 | + Provider.of<CollectStoreProvider>(context, listen: true); | ||
| 849 | return Scaffold( | 862 | return Scaffold( |
| 850 | // backgroundColor: Color.fromRGBO(246, 248, 250, 1), | 863 | // backgroundColor: Color.fromRGBO(246, 248, 250, 1), |
| 851 | // appBar: SystemAppBar('全店客情', onTap: () { | 864 | // appBar: SystemAppBar('全店客情', onTap: () { |
| @@ -1582,6 +1595,14 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { | @@ -1582,6 +1595,14 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { | ||
| 1582 | flex: 1, | 1595 | flex: 1, |
| 1583 | child: RoundButton( | 1596 | child: RoundButton( |
| 1584 | onPressed: () { | 1597 | onPressed: () { |
| 1598 | + if (!collectStoreProvider.sellerPreserve) { | ||
| 1599 | + //没有购买客情维护模块 | ||
| 1600 | + //提示购买 | ||
| 1601 | + | ||
| 1602 | + DialogUtil.showSellerVersionBuyDialog( | ||
| 1603 | + context, '客情维护', (v) {}); | ||
| 1604 | + return; | ||
| 1605 | + } | ||
| 1585 | NavigatorUtil.goExportBookDataPage( | 1606 | NavigatorUtil.goExportBookDataPage( |
| 1586 | context, | 1607 | context, |
| 1587 | ); | 1608 | ); |
| @@ -266,23 +266,26 @@ class _SmsTemplateSettingPageState extends State<SmsTemplateSettingPage> { | @@ -266,23 +266,26 @@ class _SmsTemplateSettingPageState extends State<SmsTemplateSettingPage> { | ||
| 266 | // 获取当前光标位置 | 266 | // 获取当前光标位置 |
| 267 | // int cursorPosition = _cursorPosition; | 267 | // int cursorPosition = _cursorPosition; |
| 268 | int cursorPosition = controller.selection.baseOffset; | 268 | int cursorPosition = controller.selection.baseOffset; |
| 269 | - | ||
| 270 | - // 插入文本 | ||
| 271 | - controller.text = controller.text.substring(0, cursorPosition) + | ||
| 272 | - marketingCenterProvider.smsChangeFieldData[i].show + | ||
| 273 | - controller.text.substring(cursorPosition); | ||
| 274 | - | ||
| 275 | - print(controller.text); | ||
| 276 | - | ||
| 277 | - // 设置新的光标位置 | ||
| 278 | - controller.selection = TextSelection.fromPosition(TextPosition( | ||
| 279 | - offset: cursorPosition + | ||
| 280 | - marketingCenterProvider.smsChangeFieldData[i].show.length, | ||
| 281 | - affinity: TextAffinity.downstream)); | ||
| 282 | - setState(() { | ||
| 283 | - _cursorPosition = controller.selection.baseOffset; | ||
| 284 | - // cursorPosition = _cursorPosition; | ||
| 285 | - }); | 269 | + if (cursorPosition != -1) { |
| 270 | + // 插入文本 | ||
| 271 | + controller.text = controller.text.substring(0, cursorPosition) + | ||
| 272 | + marketingCenterProvider.smsChangeFieldData[i].show + | ||
| 273 | + controller.text.substring(cursorPosition); | ||
| 274 | + | ||
| 275 | + print(controller.text); | ||
| 276 | + | ||
| 277 | + // 设置新的光标位置 | ||
| 278 | + controller.selection = TextSelection.fromPosition(TextPosition( | ||
| 279 | + offset: cursorPosition + | ||
| 280 | + marketingCenterProvider.smsChangeFieldData[i].show.length, | ||
| 281 | + affinity: TextAffinity.downstream)); | ||
| 282 | + setState(() { | ||
| 283 | + _cursorPosition = controller.selection.baseOffset; | ||
| 284 | + // cursorPosition = _cursorPosition; | ||
| 285 | + }); | ||
| 286 | + } else { | ||
| 287 | + controller.text += marketingCenterProvider.smsChangeFieldData[i].show; | ||
| 288 | + } | ||
| 286 | })); | 289 | })); |
| 287 | } | 290 | } |
| 288 | return data; | 291 | return data; |
| @@ -125,11 +125,15 @@ class MessageDialogModel extends ChangeNotifier { | @@ -125,11 +125,15 @@ class MessageDialogModel extends ChangeNotifier { | ||
| 125 | ///此状态移除,不展示 | 125 | ///此状态移除,不展示 |
| 126 | return true; | 126 | return true; |
| 127 | } | 127 | } |
| 128 | - } else if (message.message_type.toString() == "16" && | ||
| 129 | - message.uid == uid) { | ||
| 130 | - //移除自己取消的订单 | 128 | + } else if (message.message_type.toString() == "16") { |
| 129 | + //移除经理取消的订单 | ||
| 131 | return true; | 130 | return true; |
| 132 | } | 131 | } |
| 132 | + // else if (message.message_type.toString() == "16" && | ||
| 133 | + // message.uid == uid) { | ||
| 134 | + // //移除自己取消的订单 | ||
| 135 | + // return true; | ||
| 136 | + // } | ||
| 133 | return false; | 137 | return false; |
| 134 | }); | 138 | }); |
| 135 | 139 | ||
| @@ -158,7 +162,7 @@ class MessageDialogModel extends ChangeNotifier { | @@ -158,7 +162,7 @@ class MessageDialogModel extends ChangeNotifier { | ||
| 158 | .catchError((error) { | 162 | .catchError((error) { |
| 159 | print(error.toString()); | 163 | print(error.toString()); |
| 160 | }); | 164 | }); |
| 161 | - | 165 | + |
| 162 | if (baseResp.code == Constant.status_success) { | 166 | if (baseResp.code == Constant.status_success) { |
| 163 | } else { | 167 | } else { |
| 164 | Utils.showToast(baseResp.msg); | 168 | Utils.showToast(baseResp.msg); |
| @@ -77,7 +77,10 @@ class MessageModel extends ChangeNotifier { | @@ -77,7 +77,10 @@ class MessageModel extends ChangeNotifier { | ||
| 77 | temp.addAll(messagesHas); | 77 | temp.addAll(messagesHas); |
| 78 | messagesHas = []; | 78 | messagesHas = []; |
| 79 | temp.forEach((element) { | 79 | temp.forEach((element) { |
| 80 | - if (element.uid == uid && element.message_type == '16') { | 80 | + // if (element.uid == uid && element.message_type == '16') { |
| 81 | + // print('object'); | ||
| 82 | + // } | ||
| 83 | + if (element.message_type == '16') { | ||
| 81 | print('object'); | 84 | print('object'); |
| 82 | } else { | 85 | } else { |
| 83 | messagesHas.add(element); | 86 | messagesHas.add(element); |
| @@ -159,7 +162,10 @@ class MessageModel extends ChangeNotifier { | @@ -159,7 +162,10 @@ class MessageModel extends ChangeNotifier { | ||
| 159 | messagesUnTemp = []; | 162 | messagesUnTemp = []; |
| 160 | 163 | ||
| 161 | temp.forEach((element) { | 164 | temp.forEach((element) { |
| 162 | - if (element.uid == uid && element.message_type == '16') { | 165 | + // if (element.uid == uid && element.message_type == '16') { |
| 166 | + // tempnum++; | ||
| 167 | + // } | ||
| 168 | + if (element.message_type == '16') { | ||
| 163 | tempnum++; | 169 | tempnum++; |
| 164 | } else { | 170 | } else { |
| 165 | messagesUnTemp.add(element); | 171 | messagesUnTemp.add(element); |
| @@ -226,15 +232,18 @@ class MessageModel extends ChangeNotifier { | @@ -226,15 +232,18 @@ class MessageModel extends ChangeNotifier { | ||
| 226 | messagesUn = []; | 232 | messagesUn = []; |
| 227 | 233 | ||
| 228 | temp.forEach((element) { | 234 | temp.forEach((element) { |
| 229 | - if (element.uid == uid && element.message_type == '16') { | ||
| 230 | - tempnum++; | 235 | + // if (element.uid == uid && element.message_type == '16') { |
| 236 | + // tempnum++; // 自己取消的预订消息删除去 | ||
| 237 | + // } | ||
| 238 | + if (element.message_type == '16') { | ||
| 239 | + tempnum++; // 经理取消的预订消息删除去 | ||
| 231 | } else { | 240 | } else { |
| 232 | - messagesUnTemp.add(element); | 241 | + messagesUnTemp.add(element); //其他消息加进来出去 |
| 233 | } | 242 | } |
| 234 | }); | 243 | }); |
| 235 | messagesUn.addAll(messagesUnTemp); | 244 | messagesUn.addAll(messagesUnTemp); |
| 236 | if (tempnum > 0) { | 245 | if (tempnum > 0) { |
| 237 | - allUnNum = baseResp.data['count'] - tempnum; | 246 | + allUnNum = baseResp.data['count'] - tempnum; // 对应消息数 |
| 238 | } else { | 247 | } else { |
| 239 | allUnNum = baseResp.data['count']; | 248 | allUnNum = baseResp.data['count']; |
| 240 | } | 249 | } |
-
Please register or login to post a comment