Browse Source

商品板块新增:新建商品;

底部导航栏整体布局结构优化重构;
我的页面bug处理;
核销页面bug处理;
门店选择页面新增接口,数据优化调整;
会员充值页面ui调整;
wr_2023_new_business
wurong 1 year ago
parent
commit
475958179a
  1. BIN
      assets/image/2x/bus_goods_add.webp
  2. BIN
      assets/image/3x/bus_goods_add.webp
  3. BIN
      assets/image/bus_goods_add.webp
  4. 297
      lib/business_system/business_page.dart
  5. 57
      lib/business_system/goods/business_goods_page.dart
  6. 363
      lib/business_system/home/business_home_page.dart
  7. 43
      lib/business_system/home/select_shop.dart
  8. 1
      lib/business_system/home/vip/vip_recharge_page.dart
  9. 110
      lib/business_system/mine/business_mine_page.dart
  10. 8
      lib/business_system/order/business_order_page.dart
  11. 44
      lib/business_system/order/order_write_off.dart

BIN
assets/image/2x/bus_goods_add.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 662 B

BIN
assets/image/3x/bus_goods_add.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 820 B

BIN
assets/image/bus_goods_add.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 612 B

297
lib/business_system/business_page.dart

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:huixiang/business_system/goods/business_goods_page.dart'; import 'package:huixiang/business_system/goods/business_goods_page.dart';
@ -8,6 +10,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../retrofit/data/business_login_info.dart'; import '../retrofit/data/business_login_info.dart';
import 'home/business_home_page.dart'; import 'home/business_home_page.dart';
import 'home/home_view/home_sideslip_dialog.dart';
class BusinessPage extends StatefulWidget { class BusinessPage extends StatefulWidget {
final arguments; final arguments;
@ -25,6 +28,13 @@ class _BusinessPage extends State<BusinessPage>
int choiceIndex = 0; int choiceIndex = 0;
BusinessLoginInfo businessLoginInfo; BusinessLoginInfo businessLoginInfo;
int selectStoreIndex = 0; int selectStoreIndex = 0;
int switchStore = 0;
GlobalKey homePageKey = GlobalKey();
GlobalKey orderPageKey = GlobalKey();
GlobalKey goodsPageKey = GlobalKey();
GlobalKey minePageKey = GlobalKey();
var clickIndex = 0;
final PageController pageController = PageController();
@override @override
void initState() { void initState() {
@ -36,204 +46,205 @@ class _BusinessPage extends State<BusinessPage>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context); super.build(context);
return Stack( return Scaffold(
resizeToAvoidBottomInset: false,
body: Stack(
alignment: Alignment.bottomRight,
children: [ children: [
Container( Container(
color: Color(0xFFF7F7F7), child: PageView(
), controller: pageController,
Stack(
children: [ children: [
if (choiceIndex == 0) BusinessHomePage(
BusinessHomePage(businessLoginInfo, selectStoreIndex, (index) { homePageKey, businessLoginInfo, selectStoreIndex, showAlertDialog,
(index) {
setState(() { setState(() {
selectStoreIndex = index; pageController.jumpToPage(2);
});
},(index){
setState((){
choiceIndex = 3;
}); });
}), }),
if (choiceIndex == 1) BusinessOrderPage(businessLoginInfo?.storeList[selectStoreIndex]?.id ?? "0"), BusinessOrderPage(orderPageKey,
// if (choiceIndex == 2) BusinessScanCode(businessLoginInfo?.storeList[selectStoreIndex]?.id ?? "0"), businessLoginInfo?.storeList[selectStoreIndex]?.id ?? "0"),
if (choiceIndex == 3) BusinessGoodsPage(businessLoginInfo?.storeList[selectStoreIndex]?.id ?? "0"), BusinessGoodsPage(goodsPageKey,
if (choiceIndex == 4) BusinessMinePage(businessLoginInfo,businessLoginInfo?.storeList[selectStoreIndex]?.id ?? "0"), businessLoginInfo?.storeList[selectStoreIndex]?.id ?? "0"),
Align( BusinessMinePage(minePageKey, businessLoginInfo,
alignment: Alignment.bottomCenter, businessLoginInfo?.storeList[selectStoreIndex]?.id ?? "0"),
child: Container( ],
height: 85.h, physics: NeverScrollableScrollPhysics(),
width: double.infinity, onPageChanged: (index) {
color: Colors.white, clickIndex = index;
padding: EdgeInsets.only(top: 20.h), setState(() {});
child: Row( },
mainAxisAlignment: MainAxisAlignment.center, ),
crossAxisAlignment: CrossAxisAlignment.start, ),
children: [ if (switchStore == 0)
Expanded( GestureDetector(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
setState(() { setState(() {
choiceIndex = 0; switchStore = 1;
showAlertDialog();
}); });
}, },
child: Column( child: Container(
children: [ width: 97.w,
Image.asset( decoration: BoxDecoration(
choiceIndex == 0 color: Color(0xFFEBEFF6),
? "assets/image/business_home.webp" borderRadius: BorderRadius.only(
: "assets/image/business_ home_h.webp", topLeft: Radius.circular(111),
width: 30, bottomLeft: Radius.circular(111),
height: 30,
), ),
SizedBox(
height: 5.h,
), ),
padding: EdgeInsets.only(left: 12.w, top: 10.h, bottom: 10.h),
margin: EdgeInsets.only(bottom: 170.h),
child: Row(
children: [
Padding(
padding: EdgeInsets.only(right: 4.w),
child: Image.asset(
"assets/image/bs_switch.webp",
width: 12.w,
height: 15.h,
)),
Text( Text(
"首页", "切换门店",
textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 10.sp, color: Color(0xFF30415B),
fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: choiceIndex == 0
? Color(0xFF4C4C4C)
: Color(0xFFACACAC),
), ),
), ),
], ],
)),
), ),
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
choiceIndex = 1;
});
},
child: Column(
children: [
Image.asset(
(choiceIndex == 0 ||
choiceIndex == 3 ||
choiceIndex == 4)
? "assets/image/business_order_h.webp"
: "assets/image/business_order.webp",
width: 30,
height: 30,
), ),
SizedBox(
height: 5.h,
),
Text(
"订单",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.semi_bold,
color: (choiceIndex == 0 ||
choiceIndex == 3 ||
choiceIndex == 4)
? Color(0xFFACACAC)
: Color(0xFF4C4C4C),
), ),
],
), ),
extendBody: true,
bottomNavigationBar: Container(
alignment: Platform.isAndroid ? Alignment.center : Alignment.topCenter,
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 2),
blurRadius: 4,
spreadRadius: 0,
)
], ],
borderRadius: BorderRadius.vertical(
top: Radius.circular(4),
), ),
)),
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context).pushNamed('/router/scan_code_page', arguments:{"storeId":businessLoginInfo?.storeList[selectStoreIndex]?.id ?? "0"});
},
child: Image.asset(
"assets/image/business_scan_code.webp",
width: 52,
height: 52,
), ),
)), height: 82.h,
Expanded( child: Row(
child: GestureDetector( mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
bottomNavigationItem("首页", 0, "assets/image/business_home.webp",
"assets/image/business_ home_h.webp"),
bottomNavigationItem("订单", 1, "assets/image/business_order.webp",
"assets/image/business_order_h.webp"),
// bottomNavigationItem("", 2,"assets/image/business_scan_code.webp","assets/image/business_scan_code.webp"),
GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
setState(() { Navigator.of(context)
choiceIndex = 3; .pushNamed('/router/scan_code_page', arguments: {
"storeId":
businessLoginInfo?.storeList[selectStoreIndex]?.id ?? "0"
}); });
}, },
child: Column( child: Container(
children: [ padding: EdgeInsets.only(top: 10.h),
Image.asset( child: Image.asset(
(choiceIndex == 0 || "assets/image/business_scan_code.webp",
choiceIndex == 1 || width: 52.h,
choiceIndex == 4) height: 52.h,
? "assets/image/business_goods_h.webp"
: "assets/image/business_goods.webp",
width: 30,
height: 30,
),
SizedBox(
height: 5.h,
), ),
Text(
"商品",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.semi_bold,
color: (choiceIndex == 0 ||
choiceIndex == 1 ||
choiceIndex == 4)
? Color(0xFFACACAC)
: Color(0xFF4C4C4C),
), ),
), ),
bottomNavigationItem("商品", 2, "assets/image/business_goods.webp",
"assets/image/business_goods_h.webp"),
bottomNavigationItem("我的", 3, "assets/image/business_mine.webp",
"assets/image/business_mine_h.webp"),
], ],
), ),
)), ),
Expanded( );
child: GestureDetector( }
behavior: HitTestBehavior.opaque,
Widget bottomNavigationItem(text, index, image, unImage) {
var isSelected = index == clickIndex;
return Expanded(
child: InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
choiceIndex = 4; clickIndex = index;
pageController.jumpToPage(clickIndex);
}); });
}, },
child: Container(
width: 45.w,
child: Column( child: Column(
mainAxisAlignment: Platform.isAndroid
? MainAxisAlignment.center
: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Image.asset( if (Platform.isIOS)
(choiceIndex == 0 ||
choiceIndex == 1 ||
choiceIndex == 3)
? "assets/image/business_mine_h.webp"
: "assets/image/business_mine.webp",
width: 30,
height: 30,
),
SizedBox( SizedBox(
height: 5.h, height: 4.h,
),
Image.asset(
isSelected ? image : unImage,
width: 30.h,
height: 30.h,
), ),
Text( Text(
"我的", text,
style: TextStyle( style: TextStyle(
fontSize: 10.sp, fontSize: 10.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: (choiceIndex == 0 || color: isSelected ? Color(0xFF4C4C4C) : Color(0xFFACACAC),
choiceIndex == 1 ||
choiceIndex == 3)
? Color(0xFFACACAC)
: Color(0xFF4C4C4C),
), ),
), ),
], ],
), ),
)),
],
),
), ),
), ),
], flex: 1,
),
],
); );
} }
///
showAlertDialog() async {
try {
int index = await showCupertinoModalPopup(
builder: (context) {
return HomeSideslipDialog(selectStoreIndex, businessLoginInfo);
},
context: context);
if (index != null) {
if (index == -1) {
Navigator.of(context).pop();
return;
}
setState(() {
selectStoreIndex = index;
homePageKey = GlobalKey();
orderPageKey = GlobalKey();
goodsPageKey = GlobalKey();
minePageKey = GlobalKey();
});
}
} finally {
setState(() {
switchStore = 0;
});
}
}
@override @override
bool get wantKeepAlive => true; bool get wantKeepAlive => true;
} }

