Commit 394a2be222f49d699c1532fc723973bc3a042582

Authored by wdn127929
1 parent 58718afe

正在上传图片的时候,不能调用接口

... ... @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 50;
objects = {
/* Begin PBXBuildFile section */
... ... @@ -548,7 +548,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 542;
CURRENT_PROJECT_VERSION = 5430;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
FLUTTER_BUILD_MODE = release;
... ... @@ -699,10 +699,10 @@
CODE_SIGN_ENTITLEMENTS = "Runner/一键订Debug.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 542;
CURRENT_PROJECT_VERSION = 5430;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
FLUTTER_BUILD_MODE = release;
FLUTTER_BUILD_MODE = debug;
FLUTTER_ROOT = /Users/naji2021/Documents/flutter;
FLUTTER_TARGET = "/Users/naji2021/Desktop/Flutter-ReserveApp/lib/main.dart";
FRAMEWORK_SEARCH_PATHS = (
... ... @@ -741,7 +741,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 542;
CURRENT_PROJECT_VERSION = 5430;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
FLUTTER_BUILD_MODE = release;
... ...
... ... @@ -298,6 +298,84 @@ class _CollectStoreInfoPageState extends State<CollectStoreInfoPage> {
));
}
Widget _errorWidget() {
return Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
VEmptyView(384),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
Utils.getImgPath('error_circle'),
width: w(70),
),
HEmptyView(20),
Text(
'出错了!',
style: TextStyle(
color: MyColours.color_E34D59, fontSize: font(20)),
)
],
),
VEmptyView(100),
Padding(
padding: EdgeInsets.symmetric(horizontal: w(20)),
child: Text(
'您输入的店铺名字:\nxxx和商家\nxxx\n高度重合,如果您是这家店铺的工作人员,请与店铺管理员(xxx)联系增员,谢谢!',
style: TextStyle(
color: MyColours.color_515151, fontSize: font(16)),
))
],
),
)),
Container(
margin: EdgeInsets.only(
left: w(23), top: w(10), right: w(21), bottom: w(25)),
child: Row(
children: [
RoundButton(
text: '不是店员,继续注册',
isBold: true,
width: w(218),
height: w(43),
fontSize: 32,
textColor: MyColours.color_438E93,
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: MyColours.color_438E93,
radius: 10,
onPressed: () {
//再一次提交原来的数据,标识是第二次提交
},
),
HEmptyView(28),
Expanded(
child: RoundButton(
text: '朕知道了',
isBold: true,
height: w(43),
fontSize: 32,
radius: 10,
textColor: MyColours.color_ffffff,
gradientStart: MyColours.color_438E93,
gradientEnd: MyColours.color_438E93,
borderColor: MyColours.color_438E93,
onPressed: () {
//
Navigator.pop(context);
},
))
],
),
)
],
);
}
@override
Widget build(BuildContext context) {
collectStoreProvider =
... ... @@ -307,287 +385,292 @@ class _CollectStoreInfoPageState extends State<CollectStoreInfoPage> {
child: Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar('店铺信息'),
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
VEmptyView(50),
Container(
padding: EdgeInsets.symmetric(
horizontal: w(20), vertical: w(15)),
child: Text('在开始之前,请告诉我们关于您的一些信息,以方便专属客服给您提供周到的服务。',
style: TextStyle(
height: 1.5,
fontSize: font(16),
color: MyColours.color_000000))),
VEmptyView(40),
_textFeildWidget(nameC, '店铺名称:', '点击输入店铺名称'),
_divider(),
VEmptyView(20),
_addressWidget('店铺地址:', storeAddress, () {
//
FocusScope.of(context)
.requestFocus(FocusNode()); //点击空白处隐藏键盘
Utils.getPickPermission(context, () async {
var address =
await NavigatorUtil.goMapChoicePointPage(context);
if (address != null && address is Map) {
setState(() {
storeAddress = address['address'];
body: true
? _errorWidget()
: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
VEmptyView(50),
Container(
padding: EdgeInsets.symmetric(
horizontal: w(20), vertical: w(15)),
child: Text(
'在开始之前,请告诉我们关于您的一些信息,以方便专属客服给您提供周到的服务。',
style: TextStyle(
height: 1.5,
fontSize: font(16),
color: MyColours.color_000000))),
VEmptyView(40),
_textFeildWidget(nameC, '店铺名称:', '点击输入店铺名称'),
_divider(),
VEmptyView(20),
_addressWidget('店铺地址:', storeAddress, () {
//
FocusScope.of(context)
.requestFocus(FocusNode()); //点击空白处隐藏键盘
Utils.getPickPermission(context, () async {
var address =
await NavigatorUtil.goMapChoicePointPage(
context);
if (address != null && address is Map) {
setState(() {
storeAddress = address['address'];
lat = double.parse(address['lat'].toString());
lng = double.parse(address['lng'].toString());
});
}
}, Permission.location);
}),
_divider(),
VEmptyView(20),
_addressWidget('城市选择:', cityString, () async {
FocusScope.of(context)
.requestFocus(FocusNode()); //点击空白处隐藏键盘
Result result = await CityPickers.showCityPicker(
context: context,
borderRadius: r(8),
cancelWidget: Container(
padding: EdgeInsets.symmetric(
horizontal: w(20), vertical: w(20)),
child: Text(
'取消',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(32)),
),
),
confirmWidget: Container(
padding: EdgeInsets.symmetric(
horizontal: w(20), vertical: w(20)),
child: Text(
'确定',
style: TextStyle(
color: MyColours.color_438E93,
fontSize: ScreenUtil().setSp(32)),
),
),
theme: ThemeData(
textTheme: TextTheme(
bodyText1: TextStyle(
fontSize: font(11),
// fontWeight: FontWeight.w200,
),
)));
print(result);
if (result != null) {
proCode = result.provinceId;
cityCode = result.cityId;
disCode = result.areaId;
cityString = result.provinceName +
result.cityName +
result.areaName;
setState(() {});
}
}),
_divider(),
VEmptyView(20),
_textFeildWidget(personC, '联系人:', '点击输入您的姓名'),
_divider(),
VEmptyView(20),
_textFeildWidget(phoneC, '联系电话:', '点击输入您的电话号码'),
_divider(),
VEmptyView(20),
lat = double.parse(address['lat'].toString());
lng = double.parse(address['lng'].toString());
});
}
}, Permission.location);
}),
_divider(),
VEmptyView(20),
_addressWidget('城市选择:', cityString, () async {
FocusScope.of(context)
.requestFocus(FocusNode()); //点击空白处隐藏键盘
Result result = await CityPickers.showCityPicker(
context: context,
borderRadius: r(8),
cancelWidget: Container(
padding: EdgeInsets.symmetric(
horizontal: w(20), vertical: w(20)),
child: Text(
'取消',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(32)),
),
),
confirmWidget: Container(
padding: EdgeInsets.symmetric(
horizontal: w(20), vertical: w(20)),
child: Text(
'确定',
style: TextStyle(
color: MyColours.color_438E93,
fontSize: ScreenUtil().setSp(32)),
),
),
theme: ThemeData(
textTheme: TextTheme(
bodyText1: TextStyle(
fontSize: font(11),
// fontWeight: FontWeight.w200,
),
)));
print(result);
if (result != null) {
proCode = result.provinceId;
cityCode = result.cityId;
disCode = result.areaId;
cityString = result.provinceName +
result.cityName +
result.areaName;
setState(() {});
}
}),
_divider(),
VEmptyView(20),
_textFeildWidget(personC, '联系人:', '点击输入您的姓名'),
_divider(),
VEmptyView(20),
_textFeildWidget(phoneC, '联系电话:', '点击输入您的电话号码'),
_divider(),
VEmptyView(20),
_textFeildWidgetBtn(codeC, '验证码:', '点击输入验证码'),
_divider(),
VEmptyView(20),
// Container(
// height: ScreenUtil().setHeight(52 * 2),
// // width: ScreenUtil().setWidth(611),
// padding:
// EdgeInsets.only(left: ScreenUtil().setWidth(20)),
// margin: EdgeInsets.only(top: ScreenUtil().setHeight(8)),
// alignment: Alignment.center,
// decoration: BoxDecoration(
// border: Border.all(
// color: MyColours.color_bff6f7,
// width: ScreenUtil().setWidth(2)),
// borderRadius: BorderRadius.circular(
// ScreenUtil().setWidth(10))),
// child: Row(
// crossAxisAlignment: CrossAxisAlignment.center,
// children: <Widget>[
// HEmptyView(30),
// Text(
// "验证码",
// style: TextStyle(
// color: MyColours.color_333333,
// fontSize: ScreenUtil().setSp(26)),
// ),
// HEmptyView(30),
// Expanded(
// child: TextField(
// focusNode: _codeNode,
// style: TextStyle(
// color: MyColours.color_353535,
// fontSize: ScreenUtil().setSp(28)),
// decoration: InputDecoration(
// hintText: "请输入验证码",
// hintStyle: TextStyle(
// color: MyColours.color_999999,
// fontSize: ScreenUtil().setSp(26)),
// contentPadding: EdgeInsets.zero,
// border: OutlineInputBorder(
// borderSide: BorderSide.none),
// // contentPadding: EdgeInsets.fromLTRB(
// // 0,
// // ScreenUtil().setWidth(28),
// // ScreenUtil().setWidth(30),
// // ScreenUtil().setWidth(28)),
// ),
// onChanged: (value) {
// code = value;
// },
// onEditingComplete: () {
// FocusScope.of(context)
// .requestFocus(FocusNode()); //点击空白处隐藏键盘
// },
// keyboardType: TextInputType.numberWithOptions(
// decimal: true),
// ),
// ),
_textFeildWidgetBtn(codeC, '验证码:', '点击输入验证码'),
_divider(),
VEmptyView(20),
// Container(
// height: ScreenUtil().setHeight(52 * 2),
// // width: ScreenUtil().setWidth(611),
// padding:
// EdgeInsets.only(left: ScreenUtil().setWidth(20)),
// margin: EdgeInsets.only(top: ScreenUtil().setHeight(8)),
// alignment: Alignment.center,
// decoration: BoxDecoration(
// border: Border.all(
// color: MyColours.color_bff6f7,
// width: ScreenUtil().setWidth(2)),
// borderRadius: BorderRadius.circular(
// ScreenUtil().setWidth(10))),
// child: Row(
// crossAxisAlignment: CrossAxisAlignment.center,
// children: <Widget>[
// HEmptyView(30),
// Text(
// "验证码",
// style: TextStyle(
// color: MyColours.color_333333,
// fontSize: ScreenUtil().setSp(26)),
// ),
// HEmptyView(30),
// Expanded(
// child: TextField(
// focusNode: _codeNode,
// style: TextStyle(
// color: MyColours.color_353535,
// fontSize: ScreenUtil().setSp(28)),
// decoration: InputDecoration(
// hintText: "请输入验证码",
// hintStyle: TextStyle(
// color: MyColours.color_999999,
// fontSize: ScreenUtil().setSp(26)),
// contentPadding: EdgeInsets.zero,
// border: OutlineInputBorder(
// borderSide: BorderSide.none),
// // contentPadding: EdgeInsets.fromLTRB(
// // 0,
// // ScreenUtil().setWidth(28),
// // ScreenUtil().setWidth(30),
// // ScreenUtil().setWidth(28)),
// ),
// onChanged: (value) {
// code = value;
// },
// onEditingComplete: () {
// FocusScope.of(context)
// .requestFocus(FocusNode()); //点击空白处隐藏键盘
// },
// keyboardType: TextInputType.numberWithOptions(
// decimal: true),
// ),
// ),
// ],
// )),
],
))),
Container(
height: ScreenUtil().setWidth(191 * 2),
width: double.infinity,
padding: EdgeInsets.only(
top: ScreenUtil().setWidth(16 * 2),
bottom: ScreenUtil().setWidth(35 * 2),
// left: ScreenUtil().setWidth(45 * 2),
// right: ScreenUtil().setWidth(45 * 2),
),
decoration: BoxDecoration(
color: MyColours.color_ffffff,
// boxShadow: [
// BoxShadow(
// spreadRadius: ScreenUtil().setWidth(2),
// color: Color.fromRGBO(0, 0, 0, 0.1),
// offset: Offset(0, ScreenUtil().setWidth(-2)),
// blurRadius: ScreenUtil().setWidth(8))
// ],
// borderRadius: BorderRadius.all(
// Radius.circular(ScreenUtil().setWidth(16)),
// ),
),
child: Column(
children: [
Container(
padding: EdgeInsets.symmetric(
horizontal: w(20), vertical: w(15)),
child: Text(
'注:如果您的店铺已经在使用周到安排为客户预订包间,请联系管理员给您创建使用账号。',
style: TextStyle(
height: 1.5,
fontSize: font(14),
color: MyColours.color_000000))),
VEmptyView(24),
RoundButton(
text: '提交',
height: ScreenUtil().setWidth(80),
radius: ScreenUtil().setWidth(10),
isBold: true,
margin: EdgeInsets.only(
left: ScreenUtil().setWidth(45 * 2),
right: ScreenUtil().setWidth(45 * 2),
// ],
// )),
],
))),
Container(
height: ScreenUtil().setWidth(191 * 2),
width: double.infinity,
padding: EdgeInsets.only(
top: ScreenUtil().setWidth(16 * 2),
bottom: ScreenUtil().setWidth(35 * 2),
// left: ScreenUtil().setWidth(45 * 2),
// right: ScreenUtil().setWidth(45 * 2),
),
fontSize: 32,
textColor: MyColours.color_F8F9FD,
onPressed: () async {
//判空
if (nameC.text.trim().length == 0) {
Utils.showToast('请输入店铺名称');
return;
}
// if (storeAddress == '点击设置您的地址') {
// Utils.showToast('请设置您的地址');
// return;
// }
if (cityString == '点击设置您的城市') {
Utils.showToast('请设置您的城市');
return;
}
if (personC.text.trim().length == 0) {
Utils.showToast('请输入联系人');
return;
}
decoration: BoxDecoration(
color: MyColours.color_ffffff,
// boxShadow: [
// BoxShadow(
// spreadRadius: ScreenUtil().setWidth(2),
// color: Color.fromRGBO(0, 0, 0, 0.1),
// offset: Offset(0, ScreenUtil().setWidth(-2)),
// blurRadius: ScreenUtil().setWidth(8))
// ],
// borderRadius: BorderRadius.all(
// Radius.circular(ScreenUtil().setWidth(16)),
// ),
),
child: Column(
children: [
Container(
padding: EdgeInsets.symmetric(
horizontal: w(20), vertical: w(15)),
child: Text(
'注:如果您的店铺已经在使用周到安排为客户预订包间,请联系管理员给您创建使用账号。',
style: TextStyle(
height: 1.5,
fontSize: font(14),
color: MyColours.color_000000))),
VEmptyView(24),
RoundButton(
text: '提交',
height: ScreenUtil().setWidth(80),
radius: ScreenUtil().setWidth(10),
isBold: true,
margin: EdgeInsets.only(
left: ScreenUtil().setWidth(45 * 2),
right: ScreenUtil().setWidth(45 * 2),
),
fontSize: 32,
textColor: MyColours.color_F8F9FD,
onPressed: () async {
//判空
if (nameC.text.trim().length == 0) {
Utils.showToast('请输入店铺名称');
return;
}
// if (storeAddress == '点击设置您的地址') {
// Utils.showToast('请设置您的地址');
// return;
// }
if (cityString == '点击设置您的城市') {
Utils.showToast('请设置您的城市');
return;
}
if (personC.text.trim().length == 0) {
Utils.showToast('请输入联系人');
return;
}
if (phoneC.text.trim().length == 0) {
Utils.showToast('请输入联系电话');
return;
}
if (phoneC.text.trim() != '18601216909') {
if (code == null || code.trim().length == 0) {
Utils.showToast('请输入验证码');
return;
}
if (otherLoginProvider.code != null &&
!codeEnabled) {
Utils.showToast('验证码已失效,请重新获取');
return;
}
if (otherLoginProvider.code == null) {
Utils.showToast('请获取验证码');
return;
}
if (otherLoginProvider.code != code) {
Utils.showToast('您输入的验证码不正确,请重新输入');
return;
}
}
if (phoneC.text.trim().length == 0) {
Utils.showToast('请输入联系电话');
return;
}
if (phoneC.text.trim() != '18601216909') {
if (code == null ||
code.trim().length == 0) {
Utils.showToast('请输入验证码');
return;
}
if (otherLoginProvider.code != null &&
!codeEnabled) {
Utils.showToast('验证码已失效,请重新获取');
return;
}
if (otherLoginProvider.code == null) {
Utils.showToast('请获取验证码');
return;
}
if (otherLoginProvider.code != code) {
Utils.showToast('您输入的验证码不正确,请重新输入');
return;
}
}
FocusScope.of(context)
.requestFocus(FocusNode()); //点击空白处隐藏键盘
Map<String, String> params = {
'sellername': nameC.text,
'phone': phoneC.text,
'rname': personC.text,
'pro_code': proCode,
'city_code': cityCode,
'dis_code': disCode,
};
if (storeAddress != '点击设置您的地址') {
//填写了地址
params['map_address'] = storeAddress;
params['lat'] = lat.toString();
params['long'] = lng.toString();
}
bool success = await collectStoreProvider
.setSellerCollect(context, params);
if (success) {
if (phoneC.text.trim() != '18601216909') {
await collectStoreProvider
.sendIntention(context, {
"shopname": nameC.text,
"shopnumber": phoneC.text,
"name": personC.text,
"address": storeAddress,
"laiyuan": 'app'
});
}
FocusScope.of(context)
.requestFocus(FocusNode()); //点击空白处隐藏键盘
Map<String, String> params = {
'sellername': nameC.text,
'phone': phoneC.text,
'rname': personC.text,
'pro_code': proCode,
'city_code': cityCode,
'dis_code': disCode,
};
if (storeAddress != '点击设置您的地址') {
//填写了地址
params['map_address'] = storeAddress;
params['lat'] = lat.toString();
params['long'] = lng.toString();
}
bool success = await collectStoreProvider
.setSellerCollect(context, params);
if (success) {
if (phoneC.text.trim() != '18601216909') {
await collectStoreProvider
.sendIntention(context, {
"shopname": nameC.text,
"shopnumber": phoneC.text,
"name": personC.text,
"address": storeAddress,
"laiyuan": 'app'
});
}
//成功
NavigatorUtil.goCompleteStorePage(context,
replace: true);
}
},
),
],
))
],
)));
//成功
NavigatorUtil.goCompleteStorePage(context,
replace: true);
}
},
),
],
))
],
)));
}
}
... ...
... ... @@ -722,6 +722,11 @@ class _BaseInfoPageState extends State<BaseInfoPage> {
ScreenUtil().setWidth(56)),
child: RoundButton(
onPressed: () {
if (_uploadImageProvider.touxiang.process < 1 &&
_uploadImageProvider.touxiang.process > 0) {
Utils.showToast('正在上传图片,请稍等!');
return;
}
if (_phoneController.text.trim().length == 0 ||
_nameController.text.trim().length == 0) {
Utils.showToast('请至少填写您的姓名和电话');
... ...
... ... @@ -180,6 +180,12 @@ class _MenuAddDishesPageState extends State<MenuAddDishesPage> {
///添加菜品
_addCookbook({bool showLoading = true}) async {
bool canDelete = false;
if (uploadImageProvider.dish.process < 1 &&
uploadImageProvider.dish.process > 0) {
Utils.showToast('正在上传菜品图片,请稍等!');
return false;
}
if (_nameController.text.trim().length == 0) {
Utils.showToast('请输入菜品名称');
return;
... ... @@ -228,6 +234,7 @@ class _MenuAddDishesPageState extends State<MenuAddDishesPage> {
}
if (uploadImageProvider.dish.qiniuUrl != null &&
uploadImageProvider.dish.qiniuUrl != '') {
canDelete = true;
params['image'] = uploadImageProvider.dish.qiniuUrl;
}
if (selectPracticeShow != null && selectPracticeShow != '') {
... ... @@ -261,7 +268,7 @@ class _MenuAddDishesPageState extends State<MenuAddDishesPage> {
if (sucess) {
if (uploadImageProvider.dish.qiniuUrl != null &&
uploadImageProvider.dish.qiniuUrl != '') {
uploadImageProvider.dish.qiniuUrl != '' && canDelete) {
// imgAll和images 比较,挑出不一样的,删除七牛云
Set<String> difference = Set.from(imgAll)
..removeAll([uploadImageProvider.dish.qiniuUrl]);
... ...
... ... @@ -2,6 +2,7 @@ import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/models/upload_img_model.dart';
import 'package:one_key/pages/online_check/img_picker_widget.dart';
import 'package:one_key/pages/online_check/img_picker_widget_f.dart';
import 'package:one_key/provider/message_dialog_model.dart';
... ... @@ -843,23 +844,37 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> {
onPress: () async {
if (btnState == 1) {
_focusNode.unfocus();
if (_editingController.text
.startsWith('¥') &&
_editingController.text.length == 1) {
Utils.showToast('请输入金额');
setState(() {
btnState = -1;
});
return;
bool can = true;
innerloop:
for (UploadImgModel item
in _uploadImageProvider.imageList) {
if (item.process > 0 &&
item.process < 1) {
Utils.showToast('正在上传,请稍等');
// return false;
can = false;
break innerloop;
}
}
DialogUtil.confirmDialog(
context, _editingController.text, 438,
onTap: () {
if (Navigator.canPop(context)) {
Navigator.pop(context);
if (can) {
if (_editingController.text
.startsWith('¥') &&
_editingController.text.length == 1) {
Utils.showToast('请输入金额');
setState(() {
btnState = -1;
});
return;
}
_updateOrderInfo();
});
DialogUtil.confirmDialog(
context, _editingController.text, 438,
onTap: () {
if (Navigator.canPop(context)) {
Navigator.pop(context);
}
_updateOrderInfo();
});
}
}
},
))
... ...
... ... @@ -724,6 +724,11 @@ class _BaseInfoPageSimState extends State<BaseInfoPageSim> {
ScreenUtil().setWidth(56)),
child: RoundButton(
onPressed: () {
if (_uploadImageProvider.touxiang.process < 1 &&
_uploadImageProvider.touxiang.process > 0) {
Utils.showToast('正在上传图片,请稍等!');
return;
}
if (_phoneController.text.trim().length == 0 ||
_nameController.text.trim().length == 0) {
Utils.showToast('请至少填写您的姓名和电话');
... ...