|
|
|
@ -1,11 +1,16 @@
|
|
|
|
|
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'; |
|
|
|
|
import 'package:huixiang/order/order_view/order_commodity.dart'; |
|
|
|
|
import 'package:huixiang/order/order_view/order_info.dart'; |
|
|
|
|
import 'package:huixiang/retrofit/data/base_data.dart'; |
|
|
|
|
import 'package:huixiang/retrofit/data/coupon.dart'; |
|
|
|
|
import 'package:huixiang/retrofit/data/order_info.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/store/store_view/settlement_order_commodity.dart'; |
|
|
|
@ -33,15 +38,27 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
MinApiService minService; |
|
|
|
|
int selectedBtn = 0; |
|
|
|
|
Coupon coupon; |
|
|
|
|
OrderInfo orderInfo; |
|
|
|
|
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"); |
|
|
|
@ -51,11 +68,27 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
token: minToken, |
|
|
|
|
tenant: tenant, |
|
|
|
|
); |
|
|
|
|
queryOrderInfo(); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
StoreInfo storeInfo; |
|
|
|
|
///订单结算信息 |
|
|
|
|
queryOrderInfo() async { |
|
|
|
|
BaseData<SettleOrderInfo> baseData = await minService.getOrderInfo({ |
|
|
|
|
"addressId": null, |
|
|
|
|
"isTake": 0, |
|
|
|
|
"memberCouponId": null, |
|
|
|
|
// "orderId": widget.arguments["orderId"], |
|
|
|
|
"orderId": "1449199929208602624", |
|
|
|
|
"promotionId": null |
|
|
|
|
}); |
|
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
|
settleOrderInfo = baseData.data; |
|
|
|
|
setState(() {}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool isEdit = false; |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
Widget build(BuildContext context) { |
|
|
|
@ -110,11 +143,15 @@ 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( |
|
|
|
|
Text( |
|
|
|
|
S.of(context).yuliudianhua, |
|
|
|
|
overflow: TextOverflow.ellipsis, |
|
|
|
|
style: TextStyle( |
|
|
|
@ -123,31 +160,85 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
color: Color(0xFF4C4C4C), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
width: 50, |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
storeInfo != null ? storeInfo.headMobile : "", |
|
|
|
|
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( |
|
|
|
|
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, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
|
|
|
|
|
///订单商品 |
|
|
|
|
SettlementOrderCommodity(orderInfo,0), |
|
|
|
|
SettlementOrderCommodity(settleOrderInfo, 0), |
|
|
|
|
// if (payStatus == 0) couponRemarks(), |
|
|
|
|
/*(payStatus == 0) ? paySelector() : */ |
|
|
|
|
|
|
|
|
@ -218,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, |
|
|
|
@ -269,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: Container( |
|
|
|
|
height: 50.h, |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
child: Text( |
|
|
|
|
S.of(context).daodianziqu, |
|
|
|
|
style: TextStyle( |
|
|
|
@ -291,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: Container( |
|
|
|
|
height: 50.h, |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
child: Text( |
|
|
|
|
S.of(context).waimaipeisong, |
|
|
|
|
style: TextStyle( |
|
|
|
@ -313,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: Container( |
|
|
|
|
height: 50.h, |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
child: Text( |
|
|
|
|
S.of(context).kuaidiwuliu, |
|
|
|
|
style: TextStyle( |
|
|
|
@ -717,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}", |
|
|
|
|
// showAlertDialog() { |
|
|
|
|
// //显示对话框 |
|
|
|
|
// showDialog( |
|
|
|
|
// barrierDismissible: false, |
|
|
|
|
// context: context, |
|
|
|
|
// builder: (context) { |
|
|
|
|
// return RenameDialog( |
|
|
|
|
// contentWidget: RenameDialogContent( |
|
|
|
|
// title: "请输入新的手机号码", |
|
|
|
|
// okBtnTap: () { |
|
|
|
|
// // print( |
|
|
|
|
// // "输入框中的文字为:${_vc.text}", |
|
|
|
|
// // ); |
|
|
|
|
// }, |
|
|
|
|
// vc: _vc, |
|
|
|
|
// cancelBtnTap: () {}, |
|
|
|
|
// ), |
|
|
|
|
// ); |
|
|
|
|
}, |
|
|
|
|
vc: _vc, |
|
|
|
|
cancelBtnTap: () {}, |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
// }); |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
///优惠券弹窗 |
|
|
|
|
couponCart() { |
|
|
|
|