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

Loading…
Cancel
Save