Browse Source

收银台ui调整,流程调整,数据接口调试完成;

wr_2023_new_business
wurong 1 year ago
parent
commit
44e8bcf22f
  1. BIN
      assets/image/2x/bus_cashier_switch.webp
  2. BIN
      assets/image/2x/bus_vip_cc.webp
  3. BIN
      assets/image/3x/bus_cashier_switch.webp
  4. BIN
      assets/image/3x/bus_vip_cc.webp
  5. BIN
      assets/image/bus_cashier_switch.webp
  6. BIN
      assets/image/bus_vip_cc.webp
  7. 690
      lib/business_system/home/cashier/cashier_page.dart

BIN
assets/image/2x/bus_cashier_switch.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 794 B

BIN
assets/image/2x/bus_vip_cc.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
assets/image/3x/bus_cashier_switch.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
assets/image/3x/bus_vip_cc.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
assets/image/bus_cashier_switch.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 634 B

BIN
assets/image/bus_vip_cc.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 870 B

690
lib/business_system/home/cashier/cashier_page.dart

@ -15,6 +15,7 @@ import '../../../utils/business_instance.dart';
import '../../../utils/flutter_utils.dart'; import '../../../utils/flutter_utils.dart';
import '../../../view_widget/border_text.dart'; import '../../../view_widget/border_text.dart';
import '../../../view_widget/classic_header.dart'; import '../../../view_widget/classic_header.dart';
import '../../../view_widget/custom_image.dart';
import '../../../view_widget/my_footer.dart'; import '../../../view_widget/my_footer.dart';
import '../../../view_widget/round_button.dart'; import '../../../view_widget/round_button.dart';
import '../../../view_widget/settlement_tips_dialog.dart'; import '../../../view_widget/settlement_tips_dialog.dart';
@ -45,7 +46,6 @@ class _CashierPage extends State<CashierPage> {
List<dynamic> manualQueryInfo; List<dynamic> manualQueryInfo;
bool isDisplayVipInfo = false; bool isDisplayVipInfo = false;
/// ///
@override @override
void dispose() { void dispose() {
@ -71,6 +71,8 @@ class _CashierPage extends State<CashierPage> {
} }
}); });
}); });
if((widget?.arguments["phone"] ?? "")!= "")
queryMemberPhoneInfo(widget?.arguments["phone"] ?? "");
} }
/// ///
@ -89,7 +91,7 @@ class _CashierPage extends State<CashierPage> {
} }
BaseData<PhoneQueryMemberInfo> baseData = await businessService BaseData<PhoneQueryMemberInfo> baseData = await businessService
.queryMemberInfo( .queryMemberInfo(
{"phoneNum": phoneNum, "isNewUser": false}).catchError((error) { {"phoneNum": phoneNum, "isNewUser": false}).catchError((error) {
networkError = AppUtils.dioErrorTypeToString(error.type); networkError = AppUtils.dioErrorTypeToString(error.type);
networkStatus = -1; networkStatus = -1;
setState(() {}); setState(() {});
@ -99,6 +101,7 @@ class _CashierPage extends State<CashierPage> {
if (!mounted) return; if (!mounted) return;
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
phoneQueryMemberInfo = baseData.data; phoneQueryMemberInfo = baseData.data;
isDisplayVipInfo = true;
refreshController.loadComplete(); refreshController.loadComplete();
refreshController.refreshCompleted(); refreshController.refreshCompleted();
networkStatus = 1; networkStatus = 1;
@ -108,9 +111,8 @@ class _CashierPage extends State<CashierPage> {
refreshController.loadFailed(); refreshController.loadFailed();
} }
} finally { } finally {
if (isShow) if (isShow) EasyLoading.dismiss();
EasyLoading.dismiss(); setState(() {});
setState((){});
} }
} }
@ -128,10 +130,10 @@ class _CashierPage extends State<CashierPage> {
storeId: widget.arguments["storeId"]); storeId: widget.arguments["storeId"]);
} }
BaseData baseData = await businessService.createOrder({ BaseData baseData = await businessService.createOrder({
"createOrderType": "DIRECT",// DIRECT ASSIGN "createOrderType": "DIRECT", // DIRECT ASSIGN
"orderAmount": _displayTotal.toStringAsFixed(2), "orderAmount": _displayTotal.toStringAsFixed(2),
"virtualProductId":-2, "virtualProductId": -2,
"mid":phoneQueryMemberInfo?.sid ?? "" "mid": phoneQueryMemberInfo?.sid ?? ""
}).catchError((error) { }).catchError((error) {
networkError = AppUtils.dioErrorTypeToString(error.type); networkError = AppUtils.dioErrorTypeToString(error.type);
networkStatus = -1; networkStatus = -1;
@ -142,26 +144,25 @@ class _CashierPage extends State<CashierPage> {
if (!mounted) return; if (!mounted) return;
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
cashierOrderId = baseData.data; cashierOrderId = baseData.data;
if(payChannel == 1|| payChannel == 2){ if (payChannel == 1 || payChannel == 2) {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed('/router/scan_code_page', arguments: {
'/router/scan_code_page', "storeId": widget.arguments["storeId"],
arguments: { "scanCodeType": "收银台支付",
"storeId": widget.arguments["storeId"], "mid": phoneQueryMemberInfo?.sid ?? "",
"scanCodeType": "收银台支付", "orderId": cashierOrderId,
"mid":phoneQueryMemberInfo?.sid ??"", "payChannel": payChannel
"orderId": cashierOrderId, }).then((value) {
"payChannel":payChannel
}).then((value) {
if (value == 1) { if (value == 1) {
_display = ""; _display = "";
_displayTotal = 0; _displayTotal = 0;
}else{ } else {
manualQueryInfo = value; manualQueryInfo = value;
showPayQueryDialog(manualQueryInfo[0], manualQueryInfo[1]); showPayQueryDialog(manualQueryInfo[0], manualQueryInfo[1]);
} }
}); });
}else{ } else {
await cashierPayOrder(cashierOrderId,payChannel,phoneQueryMemberInfo?.sid ?? ""); await cashierPayOrder(
cashierOrderId, payChannel, phoneQueryMemberInfo?.sid ?? "");
} }
networkStatus = 1; networkStatus = 1;
setState(() {}); setState(() {});
@ -172,7 +173,7 @@ class _CashierPage extends State<CashierPage> {
} }
/// ///
cashierPayOrder(orderId, payChannel,mid) async { cashierPayOrder(orderId, payChannel, mid) async {
try { try {
if (businessService == null) { if (businessService == null) {
businessService = BusinessApiService(Dio(), businessService = BusinessApiService(Dio(),
@ -184,8 +185,8 @@ class _CashierPage extends State<CashierPage> {
BaseData baseData = await businessService.prePayOrder({ BaseData baseData = await businessService.prePayOrder({
"orderId": orderId, "orderId": orderId,
"payChannel": payChannel, "payChannel": payChannel,
"mid":mid, "mid": mid,
"authCode":(payChannel ==1 || payChannel == 2) ?"": null, "authCode": (payChannel == 1 || payChannel == 2) ? "" : null,
}).catchError((error) { }).catchError((error) {
networkError = AppUtils.dioErrorTypeToString(error.type); networkError = AppUtils.dioErrorTypeToString(error.type);
networkStatus = -1; networkStatus = -1;
@ -197,25 +198,26 @@ class _CashierPage extends State<CashierPage> {
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
_display = ""; _display = "";
_displayTotal = 0; _displayTotal = 0;
await queryMemberPhoneInfo(editingController?.text ?? "",isShow: false); if (phoneQueryMemberInfo != null)
await queryMemberPhoneInfo(editingController?.text ?? "",
isShow: false);
SmartDialog.show( SmartDialog.show(
widget: SettlementTips( widget: SettlementTips(
() {}, () {},
text: baseData.data ??"", text: baseData.data ?? "",
color: Color(0xFF30415B), color: Color(0xFF30415B),
)); ));
networkStatus = 1; networkStatus = 1;
setState(() {}); setState(() {});
} else { } else {
SmartDialog.show( SmartDialog.show(
widget: SettlementTips( widget: SettlementTips(
() {}, () {},
text: baseData.msg, text: baseData.msg,
color: Color(0xFF30415B), color: Color(0xFF30415B),
)); ));
} }
} finally { } finally {}
}
} }
/// ///
@ -231,25 +233,27 @@ class _CashierPage extends State<CashierPage> {
tenant: BusinessInstance.instance.businessTenant, tenant: BusinessInstance.instance.businessTenant,
storeId: widget.arguments["storeId"]); storeId: widget.arguments["storeId"]);
} }
BaseData baseData = await businessService.queryCashierOrder(cashierOrderId,true).catchError((error) {}); BaseData baseData = await businessService
.queryCashierOrder(cashierOrderId, true)
.catchError((error) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
_display = ""; _display = "";
_displayTotal = 0; _displayTotal = 0;
Navigator.of(context).pop(); Navigator.of(context).pop();
SmartDialog.show( SmartDialog.show(
widget: SettlementTips( widget: SettlementTips(
() {}, () {},
text: baseData.data ??"", text: baseData.data ?? "",
color: Color(0xFF30415B), color: Color(0xFF30415B),
)); ));
} else { } else {
if (baseData.msg != "需要用户输入支付密码") Navigator.of(context).pop(); if (baseData.msg != "需要用户输入支付密码") Navigator.of(context).pop();
SmartDialog.show( SmartDialog.show(
widget: SettlementTips( widget: SettlementTips(
() {}, () {},
text: baseData.msg, text: baseData.msg,
color: Color(0xFF30415B), color: Color(0xFF30415B),
)); ));
} }
} finally { } finally {
EasyLoading.dismiss(); EasyLoading.dismiss();
@ -271,8 +275,8 @@ class _CashierPage extends State<CashierPage> {
leadingColor: Colors.black, leadingColor: Colors.black,
brightness: Brightness.dark, brightness: Brightness.dark,
), ),
body: Container( body:networkStatus == -1
child: SmartRefresher( ? noNetwork() :SmartRefresher(
enablePullDown: true, enablePullDown: true,
enablePullUp: false, enablePullUp: false,
header: MyHeader( header: MyHeader(
@ -285,9 +289,9 @@ class _CashierPage extends State<CashierPage> {
), ),
controller: refreshController, controller: refreshController,
onRefresh: () { onRefresh: () {
if(editingController.text != "") if (editingController.text != "")
queryMemberPhoneInfo(editingController.text ?? "",isShow: false); queryMemberPhoneInfo(editingController.text ?? "", isShow: false);
else{ else {
refreshController.loadComplete(); refreshController.loadComplete();
refreshController.refreshCompleted(); refreshController.refreshCompleted();
} }
@ -298,57 +302,58 @@ class _CashierPage extends State<CashierPage> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( if (isDisplayVipInfo == false)
width: double.infinity, Container(
padding: EdgeInsets.only(top: 19.h, bottom: 13.h), width: double.infinity,
decoration: BoxDecoration( padding: EdgeInsets.only(top: 19.h, bottom: 13.h),
color: Colors.white, decoration: BoxDecoration(
), color: Colors.white,
child: Column( ),
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Padding( children: [
padding: EdgeInsets.only(left: 16.w), Padding(
child: Text( padding: EdgeInsets.only(left: 16.w),
"快速收银", child: Text(
style: TextStyle( "快速收银",
fontSize: 15.sp, style: TextStyle(
fontWeight: MyFontWeight.bold, fontSize: 15.sp,
color: Color(0xFF0D0D0D), fontWeight: MyFontWeight.bold,
color: Color(0xFF0D0D0D),
),
), ),
), ),
), Stack(
Stack( children: [
children: [ Container(
Container( width: double.infinity,
width: double.infinity, height: 2.h,
height: 2.h, margin: EdgeInsets.only(top: 5.h),
margin: EdgeInsets.only(top: 5.h), color: Color(0xFFD8D8D8),
color: Color(0xFFD8D8D8), ),
), Container(
Container( width: 44.w,
width: 44.w, height: 1.5.h,
height: 1.5.h, margin: EdgeInsets.only(top: 5.h, left: 24.w),
margin: EdgeInsets.only(top: 5.h, left: 24.w), color: Color(0xFF30415B),
color: Color(0xFF30415B), ),
), ],
], ),
), SizedBox(
SizedBox( height: 13.h,
height: 13.h, ),
), vipUserSearch(),
vipUserSearch(), ],
], ),
), ),
), (phoneQueryMemberInfo != null && isDisplayVipInfo == true)
phoneQueryMemberInfo != null? ? vipPlate()
vipPlate(): : SizedBox(height: 103.h),
SizedBox(height:103.h),
calculator() calculator()
], ],
), ),
), ),
)), ),
), ),
); );
} }
@ -420,7 +425,7 @@ class _CashierPage extends State<CashierPage> {
children: [ children: [
Container( Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only(top: 13.h, left: 16.w, bottom: 33.h), padding: EdgeInsets.only(left: 16.w, bottom: 33.h),
margin: EdgeInsets.only(bottom: 10.h), margin: EdgeInsets.only(bottom: 10.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
@ -428,7 +433,9 @@ class _CashierPage extends State<CashierPage> {
begin: Alignment.centerLeft, begin: Alignment.centerLeft,
end: Alignment.centerRight, end: Alignment.centerRight,
colors: [Color(0xFF30415B), Color(0xFF5171A4)]), colors: [Color(0xFF30415B), Color(0xFF5171A4)]),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.vertical(
top: Radius.circular(8),
),
), ),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -436,40 +443,84 @@ class _CashierPage extends State<CashierPage> {
Container( Container(
width: 52.h, width: 52.h,
height: 52.h, height: 52.h,
margin: EdgeInsets.only(right: 15.w), margin: EdgeInsets.only(right: 15.w, top: 13.h),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(4),
), ),
child: Image.asset( child:MImage(
"assets/image/bs_mine_heading.webp", (phoneQueryMemberInfo?.headimg ??
""),
width: double.infinity, width: double.infinity,
height: double.infinity, height: double.infinity,
fit: BoxFit.fill, fit: BoxFit.cover,
errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp",
), ),
), ),
Column( Expanded(
crossAxisAlignment: CrossAxisAlignment.start, child: Container(
children: [ padding: EdgeInsets.only(top: 13.h),
Padding( child: Column(
padding: EdgeInsets.only(bottom: 8.h), crossAxisAlignment: CrossAxisAlignment.start,
child: Text( children: [
"会员名称:${phoneQueryMemberInfo?.nickName ?? ""}", Padding(
padding: EdgeInsets.only(bottom: 8.h),
child: Text(
"会员名称:${phoneQueryMemberInfo?.nickName ?? ""}",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Colors.white,
),
)),
Text(
"手机号:${phoneQueryMemberInfo?.phoneNum ?? ""}",
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
color: Colors.white, color: Colors.white,
), ),
)), )
Text( ],
"手机号:${phoneQueryMemberInfo?.phoneNum ?? ""}", ),
style: TextStyle( ),
fontSize: 12.sp, ),
fontWeight: MyFontWeight.regular, Expanded(
color: Colors.white, child: GestureDetector(
), behavior: HitTestBehavior.opaque,
) onTap: () {
], setState(() {
) isDisplayVipInfo = false;
editingController.text = "";
});
},
child: Container(
padding:
EdgeInsets.only(right: 19.w, top: 13.h, bottom: 13.h),
child: Column(
children: [
Image.asset(
"assets/image/bus_cashier_switch.webp",
width: 17.w,
height: 15.h,
color: Colors.white,
fit: BoxFit.fill,
),
Padding(
padding: EdgeInsets.only(top: 5.h),
child: Text(
"切换会员",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
color: Colors.white,
),
))
],
)),
))
], ],
), ),
), ),
@ -505,7 +556,7 @@ class _CashierPage extends State<CashierPage> {
], ],
)), )),
Text( Text(
"${double.tryParse(phoneQueryMemberInfo?.balance ?? 0)}", "${double.tryParse(phoneQueryMemberInfo?.balance ?? 0)}",
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
@ -543,7 +594,8 @@ class _CashierPage extends State<CashierPage> {
], ],
)), )),
Text( Text(
(phoneQueryMemberInfo?.useableConponList?.length ?? 0).toString(), (phoneQueryMemberInfo?.useableConponList?.length ?? 0)
.toString(),
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
@ -563,7 +615,7 @@ class _CashierPage extends State<CashierPage> {
Widget calculator() { Widget calculator() {
return Container( return Container(
color: Colors.white, color: Colors.white,
margin: EdgeInsets.only(top: 15.h), margin: EdgeInsets.only(top: isDisplayVipInfo == false ? 15.h : 45.h),
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
@ -727,62 +779,55 @@ class _CashierPage extends State<CashierPage> {
), ),
], ],
), ),
Row( Container(
children: [ height: 100.h,
Expanded( child: Row(
flex: 2, children: [
child: Container( Expanded(
alignment: Alignment.center, flex: 2,
color: Color(0xFF5A7092), child: Container(
padding: EdgeInsets.only(top: 32.h, bottom: 33.h), alignment: Alignment.center,
child: Text( color: Color(0xFF5A7092),
"${_displayTotal.toStringAsFixed(2)}", padding: EdgeInsets.only(top: 10.h, bottom: 10.h),
style: TextStyle( child: Text(
fontSize: 24.sp, "${_displayTotal.toStringAsFixed(2)}",
fontWeight: MyFontWeight.bold, style: TextStyle(
color: Colors.white, fontSize: 24.sp,
fontWeight: MyFontWeight.bold,
color: Colors.white,
),
), ),
), )),
)), GestureDetector(
GestureDetector( behavior: HitTestBehavior.opaque,
behavior: HitTestBehavior.opaque, onTap: () {
onTap: () { if (_displayTotal.toStringAsFixed(2) == "0.00") {
if(_displayTotal.toStringAsFixed(2) == "0.00"){
SmartDialog.show(
widget: SettlementTips(
() {},
text:"订单支付金额小于或等于0,无法进行支付操作",
color: Color(0xFF30415B),
));
}else{
if(phoneQueryMemberInfo != null){
showPaySelectDialog();
}else {
SmartDialog.show( SmartDialog.show(
widget: SettlementTips( widget: SettlementTips(
() {}, () {},
text:"请输入会员手机号进行结账", text: "订单支付金额小于或等于0,无法进行支付操作",
color: Color(0xFF30415B), color: Color(0xFF30415B),
)); ));
} else {
showPaySelectDialog();
} }
} },
child: Container(
}, alignment: Alignment.center,
child: Container( color: Color(0xFF30415B),
alignment: Alignment.center, padding: EdgeInsets.only(
color: Color(0xFF30415B), top: 10.h, bottom: 10.h, left: 45.w, right: 33.w),
padding: EdgeInsets.only( child: Text(
top: 22.h, bottom: 25.h, left: 45.w, right: 33.w), "结账",
child: Text( style: TextStyle(
"结账", fontSize: 36.sp,
style: TextStyle( fontWeight: MyFontWeight.bold,
fontSize: 36.sp, color: Colors.white,
fontWeight: MyFontWeight.bold, ),
color: Colors.white,
), ),
), )),
)), ],
], ),
) )
], ],
), ),
@ -865,7 +910,7 @@ class _CashierPage extends State<CashierPage> {
builder: (context) { builder: (context) {
return Container( return Container(
width: double.infinity, width: double.infinity,
height: 280.h, height: phoneQueryMemberInfo != null ? 280.h : 220.h,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
@ -883,17 +928,18 @@ class _CashierPage extends State<CashierPage> {
children: [ children: [
Expanded( Expanded(
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
margin: EdgeInsets.only(top: 12.h,bottom: 12.h,left: 41.w), margin:
child: Text( EdgeInsets.only(top: 12.h, bottom: 12.h, left: 41.w),
S.of(context).zhifufangshi, child: Text(
style: TextStyle( S.of(context).zhifufangshi,
fontWeight: MyFontWeight.bold, style: TextStyle(
fontSize: 17.sp, fontWeight: MyFontWeight.bold,
color: Color(0xFF1A1A1A), fontSize: 17.sp,
), color: Color(0xFF1A1A1A),
), ),
)), ),
)),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {
@ -912,133 +958,146 @@ class _CashierPage extends State<CashierPage> {
], ],
), ),
Padding( Padding(
padding: EdgeInsets.only(left: 23.w,right: 9.w), padding: EdgeInsets.only(left: 23.w, right: 9.w),
child:Column( child: Column(
children: [ children: [
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap:(){ onTap: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
showPayAmountDialog(0,"现金"); showPayAmountDialog(0, "现金");
}, },
child: Padding(padding:EdgeInsets.only(left: 5.w), child: Padding(
child: Row( padding: EdgeInsets.only(left: 5.w),
children: [ child: Row(
Image.asset( children: [
"assets/image/bus_cashier_xj.webp", Image.asset(
width: 31.w, "assets/image/bus_cashier_xj.webp",
height: 22.h, width: 31.w,
height: 22.h,
),
Padding(
padding: EdgeInsets.only(left: 14.w),
child: Text(
"现金支付",
textAlign: TextAlign.center,
style: TextStyle(
color: Color(0xFF1A1A1A),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
))
],
), ),
Padding( ),
padding: EdgeInsets.only(left: 14.w),
child: Text(
"现金支付",
textAlign: TextAlign.center,
style: TextStyle(
color: Color(0xFF1A1A1A),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
))
],
),),
), ),
Container( Container(
width: double.infinity, width: double.infinity,
height: 1.h, height: 1.h,
color: Color(0xFFEBEBEB), color: Color(0xFFEBEBEB),
margin: EdgeInsets.symmetric(vertical:13.h), margin: EdgeInsets.symmetric(vertical: 13.h),
), ),
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap:(){ onTap: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
showPayAmountDialog(1,"微信");}, showPayAmountDialog(1, "微信");
child: Padding(padding:EdgeInsets.only(left: 5.w), },
child: Row( child: Padding(
children: [ padding: EdgeInsets.only(left: 5.w),
Image.asset( child: Row(
"assets/image/bus_vip_wx.webp", children: [
width: 29.w, Image.asset(
height: 26.h, "assets/image/bus_vip_wx.webp",
), width: 29.w,
Padding( height: 26.h,
padding: EdgeInsets.only(left: 14.w), ),
child: Text( Padding(
"微信", padding: EdgeInsets.only(left: 14.w),
textAlign: TextAlign.center, child: Text(
style: TextStyle( "微信",
color: Color(0xFF1A1A1A), textAlign: TextAlign.center,
fontSize: 14.sp, style: TextStyle(
fontWeight: MyFontWeight.regular, color: Color(0xFF1A1A1A),
), fontSize: 14.sp,
)) fontWeight: MyFontWeight.regular,
], ),
),)), ))
Container( ],
width: double.infinity,
height: 1.h,
color: Color(0xFFEBEBEB),
margin: EdgeInsets.symmetric(vertical:13.h),
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap:(){
Navigator.of(context).pop();
showPayAmountDialog(2,"支付宝");},
child: Padding(padding:EdgeInsets.only(left: 5.w),
child: Row(
children: [
Image.asset(
"assets/image/bus_vip_alipay.webp",
width: 29.h,
height: 29.h,
), ),
Padding( )),
padding: EdgeInsets.only(left: 14.w),
child: Text(
"支付宝",
textAlign: TextAlign.center,
style: TextStyle(
color: Color(0xFF1A1A1A),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
))
],
),)),
Container( Container(
width: double.infinity, width: double.infinity,
height: 1.h, height: 1.h,
color: Color(0xFFEBEBEB), color: Color(0xFFEBEBEB),
margin: EdgeInsets.symmetric(vertical:13.h), margin: EdgeInsets.symmetric(vertical: 13.h),
), ),
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap:(){ onTap: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
showPayAmountDialog(3,"商户余额");}, showPayAmountDialog(2, "支付宝");
child: Padding(padding:EdgeInsets.only(left: 5.w), },
child: Row( child: Padding(
children: [ padding: EdgeInsets.only(left: 5.w),
Image.asset( child: Row(
"assets/image/bus_cashier_balance.webp", children: [
width: 27.h, Image.asset(
height: 27.h, "assets/image/bus_vip_alipay.webp",
width: 29.h,
height: 29.h,
),
Padding(
padding: EdgeInsets.only(left: 14.w),
child: Text(
"支付宝",
textAlign: TextAlign.center,
style: TextStyle(
color: Color(0xFF1A1A1A),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
))
],
), ),
Padding( )),
padding: EdgeInsets.only(left: 14.w), if (phoneQueryMemberInfo != null)
child: Text( Container(
"商户余额", width: double.infinity,
textAlign: TextAlign.center, height: 1.h,
style: TextStyle( color: Color(0xFFEBEBEB),
color: Color(0xFF1A1A1A), margin: EdgeInsets.symmetric(vertical: 13.h),
fontSize: 14.sp, ),
fontWeight: MyFontWeight.regular, if (phoneQueryMemberInfo != null)
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context).pop();
showPayAmountDialog(3, "商户余额");
},
child: Padding(
padding: EdgeInsets.only(left: 5.w),
child: Row(
children: [
Image.asset(
"assets/image/bus_cashier_balance.webp",
width: 27.h,
height: 27.h,
), ),
)) Padding(
], padding: EdgeInsets.only(left: 14.w),
),)), child: Text(
"商户余额",
textAlign: TextAlign.center,
style: TextStyle(
color: Color(0xFF1A1A1A),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
))
],
),
)),
// Container( // Container(
// width: double.infinity, // width: double.infinity,
// height: 1.h, // height: 1.h,
@ -1081,7 +1140,7 @@ class _CashierPage extends State<CashierPage> {
} }
/// ///
showPayAmountDialog(index,payText) { showPayAmountDialog(index, payText) {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
@ -1113,7 +1172,7 @@ class _CashierPage extends State<CashierPage> {
), ),
), ),
SizedBox( SizedBox(
height:10.h, height: 10.h,
), ),
Text( Text(
"支付金额: ${_displayTotal.toStringAsFixed(2)}", "支付金额: ${_displayTotal.toStringAsFixed(2)}",
@ -1163,7 +1222,7 @@ class _CashierPage extends State<CashierPage> {
onTap: () { onTap: () {
setState(() { setState(() {
Navigator.of(context).pop(); Navigator.of(context).pop();
cashierCreateOrder(index); cashierCreateOrder(index);
}); });
}, },
), ),
@ -1202,7 +1261,7 @@ class _CashierPage extends State<CashierPage> {
child: Container( child: Container(
alignment: Alignment.topRight, alignment: Alignment.topRight,
padding: padding:
EdgeInsets.symmetric(horizontal: 5.w, vertical: 10.h), EdgeInsets.symmetric(horizontal: 5.w, vertical: 10.h),
child: Image.asset( child: Image.asset(
"assets/image/cancel.webp", "assets/image/cancel.webp",
width: 24.h, width: 24.h,
@ -1211,7 +1270,7 @@ class _CashierPage extends State<CashierPage> {
), ),
Padding( Padding(
padding: padding:
EdgeInsets.only(bottom: 20.h, left: 14.w, right: 14.w), EdgeInsets.only(bottom: 20.h, left: 14.w, right: 14.w),
child: Text( child: Text(
queryDialog, queryDialog,
style: TextStyle( style: TextStyle(
@ -1223,7 +1282,7 @@ class _CashierPage extends State<CashierPage> {
), ),
Padding( Padding(
padding: padding:
EdgeInsets.only(bottom: 20.h, left: 14.w, right: 14.w), EdgeInsets.only(bottom: 20.h, left: 14.w, right: 14.w),
child: Text.rich( child: Text.rich(
TextSpan( TextSpan(
children: [ children: [
@ -1308,4 +1367,53 @@ class _CashierPage extends State<CashierPage> {
}, },
); );
} }
///
Widget noNetwork() {
return Container(
color: Colors.white,
width: double.infinity,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
networkError.substring(0, networkError.indexOf(",")),
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF0D0D0D),
fontWeight: MyFontWeight.bold),
),
Padding(
padding: EdgeInsets.symmetric(vertical: 10.h),
child: Text(
"请检查网络设置或稍后重试",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF7A797F),
fontWeight: MyFontWeight.regular),
),
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
queryMemberPhoneInfo(widget?.arguments["phoneNum"] ?? "");
},
child: Container(
decoration: BoxDecoration(
color: Color(0xFF30415B),
borderRadius: BorderRadius.circular(15),
),
padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 3.h),
child: Text(
"重试",
style: TextStyle(
fontSize: 14.sp,
color: Colors.white,
fontWeight: MyFontWeight.regular),
)),
)
],
),
);
}
} }

Loading…
Cancel
Save