Browse Source

safety

master
fmk 3 years ago
parent
commit
41d3170e00
  1. 220
      lib/store/store_view/settlement.dart

220
lib/store/store_view/settlement.dart

@ -1,6 +1,7 @@
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:huixiang/generated/l10n.dart';
@ -40,11 +41,24 @@ class _Settlement extends State<Settlement> {
Function(int type) callback;
GestureTapCallback callbackEx;
int isSelected = 0;
StoreInfo storeInfo;
SettleOrderInfo settleOrderInfo;
TextEditingController _vc;
List<String> addressBgs = [
"assets/svg/dingdan_ziqu.svg",
"assets/svg/dingdan_waimai.svg",
"assets/svg/dingdan_wuliu.svg",
];
@override
void initState() {
super.initState();
storeInfo = widget.arguments["storeInfo"];
_vc = TextEditingController(
text: storeInfo != null ? storeInfo.headMobile : "");
SharedPreferences.getInstance().then((value) {
String minToken = value.getString("minToken");
String tenant = value.getString("tenant");
@ -58,9 +72,6 @@ class _Settlement extends State<Settlement> {
});
}
StoreInfo storeInfo;
SettleOrderInfo settleOrderInfo;
///
queryOrderInfo() async {
BaseData<SettleOrderInfo> baseData = await minService.getOrderInfo({
@ -77,6 +88,8 @@ class _Settlement extends State<Settlement> {
}
}
bool isEdit = false;
@override
Widget build(BuildContext context) {
return Stack(
@ -130,36 +143,94 @@ class _Settlement extends State<Settlement> {
],
borderRadius: BorderRadius.circular(8),
),
padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 15.h),
padding: EdgeInsets.symmetric(
horizontal: 12.w,
vertical: 15.h,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Text(
S.of(context).yuliudianhua,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF4C4C4C),
),
),
),
Text(
storeInfo != null ? storeInfo.headMobile : "",
S.of(context).yuliudianhua,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
fontWeight: MyFontWeight.regular,
color: Color(0xFF4C4C4C),
),
),
SizedBox(
width: 50,
),
Expanded(
child: isEdit
? Container(
height: 30.h,
alignment: Alignment.centerRight,
child: TextField(
controller: _vc,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF4C4C4C),
),
textAlign: TextAlign.right,
textAlignVertical: TextAlignVertical.center,
keyboardType: TextInputType.phone,
decoration: InputDecoration(
errorBorder: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
hintText: "",
hintStyle: TextStyle(
fontSize: 10.sp,
color: Color(0xFFA29E9E),
),
),
textInputAction: TextInputAction.next,
inputFormatters: [
LengthLimitingTextInputFormatter(11)
],
cursorColor: Colors.grey,
),
)
: Container(
height: 30.h,
alignment: Alignment.centerRight,
child: Text(
storeInfo != null
? storeInfo.headMobile
: "",
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF4C4C4C),
),
),
),
),
GestureDetector(
onTap: () {
showAlertDialog();
setState(() {
this.isEdit = !this.isEdit;
});
},
child: Image.asset(
"assets/image/pen.png",
height: 14.h,
width: 14.w,
child: Container(
padding: EdgeInsets.all(8),
child: isEdit
? Icon(
Icons.check,
size: 14.w,
color: Color(0xFF32A060),
)
: Image.asset(
"assets/image/pen.png",
height: 14.h,
width: 14.w,
),
),
),
],
@ -238,16 +309,6 @@ class _Settlement extends State<Settlement> {
);
}
String title = "";
String center = "";
TextEditingController _vc = TextEditingController();
List<String> addressBgs = [
"assets/svg/dingdan_ziqu.svg",
"assets/svg/dingdan_waimai.svg",
"assets/svg/dingdan_wuliu.svg",
];
Widget distributionMode() {
return Container(
height: 143.h,
@ -289,15 +350,15 @@ class _Settlement extends State<Settlement> {
children: [
Expanded(
flex: 1,
child: Container(
height: 50.h,
alignment: Alignment.center,
child: GestureDetector(
onTap: () {
setState(() {
selectedBtn = 0;
});
},
child: GestureDetector(
onTap: () {
setState(() {
selectedBtn = 0;
});
},
child: Container(
height: 50.h,
alignment: Alignment.center,
child: Text(
S.of(context).daodianziqu,
style: TextStyle(
@ -311,15 +372,15 @@ class _Settlement extends State<Settlement> {
),
Expanded(
flex: 1,
child: Container(
height: 50.h,
alignment: Alignment.center,
child: GestureDetector(
onTap: () {
setState(() {
selectedBtn = 1;
});
},
child: GestureDetector(
onTap: () {
setState(() {
selectedBtn = 1;
});
},
child: Container(
height: 50.h,
alignment: Alignment.center,
child: Text(
S.of(context).waimaipeisong,
style: TextStyle(
@ -333,17 +394,14 @@ class _Settlement extends State<Settlement> {
),
Expanded(
flex: 1,
child: Container(
height: 50.h,
alignment: Alignment.center,
child: GestureDetector(
onTap: () {
setState(() {
// selectedBtn = 2;
SmartDialog.showToast("该功能暂未开放!",
alignment: Alignment.center);
});
},
child: GestureDetector(
onTap: () {
SmartDialog.showToast("该功能暂未开放!",
alignment: Alignment.center);
},
child: Container(
height: 50.h,
alignment: Alignment.center,
child: Text(
S.of(context).kuaidiwuliu,
style: TextStyle(
@ -737,26 +795,26 @@ 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: () {},
),
);
});
}
// showAlertDialog() {
// //
// showDialog(
// barrierDismissible: false,
// context: context,
// builder: (context) {
// return RenameDialog(
// contentWidget: RenameDialogContent(
// title: "请输入新的手机号码",
// okBtnTap: () {
// // print(
// // "输入框中的文字为:${_vc.text}",
// // );
// },
// vc: _vc,
// cancelBtnTap: () {},
// ),
// );
// });
// }
///
couponCart() {

Loading…
Cancel
Save