diff --git a/assets/image/2x/order_wl.webp b/assets/image/2x/order_wl.webp new file mode 100644 index 00000000..0aec27f5 Binary files /dev/null and b/assets/image/2x/order_wl.webp differ diff --git a/assets/image/3x/order_wl.webp b/assets/image/3x/order_wl.webp new file mode 100644 index 00000000..38563237 Binary files /dev/null and b/assets/image/3x/order_wl.webp differ diff --git a/assets/image/order_wl.webp b/assets/image/order_wl.webp new file mode 100644 index 00000000..e74f1fb7 Binary files /dev/null and b/assets/image/order_wl.webp differ 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) {