Commit f1b71c52dfce176ae8349274e71a9be5d11c30d0

Authored by wdn127929
1 parent e067aed2

修复图片上传bug、邀请函页面布局溢出bug

@@ -11,14 +11,14 @@ if (flutterRoot == null) { @@ -11,14 +11,14 @@ if (flutterRoot == null) {
11 throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 11 throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 } 12 }
13 13
14 -def flutterVersionCode = "201" 14 +def flutterVersionCode = "210"
15 if (flutterVersionCode == null) { 15 if (flutterVersionCode == null) {
16 - flutterVersionCode = '201' 16 + flutterVersionCode = '210'
17 } 17 }
18 18
19 -def flutterVersionName = "2.0.1" 19 +def flutterVersionName = "2.1.0"
20 if (flutterVersionName == null) { 20 if (flutterVersionName == null) {
21 - flutterVersionName = '2.0.1' 21 + flutterVersionName = '2.1.0'
22 } 22 }
23 23
24 apply plugin: 'com.android.application' 24 apply plugin: 'com.android.application'

198 KB | W: | H:

165 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
  1 +import 'package:json_annotation/json_annotation.dart';
  2 +
  3 +part 'seller_phone_model.g.dart';
  4 +
  5 +@JsonSerializable()
  6 +class SellerPhoneModel extends Object {
  7 + @JsonKey(name: 'ret')
  8 + int ret;
  9 +
  10 + @JsonKey(name: 'data')
  11 + List<SellerPhoneSunModel> data;
  12 +
  13 + @JsonKey(name: 'msg')
  14 + String msg;
  15 +
  16 + SellerPhoneModel(
  17 + this.ret,
  18 + this.data,
  19 + this.msg,
  20 + );
  21 +
  22 + factory SellerPhoneModel.fromJson(Map<String, dynamic> srcJson) =>
  23 + _$SellerPhoneModelFromJson(srcJson);
  24 +
  25 + Map<String, dynamic> toJson() => _$SellerPhoneModelToJson(this);
  26 +}
  27 +
  28 +@JsonSerializable()
  29 +class SellerPhoneSunModel extends Object {
  30 + @JsonKey(name: 'id')
  31 + String id;
  32 +
  33 + @JsonKey(name: 'sellerid')
  34 + String sellerid;
  35 +
  36 + @JsonKey(name: 'type')
  37 + String type;
  38 +
  39 + @JsonKey(name: 'image')
  40 + String image;
  41 +
  42 + @JsonKey(name: 'isShare')
  43 + String isShare;
  44 +
  45 + @JsonKey(name: 'cdate')
  46 + String cdate;
  47 +
  48 + SellerPhoneSunModel(
  49 + this.id,
  50 + this.sellerid,
  51 + this.type,
  52 + this.image,
  53 + this.isShare,
  54 + this.cdate,
  55 + );
  56 +
  57 + factory SellerPhoneSunModel.fromJson(Map<String, dynamic> srcJson) =>
  58 + _$SellerPhoneSunModelFromJson(srcJson);
  59 +
  60 + Map<String, dynamic> toJson() => _$SellerPhoneSunModelToJson(this);
  61 +}
  1 +// GENERATED CODE - DO NOT MODIFY BY HAND
  2 +
  3 +part of 'seller_phone_model.dart';
  4 +
  5 +// **************************************************************************
  6 +// JsonSerializableGenerator
  7 +// **************************************************************************
  8 +
  9 +SellerPhoneModel _$SellerPhoneModelFromJson(Map<String, dynamic> json) {
  10 + return SellerPhoneModel(
  11 + json['ret'] as int,
  12 + (json['data'] as List)
  13 + ?.map((e) => e == null
  14 + ? null
  15 + : SellerPhoneSunModel.fromJson(e as Map<String, dynamic>))
  16 + ?.toList(),
  17 + json['msg'] as String);
  18 +}
  19 +
  20 +Map<String, dynamic> _$SellerPhoneModelToJson(SellerPhoneModel instance) =>
  21 + <String, dynamic>{
  22 + 'ret': instance.ret,
  23 + 'data': instance.data,
  24 + 'msg': instance.msg
  25 + };
  26 +
  27 +SellerPhoneSunModel _$SellerPhoneSunModelFromJson(Map<String, dynamic> json) {
  28 + return SellerPhoneSunModel(
  29 + json['id'] as String,
  30 + json['sellerid'] as String,
  31 + json['type'] as String,
  32 + json['image'] as String,
  33 + json['isShare'] as String,
  34 + json['cdate'] as String);
  35 +}
  36 +
  37 +Map<String, dynamic> _$SellerPhoneSunModelToJson(
  38 + SellerPhoneSunModel instance) =>
  39 + <String, dynamic>{
  40 + 'id': instance.id,
  41 + 'sellerid': instance.sellerid,
  42 + 'type': instance.type,
  43 + 'image': instance.image,
  44 + 'isShare': instance.isShare,
  45 + 'cdate': instance.cdate
  46 + };
@@ -85,5 +85,7 @@ class HttpUrl { @@ -85,5 +85,7 @@ class HttpUrl {
85 "?service=App.Activity.SetCustomerActivityBaseinfo"; //客户经理添加/修改基本信息 85 "?service=App.Activity.SetCustomerActivityBaseinfo"; //客户经理添加/修改基本信息
86 static const String get_customer_activity_baseinfo = 86 static const String get_customer_activity_baseinfo =
87 "?service=App.Activity.GetCustomerActivityBaseinfo"; //客户经理获取基本信息 87 "?service=App.Activity.GetCustomerActivityBaseinfo"; //客户经理获取基本信息
  88 + static const String get_seller_photo_by_id =
  89 + "?service=App.Photo.getSellerPhotoById"; //查看商家图片
88 90
89 } 91 }
  1 +import 'package:cached_network_image/cached_network_image.dart';
  2 +import 'package:common_utils/common_utils.dart';
1 import 'package:flutter/material.dart'; 3 import 'package:flutter/material.dart';
2 import 'package:flutter_screenutil/flutter_screenutil.dart'; 4 import 'package:flutter_screenutil/flutter_screenutil.dart';
  5 +import 'package:one_key/models/seller_phone_model.dart';
