Ver código fonte

1、人脉关联

tags/0.0.1
PH2 4 anos atrás
pai
commit
90325a15ae
2 arquivos alterados com 58 adições e 41 exclusões
  1. +51
    -37
      lib/pages/team_page/model/team_data_model.dart
  2. +7
    -4
      lib/widgets/team/recommend/team_recommend_widget.dart

+ 51
- 37
lib/pages/team_page/model/team_data_model.dart Ver arquivo

@@ -1,41 +1,55 @@
class TeamDataModel {
String all_fans;
String direct_fans_count;
String indirect_fans_count;
String referrer_invite_code;
String referrer_phone;
String referrer_username;
String referrer_wechat;
String today_add;
String yesterday_add;
String all_fans;
String direct_fans_count;
String indirect_fans_count;
String referrer_invite_code;
String referrer_phone;
String referrer_username;
String referrer_wechat;
String today_add;
String yesterday_add;
String referrerAvatar;

TeamDataModel({this.all_fans, this.direct_fans_count, this.indirect_fans_count, this.referrer_invite_code, this.referrer_phone, this.referrer_username, this.referrer_wechat, this.today_add, this.yesterday_add});
TeamDataModel({
this.all_fans,
this.direct_fans_count,
this.indirect_fans_count,
this.referrer_invite_code,
this.referrer_phone,
this.referrer_username,
this.referrer_wechat,
this.today_add,
this.yesterday_add,
this.referrerAvatar,
});

factory TeamDataModel.fromJson(Map<String, dynamic> json) {
return TeamDataModel(
all_fans: json['all_fans'],
direct_fans_count: json['direct_fans_count'],
indirect_fans_count: json['indirect_fans_count'],
referrer_invite_code: json['referrer_invite_code'],
referrer_phone: json['referrer_phone'],
referrer_username: json['referrer_username'],
referrer_wechat: json['referrer_wechat'],
today_add: json['today_add'],
yesterday_add: json['yesterday_add'],
);
}
factory TeamDataModel.fromJson(Map<String, dynamic> json) {
return TeamDataModel(
all_fans: json['all_fans'],
direct_fans_count: json['direct_fans_count'],
indirect_fans_count: json['indirect_fans_count'],
referrer_invite_code: json['referrer_invite_code'],
referrer_phone: json['referrer_phone'],
referrer_username: json['referrer_username'],
referrer_wechat: json['referrer_wechat'],
today_add: json['today_add'],
yesterday_add: json['yesterday_add'],
referrerAvatar: json['referrer_avatar'],
);
}

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['all_fans'] = this.all_fans;
data['direct_fans_count'] = this.direct_fans_count;
data['indirect_fans_count'] = this.indirect_fans_count;
data['referrer_invite_code'] = this.referrer_invite_code;
data['referrer_phone'] = this.referrer_phone;
data['referrer_username'] = this.referrer_username;
data['referrer_wechat'] = this.referrer_wechat;
data['today_add'] = this.today_add;
data['yesterday_add'] = this.yesterday_add;
return data;
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['all_fans'] = this.all_fans;
data['direct_fans_count'] = this.direct_fans_count;
data['indirect_fans_count'] = this.indirect_fans_count;
data['referrer_invite_code'] = this.referrer_invite_code;
data['referrer_phone'] = this.referrer_phone;
data['referrer_username'] = this.referrer_username;
data['referrer_wechat'] = this.referrer_wechat;
data['today_add'] = this.today_add;
data['yesterday_add'] = this.yesterday_add;
data['referrer_avatar'] = this.referrerAvatar;
return data;
}
}

+ 7
- 4
lib/widgets/team/recommend/team_recommend_widget.dart Ver arquivo

@@ -231,7 +231,7 @@ class _TeamRecommendWidgetState extends State<_TeamRecommendWidgetContainer> {
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
/// 头像widget
_getAvatarWidget(),
_getAvatarWidget(dataModel),

const SizedBox(width: 12),

@@ -242,11 +242,14 @@ class _TeamRecommendWidgetState extends State<_TeamRecommendWidgetContainer> {
}

/// 头像widget
Widget _getAvatarWidget() {
Widget _getAvatarWidget(TeamDataModel dataModel) {
return Container(
width: 55,
height: 55,
color: Colors.red,
// height: 55,
// color: Colors.red,
child: CachedNetworkImage(
imageUrl: dataModel?.referrerAvatar ?? '',
),
);
}



Carregando…
Cancelar
Salvar