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

积分界面布局修正

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