Showing
15 changed files
with
386 additions
and
109 deletions
assets/base_arrow_r.png
0 → 100755
276 Bytes
assets/base_radio_sel.png
0 → 100755
2.48 KB
assets/base_radio_un.png
0 → 100755
1.22 KB
assets/base_tx_bg.png
0 → 100755
30.4 KB
assets/base_tx_mr.png
0 → 100755
12.7 KB
| @@ -23,4 +23,7 @@ enum FromPage { | @@ -23,4 +23,7 @@ enum FromPage { | ||
| 23 | FromPageCustomerList, | 23 | FromPageCustomerList, |
| 24 | FromPageMakeRecordDetail, | 24 | FromPageMakeRecordDetail, |
| 25 | FromPageShowCutomerList, //仅展示客户列表,没有选择按钮 | 25 | FromPageShowCutomerList, //仅展示客户列表,没有选择按钮 |
| 26 | + FromPageIfNeedCreateStore, | ||
| 27 | + FromPageMyPage, | ||
| 28 | + FromPageInvicationPage | ||
| 26 | } | 29 | } |
| @@ -198,7 +198,7 @@ class _CreateStorePageState extends State<CreateStorePage> { | @@ -198,7 +198,7 @@ class _CreateStorePageState extends State<CreateStorePage> { | ||
| 198 | } | 198 | } |
| 199 | }); | 199 | }); |
| 200 | if (pickedFile != null) { | 200 | if (pickedFile != null) { |
| 201 | - model.imgSizeTouxiang = 84; | 201 | + model.imgSizeTouxiang = 76; |
| 202 | model.touxiang.qiniuUrl = null; | 202 | model.touxiang.qiniuUrl = null; |
| 203 | UploadImageUtil().startUpload(context, File(pickedFile.path), | 203 | UploadImageUtil().startUpload(context, File(pickedFile.path), |
| 204 | title == '头像' ? 0 : 1, true, model, UploadType.StoreFrontUploadType); | 204 | title == '头像' ? 0 : 1, true, model, UploadType.StoreFrontUploadType); |
| @@ -829,7 +829,8 @@ class InvicationPageState extends State<InvicationPage> | @@ -829,7 +829,8 @@ class InvicationPageState extends State<InvicationPage> | ||
| 829 | } | 829 | } |
| 830 | 830 | ||
| 831 | _goBaseInfoPage() async { | 831 | _goBaseInfoPage() async { |
| 832 | - bool needRefresh = await NavigatorUtil.goBaseInfoPage(context); | 832 | + bool needRefresh = await NavigatorUtil.goBaseInfoPage( |
| 833 | + context, FromPage.FromPageInvicationPage); | ||
| 833 | Utils.changeStatusColor(color: Colors.transparent); | 834 | Utils.changeStatusColor(color: Colors.transparent); |
| 834 | if (needRefresh != null && needRefresh) { | 835 | if (needRefresh != null && needRefresh) { |
| 835 | //刷新页面数据 | 836 | //刷新页面数据 |
| @@ -50,7 +50,6 @@ class _IfNeedCreateStoreState extends State<IfNeedCreateStore> | @@ -50,7 +50,6 @@ class _IfNeedCreateStoreState extends State<IfNeedCreateStore> | ||
| 50 | WidgetsBinding.instance.addObserver(this); | 50 | WidgetsBinding.instance.addObserver(this); |
| 51 | WidgetsBinding.instance.addPostFrameCallback((_) { | 51 | WidgetsBinding.instance.addPostFrameCallback((_) { |
| 52 | _checkSellerAcc(); | 52 | _checkSellerAcc(); |
| 53 | - _getCustomerActivityBaseinfo(); | ||
| 54 | }); | 53 | }); |
| 55 | bus.on("refresh_store_list", (arg) { | 54 | bus.on("refresh_store_list", (arg) { |
| 56 | _checkSellerAcc(); | 55 | _checkSellerAcc(); |
| @@ -87,10 +86,10 @@ class _IfNeedCreateStoreState extends State<IfNeedCreateStore> | @@ -87,10 +86,10 @@ class _IfNeedCreateStoreState extends State<IfNeedCreateStore> | ||
| 87 | } | 86 | } |
| 88 | } | 87 | } |
| 89 | 88 | ||
| 90 | - _getCustomerActivityBaseinfo() async { | 89 | + _getCustomerActivityBaseinfo(String sellerid, String openid) async { |
| 91 | Map<String, String> params = { | 90 | Map<String, String> params = { |
| 92 | - 'sellerid': Provider.of<UserModel>(context, listen: false).user.sellerid, | ||
| 93 | - "uid": Provider.of<UserModel>(context, listen: false).user.openid, | 91 | + 'sellerid': sellerid, |
| 92 | + "uid": openid, | ||
| 94 | }; | 93 | }; |
| 95 | bool success = await _baseIndoProvider | 94 | bool success = await _baseIndoProvider |
| 96 | .getCustomerActivityBaseinfo(context, params, isShowLoading: false); | 95 | .getCustomerActivityBaseinfo(context, params, isShowLoading: false); |
| @@ -118,11 +117,15 @@ class _IfNeedCreateStoreState extends State<IfNeedCreateStore> | @@ -118,11 +117,15 @@ class _IfNeedCreateStoreState extends State<IfNeedCreateStore> | ||
| 118 | } | 117 | } |
| 119 | 118 | ||
| 120 | ///点击某个店铺 | 119 | ///点击某个店铺 |
| 121 | - _clickStore(context, CheckSellerAccSunModel sunModel) { | 120 | + _clickStore(context, CheckSellerAccSunModel sunModel) async { |
| 121 | + Map<String, dynamic> seller = sunModel.toJson(); | ||
| 122 | + | ||
| 123 | + await _getCustomerActivityBaseinfo(seller['id'], seller['uid']); | ||
| 122 | //判断进入个人信息还是直接进入主页 | 124 | //判断进入个人信息还是直接进入主页 |
| 123 | if (name == '' || phone == '') { | 125 | if (name == '' || phone == '') { |
| 124 | //姓名或者电话有一个为空时,进入个人资料填写页面 | 126 | //姓名或者电话有一个为空时,进入个人资料填写页面 |
| 125 | - NavigatorUtil.goBaseInfoPage(context); | 127 | + NavigatorUtil.goBaseInfoPage(context, FromPage.FromPageIfNeedCreateStore, |
| 128 | + sunModel: sunModel); | ||
| 126 | } else { | 129 | } else { |
| 127 | _loginStore(context, sunModel); | 130 | _loginStore(context, sunModel); |
| 128 | } | 131 | } |
| @@ -4,6 +4,8 @@ import 'dart:ui'; | @@ -4,6 +4,8 @@ import 'dart:ui'; | ||
| 4 | import 'package:cached_network_image/cached_network_image.dart'; | 4 | import 'package:cached_network_image/cached_network_image.dart'; |
| 5 | import 'package:flutter/material.dart'; | 5 | import 'package:flutter/material.dart'; |
| 6 | import 'package:flutter_screenutil/screenutil.dart'; | 6 | import 'package:flutter_screenutil/screenutil.dart'; |
| 7 | +import 'package:one_key/constant/state.dart'; | ||
| 8 | +import 'package:one_key/models/check_seller_acc_model.dart'; | ||
| 7 | import 'package:one_key/models/upload_img_model.dart'; | 9 | import 'package:one_key/models/upload_img_model.dart'; |
| 8 | import 'package:one_key/models/user.dart'; | 10 | import 'package:one_key/models/user.dart'; |
| 9 | import 'package:one_key/pages/online_check/photo_view_wiget.dart'; | 11 | import 'package:one_key/pages/online_check/photo_view_wiget.dart'; |
| @@ -23,8 +25,12 @@ import 'package:image_picker/image_picker.dart'; | @@ -23,8 +25,12 @@ import 'package:image_picker/image_picker.dart'; | ||
| 23 | import 'package:permission_handler/permission_handler.dart'; | 25 | import 'package:permission_handler/permission_handler.dart'; |
| 24 | import 'package:provider/provider.dart'; | 26 | import 'package:provider/provider.dart'; |
| 25 | 27 | ||
| 28 | +import '../../app.dart'; | ||
| 29 | + | ||
| 26 | class BaseInfoPage extends StatefulWidget { | 30 | class BaseInfoPage extends StatefulWidget { |
| 27 | - BaseInfoPage({Key key}) : super(key: key); | 31 | + final FromPage fromPage; |
| 32 | + final CheckSellerAccSunModel sunModel; | ||
| 33 | + BaseInfoPage({Key key, this.fromPage, this.sunModel}) : super(key: key); | ||
| 28 | 34 | ||
| 29 | @override | 35 | @override |
| 30 | _BaseInfoPageState createState() => _BaseInfoPageState(); | 36 | _BaseInfoPageState createState() => _BaseInfoPageState(); |
| @@ -45,17 +51,51 @@ class _BaseInfoPageState extends State<BaseInfoPage> { | @@ -45,17 +51,51 @@ class _BaseInfoPageState extends State<BaseInfoPage> { | ||
| 45 | 51 | ||
| 46 | UploadImageProvider _uploadImageProvider; | 52 | UploadImageProvider _uploadImageProvider; |
| 47 | BaseIndoProvider _baseIndoProvider; | 53 | BaseIndoProvider _baseIndoProvider; |
| 54 | + String nameStr = '未填写'; | ||
| 55 | + String phoneStr = ''; | ||
| 56 | + bool isSelect = true; | ||
| 48 | 57 | ||
| 49 | @override | 58 | @override |
| 50 | void initState() { | 59 | void initState() { |
| 51 | super.initState(); | 60 | super.initState(); |
| 52 | _scrollController = ScrollController(); | 61 | _scrollController = ScrollController(); |
| 62 | + _nameFocusNode.addListener(() { | ||
| 63 | + if (_nameFocusNode.hasFocus) { | ||
| 64 | + print('得到焦点'); | ||
| 65 | + } else { | ||
| 66 | + print('失去焦点'); | ||
| 67 | + } | ||
| 68 | + setState(() {}); | ||
| 69 | + }); | ||
| 70 | + _phoneFocusNode.addListener(() { | ||
| 71 | + if (_phoneFocusNode.hasFocus) { | ||
| 72 | + print('得到焦点'); | ||
| 73 | + } else { | ||
| 74 | + print('失去焦点'); | ||
| 75 | + } | ||
| 76 | + }); | ||
| 77 | + _positionFocusNode.addListener(() { | ||
| 78 | + if (_positionFocusNode.hasFocus) { | ||
| 79 | + print('得到焦点'); | ||
| 80 | + } else { | ||
| 81 | + print('失去焦点'); | ||
| 82 | + } | ||
| 83 | + setState(() {}); | ||
| 84 | + }); | ||
| 85 | + _wechatFocusNode.addListener(() { | ||
| 86 | + if (_wechatFocusNode.hasFocus) { | ||
| 87 | + print('得到焦点'); | ||
| 88 | + } else { | ||
| 89 | + print('失去焦点'); | ||
| 90 | + } | ||
| 91 | + setState(() {}); | ||
| 92 | + }); | ||
| 53 | WidgetsBinding.instance.addPostFrameCallback((_) { | 93 | WidgetsBinding.instance.addPostFrameCallback((_) { |
| 54 | _uploadImageProvider.touxiang.process = 0.01; | 94 | _uploadImageProvider.touxiang.process = 0.01; |
| 55 | _uploadImageProvider.touxiang.qiniuUrl = ''; | 95 | _uploadImageProvider.touxiang.qiniuUrl = ''; |
| 56 | _uploadImageProvider.erweima.process = 0.01; | 96 | _uploadImageProvider.erweima.process = 0.01; |
| 57 | _uploadImageProvider.erweima.qiniuUrl = ''; | 97 | _uploadImageProvider.erweima.qiniuUrl = ''; |
| 58 | - _uploadImageProvider.imgSizeTouxiang = 84; | 98 | + _uploadImageProvider.imgSizeTouxiang = 76; |
| 59 | _uploadImageProvider.imgSizeErweima = 22; | 99 | _uploadImageProvider.imgSizeErweima = 22; |
| 60 | _getQiniuInfo(); | 100 | _getQiniuInfo(); |
| 61 | _getCustomerActivityBaseinfo(); | 101 | _getCustomerActivityBaseinfo(); |
| @@ -63,20 +103,41 @@ class _BaseInfoPageState extends State<BaseInfoPage> { | @@ -63,20 +103,41 @@ class _BaseInfoPageState extends State<BaseInfoPage> { | ||
| 63 | } | 103 | } |
| 64 | 104 | ||
| 65 | _getCustomerActivityBaseinfo() async { | 105 | _getCustomerActivityBaseinfo() async { |
| 66 | - Map<String, String> params = { | ||
| 67 | - 'sellerid': Provider.of<UserModel>(context, listen: false).user.sellerid, | ||
| 68 | - "uid": Provider.of<UserModel>(context, listen: false).user.openid, | ||
| 69 | - }; | 106 | + Map<String, String> params; |
| 107 | + | ||
| 108 | + if (widget.fromPage == FromPage.FromPageIfNeedCreateStore) { | ||
| 109 | + Map<String, dynamic> seller = widget.sunModel.toJson(); | ||
| 110 | + params = { | ||
| 111 | + 'sellerid': seller['id'], | ||
| 112 | + "uid": seller['uid'], | ||
| 113 | + }; | ||
| 114 | + } else { | ||
| 115 | + params = { | ||
| 116 | + 'sellerid': | ||
| 117 | + Provider.of<UserModel>(context, listen: false).user.sellerid, | ||
| 118 | + "uid": Provider.of<UserModel>(context, listen: false).user.openid, | ||
| 119 | + }; | ||
| 120 | + } | ||
| 70 | bool success = | 121 | bool success = |
| 71 | await _baseIndoProvider.getCustomerActivityBaseinfo(context, params); | 122 | await _baseIndoProvider.getCustomerActivityBaseinfo(context, params); |
| 72 | if (success) { | 123 | if (success) { |
| 73 | _nameController.text = _baseIndoProvider.baseInfoSunModel.name; | 124 | _nameController.text = _baseIndoProvider.baseInfoSunModel.name; |
| 125 | + nameStr = _baseIndoProvider.baseInfoSunModel.name; | ||
| 74 | _uploadImageProvider.touxiang.qiniuUrl = | 126 | _uploadImageProvider.touxiang.qiniuUrl = |
| 75 | _baseIndoProvider.baseInfoSunModel.photo; | 127 | _baseIndoProvider.baseInfoSunModel.photo; |
| 76 | _uploadImageProvider.erweima.qiniuUrl = | 128 | _uploadImageProvider.erweima.qiniuUrl = |
| 77 | _baseIndoProvider.baseInfoSunModel.qrcode; | 129 | _baseIndoProvider.baseInfoSunModel.qrcode; |
| 78 | _phoneController.text = _baseIndoProvider.baseInfoSunModel.phone; | 130 | _phoneController.text = _baseIndoProvider.baseInfoSunModel.phone; |
| 131 | + phoneStr = _baseIndoProvider.baseInfoSunModel.phone ?? ''; | ||
| 79 | _wechatController.text = _baseIndoProvider.baseInfoSunModel.wechat; | 132 | _wechatController.text = _baseIndoProvider.baseInfoSunModel.wechat; |
| 133 | + if (_baseIndoProvider.baseInfoSunModel.wechat != null && | ||
| 134 | + _baseIndoProvider.baseInfoSunModel.wechat != '' && | ||
| 135 | + phoneStr != '' && | ||
| 136 | + _baseIndoProvider.baseInfoSunModel.wechat == phoneStr) { | ||
| 137 | + isSelect = true; | ||
| 138 | + } else { | ||
| 139 | + isSelect = false; | ||
| 140 | + } | ||
| 80 | _positionController.text = _baseIndoProvider.baseInfoSunModel.position; | 141 | _positionController.text = _baseIndoProvider.baseInfoSunModel.position; |
| 81 | _uploadImageProvider.imgSizeErweima = 64; | 142 | _uploadImageProvider.imgSizeErweima = 64; |
| 82 | // setState(() {}); | 143 | // setState(() {}); |
| @@ -94,30 +155,41 @@ class _BaseInfoPageState extends State<BaseInfoPage> { | @@ -94,30 +155,41 @@ class _BaseInfoPageState extends State<BaseInfoPage> { | ||
| 94 | _setCustomerActivityBaseinfo() async { | 155 | _setCustomerActivityBaseinfo() async { |
| 95 | FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘 | 156 | FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘 |
| 96 | 157 | ||
| 97 | - User user = Provider.of<UserModel>(context, listen: false).user; | 158 | + String nameTemp = _nameController.text.trim(); |
| 159 | + String phoneTemp = _phoneController.text.trim(); | ||
| 98 | Map<String, String> params = { | 160 | Map<String, String> params = { |
| 99 | - 'sellerid': user.sellerid, | ||
| 100 | - "uid": user.openid, | ||
| 101 | - "name": _nameController.text.trim().length == 0 | ||
| 102 | - ? user.sellername | ||
| 103 | - : _nameController.text.trim(), | ||
| 104 | - "photo": _uploadImageProvider.touxiang.qiniuUrl.trim().length == 0 | ||
| 105 | - ? 'http://nosqn.colorcun.com/yd_person.png' | 161 | + "name": nameTemp, |
| 162 | + 'phone': phoneTemp, | ||
| 163 | + "photo": _uploadImageProvider.touxiang.qiniuUrl.trim().length == 0 || | ||
| 164 | + _uploadImageProvider.touxiang.qiniuUrl == | ||
| 165 | + 'http://nosqn.colorcun.com/yd_person.png' | ||
| 166 | + ? App.sp.getString("headImg") | ||
| 106 | : _uploadImageProvider.touxiang.qiniuUrl, | 167 | : _uploadImageProvider.touxiang.qiniuUrl, |
| 107 | "position": _positionController.text.trim().length == 0 | 168 | "position": _positionController.text.trim().length == 0 |
| 108 | ? '经理' | 169 | ? '经理' |
| 109 | : _positionController.text, | 170 | : _positionController.text, |
| 110 | }; | 171 | }; |
| 111 | - if (_phoneController.text.trim().length == 0) { | ||
| 112 | - if (user.userphone != null) { | ||
| 113 | - params['phone'] = user.userphone; | ||
| 114 | - } | 172 | + |
| 173 | + if (widget.fromPage == FromPage.FromPageIfNeedCreateStore) { | ||
| 174 | + Map<String, dynamic> seller = widget.sunModel.toJson(); | ||
| 175 | + | ||
| 176 | + params['sellerid'] = seller['id']; | ||
| 177 | + params["uid"] = seller['uid']; | ||
| 115 | } else { | 178 | } else { |
| 116 | - params['phone'] = _phoneController.text.trim(); | 179 | + params['sellerid'] = |
| 180 | + Provider.of<UserModel>(context, listen: false).user.sellerid; | ||
| 181 | + params["uid"] = | ||
| 182 | + Provider.of<UserModel>(context, listen: false).user.openid; | ||
| 117 | } | 183 | } |
| 118 | - if (_wechatController.text.trim().length > 0) { | ||
| 119 | - params['wechat'] = _wechatController.text; | 184 | + |
| 185 | + if (isSelect) { | ||
| 186 | + params['wechat'] = phoneTemp; | ||
| 187 | + } else { | ||
| 188 | + if (_wechatController.text.trim().length > 0) { | ||
| 189 | + params['wechat'] = _wechatController.text; | ||
| 190 | + } | ||
| 120 | } | 191 | } |
| 192 | + | ||
| 121 | if (_uploadImageProvider.erweima.qiniuUrl != null && | 193 | if (_uploadImageProvider.erweima.qiniuUrl != null && |
| 122 | _uploadImageProvider.erweima.qiniuUrl != '') { | 194 | _uploadImageProvider.erweima.qiniuUrl != '') { |
| 123 | params['qrcode'] = _uploadImageProvider.erweima.qiniuUrl; | 195 | params['qrcode'] = _uploadImageProvider.erweima.qiniuUrl; |
| @@ -131,14 +203,49 @@ class _BaseInfoPageState extends State<BaseInfoPage> { | @@ -131,14 +203,49 @@ class _BaseInfoPageState extends State<BaseInfoPage> { | ||
| 131 | if (isSuccess) { | 203 | if (isSuccess) { |
| 132 | _uploadImageProvider.touxiang.file = null; | 204 | _uploadImageProvider.touxiang.file = null; |
| 133 | _uploadImageProvider.erweima.file = null; | 205 | _uploadImageProvider.erweima.file = null; |
| 206 | + nameStr = nameTemp; | ||
| 207 | + | ||
| 208 | + phoneStr = phoneTemp; | ||
| 134 | //成功之后跳回前一个页面 | 209 | //成功之后跳回前一个页面 |
| 135 | // bus.emit('refresh_coupon_list'); | 210 | // bus.emit('refresh_coupon_list'); |
| 136 | Utils.showToast('保存成功'); | 211 | Utils.showToast('保存成功'); |
| 137 | EventBus().emit('changeStatusColor'); | 212 | EventBus().emit('changeStatusColor'); |
| 138 | - Navigator.pop(context, true); | 213 | + if (widget.fromPage == FromPage.FromPageIfNeedCreateStore) { |
| 214 | + _loginStore(context, widget.sunModel); | ||
| 215 | + } else { | ||
| 216 | + Navigator.pop(context, true); | ||
| 217 | + } | ||
| 139 | } | 218 | } |
| 140 | } | 219 | } |
| 141 | 220 | ||
| 221 | + ///进入某个店铺 | ||
| 222 | + _loginStore(context, CheckSellerAccSunModel sunModel) { | ||
| 223 | + UserModel userModel = Provider.of<UserModel>(context, listen: false); | ||
| 224 | + userModel.accountLogin = false; | ||
| 225 | + Map<String, dynamic> seller = sunModel.toJson(); | ||
| 226 | + Map<String, dynamic> userMap = { | ||
| 227 | + "openid": seller['uid'], | ||
| 228 | + "account": seller['account'], | ||
| 229 | + "role_name": seller['role_name'], | ||
| 230 | + "sellerid": seller['id'], | ||
| 231 | + "sellercode": seller['seller_code'], | ||
| 232 | + "sellername": seller['sellername'], | ||
| 233 | + "sellerphone": seller['seller_tel'], | ||
| 234 | + "sellerAddr": '', | ||
| 235 | + "scatter": 0, | ||
| 236 | + "room": 0, | ||
| 237 | + "cassette": 0, | ||
| 238 | + "morning": "", | ||
| 239 | + "noon": "", | ||
| 240 | + "night": "", | ||
| 241 | + }; | ||
| 242 | + userModel.saveUserInfo(User.fromJson(userMap)); | ||
| 243 | + userModel.getSellerInfo( | ||
| 244 | + context, | ||
| 245 | + {"seller_id": seller['id'], "seller_openid": seller['openid']}, | ||
| 246 | + userMap); | ||
| 247 | + } | ||
| 248 | + | ||
| 142 | ///输入框 | 249 | ///输入框 |
| 143 | Widget _textfield(String image, String hintText, | 250 | Widget _textfield(String image, String hintText, |
| 144 | TextEditingController editingController, FocusNode focusNode) { | 251 | TextEditingController editingController, FocusNode focusNode) { |
| @@ -159,6 +266,7 @@ class _BaseInfoPageState extends State<BaseInfoPage> { | @@ -159,6 +266,7 @@ class _BaseInfoPageState extends State<BaseInfoPage> { | ||
| 159 | // textAlign: TextAlign.right, | 266 | // textAlign: TextAlign.right, |
| 160 | // textAlignVertical: TextAlignVertical.bottom, | 267 | // textAlignVertical: TextAlignVertical.bottom, |
| 161 | maxLines: 1, | 268 | maxLines: 1, |
| 269 | + | ||
| 162 | // //光标颜色 | 270 | // //光标颜色 |
| 163 | // cursorColor: | 271 | // cursorColor: |
| 164 | // widget.isSelect ? Colors.white : MyColours.color_199095, | 272 | // widget.isSelect ? Colors.white : MyColours.color_199095, |
| @@ -168,6 +276,19 @@ class _BaseInfoPageState extends State<BaseInfoPage> { | @@ -168,6 +276,19 @@ class _BaseInfoPageState extends State<BaseInfoPage> { | ||
| 168 | ), | 276 | ), |
| 169 | focusNode: focusNode, | 277 | focusNode: focusNode, |
| 170 | decoration: InputDecoration( | 278 | decoration: InputDecoration( |
| 279 | + // suffixText: '修改', | ||
| 280 | + // suffixStyle: TextStyle( | ||
| 281 | + // fontSize: ScreenUtil().setSp(24), | ||
| 282 | + // color: MyColours.color_BFC4D4), | ||
| 283 | + // suffixIcon: Container( | ||
| 284 | + // margin: EdgeInsets.only(left: ScreenUtil().setWidth(16)), | ||
| 285 | + // child: Image.asset( | ||
| 286 | + // Utils.getImgPath('arrow_right_new'), | ||
| 287 | + // width: ScreenUtil().setWidth(20), | ||
| 288 | + // height: ScreenUtil().setWidth(40), | ||
| 289 | + // )), | ||
| 290 | + // suffixIconConstraints: | ||
| 291 | + // BoxConstraints(maxWidth: ScreenUtil().setWidth(56)), | ||
| 171 | border: OutlineInputBorder(borderSide: BorderSide.none), | 292 | border: OutlineInputBorder(borderSide: BorderSide.none), |
| 172 | hintText: hintText, | 293 | hintText: hintText, |
| 173 | hintStyle: TextStyle( | 294 | hintStyle: TextStyle( |
| @@ -181,24 +302,50 @@ class _BaseInfoPageState extends State<BaseInfoPage> { | @@ -181,24 +302,50 @@ class _BaseInfoPageState extends State<BaseInfoPage> { | ||
| 181 | borderSide: BorderSide.none, | 302 | borderSide: BorderSide.none, |
| 182 | ), | 303 | ), |
| 183 | ), | 304 | ), |
| 184 | - onChanged: (value) {}, | 305 | + |
| 306 | + onChanged: (value) { | ||
| 307 | + print('vvvvvv'); | ||
| 308 | + if (hintText == '您希望顾客看到的名字') { | ||
| 309 | + setState(() { | ||
| 310 | + nameStr = value; | ||
| 311 | + }); | ||
| 312 | + } else if (hintText == '顾客联系您的手机号') { | ||
| 313 | + setState(() { | ||
| 314 | + phoneStr = value; | ||
| 315 | + }); | ||
| 316 | + } | ||
| 317 | + }, | ||
| 185 | onEditingComplete: () { | 318 | onEditingComplete: () { |
| 186 | FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘 | 319 | FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘 |
| 187 | }, | 320 | }, |
| 188 | keyboardType: TextInputType.text, | 321 | keyboardType: TextInputType.text, |
| 189 | ), | 322 | ), |
| 190 | ), | 323 | ), |
| 191 | - Text('修改', | ||
| 192 | - style: TextStyle( | ||
| 193 | - color: MyColours.color_BFC4D4, | ||
| 194 | - fontSize: ScreenUtil().setSp(24), | ||
| 195 | - )), | ||
| 196 | - HEmptyView(20), | ||
| 197 | - Image.asset( | ||
| 198 | - Utils.getImgPath('arrow_right_new'), | ||
| 199 | - // width: ScreenUtil().setWidth(16), | ||
| 200 | - height: ScreenUtil().setWidth(34), | ||
| 201 | - ) | 324 | + focusNode.hasFocus |
| 325 | + ? SizedBox() | ||
| 326 | + : InkWell( | ||
| 327 | + onTap: () { | ||
| 328 | + FocusScope.of(context).requestFocus(focusNode); // 获取焦点 | ||
| 329 | + setState(() {}); | ||
| 330 | + }, | ||
| 331 | + child: Row( | ||
| 332 | + children: [ | ||
| 333 | + Text( | ||
| 334 | + '修改', | ||
| 335 | + style: TextStyle( | ||
| 336 | + fontSize: ScreenUtil().setSp(24), | ||
| 337 | + color: MyColours.color_BFC4D4), | ||
| 338 | + ), | ||
| 339 | + Container( | ||
| 340 | + margin: | ||
| 341 | + EdgeInsets.only(left: ScreenUtil().setWidth(16)), | ||
| 342 | + child: Image.asset( | ||
| 343 | + Utils.getImgPath('base_arrow_r'), | ||
| 344 | + width: ScreenUtil().setWidth(20), | ||
| 345 | + height: ScreenUtil().setWidth(40), | ||
| 346 | + )), | ||
| 347 | + ], | ||
| 348 | + )) | ||
| 202 | ], | 349 | ], |
| 203 | ), | 350 | ), |
| 204 | ); | 351 | ); |
| @@ -250,7 +397,7 @@ class _BaseInfoPageState extends State<BaseInfoPage> { | @@ -250,7 +397,7 @@ class _BaseInfoPageState extends State<BaseInfoPage> { | ||
| 250 | }); | 397 | }); |
| 251 | if (pickedFile != null) { | 398 | if (pickedFile != null) { |
| 252 | if (title == '头像') { | 399 | if (title == '头像') { |
| 253 | - _uploadImageProvider.imgSizeTouxiang = 84; | 400 | + _uploadImageProvider.imgSizeTouxiang = 76; |
| 254 | _uploadImageProvider.touxiang.qiniuUrl = null; | 401 | _uploadImageProvider.touxiang.qiniuUrl = null; |
| 255 | } else { | 402 | } else { |
| 256 | _uploadImageProvider.imgSizeErweima = 76; | 403 | _uploadImageProvider.imgSizeErweima = 76; |
| @@ -290,51 +437,85 @@ class _BaseInfoPageState extends State<BaseInfoPage> { | @@ -290,51 +437,85 @@ class _BaseInfoPageState extends State<BaseInfoPage> { | ||
| 290 | }, | 437 | }, |
| 291 | child: Stack(clipBehavior: Clip.none, children: [ | 438 | child: Stack(clipBehavior: Clip.none, children: [ |
| 292 | Container( | 439 | Container( |
| 293 | - width: ScreenUtil().setWidth(imgSize * 2), | ||
| 294 | - height: ScreenUtil().setWidth(imgSize * 2), | 440 | + width: ScreenUtil().setWidth(93 * 2), |
| 441 | + height: ScreenUtil().setWidth(93 * 2), | ||
| 295 | margin: EdgeInsets.only( | 442 | margin: EdgeInsets.only( |
| 296 | - right: ScreenUtil().setWidth(14), | 443 | + right: ScreenUtil().setWidth(24), |
| 297 | ), | 444 | ), |
| 298 | child: ClipRRect( | 445 | child: ClipRRect( |
| 299 | - borderRadius: | ||
| 300 | - BorderRadius.circular(ScreenUtil().setWidth(radius)), | ||
| 301 | - child: model.file == null | ||
| 302 | - ? model.qiniuUrl != null && model.qiniuUrl != '' | ||
| 303 | - ? Image.network( | ||
| 304 | - model.qiniuUrl, | ||
| 305 | - fit: BoxFit.cover, | ||
| 306 | - width: ScreenUtil().setWidth(imgSize * 2), | ||
| 307 | - height: ScreenUtil().setWidth(imgSize * 2), | ||
| 308 | - ) | ||
| 309 | - : Image.asset( | ||
| 310 | - Utils.getImgPath( | ||
| 311 | - title == '头像' ? 'touxiang' : 'erweima'), | 446 | + borderRadius: |
| 447 | + BorderRadius.circular(ScreenUtil().setWidth(93)), | ||
| 448 | + child: Image.asset( | ||
| 449 | + Utils.getImgPath('base_tx_bg'), | ||
| 450 | + fit: BoxFit.cover, | ||
| 451 | + width: ScreenUtil().setWidth(93 * 2), | ||
| 452 | + height: ScreenUtil().setWidth(93 * 2), | ||
| 453 | + ))), | ||
| 454 | + Positioned( | ||
| 455 | + top: ScreenUtil().setWidth(9), | ||
| 456 | + left: ScreenUtil().setWidth(17), | ||
| 457 | + child: Container( | ||
| 458 | + width: ScreenUtil().setWidth(imgSize * 2), | ||
| 459 | + height: ScreenUtil().setWidth(imgSize * 2), | ||
| 460 | + // margin: EdgeInsets.only( | ||
| 461 | + // right: ScreenUtil().setWidth(24), | ||
| 462 | + // ), | ||
| 463 | + child: ClipRRect( | ||
| 464 | + borderRadius: | ||
| 465 | + BorderRadius.circular(ScreenUtil().setWidth(radius)), | ||
| 466 | + child: model.file == null | ||
| 467 | + ? model.qiniuUrl != null && | ||
| 468 | + model.qiniuUrl != '' && | ||
| 469 | + model.qiniuUrl != | ||
| 470 | + 'http://nosqn.colorcun.com/yd_person.png' | ||
| 471 | + ? Image.network( | ||
| 472 | + model.qiniuUrl, | ||
| 473 | + fit: BoxFit.cover, | ||
| 474 | + width: ScreenUtil().setWidth(imgSize * 2), | ||
| 475 | + height: ScreenUtil().setWidth(imgSize * 2), | ||
| 476 | + ) | ||
| 477 | + : App.sp.getString("headImg") == '' | ||
| 478 | + ? Image.asset( | ||
| 479 | + Utils.getImgPath(title == '头像' | ||
| 480 | + ? 'base_tx_mr' | ||
| 481 | + : 'erweima'), | ||
| 482 | + fit: BoxFit.cover, | ||
| 483 | + width: ScreenUtil().setWidth(imgSize * 2), | ||
| 484 | + height: ScreenUtil().setWidth(imgSize * 2), | ||
| 485 | + ) | ||
| 486 | + : Image.network( | ||
| 487 | + App.sp.getString("headImg"), | ||
| 488 | + fit: BoxFit.cover, | ||
| 489 | + width: ScreenUtil().setWidth(imgSize * 2), | ||
| 490 | + height: ScreenUtil().setWidth(imgSize * 2), | ||
| 491 | + ) | ||
| 492 | + : Image.file( | ||
| 493 | + model.file, | ||
| 312 | fit: BoxFit.cover, | 494 | fit: BoxFit.cover, |
| 313 | width: ScreenUtil().setWidth(imgSize * 2), | 495 | width: ScreenUtil().setWidth(imgSize * 2), |
| 314 | height: ScreenUtil().setWidth(imgSize * 2), | 496 | height: ScreenUtil().setWidth(imgSize * 2), |
| 315 | - ) | ||
| 316 | - : Image.file( | ||
| 317 | - model.file, | ||
| 318 | - fit: BoxFit.cover, | ||
| 319 | - width: ScreenUtil().setWidth(imgSize * 2), | ||
| 320 | - height: ScreenUtil().setWidth(imgSize * 2), | 497 | + ), |
| 498 | + ))), | ||
| 499 | + Positioned( | ||
| 500 | + right: ScreenUtil().setWidth(42), | ||
| 501 | + top: ScreenUtil().setWidth(9), | ||
| 502 | + child: (model.file != null) && | ||
| 503 | + model.process != 1 && | ||
| 504 | + model.process != 0.01 | ||
| 505 | + ? Container( | ||
| 506 | + width: ScreenUtil().setWidth(imgSize * 2), | ||
| 507 | + height: ScreenUtil().setWidth(imgSize * 2), | ||
| 508 | + decoration: BoxDecoration( | ||
| 509 | + borderRadius: BorderRadius.circular(radius), | ||
| 510 | + color: Color.fromRGBO(0, 0, 0, 0.6)), | ||
| 511 | + child: Center( | ||
| 512 | + child: Text('上传中', | ||
| 513 | + style: TextStyle(color: MyColours.color_999999)), | ||
| 321 | ), | 514 | ), |
| 322 | - )), | ||
| 323 | - // (model.file != null) && model.process != 1 && model.process != 0.01 | ||
| 324 | - // ? Container( | ||
| 325 | - // width: ScreenUtil().setWidth(imgSize * 2), | ||
| 326 | - // height: ScreenUtil().setWidth(imgSize * 2), | ||
| 327 | - // decoration: BoxDecoration( | ||
| 328 | - // borderRadius: BorderRadius.circular(radius), | ||
| 329 | - // color: Color.fromRGBO(0, 0, 0, 0.6)), | ||
| 330 | - // child: Center( | ||
| 331 | - // child: Text('上传中', | ||
| 332 | - // style: TextStyle(color: MyColours.color_999999)), | ||
| 333 | - // ), | ||
| 334 | - // ) | ||
| 335 | - // : Container(), | 515 | + ) |
| 516 | + : Container()), | ||
| 336 | Positioned( | 517 | Positioned( |
| 337 | - right: ScreenUtil().setWidth(-14), | 518 | + right: ScreenUtil().setWidth(14), |
| 338 | top: ScreenUtil().setWidth(56), | 519 | top: ScreenUtil().setWidth(56), |
| 339 | child: InkWell( | 520 | child: InkWell( |
| 340 | onTap: () { | 521 | onTap: () { |
| @@ -398,14 +579,15 @@ class _BaseInfoPageState extends State<BaseInfoPage> { | @@ -398,14 +579,15 @@ class _BaseInfoPageState extends State<BaseInfoPage> { | ||
| 398 | _uploadImageProvider.imgSizeTouxiang, | 579 | _uploadImageProvider.imgSizeTouxiang, |
| 399 | 76), | 580 | 76), |
| 400 | VEmptyView(26), | 581 | VEmptyView(26), |
| 401 | - Text('未填写', | 582 | + Text(nameStr, |
| 402 | style: TextStyle( | 583 | style: TextStyle( |
| 403 | fontSize: ScreenUtil().setWidth(50), | 584 | fontSize: ScreenUtil().setWidth(50), |
| 404 | - color: true | ||
| 405 | - ? MyColours.color_27262B | ||
| 406 | - : MyColours.color_BFC4D4)), | 585 | + color: nameStr == '未填写' || |
| 586 | + nameStr == '' | ||
| 587 | + ? MyColours.color_BFC4D4 | ||
| 588 | + : MyColours.color_27262B)), | ||
| 407 | VEmptyView(8), | 589 | VEmptyView(8), |
| 408 | - Text('18739383883', | 590 | + Text(phoneStr == null ? '' : phoneStr, |
| 409 | style: TextStyle( | 591 | style: TextStyle( |
| 410 | fontSize: ScreenUtil().setWidth(30), | 592 | fontSize: ScreenUtil().setWidth(30), |
| 411 | color: MyColours.color_BFC4D4)), | 593 | color: MyColours.color_BFC4D4)), |
| @@ -444,15 +626,56 @@ class _BaseInfoPageState extends State<BaseInfoPage> { | @@ -444,15 +626,56 @@ class _BaseInfoPageState extends State<BaseInfoPage> { | ||
| 444 | VEmptyView(26), | 626 | VEmptyView(26), |
| 445 | // _imageWidget('微信二维码', _uploadImageProvider.erweima, | 627 | // _imageWidget('微信二维码', _uploadImageProvider.erweima, |
| 446 | // _uploadImageProvider.imgSizeErweima, 0), | 628 | // _uploadImageProvider.imgSizeErweima, 0), |
| 447 | - Padding( | ||
| 448 | - padding: EdgeInsets.symmetric( | ||
| 449 | - horizontal: ScreenUtil().setWidth(40), | ||
| 450 | - ), | ||
| 451 | - child: _textfield( | ||
| 452 | - 'base_wechat', | ||
| 453 | - '微信号方便顾客加您微信', | ||
| 454 | - _wechatController, | ||
| 455 | - _wechatFocusNode)), | 629 | + InkWell( |
| 630 | + onTap: () { | ||
| 631 | + setState(() { | ||
| 632 | + isSelect = !isSelect; | ||
| 633 | + }); | ||
| 634 | + }, | ||
| 635 | + child: Container( | ||
| 636 | + padding: EdgeInsets.only( | ||
| 637 | + left: ScreenUtil().setWidth(40), | ||
| 638 | + right: ScreenUtil().setWidth(40), | ||
| 639 | + bottom: | ||
| 640 | + ScreenUtil().setWidth(26)), | ||
| 641 | + child: Row( | ||
| 642 | + crossAxisAlignment: | ||
| 643 | + CrossAxisAlignment.center, | ||
| 644 | + children: [ | ||
| 645 | + Image.asset( | ||
| 646 | + Utils.getImgPath(isSelect | ||
| 647 | + ? 'base_radio_sel' | ||
| 648 | + : 'base_radio_un'), | ||
| 649 | + // width: ScreenUtil().setWidth(16), | ||
| 650 | + height: | ||
| 651 | + ScreenUtil().setWidth(34), | ||
| 652 | + ), | ||
| 653 | + HEmptyView(24), | ||
| 654 | + Text('微信同电话号', | ||
| 655 | + style: TextStyle( | ||
| 656 | + color: isSelect | ||
| 657 | + ? MyColours.color_438E93 | ||
| 658 | + : MyColours | ||
| 659 | + .color_BFC4D4, | ||
| 660 | + fontSize: | ||
| 661 | + ScreenUtil().setSp(30), | ||
| 662 | + )), | ||
| 663 | + ], | ||
| 664 | + ), | ||
| 665 | + )), | ||
| 666 | + | ||
| 667 | + isSelect | ||
| 668 | + ? SizedBox() | ||
| 669 | + : Padding( | ||
| 670 | + padding: EdgeInsets.symmetric( | ||
| 671 | + horizontal: | ||
| 672 | + ScreenUtil().setWidth(40), | ||
| 673 | + ), | ||
| 674 | + child: _textfield( | ||
| 675 | + 'base_wechat', | ||
| 676 | + '微信号方便顾客加您微信', | ||
| 677 | + _wechatController, | ||
| 678 | + _wechatFocusNode)), | ||
| 456 | VEmptyView(30), | 679 | VEmptyView(30), |
| 457 | ], | 680 | ], |
| 458 | )), | 681 | )), |
| @@ -463,18 +686,37 @@ class _BaseInfoPageState extends State<BaseInfoPage> { | @@ -463,18 +686,37 @@ class _BaseInfoPageState extends State<BaseInfoPage> { | ||
| 463 | ScreenUtil().setWidth(40), | 686 | ScreenUtil().setWidth(40), |
| 464 | 0, | 687 | 0, |
| 465 | ScreenUtil().setWidth(40), | 688 | ScreenUtil().setWidth(40), |
| 466 | - ScreenUtil().setWidth(40)), | 689 | + ScreenUtil().setWidth(56)), |
| 467 | child: RoundButton( | 690 | child: RoundButton( |
| 468 | onPressed: () { | 691 | onPressed: () { |
| 469 | - //接口 | 692 | + if (_phoneController.text.trim().length == |
| 693 | + 0 || | ||
| 694 | + _nameController.text.trim().length == 0) { | ||
| 695 | + Utils.showToast('请至少填写您的姓名和电话'); | ||
| 696 | + return; | ||
| 697 | + } //接口 | ||
| 470 | _setCustomerActivityBaseinfo(); | 698 | _setCustomerActivityBaseinfo(); |
| 471 | }, | 699 | }, |
| 472 | text: '保存', | 700 | text: '保存', |
| 473 | fontSize: 34, | 701 | fontSize: 34, |
| 474 | isBold: false, | 702 | isBold: false, |
| 475 | - height: ScreenUtil().setWidth(80), | ||
| 476 | - width: double.infinity, | ||
| 477 | - radius: ScreenUtil().setWidth(10), | 703 | + height: ScreenUtil().setWidth(100), |
| 704 | + width: ScreenUtil().setWidth(154 * 2), | ||
| 705 | + gradientStart: _phoneController.text | ||
| 706 | + .trim() | ||
| 707 | + .length == | ||
| 708 | + 0 || | ||
| 709 | + _nameController.text.trim().length == 0 | ||
| 710 | + ? MyColours.color_BFC4D4 | ||
| 711 | + : MyColours.color_438E93, | ||
| 712 | + gradientEnd: _phoneController.text | ||
| 713 | + .trim() | ||
| 714 | + .length == | ||
| 715 | + 0 || | ||
| 716 | + _nameController.text.trim().length == 0 | ||
| 717 | + ? MyColours.color_BFC4D4 | ||
| 718 | + : MyColours.color_438E93, | ||
| 719 | + radius: ScreenUtil().setWidth(24), | ||
| 478 | )) | 720 | )) |
| 479 | ]))))); | 721 | ]))))); |
| 480 | } | 722 | } |
| 1 | import 'package:flutter/material.dart'; | 1 | import 'package:flutter/material.dart'; |
| 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; | 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
| 3 | import 'package:fluwx/fluwx.dart'; | 3 | import 'package:fluwx/fluwx.dart'; |
| 4 | +import 'package:one_key/constant/state.dart'; | ||
| 4 | import 'package:one_key/models/sms_info.dart'; | 5 | import 'package:one_key/models/sms_info.dart'; |
| 5 | import 'package:one_key/models/version.dart'; | 6 | import 'package:one_key/models/version.dart'; |
| 6 | import 'package:one_key/provider/my_model.dart'; | 7 | import 'package:one_key/provider/my_model.dart'; |
| @@ -344,7 +345,8 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | @@ -344,7 +345,8 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | ||
| 344 | title: "个人信息", | 345 | title: "个人信息", |
| 345 | content: "", | 346 | content: "", |
| 346 | callback: () { | 347 | callback: () { |
| 347 | - NavigatorUtil.goBaseInfoPage(context); | 348 | + NavigatorUtil.goBaseInfoPage( |
| 349 | + context, FromPage.FromPageMyPage); | ||
| 348 | }, | 350 | }, |
| 349 | ), | 351 | ), |
| 350 | 352 |
| @@ -19,7 +19,7 @@ class UploadImageProvider extends ChangeNotifier { | @@ -19,7 +19,7 @@ class UploadImageProvider extends ChangeNotifier { | ||
| 19 | UploadImgModel erweima = UploadImgModel(); //二维码 | 19 | UploadImgModel erweima = UploadImgModel(); //二维码 |
| 20 | UploadImgModel mentou = UploadImgModel(); //店铺信息----门头照片 | 20 | UploadImgModel mentou = UploadImgModel(); //店铺信息----门头照片 |
| 21 | UploadImgModel dish = UploadImgModel(); //菜品 | 21 | UploadImgModel dish = UploadImgModel(); //菜品 |
| 22 | - double imgSizeTouxiang = 84; | 22 | + double imgSizeTouxiang = 76; |
| 23 | double imgSizeErweima = 22; | 23 | double imgSizeErweima = 22; |
| 24 | double imgSizeMenTou = 64; | 24 | double imgSizeMenTou = 64; |
| 25 | List<UploadImgModel> imageListDenvironment = []; //环境信息列表 | 25 | List<UploadImgModel> imageListDenvironment = []; //环境信息列表 |
| 1 | import 'package:flutter/material.dart'; | 1 | import 'package:flutter/material.dart'; |
| 2 | 2 | ||
| 3 | class MyColours { | 3 | class MyColours { |
| 4 | - | ||
| 5 | - | ||
| 6 | - static const Color color_27262B = Color(0xff27262B); | 4 | + static const Color color_438E93 = Color(0xff438E93); |
| 5 | + static const Color color_27262B = Color(0xff27262B); | ||
| 7 | static const Color color_BFC4D4 = Color(0xffBFC4D4); | 6 | static const Color color_BFC4D4 = Color(0xffBFC4D4); |
| 8 | static const Color color_C9C9C9 = Color(0xffC9C9C9); | 7 | static const Color color_C9C9C9 = Color(0xffC9C9C9); |
| 9 | static const Color color_F7F7F7 = Color(0xffF7F7F7); | 8 | static const Color color_F7F7F7 = Color(0xffF7F7F7); |
| 1 | import 'package:fluro/fluro.dart'; | 1 | import 'package:fluro/fluro.dart'; |
| 2 | import 'package:flutter/material.dart'; | 2 | import 'package:flutter/material.dart'; |
| 3 | import 'package:one_key/constant/state.dart'; | 3 | import 'package:one_key/constant/state.dart'; |
| 4 | +import 'package:one_key/models/check_seller_acc_model.dart'; | ||
| 4 | import 'package:one_key/models/cookbook_model.dart'; | 5 | import 'package:one_key/models/cookbook_model.dart'; |
| 5 | import 'package:one_key/models/coupon_model.dart'; | 6 | import 'package:one_key/models/coupon_model.dart'; |
| 6 | import 'package:one_key/models/customer_by_seller_model.dart'; | 7 | import 'package:one_key/models/customer_by_seller_model.dart'; |
| @@ -272,9 +273,17 @@ class NavigatorUtil { | @@ -272,9 +273,17 @@ class NavigatorUtil { | ||
| 272 | } | 273 | } |
| 273 | 274 | ||
| 274 | /// 个人资料页面 | 275 | /// 个人资料页面 |
| 275 | - static Future<dynamic> goBaseInfoPage(BuildContext context, | ||
| 276 | - {replace = false}) { | ||
| 277 | - return _navigateTo(context, "${Routes.base_info}", replace: replace); | 276 | + static Future<dynamic> goBaseInfoPage(BuildContext context, FromPage fromPage, |
| 277 | + {replace = false, CheckSellerAccSunModel sunModel}) { | ||
| 278 | + if (sunModel != null) { | ||
| 279 | + return _navigateTo(context, | ||
| 280 | + "${Routes.base_info}?fromPage=${FluroConvertUtils.enumToString(fromPage)}&sunModel=${FluroConvertUtils.object2string(sunModel)}", | ||
| 281 | + replace: replace); | ||
| 282 | + } else { | ||
| 283 | + return _navigateTo(context, | ||
| 284 | + "${Routes.base_info}?fromPage=${FluroConvertUtils.enumToString(fromPage)}", | ||
| 285 | + replace: replace); | ||
| 286 | + } | ||
| 278 | } | 287 | } |
| 279 | 288 | ||
| 280 | /// 绑定手机号吗页面 | 289 | /// 绑定手机号吗页面 |
| @@ -3,6 +3,7 @@ import 'dart:convert'; | @@ -3,6 +3,7 @@ import 'dart:convert'; | ||
| 3 | import 'package:fluro/fluro.dart'; | 3 | import 'package:fluro/fluro.dart'; |
| 4 | import 'package:flutter/material.dart'; | 4 | import 'package:flutter/material.dart'; |
| 5 | import 'package:one_key/constant/state.dart'; | 5 | import 'package:one_key/constant/state.dart'; |
| 6 | +import 'package:one_key/models/check_seller_acc_model.dart'; | ||
| 6 | import 'package:one_key/models/cookbook_model.dart'; | 7 | import 'package:one_key/models/cookbook_model.dart'; |
| 7 | import 'package:one_key/models/coupon_model.dart'; | 8 | import 'package:one_key/models/coupon_model.dart'; |
| 8 | import 'package:one_key/models/customer_by_seller_model.dart'; | 9 | import 'package:one_key/models/customer_by_seller_model.dart'; |
| @@ -480,11 +481,28 @@ var baseInfoPageHandler = new Handler( | @@ -480,11 +481,28 @@ var baseInfoPageHandler = new Handler( | ||
| 480 | handlerFunc: (BuildContext context, Map<String, List<Object>> params) { | 481 | handlerFunc: (BuildContext context, Map<String, List<Object>> params) { |
| 481 | // CouponSunModel couponSunModel = CouponSunModel.fromJson(json.decode( | 482 | // CouponSunModel couponSunModel = CouponSunModel.fromJson(json.decode( |
| 482 | // FluroConvertUtils.fluroCnParamsDecode(params["couponSunModel"].first))); | 483 | // FluroConvertUtils.fluroCnParamsDecode(params["couponSunModel"].first))); |
| 483 | - | 484 | + FromPage fromPage = FluroConvertUtils.enumFromString<FromPage>( |
| 485 | + FromPage.values, params["fromPage"].first); | ||
| 486 | + if (params.keys.contains('sunModel')) { | ||
| 487 | + CheckSellerAccSunModel sunModel = CheckSellerAccSunModel.fromJson( | ||
| 488 | + json.decode( | ||
| 489 | + FluroConvertUtils.fluroCnParamsDecode(params["sunModel"].first))); | ||
| 490 | + return ChangeNotifierProvider<BaseIndoProvider>( | ||
| 491 | + create: (_) => BaseIndoProvider(), | ||
| 492 | + child: ChangeNotifierProvider<UploadImageProvider>( | ||
| 493 | + create: (_) => UploadImageProvider(), | ||
| 494 | + child: BaseInfoPage( | ||
| 495 | + fromPage: fromPage, | ||
| 496 | + sunModel: sunModel, | ||
| 497 | + ))); | ||
| 498 | + } | ||
| 484 | return ChangeNotifierProvider<BaseIndoProvider>( | 499 | return ChangeNotifierProvider<BaseIndoProvider>( |
| 485 | create: (_) => BaseIndoProvider(), | 500 | create: (_) => BaseIndoProvider(), |
| 486 | child: ChangeNotifierProvider<UploadImageProvider>( | 501 | child: ChangeNotifierProvider<UploadImageProvider>( |
| 487 | - create: (_) => UploadImageProvider(), child: BaseInfoPage())); | 502 | + create: (_) => UploadImageProvider(), |
| 503 | + child: BaseInfoPage( | ||
| 504 | + fromPage: fromPage, | ||
| 505 | + ))); | ||
| 488 | }); | 506 | }); |
| 489 | 507 | ||
| 490 | ///绑定手机号码页面 | 508 | ///绑定手机号码页面 |
-
Please register or login to post a comment