|
|
|
import 'dart:io';
|
|
|
|
|
|
|
|
import 'package:cached_network_image/cached_network_image.dart';
|
|
|
|
import 'package:city_pickers/city_pickers.dart';
|
|
|
|
import 'package:city_pickers/modal/result.dart';
|
|
|
|
import 'package:common_utils/common_utils.dart';
|
|
|
|
import 'package:dio/dio.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_native_image/flutter_native_image.dart';
|
|
|
|
import 'package:flutter_picker_plus/picker.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
import 'package:image_picker/image_picker.dart';
|
|
|
|
import 'package:one_key/pages/online_check/photo_view_wiget.dart';
|
|
|
|
import 'package:one_key/provider/user_model.dart';
|
|
|
|
import 'package:one_key/widgets/MyDivider.dart';
|
|
|
|
import 'package:one_key/widgets/system_app_bar.dart';
|
|
|
|
import 'package:permission_handler/permission_handler.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
import '../../../models/get_reserve_type_field_model.dart';
|
|
...
|
...
|
@@ -25,6 +36,13 @@ import '../marketing_center/book_notification/img_picker_invitation_widget.dart' |
|
|
|
* 企业资料上传
|
|
|
|
*/
|
|
|
|
|
|
|
|
enum UpaloadSource {
|
|
|
|
/// Opens up the device camera, letting the user to take a new picture.
|
|
|
|
frontid,
|
|
|
|
backid,
|
|
|
|
business,
|
|
|
|
}
|
|
|
|
|
|
|
|
class EnterpriseInformationUploadPage extends StatefulWidget {
|
|
|
|
const EnterpriseInformationUploadPage({super.key});
|
|
|
|
|
|
...
|
...
|
@@ -35,8 +53,8 @@ class EnterpriseInformationUploadPage extends StatefulWidget { |
|
|
|
|
|
|
|
class _EnterpriseInformationUploadPageState
|
|
|
|
extends State<EnterpriseInformationUploadPage> {
|
|
|
|
String stime = '点击选择营业执照开始日期';
|
|
|
|
String etime = '点击选择营业执照结束日期';
|
|
|
|
String stime = '点击选择';
|
|
|
|
String etime = '点击选择';
|
|
|
|
ScrollController _controller = ScrollController();
|
|
|
|
late UploadImageProvider _uploadImageProvider;
|
|
|
|
late FinanceProvider financeProvider;
|
|
...
|
...
|
@@ -80,7 +98,15 @@ class _EnterpriseInformationUploadPageState |
|
|
|
FocusNode servicePhoneFoc = FocusNode();
|
|
|
|
|
|
|
|
List<GetReserveTypeFieldsSunModel> bankData = [];
|
|
|
|
String bankType='点击选择开户银行';
|
|
|
|
String bankType = '点击选择开户银行';
|
|
|
|
String cityString = '请选择';
|
|
|
|
|
|
|
|
String cityStringData = '请选择';
|
|
|
|
bool isCard = true;
|
|
|
|
|
|
|
|
String? idPersonPath;
|
|
|
|
String? idPersonUnPath;
|
|
|
|
String? businessCard;
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
...
|
...
|
@@ -127,6 +153,130 @@ class _EnterpriseInformationUploadPageState |
|
|
|
}).toList();
|
|
|
|
}
|
|
|
|
|
|
|
|
_upLoadApplyments() async {
|
|
|
|
if (registrNoC.text.trim().length == 0) {
|
|
|
|
Utils.showToast('请输入注册号!');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (registrNameC.text.trim().length == 0) {
|
|
|
|
Utils.showToast('请输入注册名称!');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (legalNameC.text.trim().length == 0) {
|
|
|
|
Utils.showToast('请输入经营者/法人姓名!');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (registrAddressC.text.trim().length == 0) {
|
|
|
|
Utils.showToast('请输入注册地址!');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (businessCard == null || businessCard == '') {
|
|
|
|
Utils.showToast('请上传营业执照照片!');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (idNumC.text.trim().length == 0) {
|
|
|
|
Utils.showToast('请输入法人身份证号码!');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (stime == '点击选择') {
|
|
|
|
Utils.showToast('请选择身份证有效期的开始时间!');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (etime == '点击选择' && !isCard) {
|
|
|
|
Utils.showToast('请选择身份证有效期的结束时间!');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (legalPhoneC.text.trim().length == 0) {
|
|
|
|
Utils.showToast('请输入法人电话号码!');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!Utils.is11PhoneS(legalPhoneC.text.trim())) {
|
|
|
|
Utils.showToast('请输入正确的11位电话号码!');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (emailC.text.trim().length == 0) {
|
|
|
|
Utils.showToast('请输入邮箱!');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (idPersonPath == null || idPersonPath == '') {
|
|
|
|
Utils.showToast('请上传法人身份证人像页!');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (idPersonUnPath == null || idPersonUnPath == '') {
|
|
|
|
Utils.showToast('法人身份证国徽页!');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
int index = bankData.indexWhere((e) => e.select!);
|
|
|
|
String bankname = '';
|
|
|
|
if (index > 0) {
|
|
|
|
bankname = bankData[index].name!;
|
|
|
|
} else {
|
|
|
|
Utils.showToast('请选择开户银行!');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (bankname == '其他银行' && bankAllNameC.text.trim().length == 0) {
|
|
|
|
//需要输入网点全名称
|
|
|
|
Utils.showToast('请输入开户银行网点全称!');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (cityString == '请选择') {
|
|
|
|
Utils.showToast('请输入开户银行所在省市区!');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (bankNumC.text.trim().length == 0) {
|
|
|
|
Utils.showToast('请输入银行账户!');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (bankNumC.text.trim().length == 0) {
|
|
|
|
Utils.showToast('请输入银行账户!');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
Map<String, dynamic> params = {
|
|
|
|
'sellerid':
|
|
|
|
Provider.of<UserModel>(context, listen: false).user!.sellerid!,
|
|
|
|
'id_card_copy': await MultipartFile.fromFile(idPersonPath!),
|
|
|
|
'id_card_national': await MultipartFile.fromFile(idPersonUnPath!),
|
|
|
|
'business_license_copy': await MultipartFile.fromFile(businessCard!),
|
|
|
|
};
|
|
|
|
FormData formData = FormData.fromMap(params);
|
|
|
|
bool suceess = await financeProvider.upLoadApplyments(context, formData);
|
|
|
|
if (suceess) {
|
|
|
|
_submitData(bankname);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
_submitData(String bankname) async {
|
|
|
|
//接口提交
|
|
|
|
Map<String, String> pramas = {
|
|
|
|
'sellerid':
|
|
|
|
Provider.of<UserModel>(context, listen: false).user!.sellerid!,
|
|
|
|
'account_type': accountType ? '3' : '2',
|
|
|
|
'id_card_name': legalNameC.text,
|
|
|
|
'id_card_number': idNumC.text,
|
|
|
|
'account_number': bankNumC.text,
|
|
|
|
'mobile_phone': legalPhoneC.text,
|
|
|
|
'contact_email': emailC.text,
|
|
|
|
'id_card_valid_time_begin': stime,
|
|
|
|
'id_card_valid_time': isCard ? '长期' : etime,
|
|
|
|
'bank_address_code': cityStringData,
|
|
|
|
'business_license_number': registrNoC.text,
|
|
|
|
'merchant_name': registrNameC.text,
|
|
|
|
'legal_person': legalNameC.text,
|
|
|
|
'company_address': registrAddressC.text
|
|
|
|
};
|
|
|
|
if (bankname == '其他银行') {
|
|
|
|
pramas['bank_name'] = bankAllNameC.text;
|
|
|
|
} else {
|
|
|
|
pramas['account_bank'] = bankname;
|
|
|
|
}
|
|
|
|
|
|
|
|
await financeProvider.setApplyments(context, pramas);
|
|
|
|
}
|
|
|
|
|
|
|
|
Widget _title(String title) {
|
|
|
|
return Padding(
|
|
|
|
padding: EdgeInsets.only(left: w(16), top: w(10), bottom: w(10)),
|
|
...
|
...
|
@@ -198,6 +348,16 @@ class _EnterpriseInformationUploadPageState |
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
///弹框text
|
|
|
|
_textWidget(String title, Color textColor, FontWeight fontWeight, int size) {
|
|
|
|
return Text(title,
|
|
|
|
style: TextStyle(
|
|
|
|
color: textColor,
|
|
|
|
decoration: TextDecoration.none,
|
|
|
|
fontWeight: fontWeight,
|
|
|
|
fontSize: ScreenUtil().setSp(size)));
|
|
|
|
}
|
|
|
|
|
|
|
|
///是否立即启用
|
|
|
|
Widget _canUse(
|
|
|
|
String title,
|
|
...
|
...
|
@@ -269,8 +429,8 @@ class _EnterpriseInformationUploadPageState |
|
|
|
Spacer(),
|
|
|
|
Text(hintText,
|
|
|
|
style: TextStyle(
|
|
|
|
color: hintText == '点击选择营业执照开始日期' ||
|
|
|
|
hintText == '点击选择营业执照结束日期' ||
|
|
|
|
color: hintText == '点击选择' ||
|
|
|
|
hintText == '点击选择' ||
|
|
|
|
hintText == '点击选择开户银行'
|
|
|
|
? MyColours.color_999999
|
|
|
|
: MyColours.color_515151,
|
|
...
|
...
|
@@ -287,6 +447,344 @@ class _EnterpriseInformationUploadPageState |
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
_addressWidget(String name, String subtitle, GestureTapCallback onTap) {
|
|
|
|
return InkWell(
|
|
|
|
onTap: onTap,
|
|
|
|
child: Container(
|
|
|
|
margin: EdgeInsets.only(left: w(40)),
|
|
|
|
padding: EdgeInsets.only(top: w(10), bottom: w(10), right: w(16)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border(
|
|
|
|
bottom: BorderSide(
|
|
|
|
color: MyColours.color_E7E7E7, width: w(0.5)))),
|
|
|
|
// height: w(48),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Row(
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
_textWidget(
|
|
|
|
name, MyColours.color_515151, FontWeight.normal, 28),
|
|
|
|
Expanded(
|
|
|
|
child: Text(
|
|
|
|
subtitle,
|
|
|
|
textAlign: TextAlign.right,
|
|
|
|
style: TextStyle(
|
|
|
|
color: subtitle == '请选择'
|
|
|
|
? MyColours.color_999999
|
|
|
|
: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(24),
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
HEmptyView(20),
|
|
|
|
Image.asset(
|
|
|
|
"assets/arrow_right_new.png",
|
|
|
|
width: w(7),
|
|
|
|
// height: ScreenUtil().setWidth(22),
|
|
|
|
)
|
|
|
|
])));
|
|
|
|
}
|
|
|
|
|
|
|
|
///添加图片UI弹出
|
|
|
|
Future _openModalBottomSheet(context, UpaloadSource source) async {
|
|
|
|
final option = await showModalBottomSheet(
|
|
|
|
context: context,
|
|
|
|
backgroundColor: Colors.transparent,
|
|
|
|
isDismissible: false,
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
return Container(
|
|
|
|
// height: ScreenUtil().setWidth(180 * 2),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
topLeft: Radius.circular(ScreenUtil().setWidth(24)),
|
|
|
|
topRight: Radius.circular(ScreenUtil().setWidth(24)))),
|
|
|
|
child: Column(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: <Widget>[
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
Utils.getPickPermission(context, () {
|
|
|
|
_getFromPictureOrCamera(ImageSource.camera, source);
|
|
|
|
if (Navigator.canPop(context)) {
|
|
|
|
Navigator.pop(context);
|
|
|
|
}
|
|
|
|
}, Permission.camera);
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
width: double.infinity,
|
|
|
|
height: ScreenUtil().setWidth(58 * 2),
|
|
|
|
child: Center(
|
|
|
|
child: Text(
|
|
|
|
'拍摄',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
color: MyColours.color_353535,
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
MyDivider(
|
|
|
|
double.infinity,
|
|
|
|
ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_EEEEEE,
|
|
|
|
),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
Utils.getPickPermission(context, () {
|
|
|
|
_getFromPictureOrCamera(ImageSource.gallery, source);
|
|
|
|
if (Navigator.canPop(context)) {
|
|
|
|
Navigator.pop(context);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
Platform.isAndroid
|
|
|
|
? Permission.storage
|
|
|
|
: Permission.photos);
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
width: double.infinity,
|
|
|
|
height: ScreenUtil().setWidth(58 * 2),
|
|
|
|
child: Center(
|
|
|
|
child: Text(
|
|
|
|
'从相册选择',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
color: MyColours.color_353535,
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
MyDivider(
|
|
|
|
double.infinity,
|
|
|
|
ScreenUtil().setWidth(10),
|
|
|
|
color: MyColours.color_EEEEEE,
|
|
|
|
),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
if (Navigator.canPop(context)) {
|
|
|
|
Navigator.pop(context, '取消');
|
|
|
|
}
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
width: double.infinity,
|
|
|
|
height: ScreenUtil().setWidth(58 * 2),
|
|
|
|
child: Center(
|
|
|
|
child: Text(
|
|
|
|
'取消',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
color: MyColours.color_353535,
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
),
|
|
|
|
)))
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
//查看大图
|
|
|
|
_showPhotoView(BuildContext context, int index, List<String?> 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)
|
|
|
|
],
|
|
|
|
);
|
|
|
|
return child;
|
|
|
|
});
|
|
|
|
Utils.setBarStatus(true, color: Colors.white);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// 九宫格
|
|
|
|
Widget _getGridImg(context, String subTips, UpaloadSource source) {
|
|
|
|
String? path;
|
|
|
|
if (source == UpaloadSource.business) {
|
|
|
|
path = businessCard;
|
|
|
|
} else if (source == UpaloadSource.frontid) {
|
|
|
|
path = idPersonPath;
|
|
|
|
} else if (source == UpaloadSource.backid) {
|
|
|
|
path = idPersonUnPath;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (path == null) {
|
|
|
|
return InkWell(
|
|
|
|
onTap: () {
|
|
|
|
// 触摸收起键盘
|
|
|
|
FocusScope.of(context).requestFocus(FocusNode());
|
|
|
|
_openModalBottomSheet(context, source);
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
width: ScreenUtil().setWidth(90 * 2),
|
|
|
|
height: ScreenUtil().setWidth(90 * 2),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border.all(
|
|
|
|
color: MyColours.color_E0E0E0,
|
|
|
|
width: ScreenUtil().setWidth(2)),
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
VEmptyView(46),
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath('add_image'),
|
|
|
|
width: ScreenUtil().setWidth(44),
|
|
|
|
height: ScreenUtil().setWidth(40),
|
|
|
|
),
|
|
|
|
VEmptyView(10),
|
|
|
|
Text(
|
|
|
|
'上传照片',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(24),
|
|
|
|
color: MyColours.color_999999),
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(top: w(5)),
|
|
|
|
child: Text(
|
|
|
|
'${subTips}',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(18),
|
|
|
|
color: MyColours.color_999999),
|
|
|
|
)),
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
return InkWell(
|
|
|
|
onTap: () {
|
|
|
|
// if (temp[index].process == 1) {
|
|
|
|
// widget.model!.imageQiniuUrlList = [];
|
|
|
|
// if (temp[index].qiniuUrl != null) {
|
|
|
|
// for (int i = 0; i < temp.length; i++) {
|
|
|
|
// widget.model!.imageQiniuUrlList.add(temp[i].qiniuUrl);
|
|
|
|
// }
|
|
|
|
|
|
|
|
///没有上传完成的不可以点击
|
|
|
|
// if(path != null){
|
|
|
|
|
|
|
|
// }
|
|
|
|
// _showPhotoView(
|
|
|
|
// context,0, []);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
},
|
|
|
|
child: Stack(
|
|
|
|
// alignment: Alignment.topRight,
|
|
|
|
children: [
|
|
|
|
// path != null
|
|
|
|
// ?
|
|
|
|
Container(
|
|
|
|
child: Image.file(
|
|
|
|
File(path),
|
|
|
|
fit: BoxFit.contain,
|
|
|
|
width: ScreenUtil().setWidth(100 * 2),
|
|
|
|
height: ScreenUtil().setWidth(100 * 2),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
// : CachedNetworkImage(
|
|
|
|
// imageUrl: '',
|
|
|
|
// fit: BoxFit.cover,
|
|
|
|
// width: ScreenUtil().setWidth(100 * 2),
|
|
|
|
// height: ScreenUtil().setWidth(100 * 2),
|
|
|
|
// ),
|
|
|
|
Positioned(
|
|
|
|
right: 0,
|
|
|
|
top: 0,
|
|
|
|
child: GestureDetector(
|
|
|
|
child: Image.asset(
|
|
|
|
Utils.getImgPath("delete"),
|
|
|
|
width: ScreenUtil().setWidth(40),
|
|
|
|
height: ScreenUtil().setWidth(40),
|
|
|
|
),
|
|
|
|
onTap: () {
|
|
|
|
if (source == UpaloadSource.business) {
|
|
|
|
businessCard = null;
|
|
|
|
} else if (source == UpaloadSource.frontid) {
|
|
|
|
idPersonPath = null;
|
|
|
|
} else if (source == UpaloadSource.backid) {
|
|
|
|
idPersonUnPath = null;
|
|
|
|
}
|
|
|
|
setState(() {});
|
|
|
|
// if (widget.uploadType ==
|
|
|
|
// UploadType.TableManagerType ||
|
|
|
|
// widget.uploadType ==
|
|
|
|
// UploadType.RemarkImagesType) {
|
|
|
|
// if (temp[index].isUpload) {
|
|
|
|
// //已经传到服务器,弹提醒窗口,是否删除
|
|
|
|
// //修改之前有内容,则弹框
|
|
|
|
// DialogUtil.cupertinoAlertDialog(context,
|
|
|
|
// title: "确认删除",
|
|
|
|
// content: "是否确定删除该照片,删除操作不可逆转,请谨慎操作",
|
|
|
|
// lCallback: () {
|
|
|
|
// print("取消");
|
|
|
|
// }, rCallback: () {
|
|
|
|
// print("确定");
|
|
|
|
// widget.deleteCallback!(index);
|
|
|
|
// });
|
|
|
|
// } else {
|
|
|
|
// //直接删除
|
|
|
|
// setState(() {
|
|
|
|
// temp.removeWhere((element) =>
|
|
|
|
// element == temp[index]);
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
// } else {
|
|
|
|
// //点击删除按钮
|
|
|
|
// setState(() {
|
|
|
|
// temp.removeWhere((element) =>
|
|
|
|
// element == temp[index]);
|
|
|
|
// widget.model!.imageQiniuUrlList
|
|
|
|
// .removeWhere((element) =>
|
|
|
|
// element ==
|
|
|
|
// widget.model!
|
|
|
|
// .imageQiniuUrlList[index]);
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
},
|
|
|
|
)),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
///#相机拍照,单图选择
|
|
|
|
Future _getFromPictureOrCamera(imageSource, UpaloadSource source) async {
|
|
|
|
final picker = ImagePicker();
|
|
|
|
final pickedFile = await picker.pickImage(source: imageSource);
|
|
|
|
if (pickedFile != null) {
|
|
|
|
File compressedFile = await FlutterNativeImage.compressImage(
|
|
|
|
pickedFile.path,
|
|
|
|
quality: 90,
|
|
|
|
percentage: 50);
|
|
|
|
if (source == UpaloadSource.business) {
|
|
|
|
businessCard = compressedFile.absolute.path;
|
|
|
|
} else if (source == UpaloadSource.frontid) {
|
|
|
|
idPersonPath = compressedFile.absolute.path;
|
|
|
|
} else if (source == UpaloadSource.backid) {
|
|
|
|
idPersonUnPath = compressedFile.absolute.path;
|
|
|
|
}
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
_uploadImageProvider =
|
|
...
|
...
|
@@ -380,7 +878,61 @@ class _EnterpriseInformationUploadPageState |
|
|
|
_inputWidget('注册号', registrNoC, registrNoFoc, '点击输入营业执照注册号'),
|
|
|
|
_inputWidget(
|
|
|
|
'注册名称', registrNameC, registrNameFoc, '点击输入营业执照上的企业名称'),
|
|
|
|
_select('营业执照开始于', stime, () {
|
|
|
|
_inputWidget(
|
|
|
|
'经营者/法人姓名', legalNameC, legalNameFoc, '点击输入经营者/法人姓名'),
|
|
|
|
_inputWidget(
|
|
|
|
'注册地址', registrAddressC, registrAddressFoc, '点击输入注册地址'),
|
|
|
|
Consumer<UploadImageProvider>(builder: (context, model, _) {
|
|
|
|
return Padding(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
left: w(20), top: w(20), bottom: w(12)),
|
|
|
|
child:
|
|
|
|
_getGridImg(context, '营业执照照片', UpaloadSource.business)
|
|
|
|
/*
|
|
|
|
ImgPickerWidget(
|
|
|
|
scrollController: _controller,
|
|
|
|
model: model,
|
|
|
|
maxImageNumber: 1,
|
|
|
|
uploadType: UploadType.TableManagerType,
|
|
|
|
subTips: '营业执照照片',
|
|
|
|
deleteCallback: (int index) {
|
|
|
|
// _delTablePhoto(
|
|
|
|
// context,
|
|
|
|
// _uploadImageProvider.tableImageList[index].photoID,
|
|
|
|
// index);
|
|
|
|
},
|
|
|
|
callback: () {
|
|
|
|
// for (UploadImgModel item
|
|
|
|
// in _uploadImageProvider.tableImageList) {
|
|
|
|
// if (item.process! < 1) {
|
|
|
|
// Utils.showToast('正在上传图片,请稍等');
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// //接口,和桌子绑定
|
|
|
|
// List imageQiniuUrlList = [];
|
|
|
|
// for (int i = 0;
|
|
|
|
// i < _uploadImageProvider.tableImageList.length;
|
|
|
|
// i++) {
|
|
|
|
// if (!_uploadImageProvider.tableImageList[i].isUpload) {
|
|
|
|
// imageQiniuUrlList.add({
|
|
|
|
// "url":
|
|
|
|
// _uploadImageProvider.tableImageList[i].qiniuUrl
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// _setTablePhoto(context, imageQiniuUrlList);
|
|
|
|
},
|
|
|
|
)
|
|
|
|
*/
|
|
|
|
|
|
|
|
);
|
|
|
|
}),
|
|
|
|
VEmptyView(24),
|
|
|
|
_title('经营者/法人信息'),
|
|
|
|
VEmptyView(20),
|
|
|
|
_inputWidget('法人身份证号码', idNumC, idNumFoc, '点击输入法人身份证号码'),
|
|
|
|
_select('身份证有效期的开始时间', stime, () {
|
|
|
|
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
//弹出时间选择器
|
|
|
|
|
|
...
|
...
|
@@ -398,9 +950,8 @@ class _EnterpriseInformationUploadPageState |
|
|
|
}
|
|
|
|
// showDateSelWidget = false;
|
|
|
|
},
|
|
|
|
dateTime: stime == '点击选择营业执照开始日期'
|
|
|
|
? null
|
|
|
|
: DateUtil.getDateTime(stime),
|
|
|
|
dateTime:
|
|
|
|
stime == '点击选择' ? null : DateUtil.getDateTime(stime),
|
|
|
|
minValue: DateTime(1987),
|
|
|
|
yearBegin: 1987,
|
|
|
|
pickerDateTimeType: PickerDateTimeType.kYMD,
|
|
...
|
...
|
@@ -408,11 +959,20 @@ class _EnterpriseInformationUploadPageState |
|
|
|
// showDateSelWidget = false;
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
_canUse('营业期限长期有效', true, () {}),
|
|
|
|
_canUse('身份证有效期长期有效', isCard, () {
|
|
|
|
setState(() {
|
|
|
|
isCard = !isCard;
|
|
|
|
etime = '点击选择';
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
_select(
|
|
|
|
'营业执照结束于',
|
|
|
|
'身份证有效期的结束时间',
|
|
|
|
etime,
|
|
|
|
() {
|
|
|
|
if (isCard) {
|
|
|
|
Utils.showToast('已选择长期有效!');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
FocusScope.of(context)
|
|
|
|
.requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
//弹出时间选择器
|
|
...
|
...
|
@@ -431,7 +991,7 @@ class _EnterpriseInformationUploadPageState |
|
|
|
}
|
|
|
|
// showDateSelWidget = false;
|
|
|
|
},
|
|
|
|
dateTime: etime == '点击选择营业执照结束日期'
|
|
|
|
dateTime: etime == '点击选择'
|
|
|
|
? null
|
|
|
|
: DateUtil.getDateTime(etime),
|
|
|
|
minValue: DateTime(1987),
|
|
...
|
...
|
@@ -442,83 +1002,41 @@ class _EnterpriseInformationUploadPageState |
|
|
|
});
|
|
|
|
},
|
|
|
|
),
|
|
|
|
_inputWidget(
|
|
|
|
'经营者/法人姓名', legalNameC, legalNameFoc, '点击输入经营者/法人姓名'),
|
|
|
|
_inputWidget(
|
|
|
|
'注册地址', registrAddressC, registrAddressFoc, '点击输入注册地址'),
|
|
|
|
Consumer<UploadImageProvider>(builder: (context, model, _) {
|
|
|
|
return Padding(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
left: w(20), top: w(20), bottom: w(12)),
|
|
|
|
child: ImgPickerWidget(
|
|
|
|
scrollController: _controller,
|
|
|
|
model: model,
|
|
|
|
maxImageNumber: 1,
|
|
|
|
uploadType: UploadType.TableManagerType,
|
|
|
|
subTips: '营业执照照片',
|
|
|
|
deleteCallback: (int index) {
|
|
|
|
// _delTablePhoto(
|
|
|
|
// context,
|
|
|
|
// _uploadImageProvider.tableImageList[index].photoID,
|
|
|
|
// index);
|
|
|
|
},
|
|
|
|
callback: () {
|
|
|
|
// for (UploadImgModel item
|
|
|
|
// in _uploadImageProvider.tableImageList) {
|
|
|
|
// if (item.process! < 1) {
|
|
|
|
// Utils.showToast('正在上传图片,请稍等');
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// //接口,和桌子绑定
|
|
|
|
// List imageQiniuUrlList = [];
|
|
|
|
// for (int i = 0;
|
|
|
|
// i < _uploadImageProvider.tableImageList.length;
|
|
|
|
// i++) {
|
|
|
|
// if (!_uploadImageProvider.tableImageList[i].isUpload) {
|
|
|
|
// imageQiniuUrlList.add({
|
|
|
|
// "url":
|
|
|
|
// _uploadImageProvider.tableImageList[i].qiniuUrl
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// _setTablePhoto(context, imageQiniuUrlList);
|
|
|
|
},
|
|
|
|
));
|
|
|
|
}),
|
|
|
|
VEmptyView(24),
|
|
|
|
_title('经营者/法人信息'),
|
|
|
|
VEmptyView(20),
|
|
|
|
_inputWidget('法人身份证号码', idNumC, idNumFoc, '点击输入法人身份证号码'),
|
|
|
|
_inputWidget(
|
|
|
|
'法人身份证住址', idAddressC, idAddressFoc, '点击输入法人身份证住址'),
|
|
|
|
// _inputWidget(
|
|
|
|
// '法人身份证住址', idAddressC, idAddressFoc, '点击输入法人身份证住址'),
|
|
|
|
_inputWidget('电话', legalPhoneC, legalPhoneFoc, '点击输入法人电话号码'),
|
|
|
|
_inputWidget('邮箱', emailC, emailFoc, '点击输入用来收取支付信息的邮箱'),
|
|
|
|
Row(children: [
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
left: w(20), top: w(20), bottom: w(12)),
|
|
|
|
child: ImgPickerInvitationWidget(
|
|
|
|
scrollController: _controller,
|
|
|
|
uploadType: UploadType.InvitationStoreType,
|
|
|
|
model: _uploadImageProvider,
|
|
|
|
index: 5,
|
|
|
|
imageModel: _uploadImageProvider.storeImage1,
|
|
|
|
subTips: '法人身份证人像页',
|
|
|
|
callback: () {},
|
|
|
|
)),
|
|
|
|
child: _getGridImg(
|
|
|
|
context, '法人身份证人像页', UpaloadSource.frontid)
|
|
|
|
// ImgPickerInvitationWidget(
|
|
|
|
// scrollController: _controller,
|
|
|
|
// uploadType: UploadType.InvitationStoreType,
|
|
|
|
// model: _uploadImageProvider,
|
|
|
|
// index: 5,
|
|
|
|
// imageModel: _uploadImageProvider.storeImage1,
|
|
|
|
// subTips: '法人身份证人像页',
|
|
|
|
// callback: () {},
|
|
|
|
// )
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
left: w(20), top: w(20), bottom: w(12)),
|
|
|
|
child: ImgPickerInvitationWidget(
|
|
|
|
scrollController: _controller,
|
|
|
|
uploadType: UploadType.InvitationStoreType,
|
|
|
|
model: _uploadImageProvider,
|
|
|
|
index: 6,
|
|
|
|
imageModel: _uploadImageProvider.storeImage2,
|
|
|
|
subTips: '法人身份证国徽页',
|
|
|
|
callback: () {},
|
|
|
|
)),
|
|
|
|
child:
|
|
|
|
_getGridImg(context, '法人身份证国徽页', UpaloadSource.backid)
|
|
|
|
// ImgPickerInvitationWidget(
|
|
|
|
// scrollController: _controller,
|
|
|
|
// uploadType: UploadType.InvitationStoreType,
|
|
|
|
// model: _uploadImageProvider,
|
|
|
|
// index: 6,
|
|
|
|
// imageModel: _uploadImageProvider.storeImage2,
|
|
|
|
// subTips: '法人身份证国徽页',
|
|
|
|
// callback: () {},
|
|
|
|
// )
|
|
|
|
),
|
|
|
|
]),
|
|
|
|
_title('收款信息'),
|
|
|
|
VEmptyView(20),
|
|
...
|
...
|
@@ -535,13 +1053,61 @@ class _EnterpriseInformationUploadPageState |
|
|
|
}
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
_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(
|
|
|
|
bodyLarge: 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!;
|
|
|
|
|
|
|
|
cityStringData = result.provinceName! +
|
|
|
|
result.cityName! +
|
|
|
|
' ${result.cityId}';
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
_inputWidget(
|
|
|
|
'开户银行网点', bankAllNameC, bankAllNameFoc, '点击输入开户银行网点全称'),
|
|
|
|
_inputWidget('银行账户', bankNumC, bankNumFoc, '点击录入银行账户号'),
|
|
|
|
_inputWidget('收款商户简称', merchantNameC, merchantNameFoc,
|
|
|
|
'点击输入商户简称,用户支付时可见'),
|
|
|
|
_inputWidget(
|
|
|
|
'服务电话', servicePhoneC, servicePhoneFoc, '点击输入服务电话'),
|
|
|
|
// _inputWidget('收款商户简称', merchantNameC, merchantNameFoc,
|
|
|
|
// '点击输入商户简称,用户支付时可见'),
|
|
|
|
// _inputWidget(
|
|
|
|
// '服务电话', servicePhoneC, servicePhoneFoc, '点击输入服务电话'),
|
|
|
|
VEmptyView(44),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(left: w(16)),
|
|
...
|
...
|
@@ -568,7 +1134,10 @@ class _EnterpriseInformationUploadPageState |
|
|
|
textColor: MyColours.color_ffffff,
|
|
|
|
isBold: true,
|
|
|
|
fontSize: 32,
|
|
|
|
onPressed: () {},
|
|
|
|
onPressed: () {
|
|
|
|
//接口提交
|
|
|
|
_upLoadApplyments();
|
|
|
|
},
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
...
|
...
|
|