Commit 7957b10eb182b7e9da0819100836279f7b1b68ff

Authored by wdn127929
1 parent 622d2b78

个人信息新UI

... ... @@ -23,4 +23,7 @@ enum FromPage {
FromPageCustomerList,
FromPageMakeRecordDetail,
FromPageShowCutomerList, //仅展示客户列表,没有选择按钮
FromPageIfNeedCreateStore,
FromPageMyPage,
FromPageInvicationPage
}
... ...
... ... @@ -198,7 +198,7 @@ class _CreateStorePageState extends State<CreateStorePage> {
}
});
if (pickedFile != null) {
model.imgSizeTouxiang = 84;
model.imgSizeTouxiang = 76;
model.touxiang.qiniuUrl = null;
UploadImageUtil().startUpload(context, File(pickedFile.path),
title == '头像' ? 0 : 1, true, model, UploadType.StoreFrontUploadType);
... ...
... ... @@ -829,7 +829,8 @@ class InvicationPageState extends State<InvicationPage>
}
_goBaseInfoPage() async {
bool needRefresh = await NavigatorUtil.goBaseInfoPage(context);
bool needRefresh = await NavigatorUtil.goBaseInfoPage(
context, FromPage.FromPageInvicationPage);
Utils.changeStatusColor(color: Colors.transparent);
if (needRefresh != null && needRefresh) {
//刷新页面数据
... ...
... ... @@ -50,7 +50,6 @@ class _IfNeedCreateStoreState extends State<IfNeedCreateStore>
WidgetsBinding.instance.addObserver(this);
WidgetsBinding.instance.addPostFrameCallback((_) {
_checkSellerAcc();
_getCustomerActivityBaseinfo();
});
bus.on("refresh_store_list", (arg) {
_checkSellerAcc();
... ... @@ -87,10 +86,10 @@ class _IfNeedCreateStoreState extends State<IfNeedCreateStore>
}
}
_getCustomerActivityBaseinfo() async {
_getCustomerActivityBaseinfo(String sellerid, String openid) async {
Map<String, String> params = {
'sellerid': Provider.of<UserModel>(context, listen: false).user.sellerid,
"uid": Provider.of<UserModel>(context, listen: false).user.openid,
'sellerid': sellerid,
"uid": openid,
};
bool success = await _baseIndoProvider
.getCustomerActivityBaseinfo(context, params, isShowLoading: false);
... ... @@ -118,11 +117,15 @@ class _IfNeedCreateStoreState extends State<IfNeedCreateStore>
}
///点击某个店铺
_clickStore(context, CheckSellerAccSunModel sunModel) {
_clickStore(context, CheckSellerAccSunModel sunModel) async {
Map<String, dynamic> seller = sunModel.toJson();
await _getCustomerActivityBaseinfo(seller['id'], seller['uid']);
//判断进入个人信息还是直接进入主页
if (name == '' || phone == '') {
//姓名或者电话有一个为空时,进入个人资料填写页面
NavigatorUtil.goBaseInfoPage(context);
NavigatorUtil.goBaseInfoPage(context, FromPage.FromPageIfNeedCreateStore,
sunModel: sunModel);
} else {
_loginStore(context, sunModel);
}
... ...
... ... @@ -4,6 +4,8 @@ import 'dart:ui';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/screenutil.dart';
import 'package:one_key/constant/state.dart';
import 'package:one_key/models/check_seller_acc_model.dart';
import 'package:one_key/models/upload_img_model.dart';
import 'package:one_key/models/user.dart';
import 'package:one_key/pages/online_check/photo_view_wiget.dart';
... ... @@ -23,8 +25,12 @@ import 'package:image_picker/image_picker.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
import '../../app.dart';
class BaseInfoPage extends StatefulWidget {
BaseInfoPage({Key key}) : super(key: key);
final FromPage fromPage;
final CheckSellerAccSunModel sunModel;
BaseInfoPage({Key key, this.fromPage, this.sunModel}) : super(key: key);
@override
_BaseInfoPageState createState() => _BaseInfoPageState();
... ... @@ -45,17 +51,51 @@ class _BaseInfoPageState extends State<BaseInfoPage> {
UploadImageProvider _uploadImageProvider;
BaseIndoProvider _baseIndoProvider;
String nameStr = '未填写';
String phoneStr = '';
bool isSelect = true;
@override
void initState() {
super.initState();
_scrollController = ScrollController();
_nameFocusNode.addListener(() {
if (_nameFocusNode.hasFocus) {
print('得到焦点');
} else {
print('失去焦点');
}
setState(() {});
});
_phoneFocusNode.addListener(() {
if (_phoneFocusNode.hasFocus) {
print('得到焦点');
} else {
print('失去焦点');
}
});
_positionFocusNode.addListener(() {
if (_positionFocusNode.hasFocus) {
print('得到焦点');
} else {
print('失去焦点');
}
setState(() {});
});
_wechatFocusNode.addListener(() {
if (_wechatFocusNode.hasFocus) {
print('得到焦点');
} else {
print('失去焦点');
}
setState(() {});
});
WidgetsBinding.instance.addPostFrameCallback((_) {
_uploadImageProvider.touxiang.process = 0.01;
_uploadImageProvider.touxiang.qiniuUrl = '';
_uploadImageProvider.erweima.process = 0.01;
_uploadImageProvider.erweima.qiniuUrl = '';
_uploadImageProvider.imgSizeTouxiang = 84;
_uploadImageProvider.imgSizeTouxiang = 76;
_uploadImageProvider.imgSizeErweima = 22;
_getQiniuInfo();
_getCustomerActivityBaseinfo();
... ... @@ -63,20 +103,41 @@ class _BaseInfoPageState extends State<BaseInfoPage> {
}
_getCustomerActivityBaseinfo() async {
Map<String, String> params = {
'sellerid': Provider.of<UserModel>(context, listen: false).user.sellerid,
"uid": Provider.of<UserModel>(context, listen: false).user.openid,
};
Map<String, String> params;
if (widget.fromPage == FromPage.FromPageIfNeedCreateStore) {
Map<String, dynamic> seller = widget.sunModel.toJson();
params = {
'sellerid': seller['id'],
"uid": seller['uid'],
};
} else {
params = {
'sellerid':
Provider.of<UserModel>(context, listen: false).user.sellerid,
"uid": Provider.of<UserModel>(context, listen: false).user.openid,
};
}
bool success =
await _baseIndoProvider.getCustomerActivityBaseinfo(context, params);
if (success) {
_nameController.text = _baseIndoProvider.baseInfoSunModel.name;
nameStr = _baseIndoProvider.baseInfoSunModel.name;
_uploadImageProvider.touxiang.qiniuUrl =
_baseIndoProvider.baseInfoSunModel.photo;
_uploadImageProvider.erweima.qiniuUrl =
_baseIndoProvider.baseInfoSunModel.qrcode;
_phoneController.text = _baseIndoProvider.baseInfoSunModel.phone;
phoneStr = _baseIndoProvider.baseInfoSunModel.phone ?? '';
_wechatController.text = _baseIndoProvider.baseInfoSunModel.wechat;
if (_baseIndoProvider.baseInfoSunModel.wechat != null &&
_baseIndoProvider.baseInfoSunModel.wechat != '' &&
phoneStr != '' &&
_baseIndoProvider.baseInfoSunModel.wechat == phoneStr) {
isSelect = true;
} else {
isSelect = false;
}
_positionController.text = _baseIndoProvider.baseInfoSunModel.position;
_uploadImageProvider.imgSizeErweima = 64;
// setState(() {});
... ... @@ -94,30 +155,41 @@ class _BaseInfoPageState extends State<BaseInfoPage> {
_setCustomerActivityBaseinfo() async {
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
User user = Provider.of<UserModel>(context, listen: false).user;
String nameTemp = _nameController.text.trim();
String phoneTemp = _phoneController.text.trim();
Map<String, String> params = {
'sellerid': user.sellerid,
"uid": user.openid,
"name": _nameController.text.trim().length == 0
? user.sellername
: _nameController.text.trim(),
"photo": _uploadImageProvider.touxiang.qiniuUrl.trim().length == 0
? 'http://nosqn.colorcun.com/yd_person.png'
"name": nameTemp,
'phone': phoneTemp,
"photo": _uploadImageProvider.touxiang.qiniuUrl.trim().length == 0 ||
_uploadImageProvider.touxiang.qiniuUrl ==
'http://nosqn.colorcun.com/yd_person.png'
? App.sp.getString("headImg")
: _uploadImageProvider.touxiang.qiniuUrl,
"position": _positionController.text.trim().length == 0
? '经理'
: _positionController.text,
};
if (_phoneController.text.trim().length == 0) {
if (user.userphone != null) {
params['phone'] = user.userphone;
}
if (widget.fromPage == FromPage.FromPageIfNeedCreateStore) {
Map<String, dynamic> seller = widget.sunModel.toJson();
params['sellerid'] = seller['id'];
params["uid"] = seller['uid'];
} else {
params['phone'] = _phoneController.text.trim();
params['sellerid'] =
Provider.of<UserModel>(context, listen: false).user.sellerid;
params["uid"] =
Provider.of<UserModel>(context, listen: false).user.openid;
}
if (_wechatController.text.trim().length > 0) {
params['wechat'] = _wechatController.text;
if (isSelect) {
params['wechat'] = phoneTemp;
} else {
if (_wechatController.text.trim().length > 0) {
params['wechat'] = _wechatController.text;
}
}
if (_uploadImageProvider.erweima.qiniuUrl != null &&
_uploadImageProvider.erweima.qiniuUrl != '') {
params['qrcode'] = _uploadImageProvider.erweima.qiniuUrl;
... ... @@ -131,14 +203,49 @@ class _BaseInfoPageState extends State<BaseInfoPage> {
if (isSuccess) {
_uploadImageProvider.touxiang.file = null;
_uploadImageProvider.erweima.file = null;
nameStr = nameTemp;
phoneStr = phoneTemp;
//成功之后跳回前一个页面
// bus.emit('refresh_coupon_list');
Utils.showToast('保存成功');
EventBus().emit('changeStatusColor');
Navigator.pop(context, true);
if (widget.fromPage == FromPage.FromPageIfNeedCreateStore) {
_loginStore(context, widget.sunModel);
} else {
Navigator.pop(context, true);
}
}
}
///进入某个店铺
_loginStore(context, CheckSellerAccSunModel sunModel) {
UserModel userModel = Provider.of<UserModel>(context, listen: false);
userModel.accountLogin = false;
Map<String, dynamic> seller = sunModel.toJson();
Map<String, dynamic> userMap = {
"openid": seller['uid'],
"account": seller['account'],
"role_name": seller['role_name'],
"sellerid": seller['id'],
"sellercode": seller['seller_code'],
"sellername": seller['sellername'],
"sellerphone": seller['seller_tel'],
"sellerAddr": '',
"scatter": 0,
"room": 0,
"cassette": 0,
"morning": "",
"noon": "",
"night": "",
};
userModel.saveUserInfo(User.fromJson(userMap));
userModel.getSellerInfo(
context,
{"seller_id": seller['id'], "seller_openid": seller['openid']},
userMap);
}
///输入框
Widget _textfield(String image, String hintText,
TextEditingController editingController, FocusNode focusNode) {
... ... @@ -159,6 +266,7 @@ class _BaseInfoPageState extends State<BaseInfoPage> {
// textAlign: TextAlign.right,
// textAlignVertical: TextAlignVertical.bottom,
maxLines: 1,
// //光标颜色
// cursorColor:
// widget.isSelect ? Colors.white : MyColours.color_199095,
... ... @@ -168,6 +276,19 @@ class _BaseInfoPageState extends State<BaseInfoPage> {
),
focusNode: focusNode,
decoration: InputDecoration(
// suffixText: '修改',
// suffixStyle: TextStyle(
// fontSize: ScreenUtil().setSp(24),
// color: MyColours.color_BFC4D4),
// suffixIcon: Container(
// margin: EdgeInsets.only(left: ScreenUtil().setWidth(16)),
// child: Image.asset(
// Utils.getImgPath('arrow_right_new'),
// width: ScreenUtil().setWidth(20),
// height: ScreenUtil().setWidth(40),
// )),
// suffixIconConstraints:
// BoxConstraints(maxWidth: ScreenUtil().setWidth(56)),
border: OutlineInputBorder(borderSide: BorderSide.none),
hintText: hintText,
hintStyle: TextStyle(
... ... @@ -181,24 +302,50 @@ class _BaseInfoPageState extends State<BaseInfoPage> {
borderSide: BorderSide.none,
),
),
onChanged: (value) {},
onChanged: (value) {
print('vvvvvv');
if (hintText == '您希望顾客看到的名字') {
setState(() {
nameStr = value;
});
} else if (hintText == '顾客联系您的手机号') {
setState(() {
phoneStr = value;
});
}
},
onEditingComplete: () {
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
},
keyboardType: TextInputType.text,
),
),
Text('修改',
style: TextStyle(
color: MyColours.color_BFC4D4,
fontSize: ScreenUtil().setSp(24),
)),
HEmptyView(20),
Image.asset(
Utils.getImgPath('arrow_right_new'),
// width: ScreenUtil().setWidth(16),
height: ScreenUtil().setWidth(34),
)
focusNode.hasFocus
? SizedBox()
: InkWell(
onTap: () {
FocusScope.of(context).requestFocus(focusNode); // 获取焦点
setState(() {});
},
child: Row(
children: [
Text(
'修改',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_BFC4D4),
),
Container(
margin:
EdgeInsets.only(left: ScreenUtil().setWidth(16)),
child: Image.asset(
Utils.getImgPath('base_arrow_r'),
width: ScreenUtil().setWidth(20),
height: ScreenUtil().setWidth(40),
)),
],
))
],
),
);
... ... @@ -250,7 +397,7 @@ class _BaseInfoPageState extends State<BaseInfoPage> {
});
if (pickedFile != null) {
if (title == '头像') {
_uploadImageProvider.imgSizeTouxiang = 84;
_uploadImageProvider.imgSizeTouxiang = 76;
_uploadImageProvider.touxiang.qiniuUrl = null;
} else {
_uploadImageProvider.imgSizeErweima = 76;
... ... @@ -290,51 +437,85 @@ class _BaseInfoPageState extends State<BaseInfoPage> {
},
child: Stack(clipBehavior: Clip.none, children: [
Container(
width: ScreenUtil().setWidth(imgSize * 2),
height: ScreenUtil().setWidth(imgSize * 2),
width: ScreenUtil().setWidth(93 * 2),
height: ScreenUtil().setWidth(93 * 2),
margin: EdgeInsets.only(
right: ScreenUtil().setWidth(14),
right: ScreenUtil().setWidth(24),
),
child: ClipRRect(
borderRadius:
BorderRadius.circular(ScreenUtil().setWidth(radius)),
child: model.file == null
? model.qiniuUrl != null && model.qiniuUrl != ''
? Image.network(
model.qiniuUrl,
fit: BoxFit.cover,
width: ScreenUtil().setWidth(imgSize * 2),
height: ScreenUtil().setWidth(imgSize * 2),
)
: Image.asset(
Utils.getImgPath(
title == '头像' ? 'touxiang' : 'erweima'),
borderRadius:
BorderRadius.circular(ScreenUtil().setWidth(93)),
child: Image.asset(
Utils.getImgPath('base_tx_bg'),
fit: BoxFit.cover,
width: ScreenUtil().setWidth(93 * 2),
height: ScreenUtil().setWidth(93 * 2),
))),
Positioned(
top: ScreenUtil().setWidth(9),
left: ScreenUtil().setWidth(17),
child: Container(
width: ScreenUtil().setWidth(imgSize * 2),
height: ScreenUtil().setWidth(imgSize * 2),
// margin: EdgeInsets.only(
// right: ScreenUtil().setWidth(24),
// ),
child: ClipRRect(
borderRadius:
BorderRadius.circular(ScreenUtil().setWidth(radius)),
child: model.file == null
? model.qiniuUrl != null &&
model.qiniuUrl != '' &&
model.qiniuUrl !=
'http://nosqn.colorcun.com/yd_person.png'
? Image.network(
model.qiniuUrl,
fit: BoxFit.cover,
width: ScreenUtil().setWidth(imgSize * 2),
height: ScreenUtil().setWidth(imgSize * 2),
)
: App.sp.getString("headImg") == ''
? Image.asset(
Utils.getImgPath(title == '头像'
? 'base_tx_mr'
: 'erweima'),
fit: BoxFit.cover,
width: ScreenUtil().setWidth(imgSize * 2),
height: ScreenUtil().setWidth(imgSize * 2),
)
: Image.network(
App.sp.getString("headImg"),
fit: BoxFit.cover,
width: ScreenUtil().setWidth(imgSize * 2),
height: ScreenUtil().setWidth(imgSize * 2),
)
: Image.file(
model.file,
fit: BoxFit.cover,
width: ScreenUtil().setWidth(imgSize * 2),
height: ScreenUtil().setWidth(imgSize * 2),
)
: Image.file(
model.file,
fit: BoxFit.cover,
width: ScreenUtil().setWidth(imgSize * 2),
height: ScreenUtil().setWidth(imgSize * 2),
),
))),
Positioned(
right: ScreenUtil().setWidth(42),
top: ScreenUtil().setWidth(9),
child: (model.file != null) &&
model.process != 1 &&
model.process != 0.01
? Container(
width: ScreenUtil().setWidth(imgSize * 2),
height: ScreenUtil().setWidth(imgSize * 2),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(radius),
color: Color.fromRGBO(0, 0, 0, 0.6)),
child: Center(
child: Text('上传中',
style: TextStyle(color: MyColours.color_999999)),
),
)),
// (model.file != null) && model.process != 1 && model.process != 0.01
// ? Container(
// width: ScreenUtil().setWidth(imgSize * 2),
// height: ScreenUtil().setWidth(imgSize * 2),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(radius),
// color: Color.fromRGBO(0, 0, 0, 0.6)),
// child: Center(
// child: Text('上传中',
// style: TextStyle(color: MyColours.color_999999)),
// ),
// )
// : Container(),
)
: Container()),
Positioned(
right: ScreenUtil().setWidth(-14),
right: ScreenUtil().setWidth(14),
top: ScreenUtil().setWidth(56),
child: InkWell(
onTap: () {
... ... @@ -398,14 +579,15 @@ class _BaseInfoPageState extends State<BaseInfoPage> {
_uploadImageProvider.imgSizeTouxiang,
76),
VEmptyView(26),
Text('未填写',
Text(nameStr,
style: TextStyle(
fontSize: ScreenUtil().setWidth(50),
color: true
? MyColours.color_27262B
: MyColours.color_BFC4D4)),
color: nameStr == '未填写' ||
nameStr == ''
? MyColours.color_BFC4D4
: MyColours.color_27262B)),
VEmptyView(8),
Text('18739383883',
Text(phoneStr == null ? '' : phoneStr,
style: TextStyle(
fontSize: ScreenUtil().setWidth(30),
color: MyColours.color_BFC4D4)),
... ... @@ -444,15 +626,56 @@ class _BaseInfoPageState extends State<BaseInfoPage> {
VEmptyView(26),
// _imageWidget('微信二维码', _uploadImageProvider.erweima,
// _uploadImageProvider.imgSizeErweima, 0),
Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40),
),
child: _textfield(
'base_wechat',
'微信号方便顾客加您微信',
_wechatController,
_wechatFocusNode)),
InkWell(
onTap: () {
setState(() {
isSelect = !isSelect;
});
},
child: Container(
padding: EdgeInsets.only(
left: ScreenUtil().setWidth(40),
right: ScreenUtil().setWidth(40),
bottom:
ScreenUtil().setWidth(26)),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Image.asset(
Utils.getImgPath(isSelect
? 'base_radio_sel'
: 'base_radio_un'),
// width: ScreenUtil().setWidth(16),
height:
ScreenUtil().setWidth(34),
),
HEmptyView(24),
Text('微信同电话号',
style: TextStyle(
color: isSelect
? MyColours.color_438E93
: MyColours
.color_BFC4D4,
fontSize:
ScreenUtil().setSp(30),
)),
],
),
)),
isSelect
? SizedBox()
: Padding(
padding: EdgeInsets.symmetric(
horizontal:
ScreenUtil().setWidth(40),
),
child: _textfield(
'base_wechat',
'微信号方便顾客加您微信',
_wechatController,
_wechatFocusNode)),
VEmptyView(30),
],
)),
... ... @@ -463,18 +686,37 @@ class _BaseInfoPageState extends State<BaseInfoPage> {
ScreenUtil().setWidth(40),
0,
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(40)),
ScreenUtil().setWidth(56)),
child: RoundButton(
onPressed: () {
//接口
if (_phoneController.text.trim().length ==
0 ||
_nameController.text.trim().length == 0) {
Utils.showToast('请至少填写您的姓名和电话');
return;
} //接口
_setCustomerActivityBaseinfo();
},
text: '保存',
fontSize: 34,
isBold: false,
height: ScreenUtil().setWidth(80),
width: double.infinity,
radius: ScreenUtil().setWidth(10),
height: ScreenUtil().setWidth(100),
width: ScreenUtil().setWidth(154 * 2),
gradientStart: _phoneController.text
.trim()
.length ==
0 ||
_nameController.text.trim().length == 0
? MyColours.color_BFC4D4
: MyColours.color_438E93,
gradientEnd: _phoneController.text
.trim()
.length ==
0 ||
_nameController.text.trim().length == 0
? MyColours.color_BFC4D4
: MyColours.color_438E93,
radius: ScreenUtil().setWidth(24),
))
])))));
}
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:fluwx/fluwx.dart';
import 'package:one_key/constant/state.dart';
import 'package:one_key/models/sms_info.dart';
import 'package:one_key/models/version.dart';
import 'package:one_key/provider/my_model.dart';
... ... @@ -344,7 +345,8 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
title: "个人信息",
content: "",
callback: () {
NavigatorUtil.goBaseInfoPage(context);
NavigatorUtil.goBaseInfoPage(
context, FromPage.FromPageMyPage);
},
),
... ...
... ... @@ -19,7 +19,7 @@ class UploadImageProvider extends ChangeNotifier {
UploadImgModel erweima = UploadImgModel(); //二维码
UploadImgModel mentou = UploadImgModel(); //店铺信息----门头照片
UploadImgModel dish = UploadImgModel(); //菜品
double imgSizeTouxiang = 84;
double imgSizeTouxiang = 76;
double imgSizeErweima = 22;
double imgSizeMenTou = 64;
List<UploadImgModel> imageListDenvironment = []; //环境信息列表
... ...
import 'package:flutter/material.dart';
class MyColours {
static const Color color_27262B = Color(0xff27262B);
static const Color color_438E93 = Color(0xff438E93);
static const Color color_27262B = Color(0xff27262B);
static const Color color_BFC4D4 = Color(0xffBFC4D4);
static const Color color_C9C9C9 = Color(0xffC9C9C9);
static const Color color_F7F7F7 = Color(0xffF7F7F7);
... ...
import 'package:fluro/fluro.dart';
import 'package:flutter/material.dart';
import 'package:one_key/constant/state.dart';
import 'package:one_key/models/check_seller_acc_model.dart';
import 'package:one_key/models/cookbook_model.dart';
import 'package:one_key/models/coupon_model.dart';
import 'package:one_key/models/customer_by_seller_model.dart';
... ... @@ -272,9 +273,17 @@ class NavigatorUtil {
}
/// 个人资料页面
static Future<dynamic> goBaseInfoPage(BuildContext context,
{replace = false}) {
return _navigateTo(context, "${Routes.base_info}", replace: replace);
static Future<dynamic> goBaseInfoPage(BuildContext context, FromPage fromPage,
{replace = false, CheckSellerAccSunModel sunModel}) {
if (sunModel != null) {
return _navigateTo(context,
"${Routes.base_info}?fromPage=${FluroConvertUtils.enumToString(fromPage)}&sunModel=${FluroConvertUtils.object2string(sunModel)}",
replace: replace);
} else {
return _navigateTo(context,
"${Routes.base_info}?fromPage=${FluroConvertUtils.enumToString(fromPage)}",
replace: replace);
}
}
/// 绑定手机号吗页面
... ...
... ... @@ -3,6 +3,7 @@ import 'dart:convert';
import 'package:fluro/fluro.dart';
import 'package:flutter/material.dart';
import 'package:one_key/constant/state.dart';
import 'package:one_key/models/check_seller_acc_model.dart';
import 'package:one_key/models/cookbook_model.dart';
import 'package:one_key/models/coupon_model.dart';
import 'package:one_key/models/customer_by_seller_model.dart';
... ... @@ -480,11 +481,28 @@ var baseInfoPageHandler = new Handler(
handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
// CouponSunModel couponSunModel = CouponSunModel.fromJson(json.decode(
// FluroConvertUtils.fluroCnParamsDecode(params["couponSunModel"].first)));
FromPage fromPage = FluroConvertUtils.enumFromString<FromPage>(
FromPage.values, params["fromPage"].first);
if (params.keys.contains('sunModel')) {
CheckSellerAccSunModel sunModel = CheckSellerAccSunModel.fromJson(
json.decode(
FluroConvertUtils.fluroCnParamsDecode(params["sunModel"].first)));
return ChangeNotifierProvider<BaseIndoProvider>(
create: (_) => BaseIndoProvider(),
child: ChangeNotifierProvider<UploadImageProvider>(
create: (_) => UploadImageProvider(),
child: BaseInfoPage(
fromPage: fromPage,
sunModel: sunModel,
)));
}
return ChangeNotifierProvider<BaseIndoProvider>(
create: (_) => BaseIndoProvider(),
child: ChangeNotifierProvider<UploadImageProvider>(
create: (_) => UploadImageProvider(), child: BaseInfoPage()));
create: (_) => UploadImageProvider(),
child: BaseInfoPage(
fromPage: fromPage,
)));
});
///绑定手机号码页面
... ...