parent
ab14b46f30
commit
94314caf0f
@ -0,0 +1,122 @@
|
||||
import 'package:recook/utils/user_level_tool.dart';
|
||||
|
||||
class UserBenefitExtraDetailModel {
|
||||
String code;
|
||||
String msg;
|
||||
Data data;
|
||||
|
||||
UserBenefitExtraDetailModel({this.code, this.msg, this.data});
|
||||
|
||||
UserBenefitExtraDetailModel.fromJson(Map<String, dynamic> json) {
|
||||
code = json['code'];
|
||||
msg = json['msg'];
|
||||
data = json['data'] != null ? new Data.fromJson(json['data']) : null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['code'] = this.code;
|
||||
data['msg'] = this.msg;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
List<UserIncome> userIncome;
|
||||
num amount = 0;
|
||||
num salesVolume;
|
||||
num ratio;
|
||||
int count;
|
||||
int isSettlement;
|
||||
|
||||
Data(
|
||||
{this.userIncome,
|
||||
this.amount,
|
||||
this.salesVolume,
|
||||
this.ratio,
|
||||
this.count,
|
||||
this.isSettlement});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
if (json['userIncome'] != null) {
|
||||
userIncome = new List<UserIncome>();
|
||||
json['userIncome'].forEach((v) {
|
||||
userIncome.add(new UserIncome.fromJson(v));
|
||||
});
|
||||
} else {
|
||||
userIncome = [];
|
||||
}
|
||||
amount = json['teamAmount'];
|
||||
salesVolume = json['salesVolume'];
|
||||
ratio = json['ratio'];
|
||||
count = json['count'];
|
||||
isSettlement = json['IsSettlement'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
if (this.userIncome != null) {
|
||||
data['userIncome'] = this.userIncome.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['amount'] = this.amount;
|
||||
data['salesVolume'] = this.salesVolume;
|
||||
data['ratio'] = this.ratio;
|
||||
data['count'] = this.count;
|
||||
data['IsSettlement'] = this.isSettlement;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class UserIncome {
|
||||
int userId;
|
||||
String headImgUrl;
|
||||
String nickname;
|
||||
String phone;
|
||||
String wechatNo;
|
||||
String remarkName;
|
||||
int count;
|
||||
num amount;
|
||||
int roleLevel;
|
||||
|
||||
UserRoleLevel get roleLevelEnum => UserLevelTool.roleLevelEnum(roleLevel);
|
||||
|
||||
UserIncome(
|
||||
{this.userId,
|
||||
this.headImgUrl,
|
||||
this.nickname,
|
||||
this.phone,
|
||||
this.wechatNo,
|
||||
this.remarkName,
|
||||
this.count,
|
||||
this.amount,
|
||||
this.roleLevel});
|
||||
|
||||
UserIncome.fromJson(Map<String, dynamic> json) {
|
||||
userId = json['userId'];
|
||||
headImgUrl = json['headImgUrl'];
|
||||
nickname = json['nickname'];
|
||||
phone = json['phone'];
|
||||
wechatNo = json['wechatNo'];
|
||||
remarkName = json['remarkName'];
|
||||
count = json['count'];
|
||||
amount = json['amount'];
|
||||
roleLevel = json['roleLevel'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['userId'] = this.userId;
|
||||
data['headImgUrl'] = this.headImgUrl;
|
||||
data['nickname'] = this.nickname;
|
||||
data['phone'] = this.phone;
|
||||
data['wechatNo'] = this.wechatNo;
|
||||
data['remarkName'] = this.remarkName;
|
||||
data['count'] = this.count;
|
||||
data['amount'] = this.amount;
|
||||
data['roleLevel'] = this.roleLevel;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,108 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:recook/constants/api.dart';
|
||||
import 'package:recook/constants/header.dart';
|
||||
import 'package:recook/utils/user_level_tool.dart';
|
||||
|
||||
class UserInviteCard extends StatelessWidget {
|
||||
final String headerImg;
|
||||
final String nickName;
|
||||
final String phone;
|
||||
final int groupCount;
|
||||
final UserRoleLevel roleLevel;
|
||||
const UserInviteCard(
|
||||
{Key key,
|
||||
this.headerImg,
|
||||
this.nickName,
|
||||
this.phone,
|
||||
this.groupCount,
|
||||
this.roleLevel})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
margin: EdgeInsets.symmetric(
|
||||
horizontal: rSize(15),
|
||||
vertical: rSize(5),
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(rSize(5)),
|
||||
color: Colors.white,
|
||||
),
|
||||
padding: EdgeInsets.all(rSize(12)),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
width: rSize(46),
|
||||
height: rSize(46),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: Color(0xFFFEC053),
|
||||
width: rSize(1),
|
||||
),
|
||||
borderRadius: BorderRadius.circular(rSize(23)),
|
||||
image: DecorationImage(
|
||||
image: NetworkImage(
|
||||
Api.getImgUrl(headerImg),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(width: rSize(12)),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
nickName,
|
||||
style: TextStyle(
|
||||
color: Color(0xFF333333),
|
||||
fontSize: rSP(14),
|
||||
),
|
||||
),
|
||||
SizedBox(height: rSize(6)),
|
||||
Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
R.ASSETS_INVITE_DETAIL_PHONE_PNG,
|
||||
height: rSize(12),
|
||||
width: rSize(12),
|
||||
),
|
||||
SizedBox(width: rSize(5)),
|
||||
Text(
|
||||
phone,
|
||||
style: TextStyle(
|
||||
color: Color(0xFF999999),
|
||||
fontSize: rSP(12),
|
||||
),
|
||||
),
|
||||
SizedBox(width: rSize(20)),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
R.ASSETS_INVITE_DETAIL_EDIT_PNG,
|
||||
height: rSize(12),
|
||||
width: rSize(12),
|
||||
),
|
||||
SizedBox(width: rSize(5)),
|
||||
Text(
|
||||
phone,
|
||||
style: TextStyle(
|
||||
color: Color(0xFF999999),
|
||||
fontSize: rSP(12),
|
||||
),
|
||||
),
|
||||
// UserLevelTool
|
||||
SizedBox(width: rSize(20)),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
///动态旋转
|
||||
class AnimatedRotate extends ImplicitlyAnimatedWidget {
|
||||
final Widget child;
|
||||
final Duration duration;
|
||||
final Curve curve;
|
||||
final double angle;
|
||||
|
||||
AnimatedRotate({
|
||||
Key key,
|
||||
@required this.child,
|
||||
this.duration = const Duration(milliseconds: 400),
|
||||
this.curve = Curves.easeInOutCubic,
|
||||
@required this.angle,
|
||||
}) : super(
|
||||
key: key,
|
||||
duration: duration,
|
||||
curve: curve,
|
||||
);
|
||||
@override
|
||||
ImplicitlyAnimatedWidgetState<ImplicitlyAnimatedWidget> createState() =>
|
||||
_AnimatedRoateState();
|
||||
}
|
||||
|
||||
class _AnimatedRoateState extends AnimatedWidgetBaseState<AnimatedRotate> {
|
||||
Tween<double> _rotateTween;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Transform.rotate(
|
||||
angle: _rotateTween.evaluate(animation),
|
||||
child: widget.child,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void forEachTween(visitor) {
|
||||
_rotateTween = visitor(
|
||||
_rotateTween,
|
||||
widget.angle,
|
||||
(dynamic value) => Tween<double>(begin: value),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue