提交 586ac1e7 authored 作者: maodou's avatar maodou

1:待付款订单添加倒计时

2:书架订单默认选择支付宝 3:优化头像修改功能
上级 7db40230
...@@ -24,7 +24,7 @@ class BookPayController extends GetxController { ...@@ -24,7 +24,7 @@ class BookPayController extends GetxController {
PayModel(type: 3, name: '紫荆币', icon: 'assets/images/pay_coin.png', selected: true), PayModel(type: 3, name: '紫荆币', icon: 'assets/images/pay_coin.png', selected: true),
]:[ ]:[
// PayModel(type: 1, name: '微信', icon: 'assets/images/pay_wechat.png', selected: true), // PayModel(type: 1, name: '微信', icon: 'assets/images/pay_wechat.png', selected: true),
PayModel(type: 2, name: '支付宝', icon: 'assets/images/pay_ali.png', selected: false), PayModel(type: 2, name: '支付宝', icon: 'assets/images/pay_ali.png', selected: true),
PayModel(type: 3, name: '紫荆币', icon: 'assets/images/pay_coin.png', selected: false), PayModel(type: 3, name: '紫荆币', icon: 'assets/images/pay_coin.png', selected: false),
]; ];
...@@ -161,7 +161,7 @@ class BookPayController extends GetxController { ...@@ -161,7 +161,7 @@ class BookPayController extends GetxController {
// 书豆支付的话先判断书豆数量 // 书豆支付的话先判断书豆数量
if (payModel.type == 3){ if (payModel.type == 3){
if (finalPrice.toDouble() > double.parse(showModel.membersBean.toString())){ if (finalPrice.toDouble() > double.parse(showModel.membersBean.toString())){
Toast.show('紫币不足,请先充值紫荆币'); Toast.show('紫币不足,请先充值紫荆币');
return; return;
} }
} }
......
...@@ -87,10 +87,10 @@ class LoginController extends GetxController { ...@@ -87,10 +87,10 @@ class LoginController extends GetxController {
// 定时器回调 // 定时器回调
}); });
/// 测试账号 /// 测试账号
// if (kDebugMode) { if (kDebugMode) {
// phoneInput.text = '13521054068'; phoneInput.text = '13521054068';
// passwordInput.text = '123456'; passwordInput.text = '123456';
// } }
super.onInit(); super.onInit();
} }
......
...@@ -173,6 +173,7 @@ class _UserInfoPageState extends State<UserInfoPage> { ...@@ -173,6 +173,7 @@ class _UserInfoPageState extends State<UserInfoPage> {
}, },
child: Container( child: Container(
height: 45.w, height: 45.w,
color: Colours.cFF,
padding: EdgeInsets.all(12.w), padding: EdgeInsets.all(12.w),
child: const Row( child: const Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
...@@ -206,6 +207,7 @@ class _UserInfoPageState extends State<UserInfoPage> { ...@@ -206,6 +207,7 @@ class _UserInfoPageState extends State<UserInfoPage> {
}, },
child: Container( child: Container(
height: 45.w, height: 45.w,
color: Colours.cFF,
padding: EdgeInsets.all(12.w), padding: EdgeInsets.all(12.w),
child: const Row( child: const Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
...@@ -235,6 +237,7 @@ class _UserInfoPageState extends State<UserInfoPage> { ...@@ -235,6 +237,7 @@ class _UserInfoPageState extends State<UserInfoPage> {
}, },
child: Container( child: Container(
height: 45.w, height: 45.w,
color: Colours.cFF,
padding: EdgeInsets.all(12.w), padding: EdgeInsets.all(12.w),
child: const Row( child: const Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
......
...@@ -8,7 +8,10 @@ class BuiltAwaiting extends StatelessWidget { ...@@ -8,7 +8,10 @@ class BuiltAwaiting extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return GestureDetector( return GestureDetector(
onTap: () { context.pushNamed(Routes.orderAwaiting,queryParameters: {'orderNum':model.ordersnum});}, onTap: () {
context.pushNamed(Routes.orderAwaiting,
queryParameters: {'orderNum': model.ordersnum});
},
child: Container( child: Container(
margin: EdgeInsets.only(left: 10.w, right: 10.w, top: 10.w), margin: EdgeInsets.only(left: 10.w, right: 10.w, top: 10.w),
padding: EdgeInsets.only(left: 11.5.w, bottom: 12.w), padding: EdgeInsets.only(left: 11.5.w, bottom: 12.w),
...@@ -24,12 +27,11 @@ class BuiltAwaiting extends StatelessWidget { ...@@ -24,12 +27,11 @@ class BuiltAwaiting extends StatelessWidget {
), ),
], ],
), ),
child:_buildCom(context), child: _buildCom(context),
),); ),
);
} }
Widget _buildCom(BuildContext context) { Widget _buildCom(BuildContext context) {
if (model.cartList!.length == 1) { if (model.cartList!.length == 1) {
return _buildOne(context); return _buildOne(context);
...@@ -63,7 +65,7 @@ class BuiltAwaiting extends StatelessWidget { ...@@ -63,7 +65,7 @@ class BuiltAwaiting extends StatelessWidget {
], ],
), ),
child: Image.network( child: Image.network(
model.cartList![0].img??'', model.cartList![0].img ?? '',
// 用实际图片链接替换 // 用实际图片链接替换
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
...@@ -121,7 +123,8 @@ class BuiltAwaiting extends StatelessWidget { ...@@ -121,7 +123,8 @@ class BuiltAwaiting extends StatelessWidget {
child: Align( child: Align(
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
'29分钟', '${30 - (DateTime.now().difference(
DateTime.parse(model.createTime.toString()))).inMinutes}分钟',
style: TextStyle( style: TextStyle(
color: Colours.cC31F4C, color: Colours.cC31F4C,
fontSize: 10.w, fontSize: 10.w,
...@@ -176,13 +179,11 @@ class BuiltAwaiting extends StatelessWidget { ...@@ -176,13 +179,11 @@ class BuiltAwaiting extends StatelessWidget {
), ),
maxLines: 2, maxLines: 2,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
)), )),
SizedBox(height: 10.5.w), SizedBox(height: 10.5.w),
], ],
), ),
Container( Container(
height: Checkbox.width, height: Checkbox.width,
alignment: Alignment.bottomLeft, alignment: Alignment.bottomLeft,
...@@ -280,7 +281,9 @@ class BuiltAwaiting extends StatelessWidget { ...@@ -280,7 +281,9 @@ class BuiltAwaiting extends StatelessWidget {
), ),
), ),
), ),
SizedBox(height: 2.w,), SizedBox(
height: 2.w,
),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
...@@ -310,7 +313,7 @@ class BuiltAwaiting extends StatelessWidget { ...@@ -310,7 +313,7 @@ class BuiltAwaiting extends StatelessWidget {
], ],
), ),
child: Image.network( child: Image.network(
cartModel.img??'', cartModel.img ?? '',
// 用实际图片链接替换 // 用实际图片链接替换
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
...@@ -332,7 +335,7 @@ class BuiltAwaiting extends StatelessWidget { ...@@ -332,7 +335,7 @@ class BuiltAwaiting extends StatelessWidget {
Padding( Padding(
padding: EdgeInsets.only(right: 26.w), padding: EdgeInsets.only(right: 26.w),
child: Text( child: Text(
${model.totalPrice??''}', ${model.totalPrice ?? ''}',
style: TextStyle( style: TextStyle(
color: Colours.cAB1941, color: Colours.cAB1941,
fontWeight: Fonts.medium, fontWeight: Fonts.medium,
...@@ -343,7 +346,7 @@ class BuiltAwaiting extends StatelessWidget { ...@@ -343,7 +346,7 @@ class BuiltAwaiting extends StatelessWidget {
Padding( Padding(
padding: EdgeInsets.only(right: 26.w, top: 0.5), padding: EdgeInsets.only(right: 26.w, top: 0.5),
child: Text( child: Text(
'共${model.cartList!.isEmpty?0:model.cartList?.length}件', '共${model.cartList!.isEmpty ? 0 : model.cartList?.length}件',
style: TextStyle( style: TextStyle(
color: Colours.c9, color: Colours.c9,
fontSize: 10.w, fontSize: 10.w,
......
...@@ -112,7 +112,7 @@ abstract class Routes { ...@@ -112,7 +112,7 @@ abstract class Routes {
static const orderAwaiting= 'order_awaiting'; static const orderAwaiting= 'order_awaiting';
// 已退款订单 // 已退款订单
static const orderRefunded= 'order_refunded'; static const orderRefunded= 'order_refunded';
// 已退款订单 // 搜索订单
static const orderSearch= 'order_search'; static const orderSearch= 'order_search';
......
...@@ -91,9 +91,9 @@ class ValidatorTool { ...@@ -91,9 +91,9 @@ class ValidatorTool {
// 密码 // 密码
static bool isValidPassword(String value) { static bool isValidPassword(String value) {
RegExp passwordPattern = RegExp(r'^[A-Za-z0-9!@#\$%^&*()_+{}\[\]:;<>,.?~\\/-]{8,12}$'); // RegExp passwordPattern = RegExp(r'^[A-Za-z0-9!@#\$%^&*()_+{}\[\]:;<>,.?~\\/-]{8,12}$');
// RegExp passwordPattern = RegExp(r'^(?=.*[A-Za-z])(?=.*\d)(?=.*[~@#%$*()_+{}\[\]:;<>,.?\\/-])[A-Za-z0-9~@#%$*()_+{}\[\]:;<>,.?\\/-]{8,12}$'); // RegExp passwordPattern = RegExp(r'^(?=.*[A-Za-z])(?=.*\d)(?=.*[~@#%$*()_+{}\[\]:;<>,.?\\/-])[A-Za-z0-9~@#%$*()_+{}\[\]:;<>,.?\\/-]{8,12}$');
// RegExp passwordPattern = RegExp(r'^\d{6}$'); RegExp passwordPattern = RegExp(r'^\d{6}$');
return passwordPattern.hasMatch(value); return passwordPattern.hasMatch(value);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论