|
...
|
...
|
@@ -64,22 +64,24 @@ class _MyMakeMarkingPageOnlyShowState extends State<MyMakeMarkingPageOnlyShow> { |
|
|
|
}
|
|
|
|
});
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
|
|
|
for (CustomerListSunModel item in customerMakingProvider.selectCustomer) {
|
|
|
|
gid += '${item.id},';
|
|
|
|
if (Platform.isIOS) {
|
|
|
|
iosPhone.add(item.phone);
|
|
|
|
} else {
|
|
|
|
andriodPhone += "${item.phone};";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (gid.endsWith(',')) {
|
|
|
|
gid = gid.substring(0, gid.length - 1);
|
|
|
|
}
|
|
|
|
if (!Platform.isIOS && andriodPhone.endsWith(';')) {
|
|
|
|
andriodPhone = andriodPhone.substring(0, andriodPhone.length - 1);
|
|
|
|
}
|
|
|
|
// print(widget.sellerList.guestCount);
|
|
|
|
// for (CustomerListSunModel item in customerMakingProvider.selectCustomer) {
|
|
|
|
// gid += '${item.id},';
|
|
|
|
// if (Platform.isIOS) {
|
|
|
|
// iosPhone.add(item.phone);
|
|
|
|
// } else {
|
|
|
|
// andriodPhone += "${item.phone};";
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// if (gid.endsWith(',')) {
|
|
|
|
// gid = gid.substring(0, gid.length - 1);
|
|
|
|
// }
|
|
|
|
// if (!Platform.isIOS && andriodPhone.endsWith(';')) {
|
|
|
|
// andriodPhone = andriodPhone.substring(0, andriodPhone.length - 1);
|
|
|
|
// }
|
|
|
|
customerMakingProvider.controller.text = widget.sellerList.content;
|
|
|
|
_couponNetworkData(isShowLoading: false);
|
|
|
|
_getGuestByGid();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -92,6 +94,56 @@ class _MyMakeMarkingPageOnlyShowState extends State<MyMakeMarkingPageOnlyShow> { |
|
|
|
//
|
|
|
|
}
|
|
|
|
|
|
|
|
_getPhoneAndGid() {
|
|
|
|
andriodPhone = '';
|
|
|
|
iosPhone = [];
|
|
|
|
for (CustomerListSunModel item in customerMakingProvider.selectCustomer) {
|
|
|
|
// gid += '${item.id},';
|
|
|
|
if (Platform.isIOS) {
|
|
|
|
iosPhone.add(item.phone);
|
|
|
|
} else {
|
|
|
|
andriodPhone += "${item.phone};";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// if (gid.endsWith(',')) {
|
|
|
|
// gid = gid.substring(0, gid.length - 1);
|
|
|
|
// }
|
|
|
|
if (!Platform.isIOS && andriodPhone.endsWith(';')) {
|
|
|
|
andriodPhone = andriodPhone.substring(0, andriodPhone.length - 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
///客户经理营销中的用户列表
|
|
|
|
_getGuestByGid({bool isShowLoading = true}) async {
|
|
|
|
// customerMakingProvider.couponSelectIndex = 0;
|
|
|
|
Map<String, String> params = {
|
|
|
|
"gid": widget.sellerList.gid,
|
|
|
|
};
|
|
|
|
await customerProvider.getGuestByGid(
|
|
|
|
context,
|
|
|
|
params,
|
|
|
|
);
|
|
|
|
print('''object''');
|
|
|
|
gid = widget.sellerList.gid;
|
|
|
|
// customerMakingProvider.labels = customerProvider.labels;
|
|
|
|
customerMakingProvider.selectCustomer = customerProvider.selectCustomer;
|
|
|
|
_getPhoneAndGid();
|
|
|
|
// customerMakingProvider.fromPage = widget.fromPage;
|
|
|
|
if (widget.sellerList.aid != null) {
|
|
|
|
//之前绑定过优惠
|
|
|
|
customerMakingProvider.isUse = true;
|
|
|
|
for (int i = 0; i < customerProvider.couponListSelect.length; i++) {
|
|
|
|
if (widget.sellerList.aid == customerProvider.couponListSelect[i].id) {
|
|
|
|
customerMakingProvider.youhui =
|
|
|
|
customerProvider.couponListSelect[i].aname;
|
|
|
|
customerMakingProvider.couponSelectIndex = i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
customerMakingProvider.isUpdate = true;
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
|
|
|
|
///消费券
|
|
|
|
_couponNetworkData({bool isShowLoading = true}) async {
|
|
|
|
// customerMakingProvider.couponSelectIndex = 0;
|
|
...
|
...
|
@@ -172,9 +224,10 @@ class _MyMakeMarkingPageOnlyShowState extends State<MyMakeMarkingPageOnlyShow> { |
|
|
|
// title: '确认发送', content: '是否确定为当前所选顾客发送该优惠券', lCallback: () {
|
|
|
|
// print('取消发送');
|
|
|
|
// }, rCallback: () async {
|
|
|
|
String message = customerMakingProvider.controller.text;
|
|
|
|
if (Platform.isIOS) {
|
|
|
|
// List<String> phoneNumber = ['18161963378', '18729572142', '18765432345'];
|
|
|
|
String message = "test";
|
|
|
|
|
|
|
|
try {
|
|
|
|
String _result = await sendSMS(message: message, recipients: iosPhone);
|
|
|
|
print(_result);
|
|
...
|
...
|
@@ -184,7 +237,6 @@ class _MyMakeMarkingPageOnlyShowState extends State<MyMakeMarkingPageOnlyShow> { |
|
|
|
} else {
|
|
|
|
print('确定发送');
|
|
|
|
// String phoneNumber = "18161963378;18729572142";
|
|
|
|
String message = "test";
|
|
|
|
|
|
|
|
// await Sendsms.onGetPermission();
|
|
|
|
|
|
...
|
...
|
@@ -454,7 +506,10 @@ class _MyMakeMarkingPageOnlyShowState extends State<MyMakeMarkingPageOnlyShow> { |
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
needClear = false;
|
|
|
|
Navigator.pop(context);
|
|
|
|
NavigatorUtil.goShowCustomerListPage(
|
|
|
|
context,
|
|
|
|
FromPage.FromPageMakeRecordDetail,
|
|
|
|
widget.sellerList.gid);
|
|
|
|
// NavigatorUtil.goMarketingRecordsDetailPage(context);
|
|
|
|
},
|
|
|
|
child: Text('仅查看',
|
...
|
...
|
|