|
...
|
...
|
@@ -43,7 +43,9 @@ import 'dart:ui' as ui; |
|
|
|
|
|
|
|
import '../../app.dart';
|
|
|
|
|
|
|
|
import '../../models/sms_info.dart';
|
|
|
|
import '../../provider/customer_provider.dart';
|
|
|
|
import '../../provider/my_model.dart';
|
|
|
|
import '../../widgets/special_text/my_extended_text_selection_controls.dart';
|
|
|
|
|
|
|
|
class InvicationPage extends StatefulWidget {
|
|
...
|
...
|
@@ -158,6 +160,9 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
MyTextSelectionControls _myExtendedMaterialTextSelectionControlsNum =
|
|
|
|
MyTextSelectionControls();
|
|
|
|
|
|
|
|
MyModel myModel;
|
|
|
|
SmsInfoData smsInfoData;
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
...
|
...
|
@@ -258,9 +263,9 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
offset: value.toString().length)));
|
|
|
|
});
|
|
|
|
couponProvider.sendSMS = 0;
|
|
|
|
await _couponNetworkData(isShowLoading: false);
|
|
|
|
// await _couponNetworkData(isShowLoading: false);
|
|
|
|
await _getCustomerActivityBaseinfo();
|
|
|
|
|
|
|
|
_getSmsInfo(context);
|
|
|
|
await _getReserveDetail(showCicle: false);
|
|
|
|
|
|
|
|
await _getTablesPhoto();
|
|
...
|
...
|
@@ -270,7 +275,7 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
await remarkManagerModel.getRemarks(context, params);
|
|
|
|
});
|
|
|
|
bus.on("refresh_coupon_invitation", (args) {
|
|
|
|
_couponNetworkData(isShowLoading: false);
|
|
|
|
// _couponNetworkData(isShowLoading: false);
|
|
|
|
});
|
|
|
|
bus.on("refresh_invitaion_info", (args) {
|
|
|
|
_getReserveDetail();
|
|
...
|
...
|
@@ -318,6 +323,34 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
///获取短信余量
|
|
|
|
_getSmsInfo(context) async {
|
|
|
|
smsInfoData = await myModel.getSmsInfo(context, selfDismiss: false);
|
|
|
|
if (myModel.smsInfo == '0') {
|
|
|
|
if (!mounted) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
setState(() {
|
|
|
|
showErroInfo = true;
|
|
|
|
erroInfo = '短信余额不足,请充值短信条数';
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
if (!mounted) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
setState(() {
|
|
|
|
showErroInfo = false;
|
|
|
|
erroInfo = '';
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// setState(() {
|
|
|
|
// if (smsInfoData != null) {
|
|
|
|
// smsInfo = smsInfoData?.lastNum;
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
}
|
|
|
|
|
|
|
|
///倒计时方法
|
|
|
|
startCountdown() {
|
|
|
|
countdownTime = 60;
|
|
...
|
...
|
@@ -1175,7 +1208,7 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
}
|
|
|
|
couponProvider.couponListSelect = temp;
|
|
|
|
//获取绑定的优惠券
|
|
|
|
_getActivityByRid();
|
|
|
|
// _getActivityByRid();
|
|
|
|
|
|
|
|
// if (couponProvider.coupons.length == 0) {
|
|
|
|
// setState(() {
|
|
...
|
...
|
@@ -2275,7 +2308,7 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
],
|
|
|
|
),
|
|
|
|
// 选择优惠
|
|
|
|
_couponWidget(),
|
|
|
|
// _couponWidget(),
|
|
|
|
showErroInfo
|
|
|
|
? Container(
|
|
|
|
margin: EdgeInsets.only(
|
|
...
|
...
|
@@ -3905,6 +3938,13 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
_showConfirmWidget(
|
|
|
|
needWechat: true,
|
|
|
|
callback: () async {
|
|
|
|
if (myModel.smsInfo == '0') {
|
|
|
|
setState(() {
|
|
|
|
showErroInfo = true;
|
|
|
|
erroInfo = '短信余额不足,请充值短信条数';
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (canSendSms) {
|
|
|
|
if (reserverPhone == null ||
|
|
|
|
reserverPhone.isEmpty ||
|
|
...
|
...
|
@@ -4001,6 +4041,13 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
});
|
|
|
|
canSendSms = false;
|
|
|
|
startCountdown();
|
|
|
|
} else {
|
|
|
|
if (couponProvider.errorSMS != '') {
|
|
|
|
setState(() {
|
|
|
|
showErroInfo = true;
|
|
|
|
erroInfo = couponProvider.errorSMS;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// if (success) {
|
|
|
|
// Utils.showToast('短信已经发送成功!');
|
|
...
|
...
|
@@ -4020,6 +4067,13 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
});
|
|
|
|
removeOverlay();
|
|
|
|
} else {
|
|
|
|
if (myModel.smsInfo == '0') {
|
|
|
|
setState(() {
|
|
|
|
showErroInfo = true;
|
|
|
|
erroInfo = '短信余额不足,请充值短信条数';
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (canSendSms) {
|
|
|
|
if (reserverPhone == null ||
|
|
|
|
reserverPhone.isEmpty ||
|
|
...
|
...
|
@@ -4064,6 +4118,13 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
});
|
|
|
|
canSendSms = false;
|
|
|
|
startCountdown();
|
|
|
|
} else {
|
|
|
|
if (couponProvider.errorSMS != '') {
|
|
|
|
setState(() {
|
|
|
|
showErroInfo = true;
|
|
|
|
erroInfo = couponProvider.errorSMS;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
...
|
...
|
@@ -4567,6 +4628,7 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
_baseIndoProvider = Provider.of<BaseIndoProvider>(context, listen: true);
|
|
|
|
couponProvider = Provider.of<CouponProvider>(context, listen: true);
|
|
|
|
remarkManagerModel = Provider.of<RemarkManagerModel>(context, listen: true);
|
|
|
|
myModel = Provider.of<MyModel>(context, listen: true);
|
|
|
|
return SafeArea(
|
|
|
|
child: Scaffold(
|
|
|
|
appBar: SystemAppBar('预订安排', titleColor: MyColours.color_438E93,
|
...
|
...
|
|