Browse Source

Merge branch 'master' into dev

master
w-R 3 years ago
parent
commit
3545ec0e99
  1. 8
      assets/svg/dingdan_waimai.svg
  2. 8
      assets/svg/dingdan_wuliu.svg
  3. 10
      assets/svg/dingdan_ziqu.svg
  4. 19
      lib/store/store_order.dart
  5. 245
      lib/store/store_view/settlement.dart

8
assets/svg/dingdan_waimai.svg

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <svg width="342px" height="133px" viewBox="0 0 342 133" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>矩形备份 20</title> <title>矩形备份 20</title>
<defs> <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> <path d="M124.04384,0 L217.889633,0 C221.497242,2.89000676e-15 224.658519,2.41457063 225.607744,5.89506075 L234.392256,38.1049392 C235.341481,41.5854294 238.502758,44 242.110367,44 L342,44 L342,44 L342,125 C342,129.418278 338.418278,133 334,133 L8,133 C3.581722,133 5.41083001e-16,129.418278 0,125 L0,44 L0,44 L99.4561601,44 C103.032457,44 106.174323,41.6263827 107.151643,38.1862167 L116.348357,5.81378328 C117.325677,2.37361731 120.467543,6.56954993e-16 124.04384,0 Z" id="path-1"></path>
<filter x="-3.9%" y="-7.9%" width="107.9%" height="120.3%" filterUnits="objectBoundingBox" id="filter-2"> <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> <feOffset dx="0" dy="3" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
<feGaussianBlur stdDeviation="4" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur> <feGaussianBlur stdDeviation="4" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
@ -10,8 +10,8 @@
</filter> </filter>
</defs> </defs>
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="外卖" transform="translate(-8.000000, -99.000000)"> <g id="外卖" transform="translate(-16.000000, -104.000000)">
<g id="矩形备份-20" transform="translate(8.000000, 99.000000)"> <g id="矩形备份-20" transform="translate(16.000000, 104.000000)">
<use fill="black" fill-opacity="1" filter="url(#filter-2)" xlink:href="#path-1"></use> <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> <use fill="#FFFFFF" fill-rule="evenodd" xlink:href="#path-1"></use>
</g> </g>

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

8
assets/svg/dingdan_wuliu.svg

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <svg width="342px" height="133px" viewBox="0 0 342 133" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>矩形备份 20</title> <title>矩形备份 20</title>
<defs> <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> <path d="M242.110367,0 L334,0 C338.418278,-8.11624501e-16 342,3.581722 342,8 L342,44 L342,44 L342,125 C342,129.418278 338.418278,133 334,133 L8,133 C3.581722,133 5.41083001e-16,129.418278 0,125 L0,44 L0,44 L217.889633,44 C221.497242,44 224.658519,41.5854294 225.607744,38.1049392 L234.392256,5.89506075 C235.341481,2.41457063 238.502758,6.62706922e-16 242.110367,0 Z" id="path-1"></path>
<filter x="-3.9%" y="-7.9%" width="107.9%" height="120.3%" filterUnits="objectBoundingBox" id="filter-2"> <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> <feOffset dx="0" dy="3" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
<feGaussianBlur stdDeviation="4" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur> <feGaussianBlur stdDeviation="4" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
@ -10,8 +10,8 @@
</filter> </filter>
</defs> </defs>
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="物流" transform="translate(-8.000000, -99.000000)"> <g id="物流" transform="translate(-16.000000, -104.000000)">
<g id="矩形备份-20" transform="translate(8.000000, 99.000000)"> <g id="矩形备份-20" transform="translate(16.000000, 104.000000)">
<use fill="black" fill-opacity="1" filter="url(#filter-2)" xlink:href="#path-1"></use> <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> <use fill="#FFFFFF" fill-rule="evenodd" xlink:href="#path-1"></use>
</g> </g>

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

10
assets/svg/dingdan_ziqu.svg

