|
...
|
...
|
@@ -58,6 +58,7 @@ import '../../provider/SmsModel.dart'; |
|
|
|
import '../../provider/customer_provider.dart';
|
|
|
|
import '../../provider/marketing_center_provider.dart';
|
|
|
|
import '../../provider/my_model.dart';
|
|
|
|
import '../../utils/MyNumberTextInputFormatter.dart';
|
|
|
|
import '../../utils/call_log_utils.dart';
|
|
|
|
import '../../utils/common_utils.dart';
|
|
|
|
import '../../utils/screen_util.dart';
|
|
...
|
...
|
@@ -187,6 +188,10 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
|
|
|
|
MarketingCenterProvider marketingCenterProvider;
|
|
|
|
String additionTitle = '点击设置本单追加的自定义图文';
|
|
|
|
// String paymentTitle = '选填,未填写表示无需支付订金';
|
|
|
|
|
|
|
|
TextEditingController moneyControl = TextEditingController();
|
|
|
|
FocusNode moneyFocusNode = FocusNode();
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
...
|
...
|
@@ -316,15 +321,42 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
bus.on("getDzSellerConf", (args) {
|
|
|
|
getDzSellerConf();
|
|
|
|
});
|
|
|
|
bus.on("getReserveImgText", (args) {
|
|
|
|
bus.on("getReserveImgText", (args) {
|
|
|
|
getReserveImgText();
|
|
|
|
});
|
|
|
|
|
|
|
|
bus.on("refresh_invication_deposit", (args) {
|
|
|
|
_getReserveDepositByRid(); //刷新订金数据
|
|
|
|
});
|
|
|
|
|
|
|
|
// Utils.changeStatusColor(color: Colors.transparent);
|
|
|
|
|
|
|
|
user = Provider.of<UserModel>(context, listen: false).user;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// 通过预订ID查收定金详情
|
|
|
|
_getReserveDepositByRid() async {
|
|
|
|
Map<String, String> params = {
|
|
|
|
'rid': widget.rid,
|
|
|
|
};
|
|
|
|
await detailModel.getReserveDepositByRid(context, params);
|
|
|
|
if (detailModel.reserveDepositList.length > 0) {
|
|
|
|
//存在在线支付订金,找到赋值,
|
|
|
|
detailModel.reserveDepositList.forEach((element) {
|
|
|
|
if (element.payType == '微信预订通知') {
|
|
|
|
moneyControl.text = element.price;
|
|
|
|
detailModel.depositId = element.id;
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
//全局设置
|
|
|
|
moneyControl.text =
|
|
|
|
marketingCenterProvider.dzSellerConfModel.depositPrice ??
|
|
|
|
'选填,未填写表示无需支付订金';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
getReserveImgText() async {
|
|
|
|
await marketingCenterProvider.getReserveImgText(context, widget.rid);
|
|
|
|
if (marketingCenterProvider.reserveImgText != null) {
|
|
...
|
...
|
@@ -336,6 +368,14 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
getDzSellerConf() async {
|
|
|
|
bool success = await marketingCenterProvider.getDzSellerConf(context);
|
|
|
|
if (success && marketingCenterProvider.dzSellerConfModel != null) {
|
|
|
|
if (marketingCenterProvider.dzSellerConfModel.isShowNoticeDeposit == '1'
|
|
|
|
// &&
|
|
|
|
// marketingCenterProvider.dzSellerConfModel.depositPrice != '0' &&
|
|
|
|
// marketingCenterProvider.dzSellerConfModel.depositPrice != null
|
|
|
|
) {
|
|
|
|
//全局设置过金额,并且开通预订方式
|
|
|
|
_getReserveDepositByRid();
|
|
|
|
}
|
|
|
|
noticeSms = marketingCenterProvider.dzSellerConfModel.isNotice == '1'
|
|
|
|
? true
|
|
|
|
: false;
|
|
...
|
...
|
@@ -442,8 +482,8 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
bus.off("refresh_invitaion_info");
|
|
|
|
bus.off("refresh_photo_invication");
|
|
|
|
bus.off("getDzSellerConf");
|
|
|
|
bus.off("getReserveImgText");
|
|
|
|
|
|
|
|
bus.off("getReserveImgText");
|
|
|
|
bus.off("refresh_invication_deposit");
|
|
|
|
|
|
|
|
WidgetsBinding.instance.removeObserver(this); //销毁观察者
|
|
|
|
if (_timer != null) {
|
|
...
|
...
|
@@ -2582,16 +2622,111 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
)
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
if (marketingCenterProvider
|
|
|
|
.dzSellerConfModel.isShowNoticeDeposit ==
|
|
|
|
'1')
|
|
|
|
InkWell(
|
|
|
|
onTap: () async {
|
|
|
|
FocusScope.of(context)
|
|
|
|
.requestFocus(FocusNode()); //隐藏键盘
|
|
|
|
|
|
|
|
//跳转到新页面
|
|
|
|
// if (detailModel.reserveDepositList.length > 0) {
|
|
|
|
// //查看页面
|
|
|
|
// NavigatorUtil.goBookDepositPage(context, widget.rid,
|
|
|
|
// onlyShow: true,bookDepositModel:detailModel.reserveDepositList[0] );
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
// //编辑页面
|
|
|
|
// NavigatorUtil.goBookDepositPage(
|
|
|
|
// context, detailEntity.id);
|
|
|
|
// }
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
// top: ScreenUtil().setWidth(40),
|
|
|
|
bottom: ScreenUtil().setWidth(40)),
|
|
|
|
height: ScreenUtil().setWidth(68),
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(16)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
ScreenUtil().setWidth(12)),
|
|
|
|
// color: Colors.red,
|
|
|
|
border: Border.all(
|
|
|
|
width: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_DBDBDB)),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'预订订金:',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
color: MyColours.color_515151),
|
|
|
|
),
|
|
|
|
HEmptyView(40),
|
|
|
|
Expanded(
|
|
|
|
child: TextField(
|
|
|
|
controller: moneyControl,
|
|
|
|
textAlign: TextAlign.right,
|
|
|
|
textAlignVertical:
|
|
|
|
TextAlignVertical.bottom,
|
|
|
|
maxLines: 1,
|
|
|
|
inputFormatters: [
|
|
|
|
FilteringTextInputFormatter(
|
|
|
|
RegExp("[0-9.]"),
|
|
|
|
allow: true),
|
|
|
|
MyNumberTextInputFormatter(digit: 2),
|
|
|
|
],
|
|
|
|
// //光标颜色
|
|
|
|
// cursorColor:
|
|
|
|
// widget.isSelect ? Colors.white : MyColours.color_199095,
|
|
|
|
//输入文本的样式
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
),
|
|
|
|
focusNode: moneyFocusNode,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
isCollapsed: true,
|
|
|
|
border: OutlineInputBorder(
|
|
|
|
borderSide: BorderSide.none),
|
|
|
|
hintText: '选填,未填写表示无需支付订金',
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
),
|
|
|
|
enabledBorder:
|
|
|
|
new UnderlineInputBorder(
|
|
|
|
borderSide: BorderSide.none,
|
|
|
|
),
|
|
|
|
focusedBorder:
|
|
|
|
new UnderlineInputBorder(
|
|
|
|
borderSide: BorderSide.none,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onChanged: (value) {},
|
|
|
|
onEditingComplete: () {
|
|
|
|
FocusScope.of(context).requestFocus(
|
|
|
|
FocusNode()); //点击空白处隐藏键盘
|
|
|
|
},
|
|
|
|
keyboardType:
|
|
|
|
TextInputType.numberWithOptions()),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
))),
|
|
|
|
InkWell(
|
|
|
|
onTap: () async{
|
|
|
|
onTap: () async {
|
|
|
|
FocusScope.of(context)
|
|
|
|
.requestFocus(FocusNode()); //隐藏键盘
|
|
|
|
|
|
|
|
//跳转到新页面
|
|
|
|
|
|
|
|
await NavigatorUtil.goInvicationAdditionPage(context,
|
|
|
|
await NavigatorUtil.goInvicationAdditionPage(context,
|
|
|
|
rid: widget.rid);
|
|
|
|
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
margin: EdgeInsets.only(
|
|
...
|
...
|
@@ -4535,6 +4670,63 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
_createReserveDeposit() async {
|
|
|
|
if (marketingCenterProvider.dzSellerConfModel.isShowNoticeDeposit == '1') {
|
|
|
|
//页面有预订定金选项
|
|
|
|
// if( detailModel.depositId == null){
|
|
|
|
// //新建
|
|
|
|
// }else{
|
|
|
|
// // 修改或者不可编辑
|
|
|
|
// }
|
|
|
|
if (moneyControl.text != '选填,未填写表示无需支付订金' && moneyControl.text.trim().length > 0) {
|
|
|
|
Map<String, String> pramas = {
|
|
|
|
'sid': Provider.of<UserModel>(context, listen: false).user.sellerid,
|
|
|
|
'rid': widget.rid,
|
|
|
|
'price': moneyControl.text,
|
|
|
|
// 'rname': paymentC.text,
|
|
|
|
'uid': Provider.of<UserModel>(context, listen: false).user.openid,
|
|
|
|
// 'pay_time': paymentTime == '请选择'
|
|
|
|
// ? null
|
|
|
|
// : (DateUtil.getDateTime(paymentTime).millisecondsSinceEpoch / 1000)
|
|
|
|
// .floor()
|
|
|
|
// .toString(),
|
|
|
|
// 'pay_type': payTypeIndex == null ? null : payType[payTypeIndex],
|
|
|
|
|
|
|
|
// 'pay_no':
|
|
|
|
// receiptNumberC.text.trim().length == 0 ? null : receiptNumberC.text,
|
|
|
|
'insert_uid':
|
|
|
|
Provider.of<UserModel>(context, listen: false).user.openid
|
|
|
|
};
|
|
|
|
|
|
|
|
bool success = await detailModel.createReserveDeposit(context, pramas);
|
|
|
|
if (success) {
|
|
|
|
bus.emit('refresh_detail_deposit');
|
|
|
|
bool isSuccess = await Utils.goShareInvicationToWeChat(
|
|
|
|
context,
|
|
|
|
widget.rid,
|
|
|
|
Provider.of<UserModel>(context, listen: false).user.openid,
|
|
|
|
depositId: detailModel.depositId);
|
|
|
|
print(isSuccess);
|
|
|
|
if (isSuccess) {
|
|
|
|
_addForward();
|
|
|
|
}
|
|
|
|
// bus.emit('refresh_invication_deposit');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
//页面无预订定金选项
|
|
|
|
bool isSuccess = await Utils.goShareInvicationToWeChat(
|
|
|
|
context,
|
|
|
|
widget.rid,
|
|
|
|
Provider.of<UserModel>(context, listen: false).user.openid,
|
|
|
|
depositId: detailModel.depositId);
|
|
|
|
print(isSuccess);
|
|
|
|
if (isSuccess) {
|
|
|
|
_addForward();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
///微信通知、发短信
|
|
|
|
Widget _btnWidget() {
|
|
|
|
return Padding(
|
|
...
|
...
|
@@ -4852,31 +5044,21 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
if (isSuc) {
|
|
|
|
couponProvider.hasModify = true;
|
|
|
|
bus.emit("refresh_book_list");
|
|
|
|
bool isSuccess =
|
|
|
|
await Utils.goShareInvicationToWeChat(
|
|
|
|
context,
|
|
|
|
widget.rid,
|
|
|
|
Provider.of<UserModel>(context, listen: false)
|
|
|
|
.user
|
|
|
|
.openid,
|
|
|
|
);
|
|
|
|
print(isSuccess);
|
|
|
|
if (isSuccess) {
|
|
|
|
_addForward();
|
|
|
|
}
|
|
|
|
await _createReserveDeposit();
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
bool isSuccess =
|
|
|
|
await Utils.goShareInvicationToWeChat(
|
|
|
|
context,
|
|
|
|
widget.rid,
|
|
|
|
Provider.of<UserModel>(context,
|
|
|
|
listen: false)
|
|
|
|
.user
|
|
|
|
.openid);
|
|
|
|
if (isSuccess) {
|
|
|
|
_addForward();
|
|
|
|
}
|
|
|
|
await _createReserveDeposit();
|
|
|
|
// bool isSuccess =
|
|
|
|
// await Utils.goShareInvicationToWeChat(
|
|
|
|
// context,
|
|
|
|
// widget.rid,
|
|
|
|
// Provider.of<UserModel>(context,
|
|
|
|
// listen: false)
|
|
|
|
// .user
|
|
|
|
// .openid);
|
|
|
|
// if (isSuccess) {
|
|
|
|
// _addForward();
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
});
|
|
|
|
removeOverlay();
|
|
...
|
...
|
@@ -4907,28 +5089,30 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
if (isSuc) {
|
|
|
|
couponProvider.hasModify = true;
|
|
|
|
bus.emit("refresh_book_list");
|
|
|
|
bool isSuccess =
|
|
|
|
await Utils.goShareInvicationToWeChat(
|
|
|
|
context,
|
|
|
|
widget.rid,
|
|
|
|
Provider.of<UserModel>(context, listen: false)
|
|
|
|
.user
|
|
|
|
.openid);
|
|
|
|
print(isSuccess);
|
|
|
|
if (isSuccess) {
|
|
|
|
_addForward();
|
|
|
|
}
|
|
|
|
await _createReserveDeposit();
|
|
|
|
// bool isSuccess =
|
|
|
|
// await Utils.goShareInvicationToWeChat(
|
|
|
|
// context,
|
|
|
|
// widget.rid,
|
|
|
|
// Provider.of<UserModel>(context, listen: false)
|
|
|
|
// .user
|
|
|
|
// .openid);
|
|
|
|
// print(isSuccess);
|
|
|
|
// if (isSuccess) {
|
|
|
|
// _addForward();
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
bool isSuccess = await Utils.goShareInvicationToWeChat(
|
|
|
|
context,
|
|
|
|
widget.rid,
|
|
|
|
Provider.of<UserModel>(context, listen: false)
|
|
|
|
.user
|
|
|
|
.openid);
|
|
|
|
if (isSuccess) {
|
|
|
|
_addForward();
|
|
|
|
}
|
|
|
|
await _createReserveDeposit();
|
|
|
|
// bool isSuccess = await Utils.goShareInvicationToWeChat(
|
|
|
|
// context,
|
|
|
|
// widget.rid,
|
|
|
|
// Provider.of<UserModel>(context, listen: false)
|
|
|
|
// .user
|
|
|
|
// .openid);
|
|
|
|
// if (isSuccess) {
|
|
|
|
// _addForward();
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
...
|
...
|
|