Commit ac4c07fb authored by skeyboy's avatar skeyboy

订阅修改、登录页输入框键盘样式优化

parent e795f058
class MultiClickUtil {
const MultiClickUtil._();
static DateTime? _lastClickTime;
/*
* 判断是否为重复点击
* 可用于Gesture的onTap函数中拦截
* */
static bool isMultiClick({int intervalMilliseconds = 500}) {
if (_lastClickTime == null ||
DateTime.now().difference(_lastClickTime!) >
Duration(milliseconds: intervalMilliseconds)) {
_lastClickTime = DateTime.now();
return false;
} else {
return true;
}
}
}
...@@ -7,3 +7,4 @@ export 'iconfont.dart'; ...@@ -7,3 +7,4 @@ export 'iconfont.dart';
export 'date.dart'; export 'date.dart';
export 'logger.dart'; export 'logger.dart';
export 'loading.dart'; export 'loading.dart';
export 'multi_click_util.dart';
...@@ -195,39 +195,40 @@ class PayItemWidget extends GetView<AndroidPayListController> { ...@@ -195,39 +195,40 @@ class PayItemWidget extends GetView<AndroidPayListController> {
Obx( Obx(
() => Container( () => Container(
width: Get.width, width: Get.width,
height: 150,
margin: const EdgeInsets.all(10), margin: const EdgeInsets.all(10),
child: ListView( child: SingleChildScrollView(
shrinkWrap: true,
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
children: controller.state.items child: IntrinsicHeight(
.map((element) => Container( child: Row(
margin: const EdgeInsets.only(right: 20), children: controller.state.items.reversed
child: InkWell( .map((element) => Container(
borderRadius: BorderRadius.circular(10), margin: const EdgeInsets.only(right: 10),
onTap: () { child: InkWell(
/// 增加选中事件 borderRadius: BorderRadius.circular(10),
controller.state.setSelectedItem = element; onTap: () {
Vibrate.feedback(FeedbackType.impact); /// 增加选中事件
}, controller.state.setSelectedItem = element;
child: Ink( Vibrate.feedback(FeedbackType.impact);
padding: const EdgeInsets.symmetric( },
horizontal: 15, vertical: 20), child: Ink(
decoration: BoxDecoration( padding: const EdgeInsets.symmetric(
borderRadius: BorderRadius.circular(10), horizontal: 5, vertical: 10),
// border: ,Color.argb(255, 62, 67, 95) decoration: BoxDecoration(
border: Border.all( borderRadius: BorderRadius.circular(10),
width: 1, // border: ,Color.argb(255, 62, 67, 95)
color: (controller.state.selectedItem border: Border.all(
.id ?? width: 1,
0) == color: (controller.state
(element.id ?? 0) .selectedItem.id ??
? const Color.fromARGB(0, 0, 0, 0) 0) ==
: const Color.fromARGB( (element.id ?? 0)
255, 90, 82, 91)), ? const Color.fromARGB(
gradient: LinearGradient( 0, 0, 0, 0)
colors: : const Color.fromARGB(
(controller.state.selectedItem.id ?? 255, 90, 82, 91)),
gradient: LinearGradient(
colors: (controller.state.selectedItem
.id ??
0) == 0) ==
(element.id ?? 0) (element.id ?? 0)
? [ ? [
...@@ -243,74 +244,100 @@ class PayItemWidget extends GetView<AndroidPayListController> { ...@@ -243,74 +244,100 @@ class PayItemWidget extends GetView<AndroidPayListController> {
Color(0xFF333450), Color(0xFF333450),
Color(0xFF2b2b4d) Color(0xFF2b2b4d)
], ],
begin: Alignment.topCenter, begin: Alignment.topCenter,
end: Alignment.bottomCenter, end: Alignment.bottomCenter,
)), )),
child: Column( child: Column(
children: [ mainAxisAlignment:
Text( MainAxisAlignment.spaceBetween,
element.goodsName!, children: [
style: TextStyle( Text(
fontWeight: FontWeight.bold, element.goodsName!,
color: controller.state.selectedItem.id == style: TextStyle(
element.id fontWeight: FontWeight.bold,
? Color.fromARGB(255, 23, 17, 7) color: controller.state
: Colors.white), .selectedItem.id ==
), element.id
Text( ? Color.fromARGB(
'¥${element.amount!}', 255, 23, 17, 7)
style: TextStyle( : Colors.white),
fontWeight: FontWeight.bold, ),
color: controller.state.selectedItem.id == Text(
element.id '¥${element.amount!}',
? Color.fromARGB(255, 230, 31, 32) style: TextStyle(
: Color.fromARGB( fontWeight: FontWeight.bold,
255, 241, 197, 131)), color: controller.state
), .selectedItem.id ==
Container( element.id
width: Get.width * 0.6, ? const Color.fromARGB(
child: Text( 255, 230, 31, 32)
element.goodsDesc!, : const Color.fromARGB(
style: TextStyle( 255, 241, 197, 131)),
fontWeight: FontWeight.bold, ),
color: controller.state.selectedItem.id == Container(
element.id width: Get.width / 3.5,
? Color.fromARGB(255, 230, 31, 32) child: Column(
: Color.fromARGB( children: element.goodsDesc!
255, 241, 197, 131)), .split('、')
), .map((e) => Text(
e,
textAlign:
TextAlign.center,
style: TextStyle(
fontWeight:
FontWeight.bold,
color: controller
.state
.selectedItem
.id ==
element.id
? const Color
.fromARGB(
255,
230,
31,
32)
: const Color
.fromARGB(
255,
241,
197,
131)),
))
.toList(),
),
),
// Text(
// '¥${(double.parse(element.goodsDesc!) * 1.2).toStringAsFixed(2)}',
// style: TextStyle(
// color:
// Color.fromARGB(255, 140, 145, 151),
// decoration: TextDecoration.combine([
// // TextDecoration.underline,
// TextDecoration.lineThrough
// ]),
// ),
// ),
// Text('限时特惠',
// style: TextStyle(
// color: controller.state.selectedItem ==
// element.id
// ? Color.fromARGB(255, 230, 31, 32)
// : Color.fromARGB(
// 255, 169, 171, 196),
// decoration: TextDecoration.combine([
// // TextDecoration.underline,
// // TextDecoration.lineThrough
// ]),
// ))
],
), ),
// Text( ),
// '¥${(double.parse(element.goodsDesc!) * 1.2).toStringAsFixed(2)}',
// style: TextStyle(
// color:
// Color.fromARGB(255, 140, 145, 151),
// decoration: TextDecoration.combine([
// // TextDecoration.underline,
// TextDecoration.lineThrough
// ]),
// ),
// ),
// Text('限时特惠',
// style: TextStyle(
// color: controller.state.selectedItem ==
// element.id
// ? Color.fromARGB(255, 230, 31, 32)
// : Color.fromARGB(
// 255, 169, 171, 196),
// decoration: TextDecoration.combine([
// // TextDecoration.underline,
// // TextDecoration.lineThrough
// ]),
// ))
],
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
), ),
), ))
), .toList(),
)) ),
.toList(), ),
), ),
), ),
), ),
...@@ -344,7 +371,7 @@ class PayItemWidget extends GetView<AndroidPayListController> { ...@@ -344,7 +371,7 @@ class PayItemWidget extends GetView<AndroidPayListController> {
Image( Image(
width: 40, width: 40,
image: Image.asset( image: Image.asset(
'assets/images/account_header.png') 'assets/images/account_header.png')
.image), .image),
SizedBox( SizedBox(
width: 10, width: 10,
...@@ -359,7 +386,7 @@ class PayItemWidget extends GetView<AndroidPayListController> { ...@@ -359,7 +386,7 @@ class PayItemWidget extends GetView<AndroidPayListController> {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color.fromARGB(255, 53, 45, 55), color: Color.fromARGB(255, 53, 45, 55),
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(40))), BorderRadius.all(Radius.circular(40))),
// diamond // diamond
child: Row( child: Row(
children: [ children: [
...@@ -415,7 +442,7 @@ class PayItemWidget extends GetView<AndroidPayListController> { ...@@ -415,7 +442,7 @@ class PayItemWidget extends GetView<AndroidPayListController> {
decoration: const BoxDecoration( decoration: const BoxDecoration(
color: Color.fromARGB(255, 53, 45, 55), color: Color.fromARGB(255, 53, 45, 55),
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(40))), BorderRadius.all(Radius.circular(40))),
// diamond // diamond
child: Row( child: Row(
children: const [ children: const [
...@@ -472,7 +499,7 @@ class PayItemWidget extends GetView<AndroidPayListController> { ...@@ -472,7 +499,7 @@ class PayItemWidget extends GetView<AndroidPayListController> {
decoration: const BoxDecoration( decoration: const BoxDecoration(
color: Color.fromARGB(255, 53, 45, 55), color: Color.fromARGB(255, 53, 45, 55),
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(40))), BorderRadius.all(Radius.circular(40))),
// diamond // diamond
child: Row( child: Row(
children: const [ children: const [
...@@ -514,7 +541,6 @@ class PayItemWidget extends GetView<AndroidPayListController> { ...@@ -514,7 +541,6 @@ class PayItemWidget extends GetView<AndroidPayListController> {
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
......
...@@ -641,7 +641,7 @@ class SignInPage extends GetView<SignInController> { ...@@ -641,7 +641,7 @@ class SignInPage extends GetView<SignInController> {
children: [ children: [
TextFormField( TextFormField(
controller: controller.mobileMemberController, controller: controller.mobileMemberController,
keyboardType: TextInputType.emailAddress, keyboardType: TextInputType.phone,
textInputAction: TextInputAction.next, textInputAction: TextInputAction.next,
cursorColor: kPrimaryColor, cursorColor: kPrimaryColor,
onSaved: (email) {}, onSaved: (email) {},
...@@ -658,6 +658,7 @@ class SignInPage extends GetView<SignInController> { ...@@ -658,6 +658,7 @@ class SignInPage extends GetView<SignInController> {
vertical: defaultPadding), vertical: defaultPadding),
child: TextFormField( child: TextFormField(
controller: controller.codeController, controller: controller.codeController,
keyboardType: TextInputType.number,
textInputAction: TextInputAction.done, textInputAction: TextInputAction.done,
obscureText: true, obscureText: true,
cursorColor: kPrimaryColor, cursorColor: kPrimaryColor,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment