Browse Source

增加访客次数

master
王子贤 3 months ago
parent
commit
04c940aa48
3 changed files with 9 additions and 1 deletions
  1. 4
      lib/model/home/marriage_data.dart
  2. 4
      lib/model/home/user_info_data.dart
  3. 2
      lib/pages/discover/visitor_list_page.dart

4
lib/model/home/marriage_data.dart

@ -19,6 +19,7 @@ class MarriageData {
final String describeInfo;
final String createTime;
final int genderCode;
final int visitCount;
final List<PhotoItem> photoList;
final bool isLive; //
@ -48,6 +49,7 @@ class MarriageData {
required this.createTime,
required this.photoList,
required this.genderCode,
required this.visitCount,
this.isLive = false,
});
@ -70,6 +72,7 @@ class MarriageData {
describeInfo: json['describeInfo'] ?? '',
createTime: json['createTime'] ?? '',
genderCode: json['genderCode'] ?? 0,
visitCount: json['visitCount'] ?? 0,
photoList: (json['photoList'] as List<dynamic>?)?.map((e) => PhotoItem.fromJson(e as Map<String, dynamic>)).toList() ?? [],
isLive: json['isLive'] ?? json['liveStatus'] ?? false, // isLive或liveStatus字段
);
@ -95,6 +98,7 @@ class MarriageData {
describeInfo: userInfo.describeInfo ?? '',
createTime: userInfo.createTime ?? '',
genderCode: userInfo.genderCode?.toInt() ?? 0,
visitCount: userInfo.visitCount?.toInt() ?? 0,
photoList: (userInfo.photoList ?? []).map((photo) => PhotoItem(
photoUrl: photo.photoUrl ?? '',
auditStatus: photo.auditStatus,

4
lib/model/home/user_info_data.dart

@ -90,6 +90,7 @@ class UserInfoData {
bool? consumeRight;
bool? vip;
num? dataScoring;
num? visitCount;
String? phone;
Null? guestMatchmaker;
String? miId;
@ -187,6 +188,7 @@ class UserInfoData {
this.consumeRight,
this.vip,
this.dataScoring,
this.visitCount,
this.phone,
this.guestMatchmaker,
this.miId,
@ -296,6 +298,7 @@ class UserInfoData {
consumeRight = json['consumeRight'];
vip = json['vip'];
dataScoring = json['dataScoring'];
visitCount = json['visitCount'];
phone = json['phone'];
guestMatchmaker = json['guestMatchmaker'];
miId = json['miId'];
@ -402,6 +405,7 @@ class UserInfoData {
data['consumeRight'] = this.consumeRight;
data['vip'] = this.vip;
data['dataScoring'] = this.dataScoring;
data['visitCount'] = this.visitCount;
data['phone'] = this.phone;
data['guestMatchmaker'] = this.guestMatchmaker;
data['miId'] = this.miId;

2
lib/pages/discover/visitor_list_page.dart

@ -180,7 +180,7 @@ class VisitorItem extends StatelessWidget {
fontWeight: FontWeight.w500,
),
),
Text('访问1次', style: TextStyle(color: Color(0xffA799FF), fontSize: 12.w))
Text('访问${visitor.visitCount}', style: TextStyle(color: Color(0xffA799FF), fontSize: 12.w))
],
),
)

Loading…
Cancel
Save