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

4
lib/model/home/user_info_data.dart

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

2
lib/pages/discover/visitor_list_page.dart

@ -180,7 +180,7 @@ class VisitorItem extends StatelessWidget {
fontWeight: FontWeight.w500, 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