Browse Source

会员列表新增两个按钮选项;

新增热销榜单页面;
新增新增会员页面;
wr_2023_new_business
wurong 1 year ago
parent
commit
b413b53eed
  1. 53
      lib/business_system/home/hot _selling_page.dart
  2. 4
      lib/business_system/home/overview/trade_goods.dart
  3. 2
      lib/business_system/home/overview/trade_overview_page.dart
  4. 225
      lib/business_system/home/vip/add_vip.dart
  5. 48
      lib/business_system/home/vip/bus_vip_list.dart
  6. 6
      lib/main.dart

53
lib/business_system/home/hot _selling_page.dart

@ -0,0 +1,53 @@
import 'package:flutter/material.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import '../../../retrofit/business_api.dart';
import 'overview/trade_goods.dart';
class HotSellingPage extends StatefulWidget {
final Map<String, dynamic> arguments;
HotSellingPage({this.arguments});
@override
State<StatefulWidget> createState() {
return _HotSellingPage();
}
}
class _HotSellingPage extends State<HotSellingPage> {
BusinessApiService businessService;
@override
void initState() {
super.initState();
}
///
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
return GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: () {
FocusScope.of(context).unfocus();
},
child: Scaffold(
resizeToAvoidBottomInset: false,
backgroundColor: Colors.white,
appBar: MyAppBar(
title: "热销榜单",
titleColor: Colors.black,
background: Colors.white,
leadingColor: Colors.black,
brightness: Brightness.dark,
),
body: TradeGoods(widget.arguments["storeId"],"热销榜单"),
),
);
}
}

4
lib/business_system/home/overview/trade_goods.dart

@ -22,8 +22,9 @@ import '../../../view_widget/no_data_view.dart';
class TradeGoods extends StatefulWidget { class TradeGoods extends StatefulWidget {
final storeId; final storeId;
final titleName;
TradeGoods(this.storeId); TradeGoods(this.storeId,this.titleName);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -250,6 +251,7 @@ class _TradeGoods extends State<TradeGoods> {
backgroundColor: Colors.white, backgroundColor: Colors.white,
body: Column( body: Column(
children: [ children: [
if(widget.titleName != "热销榜单")
Container( Container(
color: Color(0xFFD8D8D8), color: Color(0xFFD8D8D8),
width: double.infinity, width: double.infinity,

2
lib/business_system/home/overview/trade_overview_page.dart

@ -71,7 +71,7 @@ class _TradeOverviewPage extends State<TradeOverviewPage> with SingleTickerProvi
children: [ children: [
TradeSummary(storeId), TradeSummary(storeId),
TradeOrder(storeId), TradeOrder(storeId),
TradeGoods(storeId),], TradeGoods(storeId,"")],
), ),
), ),
); );

225
lib/business_system/home/vip/add_vip.dart

@ -0,0 +1,225 @@
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../../retrofit/business_api.dart';
class AddVip extends StatefulWidget {
final Map<String, dynamic> arguments;
AddVip({this.arguments});
@override
State<StatefulWidget> createState() {
return _AddVip();
}
}
class _AddVip extends State<AddVip> {
final TextEditingController vipPhoneController = TextEditingController();
final TextEditingController vipNameController = TextEditingController();
bool isKeyBoardShow = false;
FocusNode _focusNode = FocusNode();
BusinessApiService businessService;
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
setState(() {
print("object: ${MediaQuery.of(context).viewInsets.bottom}");
if (MediaQuery.of(context).viewInsets.bottom == 0) {
if (isKeyBoardShow) {
isKeyBoardShow = false;
//
FocusScope.of(context).requestFocus(FocusNode());
}
} else {
isKeyBoardShow = true;
}
});
});
}
///
@override
void dispose() {
_focusNode.unfocus();
super.dispose();
}
@override
Widget build(BuildContext context) {
return GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: () {
FocusScope.of(context).unfocus();
},
child: Scaffold(
resizeToAvoidBottomInset: false,
backgroundColor: Colors.white,
appBar: MyAppBar(
title: "新增会员",
titleColor: Colors.black,
background: Colors.white,
leadingColor: Colors.black,
brightness: Brightness.dark,
),
body: Container(
margin: EdgeInsets.only(top: 24.h, left: 16.w, right: 16.w),
child: Column(
children: [
Container(
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Color(0x0F06152E),
offset: Offset(0, 2),
blurRadius: 4,
spreadRadius: 0,
)
],
borderRadius: BorderRadius.circular(8),
),
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Row(
children: [
Expanded(
child: Text.rich(
TextSpan(
children: [
TextSpan(
text: "会员手机号",
style: TextStyle(
color: Color(0xFF1A1A1A),
fontSize: 14.sp,
fontWeight: FontWeight.w500,
),
),
TextSpan(
text: "*",
style: TextStyle(
color: Color(0xFFFA5151),
fontSize: 14.sp,
fontWeight: FontWeight.w500,
),
),
],
),
),
),
Expanded(
child: TextField(
controller: vipPhoneController,
decoration: InputDecoration(
hintText: "请输入会员手机号",
hintTextDirection: TextDirection.rtl,
hintStyle: TextStyle(
color: Color(0xFF1A1A1A),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
border: InputBorder.none,
contentPadding: EdgeInsets.only(left: 16.w),
),
textAlign: TextAlign.right,
style: TextStyle(
color: Color(0xFF1A1A1A),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular),
),
),
],
),
),
Container(
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Color(0x0F06152E),
offset: Offset(0, 2),
blurRadius: 4,
spreadRadius: 0,
)
],
borderRadius: BorderRadius.circular(8),
),
padding: EdgeInsets.symmetric(horizontal: 16.w),
margin: EdgeInsets.only(top: 16.h),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: Text(
"会员姓名",
style: TextStyle(
color: Color(0xFF1A1A1A),
fontSize: 14.sp,
fontWeight: FontWeight.w500,
),
),
),
Expanded(
child: TextField(
controller: vipNameController,
decoration: InputDecoration(
hintText: "请输入会员姓名",
hintTextDirection: TextDirection.rtl,
hintStyle: TextStyle(
color: Color(0xFF1A1A1A),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular),
border: InputBorder.none,
contentPadding: EdgeInsets.only(left: 16.w),
),
textAlign: TextAlign.right,
style: TextStyle(
color: Color(0xFF1A1A1A),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular),
),
),
],
)),
Spacer(),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
if (vipPhoneController.text == "") {
SmartDialog.showToast("请输入会员手机号",
alignment: Alignment.center);
return;
} else {
print("新增成功");
}
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(27),
color: Color(0xFF30415B),
),
width: double.infinity,
alignment: Alignment.center,
padding: EdgeInsets.symmetric(vertical: 16.h),
margin: EdgeInsets.only(bottom: 34.h),
child: Text(
"确认新增",
style: TextStyle(
color: Colors.white,
fontSize: 16.sp,
fontWeight: FontWeight.bold,
),
),
),
),
],
),
),
),
);
}
}

