|
@@ -1,6 +1,7 @@
|
|
|
import 'package:common_pub/screen.dart';
|
|
import 'package:common_pub/screen.dart';
|
|
|
import 'package:common_pub/utils.dart';
|
|
import 'package:common_pub/utils.dart';
|
|
|
import 'package:flutter/gestures.dart';
|
|
import 'package:flutter/gestures.dart';
|
|
|
|
|
+import 'package:pretty_qr_code/pretty_qr_code.dart';
|
|
|
import 'package:rive/rive.dart';
|
|
import 'package:rive/rive.dart';
|
|
|
import 'package:track_common/widget/prelude.dart';
|
|
import 'package:track_common/widget/prelude.dart';
|
|
|
|
|
|
|
@@ -66,7 +67,6 @@ class LoginView extends GetView<LoginController> {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return Container(
|
|
return Container(
|
|
|
- // margin: EdgeInsets.fromLTRB(context.width*(6), context.width*5.6), context.width*(6), context.width*(2)),
|
|
|
|
|
padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top),
|
|
padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top),
|
|
|
decoration: const BoxDecoration(
|
|
decoration: const BoxDecoration(
|
|
|
// color: Color(0xffffcb00),
|
|
// color: Color(0xffffcb00),
|
|
@@ -79,51 +79,25 @@ class LoginView extends GetView<LoginController> {
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
children: [
|
|
children: [
|
|
|
- Spacer(),
|
|
|
|
|
- Text(
|
|
|
|
|
|
|
+ const Spacer(),
|
|
|
|
|
+ const Text(
|
|
|
'定向运动活动现场监控系统',
|
|
'定向运动活动现场监控系统',
|
|
|
textAlign: TextAlign.center,
|
|
textAlign: TextAlign.center,
|
|
|
style: TextStyle(fontSize: 29.87, fontWeight: FontWeight.w500),
|
|
style: TextStyle(fontSize: 29.87, fontWeight: FontWeight.w500),
|
|
|
),
|
|
),
|
|
|
- // Expanded(child: wInput(context)),
|
|
|
|
|
SizedBox(height: inputHeight, child: wInput(context)),
|
|
SizedBox(height: inputHeight, child: wInput(context)),
|
|
|
Image.asset(Assets.imagesIcLoginLogo, height: 24, package: package),
|
|
Image.asset(Assets.imagesIcLoginLogo, height: 24, package: package),
|
|
|
- Spacer()
|
|
|
|
|
|
|
+ const Spacer()
|
|
|
// Expanded(flex: 10,child: wExtra()),
|
|
// Expanded(flex: 10,child: wExtra()),
|
|
|
],
|
|
],
|
|
|
));
|
|
));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- InputDecoration wInputDecoration(hintText) {
|
|
|
|
|
- return InputDecoration(
|
|
|
|
|
- // isCollapsed: true,
|
|
|
|
|
- contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
|
|
|
|
- hintText: hintText,
|
|
|
|
|
- // hintStyle: TextStyle(fontSize: 12.0.rpx),
|
|
|
|
|
- focusedBorder: OutlineInputBorder(
|
|
|
|
|
- borderRadius: BorderRadius.circular(4.0),
|
|
|
|
|
- borderSide: const BorderSide(
|
|
|
|
|
- color: Colors.blue,
|
|
|
|
|
- width: 1.0,
|
|
|
|
|
- ),
|
|
|
|
|
- ),
|
|
|
|
|
- enabledBorder: OutlineInputBorder(
|
|
|
|
|
- borderRadius: BorderRadius.circular(4.0),
|
|
|
|
|
- borderSide: const BorderSide(
|
|
|
|
|
- color: Color(0xffaaaaaa),
|
|
|
|
|
- width: 1.0,
|
|
|
|
|
- ),
|
|
|
|
|
- ),
|
|
|
|
|
- );
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
Widget wInput(BuildContext context) {
|
|
Widget wInput(BuildContext context) {
|
|
|
- return Container(
|
|
|
|
|
|
|
+ return Obx(() => Container(
|
|
|
width: 432.8,
|
|
width: 432.8,
|
|
|
height: 424,
|
|
height: 424,
|
|
|
- margin: EdgeInsets.only(top: 22.04, bottom: 21),
|
|
|
|
|
- padding: EdgeInsets.fromLTRB(
|
|
|
|
|
- context.wp(6), context.wp(3.6), context.wp(6), context.wp(2)),
|
|
|
|
|
|
|
+ margin: const EdgeInsets.only(top: 22.04, bottom: 21),
|
|
|
decoration: BoxDecoration(
|
|
decoration: BoxDecoration(
|
|
|
color: const Color(0xffffffff),
|
|
color: const Color(0xffffffff),
|
|
|
borderRadius: BorderRadius.circular(context.wp(1.0)),
|
|
borderRadius: BorderRadius.circular(context.wp(1.0)),
|
|
@@ -134,55 +108,7 @@ class LoginView extends GetView<LoginController> {
|
|
|
blurRadius: 6)
|
|
blurRadius: 6)
|
|
|
],
|
|
],
|
|
|
),
|
|
),
|
|
|
- child: Column(
|
|
|
|
|
- children: [
|
|
|
|
|
- // const Spacer(flex: 20),
|
|
|
|
|
- TextFormField(
|
|
|
|
|
- decoration: wInputDecoration('请输入手机号'),
|
|
|
|
|
- validator: (String? value) {
|
|
|
|
|
- if (value == null || !value.isPhoneNumber) {
|
|
|
|
|
- return '请输入正确的手机号';
|
|
|
|
|
- }
|
|
|
|
|
- return null;
|
|
|
|
|
- },
|
|
|
|
|
- onChanged: (value) {
|
|
|
|
|
- controller.phone.value = value;
|
|
|
|
|
- },
|
|
|
|
|
- keyboardType: TextInputType.phone),
|
|
|
|
|
- const Spacer(flex: 50),
|
|
|
|
|
- Stack(
|
|
|
|
|
- alignment: Alignment.centerRight,
|
|
|
|
|
- children: [
|
|
|
|
|
- TextFormField(
|
|
|
|
|
- decoration: wInputDecoration('请输入验证码'),
|
|
|
|
|
- onChanged: (value) {
|
|
|
|
|
- controller.password.value = value;
|
|
|
|
|
- },
|
|
|
|
|
- keyboardType: TextInputType.number,
|
|
|
|
|
- ),
|
|
|
|
|
- Padding(
|
|
|
|
|
- padding: const EdgeInsets.only(right: 4),
|
|
|
|
|
- child: SizedBox(
|
|
|
|
|
- width: 84,
|
|
|
|
|
- height: 37,
|
|
|
|
|
- child: Obx(() => GetCodeButton(
|
|
|
|
|
- codeRetryLeft: controller.codeRetryLeft.value,
|
|
|
|
|
- onPressed: () => controller.onGetCode(),
|
|
|
|
|
- )),
|
|
|
|
|
- ),
|
|
|
|
|
- ),
|
|
|
|
|
- ],
|
|
|
|
|
- ),
|
|
|
|
|
- // _TextContract(),
|
|
|
|
|
- const Spacer(flex: 80),
|
|
|
|
|
- button(
|
|
|
|
|
- context,
|
|
|
|
|
- '登 录',
|
|
|
|
|
- () => controller.onSignIn(),
|
|
|
|
|
- ),
|
|
|
|
|
- const Spacer(flex: 10),
|
|
|
|
|
- ],
|
|
|
|
|
- ));
|
|
|
|
|
|
|
+ child: controller.isPageQrCode.value ? _InputQrCode() : _InputPhone()));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
Widget wExtra() {
|
|
Widget wExtra() {
|
|
@@ -371,8 +297,6 @@ class AnimatedColors extends AnimatedWidget {
|
|
|
@override
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
|
final animation = listenable as Animation<double>;
|
|
final animation = listenable as Animation<double>;
|
|
|
- var style = (context.textTheme.titleLarge ?? const TextStyle())
|
|
|
|
|
- .copyWith(color: Colors.white, fontSize: context.wp(8.33));
|
|
|
|
|
|
|
|
|
|
var children = <Widget>[];
|
|
var children = <Widget>[];
|
|
|
|
|
|
|
@@ -413,3 +337,157 @@ class AnimatedColors extends AnimatedWidget {
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+class _InputPhone extends GetView<LoginController> {
|
|
|
|
|
+ @override
|
|
|
|
|
+ Widget build(BuildContext context) {
|
|
|
|
|
+ return Stack(
|
|
|
|
|
+ children: [
|
|
|
|
|
+ Align(
|
|
|
|
|
+ alignment: Alignment.topRight,
|
|
|
|
|
+ child: GestureDetector(
|
|
|
|
|
+ onTap: () => controller.toQrcode(),
|
|
|
|
|
+ child: Image.asset(Assets.imagesIcLoginQrcode,
|
|
|
|
|
+ package: package, width: 58.5, height: 58.5),
|
|
|
|
|
+ )),
|
|
|
|
|
+ Padding(
|
|
|
|
|
+ padding: EdgeInsets.fromLTRB(
|
|
|
|
|
+ context.wp(6), context.wp(3.6), context.wp(6), context.wp(2)),
|
|
|
|
|
+ child: Column(
|
|
|
|
|
+ children: [
|
|
|
|
|
+ // const Spacer(flex: 20),
|
|
|
|
|
+ TextFormField(
|
|
|
|
|
+ decoration: wInputDecoration('请输入手机号'),
|
|
|
|
|
+ validator: (String? value) {
|
|
|
|
|
+ if (value == null || !value.isPhoneNumber) {
|
|
|
|
|
+ return '请输入正确的手机号';
|
|
|
|
|
+ }
|
|
|
|
|
+ return null;
|
|
|
|
|
+ },
|
|
|
|
|
+ onChanged: (value) {
|
|
|
|
|
+ controller.phone.value = value;
|
|
|
|
|
+ },
|
|
|
|
|
+ keyboardType: TextInputType.phone),
|
|
|
|
|
+ const Spacer(flex: 50),
|
|
|
|
|
+ Stack(
|
|
|
|
|
+ alignment: Alignment.centerRight,
|
|
|
|
|
+ children: [
|
|
|
|
|
+ TextFormField(
|
|
|
|
|
+ decoration: wInputDecoration('请输入验证码'),
|
|
|
|
|
+ onChanged: (value) {
|
|
|
|
|
+ controller.password.value = value;
|
|
|
|
|
+ },
|
|
|
|
|
+ keyboardType: TextInputType.number,
|
|
|
|
|
+ ),
|
|
|
|
|
+ Padding(
|
|
|
|
|
+ padding: const EdgeInsets.only(right: 4),
|
|
|
|
|
+ child: SizedBox(
|
|
|
|
|
+ width: 84,
|
|
|
|
|
+ height: 37,
|
|
|
|
|
+ child: Obx(() => GetCodeButton(
|
|
|
|
|
+ codeRetryLeft: controller.codeRetryLeft.value,
|
|
|
|
|
+ onPressed: () => controller.onGetCode(),
|
|
|
|
|
+ )),
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ ],
|
|
|
|
|
+ ),
|
|
|
|
|
+ // _TextContract(),
|
|
|
|
|
+ const Spacer(flex: 80),
|
|
|
|
|
+ button(
|
|
|
|
|
+ context,
|
|
|
|
|
+ '登 录',
|
|
|
|
|
+ () => controller.onSignIn(),
|
|
|
|
|
+ ),
|
|
|
|
|
+ const Spacer(flex: 10),
|
|
|
|
|
+ ],
|
|
|
|
|
+ ))
|
|
|
|
|
+ ],
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ InputDecoration wInputDecoration(hintText) {
|
|
|
|
|
+ return InputDecoration(
|
|
|
|
|
+ // isCollapsed: true,
|
|
|
|
|
+ contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
|
|
|
|
+ hintText: hintText,
|
|
|
|
|
+ // hintStyle: TextStyle(fontSize: 12.0.rpx),
|
|
|
|
|
+ focusedBorder: OutlineInputBorder(
|
|
|
|
|
+ borderRadius: BorderRadius.circular(4.0),
|
|
|
|
|
+ borderSide: const BorderSide(
|
|
|
|
|
+ color: Colors.blue,
|
|
|
|
|
+ width: 1.0,
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ enabledBorder: OutlineInputBorder(
|
|
|
|
|
+ borderRadius: BorderRadius.circular(4.0),
|
|
|
|
|
+ borderSide: const BorderSide(
|
|
|
|
|
+ color: Color(0xffaaaaaa),
|
|
|
|
|
+ width: 1.0,
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+class _InputQrCode extends GetView<LoginController> {
|
|
|
|
|
+ @override
|
|
|
|
|
+ Widget build(BuildContext context) {
|
|
|
|
|
+ return Obx(() => Column(
|
|
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
+ children: [
|
|
|
|
|
+ Row(
|
|
|
|
|
+ children: [
|
|
|
|
|
+ const Spacer(),
|
|
|
|
|
+ TextButton(
|
|
|
|
|
+ onPressed: () => controller.isPageQrCode.value = false,
|
|
|
|
|
+ child: const Text('使用短信登录',
|
|
|
|
|
+ style: TextStyle(color: Color(0xff004670))))
|
|
|
|
|
+ ],
|
|
|
|
|
+ ),
|
|
|
|
|
+ Stack(children: [
|
|
|
|
|
+ GestureDetector(
|
|
|
|
|
+ onTap: () => controller.flushQrCode(),
|
|
|
|
|
+ child: Obx(() => SizedBox.square(
|
|
|
|
|
+ dimension: 104,
|
|
|
|
|
+ child:
|
|
|
|
|
+ PrettyQrView.data(data: controller.qrCode.value)))),
|
|
|
|
|
+ if (controller.codeErr.value.isNotEmpty)
|
|
|
|
|
+ Container(
|
|
|
|
|
+ height: 104,
|
|
|
|
|
+ width: 104,
|
|
|
|
|
+ color: const Color(0xe6ffffff),
|
|
|
|
|
+ alignment: Alignment.center,
|
|
|
|
|
+ child: Column(
|
|
|
|
|
+ children: [
|
|
|
|
|
+ const Expanded(
|
|
|
|
|
+ child: Center(
|
|
|
|
|
+ child: Icon(
|
|
|
|
|
+ Icons.cancel,
|
|
|
|
|
+ color: Colors.red,
|
|
|
|
|
+ size: 53.3,
|
|
|
|
|
+ ),
|
|
|
|
|
+ )),
|
|
|
|
|
+ Text(controller.codeErr.value,
|
|
|
|
|
+ style: const TextStyle(
|
|
|
|
|
+ fontSize: 14.2, fontWeight: FontWeight.w500)),
|
|
|
|
|
+ const SizedBox(height: 5)
|
|
|
|
|
+ ],
|
|
|
|
|
+ ),
|
|
|
|
|
+ )
|
|
|
|
|
+ ]),
|
|
|
|
|
+ Expanded(
|
|
|
|
|
+ child: Center(
|
|
|
|
|
+ child: controller.codeErr.value.isEmpty
|
|
|
|
|
+ ? const Text('请用彩图奔跑APP 扫一扫登录')
|
|
|
|
|
+ : TextButton(
|
|
|
|
|
+ onPressed: () => controller.flushQrCode(),
|
|
|
|
|
+ child: const Text(
|
|
|
|
|
+ '重新扫码',
|
|
|
|
|
+ style: TextStyle(color: Color(0xff004670)),
|
|
|
|
|
+ )),
|
|
|
|
|
+ ))
|
|
|
|
|
+ ],
|
|
|
|
|
+ ));
|
|
|
|
|
+ }
|
|
|
|
|
+}
|