Browse Source

优化访客页面,优化修改信息页面,优化玫瑰页面,优化我的页面样式,优化首页样式

master
王子贤 2 months ago
parent
commit
77f16bb6b4
13 changed files with 103 additions and 117 deletions
  1. 22
      lib/controller/discover/visitor_controller.dart
  2. 6
      lib/controller/mine/edit_info_controller.dart
  3. 4
      lib/model/mine/user_data.dart
  4. 15
      lib/pages/discover/visitor_list_page.dart
  5. 83
      lib/pages/home/content_card.dart
  6. 15
      lib/pages/home/home_page.dart
  7. 4
      lib/pages/home/user_information_page.dart
  8. 5
      lib/pages/main/main_page.dart
  9. 3
      lib/pages/mine/auth_center_page.dart
  10. 27
      lib/pages/mine/edit_info_page.dart
  11. 3
      lib/pages/mine/mine_page.dart
  12. 30
      lib/pages/mine/rose_page.dart
  13. 3
      lib/pages/mine/signature_page.dart

22
lib/controller/discover/visitor_controller.dart

@ -9,10 +9,8 @@ class VisitorController extends GetxController {
var visitors = <MarriageData>[].obs;
// Refresh controllers
final EasyRefreshController refreshController = EasyRefreshController(
controlFinishRefresh: true,
controlFinishLoad: true,
);
late final EasyRefreshController refreshController;
//
var currentPage = 1.obs;
@ -25,6 +23,11 @@ class VisitorController extends GetxController {
@override
void onInit() {
super.onInit();
refreshController = EasyRefreshController(
controlFinishRefresh: true,
controlFinishLoad: true,
);
_userApi = Get.find<UserApi>();
loadInitialData();
}
@ -44,6 +47,7 @@ class VisitorController extends GetxController {
//
void onRefresh() async {
hasMore.value = true;
currentPage.value = 1;
final result = await _fetchVisitorData(pageNum: currentPage.value);
@ -60,16 +64,12 @@ class VisitorController extends GetxController {
//
void onLoadMore() async {
print('onLoadMore');
if (!hasMore.value) {
return;
}
final result = await _fetchVisitorData(pageNum: currentPage.value + 1);
currentPage.value++;
final int current = result['current'] as int;
final int total = result['pages'] as int;
hasMore.value = current < total;
visitors.addAll(result['records']);
if (hasMore.value) {
if((result['records'].length ?? 0) == 10){
refreshController.finishLoad(IndicatorResult.success);
} else {
refreshController.finishLoad(IndicatorResult.noMore);

6
lib/controller/mine/edit_info_controller.dart

@ -302,8 +302,8 @@ class EditInfoController extends GetxController {
birthday.value = userData.value?.birthDate ?? "";
message.value = userData.value?.describeInfo ?? "";
realDescribe.value = userData.value?.describeInfo ?? "";
message.value = (userData.value?.auditDescribeInfo != null && userData.value?.auditDescribeInfo != "") ? (userData.value?.auditDescribeInfo ?? "") : (userData.value?.describeInfo ?? "");
realDescribe.value = message.value;
messageController.value.value = TextEditingValue(
text: message.value,
@ -624,6 +624,8 @@ class EditInfoController extends GetxController {
realDescribe.value = message.value;
getInfo();
SmartDialog.showToast("交友心声已提交审核");
Get.back();
} else{
SmartDialog.showToast(imgAuditResp.data.message);

4
lib/model/mine/user_data.dart

@ -36,6 +36,7 @@ class UserData {
final int? incomeCode;
final String? income;
final String? describeInfo;
final String? auditDescribeInfo;
final int? domicilePlaceProvinceCode;
final String? domicilePlaceProvinceName;
final int? domicilePlaceCityCode;
@ -103,6 +104,7 @@ class UserData {
this.incomeCode,
this.income,
this.describeInfo,
this.auditDescribeInfo,
this.domicilePlaceProvinceCode,
this.domicilePlaceProvinceName,
this.domicilePlaceCityCode,
@ -175,6 +177,7 @@ class UserData {
incomeCode: json['incomeCode'],
income: json['income'],
describeInfo: json['describeInfo'],
auditDescribeInfo: json['auditDescribeInfo'],
domicilePlaceProvinceCode: json['domicilePlaceProvinceCode'],
domicilePlaceProvinceName: json['domicilePlaceProvinceName'],
domicilePlaceCityCode: json['domicilePlaceCityCode'],
@ -243,6 +246,7 @@ class UserData {
'incomeCode': incomeCode,
'income': income,
'describeInfo': describeInfo,
'auditDescribeInfo': auditDescribeInfo,
'domicilePlaceProvinceCode': domicilePlaceProvinceCode,
'domicilePlaceProvinceName': domicilePlaceProvinceName,
'domicilePlaceCityCode': domicilePlaceCityCode,

15
lib/pages/discover/visitor_list_page.dart

@ -70,8 +70,6 @@ class _VisitorListPagePageState extends State<VisitorListPage> {
return EasyRefresh(
controller: visitorController.refreshController,
onRefresh: visitorController.onRefresh,
onLoad: visitorController.onLoadMore,
header: ClassicHeader(
dragText: '下拉刷新',
armedText: '释放刷新',
@ -93,6 +91,15 @@ class _VisitorListPagePageState extends State<VisitorListPage> {
noMoreText: '没有更多数据',
showMessage: false,
),
//
onRefresh: () async {
visitorController.onRefresh();
},
//
onLoad: () async {
visitorController.onLoadMore();
},
child: GridView.builder(
padding: EdgeInsets.only(top: 8.w, left: 10.w, right: 8.w, bottom: 0.w),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
@ -154,9 +161,9 @@ class VisitorItem extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if(visitor.describeInfo.isNotEmpty)SizedBox(
if(visitor.nickName.isNotEmpty)SizedBox(
width: 156.w,
child: Text(visitor.describeInfo,
child: Text(visitor.nickName,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(

83
lib/pages/home/content_card.dart

@ -61,54 +61,6 @@ class _CardHeader extends StatelessWidget {
),
),
),
// if (isOnline)
// Positioned(
// right: 6,
// bottom: 1,
// child: Container(
// width: 12,
// height: 12,
// decoration: BoxDecoration(
// color: isOnline
// ? const Color(0xFF2ED573)
// : const Color(0xFFCCCCCC), // 线绿线
// shape: BoxShape.circle,
// boxShadow: isOnline
// ? const [
// BoxShadow(
// color: Color(0x332ED573),
// blurRadius: 4,
// offset: Offset(0, 2),
// ),
// ]
// : [],
// ),
// ),
// ),
// if (isLive)
// Positioned(
// bottom: 0,
// left: 0,
// right: 0,
// child: Container(
// width: 37,
// height: 14,
// alignment: Alignment.center, //
// decoration: BoxDecoration(
// image: DecorationImage(
// image: AssetImage(Assets.imagesBtnBgIcon),
// ),
// ),
// child: const Text(
// '直播中',
// style: TextStyle(
// color: Colors.white,
// fontSize: 8,
// fontWeight: FontWeight.w600,
// ),
// ),
// ),
// ),
],
),
const SizedBox(width: 10),
@ -135,26 +87,6 @@ class _CardHeader extends StatelessWidget {
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
// 线
// if (isOnline == true)
// Container(
// padding: const EdgeInsets.symmetric(
// horizontal: 8,
// vertical: 2,
// ),
// decoration: BoxDecoration(
// color: Color.fromRGBO(234, 255, 219, 1),
// borderRadius: BorderRadius.circular(12),
// ),
// child: Text(
// isOnline ? '在线' : '',
// style: TextStyle(
// fontSize: 9,
// color: Color.fromRGBO(38, 199, 124, 1),
// ),
// ),
// ),
//
if (item.isRealNameCertified == true)
Container(
padding: const EdgeInsets.symmetric(
@ -288,8 +220,8 @@ class _CardHeader extends StatelessWidget {
},
child: Image.asset(
_getButtonImage(isLive, isOnline),
width: isLive ? 60 : 40,
height: 20,
width: isLive ? 60 : 50,
height: 30,
),
),
],
@ -324,13 +256,7 @@ class ContentCard extends StatelessWidget {
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
boxShadow: const [
BoxShadow(
color: Color(0x14000000),
blurRadius: 8,
offset: Offset(0, 4),
),
],
),
padding: const EdgeInsets.all(12),
child: Column(
@ -338,7 +264,6 @@ class ContentCard extends StatelessWidget {
children: [
// 线 - HI位置
_CardHeader(item: item),
const SizedBox(height: 8),
// -
_buildContent(),
@ -372,7 +297,7 @@ class ContentCard extends StatelessWidget {
//
if (item.photoList != null && item.photoList!.isNotEmpty) {
contentWidgets.add(const SizedBox(height: 16));
contentWidgets.add(const SizedBox(height: 6));
// = ( - padding - ListView左右padding - ) / 3
// padding: 12 * 2 = 24

15
lib/pages/home/home_page.dart

@ -37,6 +37,21 @@ class _HomePageState extends State<HomePage>
width: double.infinity,
height: double.infinity,
),
Positioned.fill(
child: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Colors.transparent, // rgba(248, 242, 255, 1)
Color.fromRGBO(242, 242, 242, .2), // rgba(247, 247, 247, 1)
],
stops: [0.0, 1.0],
),
),
),
),
Scaffold(
backgroundColor: Colors.transparent,
appBar: _buildAppBar(controller),

4
lib/pages/home/user_information_page.dart

@ -98,7 +98,7 @@ class UserInformationPage extends StatelessWidget {
),
Positioned(
left: 120.w,
top: 310.w,
top: miId != GlobalData().userData!.id ? 300.w : 310.w,
width: 240.w,
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
@ -322,7 +322,7 @@ class UserInformationPage extends StatelessWidget {
),
SizedBox(height: 8.w,),
Text(
controller.userData.value.describeInfo ?? "我想找一个有缘的异性,快来联系我吧。",
(miId == GlobalData().userData!.id && GlobalData().userData!.auditDescribeInfo != null && GlobalData().userData!.auditDescribeInfo != "") ? (GlobalData().userData!.auditDescribeInfo ?? "") : (controller.userData.value.describeInfo ?? "我想找一个有缘的异性,快来联系我吧。"),
style: TextStyle(
fontSize: 14.w,
color: const Color.fromRGBO(144, 144, 144, 1)

5
lib/pages/main/main_page.dart

@ -107,6 +107,7 @@ class _MainPageState extends State<MainPage> {
TDBottomTabBarBasicType.iconText,
componentType: TDBottomTabBarComponentType.normal,
useVerticalDivider: false,
barHeight: 61,
navigationTabs: [
tabItem('首页', Assets.imagesHomePre, Assets.imagesHomeNol, 0, 0),
tabItem('找对象', Assets.imagesDiscoverPre, Assets.imagesDiscoverNol, 1, 0),
@ -121,8 +122,8 @@ class _MainPageState extends State<MainPage> {
TDBottomTabBarTabConfig tabItem(String title, String selectedIcon, String unselectedIcon, int index, int unreadCount) {
return TDBottomTabBarTabConfig(
tabText: title,
selectedIcon: Image.asset(selectedIcon, width: 25, height: 25, fit: BoxFit.cover),
unselectedIcon: Image.asset(unselectedIcon, width: 25, height: 25, fit: BoxFit.cover),
selectedIcon: Image.asset(selectedIcon, width: 30, height: 30, fit: BoxFit.cover),
unselectedIcon: Image.asset(unselectedIcon, width: 30, height: 30, fit: BoxFit.cover),
selectTabTextStyle: TextStyle(color: Color(0xFFED4AC3)),
unselectTabTextStyle: TextStyle(color: Color(0xFF999999)),
badgeConfig: BadgeConfig(

3
lib/pages/mine/auth_center_page.dart

@ -104,6 +104,9 @@ class AuthCenterPage extends StatelessWidget {
),
).onTap(() async{
if(item.index == 1) {
if(item.authed){
return;
}
await Get.to(() => PhonePage());
} else if(item.index == 2){
await Get.to(() => EditInfoPage());

27
lib/pages/mine/edit_info_page.dart

@ -379,9 +379,8 @@ class _EditInfoPageState extends State<EditInfoPage> {
],
),
SizedBox(height: 5.w,),
Container(
SizedBox(
width: 340.w,
margin: EdgeInsets.only(bottom: 35.w),
child: Wrap(
spacing: 5.w,
runSpacing: 5.w,
@ -834,7 +833,7 @@ class _EditInfoPageState extends State<EditInfoPage> {
top: 14.w,
bottom: 14.w
),
margin: EdgeInsets.only(top: 10.w),
margin: EdgeInsets.only(top: 10.w, bottom: 15.w),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(9.w))
@ -842,6 +841,7 @@ class _EditInfoPageState extends State<EditInfoPage> {
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"交友心声",
@ -849,6 +849,18 @@ class _EditInfoPageState extends State<EditInfoPage> {
fontSize: 15.w,
fontWeight: FontWeight.w500
),
),
(controller.userData.value?.auditDescribeInfo != null && controller.userData.value?.auditDescribeInfo != "") ? Text(
"审核中",
style: TextStyle(
fontSize: 13.w,
fontWeight: FontWeight.w500,
color: Color.fromRGBO(191, 191, 191, 1)
),
) : Icon(
Icons.keyboard_arrow_right,
size: 15.w,
color: Color.fromRGBO(191, 191, 191, 1)
)
],
),
@ -856,10 +868,11 @@ class _EditInfoPageState extends State<EditInfoPage> {
Container(
alignment: Alignment.centerLeft,
child: Text(
controller.realDescribe.value,
controller.realDescribe.value != "" ? controller.realDescribe.value : "请输入交友心声",
style: TextStyle(
fontSize: 13.w,
fontWeight: FontWeight.w500
fontWeight: FontWeight.w500,
color: controller.realDescribe.value != "" ? const Color.fromRGBO(51, 51, 51, 1) : const Color.fromRGBO(191, 191, 191, 1),
),
),
)
@ -867,6 +880,10 @@ class _EditInfoPageState extends State<EditInfoPage> {
],
),
).onTap((){
if(controller.userData.value?.auditDescribeInfo != null && controller.userData.value?.auditDescribeInfo != ""){
SmartDialog.showToast("交友心声正在审核中,请勿重复提交");
return;
}
Get.to(() => SignaturePage());
}),
],

3
lib/pages/mine/mine_page.dart

@ -183,11 +183,10 @@ class _MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin{
)
],
),
SizedBox(height: 11.w,),
Text(
"ID:${controller.userId.value ?? ""}",
style: TextStyle(
fontSize: 12.w,
fontSize: 10.w,
color: const Color.fromRGBO(51, 51, 51, 1),
fontWeight: FontWeight.w500
),

30
lib/pages/mine/rose_page.dart

@ -3,7 +3,9 @@ import 'package:dating_touchme_app/controller/mine/rose_controller.dart';
import 'package:dating_touchme_app/extension/ex_widget.dart';
import 'package:dating_touchme_app/generated/assets.dart';
import 'package:dating_touchme_app/model/mine/rose_data.dart';
import 'package:dating_touchme_app/pages/mine/open_webview.dart';
import 'package:dating_touchme_app/pages/mine/rose_history_page.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
@ -170,8 +172,8 @@ class RosePage extends StatelessWidget {
fontSize: 11.w,
fontWeight: FontWeight.w500
),
children: const [
TextSpan(
children: [
const TextSpan(
text: "充值既代表同意",
style: TextStyle(
color: Color.fromRGBO(189, 189, 189, 1)
@ -179,15 +181,27 @@ class RosePage extends StatelessWidget {
),
TextSpan(
text: "《趣恋恋充值协议》",
style: TextStyle(
style: const TextStyle(
color: Color.fromRGBO(71, 123, 255, 1)
)
),
recognizer: TapGestureRecognizer()..onTap = () {
Get.to(() => OpenWebView(url: "https://www.quzhaoqin.com/payment.html"));
},
),
TextSpan(
text: "和隐私政策",
style: TextStyle(
color: Color.fromRGBO(189, 189, 189, 1)
)
text: "",
style: TextStyle(
color: Color.fromRGBO(189, 189, 189, 1)
)
),
TextSpan(
text: "《隐私政策》",
style: const TextStyle(
color: Color.fromRGBO(71, 123, 255, 1)
),
recognizer: TapGestureRecognizer()..onTap = () {
Get.to(() => OpenWebView(url: "https://www.quzhaoqin.com/information.html"));
},
),
]
),

3
lib/pages/mine/signature_page.dart

@ -82,8 +82,7 @@ class SignaturePage extends StatelessWidget {
),
),
).onTap(() async {
await controller.savaDescribeInfo();
Get.back();
controller.savaDescribeInfo();
}),
),
);

Loading…
Cancel
Save