Browse Source

Merge branch 'master' into dev

master
w-R 3 years ago
parent
commit
4484dc40c3
  1. 20
      assets/svg/dingdan_waimai.svg
  2. 20
      assets/svg/dingdan_wuliu.svg
  3. 20
      assets/svg/dingdan_ziqu.svg
  4. 55
      lib/store/store_order.dart
  5. 689
      lib/store/store_view/settlement.dart
  6. 7
      lib/store/store_view/shop_car.dart

20
assets/svg/dingdan_waimai.svg

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="358px" height="149px" viewBox="0 0 358 149" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>矩形备份 20</title>
<defs>
<path d="M132.04384,5 L225.889633,5 C229.497242,5 232.658519,7.41457063 233.607744,10.8950608 L242.392256,43.1049392 C243.341481,46.5854294 246.502758,49 250.110367,49 L350,49 L350,49 L350,130 C350,134.418278 346.418278,138 342,138 L16,138 C11.581722,138 8,134.418278 8,130 L8,49 L8,49 L107.45616,49 C111.032457,49 114.174323,46.6263827 115.151643,43.1862167 L124.348357,10.8137833 C125.325677,7.37361731 128.467543,5 132.04384,5 Z" id="path-1"></path>
<filter x="-3.9%" y="-7.9%" width="107.9%" height="120.3%" filterUnits="objectBoundingBox" id="filter-2">
<feOffset dx="0" dy="3" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
<feGaussianBlur stdDeviation="4" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix>
</filter>
</defs>
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="外卖" transform="translate(-8.000000, -99.000000)">
<g id="矩形备份-20" transform="translate(8.000000, 99.000000)">
<use fill="black" fill-opacity="1" filter="url(#filter-2)" xlink:href="#path-1"></use>
<use fill="#FFFFFF" fill-rule="evenodd" xlink:href="#path-1"></use>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

20
assets/svg/dingdan_wuliu.svg

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="358px" height="149px" viewBox="0 0 358 149" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>矩形备份 20</title>
<defs>
<path d="M250.110367,5 L342,5 C346.418278,5 350,8.581722 350,13 L350,49 L350,49 L350,130 C350,134.418278 346.418278,138 342,138 L16,138 C11.581722,138 8,134.418278 8,130 L8,49 L8,49 L225.889633,49 C229.497242,49 232.658519,46.5854294 233.607744,43.1049392 L242.392256,10.8950608 C243.341481,7.41457063 246.502758,5 250.110367,5 Z" id="path-1"></path>
<filter x="-3.9%" y="-7.9%" width="107.9%" height="120.3%" filterUnits="objectBoundingBox" id="filter-2">
<feOffset dx="0" dy="3" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
<feGaussianBlur stdDeviation="4" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix>
</filter>
</defs>
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="物流" transform="translate(-8.000000, -99.000000)">
<g id="矩形备份-20" transform="translate(8.000000, 99.000000)">
<use fill="black" fill-opacity="1" filter="url(#filter-2)" xlink:href="#path-1"></use>
<use fill="#FFFFFF" fill-rule="evenodd" xlink:href="#path-1"></use>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

20
assets/svg/dingdan_ziqu.svg

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="358px" height="181px" viewBox="0 0 358 181" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>矩形备份 20</title>
<defs>
<path d="M16,7 L107.889633,7 C111.497242,7 114.658519,9.41457063 115.607744,12.8950608 L124.392256,45.1049392 C125.341481,48.5854294 128.502758,51 132.110367,51 L350,51 L350,51 L350,164 C350,168.418278 346.418278,172 342,172 L16,172 C11.581722,172 8,168.418278 8,164 L8,15 C8,10.581722 11.581722,7 16,7 Z" id="path-1"></path>
<filter x="-3.7%" y="-7.0%" width="107.3%" height="115.2%" filterUnits="objectBoundingBox" id="filter-2">
<feOffset dx="0" dy="1" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
<feGaussianBlur stdDeviation="4" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix>
</filter>
</defs>
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="1-自取" transform="translate(-8.000000, -97.000000)">
<g id="矩形备份-20" transform="translate(8.000000, 97.000000)">
<use fill="black" fill-opacity="1" filter="url(#filter-2)" xlink:href="#path-1"></use>
<use fill="#FFFFFF" fill-rule="evenodd" xlink:href="#path-1"></use>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

