|
...
|
...
|
@@ -84,12 +84,11 @@ class _VoiceWelcomeSettingPageState extends State<VoiceWelcomeSettingPage> { |
|
|
|
VoiceWelcomeConfigModel model = VoiceWelcomeConfigModel.fromJson(
|
|
|
|
baseResp.data as Map<String, dynamic>);
|
|
|
|
addVoiceInfo = model.isVoiceWelcome == '1' ? true : false;
|
|
|
|
guestVoiceSame =
|
|
|
|
model.inviteeSameAsReserver == '1' ? true : false;
|
|
|
|
voiceIncoC.text = (model.welcomeContent != null &&
|
|
|
|
model.welcomeContent!.isNotEmpty)
|
|
|
|
? model.welcomeContent!
|
|
|
|
: defaultVoiceText;
|
|
|
|
guestVoiceSame = model.inviteeSameAsReserver == '1' ? true : false;
|
|
|
|
voiceIncoC.text =
|
|
|
|
(model.welcomeContent != null && model.welcomeContent!.isNotEmpty)
|
|
|
|
? model.welcomeContent!
|
|
|
|
: defaultVoiceText;
|
|
|
|
guestDefaultC.text = (model.inviteeDefaultContent != null &&
|
|
|
|
model.inviteeDefaultContent!.isNotEmpty)
|
|
|
|
? model.inviteeDefaultContent!
|
|
...
|
...
|
@@ -138,10 +137,9 @@ class _VoiceWelcomeSettingPageState extends State<VoiceWelcomeSettingPage> { |
|
|
|
controller.text = controller.text.substring(0, cursorPosition) +
|
|
|
|
(field.placeholder ?? '') +
|
|
|
|
controller.text.substring(cursorPosition);
|
|
|
|
controller.selection = TextSelection.fromPosition(
|
|
|
|
TextPosition(
|
|
|
|
offset: cursorPosition + field.placeholder!.length,
|
|
|
|
affinity: TextAffinity.downstream));
|
|
|
|
controller.selection = TextSelection.fromPosition(TextPosition(
|
|
|
|
offset: cursorPosition + field.placeholder!.length,
|
|
|
|
affinity: TextAffinity.downstream));
|
|
|
|
} else {
|
|
|
|
controller.text += field.placeholder ?? '';
|
|
|
|
}
|
|
...
|
...
|
@@ -158,7 +156,7 @@ class _VoiceWelcomeSettingPageState extends State<VoiceWelcomeSettingPage> { |
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: w(8), vertical: w(5)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_529EA4,
|
|
|
|
color: MyColours.color_438E93,
|
|
|
|
borderRadius: BorderRadius.circular(r(5)),
|
|
|
|
),
|
|
|
|
child: Text(
|
|
...
|
...
|
@@ -172,29 +170,35 @@ class _VoiceWelcomeSettingPageState extends State<VoiceWelcomeSettingPage> { |
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
Widget _chipsWrap(
|
|
|
|
TextEditingController controller, List<VoiceWelcomePlaceholderModel> data) {
|
|
|
|
Widget _chipsWrap(TextEditingController controller,
|
|
|
|
List<VoiceWelcomePlaceholderModel> data) {
|
|
|
|
return Padding(
|
|
|
|
padding: EdgeInsets.only(left: w(30)),
|
|
|
|
child: Wrap(
|
|
|
|
spacing: w(10),
|
|
|
|
runSpacing: w(10),
|
|
|
|
children:
|
|
|
|
data.map((e) => _fieldChip(controller, e)).toList(),
|
|
|
|
children: data.map((e) => _fieldChip(controller, e)).toList(),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
Widget _sectionHeader(String title, {double? left}) {
|
|
|
|
Widget _sectionHeader(String title,
|
|
|
|
{double? left, double? width, bool bold = true}) {
|
|
|
|
return Padding(
|
|
|
|
padding: EdgeInsets.only(left: left ?? w(16)),
|
|
|
|
child: Align(
|
|
|
|
child: Container(
|
|
|
|
width: width,
|
|
|
|
height: w(22),
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
child: Text(
|
|
|
|
title,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_666666,
|
|
|
|
fontSize: font(12)),
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontFamily: 'PingFang SC',
|
|
|
|
fontWeight: bold ? FontWeight.w600 : FontWeight.w400,
|
|
|
|
fontSize: font(16),
|
|
|
|
height: 1.4,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
...
|
...
|
@@ -216,7 +220,11 @@ class _VoiceWelcomeSettingPageState extends State<VoiceWelcomeSettingPage> { |
|
|
|
child: Text(
|
|
|
|
'被请人语音播报设置(特殊用餐类型)',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_666666, fontSize: font(12)),
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontFamily: 'PingFang SC',
|
|
|
|
fontSize: font(16),
|
|
|
|
height: 1.4,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Image.asset(
|
|
...
|
...
|
@@ -233,8 +241,7 @@ class _VoiceWelcomeSettingPageState extends State<VoiceWelcomeSettingPage> { |
|
|
|
Widget _divider() {
|
|
|
|
return Padding(
|
|
|
|
padding: EdgeInsets.only(left: w(16), right: w(12)),
|
|
|
|
child: MyDivider(double.infinity, w(0.5),
|
|
|
|
color: MyColours.color_E7E7E7),
|
|
|
|
child: MyDivider(double.infinity, w(0.5), color: MyColours.color_E7E7E7),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -246,13 +253,13 @@ class _VoiceWelcomeSettingPageState extends State<VoiceWelcomeSettingPage> { |
|
|
|
alignment: Alignment.topLeft,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
border: Border.all(color: MyColours.color_DBDBDB, width: w(1)),
|
|
|
|
border: Border.all(color: MyColours.color_CBCBCB, width: w(1)),
|
|
|
|
borderRadius: BorderRadius.circular(r(10)),
|
|
|
|
),
|
|
|
|
child: TextField(
|
|
|
|
controller: controller,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_777777,
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: font(14),
|
|
|
|
textBaseline: TextBaseline.alphabetic),
|
|
|
|
textAlignVertical: TextAlignVertical.center,
|
|
...
|
...
|
@@ -278,7 +285,7 @@ class _VoiceWelcomeSettingPageState extends State<VoiceWelcomeSettingPage> { |
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
child: Text(
|
|
|
|
'*{预订日期}、{餐段}、{桌位}不能修改,可以删除。',
|
|
|
|
style: TextStyle(color: MyColours.color_B0B0B0, fontSize: font(12)),
|
|
|
|
style: TextStyle(color: MyColours.color_999999, fontSize: font(12)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
...
|
...
|
@@ -297,7 +304,7 @@ class _VoiceWelcomeSettingPageState extends State<VoiceWelcomeSettingPage> { |
|
|
|
child: Text(
|
|
|
|
title,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_666666, fontSize: font(14)),
|
|
|
|
color: MyColours.color_515151, fontSize: font(14)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Image.asset(
|
|
...
|
...
|
@@ -323,7 +330,7 @@ class _VoiceWelcomeSettingPageState extends State<VoiceWelcomeSettingPage> { |
|
|
|
Text(
|
|
|
|
'暂无用餐类型数据,点击重试',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_666666, fontSize: font(12)),
|
|
|
|
color: MyColours.color_515151, fontSize: font(12)),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
...
|
...
|
@@ -346,22 +353,21 @@ class _VoiceWelcomeSettingPageState extends State<VoiceWelcomeSettingPage> { |
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: w(10), vertical: w(5)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: selected
|
|
|
|
? MyColours.color_529EA4
|
|
|
|
: MyColours.color_ffffff,
|
|
|
|
color:
|
|
|
|
selected ? MyColours.color_438E93 : MyColours.color_ffffff,
|
|
|
|
borderRadius: BorderRadius.circular(r(5)),
|
|
|
|
border: Border.all(
|
|
|
|
width: w(1),
|
|
|
|
color: selected
|
|
|
|
? MyColours.color_529EA4
|
|
|
|
: MyColours.color_B7B7B7),
|
|
|
|
? MyColours.color_438E93
|
|
|
|
: MyColours.color_999999),
|
|
|
|
),
|
|
|
|
child: Text(
|
|
|
|
item.name ?? '',
|
|
|
|
style: TextStyle(
|
|
|
|
color: selected
|
|
|
|
? MyColours.color_ffffff
|
|
|
|
: MyColours.color_B0B0B0,
|
|
|
|
: MyColours.color_999999,
|
|
|
|
fontSize: font(12),
|
|
|
|
),
|
|
|
|
),
|
|
...
|
...
|
@@ -436,14 +442,13 @@ class _VoiceWelcomeSettingPageState extends State<VoiceWelcomeSettingPage> { |
|
|
|
child: Container(
|
|
|
|
width: double.infinity,
|
|
|
|
margin: EdgeInsets.only(left: w(16), right: w(16)),
|
|
|
|
padding:
|
|
|
|
EdgeInsets.symmetric(vertical: w(24)),
|
|
|
|
padding: EdgeInsets.symmetric(vertical: w(24)),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'预订安排中附加语音欢迎致辞',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_666666,
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: font(16)),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
...
|
...
|
@@ -459,7 +464,7 @@ class _VoiceWelcomeSettingPageState extends State<VoiceWelcomeSettingPage> { |
|
|
|
_divider(),
|
|
|
|
if (addVoiceInfo) ...[
|
|
|
|
VEmptyView(8),
|
|
|
|
_sectionHeader('预订人语音播报设置'),
|
|
|
|
_sectionHeader('预订人语音播报设置', width: w(144)),
|
|
|
|
VEmptyView(16),
|
|
|
|
_textArea(voiceIncoC, '点击录入语音欢迎致辞'),
|
|
|
|
VEmptyView(16),
|
|
...
|
...
|
@@ -469,7 +474,7 @@ class _VoiceWelcomeSettingPageState extends State<VoiceWelcomeSettingPage> { |
|
|
|
VEmptyView(24),
|
|
|
|
_divider(),
|
|
|
|
VEmptyView(24),
|
|
|
|
_sectionHeader('被请人语音播报设置'),
|
|
|
|
_sectionHeader('被请人语音播报设置', width: w(144)),
|
|
|
|
VEmptyView(24),
|
|
|
|
_radioRow('被请人语音播报与预订人一致', guestVoiceSame, () {
|
|
|
|
setState(() {
|
|
...
|
...
|
@@ -485,7 +490,7 @@ class _VoiceWelcomeSettingPageState extends State<VoiceWelcomeSettingPage> { |
|
|
|
if (!guestVoiceSame) ...[
|
|
|
|
_divider(),
|
|
|
|
VEmptyView(16),
|
|
|
|
_sectionHeader('被请人语音播报设置(默认)', left: w(30)),
|
|
|
|
_sectionHeader('被请人语音播报设置(默认)', left: w(30), bold: false),
|
|
|
|
VEmptyView(16),
|
|
|
|
_textArea(guestDefaultC, '点击录入被请人语音播报'),
|
|
|
|
VEmptyView(16),
|
|
...
|
...
|
@@ -507,8 +512,11 @@ class _VoiceWelcomeSettingPageState extends State<VoiceWelcomeSettingPage> { |
|
|
|
child: Text(
|
|
|
|
'请选择该语音播报适用的用餐类型',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_666666,
|
|
|
|
fontSize: font(12)),
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontFamily: 'PingFang SC',
|
|
|
|
fontSize: font(16),
|
|
|
|
height: 1.4,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(16),
|
|
...
|
...
|
@@ -527,8 +535,8 @@ class _VoiceWelcomeSettingPageState extends State<VoiceWelcomeSettingPage> { |
|
|
|
left: w(24), right: w(24), top: w(12), bottom: w(25)),
|
|
|
|
child: RoundButton(
|
|
|
|
text: '保存',
|
|
|
|
gradientStart: MyColours.color_529EA4,
|
|
|
|
gradientEnd: MyColours.color_529EA4,
|
|
|
|
gradientStart: MyColours.color_438E93,
|
|
|
|
gradientEnd: MyColours.color_438E93,
|
|
|
|
radius: r(5),
|
|
|
|
fontSize: 34,
|
|
|
|
height: w(40),
|
...
|
...
|
|