提交 47cdef08 authored 作者: yueweilu's avatar yueweilu

积分界面布局修正

上级 93fc8b4a
...@@ -7,9 +7,11 @@ import 'package:flutter_book/theme.dart'; ...@@ -7,9 +7,11 @@ import 'package:flutter_book/theme.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_slidable/flutter_slidable.dart'; import 'package:flutter_slidable/flutter_slidable.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:go_router/go_router.dart';
import '../../models/index.dart'; import '../../models/index.dart';
import '../../models/shop.dart'; import '../../models/shop.dart';
import '../../routes/index.dart';
import '../../utils/index.dart'; import '../../utils/index.dart';
import '../../widgets/index.dart'; import '../../widgets/index.dart';
import '../book_shop/index.dart'; import '../book_shop/index.dart';
......
...@@ -41,30 +41,40 @@ class _BookPayPageState extends State<BookPayPage> { ...@@ -41,30 +41,40 @@ class _BookPayPageState extends State<BookPayPage> {
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colours.cC7.withOpacity(0.5), color: Colours.cC7.withOpacity(0.5),
spreadRadius: 2, spreadRadius: 2.w,
blurRadius: 5, blurRadius: 5.w,
offset: Offset(3.w, 0), // changes the position of the shadow offset: Offset(3.w, 0), // changes the position of the shadow
), ),
] ]
), ),
child: Column( child: Column(
children: [ children: [
_buildPointWidget(), GestureDetector(
child: _buildWidget(title: '优惠券',icon: 'assets/images/pay_coupon.png',),
onTap: (){
context.pushNamed(Routes.payCoupon);
},
),
Container(height: 0.5.w,color: Colours.cF0,margin: EdgeInsets.only(left: 10.w),), Container(height: 0.5.w,color: Colours.cF0,margin: EdgeInsets.only(left: 10.w),),
_buildCouponWidget() GestureDetector(
child: _buildWidget(title: '积分抵扣',icon: 'assets/images/pay_point.png',),
onTap: (){
context.pushNamed(Routes.creditPoints);
},
),
], ],
), ),
), ),
Container( Container(
margin: const EdgeInsets.only(left: 10,right: 10,top: 10), margin: EdgeInsets.only(left: 10.w,right: 10.w,top: 10.w),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius:BorderRadius.circular(8), borderRadius:BorderRadius.circular(8.w),
color: Colors.white, color: Colors.white,
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colours.cC7.withOpacity(0.5), color: Colours.cC7.withOpacity(0.5),
spreadRadius: 2, spreadRadius: 2.w,
blurRadius: 5, blurRadius: 5.w,
offset: const Offset(3, 0), // changes the position of the shadow offset: const Offset(3, 0), // changes the position of the shadow
), ),
] ]
...@@ -93,29 +103,33 @@ class _BookPayPageState extends State<BookPayPage> { ...@@ -93,29 +103,33 @@ class _BookPayPageState extends State<BookPayPage> {
} }
Widget _buildPointWidget(){ Widget _buildWidget({
required String title,
required String icon,
}){
return Container( return Container(
margin: EdgeInsets.only(left: 13,right: 13), margin: EdgeInsets.only(left: 13.w,right: 13.w),
color: Colors.white,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Row(
children: [ children: [
Container( Container(
margin: const EdgeInsets.symmetric(vertical: 12), margin: EdgeInsets.symmetric(vertical: 12.w),
// color: Colors.cyan, // color: Colors.cyan,
width:20, width:20.w,
height:20, height:20.w,
child: Image.asset('assets/images/pay_coupon.png'), child: Image.asset(icon),
), ),
const SizedBox(width: 7,), SizedBox(width: 7.w,),
const Text('优惠券',style: TextStyle(fontSize: 14,color: Colours.c3,height: 1.1)), Text(title,style: TextStyle(fontSize: 14.w,color: Colours.c3,height: 1.1)),
], ],
), ),
Container( SizedBox(
// color: Colors.cyan, // color: Colors.cyan,
width:5, width:5.w,
height:8, height:8.w,
child: Image.asset('assets/images/right_arrow.png'), child: Image.asset('assets/images/right_arrow.png'),
), ),
], ],
...@@ -123,33 +137,4 @@ class _BookPayPageState extends State<BookPayPage> { ...@@ -123,33 +137,4 @@ class _BookPayPageState extends State<BookPayPage> {
); );
} }
Widget _buildCouponWidget(){
return Container(
margin: EdgeInsets.only(left: 13,right: 13),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Container(
margin: const EdgeInsets.symmetric(vertical: 12),
// color: Colors.cyan,
width:20,
height:20,
child: Image.asset('assets/images/pay_point.png'),
),
const SizedBox(width: 7,),
const Text('积分抵扣',style: TextStyle(fontSize: 14,color: Colours.c3,height: 1.1)),
],
),
Container(
// color: Colors.cyan,
width:5,
height:8,
child: Image.asset('assets/images/right_arrow.png'),
),
],
),
);
}
} }
...@@ -11,29 +11,32 @@ class CreditPointsPage extends StatelessWidget { ...@@ -11,29 +11,32 @@ class CreditPointsPage extends StatelessWidget {
return false; return false;
}, },
child: Scaffold( child: Scaffold(
extendBodyBehindAppBar: true,
appBar: AppBar( appBar: AppBar(
centerTitle: true, centerTitle: true,
title: const Text('积分'), title: const Text('积分'),
backgroundColor: Colors.transparent,
), ),
body: Column( body:Stack(
children: [
Image.asset(
'assets/images/point_bg.png',
fit: BoxFit.contain,
width: double.infinity,
),
SafeArea(
top: true,
child: Column(
children: [ children: [
// 积分卡片 // 积分卡片
Container( Container(
color: AppTheme.primary.withOpacity(0.02), padding: EdgeInsets.symmetric(horizontal: 10.w),
padding: EdgeInsets.all(10.w),
child: Container( child: Container(
padding: EdgeInsets.only(left: 17.w,top: 18.w,bottom: 24.w,right: 17.w), padding: EdgeInsets.only(left: 17.w,top: 18.w,bottom: 24.w,right: 17.w),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white.withOpacity(0.58),
boxShadow: [ borderRadius: BorderRadius.circular(8.w),
BoxShadow( border: Border.all(width: 2.w,color: Colors.white)
color: Colours.cC7.withOpacity(0.5),
offset: Offset(0, 3.w),
blurRadius: 4.w,
spreadRadius: 0,
),
],
borderRadius: BorderRadius.circular(8)
), ),
height: 175.w, height: 175.w,
child: Column( child: Column(
...@@ -74,13 +77,14 @@ class CreditPointsPage extends StatelessWidget { ...@@ -74,13 +77,14 @@ class CreditPointsPage extends StatelessWidget {
// 使用积分 // 使用积分
Container( Container(
// height: 105, // height: 105,
margin: EdgeInsets.symmetric(horizontal: 10.w),
padding: EdgeInsets.all(20.w), padding: EdgeInsets.all(20.w),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colours.cC7.withOpacity(0.5), color: Colours.cC7.withOpacity(0.5),
offset: Offset(0, 3.w), offset: Offset(3.w, 0.w),
blurRadius: 4.w, blurRadius: 4.w,
spreadRadius: 0, spreadRadius: 0,
), ),
...@@ -123,6 +127,9 @@ class CreditPointsPage extends StatelessWidget { ...@@ -123,6 +127,9 @@ class CreditPointsPage extends StatelessWidget {
], ],
), ),
), ),
],
)
),
); );
} }
} }
...@@ -40,6 +40,7 @@ import 'package:go_router/go_router.dart'; ...@@ -40,6 +40,7 @@ import 'package:go_router/go_router.dart';
import '../models/index.dart'; import '../models/index.dart';
import '../pages/order_evaluate/index.dart'; import '../pages/order_evaluate/index.dart';
import '../pages/pay_coupon/index.dart';
import '../pages/user_about/index.dart'; import '../pages/user_about/index.dart';
import '../pages/user_terms/index.dart'; import '../pages/user_terms/index.dart';
import '../pages/version/index.dart'; import '../pages/version/index.dart';
......
...@@ -42,6 +42,7 @@ abstract class Routes { ...@@ -42,6 +42,7 @@ abstract class Routes {
/// 书架模块 /// 书架模块
static const creditPoints = 'credit_points'; static const creditPoints = 'credit_points';
static const shop = 'shop'; static const shop = 'shop';
static const payCoupon = 'pay_coupon';
...@@ -274,6 +275,15 @@ abstract class Routes { ...@@ -274,6 +275,15 @@ abstract class Routes {
child: const CreditPointsPage() child: const CreditPointsPage()
) )
), ),
GoRoute(
path: '/$payCoupon',
name: payCoupon,
pageBuilder: (context, state) =>CupertinoPage(
name: state.uri.toString(),
key: state.pageKey,
child: const PayCouponPage()
)
),
GoRoute( GoRoute(
path: '/$search', path: '/$search',
name: search, name: search,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论