Showing
7 changed files
with
633 additions
and
496 deletions
lib/models/reserve_img_text.dart
0 → 100644
| 1 | + | ||
| 2 | +import 'dart:convert'; | ||
| 3 | +class ReserveImgTextModel { | ||
| 4 | + int ret; | ||
| 5 | + ReserveImgTextSunModel data; | ||
| 6 | + String msg; | ||
| 7 | + | ||
| 8 | + ReserveImgTextModel({this.ret, this.data, this.msg}); | ||
| 9 | + | ||
| 10 | + ReserveImgTextModel.fromJson(Map<String, dynamic> json) { | ||
| 11 | + ret = json["ret"]; | ||
| 12 | + data = json["data"] == null ? null : ReserveImgTextSunModel.fromJson(json["data"]); | ||
| 13 | + msg = json["msg"]; | ||
| 14 | + } | ||
| 15 | + | ||
| 16 | + Map<String, dynamic> toJson() { | ||
| 17 | + final Map<String, dynamic> _data = <String, dynamic>{}; | ||
| 18 | + _data["ret"] = ret; | ||
| 19 | + if(data != null) { | ||
| 20 | + _data["data"] = data?.toJson(); | ||
| 21 | + } | ||
| 22 | + _data["msg"] = msg; | ||
| 23 | + return _data; | ||
| 24 | + } | ||
| 25 | +} | ||
| 26 | + | ||
| 27 | +class ReserveImgTextSunModel { | ||
| 28 | + String id; | ||
| 29 | + String uid; | ||
| 30 | + String rid; | ||
| 31 | + String title; | ||
| 32 | + List<ContentModel> content; | ||
| 33 | + String cdate; | ||
| 34 | + | ||
| 35 | + ReserveImgTextSunModel({this.id, this.uid, this.rid, this.title, this.content, this.cdate}); | ||
| 36 | + | ||
| 37 | + ReserveImgTextSunModel.fromJson(Map<String, dynamic> json) { | ||
| 38 | + id = json["id"]; | ||
| 39 | + uid = json["uid"]; | ||
| 40 | + rid = json["rid"]; | ||
| 41 | + title = json["title"]; | ||
| 42 | + content = []; | ||
| 43 | + if (json['content'] != null) { | ||
| 44 | + if (jsonDecode(json['content']) is List) { | ||
| 45 | + List temp = jsonDecode(json['content']); | ||
| 46 | + temp.forEach((element) { | ||
| 47 | + content.add(ContentModel.fromJson(element)); | ||
| 48 | + }); | ||
| 49 | + } | ||
| 50 | + } | ||
| 51 | + cdate = json["cdate"]; | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + Map<String, dynamic> toJson() { | ||
| 55 | + final Map<String, dynamic> _data = <String, dynamic>{}; | ||
| 56 | + _data["id"] = id; | ||
| 57 | + _data["uid"] = uid; | ||
| 58 | + _data["rid"] = rid; | ||
| 59 | + _data["title"] = title; | ||
| 60 | + _data["content"] = content; | ||
| 61 | + _data["cdate"] = cdate; | ||
| 62 | + return _data; | ||
| 63 | + } | ||
| 64 | +} | ||
| 65 | + | ||
| 66 | +class ContentModel{ | ||
| 67 | + String type; | ||
| 68 | + String content; | ||
| 69 | + | ||
| 70 | + ContentModel({this.type, this.content}); | ||
| 71 | + | ||
| 72 | + ContentModel.fromJson(Map<String, dynamic> json) { | ||
| 73 | + type = json["type"]; | ||
| 74 | + content = json["content"]; | ||
| 75 | + } | ||
| 76 | + | ||
| 77 | +} |
| @@ -521,14 +521,15 @@ class HttpUrl { | @@ -521,14 +521,15 @@ class HttpUrl { | ||
| 521 | static const String get_sms_change_field = | 521 | static const String get_sms_change_field = |
| 522 | "?service=App.SaiYouYun.GetSmsChangeField"; // 获取可变模板允许配置字段 | 522 | "?service=App.SaiYouYun.GetSmsChangeField"; // 获取可变模板允许配置字段 |
| 523 | 523 | ||
| 524 | + static const String save_sai_you_yun_change = | ||
| 525 | + "?service=App.SaiYouYun.SaveSaiYouYunChange"; // 配置可变模板内容 | ||
| 524 | 526 | ||
| 525 | - | ||
| 526 | - static const String save_sai_you_yun_change = | ||
| 527 | - "?service=App.SaiYouYun.SaveSaiYouYunChange"; // 配置可变模板内容 | ||
| 528 | - | ||
| 529 | - static const String app_pay_jisu_version = | 527 | + static const String app_pay_jisu_version = |
| 530 | "?service=App.Pay.AppPayJiSuVersion"; // App调起支付(购买版本) | 528 | "?service=App.Pay.AppPayJiSuVersion"; // App调起支付(购买版本) |
| 531 | - | 529 | + static const String set_reserve_img_text = |
| 530 | + "?service=App.Reserve.SetReserveImgText"; // 保存预订详情自定义图文 | ||
| 531 | +static const String get_reserve_img_text = | ||
| 532 | + "?service=App.Reserve.GetReserveImgText"; // 获取预订详情自定义图文 | ||
| 532 | 533 | ||
| 533 | 534 | ||
| 534 | } | 535 | } |
| 1 | +import 'dart:convert'; | ||
| 2 | + | ||
| 1 | import 'package:flutter/material.dart'; | 3 | import 'package:flutter/material.dart'; |
| 4 | +import 'package:flutter/services.dart'; | ||
| 2 | 5 | ||
| 3 | import 'package:flutter_native_image/flutter_native_image.dart'; | 6 | import 'package:flutter_native_image/flutter_native_image.dart'; |
| 4 | import 'package:flutter_screenutil/flutter_screenutil.dart'; | 7 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
| @@ -11,9 +14,13 @@ import 'package:one_key/widgets/system_app_bar.dart'; | @@ -11,9 +14,13 @@ import 'package:one_key/widgets/system_app_bar.dart'; | ||
| 11 | import 'package:permission_handler/permission_handler.dart'; | 14 | import 'package:permission_handler/permission_handler.dart'; |
| 12 | import 'package:provider/provider.dart'; | 15 | import 'package:provider/provider.dart'; |
| 13 | 16 | ||
| 17 | +import '../../models/reserve_img_text.dart'; | ||
| 14 | import '../../models/upload_img_model.dart'; | 18 | import '../../models/upload_img_model.dart'; |
| 19 | +import '../../provider/marketing_center_provider.dart'; | ||
| 15 | import '../../provider/upload_img_provider.dart'; | 20 | import '../../provider/upload_img_provider.dart'; |
| 21 | +import '../../provider/user_model.dart'; | ||
| 16 | import '../../res/colors.dart'; | 22 | import '../../res/colors.dart'; |
| 23 | +import '../../utils/event_bus.dart'; | ||
| 17 | import '../../utils/screen_util.dart'; | 24 | import '../../utils/screen_util.dart'; |
| 18 | import '../../utils/upload_image_util.dart'; | 25 | import '../../utils/upload_image_util.dart'; |
| 19 | import '../../utils/utils.dart'; | 26 | import '../../utils/utils.dart'; |
| @@ -44,7 +51,9 @@ class AdditionModel { | @@ -44,7 +51,9 @@ class AdditionModel { | ||
| 44 | } | 51 | } |
| 45 | 52 | ||
| 46 | class InvicationAdditionPage extends StatefulWidget { | 53 | class InvicationAdditionPage extends StatefulWidget { |
| 47 | - InvicationAdditionPage(); | 54 | + final String rid; |
| 55 | + | ||
| 56 | + InvicationAdditionPage(this.rid); | ||
| 48 | 57 | ||
| 49 | @override | 58 | @override |
| 50 | State<InvicationAdditionPage> createState() => _InvicationAdditionPageState(); | 59 | State<InvicationAdditionPage> createState() => _InvicationAdditionPageState(); |
| @@ -57,6 +66,8 @@ class _InvicationAdditionPageState extends State<InvicationAdditionPage> { | @@ -57,6 +66,8 @@ class _InvicationAdditionPageState extends State<InvicationAdditionPage> { | ||
| 57 | final picker = ImagePicker(); | 66 | final picker = ImagePicker(); |
| 58 | ScrollController controller = ScrollController(); | 67 | ScrollController controller = ScrollController(); |
| 59 | 68 | ||
| 69 | + MarketingCenterProvider marketingCenterProvider; | ||
| 70 | + | ||
| 60 | @override | 71 | @override |
| 61 | void initState() { | 72 | void initState() { |
| 62 | super.initState(); | 73 | super.initState(); |
| @@ -81,6 +92,7 @@ class _InvicationAdditionPageState extends State<InvicationAdditionPage> { | @@ -81,6 +92,7 @@ class _InvicationAdditionPageState extends State<InvicationAdditionPage> { | ||
| 81 | 92 | ||
| 82 | WidgetsBinding.instance.addPostFrameCallback((_) async { | 93 | WidgetsBinding.instance.addPostFrameCallback((_) async { |
| 83 | _getQiniuInfo(); | 94 | _getQiniuInfo(); |
| 95 | + getReserveImgText(); | ||
| 84 | }); | 96 | }); |
| 85 | } | 97 | } |
| 86 | 98 | ||
| @@ -90,6 +102,55 @@ class _InvicationAdditionPageState extends State<InvicationAdditionPage> { | @@ -90,6 +102,55 @@ class _InvicationAdditionPageState extends State<InvicationAdditionPage> { | ||
| 90 | await _uploadImageProvider.getQiniuInfo(context, {}); | 102 | await _uploadImageProvider.getQiniuInfo(context, {}); |
| 91 | } | 103 | } |
| 92 | 104 | ||
| 105 | + getReserveImgText() async { | ||
| 106 | + await marketingCenterProvider.getReserveImgText(context, widget.rid); | ||
| 107 | + if (marketingCenterProvider.reserveImgText != null) { | ||
| 108 | + titleC.text = marketingCenterProvider.reserveImgText.title; | ||
| 109 | + for (int i = 0; | ||
| 110 | + i < marketingCenterProvider.reserveImgText.content.length; | ||
| 111 | + i++) { | ||
| 112 | + ContentModel contentModel = | ||
| 113 | + marketingCenterProvider.reserveImgText.content[i]; | ||
| 114 | + if (contentModel.type == '1') { | ||
| 115 | + //图片 | ||
| 116 | + AdditionModel additionModel = AdditionModel(); | ||
| 117 | + additionModel.content = contentModel.content; | ||
| 118 | + additionModel.type = '1'; | ||
| 119 | + | ||
| 120 | + additionModel.image = UploadImgModel(); | ||
| 121 | + additionModel.image.process = 1; | ||
| 122 | + additionModel.image.qiniuUrl = contentModel.content; | ||
| 123 | + data.add(additionModel); | ||
| 124 | + } else { | ||
| 125 | + AdditionModel additionModel = AdditionModel(); | ||
| 126 | + additionModel.content = contentModel.content; | ||
| 127 | + additionModel.infoC.text = contentModel.content; | ||
| 128 | + additionModel.type = contentModel.type; | ||
| 129 | + | ||
| 130 | + data.add(additionModel); | ||
| 131 | + } | ||
| 132 | + } | ||
| 133 | + // AdditionModel additionModel = AdditionModel(); | ||
| 134 | + // additionModel.content = | ||
| 135 | + // 'https://inews.gtimg.com/om_bt/OGlQWfsaAoKkuCcMZ2o9IVEPqd-72DQy5EAN02XBHUwfYAA/641'; | ||
| 136 | + // additionModel.type = '1'; | ||
| 137 | + // additionModel.order = 0; | ||
| 138 | + // additionModel.image = UploadImgModel(); | ||
| 139 | + // additionModel.image.process = 1; | ||
| 140 | + // additionModel.image.qiniuUrl = | ||
| 141 | + // 'https://inews.gtimg.com/om_bt/OGlQWfsaAoKkuCcMZ2o9IVEPqd-72DQy5EAN02XBHUwfYAA/641'; | ||
| 142 | + | ||
| 143 | + // AdditionModel additionModel1 = AdditionModel(); | ||
| 144 | + // additionModel1.content = 'webenkjfkdfjakdfjaldfkjaldfjaldf'; | ||
| 145 | + // additionModel1.type = '2'; | ||
| 146 | + // additionModel1.order = 1; | ||
| 147 | + | ||
| 148 | + // data.add(additionModel); | ||
| 149 | + // data.add(additionModel1); | ||
| 150 | + marketingCenterProvider.notifyListeners(); | ||
| 151 | + } | ||
| 152 | + } | ||
| 153 | + | ||
| 93 | @override | 154 | @override |
| 94 | void dispose() { | 155 | void dispose() { |
| 95 | super.dispose(); | 156 | super.dispose(); |
| @@ -99,49 +160,261 @@ class _InvicationAdditionPageState extends State<InvicationAdditionPage> { | @@ -99,49 +160,261 @@ class _InvicationAdditionPageState extends State<InvicationAdditionPage> { | ||
| 99 | ///#相机拍照,单图选择 | 160 | ///#相机拍照,单图选择 |
| 100 | Future _getFromPictureOrCamera(int index, imageSource) async { | 161 | Future _getFromPictureOrCamera(int index, imageSource) async { |
| 101 | final pickedFile = await picker.pickImage(source: imageSource); | 162 | final pickedFile = await picker.pickImage(source: imageSource); |
| 102 | - File compressedFile = await FlutterNativeImage.compressImage( | ||
| 103 | - pickedFile.path, | ||
| 104 | - quality: 50, | ||
| 105 | - percentage: 50); | ||
| 106 | - UploadImgModel imgModel = _uploadImageProvider.getDynamicValue('${index}'); | ||
| 107 | - setState(() { | 163 | + if (pickedFile == null){ |
| 164 | + | ||
| 165 | + } else{ | ||
| 166 | + UploadImgModel uploadImgModel = | ||
| 167 | + UploadImgModel(); //图 | ||
| 168 | + _uploadImageProvider.setDynamicValue( | ||
| 169 | + '${data.length}', uploadImgModel); | ||
| 170 | + | ||
| 171 | + AdditionModel additionModel = | ||
| 172 | + AdditionModel(); | ||
| 173 | + // additionModel.content = imgModel.qiniuUrl; | ||
| 174 | + additionModel.type = '1'; | ||
| 175 | + // additionModel.order = data.length; | ||
| 176 | + additionModel.image = uploadImgModel; | ||
| 177 | + // additionModel.image.process = 1; | ||
| 178 | + // additionModel.image.qiniuUrl = | ||
| 179 | + // 'https://inews.gtimg.com/om_bt/OGlQWfsaAoKkuCcMZ2o9IVEPqd-72DQy5EAN02XBHUwfYAA/641'; | ||
| 180 | + | ||
| 181 | + data.add(additionModel); | ||
| 182 | + File compressedFile = await FlutterNativeImage.compressImage( | ||
| 183 | + pickedFile.path, | ||
| 184 | + quality: 50, | ||
| 185 | + percentage: 50); | ||
| 186 | + UploadImgModel imgModel = | ||
| 187 | + _uploadImageProvider.getDynamicValue('${index}'); | ||
| 188 | + setState(() { | ||
| 189 | + if (pickedFile != null) { | ||
| 190 | + imgModel.file = File(pickedFile.path); | ||
| 191 | + imgModel.process = 0.01; | ||
| 192 | + } else { | ||
| 193 | + print('No image selected.'); | ||
| 194 | + } | ||
| 195 | + }); | ||
| 108 | if (pickedFile != null) { | 196 | if (pickedFile != null) { |
| 109 | - imgModel.file = File(pickedFile.path); | ||
| 110 | - imgModel.process = 0.01; | ||
| 111 | - } else { | ||
| 112 | - print('No image selected.'); | 197 | + // if (title == '头像') { |
| 198 | + // _uploadImageProvider.imgSizeTouxiang = 76; | ||
| 199 | + // _uploadImageProvider.touxiang.qiniuUrl = null; | ||
| 200 | + // } else { | ||
| 201 | + // _uploadImageProvider.imgSizeErweima = 76; | ||
| 202 | + imgModel.qiniuUrl = null; | ||
| 203 | + // } | ||
| 204 | + bool need = await Utils.sizeNeed(File(pickedFile.path)); | ||
| 205 | + File file = File(pickedFile.path); | ||
| 206 | + if (need) { | ||
| 207 | + file = File(compressedFile.absolute.path); | ||
| 208 | + } | ||
| 209 | + UploadImageUtil().startUploadOnlyAddition( | ||
| 210 | + context, file, index, true, _uploadImageProvider, () { | ||
| 211 | + UploadImgModel imgModel = | ||
| 212 | + _uploadImageProvider.getDynamicValue('${index}'); | ||
| 213 | + AdditionModel additionModel = AdditionModel(); | ||
| 214 | + additionModel.content = imgModel.qiniuUrl; | ||
| 215 | + additionModel.type = '1'; | ||
| 216 | + // additionModel.order = index; | ||
| 217 | + additionModel.image = imgModel; | ||
| 218 | + // additionModel.image.process = 1; | ||
| 219 | + // additionModel.image.qiniuUrl = | ||
| 220 | + // 'https://inews.gtimg.com/om_bt/OGlQWfsaAoKkuCcMZ2o9IVEPqd-72DQy5EAN02XBHUwfYAA/641'; | ||
| 221 | + | ||
| 222 | + data[index] = additionModel; | ||
| 223 | + setState(() {}); | ||
| 224 | + }); | ||
| 113 | } | 225 | } |
| 114 | - }); | ||
| 115 | - if (pickedFile != null) { | ||
| 116 | - // if (title == '头像') { | ||
| 117 | - // _uploadImageProvider.imgSizeTouxiang = 76; | ||
| 118 | - // _uploadImageProvider.touxiang.qiniuUrl = null; | ||
| 119 | - // } else { | ||
| 120 | - // _uploadImageProvider.imgSizeErweima = 76; | ||
| 121 | - imgModel.qiniuUrl = null; | ||
| 122 | - // } | ||
| 123 | - bool need = await Utils.sizeNeed(File(pickedFile.path)); | ||
| 124 | - File file = File(pickedFile.path); | ||
| 125 | - if (need) { | ||
| 126 | - file = File(compressedFile.absolute.path); | 226 | + } |
| 227 | + } | ||
| 228 | + | ||
| 229 | + List<Widget> _scrolleWidget() { | ||
| 230 | + List<Widget> temp = []; | ||
| 231 | + for (AdditionModel item in data) { | ||
| 232 | + if (item.type == '1') { | ||
| 233 | + if (item.image.qiniuUrl == null && item.image.file == null) { | ||
| 234 | + } else { | ||
| 235 | + temp.add(Container( | ||
| 236 | + key: ValueKey(item), | ||
| 237 | + child: InkWell( | ||
| 238 | + onTap: () { | ||
| 239 | + // double process; | ||
| 240 | + // String qiniuUrl; | ||
| 241 | + // List<String> tempList = []; | ||
| 242 | + // // if (title == '头像') { | ||
| 243 | + // process = item.image.process; | ||
| 244 | + // qiniuUrl = item.image.qiniuUrl; | ||
| 245 | + // // } else { | ||
| 246 | + // // process = _uploadImageProvider.erweima.process; | ||
| 247 | + // // qiniuUrl = _uploadImageProvider.erweima.qiniuUrl; | ||
| 248 | + // // } | ||
| 249 | + | ||
| 250 | + // if (qiniuUrl != null && | ||
| 251 | + // qiniuUrl != '') { | ||
| 252 | + // // tempList.add(qiniuUrl); | ||
| 253 | + | ||
| 254 | + // // ///没有上传完成的不可以点击 | ||
| 255 | + // // _showPhotoView(context, 0, tempList); | ||
| 256 | + | ||
| 257 | + // // _uploadImageProvider.firstImage.qiniuUrl = null; | ||
| 258 | + // // _uploadImageProvider.firstImage.process = 0; | ||
| 259 | + // // setState(() {}); | ||
| 260 | + // _openModalBottomSheet(context); | ||
| 261 | + // // Utils.getPickPermission(context, () { | ||
| 262 | + // // _getFromPictureOrCamera( | ||
| 263 | + // // _uploadImageProvider.firstImage, | ||
| 264 | + // // ImageSource.gallery); | ||
| 265 | + // // }, | ||
| 266 | + // // Platform.isAndroid | ||
| 267 | + // // ? Permission.storage | ||
| 268 | + // // : Permission.photos); | ||
| 269 | + // } | ||
| 270 | + }, | ||
| 271 | + child: Stack(alignment: Alignment.bottomCenter, children: [ | ||
| 272 | + Stack(clipBehavior: Clip.none, children: [ | ||
| 273 | + item.image.qiniuUrl != null && item.image.qiniuUrl != '' | ||
| 274 | + ? Image.network( | ||
| 275 | + item.image.qiniuUrl, | ||
| 276 | + fit: BoxFit.contain, | ||
| 277 | + width: double.infinity, | ||
| 278 | + // width: ScreenUtil() | ||
| 279 | + // .setWidth(imgSize * 2), | ||
| 280 | + // height: ScreenUtil().setWidth( | ||
| 281 | + // _uploadImageProvider | ||
| 282 | + // .imgSizefirstImage * | ||
| 283 | + // 2), | ||
| 284 | + ) | ||
| 285 | + : Image.file( | ||
| 286 | + item.image.file, | ||
| 287 | + fit: BoxFit.contain, | ||
| 288 | + width: double.infinity, | ||
| 289 | + // width: ScreenUtil() | ||
| 290 | + // .setWidth(imgSize * 2), | ||
| 291 | + // height: ScreenUtil().setWidth( | ||
| 292 | + // _uploadImageProvider | ||
| 293 | + // .imgSizefirstImage * | ||
| 294 | + // 2), | ||
| 295 | + ), | ||
| 296 | + Positioned( | ||
| 297 | + left: 0, | ||
| 298 | + top: 0, | ||
| 299 | + child: (item.image.file != null) && | ||
| 300 | + item.image.process != 1 && | ||
| 301 | + item.image.process != 0.01 | ||
| 302 | + ? Container( | ||
| 303 | + width: ScreenUtil().screenWidth, | ||
| 304 | + height: | ||
| 305 | + w(_uploadImageProvider.imgSizefirstImage), | ||
| 306 | + color: MyColours.color_4D000000, | ||
| 307 | + child: Center( | ||
| 308 | + child: Text('上传中', | ||
| 309 | + style: TextStyle( | ||
| 310 | + color: MyColours.color_F8F9FD)), | ||
| 311 | + ), | ||
| 312 | + ) | ||
| 313 | + : Container()), | ||
| 314 | + ]), | ||
| 315 | + // item.image.process == 1 | ||
| 316 | + // ? Container( | ||
| 317 | + // width: w(150), | ||
| 318 | + // height: w(30), | ||
| 319 | + // color: MyColours.color_4D000000, | ||
| 320 | + // alignment: Alignment.center, | ||
| 321 | + // child: Text( | ||
| 322 | + // '点击图片可以更换', | ||
| 323 | + // style: TextStyle( | ||
| 324 | + // color: MyColours | ||
| 325 | + // .color_F8F9FD, | ||
| 326 | + // fontSize: font(14), | ||
| 327 | + // fontWeight: | ||
| 328 | + // FontWeight.bold), | ||
| 329 | + // )) | ||
| 330 | + // : SizedBox(), | ||
| 331 | + item.image.process == 1 | ||
| 332 | + ? Positioned( | ||
| 333 | + top: w(15), | ||
| 334 | + right: w(15), | ||
| 335 | + child: InkWell( | ||
| 336 | + onTap: () { | ||
| 337 | + data.remove(item); | ||
| 338 | + setState(() {}); | ||
| 339 | + }, | ||
| 340 | + child: Container( | ||
| 341 | + width: w(30), | ||
| 342 | + height: w(30), | ||
| 343 | + color: Colors.transparent, | ||
| 344 | + alignment: Alignment.center, | ||
| 345 | + child: Image.asset( | ||
| 346 | + Utils.getImgPath('add_close'))))) | ||
| 347 | + : SizedBox(), | ||
| 348 | + ])))); | ||
| 349 | + } | ||
| 350 | + } else { | ||
| 351 | + temp.add(Container( | ||
| 352 | + key: ValueKey(item), | ||
| 353 | + decoration: BoxDecoration( | ||
| 354 | + border: Border.all(width: w(1), color: MyColours.color_DBDBDB)), | ||
| 355 | + // child: Text(item.content), | ||
| 356 | + | ||
| 357 | + // color: Colors.red, | ||
| 358 | + child: Stack( | ||
| 359 | + children: [ | ||
| 360 | + Container( | ||
| 361 | + // height: w(152), | ||
| 362 | + decoration: BoxDecoration( | ||
| 363 | + borderRadius: BorderRadius.circular(r(5)), | ||
| 364 | + border: Border.all( | ||
| 365 | + width: w(1), color: MyColours.color_DBDBDB)), | ||
| 366 | + margin: EdgeInsets.only( | ||
| 367 | + left: w(10), top: w(10), bottom: w(10), right: w(60)), | ||
| 368 | + padding: EdgeInsets.only( | ||
| 369 | + top: w(16), bottom: w(16), left: w(14), right: w(10)), | ||
| 370 | + child: TextField( | ||
| 371 | + controller: item.infoC, | ||
| 372 | + // textAlign: TextAlign.right, | ||
| 373 | + // focusNode: _cusdemNode, | ||
| 374 | + style: TextStyle( | ||
| 375 | + color: MyColours.color_515151, | ||
| 376 | + fontSize: ScreenUtil().setSp(28), | ||
| 377 | + // textBaseline: TextBaseline.alphabetic | ||
| 378 | + ), | ||
| 379 | + // textAlignVertical: TextAlignVertical.center, | ||
| 380 | + maxLines: 5, | ||
| 381 | + maxLength: 50, | ||
| 382 | + // inputFormatters: [ | ||
| 383 | + // LengthLimitingTextInputFormatter(10), // 设置输入长度限制 | ||
| 384 | + // ], | ||
| 385 | + decoration: InputDecoration( | ||
| 386 | + hintText: "点击录入文字", | ||
| 387 | + hintStyle: TextStyle( | ||
| 388 | + color: MyColours.color_999999, | ||
| 389 | + fontSize: ScreenUtil().setSp(28), | ||
| 390 | + ), | ||
| 391 | + contentPadding: EdgeInsets.zero, | ||
| 392 | + border: OutlineInputBorder(borderSide: BorderSide.none), | ||
| 393 | + ), | ||
| 394 | + keyboardType: TextInputType.text, | ||
| 395 | + onChanged: (value) { | ||
| 396 | + item.content = value; | ||
| 397 | + })), | ||
| 398 | + Positioned( | ||
| 399 | + top: w(10), | ||
| 400 | + right: w(10), | ||
| 401 | + child: InkWell( | ||
| 402 | + onTap: () { | ||
| 403 | + data.remove(item); | ||
| 404 | + setState(() {}); | ||
| 405 | + }, | ||
| 406 | + child: Container( | ||
| 407 | + width: w(30), | ||
| 408 | + height: w(30), | ||
| 409 | + color: Colors.transparent, | ||
| 410 | + alignment: Alignment.center, | ||
| 411 | + child: Image.asset(Utils.getImgPath('add_close_b'))))) | ||
| 412 | + ], | ||
| 413 | + ), | ||
| 414 | + )); | ||
| 127 | } | 415 | } |
| 128 | - UploadImageUtil().startUploadOnlyAddition( | ||
| 129 | - context, file, index, true, _uploadImageProvider, () { | ||
| 130 | - UploadImgModel imgModel = | ||
| 131 | - _uploadImageProvider.getDynamicValue('${index}'); | ||
| 132 | - AdditionModel additionModel = AdditionModel(); | ||
| 133 | - additionModel.content = imgModel.qiniuUrl; | ||
| 134 | - additionModel.type = '1'; | ||
| 135 | - // additionModel.order = index; | ||
| 136 | - additionModel.image = imgModel; | ||
| 137 | - // additionModel.image.process = 1; | ||
| 138 | - // additionModel.image.qiniuUrl = | ||
| 139 | - // 'https://inews.gtimg.com/om_bt/OGlQWfsaAoKkuCcMZ2o9IVEPqd-72DQy5EAN02XBHUwfYAA/641'; | ||
| 140 | - | ||
| 141 | - data[index] = additionModel; | ||
| 142 | - setState(() {}); | ||
| 143 | - }); | ||
| 144 | } | 416 | } |
| 417 | + return temp; | ||
| 145 | } | 418 | } |
| 146 | 419 | ||
| 147 | ///添加图片UI弹出 | 420 | ///添加图片UI弹出 |
| @@ -253,6 +526,8 @@ class _InvicationAdditionPageState extends State<InvicationAdditionPage> { | @@ -253,6 +526,8 @@ class _InvicationAdditionPageState extends State<InvicationAdditionPage> { | ||
| 253 | Widget build(BuildContext context) { | 526 | Widget build(BuildContext context) { |
| 254 | _uploadImageProvider = | 527 | _uploadImageProvider = |
| 255 | Provider.of<UploadImageProvider>(context, listen: true); | 528 | Provider.of<UploadImageProvider>(context, listen: true); |
| 529 | + marketingCenterProvider = | ||
| 530 | + Provider.of<MarketingCenterProvider>(context, listen: true); | ||
| 256 | return Scaffold( | 531 | return Scaffold( |
| 257 | backgroundColor: MyColours.color_ffffff, | 532 | backgroundColor: MyColours.color_ffffff, |
| 258 | appBar: SystemAppBar('自定义图文'), | 533 | appBar: SystemAppBar('自定义图文'), |
| @@ -291,9 +566,10 @@ class _InvicationAdditionPageState extends State<InvicationAdditionPage> { | @@ -291,9 +566,10 @@ class _InvicationAdditionPageState extends State<InvicationAdditionPage> { | ||
| 291 | ), | 566 | ), |
| 292 | // textAlignVertical: TextAlignVertical.center, | 567 | // textAlignVertical: TextAlignVertical.center, |
| 293 | maxLines: 1, | 568 | maxLines: 1, |
| 294 | - // inputFormatters: [ | ||
| 295 | - // LengthLimitingTextInputFormatter(10), // 设置输入长度限制 | ||
| 296 | - // ], | 569 | + inputFormatters: [ |
| 570 | + LengthLimitingTextInputFormatter( | ||
| 571 | + 10), // 设置输入长度限制 | ||
| 572 | + ], | ||
| 297 | decoration: InputDecoration( | 573 | decoration: InputDecoration( |
| 298 | hintText: "点击输入区域标题(不超过10个字)", | 574 | hintText: "点击输入区域标题(不超过10个字)", |
| 299 | hintStyle: TextStyle( | 575 | hintStyle: TextStyle( |
| @@ -327,251 +603,13 @@ class _InvicationAdditionPageState extends State<InvicationAdditionPage> { | @@ -327,251 +603,13 @@ class _InvicationAdditionPageState extends State<InvicationAdditionPage> { | ||
| 327 | child: ReorderableListView( | 603 | child: ReorderableListView( |
| 328 | shrinkWrap: true, | 604 | shrinkWrap: true, |
| 329 | scrollController: controller, | 605 | scrollController: controller, |
| 330 | - children: <Widget>[ | ||
| 331 | - for (AdditionModel item in data) | ||
| 332 | - item.type == '1' | ||
| 333 | - ? item.image.qiniuUrl == null && | ||
| 334 | - item.image.file == null | ||
| 335 | - ? SizedBox() | ||
| 336 | - : Container( | ||
| 337 | - key: ValueKey(item), | ||
| 338 | - child: InkWell( | ||
| 339 | - onTap: () { | ||
| 340 | - // double process; | ||
| 341 | - // String qiniuUrl; | ||
| 342 | - // List<String> tempList = []; | ||
| 343 | - // // if (title == '头像') { | ||
| 344 | - // process = item.image.process; | ||
| 345 | - // qiniuUrl = item.image.qiniuUrl; | ||
| 346 | - // // } else { | ||
| 347 | - // // process = _uploadImageProvider.erweima.process; | ||
| 348 | - // // qiniuUrl = _uploadImageProvider.erweima.qiniuUrl; | ||
| 349 | - // // } | ||
| 350 | - | ||
| 351 | - // if (qiniuUrl != null && | ||
| 352 | - // qiniuUrl != '') { | ||
| 353 | - // // tempList.add(qiniuUrl); | ||
| 354 | - | ||
| 355 | - // // ///没有上传完成的不可以点击 | ||
| 356 | - // // _showPhotoView(context, 0, tempList); | ||
| 357 | - | ||
| 358 | - // // _uploadImageProvider.firstImage.qiniuUrl = null; | ||
| 359 | - // // _uploadImageProvider.firstImage.process = 0; | ||
| 360 | - // // setState(() {}); | ||
| 361 | - // _openModalBottomSheet(context); | ||
| 362 | - // // Utils.getPickPermission(context, () { | ||
| 363 | - // // _getFromPictureOrCamera( | ||
| 364 | - // // _uploadImageProvider.firstImage, | ||
| 365 | - // // ImageSource.gallery); | ||
| 366 | - // // }, | ||
| 367 | - // // Platform.isAndroid | ||
| 368 | - // // ? Permission.storage | ||
| 369 | - // // : Permission.photos); | ||
| 370 | - // } | ||
| 371 | - }, | ||
| 372 | - child: Stack( | ||
| 373 | - alignment: Alignment | ||
| 374 | - .bottomCenter, | ||
| 375 | - children: [ | ||
| 376 | - Stack( | ||
| 377 | - clipBehavior: | ||
| 378 | - Clip.none, | ||
| 379 | - children: [ | ||
| 380 | - item.image.qiniuUrl != | ||
| 381 | - null && | ||
| 382 | - item.image | ||
| 383 | - .qiniuUrl != | ||
| 384 | - '' | ||
| 385 | - ? Image | ||
| 386 | - .network( | ||
| 387 | - item.image | ||
| 388 | - .qiniuUrl, | ||
| 389 | - fit: BoxFit | ||
| 390 | - .contain, | ||
| 391 | - width: double | ||
| 392 | - .infinity, | ||
| 393 | - // width: ScreenUtil() | ||
| 394 | - // .setWidth(imgSize * 2), | ||
| 395 | - // height: ScreenUtil().setWidth( | ||
| 396 | - // _uploadImageProvider | ||
| 397 | - // .imgSizefirstImage * | ||
| 398 | - // 2), | ||
| 399 | - ) | ||
| 400 | - : Image.file( | ||
| 401 | - item.image | ||
| 402 | - .file, | ||
| 403 | - fit: BoxFit | ||
| 404 | - .contain, | ||
| 405 | - width: double | ||
| 406 | - .infinity, | ||
| 407 | - // width: ScreenUtil() | ||
| 408 | - // .setWidth(imgSize * 2), | ||
| 409 | - // height: ScreenUtil().setWidth( | ||
| 410 | - // _uploadImageProvider | ||
| 411 | - // .imgSizefirstImage * | ||
| 412 | - // 2), | ||
| 413 | - ), | ||
| 414 | - Positioned( | ||
| 415 | - left: 0, | ||
| 416 | - top: 0, | ||
| 417 | - child: (item.image.file != null) && | ||
| 418 | - item.image.process != | ||
| 419 | - 1 && | ||
| 420 | - item.image.process != | ||
| 421 | - 0.01 | ||
| 422 | - ? Container( | ||
| 423 | - width: | ||
| 424 | - ScreenUtil().screenWidth, | ||
| 425 | - height: | ||
| 426 | - w(_uploadImageProvider.imgSizefirstImage), | ||
| 427 | - color: | ||
| 428 | - MyColours.color_4D000000, | ||
| 429 | - child: | ||
| 430 | - Center( | ||
| 431 | - child: | ||
| 432 | - Text('上传中', style: TextStyle(color: MyColours.color_F8F9FD)), | ||
| 433 | - ), | ||
| 434 | - ) | ||
| 435 | - : Container()), | ||
| 436 | - ]), | ||
| 437 | - // item.image.process == 1 | ||
| 438 | - // ? Container( | ||
| 439 | - // width: w(150), | ||
| 440 | - // height: w(30), | ||
| 441 | - // color: MyColours.color_4D000000, | ||
| 442 | - // alignment: Alignment.center, | ||
| 443 | - // child: Text( | ||
| 444 | - // '点击图片可以更换', | ||
| 445 | - // style: TextStyle( | ||
| 446 | - // color: MyColours | ||
| 447 | - // .color_F8F9FD, | ||
| 448 | - // fontSize: font(14), | ||
| 449 | - // fontWeight: | ||
| 450 | - // FontWeight.bold), | ||
| 451 | - // )) | ||
| 452 | - // : SizedBox(), | ||
| 453 | - item.image.process == 1 | ||
| 454 | - ? Positioned( | ||
| 455 | - top: w(15), | ||
| 456 | - right: w(15), | ||
| 457 | - child: InkWell( | ||
| 458 | - onTap: () { | ||
| 459 | - data.remove( | ||
| 460 | - item); | ||
| 461 | - setState( | ||
| 462 | - () {}); | ||
| 463 | - }, | ||
| 464 | - child: Container( | ||
| 465 | - width: w( | ||
| 466 | - 30), | ||
| 467 | - height: w( | ||
| 468 | - 30), | ||
| 469 | - color: Colors | ||
| 470 | - .transparent, | ||
| 471 | - alignment: | ||
| 472 | - Alignment | ||
| 473 | - .center, | ||
| 474 | - child: Image.asset( | ||
| 475 | - Utils.getImgPath('add_close'))))) | ||
| 476 | - : SizedBox(), | ||
| 477 | - ]))) | ||
| 478 | - : Container( | ||
| 479 | - key: ValueKey(item), | ||
| 480 | - decoration: BoxDecoration( | ||
| 481 | - border: Border.all( | ||
| 482 | - width: w(1), | ||
| 483 | - color: | ||
| 484 | - MyColours.color_DBDBDB)), | ||
| 485 | - // child: Text(item.content), | ||
| 486 | - | ||
| 487 | - // color: Colors.red, | ||
| 488 | - child: Stack( | ||
| 489 | - children: [ | ||
| 490 | - Container( | ||
| 491 | - // height: w(152), | ||
| 492 | - decoration: BoxDecoration( | ||
| 493 | - borderRadius: | ||
| 494 | - BorderRadius.circular( | ||
| 495 | - r(5)), | ||
| 496 | - border: Border.all( | ||
| 497 | - width: w(1), | ||
| 498 | - color: MyColours | ||
| 499 | - .color_DBDBDB)), | ||
| 500 | - margin: EdgeInsets.only( | ||
| 501 | - left: w(10), | ||
| 502 | - top: w(10), | ||
| 503 | - bottom: w(10), | ||
| 504 | - right: w(60)), | ||
| 505 | - padding: EdgeInsets.only( | ||
| 506 | - top: w(16), | ||
| 507 | - bottom: w(16), | ||
| 508 | - left: w(14), | ||
| 509 | - right: w(10)), | ||
| 510 | - child: TextField( | ||
| 511 | - controller: item.infoC, | ||
| 512 | - // textAlign: TextAlign.right, | ||
| 513 | - // focusNode: _cusdemNode, | ||
| 514 | - style: TextStyle( | ||
| 515 | - color: MyColours | ||
| 516 | - .color_515151, | ||
| 517 | - fontSize: ScreenUtil() | ||
| 518 | - .setSp(28), | ||
| 519 | - // textBaseline: TextBaseline.alphabetic | ||
| 520 | - ), | ||
| 521 | - // textAlignVertical: TextAlignVertical.center, | ||
| 522 | - maxLines: 5, | ||
| 523 | - maxLength: 50, | ||
| 524 | - // inputFormatters: [ | ||
| 525 | - // LengthLimitingTextInputFormatter(10), // 设置输入长度限制 | ||
| 526 | - // ], | ||
| 527 | - decoration: | ||
| 528 | - InputDecoration( | ||
| 529 | - hintText: "点击录入文字", | ||
| 530 | - hintStyle: TextStyle( | ||
| 531 | - color: MyColours | ||
| 532 | - .color_999999, | ||
| 533 | - fontSize: ScreenUtil() | ||
| 534 | - .setSp(28), | ||
| 535 | - ), | ||
| 536 | - contentPadding: | ||
| 537 | - EdgeInsets.zero, | ||
| 538 | - border: | ||
| 539 | - OutlineInputBorder( | ||
| 540 | - borderSide: | ||
| 541 | - BorderSide | ||
| 542 | - .none), | ||
| 543 | - ), | ||
| 544 | - keyboardType: | ||
| 545 | - TextInputType.text, | ||
| 546 | - onChanged: (value) { | ||
| 547 | - item.content = value; | ||
| 548 | - })), | ||
| 549 | - Positioned( | ||
| 550 | - top: w(10), | ||
| 551 | - right: w(10), | ||
| 552 | - child: InkWell( | ||
| 553 | - onTap: () { | ||
| 554 | - data.remove(item); | ||
| 555 | - setState(() {}); | ||
| 556 | - }, | ||
| 557 | - child: Container( | ||
| 558 | - width: w(30), | ||
| 559 | - height: w(30), | ||
| 560 | - color: Colors | ||
| 561 | - .transparent, | ||
| 562 | - alignment: | ||
| 563 | - Alignment.center, | ||
| 564 | - child: Image.asset( | ||
| 565 | - Utils.getImgPath( | ||
| 566 | - 'add_close_b'))))) | ||
| 567 | - ], | ||
| 568 | - ), | ||
| 569 | - ), | ||
| 570 | - ], | 606 | + children: _scrolleWidget(), |
| 571 | onReorder: (int oldIndex, int newIndex) async { | 607 | onReorder: (int oldIndex, int newIndex) async { |
| 608 | + print(newIndex); | ||
| 572 | if (oldIndex < newIndex) { | 609 | if (oldIndex < newIndex) { |
| 573 | newIndex -= 1; | 610 | newIndex -= 1; |
| 574 | } | 611 | } |
| 612 | + print(newIndex); | ||
| 575 | 613 | ||
| 576 | // var childold = tableManagerModel.areas[oldIndex]; | 614 | // var childold = tableManagerModel.areas[oldIndex]; |
| 577 | // Map<String, String> params = { | 615 | // Map<String, String> params = { |
| @@ -597,24 +635,9 @@ class _InvicationAdditionPageState extends State<InvicationAdditionPage> { | @@ -597,24 +635,9 @@ class _InvicationAdditionPageState extends State<InvicationAdditionPage> { | ||
| 597 | children: [ | 635 | children: [ |
| 598 | InkWell( | 636 | InkWell( |
| 599 | onTap: () { | 637 | onTap: () { |
| 600 | - UploadImgModel uploadImgModel = | ||
| 601 | - UploadImgModel(); //图 | ||
| 602 | - _uploadImageProvider.setDynamicValue( | ||
| 603 | - '${data.length}', uploadImgModel); | ||
| 604 | - | ||
| 605 | - AdditionModel additionModel = | ||
| 606 | - AdditionModel(); | ||
| 607 | - // additionModel.content = imgModel.qiniuUrl; | ||
| 608 | - additionModel.type = '1'; | ||
| 609 | - // additionModel.order = data.length; | ||
| 610 | - additionModel.image = uploadImgModel; | ||
| 611 | - // additionModel.image.process = 1; | ||
| 612 | - // additionModel.image.qiniuUrl = | ||
| 613 | - // 'https://inews.gtimg.com/om_bt/OGlQWfsaAoKkuCcMZ2o9IVEPqd-72DQy5EAN02XBHUwfYAA/641'; | ||
| 614 | - | ||
| 615 | - data.add(additionModel); | 638 | + |
| 616 | _openModalBottomSheet( | 639 | _openModalBottomSheet( |
| 617 | - context, data.length - 1); | 640 | + context, data.length); |
| 618 | }, | 641 | }, |
| 619 | child: Container( | 642 | child: Container( |
| 620 | width: w(77), | 643 | width: w(77), |
| @@ -700,11 +723,55 @@ class _InvicationAdditionPageState extends State<InvicationAdditionPage> { | @@ -700,11 +723,55 @@ class _InvicationAdditionPageState extends State<InvicationAdditionPage> { | ||
| 700 | gradientEnd: MyColours.color_438E93, | 723 | gradientEnd: MyColours.color_438E93, |
| 701 | textColor: MyColours.color_ffffff, | 724 | textColor: MyColours.color_ffffff, |
| 702 | borderColor: MyColours.color_438E93, | 725 | borderColor: MyColours.color_438E93, |
| 703 | - onPressed: () { | 726 | + onPressed: () async { |
| 704 | // _createReserveDeposit(); | 727 | // _createReserveDeposit(); |
| 728 | + // print(data); | ||
| 729 | + // print(titleC.text); | ||
| 705 | print(data); | 730 | print(data); |
| 706 | - print(titleC.text); | ||
| 707 | - print(data); | 731 | + |
| 732 | + bool can = true; | ||
| 733 | + innerloop: | ||
| 734 | + for (AdditionModel item in data) { | ||
| 735 | + if (item.type == '1' && item.image.process < 1) { | ||
| 736 | + Utils.showToast('正在上传图片,请稍等'); | ||
| 737 | + // return false; | ||
| 738 | + can = false; | ||
| 739 | + break innerloop; | ||
| 740 | + } | ||
| 741 | + } | ||
| 742 | + data.removeWhere((element) => element.type == '2'&& (element.infoC.text.trim() == ''||element.infoC.text ==null) ); | ||
| 743 | + if (can) { | ||
| 744 | + List temp = []; | ||
| 745 | + for (int i = 0; i < data.length; i++) { | ||
| 746 | + AdditionModel element = data[i]; | ||
| 747 | + temp.add({ | ||
| 748 | + 'type': element.type, | ||
| 749 | + 'content': element.type == '2' | ||
| 750 | + ? element.infoC.text | ||
| 751 | + : element.image.qiniuUrl, | ||
| 752 | + }); | ||
| 753 | + } | ||
| 754 | + | ||
| 755 | + Map<String, String> params = { | ||
| 756 | + 'rid': widget.rid, | ||
| 757 | + 'uid': Provider.of<UserModel>(context, listen: false) | ||
| 758 | + .user | ||
| 759 | + .openid, | ||
| 760 | + 'title': titleC.text, | ||
| 761 | + 'content': jsonEncode(temp) | ||
| 762 | + }; | ||
| 763 | + | ||
| 764 | + if (marketingCenterProvider.reserveImgText != null) { | ||
| 765 | + params['id'] = | ||
| 766 | + marketingCenterProvider.reserveImgText.id; | ||
| 767 | + } | ||
| 768 | + bool success = await marketingCenterProvider.setReserveImgText( | ||
| 769 | + context, params); | ||
| 770 | + if (success){ | ||
| 771 | + bus.emit('getReserveImgText'); | ||
| 772 | + Navigator.pop(context); | ||
| 773 | + } | ||
| 774 | + } | ||
| 708 | }, | 775 | }, |
| 709 | )), | 776 | )), |
| 710 | ], | 777 | ], |
| @@ -186,6 +186,7 @@ class InvicationPageState extends State<InvicationPage> | @@ -186,6 +186,7 @@ class InvicationPageState extends State<InvicationPage> | ||
| 186 | String smsContent = ''; | 186 | String smsContent = ''; |
| 187 | 187 | ||
| 188 | MarketingCenterProvider marketingCenterProvider; | 188 | MarketingCenterProvider marketingCenterProvider; |
| 189 | + String additionTitle = '点击设置本单追加的自定义图文'; | ||
| 189 | 190 | ||
| 190 | @override | 191 | @override |
| 191 | void initState() { | 192 | void initState() { |
| @@ -286,6 +287,7 @@ class InvicationPageState extends State<InvicationPage> | @@ -286,6 +287,7 @@ class InvicationPageState extends State<InvicationPage> | ||
| 286 | affinity: TextAffinity.downstream, | 287 | affinity: TextAffinity.downstream, |
| 287 | offset: value.toString().length))); | 288 | offset: value.toString().length))); |
| 288 | }); | 289 | }); |
| 290 | + getReserveImgText(); | ||
| 289 | 291 | ||
| 290 | // await _couponNetworkData(isShowLoading: false); | 292 | // await _couponNetworkData(isShowLoading: false); |
| 291 | await _getCustomerActivityBaseinfo(); | 293 | await _getCustomerActivityBaseinfo(); |
| @@ -314,12 +316,23 @@ class InvicationPageState extends State<InvicationPage> | @@ -314,12 +316,23 @@ class InvicationPageState extends State<InvicationPage> | ||
| 314 | bus.on("getDzSellerConf", (args) { | 316 | bus.on("getDzSellerConf", (args) { |
| 315 | getDzSellerConf(); | 317 | getDzSellerConf(); |
| 316 | }); | 318 | }); |
| 319 | + bus.on("getReserveImgText", (args) { | ||
| 320 | + getReserveImgText(); | ||
| 321 | + }); | ||
| 317 | 322 | ||
| 318 | // Utils.changeStatusColor(color: Colors.transparent); | 323 | // Utils.changeStatusColor(color: Colors.transparent); |
| 319 | 324 | ||
| 320 | user = Provider.of<UserModel>(context, listen: false).user; | 325 | user = Provider.of<UserModel>(context, listen: false).user; |
| 321 | } | 326 | } |
| 322 | 327 | ||
| 328 | + getReserveImgText() async { | ||
| 329 | + await marketingCenterProvider.getReserveImgText(context, widget.rid); | ||
| 330 | + if (marketingCenterProvider.reserveImgText != null) { | ||
| 331 | + additionTitle = marketingCenterProvider.reserveImgText.title; | ||
| 332 | + setState(() {}); | ||
| 333 | + } | ||
| 334 | + } | ||
| 335 | + | ||
| 323 | getDzSellerConf() async { | 336 | getDzSellerConf() async { |
| 324 | bool success = await marketingCenterProvider.getDzSellerConf(context); | 337 | bool success = await marketingCenterProvider.getDzSellerConf(context); |
| 325 | if (success && marketingCenterProvider.dzSellerConfModel != null) { | 338 | if (success && marketingCenterProvider.dzSellerConfModel != null) { |
| @@ -429,6 +442,8 @@ class InvicationPageState extends State<InvicationPage> | @@ -429,6 +442,8 @@ class InvicationPageState extends State<InvicationPage> | ||
| 429 | bus.off("refresh_invitaion_info"); | 442 | bus.off("refresh_invitaion_info"); |
| 430 | bus.off("refresh_photo_invication"); | 443 | bus.off("refresh_photo_invication"); |
| 431 | bus.off("getDzSellerConf"); | 444 | bus.off("getDzSellerConf"); |
| 445 | + bus.off("getReserveImgText"); | ||
| 446 | + | ||
| 432 | 447 | ||
| 433 | WidgetsBinding.instance.removeObserver(this); //销毁观察者 | 448 | WidgetsBinding.instance.removeObserver(this); //销毁观察者 |
| 434 | if (_timer != null) { | 449 | if (_timer != null) { |
| @@ -2567,97 +2582,52 @@ class InvicationPageState extends State<InvicationPage> | @@ -2567,97 +2582,52 @@ class InvicationPageState extends State<InvicationPage> | ||
| 2567 | ) | 2582 | ) |
| 2568 | ], | 2583 | ], |
| 2569 | )), | 2584 | )), |
| 2570 | - // InkWell( | ||
| 2571 | - // onTap: () { | ||
| 2572 | - // FocusScope.of(context) | ||
| 2573 | - // .requestFocus(FocusNode()); //隐藏键盘 | ||
| 2574 | - | ||
| 2575 | - // //跳转到新页面 | ||
| 2576 | - | ||
| 2577 | - // NavigatorUtil.goInvicationAdditionPage(context); | ||
| 2578 | - | ||
| 2579 | - // }, | ||
| 2580 | - // child: Container( | ||
| 2581 | - // margin: EdgeInsets.only( | ||
| 2582 | - // // top: ScreenUtil().setWidth(40), | ||
| 2583 | - // bottom: ScreenUtil().setWidth(40)), | ||
| 2584 | - // height: ScreenUtil().setWidth(68), | ||
| 2585 | - // padding: EdgeInsets.symmetric( | ||
| 2586 | - // horizontal: ScreenUtil().setWidth(16)), | ||
| 2587 | - // decoration: BoxDecoration( | ||
| 2588 | - // borderRadius: BorderRadius.circular( | ||
| 2589 | - // ScreenUtil().setWidth(12)), | ||
| 2590 | - // // color: Colors.red, | ||
| 2591 | - // border: Border.all( | ||
| 2592 | - // width: ScreenUtil().setWidth(2), | ||
| 2593 | - // color: MyColours.color_DBDBDB)), | ||
| 2594 | - // child: Row( | ||
| 2595 | - // mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 2596 | - // crossAxisAlignment: CrossAxisAlignment.center, | ||
| 2597 | - // children: [ | ||
| 2598 | - // Text( | ||
| 2599 | - // '自定义图文:', | ||
| 2600 | - // style: TextStyle( | ||
| 2601 | - // fontSize: ScreenUtil().setSp(28), | ||
| 2602 | - // color: MyColours.color_515151), | ||
| 2603 | - // ), | ||
| 2604 | - | ||
| 2605 | - // Expanded( | ||
| 2606 | - // child: Text( | ||
| 2607 | - // '点击设置本单追加的自定义图文', | ||
| 2608 | - // textAlign: TextAlign.right, | ||
| 2609 | - // style: TextStyle( | ||
| 2610 | - // fontSize: ScreenUtil().setSp(28), | ||
| 2611 | - // color: MyColours.color_999999), | ||
| 2612 | - // ), | ||
| 2613 | - // ), | ||
| 2614 | - | ||
| 2615 | - // // InkWell( | ||
| 2616 | - // // onTap: () { | ||
| 2617 | - // // FocusScope.of(context) | ||
| 2618 | - // // .requestFocus(FocusNode()); //隐藏键盘 | ||
| 2619 | - // // // 存储 | ||
| 2620 | - | ||
| 2621 | - // // DialogUtil.openDishTypeSelectModalBottomSheet( | ||
| 2622 | - // // context, | ||
| 2623 | - // // detailModel.reserveTypes, | ||
| 2624 | - // // reserveType, rCallback: (value) async { | ||
| 2625 | - // // if (value != null) { | ||
| 2626 | - // // reserveType = value; | ||
| 2627 | - // // setState(() {}); | ||
| 2628 | - // // bool sucess = await detailModel | ||
| 2629 | - // // .upReserveInfo(context, widget.rid, | ||
| 2630 | - // // reserveType: reserveType, | ||
| 2631 | - // // needToast: false); | ||
| 2632 | - // // if (sucess) { | ||
| 2633 | - // // EventBus() | ||
| 2634 | - // // .emit("refresh_tablemanager"); //刷新桌位 | ||
| 2635 | - // // bus.emit("refresh_book_list"); //刷新已预订列表 | ||
| 2636 | - // // bus.emit("refresh_detail"); | ||
| 2637 | - // // // await _getReserveDetail( | ||
| 2638 | - // // // showCicle: false); | ||
| 2639 | - // // } | ||
| 2640 | - // // } | ||
| 2641 | - // // }); | ||
| 2642 | - // // }, | ||
| 2643 | - // // child: Row(children: [ | ||
| 2644 | - // // Text( | ||
| 2645 | - // // reserveType, | ||
| 2646 | - // // style: TextStyle( | ||
| 2647 | - // // color: reserveType == '请选择' | ||
| 2648 | - // // ? MyColours.color_999999 | ||
| 2649 | - // // : MyColours.color_515151, | ||
| 2650 | - // // fontSize: ScreenUtil().setSp(28), | ||
| 2651 | - // // ), | ||
| 2652 | - // // ), | ||
| 2653 | - // // HEmptyView(4), | ||
| 2654 | - // // Image.asset(Utils.getImgPath('quan_down_f'), | ||
| 2655 | - // // width: ScreenUtil().setWidth(28), | ||
| 2656 | - // // height: ScreenUtil().setWidth(28)), | ||
| 2657 | - // // ]), | ||
| 2658 | - // // ) | ||
| 2659 | - // ], | ||
| 2660 | - // ))), | 2585 | + InkWell( |
| 2586 | + onTap: () async{ | ||
| 2587 | + FocusScope.of(context) | ||
| 2588 | + .requestFocus(FocusNode()); //隐藏键盘 | ||
| 2589 | + | ||
| 2590 | + //跳转到新页面 | ||
| 2591 | + | ||
| 2592 | + await NavigatorUtil.goInvicationAdditionPage(context, | ||
| 2593 | + rid: widget.rid); | ||
| 2594 | + | ||
| 2595 | + }, | ||
| 2596 | + child: Container( | ||
| 2597 | + margin: EdgeInsets.only( | ||
| 2598 | + // top: ScreenUtil().setWidth(40), | ||
| 2599 | + bottom: ScreenUtil().setWidth(40)), | ||
| 2600 | + height: ScreenUtil().setWidth(68), | ||
| 2601 | + padding: EdgeInsets.symmetric( | ||
| 2602 | + horizontal: ScreenUtil().setWidth(16)), | ||
| 2603 | + decoration: BoxDecoration( | ||
| 2604 | + borderRadius: BorderRadius.circular( | ||
| 2605 | + ScreenUtil().setWidth(12)), | ||
| 2606 | + // color: Colors.red, | ||
| 2607 | + border: Border.all( | ||
| 2608 | + width: ScreenUtil().setWidth(2), | ||
| 2609 | + color: MyColours.color_DBDBDB)), | ||
| 2610 | + child: Row( | ||
| 2611 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 2612 | + crossAxisAlignment: CrossAxisAlignment.center, | ||
| 2613 | + children: [ | ||
| 2614 | + Text( | ||
| 2615 | + '自定义图文:', | ||
| 2616 | + style: TextStyle( | ||
| 2617 | + fontSize: ScreenUtil().setSp(28), | ||
| 2618 | + color: MyColours.color_515151), | ||
| 2619 | + ), | ||
| 2620 | + Expanded( | ||
| 2621 | + child: Text( | ||
| 2622 | + additionTitle, | ||
| 2623 | + textAlign: TextAlign.right, | ||
| 2624 | + style: TextStyle( | ||
| 2625 | + fontSize: ScreenUtil().setSp(28), | ||
| 2626 | + color: MyColours.color_999999), | ||
| 2627 | + ), | ||
| 2628 | + ), | ||
| 2629 | + ], | ||
| 2630 | + ))), | ||
| 2661 | //输入框 | 2631 | //输入框 |
| 2662 | Container( | 2632 | Container( |
| 2663 | width: double.infinity, | 2633 | width: double.infinity, |
| @@ -9,6 +9,7 @@ import '../constant/error.dart'; | @@ -9,6 +9,7 @@ import '../constant/error.dart'; | ||
| 9 | import '../models/GetDzSellerConfModel.dart'; | 9 | import '../models/GetDzSellerConfModel.dart'; |
| 10 | import '../models/mark_data_model.dart'; | 10 | import '../models/mark_data_model.dart'; |
| 11 | import '../models/recharge_notice_model.dart'; | 11 | import '../models/recharge_notice_model.dart'; |
| 12 | +import '../models/reserve_img_text.dart'; | ||
| 12 | import '../models/sai_you_yun_change_model.dart'; | 13 | import '../models/sai_you_yun_change_model.dart'; |
| 13 | import '../models/sai_you_yun_model.dart'; | 14 | import '../models/sai_you_yun_model.dart'; |
| 14 | import '../models/seller_template_color_list_model.dart'; | 15 | import '../models/seller_template_color_list_model.dart'; |
| @@ -51,6 +52,61 @@ class MarketingCenterProvider extends ChangeNotifier { | @@ -51,6 +52,61 @@ class MarketingCenterProvider extends ChangeNotifier { | ||
| 51 | List<SmsChangeFieldSunModel> smsChangeFieldData = []; // 获取可变模板允许配置字段 | 52 | List<SmsChangeFieldSunModel> smsChangeFieldData = []; // 获取可变模板允许配置字段 |
| 52 | bool phoneSwich = true; | 53 | bool phoneSwich = true; |
| 53 | bool nameSwich = true; | 54 | bool nameSwich = true; |
| 55 | + ReserveImgTextSunModel reserveImgText; | ||
| 56 | + | ||
| 57 | + // 获取预订详情自定义图文 | ||
| 58 | + | ||
| 59 | + Future<bool> getReserveImgText(BuildContext context,String rid, | ||
| 60 | + {bool showLoading = true}) async { | ||
| 61 | + Map<String, String> params = { | ||
| 62 | + 'rid': rid | ||
| 63 | + }; | ||
| 64 | + BaseResp<dynamic> baseResp = await DioUtil() | ||
| 65 | + .request<dynamic>(context, Method.post, HttpUrl.get_reserve_img_text, | ||
| 66 | + data: params, showLoading: showLoading) | ||
| 67 | + .catchError((error) { | ||
| 68 | + print(error.toString()); | ||
| 69 | + Utils.showToast('请求失败,请重试'); | ||
| 70 | + return false; | ||
| 71 | + }); | ||
| 72 | + if (baseResp.code == Constant.status_success) { | ||
| 73 | + if (baseResp.data is bool) { | ||
| 74 | + // 没有设置数据 | ||
| 75 | + } else { | ||
| 76 | + reserveImgText = | ||
| 77 | + ReserveImgTextModel.fromJson(baseResp.responseData).data; | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | + return true; | ||
| 81 | + } else { | ||
| 82 | + Utils.showToast(baseResp.msg ?? '请求失败,请重试'); | ||
| 83 | + } | ||
| 84 | + return false; | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + // 保存预订详情自定义图文 | ||
| 88 | + Future<bool> setReserveImgText( | ||
| 89 | + BuildContext context, Map<String, String> params, | ||
| 90 | + {bool showLoading = true}) async { | ||
| 91 | + BaseResp<dynamic> baseResp = await DioUtil() | ||
| 92 | + .request<dynamic>(context, Method.post, HttpUrl.set_reserve_img_text, | ||
| 93 | + data: params, showLoading: showLoading) | ||
| 94 | + .catchError((error) { | ||
| 95 | + print(error.toString()); | ||
| 96 | + Utils.showToast('设置失败,请重试'); | ||
| 97 | + return false; | ||
| 98 | + }); | ||
| 99 | + if (baseResp.code == Constant.status_success) { | ||
| 100 | + if (baseResp.data is Map || baseResp.data == 1) { | ||
| 101 | + return true; | ||
| 102 | + } else { | ||
| 103 | + Utils.showToast('设置失败,请重试'); | ||
| 104 | + } | ||
| 105 | + } else { | ||
| 106 | + Utils.showToast(baseResp.msg ?? '设置失败,请重试'); | ||
| 107 | + } | ||
| 108 | + return false; | ||
| 109 | + } | ||
| 54 | 110 | ||
| 55 | // 获取赛邮云短信模板列表 (固定模版) | 111 | // 获取赛邮云短信模板列表 (固定模版) |
| 56 | 112 | ||
| @@ -217,7 +273,8 @@ class MarketingCenterProvider extends ChangeNotifier { | @@ -217,7 +273,8 @@ class MarketingCenterProvider extends ChangeNotifier { | ||
| 217 | BuildContext context, Map<String, String> params, | 273 | BuildContext context, Map<String, String> params, |
| 218 | {bool showLoading = true}) async { | 274 | {bool showLoading = true}) async { |
| 219 | BaseResp<dynamic> baseResp = await DioUtil() | 275 | BaseResp<dynamic> baseResp = await DioUtil() |
| 220 | - .request<dynamic>(context, Method.post, HttpUrl.set_seller_template_conf, | 276 | + .request<dynamic>( |
| 277 | + context, Method.post, HttpUrl.set_seller_template_conf, | ||
| 221 | data: params, showLoading: showLoading) | 278 | data: params, showLoading: showLoading) |
| 222 | .catchError((error) { | 279 | .catchError((error) { |
| 223 | print(error.toString()); | 280 | print(error.toString()); |
| @@ -299,7 +356,8 @@ class MarketingCenterProvider extends ChangeNotifier { | @@ -299,7 +356,8 @@ class MarketingCenterProvider extends ChangeNotifier { | ||
| 299 | UserModel userModel = Provider.of<UserModel>(context, listen: false); | 356 | UserModel userModel = Provider.of<UserModel>(context, listen: false); |
| 300 | Map<String, String> params = {"sid": userModel.user.sellerid}; | 357 | Map<String, String> params = {"sid": userModel.user.sellerid}; |
| 301 | BaseResp<dynamic> baseResp = await DioUtil() | 358 | BaseResp<dynamic> baseResp = await DioUtil() |
| 302 | - .request<dynamic>(context, Method.post, HttpUrl.get_seller_template_conf, | 359 | + .request<dynamic>( |
| 360 | + context, Method.post, HttpUrl.get_seller_template_conf, | ||
| 303 | data: params, | 361 | data: params, |
| 304 | showLoading: pageState == PageState.Loading ? false : showLoading) | 362 | showLoading: pageState == PageState.Loading ? false : showLoading) |
| 305 | .catchError((error) { | 363 | .catchError((error) { |
| @@ -89,9 +89,7 @@ class NavigatorUtil { | @@ -89,9 +89,7 @@ class NavigatorUtil { | ||
| 89 | // } | 89 | // } |
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | - | ||
| 93 | - | ||
| 94 | - /// 首页 | 92 | + /// 首页 |
| 95 | static void goHomePageSim(BuildContext context, | 93 | static void goHomePageSim(BuildContext context, |
| 96 | {int initialIndex = 2, | 94 | {int initialIndex = 2, |
| 97 | needRefresh = true, | 95 | needRefresh = true, |
| @@ -117,9 +115,9 @@ class NavigatorUtil { | @@ -117,9 +115,9 @@ class NavigatorUtil { | ||
| 117 | replace: replace); | 115 | replace: replace); |
| 118 | } | 116 | } |
| 119 | 117 | ||
| 120 | - | ||
| 121 | - /// 订单详情 | ||
| 122 | - static void goNotebookDetailPageSim(BuildContext context, String rid, String uid, | 118 | + /// 订单详情 |
| 119 | + static void goNotebookDetailPageSim( | ||
| 120 | + BuildContext context, String rid, String uid, | ||
| 123 | {String mid = "", bool fromNotify = false, replace = false}) { | 121 | {String mid = "", bool fromNotify = false, replace = false}) { |
| 124 | _navigateTo(context, | 122 | _navigateTo(context, |
| 125 | "${Routes.reserve_detail_sim}?rid=$rid&mid=$mid&uid=$uid&fromNotify=$fromNotify", | 123 | "${Routes.reserve_detail_sim}?rid=$rid&mid=$mid&uid=$uid&fromNotify=$fromNotify", |
| @@ -134,10 +132,9 @@ class NavigatorUtil { | @@ -134,10 +132,9 @@ class NavigatorUtil { | ||
| 134 | replace: replace); | 132 | replace: replace); |
| 135 | } | 133 | } |
| 136 | 134 | ||
| 137 | - | ||
| 138 | - | ||
| 139 | - /// 处理在线预订 | ||
| 140 | - static Future goHandleOnlinePageSim(BuildContext context, String rid, String mid, | 135 | + /// 处理在线预订 |
| 136 | + static Future goHandleOnlinePageSim( | ||
| 137 | + BuildContext context, String rid, String mid, | ||
| 141 | {fromNotify = false, replace = false}) { | 138 | {fromNotify = false, replace = false}) { |
| 142 | return _navigateTo(context, | 139 | return _navigateTo(context, |
| 143 | "${Routes.handle_online_page_sim}?rid=$rid&mid=$mid&fromNotify=$fromNotify", | 140 | "${Routes.handle_online_page_sim}?rid=$rid&mid=$mid&fromNotify=$fromNotify", |
| @@ -202,8 +199,7 @@ class NavigatorUtil { | @@ -202,8 +199,7 @@ class NavigatorUtil { | ||
| 202 | _navigateTo(context, "${Routes.invication}?rid=$rid", replace: replace); | 199 | _navigateTo(context, "${Routes.invication}?rid=$rid", replace: replace); |
| 203 | } | 200 | } |
| 204 | 201 | ||
| 205 | - | ||
| 206 | - /// 邀请函 | 202 | + /// 邀请函 |
| 207 | static void goInvicationPageSim(BuildContext context, String rid, | 203 | static void goInvicationPageSim(BuildContext context, String rid, |
| 208 | {bool replace = false}) { | 204 | {bool replace = false}) { |
| 209 | _navigateTo(context, "${Routes.invication_sim}?rid=$rid", replace: replace); | 205 | _navigateTo(context, "${Routes.invication_sim}?rid=$rid", replace: replace); |
| @@ -323,13 +319,13 @@ class NavigatorUtil { | @@ -323,13 +319,13 @@ class NavigatorUtil { | ||
| 323 | /// 创建优惠券 | 319 | /// 创建优惠券 |
| 324 | static Future<dynamic> goCouponEditPage(BuildContext context, | 320 | static Future<dynamic> goCouponEditPage(BuildContext context, |
| 325 | {replace = false, bool isMine = true, CouponSunModel couponSunModel}) { | 321 | {replace = false, bool isMine = true, CouponSunModel couponSunModel}) { |
| 326 | - if(couponSunModel != null){ | ||
| 327 | - return _navigateTo(context, "${Routes.coupon_edit}?isMine=${isMine}&couponSunModel=${FluroConvertUtils.object2string(couponSunModel)}", | ||
| 328 | - replace: replace); | ||
| 329 | - } | ||
| 330 | - return _navigateTo(context, "${Routes.coupon_edit}?isMine=${isMine}", | 322 | + if (couponSunModel != null) { |
| 323 | + return _navigateTo(context, | ||
| 324 | + "${Routes.coupon_edit}?isMine=${isMine}&couponSunModel=${FluroConvertUtils.object2string(couponSunModel)}", | ||
| 325 | + replace: replace); | ||
| 326 | + } | ||
| 327 | + return _navigateTo(context, "${Routes.coupon_edit}?isMine=${isMine}", | ||
| 331 | replace: replace); | 328 | replace: replace); |
| 332 | - | ||
| 333 | } | 329 | } |
| 334 | 330 | ||
| 335 | /// 选择优惠券 | 331 | /// 选择优惠券 |
| @@ -363,10 +359,9 @@ class NavigatorUtil { | @@ -363,10 +359,9 @@ class NavigatorUtil { | ||
| 363 | } | 359 | } |
| 364 | } | 360 | } |
| 365 | 361 | ||
| 366 | - | ||
| 367 | - | ||
| 368 | /// 个人资料页面 | 362 | /// 个人资料页面 |
| 369 | - static Future<dynamic> goBaseInfoPageSim(BuildContext context, FromPage fromPage, | 363 | + static Future<dynamic> goBaseInfoPageSim( |
| 364 | + BuildContext context, FromPage fromPage, | ||
| 370 | {replace = false, CheckSellerAccSunModel sunModel}) { | 365 | {replace = false, CheckSellerAccSunModel sunModel}) { |
| 371 | if (sunModel != null) { | 366 | if (sunModel != null) { |
| 372 | return _navigateTo(context, | 367 | return _navigateTo(context, |
| @@ -556,8 +551,7 @@ class NavigatorUtil { | @@ -556,8 +551,7 @@ class NavigatorUtil { | ||
| 556 | replace: replace); | 551 | replace: replace); |
| 557 | } | 552 | } |
| 558 | 553 | ||
| 559 | - | ||
| 560 | - /// 店铺信息 | 554 | + /// 店铺信息 |
| 561 | static Future<dynamic> goStoreBaseInfoPageSim(BuildContext context, | 555 | static Future<dynamic> goStoreBaseInfoPageSim(BuildContext context, |
| 562 | {replace = false, SmsInfoData smsInfoData}) { | 556 | {replace = false, SmsInfoData smsInfoData}) { |
| 563 | return _navigateTo(context, "${Routes.store_base_info_page_sim}", | 557 | return _navigateTo(context, "${Routes.store_base_info_page_sim}", |
| @@ -627,14 +621,13 @@ class NavigatorUtil { | @@ -627,14 +621,13 @@ class NavigatorUtil { | ||
| 627 | replace: replace); | 621 | replace: replace); |
| 628 | } | 622 | } |
| 629 | 623 | ||
| 630 | - /// 员工管理页面 | 624 | + /// 员工管理页面 |
| 631 | static Future<dynamic> goPersonnelManagePageSim(BuildContext context, | 625 | static Future<dynamic> goPersonnelManagePageSim(BuildContext context, |
| 632 | {replace = false, bool isNew = true, String idstr}) { | 626 | {replace = false, bool isNew = true, String idstr}) { |
| 633 | return _navigateTo(context, "${Routes.personnel_manage_page_sim}", | 627 | return _navigateTo(context, "${Routes.personnel_manage_page_sim}", |
| 634 | replace: replace); | 628 | replace: replace); |
| 635 | } | 629 | } |
| 636 | 630 | ||
| 637 | - | ||
| 638 | /// 员工管理页面 | 631 | /// 员工管理页面 |
| 639 | static Future<dynamic> goPersonnelDetailPage(BuildContext context, | 632 | static Future<dynamic> goPersonnelDetailPage(BuildContext context, |
| 640 | {replace = false, int index, String position}) { | 633 | {replace = false, int index, String position}) { |
| @@ -704,20 +697,16 @@ class NavigatorUtil { | @@ -704,20 +697,16 @@ class NavigatorUtil { | ||
| 704 | replace: replace); | 697 | replace: replace); |
| 705 | } | 698 | } |
| 706 | 699 | ||
| 707 | - | ||
| 708 | - /// 客情列表 | ||
| 709 | - static Future<dynamic> goCustomerListPageSim( | ||
| 710 | - BuildContext context, | 700 | + /// 客情列表 |
| 701 | + static Future<dynamic> goCustomerListPageSim(BuildContext context, | ||
| 711 | {replace = false, | 702 | {replace = false, |
| 712 | bool needBtn = false, | 703 | bool needBtn = false, |
| 713 | String index = '0', | 704 | String index = '0', |
| 714 | bool distribution = false}) { | 705 | bool distribution = false}) { |
| 715 | - return _navigateTo(context, | ||
| 716 | - "${Routes.customer_list_page_sim}", | 706 | + return _navigateTo(context, "${Routes.customer_list_page_sim}", |
| 717 | replace: replace); | 707 | replace: replace); |
| 718 | } | 708 | } |
| 719 | 709 | ||
| 720 | - | ||
| 721 | /// 仅展示客情列表 --- 商家 | 710 | /// 仅展示客情列表 --- 商家 |
| 722 | static Future<dynamic> goShowCustomerListPage( | 711 | static Future<dynamic> goShowCustomerListPage( |
| 723 | BuildContext context, FromPage fromPage, String gid, | 712 | BuildContext context, FromPage fromPage, String gid, |
| @@ -786,13 +775,10 @@ class NavigatorUtil { | @@ -786,13 +775,10 @@ class NavigatorUtil { | ||
| 786 | replace: replace); | 775 | replace: replace); |
| 787 | } | 776 | } |
| 788 | 777 | ||
| 789 | - | ||
| 790 | - | ||
| 791 | /// 客户详情 | 778 | /// 客户详情 |
| 792 | static Future<dynamic> goCustomerDetailPageSim( | 779 | static Future<dynamic> goCustomerDetailPageSim( |
| 793 | BuildContext context, | 780 | BuildContext context, |
| 794 | - CustomerBySellerSunModel userHistoryEntity, | ||
| 795 | - { | 781 | + CustomerBySellerSunModel userHistoryEntity, { |
| 796 | replace = false, | 782 | replace = false, |
| 797 | }) { | 783 | }) { |
| 798 | return _navigateTo(context, | 784 | return _navigateTo(context, |
| @@ -812,12 +798,10 @@ class NavigatorUtil { | @@ -812,12 +798,10 @@ class NavigatorUtil { | ||
| 812 | replace: replace); | 798 | replace: replace); |
| 813 | } | 799 | } |
| 814 | 800 | ||
| 815 | - | ||
| 816 | - ///编辑客户详情 | 801 | + ///编辑客户详情 |
| 817 | static Future<dynamic> goCustomerDetailEditPageSim( | 802 | static Future<dynamic> goCustomerDetailEditPageSim( |
| 818 | BuildContext context, | 803 | BuildContext context, |
| 819 | - Guest guest, | ||
| 820 | - { | 804 | + Guest guest, { |
| 821 | replace = false, | 805 | replace = false, |
| 822 | }) { | 806 | }) { |
| 823 | return _navigateTo(context, | 807 | return _navigateTo(context, |
| @@ -863,17 +847,13 @@ class NavigatorUtil { | @@ -863,17 +847,13 @@ class NavigatorUtil { | ||
| 863 | replace: replace); | 847 | replace: replace); |
| 864 | } | 848 | } |
| 865 | 849 | ||
| 866 | - | ||
| 867 | /// 我的客情列表 | 850 | /// 我的客情列表 |
| 868 | - static Future<dynamic> goMyCustomerListPageSim( | ||
| 869 | - BuildContext context, | 851 | + static Future<dynamic> goMyCustomerListPageSim(BuildContext context, |
| 870 | {replace = false, bool needBtn = false, String index = '0'}) { | 852 | {replace = false, bool needBtn = false, String index = '0'}) { |
| 871 | - return _navigateTo(context, | ||
| 872 | - "${Routes.my_customer_list_page_sim}", | 853 | + return _navigateTo(context, "${Routes.my_customer_list_page_sim}", |
| 873 | replace: replace); | 854 | replace: replace); |
| 874 | } | 855 | } |
| 875 | 856 | ||
| 876 | - | ||
| 877 | /// 我的营销记录 | 857 | /// 我的营销记录 |
| 878 | static Future<dynamic> goMyMarketingRecordsPage( | 858 | static Future<dynamic> goMyMarketingRecordsPage( |
| 879 | BuildContext context, FromPage fromPage, String uid, | 859 | BuildContext context, FromPage fromPage, String uid, |
| @@ -937,12 +917,10 @@ class NavigatorUtil { | @@ -937,12 +917,10 @@ class NavigatorUtil { | ||
| 937 | replace: replace); | 917 | replace: replace); |
| 938 | } | 918 | } |
| 939 | 919 | ||
| 940 | - | ||
| 941 | - /// 我的客户详情 | 920 | + /// 我的客户详情 |
| 942 | static Future<dynamic> goMyCustomerDetailPageSim( | 921 | static Future<dynamic> goMyCustomerDetailPageSim( |
| 943 | BuildContext context, | 922 | BuildContext context, |
| 944 | - CustomerListSunModel userHistoryEntity, | ||
| 945 | - { | 923 | + CustomerListSunModel userHistoryEntity, { |
| 946 | replace = false, | 924 | replace = false, |
| 947 | }) { | 925 | }) { |
| 948 | return _navigateTo(context, | 926 | return _navigateTo(context, |
| @@ -961,11 +939,11 @@ class NavigatorUtil { | @@ -961,11 +939,11 @@ class NavigatorUtil { | ||
| 961 | "${Routes.my_customer_edit_detail_page}?guest=${FluroConvertUtils.object2string(guest)}&fromPage=${FluroConvertUtils.enumToString(fromPage)}", | 939 | "${Routes.my_customer_edit_detail_page}?guest=${FluroConvertUtils.object2string(guest)}&fromPage=${FluroConvertUtils.enumToString(fromPage)}", |
| 962 | replace: replace); | 940 | replace: replace); |
| 963 | } | 941 | } |
| 964 | - ///编辑客户详情 | 942 | + |
| 943 | + ///编辑客户详情 | ||
| 965 | static Future<dynamic> goMyCustomerDetailEditPageSim( | 944 | static Future<dynamic> goMyCustomerDetailEditPageSim( |
| 966 | BuildContext context, | 945 | BuildContext context, |
| 967 | - Guest guest, | ||
| 968 | - { | 946 | + Guest guest, { |
| 969 | replace = false, | 947 | replace = false, |
| 970 | }) { | 948 | }) { |
| 971 | return _navigateTo(context, | 949 | return _navigateTo(context, |
| @@ -1009,7 +987,7 @@ class NavigatorUtil { | @@ -1009,7 +987,7 @@ class NavigatorUtil { | ||
| 1009 | replace: replace); | 987 | replace: replace); |
| 1010 | } | 988 | } |
| 1011 | 989 | ||
| 1012 | - ///客情详情----再次预订 | 990 | + ///客情详情----再次预订 |
| 1013 | static Future<dynamic> goTableManagerPageSim( | 991 | static Future<dynamic> goTableManagerPageSim( |
| 1014 | BuildContext context, | 992 | BuildContext context, |
| 1015 | Guest guest, { | 993 | Guest guest, { |
| @@ -1621,7 +1599,8 @@ class NavigatorUtil { | @@ -1621,7 +1599,8 @@ class NavigatorUtil { | ||
| 1621 | BuildContext context, { | 1599 | BuildContext context, { |
| 1622 | replace = false, | 1600 | replace = false, |
| 1623 | }) { | 1601 | }) { |
| 1624 | - return _navigateTo(context, "${Routes.book_info_page_sim}", replace: replace); | 1602 | + return _navigateTo(context, "${Routes.book_info_page_sim}", |
| 1603 | + replace: replace); | ||
| 1625 | } | 1604 | } |
| 1626 | 1605 | ||
| 1627 | ///预订安排通知定制------店铺介绍 | 1606 | ///预订安排通知定制------店铺介绍 |
| @@ -1659,9 +1638,7 @@ class NavigatorUtil { | @@ -1659,9 +1638,7 @@ class NavigatorUtil { | ||
| 1659 | replace: replace); | 1638 | replace: replace); |
| 1660 | } | 1639 | } |
| 1661 | 1640 | ||
| 1662 | - | ||
| 1663 | - | ||
| 1664 | - ///预订安排通知定制------客户互动及店铺推广 | 1641 | + ///预订安排通知定制------客户互动及店铺推广 |
| 1665 | static Future<dynamic> goMarkingInteractionPageSim( | 1642 | static Future<dynamic> goMarkingInteractionPageSim( |
| 1666 | BuildContext context, { | 1643 | BuildContext context, { |
| 1667 | replace = false, | 1644 | replace = false, |
| @@ -1991,8 +1968,7 @@ class NavigatorUtil { | @@ -1991,8 +1968,7 @@ class NavigatorUtil { | ||
| 1991 | replace: replace); | 1968 | replace: replace); |
| 1992 | } | 1969 | } |
| 1993 | 1970 | ||
| 1994 | - | ||
| 1995 | - /// 客户通知配置页 | 1971 | + /// 客户通知配置页 |
| 1996 | static Future<dynamic> goCustomerNoticeSettingPageSim( | 1972 | static Future<dynamic> goCustomerNoticeSettingPageSim( |
| 1997 | BuildContext context, { | 1973 | BuildContext context, { |
| 1998 | replace = false, | 1974 | replace = false, |
| @@ -2120,7 +2096,6 @@ class NavigatorUtil { | @@ -2120,7 +2096,6 @@ class NavigatorUtil { | ||
| 2120 | replace: replace); | 2096 | replace: replace); |
| 2121 | } | 2097 | } |
| 2122 | 2098 | ||
| 2123 | - | ||
| 2124 | ///预订通知短信模版选择 | 2099 | ///预订通知短信模版选择 |
| 2125 | static Future<dynamic> goSmsTemplateSettingPageSim( | 2100 | static Future<dynamic> goSmsTemplateSettingPageSim( |
| 2126 | BuildContext context, | 2101 | BuildContext context, |
| @@ -2164,15 +2139,13 @@ class NavigatorUtil { | @@ -2164,15 +2139,13 @@ class NavigatorUtil { | ||
| 2164 | replace: replace); | 2139 | replace: replace); |
| 2165 | } | 2140 | } |
| 2166 | 2141 | ||
| 2167 | - | ||
| 2168 | - | ||
| 2169 | - | ||
| 2170 | - //预订信息模块设置-自定义图文默认 | 2142 | + //预订信息模块设置-自定义图文默认 |
| 2171 | static Future<dynamic> goInvicationAdditionPage( | 2143 | static Future<dynamic> goInvicationAdditionPage( |
| 2172 | BuildContext context, { | 2144 | BuildContext context, { |
| 2145 | + String rid, | ||
| 2173 | replace = false, | 2146 | replace = false, |
| 2174 | }) { | 2147 | }) { |
| 2175 | - return _navigateTo(context, "${Routes.invication_addition_page}", | 2148 | + return _navigateTo(context, "${Routes.invication_addition_page}?rid=$rid", |
| 2176 | replace: replace); | 2149 | replace: replace); |
| 2177 | } | 2150 | } |
| 2178 | } | 2151 | } |
| @@ -511,16 +511,16 @@ var handleSelectTableFHandler = new Handler( | @@ -511,16 +511,16 @@ var handleSelectTableFHandler = new Handler( | ||
| 511 | return ChangeNotifierProvider<ChooseTableModel>( | 511 | return ChangeNotifierProvider<ChooseTableModel>( |
| 512 | create: (_) => ChooseTableModel(), | 512 | create: (_) => ChooseTableModel(), |
| 513 | child: ChangeNotifierProvider<TableManagerModel>( | 513 | child: ChangeNotifierProvider<TableManagerModel>( |
| 514 | - create: (_) => TableManagerModel(), | ||
| 515 | - child:SelectTableFPage(rid, dateTime, ddateSlot, | ||
| 516 | - canChoose: canChoose, | ||
| 517 | - tableList: res, | ||
| 518 | - fromPage: fromPage, | ||
| 519 | - tid: tid, | ||
| 520 | - hmS: hmS, | ||
| 521 | - hmE: hmE, | ||
| 522 | - source: source, | ||
| 523 | - ridFeast: ridFeast))); | 514 | + create: (_) => TableManagerModel(), |
| 515 | + child: SelectTableFPage(rid, dateTime, ddateSlot, | ||
| 516 | + canChoose: canChoose, | ||
| 517 | + tableList: res, | ||
| 518 | + fromPage: fromPage, | ||
| 519 | + tid: tid, | ||
| 520 | + hmS: hmS, | ||
| 521 | + hmE: hmE, | ||
| 522 | + source: source, | ||
| 523 | + ridFeast: ridFeast))); | ||
| 524 | }); | 524 | }); |
| 525 | 525 | ||
| 526 | // 跳转到照片管理的选择桌位_方硕新修改的页面 | 526 | // 跳转到照片管理的选择桌位_方硕新修改的页面 |
| @@ -771,23 +771,14 @@ var handleCouponEditPageHandler = new Handler( | @@ -771,23 +771,14 @@ var handleCouponEditPageHandler = new Handler( | ||
| 771 | // String rid = params["rid"].first; | 771 | // String rid = params["rid"].first; |
| 772 | bool isMine = FluroConvertUtils.string2bool(params["isMine"].first); | 772 | bool isMine = FluroConvertUtils.string2bool(params["isMine"].first); |
| 773 | CouponSunModel couponSunModel; | 773 | CouponSunModel couponSunModel; |
| 774 | - if(params.keys.contains("couponSunModel")){ | ||
| 775 | - couponSunModel = CouponSunModel.fromJson(json.decode( | ||
| 776 | - FluroConvertUtils.fluroCnParamsDecode(params["couponSunModel"].first))); | ||
| 777 | - | 774 | + if (params.keys.contains("couponSunModel")) { |
| 775 | + couponSunModel = CouponSunModel.fromJson(json.decode( | ||
| 776 | + FluroConvertUtils.fluroCnParamsDecode(params["couponSunModel"].first))); | ||
| 778 | } | 777 | } |
| 779 | 778 | ||
| 780 | return ChangeNotifierProvider<UploadImageProvider>( | 779 | return ChangeNotifierProvider<UploadImageProvider>( |
| 781 | create: (_) => UploadImageProvider(), | 780 | create: (_) => UploadImageProvider(), |
| 782 | - child: CouponEidtPage( | ||
| 783 | - isMine: isMine, | ||
| 784 | - couponSunModel:couponSunModel | ||
| 785 | - )); | ||
| 786 | - | ||
| 787 | - | ||
| 788 | - | ||
| 789 | - | ||
| 790 | - | 781 | + child: CouponEidtPage(isMine: isMine, couponSunModel: couponSunModel)); |
| 791 | }); | 782 | }); |
| 792 | 783 | ||
| 793 | ///选择优惠券 | 784 | ///选择优惠券 |
| @@ -3685,16 +3676,16 @@ var monthOrderHomePageHandle = new Handler( | @@ -3685,16 +3676,16 @@ var monthOrderHomePageHandle = new Handler( | ||
| 3685 | create: (_) => PersonnelProvider(), child: MonthOrderHomePage())); | 3676 | create: (_) => PersonnelProvider(), child: MonthOrderHomePage())); |
| 3686 | }); | 3677 | }); |
| 3687 | 3678 | ||
| 3688 | - | ||
| 3689 | - | ||
| 3690 | ///预订信息模块设置-自定义图文默认 | 3679 | ///预订信息模块设置-自定义图文默认 |
| 3691 | var invicationAdditionPageHandle = new Handler( | 3680 | var invicationAdditionPageHandle = new Handler( |
| 3692 | handlerFunc: (BuildContext context, Map<String, List<Object>> params) { | 3681 | handlerFunc: (BuildContext context, Map<String, List<Object>> params) { |
| 3693 | - // String id = params["id"].first; | 3682 | + String rid = params["rid"].first; |
| 3694 | // // String smsTemplate = params["smsTemplate"].first; | 3683 | // // String smsTemplate = params["smsTemplate"].first; |
| 3695 | // CouponUse use = CouponUse.fromJson( | 3684 | // CouponUse use = CouponUse.fromJson( |
| 3696 | // json.decode(FluroConvertUtils.fluroCnParamsDecode(params["use"].first))); | 3685 | // json.decode(FluroConvertUtils.fluroCnParamsDecode(params["use"].first))); |
| 3697 | // CouponSunModel couponSunModel = CouponSunModel.fromJson(json.decode( | 3686 | // CouponSunModel couponSunModel = CouponSunModel.fromJson(json.decode( |
| 3698 | // FluroConvertUtils.fluroCnParamsDecode(params["couponSunModel"].first))); | 3687 | // FluroConvertUtils.fluroCnParamsDecode(params["couponSunModel"].first))); |
| 3699 | - return InvicationAdditionPage(); | 3688 | + return ChangeNotifierProvider<MarketingCenterProvider>( |
| 3689 | + create: (_) => MarketingCenterProvider(), | ||
| 3690 | + child: InvicationAdditionPage(rid)); | ||
| 3700 | }); | 3691 | }); |
-
Please register or login to post a comment