Browse Source

更改

master
w-R 3 years ago
parent
commit
2a177dba87
  1. 16
      lib/order/order_view/order_status.dart
  2. 6
      lib/store/store_order.dart
  3. 45
      lib/store/store_view/settlement.dart
  4. 12
      lib/view_widget/rename_dialog.dart
  5. 104
      lib/view_widget/rename_dialog_content.dart

16
lib/order/order_view/order_status.dart

@ -91,7 +91,7 @@ class _OrderStatus extends State<OrderStatus> {
), ),
), ),
Image.asset( Image.asset(
"assets/image/order_ok.png", statusPicture(widget.title),
height: 66.h, height: 66.h,
width:66.w, width:66.w,
), ),
@ -205,6 +205,18 @@ class _OrderStatus extends State<OrderStatus> {
]; ];
} }
statusPicture(String status) {
String tripStatus = "assets/image/wait_meal.png";
if (status.contains(S.of(context).dingdanyiwancheng)) {
tripStatus = "assets/image/order_ok.png";
} else if (status.contains(S.of(context).dingdanyituikuan)) {
tripStatus = "assets/image/order_refund.png";
} else if (status.contains(S.of(context).quxiaodingdan)) {
tripStatus = "assets/image/oeder_cancel.png";
} else if (status.contains(S.of(context).dengdaiyonghuqucan)) {
tripStatus = "assets/image/wait_meal.png";
}
return tripStatus;
}
} }

6
lib/store/store_order.dart

@ -365,7 +365,11 @@ class _StoreOrderPage extends State<StoreOrderPage>
onTap: () { onTap: () {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/settlement', '/router/settlement',
arguments: widget.arguments, arguments: {
"storeName": storeInfo.storeName,
"address": storeInfo.address,
"headMobile": storeInfo.headMobile,
},
); );
}, },
child: RoundButton( child: RoundButton(

45
lib/store/store_view/settlement.dart

@ -7,10 +7,13 @@ import 'package:huixiang/order/order_view/order_commodity.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/order_info.dart'; import 'package:huixiang/retrofit/data/order_info.dart';
import 'package:huixiang/retrofit/data/settleOrderInfo.dart'; import 'package:huixiang/retrofit/data/settleOrderInfo.dart';
import 'package:huixiang/retrofit/data/store_info.dart';
import 'package:huixiang/retrofit/min_api.dart'; import 'package:huixiang/retrofit/min_api.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.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:huixiang/view_widget/rename_dialog.dart';
import 'package:huixiang/view_widget/rename_dialog_content.dart';
import 'package:huixiang/view_widget/round_button.dart'; import 'package:huixiang/view_widget/round_button.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -47,6 +50,7 @@ class _Settlement extends State<Settlement> {
} }
OrderInfo orderInfo; OrderInfo orderInfo;
StoreInfo storeInfo;
int payStatus = 0; int payStatus = 0;
int orderStatus = 0; int orderStatus = 0;
int sendStatus = 0; int sendStatus = 0;
@ -204,6 +208,7 @@ class _Settlement extends State<Settlement> {
String title = ""; String title = "";
String center = ""; String center = "";
TextEditingController _vc = TextEditingController();
statusTitle() { statusTitle() {
if (isTakeOut == 0) { if (isTakeOut == 0) {
@ -441,7 +446,7 @@ class _Settlement extends State<Settlement> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
"前进麦味·天然烘焙(凯德1818店)", storeInfo != null ? (storeInfo.storeName ?? "") : "",
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
@ -453,7 +458,7 @@ class _Settlement extends State<Settlement> {
height: 4, height: 4,
), ),
Text( Text(
"武昌区中国铁建凯德1818蓝调步行街中北路109附33门牌号05", storeInfo != null ? storeInfo.address : "",
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 2, maxLines: 2,
style: TextStyle( style: TextStyle(
@ -515,17 +520,22 @@ class _Settlement extends State<Settlement> {
), ),
)), )),
Text( Text(
"12309090909", storeInfo != null ? storeInfo.headMobile:"",
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
color: Color(0xFF4C4C4C), color: Color(0xFF4C4C4C),
), ),
), ),
Image.asset( GestureDetector(
"assets/image/pen.png", onTap: (){
height:14.h, showAlertDialog();
width:14.w, },
child:Image.asset(
"assets/image/pen.png",
height:14.h,
width:14.w,
),
), ),
], ],
) )
@ -793,6 +803,27 @@ class _Settlement extends State<Settlement> {
); );
} }
showAlertDialog() {
//
showDialog(
barrierDismissible: false,
context: context,
builder: (context) {
return RenameDialog(
contentWidget: RenameDialogContent(
title: "请输入新的手机号码",
okBtnTap: () {
// print(
// "输入框中的文字为:${_vc.text}",
// );
},
vc: _vc,
cancelBtnTap: () {},
),
);
});
}
var checkIndex = 1; var checkIndex = 1;
Widget checkView(var index) { Widget checkView(var index) {

12
lib/view_widget/rename_dialog.dart

@ -0,0 +1,12 @@
import 'package:flutter/material.dart';
class RenameDialog extends AlertDialog {
RenameDialog({Widget contentWidget})
: super(
content: contentWidget,
contentPadding: EdgeInsets.zero,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
side: BorderSide(color: Colors.white, width: 3)),
);
}

104
lib/view_widget/rename_dialog_content.dart

@ -0,0 +1,104 @@
import 'package:flutter/material.dart';
import 'package:huixiang/generated/l10n.dart';
double btnHeight = 60;
double borderWidth = 2;
class RenameDialogContent extends StatefulWidget {
final String title;
final VoidCallback cancelBtnTap;
final VoidCallback okBtnTap;
final TextEditingController vc;
RenameDialogContent(
{@required this.title,
this.cancelBtnTap,
this.okBtnTap,
this.vc});
@override
_RenameDialogContentState createState() =>
_RenameDialogContentState();
}
class _RenameDialogContentState extends State<RenameDialogContent> {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(top: 20),
height: 200,
width: 10000,
alignment: Alignment.bottomCenter,
child: Column(
children: [
Container(
alignment: Alignment.center,
child: Text(
widget.title,
style: TextStyle(color: Colors.grey),
)),
Spacer(),
Padding(
padding: EdgeInsets.fromLTRB(30, 0, 30, 0),
child: TextField(
style: TextStyle(color: Colors.black87),
controller: widget.vc,
decoration: InputDecoration(
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Colors.black),
),
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Colors.black),
)),
),
),
Container(
// color: Colors.red,
height: btnHeight,
margin: EdgeInsets.fromLTRB(0, 30, 0, 0),
child: Column(
children: [
Container(
// 线
width: double.infinity,
color: Colors.white,
height: borderWidth,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
FlatButton(
onPressed: () {
widget.vc.text = "";
widget.cancelBtnTap();
Navigator.of(context).pop();
},
child: Text(
S.of(context).quxiao,
style: TextStyle(fontSize: 18, color: Colors.black),
),
),
Container(
// 线
width: borderWidth,
color: Colors.grey,
height: btnHeight - borderWidth - borderWidth,
),
FlatButton(
onPressed: () {
widget.okBtnTap();
Navigator.of(context).pop();
widget.vc.text = "";
},
child: Text(
S.of(context).queding,
style: TextStyle(fontSize:18, color: Colors.black),
)),
],
),
],
),
)
],
));
}
}
Loading…
Cancel
Save