Commit f1b71c52dfce176ae8349274e71a9be5d11c30d0

Authored by wdn127929
1 parent e067aed2

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

... ... @@ -11,14 +11,14 @@ if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = "201"
def flutterVersionCode = "210"
if (flutterVersionCode == null) {
flutterVersionCode = '201'
flutterVersionCode = '210'
}
def flutterVersionName = "2.0.1"
def flutterVersionName = "2.1.0"
if (flutterVersionName == null) {
flutterVersionName = '2.0.1'
flutterVersionName = '2.1.0'
}
apply plugin: 'com.android.application'
... ...

198 KB | W: | H:

165 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
import 'package:json_annotation/json_annotation.dart';
part 'seller_phone_model.g.dart';
@JsonSerializable()
class SellerPhoneModel extends Object {
@JsonKey(name: 'ret')
int ret;
@JsonKey(name: 'data')
List<SellerPhoneSunModel> data;
@JsonKey(name: 'msg')
String msg;
SellerPhoneModel(
this.ret,
this.data,
this.msg,
);
factory SellerPhoneModel.fromJson(Map<String, dynamic> srcJson) =>
_$SellerPhoneModelFromJson(srcJson);
Map<String, dynamic> toJson() => _$SellerPhoneModelToJson(this);
}
@JsonSerializable()
class SellerPhoneSunModel extends Object {
@JsonKey(name: 'id')
String id;
@JsonKey(name: 'sellerid')
String sellerid;
@JsonKey(name: 'type')
String type;
@JsonKey(name: 'image')
String image;
@JsonKey(name: 'isShare')
String isShare;
@JsonKey(name: 'cdate')
String cdate;
SellerPhoneSunModel(
this.id,
this.sellerid,
this.type,
this.image,
this.isShare,
this.cdate,
);
factory SellerPhoneSunModel.fromJson(Map<String, dynamic> srcJson) =>
_$SellerPhoneSunModelFromJson(srcJson);
Map<String, dynamic> toJson() => _$SellerPhoneSunModelToJson(this);
}
... ...
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'seller_phone_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
SellerPhoneModel _$SellerPhoneModelFromJson(Map<String, dynamic> json) {
return SellerPhoneModel(
json['ret'] as int,
(json['data'] as List)
?.map((e) => e == null
? null
: SellerPhoneSunModel.fromJson(e as Map<String, dynamic>))
?.toList(),
json['msg'] as String);
}
Map<String, dynamic> _$SellerPhoneModelToJson(SellerPhoneModel instance) =>
<String, dynamic>{
'ret': instance.ret,
'data': instance.data,
'msg': instance.msg
};
SellerPhoneSunModel _$SellerPhoneSunModelFromJson(Map<String, dynamic> json) {
return SellerPhoneSunModel(
json['id'] as String,
json['sellerid'] as String,
json['type'] as String,
json['image'] as String,
json['isShare'] as String,
json['cdate'] as String);
}
Map<String, dynamic> _$SellerPhoneSunModelToJson(
SellerPhoneSunModel instance) =>
<String, dynamic>{
'id': instance.id,
'sellerid': instance.sellerid,
'type': instance.type,
'image': instance.image,
'isShare': instance.isShare,
'cdate': instance.cdate
};
... ...
... ... @@ -85,5 +85,7 @@ class HttpUrl {
"?service=App.Activity.SetCustomerActivityBaseinfo"; //客户经理添加/修改基本信息
static const String get_customer_activity_baseinfo =
"?service=App.Activity.GetCustomerActivityBaseinfo"; //客户经理获取基本信息
static const String get_seller_photo_by_id =
"?service=App.Photo.getSellerPhotoById"; //查看商家图片
}
... ...
import 'package:cached_network_image/cached_network_image.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/models/seller_phone_model.dart';
import 'package:one_key/models/user.dart';
import 'package:one_key/pages/online_check/photo_view_wiget.dart';
import 'package:one_key/provider/base_info_provider.dart';
import 'package:one_key/provider/coupon_provider.dart';
import 'package:one_key/provider/user_model.dart';
import 'package:one_key/res/colors.dart';
... ... @@ -35,6 +40,11 @@ class InvicationPageState extends State<InvicationPage> {
ScrollController controller = ScrollController();
double couponHeight = 180.0;
CouponProvider couponProvider;
BaseIndoProvider _baseIndoProvider;
String name = '请填写姓名';
String position = '请填写职位';
String phone = '请填写电话';
String qiniuUrl = '';
@override
void initState() {
... ... @@ -42,6 +52,8 @@ class InvicationPageState extends State<InvicationPage> {
WidgetsBinding.instance.addPostFrameCallback((_) {
_getActivityByRid();
_getCustomerActivityBaseinfo();
_getSellerPhotoById();
});
Utils.changeStatusColor(color: Colors.transparent);
dateTime =
... ... @@ -51,6 +63,37 @@ class InvicationPageState extends State<InvicationPage> {
"${dateTime.year}/${Utils.addZeroNumber(dateTime.month)}/${Utils.addZeroNumber(dateTime.day)} 星期${Utils.formatWeekDayNum(dateTime.weekday)} ${widget.ddateStr}";
}
_getSellerPhotoById() async {
Map<String, String> params = {
'sellerid': Provider.of<UserModel>(context, listen: false).user.sellerid,
"type": '2',
};
bool success = await _baseIndoProvider.getSellerPhotoById(context, params);
}
_getCustomerActivityBaseinfo() async {
Map<String, String> 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) {
name = _baseIndoProvider.baseInfoSunModel.name;
qiniuUrl = _baseIndoProvider.baseInfoSunModel.photo;
// _uploadImageProvider.erweima.qiniuUrl =
// _baseIndoProvider.baseInfoSunModel.qrcode;
phone = _baseIndoProvider.baseInfoSunModel.phone;
position = _baseIndoProvider.baseInfoSunModel.position;
setState(() {});
} else {
// name = '请填写姓名';
// position = '请填写职位';
// phone = '请填写电话';
// qiniuUrl = '';
}
}
_getActivityByRid() async {
Map<String, String> params = {
"rid": widget.rid,
... ... @@ -140,10 +183,50 @@ class InvicationPageState extends State<InvicationPage> {
);
}
_goBaseInfoPage() async {
bool needRefresh = await NavigatorUtil.goBaseInfoPage(context);
if (needRefresh != null && needRefresh) {
//刷新页面数据
_getCustomerActivityBaseinfo();
}
}
//查看大图
_showPhotoView(BuildContext context, int index, List imgs,
{isShow = false, List dashName}) async {
// if (imgs.length == 1 &&
// imgs[0] ==
// 'http://nosqn.colorcun.com/custom/lite-online/image/def-banner.png') {
// imgs[0] = 'http://nosqn.colorcun.com/app/seller-hj-empty.png';
// }
Utils.setBarStatus(false, color: Colors.black);
dynamic result = await showGeneralDialog(
context: context,
barrierDismissible: false,
// barrierColor: Colors.red,
barrierLabel:
MaterialLocalizations.of(context).modalBarrierDismissLabel,
transitionDuration: const Duration(milliseconds: 150),
pageBuilder: (BuildContext context, Animation animation,
Animation secondaryAnimation) {
Widget child = Stack(
children: <Widget>[
PhotoPreview(
initialIndex: index,
photoList: imgs,
isShow: isShow,
dashName: dashName)
],
);
return child;
});
Utils.setBarStatus(true, color: Colors.white);
}
@override
Widget build(BuildContext context) {
// TODO: implement build
_baseIndoProvider = Provider.of<BaseIndoProvider>(context, listen: true);
couponProvider = Provider.of<CouponProvider>(context, listen: true);
return Container(
width: double.infinity,
... ... @@ -157,7 +240,8 @@ class InvicationPageState extends State<InvicationPage> {
body: SafeArea(
child: Stack(
children: [
Padding(
Container(
margin: EdgeInsets.only(top: ScreenUtil().setWidth(10 * 2)),
padding:
EdgeInsets.only(top: ScreenUtil().setWidth(35 * 2)),
child: Column(children: [
... ... @@ -172,14 +256,14 @@ class InvicationPageState extends State<InvicationPage> {
Image.asset(
"assets/img_ydap.png",
width: ScreenUtil().setWidth(220 * 2),
height: ScreenUtil().setHeight(120 * 2),
height: ScreenUtil().setHeight(98 * 2),
),
VEmptyView(20),
VEmptyView(10),
Container(
margin: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40)),
padding: EdgeInsets.all(
ScreenUtil().setWidth(60)),
// padding: EdgeInsets.all(
// ScreenUtil().setWidth(60)),
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
... ... @@ -196,8 +280,186 @@ class InvicationPageState extends State<InvicationPage> {
CrossAxisAlignment.center,
children: [
Container(
color: Colors.red,
height: 160,
width:
ScreenUtil().setWidth(335 * 2),
height:
ScreenUtil().setWidth(200 * 2),
decoration: BoxDecoration(
image: DecorationImage(
alignment:
Alignment.topCenter,
image: AssetImage(
"assets/yd_baiinfo_bg.png"),
fit: BoxFit.cover),
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(
top: ScreenUtil()
.setWidth(20),
left: ScreenUtil()
.setWidth(60)),
child: qiniuUrl == ''
? Image.asset(
Utils.getImgPath(
'person'),
width: ScreenUtil().setWidth(
143 * 2),
height: ScreenUtil()
.setWidth(
190 * 2))
: Image.network(qiniuUrl,
width: ScreenUtil()
.setWidth(
143 * 2),
height: ScreenUtil()
.setWidth(190 * 2)),
),
HEmptyView(10),
Spacer(),
Container(
height: ScreenUtil()
.setWidth(200 * 2),
child: Column(
mainAxisAlignment:
MainAxisAlignment
.start,
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
VEmptyView(60),
GestureDetector(
behavior:
HitTestBehavior
.opaque,
onTap: () {
_goBaseInfoPage();
},
child: Container(
width: ScreenUtil()
.setWidth(
100 * 2),
height: ScreenUtil()
.setWidth(
24 * 2),
child: Text(
name,
overflow:
TextOverflow
.ellipsis,
style: TextStyle(
fontWeight:
FontWeight
.bold,
color: MyColours
.color_794F28,
fontSize:
ScreenUtil()
.setSp(
36)),
),
),
),
VEmptyView(6),
InkWell(
onTap: () {
_goBaseInfoPage();
},
child: Container(
width: ScreenUtil()
.setWidth(
100 * 2),
height:
ScreenUtil()
.setWidth(
18 *
2),
child: Text(
position,
overflow:
TextOverflow
.ellipsis,
style: TextStyle(
color: MyColours
.color_794F28,
fontSize: ScreenUtil()
.setSp(
28)),
),
)),
VEmptyView(6),
InkWell(
onTap: () {
_goBaseInfoPage();
},
child: Container(
width: ScreenUtil()
.setWidth(
100 * 2),
height:
ScreenUtil()
.setWidth(
18 *
2),
child: Text(
phone,
overflow:
TextOverflow
.ellipsis,
style: TextStyle(
color: MyColours
.color_794F28,
fontSize: ScreenUtil()
.setSp(
28)),
),
)),
VEmptyView(14),
RoundButton(
height: ScreenUtil()
.setWidth(94 * 2),
image:
Utils.getImgPath(
'yd_bianji'),
imgWidth: 24,
space: ScreenUtil()
.setWidth(20),
text: '编辑',
textColor: MyColours
.color_794F28,
isBold: false,
fontSize: 28,
gradientStart: Colors
.transparent,
gradientEnd: Colors
.transparent,
onPressed: () {
_goBaseInfoPage();
},
)
],
)),
HEmptyView(60),
],
)),
// Positioned(
// bottom: 0,
// child: Container(
// color: MyColours.color_EEDBC4,
// width: double.infinity,
// height:
// ScreenUtil().setWidth(40),
// ))
// ],
// ),
Container(
color: MyColours.color_EEDBC4,
width: double.infinity,
height: ScreenUtil().setWidth(40),
),
VEmptyView(40),
Image.asset(
... ... @@ -206,7 +468,7 @@ class InvicationPageState extends State<InvicationPage> {
height:
ScreenUtil().setHeight(33 * 2),
),
VEmptyView(60),
VEmptyView(50),
Container(
height: ScreenUtil().setWidth(48),
child: Text(
... ... @@ -217,7 +479,7 @@ class InvicationPageState extends State<InvicationPage> {
color: MyColours.color_794F28,
fontWeight: FontWeight.bold,
fontSize:
ScreenUtil().setSp(34)),
ScreenUtil().setSp(36)),
),
),
VEmptyView(30),
... ... @@ -230,7 +492,7 @@ class InvicationPageState extends State<InvicationPage> {
.setWidth(1.7 * 2),
color: MyColours.color_C19E5B,
fontSize:
ScreenUtil().setSp(26)),
ScreenUtil().setSp(28)),
),
),
VEmptyView(12),
... ... @@ -257,7 +519,7 @@ class InvicationPageState extends State<InvicationPage> {
MyColours.color_794F28,
fontWeight: FontWeight.bold,
fontSize:
ScreenUtil().setSp(34)),
ScreenUtil().setSp(42)),
),
),
Image.asset(
... ... @@ -269,19 +531,46 @@ class InvicationPageState extends State<InvicationPage> {
),
],
),
VEmptyView(18),
RoundButton(
text: '浏览照片',
width: ScreenUtil().setWidth(68 * 2),
height: ScreenUtil().setWidth(24 * 2),
fontSize: 24,
textColor: MyColours.color_794F28,
isBold: false,
gradientStart:
Color.fromRGBO(121, 79, 40, 0.1),
gradientEnd:
Color.fromRGBO(121, 79, 40, 0.1),
),
_baseIndoProvider.photoList.length > 0
? VEmptyView(18)
: Container(),
_baseIndoProvider.photoList.length > 0
? RoundButton(
onPressed: () {
List<String> temp = [];
if (_baseIndoProvider
.photoList.length >
0) {
for (int i = 0;
i <
_baseIndoProvider
.photoList
.length;
i++) {
temp.add(_baseIndoProvider
.photoList[i].image);
}
///没有上传完成的不可以点击
_showPhotoView(
context, 0, temp);
}
},
text: '浏览照片',
width: ScreenUtil()
.setWidth(68 * 2),
height: ScreenUtil()
.setWidth(24 * 2),
fontSize: 26,
textColor:
MyColours.color_794F28,
isBold: false,
gradientStart: Color.fromRGBO(
121, 79, 40, 0.1),
gradientEnd: Color.fromRGBO(
121, 79, 40, 0.1),
)
: Container(),
VEmptyView(60),
Container(
height: ScreenUtil().setWidth(40),
... ... @@ -293,7 +582,7 @@ class InvicationPageState extends State<InvicationPage> {
color: MyColours.color_794F28,
fontWeight: FontWeight.bold,
fontSize:
ScreenUtil().setSp(28)),
ScreenUtil().setSp(30)),
),
),
VEmptyView(20),
... ... @@ -310,7 +599,7 @@ class InvicationPageState extends State<InvicationPage> {
color: MyColours.color_794F28,
fontWeight: FontWeight.bold,
fontSize:
ScreenUtil().setSp(28)),
ScreenUtil().setSp(30)),
),
),
// VEmptyView(20),
... ... @@ -326,13 +615,14 @@ class InvicationPageState extends State<InvicationPage> {
// gradientEnd:
// Color.fromRGBO(121, 79, 40, 0.1),
// ),
VEmptyView(60),
VEmptyView(50),
Image.asset(
"assets/yd_down.png",
width: ScreenUtil().setWidth(195 * 2),
height:
ScreenUtil().setHeight(33 * 2),
),
VEmptyView(60),
],
),
)
... ... @@ -375,6 +665,36 @@ class InvicationPageState extends State<InvicationPage> {
Expanded(
child: GestureDetector(
onTap: () async {
if (ObjectUtil.isEmpty(
_baseIndoProvider.baseInfoSunModel)) {
Utils.showToast('请输入个人资料');
return;
}
if (ObjectUtil.isEmpty(_baseIndoProvider
.baseInfoSunModel.name)) {
Utils.showToast('请填写您的姓名');
return;
}
if (ObjectUtil.isEmpty(_baseIndoProvider
.baseInfoSunModel.phone)) {
Utils.showToast('请填写您的联系电话');
return;
}
if (ObjectUtil.isEmpty(_baseIndoProvider
.baseInfoSunModel.position)) {
Utils.showToast('请填写您在餐厅中的职位');
return;
}
if (ObjectUtil.isEmpty(_baseIndoProvider
.baseInfoSunModel.phone)) {
Utils.showToast('请上传您的头像');
return;
}
if (ObjectUtil.isEmpty(_baseIndoProvider
.baseInfoSunModel.qrcode)) {
Utils.showToast('请上传您的微信二维码');
return;
}
if (!couponProvider.hasModify &&
couponProvider.coupons.length > 0) {
Map<String, String> params = {
... ... @@ -386,9 +706,14 @@ class InvicationPageState extends State<InvicationPage> {
.setActivityAsReserve(context, params);
if (isSuc) {
couponProvider.hasModify = true;
bool isSuccess =
await Utils.goShareInvicationToWeChat(
widget.rid);
widget.rid,
Provider.of<UserModel>(context,
listen: false)
.user
.openid);
print(isSuccess);
// couponProvider.couponsShow = [];
// couponProvider.couponsShow
... ... @@ -399,7 +724,11 @@ class InvicationPageState extends State<InvicationPage> {
} else {
bool isSuccess =
await Utils.goShareInvicationToWeChat(
widget.rid);
widget.rid,
Provider.of<UserModel>(context,
listen: false)
.user
.openid);
print(isSuccess);
}
},
... ...
... ... @@ -75,7 +75,8 @@ class _BaseInfoPageState extends State<BaseInfoPage> {
_phoneController.text = _baseIndoProvider.baseInfoSunModel.phone;
_positionController.text = _baseIndoProvider.baseInfoSunModel.position;
_uploadImageProvider.imgSizeErweima = 64;
setState(() {});
// setState(() {});
_uploadImageProvider.notifyListeners();
}
}
... ... @@ -97,9 +98,14 @@ class _BaseInfoPageState extends State<BaseInfoPage> {
"position": _positionController.text,
"qrcode": _uploadImageProvider.erweima.qiniuUrl,
};
if (_baseIndoProvider.baseInfoSunModel != null) {
params['id'] = _baseIndoProvider.baseInfoSunModel.id;
}
bool isSuccess =
await _baseIndoProvider.setCustomerActivityBaseinfo(context, params);
if (isSuccess) {
_uploadImageProvider.touxiang.file = null;
_uploadImageProvider.erweima.file = null;
//成功之后跳回前一个页面
// bus.emit('refresh_coupon_list');
Utils.showToast('保存成功');
... ... @@ -211,9 +217,13 @@ class _BaseInfoPageState extends State<BaseInfoPage> {
}
});
if (pickedFile != null) {
title == '头像'
? _uploadImageProvider.imgSizeTouxiang = 64
: _uploadImageProvider.imgSizeErweima = 64;
if (title == '头像') {
_uploadImageProvider.imgSizeTouxiang = 64;
_uploadImageProvider.touxiang.qiniuUrl = null;
} else {
_uploadImageProvider.imgSizeErweima = 64;
_uploadImageProvider.erweima.qiniuUrl = null;
}
UploadImageUtil().startUploadOnly(context, File(pickedFile.path),
title == '头像' ? 0 : 1, true, _uploadImageProvider);
}
... ... @@ -268,9 +278,9 @@ class _BaseInfoPageState extends State<BaseInfoPage> {
borderRadius:
BorderRadius.circular(ScreenUtil().setWidth(radius)),
child: model.file == null
? model.qiniuUrl != null
? CachedNetworkImage(
imageUrl: model.qiniuUrl,
? model.qiniuUrl != null && model.qiniuUrl != ''
? Image.network(
model.qiniuUrl,
fit: BoxFit.cover,
width: ScreenUtil().setWidth(imgSize * 2),
height: ScreenUtil().setWidth(imgSize * 2),
... ... @@ -290,20 +300,19 @@ class _BaseInfoPageState extends State<BaseInfoPage> {
),
),
),
model.file == null && model.qiniuUrl == null
? Offstage(
offstage: model.process == 1,
child: Container(
width: ScreenUtil().setWidth(imgSize * 2),
height: ScreenUtil().setWidth(imgSize * 2),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(radius),
color: Color.fromRGBO(0, 0, 0, 0.2)),
child: Center(
child: Text('上传中',
style:
TextStyle(color: MyColours.color_333333)),
),
(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.2)),
child: Center(
child: Text('上传中',
style:
TextStyle(color: MyColours.color_333333)),
),
)
: Container(),
... ... @@ -420,7 +429,7 @@ class _BaseInfoPageState extends State<BaseInfoPage> {
}
if (_uploadImageProvider.erweima.qiniuUrl.trim().length ==
0) {
Utils.showToast('请上传头像');
Utils.showToast('请上传二维码');
return;
}
... ...
... ... @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:one_key/constant/constant.dart';
import 'package:one_key/constant/error.dart';
import 'package:one_key/models/base_info_model.dart';
import 'package:one_key/models/seller_phone_model.dart';
import 'package:one_key/net/base_resp.dart';
import 'package:one_key/net/dio_util.dart';
import 'package:one_key/net/http_url.dart';
... ... @@ -9,6 +10,9 @@ import 'package:one_key/utils/utils.dart';
class BaseIndoProvider with ChangeNotifier {
BaseInfoSunModel baseInfoSunModel; //客户经理基础信息
List<SellerPhoneSunModel> photoList = []; //商家图片信息
///客户经理添加/修改基本信息
Future<dynamic> setCustomerActivityBaseinfo(
... ... @@ -61,7 +65,40 @@ class BaseIndoProvider with ChangeNotifier {
// // couponsShow.add(couponTemp[i].id);
// }
// hasModify = true;
notifyListeners();
return true;
}
} else {
if (baseResp != null) {
Utils.showToast(baseResp.msg ?? "");
}
return false;
}
}
///根据商家ID获取对应类型图片
Future<bool> getSellerPhotoById(
BuildContext context, Map<String, String> params,
{isShowLoading = true}) async {
BaseResp<dynamic> baseResp = await DioUtil()
.request<dynamic>(context, Method.get, HttpUrl.get_seller_photo_by_id,
data: params, showLoading: isShowLoading)
.catchError((error) {
print(error.toString());
if (error is MyError) {}
});
if (baseResp.code == Constant.status_success) {
if (baseResp.data == null || baseResp.data == false) {
return false;
} else {
photoList = SellerPhoneModel.fromJson(baseResp.responseData).data;
// for (int i = 0; i < couponListSelect.length; i++) {
// coupons.add(couponListSelect[i].id);
// // couponsShow.add(couponTemp[i].id);
// }
// hasModify = true;
notifyListeners();
return true;
}
} else {
... ...
... ... @@ -16,6 +16,11 @@ class UploadImageProvider extends ChangeNotifier {
double imgSizeTouxiang = 64;
double imgSizeErweima = 22;
UploadImageProvider() {
touxiang.process = 0.01;
erweima.process = 0.01;
}
/// 获取七牛上传token信息
Future<QiniuInfoSunModel> getQiniuInfo(
BuildContext context, Map<String, String> params,
... ...
... ... @@ -82,4 +82,5 @@ class MyColours {
static const Color color_E3D6C7 = Color(0xffE3D6C7);
static const Color color_794F28 = Color(0xff794F28);
static const Color color_C19E5B = Color(0xffC19E5B);
static const Color color_EEDBC4 = Color(0xffEEDBC4);
}
... ...
... ... @@ -188,7 +188,8 @@ class NavigatorUtil {
}
/// 个人资料页面
static void goBaseInfoPage(BuildContext context, {replace = false}) {
_navigateTo(context, "${Routes.base_info}", replace: replace);
static Future<dynamic> goBaseInfoPage(BuildContext context,
{replace = false}) {
return _navigateTo(context, "${Routes.base_info}", replace: replace);
}
}
... ...
... ... @@ -177,10 +177,12 @@ class UploadImageUtil {
if (index == 0) {
uploadImageProvider.touxiang.process = 1;
uploadImageProvider.touxiang.qiniuUrl = imgUrl;
uploadImageProvider.touxiang.file = null;
uploadImageProvider.notifyListeners();
} else if (index == 1) {
uploadImageProvider.erweima.process = 1;
uploadImageProvider.erweima.qiniuUrl = imgUrl;
uploadImageProvider.erweima.file = null;
uploadImageProvider.notifyListeners();
}
})
... ...
... ... @@ -257,16 +257,15 @@ class Utils {
}
//分享邀请函
static goShareInvicationToWeChat(String rid) async {
static goShareInvicationToWeChat(String rid, String uid) async {
String _webPageUrl = "http://colorcun.com/";
// String _thumbnail =
// "https://xt04.colorcun.com/h5/index.html#/?id=163854&hasInvitation=1";
String _thumbnail =
"https://qn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911151148572.jpg";
String _title = "用餐已为您安排";
String _userName = "gh_487873d353b3";
String _path = "pages/customer/index?id=$rid&hasInvitation=1";
String _path = "pages/customer/index?id=$rid&hasInvitation=1&hasSellerShare=1&uid=$uid";
String _description = "进入查看包间详情,转发同行好友,还可一键导航到饭店";
//跳转小程序
var model = new WeChatShareMiniProgramModel(
... ...
... ... @@ -23,7 +23,9 @@ class RoundButton extends StatelessWidget {
this.gradientStart = MyColours.color_199095,
this.gradientEnd = MyColours.color_199095,
this.textColor = Colors.white,
this.borderColor = Colors.transparent, this.isBold = true})
this.borderColor = Colors.transparent,
this.isBold = true,
this.space = 6})
: super(key: key);
final String image;
... ... @@ -45,6 +47,7 @@ class RoundButton extends StatelessWidget {
final Color gradientEnd;
final Widget child;
final Color borderColor;
final double space;
final String text;
final TextStyle style;
... ... @@ -61,7 +64,8 @@ class RoundButton extends StatelessWidget {
margin: margin,
decoration: BoxDecoration(
borderRadius: _borderRadius,
border: Border.all(color: borderColor, width: ScreenUtil().setWidth(2)),
border:
Border.all(color: borderColor, width: ScreenUtil().setWidth(2)),
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
... ... @@ -81,7 +85,7 @@ class RoundButton extends StatelessWidget {
children: <Widget>[
!ObjectUtil.isEmptyString(image)
? Padding(
padding: EdgeInsets.only(right: 6, bottom: 3),
padding: EdgeInsets.only(right: space, bottom: 3),
child: Image.asset(
image,
width: ScreenUtil().setWidth(imgWidth),
... ... @@ -93,8 +97,9 @@ class RoundButton extends StatelessWidget {
style: style ??
new TextStyle(
color: textColor,
fontSize:ScreenUtil().setSp(fontSize),
fontWeight: isBold ? FontWeight.bold : FontWeight.normal),
fontSize: ScreenUtil().setSp(fontSize),
fontWeight:
isBold ? FontWeight.bold : FontWeight.normal),
)
],
),
... ...