14 changed files with 394 additions and 5 deletions
Unified View
Diff Options
-
BINassets/images/login_bg_white.png
-
BINassets/images/real_login_bg.png
-
BINassets/images/real_logo.png
-
4lib/controller/mine/login_controller.dart
-
3lib/generated/assets.dart
-
3lib/im/im_manager.dart
-
3lib/main.dart
-
3lib/network/network_config.dart
-
19lib/pages/home/real_home_page.dart
-
85lib/pages/home/real_home_timeline_item.dart
-
169lib/pages/mine/phone_login_page.dart
-
104lib/pages/mine/real_login_page.dart
-
3lib/pages/setting/deactivate_page.dart
-
3lib/pages/setting/setting_page.dart
@ -0,0 +1,85 @@ |
|||||
|
import 'package:dating_touchme_app/generated/assets.dart'; |
||||
|
import 'package:flutter/material.dart'; |
||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
|
|
||||
|
class RealHomeTimelineItem extends StatefulWidget { |
||||
|
const RealHomeTimelineItem({super.key}); |
||||
|
|
||||
|
@override |
||||
|
State<RealHomeTimelineItem> createState() => _RealHomeTimelineItemState(); |
||||
|
} |
||||
|
|
||||
|
class _RealHomeTimelineItemState extends State<RealHomeTimelineItem> { |
||||
|
@override |
||||
|
Widget build(BuildContext context) { |
||||
|
return ClipRRect( |
||||
|
borderRadius: BorderRadius.all(Radius.circular(8.w)), |
||||
|
child: Container( |
||||
|
width: 170.w, |
||||
|
height: 205.w, |
||||
|
color: Colors.white, |
||||
|
child: Column( |
||||
|
children: [ |
||||
|
Image.asset( |
||||
|
Assets.imagesUserAvatar, |
||||
|
width: 170.w, |
||||
|
height: 170.w, |
||||
|
), |
||||
|
Container( |
||||
|
width: 170.w, |
||||
|
height: 35.w, |
||||
|
color: Colors.white, |
||||
|
padding: EdgeInsets.symmetric(horizontal: 10.w), |
||||
|
child: Row( |
||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
||||
|
children: [ |
||||
|
Row( |
||||
|
children: [ |
||||
|
ClipRRect( |
||||
|
borderRadius: BorderRadius.all(Radius.circular(23.w)), |
||||
|
child: Image.asset( |
||||
|
Assets.imagesUserAvatar, |
||||
|
width: 23.w, |
||||
|
height: 23.w, |
||||
|
), |
||||
|
), |
||||
|
SizedBox(width: 3.w,), |
||||
|
Text( |
||||
|
"大西瓜", |
||||
|
style: TextStyle( |
||||
|
fontSize: 12.w, |
||||
|
fontWeight: FontWeight.w400 |
||||
|
), |
||||
|
) |
||||
|
], |
||||
|
), |
||||
|
Row( |
||||
|
children: [ |
||||
|
Row( |
||||
|
children: [ |
||||
|
Image.asset( |
||||
|
(false) ? Assets.imagesLikeActive : Assets.imagesLikeIcon, |
||||
|
width: 14.w, |
||||
|
height: 12.w, |
||||
|
), |
||||
|
SizedBox(width: 6.w,), |
||||
|
Text( |
||||
|
"${23}", |
||||
|
style: TextStyle( |
||||
|
fontSize: 11.w, |
||||
|
color: const Color.fromRGBO(144, 144, 144, .6) |
||||
|
), |
||||
|
) |
||||
|
], |
||||
|
) |
||||
|
], |
||||
|
) |
||||
|
], |
||||
|
), |
||||
|
) |
||||
|
], |
||||
|
), |
||||
|
), |
||||
|
); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,169 @@ |
|||||
|
import 'package:dating_touchme_app/controller/mine/login_controller.dart'; |
||||
|
import 'package:dating_touchme_app/extension/ex_widget.dart'; |
||||
|
import 'package:flutter/material.dart'; |
||||
|
import 'package:flutter/services.dart'; |
||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
|
import 'package:get/get.dart'; |
||||
|
import 'package:pinput/pinput.dart'; |
||||
|
|
||||
|
class PhoneLoginPage extends StatelessWidget { |
||||
|
const PhoneLoginPage({super.key}); |
||||
|
|
||||
|
@override |
||||
|
Widget build(BuildContext context) { |
||||
|
return GetX<LoginController>( |
||||
|
init: LoginController(), |
||||
|
builder: (controller){ |
||||
|
return Scaffold( |
||||
|
backgroundColor: Colors.white, |
||||
|
body: !(controller.isSend.value) ? Container( |
||||
|
width: 375.w, |
||||
|
padding: EdgeInsets.only( |
||||
|
top: 310.w, |
||||
|
left: 25.w, |
||||
|
right: 25.w |
||||
|
), |
||||
|
child: Column( |
||||
|
children: [ |
||||
|
Container( |
||||
|
height: 52.w, |
||||
|
decoration: BoxDecoration( |
||||
|
borderRadius: BorderRadius.all(Radius.circular(9.w)), |
||||
|
border: Border.all(width: 1.w, color: const Color.fromRGBO(230, 230, 230, 1)) |
||||
|
), |
||||
|
child: Center( |
||||
|
child: TextField( |
||||
|
decoration: const InputDecoration( |
||||
|
hintText: '请输入你的手机号', |
||||
|
border: InputBorder.none, |
||||
|
contentPadding: EdgeInsets.symmetric( |
||||
|
horizontal: 15, |
||||
|
vertical: 0, |
||||
|
), |
||||
|
counterText: '', |
||||
|
), |
||||
|
keyboardType: TextInputType.phone, |
||||
|
inputFormatters: [ |
||||
|
// 只允许 0-9 |
||||
|
FilteringTextInputFormatter.digitsOnly, |
||||
|
], |
||||
|
maxLength: 11, |
||||
|
onChanged: (value) { |
||||
|
controller.phoneNumber.value = value; |
||||
|
}, |
||||
|
style: const TextStyle(fontSize: 16), |
||||
|
), |
||||
|
), |
||||
|
), |
||||
|
SizedBox(height: 10.w,), |
||||
|
Text( |
||||
|
"未注册的手机号将在登录后自动注册", |
||||
|
style: TextStyle( |
||||
|
fontSize: 11.w, |
||||
|
color: const Color.fromRGBO(189, 189, 189, 1) |
||||
|
), |
||||
|
), |
||||
|
SizedBox(height: 30.w,), |
||||
|
Container( |
||||
|
width: 325.w, |
||||
|
height: 52.w, |
||||
|
decoration: BoxDecoration( |
||||
|
borderRadius: BorderRadius.all(Radius.circular(52.w)), |
||||
|
gradient: controller.phoneNumber.value.isNotEmpty ? LinearGradient( |
||||
|
begin: Alignment.centerLeft, |
||||
|
end: Alignment.centerRight, |
||||
|
colors: [ |
||||
|
Color.fromRGBO(131, 89, 255, 1), |
||||
|
Color.fromRGBO(61, 138, 224, 1), |
||||
|
], |
||||
|
) : null, |
||||
|
color: const Color.fromRGBO(217, 217, 217, 1) |
||||
|
), |
||||
|
child: Center( |
||||
|
child: Text( |
||||
|
"获取验证码", |
||||
|
style: TextStyle( |
||||
|
fontSize: 18.w, |
||||
|
color: Colors.white |
||||
|
), |
||||
|
), |
||||
|
), |
||||
|
).onTap(() { |
||||
|
controller.isSendingCode.value || |
||||
|
controller.countdownSeconds.value > 0 |
||||
|
? null |
||||
|
: controller.getVerificationCode(); |
||||
|
}), |
||||
|
], |
||||
|
), |
||||
|
) : Container( |
||||
|
width: 375.w, |
||||
|
padding: EdgeInsets.only( |
||||
|
top: 271.w, |
||||
|
left: 25.w, |
||||
|
right: 25.w |
||||
|
), |
||||
|
child: Column( |
||||
|
children: [ |
||||
|
Text( |
||||
|
"已发送到${controller.phoneNumber.value}", |
||||
|
style: TextStyle( |
||||
|
fontSize: 14.w |
||||
|
), |
||||
|
), |
||||
|
SizedBox(height: 20.w,), |
||||
|
|
||||
|
Pinput( |
||||
|
length: 6, |
||||
|
controller: controller.passwordController.value, |
||||
|
inputFormatters: [ |
||||
|
// 只允许 0-9 |
||||
|
FilteringTextInputFormatter.digitsOnly, |
||||
|
], |
||||
|
onCompleted: (pin) { |
||||
|
controller.verificationCode.value = pin; |
||||
|
controller.isLoggingIn.value |
||||
|
? null |
||||
|
: controller.login(); |
||||
|
}, |
||||
|
), |
||||
|
SizedBox(height: 40.w,), |
||||
|
Container( |
||||
|
width: 325.w, |
||||
|
height: 52.w, |
||||
|
decoration: BoxDecoration( |
||||
|
borderRadius: BorderRadius.all(Radius.circular(52.w)), |
||||
|
gradient: controller.countdownSeconds.value <= 0 ? LinearGradient( |
||||
|
begin: Alignment.centerLeft, |
||||
|
end: Alignment.centerRight, |
||||
|
colors: [ |
||||
|
Color.fromRGBO(131, 89, 255, 1), |
||||
|
Color.fromRGBO(61, 138, 224, 1), |
||||
|
], |
||||
|
) : null, |
||||
|
color: const Color.fromRGBO(217, 217, 217, 1) |
||||
|
), |
||||
|
child: Center( |
||||
|
child: Text( |
||||
|
controller.countdownSeconds.value > 0 ? "获取验证码 ${controller.countdownSeconds.value}s" : "获取验证码", |
||||
|
style: TextStyle( |
||||
|
fontSize: 18.w, |
||||
|
color: Colors.white |
||||
|
), |
||||
|
), |
||||
|
), |
||||
|
).onTap(() { |
||||
|
controller.isSendingCode.value || |
||||
|
controller.countdownSeconds.value > 0 |
||||
|
? null |
||||
|
: controller.getVerificationCode(); |
||||
|
}), |
||||
|
], |
||||
|
), |
||||
|
), |
||||
|
); |
||||
|
}, |
||||
|
); |
||||
|
} |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,104 @@ |
|||||
|
import 'package:dating_touchme_app/extension/ex_widget.dart'; |
||||
|
import 'package:dating_touchme_app/generated/assets.dart'; |
||||
|
import 'package:dating_touchme_app/pages/mine/phone_login_page.dart'; |
||||
|
import 'package:flutter/material.dart'; |
||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
|
import 'package:get/get.dart'; |
||||
|
|
||||
|
class RealLoginPage extends StatefulWidget { |
||||
|
const RealLoginPage({super.key}); |
||||
|
|
||||
|
@override |
||||
|
State<RealLoginPage> createState() => _RealLoginPageState(); |
||||
|
} |
||||
|
|
||||
|
class _RealLoginPageState extends State<RealLoginPage> { |
||||
|
@override |
||||
|
Widget build(BuildContext context) { |
||||
|
return Stack( |
||||
|
children: [ |
||||
|
Container( |
||||
|
width: 375.w, |
||||
|
height: 812.h, |
||||
|
color: Colors.white, |
||||
|
), |
||||
|
Image.asset( |
||||
|
Assets.imagesRealLoginBg, |
||||
|
width: 375.w, |
||||
|
fit: BoxFit.cover, |
||||
|
alignment: AlignmentGeometry.topCenter, |
||||
|
), |
||||
|
Image.asset( |
||||
|
Assets.imagesLoginBgWhite, |
||||
|
width: 375.w, |
||||
|
fit: BoxFit.cover, |
||||
|
alignment: AlignmentGeometry.topCenter, |
||||
|
), |
||||
|
Scaffold( |
||||
|
backgroundColor: Colors.transparent, |
||||
|
body: Container( |
||||
|
width: 375.w, |
||||
|
padding: EdgeInsets.only( |
||||
|
top: 126.w, |
||||
|
left: 20.w, |
||||
|
right: 20.w |
||||
|
), |
||||
|
child: Column( |
||||
|
children: [ |
||||
|
Image.asset( |
||||
|
Assets.imagesRealLogo, |
||||
|
width: 55.w, |
||||
|
height: 55.w, |
||||
|
), |
||||
|
SizedBox(height: 12.w,), |
||||
|
Text( |
||||
|
"快乐星球", |
||||
|
style: TextStyle( |
||||
|
fontSize: 24.w |
||||
|
), |
||||
|
), |
||||
|
SizedBox(height: 261.w,), |
||||
|
Container( |
||||
|
width: 335.w, |
||||
|
height: 52.w, |
||||
|
decoration: BoxDecoration( |
||||
|
borderRadius: BorderRadius.all(Radius.circular(52.w)), |
||||
|
gradient: LinearGradient( |
||||
|
begin: Alignment.centerLeft, |
||||
|
end: Alignment.centerRight, |
||||
|
colors: [ |
||||
|
Color.fromRGBO(131, 89, 255, 1), |
||||
|
Color.fromRGBO(61, 138, 224, 1), |
||||
|
], |
||||
|
), |
||||
|
), |
||||
|
child: Row( |
||||
|
mainAxisAlignment: MainAxisAlignment.center, |
||||
|
children: [ |
||||
|
Icon( |
||||
|
Icons.phone_iphone, |
||||
|
size: 28.w, |
||||
|
color: Colors.white, |
||||
|
), |
||||
|
SizedBox(width: 12.w,), |
||||
|
Text( |
||||
|
"手机登录注册", |
||||
|
style: TextStyle( |
||||
|
fontSize: 18.w, |
||||
|
color: Colors.white |
||||
|
), |
||||
|
) |
||||
|
], |
||||
|
), |
||||
|
).onTap(() { |
||||
|
Get.to(() => PhoneLoginPage()); |
||||
|
}), |
||||
|
|
||||
|
], |
||||
|
), |
||||
|
), |
||||
|
) |
||||
|
], |
||||
|
); |
||||
|
} |
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save