From 90325a15ae5190cb77c350da4906ad7d88c96e76 Mon Sep 17 00:00:00 2001 From: PH2 <1293456824@qq.com> Date: Fri, 16 Oct 2020 17:12:13 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BA=BA=E8=84=89=E5=85=B3=E8=81=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../team_page/model/team_data_model.dart | 88 +++++++++++-------- .../team/recommend/team_recommend_widget.dart | 11 ++- 2 files changed, 58 insertions(+), 41 deletions(-) diff --git a/lib/pages/team_page/model/team_data_model.dart b/lib/pages/team_page/model/team_data_model.dart index 05ccb3b..ba6cffc 100644 --- a/lib/pages/team_page/model/team_data_model.dart +++ b/lib/pages/team_page/model/team_data_model.dart @@ -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 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 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 toJson() { - final Map data = new Map(); - 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; - } -} \ No newline at end of file + Map toJson() { + final Map data = new Map(); + 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; + } +} diff --git a/lib/widgets/team/recommend/team_recommend_widget.dart b/lib/widgets/team/recommend/team_recommend_widget.dart index 80b454f..d8a624a 100644 --- a/lib/widgets/team/recommend/team_recommend_widget.dart +++ b/lib/widgets/team/recommend/team_recommend_widget.dart @@ -231,7 +231,7 @@ class _TeamRecommendWidgetState extends State<_TeamRecommendWidgetContainer> { mainAxisAlignment: MainAxisAlignment.start, children: [ /// 头像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 ?? '', + ), ); }