57
lib/business_system/goods/business_goods_page.dart

@ -1,17 +1,19 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:huixiang/business_system/goods/off_shelf/off_shelf_page.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../utils/font_weight.dart';
import '../../view_widget/my_appbar.dart'; import '../../view_widget/my_appbar.dart';
import '../../view_widget/my_tab.dart'; import '../../view_widget/my_tab.dart';
import '../order/ticket/ticket_tab.dart';
import 'off_shelf/off_shelf_page.dart';
import 'on_sale/on_sale_page.dart'; import 'on_sale/on_sale_page.dart';
class BusinessGoodsPage extends StatefulWidget { class BusinessGoodsPage extends StatefulWidget {
final String storeId; final String storeId;
BusinessGoodsPage(this.storeId); BusinessGoodsPage(Key key,this.storeId): super(key: key);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -19,12 +21,11 @@ class BusinessGoodsPage extends StatefulWidget {
} }
} }
class _BusinessGoodsPage extends State<BusinessGoodsPage> class _BusinessGoodsPage extends State<BusinessGoodsPage> {
with AutomaticKeepAliveClientMixin {
final RefreshController refreshController = RefreshController(); final RefreshController refreshController = RefreshController();
final ScrollController scrollController = ScrollController();
String offShelfTotal; String offShelfTotal;
String onSaleTotal; String onSaleTotal;
int goodsIndex = 0;
@override @override
void initState() { void initState() {
@ -33,12 +34,12 @@ class _BusinessGoodsPage extends State<BusinessGoodsPage>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context);
return Column( return Column(
children: [ children: [
Expanded(child: Expanded(
child:
DefaultTabController( DefaultTabController(
length: 2, length: 3,
child: Scaffold( child: Scaffold(
appBar: MyAppBar( appBar: MyAppBar(
title:"", title:"",
@ -60,6 +61,10 @@ class _BusinessGoodsPage extends State<BusinessGoodsPage>
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
color: Color(0xFF666666) color: Color(0xFF666666)
), ),
indicator: const TicketTab(
width: 33,
borderSide: BorderSide(
width: 2.0, color: Color(0xFF30415B))),
// controller: tabController, // controller: tabController,
// //
unselectedLabelColor: Color(0xffA29E9E), unselectedLabelColor: Color(0xffA29E9E),
@ -68,10 +73,37 @@ class _BusinessGoodsPage extends State<BusinessGoodsPage>
tabs: <Widget>[ tabs: <Widget>[
MyTab(text:"在售中(${onSaleTotal ?? "0"})"), MyTab(text:"在售中(${onSaleTotal ?? "0"})"),
MyTab(text: "已下架(${offShelfTotal ?? "0"})"), MyTab(text: "已下架(${offShelfTotal ?? "0"})"),
GestureDetector(
onTap: (){
Navigator.of(context).pushNamed(
'/router/add_goods_page',
arguments: {
"storeId":widget.storeId ?? "",
});
},
child:Row(children: [Padding(
padding: EdgeInsets.only(right: 5.w),
child: Text(
"新增商品",
textAlign: TextAlign.center,
style: TextStyle(
height: 1.5,
color: Color(0xFF2E3552),
fontSize: 16.sp,
fontWeight: MyFontWeight.bold,
),
)), Image.asset(
"assets/image/bus_goods_add.webp",
width: 14.w,
height: 15.h,
),
]),
),
], ],
), ),
), ),
body: TabBarView( body: TabBarView(
physics: NeverScrollableScrollPhysics(),
children: [ children: [
OnSalePage(widget.storeId,(value){ OnSalePage(widget.storeId,(value){
setState((){ setState((){
@ -82,10 +114,13 @@ class _BusinessGoodsPage extends State<BusinessGoodsPage>
setState((){ setState((){
offShelfTotal = value; offShelfTotal = value;
}); });
})], }),
Container()
],
),
),
), ),
), ),
),),
SizedBox( SizedBox(
height: 76.h, height: 76.h,
), ),
@ -93,6 +128,4 @@ class _BusinessGoodsPage extends State<BusinessGoodsPage>
); );
} }
@override
bool get wantKeepAlive => true;
} }

363
lib/business_system/home/business_home_page.dart

@ -3,7 +3,6 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/business_system/home/home_view/home_sideslip_dialog.dart';
import 'package:huixiang/utils/business_instance.dart'; import 'package:huixiang/utils/business_instance.dart';
import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/my_footer.dart'; import 'package:huixiang/view_widget/my_footer.dart';
@ -19,7 +18,6 @@ import '../../retrofit/data/business_login_info.dart';
import '../../retrofit/data/day_count.dart'; import '../../retrofit/data/day_count.dart';
import '../../utils/flutter_utils.dart'; import '../../utils/flutter_utils.dart';
import '../../utils/font_weight.dart'; import '../../utils/font_weight.dart';
import '../../view_widget/settlement_tips_dialog.dart';
class BusinessHomePage extends StatefulWidget { class BusinessHomePage extends StatefulWidget {
final BusinessLoginInfo businessLoginInfo; final BusinessLoginInfo businessLoginInfo;
@ -27,8 +25,8 @@ class BusinessHomePage extends StatefulWidget {
final Function changeIndex; final Function changeIndex;
final Function changeTab; final Function changeTab;
BusinessHomePage( BusinessHomePage(Key key,this.businessLoginInfo, this.selectStoreIndex,
this.businessLoginInfo, this.selectStoreIndex, this.changeIndex,this.changeTab); this.changeIndex, this.changeTab): super(key: key);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -36,8 +34,7 @@ class BusinessHomePage extends StatefulWidget {
} }
} }
class _BusinessHomePage extends State<BusinessHomePage> class _BusinessHomePage extends State<BusinessHomePage> {
with AutomaticKeepAliveClientMixin {
final RefreshController refreshController = RefreshController(); final RefreshController refreshController = RefreshController();
final ScrollController scrollController = ScrollController(); final ScrollController scrollController = ScrollController();
BusinessApiService businessService; BusinessApiService businessService;
@ -48,19 +45,21 @@ class _BusinessHomePage extends State<BusinessHomePage>
void initState() { void initState() {
super.initState(); super.initState();
_onRefresh(); _onRefresh();
} }
@override @override
void dispose() { void dispose() {
super.dispose(); super.dispose();
refreshController.dispose();
} }
_onRefresh({int index, isLoading = true}) async { _onRefresh({int index, isLoading = true}) async {
if (isLoading) if (isLoading)
EasyLoading.show( EasyLoading.show(
status: S.current.zhengzaijiazai, status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black); maskType: EasyLoadingMaskType.black);
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {
if (!mounted) return;
businessService = BusinessApiService(Dio(), businessService = BusinessApiService(Dio(),
context: context, context: context,
token: BusinessInstance.instance.businessToken, token: BusinessInstance.instance.businessToken,
@ -106,7 +105,6 @@ class _BusinessHomePage extends State<BusinessHomePage>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context);
return Column( return Column(
children: [ children: [
Expanded( Expanded(
@ -140,6 +138,68 @@ class _BusinessHomePage extends State<BusinessHomePage>
), ),
), ),
), ),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context)
.pushNamed('/router/service_subscription_page', arguments: {
"storeId": widget.businessLoginInfo
.storeList[widget.selectStoreIndex].name ==
"所有门店"
? "0"
: widget
.businessLoginInfo.storeList[widget.selectStoreIndex].id
});
},
child: Container(
alignment: Alignment.center,
padding: EdgeInsets.only(
top: 20.h, bottom: 28.h, left: 20.w, right: 23.w),
color: Color(0xFFDCE8FC),
child: Row(
children: [
Expanded(
child: Text.rich(
TextSpan(
children: [
TextSpan(
text: "试用期到期时间:",
style: TextStyle(
color: Color(0xFF252626),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
),
TextSpan(
text: "2024-01-02",
style: TextStyle(
color: Color(0xFFFF8F1F),
fontSize: 14.sp,
fontWeight: FontWeight.w500,
),
),
],
),
),
),
Padding(
padding: EdgeInsets.only(right: 2.w),
child: Text(
"去购买服务",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF30415B),
fontWeight: MyFontWeight.regular),
)),
Image.asset(
"assets/image/icon_right_z.webp",
width: 14.h,
height: 14.h,
color: Color(0xFF30415B),
),
],
)),
),
SizedBox( SizedBox(
height: 76.h, height: 76.h,
), ),
@ -165,10 +225,7 @@ class _BusinessHomePage extends State<BusinessHomePage>
child: GestureDetector( child: GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
showAlertDialog( widget.changeIndex();
widget.selectStoreIndex,
widget.businessLoginInfo,
);
// //
// SystemChrome.setSystemUIOverlayStyle( SystemUiOverlayStyle(statusBarColor: Colors.white), ); // SystemChrome.setSystemUIOverlayStyle( SystemUiOverlayStyle(statusBarColor: Colors.white), );
// Navigator.of(context).pushNamed('/router/select_shop'); // Navigator.of(context).pushNamed('/router/select_shop');
@ -407,26 +464,6 @@ class _BusinessHomePage extends State<BusinessHomePage>
); );
} }
///
showAlertDialog(
selectStoreIndex,
businessLoginInfo,
) async {
int index = await showCupertinoModalPopup(
builder: (context) {
return HomeSideslipDialog(selectStoreIndex, businessLoginInfo);
},
context: context);
if (index != null) {
if (index == -1) {
Navigator.of(context).pop();
return;
}
widget.changeIndex(index);
_onRefresh(index: index);
}
}
/// ///
showIdentitySwitchDialog() async { showIdentitySwitchDialog() async {
SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
@ -488,8 +525,9 @@ class _BusinessHomePage extends State<BusinessHomePage>
Widget commonFunctions() { Widget commonFunctions() {
return Container( return Container(
color: Colors.white, color: Colors.white,
margin: EdgeInsets.only(bottom:16.h), margin: EdgeInsets.only(bottom: 16.h),
padding: EdgeInsets.only(left: 16.w, right: 15.w, top: 12.h, bottom: 16.h), padding:
EdgeInsets.only(left: 16.w, right: 15.w, top: 12.h, bottom: 16.h),
child: Column( child: Column(
children: [ children: [
Row( Row(
@ -511,13 +549,13 @@ class _BusinessHomePage extends State<BusinessHomePage>
], ],
), ),
GridView.builder( GridView.builder(
itemCount:commonFunctionsList.length ?? 0, itemCount: commonFunctionsList.length ?? 0,
padding: EdgeInsets.only(top:24.h), padding: EdgeInsets.only(top: 24.h),
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 4, crossAxisCount: 4,
crossAxisSpacing:15.w, crossAxisSpacing: 15.w,
mainAxisSpacing: 12.w, mainAxisSpacing: 12.w,
), ),
itemBuilder: (context, index) { itemBuilder: (context, index) {
@ -538,119 +576,144 @@ class _BusinessHomePage extends State<BusinessHomePage>
commonFunctionsIndex(index) async { commonFunctionsIndex(index) async {
switch (index) { switch (index) {
case 0: case 0:
if ((widget.businessLoginInfo if ((widget.businessLoginInfo.storeList[widget.selectStoreIndex].name ==
.storeList[widget.selectStoreIndex].name ==
"所有门店" "所有门店"
? "0" ? "0"
: widget.businessLoginInfo : widget
.storeList[widget.selectStoreIndex].id) == "0") { .businessLoginInfo.storeList[widget.selectStoreIndex].id) ==
SmartDialog.show( "0") {
widget: SettlementTips( widget.changeIndex();
() {}, } else {
text: "请选择门店进行收银操作",
color: Color(0xFF30415B),
));
}else{
Navigator.of(context).pushNamed('/router/cashier_page', arguments: { Navigator.of(context).pushNamed('/router/cashier_page', arguments: {
"storeId": widget.businessLoginInfo "storeId": widget.businessLoginInfo
.storeList[widget.selectStoreIndex].name == .storeList[widget.selectStoreIndex].name ==
"所有门店" "所有门店"
? "0" ? "0"
: widget.businessLoginInfo : widget
.storeList[widget.selectStoreIndex].id, .businessLoginInfo.storeList[widget.selectStoreIndex].id,
}); });
} }
break; break;
case 1: case 1:
Navigator.of(context) Navigator.of(context)
.pushNamed('/router/vip_recharge_page', arguments: { .pushNamed('/router/vip_recharge_page', arguments: {
"storeId": widget.businessLoginInfo "storeId": widget.businessLoginInfo.storeList[widget.selectStoreIndex]
.storeList[widget.selectStoreIndex].name == .name ==
"所有门店" "所有门店"
? "0" ? "0"
: widget.businessLoginInfo : widget.businessLoginInfo.storeList[widget.selectStoreIndex].id,
.storeList[widget.selectStoreIndex].id,
}); });
break; break;
case 2: case 2:
Navigator.of(context) Navigator.of(context).pushNamed('/router/add_vip', arguments: {
.pushNamed('/router/add_vip', arguments: { "storeId": widget.businessLoginInfo.storeList[widget.selectStoreIndex]
"storeId": widget.businessLoginInfo .name ==
.storeList[widget.selectStoreIndex].name ==
"所有门店" "所有门店"
? "0" ? "0"
: widget.businessLoginInfo : widget.businessLoginInfo.storeList[widget.selectStoreIndex].id,
.storeList[widget.selectStoreIndex].id,
}); });
break; break;
case 3: case 3:
Navigator.of(context) Navigator.of(context)
.pushNamed('/router/trade_overview_page', arguments: { .pushNamed('/router/trade_overview_page', arguments: {
"storeId": widget.businessLoginInfo "storeId": widget.businessLoginInfo.storeList[widget.selectStoreIndex]
.storeList[widget.selectStoreIndex].name == .name ==
"所有门店" "所有门店"
? "0" ? "0"
: widget.businessLoginInfo : widget.businessLoginInfo.storeList[widget.selectStoreIndex].id,
.storeList[widget.selectStoreIndex].id,
}); });
break; break;
case 4: case 4:
Navigator.of(context) Navigator.of(context)
.pushNamed('/router/business_vip_page', arguments: { .pushNamed('/router/business_vip_page', arguments: {
"storeId": widget.businessLoginInfo "storeId": widget.businessLoginInfo.storeList[widget.selectStoreIndex]
.storeList[widget.selectStoreIndex].name == .name ==
"所有门店" "所有门店"
? "0" ? "0"
: widget.businessLoginInfo : widget.businessLoginInfo.storeList[widget.selectStoreIndex].id,
.storeList[widget.selectStoreIndex].id,
}); });
break; break;
case 5: case 5:
Navigator.of(context) Navigator.of(context).pushNamed('/router/hot_selling_page', arguments: {
.pushNamed('/router/hot_selling_page', arguments: { "storeId": widget.businessLoginInfo.storeList[widget.selectStoreIndex]
"storeId": widget.businessLoginInfo .name ==
.storeList[widget.selectStoreIndex].name ==
"所有门店" "所有门店"
? "0" ? "0"
: widget.businessLoginInfo : widget.businessLoginInfo.storeList[widget.selectStoreIndex].id,
.storeList[widget.selectStoreIndex].id,
}); });
break; break;
case 6: case 6:
Navigator.of(context) Navigator.of(context).pushNamed('/router/flow_page', arguments: {
.pushNamed('/router/flow_page', arguments: {
"storeName": widget?.businessLoginInfo "storeName": widget?.businessLoginInfo
?.storeList[widget.selectStoreIndex].name ?? ?.storeList[widget.selectStoreIndex].name ??
"", "",
"storeId": widget.businessLoginInfo "storeId": widget.businessLoginInfo.storeList[widget.selectStoreIndex]
.storeList[widget.selectStoreIndex].name == .name ==
"所有门店" "所有门店"
? "0" ? "0"
: widget.businessLoginInfo : widget.businessLoginInfo.storeList[widget.selectStoreIndex].id,
.storeList[widget.selectStoreIndex].id,
}); });
break; break;
case 7: case 7:
widget.changeTab(3); widget.changeTab(3);
break; break;
} }
} }
/// ///
List<Map<String,String>> commonFunctionsList = [ List<Map<String, String>> commonFunctionsList = [
{"image":"assets/image/bus_home_syt.webp","commonName":"收银台","imageWidth":"26","imageHeight":"23"}, {
{"image":"assets/image/bus_home_cz.webp","commonName":"充值","imageWidth":"22","imageHeight":"19"}, "image": "assets/image/bus_home_syt.webp",
{"image":"assets/image/bus_home_bhy.webp","commonName":"办会员","imageWidth":"24","imageHeight":"21"}, "commonName": "收银台",
{"image":"assets/image/bus_home_syzl.webp","commonName":"生意总览","imageWidth":"22","imageHeight":"23"}, "imageWidth": "26",
{"image":"assets/image/bus_home_hygl.webp","commonName":"会员管理","imageWidth":"23","imageHeight":"25"}, "imageHeight": "23"
{"image":"assets/image/bus_home_rxbd.webp","commonName":"热销榜单","imageWidth":"20","imageHeight":"26"}, },
{"image":"assets/image/bus_home_jrls.webp","commonName":"今日流水","imageWidth":"22","imageHeight":"23"}, {
{"image":"assets/image/bus_home_goods.webp","commonName":"商品","imageWidth":"21","imageHeight":"23"}, "image": "assets/image/bus_home_cz.webp",
"commonName": "充值",
"imageWidth": "22",
"imageHeight": "19"
},
{
"image": "assets/image/bus_home_bhy.webp",
"commonName": "办会员",
"imageWidth": "24",
"imageHeight": "21"
},
{
"image": "assets/image/bus_home_syzl.webp",
"commonName": "生意总览",
"imageWidth": "22",
"imageHeight": "23"
},
{
"image": "assets/image/bus_home_hygl.webp",
"commonName": "会员管理",
"imageWidth": "23",
"imageHeight": "25"
},
{
"image": "assets/image/bus_home_rxbd.webp",
"commonName": "热销榜单",
"imageWidth": "20",
"imageHeight": "26"
},
{
"image": "assets/image/bus_home_jrls.webp",
"commonName": "今日流水",
"imageWidth": "22",
"imageHeight": "23"
},
{
"image": "assets/image/bus_home_goods.webp",
"commonName": "商品",
"imageWidth": "21",
"imageHeight": "23"
},
]; ];
///Item ///Item
Widget commonFunctionsItem(index){ Widget commonFunctionsItem(index) {
return Column( return Column(
children: [ children: [
Image.asset( Image.asset(
@ -659,7 +722,8 @@ class _BusinessHomePage extends State<BusinessHomePage>
height: double.tryParse(commonFunctionsList[index]["imageHeight"]).h, height: double.tryParse(commonFunctionsList[index]["imageHeight"]).h,
fit: BoxFit.fill, fit: BoxFit.fill,
), ),
Padding(padding: EdgeInsets.only(top: 12.h), Padding(
padding: EdgeInsets.only(top: 12.h),
child: Text( child: Text(
commonFunctionsList[index]["commonName"], commonFunctionsList[index]["commonName"],
textAlign: TextAlign.center, textAlign: TextAlign.center,
@ -677,8 +741,9 @@ class _BusinessHomePage extends State<BusinessHomePage>
Widget homeStatistics() { Widget homeStatistics() {
return Container( return Container(
color: Colors.white, color: Colors.white,
margin: EdgeInsets.only(bottom:16.h), margin: EdgeInsets.only(bottom: 16.h),
padding: EdgeInsets.only(left: 16.w, right: 15.w, top: 12.h, bottom: 16.h), padding:
EdgeInsets.only(left: 16.w, right: 15.w, top: 12.h, bottom: 16.h),
child: Column( child: Column(
children: [ children: [
Row( Row(
@ -700,13 +765,13 @@ class _BusinessHomePage extends State<BusinessHomePage>
], ],
), ),
GridView.builder( GridView.builder(
itemCount:homeStatisticsList.length ?? 0, itemCount: homeStatisticsList.length ?? 0,
padding: EdgeInsets.only(top:24.h), padding: EdgeInsets.only(top: 24.h),
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 4, crossAxisCount: 4,
crossAxisSpacing:15.w, crossAxisSpacing: 15.w,
mainAxisSpacing: 12.w, mainAxisSpacing: 12.w,
), ),
itemBuilder: (context, index) { itemBuilder: (context, index) {
@ -729,89 +794,113 @@ class _BusinessHomePage extends State<BusinessHomePage>
case 0: case 0:
Navigator.of(context) Navigator.of(context)
.pushNamed('/router/trade_overview_page', arguments: { .pushNamed('/router/trade_overview_page', arguments: {
"storeId": widget.businessLoginInfo "storeId": widget.businessLoginInfo.storeList[widget.selectStoreIndex]
.storeList[widget.selectStoreIndex].name == .name ==
"所有门店" "所有门店"
? "0" ? "0"
: widget.businessLoginInfo : widget.businessLoginInfo.storeList[widget.selectStoreIndex].id,
.storeList[widget.selectStoreIndex].id,
}); });
break; break;
case 1: case 1:
Navigator.of(context) Navigator.of(context)
.pushNamed('/router/business_vip_page', arguments: { .pushNamed('/router/business_vip_page', arguments: {
"storeId": widget.businessLoginInfo "storeId": widget.businessLoginInfo.storeList[widget.selectStoreIndex]
.storeList[widget.selectStoreIndex].name == .name ==
"所有门店" "所有门店"
? "0" ? "0"
: widget.businessLoginInfo : widget.businessLoginInfo.storeList[widget.selectStoreIndex].id,
.storeList[widget.selectStoreIndex].id, "index": 2
"index":2
}); });
break; break;
case 2: case 2:
Navigator.of(context) Navigator.of(context)
.pushNamed('/router/business_vip_page', arguments: { .pushNamed('/router/business_vip_page', arguments: {
"storeId": widget.businessLoginInfo "storeId": widget.businessLoginInfo.storeList[widget.selectStoreIndex]
.storeList[widget.selectStoreIndex].name == .name ==
"所有门店" "所有门店"
? "0" ? "0"
: widget.businessLoginInfo : widget.businessLoginInfo.storeList[widget.selectStoreIndex].id,
.storeList[widget.selectStoreIndex].id, "index": 1
"index":1
}); });
break; break;
case 3: case 3:
Navigator.of(context) Navigator.of(context)
.pushNamed('/router/consumer_ranking_page', arguments: { .pushNamed('/router/consumer_ranking_page', arguments: {
"storeId": widget.businessLoginInfo "storeId": widget.businessLoginInfo.storeList[widget.selectStoreIndex]
.storeList[widget.selectStoreIndex].name == .name ==
"所有门店" "所有门店"
? "0" ? "0"
: widget.businessLoginInfo : widget.businessLoginInfo.storeList[widget.selectStoreIndex].id,
.storeList[widget.selectStoreIndex].id, "titleName": "会员余额统计"
"titleName":"会员余额统计"
}); });
break; break;
case 4: case 4:
Navigator.of(context) Navigator.of(context)
.pushNamed('/router/consumer_ranking_page', arguments: { .pushNamed('/router/consumer_ranking_page', arguments: {
"storeId": widget.businessLoginInfo "storeId": widget.businessLoginInfo.storeList[widget.selectStoreIndex]
.storeList[widget.selectStoreIndex].name == .name ==
"所有门店" "所有门店"
? "0" ? "0"
: widget.businessLoginInfo : widget.businessLoginInfo.storeList[widget.selectStoreIndex].id,
.storeList[widget.selectStoreIndex].id, "titleName": "消费排名"
"titleName":"消费排名"
}); });
break; break;
case 5: case 5:
Navigator.of(context) Navigator.of(context)
.pushNamed('/router/trade_overview_page', arguments: { .pushNamed('/router/trade_overview_page', arguments: {
"storeId": widget.businessLoginInfo "storeId": widget.businessLoginInfo.storeList[widget.selectStoreIndex]
.storeList[widget.selectStoreIndex].name == .name ==
"所有门店" "所有门店"
? "0" ? "0"
: widget.businessLoginInfo : widget.businessLoginInfo.storeList[widget.selectStoreIndex].id,
.storeList[widget.selectStoreIndex].id, "index": 2
"index":2
}); });
break; break;
} }
} }
/// ///
List<Map<String,String>> homeStatisticsList = [ List<Map<String, String>> homeStatisticsList = [
{"image":"assets/image/bus_home_yytj.webp","commonName":"营业统计","imageWidth":"21","imageHeight":"20"}, {
{"image":"assets/image/bus_home_xfjl.webp","commonName":"消费记录","imageWidth":"22","imageHeight":"21"}, "image": "assets/image/bus_home_yytj.webp",
{"image":"assets/image/bus_home_czjl.webp","commonName":"充值记录","imageWidth":"19","imageHeight":"22"}, "commonName": "营业统计",
{"image":"assets/image/bus_home_hyyetj.webp","commonName":"会员余额统计","imageWidth":"23","imageHeight":"23"}, "imageWidth": "21",
{"image":"assets/image/bus_home_xfpm.webp","commonName":"消费排名","imageWidth":"26","imageHeight":"22"}, "imageHeight": "20"
{"image":"assets/image/bus_home_goods_ssfx.webp","commonName":"商品销售分析","imageWidth":"26","imageHeight":"23"}, },
{
"image": "assets/image/bus_home_xfjl.webp",
"commonName": "消费记录",
"imageWidth": "22",
"imageHeight": "21"
},
{
"image": "assets/image/bus_home_czjl.webp",
"commonName": "充值记录",
"imageWidth": "19",
"imageHeight": "22"
},
{
"image": "assets/image/bus_home_hyyetj.webp",
"commonName": "会员余额统计",
"imageWidth": "23",
"imageHeight": "23"
},
{
"image": "assets/image/bus_home_xfpm.webp",
"commonName": "消费排名",
"imageWidth": "26",
"imageHeight": "22"
},
{
"image": "assets/image/bus_home_goods_ssfx.webp",
"commonName": "商品销售分析",
"imageWidth": "26",
"imageHeight": "23"
},
]; ];
///Item ///Item
Widget homeStatisticsItem(index){ Widget homeStatisticsItem(index) {
return Column( return Column(
children: [ children: [
Image.asset( Image.asset(
@ -820,7 +909,8 @@ class _BusinessHomePage extends State<BusinessHomePage>
height: double.tryParse(homeStatisticsList[index]["imageHeight"]).h, height: double.tryParse(homeStatisticsList[index]["imageHeight"]).h,
fit: BoxFit.fill, fit: BoxFit.fill,
), ),
Padding(padding: EdgeInsets.only(top: 12.h), Padding(
padding: EdgeInsets.only(top: 12.h),
child: Text( child: Text(
homeStatisticsList[index]["commonName"], homeStatisticsList[index]["commonName"],
textAlign: TextAlign.center, textAlign: TextAlign.center,
@ -833,7 +923,4 @@ class _BusinessHomePage extends State<BusinessHomePage>
], ],
); );
} }
@override
bool get wantKeepAlive => true;
} }

43
lib/business_system/home/select_shop.dart

@ -1,12 +1,18 @@
import 'package:dio/dio.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../generated/l10n.dart'; import '../../generated/l10n.dart';
import '../../retrofit/business_api.dart';
import '../../retrofit/data/base_data.dart';
import '../../retrofit/data/business_login_info.dart'; import '../../retrofit/data/business_login_info.dart';
import '../../retrofit/data/business_store_list.dart'; import '../../retrofit/data/business_store_list.dart';
import '../../utils/business_instance.dart';
import '../../view_widget/classic_header.dart'; import '../../view_widget/classic_header.dart';
import '../../view_widget/my_footer.dart'; import '../../view_widget/my_footer.dart';
@ -24,6 +30,7 @@ class SelectShop extends StatefulWidget {
class _SelectShop extends State<SelectShop> { class _SelectShop extends State<SelectShop> {
final RefreshController refreshController = RefreshController(); final RefreshController refreshController = RefreshController();
BusinessLoginInfo businessLoginInfo; BusinessLoginInfo businessLoginInfo;
BusinessApiService businessService;
List<Records> records = []; List<Records> records = [];
int selectIndex = 0; int selectIndex = 0;
@ -31,7 +38,43 @@ class _SelectShop extends State<SelectShop> {
void initState() { void initState() {
super.initState(); super.initState();
businessLoginInfo = widget.arguments["businessLoginInfo"]; businessLoginInfo = widget.arguments["businessLoginInfo"];
if(widget.arguments["routeSource"] == "单门店")
records = widget.arguments["records"]; records = widget.arguments["records"];
if(widget.arguments["routeSource"] == "门店设置")
queryStoreList();
}
///
queryStoreList() async {
try{
EasyLoading.show(
status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
if (businessService == null) {
businessService = BusinessApiService(Dio(),
context: context,
token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant,
storeId: "0");
}
BaseData<BusinessStoreList> baseData = await businessService
.getStoreList(BusinessInstance.instance.businessTenant, "1", "100")
.catchError((error) {
refreshController.refreshFailed();
refreshController.loadFailed();
});
if (!mounted) return;
if (baseData != null && baseData.isSuccess) {
records.clear();
records.addAll((baseData?.data?.records ?? []).reversed);
refreshController.refreshCompleted();
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}finally{
EasyLoading.dismiss();
setState((){});
}
} }
@override @override

1
lib/business_system/home/vip/vip_recharge_page.dart

@ -684,7 +684,6 @@ class _VipRechargePage extends State<VipRechargePage> {
bottom: 34.h), bottom: 34.h),
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
padding: EdgeInsets.symmetric(vertical: 16.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFF30415B), color: Color(0xFF30415B),
borderRadius: BorderRadius.circular(27), borderRadius: BorderRadius.circular(27),

110
lib/business_system/mine/business_mine_page.dart

@ -7,20 +7,19 @@ import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/my_footer.dart'; import 'package:huixiang/view_widget/my_footer.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:visibility_detector/visibility_detector.dart';
import '../../retrofit/business_api.dart'; import '../../retrofit/business_api.dart';
import '../../retrofit/data/base_data.dart'; import '../../retrofit/data/base_data.dart';
import '../../retrofit/data/business_login_info.dart'; import '../../retrofit/data/business_login_info.dart';
import '../../retrofit/data/business_store_list.dart'; import '../../retrofit/data/business_store_list.dart';
import '../../utils/business_instance.dart'; import '../../utils/business_instance.dart';
import '../../utils/flutter_utils.dart';
import '../../utils/font_weight.dart'; import '../../utils/font_weight.dart';
class BusinessMinePage extends StatefulWidget { class BusinessMinePage extends StatefulWidget {
final BusinessLoginInfo businessLoginInfo; final BusinessLoginInfo businessLoginInfo;
final String storeId; final String storeId;
BusinessMinePage(this.businessLoginInfo, this.storeId); BusinessMinePage(Key key, this.businessLoginInfo, this.storeId)
: super(key: key);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -28,17 +27,18 @@ class BusinessMinePage extends StatefulWidget {
} }
} }
class _BusinessMinePage extends State<BusinessMinePage> class _BusinessMinePage extends State<BusinessMinePage> {
with AutomaticKeepAliveClientMixin {
final RefreshController refreshController = RefreshController(); final RefreshController refreshController = RefreshController();
BusinessApiService businessService; BusinessApiService businessService;
List<Records> records = []; List<Records> records = [];
double visiblePercentage;
int networkStatus = 0; int networkStatus = 0;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
if (widget.businessLoginInfo.storeList.length == 1) {
queryStoreList();
}
} }
@override @override
@ -49,9 +49,6 @@ class _BusinessMinePage extends State<BusinessMinePage>
/// ///
queryStoreList() async { queryStoreList() async {
// EasyLoading.show(
// status: S.current.zhengzaijiazai,
// maskType: EasyLoadingMaskType.black);
if (businessService == null) { if (businessService == null) {
businessService = BusinessApiService(Dio(), businessService = BusinessApiService(Dio(),
context: context, context: context,
@ -62,18 +59,14 @@ class _BusinessMinePage extends State<BusinessMinePage>
BaseData<BusinessStoreList> baseData = await businessService BaseData<BusinessStoreList> baseData = await businessService
.getStoreList(BusinessInstance.instance.businessTenant, "1", "100") .getStoreList(BusinessInstance.instance.businessTenant, "1", "100")
.catchError((error) { .catchError((error) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
alignment: Alignment.center);
networkStatus = -1;
refreshController.refreshFailed(); refreshController.refreshFailed();
refreshController.loadFailed(); refreshController.loadFailed();
}); });
if (!mounted) return; if (!mounted) return;
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
records = baseData.data.records ?? []; records.clear();
records.addAll((baseData.data.records ?? []).reversed);
refreshController.refreshCompleted(); refreshController.refreshCompleted();
networkStatus = 1;
// EasyLoading.dismiss();
} else { } else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
} }
@ -81,14 +74,7 @@ class _BusinessMinePage extends State<BusinessMinePage>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context); return Column(
return VisibilityDetector(
key: Key('my-widget-key'),
onVisibilityChanged: (visibilityInfo) {
visiblePercentage = visibilityInfo.visibleFraction;
if (visiblePercentage == 1) queryStoreList();
},
child: Column(
children: [ children: [
Expanded( Expanded(
child: Container( child: Container(
@ -137,12 +123,15 @@ class _BusinessMinePage extends State<BusinessMinePage>
height: 76.h, height: 76.h,
), ),
], ],
)); );
} }
Widget mineInfo() { Widget mineInfo() {
return Container( return Container(
child: Stack( child: Stack(
alignment: Alignment.bottomCenter,
children: [
Stack(
children: [ children: [
Container( Container(
width: double.infinity, width: double.infinity,
@ -217,6 +206,48 @@ class _BusinessMinePage extends State<BusinessMinePage>
), ),
], ],
), ),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context)
.pushNamed('/router/service_subscription_page', arguments: {
"storeId": widget.storeId ?? "",
});
},
child: Container(
padding: EdgeInsets.only(bottom: 12.h, left: 16.w),
child: Row(
children: [
Padding(
padding: EdgeInsets.only(right: 14.w),
child: Text(
"服务有效期:2029-12-23",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF353535),
fontWeight: MyFontWeight.regular),
)),
Padding(
padding: EdgeInsets.only(right: 4.w),
child: Text(
"去续费",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF353535),
fontWeight: MyFontWeight.regular),
)),
Image.asset(
"assets/image/icon_right_z.webp",
width: 16.h,
height: 16.h,
color: Color(0xFF353535),
),
],
),
),
)
],
),
); );
} }
@ -249,24 +280,26 @@ class _BusinessMinePage extends State<BusinessMinePage>
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
if(networkStatus == -1){ if (networkStatus == -1) {
queryStoreList(); queryStoreList();
return; return;
} } else if (widget.businessLoginInfo.storeList.length > 1) {
else if (widget.businessLoginInfo.storeList.length > 1) { Navigator.of(context)
Navigator.of(context).pushNamed('/router/select_shop', .pushNamed('/router/select_shop', arguments: {
arguments: {"routeSource": "门店设置", "records": records}); "routeSource": "门店设置",
});
} else { } else {
Navigator.of(context) Navigator.of(context)
.pushNamed('/router/merchant_info', arguments: { .pushNamed('/router/merchant_info', arguments: {
"storeId": widget.storeId, "storeId": widget.storeId,
"storeName": records[0].storeName, "storeName": records[0].storeName,
"records": records[0], "records": records[0],
"routeSource": "单门店"
}); });
} }
}, },
child: commonFunctionsItem( child: commonFunctionsItem(
"assets/image/bs_shop_logo.webp", "门店设置", "",20,20), "assets/image/bs_shop_logo.webp", "门店设置", "", 20, 20),
), ),
Container( Container(
width: double.infinity, width: double.infinity,
@ -282,7 +315,7 @@ class _BusinessMinePage extends State<BusinessMinePage>
SmartDialog.showToast("该功能暂未开放!", alignment: Alignment.center); SmartDialog.showToast("该功能暂未开放!", alignment: Alignment.center);
}, },
child: commonFunctionsItem( child: commonFunctionsItem(
"assets/image/bs_mine_code.webp", "门店预约二维码", "",18,18), "assets/image/bs_mine_code.webp", "门店预约二维码", "", 18, 18),
), ),
Container( Container(
width: double.infinity, width: double.infinity,
@ -300,7 +333,7 @@ class _BusinessMinePage extends State<BusinessMinePage>
}); });
}, },
child: commonFunctionsItem( child: commonFunctionsItem(
"assets/image/bs_secure.webp", "安全设置", "登录手机号/密码",18,22)), "assets/image/bs_secure.webp", "安全设置", "登录手机号/密码", 18, 22)),
Container( Container(
width: double.infinity, width: double.infinity,
height: 1.h, height: 1.h,
@ -316,14 +349,15 @@ class _BusinessMinePage extends State<BusinessMinePage>
}); });
}, },
child: commonFunctionsItem( child: commonFunctionsItem(
"assets/image/bs_mine_clerk.webp", "店员管理", "",18,20), "assets/image/bs_mine_clerk.webp", "店员管理", "", 18, 20),
), ),
], ],
), ),
); );
} }
Widget commonFunctionsItem(icon, leftText, rightText,double width,double height) { Widget commonFunctionsItem(
icon, leftText, rightText, double width, double height) {
return Container( return Container(
margin: EdgeInsets.only(bottom: 14.h), margin: EdgeInsets.only(bottom: 14.h),
child: Row( child: Row(
@ -336,7 +370,7 @@ class _BusinessMinePage extends State<BusinessMinePage>
fit: BoxFit.fill, fit: BoxFit.fill,
), ),
SizedBox( SizedBox(
width:11.w, width: 11.w,
), ),
Expanded( Expanded(
child: Text( child: Text(
@ -397,13 +431,11 @@ class _BusinessMinePage extends State<BusinessMinePage>
onTap: () { onTap: () {
Navigator.of(context).pushNamed('/router/user_service_page'); Navigator.of(context).pushNamed('/router/user_service_page');
}, },
child: child: commonFunctionsItem(
commonFunctionsItem("assets/image/bs_user.webp", "关于我们", "",24,24)) "assets/image/bs_user.webp", "关于我们", "", 24, 24))
], ],
), ),
); );
} }
@override
bool get wantKeepAlive => true;
} }

