|
|
|
@ -2,6 +2,7 @@ import 'package:dio/dio.dart';
|
|
|
|
|
import 'package:flutter/cupertino.dart'; |
|
|
|
|
import 'package:flutter/material.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/retrofit/data/coupon.dart'; |
|
|
|
|
import 'package:huixiang/retrofit/data/order_info.dart'; |
|
|
|
@ -78,6 +79,7 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
leadingColor: Colors.white, |
|
|
|
|
title: S.of(context).dingdanjiesuan, |
|
|
|
|
titleColor: Colors.white, |
|
|
|
|
brightness: Brightness.dark, |
|
|
|
|
titleSize: 18.sp, |
|
|
|
|
), |
|
|
|
|
body: Container( |
|
|
|
@ -88,7 +90,60 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
children: [ |
|
|
|
|
distributionMode(), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 14, |
|
|
|
|
height: 16, |
|
|
|
|
), |
|
|
|
|
|
|
|
|
|
Container( |
|
|
|
|
margin: EdgeInsets.only( |
|
|
|
|
left: 16, |
|
|
|
|
right: 16, |
|
|
|
|
), |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Colors.white, |
|
|
|
|
boxShadow: [ |
|
|
|
|
BoxShadow( |
|
|
|
|
color: Color(0x0D000000), |
|
|
|
|
offset: Offset(0, 3), |
|
|
|
|
blurRadius: 14, |
|
|
|
|
spreadRadius: 0, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
borderRadius: BorderRadius.circular(8), |
|
|
|
|
), |
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 15.h), |
|
|
|
|
child: Row( |
|
|
|
|
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 : "", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
color: Color(0xFF4C4C4C), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
showAlertDialog(); |
|
|
|
|
}, |
|
|
|
|
child: Image.asset( |
|
|
|
|
"assets/image/pen.png", |
|
|
|
|
height: 14.h, |
|
|
|
|
width: 14.w, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
|
|
|
|
|
///订单商品 |
|
|
|
@ -167,10 +222,25 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
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, |
|
|
|
|
margin: EdgeInsets.only( |
|
|
|
|
left: 16, |
|
|
|
|
right: 16, |
|
|
|
|
top: 10, |
|
|
|
|
), |
|
|
|
|
child: Stack( |
|
|
|
|
children: [ |
|
|
|
|
Container( |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0xFFFAFAFA), |
|
|
|
|
color: Color(0x80FFFFFF), |
|
|
|
|
boxShadow: [ |
|
|
|
|
BoxShadow( |
|
|
|
|
color: Color(0x0D000000), |
|
|
|
@ -181,51 +251,34 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
], |
|
|
|
|
borderRadius: BorderRadius.circular(8), |
|
|
|
|
), |
|
|
|
|
height: 175.h, |
|
|
|
|
margin: EdgeInsets.only(left: 16, right: 16, top: 15), |
|
|
|
|
child: Stack( |
|
|
|
|
children: [ |
|
|
|
|
child: SvgPicture.asset( |
|
|
|
|
addressBgs[selectedBtn], |
|
|
|
|
width: double.infinity, |
|
|
|
|
height: double.infinity, |
|
|
|
|
fit: BoxFit.fill, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Column( |
|
|
|
|
children: [ |
|
|
|
|
Container( |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0xFF9C9FAC), |
|
|
|
|
borderRadius: BorderRadius.only( |
|
|
|
|
topLeft: Radius.circular(8), |
|
|
|
|
topRight: Radius.circular(8), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
height: 50.h, |
|
|
|
|
child: Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
|
mainAxisSize: MainAxisSize.max, |
|
|
|
|
children: [ |
|
|
|
|
Expanded( |
|
|
|
|
flex: 1, |
|
|
|
|
child: Container( |
|
|
|
|
height: 50.h, |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
image: selectedBtn == 0 |
|
|
|
|
? DecorationImage( |
|
|
|
|
image: |
|
|
|
|
AssetImage("assets/image/order_btn1.png"), |
|
|
|
|
fit: BoxFit.fill, |
|
|
|
|
) |
|
|
|
|
: null, |
|
|
|
|
borderRadius: BorderRadius.only( |
|
|
|
|
topLeft: Radius.circular(8), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
child: GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
setState(() { |
|
|
|
|
selectedBtn = 0; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
child: Stack( |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
children: [ |
|
|
|
|
Text( |
|
|
|
|
child: Text( |
|
|
|
|
S.of(context).daodianziqu, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 14.sp, |
|
|
|
@ -233,29 +286,21 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
color: Colors.black, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Expanded( |
|
|
|
|
flex: 1, |
|
|
|
|
child: Container( |
|
|
|
|
height: 50.h, |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
child: GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
setState(() { |
|
|
|
|
selectedBtn = 1; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
child: Stack( |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
children: [ |
|
|
|
|
if (selectedBtn == 1) |
|
|
|
|
Image.asset( |
|
|
|
|
"assets/image/order_btn2.png", |
|
|
|
|
height: 50.h, |
|
|
|
|
fit: BoxFit.fill, |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
child: Text( |
|
|
|
|
S.of(context).waimaipeisong, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 14.sp, |
|
|
|
@ -263,7 +308,6 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
color: Colors.black, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
@ -271,18 +315,7 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
flex: 1, |
|
|
|
|
child: Container( |
|
|
|
|
height: 50.h, |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
image: selectedBtn == 2 |
|
|
|
|
? DecorationImage( |
|
|
|
|
image: |
|
|
|
|
AssetImage("assets/image/order_btn3.png"), |
|
|
|
|
fit: BoxFit.fill, |
|
|
|
|
) |
|
|
|
|
: null, |
|
|
|
|
borderRadius: BorderRadius.only( |
|
|
|
|
topRight: Radius.circular(8), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
child: GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
setState(() { |
|
|
|
@ -291,10 +324,7 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
alignment: Alignment.center); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
child: Stack( |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
children: [ |
|
|
|
|
Text( |
|
|
|
|
child: Text( |
|
|
|
|
S.of(context).kuaidiwuliu, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 14.sp, |
|
|
|
@ -302,8 +332,6 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
color: Colors.black, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
@ -394,39 +422,6 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
Row( |
|
|
|
|
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 : "", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
color: Color(0xFF4C4C4C), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
showAlertDialog(); |
|
|
|
|
}, |
|
|
|
|
child: Image.asset( |
|
|
|
|
"assets/image/pen.png", |
|
|
|
|
height: 14.h, |
|
|
|
|
width: 14.w, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
) |
|
|
|
|