|
|
@ -5,10 +5,9 @@ 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'; |
|
|
|
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/base_data.dart'; |
|
|
|
import 'package:huixiang/retrofit/data/coupon.dart'; |
|
|
|
import 'package:huixiang/retrofit/data/coupon.dart'; |
|
|
|
|
|
|
|
import 'package:huixiang/retrofit/data/findMiNiGroupList.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/data/store_info.dart'; |
|
|
@ -16,8 +15,6 @@ import 'package:huixiang/retrofit/min_api.dart'; |
|
|
|
import 'package:huixiang/store/store_view/settlement_order_commodity.dart'; |
|
|
|
import 'package:huixiang/store/store_view/settlement_order_commodity.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:huixiang/view_widget/separator.dart'; |
|
|
|
import 'package:huixiang/view_widget/separator.dart'; |
|
|
|
import 'package:shared_preferences/shared_preferences.dart'; |
|
|
|
import 'package:shared_preferences/shared_preferences.dart'; |
|
|
@ -42,7 +39,10 @@ class _Settlement extends State<Settlement> { |
|
|
|
GestureTapCallback callbackEx; |
|
|
|
GestureTapCallback callbackEx; |
|
|
|
int isSelected = 0; |
|
|
|
int isSelected = 0; |
|
|
|
StoreInfo storeInfo; |
|
|
|
StoreInfo storeInfo; |
|
|
|
|
|
|
|
List<ProductListBean> shopCar = []; |
|
|
|
|
|
|
|
List<Map<String, dynamic>> shopCarGoods = []; |
|
|
|
SettleOrderInfo settleOrderInfo; |
|
|
|
SettleOrderInfo settleOrderInfo; |
|
|
|
|
|
|
|
int selectedCouponIndex = -1; |
|
|
|
|
|
|
|
|
|
|
|
TextEditingController _vc; |
|
|
|
TextEditingController _vc; |
|
|
|
List<String> addressBgs = [ |
|
|
|
List<String> addressBgs = [ |
|
|
@ -55,6 +55,8 @@ class _Settlement extends State<Settlement> { |
|
|
|
void initState() { |
|
|
|
void initState() { |
|
|
|
super.initState(); |
|
|
|
super.initState(); |
|
|
|
storeInfo = widget.arguments["storeInfo"]; |
|
|
|
storeInfo = widget.arguments["storeInfo"]; |
|
|
|
|
|
|
|
shopCar = widget.arguments["shopProduct"]; |
|
|
|
|
|
|
|
shopCarGoods = widget.arguments["shopGoods"]; |
|
|
|
|
|
|
|
|
|
|
|
_vc = TextEditingController( |
|
|
|
_vc = TextEditingController( |
|
|
|
text: storeInfo != null ? storeInfo.headMobile : ""); |
|
|
|
text: storeInfo != null ? storeInfo.headMobile : ""); |
|
|
@ -78,18 +80,27 @@ class _Settlement extends State<Settlement> { |
|
|
|
"addressId": null, |
|
|
|
"addressId": null, |
|
|
|
"isTake": 0, |
|
|
|
"isTake": 0, |
|
|
|
"memberCouponId": null, |
|
|
|
"memberCouponId": null, |
|
|
|
// "orderId": widget.arguments["orderId"], |
|
|
|
"orderId": 0, |
|
|
|
"orderId": "1449199929208602624", |
|
|
|
|
|
|
|
"promotionId": null |
|
|
|
"promotionId": null |
|
|
|
}); |
|
|
|
}); |
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
settleOrderInfo = baseData.data; |
|
|
|
setState(() { |
|
|
|
setState(() {}); |
|
|
|
settleOrderInfo = baseData.data; |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool isEdit = false; |
|
|
|
bool isEdit = false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String totalPrice() { |
|
|
|
|
|
|
|
if (shopCarGoods == null) return ""; |
|
|
|
|
|
|
|
double totalPrice = 0; |
|
|
|
|
|
|
|
shopCarGoods.forEach((element) { |
|
|
|
|
|
|
|
totalPrice += double.tryParse(element["price"]) * element["count"]; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
return "$totalPrice"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
Widget build(BuildContext context) { |
|
|
|
Widget build(BuildContext context) { |
|
|
|
return Stack( |
|
|
|
return Stack( |
|
|
@ -176,7 +187,8 @@ class _Settlement extends State<Settlement> { |
|
|
|
color: Color(0xFF4C4C4C), |
|
|
|
color: Color(0xFF4C4C4C), |
|
|
|
), |
|
|
|
), |
|
|
|
textAlign: TextAlign.right, |
|
|
|
textAlign: TextAlign.right, |
|
|
|
textAlignVertical: TextAlignVertical.center, |
|
|
|
textAlignVertical: |
|
|
|
|
|
|
|
TextAlignVertical.center, |
|
|
|
keyboardType: TextInputType.phone, |
|
|
|
keyboardType: TextInputType.phone, |
|
|
|
decoration: InputDecoration( |
|
|
|
decoration: InputDecoration( |
|
|
|
errorBorder: InputBorder.none, |
|
|
|
errorBorder: InputBorder.none, |
|
|
@ -222,15 +234,15 @@ class _Settlement extends State<Settlement> { |
|
|
|
padding: EdgeInsets.all(8), |
|
|
|
padding: EdgeInsets.all(8), |
|
|
|
child: isEdit |
|
|
|
child: isEdit |
|
|
|
? Icon( |
|
|
|
? Icon( |
|
|
|
Icons.check, |
|
|
|
Icons.check, |
|
|
|
size: 14.w, |
|
|
|
size: 14.w, |
|
|
|
color: Color(0xFF32A060), |
|
|
|
color: Color(0xFF32A060), |
|
|
|
) |
|
|
|
) |
|
|
|
: Image.asset( |
|
|
|
: Image.asset( |
|
|
|
"assets/image/pen.png", |
|
|
|
"assets/image/pen.png", |
|
|
|
height: 14.h, |
|
|
|
height: 14.h, |
|
|
|
width: 14.w, |
|
|
|
width: 14.w, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
@ -238,7 +250,7 @@ class _Settlement extends State<Settlement> { |
|
|
|
), |
|
|
|
), |
|
|
|
|
|
|
|
|
|
|
|
///订单商品 |
|
|
|
///订单商品 |
|
|
|
SettlementOrderCommodity(settleOrderInfo, 0), |
|
|
|
SettlementOrderCommodity(shopCar, 0,shopCarGoods,settleOrderInfo), |
|
|
|
// if (payStatus == 0) couponRemarks(), |
|
|
|
// if (payStatus == 0) couponRemarks(), |
|
|
|
/*(payStatus == 0) ? paySelector() : */ |
|
|
|
/*(payStatus == 0) ? paySelector() : */ |
|
|
|
|
|
|
|
|
|
|
@ -255,11 +267,11 @@ class _Settlement extends State<Settlement> { |
|
|
|
), |
|
|
|
), |
|
|
|
left: 0, |
|
|
|
left: 0, |
|
|
|
right: 0, |
|
|
|
right: 0, |
|
|
|
top: 0, |
|
|
|
top:0, |
|
|
|
bottom: 0, |
|
|
|
bottom:0, |
|
|
|
), |
|
|
|
), |
|
|
|
Positioned( |
|
|
|
Positioned( |
|
|
|
bottom: 0, |
|
|
|
bottom:0, |
|
|
|
left: 0, |
|
|
|
left: 0, |
|
|
|
right: 0, |
|
|
|
right: 0, |
|
|
|
child: Container( |
|
|
|
child: Container( |
|
|
@ -278,7 +290,7 @@ class _Settlement extends State<Settlement> { |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
Text( |
|
|
|
Text( |
|
|
|
"¥19.00", |
|
|
|
totalPrice(), |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 20.sp, |
|
|
|
fontSize: 20.sp, |
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
@ -613,7 +625,10 @@ class _Settlement extends State<Settlement> { |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
Text( |
|
|
|
Text( |
|
|
|
"满30减10", |
|
|
|
(settleOrderInfo?.couponList == null || settleOrderInfo.couponList.length == 0) |
|
|
|
|
|
|
|
? "暂无可用优惠券" : (selectedCouponIndex == -1 |
|
|
|
|
|
|
|
? "拥有${settleOrderInfo.couponList.length}张优惠券": |
|
|
|
|
|
|
|
settleOrderInfo.couponList[selectedCouponIndex].promotionName), |
|
|
|
textAlign: TextAlign.end, |
|
|
|
textAlign: TextAlign.end, |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 14.sp, |
|
|
|
fontSize: 14.sp, |
|
|
|