8
lib/business_system/order/business_order_page.dart

@ -10,7 +10,7 @@ import 'order_list_page.dart';
class BusinessOrderPage extends StatefulWidget { class BusinessOrderPage extends StatefulWidget {
final String storeId; final String storeId;
BusinessOrderPage(this.storeId); BusinessOrderPage(Key key,this.storeId): super(key: key);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -19,7 +19,7 @@ class BusinessOrderPage extends StatefulWidget {
} }
class _BusinessOrderPage extends State<BusinessOrderPage> class _BusinessOrderPage extends State<BusinessOrderPage>
with AutomaticKeepAliveClientMixin,SingleTickerProviderStateMixin{ with SingleTickerProviderStateMixin{
final RefreshController refreshController = RefreshController(); final RefreshController refreshController = RefreshController();
final ScrollController scrollController = ScrollController(); final ScrollController scrollController = ScrollController();
TabController tabController; TabController tabController;
@ -37,7 +37,6 @@ class _BusinessOrderPage extends State<BusinessOrderPage>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context);
return Column( return Column(
children: [ children: [
Expanded(child: Expanded(child:
@ -86,7 +85,4 @@ class _BusinessOrderPage extends State<BusinessOrderPage>
], ],
); );
} }
@override
bool get wantKeepAlive => true;
} }