3 import 'package:one_key/models/user.dart'; 6 import 'package:one_key/models/user.dart';
  7 +import 'package:one_key/pages/online_check/photo_view_wiget.dart';
  8 +import 'package:one_key/provider/base_info_provider.dart';
4 import 'package:one_key/provider/coupon_provider.dart'; 9 import 'package:one_key/provider/coupon_provider.dart';
5 import 'package:one_key/provider/user_model.dart'; 10 import 'package:one_key/provider/user_model.dart';
6 import 'package:one_key/res/colors.dart'; 11 import 'package:one_key/res/colors.dart';
@@ -35,6 +40,11 @@ class InvicationPageState extends State<InvicationPage> { @@ -35,6 +40,11 @@ class InvicationPageState extends State<InvicationPage> {
35 ScrollController controller = ScrollController(); 40 ScrollController controller = ScrollController();
36 double couponHeight = 180.0; 41 double couponHeight = 180.0;
37 CouponProvider couponProvider; 42 CouponProvider couponProvider;
  43 + BaseIndoProvider _baseIndoProvider;
  44 + String name = '请填写姓名';
  45 + String position = '请填写职位';
  46 + String phone = '请填写电话';
  47 + String qiniuUrl = '';
38 48
39 @override 49 @override
40 void initState() { 50 void initState() {
@@ -42,6 +52,8 @@ class InvicationPageState extends State<InvicationPage> { @@ -42,6 +52,8 @@ class InvicationPageState extends State<InvicationPage> {
42 52
43 WidgetsBinding.instance.addPostFrameCallback((_) { 53 WidgetsBinding.instance.addPostFrameCallback((_) {
44 _getActivityByRid(); 54 _getActivityByRid();
  55 + _getCustomerActivityBaseinfo();
  56 + _getSellerPhotoById();
45 }); 57 });
46 Utils.changeStatusColor(color: Colors.transparent); 58 Utils.changeStatusColor(color: Colors.transparent);
47 dateTime = 59 dateTime =
@@ -51,6 +63,37 @@ class InvicationPageState extends State<InvicationPage> { @@ -51,6 +63,37 @@ class InvicationPageState extends State<InvicationPage> {
51 "${dateTime.year}/${Utils.addZeroNumber(dateTime.month)}/${Utils.addZeroNumber(dateTime.day)} 星期${Utils.formatWeekDayNum(dateTime.weekday)} ${widget.ddateStr}"; 63 "${dateTime.year}/${Utils.addZeroNumber(dateTime.month)}/${Utils.addZeroNumber(dateTime.day)} 星期${Utils.formatWeekDayNum(dateTime.weekday)} ${widget.ddateStr}";
52 } 64 }
53 65
  66 + _getSellerPhotoById() async {
  67 + Map<String, String> params = {
  68 + 'sellerid': Provider.of<UserModel>(context, listen: false).user.sellerid,
  69 + "type": '2',
  70 + };
  71 + bool success = await _baseIndoProvider.getSellerPhotoById(context, params);
  72 + }
  73 +
  74 + _getCustomerActivityBaseinfo() async {
  75 + Map<String, String> params = {
  76 + 'sellerid': Provider.of<UserModel>(context, listen: false).user.sellerid,
  77 + "uid": Provider.of<UserModel>(context, listen: false).user.openid,
  78 + };
  79 + bool success =
  80 + await _baseIndoProvider.getCustomerActivityBaseinfo(context, params);
  81 + if (success) {
  82 + name = _baseIndoProvider.baseInfoSunModel.name;
  83 + qiniuUrl = _baseIndoProvider.baseInfoSunModel.photo;
  84 + // _uploadImageProvider.erweima.qiniuUrl =
  85 + // _baseIndoProvider.baseInfoSunModel.qrcode;
  86 + phone = _baseIndoProvider.baseInfoSunModel.phone;
  87 + position = _baseIndoProvider.baseInfoSunModel.position;
  88 + setState(() {});
  89 + } else {
  90 + // name = '请填写姓名';
  91 + // position = '请填写职位';
  92 + // phone = '请填写电话';
  93 + // qiniuUrl = '';
  94 + }
  95 + }
  96 +
54 _getActivityByRid() async { 97 _getActivityByRid() async {
55 Map<String, String> params = { 98 Map<String, String> params = {
56 "rid": widget.rid, 99 "rid": widget.rid,
@@ -140,10 +183,50 @@ class InvicationPageState extends State<InvicationPage> { @@ -140,10 +183,50 @@ class InvicationPageState extends State<InvicationPage> {
140 ); 183 );
141 } 184 }
142 185
  186 + _goBaseInfoPage() async {
  187 + bool needRefresh = await NavigatorUtil.goBaseInfoPage(context);
  188 + if (needRefresh != null && needRefresh) {
  189 + //刷新页面数据
  190 + _getCustomerActivityBaseinfo();
  191 + }
  192 + }
  193 +
  194 + //查看大图
  195 + _showPhotoView(BuildContext context, int index, List imgs,
  196 + {isShow = false, List dashName}) async {
  197 + // if (imgs.length == 1 &&
  198 + // imgs[0] ==
  199 + // 'http://nosqn.colorcun.com/custom/lite-online/image/def-banner.png') {
  200 + // imgs[0] = 'http://nosqn.colorcun.com/app/seller-hj-empty.png';
  201 + // }
  202 + Utils.setBarStatus(false, color: Colors.black);
  203 + dynamic result = await showGeneralDialog(
  204 + context: context,
  205 + barrierDismissible: false,
  206 + // barrierColor: Colors.red,
  207 + barrierLabel:
  208 + MaterialLocalizations.of(context).modalBarrierDismissLabel,
  209 + transitionDuration: const Duration(milliseconds: 150),
  210 + pageBuilder: (BuildContext context, Animation animation,
  211 + Animation secondaryAnimation) {
  212 + Widget child = Stack(
  213 + children: <Widget>[
  214 + PhotoPreview(
  215 + initialIndex: index,
  216 + photoList: imgs,
  217 + isShow: isShow,
  218 + dashName: dashName)
  219 + ],
  220 + );
  221 + return child;
  222 + });
  223 + Utils.setBarStatus(true, color: Colors.white);
  224 + }
  225 +
143 @override 226 @override
144 Widget build(BuildContext context) { 227 Widget build(BuildContext context) {
145 // TODO: implement build 228 // TODO: implement build
146 - 229 + _baseIndoProvider = Provider.of<BaseIndoProvider>(context, listen: true);
147 couponProvider = Provider.of<CouponProvider>(context, listen: true); 230 couponProvider = Provider.of<CouponProvider>(context, listen: true);
148 return Container( 231 return Container(
149 width: double.infinity, 232 width: double.infinity,
@@ -157,7 +240,8 @@ class InvicationPageState extends State<InvicationPage> { @@ -157,7 +240,8 @@ class InvicationPageState extends State<InvicationPage> {
157 body: SafeArea( 240 body: SafeArea(
158 child: Stack( 241 child: Stack(
159 children: [ 242 children: [
160 - Padding( 243 + Container(
  244 + margin: EdgeInsets.only(top: ScreenUtil().setWidth(10 * 2)),
161 padding: 245 padding:
162 EdgeInsets.only(top: ScreenUtil().setWidth(35 * 2)), 246 EdgeInsets.only(top: ScreenUtil().setWidth(35 * 2)),
163 child: Column(children: [ 247 child: Column(children: [
@@ -172,14 +256,14 @@ class InvicationPageState extends State<InvicationPage> { @@ -172,14 +256,14 @@ class InvicationPageState extends State<InvicationPage> {
172 Image.asset( 256 Image.asset(
173 "assets/img_ydap.png", 257 "assets/img_ydap.png",
174 width: ScreenUtil().setWidth(220 * 2), 258 width: ScreenUtil().setWidth(220 * 2),
175 - height: ScreenUtil().setHeight(120 * 2), 259 + height: ScreenUtil().setHeight(98 * 2),
176 ), 260 ),
177 - VEmptyView(20), 261 + VEmptyView(10),
178 Container( 262 Container(
179 margin: EdgeInsets.symmetric( 263 margin: EdgeInsets.symmetric(
180 horizontal: ScreenUtil().setWidth(40)), 264 horizontal: ScreenUtil().setWidth(40)),
181 - padding: EdgeInsets.all(  
182 - ScreenUtil().setWidth(60)), 265 + // padding: EdgeInsets.all(
  266 + // ScreenUtil().setWidth(60)),
183 decoration: BoxDecoration( 267 decoration: BoxDecoration(
184 gradient: LinearGradient( 268 gradient: LinearGradient(
185 begin: Alignment.topCenter, 269 begin: Alignment.topCenter,
@@ -196,8 +280,186 @@ class InvicationPageState extends State<InvicationPage> { @@ -196,8 +280,186 @@ class InvicationPageState extends State<InvicationPage> {
196 CrossAxisAlignment.center, 280 CrossAxisAlignment.center,
197 children: [ 281 children: [
198 Container( 282 Container(
199 - color: Colors.red,  
200 - height: 160, 283 + width:
  284 + ScreenUtil().setWidth(335 * 2),
  285 + height:
  286 + ScreenUtil().setWidth(200 * 2),
  287 + decoration: BoxDecoration(
  288 + image: DecorationImage(
  289 + alignment:
  290 + Alignment.topCenter,
  291 + image: AssetImage(
  292 + "assets/yd_baiinfo_bg.png"),
  293 + fit: BoxFit.cover),
  294 + ),
  295 + child: Row(
  296 + crossAxisAlignment:
  297 + CrossAxisAlignment.start,
  298 + children: [
  299 + Padding(
  300 + padding: EdgeInsets.only(
  301 + top: ScreenUtil()
  302 + .setWidth(20),
  303 + left: ScreenUtil()
  304 + .setWidth(60)),
  305 + child: qiniuUrl == ''
  306 + ? Image.asset(
  307 + Utils.getImgPath(
  308 + 'person'),
  309 + width: ScreenUtil().setWidth(
  310 + 143 * 2),
  311 + height: ScreenUtil()
  312 + .setWidth(
  313 + 190 * 2))
  314 + : Image.network(qiniuUrl,
  315 + width: ScreenUtil()
  316 + .setWidth(
  317 + 143 * 2),
  318 + height: ScreenUtil()
  319 + .setWidth(190 * 2)),
  320 + ),
  321 + HEmptyView(10),
  322 + Spacer(),
  323 + Container(
  324 + height: ScreenUtil()
  325 + .setWidth(200 * 2),
  326 + child: Column(
  327 + mainAxisAlignment:
  328 + MainAxisAlignment
  329 + .start,
  330 + crossAxisAlignment:
  331 + CrossAxisAlignment
  332 + .start,
  333 + children: [
  334 + VEmptyView(60),
  335 + GestureDetector(
  336 + behavior:
  337 + HitTestBehavior
  338 + .opaque,
  339 + onTap: () {
  340 + _goBaseInfoPage();
  341 + },
  342 + child: Container(
  343 + width: ScreenUtil()
  344 + .setWidth(
  345 + 100 * 2),
  346 + height: ScreenUtil()
  347 + .setWidth(
  348 + 24 * 2),
  349 + child: Text(
  350 + name,
  351 + overflow:
  352 + TextOverflow
  353 + .ellipsis,
  354 + style: TextStyle(
  355 + fontWeight:
  356 + FontWeight
  357 + .bold,
  358 + color: MyColours
  359 + .color_794F28,
  360 + fontSize:
  361 + ScreenUtil()
  362 + .setSp(
  363 + 36)),
  364 + ),
  365 + ),
  366 + ),
  367 + VEmptyView(6),
  368 + InkWell(
  369 + onTap: () {
  370 + _goBaseInfoPage();
  371 + },
  372 + child: Container(
  373 + width: ScreenUtil()
  374 + .setWidth(
  375 + 100 * 2),
  376 + height:
  377 + ScreenUtil()
  378 + .setWidth(
  379 + 18 *
  380 + 2),
  381 + child: Text(
  382 + position,
  383 + overflow:
  384 + TextOverflow
  385 + .ellipsis,
  386 + style: TextStyle(
  387 + color: MyColours
  388 + .color_794F28,
  389 + fontSize: ScreenUtil()
  390 + .setSp(
  391 + 28)),
  392 + ),
  393 + )),
  394 + VEmptyView(6),
  395 + InkWell(
  396 + onTap: () {
  397 + _goBaseInfoPage();
  398 + },
  399 + child: Container(
  400 + width: ScreenUtil()
  401 + .setWidth(
  402 + 100 * 2),
  403 + height:
  404 + ScreenUtil()
  405 + .setWidth(
  406 + 18 *
  407 + 2),
  408 + child: Text(
  409 + phone,
  410 + overflow:
  411 + TextOverflow
  412 + .ellipsis,
  413 + style: TextStyle(
  414 + color: MyColours
  415 + .color_794F28,
  416 + fontSize: ScreenUtil()
  417 + .setSp(
  418 + 28)),
  419 + ),
  420 + )),
  421 + VEmptyView(14),
  422 + RoundButton(
  423 + height: ScreenUtil()
  424 + .setWidth(94 * 2),
  425 + image:
  426 + Utils.getImgPath(
  427 + 'yd_bianji'),
  428 + imgWidth: 24,
  429 + space: ScreenUtil()
  430 + .setWidth(20),
  431 + text: '编辑',
  432 + textColor: MyColours
  433 + .color_794F28,
  434 + isBold: false,
  435 + fontSize: 28,
  436 + gradientStart: Colors
  437 + .transparent,
  438 + gradientEnd: Colors
  439 + .transparent,
  440 + onPressed: () {
  441 + _goBaseInfoPage();
  442 + },
  443 + )
  444 + ],
  445 + )),
  446 + HEmptyView(60),
  447 + ],
  448 + )),
  449 + // Positioned(
  450 + // bottom: 0,
  451 + // child: Container(
  452 + // color: MyColours.color_EEDBC4,
  453 + // width: double.infinity,
  454 + // height:
  455 + // ScreenUtil().setWidth(40),
  456 + // ))
  457 + // ],
  458 + // ),
  459 + Container(
  460 + color: MyColours.color_EEDBC4,
  461 + width: double.infinity,
  462 + height: ScreenUtil().setWidth(40),
201 ), 463 ),
202 VEmptyView(40), 464 VEmptyView(40),
203 Image.asset( 465 Image.asset(
@@ -206,7 +468,7 @@ class InvicationPageState extends State<InvicationPage> { @@ -206,7 +468,7 @@ class InvicationPageState extends State<InvicationPage> {
206 height: 468 height:
207 ScreenUtil().setHeight(33 * 2), 469 ScreenUtil().setHeight(33 * 2),
208 ), 470 ),
209 - VEmptyView(60), 471 + VEmptyView(50),
210 Container( 472 Container(
211 height: ScreenUtil().setWidth(48), 473 height: ScreenUtil().setWidth(48),
212 child: Text( 474 child: Text(
@@ -217,7 +479,7 @@ class InvicationPageState extends State<InvicationPage> { @@ -217,7 +479,7 @@ class InvicationPageState extends State<InvicationPage> {
217 color: MyColours.color_794F28, 479 color: MyColours.color_794F28,
218 fontWeight: FontWeight.bold, 480 fontWeight: FontWeight.bold,
219 fontSize: 481 fontSize:
220 - ScreenUtil().setSp(34)), 482 + ScreenUtil().setSp(36)),
221 ), 483 ),
222 ), 484 ),
223 VEmptyView(30), 485 VEmptyView(30),
@@ -230,7 +492,7 @@ class InvicationPageState extends State<InvicationPage> { @@ -230,7 +492,7 @@ class InvicationPageState extends State<InvicationPage> {
230 .setWidth(1.7 * 2), 492 .setWidth(1.7 * 2),
231 color: MyColours.color_C19E5B, 493 color: MyColours.color_C19E5B,
232 fontSize: 494 fontSize:
233 - ScreenUtil().setSp(26)), 495 + ScreenUtil().setSp(28)),
234 ), 496 ),
235 ), 497 ),
236 VEmptyView(12), 498 VEmptyView(12),
@@ -257,7 +519,7 @@ class InvicationPageState extends State<InvicationPage> { @@ -257,7 +519,7 @@ class InvicationPageState extends State<InvicationPage> {
257 MyColours.color_794F28, 519 MyColours.color_794F28,
258 fontWeight: FontWeight.bold, 520 fontWeight: FontWeight.bold,
259 fontSize: 521 fontSize:
260 - ScreenUtil().setSp(34)), 522 + ScreenUtil().setSp(42)),
261 ), 523 ),
262 ), 524 ),
263 Image.asset( 525 Image.asset(
@@ -269,19 +531,46 @@ class InvicationPageState extends State<InvicationPage> { @@ -269,19 +531,46 @@ class InvicationPageState extends State<InvicationPage> {
269 ), 531 ),
270 ], 532 ],
271 ), 533 ),
272 - VEmptyView(18),  
273 - RoundButton(  
274 - text: '浏览照片',  
275 - width: ScreenUtil().setWidth(68 * 2),  
276 - height: ScreenUtil().setWidth(24 * 2),  
277 - fontSize: 24,  
278 - textColor: MyColours.color_794F28,  
279 - isBold: false,  
280 - gradientStart:  
281 - Color.fromRGBO(121, 79, 40, 0.1),  
282 - gradientEnd:  
283 - Color.fromRGBO(121, 79, 40, 0.1),  
284 - ), 534 + _baseIndoProvider.photoList.length > 0
  535 + ? VEmptyView(18)
  536 + : Container(),
  537 + _baseIndoProvider.photoList.length > 0
  538 + ? RoundButton(
  539 + onPressed: () {
  540 + List<String> temp = [];
  541 + if (_baseIndoProvider
  542 + .photoList.length >
  543 + 0) {
  544 + for (int i = 0;
  545 + i <
  546 + _baseIndoProvider
  547 + .photoList
  548 + .length;
  549 + i++) {
  550 + temp.add(_baseIndoProvider
  551 + .photoList[i].image);
  552 + }
  553 +
  554 + ///没有上传完成的不可以点击
  555 + _showPhotoView(
  556 + context, 0, temp);
  557 + }
  558 + },
  559 + text: '浏览照片',
  560 + width: ScreenUtil()
  561 + .setWidth(68 * 2),
  562 + height: ScreenUtil()
  563 + .setWidth(24 * 2),
  564 + fontSize: 26,
  565 + textColor:
  566 + MyColours.color_794F28,
  567 + isBold: false,
  568 + gradientStart: Color.fromRGBO(
  569 + 121, 79, 40, 0.1),
  570 + gradientEnd: Color.fromRGBO(
  571 + 121, 79, 40, 0.1),
  572 + )
  573 + : Container(),
285 VEmptyView(60), 574 VEmptyView(60),
286 Container( 575 Container(
287 height: ScreenUtil().setWidth(40), 576 height: ScreenUtil().setWidth(40),
@@ -293,7 +582,7 @@ class InvicationPageState extends State<InvicationPage> { @@ -293,7 +582,7 @@ class InvicationPageState extends State<InvicationPage> {
293 color: MyColours.color_794F28, 582 color: MyColours.color_794F28,
294 fontWeight: FontWeight.bold, 583 fontWeight: FontWeight.bold,
295 fontSize: 584 fontSize:
296 - ScreenUtil().setSp(28)), 585 + ScreenUtil().setSp(30)),
297 ), 586 ),
298 ), 587 ),
299 VEmptyView(20), 588 VEmptyView(20),
@@ -310,7 +599,7 @@ class InvicationPageState extends State<InvicationPage> { @@ -310,7 +599,7 @@ class InvicationPageState extends State<InvicationPage> {
310 color: MyColours.color_794F28, 599 color: MyColours.color_794F28,
311 fontWeight: FontWeight.bold, 600 fontWeight: FontWeight.bold,
312 fontSize: 601 fontSize:
313 - ScreenUtil().setSp(28)), 602 + ScreenUtil().setSp(30)),
314 ), 603 ),
315 ), 604 ),
316 // VEmptyView(20), 605 // VEmptyView(20),
@@ -326,13 +615,14 @@ class InvicationPageState extends State<InvicationPage> { @@ -326,13 +615,14 @@ class InvicationPageState extends State<InvicationPage> {
326 // gradientEnd: 615 // gradientEnd:
327 // Color.fromRGBO(121, 79, 40, 0.1), 616 // Color.fromRGBO(121, 79, 40, 0.1),
328 // ), 617 // ),
329 - VEmptyView(60), 618 + VEmptyView(50),
330 Image.asset( 619 Image.asset(
331 "assets/yd_down.png", 620 "assets/yd_down.png",
332 width: ScreenUtil().setWidth(195 * 2), 621 width: ScreenUtil().setWidth(195 * 2),
333 height: 622 height:
334 ScreenUtil().setHeight(33 * 2), 623 ScreenUtil().setHeight(33 * 2),
335 ), 624 ),
  625 + VEmptyView(60),
336 ], 626 ],
337 ), 627 ),
338 ) 628 )
@@ -375,6 +665,36 @@ class InvicationPageState extends State<InvicationPage> { @@ -375,6 +665,36 @@ class InvicationPageState extends State<InvicationPage> {
375 Expanded( 665 Expanded(
376 child: GestureDetector( 666 child: GestureDetector(
377 onTap: () async { 667 onTap: () async {
  668 + if (ObjectUtil.isEmpty(
  669 + _baseIndoProvider.baseInfoSunModel)) {
  670 + Utils.showToast('请输入个人资料');
  671 + return;
  672 + }
  673 + if (ObjectUtil.isEmpty(_baseIndoProvider
  674 + .baseInfoSunModel.name)) {
  675 + Utils.showToast('请填写您的姓名');
  676 + return;
  677 + }
  678 + if (ObjectUtil.isEmpty(_baseIndoProvider
  679 + .baseInfoSunModel.phone)) {
  680 + Utils.showToast('请填写您的联系电话');
  681 + return;
  682 + }
  683 + if (ObjectUtil.isEmpty(_baseIndoProvider
  684 + .baseInfoSunModel.position)) {
  685 + Utils.showToast('请填写您在餐厅中的职位');
  686 + return;
  687 + }
  688 + if (ObjectUtil.isEmpty(_baseIndoProvider
  689 + .baseInfoSunModel.phone)) {
  690 + Utils.showToast('请上传您的头像');
  691 + return;
  692 + }
  693 + if (ObjectUtil.isEmpty(_baseIndoProvider
  694 + .baseInfoSunModel.qrcode)) {
  695 + Utils.showToast('请上传您的微信二维码');
  696 + return;
  697 + }
378 if (!couponProvider.hasModify && 698 if (!couponProvider.hasModify &&
379 couponProvider.coupons.length > 0) { 699 couponProvider.coupons.length > 0) {
380 Map<String, String> params = { 700 Map<String, String> params = {
@@ -386,9 +706,14 @@ class InvicationPageState extends State<InvicationPage> { @@ -386,9 +706,14 @@ class InvicationPageState extends State<InvicationPage> {
386 .setActivityAsReserve(context, params); 706 .setActivityAsReserve(context, params);
387 if (isSuc) { 707 if (isSuc) {
388 couponProvider.hasModify = true; 708 couponProvider.hasModify = true;
  709 +
389 bool isSuccess = 710 bool isSuccess =
390 await Utils.goShareInvicationToWeChat( 711 await Utils.goShareInvicationToWeChat(
391 - widget.rid); 712 + widget.rid,
  713 + Provider.of<UserModel>(context,
  714 + listen: false)
  715 + .user
  716 + .openid);
392 print(isSuccess); 717 print(isSuccess);
393 // couponProvider.couponsShow = []; 718 // couponProvider.couponsShow = [];
394 // couponProvider.couponsShow 719 // couponProvider.couponsShow
@@ -399,7 +724,11 @@ class InvicationPageState extends State<InvicationPage> { @@ -399,7 +724,11 @@ class InvicationPageState extends State<InvicationPage> {
399 } else { 724 } else {
400 bool isSuccess = 725 bool isSuccess =
401 await Utils.goShareInvicationToWeChat( 726 await Utils.goShareInvicationToWeChat(
402 - widget.rid); 727 + widget.rid,
  728 + Provider.of<UserModel>(context,
  729 + listen: false)
  730 + .user
  731 + .openid);
403 print(isSuccess); 732 print(isSuccess);
404 } 733 }
405 }, 734 },
@@ -75,7 +75,8 @@ class _BaseInfoPageState extends State<BaseInfoPage> { @@ -75,7 +75,8 @@ class _BaseInfoPageState extends State<BaseInfoPage> {
75 _phoneController.text = _baseIndoProvider.baseInfoSunModel.phone; 75 _phoneController.text = _baseIndoProvider.baseInfoSunModel.phone;
76 _positionController.text = _baseIndoProvider.baseInfoSunModel.position; 76 _positionController.text = _baseIndoProvider.baseInfoSunModel.position;
77 _uploadImageProvider.imgSizeErweima = 64; 77 _uploadImageProvider.imgSizeErweima = 64;
78 - setState(() {}); 78 + // setState(() {});
  79 + _uploadImageProvider.notifyListeners();
79 } 80 }
80 } 81 }
81 82
@@ -97,9 +98,14 @@ class _BaseInfoPageState extends State<BaseInfoPage> { @@ -97,9 +98,14 @@ class _BaseInfoPageState extends State<BaseInfoPage> {
97 "position": _positionController.text, 98 "position": _positionController.text,
98 "qrcode": _uploadImageProvider.erweima.qiniuUrl, 99 "qrcode": _uploadImageProvider.erweima.qiniuUrl,
99 }; 100 };
  101 + if (_baseIndoProvider.baseInfoSunModel != null) {
  102 + params['id'] = _baseIndoProvider.baseInfoSunModel.id;
  103 + }
100 bool isSuccess = 104 bool isSuccess =
101 await _baseIndoProvider.setCustomerActivityBaseinfo(context, params); 105 await _baseIndoProvider.setCustomerActivityBaseinfo(context, params);
102 if (isSuccess) { 106 if (isSuccess) {
  107 + _uploadImageProvider.touxiang.file = null;
  108 + _uploadImageProvider.erweima.file = null;
103 //成功之后跳回前一个页面 109 //成功之后跳回前一个页面
104 // bus.emit('refresh_coupon_list'); 110 // bus.emit('refresh_coupon_list');
105 Utils.showToast('保存成功'); 111 Utils.showToast('保存成功');
@@ -211,9 +217,13 @@ class _BaseInfoPageState extends State<BaseInfoPage> { @@ -211,9 +217,13 @@ class _BaseInfoPageState extends State<BaseInfoPage> {
211 } 217 }
212 }); 218 });
213 if (pickedFile != null) { 219 if (pickedFile != null) {
214 - title == '头像'  
215 - ? _uploadImageProvider.imgSizeTouxiang = 64  
216 - : _uploadImageProvider.imgSizeErweima = 64; 220 + if (title == '头像') {
  221 + _uploadImageProvider.imgSizeTouxiang = 64;
  222 + _uploadImageProvider.touxiang.qiniuUrl = null;
  223 + } else {
  224 + _uploadImageProvider.imgSizeErweima = 64;
  225 + _uploadImageProvider.erweima.qiniuUrl = null;
  226 + }
217 UploadImageUtil().startUploadOnly(context, File(pickedFile.path), 227 UploadImageUtil().startUploadOnly(context, File(pickedFile.path),
218 title == '头像' ? 0 : 1, true, _uploadImageProvider); 228 title == '头像' ? 0 : 1, true, _uploadImageProvider);
219 } 229 }
@@ -268,9 +278,9 @@ class _BaseInfoPageState extends State<BaseInfoPage> { @@ -268,9 +278,9 @@ class _BaseInfoPageState extends State<BaseInfoPage> {
268 borderRadius: 278 borderRadius:
269 BorderRadius.circular(ScreenUtil().setWidth(radius)), 279 BorderRadius.circular(ScreenUtil().setWidth(radius)),
270 child: model.file == null 280 child: model.file == null
271 - ? model.qiniuUrl != null  
272 - ? CachedNetworkImage(  
273 - imageUrl: model.qiniuUrl, 281 + ? model.qiniuUrl != null && model.qiniuUrl != ''
  282 + ? Image.network(
  283 + model.qiniuUrl,
274 fit: BoxFit.cover, 284 fit: BoxFit.cover,
275 width: ScreenUtil().setWidth(imgSize * 2), 285 width: ScreenUtil().setWidth(imgSize * 2),
276 height: ScreenUtil().setWidth(imgSize * 2), 286 height: ScreenUtil().setWidth(imgSize * 2),
@@ -290,20 +300,19 @@ class _BaseInfoPageState extends State<BaseInfoPage> { @@ -290,20 +300,19 @@ class _BaseInfoPageState extends State<BaseInfoPage> {
290 ), 300 ),
291 ), 301 ),
292 ), 302 ),
293 - model.file == null && model.qiniuUrl == null  
294 - ? Offstage(  
295 - offstage: model.process == 1,  
296 - child: Container(  
297 - width: ScreenUtil().setWidth(imgSize * 2),  
298 - height: ScreenUtil().setWidth(imgSize * 2),  
299 - decoration: BoxDecoration(  
300 - borderRadius: BorderRadius.circular(radius),  
301 - color: Color.fromRGBO(0, 0, 0, 0.2)),  
302 - child: Center(  
303 - child: Text('上传中',  
304 - style:  
305 - TextStyle(color: MyColours.color_333333)),  
306 - ), 303 + (model.file != null) &&
  304 + model.process != 1 &&
  305 + model.process != 0.01
  306 + ? Container(
  307 + width: ScreenUtil().setWidth(imgSize * 2),
  308 + height: ScreenUtil().setWidth(imgSize * 2),
  309 + decoration: BoxDecoration(
  310 + borderRadius: BorderRadius.circular(radius),
  311 + color: Color.fromRGBO(0, 0, 0, 0.2)),
  312 + child: Center(
  313 + child: Text('上传中',
  314 + style:
  315 + TextStyle(color: MyColours.color_333333)),
307 ), 316 ),
308 ) 317 )
309 : Container(), 318 : Container(),
@@ -420,7 +429,7 @@ class _BaseInfoPageState extends State<BaseInfoPage> { @@ -420,7 +429,7 @@ class _BaseInfoPageState extends State<BaseInfoPage> {
420 } 429 }
421 if (_uploadImageProvider.erweima.qiniuUrl.trim().length == 430 if (_uploadImageProvider.erweima.qiniuUrl.trim().length ==
422 0) { 431 0) {
423 - Utils.showToast('请上传头像'); 432 + Utils.showToast('请上传二维码');
424 return; 433 return;
425 } 434 }
426 435
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
2 import 'package:one_key/constant/constant.dart'; 2 import 'package:one_key/constant/constant.dart';
3 import 'package:one_key/constant/error.dart'; 3 import 'package:one_key/constant/error.dart';
4 import 'package:one_key/models/base_info_model.dart'; 4 import 'package:one_key/models/base_info_model.dart';
  5 +import 'package:one_key/models/seller_phone_model.dart';
5 import 'package:one_key/net/base_resp.dart'; 6 import 'package:one_key/net/base_resp.dart';
6 import 'package:one_key/net/dio_util.dart'; 7 import 'package:one_key/net/dio_util.dart';
7 import 'package:one_key/net/http_url.dart'; 8 import 'package:one_key/net/http_url.dart';
@@ -9,6 +10,9 @@ import 'package:one_key/utils/utils.dart'; @@ -9,6 +10,9 @@ import 'package:one_key/utils/utils.dart';
9 10
10 class BaseIndoProvider with ChangeNotifier { 11 class BaseIndoProvider with ChangeNotifier {
11 BaseInfoSunModel baseInfoSunModel; //客户经理基础信息 12 BaseInfoSunModel baseInfoSunModel; //客户经理基础信息
  13 + List<SellerPhoneSunModel> photoList = []; //商家图片信息
  14 +
  15 +
12 16
13 ///客户经理添加/修改基本信息 17 ///客户经理添加/修改基本信息
14 Future<dynamic> setCustomerActivityBaseinfo( 18 Future<dynamic> setCustomerActivityBaseinfo(
@@ -61,7 +65,40 @@ class BaseIndoProvider with ChangeNotifier { @@ -61,7 +65,40 @@ class BaseIndoProvider with ChangeNotifier {
61 // // couponsShow.add(couponTemp[i].id); 65 // // couponsShow.add(couponTemp[i].id);
62 // } 66 // }
63 // hasModify = true; 67 // hasModify = true;
  68 + notifyListeners();
  69 +
  70 + return true;
  71 + }
  72 + } else {
  73 + if (baseResp != null) {
  74 + Utils.showToast(baseResp.msg ?? "");
  75 + }
  76 + return false;
  77 + }
  78 + }
64 79
  80 + ///根据商家ID获取对应类型图片
  81 + Future<bool> getSellerPhotoById(
  82 + BuildContext context, Map<String, String> params,
  83 + {isShowLoading = true}) async {
  84 + BaseResp<dynamic> baseResp = await DioUtil()
  85 + .request<dynamic>(context, Method.get, HttpUrl.get_seller_photo_by_id,
  86 + data: params, showLoading: isShowLoading)
  87 + .catchError((error) {
  88 + print(error.toString());
  89 + if (error is MyError) {}
  90 + });
  91 + if (baseResp.code == Constant.status_success) {
  92 + if (baseResp.data == null || baseResp.data == false) {
  93 + return false;
  94 + } else {
  95 + photoList = SellerPhoneModel.fromJson(baseResp.responseData).data;
  96 + // for (int i = 0; i < couponListSelect.length; i++) {
  97 + // coupons.add(couponListSelect[i].id);
  98 + // // couponsShow.add(couponTemp[i].id);
  99 + // }
  100 + // hasModify = true;
  101 + notifyListeners();
65 return true; 102 return true;
66 } 103 }
67 } else { 104 } else {
@@ -16,6 +16,11 @@ class UploadImageProvider extends ChangeNotifier { @@ -16,6 +16,11 @@ class UploadImageProvider extends ChangeNotifier {
16 double imgSizeTouxiang = 64; 16 double imgSizeTouxiang = 64;
17 double imgSizeErweima = 22; 17 double imgSizeErweima = 22;
18 18
  19 + UploadImageProvider() {
  20 + touxiang.process = 0.01;
  21 + erweima.process = 0.01;
  22 + }
  23 +
19 /// 获取七牛上传token信息 24 /// 获取七牛上传token信息
20 Future<QiniuInfoSunModel> getQiniuInfo( 25 Future<QiniuInfoSunModel> getQiniuInfo(
21 BuildContext context, Map<String, String> params, 26 BuildContext context, Map<String, String> params,
@@ -82,4 +82,5 @@ class MyColours { @@ -82,4 +82,5 @@ class MyColours {
82 static const Color color_E3D6C7 = Color(0xffE3D6C7); 82 static const Color color_E3D6C7 = Color(0xffE3D6C7);
83 static const Color color_794F28 = Color(0xff794F28); 83 static const Color color_794F28 = Color(0xff794F28);
84 static const Color color_C19E5B = Color(0xffC19E5B); 84 static const Color color_C19E5B = Color(0xffC19E5B);
  85 + static const Color color_EEDBC4 = Color(0xffEEDBC4);
85 } 86 }
@@ -188,7 +188,8 @@ class NavigatorUtil { @@ -188,7 +188,8 @@ class NavigatorUtil {
188 } 188 }
189 189
190 /// 个人资料页面 190 /// 个人资料页面
191 - static void goBaseInfoPage(BuildContext context, {replace = false}) {  
192 - _navigateTo(context, "${Routes.base_info}", replace: replace); 191 + static Future<dynamic> goBaseInfoPage(BuildContext context,
  192 + {replace = false}) {
  193 + return _navigateTo(context, "${Routes.base_info}", replace: replace);
193 } 194 }
194 } 195 }
@@ -177,10 +177,12 @@ class UploadImageUtil { @@ -177,10 +177,12 @@ class UploadImageUtil {
177 if (index == 0) { 177 if (index == 0) {
178 uploadImageProvider.touxiang.process = 1; 178 uploadImageProvider.touxiang.process = 1;
179 uploadImageProvider.touxiang.qiniuUrl = imgUrl; 179 uploadImageProvider.touxiang.qiniuUrl = imgUrl;
  180 + uploadImageProvider.touxiang.file = null;
180 uploadImageProvider.notifyListeners(); 181 uploadImageProvider.notifyListeners();
181 } else if (index == 1) { 182 } else if (index == 1) {
182 uploadImageProvider.erweima.process = 1; 183 uploadImageProvider.erweima.process = 1;
183 uploadImageProvider.erweima.qiniuUrl = imgUrl; 184 uploadImageProvider.erweima.qiniuUrl = imgUrl;
  185 + uploadImageProvider.erweima.file = null;
184 uploadImageProvider.notifyListeners(); 186 uploadImageProvider.notifyListeners();
185 } 187 }
186 }) 188 })
@@ -257,16 +257,15 @@ class Utils { @@ -257,16 +257,15 @@ class Utils {
257 } 257 }
258 258
259 //分享邀请函 259 //分享邀请函
260 - static goShareInvicationToWeChat(String rid) async { 260 + static goShareInvicationToWeChat(String rid, String uid) async {
261 String _webPageUrl = "http://colorcun.com/"; 261 String _webPageUrl = "http://colorcun.com/";
262 // String _thumbnail = 262 // String _thumbnail =
263 // "https://xt04.colorcun.com/h5/index.html#/?id=163854&hasInvitation=1"; 263 // "https://xt04.colorcun.com/h5/index.html#/?id=163854&hasInvitation=1";
264 -  
265 String _thumbnail = 264 String _thumbnail =
266 "https://qn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911151148572.jpg"; 265 "https://qn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911151148572.jpg";
267 String _title = "用餐已为您安排"; 266 String _title = "用餐已为您安排";
268 String _userName = "gh_487873d353b3"; 267 String _userName = "gh_487873d353b3";
269 - String _path = "pages/customer/index?id=$rid&hasInvitation=1"; 268 + String _path = "pages/customer/index?id=$rid&hasInvitation=1&hasSellerShare=1&uid=$uid";
270 String _description = "进入查看包间详情,转发同行好友,还可一键导航到饭店"; 269 String _description = "进入查看包间详情,转发同行好友,还可一键导航到饭店";
271 //跳转小程序 270 //跳转小程序
272 var model = new WeChatShareMiniProgramModel( 271 var model = new WeChatShareMiniProgramModel(
@@ -23,7 +23,9 @@ class RoundButton extends StatelessWidget { @@ -23,7 +23,9 @@ class RoundButton extends StatelessWidget {
23 this.gradientStart = MyColours.color_199095, 23 this.gradientStart = MyColours.color_199095,
24 this.gradientEnd = MyColours.color_199095, 24 this.gradientEnd = MyColours.color_199095,
25 this.textColor = Colors.white, 25 this.textColor = Colors.white,
26 - this.borderColor = Colors.transparent, this.isBold = true}) 26 + this.borderColor = Colors.transparent,
  27 + this.isBold = true,
  28 + this.space = 6})
27 : super(key: key); 29 : super(key: key);
28 30
29 final String image; 31 final String image;
@@ -45,6 +47,7 @@ class RoundButton extends StatelessWidget { @@ -45,6 +47,7 @@ class RoundButton extends StatelessWidget {
45 final Color gradientEnd; 47 final Color gradientEnd;
46 final Widget child; 48 final Widget child;
47 final Color borderColor; 49 final Color borderColor;
  50 + final double space;
48 51
49 final String text; 52 final String text;
50 final TextStyle style; 53 final TextStyle style;
@@ -61,7 +64,8 @@ class RoundButton extends StatelessWidget { @@ -61,7 +64,8 @@ class RoundButton extends StatelessWidget {
61 margin: margin, 64 margin: margin,
62 decoration: BoxDecoration( 65 decoration: BoxDecoration(
63 borderRadius: _borderRadius, 66 borderRadius: _borderRadius,
64 - border: Border.all(color: borderColor, width: ScreenUtil().setWidth(2)), 67 + border:
  68 + Border.all(color: borderColor, width: ScreenUtil().setWidth(2)),
65 gradient: LinearGradient( 69 gradient: LinearGradient(
66 begin: Alignment.topLeft, 70 begin: Alignment.topLeft,
67 end: Alignment.bottomRight, 71 end: Alignment.bottomRight,
@@ -81,7 +85,7 @@ class RoundButton extends StatelessWidget { @@ -81,7 +85,7 @@ class RoundButton extends StatelessWidget {
81 children: <Widget>[ 85 children: <Widget>[
82 !ObjectUtil.isEmptyString(image) 86 !ObjectUtil.isEmptyString(image)
83 ? Padding( 87 ? Padding(
84 - padding: EdgeInsets.only(right: 6, bottom: 3), 88 + padding: EdgeInsets.only(right: space, bottom: 3),
85 child: Image.asset( 89 child: Image.asset(
86 image, 90 image,
87 width: ScreenUtil().setWidth(imgWidth), 91 width: ScreenUtil().setWidth(imgWidth),
@@ -93,8 +97,9 @@ class RoundButton extends StatelessWidget { @@ -93,8 +97,9 @@ class RoundButton extends StatelessWidget {
93 style: style ?? 97 style: style ??
94 new TextStyle( 98 new TextStyle(
95 color: textColor, 99 color: textColor,
96 - fontSize:ScreenUtil().setSp(fontSize),  
97 - fontWeight: isBold ? FontWeight.bold : FontWeight.normal), 100 + fontSize: ScreenUtil().setSp(fontSize),
  101 + fontWeight:
  102 + isBold ? FontWeight.bold : FontWeight.normal),
98 ) 103 )
99 ], 104 ],
100 ), 105 ),