From a5d74631ebd8cc80c5fcd0a2a2149545efa93031 Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Sat, 6 May 2023 15:27:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E7=BB=93=E7=AE=97=E9=A1=B5?= =?UTF-8?q?=E5=A4=96=E5=8D=96=EF=BC=8C=E7=89=A9=E6=B5=81=EF=BC=8C=E5=A0=82?= =?UTF-8?q?=E9=A3=9F=EF=BC=8C=E6=A0=B9=E6=8D=AE=E5=AF=B9=E5=BA=94=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E6=98=BE=E7=A4=BA=E9=9A=90=E8=97=8F=E5=AF=B9=E5=BA=94?= =?UTF-8?q?=E6=8C=89=E9=92=AE=EF=BC=9B=20=E6=9B=B4=E6=94=B9=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E8=AF=AD=E8=A8=80=E9=A1=BA=E5=BA=8F=EF=BC=9B=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=82=B9=E9=A4=90=E9=A1=B5banner=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=BB=91=E5=8A=A8=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/image/2x/order_wl.webp | Bin 0 -> 834 bytes assets/image/3x/order_wl.webp | Bin 0 -> 1140 bytes assets/image/order_wl.webp | Bin 0 -> 630 bytes lib/home/guide_page.dart | 2 +- lib/home/welfare_exchange.dart | 7 --- lib/login/new_login_page.dart | 2 +- lib/main.dart | 6 +- lib/retrofit/data/delivery_info.dart | 6 +- lib/retrofit/data/pickup_type.dart | 42 +++++++++++++ lib/retrofit/data/store_info.dart | 6 ++ lib/settlement/settlement.dart | 5 +- .../settlement_view/distribution.dart | 58 +++++++++--------- lib/store/store_order.dart | 2 +- 13 files changed, 86 insertions(+), 50 deletions(-) create mode 100644 assets/image/2x/order_wl.webp create mode 100644 assets/image/3x/order_wl.webp create mode 100644 assets/image/order_wl.webp create mode 100644 lib/retrofit/data/pickup_type.dart diff --git a/assets/image/2x/order_wl.webp b/assets/image/2x/order_wl.webp new file mode 100644 index 0000000000000000000000000000000000000000..0aec27f5ad2e66a734f284c01d88cbcaed3ba228 GIT binary patch literal 834 zcmWIYbaS&}W?%?+bqWXzu!!JdU|=u+Voe4HSq27AXXk(uj6f~};|UPS0+h<lD=7+c zcT$Lmj8b5Kz`zKEV33$xTmWHVC4s8GU4y8-tcz6zenHNZ)Z%2Ik`F+vQUtUd=q3>$ zTO=LA)&Q}SAZ!~DyS${J1gIte#4ZX6at5+ffNYI)Bz6)KJGr0;q`n8J#wItX6l50& zfPBZ3nim=jq&a|ChM|}th{2t~3FLnu9|-anF)&zsWnf^QfDlWX$-uC^m4QLx7D7yA z0Rsbn3j@Qp^9V6Sm=q)yC4!A(0g_B<X$%aXmNPK$Mlvu6UtnP1iU!L82^?-y07}UK z-IWi7=?pmxsSFAXo(y>m$qafxmJu*g4H?XUG3?{R$iSel>A)_KFDTff<QX*Q?wh;G zKR!zC(8yS^m+^J}E$b_vPj760a)DokLB)NNi04hqGiT0R-6;FN{(i|rzPZZ3-XF-7 zcE9wkY`N_G_kycsU=CwA5v~LVmY$PTpy*koz=V_0*-Hci0z=_ot%946vW?s?>yPY~ z)r_eHc^?joKVYxV-JkW<Juj|w*G6^s^;J0q`u=-gHK#pY89p)h<ipiM@9$S+M)Dpv z_dfPfa&or&;%ycZ#WTW%XS{oN?RepaFX!?$E%&o2ynlRgp;DxXO8?b}W+uC@>VDr( z9A9#Cj!hD4t)8NM_1WBCNA^8a3HrLA|Mss?zD*fXlhXumy41X}_gtoylGGI1|6|8f zi?)03Uf9ogwV9{)#wFFe%j>=cTU?L*_we%8&ghBjzFT{J;EdGoKPEH%U)`d91_1OL B<-Gs^ literal 0 HcmV?d00001 diff --git a/assets/image/3x/order_wl.webp b/assets/image/3x/order_wl.webp new file mode 100644 index 0000000000000000000000000000000000000000..385632372e79e5883143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zWgbq<^%kQ}|~kzL+(<@%E3vm!&ej?kkS0O;(TN+4r~HWyP`FWpdiC@odH$w}d_p zs}2@wG2hC;yYp!OlVY7!=JOY?4}ErRb76pi)r}XOTUWW=IdwiI<>>a6_S(u9%e4!X E0d;G8D*ylh literal 0 HcmV?d00001 diff --git a/assets/image/order_wl.webp b/assets/image/order_wl.webp new file mode 100644 index 0000000000000000000000000000000000000000..e74f1fb71b7c2610484627c97c8f96db96dab149 GIT binary patch literal 630 zcmWIYbaTsNVqge&bqWXzu!!JdU|=u+Vi5)gJ_ZI)XXk(uj6f~};|UPS0+h<lD=7+c zcT$Lmj8b5Kz`zKEV33$xTmWHVC4s8GU4y8-tcz6zenHNZ)Z%2Ik`F+vQUtUd=q8{e z8AQ?{Yz+`Q3BtAkvCB&eN`PttK<uKBAZH*u1<2M&M`9--v6BmmK<aydYHV_IN<nsk z0LXVdsd=HnK$-)HWf+PXf*9NxoIw5u@_`_K5d(w8R|W>=2?(*InG6iuTNxN6ZXv`} z7BDdIw=ghlJC6`Ugh@eSQ6ktl79h!#md3#FX*mM}ZzKbQ@C612u4u3vkig+K1)!7+ z&|UdJn9h*HkjkLI;K`83kj$V5WElY?)sVpq7{fmGK!y4u4a@@V0)kmmo{fj!Tnw%i zT2bH-vFPWgTNfA`5>-6CzO^1r{KWsAw^L!!|E@dRa!XEUvDz~Obxu&}yt*y-_P1Nf zo<Z6V<2U|os@k+)i|J=*^~1ZTHa;vVK0dG8S}N?^&n3KTOCxrB9RGN2_e#MTS%xJU QA+I0ZSh#M<p%ab_0AP-X@c;k- literal 0 HcmV?d00001 diff --git a/lib/home/guide_page.dart b/lib/home/guide_page.dart index 55c6ea59..49a810b3 100644 --- a/lib/home/guide_page.dart +++ b/lib/home/guide_page.dart @@ -430,7 +430,7 @@ class _GuidePage extends State<GuidePage> { Container( alignment: Alignment.center, width: double.infinity, - height: 305.h, + height: 325.h, padding: EdgeInsets.only(left: 16.w, right: 16.w), decoration: new BoxDecoration( color: Colors.white, diff --git a/lib/home/welfare_exchange.dart b/lib/home/welfare_exchange.dart index b1ee3566..890ca54f 100644 --- a/lib/home/welfare_exchange.dart +++ b/lib/home/welfare_exchange.dart @@ -31,7 +31,6 @@ class WelfareExchange extends StatefulWidget { class _WelfareExchange extends State<WelfareExchange> with SingleTickerProviderStateMixin, AutomaticKeepAliveClientMixin { ApiService apiService; - final ScrollController scrollController = ScrollController(); final RefreshController refreshController = RefreshController(); int pageNum = 1; @@ -45,12 +44,6 @@ class _WelfareExchange extends State<WelfareExchange> List<GoodsCategory> gooodsCategorys = []; UserInfo userInfo; String categoryId; - var _itemText = S.current.morenpaixu; - List<String> sortString = [ - S.current.morenpaixu, - S.current.jifengaodaodi, - S.current.jifendidaogao, - ]; @override void dispose() { diff --git a/lib/login/new_login_page.dart b/lib/login/new_login_page.dart index bd3a24c9..8c99d87b 100644 --- a/lib/login/new_login_page.dart +++ b/lib/login/new_login_page.dart @@ -832,7 +832,7 @@ class _NewLoginPage extends State<NewLoginPage> { Container( alignment: Alignment.center, width: double.infinity, - height: 305.h, + height: 325.h, padding: EdgeInsets.only(left: 16.w, right: 16.w), decoration: new BoxDecoration( color: Colors.white, diff --git a/lib/main.dart b/lib/main.dart index 095a300d..26e5d430 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -199,10 +199,10 @@ class MyApp extends StatelessWidget { Locale locale; if (locales[0].countryCode == "TW") { locale = Locale.fromSubtags(languageCode: 'zh', countryCode: 'TW'); - } else if (locales[0].countryCode == "CN"){ - locale = Locale.fromSubtags(languageCode: 'zh', countryCode: 'CH'); - } else{ + } else if (locales[0].countryCode == "US"){ locale = Locale.fromSubtags(languageCode: 'en', countryCode: 'US'); + } else{ + locale = Locale.fromSubtags(languageCode: 'zh', countryCode: 'CH'); } return appLocale ?? locale; }, diff --git a/lib/retrofit/data/delivery_info.dart b/lib/retrofit/data/delivery_info.dart index 1fc09716..c58156cb 100644 --- a/lib/retrofit/data/delivery_info.dart +++ b/lib/retrofit/data/delivery_info.dart @@ -7,9 +7,8 @@ class DeliveryInfo { bool dianwodaStatus; bool meituanRegStatus; bool meituanStatus; - bool dineInTakeStatus; - DeliveryInfo({this.dadaRegStatus, this.dadaSourceId, this.dadaStatus, this.dianwodaRegStatus, this.dianwodaStatus, this.meituanRegStatus, this.meituanStatus,this.dineInTakeStatus}); + DeliveryInfo({this.dadaRegStatus, this.dadaSourceId, this.dadaStatus, this.dianwodaRegStatus, this.dianwodaStatus, this.meituanRegStatus, this.meituanStatus}); factory DeliveryInfo.fromJson(Map<String, dynamic> json) => DeliveryInfo( dadaRegStatus: json['dadaRegStatus'] as bool, @@ -19,8 +18,6 @@ class DeliveryInfo { dianwodaStatus: json['dianwodaStatus'] as bool, meituanRegStatus: json['meituanRegStatus'] as bool, meituanStatus: json['meituanStatus'] as bool, - dineInTakeStatus: json['dineInTakeStatus'] as bool, - ); Map<String, dynamic> toJson() => <String, dynamic>{ @@ -31,7 +28,6 @@ class DeliveryInfo { 'dianwodaStatus': this.dianwodaStatus, 'meituanRegStatus': this.meituanRegStatus, 'meituanStatus': this.meituanStatus, - 'dineInTakeStatus': this.dineInTakeStatus, }; } diff --git a/lib/retrofit/data/pickup_type.dart b/lib/retrofit/data/pickup_type.dart new file mode 100644 index 00000000..36a7d860 --- /dev/null +++ b/lib/retrofit/data/pickup_type.dart @@ -0,0 +1,42 @@ +/// dineInTakeStatus : true +/// takeawayStatus : null +/// expressDeliveryStatus : null + +class PickupType { + PickupType({ + bool dineInTakeStatus, + dynamic takeawayStatus, + dynamic expressDeliveryStatus,}){ + _dineInTakeStatus = dineInTakeStatus; + _takeawayStatus = takeawayStatus; + _expressDeliveryStatus = expressDeliveryStatus; +} + + PickupType.fromJson(dynamic json) { + _dineInTakeStatus = json['dineInTakeStatus']; + _takeawayStatus = json['takeawayStatus']; + _expressDeliveryStatus = json['expressDeliveryStatus']; + } + bool _dineInTakeStatus; + dynamic _takeawayStatus; + dynamic _expressDeliveryStatus; +PickupType copyWith({ bool dineInTakeStatus, + dynamic takeawayStatus, + dynamic expressDeliveryStatus, +}) => PickupType( dineInTakeStatus: dineInTakeStatus ?? _dineInTakeStatus, + takeawayStatus: takeawayStatus ?? _takeawayStatus, + expressDeliveryStatus: expressDeliveryStatus ?? _expressDeliveryStatus, +); + bool get dineInTakeStatus => _dineInTakeStatus; + dynamic get takeawayStatus => _takeawayStatus; + dynamic get expressDeliveryStatus => _expressDeliveryStatus; + + Map<String, dynamic> toJson() { + final map = <String, dynamic>{}; + map['dineInTakeStatus'] = _dineInTakeStatus; + map['takeawayStatus'] = _takeawayStatus; + map['expressDeliveryStatus'] = _expressDeliveryStatus; + return map; + } + +} \ No newline at end of file diff --git a/lib/retrofit/data/store_info.dart b/lib/retrofit/data/store_info.dart index 2f6010a3..e0db90d5 100644 --- a/lib/retrofit/data/store_info.dart +++ b/lib/retrofit/data/store_info.dart @@ -3,6 +3,7 @@ import 'package:huixiang/retrofit/data/coupon_vo.dart'; import 'package:huixiang/retrofit/data/delivery_info.dart'; import 'package:huixiang/retrofit/data/member_source.dart'; import 'package:huixiang/retrofit/data/page.dart'; +import 'package:huixiang/retrofit/data/pickup_type.dart'; import 'package:huixiang/retrofit/data/promotion.dart'; import 'package:huixiang/retrofit/data/store_type.dart'; import 'package:huixiang/retrofit/data/mini.dart'; @@ -15,6 +16,7 @@ class StoreInfo { String createTime; String createUser; DeliveryInfo deliveryInfo; + PickupType pickupType; String district; String headMobile; String tel; @@ -67,6 +69,9 @@ class StoreInfo { ..deliveryInfo = json['deliveryInfo'] == null ? null : DeliveryInfo.fromJson(json['deliveryInfo'] as Map<String, dynamic>) + ..pickupType = json['pickupType'] == null + ? null + : PickupType.fromJson(json['pickupType'] as Map<String, dynamic>) ..district = json['district'] as String ..headMobile = json['headMobile'] as String ..tel = json['tel'] as String @@ -117,6 +122,7 @@ class StoreInfo { 'createTime': this.createTime, 'createUser': this.createUser, 'deliveryInfo': this.deliveryInfo.toJson(), + 'pickupType':this.pickupType.toJson(), 'district': this.district, 'headMobile': this.headMobile, 'tel': this.tel, diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index ed738a5f..d19ca702 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -530,7 +530,7 @@ class _Settlement extends State<Settlement> { ((subscribeParam?.isEnableSubscribe ?? false) == true) ? true : false; //是否预约 - placeOrderFirst.isTakeOut = ((storeInfo?.deliveryInfo?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false) ? diningStatus : selectedBtn; + placeOrderFirst.isTakeOut = ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn!=1&&selectedBtn!=2) ? diningStatus : selectedBtn; placeOrderFirst.notes = remakers + (reservationTime ?? "") + ((subscribeParam?.isEnableSubscribe ?? false) == true @@ -835,7 +835,8 @@ class _Settlement extends State<Settlement> { height: 16.h, ), - if((storeInfo?.deliveryInfo?.dineInTakeStatus?? false) ==true && (subscribeParam?.isEnableSubscribe ?? false) == false &&settleOrderInfo !=null) + if((storeInfo?.pickupType?.dineInTakeStatus?? false) ==true && (subscribeParam?.isEnableSubscribe ?? false) == false + && selectedBtn != 1 && selectedBtn != 2&& settleOrderInfo !=null) takeStatus(), /// 预留的手机号, 可修改 diff --git a/lib/settlement/settlement_view/distribution.dart b/lib/settlement/settlement_view/distribution.dart index af54e70b..6b63cdee 100644 --- a/lib/settlement/settlement_view/distribution.dart +++ b/lib/settlement/settlement_view/distribution.dart @@ -146,21 +146,22 @@ class _DistributionMode extends State<DistributionMode> { flex: 1, child: GestureDetector( onTap: () { - // if (widget.storeInfo.storeName == "一心回乡商城") { - // SmartDialog.showToast("该功能暂未开放!", - // alignment: Alignment.center); - // return; - // } - // selectedBtn = 1; - // widget.queryAddress(selectedBtn); - SmartDialog.showToast("该功能暂未开放!", - alignment: Alignment.center); + // if (widget.storeInfo.storeName == "一心回乡商城") + if ((widget?.storeInfo?.pickupType?.takeawayStatus ?? false) == false) { + SmartDialog.showToast("该功能暂未开放!", + alignment: Alignment.center); + return; + } + selectedBtn = 1; + widget.queryAddress(selectedBtn); + // SmartDialog.showToast("该功能暂未开放!", + // alignment: Alignment.center); }, child: Container( height: 50.h, alignment: Alignment.center, child: Text( - S.of(context).waimaipeisong, + (widget?.storeInfo?.pickupType?.takeawayStatus ?? false) == false ? "" :S.of(context).waimaipeisong, style: TextStyle( fontSize: 14.sp, fontWeight: MyFontWeight.regular, @@ -174,19 +175,22 @@ class _DistributionMode extends State<DistributionMode> { flex: 1, child: GestureDetector( onTap: () { - // if (widget.storeInfo.storeName == "一心回乡商城") { - // selectedBtn = 2; - // widget.queryAddress(selectedBtn); - // return; - // } - SmartDialog.showToast("该功能暂未开放!", - alignment: Alignment.center); + // if (widget.storeInfo.storeName == "一心回乡商城") + if((widget?.storeInfo?.pickupType?.expressDeliveryStatus ?? false) == false){ + SmartDialog.showToast("该功能暂未开放!", + alignment: Alignment.center); + return; + } + selectedBtn = 2; + widget.queryAddress(selectedBtn); + // SmartDialog.showToast("该功能暂未开放!", + // alignment: Alignment.center); }, child: Container( height: 50.h, alignment: Alignment.center, child: Text( - S.of(context).kuaidiwuliu, + (widget?.storeInfo?.pickupType?.expressDeliveryStatus ?? false) == false ? "" :S.of(context).kuaidiwuliu, style: TextStyle( fontSize: 14.sp, fontWeight: MyFontWeight.regular, @@ -202,7 +206,7 @@ class _DistributionMode extends State<DistributionMode> { selectedBtn == 0 ? Container( width: double.infinity, - padding: EdgeInsets.only(left: 16, right: 16, top: 15), + padding: EdgeInsets.only(left: 16.w, right: 16.w, top: 15.h), child: Column( children: [ Row( @@ -311,7 +315,7 @@ class _DistributionMode extends State<DistributionMode> { }, child: Container( width: double.infinity, - padding: EdgeInsets.only(left: 16, right: 16, top: 15), + padding: EdgeInsets.only(left: 16.w, right: 16.w, top: 15.h), child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, @@ -320,14 +324,8 @@ class _DistributionMode extends State<DistributionMode> { mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ - (widget.storeInfo.storeName == "一心回乡商城") - ? Icon( - Icons.local_shipping, - color: Color(0xFF727272), - size: 24, - ) - : Image.asset( - "assets/image/icon_permission_location.webp", + Image.asset( + (widget.storeInfo?.pickupType?.expressDeliveryStatus ?? false == true) ? "assets/image/order_wl.webp":"assets/image/icon_permission_location.webp", height: 24.h, width: 24.w, ), @@ -342,7 +340,7 @@ class _DistributionMode extends State<DistributionMode> { ), ), SizedBox( - width: 13, + width: 13.w, ), Expanded( child: Text( @@ -380,7 +378,7 @@ class _DistributionMode extends State<DistributionMode> { ], ), Padding( - padding: EdgeInsets.only(top: 4, left: 25), + padding: EdgeInsets.only(top: 4.h, left: 25.w), child: Text( (widget?.address?.city ?? "") + (widget?.address?.area ?? "") + diff --git a/lib/store/store_order.dart b/lib/store/store_order.dart index ce36c5b9..8b7aeff7 100644 --- a/lib/store/store_order.dart +++ b/lib/store/store_order.dart @@ -700,7 +700,7 @@ class _StoreOrderPage extends State<StoreOrderPage> color: Colors.white.withAlpha(76), ), ), - autoplay: true, + autoplay: (storeInfo?.bannerList?.length ?? 0) == 0 ? false :true, duration: 1000, autoplayDelay: 2000, itemBuilder: (context, position) {