@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <svg width="342px" height="133px" viewBox="0 0 342 133" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>矩形备份 20</title> <title>矩形备份 20</title>
<defs> <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> <path d="M8,0 L99.8896333,0 C103.497242,1.81067732e-15 106.658519,2.41457063 107.607744,5.89506075 L116.392256,38.1049392 C117.341481,41.5854294 120.502758,44 124.110367,44 L342,44 L342,44 L342,125 C342,129.418278 338.418278,133 334,133 L8,133 C3.581722,133 5.41083001e-16,129.418278 0,125 L0,8 C-5.41083001e-16,3.581722 3.581722,8.11624501e-16 8,0 Z" id="path-1"></path>
<filter x="-3.7%" y="-7.0%" width="107.3%" height="115.2%" filterUnits="objectBoundingBox" id="filter-2"> <filter x="-3.7%" y="-8.6%" width="107.3%" height="118.8%" filterUnits="objectBoundingBox" id="filter-2">
<feOffset dx="0" dy="1" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset> <feOffset dx="0" dy="1" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
<feGaussianBlur stdDeviation="4" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur> <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> <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> </filter>
</defs> </defs>
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="1-自取" transform="translate(-8.000000, -97.000000)"> <g id="1-自取" transform="translate(-16.000000, -104.000000)">
<g id="矩形备份-20" transform="translate(8.000000, 97.000000)"> <g id="矩形备份-20" transform="translate(16.000000, 104.000000)">
<use fill="black" fill-opacity="1" filter="url(#filter-2)" xlink:href="#path-1"></use> <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> <use fill="#FFFFFF" fill-rule="evenodd" xlink:href="#path-1"></use>
</g> </g>

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

19
lib/store/store_order.dart

