Commit 9a6b91e31de29c1a12245dea3737ed09c72166b5

Authored by weixin_45529955
1 parent 2e973e78

语音播报修复

Showing 28 changed files with 334 additions and 237 deletions
@@ -355,14 +355,10 @@ @@ -355,14 +355,10 @@
355 inputFileListPaths = ( 355 inputFileListPaths = (
356 "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", 356 "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
357 ); 357 );
358 - inputPaths = (  
359 - );  
360 name = "[CP] Embed Pods Frameworks"; 358 name = "[CP] Embed Pods Frameworks";
361 outputFileListPaths = ( 359 outputFileListPaths = (
362 "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", 360 "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
363 ); 361 );
364 - outputPaths = (  
365 - );  
366 runOnlyForDeploymentPostprocessing = 0; 362 runOnlyForDeploymentPostprocessing = 0;
367 shellPath = /bin/sh; 363 shellPath = /bin/sh;
368 shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; 364 shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
@@ -376,14 +372,10 @@ @@ -376,14 +372,10 @@
376 inputFileListPaths = ( 372 inputFileListPaths = (
377 "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", 373 "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
378 ); 374 );
379 - inputPaths = (  
380 - );  
381 name = "[CP] Copy Pods Resources"; 375 name = "[CP] Copy Pods Resources";
382 outputFileListPaths = ( 376 outputFileListPaths = (
383 "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", 377 "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
384 ); 378 );
385 - outputPaths = (  
386 - );  
387 runOnlyForDeploymentPostprocessing = 0; 379 runOnlyForDeploymentPostprocessing = 0;
388 shellPath = /bin/sh; 380 shellPath = /bin/sh;
389 shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; 381 shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
@@ -535,7 +527,7 @@ @@ -535,7 +527,7 @@
535 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 527 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
536 CLANG_ENABLE_MODULES = YES; 528 CLANG_ENABLE_MODULES = YES;
537 CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; 529 CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
538 - CURRENT_PROJECT_VERSION = 703; 530 + CURRENT_PROJECT_VERSION = 7100;
539 DEVELOPMENT_TEAM = 8J59HM8B82; 531 DEVELOPMENT_TEAM = 8J59HM8B82;
540 ENABLE_BITCODE = NO; 532 ENABLE_BITCODE = NO;
541 "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; 533 "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
@@ -545,7 +537,7 @@ @@ -545,7 +537,7 @@
545 "$(inherited)", 537 "$(inherited)",
546 "@executable_path/Frameworks", 538 "@executable_path/Frameworks",
547 ); 539 );
548 - MARKETING_VERSION = 7.0.3; 540 + MARKETING_VERSION = 7.1.0;
549 PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; 541 PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine;
550 PRODUCT_NAME = "$(TARGET_NAME)"; 542 PRODUCT_NAME = "$(TARGET_NAME)";
551 SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 543 SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@@ -720,7 +712,7 @@ @@ -720,7 +712,7 @@
720 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 712 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
721 CLANG_ENABLE_MODULES = YES; 713 CLANG_ENABLE_MODULES = YES;
722 CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; 714 CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
723 - CURRENT_PROJECT_VERSION = 703; 715 + CURRENT_PROJECT_VERSION = 7100;
724 DEVELOPMENT_TEAM = 8J59HM8B82; 716 DEVELOPMENT_TEAM = 8J59HM8B82;
725 ENABLE_BITCODE = NO; 717 ENABLE_BITCODE = NO;
726 "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; 718 "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
@@ -730,7 +722,7 @@ @@ -730,7 +722,7 @@
730 "$(inherited)", 722 "$(inherited)",
731 "@executable_path/Frameworks", 723 "@executable_path/Frameworks",
732 ); 724 );
733 - MARKETING_VERSION = 7.0.3; 725 + MARKETING_VERSION = 7.1.0;
734 PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; 726 PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine;
735 PRODUCT_NAME = "$(TARGET_NAME)"; 727 PRODUCT_NAME = "$(TARGET_NAME)";
736 SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 728 SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@@ -748,7 +740,7 @@ @@ -748,7 +740,7 @@
748 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 740 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
749 CLANG_ENABLE_MODULES = YES; 741 CLANG_ENABLE_MODULES = YES;
750 CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; 742 CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
751 - CURRENT_PROJECT_VERSION = 703; 743 + CURRENT_PROJECT_VERSION = 7100;
752 DEVELOPMENT_TEAM = 8J59HM8B82; 744 DEVELOPMENT_TEAM = 8J59HM8B82;
753 ENABLE_BITCODE = NO; 745 ENABLE_BITCODE = NO;
754 "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; 746 "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
@@ -758,7 +750,7 @@ @@ -758,7 +750,7 @@
758 "$(inherited)", 750 "$(inherited)",
759 "@executable_path/Frameworks", 751 "@executable_path/Frameworks",
760 ); 752 );
761 - MARKETING_VERSION = 7.0.3; 753 + MARKETING_VERSION = 7.1.0;
762 PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; 754 PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine;
763 PRODUCT_NAME = "$(TARGET_NAME)"; 755 PRODUCT_NAME = "$(TARGET_NAME)";
764 SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 756 SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
1 { 1 {
2 "images" : [ 2 "images" : [
3 { 3 {
4 - "filename" : "40.jpg", 4 + "filename" : "40.png",
5 "idiom" : "iphone", 5 "idiom" : "iphone",
6 "scale" : "2x", 6 "scale" : "2x",
7 "size" : "20x20" 7 "size" : "20x20"
8 }, 8 },
9 { 9 {
10 - "filename" : "60.jpg", 10 + "filename" : "60.png",
11 "idiom" : "iphone", 11 "idiom" : "iphone",
12 "scale" : "3x", 12 "scale" : "3x",
13 "size" : "20x20" 13 "size" : "20x20"
14 }, 14 },
15 { 15 {
16 - "filename" : "29.jpg", 16 + "filename" : "29.png",
17 "idiom" : "iphone", 17 "idiom" : "iphone",
18 "scale" : "1x", 18 "scale" : "1x",
19 "size" : "29x29" 19 "size" : "29x29"
20 }, 20 },
21 { 21 {
22 - "filename" : "58.jpg", 22 + "filename" : "58.png",
23 "idiom" : "iphone", 23 "idiom" : "iphone",
24 "scale" : "2x", 24 "scale" : "2x",
25 "size" : "29x29" 25 "size" : "29x29"
26 }, 26 },
27 { 27 {
28 - "filename" : "87.jpg", 28 + "filename" : "87.png",
29 "idiom" : "iphone", 29 "idiom" : "iphone",
30 "scale" : "3x", 30 "scale" : "3x",
31 "size" : "29x29" 31 "size" : "29x29"
32 }, 32 },
33 { 33 {
34 - "filename" : "80 1.jpg", 34 + "filename" : "80 1.png",
35 "idiom" : "iphone", 35 "idiom" : "iphone",
36 "scale" : "2x", 36 "scale" : "2x",
37 "size" : "40x40" 37 "size" : "40x40"
38 }, 38 },
39 { 39 {
40 - "filename" : "120 1.jpg", 40 + "filename" : "120 1.png",
41 "idiom" : "iphone", 41 "idiom" : "iphone",
42 "scale" : "3x", 42 "scale" : "3x",
43 "size" : "40x40" 43 "size" : "40x40"
44 }, 44 },
45 { 45 {
46 - "filename" : "120.jpg", 46 + "filename" : "120.png",
47 "idiom" : "iphone", 47 "idiom" : "iphone",
48 "scale" : "2x", 48 "scale" : "2x",
49 "size" : "60x60" 49 "size" : "60x60"
50 }, 50 },
51 { 51 {
52 - "filename" : "180.jpg", 52 + "filename" : "180.png",
53 "idiom" : "iphone", 53 "idiom" : "iphone",
54 "scale" : "3x", 54 "scale" : "3x",
55 "size" : "60x60" 55 "size" : "60x60"
56 }, 56 },
57 { 57 {
58 - "filename" : "20 1.jpg", 58 + "filename" : "20 1.png",
59 "idiom" : "ipad", 59 "idiom" : "ipad",
60 "scale" : "1x", 60 "scale" : "1x",
61 "size" : "20x20" 61 "size" : "20x20"
62 }, 62 },
63 { 63 {
64 - "filename" : "40 1.jpg", 64 + "filename" : "40 1.png",
65 "idiom" : "ipad", 65 "idiom" : "ipad",
66 "scale" : "2x", 66 "scale" : "2x",
67 "size" : "20x20" 67 "size" : "20x20"
68 }, 68 },
69 { 69 {
70 - "filename" : "29 1.jpg", 70 + "filename" : "29 1.png",
71 "idiom" : "ipad", 71 "idiom" : "ipad",
72 "scale" : "1x", 72 "scale" : "1x",
73 "size" : "29x29" 73 "size" : "29x29"
74 }, 74 },
75 { 75 {
76 - "filename" : "58 1.jpg", 76 + "filename" : "58 1.png",
77 "idiom" : "ipad", 77 "idiom" : "ipad",
78 "scale" : "2x", 78 "scale" : "2x",
79 "size" : "29x29" 79 "size" : "29x29"
80 }, 80 },
81 { 81 {
82 - "filename" : "40 2.jpg", 82 + "filename" : "40 2.png",
83 "idiom" : "ipad", 83 "idiom" : "ipad",
84 "scale" : "1x", 84 "scale" : "1x",
85 "size" : "40x40" 85 "size" : "40x40"
86 }, 86 },
87 { 87 {
88 - "filename" : "80 2.jpg", 88 + "filename" : "80 2.png",
89 "idiom" : "ipad", 89 "idiom" : "ipad",
90 "scale" : "2x", 90 "scale" : "2x",
91 "size" : "40x40" 91 "size" : "40x40"
92 }, 92 },
93 { 93 {
94 - "filename" : "76.jpg", 94 + "filename" : "76.png",
95 "idiom" : "ipad", 95 "idiom" : "ipad",
96 "scale" : "1x", 96 "scale" : "1x",
97 "size" : "76x76" 97 "size" : "76x76"
98 }, 98 },
99 { 99 {
100 - "filename" : "152.jpg", 100 + "filename" : "152.png",
101 "idiom" : "ipad", 101 "idiom" : "ipad",
102 "scale" : "2x", 102 "scale" : "2x",
103 "size" : "76x76" 103 "size" : "76x76"
104 }, 104 },
105 { 105 {
106 - "filename" : "167.jpg", 106 + "filename" : "167.png",
107 "idiom" : "ipad", 107 "idiom" : "ipad",
108 "scale" : "2x", 108 "scale" : "2x",
109 "size" : "83.5x83.5" 109 "size" : "83.5x83.5"
110 }, 110 },
111 { 111 {
112 - "filename" : "1024.jpg", 112 + "filename" : "1024.png",
113 "idiom" : "ios-marketing", 113 "idiom" : "ios-marketing",
114 "scale" : "1x", 114 "scale" : "1x",
115 "size" : "1024x1024" 115 "size" : "1024x1024"

68 Bytes | W: | H:

8.61 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
@@ -10,10 +10,10 @@ class Constant { @@ -10,10 +10,10 @@ class Constant {
10 * 10 *
11 * 测试账号变更,已经删除0001 账户 代替为 0019!!!!!!!注意!!!!!!!!!!!!!! 11 * 测试账号变更,已经删除0001 账户 代替为 0019!!!!!!!注意!!!!!!!!!!!!!!
12 * */ 12 * */
13 - static const WXMiniProgramType wxMiniProgramType =  
14 - WXMiniProgramType.release; //正式版  
15 // static const WXMiniProgramType wxMiniProgramType = 13 // static const WXMiniProgramType wxMiniProgramType =
16 - // WXMiniProgramType.preview; //体验版 14 + // WXMiniProgramType.release; //正式版
  15 + static const WXMiniProgramType wxMiniProgramType =
  16 + WXMiniProgramType.preview; //体验版
17 // static const WXMiniProgramType wxMiniProgramType = 17 // static const WXMiniProgramType wxMiniProgramType =
18 // WXMiniProgramType.test; //开发版 18 // WXMiniProgramType.test; //开发版
19 19
@@ -511,6 +511,8 @@ class HttpUrl { @@ -511,6 +511,8 @@ class HttpUrl {
511 "?service=App.Seller.GetVoiceWelcomeConfig"; //获取商家语音欢迎致辞配置 511 "?service=App.Seller.GetVoiceWelcomeConfig"; //获取商家语音欢迎致辞配置
512 static const String save_voice_welcome_config = 512 static const String save_voice_welcome_config =
513 "?service=App.Seller.SaveVoiceWelcomeConfig"; //保存商家语音欢迎致辞配置 513 "?service=App.Seller.SaveVoiceWelcomeConfig"; //保存商家语音欢迎致辞配置
  514 + static const String get_voice_welcome_placeholder_buttons =
  515 + "?service=App.Seller.GetVoiceWelcomePlaceholderButtons"; //获取商家语音欢迎致辞配置占位符信息
514 516
515 static const String set_reserve_deposit = 517 static const String set_reserve_deposit =
516 "?service=App.Reserve.SetReserveDeposit"; // 取消订单设置订金走向 518 "?service=App.Reserve.SetReserveDeposit"; // 取消订单设置订金走向
@@ -19,7 +19,7 @@ import 'package:provider/provider.dart'; @@ -19,7 +19,7 @@ import 'package:provider/provider.dart';
19 import '../../../../constant/state.dart'; 19 import '../../../../constant/state.dart';
20 import '../../../../models/get_seller_info_model.dart'; 20 import '../../../../models/get_seller_info_model.dart';
21 import '../../../../models/mark_data_model.dart'; 21 import '../../../../models/mark_data_model.dart';
22 -import '../../../../models/sms_change_field_model.dart'; 22 +// import '../../../../models/sms_change_field_model.dart'; //附加语音欢迎致辞:暂时屏蔽
23 import '../../../../models/upload_img_model.dart'; 23 import '../../../../models/upload_img_model.dart';
24 import '../../../../provider/base_info_provider.dart'; 24 import '../../../../provider/base_info_provider.dart';
25 import '../../../../provider/marketing_center_provider.dart'; 25 import '../../../../provider/marketing_center_provider.dart';
@@ -72,8 +72,9 @@ class _BookInfoPageState extends State<BookInfoPage> { @@ -72,8 +72,9 @@ class _BookInfoPageState extends State<BookInfoPage> {
72 TextEditingController bookingIncoC = TextEditingController(); 72 TextEditingController bookingIncoC = TextEditingController();
73 FocusNode bookingIncoNode = FocusNode(); 73 FocusNode bookingIncoNode = FocusNode();
74 74
75 - TextEditingController voiceIncoC = TextEditingController();  
76 - FocusNode voiceIncoNode = FocusNode(); 75 + //附加语音欢迎致辞:暂时屏蔽
  76 + // TextEditingController voiceIncoC = TextEditingController();
  77 + // FocusNode voiceIncoNode = FocusNode();
77 78
78 String? date; //日期 79 String? date; //日期
79 String? dsolt; //餐段 80 String? dsolt; //餐段
@@ -91,7 +92,7 @@ class _BookInfoPageState extends State<BookInfoPage> { @@ -91,7 +92,7 @@ class _BookInfoPageState extends State<BookInfoPage> {
91 // bool addParking = false; 92 // bool addParking = false;
92 bool addPhone = true; 93 bool addPhone = true;
93 bool addBookingInfo = false; //预订信息致辞 94 bool addBookingInfo = false; //预订信息致辞
94 - bool addVoiceInfo = false; //附加语音欢迎致辞 95 + // bool addVoiceInfo = false; //附加语音欢迎致辞
95 bool addCutomer = false; //附加预订客人信息(已录入客户姓名) 96 bool addCutomer = false; //附加预订客人信息(已录入客户姓名)
96 97
97 bool addFirstImage = false; //附加餐厅首图 98 bool addFirstImage = false; //附加餐厅首图
@@ -111,7 +112,7 @@ class _BookInfoPageState extends State<BookInfoPage> { @@ -111,7 +112,7 @@ class _BookInfoPageState extends State<BookInfoPage> {
111 final picker = ImagePicker(); 112 final picker = ImagePicker();
112 113
113 late UploadImageProvider _uploadImageProvider; 114 late UploadImageProvider _uploadImageProvider;
114 - List<SmsChangeFieldSunModel> changeFieldData = []; // 115 + // List<SmsChangeFieldSunModel> changeFieldData = []; //
115 // List<ChangeModel> data = []; //停车信息图片 116 // List<ChangeModel> data = []; //停车信息图片
116 117
117 List<String?> imgAll = []; 118 List<String?> imgAll = [];
@@ -120,55 +121,49 @@ class _BookInfoPageState extends State<BookInfoPage> { @@ -120,55 +121,49 @@ class _BookInfoPageState extends State<BookInfoPage> {
120 void initState() { 121 void initState() {
121 super.initState(); 122 super.initState();
122 123
123 - SmsChangeFieldSunModel smsChangeFieldSunModel1 = SmsChangeFieldSunModel();  
124 - smsChangeFieldSunModel1.name = '年月日';  
125 - smsChangeFieldSunModel1.show = '{年月日}';  
126 - changeFieldData.add(smsChangeFieldSunModel1);  
127 -  
128 - SmsChangeFieldSunModel smsChangeFieldSunModel2 = SmsChangeFieldSunModel();  
129 - smsChangeFieldSunModel2.name = '月日';  
130 - smsChangeFieldSunModel2.show = '{月日}';  
131 - changeFieldData.add(smsChangeFieldSunModel2);  
132 -  
133 - SmsChangeFieldSunModel smsChangeFieldSunModel3 = SmsChangeFieldSunModel();  
134 - smsChangeFieldSunModel3.name = '餐段';  
135 - smsChangeFieldSunModel3.show = '{餐段}';  
136 - changeFieldData.add(smsChangeFieldSunModel3);  
137 -  
138 - SmsChangeFieldSunModel smsChangeFieldSunModel4 = SmsChangeFieldSunModel();  
139 - smsChangeFieldSunModel4.name = '就餐时间';  
140 - smsChangeFieldSunModel4.show = '{就餐时间}';  
141 - changeFieldData.add(smsChangeFieldSunModel4);  
142 -  
143 - SmsChangeFieldSunModel smsChangeFieldSunModel5 = SmsChangeFieldSunModel();  
144 - smsChangeFieldSunModel5.name = '包间名';  
145 - smsChangeFieldSunModel5.show = '{包间名}';  
146 - changeFieldData.add(smsChangeFieldSunModel5);  
147 -  
148 - SmsChangeFieldSunModel smsChangeFieldSunModel6 = SmsChangeFieldSunModel();  
149 - smsChangeFieldSunModel6.name = '区域名+包间名';  
150 - smsChangeFieldSunModel6.show = '{区域名+包间名}';  
151 - changeFieldData.add(smsChangeFieldSunModel6);  
152 -  
153 - SmsChangeFieldSunModel smsChangeFieldSunModel7 = SmsChangeFieldSunModel();  
154 - smsChangeFieldSunModel7.name = '经理名字';  
155 - smsChangeFieldSunModel7.show = '{经理名字}';  
156 - changeFieldData.add(smsChangeFieldSunModel7);  
157 -  
158 - SmsChangeFieldSunModel smsChangeFieldSunModel8 = SmsChangeFieldSunModel();  
159 - smsChangeFieldSunModel8.name = '客人姓名';  
160 - smsChangeFieldSunModel8.show = '{客人姓名}';  
161 - changeFieldData.add(smsChangeFieldSunModel8);  
162 -  
163 - SmsChangeFieldSunModel smsChangeFieldSunModel9 = SmsChangeFieldSunModel();  
164 - smsChangeFieldSunModel9.name = '客人姓氏';  
165 - smsChangeFieldSunModel9.show = '{客人姓氏}';  
166 - changeFieldData.add(smsChangeFieldSunModel9); 124 + //附加语音欢迎致辞:暂时屏蔽(可变字段按钮初始化)
  125 + // SmsChangeFieldSunModel smsChangeFieldSunModel1 = SmsChangeFieldSunModel();
  126 + // smsChangeFieldSunModel1.name = '年月日';
  127 + // smsChangeFieldSunModel1.show = '{年月日}';
  128 + // changeFieldData.add(smsChangeFieldSunModel1);
  129 + // SmsChangeFieldSunModel smsChangeFieldSunModel2 = SmsChangeFieldSunModel();
  130 + // smsChangeFieldSunModel2.name = '月日';
  131 + // smsChangeFieldSunModel2.show = '{月日}';
  132 + // changeFieldData.add(smsChangeFieldSunModel2);
  133 + // SmsChangeFieldSunModel smsChangeFieldSunModel3 = SmsChangeFieldSunModel();
  134 + // smsChangeFieldSunModel3.name = '餐段';
  135 + // smsChangeFieldSunModel3.show = '{餐段}';
  136 + // changeFieldData.add(smsChangeFieldSunModel3);
  137 + // SmsChangeFieldSunModel smsChangeFieldSunModel4 = SmsChangeFieldSunModel();
  138 + // smsChangeFieldSunModel4.name = '就餐时间';
  139 + // smsChangeFieldSunModel4.show = '{就餐时间}';
  140 + // changeFieldData.add(smsChangeFieldSunModel4);
  141 + // SmsChangeFieldSunModel smsChangeFieldSunModel5 = SmsChangeFieldSunModel();
  142 + // smsChangeFieldSunModel5.name = '包间名';
  143 + // smsChangeFieldSunModel5.show = '{包间名}';
  144 + // changeFieldData.add(smsChangeFieldSunModel5);
  145 + // SmsChangeFieldSunModel smsChangeFieldSunModel6 = SmsChangeFieldSunModel();
  146 + // smsChangeFieldSunModel6.name = '区域名+包间名';
  147 + // smsChangeFieldSunModel6.show = '{区域名+包间名}';
  148 + // changeFieldData.add(smsChangeFieldSunModel6);
  149 + // SmsChangeFieldSunModel smsChangeFieldSunModel7 = SmsChangeFieldSunModel();
  150 + // smsChangeFieldSunModel7.name = '经理名字';
  151 + // smsChangeFieldSunModel7.show = '{经理名字}';
  152 + // changeFieldData.add(smsChangeFieldSunModel7);
  153 + // SmsChangeFieldSunModel smsChangeFieldSunModel8 = SmsChangeFieldSunModel();
  154 + // smsChangeFieldSunModel8.name = '客人姓名';
  155 + // smsChangeFieldSunModel8.show = '{客人姓名}';
  156 + // changeFieldData.add(smsChangeFieldSunModel8);
  157 + // SmsChangeFieldSunModel smsChangeFieldSunModel9 = SmsChangeFieldSunModel();
  158 + // smsChangeFieldSunModel9.name = '客人姓氏';
  159 + // smsChangeFieldSunModel9.show = '{客人姓氏}';
  160 + // changeFieldData.add(smsChangeFieldSunModel9);
167 161
168 WidgetsBinding.instance.addPostFrameCallback((_) async { 162 WidgetsBinding.instance.addPostFrameCallback((_) async {
169 // _initData(); 163 // _initData();
170 - voiceIncoC.text =  
171 - '尊敬的贵宾,您好!\n感谢您选择${Provider.of<UserModel>(context, listen: false).user!.sellername}!\n您的就餐安排在{预订日期},{餐段},坐席位于{桌位}。预祝您用餐愉快,期待您的光临!'; 164 + //附加语音欢迎致辞默认文案:暂时屏蔽
  165 + // voiceIncoC.text =
  166 + // '尊敬的贵宾,您好!\n感谢您选择${Provider.of<UserModel>(context, listen: false).user!.sellername}!\n您的就餐安排在{预订日期},{餐段},坐席位于{桌位}。预祝您用餐愉快,期待您的光临!';
172 _getQiniuInfo(); 167 _getQiniuInfo();
173 168
174 await getSellerTemplateConf(); 169 await getSellerTemplateConf();
@@ -255,10 +250,11 @@ class _BookInfoPageState extends State<BookInfoPage> { @@ -255,10 +250,11 @@ class _BookInfoPageState extends State<BookInfoPage> {
255 bookingIncoC.text = 250 bookingIncoC.text =
256 marketingCenterProvider.markDataModel!.reserve!.bookingInfo ?? ''; 251 marketingCenterProvider.markDataModel!.reserve!.bookingInfo ?? '';
257 252
258 - addVoiceInfo =  
259 - marketingCenterProvider.markDataModel!.reserve!.swichVoiceInfo == '1'  
260 - ? true  
261 - : false; 253 + //附加语音欢迎致辞开关状态:暂时屏蔽
  254 + // addVoiceInfo =
  255 + // marketingCenterProvider.markDataModel!.reserve!.swichVoiceInfo == '1'
  256 + // ? true
  257 + // : false;
262 addWelcome = 258 addWelcome =
263 marketingCenterProvider.markDataModel!.reserve!.swichWelcome == '1' 259 marketingCenterProvider.markDataModel!.reserve!.swichWelcome == '1'
264 ? true 260 ? true
@@ -306,10 +302,11 @@ class _BookInfoPageState extends State<BookInfoPage> { @@ -306,10 +302,11 @@ class _BookInfoPageState extends State<BookInfoPage> {
306 ? 1 302 ? 1
307 : 0; 303 : 0;
308 304
309 - if (marketingCenterProvider.markDataModel!.reserve!.voiceInco != null) {  
310 - voiceIncoC.text =  
311 - marketingCenterProvider.markDataModel!.reserve!.voiceInco!;  
312 - } 305 + //附加语音欢迎致辞内容:暂时屏蔽(原为取接口reserve.voice_info)
  306 + // if (marketingCenterProvider.markDataModel!.reserve!.voiceInco != null) {
  307 + // voiceIncoC.text =
  308 + // marketingCenterProvider.markDataModel!.reserve!.voiceInco!;
  309 + // }
313 } 310 }
314 if (marketingCenterProvider.markDataModel!.marketing != null) { 311 if (marketingCenterProvider.markDataModel!.marketing != null) {
315 welcomeC.text = 312 welcomeC.text =
@@ -626,53 +623,51 @@ class _BookInfoPageState extends State<BookInfoPage> { @@ -626,53 +623,51 @@ class _BookInfoPageState extends State<BookInfoPage> {
626 }); 623 });
627 } 624 }
628 625
629 - List<Widget> btnWidgets() {  
630 - List<Widget> data = [];  
631 - for (var i = 0; i < changeFieldData.length; i++) {  
632 - data.add(btnItem(changeFieldData[i].name!, true, onTap: () {  
633 - changeFieldData[i].times++;  
634 - print(voiceIncoC.text);  
635 -  
636 - // 获取当前光标位置  
637 - // int cursorPosition = _cursorPosition;  
638 - int cursorPosition = voiceIncoC.selection.baseOffset;  
639 - if (cursorPosition != -1) {  
640 - // 插入文本  
641 - voiceIncoC.text = voiceIncoC.text.substring(0, cursorPosition) +  
642 - (changeFieldData[i].show??'') +  
643 - voiceIncoC.text.substring(cursorPosition);  
644 -  
645 - print(voiceIncoC.text);  
646 -  
647 - // 设置新的光标位置  
648 - voiceIncoC.selection = TextSelection.fromPosition(TextPosition(  
649 - offset: cursorPosition + changeFieldData[i].show!.length,  
650 - affinity: TextAffinity.downstream));  
651 - } else {  
652 - voiceIncoC.text += changeFieldData[i].show!;  
653 - }  
654 - }));  
655 - }  
656 - return data;  
657 - }  
658 -  
659 - Widget btnItem(String title, bool select, {GestureTapCallback? onTap}) {  
660 - return InkWell(  
661 - onTap: onTap,  
662 - child: Container(  
663 - padding: EdgeInsets.all(w(3)),  
664 - decoration: BoxDecoration(  
665 - color: select ? MyColours.color_438E93 : MyColours.color_ffffff,  
666 - borderRadius: BorderRadius.circular(r(5)),  
667 - border: Border.all(width: w(1), color: MyColours.color_438E93)),  
668 - child: Text(title,  
669 - style: TextStyle(  
670 - color: select ? MyColours.color_ffffff : MyColours.color_438E93,  
671 - fontSize: font(12),  
672 - fontWeight: FontWeight.bold)),  
673 - ),  
674 - );  
675 - } 626 + //附加语音欢迎致辞可变字段按钮:暂时屏蔽
  627 + // List<Widget> btnWidgets() {
  628 + // List<Widget> data = [];
  629 + // for (var i = 0; i < changeFieldData.length; i++) {
  630 + // data.add(btnItem(changeFieldData[i].name!, true, onTap: () {
  631 + // changeFieldData[i].times++;
  632 + // print(voiceIncoC.text);
  633 + // // 获取当前光标位置
  634 + // // int cursorPosition = _cursorPosition;
  635 + // int cursorPosition = voiceIncoC.selection.baseOffset;
  636 + // if (cursorPosition != -1) {
  637 + // // 插入文本
  638 + // voiceIncoC.text = voiceIncoC.text.substring(0, cursorPosition) +
  639 + // (changeFieldData[i].show??'') +
  640 + // voiceIncoC.text.substring(cursorPosition);
  641 + // print(voiceIncoC.text);
  642 + // // 设置新的光标位置
  643 + // voiceIncoC.selection = TextSelection.fromPosition(TextPosition(
  644 + // offset: cursorPosition + changeFieldData[i].show!.length,
  645 + // affinity: TextAffinity.downstream));
  646 + // } else {
  647 + // voiceIncoC.text += changeFieldData[i].show!;
  648 + // }
  649 + // }));
  650 + // }
  651 + // return data;
  652 + // }
  653 + //
  654 + // Widget btnItem(String title, bool select, {GestureTapCallback? onTap}) {
  655 + // return InkWell(
  656 + // onTap: onTap,
  657 + // child: Container(
  658 + // padding: EdgeInsets.all(w(3)),
  659 + // decoration: BoxDecoration(
  660 + // color: select ? MyColours.color_438E93 : MyColours.color_ffffff,
  661 + // borderRadius: BorderRadius.circular(r(5)),
  662 + // border: Border.all(width: w(1), color: MyColours.color_438E93)),
  663 + // child: Text(title,
  664 + // style: TextStyle(
  665 + // color: select ? MyColours.color_ffffff : MyColours.color_438E93,
  666 + // fontSize: font(12),
  667 + // fontWeight: FontWeight.bold)),
  668 + // ),
  669 + // );
  670 + // }
676 671
677 /// 高级筛选输入框 672 /// 高级筛选输入框
678 Widget _textFeildWidget( 673 Widget _textFeildWidget(
@@ -1302,84 +1297,86 @@ class _BookInfoPageState extends State<BookInfoPage> { @@ -1302,84 +1297,86 @@ class _BookInfoPageState extends State<BookInfoPage> {
1302 // )), 1297 // )),
1303 1298
1304 // VEmptyView(24), 1299 // VEmptyView(24),
1305 - _item('附加语音欢迎致辞', select: addVoiceInfo, onTap: () {  
1306 - setState(() {  
1307 - addVoiceInfo = !addVoiceInfo;  
1308 - });  
1309 - }),  
1310 - VEmptyView(24),  
1311 - //输入框  
1312 - Container(  
1313 - width: double.infinity,  
1314 - margin: EdgeInsets.symmetric(  
1315 - horizontal: ScreenUtil().setWidth(40)),  
1316 - padding: EdgeInsets.symmetric(  
1317 - horizontal: ScreenUtil().setWidth(40),  
1318 - vertical: ScreenUtil().setWidth(20)),  
1319 - alignment: Alignment.topLeft,  
1320 - decoration: BoxDecoration(  
1321 - color: MyColours.color_ffffff,  
1322 - border: Border.all(  
1323 - color: MyColours.color_DBDBDB,  
1324 - width: ScreenUtil().setWidth(2)),  
1325 - borderRadius: BorderRadius.circular(  
1326 - ScreenUtil().setWidth(20))),  
1327 - child: TextField(  
1328 - controller: voiceIncoC,  
1329 - focusNode: voiceIncoNode,  
1330 - style: TextStyle(  
1331 - color: MyColours.color_515151,  
1332 - fontSize: ScreenUtil().setSp(28),  
1333 - textBaseline: TextBaseline.alphabetic),  
1334 - textAlignVertical: TextAlignVertical.center,  
1335 - maxLines: 7,  
1336 - // maxLength: 50,  
1337 - decoration: InputDecoration(  
1338 - hintText: "点击录入语音欢迎致辞",  
1339 - hintStyle: TextStyle(  
1340 - color: MyColours.color_999999,  
1341 - fontSize: ScreenUtil().setSp(28),  
1342 - ),  
1343 - contentPadding: EdgeInsets.zero,  
1344 - border: OutlineInputBorder(  
1345 - borderSide: BorderSide.none),  
1346 - ),  
1347 - keyboardType: TextInputType.multiline,  
1348 - onChanged: (value) {  
1349 - setState(() {  
1350 - // currentRemark = value ?? "";  
1351 - });  
1352 - }),  
1353 - ),  
1354 - VEmptyView(24),  
1355 -  
1356 - Container(  
1357 - padding: EdgeInsets.symmetric(horizontal: w(20)),  
1358 - child: Text(  
1359 - '*{预定日期}、{餐段}、{桌位}不能修改,可以删除。',  
1360 - style: TextStyle(  
1361 - color: MyColours.color_999999,  
1362 - fontSize: font(14)),  
1363 - )),  
1364 - VEmptyView(24),  
1365 -  
1366 - Container(  
1367 - padding: EdgeInsets.symmetric(horizontal: w(20)),  
1368 - child: Wrap(  
1369 - crossAxisAlignment: WrapCrossAlignment.start,  
1370 - alignment: WrapAlignment.start,  
1371 - spacing: w(10),  
1372 - runSpacing: w(10),  
1373 - children: btnWidgets(),  
1374 - )),  
1375 - VEmptyView(24),  
1376 - Padding(  
1377 - padding: EdgeInsets.symmetric(horizontal: w(20)),  
1378 - child: MyDivider(  
1379 - double.infinity,  
1380 - w(0.5),  
1381 - color: MyColours.color_DBDBDB,  
1382 - )), 1300 + //附加语音欢迎致辞功能块:暂时屏蔽
  1301 + // _item('附加语音欢迎致辞', select: addVoiceInfo, onTap: () {
  1302 + // setState(() {
  1303 + // addVoiceInfo = !addVoiceInfo;
  1304 + // });
  1305 + // }),
  1306 + // VEmptyView(24),
  1307 + // //输入框
  1308 + // Container(
  1309 + // width: double.infinity,
  1310 + // margin: EdgeInsets.symmetric(
  1311 + // horizontal: ScreenUtil().setWidth(40)),
  1312 + // padding: EdgeInsets.symmetric(
  1313 + // horizontal: ScreenUtil().setWidth(40),
  1314 + // vertical: ScreenUtil().setWidth(20)),
  1315 + // alignment: Alignment.topLeft,
  1316 + // decoration: BoxDecoration(
  1317 + // color: MyColours.color_ffffff,
  1318 + // border: Border.all(
  1319 + // color: MyColours.color_DBDBDB,
  1320 + // width: ScreenUtil().setWidth(2)),
  1321 + // borderRadius: BorderRadius.circular(
  1322 + // ScreenUtil().setWidth(20))),
  1323 + // child: TextField(
  1324 + // controller: voiceIncoC,
  1325 + // focusNode: voiceIncoNode,
  1326 + // style: TextStyle(
  1327 + // color: MyColours.color_515151,
  1328 + // fontSize: ScreenUtil().setSp(28),
  1329 + // textBaseline: TextBaseline.alphabetic),
  1330 + // textAlignVertical: TextAlignVertical.center,
  1331 + // maxLines: 7,
  1332 + // // maxLength: 50,
  1333 + // decoration: InputDecoration(
  1334 + // hintText: "点击录入语音欢迎致辞",
  1335 + // hintStyle: TextStyle(
  1336 + // color: MyColours.color_999999,
  1337 + // fontSize: ScreenUtil().setSp(28),
  1338 + // ),
  1339 + // contentPadding: EdgeInsets.zero,
  1340 + // border: OutlineInputBorder(
  1341 + // borderSide: BorderSide.none),
  1342 + // ),
  1343 + // keyboardType: TextInputType.multiline,
  1344 + // onChanged: (value) {
  1345 + // setState(() {
  1346 + // // currentRemark = value ?? "";
  1347 + // });
  1348 + // }),
  1349 + // ),
  1350 + // VEmptyView(24),
  1351 + //
  1352 + // Container(
  1353 + // padding: EdgeInsets.symmetric(horizontal: w(20)),
  1354 + // child: Text(
  1355 + // '*{预定日期}、{餐段}、{桌位}不能修改,可以删除。',
  1356 + // style: TextStyle(
  1357 + // color: MyColours.color_999999,
  1358 + // fontSize: font(14)),
  1359 + // )),
  1360 + // VEmptyView(24),
  1361 + //
  1362 + // Container(
  1363 + // padding: EdgeInsets.symmetric(horizontal: w(20)),
  1364 + // child: Wrap(
  1365 + // crossAxisAlignment: WrapCrossAlignment.start,
  1366 + // alignment: WrapAlignment.start,
  1367 + // spacing: w(10),
  1368 + // runSpacing: w(10),
  1369 + // children: btnWidgets(),
  1370 + // )),
  1371 + // VEmptyView(24),
  1372 + //附加语音欢迎致辞分隔线:暂时屏蔽
  1373 + // Padding(
  1374 + // padding: EdgeInsets.symmetric(horizontal: w(20)),
  1375 + // child: MyDivider(
  1376 + // double.infinity,
  1377 + // w(0.5),
  1378 + // color: MyColours.color_DBDBDB,
  1379 + // )),
1383 1380
1384 // Padding( 1381 // Padding(
1385 // padding: EdgeInsets.symmetric(horizontal: w(20)), 1382 // padding: EdgeInsets.symmetric(horizontal: w(20)),
@@ -1646,10 +1643,11 @@ class _BookInfoPageState extends State<BookInfoPage> { @@ -1646,10 +1643,11 @@ class _BookInfoPageState extends State<BookInfoPage> {
1646 // Utils.showToast('请输入停车信息!'); 1643 // Utils.showToast('请输入停车信息!');
1647 // return false; 1644 // return false;
1648 // } 1645 // }
1649 - if (addVoiceInfo && voiceIncoC.text.trim().length == 0) {  
1650 - Utils.showToast('请输入语音欢迎致辞!');  
1651 - return ;  
1652 - } 1646 + //附加语音欢迎致辞校验:暂时屏蔽
  1647 + // if (addVoiceInfo && voiceIncoC.text.trim().length == 0) {
  1648 + // Utils.showToast('请输入语音欢迎致辞!');
  1649 + // return ;
  1650 + // }
1653 // if (addParking && parkingIncoC.text.trim().length == 0) { 1651 // if (addParking && parkingIncoC.text.trim().length == 0) {
1654 // Utils.showToast('请输入停车信息!'); 1652 // Utils.showToast('请输入停车信息!');
1655 // return false; 1653 // return false;
@@ -1695,10 +1693,10 @@ class _BookInfoPageState extends State<BookInfoPage> { @@ -1695,10 +1693,10 @@ class _BookInfoPageState extends State<BookInfoPage> {
1695 'swich_manager': addManager ? '1' : '0', 1693 'swich_manager': addManager ? '1' : '0',
1696 // 'swich_park': addParking ? '1' : '0', 1694 // 'swich_park': addParking ? '1' : '0',
1697 'swich_booking': addBookingInfo ? '1' : '0', 1695 'swich_booking': addBookingInfo ? '1' : '0',
1698 - 'swich_voice': addVoiceInfo ? '1' : '0', 1696 + // 'swich_voice': addVoiceInfo ? '1' : '0',
1699 // 'park_info': parkingIncoC.text, 1697 // 'park_info': parkingIncoC.text,
1700 'book_info': bookingIncoC.text, 1698 'book_info': bookingIncoC.text,
1701 - 'voice_info': voiceIncoC.text, 1699 + // 'voice_info': voiceIncoC.text,
1702 'swich_welcome': addWelcome ? '1' : '0', 1700 'swich_welcome': addWelcome ? '1' : '0',
1703 'swich_slogan': addSlogan ? '1' : '0', 1701 'swich_slogan': addSlogan ? '1' : '0',
1704 // 'park_info_images': 1702 // 'park_info_images':
@@ -3,6 +3,7 @@ import 'dart:convert'; @@ -3,6 +3,7 @@ import 'dart:convert';
3 import 'package:flutter/material.dart'; 3 import 'package:flutter/material.dart';
4 import 'package:one_key/constant/constant.dart'; 4 import 'package:one_key/constant/constant.dart';
5 import 'package:one_key/models/get_reserve_type_field_model.dart'; 5 import 'package:one_key/models/get_reserve_type_field_model.dart';
  6 +import 'package:one_key/models/mark_data_model.dart';
6 import 'package:one_key/models/voice_welcome_config_model.dart'; 7 import 'package:one_key/models/voice_welcome_config_model.dart';
7 import 'package:one_key/net/base_resp.dart'; 8 import 'package:one_key/net/base_resp.dart';
8 import 'package:one_key/net/dio_util.dart'; 9 import 'package:one_key/net/dio_util.dart';
@@ -45,8 +46,10 @@ class _VoiceWelcomeSettingPageState extends State<VoiceWelcomeSettingPage> { @@ -45,8 +46,10 @@ class _VoiceWelcomeSettingPageState extends State<VoiceWelcomeSettingPage> {
45 List<GetReserveTypeFieldsSunModel>? mealTypes = []; //用餐类型 46 List<GetReserveTypeFieldsSunModel>? mealTypes = []; //用餐类型
46 bool mealTypesError = false; //用餐类型接口加载失败 47 bool mealTypesError = false; //用餐类型接口加载失败
47 48
48 - static const String defaultVoiceText = 49 + static const String _localDefaultVoiceText =
49 '尊敬的贵宾,您好!\n欢迎您选择本店。\n您的就餐安排在{预订日期},{餐段},坐席位于{桌位}。\n预祝您用餐愉快,期待您的光临!'; 50 '尊敬的贵宾,您好!\n欢迎您选择本店。\n您的就餐安排在{预订日期},{餐段},坐席位于{桌位}。\n预祝您用餐愉快,期待您的光临!';
  51 + //默认语音欢迎致辞,优先取接口数据(对应BookInfoPage附加语音欢迎致辞内容),接口无数据时用本地文本
  52 + String defaultVoiceText = _localDefaultVoiceText;
50 53
51 @override 54 @override
52 void initState() { 55 void initState() {
@@ -75,9 +78,20 @@ class _VoiceWelcomeSettingPageState extends State<VoiceWelcomeSettingPage> { @@ -75,9 +78,20 @@ class _VoiceWelcomeSettingPageState extends State<VoiceWelcomeSettingPage> {
75 try { 78 try {
76 String? sid = 79 String? sid =
77 Provider.of<UserModel>(context, listen: false).user?.sellerid; 80 Provider.of<UserModel>(context, listen: false).user?.sellerid;
  81 + //从预订安排模板接口获取默认语音欢迎致辞
  82 + await _getDefaultVoiceText();
  83 + //接口有默认文本时先填充,接口无数据时保持本地文本;配置接口失败时也使用该默认
  84 + voiceIncoC.text = defaultVoiceText;
  85 + guestDefaultC.text = defaultVoiceText;
  86 + guestSpecialC.text = defaultVoiceText;
78 BaseResp<dynamic> baseResp = await DioUtil().request<dynamic>( 87 BaseResp<dynamic> baseResp = await DioUtil().request<dynamic>(
79 context, Method.post, HttpUrl.get_voice_welcome_config, 88 context, Method.post, HttpUrl.get_voice_welcome_config,
80 data: {'sid': sid}, showLoading: false); 89 data: {'sid': sid}, showLoading: false);
  90 + //可变字段按钮:独立于配置接口获取(未配置店铺时配置接口返回false而非对象)
  91 + List<VoiceWelcomePlaceholderModel>? buttons =
  92 + await _getPlaceholderButtons();
  93 + //用餐类型按钮:独立于配置接口获取(参考工程内App.Seller.GetReserveTypeField用法)
  94 + List<GetReserveTypeFieldsSunModel>? mealTypeList = await _getMealTypes();
81 if (baseResp.code == Constant.status_success && 95 if (baseResp.code == Constant.status_success &&
82 baseResp.data != null && 96 baseResp.data != null &&
83 baseResp.data is Map) { 97 baseResp.data is Map) {
@@ -99,18 +113,20 @@ class _VoiceWelcomeSettingPageState extends State<VoiceWelcomeSettingPage> { @@ -99,18 +113,20 @@ class _VoiceWelcomeSettingPageState extends State<VoiceWelcomeSettingPage> {
99 : defaultVoiceText; 113 : defaultVoiceText;
100 specialVoiceEnabled = 114 specialVoiceEnabled =
101 model.isInviteeSpecialEnabled == '1' ? true : false; 115 model.isInviteeSpecialEnabled == '1' ? true : false;
102 - //可变字段按钮 116 + //可变字段按钮兜底:配置接口返回的占位符
103 changeFieldData = model.placeholderButtons ?? []; 117 changeFieldData = model.placeholderButtons ?? [];
104 - //用餐类型及已选状态 118 + //用餐类型兜底:配置接口返回的选项
105 mealTypes = []; 119 mealTypes = [];
106 model.reserveTypeOptions?.forEach((v) { 120 model.reserveTypeOptions?.forEach((v) {
107 - GetReserveTypeFieldsSunModel temp =  
108 - GetReserveTypeFieldsSunModel(name: v, select: false); 121 + mealTypes!.add(
  122 + GetReserveTypeFieldsSunModel(name: v, select: false));
  123 + });
  124 + //已选特殊用餐类型
  125 + mealTypes?.forEach((item) {
109 if (model.specialReserveTypes != null && 126 if (model.specialReserveTypes != null &&
110 - model.specialReserveTypes!.contains(v)) {  
111 - temp.select = true; 127 + model.specialReserveTypes!.contains(item.name)) {
  128 + item.select = true;
112 } 129 }
113 - mealTypes!.add(temp);  
114 }); 130 });
115 mealTypesError = false; 131 mealTypesError = false;
116 } else { 132 } else {
@@ -119,6 +135,26 @@ class _VoiceWelcomeSettingPageState extends State<VoiceWelcomeSettingPage> { @@ -119,6 +135,26 @@ class _VoiceWelcomeSettingPageState extends State<VoiceWelcomeSettingPage> {
119 Utils.showToast(baseResp.msg!); 135 Utils.showToast(baseResp.msg!);
120 } 136 }
121 } 137 }
  138 + //按钮数据优先取专用占位符接口,失败时保持配置接口兜底
  139 + if (buttons != null && buttons.isNotEmpty) {
  140 + changeFieldData = buttons;
  141 + }
  142 + //用餐类型优先取专用接口,失败时保持配置接口兜底,并保留已选状态
  143 + if (mealTypeList != null && mealTypeList.isNotEmpty) {
  144 + List<String> selectedMealTypeNames = [];
  145 + mealTypes?.forEach((item) {
  146 + if (item.select ?? false) {
  147 + selectedMealTypeNames.add(item.name ?? '');
  148 + }
  149 + });
  150 + mealTypes = mealTypeList;
  151 + mealTypes!.forEach((item) {
  152 + if (selectedMealTypeNames.contains(item.name)) {
  153 + item.select = true;
  154 + }
  155 + });
  156 + mealTypesError = false;
  157 + }
122 } catch (error) { 158 } catch (error) {
123 print(error.toString()); 159 print(error.toString());
124 mealTypesError = true; 160 mealTypesError = true;
@@ -128,6 +164,72 @@ class _VoiceWelcomeSettingPageState extends State<VoiceWelcomeSettingPage> { @@ -128,6 +164,72 @@ class _VoiceWelcomeSettingPageState extends State<VoiceWelcomeSettingPage> {
128 } 164 }
129 } 165 }
130 166
  167 + ///从接口获取默认语音欢迎致辞(参考BookInfoPage附加语音欢迎致辞文本内容)
  168 + _getDefaultVoiceText() async {
  169 + try {
  170 + String? sid =
  171 + Provider.of<UserModel>(context, listen: false).user?.sellerid;
  172 + BaseResp<dynamic> baseResp = await DioUtil().request<dynamic>(
  173 + context, Method.post, HttpUrl.get_seller_template_conf,
  174 + data: {'sid': sid}, showLoading: false);
  175 + if (baseResp.code == Constant.status_success &&
  176 + baseResp.data != null &&
  177 + baseResp.data is Map) {
  178 + MarkDataModel model =
  179 + MarkDataModel.fromJson(baseResp.data as Map<String, dynamic>);
  180 + String? voiceInco = model.reserve?.voiceInco;
  181 + if (voiceInco != null && voiceInco.isNotEmpty) {
  182 + defaultVoiceText = voiceInco;
  183 + }
  184 + }
  185 + } catch (error) {
  186 + print(error.toString());
  187 + }
  188 + }
  189 +
  190 + ///从接口获取可变字段按钮数据(对应App.Seller.GetVoiceWelcomePlaceholderButtons)
  191 + Future<List<VoiceWelcomePlaceholderModel>?> _getPlaceholderButtons() async {
  192 + try {
  193 + BaseResp<dynamic> baseResp = await DioUtil().request<dynamic>(context,
  194 + Method.post, HttpUrl.get_voice_welcome_placeholder_buttons,
  195 + data: <String, dynamic>{}, showLoading: false);
  196 + if (baseResp.code == Constant.status_success &&
  197 + baseResp.data != null &&
  198 + baseResp.data is List) {
  199 + List<VoiceWelcomePlaceholderModel> list = [];
  200 + (baseResp.data as List).forEach((v) {
  201 + if (v is Map) {
  202 + list.add(VoiceWelcomePlaceholderModel.fromJson(
  203 + Map<String, dynamic>.from(v)));
  204 + }
  205 + });
  206 + return list;
  207 + }
  208 + } catch (error) {
  209 + print(error.toString());
  210 + }
  211 + return null;
  212 + }
  213 +
  214 + ///从接口获取用餐类型按钮数据(参考工程内App.Seller.GetReserveTypeField用法)
  215 + Future<List<GetReserveTypeFieldsSunModel>?> _getMealTypes() async {
  216 + try {
  217 + BaseResp<dynamic> baseResp = await DioUtil().request<dynamic>(context,
  218 + Method.post, HttpUrl.get_reserve_type_field,
  219 + showLoading: false);
  220 + if (baseResp.code == Constant.status_success &&
  221 + baseResp.responseData != null &&
  222 + baseResp.responseData is Map) {
  223 + GetReserveTypeFieldModel model = GetReserveTypeFieldModel.fromJson(
  224 + baseResp.responseData as Map<String, dynamic>);
  225 + return model.data ?? [];
  226 + }
  227 + } catch (error) {
  228 + print(error.toString());
  229 + }
  230 + return null;
  231 + }
  232 +
131 ///在光标处插入可变字段 233 ///在光标处插入可变字段
132 _insertField( 234 _insertField(
133 TextEditingController controller, VoiceWelcomePlaceholderModel field) { 235 TextEditingController controller, VoiceWelcomePlaceholderModel field) {
@@ -389,14 +491,17 @@ class _VoiceWelcomeSettingPageState extends State<VoiceWelcomeSettingPage> { @@ -389,14 +491,17 @@ class _VoiceWelcomeSettingPageState extends State<VoiceWelcomeSettingPage> {
389 selectedMealTypes.add(item.name ?? ''); 491 selectedMealTypes.add(item.name ?? '');
390 } 492 }
391 }); 493 });
  494 + //提交时把语音播报内容中的{预订日期}占位符替换为{年月日}
  495 + String replaceReserveDate(String text) =>
  496 + text.replaceAll('{预订日期}', '{年月日}');
392 497
393 Map<String, String?> params = { 498 Map<String, String?> params = {
394 'sid': Provider.of<UserModel>(context, listen: false).user?.sellerid, 499 'sid': Provider.of<UserModel>(context, listen: false).user?.sellerid,
395 'is_voice_welcome': addVoiceInfo ? '1' : '0', 500 'is_voice_welcome': addVoiceInfo ? '1' : '0',
396 - 'welcome_content': voiceIncoC.text, 501 + 'welcome_content': replaceReserveDate(voiceIncoC.text),
397 'invitee_same_as_reserver': guestVoiceSame ? '1' : '0', 502 'invitee_same_as_reserver': guestVoiceSame ? '1' : '0',
398 - 'invitee_default_content': guestDefaultC.text,  
399 - 'invitee_special_content': guestSpecialC.text, 503 + 'invitee_default_content': replaceReserveDate(guestDefaultC.text),
  504 + 'invitee_special_content': replaceReserveDate(guestSpecialC.text),
400 'special_reserve_types': json.encode(selectedMealTypes), 505 'special_reserve_types': json.encode(selectedMealTypes),
401 'is_invitee_special_enabled': specialVoiceEnabled ? '1' : '0', 506 'is_invitee_special_enabled': specialVoiceEnabled ? '1' : '0',
402 }; 507 };