Commit e89e87ed4f44978bef80e9e2441f0bbe5645f458

Authored by wdn127929
1 parent 7d57d9f7

我的UI+嗲怒头像

... ... @@ -12,14 +12,14 @@ if (flutterRoot == null) {
}
def flutterVersionCode = "380"
def flutterVersionCode = "381"
if (flutterVersionCode == null) {
flutterVersionCode = '380'
flutterVersionCode = '381'
}
def flutterVersionName = "3.8.0"
def flutterVersionName = "3.8.1"
if (flutterVersionName == null) {
flutterVersionName = '3.8.0'
flutterVersionName = '3.8.1'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
... ...
... ... @@ -142,6 +142,7 @@ class _IfNeedCreateStoreState extends State<IfNeedCreateStore>
"role_name": seller['role_name'],
"sellerid": seller['id'],
"sellercode": seller['seller_code'],
"sellerimage": seller['seller_image'],
"sellername": seller['sellername'],
"sellerphone": seller['seller_tel'],
"sellerAddr": '',
... ... @@ -152,6 +153,7 @@ class _IfNeedCreateStoreState extends State<IfNeedCreateStore>
"noon": "",
"night": "",
};
userModel.saveUserInfo(User.fromJson(userMap));
userModel.getSellerInfo(
context,
... ...
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter_ex_widget/ex_text.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:fluwx/fluwx.dart';
import 'package:one_key/constant/state.dart';
... ... @@ -142,6 +143,25 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
}, showToast: false);
}
Widget _item(String name, String title) {
return Column(
children: [
Image.asset(
name,
width: ScreenUtil().setWidth(32 * 2),
),
VEmptyView(20),
Text(
title,
style: TextStyle(
fontWeight: FontWeight.bold,
color: MyColours.color_999999,
fontSize: ScreenUtil().setWidth(20)),
)
],
);
}
@override
Widget build(BuildContext context) {
myModel = Provider.of<MyModel>(context, listen: true);
... ... @@ -250,28 +270,33 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontWeight: FontWeight.w600,
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(28)),
),
),
VEmptyView(14),
Container(
padding: EdgeInsets.symmetric(
horizontal:
ScreenUtil().setWidth(8),
vertical: ScreenUtil().setWidth(4)),
height: ScreenUtil().setWidth(30),
padding: EdgeInsets.only(
left: ScreenUtil().setWidth(8),
right: ScreenUtil().setWidth(8),
),
alignment: Alignment.center,
decoration: BoxDecoration(
color: MyColours.color_ffffff,
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(6))),
child: Text(
child: Center(
child: ExText(
model.user.account +
" " +
model.user.role_name,
style: TextStyle(
TextStyle(
fontWeight: FontWeight.bold,
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(16)),
)),
))),
// VEmptyView(20),
// InkWell(
// onTap: () {
... ... @@ -313,7 +338,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
width: ScreenUtil().setWidth(68 * 2),
height: ScreenUtil().setWidth(25 * 2),
fontSize: 24,
isBold: false,
isBold: true,
textColor:
App.sp.getBool("accountLogin") ?? false
? MyColours.color_999999
... ... @@ -371,12 +396,14 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
Text(
myModel.reserveTotal,
style: TextStyle(
fontWeight: FontWeight.bold,
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(40)),
),
Text(
'个',
style: TextStyle(
fontWeight: FontWeight.bold,
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(22)),
)
... ... @@ -386,6 +413,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
Text(
'月订单量',
style: TextStyle(
fontWeight: FontWeight.bold,
color: MyColours.color_BFC4D4,
fontSize: ScreenUtil().setSp(20)),
),
... ... @@ -406,12 +434,14 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
? '${myModel.smsInfo}'
: '0',
style: TextStyle(
fontWeight: FontWeight.bold,
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(40)),
),
Text(
'条',
style: TextStyle(
fontWeight: FontWeight.bold,
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(22)),
)
... ... @@ -426,7 +456,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
width: ScreenUtil().setWidth(48 * 2),
height: ScreenUtil().setWidth(18 * 2),
fontSize: 20,
isBold: false,
isBold: true,
textColor: MyColours.color_ffffff,
radius: ScreenUtil().setWidth(8),
onPressed: () {
... ... @@ -453,6 +483,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
Text(
'${myModel.integralSunModel != null && myModel.integralSunModel.myIntegral != null ? myModel.integralSunModel?.myIntegral : '0'}',
style: TextStyle(
fontWeight: FontWeight.bold,
color: MyColours.color_515151,
fontSize:
ScreenUtil().setSp(40)),
... ... @@ -460,6 +491,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
Text(
'个',
style: TextStyle(
fontWeight: FontWeight.bold,
color: MyColours.color_515151,
fontSize:
ScreenUtil().setSp(22)),
... ... @@ -475,7 +507,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
width: ScreenUtil().setWidth(48 * 2),
height: ScreenUtil().setWidth(18 * 2),
fontSize: 20,
isBold: false,
isBold: true,
textColor: MyColours.color_ffffff,
radius: ScreenUtil().setWidth(8),
onPressed: () {})
... ... @@ -545,6 +577,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
child: Text(
'我的内容',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_515151),
)),
... ... @@ -567,82 +600,25 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
NavigatorUtil.goBaseInfoPage(
context, FromPage.FromPageMyPage);
},
child: Column(
children: [
Image.asset(
Utils.getImgPath('grxx'),
width: ScreenUtil().setWidth(32 * 2),
),
VEmptyView(8),
Text(
'个人信息',
style: TextStyle(
color: MyColours.color_999999,
fontSize:
ScreenUtil().setWidth(20)),
)
],
)),
child:
_item(Utils.getImgPath('grxx'), '个人信息')),
InkWell(
onTap: () {
NavigatorUtil.goMyCustomerPage(context);
},
child: Column(
children: [
Image.asset(
Utils.getImgPath('wdkq'),
width: ScreenUtil().setWidth(32 * 2),
),
VEmptyView(8),
Text(
'我的客情',
style: TextStyle(
color: MyColours.color_999999,
fontSize:
ScreenUtil().setWidth(20)),
)
],
)),
child:
_item(Utils.getImgPath('wdkq'), '我的客情')),
InkWell(
onTap: () {
NavigatorUtil.goCouponPage(context);
},
child: Column(
children: [
Image.asset(
Utils.getImgPath('yhq'),
width: ScreenUtil().setWidth(32 * 2),
),
VEmptyView(8),
Text(
'优惠券',
style: TextStyle(
color: MyColours.color_999999,
fontSize:
ScreenUtil().setWidth(20)),
)
],
)),
child: _item(Utils.getImgPath('yhq'), '优惠券')),
InkWell(
onTap: () {
NavigatorUtil.goRemarkManagerPage(context);
},
child: Column(
children: [
Image.asset(
Utils.getImgPath('cybz'),
width: ScreenUtil().setWidth(32 * 2),
),
VEmptyView(8),
Text(
'常用备注',
style: TextStyle(
color: MyColours.color_999999,
fontSize:
ScreenUtil().setWidth(20)),
)
],
))
child:
_item(Utils.getImgPath('cybz'), '常用备注'))
],
),
)),
... ... @@ -654,6 +630,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
child: Text(
'店铺相关',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_515151),
)),
... ... @@ -696,32 +673,15 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
setState(() {});
}
},
child: Column(
children: [
Image.asset(
userModel.user.role_name ==
'收银员' ||
userModel
.user.role_name ==
'服务员' ||
userModel
.user.role_name ==
'客户经理'
? Utils.getImgPath('dpxx_un')
: Utils.getImgPath('dpxx'),
width:
ScreenUtil().setWidth(32 * 2),
),
VEmptyView(8),
Text(
'店铺信息',
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil()
.setWidth(20)),
)
],
)),
child: _item(
userModel.user.role_name == '收银员' ||
userModel.user.role_name ==
'服务员' ||
userModel.user.role_name ==
'客户经理'
? Utils.getImgPath('dpxx_un')
: Utils.getImgPath('dpxx'),
'店铺信息')),
InkWell(
onTap: () {
if (userModel.user.role_name == '收银员' ||
... ... @@ -734,32 +694,15 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
context);
}
},
child: Column(
children: [
Image.asset(
userModel.user.role_name ==
'收银员' ||
userModel
.user.role_name ==
'服务员' ||
userModel
.user.role_name ==
'客户经理'
? Utils.getImgPath('qdkq_un')
: Utils.getImgPath('qdkq'),
width:
ScreenUtil().setWidth(32 * 2),
),
VEmptyView(8),
Text(
'全店客情',
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil()
.setWidth(20)),
)
],
)),
child: _item(
userModel.user.role_name == '收银员' ||
userModel.user.role_name ==
'服务员' ||
userModel.user.role_name ==
'客户经理'
? Utils.getImgPath('qdkq_un')
: Utils.getImgPath('qdkq'),
'全店客情')),
InkWell(
onTap: () {
if (userModel.user.role_name ==
... ... @@ -772,29 +715,13 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
context);
}
},
child: Column(
children: [
Image.asset(
userModel.user.role_name ==
'收银员' ||
userModel
.user.role_name ==
'服务员'
? Utils.getImgPath('zwgl_un')
: Utils.getImgPath('zwgl'),
width:
ScreenUtil().setWidth(32 * 2),
),
VEmptyView(8),
Text(
'桌位管理',
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil()
.setWidth(20)),
)
],
)),
child: _item(
userModel.user.role_name == '收银员' ||
userModel.user.role_name ==
'服务员'
? Utils.getImgPath('zwgl_un')
: Utils.getImgPath('zwgl'),
'桌位管理')),
InkWell(
onTap: () async {
if (userModel.user.role_name ==
... ... @@ -822,32 +749,16 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
// // _getTablePhoto(context, temp['tid'], showLoading: true)
}
},
child: Column(
children: [
Image.asset(
userModel.user.role_name ==
'收银员' ||
userModel
.user.role_name ==
'服务员'
? Utils.getImgPath('zwzp_un')
: Utils.getImgPath('zwzp'),
width:
ScreenUtil().setWidth(32 * 2),
),
VEmptyView(8),
Text(
'桌位照片',
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil()
.setWidth(20)),
)
],
))
child: _item(
userModel.user.role_name == '收银员' ||
userModel.user.role_name ==
'服务员'
? Utils.getImgPath('zwzp_un')
: Utils.getImgPath('zwzp'),
'桌位照片'))
],
),
VEmptyView(60),
VEmptyView(68),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceEvenly,
... ... @@ -863,29 +774,13 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
context);
}
},
child: Column(
children: [
Image.asset(
userModel.user.role_name ==
'收银员' ||
userModel
.user.role_name ==
'服务员'
? Utils.getImgPath('yggl_un')
: Utils.getImgPath('yggl'),
width:
ScreenUtil().setWidth(32 * 2),
),
VEmptyView(8),
Text(
'员工管理',
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil()
.setWidth(20)),
)
],
)),
child: _item(
userModel.user.role_name == '收银员' ||
userModel.user.role_name ==
'服务员'
? Utils.getImgPath('yggl_un')
: Utils.getImgPath('yggl'),
'员工管理')),
InkWell(
onTap: () {
if (userModel.user.role_name ==
... ... @@ -897,29 +792,13 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
context);
}
},
child: Column(
children: [
Image.asset(
userModel.user.role_name ==
'收银员' ||
userModel
.user.role_name ==
'服务员'
? Utils.getImgPath('cdgl_un')
: Utils.getImgPath('cdgl'),
width:
ScreenUtil().setWidth(32 * 2),
),
VEmptyView(8),
Text(
'菜单管理',
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil()
.setWidth(20)),
)
],
)),
child: _item(
userModel.user.role_name == '收银员' ||
userModel.user.role_name ==
'服务员'
? Utils.getImgPath('cdgl_un')
: Utils.getImgPath('cdgl'),
'菜单管理')),
InkWell(
onTap: () {
if (userModel.user.role_name ==
... ... @@ -931,29 +810,13 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
context);
}
},
child: Column(
children: [
Image.asset(
userModel.user.role_name ==
'收银员' ||
userModel
.user.role_name ==
'服务员'
? Utils.getImgPath('bjlx_un')
: Utils.getImgPath('bjlx'),
width:
ScreenUtil().setWidth(32 * 2),
),
VEmptyView(8),
Text(
'包间类型',
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil()
.setWidth(20)),
)
],
)),
child: _item(
userModel.user.role_name == '收银员' ||
userModel.user.role_name ==
'服务员'
? Utils.getImgPath('bjlx_un')
: Utils.getImgPath('bjlx'),
'包间类型')),
InkWell(
onTap: () {
if (userModel.user.role_name ==
... ... @@ -966,29 +829,13 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
context);
}
},
child: Column(
children: [
Image.asset(
userModel.user.role_name ==
'收银员' ||
userModel
.user.role_name ==
'服务员'
? Utils.getImgPath('bjzm_un')
: Utils.getImgPath('bjzm'),
width:
ScreenUtil().setWidth(32 * 2),
),
VEmptyView(8),
Text(
'包间置满',
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil()
.setWidth(20)),
)
],
))
child: _item(
userModel.user.role_name == '收银员' ||
userModel.user.role_name ==
'服务员'
? Utils.getImgPath('bjzm_un')
: Utils.getImgPath('bjzm'),
'包间置满'))
],
)
],
... ... @@ -1002,6 +849,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
child: Text(
'其他设置',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_515151),
)),
... ... @@ -1032,6 +880,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
Text(
'联系客服',
style: TextStyle(
fontWeight: FontWeight.bold,
color: MyColours.color_515151,
fontSize:
ScreenUtil().setWidth(28)),
... ... @@ -1069,6 +918,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
Text(
'隐私政策',
style: TextStyle(
fontWeight: FontWeight.bold,
color: MyColours.color_515151,
fontSize:
ScreenUtil().setWidth(28)),
... ... @@ -1103,6 +953,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
Text(
'版本升级',
style: TextStyle(
fontWeight: FontWeight.bold,
color: MyColours.color_515151,
fontSize:
ScreenUtil().setWidth(28)),
... ...
This diff could not be displayed because it is too large.
// import 'dart:io';
import 'dart:io';
// import 'package:cached_network_image/cached_network_image.dart';
// import 'package:dio/dio.dart';
// import 'package:flutter/material.dart';
// import 'package:flutter/services.dart';
// import 'package:flutter_screenutil/screenutil.dart';
// import 'package:one_key/models/get_seller_info_model.dart';
// import 'package:one_key/models/set_seller_info_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';
// import 'package:one_key/pages/online_check/progress.dart';
// import 'package:one_key/provider/base_info_provider.dart';
// import 'package:one_key/provider/store_base_info_provider.dart';
// import 'package:one_key/provider/upload_img_provider.dart';
// import 'package:one_key/provider/user_model.dart';
// import 'package:one_key/res/colors.dart';
// import 'package:one_key/route/navigator_util.dart';
// import 'package:one_key/utils/event_bus.dart';
// import 'package:one_key/utils/upload_image_util.dart';
// import 'package:one_key/utils/utils.dart';
// import 'package:one_key/widgets/h_empty_view.dart';
// import 'package:one_key/widgets/round_button.dart';
// import 'package:one_key/widgets/system_app_bar.dart';
// import 'package:one_key/widgets/v_empty_view.dart';
// import 'package:image_picker/image_picker.dart';
// import 'package:permission_handler/permission_handler.dart';
// import 'package:provider/provider.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/screenutil.dart';
import 'package:one_key/models/get_seller_info_model.dart';
import 'package:one_key/models/set_seller_info_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';
import 'package:one_key/pages/online_check/progress.dart';
import 'package:one_key/provider/base_info_provider.dart';
import 'package:one_key/provider/store_base_info_provider.dart';
import 'package:one_key/provider/upload_img_provider.dart';
import 'package:one_key/provider/user_model.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/route/navigator_util.dart';
import 'package:one_key/utils/event_bus.dart';
import 'package:one_key/utils/upload_image_util.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/h_empty_view.dart';
import 'package:one_key/widgets/round_button.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:image_picker/image_picker.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
// class StoreBaseInfoPage extends StatefulWidget {
// StoreBaseInfoPage({Key key}) : super(key: key);
class StoreBaseInfoPage extends StatefulWidget {
StoreBaseInfoPage({Key key}) : super(key: key);
// @override
// _StoreBaseInfoPageState createState() => _StoreBaseInfoPageState();
// }
@override
_StoreBaseInfoPageState createState() => _StoreBaseInfoPageState();
}
// class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> {
// ScrollController _scrollController;
// TextEditingController _nameController = TextEditingController();
// TextEditingController _phoneController = TextEditingController();
// TextEditingController _timeController = TextEditingController();
// TextEditingController _addressController = TextEditingController();
// TextEditingController _introductionController = TextEditingController();
// FocusNode _nameFocusNode = FocusNode();
// FocusNode _phoneFocusNode = FocusNode();
// FocusNode _timeFocusNode = FocusNode();
// FocusNode _addressFocusNode = FocusNode();
// FocusNode _introductionFocusNode = FocusNode();
class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> {
ScrollController _scrollController;
TextEditingController _nameController = TextEditingController();
TextEditingController _phoneController = TextEditingController();
TextEditingController _timeController = TextEditingController();
TextEditingController _addressController = TextEditingController();
TextEditingController _introductionController = TextEditingController();
FocusNode _nameFocusNode = FocusNode();
FocusNode _phoneFocusNode = FocusNode();
FocusNode _timeFocusNode = FocusNode();
FocusNode _addressFocusNode = FocusNode();
FocusNode _introductionFocusNode = FocusNode();
// Map<String, dynamic> mapAddress;
Map<String, dynamic> mapAddress;
// final picker = ImagePicker();
// UploadImageProvider _uploadImageProvider;
// StoreBaseIndoProvider _baseIndoProvider;
final picker = ImagePicker();
UploadImageProvider _uploadImageProvider;
StoreBaseIndoProvider _baseIndoProvider;
// @override
// void initState() {
// super.initState();
// mapAddress = {
// "address": '点击选择',
// 'lat': '',
// 'lng': '',
// };
// _scrollController = ScrollController();
// WidgetsBinding.instance.addPostFrameCallback((_) {
// _uploadImageProvider.mentou.process = 0.01;
// _uploadImageProvider.mentou.qiniuUrl = '';
// _uploadImageProvider.imgSizeMenTou = 64;
// // _uploadImageProvider.mentou.file = null;
// _getQiniuInfo();
// _getStoreBaseinfo();
// });
// }
@override
void initState() {
super.initState();
mapAddress = {
"address": '点击选择',
'lat': '',
'lng': '',
};
_scrollController = ScrollController();
WidgetsBinding.instance.addPostFrameCallback((_) {
_uploadImageProvider.mentou.process = 0.01;
_uploadImageProvider.mentou.qiniuUrl = '';
_uploadImageProvider.imgSizeMenTou = 64;
// _uploadImageProvider.mentou.file = null;
_getQiniuInfo();
_getStoreBaseinfo();
});
}
// ///获取店铺信息
// _getStoreBaseinfo() async {
// GetSellerInfoSunModel itemModel =
// await _baseIndoProvider.getSellerById(context);
// if (itemModel != null) {
// _nameController.text = itemModel.data.sellername;
// _phoneController.text = itemModel.data.sellerTel;
// _timeController.text = itemModel.data.dailyTime;
// _addressController.text = itemModel.data.realAddress;
// _introductionController.text = itemModel.data.sellerdesc;
// _uploadImageProvider.mentou.qiniuUrl = itemModel.data.sellerImage;
// // _uploadImageProvider.notifyListeners();
// mapAddress = {
// "address": itemModel.data.mapAddress,
// 'lat': itemModel.data.lat,
// 'lng': itemModel.data.long,
// };
// setState(() {});
// }
// }
///获取店铺信息
_getStoreBaseinfo() async {
GetSellerInfoSunModel itemModel =
await _baseIndoProvider.getSellerById(context);
if (itemModel != null) {
_nameController.text = itemModel.data.sellername;
_phoneController.text = itemModel.data.sellerTel;
_timeController.text = itemModel.data.dailyTime;
_addressController.text = itemModel.data.realAddress;
_introductionController.text = itemModel.data.sellerdesc;
_uploadImageProvider.mentou.qiniuUrl = itemModel.data.sellerImage;
// _uploadImageProvider.notifyListeners();
mapAddress = {
"address": itemModel.data.mapAddress,
'lat': itemModel.data.lat,
'lng': itemModel.data.long,
};
setState(() {});
}
}
// ///获取七牛云token
// ///
// _getQiniuInfo() async {
// await _uploadImageProvider.getQiniuInfo(context, {});
// }
///获取七牛云token
///
_getQiniuInfo() async {
await _uploadImageProvider.getQiniuInfo(context, {});
}
// /// 修改店铺基本信息
// _setSellerInfoById() async {
// FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
/// 修改店铺基本信息
_setSellerInfoById() async {
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
// User user = Provider.of<UserModel>(context, listen: false).user;
// Map<String, dynamic> params = {
// 'id': user.sellerid,
// };
User user = Provider.of<UserModel>(context, listen: false).user;
Map<String, dynamic> params = {
'id': user.sellerid,
};
// params['name'] = _nameController.text;
params['name'] = _nameController.text;
// if (_uploadImageProvider.mentou.path != null &&
// _uploadImageProvider.mentou.path != '') {
// params['image'] =
// await MultipartFile.fromFile(_uploadImageProvider.mentou.path);
// }
if (_uploadImageProvider.mentou.path != null &&
_uploadImageProvider.mentou.path != '') {
params['image'] =
await MultipartFile.fromFile(_uploadImageProvider.mentou.path);
}
// params['phone'] = _phoneController.text;
params['phone'] = _phoneController.text;
// if (mapAddress != null && mapAddress['address'] != '') {
// params['map_address'] = mapAddress['address'];
// }
// if (mapAddress != null && mapAddress['lng'] != '') {
// params['long'] = mapAddress['lng'];
// }
// if (mapAddress != null && mapAddress['lat'] != '') {
// params['lat'] = mapAddress['lat'];
// }
if (mapAddress != null && mapAddress['address'] != '') {
params['map_address'] = mapAddress['address'];
}
if (mapAddress != null && mapAddress['lng'] != '') {
params['long'] = mapAddress['lng'];
}
if (mapAddress != null && mapAddress['lat'] != '') {
params['lat'] = mapAddress['lat'];
}
// params['real_address'] = _addressController.text;
params['real_address'] = _addressController.text;
// params['sellerdesc'] = _introductionController.text;
params['sellerdesc'] = _introductionController.text;
// params['daily_time'] = _timeController.text;
params['daily_time'] = _timeController.text;
// FormData formData = FormData.fromMap(params);
FormData formData = FormData.fromMap(params);
// SetSellerInfoSunModel sunModel =
// await _baseIndoProvider.setSellerInfoById(context, formData);
// if (sunModel != null) {
// //修改成功
// Utils.showToast('保存成功');
// EventBus().emit('changeStatusColor');
// Navigator.pop(
// context,
// _uploadImageProvider.mentou.qiniuUrl != null &&
// _uploadImageProvider.mentou.qiniuUrl != ''
// ? {'image': _uploadImageProvider.mentou.qiniuUrl}
// : {'image': ''});
// } else {
// // Utils.showToast('保存失败');
// }
// }
SetSellerInfoSunModel sunModel =
await _baseIndoProvider.setSellerInfoById(context, formData);
if (sunModel != null) {
//修改成功
Utils.showToast('保存成功');
EventBus().emit('changeStatusColor');
Navigator.pop(
context,
_uploadImageProvider.mentou.qiniuUrl != null &&
_uploadImageProvider.mentou.qiniuUrl != ''
? {'image': _uploadImageProvider.mentou.qiniuUrl}
: {'image': ''});
} else {
// Utils.showToast('保存失败');
}
}
// ///输入框
// Widget _textfield(String title, String hintText,
// TextEditingController editingController, FocusNode focusNode) {
// return Container(
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Container(
// child: Text(
// title,
// style: TextStyle(
// color: MyColours.color_333333,
// fontWeight: FontWeight.bold,
// fontSize: ScreenUtil().setSp(34)),
// ),
// ),
// HEmptyView(20),
// Spacer(),
// Container(
// width: ScreenUtil().setWidth(231 * 2),
// child: TextField(
// controller: editingController,
// textAlign: TextAlign.right,
// textAlignVertical: TextAlignVertical.bottom,
// maxLines: 1,
// inputFormatters: title == '详细地址'
// ? [
// LengthLimitingTextInputFormatter(20),
// // WhitelistingTextInputFormatter.digitsOnly
// ]
// : [],
///输入框
Widget _textfield(String title, String hintText,
TextEditingController editingController, FocusNode focusNode) {
return Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
child: Text(
title,
style: TextStyle(
color: MyColours.color_333333,
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(34)),
),
),
HEmptyView(20),
Spacer(),
Container(
width: ScreenUtil().setWidth(231 * 2),
child: TextField(
controller: editingController,
textAlign: TextAlign.right,
textAlignVertical: TextAlignVertical.bottom,
maxLines: 1,
inputFormatters: title == '详细地址'
? [
LengthLimitingTextInputFormatter(20),
// WhitelistingTextInputFormatter.digitsOnly
]
: [],
// // //光标颜色
// // cursorColor:
// // widget.isSelect ? Colors.white : MyColours.color_199095,
// //输入文本的样式
// style: TextStyle(
// fontSize: ScreenUtil().setSp(32),
// ),
// focusNode: focusNode,
// decoration: InputDecoration(
// border: OutlineInputBorder(borderSide: BorderSide.none),
// hintText: hintText,
// hintStyle: TextStyle(
// color: MyColours.color_999999,
// fontSize: ScreenUtil().setSp(32),
// ),
// enabledBorder: new UnderlineInputBorder(
// borderSide: BorderSide.none,
// ),
// focusedBorder: new UnderlineInputBorder(
// borderSide: BorderSide.none,
// ),
// ),
// onChanged: (value) {
// // if (editingController == _nameController) {
// // _nameController.text = value;
// // }
// },
// onEditingComplete: () {
// FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
// },
// keyboardType: TextInputType.text,
// ),
// )
// ],
// ),
// );
// }
// //光标颜色
// cursorColor:
// widget.isSelect ? Colors.white : MyColours.color_199095,
//输入文本的样式
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
),
focusNode: focusNode,
decoration: InputDecoration(
border: OutlineInputBorder(borderSide: BorderSide.none),
hintText: hintText,
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(32),
),
enabledBorder: new UnderlineInputBorder(
borderSide: BorderSide.none,
),
focusedBorder: new UnderlineInputBorder(
borderSide: BorderSide.none,
),
),
onChanged: (value) {
// if (editingController == _nameController) {
// _nameController.text = value;
// }
},
onEditingComplete: () {
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
},
keyboardType: TextInputType.text,
),
)
],
),
);
}
// //查看大图
// _showPhotoView(BuildContext context, int index, List imgs,
// {isShow = false, List dashName}) async {
// // if (imgs.length == 1 &&
// // imgs[0] ==
// // 'http://nosqn.colorcun.com/custom/lite-online/image/def-banner.png') {
// // imgs[0] = 'http://nosqn.colorcun.com/app/seller-hj-empty.png';
// // }
// Utils.setBarStatus(false, color: Colors.black);
// dynamic result = await showGeneralDialog(
// context: context,
// barrierDismissible: false,
// // barrierColor: Colors.red,
// barrierLabel:
// MaterialLocalizations.of(context).modalBarrierDismissLabel,
// transitionDuration: const Duration(milliseconds: 150),
// pageBuilder: (BuildContext context, Animation animation,
// Animation secondaryAnimation) {
// Widget child = Stack(
// children: <Widget>[
// PhotoPreview(
// initialIndex: index,
// photoList: imgs,
// isShow: isShow,
// dashName: dashName,
// needMask: false,
// )
// ],
// );
// return child;
// });
// Utils.setBarStatus(true, color: Colors.white);
// }
//查看大图
_showPhotoView(BuildContext context, int index, List imgs,
{isShow = false, List dashName}) async {
// if (imgs.length == 1 &&
// imgs[0] ==
// 'http://nosqn.colorcun.com/custom/lite-online/image/def-banner.png') {
// imgs[0] = 'http://nosqn.colorcun.com/app/seller-hj-empty.png';
// }
Utils.setBarStatus(false, color: Colors.black);
dynamic result = await showGeneralDialog(
context: context,
barrierDismissible: false,
// barrierColor: Colors.red,
barrierLabel:
MaterialLocalizations.of(context).modalBarrierDismissLabel,
transitionDuration: const Duration(milliseconds: 150),
pageBuilder: (BuildContext context, Animation animation,
Animation secondaryAnimation) {
Widget child = Stack(
children: <Widget>[
PhotoPreview(
initialIndex: index,
photoList: imgs,
isShow: isShow,
dashName: dashName,
needMask: false,
)
],
);
return child;
});
Utils.setBarStatus(true, color: Colors.white);
}
// ///#相机拍照,单图选择
// Future _getFromPictureOrCamera(
// String title, UploadImgModel imgModel, imageSource) async {
// final pickedFile = await picker.getImage(source: imageSource);
// setState(() {
// if (pickedFile != null) {
// imgModel.file = File(pickedFile.path);
// imgModel.process = 0.01;
// } else {
// print('No image selected.');
// }
// });
// if (pickedFile != null) {
// _uploadImageProvider.imgSizeMenTou = 64;
// _uploadImageProvider.mentou.qiniuUrl = null;
// _uploadImageProvider.mentou.file = File(pickedFile.path);
// _uploadImageProvider.mentou.path = pickedFile.path;
// UploadImageUtil().startUploadOnly(
// context, File(pickedFile.path), 2, true, _uploadImageProvider);
// }
// }
///#相机拍照,单图选择
Future _getFromPictureOrCamera(
String title, UploadImgModel imgModel, imageSource) async {
final pickedFile = await picker.getImage(source: imageSource);
setState(() {
if (pickedFile != null) {
imgModel.file = File(pickedFile.path);
imgModel.process = 0.01;
} else {
print('No image selected.');
}
});
if (pickedFile != null) {
_uploadImageProvider.imgSizeMenTou = 64;
_uploadImageProvider.mentou.qiniuUrl = null;
_uploadImageProvider.mentou.file = File(pickedFile.path);
_uploadImageProvider.mentou.path = pickedFile.path;
UploadImageUtil().startUploadOnly(
context, File(pickedFile.path), 2, true, _uploadImageProvider);
}
}
// ///图片 头像和二维码
// Widget _imageWidget(
// String title, UploadImgModel model, double imgSize, double radius) {
// return InkWell(
// onTap: () {
// Utils.getPickPermission(context, () {
// _getFromPictureOrCamera(title, model, ImageSource.gallery);
// }, Platform.isAndroid ? Permission.storage : Permission.photos);
// },
// child: Container(
// margin: EdgeInsets.only(
// top: ScreenUtil().setWidth(40),
// left: ScreenUtil().setWidth(40),
// right: ScreenUtil().setWidth(40)),
// height: ScreenUtil().setWidth(imgSize * 2),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Text(
// title,
// textAlign: TextAlign.left,
// style: TextStyle(
// color: MyColours.color_333333,
// fontWeight: FontWeight.bold,
// fontSize: ScreenUtil().setSp(34)),
// ),
// Spacer(),
// Stack(
// children: [
// InkWell(
// onTap: () {
// double process;
// String qiniuUrl;
// List<String> tempList = [];
///图片 头像和二维码
Widget _imageWidget(
String title, UploadImgModel model, double imgSize, double radius) {
return InkWell(
onTap: () {
Utils.getPickPermission(context, () {
_getFromPictureOrCamera(title, model, ImageSource.gallery);
}, Platform.isAndroid ? Permission.storage : Permission.photos);
},
child: Container(
margin: EdgeInsets.only(
top: ScreenUtil().setWidth(40),
left: ScreenUtil().setWidth(40),
right: ScreenUtil().setWidth(40)),
height: ScreenUtil().setWidth(imgSize * 2),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
title,
textAlign: TextAlign.left,
style: TextStyle(
color: MyColours.color_333333,
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(34)),
),
Spacer(),
Stack(
children: [
InkWell(
onTap: () {
double process;
String qiniuUrl;
List<String> tempList = [];
// process = _uploadImageProvider.mentou.process;
// qiniuUrl = _uploadImageProvider.mentou.qiniuUrl;
process = _uploadImageProvider.mentou.process;
qiniuUrl = _uploadImageProvider.mentou.qiniuUrl;
// if (qiniuUrl != null && qiniuUrl != '') {
// tempList.add(qiniuUrl);
if (qiniuUrl != null && qiniuUrl != '') {
tempList.add(qiniuUrl);
// ///没有上传完成的不可以点击
// _showPhotoView(context, 0, tempList);
// } else {
// Utils.getPickPermission(context, () {
// _getFromPictureOrCamera(
// title, model, ImageSource.gallery);
// },
// Platform.isAndroid
// ? Permission.storage
// : Permission.photos);
// }
// },
// 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('no_image'),
// 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),
// ),
// ),
// ),
// (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(),
// ],
// ),
// HEmptyView(30),
// Image.asset(
// "assets/arr_right_gray.png",
// width: ScreenUtil().setWidth(14),
// height: ScreenUtil().setWidth(22),
// )
// ],
// ),
// ));
// }
///没有上传完成的不可以点击
_showPhotoView(context, 0, tempList);
} else {
Utils.getPickPermission(context, () {
_getFromPictureOrCamera(
title, model, ImageSource.gallery);
},
Platform.isAndroid
? Permission.storage
: Permission.photos);
}
},
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('no_image'),
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),
),
),
),
(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(),
],
),
HEmptyView(30),
Image.asset(
"assets/arr_right_gray.png",
width: ScreenUtil().setWidth(14),
height: ScreenUtil().setWidth(22),
)
],
),
));
}
// ///地图地址选择
// Widget _select(String title, String hintText) {
// return InkWell(
// onTap: () {
// Utils.getPickPermission(context, () async {
// mapAddress = await NavigatorUtil.goMapChoicePointPage(context);
// if (mapAddress != null) {
// setState(() {
// // storeMapAddress = address['address'];
// // // createStoreModel.storeInfo?.address = storeAddress;
// // // createStoreModel.storeInfo?.lat = address['lat'];
// // // createStoreModel.storeInfo?.lng = address['lng'];
// });
// }
// }, Permission.location);
// },
// child: Container(
// child: Row(
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Container(
// child: Text(
// title,
// style: TextStyle(
// color: MyColours.color_333333,
// fontWeight: FontWeight.bold,
// fontSize: ScreenUtil().setSp(34)),
// ),
// ),
// HEmptyView(40),
// Expanded(
// child: Text(hintText,
// textAlign: TextAlign.right,
// style: TextStyle(
// color: hintText == '点击选择'
// ? MyColours.color_999999
// : MyColours.color_333333,
// fontSize: ScreenUtil().setSp(32),
// ))),
// HEmptyView(20),
// Image.asset(
// Utils.getImgPath('arr_right_gray'),
// width: ScreenUtil().setWidth(12),
// height: ScreenUtil().setWidth(22),
// )
// ],
// ),
// ),
// );
// }
///地图地址选择
Widget _select(String title, String hintText) {
return InkWell(
onTap: () {
Utils.getPickPermission(context, () async {
mapAddress = await NavigatorUtil.goMapChoicePointPage(context);
if (mapAddress != null) {
setState(() {
// storeMapAddress = address['address'];
// // createStoreModel.storeInfo?.address = storeAddress;
// // createStoreModel.storeInfo?.lat = address['lat'];
// // createStoreModel.storeInfo?.lng = address['lng'];
});
}
}, Permission.location);
},
child: Container(
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
child: Text(
title,
style: TextStyle(
color: MyColours.color_333333,
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(34)),
),
),
HEmptyView(40),
Expanded(
child: Text(hintText,
textAlign: TextAlign.right,
style: TextStyle(
color: hintText == '点击选择'
? MyColours.color_999999
: MyColours.color_333333,
fontSize: ScreenUtil().setSp(32),
))),
HEmptyView(20),
Image.asset(
Utils.getImgPath('arr_right_gray'),
width: ScreenUtil().setWidth(12),
height: ScreenUtil().setWidth(22),
)
],
),
),
);
}
// @override
// Widget build(BuildContext context) {
// _uploadImageProvider =
// Provider.of<UploadImageProvider>(context, listen: true);
// _baseIndoProvider =
// Provider.of<StoreBaseIndoProvider>(context, listen: true);
// return Scaffold(
// backgroundColor: MyColours.color_fefefe,
// appBar: SystemAppBar(
// '店铺信息',
// onTap: () {
// EventBus().emit('changeStatusColor');
// Navigator.of(context).pop();
// },
// ),
// body: WillPopScope(
// onWillPop: () {
// EventBus().emit('changeStatusColor');
// Navigator.of(context).pop();
// },
// child: InkWell(
// onTap: () {
// FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
// },
// child: Column(children: [
// Expanded(
// child: SingleChildScrollView(
// controller: _scrollController,
// physics: BouncingScrollPhysics(),
// child: Column(
// children: [
// Padding(
// padding: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(40),
// ),
// child: _textfield('店铺名称', '请填写店铺名称',
// _nameController, _nameFocusNode)),
// VEmptyView(10),
// _imageWidget('门头照片', _uploadImageProvider.mentou,
// _uploadImageProvider.imgSizeMenTou, 64),
// VEmptyView(30),
// Container(
// height: ScreenUtil().setWidth(2),
// color: MyColours.color_efefef,
// margin: EdgeInsets.only(
// left: ScreenUtil().setWidth(108 * 2),
// right: ScreenUtil().setWidth(40)),
// ),
// VEmptyView(10),
// Padding(
// padding: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(40),
// ),
// child: _textfield('店铺电话', '请填写店铺电话',
// _phoneController, _phoneFocusNode)),
// VEmptyView(10),
// Container(
// height: ScreenUtil().setWidth(2),
// color: MyColours.color_efefef,
// margin: EdgeInsets.only(
// left: ScreenUtil().setWidth(108 * 2),
// right: ScreenUtil().setWidth(40)),
// ),
// VEmptyView(10),
// Padding(
// padding: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(40),
// ),
// child: _textfield(
// '营业时间',
// '请填写营业时间,如09:00-23:00',
// _timeController,
// _timeFocusNode)),
// VEmptyView(10),
// Container(
// height: ScreenUtil().setWidth(2),
// color: MyColours.color_efefef,
// margin: EdgeInsets.only(
// left: ScreenUtil().setWidth(108 * 2),
// right: ScreenUtil().setWidth(40)),
// ),
// VEmptyView(10),
// Padding(
// padding: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(40),
// vertical: ScreenUtil().setWidth(40),
// ),
// child: _select('地图地址', mapAddress['address'])),
// VEmptyView(10),
// Container(
// height: ScreenUtil().setWidth(2),
// color: MyColours.color_efefef,
// margin: EdgeInsets.only(
// left: ScreenUtil().setWidth(108 * 2),
// right: ScreenUtil().setWidth(40)),
// ),
// VEmptyView(10),
// Padding(
// padding: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(40),
// ),
// child: _textfield('详细地址', '请填写店铺详细地址',
// _addressController, _addressFocusNode)),
// VEmptyView(10),
// Container(
// height: ScreenUtil().setWidth(2),
// color: MyColours.color_efefef,
// margin: EdgeInsets.only(
// left: ScreenUtil().setWidth(108 * 2),
// right: ScreenUtil().setWidth(40)),
// ),
// VEmptyView(10),
// Padding(
// padding: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(40),
// ),
// child: _textfield(
// '店铺简介',
// '请填写店铺简介',
// _introductionController,
// _introductionFocusNode)),
// VEmptyView(10),
// ],
// )),
// ),
// VEmptyView(20),
// Padding(
// padding: EdgeInsets.fromLTRB(ScreenUtil().setWidth(40), 0,
// ScreenUtil().setWidth(40), ScreenUtil().setWidth(40)),
// child: RoundButton(
// onPressed: () {
// //接口
// _setSellerInfoById();
// },
// text: '保存',
// fontSize: 34,
// isBold: false,
// height: ScreenUtil().setWidth(80),
// width: double.infinity,
// radius: ScreenUtil().setWidth(10),
// ))
// ]))));
// }
// }
@override
Widget build(BuildContext context) {
_uploadImageProvider =
Provider.of<UploadImageProvider>(context, listen: true);
_baseIndoProvider =
Provider.of<StoreBaseIndoProvider>(context, listen: true);
return Scaffold(
backgroundColor: MyColours.color_fefefe,
appBar: SystemAppBar(
'店铺信息',
onTap: () {
EventBus().emit('changeStatusColor');
Navigator.of(context).pop();
},
),
body: WillPopScope(
onWillPop: () {
EventBus().emit('changeStatusColor');
Navigator.of(context).pop();
},
child: InkWell(
onTap: () {
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
},
child: Column(children: [
Expanded(
child: SingleChildScrollView(
controller: _scrollController,
physics: BouncingScrollPhysics(),
child: Column(
children: [
Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40),
),
child: _textfield('店铺名称', '请填写店铺名称',
_nameController, _nameFocusNode)),
VEmptyView(10),
_imageWidget('门头照片', _uploadImageProvider.mentou,
_uploadImageProvider.imgSizeMenTou, 64),
VEmptyView(30),
Container(
height: ScreenUtil().setWidth(2),
color: MyColours.color_efefef,
margin: EdgeInsets.only(
left: ScreenUtil().setWidth(108 * 2),
right: ScreenUtil().setWidth(40)),
),
VEmptyView(10),
Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40),
),
child: _textfield('店铺电话', '请填写店铺电话',
_phoneController, _phoneFocusNode)),
VEmptyView(10),
Container(
height: ScreenUtil().setWidth(2),
color: MyColours.color_efefef,
margin: EdgeInsets.only(
left: ScreenUtil().setWidth(108 * 2),
right: ScreenUtil().setWidth(40)),
),
VEmptyView(10),
Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40),
),
child: _textfield(
'营业时间',
'请填写营业时间,如09:00-23:00',
_timeController,
_timeFocusNode)),
VEmptyView(10),
Container(
height: ScreenUtil().setWidth(2),
color: MyColours.color_efefef,
margin: EdgeInsets.only(
left: ScreenUtil().setWidth(108 * 2),
right: ScreenUtil().setWidth(40)),
),
VEmptyView(10),
Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40),
vertical: ScreenUtil().setWidth(40),
),
child: _select('地图地址', mapAddress['address'])),
VEmptyView(10),
Container(
height: ScreenUtil().setWidth(2),
color: MyColours.color_efefef,
margin: EdgeInsets.only(
left: ScreenUtil().setWidth(108 * 2),
right: ScreenUtil().setWidth(40)),
),
VEmptyView(10),
Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40),
),
child: _textfield('详细地址', '请填写店铺详细地址',
_addressController, _addressFocusNode)),
VEmptyView(10),
Container(
height: ScreenUtil().setWidth(2),
color: MyColours.color_efefef,
margin: EdgeInsets.only(
left: ScreenUtil().setWidth(108 * 2),
right: ScreenUtil().setWidth(40)),
),
VEmptyView(10),
Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40),
),
child: _textfield(
'店铺简介',
'请填写店铺简介',
_introductionController,
_introductionFocusNode)),
VEmptyView(10),
],
)),
),
VEmptyView(20),
Padding(
padding: EdgeInsets.fromLTRB(ScreenUtil().setWidth(40), 0,
ScreenUtil().setWidth(40), ScreenUtil().setWidth(40)),
child: RoundButton(
onPressed: () {
//接口
_setSellerInfoById();
},
text: '保存',
fontSize: 34,
isBold: false,
height: ScreenUtil().setWidth(80),
width: double.infinity,
radius: ScreenUtil().setWidth(10),
))
]))));
}
}
... ...
... ... @@ -94,6 +94,7 @@ import 'package:one_key/pages/my/room_type/room_type_select_table_page.dart';
import 'package:one_key/pages/my/sms_manager.dart';
import 'package:one_key/pages/my/sms_recharge_page.dart';
import 'package:one_key/pages/my/store_base_info_page.dart';
import 'package:one_key/pages/my/store_base_info_page_old.dart';
import 'package:one_key/pages/my/store_type_fill_manage_page.dart';
import 'package:one_key/pages/my/table_manage/my_areas_manage_page.dart';
import 'package:one_key/pages/my/table_manage/my_table_manage_home_page.dart';
... ...
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart' hide Router;
import 'package:flutter_ex_widget/ex_rich_text2.dart';
import 'package:flutter_ex_widget/ex_text.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/res/colors.dart';
import 'package:flutter_ex_widget/flutter_ex_widget.dart';
class RoundButton extends StatelessWidget {
const RoundButton(
{Key key,
this.width,
this.height = 50,
this.margin,
this.margin = EdgeInsets.zero,
this.radius,
this.bgColor,
this.highlightColor,
... ... @@ -85,6 +88,7 @@ class RoundButton extends StatelessWidget {
new Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
!ObjectUtil.isEmptyString(image)
? Padding(
... ... @@ -97,17 +101,18 @@ class RoundButton extends StatelessWidget {
)
: Text(''),
Expanded(
child: Text(
child: Container(
padding: EdgeInsets.only(top: ScreenUtil().setWidth(2)),
child: ExText(
text,
textAlign: TextAlign.center,
overflow: TextOverflow.ellipsis,
style: style ??
style ??
new TextStyle(
color: textColor,
fontSize: ScreenUtil().setSp(fontSize),
fontWeight:
isBold ? FontWeight.bold : FontWeight.normal),
))
overflow: TextOverflow.ellipsis,
)))
],
),
),
... ...
... ... @@ -398,6 +398,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.2.1"
flutter_ex_widget:
dependency: "direct main"
description:
name: flutter_ex_widget
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.0.7"
flutter_inappwebview:
dependency: "direct main"
description:
... ...
... ... @@ -158,6 +158,8 @@ dependencies:
azlistview: ^1.1.1
# sendsms: ^1.0.3
flutter_ex_widget: ^0.0.7
... ...