|
...
|
...
|
@@ -4,6 +4,8 @@ import 'dart:ui'; |
|
|
|
import 'package:cached_network_image/cached_network_image.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_screenutil/screenutil.dart';
|
|
|
|
import 'package:one_key/constant/state.dart';
|
|
|
|
import 'package:one_key/models/check_seller_acc_model.dart';
|
|
|
|
import 'package:one_key/models/upload_img_model.dart';
|
|
|
|
import 'package:one_key/models/user.dart';
|
|
|
|
import 'package:one_key/pages/online_check/photo_view_wiget.dart';
|
|
...
|
...
|
@@ -23,8 +25,12 @@ import 'package:image_picker/image_picker.dart'; |
|
|
|
import 'package:permission_handler/permission_handler.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
import '../../app.dart';
|
|
|
|
|
|
|
|
class BaseInfoPage extends StatefulWidget {
|
|
|
|
BaseInfoPage({Key key}) : super(key: key);
|
|
|
|
final FromPage fromPage;
|
|
|
|
final CheckSellerAccSunModel sunModel;
|
|
|
|
BaseInfoPage({Key key, this.fromPage, this.sunModel}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
_BaseInfoPageState createState() => _BaseInfoPageState();
|
|
...
|
...
|
@@ -45,17 +51,51 @@ class _BaseInfoPageState extends State<BaseInfoPage> { |
|
|
|
|
|
|
|
UploadImageProvider _uploadImageProvider;
|
|
|
|
BaseIndoProvider _baseIndoProvider;
|
|
|
|
String nameStr = '未填写';
|
|
|
|
String phoneStr = '';
|
|
|
|
bool isSelect = true;
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
_scrollController = ScrollController();
|
|
|
|
_nameFocusNode.addListener(() {
|
|
|
|
if (_nameFocusNode.hasFocus) {
|
|
|
|
print('得到焦点');
|
|
|
|
} else {
|
|
|
|
print('失去焦点');
|
|
|
|
}
|
|
|
|
setState(() {});
|
|
|
|
});
|
|
|
|
_phoneFocusNode.addListener(() {
|
|
|
|
if (_phoneFocusNode.hasFocus) {
|
|
|
|
print('得到焦点');
|
|
|
|
} else {
|
|
|
|
print('失去焦点');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
_positionFocusNode.addListener(() {
|
|
|
|
if (_positionFocusNode.hasFocus) {
|
|
|
|
print('得到焦点');
|
|
|
|
} else {
|
|
|
|
print('失去焦点');
|
|
|
|
}
|
|
|
|
setState(() {});
|
|
|
|
});
|
|
|
|
_wechatFocusNode.addListener(() {
|
|
|
|
if (_wechatFocusNode.hasFocus) {
|
|
|
|
print('得到焦点');
|
|
|
|
} else {
|
|
|
|
print('失去焦点');
|
|
|
|
}
|
|
|
|
setState(() {});
|
|
|
|
});
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
|
|
_uploadImageProvider.touxiang.process = 0.01;
|
|
|
|
_uploadImageProvider.touxiang.qiniuUrl = '';
|
|
|
|
_uploadImageProvider.erweima.process = 0.01;
|
|
|
|
_uploadImageProvider.erweima.qiniuUrl = '';
|
|
|
|
_uploadImageProvider.imgSizeTouxiang = 84;
|
|
|
|
_uploadImageProvider.imgSizeTouxiang = 76;
|
|
|
|
_uploadImageProvider.imgSizeErweima = 22;
|
|
|
|
_getQiniuInfo();
|
|
|
|
_getCustomerActivityBaseinfo();
|
|
...
|
...
|
@@ -63,20 +103,41 @@ class _BaseInfoPageState extends State<BaseInfoPage> { |
|
|
|
}
|
|
|
|
|
|
|
|
_getCustomerActivityBaseinfo() async {
|
|
|
|
Map<String, String> params = {
|
|
|
|
'sellerid': Provider.of<UserModel>(context, listen: false).user.sellerid,
|
|
|
|
"uid": Provider.of<UserModel>(context, listen: false).user.openid,
|
|
|
|
};
|
|
|
|
Map<String, String> params;
|
|
|
|
|
|
|
|
if (widget.fromPage == FromPage.FromPageIfNeedCreateStore) {
|
|
|
|
Map<String, dynamic> seller = widget.sunModel.toJson();
|
|
|
|
params = {
|
|
|
|
'sellerid': seller['id'],
|
|
|
|
"uid": seller['uid'],
|
|
|
|
};
|
|
|
|
} else {
|
|
|
|
params = {
|
|
|
|
'sellerid':
|
|
|
|
Provider.of<UserModel>(context, listen: false).user.sellerid,
|
|
|
|
"uid": Provider.of<UserModel>(context, listen: false).user.openid,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
bool success =
|
|
|
|
await _baseIndoProvider.getCustomerActivityBaseinfo(context, params);
|
|
|
|
if (success) {
|
|
|
|
_nameController.text = _baseIndoProvider.baseInfoSunModel.name;
|
|
|
|
nameStr = _baseIndoProvider.baseInfoSunModel.name;
|
|
|
|
_uploadImageProvider.touxiang.qiniuUrl =
|
|
|
|
_baseIndoProvider.baseInfoSunModel.photo;
|
|
|
|
_uploadImageProvider.erweima.qiniuUrl =
|
|
|
|
_baseIndoProvider.baseInfoSunModel.qrcode;
|
|
|
|
_phoneController.text = _baseIndoProvider.baseInfoSunModel.phone;
|
|
|
|
phoneStr = _baseIndoProvider.baseInfoSunModel.phone ?? '';
|
|
|
|
_wechatController.text = _baseIndoProvider.baseInfoSunModel.wechat;
|
|
|
|
if (_baseIndoProvider.baseInfoSunModel.wechat != null &&
|
|
|
|
_baseIndoProvider.baseInfoSunModel.wechat != '' &&
|
|
|
|
phoneStr != '' &&
|
|
|
|
_baseIndoProvider.baseInfoSunModel.wechat == phoneStr) {
|
|
|
|
isSelect = true;
|
|
|
|
} else {
|
|
|
|
isSelect = false;
|
|
|
|
}
|
|
|
|
_positionController.text = _baseIndoProvider.baseInfoSunModel.position;
|
|
|
|
_uploadImageProvider.imgSizeErweima = 64;
|
|
|
|
// setState(() {});
|
|
...
|
...
|
@@ -94,30 +155,41 @@ class _BaseInfoPageState extends State<BaseInfoPage> { |
|
|
|
_setCustomerActivityBaseinfo() async {
|
|
|
|
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
|
|
|
|
User user = Provider.of<UserModel>(context, listen: false).user;
|
|
|
|
String nameTemp = _nameController.text.trim();
|
|
|
|
String phoneTemp = _phoneController.text.trim();
|
|
|
|
Map<String, String> params = {
|
|
|
|
'sellerid': user.sellerid,
|
|
|
|
"uid": user.openid,
|
|
|
|
"name": _nameController.text.trim().length == 0
|
|
|
|
? user.sellername
|
|
|
|
: _nameController.text.trim(),
|
|
|
|
"photo": _uploadImageProvider.touxiang.qiniuUrl.trim().length == 0
|
|
|
|
? 'http://nosqn.colorcun.com/yd_person.png'
|
|
|
|
"name": nameTemp,
|
|
|
|
'phone': phoneTemp,
|
|
|
|
"photo": _uploadImageProvider.touxiang.qiniuUrl.trim().length == 0 ||
|
|
|
|
_uploadImageProvider.touxiang.qiniuUrl ==
|
|
|
|
'http://nosqn.colorcun.com/yd_person.png'
|
|
|
|
? App.sp.getString("headImg")
|
|
|
|
: _uploadImageProvider.touxiang.qiniuUrl,
|
|
|
|
"position": _positionController.text.trim().length == 0
|
|
|
|
? '经理'
|
|
|
|
: _positionController.text,
|
|
|
|
};
|
|
|
|
if (_phoneController.text.trim().length == 0) {
|
|
|
|
if (user.userphone != null) {
|
|
|
|
params['phone'] = user.userphone;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (widget.fromPage == FromPage.FromPageIfNeedCreateStore) {
|
|
|
|
Map<String, dynamic> seller = widget.sunModel.toJson();
|
|
|
|
|
|
|
|
params['sellerid'] = seller['id'];
|
|
|
|
params["uid"] = seller['uid'];
|
|
|
|
} else {
|
|
|
|
params['phone'] = _phoneController.text.trim();
|
|
|
|
params['sellerid'] =
|
|
|
|
Provider.of<UserModel>(context, listen: false).user.sellerid;
|
|
|
|
params["uid"] =
|
|
|
|
Provider.of<UserModel>(context, listen: false).user.openid;
|
|
|
|
}
|
|
|
|
if (_wechatController.text.trim().length > 0) {
|
|
|
|
params['wechat'] = _wechatController.text;
|
|
|
|
|
|
|
|
if (isSelect) {
|
|
|
|
params['wechat'] = phoneTemp;
|
|
|
|
} else {
|
|
|
|
if (_wechatController.text.trim().length > 0) {
|
|
|
|
params['wechat'] = _wechatController.text;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (_uploadImageProvider.erweima.qiniuUrl != null &&
|
|
|
|
_uploadImageProvider.erweima.qiniuUrl != '') {
|
|
|
|
params['qrcode'] = _uploadImageProvider.erweima.qiniuUrl;
|
|
...
|
...
|
@@ -131,14 +203,49 @@ class _BaseInfoPageState extends State<BaseInfoPage> { |
|
|
|
if (isSuccess) {
|
|
|
|
_uploadImageProvider.touxiang.file = null;
|
|
|
|
_uploadImageProvider.erweima.file = null;
|
|
|
|
nameStr = nameTemp;
|
|
|
|
|
|
|
|
phoneStr = phoneTemp;
|
|
|
|
//成功之后跳回前一个页面
|
|
|
|
// bus.emit('refresh_coupon_list');
|
|
|
|
Utils.showToast('保存成功');
|
|
|
|
EventBus().emit('changeStatusColor');
|
|
|
|
Navigator.pop(context, true);
|
|
|
|
if (widget.fromPage == FromPage.FromPageIfNeedCreateStore) {
|
|
|
|
_loginStore(context, widget.sunModel);
|
|
|
|
} else {
|
|
|
|
Navigator.pop(context, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
///进入某个店铺
|
|
|
|
_loginStore(context, CheckSellerAccSunModel sunModel) {
|
|
|
|
UserModel userModel = Provider.of<UserModel>(context, listen: false);
|
|
|
|
userModel.accountLogin = false;
|
|
|
|
Map<String, dynamic> seller = sunModel.toJson();
|
|
|
|
Map<String, dynamic> userMap = {
|
|
|
|
"openid": seller['uid'],
|
|
|
|
"account": seller['account'],
|
|
|
|
"role_name": seller['role_name'],
|
|
|
|
"sellerid": seller['id'],
|
|
|
|
"sellercode": seller['seller_code'],
|
|
|
|
"sellername": seller['sellername'],
|
|
|
|
"sellerphone": seller['seller_tel'],
|
|
|
|
"sellerAddr": '',
|
|
|
|
"scatter": 0,
|
|
|
|
"room": 0,
|
|
|
|
"cassette": 0,
|
|
|
|
"morning": "",
|
|
|
|
"noon": "",
|
|
|
|
"night": "",
|
|
|
|
};
|
|
|
|
userModel.saveUserInfo(User.fromJson(userMap));
|
|
|
|
userModel.getSellerInfo(
|
|
|
|
context,
|
|
|
|
{"seller_id": seller['id'], "seller_openid": seller['openid']},
|
|
|
|
userMap);
|
|
|
|
}
|
|
|
|
|
|
|
|
///输入框
|
|
|
|
Widget _textfield(String image, String hintText,
|
|
|
|
TextEditingController editingController, FocusNode focusNode) {
|
|
...
|
...
|
@@ -159,6 +266,7 @@ class _BaseInfoPageState extends State<BaseInfoPage> { |
|
|
|
// textAlign: TextAlign.right,
|
|
|
|
// textAlignVertical: TextAlignVertical.bottom,
|
|
|
|
maxLines: 1,
|
|
|
|
|
|
|
|
// //光标颜色
|
|
|
|
// cursorColor:
|
|
|
|
// widget.isSelect ? Colors.white : MyColours.color_199095,
|
|
...
|
...
|
@@ -168,6 +276,19 @@ class _BaseInfoPageState extends State<BaseInfoPage> { |
|
|
|
),
|
|
|
|
focusNode: focusNode,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
// suffixText: '修改',
|
|
|
|
// suffixStyle: TextStyle(
|
|
|
|
// fontSize: ScreenUtil().setSp(24),
|
|
|
|
// color: MyColours.color_BFC4D4),
|
|
|
|
// suffixIcon: Container(
|
|
|
|
// margin: EdgeInsets.only(left: ScreenUtil().setWidth(16)),
|
|
|
|
// child: Image.asset(
|
|
|
|
// Utils.getImgPath('arrow_right_new'),
|
|
|
|
// width: ScreenUtil().setWidth(20),
|
|
|
|
// height: ScreenUtil().setWidth(40),
|
|
|
|
// )),
|
|
|
|
// suffixIconConstraints:
|
|
|
|
// BoxConstraints(maxWidth: ScreenUtil().setWidth(56)),
|
|
|
|
border: OutlineInputBorder(borderSide: BorderSide.none),
|
|
|
|
hintText: hintText,
|
|
|
|
hintStyle: TextStyle(
|
|
...
|
...
|
@@ -181,24 +302,50 @@ class _BaseInfoPageState extends State<BaseInfoPage> { |
|
|
|
borderSide: BorderSide.none,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onChanged: (value) {},
|
|
|
|
|
|
|
|
onChanged: (value) {
|
|
|
|
print('vvvvvv');
|
|
|
|
if (hintText == '您希望顾客看到的名字') {
|
|
|
|
setState(() {
|
|
|
|
nameStr = value;
|
|
|
|
});
|
|
|
|
} else if (hintText == '顾客联系您的手机号') {
|
|
|
|
setState(() {
|
|
|
|
phoneStr = value;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
},
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Text('修改',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_BFC4D4,
|
|
|
|
fontSize: ScreenUtil().setSp(24),
|
|
|
|
)),
|
|
|
|
HEmptyView(20),
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath('arrow_right_new'),
|
|
|
|
// width: ScreenUtil().setWidth(16),
|
|
|
|
height: ScreenUtil().setWidth(34),
|
|
|
|
)
|
|
|
|
focusNode.hasFocus
|
|
|
|
? SizedBox()
|
|
|
|
: InkWell(
|
|
|
|
onTap: () {
|
|
|
|
FocusScope.of(context).requestFocus(focusNode); // 获取焦点
|
|
|
|
setState(() {});
|
|
|
|
},
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'修改',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(24),
|
|
|
|
color: MyColours.color_BFC4D4),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
margin:
|
|
|
|
EdgeInsets.only(left: ScreenUtil().setWidth(16)),
|
|
|
|
child: Image.asset(
|
|
|
|
Utils.getImgPath('base_arrow_r'),
|
|
|
|
width: ScreenUtil().setWidth(20),
|
|
|
|
height: ScreenUtil().setWidth(40),
|
|
|
|
)),
|
|
|
|
],
|
|
|
|
))
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
...
|
...
|
@@ -250,7 +397,7 @@ class _BaseInfoPageState extends State<BaseInfoPage> { |
|
|
|
});
|
|
|
|
if (pickedFile != null) {
|
|
|
|
if (title == '头像') {
|
|
|
|
_uploadImageProvider.imgSizeTouxiang = 84;
|
|
|
|
_uploadImageProvider.imgSizeTouxiang = 76;
|
|
|
|
_uploadImageProvider.touxiang.qiniuUrl = null;
|
|
|
|
} else {
|
|
|
|
_uploadImageProvider.imgSizeErweima = 76;
|
|
...
|
...
|
@@ -290,51 +437,85 @@ class _BaseInfoPageState extends State<BaseInfoPage> { |
|
|
|
},
|
|
|
|
child: Stack(clipBehavior: Clip.none, children: [
|
|
|
|
Container(
|
|
|
|
width: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
height: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
width: ScreenUtil().setWidth(93 * 2),
|
|
|
|
height: ScreenUtil().setWidth(93 * 2),
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
right: ScreenUtil().setWidth(14),
|
|
|
|
right: ScreenUtil().setWidth(24),
|
|
|
|
),
|
|
|
|
child: ClipRRect(
|
|
|
|
borderRadius:
|
|
|
|
BorderRadius.circular(ScreenUtil().setWidth(radius)),
|
|
|
|
child: model.file == null
|
|
|
|
? model.qiniuUrl != null && model.qiniuUrl != ''
|
|
|
|
? Image.network(
|
|
|
|
model.qiniuUrl,
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
width: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
height: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
)
|
|
|
|
: Image.asset(
|
|
|
|
Utils.getImgPath(
|
|
|
|
title == '头像' ? 'touxiang' : 'erweima'),
|
|
|
|
borderRadius:
|
|
|
|
BorderRadius.circular(ScreenUtil().setWidth(93)),
|
|
|
|
child: Image.asset(
|
|
|
|
Utils.getImgPath('base_tx_bg'),
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
width: ScreenUtil().setWidth(93 * 2),
|
|
|
|
height: ScreenUtil().setWidth(93 * 2),
|
|
|
|
))),
|
|
|
|
Positioned(
|
|
|
|
top: ScreenUtil().setWidth(9),
|
|
|
|
left: ScreenUtil().setWidth(17),
|
|
|
|
child: Container(
|
|
|
|
width: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
height: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
// margin: EdgeInsets.only(
|
|
|
|
// right: ScreenUtil().setWidth(24),
|
|
|
|
// ),
|
|
|
|
child: ClipRRect(
|
|
|
|
borderRadius:
|
|
|
|
BorderRadius.circular(ScreenUtil().setWidth(radius)),
|
|
|
|
child: model.file == null
|
|
|
|
? model.qiniuUrl != null &&
|
|
|
|
model.qiniuUrl != '' &&
|
|
|
|
model.qiniuUrl !=
|
|
|
|
'http://nosqn.colorcun.com/yd_person.png'
|
|
|
|
? Image.network(
|
|
|
|
model.qiniuUrl,
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
width: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
height: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
)
|
|
|
|
: App.sp.getString("headImg") == ''
|
|
|
|
? Image.asset(
|
|
|
|
Utils.getImgPath(title == '头像'
|
|
|
|
? 'base_tx_mr'
|
|
|
|
: 'erweima'),
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
width: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
height: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
)
|
|
|
|
: Image.network(
|
|
|
|
App.sp.getString("headImg"),
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
width: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
height: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
)
|
|
|
|
: Image.file(
|
|
|
|
model.file,
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
width: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
height: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
)
|
|
|
|
: Image.file(
|
|
|
|
model.file,
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
width: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
height: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
),
|
|
|
|
))),
|
|
|
|
Positioned(
|
|
|
|
right: ScreenUtil().setWidth(42),
|
|
|
|
top: ScreenUtil().setWidth(9),
|
|
|
|
child: (model.file != null) &&
|
|
|
|
model.process != 1 &&
|
|
|
|
model.process != 0.01
|
|
|
|
? Container(
|
|
|
|
width: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
height: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(radius),
|
|
|
|
color: Color.fromRGBO(0, 0, 0, 0.6)),
|
|
|
|
child: Center(
|
|
|
|
child: Text('上传中',
|
|
|
|
style: TextStyle(color: MyColours.color_999999)),
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
// (model.file != null) && model.process != 1 && model.process != 0.01
|
|
|
|
// ? Container(
|
|
|
|
// width: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
// height: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
// decoration: BoxDecoration(
|
|
|
|
// borderRadius: BorderRadius.circular(radius),
|
|
|
|
// color: Color.fromRGBO(0, 0, 0, 0.6)),
|
|
|
|
// child: Center(
|
|
|
|
// child: Text('上传中',
|
|
|
|
// style: TextStyle(color: MyColours.color_999999)),
|
|
|
|
// ),
|
|
|
|
// )
|
|
|
|
// : Container(),
|
|
|
|
)
|
|
|
|
: Container()),
|
|
|
|
Positioned(
|
|
|
|
right: ScreenUtil().setWidth(-14),
|
|
|
|
right: ScreenUtil().setWidth(14),
|
|
|
|
top: ScreenUtil().setWidth(56),
|
|
|
|
child: InkWell(
|
|
|
|
onTap: () {
|
|
...
|
...
|
@@ -398,14 +579,15 @@ class _BaseInfoPageState extends State<BaseInfoPage> { |
|
|
|
_uploadImageProvider.imgSizeTouxiang,
|
|
|
|
76),
|
|
|
|
VEmptyView(26),
|
|
|
|
Text('未填写',
|
|
|
|
Text(nameStr,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setWidth(50),
|
|
|
|
color: true
|
|
|
|
? MyColours.color_27262B
|
|
|
|
: MyColours.color_BFC4D4)),
|
|
|
|
color: nameStr == '未填写' ||
|
|
|
|
nameStr == ''
|
|
|
|
? MyColours.color_BFC4D4
|
|
|
|
: MyColours.color_27262B)),
|
|
|
|
VEmptyView(8),
|
|
|
|
Text('18739383883',
|
|
|
|
Text(phoneStr == null ? '' : phoneStr,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setWidth(30),
|
|
|
|
color: MyColours.color_BFC4D4)),
|
|
...
|
...
|
@@ -444,15 +626,56 @@ class _BaseInfoPageState extends State<BaseInfoPage> { |
|
|
|
VEmptyView(26),
|
|
|
|
// _imageWidget('微信二维码', _uploadImageProvider.erweima,
|
|
|
|
// _uploadImageProvider.imgSizeErweima, 0),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(40),
|
|
|
|
),
|
|
|
|
child: _textfield(
|
|
|
|
'base_wechat',
|
|
|
|
'微信号方便顾客加您微信',
|
|
|
|
_wechatController,
|
|
|
|
_wechatFocusNode)),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
setState(() {
|
|
|
|
isSelect = !isSelect;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
left: ScreenUtil().setWidth(40),
|
|
|
|
right: ScreenUtil().setWidth(40),
|
|
|
|
bottom:
|
|
|
|
ScreenUtil().setWidth(26)),
|
|
|
|
child: Row(
|
|
|
|
crossAxisAlignment:
|
|
|
|
CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath(isSelect
|
|
|
|
? 'base_radio_sel'
|
|
|
|
: 'base_radio_un'),
|
|
|
|
// width: ScreenUtil().setWidth(16),
|
|
|
|
height:
|
|
|
|
ScreenUtil().setWidth(34),
|
|
|
|
),
|
|
|
|
HEmptyView(24),
|
|
|
|
Text('微信同电话号',
|
|
|
|
style: TextStyle(
|
|
|
|
color: isSelect
|
|
|
|
? MyColours.color_438E93
|
|
|
|
: MyColours
|
|
|
|
.color_BFC4D4,
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil().setSp(30),
|
|
|
|
)),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
|
|
|
|
isSelect
|
|
|
|
? SizedBox()
|
|
|
|
: Padding(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal:
|
|
|
|
ScreenUtil().setWidth(40),
|
|
|
|
),
|
|
|
|
child: _textfield(
|
|
|
|
'base_wechat',
|
|
|
|
'微信号方便顾客加您微信',
|
|
|
|
_wechatController,
|
|
|
|
_wechatFocusNode)),
|
|
|
|
VEmptyView(30),
|
|
|
|
],
|
|
|
|
)),
|
|
...
|
...
|
@@ -463,18 +686,37 @@ class _BaseInfoPageState extends State<BaseInfoPage> { |
|
|
|
ScreenUtil().setWidth(40),
|
|
|
|
0,
|
|
|
|
ScreenUtil().setWidth(40),
|
|
|
|
ScreenUtil().setWidth(40)),
|
|
|
|
ScreenUtil().setWidth(56)),
|
|
|
|
child: RoundButton(
|
|
|
|
onPressed: () {
|
|
|
|
//接口
|
|
|
|
if (_phoneController.text.trim().length ==
|
|
|
|
0 ||
|
|
|
|
_nameController.text.trim().length == 0) {
|
|
|
|
Utils.showToast('请至少填写您的姓名和电话');
|
|
|
|
return;
|
|
|
|
} //接口
|
|
|
|
_setCustomerActivityBaseinfo();
|
|
|
|
},
|
|
|
|
text: '保存',
|
|
|
|
fontSize: 34,
|
|
|
|
isBold: false,
|
|
|
|
height: ScreenUtil().setWidth(80),
|
|
|
|
width: double.infinity,
|
|
|
|
radius: ScreenUtil().setWidth(10),
|
|
|
|
height: ScreenUtil().setWidth(100),
|
|
|
|
width: ScreenUtil().setWidth(154 * 2),
|
|
|
|
gradientStart: _phoneController.text
|
|
|
|
.trim()
|
|
|
|
.length ==
|
|
|
|
0 ||
|
|
|
|
_nameController.text.trim().length == 0
|
|
|
|
? MyColours.color_BFC4D4
|
|
|
|
: MyColours.color_438E93,
|
|
|
|
gradientEnd: _phoneController.text
|
|
|
|
.trim()
|
|
|
|
.length ==
|
|
|
|
0 ||
|
|
|
|
_nameController.text.trim().length == 0
|
|
|
|
? MyColours.color_BFC4D4
|
|
|
|
: MyColours.color_438E93,
|
|
|
|
radius: ScreenUtil().setWidth(24),
|
|
|
|
))
|
|
|
|
])))));
|
|
|
|
}
|
...
|
...
|
|