Showing
23 changed files
with
1479 additions
and
287 deletions
lib/models/phone_code_model.dart
0 → 100644
| 1 | +import 'package:json_annotation/json_annotation.dart'; | ||
| 2 | + | ||
| 3 | +part 'phone_code_model.g.dart'; | ||
| 4 | + | ||
| 5 | +@JsonSerializable() | ||
| 6 | +class PhoneCodeModel extends Object { | ||
| 7 | + @JsonKey(name: 'ret') | ||
| 8 | + int ret; | ||
| 9 | + | ||
| 10 | + @JsonKey(name: 'data') | ||
| 11 | + PhoneCodeSunModel data; | ||
| 12 | + | ||
| 13 | + @JsonKey(name: 'msg') | ||
| 14 | + String msg; | ||
| 15 | + | ||
| 16 | + PhoneCodeModel( | ||
| 17 | + this.ret, | ||
| 18 | + this.data, | ||
| 19 | + this.msg, | ||
| 20 | + ); | ||
| 21 | + | ||
| 22 | + factory PhoneCodeModel.fromJson(Map<String, dynamic> srcJson) => | ||
| 23 | + _$PhoneCodeModelFromJson(srcJson); | ||
| 24 | + | ||
| 25 | + Map<String, dynamic> toJson() => _$PhoneCodeModelToJson(this); | ||
| 26 | +} | ||
| 27 | + | ||
| 28 | +@JsonSerializable() | ||
| 29 | +class PhoneCodeSunModel extends Object { | ||
| 30 | + @JsonKey(name: 'RequestId') | ||
| 31 | + String requestId; | ||
| 32 | + | ||
| 33 | + @JsonKey(name: 'Message') | ||
| 34 | + String message; | ||
| 35 | + | ||
| 36 | + @JsonKey(name: 'BizId') | ||
| 37 | + String bizId; | ||
| 38 | + | ||
| 39 | + @JsonKey(name: 'Code') | ||
| 40 | + String code; | ||
| 41 | + | ||
| 42 | + PhoneCodeSunModel( | ||
| 43 | + this.requestId, | ||
| 44 | + this.message, | ||
| 45 | + this.bizId, | ||
| 46 | + this.code, | ||
| 47 | + ); | ||
| 48 | + | ||
| 49 | + factory PhoneCodeSunModel.fromJson(Map<String, dynamic> srcJson) => | ||
| 50 | + _$PhoneCodeSunModelFromJson(srcJson); | ||
| 51 | + | ||
| 52 | + Map<String, dynamic> toJson() => _$PhoneCodeSunModelToJson(this); | ||
| 53 | +} |
lib/models/phone_code_model.g.dart
0 → 100644
| 1 | +// GENERATED CODE - DO NOT MODIFY BY HAND | ||
| 2 | + | ||
| 3 | +part of 'phone_code_model.dart'; | ||
| 4 | + | ||
| 5 | +// ************************************************************************** | ||
| 6 | +// JsonSerializableGenerator | ||
| 7 | +// ************************************************************************** | ||
| 8 | + | ||
| 9 | +PhoneCodeModel _$PhoneCodeModelFromJson(Map<String, dynamic> json) { | ||
| 10 | + return PhoneCodeModel( | ||
| 11 | + json['ret'] as int, | ||
| 12 | + json['data'] == null | ||
| 13 | + ? null | ||
| 14 | + : PhoneCodeSunModel.fromJson(json['data'] as Map<String, dynamic>), | ||
| 15 | + json['msg'] as String); | ||
| 16 | +} | ||
| 17 | + | ||
| 18 | +Map<String, dynamic> _$PhoneCodeModelToJson(PhoneCodeModel instance) => | ||
| 19 | + <String, dynamic>{ | ||
| 20 | + 'ret': instance.ret, | ||
| 21 | + 'data': instance.data, | ||
| 22 | + 'msg': instance.msg | ||
| 23 | + }; | ||
| 24 | + | ||
| 25 | +PhoneCodeSunModel _$PhoneCodeSunModelFromJson(Map<String, dynamic> json) { | ||
| 26 | + return PhoneCodeSunModel( | ||
| 27 | + json['RequestId'] as String, | ||
| 28 | + json['Message'] as String, | ||
| 29 | + json['BizId'] as String, | ||
| 30 | + json['Code'] as String); | ||
| 31 | +} | ||
| 32 | + | ||
| 33 | +Map<String, dynamic> _$PhoneCodeSunModelToJson(PhoneCodeSunModel instance) => | ||
| 34 | + <String, dynamic>{ | ||
| 35 | + 'RequestId': instance.requestId, | ||
| 36 | + 'Message': instance.message, | ||
| 37 | + 'BizId': instance.bizId, | ||
| 38 | + 'Code': instance.code | ||
| 39 | + }; |
| @@ -87,5 +87,7 @@ class HttpUrl { | @@ -87,5 +87,7 @@ class HttpUrl { | ||
| 87 | "?service=App.Activity.GetCustomerActivityBaseinfo"; //客户经理获取基本信息 | 87 | "?service=App.Activity.GetCustomerActivityBaseinfo"; //客户经理获取基本信息 |
| 88 | static const String get_seller_photo_by_id = | 88 | static const String get_seller_photo_by_id = |
| 89 | "?service=App.Photo.getSellerPhotoById"; //查看商家图片 | 89 | "?service=App.Photo.getSellerPhotoById"; //查看商家图片 |
| 90 | + static const String send_vc_code = | ||
| 91 | + "?service=App.SendSMS.SendVcCode"; //绑定手机号码时,给用户发送短信验证码接口 | ||
| 90 | 92 | ||
| 91 | } | 93 | } |
| @@ -5,6 +5,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; | @@ -5,6 +5,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
| 5 | import 'package:image_picker/image_picker.dart'; | 5 | import 'package:image_picker/image_picker.dart'; |
| 6 | import 'package:one_key/models/upload_img_model.dart'; | 6 | import 'package:one_key/models/upload_img_model.dart'; |
| 7 | import 'package:one_key/pages/create_store/video_widget.dart'; | 7 | import 'package:one_key/pages/create_store/video_widget.dart'; |
| 8 | +import 'package:one_key/pages/online_check/img_picker_widget.dart'; | ||
| 8 | import 'package:one_key/pages/online_check/photo_view_wiget.dart'; | 9 | import 'package:one_key/pages/online_check/photo_view_wiget.dart'; |
| 9 | import 'package:one_key/provider/upload_img_provider.dart'; | 10 | import 'package:one_key/provider/upload_img_provider.dart'; |
| 10 | import 'package:one_key/res/colors.dart'; | 11 | import 'package:one_key/res/colors.dart'; |
| @@ -61,12 +62,57 @@ class _CreateStorePageState extends State<CreateStorePage> { | @@ -61,12 +62,57 @@ class _CreateStorePageState extends State<CreateStorePage> { | ||
| 61 | return list; | 62 | return list; |
| 62 | } | 63 | } |
| 63 | 64 | ||
| 64 | - ///店铺名称 | 65 | + ///店铺电话 |
| 66 | + Widget _storePhoneWidget() { | ||
| 67 | + return Column( | ||
| 68 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 69 | + children: [ | ||
| 70 | + Text('2.您店铺的电话是?', | ||
| 71 | + style: TextStyle( | ||
| 72 | + fontSize: ScreenUtil().setSp(30), fontWeight: FontWeight.bold)), | ||
| 73 | + VEmptyView(30), | ||
| 74 | + TextField( | ||
| 75 | + // textAlignVertical: TextAlignVertical.bottom, | ||
| 76 | + maxLines: 1, | ||
| 77 | + // //光标颜色 | ||
| 78 | + // cursorColor: | ||
| 79 | + // widget.isSelect ? Colors.white : MyColours.color_199095, | ||
| 80 | + //输入文本的样式 | ||
| 81 | + style: TextStyle( | ||
| 82 | + fontSize: ScreenUtil().setSp(28), | ||
| 83 | + ), | ||
| 84 | + // focusNode: _codeNode, | ||
| 85 | + decoration: InputDecoration( | ||
| 86 | + contentPadding: EdgeInsets.symmetric( | ||
| 87 | + vertical: ScreenUtil().setWidth(6), | ||
| 88 | + horizontal: ScreenUtil().setWidth(20)), | ||
| 89 | + border: OutlineInputBorder(), | ||
| 90 | + hintText: '请输入店铺接单电话', | ||
| 91 | + hintStyle: TextStyle( | ||
| 92 | + color: MyColours.color_999999, | ||
| 93 | + fontSize: ScreenUtil().setSp(28), | ||
| 94 | + ), | ||
| 95 | + // enabledBorder: new UnderlineInputBorder( | ||
| 96 | + // borderSide: BorderSide.none, | ||
| 97 | + // ), | ||
| 98 | + focusedBorder: OutlineInputBorder( | ||
| 99 | + borderSide: BorderSide(color: MyColours.color_199095)), | ||
| 100 | + ), | ||
| 101 | + onChanged: (value) {}, | ||
| 102 | + onEditingComplete: () { | ||
| 103 | + FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 104 | + }, | ||
| 105 | + keyboardType: TextInputType.text, | ||
| 106 | + ) | ||
| 107 | + ], | ||
| 108 | + ); | ||
| 109 | + } | ||
| 110 | + | ||
| 65 | Widget _storeNameWidget() { | 111 | Widget _storeNameWidget() { |
| 66 | return Column( | 112 | return Column( |
| 67 | crossAxisAlignment: CrossAxisAlignment.start, | 113 | crossAxisAlignment: CrossAxisAlignment.start, |
| 68 | children: [ | 114 | children: [ |
| 69 | - Text('1.您的店铺名称是?', | 115 | + Text('1.您店铺的名称是?', |
| 70 | style: TextStyle( | 116 | style: TextStyle( |
| 71 | fontSize: ScreenUtil().setSp(30), fontWeight: FontWeight.bold)), | 117 | fontSize: ScreenUtil().setSp(30), fontWeight: FontWeight.bold)), |
| 72 | VEmptyView(30), | 118 | VEmptyView(30), |
| @@ -154,8 +200,8 @@ class _CreateStorePageState extends State<CreateStorePage> { | @@ -154,8 +200,8 @@ class _CreateStorePageState extends State<CreateStorePage> { | ||
| 154 | if (pickedFile != null) { | 200 | if (pickedFile != null) { |
| 155 | model.imgSizeTouxiang = 64; | 201 | model.imgSizeTouxiang = 64; |
| 156 | model.touxiang.qiniuUrl = null; | 202 | model.touxiang.qiniuUrl = null; |
| 157 | - UploadImageUtil().startUploadOnly( | ||
| 158 | - context, File(pickedFile.path), title == '头像' ? 0 : 1, true, model); | 203 | + UploadImageUtil().startUpload(context, File(pickedFile.path), |
| 204 | + title == '头像' ? 0 : 1, true, model, UploadType.StoreFrontUploadType); | ||
| 159 | } | 205 | } |
| 160 | } | 206 | } |
| 161 | 207 | ||
| @@ -339,12 +385,33 @@ class _CreateStorePageState extends State<CreateStorePage> { | @@ -339,12 +385,33 @@ class _CreateStorePageState extends State<CreateStorePage> { | ||
| 339 | ); | 385 | ); |
| 340 | } | 386 | } |
| 341 | 387 | ||
| 388 | + ///门头照片 | ||
| 389 | + Widget _storeFrontPhotoWidget() { | ||
| 390 | + return Column( | ||
| 391 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 392 | + children: [ | ||
| 393 | + Text('2.您店铺的门头照片是?', | ||
| 394 | + style: TextStyle( | ||
| 395 | + fontSize: ScreenUtil().setSp(30), fontWeight: FontWeight.bold)), | ||
| 396 | + VEmptyView(30), | ||
| 397 | + Consumer<UploadImageProvider>(builder: (context, model, _) { | ||
| 398 | + return ImgPickerWidget( | ||
| 399 | + scrollController: _controller, | ||
| 400 | + model: model, | ||
| 401 | + maxImageNumber: 1, | ||
| 402 | + uploadType: UploadType.StoreFrontUploadType, | ||
| 403 | + ); | ||
| 404 | + }) | ||
| 405 | + ], | ||
| 406 | + ); | ||
| 407 | + } | ||
| 408 | + | ||
| 342 | ///店铺环境 | 409 | ///店铺环境 |
| 343 | Widget _storeEnvironmentWidget() { | 410 | Widget _storeEnvironmentWidget() { |
| 344 | return Column( | 411 | return Column( |
| 345 | crossAxisAlignment: CrossAxisAlignment.start, | 412 | crossAxisAlignment: CrossAxisAlignment.start, |
| 346 | children: [ | 413 | children: [ |
| 347 | - Text('4.请上传您店铺环境的照片或者视频', | 414 | + Text('2.请上传您店铺环境的照片或者视频', |
| 348 | style: TextStyle( | 415 | style: TextStyle( |
| 349 | fontSize: ScreenUtil().setSp(30), fontWeight: FontWeight.bold)), | 416 | fontSize: ScreenUtil().setSp(30), fontWeight: FontWeight.bold)), |
| 350 | VEmptyView(30), | 417 | VEmptyView(30), |
| @@ -388,6 +455,10 @@ class _CreateStorePageState extends State<CreateStorePage> { | @@ -388,6 +455,10 @@ class _CreateStorePageState extends State<CreateStorePage> { | ||
| 388 | // Column(children: _roomTypeWidget()), | 455 | // Column(children: _roomTypeWidget()), |
| 389 | _storeNameWidget(), | 456 | _storeNameWidget(), |
| 390 | VEmptyView(30), | 457 | VEmptyView(30), |
| 458 | + _storeFrontPhotoWidget(), | ||
| 459 | + VEmptyView(30), | ||
| 460 | + _storePhoneWidget(), | ||
| 461 | + VEmptyView(30), | ||
| 391 | _addressWidget(), | 462 | _addressWidget(), |
| 392 | VEmptyView(30), | 463 | VEmptyView(30), |
| 393 | _positionWidget(), | 464 | _positionWidget(), |
| 1 | +import 'package:flutter/material.dart'; | ||
| 2 | +import 'package:flutter_screenutil/screenutil.dart'; | ||
| 3 | +import 'package:one_key/res/colors.dart'; | ||
| 4 | +import 'package:one_key/utils/navigator_util.dart'; | ||
| 5 | +import 'package:one_key/utils/utils.dart'; | ||
| 6 | +import 'package:one_key/widgets/round_button.dart'; | ||
| 7 | +import 'package:one_key/widgets/system_app_bar.dart'; | ||
| 8 | +import 'package:one_key/widgets/v_empty_view.dart'; | ||
| 9 | +import 'package:permission_handler/permission_handler.dart'; | ||
| 10 | + | ||
| 11 | +class EnterStoreAddressPage extends StatefulWidget { | ||
| 12 | + EnterStoreAddressPage({Key key}) : super(key: key); | ||
| 13 | + | ||
| 14 | + @override | ||
| 15 | + _EnterStoreAddressPageState createState() => _EnterStoreAddressPageState(); | ||
| 16 | +} | ||
| 17 | + | ||
| 18 | +class _EnterStoreAddressPageState extends State<EnterStoreAddressPage> { | ||
| 19 | + String storeAddress = '请选择地图地址'; | ||
| 20 | + @override | ||
| 21 | + Widget build(BuildContext context) { | ||
| 22 | + return Scaffold( | ||
| 23 | + backgroundColor: Colors.white, | ||
| 24 | + appBar: SystemAppBar( | ||
| 25 | + '', | ||
| 26 | + leftTitle: '上一步', | ||
| 27 | + onTap: () { | ||
| 28 | + Navigator.pop(context); | ||
| 29 | + }, | ||
| 30 | + ), | ||
| 31 | + body: InkWell( | ||
| 32 | + onTap: () { | ||
| 33 | + FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 34 | + }, | ||
| 35 | + child: Container( | ||
| 36 | + padding: EdgeInsets.fromLTRB(ScreenUtil().setWidth(70), | ||
| 37 | + ScreenUtil().setWidth(60), ScreenUtil().setWidth(70), 0), | ||
| 38 | + child: SingleChildScrollView( | ||
| 39 | + // controller: _controller, | ||
| 40 | + child: Column( | ||
| 41 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 42 | + children: [ | ||
| 43 | + Text('您的店铺地址在哪?', | ||
| 44 | + style: TextStyle( | ||
| 45 | + color: MyColours.color_333333, | ||
| 46 | + fontSize: ScreenUtil().setSp(40), | ||
| 47 | + fontWeight: FontWeight.bold)), | ||
| 48 | + VEmptyView(100), | ||
| 49 | + InkWell( | ||
| 50 | + onTap: () { | ||
| 51 | + Utils.getPickPermission(context, () async { | ||
| 52 | + Map address = | ||
| 53 | + await NavigatorUtil.goMapChoicePointPage( | ||
| 54 | + context); | ||
| 55 | + if (address != null) { | ||
| 56 | + setState(() { | ||
| 57 | + storeAddress = address['address']; | ||
| 58 | + // 'address': | ||
| 59 | + // 'lat': | ||
| 60 | + // 'lng | ||
| 61 | + }); | ||
| 62 | + } | ||
| 63 | + }, PermissionGroup.location); | ||
| 64 | + }, | ||
| 65 | + child: Container( | ||
| 66 | + alignment: Alignment.centerLeft, | ||
| 67 | + width: double.infinity, | ||
| 68 | + height: ScreenUtil().setWidth(104), | ||
| 69 | + decoration: BoxDecoration( | ||
| 70 | + borderRadius: BorderRadius.circular( | ||
| 71 | + ScreenUtil().setWidth(10)), | ||
| 72 | + border: Border.all( | ||
| 73 | + color: MyColours.color_bff6f7, | ||
| 74 | + width: ScreenUtil().setWidth(2))), | ||
| 75 | + padding: EdgeInsets.symmetric( | ||
| 76 | + horizontal: ScreenUtil().setWidth(40), | ||
| 77 | + ), | ||
| 78 | + child: Text('${storeAddress}', | ||
| 79 | + style: TextStyle( | ||
| 80 | + color: storeAddress == '请选择地图地址' | ||
| 81 | + ? MyColours.color_999999 | ||
| 82 | + : MyColours.color_333333, | ||
| 83 | + fontSize: ScreenUtil().setSp(28), | ||
| 84 | + )), | ||
| 85 | + ), | ||
| 86 | + ), | ||
| 87 | + VEmptyView(20), | ||
| 88 | + TextField( | ||
| 89 | + // textAlignVertical: TextAlignVertical.bottom, | ||
| 90 | + maxLines: 1, | ||
| 91 | + // //光标颜色 | ||
| 92 | + // cursorColor: | ||
| 93 | + // widget.isSelect ? Colors.white : MyColours.color_199095, | ||
| 94 | + //输入文本的样式 | ||
| 95 | + style: TextStyle( | ||
| 96 | + color: MyColours.color_333333, | ||
| 97 | + fontSize: ScreenUtil().setSp(28), | ||
| 98 | + ), | ||
| 99 | + // focusNode: _codeNode, | ||
| 100 | + decoration: InputDecoration( | ||
| 101 | + contentPadding: EdgeInsets.symmetric( | ||
| 102 | + vertical: ScreenUtil().setWidth(32), | ||
| 103 | + horizontal: ScreenUtil().setWidth(40)), | ||
| 104 | + border: OutlineInputBorder(), | ||
| 105 | + hintText: '请输入详细地址(选填)', | ||
| 106 | + hintStyle: TextStyle( | ||
| 107 | + color: MyColours.color_999999, | ||
| 108 | + fontSize: ScreenUtil().setSp(28), | ||
| 109 | + ), | ||
| 110 | + enabledBorder: OutlineInputBorder( | ||
| 111 | + borderSide: BorderSide( | ||
| 112 | + color: MyColours.color_bff6f7, | ||
| 113 | + width: ScreenUtil().setWidth(2))), | ||
| 114 | + focusedBorder: OutlineInputBorder( | ||
| 115 | + borderSide: BorderSide( | ||
| 116 | + color: MyColours.color_bff6f7, | ||
| 117 | + width: ScreenUtil().setWidth(2))), | ||
| 118 | + ), | ||
| 119 | + onChanged: (value) {}, | ||
| 120 | + onEditingComplete: () { | ||
| 121 | + FocusScope.of(context) | ||
| 122 | + .requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 123 | + }, | ||
| 124 | + keyboardType: TextInputType.text, | ||
| 125 | + ), | ||
| 126 | + VEmptyView(160), | ||
| 127 | + RoundButton( | ||
| 128 | + text: '下一步', | ||
| 129 | + gradientStart: MyColours.color_199095, | ||
| 130 | + gradientEnd: MyColours.color_199095, | ||
| 131 | + // borderColor: MyColours.color_999999, | ||
| 132 | + radius: ScreenUtil().setWidth(20), | ||
| 133 | + fontSize: 28, | ||
| 134 | + isBold: false, | ||
| 135 | + onPressed: () { | ||
| 136 | + NavigatorUtil.goEnterStorePositionPage(context); | ||
| 137 | + }, | ||
| 138 | + ) | ||
| 139 | + ]))))); | ||
| 140 | + ; | ||
| 141 | + } | ||
| 142 | +} |
| 1 | +import 'package:flutter/material.dart'; | ||
| 2 | +import 'package:flutter_screenutil/screenutil.dart'; | ||
| 3 | +import 'package:one_key/pages/create_store/video_widget.dart'; | ||
| 4 | +import 'package:one_key/pages/online_check/img_picker_widget.dart'; | ||
| 5 | +import 'package:one_key/provider/upload_img_provider.dart'; | ||
| 6 | +import 'package:one_key/res/colors.dart'; | ||
| 7 | +import 'package:one_key/utils/navigator_util.dart'; | ||
| 8 | +import 'package:one_key/utils/upload_image_util.dart'; | ||
| 9 | +import 'package:one_key/widgets/round_button.dart'; | ||
| 10 | +import 'package:one_key/widgets/system_app_bar.dart'; | ||
| 11 | +import 'package:one_key/widgets/v_empty_view.dart'; | ||
| 12 | +import 'package:provider/provider.dart'; | ||
| 13 | + | ||
| 14 | +class EnterStoreEnvironmentPage extends StatefulWidget { | ||
| 15 | + EnterStoreEnvironmentPage({Key key}) : super(key: key); | ||
| 16 | + | ||
| 17 | + @override | ||
| 18 | + _EnterStoreEnvironmentPageState createState() => | ||
| 19 | + _EnterStoreEnvironmentPageState(); | ||
| 20 | +} | ||
| 21 | + | ||
| 22 | +class _EnterStoreEnvironmentPageState extends State<EnterStoreEnvironmentPage> { | ||
| 23 | + ScrollController _controller = ScrollController(); | ||
| 24 | + @override | ||
| 25 | + Widget build(BuildContext context) { | ||
| 26 | + return Scaffold( | ||
| 27 | + backgroundColor: Colors.white, | ||
| 28 | + appBar: SystemAppBar( | ||
| 29 | + '', | ||
| 30 | + onTap: () { | ||
| 31 | + Navigator.pop(context); | ||
| 32 | + }, | ||
| 33 | + ), | ||
| 34 | + body: InkWell( | ||
| 35 | + onTap: () { | ||
| 36 | + FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 37 | + }, | ||
| 38 | + child: Container( | ||
| 39 | + padding: EdgeInsets.symmetric( | ||
| 40 | + horizontal: ScreenUtil().setWidth(70), | ||
| 41 | + vertical: ScreenUtil().setWidth(60)), | ||
| 42 | + child: SingleChildScrollView( | ||
| 43 | + controller: _controller, | ||
| 44 | + child: Column( | ||
| 45 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 46 | + children: [ | ||
| 47 | + Text('请上传店内环境照片或视频(选传)', | ||
| 48 | + style: TextStyle( | ||
| 49 | + color: MyColours.color_333333, | ||
| 50 | + fontSize: ScreenUtil().setSp(40), | ||
| 51 | + fontWeight: FontWeight.bold)), | ||
| 52 | + VEmptyView(100), | ||
| 53 | + Consumer<UploadImageProvider>( | ||
| 54 | + builder: (context, model, _) { | ||
| 55 | + return VideoPickerWidget( | ||
| 56 | + maxImageNumber: 9, | ||
| 57 | + model: model, | ||
| 58 | + scrollController: _controller); | ||
| 59 | + }), | ||
| 60 | + VEmptyView(160), | ||
| 61 | + RoundButton( | ||
| 62 | + text: '下一步', | ||
| 63 | + gradientStart: MyColours.color_199095, | ||
| 64 | + gradientEnd: MyColours.color_199095, | ||
| 65 | + // borderColor: MyColours.color_999999, | ||
| 66 | + radius: ScreenUtil().setWidth(20), | ||
| 67 | + fontSize: 28, | ||
| 68 | + isBold: false, | ||
| 69 | + onPressed: () { | ||
| 70 | + NavigatorUtil.goEnterStoreAddressPage(context); | ||
| 71 | + }, | ||
| 72 | + ) | ||
| 73 | + ]))))); | ||
| 74 | + ; | ||
| 75 | + } | ||
| 76 | +} |
| 1 | +import 'package:flutter/material.dart'; | ||
| 2 | +import 'package:flutter_screenutil/screenutil.dart'; | ||
| 3 | +import 'package:one_key/pages/online_check/img_picker_widget.dart'; | ||
| 4 | +import 'package:one_key/provider/upload_img_provider.dart'; | ||
| 5 | +import 'package:one_key/res/colors.dart'; | ||
| 6 | +import 'package:one_key/utils/navigator_util.dart'; | ||
| 7 | +import 'package:one_key/utils/upload_image_util.dart'; | ||
| 8 | +import 'package:one_key/widgets/round_button.dart'; | ||
| 9 | +import 'package:one_key/widgets/system_app_bar.dart'; | ||
| 10 | +import 'package:one_key/widgets/v_empty_view.dart'; | ||
| 11 | +import 'package:provider/provider.dart'; | ||
| 12 | + | ||
| 13 | +class EnterStoreFrontPhotoPage extends StatefulWidget { | ||
| 14 | + EnterStoreFrontPhotoPage({Key key}) : super(key: key); | ||
| 15 | + | ||
| 16 | + @override | ||
| 17 | + _EnterStoreFrontPhotoPageState createState() => | ||
| 18 | + _EnterStoreFrontPhotoPageState(); | ||
| 19 | +} | ||
| 20 | + | ||
| 21 | +class _EnterStoreFrontPhotoPageState extends State<EnterStoreFrontPhotoPage> { | ||
| 22 | + ScrollController _controller = ScrollController(); | ||
| 23 | + @override | ||
| 24 | + Widget build(BuildContext context) { | ||
| 25 | + return Scaffold( | ||
| 26 | + backgroundColor: Colors.white, | ||
| 27 | + appBar: SystemAppBar( | ||
| 28 | + '', | ||
| 29 | + onTap: () { | ||
| 30 | + Navigator.pop(context); | ||
| 31 | + }, | ||
| 32 | + ), | ||
| 33 | + body: InkWell( | ||
| 34 | + onTap: () { | ||
| 35 | + FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 36 | + }, | ||
| 37 | + child: Container( | ||
| 38 | + padding: EdgeInsets.symmetric( | ||
| 39 | + horizontal: ScreenUtil().setWidth(70), | ||
| 40 | + vertical: ScreenUtil().setWidth(60)), | ||
| 41 | + child: SingleChildScrollView( | ||
| 42 | + controller: _controller, | ||
| 43 | + child: Column( | ||
| 44 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 45 | + children: [ | ||
| 46 | + Text('请上传店铺的门头照片(选传)', | ||
| 47 | + style: TextStyle( | ||
| 48 | + color: MyColours.color_333333, | ||
| 49 | + fontSize: ScreenUtil().setSp(40), | ||
| 50 | + fontWeight: FontWeight.bold)), | ||
| 51 | + VEmptyView(100), | ||
| 52 | + Consumer<UploadImageProvider>( | ||
| 53 | + builder: (context, model, _) { | ||
| 54 | + return ImgPickerWidget( | ||
| 55 | + scrollController: _controller, | ||
| 56 | + model: model, | ||
| 57 | + maxImageNumber: 1, | ||
| 58 | + uploadType: UploadType.StoreFrontUploadType, | ||
| 59 | + ); | ||
| 60 | + }), | ||
| 61 | + VEmptyView(160), | ||
| 62 | + RoundButton( | ||
| 63 | + text: '下一步', | ||
| 64 | + gradientStart: MyColours.color_199095, | ||
| 65 | + gradientEnd: MyColours.color_199095, | ||
| 66 | + // borderColor: MyColours.color_999999, | ||
| 67 | + radius: ScreenUtil().setWidth(20), | ||
| 68 | + fontSize: 28, | ||
| 69 | + isBold: false, | ||
| 70 | + onPressed: () { | ||
| 71 | + NavigatorUtil.goEnterStoreEnvironmentPage( | ||
| 72 | + context); | ||
| 73 | + }, | ||
| 74 | + ) | ||
| 75 | + ]))))); | ||
| 76 | + ; | ||
| 77 | + } | ||
| 78 | +} |
lib/pages/create_store/enter_store_name.dart
0 → 100644
| 1 | +import 'package:flutter/material.dart'; | ||
| 2 | +import 'package:flutter_screenutil/screenutil.dart'; | ||
| 3 | +import 'package:one_key/res/colors.dart'; | ||
| 4 | +import 'package:one_key/utils/navigator_util.dart'; | ||
| 5 | +import 'package:one_key/widgets/round_button.dart'; | ||
| 6 | +import 'package:one_key/widgets/system_app_bar.dart'; | ||
| 7 | +import 'package:one_key/widgets/v_empty_view.dart'; | ||
| 8 | + | ||
| 9 | +class EnterStoreNamePage extends StatefulWidget { | ||
| 10 | + EnterStoreNamePage({Key key}) : super(key: key); | ||
| 11 | + | ||
| 12 | + @override | ||
| 13 | + _EnterStoreNamePageState createState() => _EnterStoreNamePageState(); | ||
| 14 | +} | ||
| 15 | + | ||
| 16 | +class _EnterStoreNamePageState extends State<EnterStoreNamePage> { | ||
| 17 | + @override | ||
| 18 | + Widget build(BuildContext context) { | ||
| 19 | + return Scaffold( | ||
| 20 | + backgroundColor: Colors.white, | ||
| 21 | + appBar: SystemAppBar( | ||
| 22 | + '', | ||
| 23 | + onTap: () { | ||
| 24 | + Navigator.pop(context); | ||
| 25 | + }, | ||
| 26 | + ), | ||
| 27 | + body: InkWell( | ||
| 28 | + onTap: () { | ||
| 29 | + FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 30 | + }, | ||
| 31 | + child: Container( | ||
| 32 | + padding: EdgeInsets.symmetric( | ||
| 33 | + horizontal: ScreenUtil().setWidth(70), | ||
| 34 | + vertical: ScreenUtil().setWidth(60)), | ||
| 35 | + child: SingleChildScrollView( | ||
| 36 | + child: Column( | ||
| 37 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 38 | + children: [ | ||
| 39 | + Text('您的店铺名称是?', | ||
| 40 | + style: TextStyle( | ||
| 41 | + color: MyColours.color_333333, | ||
| 42 | + fontSize: ScreenUtil().setSp(40), | ||
| 43 | + fontWeight: FontWeight.bold)), | ||
| 44 | + VEmptyView(100), | ||
| 45 | + TextField( | ||
| 46 | + // textAlignVertical: TextAlignVertical.bottom, | ||
| 47 | + maxLines: 1, | ||
| 48 | + // //光标颜色 | ||
| 49 | + // cursorColor: | ||
| 50 | + // widget.isSelect ? Colors.white : MyColours.color_199095, | ||
| 51 | + //输入文本的样式 | ||
| 52 | + style: TextStyle( | ||
| 53 | + color: MyColours.color_333333, | ||
| 54 | + fontSize: ScreenUtil().setSp(28), | ||
| 55 | + ), | ||
| 56 | + // focusNode: _codeNode, | ||
| 57 | + decoration: InputDecoration( | ||
| 58 | + contentPadding: EdgeInsets.symmetric( | ||
| 59 | + vertical: ScreenUtil().setWidth(32), | ||
| 60 | + horizontal: ScreenUtil().setWidth(40)), | ||
| 61 | + border: OutlineInputBorder(), | ||
| 62 | + hintText: '请输入店铺名称', | ||
| 63 | + hintStyle: TextStyle( | ||
| 64 | + color: MyColours.color_999999, | ||
| 65 | + fontSize: ScreenUtil().setSp(28), | ||
| 66 | + ), | ||
| 67 | + enabledBorder: OutlineInputBorder( | ||
| 68 | + borderSide: BorderSide( | ||
| 69 | + color: MyColours.color_bff6f7, | ||
| 70 | + width: ScreenUtil().setWidth(2))), | ||
| 71 | + focusedBorder: OutlineInputBorder( | ||
| 72 | + borderSide: BorderSide( | ||
| 73 | + color: MyColours.color_bff6f7, | ||
| 74 | + width: ScreenUtil().setWidth(2))), | ||
| 75 | + ), | ||
| 76 | + onChanged: (value) {}, | ||
| 77 | + onEditingComplete: () { | ||
| 78 | + FocusScope.of(context) | ||
| 79 | + .requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 80 | + }, | ||
| 81 | + keyboardType: TextInputType.text, | ||
| 82 | + ), | ||
| 83 | + VEmptyView(160), | ||
| 84 | + RoundButton( | ||
| 85 | + text: '下一步', | ||
| 86 | + gradientStart: MyColours.color_199095, | ||
| 87 | + gradientEnd: MyColours.color_199095, | ||
| 88 | + // borderColor: MyColours.color_999999, | ||
| 89 | + radius: ScreenUtil().setWidth(20), | ||
| 90 | + fontSize: 28, | ||
| 91 | + isBold: false, | ||
| 92 | + onPressed: () { | ||
| 93 | + NavigatorUtil.goEnterStoreAddressPage(context); | ||
| 94 | + }, | ||
| 95 | + ) | ||
| 96 | + ]))))); | ||
| 97 | + ; | ||
| 98 | + } | ||
| 99 | +} |
| 1 | +import 'package:flutter/material.dart'; | ||
| 2 | +import 'package:flutter_screenutil/screenutil.dart'; | ||
| 3 | +import 'package:one_key/res/colors.dart'; | ||
| 4 | +import 'package:one_key/utils/navigator_util.dart'; | ||
| 5 | +import 'package:one_key/widgets/round_button.dart'; | ||
| 6 | +import 'package:one_key/widgets/system_app_bar.dart'; | ||
| 7 | +import 'package:one_key/widgets/v_empty_view.dart'; | ||
| 8 | + | ||
| 9 | +class EnterStorePhonePage extends StatefulWidget { | ||
| 10 | + EnterStorePhonePage({Key key}) : super(key: key); | ||
| 11 | + | ||
| 12 | + @override | ||
| 13 | + _EnterStorePhonePageState createState() => _EnterStorePhonePageState(); | ||
| 14 | +} | ||
| 15 | + | ||
| 16 | +class _EnterStorePhonePageState extends State<EnterStorePhonePage> { | ||
| 17 | + @override | ||
| 18 | + Widget build(BuildContext context) { | ||
| 19 | + return Scaffold( | ||
| 20 | + backgroundColor: Colors.white, | ||
| 21 | + appBar: SystemAppBar( | ||
| 22 | + '', | ||
| 23 | + onTap: () { | ||
| 24 | + Navigator.pop(context); | ||
| 25 | + }, | ||
| 26 | + ), | ||
| 27 | + body: InkWell( | ||
| 28 | + onTap: () { | ||
| 29 | + FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 30 | + }, | ||
| 31 | + child: Container( | ||
| 32 | + padding: EdgeInsets.symmetric( | ||
| 33 | + horizontal: ScreenUtil().setWidth(70), | ||
| 34 | + vertical: ScreenUtil().setWidth(60)), | ||
| 35 | + child: SingleChildScrollView( | ||
| 36 | + child: Column( | ||
| 37 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 38 | + children: [ | ||
| 39 | + Text('确定将此电话作为接单电话吗?', | ||
| 40 | + style: TextStyle( | ||
| 41 | + color: MyColours.color_333333, | ||
| 42 | + fontSize: ScreenUtil().setSp(40), | ||
| 43 | + fontWeight: FontWeight.bold)), | ||
| 44 | + VEmptyView(100), | ||
| 45 | + TextField( | ||
| 46 | + // textAlignVertical: TextAlignVertical.bottom, | ||
| 47 | + maxLines: 1, | ||
| 48 | + // //光标颜色 | ||
| 49 | + // cursorColor: | ||
| 50 | + // widget.isSelect ? Colors.white : MyColours.color_199095, | ||
| 51 | + //输入文本的样式 | ||
| 52 | + style: TextStyle( | ||
| 53 | + color: MyColours.color_333333, | ||
| 54 | + fontSize: ScreenUtil().setSp(28), | ||
| 55 | + ), | ||
| 56 | + // focusNode: _codeNode, | ||
| 57 | + decoration: InputDecoration( | ||
| 58 | + contentPadding: EdgeInsets.symmetric( | ||
| 59 | + vertical: ScreenUtil().setWidth(32), | ||
| 60 | + horizontal: ScreenUtil().setWidth(40)), | ||
| 61 | + border: OutlineInputBorder(), | ||
| 62 | + hintText: '请输入接单电话', | ||
| 63 | + hintStyle: TextStyle( | ||
| 64 | + color: MyColours.color_999999, | ||
| 65 | + fontSize: ScreenUtil().setSp(28), | ||
| 66 | + ), | ||
| 67 | + enabledBorder: OutlineInputBorder( | ||
| 68 | + borderSide: BorderSide( | ||
| 69 | + color: MyColours.color_bff6f7, | ||
| 70 | + width: ScreenUtil().setWidth(2))), | ||
| 71 | + focusedBorder: OutlineInputBorder( | ||
| 72 | + borderSide: BorderSide( | ||
| 73 | + color: MyColours.color_bff6f7, | ||
| 74 | + width: ScreenUtil().setWidth(2))), | ||
| 75 | + ), | ||
| 76 | + onChanged: (value) {}, | ||
| 77 | + onEditingComplete: () { | ||
| 78 | + FocusScope.of(context) | ||
| 79 | + .requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 80 | + }, | ||
| 81 | + keyboardType: TextInputType.text, | ||
| 82 | + ), | ||
| 83 | + VEmptyView(160), | ||
| 84 | + RoundButton( | ||
| 85 | + text: '下一步', | ||
| 86 | + gradientStart: MyColours.color_199095, | ||
| 87 | + gradientEnd: MyColours.color_199095, | ||
| 88 | + // borderColor: MyColours.color_999999, | ||
| 89 | + radius: ScreenUtil().setWidth(20), | ||
| 90 | + fontSize: 28, | ||
| 91 | + isBold: false, | ||
| 92 | + onPressed: () { | ||
| 93 | + NavigatorUtil.goEnterStoreFrontPhotoPage(context); | ||
| 94 | + }, | ||
| 95 | + ) | ||
| 96 | + ]))))); | ||
| 97 | + ; | ||
| 98 | + } | ||
| 99 | +} |
| 1 | +import 'package:flutter/material.dart'; | ||
| 2 | +import 'package:flutter_screenutil/screenutil.dart'; | ||
| 3 | +import 'package:one_key/res/colors.dart'; | ||
| 4 | +import 'package:one_key/utils/navigator_util.dart'; | ||
| 5 | +import 'package:one_key/widgets/round_button.dart'; | ||
| 6 | +import 'package:one_key/widgets/system_app_bar.dart'; | ||
| 7 | +import 'package:one_key/widgets/v_empty_view.dart'; | ||
| 8 | + | ||
| 9 | +class EnterStorePositionPage extends StatefulWidget { | ||
| 10 | + EnterStorePositionPage({Key key}) : super(key: key); | ||
| 11 | + | ||
| 12 | + @override | ||
| 13 | + _EnterStorePositionPageState createState() => _EnterStorePositionPageState(); | ||
| 14 | +} | ||
| 15 | + | ||
| 16 | +class _EnterStorePositionPageState extends State<EnterStorePositionPage> { | ||
| 17 | + @override | ||
| 18 | + Widget build(BuildContext context) { | ||
| 19 | + return Scaffold( | ||
| 20 | + backgroundColor: Colors.white, | ||
| 21 | + appBar: SystemAppBar( | ||
| 22 | + '', | ||
| 23 | + onTap: () { | ||
| 24 | + Navigator.pop(context); | ||
| 25 | + }, | ||
| 26 | + ), | ||
| 27 | + body: InkWell( | ||
| 28 | + onTap: () { | ||
| 29 | + FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 30 | + }, | ||
| 31 | + child: Container( | ||
| 32 | + padding: EdgeInsets.symmetric( | ||
| 33 | + horizontal: ScreenUtil().setWidth(70), | ||
| 34 | + vertical: ScreenUtil().setWidth(60)), | ||
| 35 | + child: SingleChildScrollView( | ||
| 36 | + child: Column( | ||
| 37 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 38 | + children: [ | ||
| 39 | + Text('您在店铺的角色是?', | ||
| 40 | + style: TextStyle( | ||
| 41 | + color: MyColours.color_333333, | ||
| 42 | + fontSize: ScreenUtil().setSp(40), | ||
| 43 | + fontWeight: FontWeight.bold)), | ||
| 44 | + VEmptyView(100), | ||
| 45 | + TextField( | ||
| 46 | + // textAlignVertical: TextAlignVertical.bottom, | ||
| 47 | + maxLines: 1, | ||
| 48 | + // //光标颜色 | ||
| 49 | + // cursorColor: | ||
| 50 | + // widget.isSelect ? Colors.white : MyColours.color_199095, | ||
| 51 | + //输入文本的样式 | ||
| 52 | + style: TextStyle( | ||
| 53 | + color: MyColours.color_333333, | ||
| 54 | + fontSize: ScreenUtil().setSp(28), | ||
| 55 | + ), | ||
| 56 | + // focusNode: _codeNode, | ||
| 57 | + decoration: InputDecoration( | ||
| 58 | + contentPadding: EdgeInsets.symmetric( | ||
| 59 | + vertical: ScreenUtil().setWidth(32), | ||
| 60 | + horizontal: ScreenUtil().setWidth(40)), | ||
| 61 | + border: OutlineInputBorder(), | ||
| 62 | + hintText: '请输入您的职位', | ||
| 63 | + hintStyle: TextStyle( | ||
| 64 | + color: MyColours.color_999999, | ||
| 65 | + fontSize: ScreenUtil().setSp(28), | ||
| 66 | + ), | ||
| 67 | + enabledBorder: OutlineInputBorder( | ||
| 68 | + borderSide: BorderSide( | ||
| 69 | + color: MyColours.color_bff6f7, | ||
| 70 | + width: ScreenUtil().setWidth(2))), | ||
| 71 | + focusedBorder: OutlineInputBorder( | ||
| 72 | + borderSide: BorderSide( | ||
| 73 | + color: MyColours.color_bff6f7, | ||
| 74 | + width: ScreenUtil().setWidth(2))), | ||
| 75 | + ), | ||
| 76 | + onChanged: (value) {}, | ||
| 77 | + onEditingComplete: () { | ||
| 78 | + FocusScope.of(context) | ||
| 79 | + .requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 80 | + }, | ||
| 81 | + keyboardType: TextInputType.text, | ||
| 82 | + ), | ||
| 83 | + VEmptyView(160), | ||
| 84 | + RoundButton( | ||
| 85 | + text: '下一步', | ||
| 86 | + gradientStart: MyColours.color_199095, | ||
| 87 | + gradientEnd: MyColours.color_199095, | ||
| 88 | + // borderColor: MyColours.color_999999, | ||
| 89 | + radius: ScreenUtil().setWidth(20), | ||
| 90 | + fontSize: 28, | ||
| 91 | + isBold: false, | ||
| 92 | + onPressed: () { | ||
| 93 | + NavigatorUtil.goEnterStoreTimePage(context); | ||
| 94 | + }, | ||
| 95 | + ) | ||
| 96 | + ]))))); | ||
| 97 | + ; | ||
| 98 | + } | ||
| 99 | +} |
lib/pages/create_store/enter_store_time.dart
0 → 100644
| 1 | +import 'package:flutter/material.dart'; | ||
| 2 | +import 'package:flutter_screenutil/screenutil.dart'; | ||
| 3 | +import 'package:one_key/res/colors.dart'; | ||
| 4 | +import 'package:one_key/utils/navigator_util.dart'; | ||
| 5 | +import 'package:one_key/widgets/round_button.dart'; | ||
| 6 | +import 'package:one_key/widgets/system_app_bar.dart'; | ||
| 7 | +import 'package:one_key/widgets/v_empty_view.dart'; | ||
| 8 | + | ||
| 9 | +class EnterStoreTimePage extends StatefulWidget { | ||
| 10 | + EnterStoreTimePage({Key key}) : super(key: key); | ||
| 11 | + | ||
| 12 | + @override | ||
| 13 | + _EnterStoreTimePageState createState() => _EnterStoreTimePageState(); | ||
| 14 | +} | ||
| 15 | + | ||
| 16 | +class _EnterStoreTimePageState extends State<EnterStoreTimePage> { | ||
| 17 | + @override | ||
| 18 | + Widget build(BuildContext context) { | ||
| 19 | + return Scaffold( | ||
| 20 | + backgroundColor: Colors.white, | ||
| 21 | + appBar: SystemAppBar( | ||
| 22 | + '', | ||
| 23 | + onTap: () { | ||
| 24 | + Navigator.pop(context); | ||
| 25 | + }, | ||
| 26 | + ), | ||
| 27 | + body: InkWell( | ||
| 28 | + onTap: () { | ||
| 29 | + FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 30 | + }, | ||
| 31 | + child: Container( | ||
| 32 | + padding: EdgeInsets.symmetric( | ||
| 33 | + horizontal: ScreenUtil().setWidth(70), | ||
| 34 | + vertical: ScreenUtil().setWidth(60)), | ||
| 35 | + child: SingleChildScrollView( | ||
| 36 | + child: Column( | ||
| 37 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 38 | + children: [ | ||
| 39 | + Text('您的店铺营业时间是?', | ||
| 40 | + style: TextStyle( | ||
| 41 | + color: MyColours.color_333333, | ||
| 42 | + fontSize: ScreenUtil().setSp(40), | ||
| 43 | + fontWeight: FontWeight.bold)), | ||
| 44 | + VEmptyView(100), | ||
| 45 | + TextField( | ||
| 46 | + // textAlignVertical: TextAlignVertical.bottom, | ||
| 47 | + maxLines: 1, | ||
| 48 | + // //光标颜色 | ||
| 49 | + // cursorColor: | ||
| 50 | + // widget.isSelect ? Colors.white : MyColours.color_199095, | ||
| 51 | + //输入文本的样式 | ||
| 52 | + style: TextStyle( | ||
| 53 | + color: MyColours.color_333333, | ||
| 54 | + fontSize: ScreenUtil().setSp(28), | ||
| 55 | + ), | ||
| 56 | + // focusNode: _codeNode, | ||
| 57 | + decoration: InputDecoration( | ||
| 58 | + contentPadding: EdgeInsets.symmetric( | ||
| 59 | + vertical: ScreenUtil().setWidth(32), | ||
| 60 | + horizontal: ScreenUtil().setWidth(40)), | ||
| 61 | + border: OutlineInputBorder(), | ||
| 62 | + hintText: '请输入营业时间,如09:00-23:00', | ||
| 63 | + hintStyle: TextStyle( | ||
| 64 | + color: MyColours.color_999999, | ||
| 65 | + fontSize: ScreenUtil().setSp(28), | ||
| 66 | + ), | ||
| 67 | + enabledBorder: OutlineInputBorder( | ||
| 68 | + borderSide: BorderSide( | ||
| 69 | + color: MyColours.color_bff6f7, | ||
| 70 | + width: ScreenUtil().setWidth(2))), | ||
| 71 | + focusedBorder: OutlineInputBorder( | ||
| 72 | + borderSide: BorderSide( | ||
| 73 | + color: MyColours.color_bff6f7, | ||
| 74 | + width: ScreenUtil().setWidth(2))), | ||
| 75 | + ), | ||
| 76 | + onChanged: (value) {}, | ||
| 77 | + onEditingComplete: () { | ||
| 78 | + FocusScope.of(context) | ||
| 79 | + .requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 80 | + }, | ||
| 81 | + keyboardType: TextInputType.text, | ||
| 82 | + ), | ||
| 83 | + VEmptyView(160), | ||
| 84 | + RoundButton( | ||
| 85 | + text: '下一步', | ||
| 86 | + gradientStart: MyColours.color_199095, | ||
| 87 | + gradientEnd: MyColours.color_199095, | ||
| 88 | + // borderColor: MyColours.color_999999, | ||
| 89 | + radius: ScreenUtil().setWidth(20), | ||
| 90 | + fontSize: 28, | ||
| 91 | + isBold: false, | ||
| 92 | + onPressed: () { | ||
| 93 | + NavigatorUtil.goEnterStorePhonePage(context); | ||
| 94 | + }, | ||
| 95 | + ) | ||
| 96 | + ]))))); | ||
| 97 | + ; | ||
| 98 | + } | ||
| 99 | +} |
| @@ -78,14 +78,19 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | @@ -78,14 +78,19 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | ||
| 78 | imgModel.file = File(pickedFile.path); | 78 | imgModel.file = File(pickedFile.path); |
| 79 | imgModel.process = 0.01; | 79 | imgModel.process = 0.01; |
| 80 | imgModel.fileType = FileType.image; | 80 | imgModel.fileType = FileType.image; |
| 81 | - widget.model.imageList.add(imgModel); | 81 | + widget.model.imageListDenvironment.add(imgModel); |
| 82 | } else { | 82 | } else { |
| 83 | print('No image selected.'); | 83 | print('No image selected.'); |
| 84 | } | 84 | } |
| 85 | }); | 85 | }); |
| 86 | if (pickedFile != null) { | 86 | if (pickedFile != null) { |
| 87 | - UploadImageUtil().startUpload(context, File(pickedFile.path), | ||
| 88 | - widget.model.imageList.length - 1, true, widget.model); | 87 | + UploadImageUtil().startUpload( |
| 88 | + context, | ||
| 89 | + File(pickedFile.path), | ||
| 90 | + widget.model.imageListDenvironment.length - 1, | ||
| 91 | + true, | ||
| 92 | + widget.model, | ||
| 93 | + UploadType.EnvironmentUploadType); | ||
| 89 | } | 94 | } |
| 90 | } | 95 | } |
| 91 | 96 | ||
| @@ -116,10 +121,15 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | @@ -116,10 +121,15 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | ||
| 116 | imgModel.fileType = FileType.video; | 121 | imgModel.fileType = FileType.video; |
| 117 | imgModel.thumbnailPath = thumbnailPath; | 122 | imgModel.thumbnailPath = thumbnailPath; |
| 118 | imgModel.duration = duration; | 123 | imgModel.duration = duration; |
| 119 | - widget.model.imageList.add(imgModel); | 124 | + widget.model.imageListDenvironment.add(imgModel); |
| 120 | setState(() {}); | 125 | setState(() {}); |
| 121 | - UploadImageUtil().startUpload(context, File(pickedFile.path), | ||
| 122 | - widget.model.imageList.length - 1, true, widget.model); | 126 | + UploadImageUtil().startUpload( |
| 127 | + context, | ||
| 128 | + File(pickedFile.path), | ||
| 129 | + widget.model.imageListDenvironment.length - 1, | ||
| 130 | + true, | ||
| 131 | + widget.model, | ||
| 132 | + UploadType.EnvironmentUploadType); | ||
| 123 | } else { | 133 | } else { |
| 124 | print('No image selected.'); | 134 | print('No image selected.'); |
| 125 | } | 135 | } |
| @@ -145,7 +155,8 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | @@ -145,7 +155,8 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | ||
| 145 | // the check box disable color | 155 | // the check box disable color |
| 146 | itemRadio: 0.88, | 156 | itemRadio: 0.88, |
| 147 | // the content item radio | 157 | // the content item radio |
| 148 | - maxSelected: widget.maxImageNumber - widget.model.imageList.length, | 158 | + maxSelected: |
| 159 | + widget.maxImageNumber - widget.model.imageListDenvironment.length, | ||
| 149 | // max picker image count | 160 | // max picker image count |
| 150 | // provider: I18nProvider.english, | 161 | // provider: I18nProvider.english, |
| 151 | provider: I18nProvider.chinese, | 162 | provider: I18nProvider.chinese, |
| @@ -180,12 +191,17 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | @@ -180,12 +191,17 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | ||
| 180 | imgModel.file = File(file.absolute.path); | 191 | imgModel.file = File(file.absolute.path); |
| 181 | imgModel.process = 0.01; | 192 | imgModel.process = 0.01; |
| 182 | imgModel.fileType = FileType.image; | 193 | imgModel.fileType = FileType.image; |
| 183 | - widget.model.imageList.add(imgModel); | 194 | + widget.model.imageListDenvironment.add(imgModel); |
| 184 | }); | 195 | }); |
| 185 | - UploadImageUtil().startUpload(context, File(file.absolute.path), | ||
| 186 | - widget.model.imageList.length - 1, false, widget.model); | 196 | + UploadImageUtil().startUpload( |
| 197 | + context, | ||
| 198 | + File(file.absolute.path), | ||
| 199 | + widget.model.imageListDenvironment.length - 1, | ||
| 200 | + false, | ||
| 201 | + widget.model, | ||
| 202 | + UploadType.EnvironmentUploadType); | ||
| 187 | // startUpload(File(file.absolute.path), | 203 | // startUpload(File(file.absolute.path), |
| 188 | - // _uploadImageProvider.imageList.length - 1, false); | 204 | + // _uploadImageProvider.imageListDenvironment.length - 1, false); |
| 189 | } | 205 | } |
| 190 | } | 206 | } |
| 191 | } | 207 | } |
| @@ -293,11 +309,13 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | @@ -293,11 +309,13 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | ||
| 293 | @override | 309 | @override |
| 294 | Widget build(BuildContext context) { | 310 | Widget build(BuildContext context) { |
| 295 | return _getGridImg( | 311 | return _getGridImg( |
| 296 | - widget.model.imageList.length < widget.maxImageNumber | ||
| 297 | - ? widget.model.imageList.length + 2 | ||
| 298 | - : widget.model.imageList.length, | 312 | + widget.model.imageListDenvironment.length < widget.maxImageNumber |
| 313 | + ? widget.model.imageListDenvironment.length + 2 | ||
| 314 | + : widget.model.imageListDenvironment.length, | ||
| 299 | context, | 315 | context, |
| 300 | - widget.model.imageList.length == widget.maxImageNumber ? true : false); | 316 | + widget.model.imageListDenvironment.length == widget.maxImageNumber |
| 317 | + ? true | ||
| 318 | + : false); | ||
| 301 | } | 319 | } |
| 302 | 320 | ||
| 303 | //查看大图 | 321 | //查看大图 |
| @@ -423,17 +441,20 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | @@ -423,17 +441,20 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | ||
| 423 | ); | 441 | ); |
| 424 | } | 442 | } |
| 425 | 443 | ||
| 426 | - return widget.model.imageList.length < 1 | 444 | + return widget.model.imageListDenvironment.length < 1 |
| 427 | ? Text('') | 445 | ? Text('') |
| 428 | : InkWell( | 446 | : InkWell( |
| 429 | onTap: () { | 447 | onTap: () { |
| 430 | - if (widget.model.imageList[index].process == 1) { | 448 | + if (widget.model.imageListDenvironment[index].process == |
| 449 | + 1) { | ||
| 431 | widget.model.imageQiniuUrlList = []; | 450 | widget.model.imageQiniuUrlList = []; |
| 432 | - if (widget.model.imageList[index].qiniuUrl != null) { | ||
| 433 | - if (widget.model.imageList[index].fileType == | 451 | + if (widget.model.imageListDenvironment[index].qiniuUrl != |
| 452 | + null) { | ||
| 453 | + if (widget | ||
| 454 | + .model.imageListDenvironment[index].fileType == | ||
| 434 | FileType.image) { | 455 | FileType.image) { |
| 435 | List<UploadImgModel> temp = []; | 456 | List<UploadImgModel> temp = []; |
| 436 | - temp.addAll(widget.model.imageList); | 457 | + temp.addAll(widget.model.imageListDenvironment); |
| 437 | temp.removeWhere( | 458 | temp.removeWhere( |
| 438 | (element) => element.fileType == FileType.video); | 459 | (element) => element.fileType == FileType.video); |
| 439 | for (int i = 0; i < temp.length; i++) { | 460 | for (int i = 0; i < temp.length; i++) { |
| @@ -444,10 +465,12 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | @@ -444,10 +465,12 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | ||
| 444 | ///没有上传完成的不可以点击 | 465 | ///没有上传完成的不可以点击 |
| 445 | _showPhotoView( | 466 | _showPhotoView( |
| 446 | context, index, widget.model.imageQiniuUrlList); | 467 | context, index, widget.model.imageQiniuUrlList); |
| 447 | - } else if (widget.model.imageList[index].fileType == | 468 | + } else if (widget |
| 469 | + .model.imageListDenvironment[index].fileType == | ||
| 448 | FileType.video) { | 470 | FileType.video) { |
| 449 | NavigatorUtil.goPlayVideoPage(context, | 471 | NavigatorUtil.goPlayVideoPage(context, |
| 450 | - urlStr: widget.model.imageList[index].qiniuUrl); | 472 | + urlStr: widget |
| 473 | + .model.imageListDenvironment[index].qiniuUrl); | ||
| 451 | } | 474 | } |
| 452 | } | 475 | } |
| 453 | } | 476 | } |
| @@ -457,16 +480,18 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | @@ -457,16 +480,18 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | ||
| 457 | Stack( | 480 | Stack( |
| 458 | alignment: Alignment.topRight, | 481 | alignment: Alignment.topRight, |
| 459 | children: [ | 482 | children: [ |
| 460 | - widget.model.imageList[index].fileType == | 483 | + widget.model.imageListDenvironment[index].fileType == |
| 461 | FileType.image | 484 | FileType.image |
| 462 | ? Image.file( | 485 | ? Image.file( |
| 463 | - widget.model.imageList[index].file, | 486 | + widget |
| 487 | + .model.imageListDenvironment[index].file, | ||
| 464 | fit: BoxFit.cover, | 488 | fit: BoxFit.cover, |
| 465 | width: ScreenUtil().setWidth(100 * 2), | 489 | width: ScreenUtil().setWidth(100 * 2), |
| 466 | height: ScreenUtil().setWidth(100 * 2), | 490 | height: ScreenUtil().setWidth(100 * 2), |
| 467 | ) | 491 | ) |
| 468 | : Image.file( | 492 | : Image.file( |
| 469 | - widget.model.imageList[index].thumbnailPath, | 493 | + widget.model.imageListDenvironment[index] |
| 494 | + .thumbnailPath, | ||
| 470 | fit: BoxFit.cover, | 495 | fit: BoxFit.cover, |
| 471 | width: ScreenUtil().setWidth(100 * 2), | 496 | width: ScreenUtil().setWidth(100 * 2), |
| 472 | height: ScreenUtil().setWidth(100 * 2), | 497 | height: ScreenUtil().setWidth(100 * 2), |
| @@ -498,7 +523,9 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | @@ -498,7 +523,9 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | ||
| 498 | // ), | 523 | // ), |
| 499 | , | 524 | , |
| 500 | Offstage( | 525 | Offstage( |
| 501 | - offstage: widget.model.imageList[index].process < 1, | 526 | + offstage: widget.model.imageListDenvironment[index] |
| 527 | + .process < | ||
| 528 | + 1, | ||
| 502 | child: GestureDetector( | 529 | child: GestureDetector( |
| 503 | child: Image.asset( | 530 | child: Image.asset( |
| 504 | Utils.getImgPath("delete"), | 531 | Utils.getImgPath("delete"), |
| @@ -508,10 +535,11 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | @@ -508,10 +535,11 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | ||
| 508 | onTap: () { | 535 | onTap: () { |
| 509 | //点击删除按钮 | 536 | //点击删除按钮 |
| 510 | setState(() { | 537 | setState(() { |
| 511 | - widget.model.imageList.removeWhere( | ||
| 512 | - (element) => | 538 | + widget.model.imageListDenvironment |
| 539 | + .removeWhere((element) => | ||
| 513 | element == | 540 | element == |
| 514 | - widget.model.imageList[index]); | 541 | + widget.model |
| 542 | + .imageListDenvironment[index]); | ||
| 515 | widget.model.imageQiniuUrlList.removeWhere( | 543 | widget.model.imageQiniuUrlList.removeWhere( |
| 516 | (element) => | 544 | (element) => |
| 517 | element == | 545 | element == |
| @@ -524,11 +552,12 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | @@ -524,11 +552,12 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | ||
| 524 | ], | 552 | ], |
| 525 | ), | 553 | ), |
| 526 | // Offstage( | 554 | // Offstage( |
| 527 | - // offstage: widget.model.imageList[index].process == 1, | ||
| 528 | - // child: Progress(widget.model.imageList[index].process), | 555 | + // offstage: widget.model.imageListDenvironment[index].process == 1, |
| 556 | + // child: Progress(widget.model.imageListDenvironment[index].process), | ||
| 529 | // ), | 557 | // ), |
| 530 | - widget.model.imageList[index].process == 1 | ||
| 531 | - ? widget.model.imageList[index].fileType == | 558 | + widget.model.imageListDenvironment[index].process == 1 |
| 559 | + ? widget.model.imageListDenvironment[index] | ||
| 560 | + .fileType == | ||
| 532 | FileType.video | 561 | FileType.video |
| 533 | ? Align( | 562 | ? Align( |
| 534 | alignment: Alignment.center, | 563 | alignment: Alignment.center, |
| @@ -537,8 +566,10 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | @@ -537,8 +566,10 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | ||
| 537 | width: ScreenUtil().setWidth(40), | 566 | width: ScreenUtil().setWidth(40), |
| 538 | )) | 567 | )) |
| 539 | : Container() | 568 | : Container() |
| 540 | - : Progress(widget.model.imageList[index].process), | ||
| 541 | - widget.model.imageList[index].fileType == FileType.video | 569 | + : Progress(widget |
| 570 | + .model.imageListDenvironment[index].process), | ||
| 571 | + widget.model.imageListDenvironment[index].fileType == | ||
| 572 | + FileType.video | ||
| 542 | ? Align( | 573 | ? Align( |
| 543 | alignment: Alignment.bottomRight, | 574 | alignment: Alignment.bottomRight, |
| 544 | child: Padding( | 575 | child: Padding( |
| @@ -546,7 +577,7 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | @@ -546,7 +577,7 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | ||
| 546 | bottom: ScreenUtil().setWidth(10), | 577 | bottom: ScreenUtil().setWidth(10), |
| 547 | right: ScreenUtil().setWidth(10)), | 578 | right: ScreenUtil().setWidth(10)), |
| 548 | child: Text( | 579 | child: Text( |
| 549 | - '00:${widget.model.imageList[index].duration}', | 580 | + '00:${widget.model.imageListDenvironment[index].duration}', |
| 550 | style: TextStyle( | 581 | style: TextStyle( |
| 551 | color: MyColours.color_333333, | 582 | color: MyColours.color_333333, |
| 552 | fontSize: ScreenUtil().setSp(24)), | 583 | fontSize: ScreenUtil().setSp(24)), |
| 1 | import 'dart:async'; | 1 | import 'dart:async'; |
| 2 | 2 | ||
| 3 | +import 'package:common_utils/common_utils.dart'; | ||
| 3 | import 'package:flutter/material.dart'; | 4 | import 'package:flutter/material.dart'; |
| 4 | import 'package:flutter_screenutil/screenutil.dart'; | 5 | import 'package:flutter_screenutil/screenutil.dart'; |
| 5 | import 'package:one_key/app.dart'; | 6 | import 'package:one_key/app.dart'; |
| 7 | +import 'package:one_key/provider/other_login_provider.dart'; | ||
| 6 | import 'package:one_key/res/colors.dart'; | 8 | import 'package:one_key/res/colors.dart'; |
| 7 | import 'package:one_key/utils/navigator_util.dart'; | 9 | import 'package:one_key/utils/navigator_util.dart'; |
| 8 | import 'package:one_key/utils/utils.dart'; | 10 | import 'package:one_key/utils/utils.dart'; |
| @@ -10,6 +12,7 @@ import 'package:one_key/widgets/h_empty_view.dart'; | @@ -10,6 +12,7 @@ import 'package:one_key/widgets/h_empty_view.dart'; | ||
| 10 | import 'package:one_key/widgets/round_button.dart'; | 12 | import 'package:one_key/widgets/round_button.dart'; |
| 11 | import 'package:one_key/widgets/system_app_bar.dart'; | 13 | import 'package:one_key/widgets/system_app_bar.dart'; |
| 12 | import 'package:one_key/widgets/v_empty_view.dart'; | 14 | import 'package:one_key/widgets/v_empty_view.dart'; |
| 15 | +import 'package:provider/provider.dart'; | ||
| 13 | 16 | ||
| 14 | class BindingPhone extends StatefulWidget { | 17 | class BindingPhone extends StatefulWidget { |
| 15 | BindingPhone({Key key}) : super(key: key); | 18 | BindingPhone({Key key}) : super(key: key); |
| @@ -30,6 +33,8 @@ class _BindingPhoneState extends State<BindingPhone> { | @@ -30,6 +33,8 @@ class _BindingPhoneState extends State<BindingPhone> { | ||
| 30 | 33 | ||
| 31 | String phone; | 34 | String phone; |
| 32 | String code; | 35 | String code; |
| 36 | + bool enabled = true; //手机号码框是否可以编辑 | ||
| 37 | + bool codeEnabled = false; //验证码是否可用 | ||
| 33 | 38 | ||
| 34 | @override | 39 | @override |
| 35 | void initState() { | 40 | void initState() { |
| @@ -46,14 +51,18 @@ class _BindingPhoneState extends State<BindingPhone> { | @@ -46,14 +51,18 @@ class _BindingPhoneState extends State<BindingPhone> { | ||
| 46 | } | 51 | } |
| 47 | 52 | ||
| 48 | ///倒计时方法 | 53 | ///倒计时方法 |
| 49 | - startCountdown() { | ||
| 50 | - Utils.showToast('短信验证码已发送,请注意查收'); | ||
| 51 | - countdownTime = 60; | 54 | + startCountdown(OtherLoginProvider model) { |
| 55 | + countdownTime = 300; | ||
| 52 | final call = (timer) { | 56 | final call = (timer) { |
| 53 | setState(() { | 57 | setState(() { |
| 54 | if (countdownTime < 1) { | 58 | if (countdownTime < 1) { |
| 59 | + // model.code = null; | ||
| 60 | + enabled = true; | ||
| 61 | + codeEnabled = false; | ||
| 55 | _timer.cancel(); | 62 | _timer.cancel(); |
| 56 | } else { | 63 | } else { |
| 64 | + enabled = false; | ||
| 65 | + codeEnabled = true; | ||
| 57 | countdownTime -= 1; | 66 | countdownTime -= 1; |
| 58 | } | 67 | } |
| 59 | }); | 68 | }); |
| @@ -85,179 +94,220 @@ class _BindingPhoneState extends State<BindingPhone> { | @@ -85,179 +94,220 @@ class _BindingPhoneState extends State<BindingPhone> { | ||
| 85 | Expanded( | 94 | Expanded( |
| 86 | child: SingleChildScrollView( | 95 | child: SingleChildScrollView( |
| 87 | controller: _controller, | 96 | controller: _controller, |
| 88 | - child: Column( | ||
| 89 | - crossAxisAlignment: CrossAxisAlignment.start, | ||
| 90 | - children: [ | ||
| 91 | - Text('绑定您的手机号', | ||
| 92 | - style: TextStyle( | ||
| 93 | - fontWeight: FontWeight.bold, | ||
| 94 | - color: MyColours.color_333333, | ||
| 95 | - fontSize: ScreenUtil().setSp(40))), | ||
| 96 | - VEmptyView(100), | ||
| 97 | - Container( | ||
| 98 | - height: ScreenUtil().setHeight(52 * 2), | ||
| 99 | - // width: ScreenUtil().setWidth(611), | ||
| 100 | - padding: EdgeInsets.only( | ||
| 101 | - left: ScreenUtil().setWidth(20)), | ||
| 102 | - margin: EdgeInsets.only( | ||
| 103 | - top: ScreenUtil().setHeight(8)), | ||
| 104 | - alignment: Alignment.center, | ||
| 105 | - decoration: BoxDecoration( | ||
| 106 | - border: Border.all( | ||
| 107 | - color: MyColours.color_bff6f7, | ||
| 108 | - width: ScreenUtil().setWidth(2)), | ||
| 109 | - borderRadius: BorderRadius.circular( | ||
| 110 | - ScreenUtil().setWidth(10))), | ||
| 111 | - child: Row( | ||
| 112 | - crossAxisAlignment: CrossAxisAlignment.center, | ||
| 113 | - children: <Widget>[ | ||
| 114 | - HEmptyView(30), | ||
| 115 | - Text( | ||
| 116 | - "手机号", | ||
| 117 | - style: TextStyle( | ||
| 118 | - color: MyColours.color_333333, | ||
| 119 | - fontSize: ScreenUtil().setSp(26)), | ||
| 120 | - ), | ||
| 121 | - HEmptyView(30), | ||
| 122 | - Expanded( | ||
| 123 | - child: TextField( | ||
| 124 | - focusNode: _phoneNode, | 97 | + child: Consumer<OtherLoginProvider>( |
| 98 | + builder: (context, model, _) { | ||
| 99 | + return Column( | ||
| 100 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 101 | + children: [ | ||
| 102 | + Text('绑定您的手机号', | ||
| 103 | + style: TextStyle( | ||
| 104 | + fontWeight: FontWeight.bold, | ||
| 105 | + color: MyColours.color_333333, | ||
| 106 | + fontSize: ScreenUtil().setSp(40))), | ||
| 107 | + VEmptyView(100), | ||
| 108 | + Container( | ||
| 109 | + height: ScreenUtil().setHeight(52 * 2), | ||
| 110 | + // width: ScreenUtil().setWidth(611), | ||
| 111 | + padding: EdgeInsets.only( | ||
| 112 | + left: ScreenUtil().setWidth(20)), | ||
| 113 | + margin: EdgeInsets.only( | ||
| 114 | + top: ScreenUtil().setHeight(8)), | ||
| 115 | + alignment: Alignment.center, | ||
| 116 | + decoration: BoxDecoration( | ||
| 117 | + border: Border.all( | ||
| 118 | + color: MyColours.color_bff6f7, | ||
| 119 | + width: ScreenUtil().setWidth(2)), | ||
| 120 | + borderRadius: BorderRadius.circular( | ||
| 121 | + ScreenUtil().setWidth(10))), | ||
| 122 | + child: Row( | ||
| 123 | + crossAxisAlignment: CrossAxisAlignment.center, | ||
| 124 | + children: <Widget>[ | ||
| 125 | + HEmptyView(30), | ||
| 126 | + Text( | ||
| 127 | + "手机号", | ||
| 125 | style: TextStyle( | 128 | style: TextStyle( |
| 126 | - color: MyColours.color_353535, | ||
| 127 | - fontSize: ScreenUtil().setSp(28)), | ||
| 128 | - decoration: InputDecoration( | ||
| 129 | - hintText: "请输入手机号", | ||
| 130 | - hintStyle: TextStyle( | ||
| 131 | - color: MyColours.color_999999, | ||
| 132 | - fontSize: ScreenUtil().setSp(26)), | ||
| 133 | - border: InputBorder.none, | ||
| 134 | - contentPadding: EdgeInsets.fromLTRB( | ||
| 135 | - 0, | ||
| 136 | - ScreenUtil().setWidth(28), | ||
| 137 | - ScreenUtil().setWidth(30), | ||
| 138 | - ScreenUtil().setWidth(28)), | ||
| 139 | - ), | ||
| 140 | - onChanged: (value) { | ||
| 141 | - phone = value; | ||
| 142 | - }, | ||
| 143 | - onEditingComplete: () { | ||
| 144 | - FocusScope.of(context).requestFocus( | ||
| 145 | - FocusNode()); //点击空白处隐藏键盘 | ||
| 146 | - }, | ||
| 147 | - keyboardType: TextInputType.number, | 129 | + color: MyColours.color_333333, |
| 130 | + fontSize: ScreenUtil().setSp(26)), | ||
| 148 | ), | 131 | ), |
| 149 | - ) | ||
| 150 | - ], | ||
| 151 | - )), | ||
| 152 | - VEmptyView(10), | ||
| 153 | - Container( | ||
| 154 | - height: ScreenUtil().setHeight(52 * 2), | ||
| 155 | - // width: ScreenUtil().setWidth(611), | ||
| 156 | - padding: EdgeInsets.only( | ||
| 157 | - left: ScreenUtil().setWidth(20)), | ||
| 158 | - margin: EdgeInsets.only( | ||
| 159 | - top: ScreenUtil().setHeight(8)), | ||
| 160 | - alignment: Alignment.center, | ||
| 161 | - decoration: BoxDecoration( | ||
| 162 | - border: Border.all( | ||
| 163 | - color: MyColours.color_bff6f7, | ||
| 164 | - width: ScreenUtil().setWidth(2)), | ||
| 165 | - borderRadius: BorderRadius.circular( | ||
| 166 | - ScreenUtil().setWidth(10))), | ||
| 167 | - child: Row( | ||
| 168 | - crossAxisAlignment: CrossAxisAlignment.center, | ||
| 169 | - children: <Widget>[ | ||
| 170 | - HEmptyView(30), | ||
| 171 | - Text( | ||
| 172 | - "验证码", | ||
| 173 | - style: TextStyle( | ||
| 174 | - color: MyColours.color_333333, | ||
| 175 | - fontSize: ScreenUtil().setSp(26)), | ||
| 176 | - ), | ||
| 177 | - HEmptyView(30), | ||
| 178 | - Expanded( | ||
| 179 | - child: TextField( | ||
| 180 | - focusNode: _codeNode, | 132 | + HEmptyView(30), |
| 133 | + Expanded( | ||
| 134 | + child: TextField( | ||
| 135 | + enabled: enabled, | ||
| 136 | + focusNode: _phoneNode, | ||
| 137 | + style: TextStyle( | ||
| 138 | + color: MyColours.color_353535, | ||
| 139 | + fontSize: ScreenUtil().setSp(28)), | ||
| 140 | + decoration: InputDecoration( | ||
| 141 | + hintText: "请输入手机号", | ||
| 142 | + hintStyle: TextStyle( | ||
| 143 | + color: MyColours.color_999999, | ||
| 144 | + fontSize: ScreenUtil().setSp(26)), | ||
| 145 | + border: InputBorder.none, | ||
| 146 | + contentPadding: EdgeInsets.fromLTRB( | ||
| 147 | + 0, | ||
| 148 | + ScreenUtil().setWidth(28), | ||
| 149 | + ScreenUtil().setWidth(30), | ||
| 150 | + ScreenUtil().setWidth(28)), | ||
| 151 | + ), | ||
| 152 | + onChanged: (value) { | ||
| 153 | + phone = value; | ||
| 154 | + }, | ||
| 155 | + onEditingComplete: () { | ||
| 156 | + FocusScope.of(context).requestFocus( | ||
| 157 | + FocusNode()); //点击空白处隐藏键盘 | ||
| 158 | + }, | ||
| 159 | + keyboardType: TextInputType.number, | ||
| 160 | + ), | ||
| 161 | + ) | ||
| 162 | + ], | ||
| 163 | + )), | ||
| 164 | + VEmptyView(10), | ||
| 165 | + Container( | ||
| 166 | + height: ScreenUtil().setHeight(52 * 2), | ||
| 167 | + // width: ScreenUtil().setWidth(611), | ||
| 168 | + padding: EdgeInsets.only( | ||
| 169 | + left: ScreenUtil().setWidth(20)), | ||
| 170 | + margin: EdgeInsets.only( | ||
| 171 | + top: ScreenUtil().setHeight(8)), | ||
| 172 | + alignment: Alignment.center, | ||
| 173 | + decoration: BoxDecoration( | ||
| 174 | + border: Border.all( | ||
| 175 | + color: MyColours.color_bff6f7, | ||
| 176 | + width: ScreenUtil().setWidth(2)), | ||
| 177 | + borderRadius: BorderRadius.circular( | ||
| 178 | + ScreenUtil().setWidth(10))), | ||
| 179 | + child: Row( | ||
| 180 | + crossAxisAlignment: CrossAxisAlignment.center, | ||
| 181 | + children: <Widget>[ | ||
| 182 | + HEmptyView(30), | ||
| 183 | + Text( | ||
| 184 | + "验证码", | ||
| 181 | style: TextStyle( | 185 | style: TextStyle( |
| 182 | - color: MyColours.color_353535, | ||
| 183 | - fontSize: ScreenUtil().setSp(28)), | ||
| 184 | - decoration: InputDecoration( | ||
| 185 | - hintText: "请输入验证码", | ||
| 186 | - hintStyle: TextStyle( | ||
| 187 | - color: MyColours.color_999999, | ||
| 188 | - fontSize: ScreenUtil().setSp(26)), | ||
| 189 | - border: InputBorder.none, | ||
| 190 | - contentPadding: EdgeInsets.fromLTRB( | ||
| 191 | - 0, | ||
| 192 | - ScreenUtil().setWidth(28), | ||
| 193 | - ScreenUtil().setWidth(30), | ||
| 194 | - ScreenUtil().setWidth(28)), | 186 | + color: MyColours.color_333333, |
| 187 | + fontSize: ScreenUtil().setSp(26)), | ||
| 188 | + ), | ||
| 189 | + HEmptyView(30), | ||
| 190 | + Expanded( | ||
| 191 | + child: TextField( | ||
| 192 | + focusNode: _codeNode, | ||
| 193 | + style: TextStyle( | ||
| 194 | + color: MyColours.color_353535, | ||
| 195 | + fontSize: ScreenUtil().setSp(28)), | ||
| 196 | + decoration: InputDecoration( | ||
| 197 | + hintText: "请输入验证码", | ||
| 198 | + hintStyle: TextStyle( | ||
| 199 | + color: MyColours.color_999999, | ||
| 200 | + fontSize: ScreenUtil().setSp(26)), | ||
| 201 | + border: InputBorder.none, | ||
| 202 | + contentPadding: EdgeInsets.fromLTRB( | ||
| 203 | + 0, | ||
| 204 | + ScreenUtil().setWidth(28), | ||
| 205 | + ScreenUtil().setWidth(30), | ||
| 206 | + ScreenUtil().setWidth(28)), | ||
| 207 | + ), | ||
| 208 | + onChanged: (value) { | ||
| 209 | + code = value; | ||
| 210 | + }, | ||
| 211 | + onEditingComplete: () { | ||
| 212 | + FocusScope.of(context).requestFocus( | ||
| 213 | + FocusNode()); //点击空白处隐藏键盘 | ||
| 214 | + }, | ||
| 215 | + keyboardType: TextInputType.number, | ||
| 195 | ), | 216 | ), |
| 196 | - onChanged: (value) { | ||
| 197 | - code = value; | ||
| 198 | - }, | ||
| 199 | - onEditingComplete: () { | ||
| 200 | - FocusScope.of(context).requestFocus( | ||
| 201 | - FocusNode()); //点击空白处隐藏键盘 | 217 | + ), |
| 218 | + HEmptyView(10), | ||
| 219 | + RoundButton( | ||
| 220 | + height: ScreenUtil().setWidth(84), | ||
| 221 | + text: countdownTime > 0 | ||
| 222 | + ? "${Utils.durationTransform(countdownTime)}后重新获取" | ||
| 223 | + : "获取验证码", | ||
| 224 | + radius: ScreenUtil().setWidth(10), | ||
| 225 | + textColor: MyColours.color_199095, | ||
| 226 | + gradientStart: MyColours.color_ffffff, | ||
| 227 | + gradientEnd: MyColours.color_ffffff, | ||
| 228 | + borderColor: Colors.transparent, | ||
| 229 | + fontSize: 26, | ||
| 230 | + isBold: false, | ||
| 231 | + onPressed: () async { | ||
| 232 | + if (countdownTime == 0) { | ||
| 233 | + if (phone == null || | ||
| 234 | + phone.trim().length == 0) { | ||
| 235 | + Utils.showToast('请输入手机号码'); | ||
| 236 | + return; | ||
| 237 | + } | ||
| 238 | + if (!Utils.phoneRegExp(phone)) { | ||
| 239 | + Utils.showToast( | ||
| 240 | + '您输入的手机号码格式不正确,请重新输入'); | ||
| 241 | + return; | ||
| 242 | + } | ||
| 243 | + model.code = Utils.randomBit(4); | ||
| 244 | + Map<String, String> params = { | ||
| 245 | + "phone": phone, | ||
| 246 | + "code": model.code, | ||
| 247 | + }; | ||
| 248 | + startCountdown(model); | ||
| 249 | + bool success = await model | ||
| 250 | + .getPhoneCode(context, params); | ||
| 251 | + if (!success) { | ||
| 252 | + _timer.cancel(); | ||
| 253 | + } else { | ||
| 254 | + Utils.showToast('短信验证码已发送,请注意查收'); | ||
| 255 | + } | ||
| 256 | + } | ||
| 202 | }, | 257 | }, |
| 203 | - keyboardType: TextInputType.number, | ||
| 204 | ), | 258 | ), |
| 205 | - ), | ||
| 206 | - HEmptyView(10), | ||
| 207 | - RoundButton( | ||
| 208 | - height: ScreenUtil().setWidth(84), | ||
| 209 | - text: countdownTime > 0 | ||
| 210 | - ? "${countdownTime}s后重新获取" | ||
| 211 | - : "获取验证码", | ||
| 212 | - radius: ScreenUtil().setWidth(10), | ||
| 213 | - textColor: MyColours.color_199095, | ||
| 214 | - gradientStart: MyColours.color_ffffff, | ||
| 215 | - gradientEnd: MyColours.color_ffffff, | ||
| 216 | - borderColor: Colors.transparent, | ||
| 217 | - fontSize: 26, | ||
| 218 | - isBold: false, | ||
| 219 | - onPressed: () { | ||
| 220 | - if (countdownTime == 0) { | ||
| 221 | - startCountdown(); | ||
| 222 | - } | ||
| 223 | - }, | ||
| 224 | - ), | ||
| 225 | - HEmptyView(20), | ||
| 226 | - ], | ||
| 227 | - )), | ||
| 228 | - VEmptyView(120), | ||
| 229 | - RoundButton( | ||
| 230 | - text: '提交', | ||
| 231 | - gradientStart: MyColours.color_199095, | ||
| 232 | - gradientEnd: MyColours.color_199095, | ||
| 233 | - // borderColor: MyColours.color_999999, | ||
| 234 | - radius: ScreenUtil().setWidth(20), | ||
| 235 | - fontSize: 34, | ||
| 236 | - isBold: false, | ||
| 237 | - onPressed: () { | ||
| 238 | - if (phone == null || phone.trim().length == 0) { | ||
| 239 | - Utils.showToast('请输入手机号码'); | ||
| 240 | - return; | ||
| 241 | - } | ||
| 242 | - if (code == null || code.trim().length == 0) { | ||
| 243 | - Utils.showToast('请输入验证码'); | ||
| 244 | - return; | ||
| 245 | - } | ||
| 246 | - | ||
| 247 | - //接口确认验证码是否正确 | 259 | + HEmptyView(20), |
| 260 | + ], | ||
| 261 | + )), | ||
| 262 | + VEmptyView(120), | ||
| 263 | + RoundButton( | ||
| 264 | + text: '确定', | ||
| 265 | + gradientStart: MyColours.color_199095, | ||
| 266 | + gradientEnd: MyColours.color_199095, | ||
| 267 | + // borderColor: MyColours.color_999999, | ||
| 268 | + radius: ScreenUtil().setWidth(20), | ||
| 269 | + fontSize: 34, | ||
| 270 | + isBold: false, | ||
| 271 | + onPressed: () { | ||
| 272 | + NavigatorUtil.goIfNeedCreateStorePage(context); | ||
| 273 | + if (phone == null || phone.trim().length == 0) { | ||
| 274 | + Utils.showToast('请输入手机号码'); | ||
| 275 | + return; | ||
| 276 | + } | ||
| 277 | + if (code == null || code.trim().length == 0) { | ||
| 278 | + Utils.showToast('请输入验证码'); | ||
| 279 | + return; | ||
| 280 | + } | ||
| 281 | + if (model.code != null && !codeEnabled) { | ||
| 282 | + Utils.showToast('验证码已失效,请重新获取'); | ||
| 283 | + return; | ||
| 284 | + } | ||
| 285 | + if (model.code == null) { | ||
| 286 | + Utils.showToast('请获取验证码'); | ||
| 287 | + return; | ||
| 288 | + } | ||
| 289 | + if (model.code != code) { | ||
| 290 | + Utils.showToast('您输入的验证码不正确,请重新输入'); | ||
| 291 | + return; | ||
| 292 | + } | ||
| 293 | + // if (countdownTime < 1) { | ||
| 294 | + // Utils.showToast('验证码已失效,请重新获取'); | ||
| 295 | + // return; | ||
| 296 | + // } | ||
| 248 | 297 | ||
| 249 | - // 正确 | ||
| 250 | - //真正登录成功标志 | ||
| 251 | - App.sp.setBool("isLogin", true); | ||
| 252 | - NavigatorUtil.goIfNeedCreateStorePage(context); | ||
| 253 | - //错误 | ||
| 254 | - // Utils.showToast('您输入的验证码有误,请重新输入'); | ||
| 255 | - }, | ||
| 256 | - ) | 298 | + // 正确 |
| 299 | + //真正登录成功标志 | ||
| 300 | + App.sp.setBool("isLogin", true); | ||
| 301 | + NavigatorUtil.goIfNeedCreateStorePage(context); | ||
| 302 | + //错误 | ||
| 303 | + // Utils.showToast('您输入的验证码有误,请重新输入'); | ||
| 304 | + }, | ||
| 305 | + ) | ||
| 257 | 306 | ||
| 258 | - // Spacer(), | ||
| 259 | - ], | ||
| 260 | - ), | 307 | + // Spacer(), |
| 308 | + ], | ||
| 309 | + ); | ||
| 310 | + }), | ||
| 261 | ), | 311 | ), |
| 262 | ), | 312 | ), |
| 263 | ], | 313 | ], |
| @@ -55,7 +55,7 @@ class _IfNeedCreateStoreState extends State<IfNeedCreateStore> { | @@ -55,7 +55,7 @@ class _IfNeedCreateStoreState extends State<IfNeedCreateStore> { | ||
| 55 | onTap: () { | 55 | onTap: () { |
| 56 | if (noStore) { | 56 | if (noStore) { |
| 57 | //跳转至新建店铺流程 | 57 | //跳转至新建店铺流程 |
| 58 | - NavigatorUtil.goCreateStorePage(context); | 58 | + NavigatorUtil.goEnterStoreNamePage(context); |
| 59 | } else { | 59 | } else { |
| 60 | //进入店铺 | 60 | //进入店铺 |
| 61 | 61 | ||
| @@ -91,7 +91,7 @@ class _IfNeedCreateStoreState extends State<IfNeedCreateStore> { | @@ -91,7 +91,7 @@ class _IfNeedCreateStoreState extends State<IfNeedCreateStore> { | ||
| 91 | child: InkWell( | 91 | child: InkWell( |
| 92 | onTap: () { | 92 | onTap: () { |
| 93 | //跳转至新建店铺流程 | 93 | //跳转至新建店铺流程 |
| 94 | - NavigatorUtil.goCreateStorePage(context); | 94 | + NavigatorUtil.goEnterStoreNamePage(context); |
| 95 | }, | 95 | }, |
| 96 | child: Text( | 96 | child: Text( |
| 97 | '不是我,我要重新建店', | 97 | '不是我,我要重新建店', |
| @@ -36,12 +36,16 @@ class ImgPickerWidget extends StatefulWidget { | @@ -36,12 +36,16 @@ class ImgPickerWidget extends StatefulWidget { | ||
| 36 | final Color borderColor; | 36 | final Color borderColor; |
| 37 | final ValueChanged onChange; | 37 | final ValueChanged onChange; |
| 38 | final int maxImageNumber; | 38 | final int maxImageNumber; |
| 39 | + final UploadImageProvider model; | ||
| 40 | + final UploadType uploadType; | ||
| 39 | ImgPickerWidget( | 41 | ImgPickerWidget( |
| 40 | {Key key, | 42 | {Key key, |
| 41 | this.scrollController, | 43 | this.scrollController, |
| 42 | this.borderColor = Colors.blue, | 44 | this.borderColor = Colors.blue, |
| 43 | this.onChange, | 45 | this.onChange, |
| 44 | - this.maxImageNumber = 5}) | 46 | + this.maxImageNumber = 5, |
| 47 | + this.model, | ||
| 48 | + this.uploadType}) | ||
| 45 | : super(key: key); | 49 | : super(key: key); |
| 46 | 50 | ||
| 47 | @override | 51 | @override |
| @@ -51,7 +55,7 @@ class ImgPickerWidget extends StatefulWidget { | @@ -51,7 +55,7 @@ class ImgPickerWidget extends StatefulWidget { | ||
| 51 | class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | 55 | class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { |
| 52 | final picker = ImagePicker(); | 56 | final picker = ImagePicker(); |
| 53 | // OnlineCheckEditProvider _onlineCheckEditProvider; | 57 | // OnlineCheckEditProvider _onlineCheckEditProvider; |
| 54 | - UploadImageProvider _uploadImageProvider; | 58 | + // UploadImageProvider _uploadImageProvider; |
| 55 | 59 | ||
| 56 | // 用户输入的文件名 | 60 | // 用户输入的文件名 |
| 57 | String key; | 61 | String key; |
| @@ -59,7 +63,7 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | @@ -59,7 +63,7 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | ||
| 59 | int partSize = 4; | 63 | int partSize = 4; |
| 60 | // 用户输入的 token | 64 | // 用户输入的 token |
| 61 | String token; | 65 | String token; |
| 62 | - | 66 | + |
| 63 | /// storage 实例 | 67 | /// storage 实例 |
| 64 | final Storage storage = Storage(); | 68 | final Storage storage = Storage(); |
| 65 | // 控制器,可以用于取消任务、获取上述的状态,进度等信息 | 69 | // 控制器,可以用于取消任务、获取上述的状态,进度等信息 |
| @@ -86,23 +90,36 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | @@ -86,23 +90,36 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | ||
| 86 | UploadImgModel imgModel = UploadImgModel(); | 90 | UploadImgModel imgModel = UploadImgModel(); |
| 87 | imgModel.file = File(pickedFile.path); | 91 | imgModel.file = File(pickedFile.path); |
| 88 | imgModel.process = 0.01; | 92 | imgModel.process = 0.01; |
| 89 | - _uploadImageProvider.imageList.add(imgModel); | 93 | + if (widget.uploadType == UploadType.ConsumptionUploadType) { |
| 94 | + widget.model.imageList.add(imgModel); | ||
| 95 | + } else if (widget.uploadType == UploadType.StoreFrontUploadType) { | ||
| 96 | + widget.model.imageListFront.add(imgModel); | ||
| 97 | + } | ||
| 90 | } else { | 98 | } else { |
| 91 | print('No image selected.'); | 99 | print('No image selected.'); |
| 92 | } | 100 | } |
| 93 | }); | 101 | }); |
| 94 | if (pickedFile != null) { | 102 | if (pickedFile != null) { |
| 95 | - UploadImageUtil().startUpload( | ||
| 96 | - context, | ||
| 97 | - File(pickedFile.path), | ||
| 98 | - _uploadImageProvider.imageList.length - 1, | ||
| 99 | - true, | ||
| 100 | - _uploadImageProvider); | 103 | + List<UploadImgModel> temp = []; |
| 104 | + if (widget.uploadType == UploadType.ConsumptionUploadType) { | ||
| 105 | + temp = widget.model.imageList; | ||
| 106 | + } else if (widget.uploadType == UploadType.StoreFrontUploadType) { | ||
| 107 | + temp = widget.model.imageListFront; | ||
| 108 | + } | ||
| 109 | + UploadImageUtil().startUpload(context, File(pickedFile.path), | ||
| 110 | + temp.length - 1, true, widget.model, widget.uploadType); | ||
| 101 | } | 111 | } |
| 102 | } | 112 | } |
| 103 | 113 | ||
| 104 | ///多图片选择 | 114 | ///多图片选择 |
| 105 | void pickAsset(PickType type, {List<AssetPathEntity> pathList}) async { | 115 | void pickAsset(PickType type, {List<AssetPathEntity> pathList}) async { |
| 116 | + List<UploadImgModel> temp = []; | ||
| 117 | + if (widget.uploadType == UploadType.ConsumptionUploadType) { | ||
| 118 | + temp = widget.model.imageList; | ||
| 119 | + } else if (widget.uploadType == UploadType.StoreFrontUploadType) { | ||
| 120 | + temp = widget.model.imageListFront; | ||
| 121 | + } | ||
| 122 | + | ||
| 106 | /// context is required, other params is optional. | 123 | /// context is required, other params is optional. |
| 107 | List<AssetEntity> imgList = await PhotoPicker.pickAsset( | 124 | List<AssetEntity> imgList = await PhotoPicker.pickAsset( |
| 108 | // BuildContext required | 125 | // BuildContext required |
| @@ -121,8 +138,7 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | @@ -121,8 +138,7 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | ||
| 121 | // the check box disable color | 138 | // the check box disable color |
| 122 | itemRadio: 0.88, | 139 | itemRadio: 0.88, |
| 123 | // the content item radio | 140 | // the content item radio |
| 124 | - maxSelected: | ||
| 125 | - widget.maxImageNumber - _uploadImageProvider.imageList.length, | 141 | + maxSelected: widget.maxImageNumber - temp.length, |
| 126 | // max picker image count | 142 | // max picker image count |
| 127 | // provider: I18nProvider.english, | 143 | // provider: I18nProvider.english, |
| 128 | provider: I18nProvider.chinese, | 144 | provider: I18nProvider.chinese, |
| @@ -156,14 +172,11 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | @@ -156,14 +172,11 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | ||
| 156 | UploadImgModel imgModel = UploadImgModel(); | 172 | UploadImgModel imgModel = UploadImgModel(); |
| 157 | imgModel.file = File(file.absolute.path); | 173 | imgModel.file = File(file.absolute.path); |
| 158 | imgModel.process = 0.01; | 174 | imgModel.process = 0.01; |
| 159 | - _uploadImageProvider.imageList.add(imgModel); | 175 | + |
| 176 | + temp.add(imgModel); | ||
| 160 | }); | 177 | }); |
| 161 | - UploadImageUtil().startUpload( | ||
| 162 | - context, | ||
| 163 | - File(file.absolute.path), | ||
| 164 | - _uploadImageProvider.imageList.length - 1, | ||
| 165 | - false, | ||
| 166 | - _uploadImageProvider); | 178 | + UploadImageUtil().startUpload(context, File(file.absolute.path), |
| 179 | + temp.length - 1, false, widget.model, widget.uploadType); | ||
| 167 | // startUpload(File(file.absolute.path), | 180 | // startUpload(File(file.absolute.path), |
| 168 | // _uploadImageProvider.imageList.length - 1, false); | 181 | // _uploadImageProvider.imageList.length - 1, false); |
| 169 | } | 182 | } |
| @@ -382,20 +395,23 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | @@ -382,20 +395,23 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | ||
| 382 | 395 | ||
| 383 | @override | 396 | @override |
| 384 | Widget build(BuildContext context) { | 397 | Widget build(BuildContext context) { |
| 385 | - _uploadImageProvider = | ||
| 386 | - Provider.of<UploadImageProvider>(context, listen: true); | 398 | + // _uploadImageProvider = |
| 399 | + // Provider.of<UploadImageProvider>(context, listen: true); | ||
| 400 | + List<UploadImgModel> temp = []; | ||
| 401 | + if (widget.uploadType == UploadType.ConsumptionUploadType) { | ||
| 402 | + temp = widget.model.imageList; | ||
| 403 | + } else if (widget.uploadType == UploadType.StoreFrontUploadType) { | ||
| 404 | + temp = widget.model.imageListFront; | ||
| 405 | + } | ||
| 387 | return _getGridImg( | 406 | return _getGridImg( |
| 388 | - _uploadImageProvider.imageList.length < widget.maxImageNumber | ||
| 389 | - ? _uploadImageProvider.imageList.length + 1 | ||
| 390 | - : _uploadImageProvider.imageList.length, | 407 | + temp.length < widget.maxImageNumber ? temp.length + 1 : temp.length, |
| 391 | context, | 408 | context, |
| 392 | - _uploadImageProvider.imageList.length == widget.maxImageNumber | ||
| 393 | - ? true | ||
| 394 | - : false); | 409 | + temp.length == widget.maxImageNumber ? true : false, |
| 410 | + temp); | ||
| 395 | } | 411 | } |
| 396 | 412 | ||
| 397 | /// 九宫格 | 413 | /// 九宫格 |
| 398 | - Widget _getGridImg(count, context, isLinjie) { | 414 | + Widget _getGridImg(count, context, isLinjie, List<UploadImgModel> temp) { |
| 399 | return GridView.builder( | 415 | return GridView.builder( |
| 400 | controller: widget.scrollController, | 416 | controller: widget.scrollController, |
| 401 | // padding: EdgeInsets.only(top: ScreenUtil().getAdapterSize(10)), | 417 | // padding: EdgeInsets.only(top: ScreenUtil().getAdapterSize(10)), |
| @@ -451,24 +467,20 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | @@ -451,24 +467,20 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | ||
| 451 | )), | 467 | )), |
| 452 | ); | 468 | ); |
| 453 | } | 469 | } |
| 454 | - return _uploadImageProvider.imageList.length < 1 | 470 | + return temp.length < 1 |
| 455 | ? Text('') | 471 | ? Text('') |
| 456 | : InkWell( | 472 | : InkWell( |
| 457 | onTap: () { | 473 | onTap: () { |
| 458 | - if (_uploadImageProvider.imageList[index].process == 1) { | ||
| 459 | - _uploadImageProvider.imageQiniuUrlList = []; | ||
| 460 | - if (_uploadImageProvider.imageList[index].qiniuUrl != | ||
| 461 | - null) { | ||
| 462 | - for (int i = 0; | ||
| 463 | - i < _uploadImageProvider.imageList.length; | ||
| 464 | - i++) { | ||
| 465 | - _uploadImageProvider.imageQiniuUrlList | ||
| 466 | - .add(_uploadImageProvider.imageList[i].qiniuUrl); | 474 | + if (temp[index].process == 1) { |
| 475 | + widget.model.imageQiniuUrlList = []; | ||
| 476 | + if (temp[index].qiniuUrl != null) { | ||
| 477 | + for (int i = 0; i < temp.length; i++) { | ||
| 478 | + widget.model.imageQiniuUrlList.add(temp[i].qiniuUrl); | ||
| 467 | } | 479 | } |
| 468 | 480 | ||
| 469 | ///没有上传完成的不可以点击 | 481 | ///没有上传完成的不可以点击 |
| 470 | - _showPhotoView(context, index, | ||
| 471 | - _uploadImageProvider.imageQiniuUrlList); | 482 | + _showPhotoView( |
| 483 | + context, index, widget.model.imageQiniuUrlList); | ||
| 472 | } | 484 | } |
| 473 | } | 485 | } |
| 474 | }, | 486 | }, |
| @@ -478,15 +490,13 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | @@ -478,15 +490,13 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | ||
| 478 | alignment: Alignment.topRight, | 490 | alignment: Alignment.topRight, |
| 479 | children: [ | 491 | children: [ |
| 480 | Image.file( | 492 | Image.file( |
| 481 | - _uploadImageProvider.imageList[index].file, | 493 | + temp[index].file, |
| 482 | fit: BoxFit.cover, | 494 | fit: BoxFit.cover, |
| 483 | width: ScreenUtil().setWidth(100 * 2), | 495 | width: ScreenUtil().setWidth(100 * 2), |
| 484 | height: ScreenUtil().setWidth(100 * 2), | 496 | height: ScreenUtil().setWidth(100 * 2), |
| 485 | ), | 497 | ), |
| 486 | Offstage( | 498 | Offstage( |
| 487 | - offstage: | ||
| 488 | - _uploadImageProvider.imageList[index].process < | ||
| 489 | - 1, | 499 | + offstage: temp[index].process < 1, |
| 490 | child: GestureDetector( | 500 | child: GestureDetector( |
| 491 | child: Image.asset( | 501 | child: Image.asset( |
| 492 | Utils.getImgPath("delete"), | 502 | Utils.getImgPath("delete"), |
| @@ -496,16 +506,13 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | @@ -496,16 +506,13 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | ||
| 496 | onTap: () { | 506 | onTap: () { |
| 497 | //点击删除按钮 | 507 | //点击删除按钮 |
| 498 | setState(() { | 508 | setState(() { |
| 499 | - _uploadImageProvider.imageList.removeWhere( | 509 | + temp.removeWhere( |
| 510 | + (element) => element == temp[index]); | ||
| 511 | + widget.model.imageQiniuUrlList.removeWhere( | ||
| 500 | (element) => | 512 | (element) => |
| 501 | element == | 513 | element == |
| 502 | - _uploadImageProvider | ||
| 503 | - .imageList[index]); | ||
| 504 | - _uploadImageProvider.imageQiniuUrlList | ||
| 505 | - .removeWhere((element) => | ||
| 506 | - element == | ||
| 507 | - _uploadImageProvider | ||
| 508 | - .imageQiniuUrlList[index]); | 514 | + widget |
| 515 | + .model.imageQiniuUrlList[index]); | ||
| 509 | }); | 516 | }); |
| 510 | }, | 517 | }, |
| 511 | ), | 518 | ), |
| @@ -513,10 +520,8 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | @@ -513,10 +520,8 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | ||
| 513 | ], | 520 | ], |
| 514 | ), | 521 | ), |
| 515 | Offstage( | 522 | Offstage( |
| 516 | - offstage: | ||
| 517 | - _uploadImageProvider.imageList[index].process == 1, | ||
| 518 | - child: Progress( | ||
| 519 | - _uploadImageProvider.imageList[index].process), | 523 | + offstage: temp[index].process == 1, |
| 524 | + child: Progress(temp[index].process), | ||
| 520 | ) | 525 | ) |
| 521 | ], | 526 | ], |
| 522 | )); | 527 | )); |
| @@ -13,6 +13,7 @@ import 'package:one_key/res/colors.dart'; | @@ -13,6 +13,7 @@ import 'package:one_key/res/colors.dart'; | ||
| 13 | import 'package:one_key/utils/dialog_util.dart'; | 13 | import 'package:one_key/utils/dialog_util.dart'; |
| 14 | import 'package:one_key/utils/event_bus.dart'; | 14 | import 'package:one_key/utils/event_bus.dart'; |
| 15 | import 'package:one_key/utils/navigator_util.dart'; | 15 | import 'package:one_key/utils/navigator_util.dart'; |
| 16 | +import 'package:one_key/utils/upload_image_util.dart'; | ||
| 16 | import 'package:one_key/utils/utils.dart'; | 17 | import 'package:one_key/utils/utils.dart'; |
| 17 | import 'package:one_key/widgets/MyDivider.dart'; | 18 | import 'package:one_key/widgets/MyDivider.dart'; |
| 18 | import 'package:one_key/widgets/common_button.dart'; | 19 | import 'package:one_key/widgets/common_button.dart'; |
| @@ -605,9 +606,16 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> { | @@ -605,9 +606,16 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> { | ||
| 605 | Padding( | 606 | Padding( |
| 606 | padding: EdgeInsets.all( | 607 | padding: EdgeInsets.all( |
| 607 | ScreenUtil().setWidth(40)), | 608 | ScreenUtil().setWidth(40)), |
| 608 | - child: ImgPickerWidget( | 609 | + child: Consumer<UploadImageProvider>( |
| 610 | + builder: (context, model, _) { | ||
| 611 | + return ImgPickerWidget( | ||
| 612 | + model: model, | ||
| 609 | scrollController: | 613 | scrollController: |
| 610 | - _scrollController), | 614 | + _scrollController, |
| 615 | + uploadType: UploadType | ||
| 616 | + .ConsumptionUploadType, | ||
| 617 | + ); | ||
| 618 | + }), | ||
| 611 | ) | 619 | ) |
| 612 | // _getGridImg(1, context) | 620 | // _getGridImg(1, context) |
| 613 | ], | 621 | ], |
lib/provider/other_login_provider.dart
0 → 100644
| 1 | +import 'package:flutter/material.dart'; | ||
| 2 | +import 'package:one_key/constant/constant.dart'; | ||
| 3 | +import 'package:one_key/models/phone_code_model.dart'; | ||
| 4 | +import 'package:one_key/net/base_resp.dart'; | ||
| 5 | +import 'package:one_key/net/dio_util.dart'; | ||
| 6 | +import 'package:one_key/net/http_url.dart'; | ||
| 7 | +import 'package:one_key/utils/utils.dart'; | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * 第三方登陆 | ||
| 11 | + */ | ||
| 12 | +class OtherLoginProvider extends ChangeNotifier { | ||
| 13 | + String phone; //手机号码 | ||
| 14 | + String code; //验证码 | ||
| 15 | + PhoneCodeSunModel phoneCodeSunModel; | ||
| 16 | + | ||
| 17 | + /// 给手机发送短信验证码 | ||
| 18 | + Future<bool> getPhoneCode(BuildContext context, Map<String, String> params, | ||
| 19 | + {isShowLoading = true}) async { | ||
| 20 | + BaseResp<Map<String, dynamic>> baseResp = await DioUtil() | ||
| 21 | + .request<Map<String, dynamic>>( | ||
| 22 | + context, Method.get, HttpUrl.send_vc_code, | ||
| 23 | + data: params, showLoading: false) | ||
| 24 | + .catchError((error) {}); | ||
| 25 | + if (baseResp.code == Constant.status_success) { | ||
| 26 | + if (baseResp.data.isEmpty) { | ||
| 27 | + return false; | ||
| 28 | + } else { | ||
| 29 | + //解析解析 | ||
| 30 | + phoneCodeSunModel = PhoneCodeModel.fromJson(baseResp.responseData).data; | ||
| 31 | + return true; | ||
| 32 | + } | ||
| 33 | + } else { | ||
| 34 | + if (baseResp != null) { | ||
| 35 | + Utils.showToast(baseResp.msg ?? ""); | ||
| 36 | + } | ||
| 37 | + return false; | ||
| 38 | + } | ||
| 39 | + } | ||
| 40 | +} |
| @@ -7,6 +7,10 @@ import 'package:one_key/net/dio_util.dart'; | @@ -7,6 +7,10 @@ import 'package:one_key/net/dio_util.dart'; | ||
| 7 | import 'package:one_key/net/http_url.dart'; | 7 | import 'package:one_key/net/http_url.dart'; |
| 8 | import 'package:one_key/utils/utils.dart'; | 8 | import 'package:one_key/utils/utils.dart'; |
| 9 | 9 | ||
| 10 | +// class UploadImageStore extends UploadImageProvider{ | ||
| 11 | + | ||
| 12 | +// } | ||
| 13 | + | ||
| 10 | class UploadImageProvider extends ChangeNotifier { | 14 | class UploadImageProvider extends ChangeNotifier { |
| 11 | List<UploadImgModel> imageList = []; //图片信息列表 | 15 | List<UploadImgModel> imageList = []; //图片信息列表 |
| 12 | List<String> imageQiniuUrlList = []; //七牛云地址列表 | 16 | List<String> imageQiniuUrlList = []; //七牛云地址列表 |
| @@ -15,7 +19,8 @@ class UploadImageProvider extends ChangeNotifier { | @@ -15,7 +19,8 @@ class UploadImageProvider extends ChangeNotifier { | ||
| 15 | UploadImgModel erweima = UploadImgModel(); //二维码 | 19 | UploadImgModel erweima = UploadImgModel(); //二维码 |
| 16 | double imgSizeTouxiang = 64; | 20 | double imgSizeTouxiang = 64; |
| 17 | double imgSizeErweima = 22; | 21 | double imgSizeErweima = 22; |
| 18 | - | 22 | + List<UploadImgModel> imageListDenvironment = []; //环境信息列表 |
| 23 | + List<UploadImgModel> imageListFront = []; //门头信息列表 | ||
| 19 | UploadImageProvider() { | 24 | UploadImageProvider() { |
| 20 | touxiang.process = 0.01; | 25 | touxiang.process = 0.01; |
| 21 | erweima.process = 0.01; | 26 | erweima.process = 0.01; |
| @@ -12,6 +12,13 @@ import 'package:one_key/pages/coupon/coupon_history_page.dart'; | @@ -12,6 +12,13 @@ import 'package:one_key/pages/coupon/coupon_history_page.dart'; | ||
| 12 | import 'package:one_key/pages/coupon/coupon_page.dart'; | 12 | import 'package:one_key/pages/coupon/coupon_page.dart'; |
| 13 | import 'package:one_key/pages/coupon/coupon_selecet_page.dart'; | 13 | import 'package:one_key/pages/coupon/coupon_selecet_page.dart'; |
| 14 | import 'package:one_key/pages/create_store/create_store.dart'; | 14 | import 'package:one_key/pages/create_store/create_store.dart'; |
| 15 | +import 'package:one_key/pages/create_store/enter_store_address.dart'; | ||
| 16 | +import 'package:one_key/pages/create_store/enter_store_environment.dart'; | ||
| 17 | +import 'package:one_key/pages/create_store/enter_store_front_photo.dart'; | ||
| 18 | +import 'package:one_key/pages/create_store/enter_store_name.dart'; | ||
| 19 | +import 'package:one_key/pages/create_store/enter_store_phone.dart'; | ||
| 20 | +import 'package:one_key/pages/create_store/enter_store_position.dart'; | ||
| 21 | +import 'package:one_key/pages/create_store/enter_store_time.dart'; | ||
| 15 | import 'package:one_key/pages/create_store/map_choice_point.dart'; | 22 | import 'package:one_key/pages/create_store/map_choice_point.dart'; |
| 16 | import 'package:one_key/pages/create_store/play_video.dart'; | 23 | import 'package:one_key/pages/create_store/play_video.dart'; |
| 17 | import 'package:one_key/pages/detail/notebook_detail_change_page.dart'; | 24 | import 'package:one_key/pages/detail/notebook_detail_change_page.dart'; |
| @@ -39,6 +46,7 @@ import 'package:one_key/provider/choose_table_model.dart'; | @@ -39,6 +46,7 @@ import 'package:one_key/provider/choose_table_model.dart'; | ||
| 39 | import 'package:one_key/provider/notebook_detail_change_model.dart'; | 46 | import 'package:one_key/provider/notebook_detail_change_model.dart'; |
| 40 | import 'package:one_key/provider/notebook_detail_model.dart'; | 47 | import 'package:one_key/provider/notebook_detail_model.dart'; |
| 41 | import 'package:one_key/provider/order_food_provider.dart'; | 48 | import 'package:one_key/provider/order_food_provider.dart'; |
| 49 | +import 'package:one_key/provider/other_login_provider.dart'; | ||
| 42 | import 'package:one_key/provider/remark_manager_model.dart'; | 50 | import 'package:one_key/provider/remark_manager_model.dart'; |
| 43 | import 'package:one_key/provider/upload_img_provider.dart'; | 51 | import 'package:one_key/provider/upload_img_provider.dart'; |
| 44 | import 'package:one_key/utils/fluro_convert_utils.dart'; | 52 | import 'package:one_key/utils/fluro_convert_utils.dart'; |
| @@ -284,7 +292,8 @@ var bindingPhonePageHandler = new Handler( | @@ -284,7 +292,8 @@ var bindingPhonePageHandler = new Handler( | ||
| 284 | // CouponSunModel couponSunModel = CouponSunModel.fromJson(json.decode( | 292 | // CouponSunModel couponSunModel = CouponSunModel.fromJson(json.decode( |
| 285 | // FluroConvertUtils.fluroCnParamsDecode(params["couponSunModel"].first))); | 293 | // FluroConvertUtils.fluroCnParamsDecode(params["couponSunModel"].first))); |
| 286 | 294 | ||
| 287 | - return BindingPhone(); | 295 | + return ChangeNotifierProvider<OtherLoginProvider>( |
| 296 | + create: (_) => OtherLoginProvider(), child: BindingPhone()); | ||
| 288 | }); | 297 | }); |
| 289 | 298 | ||
| 290 | ///是否新建店铺页面 | 299 | ///是否新建店铺页面 |
| @@ -322,3 +331,68 @@ var mapChoicePointPageHandler = new Handler( | @@ -322,3 +331,68 @@ var mapChoicePointPageHandler = new Handler( | ||
| 322 | // String urlStr = FluroConvertUtils.fluroCnParamsDecode(params["urlStr"].first); | 331 | // String urlStr = FluroConvertUtils.fluroCnParamsDecode(params["urlStr"].first); |
| 323 | return MapChoicePointPage(); | 332 | return MapChoicePointPage(); |
| 324 | }); | 333 | }); |
| 334 | + | ||
| 335 | +///店铺名称 | ||
| 336 | +var enterStoreNamePageHandler = new Handler( | ||
| 337 | + handlerFunc: (BuildContext context, Map<String, List<Object>> params) { | ||
| 338 | + // CouponSunModel couponSunModel = CouponSunModel.fromJson(json.decode( | ||
| 339 | + // FluroConvertUtils.fluroCnParamsDecode(params["couponSunModel"].first))); | ||
| 340 | + // String urlStr = FluroConvertUtils.fluroCnParamsDecode(params["urlStr"].first); | ||
| 341 | + return EnterStoreNamePage(); | ||
| 342 | +}); | ||
| 343 | + | ||
| 344 | +///店铺地址 | ||
| 345 | +var enterStoreAddressPageHandler = new Handler( | ||
| 346 | + handlerFunc: (BuildContext context, Map<String, List<Object>> params) { | ||
| 347 | + // CouponSunModel couponSunModel = CouponSunModel.fromJson(json.decode( | ||
| 348 | + // FluroConvertUtils.fluroCnParamsDecode(params["couponSunModel"].first))); | ||
| 349 | + // String urlStr = FluroConvertUtils.fluroCnParamsDecode(params["urlStr"].first); | ||
| 350 | + return EnterStoreAddressPage(); | ||
| 351 | +}); | ||
| 352 | + | ||
| 353 | +///店铺担任角色 | ||
| 354 | +var enterStorePositionPageHandler = new Handler( | ||
| 355 | + handlerFunc: (BuildContext context, Map<String, List<Object>> params) { | ||
| 356 | + // CouponSunModel couponSunModel = CouponSunModel.fromJson(json.decode( | ||
| 357 | + // FluroConvertUtils.fluroCnParamsDecode(params["couponSunModel"].first))); | ||
| 358 | + // String urlStr = FluroConvertUtils.fluroCnParamsDecode(params["urlStr"].first); | ||
| 359 | + return EnterStorePositionPage(); | ||
| 360 | +}); | ||
| 361 | + | ||
| 362 | +///店铺营业时间 | ||
| 363 | +var enterStoreTimePageHandler = new Handler( | ||
| 364 | + handlerFunc: (BuildContext context, Map<String, List<Object>> params) { | ||
| 365 | + // CouponSunModel couponSunModel = CouponSunModel.fromJson(json.decode( | ||
| 366 | + // FluroConvertUtils.fluroCnParamsDecode(params["couponSunModel"].first))); | ||
| 367 | + // String urlStr = FluroConvertUtils.fluroCnParamsDecode(params["urlStr"].first); | ||
| 368 | + return EnterStoreTimePage(); | ||
| 369 | +}); | ||
| 370 | + | ||
| 371 | +///店铺接单电话 | ||
| 372 | +var enterStorePhonePageHandler = new Handler( | ||
| 373 | + handlerFunc: (BuildContext context, Map<String, List<Object>> params) { | ||
| 374 | + // CouponSunModel couponSunModel = CouponSunModel.fromJson(json.decode( | ||
| 375 | + // FluroConvertUtils.fluroCnParamsDecode(params["couponSunModel"].first))); | ||
| 376 | + // String urlStr = FluroConvertUtils.fluroCnParamsDecode(params["urlStr"].first); | ||
| 377 | + return EnterStorePhonePage(); | ||
| 378 | +}); | ||
| 379 | + | ||
| 380 | +///店铺门头照片 | ||
| 381 | +var enterStoreFrontPhotoPageHandler = new Handler( | ||
| 382 | + handlerFunc: (BuildContext context, Map<String, List<Object>> params) { | ||
| 383 | + // CouponSunModel couponSunModel = CouponSunModel.fromJson(json.decode( | ||
| 384 | + // FluroConvertUtils.fluroCnParamsDecode(params["couponSunModel"].first))); | ||
| 385 | + // String urlStr = FluroConvertUtils.fluroCnParamsDecode(params["urlStr"].first); | ||
| 386 | + return ChangeNotifierProvider<UploadImageProvider>( | ||
| 387 | + create: (_) => UploadImageProvider(), child: EnterStoreFrontPhotoPage()); | ||
| 388 | +}); | ||
| 389 | + | ||
| 390 | +///店铺环境 | ||
| 391 | +var enterStoreEnvironmentPageHandler = new Handler( | ||
| 392 | + handlerFunc: (BuildContext context, Map<String, List<Object>> params) { | ||
| 393 | + // CouponSunModel couponSunModel = CouponSunModel.fromJson(json.decode( | ||
| 394 | + // FluroConvertUtils.fluroCnParamsDecode(params["couponSunModel"].first))); | ||
| 395 | + // String urlStr = FluroConvertUtils.fluroCnParamsDecode(params["urlStr"].first); | ||
| 396 | + return ChangeNotifierProvider<UploadImageProvider>( | ||
| 397 | + create: (_) => UploadImageProvider(), child: EnterStoreEnvironmentPage()); | ||
| 398 | +}); |
| @@ -33,6 +33,14 @@ class Routes { | @@ -33,6 +33,14 @@ class Routes { | ||
| 33 | static String create_store = "/create_store"; //新建店铺 | 33 | static String create_store = "/create_store"; //新建店铺 |
| 34 | static String play_video = "/play_video"; //播放视频页 | 34 | static String play_video = "/play_video"; //播放视频页 |
| 35 | static String map_choice_point = "/map_choice_point"; //地图位置选择页 | 35 | static String map_choice_point = "/map_choice_point"; //地图位置选择页 |
| 36 | + static String enter_store_name = "/enter_store_name"; //店铺名称 | ||
| 37 | + static String enter_store_address = "/enter_store_address"; //店铺地址 | ||
| 38 | + static String enter_store_position = "/enter_store_position"; //店铺担任角色 | ||
| 39 | + static String enter_store_time = "/enter_store_time"; //店铺营业时间 | ||
| 40 | + static String enter_store_phone = "/enter_store_phone"; //接单电话 | ||
| 41 | + static String enter_store_front_photo = "/enter_store_front_photo"; //门头照片 | ||
| 42 | + static String enter_store_environment = "/enter_store_environment"; //店铺环境 | ||
| 43 | + | ||
| 36 | 44 | ||
| 37 | 45 | ||
| 38 | static void configureRoutes(FluroRouter router) { | 46 | static void configureRoutes(FluroRouter router) { |
| @@ -71,11 +79,15 @@ class Routes { | @@ -71,11 +79,15 @@ class Routes { | ||
| 71 | router.define(create_store, handler: createStorePageHandler); | 79 | router.define(create_store, handler: createStorePageHandler); |
| 72 | router.define(play_video, handler: playVideoPageHandler); | 80 | router.define(play_video, handler: playVideoPageHandler); |
| 73 | router.define(map_choice_point, handler: mapChoicePointPageHandler); | 81 | router.define(map_choice_point, handler: mapChoicePointPageHandler); |
| 82 | + router.define(enter_store_name, handler: enterStoreNamePageHandler); | ||
| 83 | + router.define(enter_store_address, handler: enterStoreAddressPageHandler); | ||
| 84 | + router.define(enter_store_position, handler: enterStorePositionPageHandler); | ||
| 85 | + router.define(enter_store_time, handler: enterStoreTimePageHandler); | ||
| 86 | + router.define(enter_store_phone, handler: enterStorePhonePageHandler); | ||
| 87 | + router.define(enter_store_front_photo, handler: enterStoreFrontPhotoPageHandler); | ||
| 88 | + router.define(enter_store_environment, handler: enterStoreEnvironmentPageHandler); | ||
| 89 | + | ||
| 74 | 90 | ||
| 75 | 91 | ||
| 76 | - | ||
| 77 | - | ||
| 78 | - | ||
| 79 | - | ||
| 80 | } | 92 | } |
| 81 | } | 93 | } |
| @@ -228,4 +228,51 @@ class NavigatorUtil { | @@ -228,4 +228,51 @@ class NavigatorUtil { | ||
| 228 | {replace = false, String urlStr}) { | 228 | {replace = false, String urlStr}) { |
| 229 | return _navigateTo(context, "${Routes.map_choice_point}", replace: replace); | 229 | return _navigateTo(context, "${Routes.map_choice_point}", replace: replace); |
| 230 | } | 230 | } |
| 231 | + | ||
| 232 | + /// 店铺名称 | ||
| 233 | + static Future<dynamic> goEnterStoreNamePage(BuildContext context, | ||
| 234 | + {replace = false}) { | ||
| 235 | + return _navigateTo(context, "${Routes.enter_store_name}", replace: replace); | ||
| 236 | + } | ||
| 237 | + | ||
| 238 | + /// 店铺地址 | ||
| 239 | + static Future<dynamic> goEnterStoreAddressPage(BuildContext context, | ||
| 240 | + {replace = false}) { | ||
| 241 | + return _navigateTo(context, "${Routes.enter_store_address}", | ||
| 242 | + replace: replace); | ||
| 243 | + } | ||
| 244 | + | ||
| 245 | + /// 店铺担任角色 | ||
| 246 | + static Future<dynamic> goEnterStorePositionPage(BuildContext context, | ||
| 247 | + {replace = false}) { | ||
| 248 | + return _navigateTo(context, "${Routes.enter_store_position}", | ||
| 249 | + replace: replace); | ||
| 250 | + } | ||
| 251 | + | ||
| 252 | + /// 店铺营业时间 | ||
| 253 | + static Future<dynamic> goEnterStoreTimePage(BuildContext context, | ||
| 254 | + {replace = false}) { | ||
| 255 | + return _navigateTo(context, "${Routes.enter_store_time}", replace: replace); | ||
| 256 | + } | ||
| 257 | + | ||
| 258 | + /// 店铺接单电话 | ||
| 259 | + static Future<dynamic> goEnterStorePhonePage(BuildContext context, | ||
| 260 | + {replace = false}) { | ||
| 261 | + return _navigateTo(context, "${Routes.enter_store_phone}", | ||
| 262 | + replace: replace); | ||
| 263 | + } | ||
| 264 | + | ||
| 265 | + /// 店铺门头照片 | ||
| 266 | + static Future<dynamic> goEnterStoreFrontPhotoPage(BuildContext context, | ||
| 267 | + {replace = false}) { | ||
| 268 | + return _navigateTo(context, "${Routes.enter_store_front_photo}", | ||
| 269 | + replace: replace); | ||
| 270 | + } | ||
| 271 | + | ||
| 272 | + /// 店铺环境 | ||
| 273 | + static Future<dynamic> goEnterStoreEnvironmentPage(BuildContext context, | ||
| 274 | + {replace = false}) { | ||
| 275 | + return _navigateTo(context, "${Routes.enter_store_environment}", | ||
| 276 | + replace: replace); | ||
| 277 | + } | ||
| 231 | } | 278 | } |
| @@ -11,6 +11,15 @@ import 'package:photo/photo.dart'; | @@ -11,6 +11,15 @@ import 'package:photo/photo.dart'; | ||
| 11 | import 'package:qiniu_flutter_sdk/qiniu_flutter_sdk.dart'; | 11 | import 'package:qiniu_flutter_sdk/qiniu_flutter_sdk.dart'; |
| 12 | import 'package:photo_manager/photo_manager.dart'; | 12 | import 'package:photo_manager/photo_manager.dart'; |
| 13 | 13 | ||
| 14 | +enum UploadType { | ||
| 15 | + EnvironmentUploadType, //店铺环境 | ||
| 16 | + ConsumptionUploadType, //消费清单 | ||
| 17 | + StoreFrontUploadType, //门头 | ||
| 18 | + HeadUploadType, //头像 | ||
| 19 | + QrcodeUploadType, //二维码 | ||
| 20 | + | ||
| 21 | +} | ||
| 22 | + | ||
| 14 | class UploadImageUtil { | 23 | class UploadImageUtil { |
| 15 | final picker = ImagePicker(); | 24 | final picker = ImagePicker(); |
| 16 | 25 | ||
| @@ -28,8 +37,13 @@ class UploadImageUtil { | @@ -28,8 +37,13 @@ class UploadImageUtil { | ||
| 28 | // 当前的任务状态 | 37 | // 当前的任务状态 |
| 29 | 38 | ||
| 30 | ///上传到七牛云 | 39 | ///上传到七牛云 |
| 31 | - void startUpload(BuildContext context, File selectedFile, int index, | ||
| 32 | - bool needInit, UploadImageProvider uploadImageProvider) async { | 40 | + void startUpload( |
| 41 | + BuildContext context, | ||
| 42 | + File selectedFile, | ||
| 43 | + int index, | ||
| 44 | + bool needInit, | ||
| 45 | + UploadImageProvider uploadImageProvider, | ||
| 46 | + UploadType uploadType) async { | ||
| 33 | final PutController putController = PutController(); | 47 | final PutController putController = PutController(); |
| 34 | print(index); | 48 | print(index); |
| 35 | 49 | ||
| @@ -40,7 +54,16 @@ class UploadImageUtil { | @@ -40,7 +54,16 @@ class UploadImageUtil { | ||
| 40 | // 添加整体进度监听 | 54 | // 添加整体进度监听 |
| 41 | putController.addProgressListener((percent) { | 55 | putController.addProgressListener((percent) { |
| 42 | print('${index}任务进度变化:进度:${percent.toStringAsFixed(4)}'); | 56 | print('${index}任务进度变化:进度:${percent.toStringAsFixed(4)}'); |
| 43 | - uploadImageProvider.imageList[index].process = percent; | 57 | + if (uploadType == UploadType.StoreFrontUploadType) { |
| 58 | + //门头 | ||
| 59 | + uploadImageProvider.imageListFront[index].process = percent; | ||
| 60 | + } else if (uploadType == UploadType.EnvironmentUploadType) { | ||
| 61 | + uploadImageProvider.imageListDenvironment[index].process = percent; | ||
| 62 | + } else if (uploadType == UploadType.ConsumptionUploadType) { | ||
| 63 | + //消费清单 | ||
| 64 | + uploadImageProvider.imageList[index].process = percent; | ||
| 65 | + } | ||
| 66 | + | ||
| 44 | uploadImageProvider.notifyListeners(); | 67 | uploadImageProvider.notifyListeners(); |
| 45 | }); | 68 | }); |
| 46 | // 添加实际发送进度订阅 | 69 | // 添加实际发送进度订阅 |
| @@ -73,8 +96,19 @@ class UploadImageUtil { | @@ -73,8 +96,19 @@ class UploadImageUtil { | ||
| 73 | String imgUrl = uploadImageProvider.qiniuInfoSunModel.domain + | 96 | String imgUrl = uploadImageProvider.qiniuInfoSunModel.domain + |
| 74 | '/' + | 97 | '/' + |
| 75 | response.rawData['key']; | 98 | response.rawData['key']; |
| 76 | - uploadImageProvider.imageList[index].process = 1; | ||
| 77 | - uploadImageProvider.imageList[index].qiniuUrl = imgUrl; | 99 | + if (uploadType == UploadType.StoreFrontUploadType) { |
| 100 | + //门头 | ||
| 101 | + uploadImageProvider.imageListFront[index].process = 1; | ||
| 102 | + uploadImageProvider.imageListFront[index].qiniuUrl = imgUrl; | ||
| 103 | + } else if (uploadType == UploadType.EnvironmentUploadType) { | ||
| 104 | + uploadImageProvider.imageListDenvironment[index].process = 1; | ||
| 105 | + uploadImageProvider.imageListDenvironment[index].qiniuUrl = imgUrl; | ||
| 106 | + } else if (uploadType == UploadType.ConsumptionUploadType) { | ||
| 107 | + //消费清单 | ||
| 108 | + uploadImageProvider.imageList[index].process = 1; | ||
| 109 | + uploadImageProvider.imageList[index].qiniuUrl = imgUrl; | ||
| 110 | + } | ||
| 111 | + | ||
| 78 | // 取消当前任务 | 112 | // 取消当前任务 |
| 79 | putController.cancel(); | 113 | putController.cancel(); |
| 80 | // _image | 114 | // _image |
| @@ -117,13 +151,8 @@ class UploadImageUtil { | @@ -117,13 +151,8 @@ class UploadImageUtil { | ||
| 117 | } | 151 | } |
| 118 | 152 | ||
| 119 | ///上传到七牛云 | 153 | ///上传到七牛云 |
| 120 | - void startUploadOnly( | ||
| 121 | - BuildContext context, | ||
| 122 | - File selectedFile, | ||
| 123 | - int index, | ||
| 124 | - bool needInit, | ||
| 125 | - UploadImageProvider uploadImageProvider, | ||
| 126 | - ) async { | 154 | + void startUploadOnly(BuildContext context, File selectedFile, int index, |
| 155 | + bool needInit, UploadImageProvider uploadImageProvider) async { | ||
| 127 | final PutController putController = PutController(); | 156 | final PutController putController = PutController(); |
| 128 | print(index); | 157 | print(index); |
| 129 | 158 |
| 1 | import 'dart:io'; | 1 | import 'dart:io'; |
| 2 | +import 'dart:math'; | ||
| 2 | import 'dart:typed_data'; | 3 | import 'dart:typed_data'; |
| 3 | 4 | ||
| 4 | import 'package:common_utils/common_utils.dart'; | 5 | import 'package:common_utils/common_utils.dart'; |
| @@ -27,6 +28,39 @@ import '../app.dart'; | @@ -27,6 +28,39 @@ import '../app.dart'; | ||
| 27 | typedef BookTimeSetCallback = void Function(bool needChange); | 28 | typedef BookTimeSetCallback = void Function(bool needChange); |
| 28 | 29 | ||
| 29 | class Utils { | 30 | class Utils { |
| 31 | + ///手机号码格式验证 | ||
| 32 | + static bool phoneRegExp(String phone) { | ||
| 33 | + RegExp exp = RegExp( | ||
| 34 | + r'^((13[0-9])|(14[0-9])|(15[0-9])|(16[0-9])|(17[0-9])|(18[0-9])|(19[0-9]))\d{8}$'); | ||
| 35 | + return exp.hasMatch(phone); | ||
| 36 | + } | ||
| 37 | + | ||
| 38 | + ///生成随机验证码 | ||
| 39 | + static randomBit(int len) { | ||
| 40 | + String scopeF = '123456789'; //首位 | ||
| 41 | + String scopeC = '0123456789'; //中间 | ||
| 42 | + String result = ''; | ||
| 43 | + for (int i = 0; i < len; i++) { | ||
| 44 | + if (i == 0) { | ||
| 45 | + result = scopeF[Random().nextInt(scopeF.length)]; | ||
| 46 | + } else { | ||
| 47 | + result = result + scopeC[Random().nextInt(scopeC.length)]; | ||
| 48 | + } | ||
| 49 | + } | ||
| 50 | + return result; | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + //时间转换 将秒转换为小时分钟 | ||
| 54 | + static String durationTransform(int seconds) { | ||
| 55 | + Duration d = Duration(seconds: seconds); | ||
| 56 | + List<String> parts = d.toString().split(':'); | ||
| 57 | + return '${parts[1]}:${parts[2].substring(0, 2)}'; | ||
| 58 | + // int minute = seconds % 3600 ~/ 60; | ||
| 59 | + // // 如果用到秒的话计算 | ||
| 60 | + // int second = seconds % 60; | ||
| 61 | + // return '${minute}:${second}'; | ||
| 62 | + } | ||
| 63 | + | ||
| 30 | static getDeviceInfoSystem() async { | 64 | static getDeviceInfoSystem() async { |
| 31 | DeviceInfoPlugin deviceInfo = DeviceInfoPlugin(); | 65 | DeviceInfoPlugin deviceInfo = DeviceInfoPlugin(); |
| 32 | if (Platform.isIOS) { | 66 | if (Platform.isIOS) { |
-
Please register or login to post a comment