44
lib/business_system/order/order_write_off.dart

@ -100,15 +100,23 @@ class _OrderWriteOff extends State<OrderWriteOff> {
}, },
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
scrollController: ScrollController(), scrollController: ScrollController(),
child: SingleChildScrollView( child: Stack(
physics: NeverScrollableScrollPhysics(), children: [
SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container( child: Container(
margin: EdgeInsets.only(top: 16.h, left: 16.w, right: 16.w), margin: EdgeInsets.only(top: 16.h, left: 16.w, right: 16.w,bottom:100.h),
child: Column( child: Column(
children: [ children: [
basicInfo(), basicInfo(),
writeOffInfo(), writeOffInfo(),
GestureDetector( ],
),
),
),
Align(
alignment: Alignment.bottomCenter,
child: GestureDetector(
onTap: () { onTap: () {
if (tickets != null if (tickets != null
? (widget.arguments["ticketStatus"] == false) ? (widget.arguments["ticketStatus"] == false)
@ -176,18 +184,18 @@ class _OrderWriteOff extends State<OrderWriteOff> {
} }
} }
}, },
child: Container(
color: Colors.white,
width: double.infinity,
padding: EdgeInsets.only(
top: 10.h,
left: 16.w,
right: 16.w,
bottom: 34.h),
child: Container( child: Container(
width: double.infinity, width: double.infinity,
alignment: Alignment.center, alignment: Alignment.center,
margin: EdgeInsets.only( height: 54.h,
bottom: 55.h,
top: (tickets != null
? tickets.length
: ticketDetails.ticketItemList.length) <=
1
? 125.h
: 10.h),
padding: EdgeInsets.symmetric(vertical: 16.h),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(27), borderRadius: BorderRadius.circular(27),
color: (tickets != null color: (tickets != null
@ -203,13 +211,11 @@ class _OrderWriteOff extends State<OrderWriteOff> {
color: Colors.white, color: Colors.white,
), ),
), ),
), )),
) ))
], ],
), ),
), ),
),
),
); );
} }
@ -253,10 +259,10 @@ class _OrderWriteOff extends State<OrderWriteOff> {
SizedBox( SizedBox(
height: 12.h, height: 12.h,
), ),
basicInfoItem("用户名称:", basicInfoItem("用户名称:",
widget?.arguments["userName"] ?? ticketDetails?.userName ?? ""), widget?.arguments["userName"] ?? ticketDetails?.userName ?? ""),
basicInfoItem( basicInfoItem(
"订单编号:", "订单编号:",
widget?.arguments["orderCode"] ?? widget?.arguments["orderCode"] ??
(ticketDetails.code.replaceAll("T", "")) ?? (ticketDetails.code.replaceAll("T", "")) ??
""), ""),

Loading…
Cancel
Save