55
lib/store/store_order.dart

@ -4,6 +4,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/activity.dart'; import 'package:huixiang/retrofit/data/activity.dart';
@ -39,7 +40,8 @@ class StoreOrderPage extends StatefulWidget {
} }
} }
class _StoreOrderPage extends State<StoreOrderPage> with TickerProviderStateMixin/*, AutomaticKeepAliveClientMixin*/ { class _StoreOrderPage extends State<StoreOrderPage>
with TickerProviderStateMixin /*, AutomaticKeepAliveClientMixin*/ {
TabController tabcontroller; TabController tabcontroller;
ApiService apiService; ApiService apiService;
MinApiService minService; MinApiService minService;
@ -71,7 +73,8 @@ class _StoreOrderPage extends State<StoreOrderPage> with TickerProviderStateMixi
_fc(int count, String productId, int allCount, double allPrice) { _fc(int count, String productId, int allCount, double allPrice) {
if (count == 0) { if (count == 0) {
int index = shopCarGoods.indexWhere((element) => element["id"] == productId); int index =
shopCarGoods.indexWhere((element) => element["id"] == productId);
shopCarGoods.removeAt(index); shopCarGoods.removeAt(index);
} }
@ -239,7 +242,8 @@ class _StoreOrderPage extends State<StoreOrderPage> with TickerProviderStateMixi
coupon: true, coupon: true,
), ),
if (storeInfo == null || storeInfo.couponVOList == null) if (storeInfo == null ||
storeInfo.couponVOList == null)
SizedBox( SizedBox(
height: 8, height: 8,
), ),
@ -274,8 +278,10 @@ class _StoreOrderPage extends State<StoreOrderPage> with TickerProviderStateMixi
isScrollable: true, isScrollable: true,
indicatorWeight: 1, indicatorWeight: 1,
indicatorColor: Color(0xFFFAFAFA), indicatorColor: Color(0xFFFAFAFA),
labelPadding: labelPadding: EdgeInsets.only(
EdgeInsets.only(left: 8.w, right: 8.w), left: 8.w,
right: 8.w,
),
indicatorSize: TabBarIndicatorSize.label, indicatorSize: TabBarIndicatorSize.label,
unselectedLabelStyle: TextStyle( unselectedLabelStyle: TextStyle(
fontSize: 15.sp, fontSize: 15.sp,
@ -288,8 +294,8 @@ class _StoreOrderPage extends State<StoreOrderPage> with TickerProviderStateMixi
), ),
labelColor: Colors.black, labelColor: Colors.black,
tabs: [ tabs: [
MyTab(text: S.current.diancan), MyTab(text: S.of(context).diancan),
MyTab(text: S.current.xindianhuodong), MyTab(text: S.of(context).xindianhuodong),
], ],
), ),
), ),
@ -356,12 +362,7 @@ class _StoreOrderPage extends State<StoreOrderPage> with TickerProviderStateMixi
Spacer(), Spacer(),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
Navigator.of(context).pushNamed( toDownOrder();
'/router/settlement',
arguments: {
"storeInfo": storeInfo,
},
);
}, },
child: RoundButton( child: RoundButton(
width: 103.w, width: 103.w,
@ -414,6 +415,20 @@ class _StoreOrderPage extends State<StoreOrderPage> with TickerProviderStateMixi
); );
} }
toDownOrder() {
if (shopCarGoods == null || shopCarGoods.length == 0) {
SmartDialog.showToast("请选择要购买的商品~");
return ;
}
Navigator.of(context).pushNamed(
'/router/settlement',
arguments: {
"storeInfo": storeInfo,
"shopGoods": shopCarGoods,
},
);
}
Widget buildSwiper() { Widget buildSwiper() {
return Container( return Container(
width: double.infinity, width: double.infinity,
@ -481,6 +496,7 @@ class _StoreOrderPage extends State<StoreOrderPage> with TickerProviderStateMixi
shopCar, shopCar,
shopCarGoods, shopCarGoods,
clearShopCar, clearShopCar,
toDownOrder,
(int count, String productId, allCount, allPrice) { (int count, String productId, allCount, allPrice) {
print("shopCarCount: $allCount allPrice: $allPrice "); print("shopCarCount: $allCount allPrice: $allPrice ");
setState(() { setState(() {
@ -495,8 +511,7 @@ class _StoreOrderPage extends State<StoreOrderPage> with TickerProviderStateMixi
/// ///
clearShopCar() { clearShopCar() {
if (shopCarGoods != null) if (shopCarGoods != null) shopCarGoods.clear();
shopCarGoods.clear();
calculatePrice(); calculatePrice();
setState(() {}); setState(() {});
} }
@ -542,7 +557,8 @@ class _StoreOrderPage extends State<StoreOrderPage> with TickerProviderStateMixi
} }
}); });
if (map != null) { if (map != null) {
int index = shopCarGoods.indexWhere((element) => element["id"] == result["id"]); int index = shopCarGoods
.indexWhere((element) => element["id"] == result["id"]);
shopCarGoods.removeAt(index); shopCarGoods.removeAt(index);
shopCarGoods.insert(index, result); shopCarGoods.insert(index, result);
} else { } else {
@ -561,7 +577,8 @@ class _StoreOrderPage extends State<StoreOrderPage> with TickerProviderStateMixi
double singlePrice = double.tryParse(element2["price"]); double singlePrice = double.tryParse(element2["price"]);
allCount += element2["count"]; allCount += element2["count"];
AiDecimalAccuracy aiDecimalAccuracy = AiDecimalAccuracy.fromInt(element2["count"]); AiDecimalAccuracy aiDecimalAccuracy =
AiDecimalAccuracy.fromInt(element2["count"]);
AiDecimalAccuracy aiPrice = AiDecimalAccuracy.tryParse("$singlePrice"); AiDecimalAccuracy aiPrice = AiDecimalAccuracy.tryParse("$singlePrice");
allPriceDecimal += (aiPrice * aiDecimalAccuracy); allPriceDecimal += (aiPrice * aiDecimalAccuracy);
@ -572,8 +589,8 @@ class _StoreOrderPage extends State<StoreOrderPage> with TickerProviderStateMixi
setState(() {}); setState(() {});
} }
// @override // @override
// bool get wantKeepAlive => true; // bool get wantKeepAlive => true;
} }
class Title extends StatefulWidget { class Title extends StatefulWidget {

689
lib/store/store_view/settlement.dart

@ -3,8 +3,11 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.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/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';
import 'package:huixiang/retrofit/min_api.dart'; import 'package:huixiang/retrofit/min_api.dart';
@ -57,21 +60,19 @@ class _Settlement extends State<Settlement> {
StoreInfo storeInfo; StoreInfo storeInfo;
SettleOrderInfo settleOrderInfo; SettleOrderInfo settleOrderInfo;
/// ///
queryOrderInfo() async { queryOrderInfo() async {
BaseData<SettleOrderInfo> baseData = await minService.getOrderInfo({ BaseData<SettleOrderInfo> baseData = await minService.getOrderInfo({
"addressId":null, "addressId": null,
"isTake": 0, "isTake": 0,
"memberCouponId": null, "memberCouponId": null,
// "orderId": widget.arguments["orderId"], // "orderId": widget.arguments["orderId"],
"orderId":"1449199929208602624", "orderId": "1449199929208602624",
"promotionId": null "promotionId": null
}); });
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
settleOrderInfo = baseData.data; settleOrderInfo = baseData.data;
setState(() { setState(() {});
});
} }
} }
@ -95,7 +96,7 @@ class _Settlement extends State<Settlement> {
appBar: MyAppBar( appBar: MyAppBar(
background: Color(0xFF3A405A), background: Color(0xFF3A405A),
leadingColor: Colors.white, leadingColor: Colors.white,
title:S.of(context).dingdanjiesuan, title: S.of(context).dingdanjiesuan,
titleColor: Colors.white, titleColor: Colors.white,
titleSize: 18.sp, titleSize: 18.sp,
), ),
@ -106,10 +107,12 @@ class _Settlement extends State<Settlement> {
child: Column( child: Column(
children: [ children: [
distributionMode(), distributionMode(),
SizedBox(height: 14,), SizedBox(
height: 14,
),
/// ///
SettlementOrderCommodity(settleOrderInfo,0), SettlementOrderCommodity(settleOrderInfo, 0),
// if (payStatus == 0) couponRemarks(), // if (payStatus == 0) couponRemarks(),
/*(payStatus == 0) ? paySelector() : */ /*(payStatus == 0) ? paySelector() : */
@ -118,7 +121,6 @@ class _Settlement extends State<Settlement> {
/// ///
payMethod(), payMethod(),
], ],
), ),
), ),
@ -134,49 +136,48 @@ class _Settlement extends State<Settlement> {
bottom: 0, bottom: 0,
left: 0, left: 0,
right: 0, right: 0,
child: child: Container(
Container( height: 54.h,
height: 54.h, color: Colors.white,
color: Colors.white, child: Row(
child: Row( crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, children: [
children: [ Spacer(),
Spacer(), Text(
Text( S.of(context).heji,
S.of(context).heji, style: TextStyle(
style: TextStyle( fontSize: 12.sp,
fontSize: 12.sp, fontWeight: MyFontWeight.regular,
fontWeight: MyFontWeight.regular, color: Colors.black,
color: Colors.black, ),
),
),
Text(
"¥19.00",
style: TextStyle(
fontSize: 20.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF32A060),
),
),
SizedBox(width: 28,),
GestureDetector(
onTap: () {
},
child: RoundButton(
width: 103.w,
height: 54.h,
text: S.current.jiesuan,
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFF32A060),
fontSize: 16.sp,
padding: EdgeInsets.symmetric(vertical: 5.h),
),
),
],
), ),
), Text(
"¥19.00",
style: TextStyle(
fontSize: 20.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF32A060),
),
),
SizedBox(
width: 28,
),
GestureDetector(
onTap: () {},
child: RoundButton(
width: 103.w,
height: 54.h,
text: S.current.jiesuan,
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFF32A060),
fontSize: 16.sp,
padding: EdgeInsets.symmetric(vertical: 5.h),
),
),
],
),
),
) )
], ],
); );
@ -186,7 +187,6 @@ class _Settlement extends State<Settlement> {
String center = ""; String center = "";
TextEditingController _vc = TextEditingController(); TextEditingController _vc = TextEditingController();
Widget distributionMode() { Widget distributionMode() {
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
@ -223,37 +223,40 @@ class _Settlement extends State<Settlement> {
Expanded( Expanded(
flex: 1, flex: 1,
child: Container( child: Container(
height: 50.h, height: 50.h,
decoration: BoxDecoration( decoration: BoxDecoration(
image: selectedBtn == 0 image: selectedBtn == 0
? DecorationImage( ? DecorationImage(
image: AssetImage( image:
"assets/image/order_btn1.png"), AssetImage("assets/image/order_btn1.png"),
fit: BoxFit.fill, fit: BoxFit.fill,
) )
: null, : null,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(8))), topLeft: Radius.circular(8),
child: GestureDetector( ),
onTap: () { ),
setState(() { child: GestureDetector(
selectedBtn = 0; onTap: () {
}); setState(() {
}, selectedBtn = 0;
child: Stack( });
alignment: Alignment.center, },
children: [ child: Stack(
Text( alignment: Alignment.center,
S.of(context).daodianziqu, children: [
style: TextStyle( Text(
fontSize: 14.sp, S.of(context).daodianziqu,
fontWeight: MyFontWeight.semi_bold, style: TextStyle(
color: Colors.black, fontSize: 14.sp,
), fontWeight: MyFontWeight.semi_bold,
color: Colors.black,
), ),
], ),
), ],
)), ),
),
),
), ),
Expanded( Expanded(
flex: 1, flex: 1,
@ -273,7 +276,7 @@ class _Settlement extends State<Settlement> {
fit: BoxFit.fill, fit: BoxFit.fill,
), ),
Text( Text(
S.of(context).waimaipeisong, S.of(context).waimaipeisong,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
@ -287,68 +290,214 @@ class _Settlement extends State<Settlement> {
Expanded( Expanded(
flex: 1, flex: 1,
child: Container( child: Container(
height: 50.h, height: 50.h,
decoration: BoxDecoration( decoration: BoxDecoration(
image: selectedBtn == 2 image: selectedBtn == 2
? DecorationImage( ? DecorationImage(
image: AssetImage( image:
"assets/image/order_btn3.png"), AssetImage("assets/image/order_btn3.png"),
fit: BoxFit.fill, fit: BoxFit.fill,
) )
: null, : null,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topRight: Radius.circular(8))), topRight: Radius.circular(8),
child: GestureDetector( ),
onTap: () { ),
setState(() { child: GestureDetector(
// selectedBtn = 2; onTap: () {
SmartDialog.showToast("该功能暂未开放!", alignment: Alignment.center); setState(() {
}); // selectedBtn = 2;
}, SmartDialog.showToast("该功能暂未开放!",
child: Stack( alignment: Alignment.center);
alignment: Alignment.center, });
children: [ },
Text( child: Stack(
S.of(context).kuaidiwuliu, alignment: Alignment.center,
style: TextStyle( children: [
fontSize: 14.sp, Text(
fontWeight: MyFontWeight.regular, S.of(context).kuaidiwuliu,
color: Colors.black, style: TextStyle(
), fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
color: Colors.black,
), ),
], ),
), ],
)), ),
),
),
), ),
], ],
), ),
), ),
selectedBtn == 0 ? selectedBtn == 0
Container( ? Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only(left: 16, right: 16, top: 15), padding: EdgeInsets.only(left: 16, right: 16, top: 15),
child: Column( child: Column(
children: [ children: [
Row( Row(
children: [ children: [
Expanded(child:Column( Expanded(
mainAxisAlignment: MainAxisAlignment.spaceBetween, child: Column(
crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment:
children: [ MainAxisAlignment.spaceBetween,
Text( crossAxisAlignment: CrossAxisAlignment.start,
storeInfo != null ? (storeInfo.storeName ?? "") : "", children: [
overflow: TextOverflow.ellipsis, Text(
style: TextStyle( storeInfo != null
fontSize: 14.sp, ? (storeInfo.storeName ?? "")
fontWeight: MyFontWeight.semi_bold, : "",
color: Color(0xFF4C4C4C), overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF4C4C4C),
),
),
SizedBox(
height: 4,
),
Text(
storeInfo != null
? storeInfo.address
: "",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF727272),
),
),
SizedBox(
height: 12,
),
],
),
), ),
), SizedBox(
SizedBox( width: 18,
height: 4, ),
), Stack(
Text( alignment: Alignment.center,
storeInfo != null ? storeInfo.address : "", children: [
Column(
children: [
Image.asset(
"assets/image/map.png",
height: 61.h,
width: 61.w,
),
],
),
Column(
children: [
RoundButton(
width: 41.w,
height: 13,
text: "距离您11m",
textColor: Color(0xFF34A262),
fontWeight: MyFontWeight.semi_bold,
radius: 7.5,
backgroup: Colors.white,
fontSize: 7.sp,
),
Image.asset(
"assets/image/landmark.png",
height: 24.h,
width: 24.w,
),
],
),
],
)
],
),
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,
),
),
],
)
],
),
)
: Container(
width: double.infinity,
padding: EdgeInsets.only(left: 16, right: 16, top: 15),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
"assets/image/icon_permission_location.png",
height: 24.h,
width: 24.w,
),
Text(
"张先生",
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF4C4C4C),
),
),
SizedBox(
width: 13,
),
Expanded(
child: Text(
"12309090909",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF4C4C4C),
),
),
),
Icon(
Icons.keyboard_arrow_right,
size: 24,
),
],
),
Padding(
padding: EdgeInsets.only(top: 4, left: 25),
child: Text(
"武昌区中国铁建凯德1818蓝调步行街中北路109附33门牌号05",
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 2, maxLines: 2,
style: TextStyle( style: TextStyle(
@ -357,136 +506,10 @@ class _Settlement extends State<Settlement> {
color: Color(0xFF727272), color: Color(0xFF727272),
), ),
), ),
SizedBox(
height: 12,
),
],
),),
SizedBox(
width: 18,
),
Stack(
alignment: Alignment.center,
children: [
Column(
children: [
Image.asset(
"assets/image/map.png",
height: 61.h,
width:61.w,
),
],
),
Column(children: [
RoundButton(
width: 41.w,
height: 13,
text: "距离您11m",
textColor:Color(0xFF34A262),
fontWeight: MyFontWeight.semi_bold,
radius:7.5,
backgroup:Colors.white,
fontSize:7.sp,
),
Image.asset(
"assets/image/landmark.png",
height: 24.h,
width:24.w,
),
],),
],
)
],
),
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,
), ),
), ],
],
)
],
),
)
: Container(
width: double.infinity,
padding: EdgeInsets.only(left: 16, right: 16, top: 15),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
"assets/image/icon_permission_location.png",
height:24.h,
width:24.w,
), Text(
"张先生",
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF4C4C4C),
),
),
SizedBox(
width: 13,
),
Expanded(child: Text(
"12309090909",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF4C4C4C),
),
),),
Icon(
Icons.keyboard_arrow_right,
size:24,
),
],
),
Padding(padding:EdgeInsets.only(top: 4,left:25),
child: Text(
"武昌区中国铁建凯德1818蓝调步行街中北路109附33门牌号05",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF727272),
), ),
),), ),
],
),
),
], ],
), ),
], ],
@ -494,7 +517,7 @@ class _Settlement extends State<Settlement> {
); );
} }
Widget activityRemarks(){ Widget activityRemarks() {
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
@ -509,29 +532,40 @@ class _Settlement extends State<Settlement> {
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
height: 86.h, height: 86.h,
margin: EdgeInsets.only(left: 16, right: 16, top: 15), margin: EdgeInsets.only(
padding: EdgeInsets.only(left: 16, right: 16, top: 16), left: 16,
right: 16,
top: 15,
),
padding: EdgeInsets.only(
left: 16,
right: 16,
top: 16,
),
child: Column( child: Column(
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded(flex: 1,child:Text( Expanded(
S.of(context).youhuiquan, flex: 1,
style: TextStyle( child: Text(
fontWeight: MyFontWeight.regular, S.of(context).youhuiquan,
fontSize: 14.sp, style: TextStyle(
color: Color(0xFF353535), fontWeight: MyFontWeight.regular,
fontSize: 14.sp,
color: Color(0xFF353535),
),
), ),
)), ),
Text( Text(
"满30减10", "满30减10",
textAlign: TextAlign.end, textAlign: TextAlign.end,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xFF32A060), color: Color(0xFF32A060),
fontWeight: MyFontWeight.semi_bold fontWeight: MyFontWeight.semi_bold,
), ),
), ),
InkWell( InkWell(
@ -540,35 +574,38 @@ class _Settlement extends State<Settlement> {
couponCart(); couponCart();
}); });
}, },
child: Icon( child: Icon(
Icons.keyboard_arrow_right, Icons.keyboard_arrow_right,
size: 16, size: 16,
), ),
), ),
], ],
), ),
SizedBox(height: 13, SizedBox(
height: 13,
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded(flex: 1,child:Text( Expanded(
S.of(context).beizhu, flex: 1,
style: TextStyle( child: Text(
fontWeight: MyFontWeight.regular, S.of(context).beizhu,
fontSize: 14.sp, style: TextStyle(
color: Color(0xFF353535), fontWeight: MyFontWeight.regular,
fontSize: 14.sp,
color: Color(0xFF353535),
),
), ),
)), ),
Text( Text(
"口味、面包硬度等", "口味、面包硬度等",
textAlign: TextAlign.end, textAlign: TextAlign.end,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xFF353535), color: Color(0xFF353535),
fontWeight: MyFontWeight.semi_bold fontWeight: MyFontWeight.semi_bold,
), ),
), ),
Icon( Icon(
@ -582,7 +619,7 @@ class _Settlement extends State<Settlement> {
); );
} }
Widget payMethod(){ Widget payMethod() {
return Container( return Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only( margin: EdgeInsets.only(
@ -619,14 +656,14 @@ class _Settlement extends State<Settlement> {
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
color: Colors.black, color: Colors.black,
fontWeight:MyFontWeight.regular, fontWeight: MyFontWeight.regular,
), ),
), ),
), ),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {
checkIndex =1; checkIndex = 1;
}); });
}, },
child: Row( child: Row(
@ -637,19 +674,20 @@ class _Settlement extends State<Settlement> {
Text( Text(
S.of(context).pingtaiyue, S.of(context).pingtaiyue,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xff353535), color: Color(0xff353535),
fontWeight: MyFontWeight.semi_bold fontWeight: MyFontWeight.semi_bold),
),
), ),
], ],
), ),
), ),
SizedBox(height: 10,), SizedBox(
height: 10,
),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {
checkIndex =2; checkIndex = 2;
}); });
}, },
child: Row( child: Row(
@ -662,13 +700,15 @@ class _Settlement extends State<Settlement> {
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xff353535), color: Color(0xff353535),
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
), ),
), ),
], ],
), ),
), ),
SizedBox(height: 10,), SizedBox(
height: 10,
),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {
@ -689,7 +729,7 @@ class _Settlement extends State<Settlement> {
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xff353535), color: Color(0xff353535),
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
), ),
), ),
), ),
@ -764,15 +804,19 @@ class _Settlement extends State<Settlement> {
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
), ),
), ),
SizedBox(width: 4,), SizedBox(
Expanded(child: Text( width: 4,
"(1)", ),
style: TextStyle( Expanded(
color: Color(0xFF000000), child: Text(
fontSize: 14.sp, "(1)",
fontWeight: MyFontWeight.medium, style: TextStyle(
color: Color(0xFF000000),
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
), ),
),), ),
InkWell( InkWell(
onTap: () { onTap: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
@ -794,13 +838,12 @@ class _Settlement extends State<Settlement> {
right: 16, right: 16,
), ),
child: ListView.builder( child: ListView.builder(
itemCount:5, itemCount: 5,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
itemBuilder: (context, position) { itemBuilder: (context, position) {
// return shoppGoodsItem(); // return shoppGoodsItem();
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {},
},
child: couponItem(position), child: couponItem(position),
); );
}, },
@ -817,9 +860,9 @@ class _Settlement extends State<Settlement> {
/// ///
Widget couponItem(int index) { Widget couponItem(int index) {
return StatefulBuilder(builder: (context1, state){ return StatefulBuilder(builder: (context1, state) {
return Container( return Container(
height:170, height: 170,
width: double.infinity, width: double.infinity,
margin: EdgeInsets.fromLTRB(14.w, 6.h, 14.w, 6.h), margin: EdgeInsets.fromLTRB(14.w, 6.h, 14.w, 6.h),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -846,7 +889,7 @@ class _Settlement extends State<Settlement> {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded( Expanded(
child:Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
@ -901,8 +944,7 @@ class _Settlement extends State<Settlement> {
Container( Container(
padding: EdgeInsets.fromLTRB(4, 2, 4, 2), padding: EdgeInsets.fromLTRB(4, 2, 4, 2),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius: BorderRadius.circular(2),
BorderRadius.circular(2),
border: Border.all( border: Border.all(
width: 1, width: 1,
color: Color(0xFFFF7A1A), color: Color(0xFFFF7A1A),
@ -956,13 +998,13 @@ class _Settlement extends State<Settlement> {
), ),
Container( Container(
margin: EdgeInsets.only(right: 23.w), margin: EdgeInsets.only(right: 23.w),
child:GestureDetector( child: GestureDetector(
onTap: (){ onTap: () {
state(() { state(() {
isSelected = index; isSelected = index;
}); });
}, },
child:Image.asset( child: Image.asset(
isSelected != index isSelected != index
? "assets/image/icon_radio_unselected.png" ? "assets/image/icon_radio_unselected.png"
: "assets/image/icon_radio_selected.png", : "assets/image/icon_radio_selected.png",
@ -1032,7 +1074,7 @@ class _Settlement extends State<Settlement> {
), ),
Text( Text(
(coupon.useStartTime == null && (coupon.useStartTime == null &&
coupon.useEndTime == null) coupon.useEndTime == null)
? S.of(context).quantian ? S.of(context).quantian
: "${coupon.useStartTime.replaceAll("-", ".").split(" ")[0]} - ${coupon.useEndTime.replaceAll("-", ".").split(" ")[0]}", : "${coupon.useStartTime.replaceAll("-", ".").split(" ")[0]} - ${coupon.useEndTime.replaceAll("-", ".").split(" ")[0]}",
style: TextStyle( style: TextStyle(
@ -1067,5 +1109,4 @@ class _Settlement extends State<Settlement> {
), ),
); );
} }
} }

7
lib/store/store_view/shop_car.dart

@ -11,6 +11,7 @@ class ShopCar extends StatefulWidget {
final List<ProductListBean> productLists; final List<ProductListBean> productLists;
final Function(String id) queryMiNiDetail; final Function(String id) queryMiNiDetail;
final Function() clearShopCar; final Function() clearShopCar;
final Function() toDownOrder;
final List<Map<String, dynamic>> shopCarGoods; final List<Map<String, dynamic>> shopCarGoods;
final Function(int count, String productId, int allCount, double allPrice) fc; final Function(int count, String productId, int allCount, double allPrice) fc;
@ -19,6 +20,7 @@ class ShopCar extends StatefulWidget {
this.productLists, this.productLists,
this.shopCarGoods, this.shopCarGoods,
this.clearShopCar, this.clearShopCar,
this.toDownOrder,
this.fc, { this.fc, {
this.queryMiNiDetail, this.queryMiNiDetail,
}); });
@ -211,10 +213,7 @@ class _ShopCar extends State<ShopCar> {
Spacer(), Spacer(),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
Navigator.of(context).pushNamed( widget.toDownOrder();
'/router/settlement',
arguments: {},
);
}, },
child: RoundButton( child: RoundButton(
width: 103.w, width: 103.w,

Loading…
Cancel
Save