|
1
|
-// import 'dart:io';
|
1
|
+import 'dart:io';
|
|
2
|
|
2
|
|
|
3
|
-// import 'package:cached_network_image/cached_network_image.dart';
|
|
|
|
4
|
-// import 'package:dio/dio.dart';
|
|
|
|
5
|
-// import 'package:flutter/material.dart';
|
|
|
|
6
|
-// import 'package:flutter/services.dart';
|
|
|
|
7
|
-// import 'package:flutter_screenutil/screenutil.dart';
|
|
|
|
8
|
-// import 'package:one_key/models/get_seller_info_model.dart';
|
|
|
|
9
|
-// import 'package:one_key/models/set_seller_info_model.dart';
|
|
|
|
10
|
-// import 'package:one_key/models/upload_img_model.dart';
|
|
|
|
11
|
-// import 'package:one_key/models/user.dart';
|
|
|
|
12
|
-// import 'package:one_key/pages/online_check/photo_view_wiget.dart';
|
|
|
|
13
|
-// import 'package:one_key/pages/online_check/progress.dart';
|
|
|
|
14
|
-// import 'package:one_key/provider/base_info_provider.dart';
|
|
|
|
15
|
-// import 'package:one_key/provider/store_base_info_provider.dart';
|
|
|
|
16
|
-// import 'package:one_key/provider/upload_img_provider.dart';
|
|
|
|
17
|
-// import 'package:one_key/provider/user_model.dart';
|
|
|
|
18
|
-// import 'package:one_key/res/colors.dart';
|
|
|
|
19
|
-// import 'package:one_key/route/navigator_util.dart';
|
|
|
|
20
|
-// import 'package:one_key/utils/event_bus.dart';
|
|
|
|
21
|
-// import 'package:one_key/utils/upload_image_util.dart';
|
|
|
|
22
|
-// import 'package:one_key/utils/utils.dart';
|
|
|
|
23
|
-// import 'package:one_key/widgets/h_empty_view.dart';
|
|
|
|
24
|
-// import 'package:one_key/widgets/round_button.dart';
|
|
|
|
25
|
-// import 'package:one_key/widgets/system_app_bar.dart';
|
|
|
|
26
|
-// import 'package:one_key/widgets/v_empty_view.dart';
|
|
|
|
27
|
-// import 'package:image_picker/image_picker.dart';
|
|
|
|
28
|
-// import 'package:permission_handler/permission_handler.dart';
|
|
|
|
29
|
-// import 'package:provider/provider.dart';
|
3
|
+import 'package:cached_network_image/cached_network_image.dart';
|
|
|
|
4
|
+import 'package:dio/dio.dart';
|
|
|
|
5
|
+import 'package:flutter/material.dart';
|
|
|
|
6
|
+import 'package:flutter/services.dart';
|
|
|
|
7
|
+import 'package:flutter_screenutil/screenutil.dart';
|
|
|
|
8
|
+import 'package:one_key/models/get_seller_info_model.dart';
|
|
|
|
9
|
+import 'package:one_key/models/set_seller_info_model.dart';
|
|
|
|
10
|
+import 'package:one_key/models/upload_img_model.dart';
|
|
|
|
11
|
+import 'package:one_key/models/user.dart';
|
|
|
|
12
|
+import 'package:one_key/pages/online_check/photo_view_wiget.dart';
|
|
|
|
13
|
+import 'package:one_key/pages/online_check/progress.dart';
|
|
|
|
14
|
+import 'package:one_key/provider/base_info_provider.dart';
|
|
|
|
15
|
+import 'package:one_key/provider/store_base_info_provider.dart';
|
|
|
|
16
|
+import 'package:one_key/provider/upload_img_provider.dart';
|
|
|
|
17
|
+import 'package:one_key/provider/user_model.dart';
|
|
|
|
18
|
+import 'package:one_key/res/colors.dart';
|
|
|
|
19
|
+import 'package:one_key/route/navigator_util.dart';
|
|
|
|
20
|
+import 'package:one_key/utils/event_bus.dart';
|
|
|
|
21
|
+import 'package:one_key/utils/upload_image_util.dart';
|
|
|
|
22
|
+import 'package:one_key/utils/utils.dart';
|
|
|
|
23
|
+import 'package:one_key/widgets/h_empty_view.dart';
|
|
|
|
24
|
+import 'package:one_key/widgets/round_button.dart';
|
|
|
|
25
|
+import 'package:one_key/widgets/system_app_bar.dart';
|
|
|
|
26
|
+import 'package:one_key/widgets/v_empty_view.dart';
|
|
|
|
27
|
+import 'package:image_picker/image_picker.dart';
|
|
|
|
28
|
+import 'package:permission_handler/permission_handler.dart';
|
|
|
|
29
|
+import 'package:provider/provider.dart';
|
|
30
|
|
30
|
|
|
31
|
-// class StoreBaseInfoPage extends StatefulWidget {
|
|
|
|
32
|
-// StoreBaseInfoPage({Key key}) : super(key: key);
|
31
|
+class StoreBaseInfoPage extends StatefulWidget {
|
|
|
|
32
|
+ StoreBaseInfoPage({Key key}) : super(key: key);
|
|
33
|
|
33
|
|
|
34
|
-// @override
|
|
|
|
35
|
-// _StoreBaseInfoPageState createState() => _StoreBaseInfoPageState();
|
|
|
|
36
|
-// }
|
34
|
+ @override
|
|
|
|
35
|
+ _StoreBaseInfoPageState createState() => _StoreBaseInfoPageState();
|
|
|
|
36
|
+}
|
|
37
|
|
37
|
|
|
38
|
-// class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> {
|
|
|
|
39
|
-// ScrollController _scrollController;
|
|
|
|
40
|
-// TextEditingController _nameController = TextEditingController();
|
|
|
|
41
|
-// TextEditingController _phoneController = TextEditingController();
|
|
|
|
42
|
-// TextEditingController _timeController = TextEditingController();
|
|
|
|
43
|
-// TextEditingController _addressController = TextEditingController();
|
|
|
|
44
|
-// TextEditingController _introductionController = TextEditingController();
|
|
|
|
45
|
-// FocusNode _nameFocusNode = FocusNode();
|
|
|
|
46
|
-// FocusNode _phoneFocusNode = FocusNode();
|
|
|
|
47
|
-// FocusNode _timeFocusNode = FocusNode();
|
|
|
|
48
|
-// FocusNode _addressFocusNode = FocusNode();
|
|
|
|
49
|
-// FocusNode _introductionFocusNode = FocusNode();
|
38
|
+class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> {
|
|
|
|
39
|
+ ScrollController _scrollController;
|
|
|
|
40
|
+ TextEditingController _nameController = TextEditingController();
|
|
|
|
41
|
+ TextEditingController _phoneController = TextEditingController();
|
|
|
|
42
|
+ TextEditingController _timeController = TextEditingController();
|
|
|
|
43
|
+ TextEditingController _addressController = TextEditingController();
|
|
|
|
44
|
+ TextEditingController _introductionController = TextEditingController();
|
|
|
|
45
|
+ FocusNode _nameFocusNode = FocusNode();
|
|
|
|
46
|
+ FocusNode _phoneFocusNode = FocusNode();
|
|
|
|
47
|
+ FocusNode _timeFocusNode = FocusNode();
|
|
|
|
48
|
+ FocusNode _addressFocusNode = FocusNode();
|
|
|
|
49
|
+ FocusNode _introductionFocusNode = FocusNode();
|
|
50
|
|
50
|
|
|
51
|
-// Map<String, dynamic> mapAddress;
|
51
|
+ Map<String, dynamic> mapAddress;
|
|
52
|
|
52
|
|
|
53
|
-// final picker = ImagePicker();
|
|
|
|
54
|
-// UploadImageProvider _uploadImageProvider;
|
|
|
|
55
|
-// StoreBaseIndoProvider _baseIndoProvider;
|
53
|
+ final picker = ImagePicker();
|
|
|
|
54
|
+ UploadImageProvider _uploadImageProvider;
|
|
|
|
55
|
+ StoreBaseIndoProvider _baseIndoProvider;
|
|
56
|
|
56
|
|
|
57
|
-// @override
|
|
|
|
58
|
-// void initState() {
|
|
|
|
59
|
-// super.initState();
|
|
|
|
60
|
-// mapAddress = {
|
|
|
|
61
|
-// "address": '点击选择',
|
|
|
|
62
|
-// 'lat': '',
|
|
|
|
63
|
-// 'lng': '',
|
|
|
|
64
|
-// };
|
|
|
|
65
|
-// _scrollController = ScrollController();
|
|
|
|
66
|
-// WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
|
|
67
|
-// _uploadImageProvider.mentou.process = 0.01;
|
|
|
|
68
|
-// _uploadImageProvider.mentou.qiniuUrl = '';
|
|
|
|
69
|
-// _uploadImageProvider.imgSizeMenTou = 64;
|
|
|
|
70
|
-// // _uploadImageProvider.mentou.file = null;
|
|
|
|
71
|
-// _getQiniuInfo();
|
|
|
|
72
|
-// _getStoreBaseinfo();
|
|
|
|
73
|
-// });
|
|
|
|
74
|
-// }
|
57
|
+ @override
|
|
|
|
58
|
+ void initState() {
|
|
|
|
59
|
+ super.initState();
|
|
|
|
60
|
+ mapAddress = {
|
|
|
|
61
|
+ "address": '点击选择',
|
|
|
|
62
|
+ 'lat': '',
|
|
|
|
63
|
+ 'lng': '',
|
|
|
|
64
|
+ };
|
|
|
|
65
|
+ _scrollController = ScrollController();
|
|
|
|
66
|
+ WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
|
|
67
|
+ _uploadImageProvider.mentou.process = 0.01;
|
|
|
|
68
|
+ _uploadImageProvider.mentou.qiniuUrl = '';
|
|
|
|
69
|
+ _uploadImageProvider.imgSizeMenTou = 64;
|
|
|
|
70
|
+ // _uploadImageProvider.mentou.file = null;
|
|
|
|
71
|
+ _getQiniuInfo();
|
|
|
|
72
|
+ _getStoreBaseinfo();
|
|
|
|
73
|
+ });
|
|
|
|
74
|
+ }
|
|
75
|
|
75
|
|
|
76
|
-// ///获取店铺信息
|
|
|
|
77
|
-// _getStoreBaseinfo() async {
|
|
|
|
78
|
-// GetSellerInfoSunModel itemModel =
|
|
|
|
79
|
-// await _baseIndoProvider.getSellerById(context);
|
|
|
|
80
|
-// if (itemModel != null) {
|
|
|
|
81
|
-// _nameController.text = itemModel.data.sellername;
|
|
|
|
82
|
-// _phoneController.text = itemModel.data.sellerTel;
|
|
|
|
83
|
-// _timeController.text = itemModel.data.dailyTime;
|
|
|
|
84
|
-// _addressController.text = itemModel.data.realAddress;
|
|
|
|
85
|
-// _introductionController.text = itemModel.data.sellerdesc;
|
|
|
|
86
|
-// _uploadImageProvider.mentou.qiniuUrl = itemModel.data.sellerImage;
|
|
|
|
87
|
-// // _uploadImageProvider.notifyListeners();
|
|
|
|
88
|
-// mapAddress = {
|
|
|
|
89
|
-// "address": itemModel.data.mapAddress,
|
|
|
|
90
|
-// 'lat': itemModel.data.lat,
|
|
|
|
91
|
-// 'lng': itemModel.data.long,
|
|
|
|
92
|
-// };
|
|
|
|
93
|
-// setState(() {});
|
|
|
|
94
|
-// }
|
|
|
|
95
|
-// }
|
76
|
+ ///获取店铺信息
|
|
|
|
77
|
+ _getStoreBaseinfo() async {
|
|
|
|
78
|
+ GetSellerInfoSunModel itemModel =
|
|
|
|
79
|
+ await _baseIndoProvider.getSellerById(context);
|
|
|
|
80
|
+ if (itemModel != null) {
|
|
|
|
81
|
+ _nameController.text = itemModel.data.sellername;
|
|
|
|
82
|
+ _phoneController.text = itemModel.data.sellerTel;
|
|
|
|
83
|
+ _timeController.text = itemModel.data.dailyTime;
|
|
|
|
84
|
+ _addressController.text = itemModel.data.realAddress;
|
|
|
|
85
|
+ _introductionController.text = itemModel.data.sellerdesc;
|
|
|
|
86
|
+ _uploadImageProvider.mentou.qiniuUrl = itemModel.data.sellerImage;
|
|
|
|
87
|
+ // _uploadImageProvider.notifyListeners();
|
|
|
|
88
|
+ mapAddress = {
|
|
|
|
89
|
+ "address": itemModel.data.mapAddress,
|
|
|
|
90
|
+ 'lat': itemModel.data.lat,
|
|
|
|
91
|
+ 'lng': itemModel.data.long,
|
|
|
|
92
|
+ };
|
|
|
|
93
|
+ setState(() {});
|
|
|
|
94
|
+ }
|
|
|
|
95
|
+ }
|
|
96
|
|
96
|
|
|
97
|
-// ///获取七牛云token
|
|
|
|
98
|
-// ///
|
|
|
|
99
|
-// _getQiniuInfo() async {
|
|
|
|
100
|
-// await _uploadImageProvider.getQiniuInfo(context, {});
|
|
|
|
101
|
-// }
|
97
|
+ ///获取七牛云token
|
|
|
|
98
|
+ ///
|
|
|
|
99
|
+ _getQiniuInfo() async {
|
|
|
|
100
|
+ await _uploadImageProvider.getQiniuInfo(context, {});
|
|
|
|
101
|
+ }
|
|
102
|
|
102
|
|
|
103
|
-// /// 修改店铺基本信息
|
|
|
|
104
|
-// _setSellerInfoById() async {
|
|
|
|
105
|
-// FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
|
103
|
+ /// 修改店铺基本信息
|
|
|
|
104
|
+ _setSellerInfoById() async {
|
|
|
|
105
|
+ FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
106
|
|
106
|
|
|
107
|
-// User user = Provider.of<UserModel>(context, listen: false).user;
|
|
|
|
108
|
-// Map<String, dynamic> params = {
|
|
|
|
109
|
-// 'id': user.sellerid,
|
|
|
|
110
|
-// };
|
107
|
+ User user = Provider.of<UserModel>(context, listen: false).user;
|
|
|
|
108
|
+ Map<String, dynamic> params = {
|
|
|
|
109
|
+ 'id': user.sellerid,
|
|
|
|
110
|
+ };
|
|
111
|
|
111
|
|
|
112
|
-// params['name'] = _nameController.text;
|
112
|
+ params['name'] = _nameController.text;
|
|
113
|
|
113
|
|
|
114
|
-// if (_uploadImageProvider.mentou.path != null &&
|
|
|
|
115
|
-// _uploadImageProvider.mentou.path != '') {
|
|
|
|
116
|
-// params['image'] =
|
|
|
|
117
|
-// await MultipartFile.fromFile(_uploadImageProvider.mentou.path);
|
|
|
|
118
|
-// }
|
114
|
+ if (_uploadImageProvider.mentou.path != null &&
|
|
|
|
115
|
+ _uploadImageProvider.mentou.path != '') {
|
|
|
|
116
|
+ params['image'] =
|
|
|
|
117
|
+ await MultipartFile.fromFile(_uploadImageProvider.mentou.path);
|
|
|
|
118
|
+ }
|
|
119
|
|
119
|
|
|
120
|
-// params['phone'] = _phoneController.text;
|
120
|
+ params['phone'] = _phoneController.text;
|
|
121
|
|
121
|
|
|
122
|
-// if (mapAddress != null && mapAddress['address'] != '') {
|
|
|
|
123
|
-// params['map_address'] = mapAddress['address'];
|
|
|
|
124
|
-// }
|
|
|
|
125
|
-// if (mapAddress != null && mapAddress['lng'] != '') {
|
|
|
|
126
|
-// params['long'] = mapAddress['lng'];
|
|
|
|
127
|
-// }
|
|
|
|
128
|
-// if (mapAddress != null && mapAddress['lat'] != '') {
|
|
|
|
129
|
-// params['lat'] = mapAddress['lat'];
|
|
|
|
130
|
-// }
|
122
|
+ if (mapAddress != null && mapAddress['address'] != '') {
|
|
|
|
123
|
+ params['map_address'] = mapAddress['address'];
|
|
|
|
124
|
+ }
|
|
|
|
125
|
+ if (mapAddress != null && mapAddress['lng'] != '') {
|
|
|
|
126
|
+ params['long'] = mapAddress['lng'];
|
|
|
|
127
|
+ }
|
|
|
|
128
|
+ if (mapAddress != null && mapAddress['lat'] != '') {
|
|
|
|
129
|
+ params['lat'] = mapAddress['lat'];
|
|
|
|
130
|
+ }
|
|
131
|
|
131
|
|
|
132
|
-// params['real_address'] = _addressController.text;
|
132
|
+ params['real_address'] = _addressController.text;
|
|
133
|
|
133
|
|
|
134
|
-// params['sellerdesc'] = _introductionController.text;
|
134
|
+ params['sellerdesc'] = _introductionController.text;
|
|
135
|
|
135
|
|
|
136
|
-// params['daily_time'] = _timeController.text;
|
136
|
+ params['daily_time'] = _timeController.text;
|
|
137
|
|
137
|
|
|
138
|
-// FormData formData = FormData.fromMap(params);
|
138
|
+ FormData formData = FormData.fromMap(params);
|
|
139
|
|
139
|
|
|
140
|
-// SetSellerInfoSunModel sunModel =
|
|
|
|
141
|
-// await _baseIndoProvider.setSellerInfoById(context, formData);
|
|
|
|
142
|
-// if (sunModel != null) {
|
|
|
|
143
|
-// //修改成功
|
|
|
|
144
|
-// Utils.showToast('保存成功');
|
|
|
|
145
|
-// EventBus().emit('changeStatusColor');
|
|
|
|
146
|
-// Navigator.pop(
|
|
|
|
147
|
-// context,
|
|
|
|
148
|
-// _uploadImageProvider.mentou.qiniuUrl != null &&
|
|
|
|
149
|
-// _uploadImageProvider.mentou.qiniuUrl != ''
|
|
|
|
150
|
-// ? {'image': _uploadImageProvider.mentou.qiniuUrl}
|
|
|
|
151
|
-// : {'image': ''});
|
|
|
|
152
|
-// } else {
|
|
|
|
153
|
-// // Utils.showToast('保存失败');
|
|
|
|
154
|
-// }
|
|
|
|
155
|
-// }
|
140
|
+ SetSellerInfoSunModel sunModel =
|
|
|
|
141
|
+ await _baseIndoProvider.setSellerInfoById(context, formData);
|
|
|
|
142
|
+ if (sunModel != null) {
|
|
|
|
143
|
+ //修改成功
|
|
|
|
144
|
+ Utils.showToast('保存成功');
|
|
|
|
145
|
+ EventBus().emit('changeStatusColor');
|
|
|
|
146
|
+ Navigator.pop(
|
|
|
|
147
|
+ context,
|
|
|
|
148
|
+ _uploadImageProvider.mentou.qiniuUrl != null &&
|
|
|
|
149
|
+ _uploadImageProvider.mentou.qiniuUrl != ''
|
|
|
|
150
|
+ ? {'image': _uploadImageProvider.mentou.qiniuUrl}
|
|
|
|
151
|
+ : {'image': ''});
|
|
|
|
152
|
+ } else {
|
|
|
|
153
|
+ // Utils.showToast('保存失败');
|
|
|
|
154
|
+ }
|
|
|
|
155
|
+ }
|
|
156
|
|
156
|
|
|
157
|
-// ///输入框
|
|
|
|
158
|
-// Widget _textfield(String title, String hintText,
|
|
|
|
159
|
-// TextEditingController editingController, FocusNode focusNode) {
|
|
|
|
160
|
-// return Container(
|
|
|
|
161
|
-// child: Row(
|
|
|
|
162
|
-// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
163
|
-// children: [
|
|
|
|
164
|
-// Container(
|
|
|
|
165
|
-// child: Text(
|
|
|
|
166
|
-// title,
|
|
|
|
167
|
-// style: TextStyle(
|
|
|
|
168
|
-// color: MyColours.color_333333,
|
|
|
|
169
|
-// fontWeight: FontWeight.bold,
|
|
|
|
170
|
-// fontSize: ScreenUtil().setSp(34)),
|
|
|
|
171
|
-// ),
|
|
|
|
172
|
-// ),
|
|
|
|
173
|
-// HEmptyView(20),
|
|
|
|
174
|
-// Spacer(),
|
|
|
|
175
|
-// Container(
|
|
|
|
176
|
-// width: ScreenUtil().setWidth(231 * 2),
|
|
|
|
177
|
-// child: TextField(
|
|
|
|
178
|
-// controller: editingController,
|
|
|
|
179
|
-// textAlign: TextAlign.right,
|
|
|
|
180
|
-// textAlignVertical: TextAlignVertical.bottom,
|
|
|
|
181
|
-// maxLines: 1,
|
|
|
|
182
|
-// inputFormatters: title == '详细地址'
|
|
|
|
183
|
-// ? [
|
|
|
|
184
|
-// LengthLimitingTextInputFormatter(20),
|
|
|
|
185
|
-// // WhitelistingTextInputFormatter.digitsOnly
|
|
|
|
186
|
-// ]
|
|
|
|
187
|
-// : [],
|
157
|
+ ///输入框
|
|
|
|
158
|
+ Widget _textfield(String title, String hintText,
|
|
|
|
159
|
+ TextEditingController editingController, FocusNode focusNode) {
|
|
|
|
160
|
+ return Container(
|
|
|
|
161
|
+ child: Row(
|
|
|
|
162
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
163
|
+ children: [
|
|
|
|
164
|
+ Container(
|
|
|
|
165
|
+ child: Text(
|
|
|
|
166
|
+ title,
|
|
|
|
167
|
+ style: TextStyle(
|
|
|
|
168
|
+ color: MyColours.color_333333,
|
|
|
|
169
|
+ fontWeight: FontWeight.bold,
|
|
|
|
170
|
+ fontSize: ScreenUtil().setSp(34)),
|
|
|
|
171
|
+ ),
|
|
|
|
172
|
+ ),
|
|
|
|
173
|
+ HEmptyView(20),
|
|
|
|
174
|
+ Spacer(),
|
|
|
|
175
|
+ Container(
|
|
|
|
176
|
+ width: ScreenUtil().setWidth(231 * 2),
|
|
|
|
177
|
+ child: TextField(
|
|
|
|
178
|
+ controller: editingController,
|
|
|
|
179
|
+ textAlign: TextAlign.right,
|
|
|
|
180
|
+ textAlignVertical: TextAlignVertical.bottom,
|
|
|
|
181
|
+ maxLines: 1,
|
|
|
|
182
|
+ inputFormatters: title == '详细地址'
|
|
|
|
183
|
+ ? [
|
|
|
|
184
|
+ LengthLimitingTextInputFormatter(20),
|
|
|
|
185
|
+ // WhitelistingTextInputFormatter.digitsOnly
|
|
|
|
186
|
+ ]
|
|
|
|
187
|
+ : [],
|
|
188
|
|
188
|
|
|
189
|
-// // //光标颜色
|
|
|
|
190
|
-// // cursorColor:
|
|
|
|
191
|
-// // widget.isSelect ? Colors.white : MyColours.color_199095,
|
|
|
|
192
|
-// //输入文本的样式
|
|
|
|
193
|
-// style: TextStyle(
|
|
|
|
194
|
-// fontSize: ScreenUtil().setSp(32),
|
|
|
|
195
|
-// ),
|
|
|
|
196
|
-// focusNode: focusNode,
|
|
|
|
197
|
-// decoration: InputDecoration(
|
|
|
|
198
|
-// border: OutlineInputBorder(borderSide: BorderSide.none),
|
|
|
|
199
|
-// hintText: hintText,
|
|
|
|
200
|
-// hintStyle: TextStyle(
|
|
|
|
201
|
-// color: MyColours.color_999999,
|
|
|
|
202
|
-// fontSize: ScreenUtil().setSp(32),
|
|
|
|
203
|
-// ),
|
|
|
|
204
|
-// enabledBorder: new UnderlineInputBorder(
|
|
|
|
205
|
-// borderSide: BorderSide.none,
|
|
|
|
206
|
-// ),
|
|
|
|
207
|
-// focusedBorder: new UnderlineInputBorder(
|
|
|
|
208
|
-// borderSide: BorderSide.none,
|
|
|
|
209
|
-// ),
|
|
|
|
210
|
-// ),
|
|
|
|
211
|
-// onChanged: (value) {
|
|
|
|
212
|
-// // if (editingController == _nameController) {
|
|
|
|
213
|
-// // _nameController.text = value;
|
|
|
|
214
|
-// // }
|
|
|
|
215
|
-// },
|
|
|
|
216
|
-// onEditingComplete: () {
|
|
|
|
217
|
-// FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
218
|
-// },
|
|
|
|
219
|
-// keyboardType: TextInputType.text,
|
|
|
|
220
|
-// ),
|
|
|
|
221
|
-// )
|
|
|
|
222
|
-// ],
|
|
|
|
223
|
-// ),
|
|
|
|
224
|
-// );
|
|
|
|
225
|
-// }
|
189
|
+ // //光标颜色
|
|
|
|
190
|
+ // cursorColor:
|
|
|
|
191
|
+ // widget.isSelect ? Colors.white : MyColours.color_199095,
|
|
|
|
192
|
+ //输入文本的样式
|
|
|
|
193
|
+ style: TextStyle(
|
|
|
|
194
|
+ fontSize: ScreenUtil().setSp(32),
|
|
|
|
195
|
+ ),
|
|
|
|
196
|
+ focusNode: focusNode,
|
|
|
|
197
|
+ decoration: InputDecoration(
|
|
|
|
198
|
+ border: OutlineInputBorder(borderSide: BorderSide.none),
|
|
|
|
199
|
+ hintText: hintText,
|
|
|
|
200
|
+ hintStyle: TextStyle(
|
|
|
|
201
|
+ color: MyColours.color_999999,
|
|
|
|
202
|
+ fontSize: ScreenUtil().setSp(32),
|
|
|
|
203
|
+ ),
|
|
|
|
204
|
+ enabledBorder: new UnderlineInputBorder(
|
|
|
|
205
|
+ borderSide: BorderSide.none,
|
|
|
|
206
|
+ ),
|
|
|
|
207
|
+ focusedBorder: new UnderlineInputBorder(
|
|
|
|
208
|
+ borderSide: BorderSide.none,
|
|
|
|
209
|
+ ),
|
|
|
|
210
|
+ ),
|
|
|
|
211
|
+ onChanged: (value) {
|
|
|
|
212
|
+ // if (editingController == _nameController) {
|
|
|
|
213
|
+ // _nameController.text = value;
|
|
|
|
214
|
+ // }
|
|
|
|
215
|
+ },
|
|
|
|
216
|
+ onEditingComplete: () {
|
|
|
|
217
|
+ FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
218
|
+ },
|
|
|
|
219
|
+ keyboardType: TextInputType.text,
|
|
|
|
220
|
+ ),
|
|
|
|
221
|
+ )
|
|
|
|
222
|
+ ],
|
|
|
|
223
|
+ ),
|
|
|
|
224
|
+ );
|
|
|
|
225
|
+ }
|
|
226
|
|
226
|
|
|
227
|
-// //查看大图
|
|
|
|
228
|
-// _showPhotoView(BuildContext context, int index, List imgs,
|
|
|
|
229
|
-// {isShow = false, List dashName}) async {
|
|
|
|
230
|
-// // if (imgs.length == 1 &&
|
|
|
|
231
|
-// // imgs[0] ==
|
|
|
|
232
|
-// // 'http://nosqn.colorcun.com/custom/lite-online/image/def-banner.png') {
|
|
|
|
233
|
-// // imgs[0] = 'http://nosqn.colorcun.com/app/seller-hj-empty.png';
|
|
|
|
234
|
-// // }
|
|
|
|
235
|
-// Utils.setBarStatus(false, color: Colors.black);
|
|
|
|
236
|
-// dynamic result = await showGeneralDialog(
|
|
|
|
237
|
-// context: context,
|
|
|
|
238
|
-// barrierDismissible: false,
|
|
|
|
239
|
-// // barrierColor: Colors.red,
|
|
|
|
240
|
-// barrierLabel:
|
|
|
|
241
|
-// MaterialLocalizations.of(context).modalBarrierDismissLabel,
|
|
|
|
242
|
-// transitionDuration: const Duration(milliseconds: 150),
|
|
|
|
243
|
-// pageBuilder: (BuildContext context, Animation animation,
|
|
|
|
244
|
-// Animation secondaryAnimation) {
|
|
|
|
245
|
-// Widget child = Stack(
|
|
|
|
246
|
-// children: <Widget>[
|
|
|
|
247
|
-// PhotoPreview(
|
|
|
|
248
|
-// initialIndex: index,
|
|
|
|
249
|
-// photoList: imgs,
|
|
|
|
250
|
-// isShow: isShow,
|
|
|
|
251
|
-// dashName: dashName,
|
|
|
|
252
|
-// needMask: false,
|
|
|
|
253
|
-// )
|
|
|
|
254
|
-// ],
|
|
|
|
255
|
-// );
|
|
|
|
256
|
-// return child;
|
|
|
|
257
|
-// });
|
|
|
|
258
|
-// Utils.setBarStatus(true, color: Colors.white);
|
|
|
|
259
|
-// }
|
227
|
+ //查看大图
|
|
|
|
228
|
+ _showPhotoView(BuildContext context, int index, List imgs,
|
|
|
|
229
|
+ {isShow = false, List dashName}) async {
|
|
|
|
230
|
+ // if (imgs.length == 1 &&
|
|
|
|
231
|
+ // imgs[0] ==
|
|
|
|
232
|
+ // 'http://nosqn.colorcun.com/custom/lite-online/image/def-banner.png') {
|
|
|
|
233
|
+ // imgs[0] = 'http://nosqn.colorcun.com/app/seller-hj-empty.png';
|
|
|
|
234
|
+ // }
|
|
|
|
235
|
+ Utils.setBarStatus(false, color: Colors.black);
|
|
|
|
236
|
+ dynamic result = await showGeneralDialog(
|
|
|
|
237
|
+ context: context,
|
|
|
|
238
|
+ barrierDismissible: false,
|
|
|
|
239
|
+ // barrierColor: Colors.red,
|
|
|
|
240
|
+ barrierLabel:
|
|
|
|
241
|
+ MaterialLocalizations.of(context).modalBarrierDismissLabel,
|
|
|
|
242
|
+ transitionDuration: const Duration(milliseconds: 150),
|
|
|
|
243
|
+ pageBuilder: (BuildContext context, Animation animation,
|
|
|
|
244
|
+ Animation secondaryAnimation) {
|
|
|
|
245
|
+ Widget child = Stack(
|
|
|
|
246
|
+ children: <Widget>[
|
|
|
|
247
|
+ PhotoPreview(
|
|
|
|
248
|
+ initialIndex: index,
|
|
|
|
249
|
+ photoList: imgs,
|
|
|
|
250
|
+ isShow: isShow,
|
|
|
|
251
|
+ dashName: dashName,
|
|
|
|
252
|
+ needMask: false,
|
|
|
|
253
|
+ )
|
|
|
|
254
|
+ ],
|
|
|
|
255
|
+ );
|
|
|
|
256
|
+ return child;
|
|
|
|
257
|
+ });
|
|
|
|
258
|
+ Utils.setBarStatus(true, color: Colors.white);
|
|
|
|
259
|
+ }
|
|
260
|
|
260
|
|
|
261
|
-// ///#相机拍照,单图选择
|
|
|
|
262
|
-// Future _getFromPictureOrCamera(
|
|
|
|
263
|
-// String title, UploadImgModel imgModel, imageSource) async {
|
|
|
|
264
|
-// final pickedFile = await picker.getImage(source: imageSource);
|
|
|
|
265
|
-// setState(() {
|
|
|
|
266
|
-// if (pickedFile != null) {
|
|
|
|
267
|
-// imgModel.file = File(pickedFile.path);
|
|
|
|
268
|
-// imgModel.process = 0.01;
|
|
|
|
269
|
-// } else {
|
|
|
|
270
|
-// print('No image selected.');
|
|
|
|
271
|
-// }
|
|
|
|
272
|
-// });
|
|
|
|
273
|
-// if (pickedFile != null) {
|
|
|
|
274
|
-// _uploadImageProvider.imgSizeMenTou = 64;
|
|
|
|
275
|
-// _uploadImageProvider.mentou.qiniuUrl = null;
|
|
|
|
276
|
-// _uploadImageProvider.mentou.file = File(pickedFile.path);
|
|
|
|
277
|
-// _uploadImageProvider.mentou.path = pickedFile.path;
|
|
|
|
278
|
-// UploadImageUtil().startUploadOnly(
|
|
|
|
279
|
-// context, File(pickedFile.path), 2, true, _uploadImageProvider);
|
|
|
|
280
|
-// }
|
|
|
|
281
|
-// }
|
261
|
+ ///#相机拍照,单图选择
|
|
|
|
262
|
+ Future _getFromPictureOrCamera(
|
|
|
|
263
|
+ String title, UploadImgModel imgModel, imageSource) async {
|
|
|
|
264
|
+ final pickedFile = await picker.getImage(source: imageSource);
|
|
|
|
265
|
+ setState(() {
|
|
|
|
266
|
+ if (pickedFile != null) {
|
|
|
|
267
|
+ imgModel.file = File(pickedFile.path);
|
|
|
|
268
|
+ imgModel.process = 0.01;
|
|
|
|
269
|
+ } else {
|
|
|
|
270
|
+ print('No image selected.');
|
|
|
|
271
|
+ }
|
|
|
|
272
|
+ });
|
|
|
|
273
|
+ if (pickedFile != null) {
|
|
|
|
274
|
+ _uploadImageProvider.imgSizeMenTou = 64;
|
|
|
|
275
|
+ _uploadImageProvider.mentou.qiniuUrl = null;
|
|
|
|
276
|
+ _uploadImageProvider.mentou.file = File(pickedFile.path);
|
|
|
|
277
|
+ _uploadImageProvider.mentou.path = pickedFile.path;
|
|
|
|
278
|
+ UploadImageUtil().startUploadOnly(
|
|
|
|
279
|
+ context, File(pickedFile.path), 2, true, _uploadImageProvider);
|
|
|
|
280
|
+ }
|
|
|
|
281
|
+ }
|
|
282
|
|
282
|
|
|
283
|
-// ///图片 头像和二维码
|
|
|
|
284
|
-// Widget _imageWidget(
|
|
|
|
285
|
-// String title, UploadImgModel model, double imgSize, double radius) {
|
|
|
|
286
|
-// return InkWell(
|
|
|
|
287
|
-// onTap: () {
|
|
|
|
288
|
-// Utils.getPickPermission(context, () {
|
|
|
|
289
|
-// _getFromPictureOrCamera(title, model, ImageSource.gallery);
|
|
|
|
290
|
-// }, Platform.isAndroid ? Permission.storage : Permission.photos);
|
|
|
|
291
|
-// },
|
|
|
|
292
|
-// child: Container(
|
|
|
|
293
|
-// margin: EdgeInsets.only(
|
|
|
|
294
|
-// top: ScreenUtil().setWidth(40),
|
|
|
|
295
|
-// left: ScreenUtil().setWidth(40),
|
|
|
|
296
|
-// right: ScreenUtil().setWidth(40)),
|
|
|
|
297
|
-// height: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
298
|
-// child: Row(
|
|
|
|
299
|
-// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
300
|
-// children: [
|
|
|
|
301
|
-// Text(
|
|
|
|
302
|
-// title,
|
|
|
|
303
|
-// textAlign: TextAlign.left,
|
|
|
|
304
|
-// style: TextStyle(
|
|
|
|
305
|
-// color: MyColours.color_333333,
|
|
|
|
306
|
-// fontWeight: FontWeight.bold,
|
|
|
|
307
|
-// fontSize: ScreenUtil().setSp(34)),
|
|
|
|
308
|
-// ),
|
|
|
|
309
|
-// Spacer(),
|
|
|
|
310
|
-// Stack(
|
|
|
|
311
|
-// children: [
|
|
|
|
312
|
-// InkWell(
|
|
|
|
313
|
-// onTap: () {
|
|
|
|
314
|
-// double process;
|
|
|
|
315
|
-// String qiniuUrl;
|
|
|
|
316
|
-// List<String> tempList = [];
|
283
|
+ ///图片 头像和二维码
|
|
|
|
284
|
+ Widget _imageWidget(
|
|
|
|
285
|
+ String title, UploadImgModel model, double imgSize, double radius) {
|
|
|
|
286
|
+ return InkWell(
|
|
|
|
287
|
+ onTap: () {
|
|
|
|
288
|
+ Utils.getPickPermission(context, () {
|
|
|
|
289
|
+ _getFromPictureOrCamera(title, model, ImageSource.gallery);
|
|
|
|
290
|
+ }, Platform.isAndroid ? Permission.storage : Permission.photos);
|
|
|
|
291
|
+ },
|
|
|
|
292
|
+ child: Container(
|
|
|
|
293
|
+ margin: EdgeInsets.only(
|
|
|
|
294
|
+ top: ScreenUtil().setWidth(40),
|
|
|
|
295
|
+ left: ScreenUtil().setWidth(40),
|
|
|
|
296
|
+ right: ScreenUtil().setWidth(40)),
|
|
|
|
297
|
+ height: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
298
|
+ child: Row(
|
|
|
|
299
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
300
|
+ children: [
|
|
|
|
301
|
+ Text(
|
|
|
|
302
|
+ title,
|
|
|
|
303
|
+ textAlign: TextAlign.left,
|
|
|
|
304
|
+ style: TextStyle(
|
|
|
|
305
|
+ color: MyColours.color_333333,
|
|
|
|
306
|
+ fontWeight: FontWeight.bold,
|
|
|
|
307
|
+ fontSize: ScreenUtil().setSp(34)),
|
|
|
|
308
|
+ ),
|
|
|
|
309
|
+ Spacer(),
|
|
|
|
310
|
+ Stack(
|
|
|
|
311
|
+ children: [
|
|
|
|
312
|
+ InkWell(
|
|
|
|
313
|
+ onTap: () {
|
|
|
|
314
|
+ double process;
|
|
|
|
315
|
+ String qiniuUrl;
|
|
|
|
316
|
+ List<String> tempList = [];
|
|
317
|
|
317
|
|
|
318
|
-// process = _uploadImageProvider.mentou.process;
|
|
|
|
319
|
-// qiniuUrl = _uploadImageProvider.mentou.qiniuUrl;
|
318
|
+ process = _uploadImageProvider.mentou.process;
|
|
|
|
319
|
+ qiniuUrl = _uploadImageProvider.mentou.qiniuUrl;
|
|
320
|
|
320
|
|
|
321
|
-// if (qiniuUrl != null && qiniuUrl != '') {
|
|
|
|
322
|
-// tempList.add(qiniuUrl);
|
321
|
+ if (qiniuUrl != null && qiniuUrl != '') {
|
|
|
|
322
|
+ tempList.add(qiniuUrl);
|
|
323
|
|
323
|
|
|
324
|
-// ///没有上传完成的不可以点击
|
|
|
|
325
|
-// _showPhotoView(context, 0, tempList);
|
|
|
|
326
|
-// } else {
|
|
|
|
327
|
-// Utils.getPickPermission(context, () {
|
|
|
|
328
|
-// _getFromPictureOrCamera(
|
|
|
|
329
|
-// title, model, ImageSource.gallery);
|
|
|
|
330
|
-// },
|
|
|
|
331
|
-// Platform.isAndroid
|
|
|
|
332
|
-// ? Permission.storage
|
|
|
|
333
|
-// : Permission.photos);
|
|
|
|
334
|
-// }
|
|
|
|
335
|
-// },
|
|
|
|
336
|
-// child: ClipRRect(
|
|
|
|
337
|
-// borderRadius:
|
|
|
|
338
|
-// BorderRadius.circular(ScreenUtil().setWidth(radius)),
|
|
|
|
339
|
-// child: model.file == null
|
|
|
|
340
|
-// ? model.qiniuUrl != null && model.qiniuUrl != ''
|
|
|
|
341
|
-// ? Image.network(
|
|
|
|
342
|
-// model.qiniuUrl,
|
|
|
|
343
|
-// fit: BoxFit.cover,
|
|
|
|
344
|
-// width: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
345
|
-// height: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
346
|
-// )
|
|
|
|
347
|
-// : Image.asset(
|
|
|
|
348
|
-// Utils.getImgPath('no_image'),
|
|
|
|
349
|
-// fit: BoxFit.cover,
|
|
|
|
350
|
-// width: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
351
|
-// height: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
352
|
-// )
|
|
|
|
353
|
-// : Image.file(
|
|
|
|
354
|
-// model.file,
|
|
|
|
355
|
-// fit: BoxFit.cover,
|
|
|
|
356
|
-// width: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
357
|
-// height: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
358
|
-// ),
|
|
|
|
359
|
-// ),
|
|
|
|
360
|
-// ),
|
|
|
|
361
|
-// (model.file != null) &&
|
|
|
|
362
|
-// model.process != 1 &&
|
|
|
|
363
|
-// model.process != 0.01
|
|
|
|
364
|
-// ? Container(
|
|
|
|
365
|
-// width: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
366
|
-// height: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
367
|
-// decoration: BoxDecoration(
|
|
|
|
368
|
-// borderRadius: BorderRadius.circular(radius),
|
|
|
|
369
|
-// color: Color.fromRGBO(0, 0, 0, 0.6)),
|
|
|
|
370
|
-// child: Center(
|
|
|
|
371
|
-// child: Text('上传中',
|
|
|
|
372
|
-// style:
|
|
|
|
373
|
-// TextStyle(color: MyColours.color_999999)),
|
|
|
|
374
|
-// ),
|
|
|
|
375
|
-// )
|
|
|
|
376
|
-// : Container(),
|
|
|
|
377
|
-// ],
|
|
|
|
378
|
-// ),
|
|
|
|
379
|
-// HEmptyView(30),
|
|
|
|
380
|
-// Image.asset(
|
|
|
|
381
|
-// "assets/arr_right_gray.png",
|
|
|
|
382
|
-// width: ScreenUtil().setWidth(14),
|
|
|
|
383
|
-// height: ScreenUtil().setWidth(22),
|
|
|
|
384
|
-// )
|
|
|
|
385
|
-// ],
|
|
|
|
386
|
-// ),
|
|
|
|
387
|
-// ));
|
|
|
|
388
|
-// }
|
324
|
+ ///没有上传完成的不可以点击
|
|
|
|
325
|
+ _showPhotoView(context, 0, tempList);
|
|
|
|
326
|
+ } else {
|
|
|
|
327
|
+ Utils.getPickPermission(context, () {
|
|
|
|
328
|
+ _getFromPictureOrCamera(
|
|
|
|
329
|
+ title, model, ImageSource.gallery);
|
|
|
|
330
|
+ },
|
|
|
|
331
|
+ Platform.isAndroid
|
|
|
|
332
|
+ ? Permission.storage
|
|
|
|
333
|
+ : Permission.photos);
|
|
|
|
334
|
+ }
|
|
|
|
335
|
+ },
|
|
|
|
336
|
+ child: ClipRRect(
|
|
|
|
337
|
+ borderRadius:
|
|
|
|
338
|
+ BorderRadius.circular(ScreenUtil().setWidth(radius)),
|
|
|
|
339
|
+ child: model.file == null
|
|
|
|
340
|
+ ? model.qiniuUrl != null && model.qiniuUrl != ''
|
|
|
|
341
|
+ ? Image.network(
|
|
|
|
342
|
+ model.qiniuUrl,
|
|
|
|
343
|
+ fit: BoxFit.cover,
|
|
|
|
344
|
+ width: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
345
|
+ height: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
346
|
+ )
|
|
|
|
347
|
+ : Image.asset(
|
|
|
|
348
|
+ Utils.getImgPath('no_image'),
|
|
|
|
349
|
+ fit: BoxFit.cover,
|
|
|
|
350
|
+ width: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
351
|
+ height: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
352
|
+ )
|
|
|
|
353
|
+ : Image.file(
|
|
|
|
354
|
+ model.file,
|
|
|
|
355
|
+ fit: BoxFit.cover,
|
|
|
|
356
|
+ width: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
357
|
+ height: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
358
|
+ ),
|
|
|
|
359
|
+ ),
|
|
|
|
360
|
+ ),
|
|
|
|
361
|
+ (model.file != null) &&
|
|
|
|
362
|
+ model.process != 1 &&
|
|
|
|
363
|
+ model.process != 0.01
|
|
|
|
364
|
+ ? Container(
|
|
|
|
365
|
+ width: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
366
|
+ height: ScreenUtil().setWidth(imgSize * 2),
|
|
|
|
367
|
+ decoration: BoxDecoration(
|
|
|
|
368
|
+ borderRadius: BorderRadius.circular(radius),
|
|
|
|
369
|
+ color: Color.fromRGBO(0, 0, 0, 0.6)),
|
|
|
|
370
|
+ child: Center(
|
|
|
|
371
|
+ child: Text('上传中',
|
|
|
|
372
|
+ style:
|
|
|
|
373
|
+ TextStyle(color: MyColours.color_999999)),
|
|
|
|
374
|
+ ),
|
|
|
|
375
|
+ )
|
|
|
|
376
|
+ : Container(),
|
|
|
|
377
|
+ ],
|
|
|
|
378
|
+ ),
|
|
|
|
379
|
+ HEmptyView(30),
|
|
|
|
380
|
+ Image.asset(
|
|
|
|
381
|
+ "assets/arr_right_gray.png",
|
|
|
|
382
|
+ width: ScreenUtil().setWidth(14),
|
|
|
|
383
|
+ height: ScreenUtil().setWidth(22),
|
|
|
|
384
|
+ )
|
|
|
|
385
|
+ ],
|
|
|
|
386
|
+ ),
|
|
|
|
387
|
+ ));
|
|
|
|
388
|
+ }
|
|
389
|
|
389
|
|
|
390
|
-// ///地图地址选择
|
|
|
|
391
|
-// Widget _select(String title, String hintText) {
|
|
|
|
392
|
-// return InkWell(
|
|
|
|
393
|
-// onTap: () {
|
|
|
|
394
|
-// Utils.getPickPermission(context, () async {
|
|
|
|
395
|
-// mapAddress = await NavigatorUtil.goMapChoicePointPage(context);
|
|
|
|
396
|
-// if (mapAddress != null) {
|
|
|
|
397
|
-// setState(() {
|
|
|
|
398
|
-// // storeMapAddress = address['address'];
|
|
|
|
399
|
-// // // createStoreModel.storeInfo?.address = storeAddress;
|
|
|
|
400
|
-// // // createStoreModel.storeInfo?.lat = address['lat'];
|
|
|
|
401
|
-// // // createStoreModel.storeInfo?.lng = address['lng'];
|
|
|
|
402
|
-// });
|
|
|
|
403
|
-// }
|
|
|
|
404
|
-// }, Permission.location);
|
|
|
|
405
|
-// },
|
|
|
|
406
|
-// child: Container(
|
|
|
|
407
|
-// child: Row(
|
|
|
|
408
|
-// crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
409
|
-// mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
410
|
-// children: [
|
|
|
|
411
|
-// Container(
|
|
|
|
412
|
-// child: Text(
|
|
|
|
413
|
-// title,
|
|
|
|
414
|
-// style: TextStyle(
|
|
|
|
415
|
-// color: MyColours.color_333333,
|
|
|
|
416
|
-// fontWeight: FontWeight.bold,
|
|
|
|
417
|
-// fontSize: ScreenUtil().setSp(34)),
|
|
|
|
418
|
-// ),
|
|
|
|
419
|
-// ),
|
|
|
|
420
|
-// HEmptyView(40),
|
|
|
|
421
|
-// Expanded(
|
|
|
|
422
|
-// child: Text(hintText,
|
|
|
|
423
|
-// textAlign: TextAlign.right,
|
|
|
|
424
|
-// style: TextStyle(
|
|
|
|
425
|
-// color: hintText == '点击选择'
|
|
|
|
426
|
-// ? MyColours.color_999999
|
|
|
|
427
|
-// : MyColours.color_333333,
|
|
|
|
428
|
-// fontSize: ScreenUtil().setSp(32),
|
|
|
|
429
|
-// ))),
|
|
|
|
430
|
-// HEmptyView(20),
|
|
|
|
431
|
-// Image.asset(
|
|
|
|
432
|
-// Utils.getImgPath('arr_right_gray'),
|
|
|
|
433
|
-// width: ScreenUtil().setWidth(12),
|
|
|
|
434
|
-// height: ScreenUtil().setWidth(22),
|
|
|
|
435
|
-// )
|
|
|
|
436
|
-// ],
|
|
|
|
437
|
-// ),
|
|
|
|
438
|
-// ),
|
|
|
|
439
|
-// );
|
|
|
|
440
|
-// }
|
390
|
+ ///地图地址选择
|
|
|
|
391
|
+ Widget _select(String title, String hintText) {
|
|
|
|
392
|
+ return InkWell(
|
|
|
|
393
|
+ onTap: () {
|
|
|
|
394
|
+ Utils.getPickPermission(context, () async {
|
|
|
|
395
|
+ mapAddress = await NavigatorUtil.goMapChoicePointPage(context);
|
|
|
|
396
|
+ if (mapAddress != null) {
|
|
|
|
397
|
+ setState(() {
|
|
|
|
398
|
+ // storeMapAddress = address['address'];
|
|
|
|
399
|
+ // // createStoreModel.storeInfo?.address = storeAddress;
|
|
|
|
400
|
+ // // createStoreModel.storeInfo?.lat = address['lat'];
|
|
|
|
401
|
+ // // createStoreModel.storeInfo?.lng = address['lng'];
|
|
|
|
402
|
+ });
|
|
|
|
403
|
+ }
|
|
|
|
404
|
+ }, Permission.location);
|
|
|
|
405
|
+ },
|
|
|
|
406
|
+ child: Container(
|
|
|
|
407
|
+ child: Row(
|
|
|
|
408
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
409
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
410
|
+ children: [
|
|
|
|
411
|
+ Container(
|
|
|
|
412
|
+ child: Text(
|
|
|
|
413
|
+ title,
|
|
|
|
414
|
+ style: TextStyle(
|
|
|
|
415
|
+ color: MyColours.color_333333,
|
|
|
|
416
|
+ fontWeight: FontWeight.bold,
|
|
|
|
417
|
+ fontSize: ScreenUtil().setSp(34)),
|
|
|
|
418
|
+ ),
|
|
|
|
419
|
+ ),
|
|
|
|
420
|
+ HEmptyView(40),
|
|
|
|
421
|
+ Expanded(
|
|
|
|
422
|
+ child: Text(hintText,
|
|
|
|
423
|
+ textAlign: TextAlign.right,
|
|
|
|
424
|
+ style: TextStyle(
|
|
|
|
425
|
+ color: hintText == '点击选择'
|
|
|
|
426
|
+ ? MyColours.color_999999
|
|
|
|
427
|
+ : MyColours.color_333333,
|
|
|
|
428
|
+ fontSize: ScreenUtil().setSp(32),
|
|
|
|
429
|
+ ))),
|
|
|
|
430
|
+ HEmptyView(20),
|
|
|
|
431
|
+ Image.asset(
|
|
|
|
432
|
+ Utils.getImgPath('arr_right_gray'),
|
|
|
|
433
|
+ width: ScreenUtil().setWidth(12),
|
|
|
|
434
|
+ height: ScreenUtil().setWidth(22),
|
|
|
|
435
|
+ )
|
|
|
|
436
|
+ ],
|
|
|
|
437
|
+ ),
|
|
|
|
438
|
+ ),
|
|
|
|
439
|
+ );
|
|
|
|
440
|
+ }
|
|
441
|
|
441
|
|
|
442
|
-// @override
|
|
|
|
443
|
-// Widget build(BuildContext context) {
|
|
|
|
444
|
-// _uploadImageProvider =
|
|
|
|
445
|
-// Provider.of<UploadImageProvider>(context, listen: true);
|
|
|
|
446
|
-// _baseIndoProvider =
|
|
|
|
447
|
-// Provider.of<StoreBaseIndoProvider>(context, listen: true);
|
|
|
|
448
|
-// return Scaffold(
|
|
|
|
449
|
-// backgroundColor: MyColours.color_fefefe,
|
|
|
|
450
|
-// appBar: SystemAppBar(
|
|
|
|
451
|
-// '店铺信息',
|
|
|
|
452
|
-// onTap: () {
|
|
|
|
453
|
-// EventBus().emit('changeStatusColor');
|
|
|
|
454
|
-// Navigator.of(context).pop();
|
|
|
|
455
|
-// },
|
|
|
|
456
|
-// ),
|
|
|
|
457
|
-// body: WillPopScope(
|
|
|
|
458
|
-// onWillPop: () {
|
|
|
|
459
|
-// EventBus().emit('changeStatusColor');
|
|
|
|
460
|
-// Navigator.of(context).pop();
|
|
|
|
461
|
-// },
|
|
|
|
462
|
-// child: InkWell(
|
|
|
|
463
|
-// onTap: () {
|
|
|
|
464
|
-// FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
465
|
-// },
|
|
|
|
466
|
-// child: Column(children: [
|
|
|
|
467
|
-// Expanded(
|
|
|
|
468
|
-// child: SingleChildScrollView(
|
|
|
|
469
|
-// controller: _scrollController,
|
|
|
|
470
|
-// physics: BouncingScrollPhysics(),
|
|
|
|
471
|
-// child: Column(
|
|
|
|
472
|
-// children: [
|
|
|
|
473
|
-// Padding(
|
|
|
|
474
|
-// padding: EdgeInsets.symmetric(
|
|
|
|
475
|
-// horizontal: ScreenUtil().setWidth(40),
|
|
|
|
476
|
-// ),
|
|
|
|
477
|
-// child: _textfield('店铺名称', '请填写店铺名称',
|
|
|
|
478
|
-// _nameController, _nameFocusNode)),
|
|
|
|
479
|
-// VEmptyView(10),
|
|
|
|
480
|
-// _imageWidget('门头照片', _uploadImageProvider.mentou,
|
|
|
|
481
|
-// _uploadImageProvider.imgSizeMenTou, 64),
|
|
|
|
482
|
-// VEmptyView(30),
|
|
|
|
483
|
-// Container(
|
|
|
|
484
|
-// height: ScreenUtil().setWidth(2),
|
|
|
|
485
|
-// color: MyColours.color_efefef,
|
|
|
|
486
|
-// margin: EdgeInsets.only(
|
|
|
|
487
|
-// left: ScreenUtil().setWidth(108 * 2),
|
|
|
|
488
|
-// right: ScreenUtil().setWidth(40)),
|
|
|
|
489
|
-// ),
|
|
|
|
490
|
-// VEmptyView(10),
|
|
|
|
491
|
-// Padding(
|
|
|
|
492
|
-// padding: EdgeInsets.symmetric(
|
|
|
|
493
|
-// horizontal: ScreenUtil().setWidth(40),
|
|
|
|
494
|
-// ),
|
|
|
|
495
|
-// child: _textfield('店铺电话', '请填写店铺电话',
|
|
|
|
496
|
-// _phoneController, _phoneFocusNode)),
|
|
|
|
497
|
-// VEmptyView(10),
|
|
|
|
498
|
-// Container(
|
|
|
|
499
|
-// height: ScreenUtil().setWidth(2),
|
|
|
|
500
|
-// color: MyColours.color_efefef,
|
|
|
|
501
|
-// margin: EdgeInsets.only(
|
|
|
|
502
|
-// left: ScreenUtil().setWidth(108 * 2),
|
|
|
|
503
|
-// right: ScreenUtil().setWidth(40)),
|
|
|
|
504
|
-// ),
|
|
|
|
505
|
-// VEmptyView(10),
|
|
|
|
506
|
-// Padding(
|
|
|
|
507
|
-// padding: EdgeInsets.symmetric(
|
|
|
|
508
|
-// horizontal: ScreenUtil().setWidth(40),
|
|
|
|
509
|
-// ),
|
|
|
|
510
|
-// child: _textfield(
|
|
|
|
511
|
-// '营业时间',
|
|
|
|
512
|
-// '请填写营业时间,如09:00-23:00',
|
|
|
|
513
|
-// _timeController,
|
|
|
|
514
|
-// _timeFocusNode)),
|
|
|
|
515
|
-// VEmptyView(10),
|
|
|
|
516
|
-// Container(
|
|
|
|
517
|
-// height: ScreenUtil().setWidth(2),
|
|
|
|
518
|
-// color: MyColours.color_efefef,
|
|
|
|
519
|
-// margin: EdgeInsets.only(
|
|
|
|
520
|
-// left: ScreenUtil().setWidth(108 * 2),
|
|
|
|
521
|
-// right: ScreenUtil().setWidth(40)),
|
|
|
|
522
|
-// ),
|
|
|
|
523
|
-// VEmptyView(10),
|
|
|
|
524
|
-// Padding(
|
|
|
|
525
|
-// padding: EdgeInsets.symmetric(
|
|
|
|
526
|
-// horizontal: ScreenUtil().setWidth(40),
|
|
|
|
527
|
-// vertical: ScreenUtil().setWidth(40),
|
|
|
|
528
|
-// ),
|
|
|
|
529
|
-// child: _select('地图地址', mapAddress['address'])),
|
|
|
|
530
|
-// VEmptyView(10),
|
|
|
|
531
|
-// Container(
|
|
|
|
532
|
-// height: ScreenUtil().setWidth(2),
|
|
|
|
533
|
-// color: MyColours.color_efefef,
|
|
|
|
534
|
-// margin: EdgeInsets.only(
|
|
|
|
535
|
-// left: ScreenUtil().setWidth(108 * 2),
|
|
|
|
536
|
-// right: ScreenUtil().setWidth(40)),
|
|
|
|
537
|
-// ),
|
|
|
|
538
|
-// VEmptyView(10),
|
|
|
|
539
|
-// Padding(
|
|
|
|
540
|
-// padding: EdgeInsets.symmetric(
|
|
|
|
541
|
-// horizontal: ScreenUtil().setWidth(40),
|
|
|
|
542
|
-// ),
|
|
|
|
543
|
-// child: _textfield('详细地址', '请填写店铺详细地址',
|
|
|
|
544
|
-// _addressController, _addressFocusNode)),
|
|
|
|
545
|
-// VEmptyView(10),
|
|
|
|
546
|
-// Container(
|
|
|
|
547
|
-// height: ScreenUtil().setWidth(2),
|
|
|
|
548
|
-// color: MyColours.color_efefef,
|
|
|
|
549
|
-// margin: EdgeInsets.only(
|
|
|
|
550
|
-// left: ScreenUtil().setWidth(108 * 2),
|
|
|
|
551
|
-// right: ScreenUtil().setWidth(40)),
|
|
|
|
552
|
-// ),
|
|
|
|
553
|
-// VEmptyView(10),
|
|
|
|
554
|
-// Padding(
|
|
|
|
555
|
-// padding: EdgeInsets.symmetric(
|
|
|
|
556
|
-// horizontal: ScreenUtil().setWidth(40),
|
|
|
|
557
|
-// ),
|
|
|
|
558
|
-// child: _textfield(
|
|
|
|
559
|
-// '店铺简介',
|
|
|
|
560
|
-// '请填写店铺简介',
|
|
|
|
561
|
-// _introductionController,
|
|
|
|
562
|
-// _introductionFocusNode)),
|
|
|
|
563
|
-// VEmptyView(10),
|
|
|
|
564
|
-// ],
|
|
|
|
565
|
-// )),
|
|
|
|
566
|
-// ),
|
|
|
|
567
|
-// VEmptyView(20),
|
|
|
|
568
|
-// Padding(
|
|
|
|
569
|
-// padding: EdgeInsets.fromLTRB(ScreenUtil().setWidth(40), 0,
|
|
|
|
570
|
-// ScreenUtil().setWidth(40), ScreenUtil().setWidth(40)),
|
|
|
|
571
|
-// child: RoundButton(
|
|
|
|
572
|
-// onPressed: () {
|
|
|
|
573
|
-// //接口
|
|
|
|
574
|
-// _setSellerInfoById();
|
|
|
|
575
|
-// },
|
|
|
|
576
|
-// text: '保存',
|
|
|
|
577
|
-// fontSize: 34,
|
|
|
|
578
|
-// isBold: false,
|
|
|
|
579
|
-// height: ScreenUtil().setWidth(80),
|
|
|
|
580
|
-// width: double.infinity,
|
|
|
|
581
|
-// radius: ScreenUtil().setWidth(10),
|
|
|
|
582
|
-// ))
|
|
|
|
583
|
-// ]))));
|
|
|
|
584
|
-// }
|
|
|
|
585
|
-// } |
442
|
+ @override
|
|
|
|
443
|
+ Widget build(BuildContext context) {
|
|
|
|
444
|
+ _uploadImageProvider =
|
|
|
|
445
|
+ Provider.of<UploadImageProvider>(context, listen: true);
|
|
|
|
446
|
+ _baseIndoProvider =
|
|
|
|
447
|
+ Provider.of<StoreBaseIndoProvider>(context, listen: true);
|
|
|
|
448
|
+ return Scaffold(
|
|
|
|
449
|
+ backgroundColor: MyColours.color_fefefe,
|
|
|
|
450
|
+ appBar: SystemAppBar(
|
|
|
|
451
|
+ '店铺信息',
|
|
|
|
452
|
+ onTap: () {
|
|
|
|
453
|
+ EventBus().emit('changeStatusColor');
|
|
|
|
454
|
+ Navigator.of(context).pop();
|
|
|
|
455
|
+ },
|
|
|
|
456
|
+ ),
|
|
|
|
457
|
+ body: WillPopScope(
|
|
|
|
458
|
+ onWillPop: () {
|
|
|
|
459
|
+ EventBus().emit('changeStatusColor');
|
|
|
|
460
|
+ Navigator.of(context).pop();
|
|
|
|
461
|
+ },
|
|
|
|
462
|
+ child: InkWell(
|
|
|
|
463
|
+ onTap: () {
|
|
|
|
464
|
+ FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
465
|
+ },
|
|
|
|
466
|
+ child: Column(children: [
|
|
|
|
467
|
+ Expanded(
|
|
|
|
468
|
+ child: SingleChildScrollView(
|
|
|
|
469
|
+ controller: _scrollController,
|
|
|
|
470
|
+ physics: BouncingScrollPhysics(),
|
|
|
|
471
|
+ child: Column(
|
|
|
|
472
|
+ children: [
|
|
|
|
473
|
+ Padding(
|
|
|
|
474
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
475
|
+ horizontal: ScreenUtil().setWidth(40),
|
|
|
|
476
|
+ ),
|
|
|
|
477
|
+ child: _textfield('店铺名称', '请填写店铺名称',
|
|
|
|
478
|
+ _nameController, _nameFocusNode)),
|
|
|
|
479
|
+ VEmptyView(10),
|
|
|
|
480
|
+ _imageWidget('门头照片', _uploadImageProvider.mentou,
|
|
|
|
481
|
+ _uploadImageProvider.imgSizeMenTou, 64),
|
|
|
|
482
|
+ VEmptyView(30),
|
|
|
|
483
|
+ Container(
|
|
|
|
484
|
+ height: ScreenUtil().setWidth(2),
|
|
|
|
485
|
+ color: MyColours.color_efefef,
|
|
|
|
486
|
+ margin: EdgeInsets.only(
|
|
|
|
487
|
+ left: ScreenUtil().setWidth(108 * 2),
|
|
|
|
488
|
+ right: ScreenUtil().setWidth(40)),
|
|
|
|
489
|
+ ),
|
|
|
|
490
|
+ VEmptyView(10),
|
|
|
|
491
|
+ Padding(
|
|
|
|
492
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
493
|
+ horizontal: ScreenUtil().setWidth(40),
|
|
|
|
494
|
+ ),
|
|
|
|
495
|
+ child: _textfield('店铺电话', '请填写店铺电话',
|
|
|
|
496
|
+ _phoneController, _phoneFocusNode)),
|
|
|
|
497
|
+ VEmptyView(10),
|
|
|
|
498
|
+ Container(
|
|
|
|
499
|
+ height: ScreenUtil().setWidth(2),
|
|
|
|
500
|
+ color: MyColours.color_efefef,
|
|
|
|
501
|
+ margin: EdgeInsets.only(
|
|
|
|
502
|
+ left: ScreenUtil().setWidth(108 * 2),
|
|
|
|
503
|
+ right: ScreenUtil().setWidth(40)),
|
|
|
|
504
|
+ ),
|
|
|
|
505
|
+ VEmptyView(10),
|
|
|
|
506
|
+ Padding(
|
|
|
|
507
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
508
|
+ horizontal: ScreenUtil().setWidth(40),
|
|
|
|
509
|
+ ),
|
|
|
|
510
|
+ child: _textfield(
|
|
|
|
511
|
+ '营业时间',
|
|
|
|
512
|
+ '请填写营业时间,如09:00-23:00',
|
|
|
|
513
|
+ _timeController,
|
|
|
|
514
|
+ _timeFocusNode)),
|
|
|
|
515
|
+ VEmptyView(10),
|
|
|
|
516
|
+ Container(
|
|
|
|
517
|
+ height: ScreenUtil().setWidth(2),
|
|
|
|
518
|
+ color: MyColours.color_efefef,
|
|
|
|
519
|
+ margin: EdgeInsets.only(
|
|
|
|
520
|
+ left: ScreenUtil().setWidth(108 * 2),
|
|
|
|
521
|
+ right: ScreenUtil().setWidth(40)),
|
|
|
|
522
|
+ ),
|
|
|
|
523
|
+ VEmptyView(10),
|
|
|
|
524
|
+ Padding(
|
|
|
|
525
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
526
|
+ horizontal: ScreenUtil().setWidth(40),
|
|
|
|
527
|
+ vertical: ScreenUtil().setWidth(40),
|
|
|
|
528
|
+ ),
|
|
|
|
529
|
+ child: _select('地图地址', mapAddress['address'])),
|
|
|
|
530
|
+ VEmptyView(10),
|
|
|
|
531
|
+ Container(
|
|
|
|
532
|
+ height: ScreenUtil().setWidth(2),
|
|
|
|
533
|
+ color: MyColours.color_efefef,
|
|
|
|
534
|
+ margin: EdgeInsets.only(
|
|
|
|
535
|
+ left: ScreenUtil().setWidth(108 * 2),
|
|
|
|
536
|
+ right: ScreenUtil().setWidth(40)),
|
|
|
|
537
|
+ ),
|
|
|
|
538
|
+ VEmptyView(10),
|
|
|
|
539
|
+ Padding(
|
|
|
|
540
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
541
|
+ horizontal: ScreenUtil().setWidth(40),
|
|
|
|
542
|
+ ),
|
|
|
|
543
|
+ child: _textfield('详细地址', '请填写店铺详细地址',
|
|
|
|
544
|
+ _addressController, _addressFocusNode)),
|
|
|
|
545
|
+ VEmptyView(10),
|
|
|
|
546
|
+ Container(
|
|
|
|
547
|
+ height: ScreenUtil().setWidth(2),
|
|
|
|
548
|
+ color: MyColours.color_efefef,
|
|
|
|
549
|
+ margin: EdgeInsets.only(
|
|
|
|
550
|
+ left: ScreenUtil().setWidth(108 * 2),
|
|
|
|
551
|
+ right: ScreenUtil().setWidth(40)),
|
|
|
|
552
|
+ ),
|
|
|
|
553
|
+ VEmptyView(10),
|
|
|
|
554
|
+ Padding(
|
|
|
|
555
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
556
|
+ horizontal: ScreenUtil().setWidth(40),
|
|
|
|
557
|
+ ),
|
|
|
|
558
|
+ child: _textfield(
|
|
|
|
559
|
+ '店铺简介',
|
|
|
|
560
|
+ '请填写店铺简介',
|
|
|
|
561
|
+ _introductionController,
|
|
|
|
562
|
+ _introductionFocusNode)),
|
|
|
|
563
|
+ VEmptyView(10),
|
|
|
|
564
|
+ ],
|
|
|
|
565
|
+ )),
|
|
|
|
566
|
+ ),
|
|
|
|
567
|
+ VEmptyView(20),
|
|
|
|
568
|
+ Padding(
|
|
|
|
569
|
+ padding: EdgeInsets.fromLTRB(ScreenUtil().setWidth(40), 0,
|
|
|
|
570
|
+ ScreenUtil().setWidth(40), ScreenUtil().setWidth(40)),
|
|
|
|
571
|
+ child: RoundButton(
|
|
|
|
572
|
+ onPressed: () {
|
|
|
|
573
|
+ //接口
|
|
|
|
574
|
+ _setSellerInfoById();
|
|
|
|
575
|
+ },
|
|
|
|
576
|
+ text: '保存',
|
|
|
|
577
|
+ fontSize: 34,
|
|
|
|
578
|
+ isBold: false,
|
|
|
|
579
|
+ height: ScreenUtil().setWidth(80),
|
|
|
|
580
|
+ width: double.infinity,
|
|
|
|
581
|
+ radius: ScreenUtil().setWidth(10),
|
|
|
|
582
|
+ ))
|
|
|
|
583
|
+ ]))));
|
|
|
|
584
|
+ }
|
|
|
|
585
|
+} |