48
lib/business_system/home/vip/bus_vip_list.dart

@ -173,7 +173,7 @@ class _BusVipList extends State<BusVipList> {
), ),
Expanded( Expanded(
child: Text( child: Text(
"会员管理", "会员列表",
style: TextStyle( style: TextStyle(
fontSize: 15.sp, fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
@ -181,6 +181,52 @@ class _BusVipList extends State<BusVipList> {
), ),
), ),
), ),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){},
child:Container(
decoration: BoxDecoration(
color: Color(0xFF30415B),
borderRadius: BorderRadius.circular(4),
),
padding: EdgeInsets.symmetric(horizontal: 14.w,vertical: 5..h),
margin: EdgeInsets.only(right: 8.w),
child:Text(
"会员充值",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Colors.white,
),
),
)
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
Navigator.of(context).pushNamed('/router/hot_selling_page',
arguments: {"storeId": widget.storeId}).then((value){
_current = 1;
records.clear();
_onRefresh(isShowLoad: false);
});
},
child:Container(
decoration: BoxDecoration(
color: Color(0xFF30415B),
borderRadius: BorderRadius.circular(4),
),
padding: EdgeInsets.symmetric(horizontal: 14.w,vertical: 5..h),
margin: EdgeInsets.only(right:16.w),
child:Text(
"新增会员",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Colors.white,
),
),
)),
], ],
), ),
), ),

6
lib/main.dart

@ -97,8 +97,10 @@ import 'business_system/goods/on_sale/goods_assort.dart';
import 'business_system/goods/on_sale/goods_sort.dart'; import 'business_system/goods/on_sale/goods_sort.dart';
import 'business_system/goods/reservation_ page.dart'; import 'business_system/goods/reservation_ page.dart';
import 'business_system/home/flow_page.dart'; import 'business_system/home/flow_page.dart';
import 'business_system/home/hot _selling_page.dart';
import 'business_system/home/select_shop.dart'; import 'business_system/home/select_shop.dart';
import 'business_system/home/overview/trade_overview_page.dart'; import 'business_system/home/overview/trade_overview_page.dart';
import 'business_system/home/vip/add_vip.dart';
import 'business_system/home/vip/business_vip_page.dart'; import 'business_system/home/vip/business_vip_page.dart';
import 'business_system/login/business_login_page.dart'; import 'business_system/login/business_login_page.dart';
import 'business_system/mine/account_information.dart'; import 'business_system/mine/account_information.dart';
@ -518,4 +520,8 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
BusinessVipPage(arguments:arguments), BusinessVipPage(arguments:arguments),
'/router/reservation_page': (context, {arguments}) => '/router/reservation_page': (context, {arguments}) =>
ReservationPage(arguments:arguments), ReservationPage(arguments:arguments),
'/router/add_vip': (context, {arguments}) =>
AddVip(arguments:arguments),
'/router/hot_selling_page': (context, {arguments}) =>
HotSellingPage(arguments:arguments),
}; };

Loading…
Cancel
Save