@ -54,6 +54,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
StoreOrderListPage storeOrderListPage; StoreOrderListPage storeOrderListPage;
List<Map<String, dynamic>> shopCarGoods = []; List<Map<String, dynamic>> shopCarGoods = [];
List<FindMiNiGroupList> appletProducts = [];
List<ProductListBean> shopCar = [];
ScrollController controller = ScrollController(); ScrollController controller = ScrollController();
@ -420,11 +422,14 @@ class _StoreOrderPage extends State<StoreOrderPage>
SmartDialog.showToast("请选择要购买的商品~"); SmartDialog.showToast("请选择要购买的商品~");
return ; return ;
} }
getShopCarGoods();
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/settlement', '/router/settlement',
arguments: { arguments: {
"storeInfo": storeInfo, "storeInfo": storeInfo,
"shopGoods": shopCarGoods, "shopGoods": shopCarGoods,
"shopProduct": shopCar,
}, },
); );
} }
@ -466,16 +471,14 @@ class _StoreOrderPage extends State<StoreOrderPage>
); );
} }
List<FindMiNiGroupList> appletProducts = [];
_productListResult(List<FindMiNiGroupList> appletProducts) { _productListResult(List<FindMiNiGroupList> appletProducts) {
this.appletProducts = appletProducts; this.appletProducts = appletProducts;
} }
/// ///
showShoppingCart() { getShopCarGoods() {
if (appletProducts == null || appletProducts.length == 0) return; if (appletProducts == null || appletProducts.length == 0) return;
List<ProductListBean> shopCar = []; shopCar = [];
if (shopCarGoods != null && shopCarGoods.length > 0) { if (shopCarGoods != null && shopCarGoods.length > 0) {
shopCarGoods.forEach((element) { shopCarGoods.forEach((element) {
appletProducts.forEach((element1) { appletProducts.forEach((element1) {
@ -487,6 +490,12 @@ class _StoreOrderPage extends State<StoreOrderPage>
}); });
}); });
} }
}
///
showShoppingCart() {
getShopCarGoods();
showModalBottomSheet( showModalBottomSheet(
context: context, context: context,

245
lib/store/store_view/settlement.dart

@ -2,6 +2,7 @@ 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_smart_dialog/flutter_smart_dialog.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/generated/l10n.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/order_info.dart';
@ -78,6 +79,7 @@ class _Settlement extends State<Settlement> {
leadingColor: Colors.white, leadingColor: Colors.white,
title: S.of(context).dingdanjiesuan, title: S.of(context).dingdanjiesuan,
titleColor: Colors.white, titleColor: Colors.white,
brightness: Brightness.dark,
titleSize: 18.sp, titleSize: 18.sp,
), ),
body: Container( body: Container(
@ -88,7 +90,60 @@ class _Settlement extends State<Settlement> {
children: [ children: [
distributionMode(), distributionMode(),
SizedBox( 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,103 +222,92 @@ class _Settlement extends State<Settlement> {
String center = ""; String center = "";
TextEditingController _vc = TextEditingController(); 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(
decoration: BoxDecoration( height: 143.h,
color: Color(0xFFFAFAFA), margin: EdgeInsets.only(
boxShadow: [ left: 16,
BoxShadow( right: 16,
color: Color(0x0D000000), top: 10,
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
borderRadius: BorderRadius.circular(8),
), ),
height: 175.h,
margin: EdgeInsets.only(left: 16, right: 16, top: 15),
child: Stack( child: Stack(
children: [ children: [
Container(
decoration: BoxDecoration(
color: Color(0x80FFFFFF),
boxShadow: [
BoxShadow(
color: Color(0x0D000000),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
borderRadius: BorderRadius.circular(8),
),
child: SvgPicture.asset(
addressBgs[selectedBtn],
width: double.infinity,
height: double.infinity,
fit: BoxFit.fill,
),
),
Column( Column(
children: [ children: [
Container( Container(
decoration: BoxDecoration(
color: Color(0xFF9C9FAC),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
topRight: Radius.circular(8),
),
),
height: 50.h, height: 50.h,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: [ children: [
Expanded( Expanded(
flex: 1, flex: 1,
child: Container( child: Container(
height: 50.h, height: 50.h,
decoration: BoxDecoration( alignment: Alignment.center,
image: selectedBtn == 0
? DecorationImage(
image:
AssetImage("assets/image/order_btn1.png"),
fit: BoxFit.fill,
)
: null,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
),
),
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {
selectedBtn = 0; selectedBtn = 0;
}); });
}, },
child: Stack( child: 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,
child: GestureDetector( child: Container(
onTap: () { height: 50.h,
setState(() { alignment: Alignment.center,
selectedBtn = 1; child: GestureDetector(
}); onTap: () {
}, setState(() {
child: Stack( selectedBtn = 1;
alignment: Alignment.center, });
children: [ },
if (selectedBtn == 1) child: Text(
Image.asset( S.of(context).waimaipeisong,
"assets/image/order_btn2.png", style: TextStyle(
height: 50.h, fontSize: 14.sp,
fit: BoxFit.fill, fontWeight: MyFontWeight.regular,
), color: Colors.black,
Text(
S.of(context).waimaipeisong,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
color: Colors.black,
),
), ),
], ),
), ),
), ),
), ),
@ -271,18 +315,7 @@ class _Settlement extends State<Settlement> {
flex: 1, flex: 1,
child: Container( child: Container(
height: 50.h, height: 50.h,
decoration: BoxDecoration( alignment: Alignment.center,
image: selectedBtn == 2
? DecorationImage(
image:
AssetImage("assets/image/order_btn3.png"),
fit: BoxFit.fill,
)
: null,
borderRadius: BorderRadius.only(
topRight: Radius.circular(8),
),
),
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {
@ -291,18 +324,13 @@ class _Settlement extends State<Settlement> {
alignment: Alignment.center); alignment: Alignment.center);
}); });
}, },
child: Stack( child: Text(
alignment: Alignment.center, S.of(context).kuaidiwuliu,
children: [ style: TextStyle(
Text( fontSize: 14.sp,
S.of(context).kuaidiwuliu, fontWeight: MyFontWeight.regular,
style: TextStyle( color: Colors.black,
fontSize: 14.sp, ),
fontWeight: MyFontWeight.regular,
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,
),
),
],
)
], ],
), ),
) )

Loading…
Cancel
Save