Browse Source

增加预约时间;

登录页更改;
增加日期选择器;
预约时间更改-预约商品直接显示立即预约-立即预约选好商品规格直接跳转结算页-结算页如果是预约商品就显示预约时间和预约店铺-下单时把预约时间,预约店铺放备注一起传过去,下单时外加(预约时间,是否是预约订单);
详情页增加下单时间;
点单页,商品详情页均增加立即预约;
new_revision_app
wurong 2 years ago
parent
commit
1d2340ec9d
  1. 2
      lib/order/edit_remarks_page.dart
  2. 5
      lib/order/order_view/order_info.dart
  3. 94
      lib/retrofit/data/findMiNiGroupList.dart
  4. 237
      lib/retrofit/data/miNiDetail.dart
  5. 5
      lib/retrofit/data/placeOrderFirst.dart
  6. 231
      lib/settlement/settlement.dart
  7. 118
      lib/settlement/settlement_view/activity_coupon_remarks.dart
  8. 32
      lib/store/shop_details_page.dart
  9. 34
      lib/store/store_order.dart
  10. 2
      lib/store/store_view/product_sku.dart
  11. 123
      lib/store/store_view/shop_goods.dart
  12. 36
      lib/store/store_view/store_order_list.dart
  13. 8
      lib/view_widget/cupertino_date_picker.dart
  14. 7
      pubspec.lock
  15. 3
      pubspec.yaml

2
lib/order/edit_remarks_page.dart

@ -214,7 +214,7 @@ class _EditRemarksPage extends State<EditRemarksPage> {
fontSize: 12.sp,
),
),
),onTap: (){addRemarksCnt("");},),
),onTap: (){addRemarksCnt("软一");},),
];
}
}

5
lib/order/order_view/order_info.dart

@ -48,6 +48,9 @@ class _OrderInfoView extends State<OrderInfoView> {
orderInfoItem(S.of(context).peisongfangshi, widget.isTakeOut == 0
? S.of(context).ziqu :(widget.orderInfo != null && widget.orderInfo.logisticsName != "") ? widget.orderInfo.logisticsName : "美团配送"),
// orderInfoItem(S.of(context).peisongfangshi,"美团配送"),
if(widget?.orderInfo?.subcribeTime != null && widget?.orderInfo?.subcribeTime != "")
orderInfoItem("预约时间",
widget.orderInfo != null ? widget.orderInfo.subcribeTime : ""),
orderInfoItem(
S.of(context).beizhuxinxi,
widget.orderInfo != null
@ -88,7 +91,7 @@ class _OrderInfoView extends State<OrderInfoView> {
margin: EdgeInsets.only(top: 8.h, bottom: 8.h),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
leftText,

94
lib/retrofit/data/findMiNiGroupList.dart

@ -102,6 +102,7 @@ class ProductListBean {
int setMeal;
String printerFlag;
dynamic markProductNone;
SubscribeParam subscribeParam;
static ProductListBean fromJson(Map<String, dynamic> map) {
if (map == null) return null;
@ -135,6 +136,7 @@ class ProductListBean {
productListBean.setMeal = map['setMeal'];
productListBean.printerFlag = map['printerFlag'];
productListBean.markProductNone = map['markProductNone'];
productListBean.subscribeParam = SubscribeParam.fromJson(map['subscribeParam']);
return productListBean;
}
@ -168,5 +170,97 @@ class ProductListBean {
"setMeal": setMeal,
"printerFlag": printerFlag,
"markProductNone": markProductNone,
"subscribeParam": subscribeParam,
};
}
/// isEnableSubscribe : true
/// dayOrDate : 3
/// startAfterDays : null
/// daysValidate : null
/// subscribeStartTime : "2023-04-20 00:00:00"
/// subscribeEndTime : "2023-04-30 00:00:00"
/// stores : ["海峡姐妹","前进麦味","百年川椒","小吃街"]
class SubscribeParam {
SubscribeParam({
bool isEnableSubscribe,
num dayOrDate,
dynamic startAfterDays,
dynamic daysValidate,
String subscribeStartTime,
String subscribeEndTime,
List<String> stores,}) {
_isEnableSubscribe = isEnableSubscribe;
_dayOrDate = dayOrDate;
_startAfterDays = startAfterDays;
_daysValidate = daysValidate;
_subscribeStartTime = subscribeStartTime;
_subscribeEndTime = subscribeEndTime;
_stores = stores;
}
SubscribeParam.fromJson(dynamic json) {
if(json == null)
return;
_isEnableSubscribe = json['isEnableSubscribe'];
_dayOrDate = json['dayOrDate'];
_startAfterDays = json['startAfterDays'];
_daysValidate = json['daysValidate'];
_subscribeStartTime = json['subscribeStartTime'];
_subscribeEndTime = json['subscribeEndTime'];
_stores = json['stores'] != null ? json['stores'].cast<String>() : [];
}
bool _isEnableSubscribe;
num _dayOrDate;
dynamic _startAfterDays;
dynamic _daysValidate;
String _subscribeStartTime;
String _subscribeEndTime;
List<String> _stores;
SubscribeParam copyWith({ bool isEnableSubscribe,
num dayOrDate,
dynamic startAfterDays,
dynamic daysValidate,
String subscribeStartTime,
String subscribeEndTime,
List<String> stores,
}) =>
SubscribeParam(
isEnableSubscribe: isEnableSubscribe ?? _isEnableSubscribe,
dayOrDate: dayOrDate ?? _dayOrDate,
startAfterDays: startAfterDays ?? _startAfterDays,
daysValidate: daysValidate ?? _daysValidate,
subscribeStartTime: subscribeStartTime ?? _subscribeStartTime,
subscribeEndTime: subscribeEndTime ?? _subscribeEndTime,
stores: stores ?? _stores,
);
bool get isEnableSubscribe => _isEnableSubscribe;
num get dayOrDate => _dayOrDate;
dynamic get startAfterDays => _startAfterDays;
dynamic get daysValidate => _daysValidate;
String get subscribeStartTime => _subscribeStartTime;
String get subscribeEndTime => _subscribeEndTime;
List<String> get stores => _stores;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['isEnableSubscribe'] = _isEnableSubscribe;
map['dayOrDate'] = _dayOrDate;
map['startAfterDays'] = _startAfterDays;
map['daysValidate'] = _daysValidate;
map['subscribeStartTime'] = _subscribeStartTime;
map['subscribeEndTime'] = _subscribeEndTime;
map['stores'] = _stores;
return map;
}
}

237
lib/retrofit/data/miNiDetail.dart

@ -86,6 +86,7 @@ class MiNiDetail {
dynamic markProductNone;
dynamic namePinyin;
dynamic nameInitials;
SubscribeParam subscribeParam;
static MiNiDetail fromJson(Map<String, dynamic> map) {
if (map == null) return null;
@ -123,16 +124,14 @@ class MiNiDetail {
miNiDetailBean.printerFlag = map['printerFlag'];
miNiDetailBean.thumbnailImg = map['thumbnailImg'];
miNiDetailBean.materialId = map['materialId'];
miNiDetailBean.imgs = []..addAll(
(map['imgs'] as List ?? []).map((o) => o.toString())
);
miNiDetailBean.imgs = []
..addAll((map['imgs'] as List ?? []).map((o) => o.toString()));
miNiDetailBean.storeDTO = StoreDTOBean.fromJson(map['storeDTO']);
miNiDetailBean.attrList = []..addAll(
(map['attrList'] as List ?? []).map((o) => AttrListBean.fromJson(o))
);
(map['attrList'] as List ?? []).map((o) => AttrListBean.fromJson(o)));
miNiDetailBean.productSkuVOList = []..addAll(
(map['productSkuVOList'] as List ?? []).map((o) => ProductSkuVOListBean.fromJson(o))
);
(map['productSkuVOList'] as List ?? [])
.map((o) => ProductSkuVOListBean.fromJson(o)));
miNiDetailBean.shipAddress = map['shipAddress'];
miNiDetailBean.buyCount = map['buyCount'];
miNiDetailBean.promotionShowVOList = map['promotionShowVOList'];
@ -141,6 +140,8 @@ class MiNiDetail {
miNiDetailBean.markProductNone = map['markProductNone'];
miNiDetailBean.namePinyin = map['namePinyin'];
miNiDetailBean.nameInitials = map['nameInitials'];
miNiDetailBean.subscribeParam =
SubscribeParam.fromJson(map['subscribeParam']);
return miNiDetailBean;
}
@ -190,6 +191,7 @@ class MiNiDetail {
"markProductNone": markProductNone,
"namePinyin": namePinyin,
"nameInitials": nameInitials,
"subscribeParam": subscribeParam,
};
}
@ -271,11 +273,11 @@ class ProductSkuVOListBean {
productSkuVOListBean.version = map['version'];
productSkuVOListBean.skuAttrCodeDTOList = map['skuAttrCodeDTOList'];
productSkuVOListBean.skuAttrList = []..addAll(
(map['skuAttrList'] as List ?? []).map((o) => SkuAttrListBean.fromJson(o))
);
(map['skuAttrList'] as List ?? [])
.map((o) => SkuAttrListBean.fromJson(o)));
productSkuVOListBean.productSetMeals = []..addAll(
(map['productSetMeals'] as List ?? []).map((o) => ProductSetMeals.fromJson(o))
);
(map['productSetMeals'] as List ?? [])
.map((o) => ProductSetMeals.fromJson(o)));
productSkuVOListBean.setMealDTOList = map['setMealDTOList'];
return productSkuVOListBean;
}
@ -371,7 +373,8 @@ class ProductSetMeals {
String groupName,
int totalNumber,
int optionalNumber,
List<ProductInfoList> productInfoList,}){
List<ProductInfoList> productInfoList,
}) {
_groupName = groupName;
_totalNumber = totalNumber;
_optionalNumber = optionalNumber;
@ -389,22 +392,31 @@ class ProductSetMeals {
});
}
}
String _groupName;
int _totalNumber;
int _optionalNumber;
List<ProductInfoList> _productInfoList;
ProductSetMeals copyWith({ String groupName,
ProductSetMeals copyWith({
String groupName,
int totalNumber,
int optionalNumber,
List<ProductInfoList> productInfoList,
}) => ProductSetMeals( groupName: groupName ?? _groupName,
}) =>
ProductSetMeals(
groupName: groupName ?? _groupName,
totalNumber: totalNumber ?? _totalNumber,
optionalNumber: optionalNumber ?? _optionalNumber,
productInfoList: productInfoList ?? _productInfoList,
);
String get groupName => _groupName;
int get totalNumber => _totalNumber;
int get optionalNumber => _optionalNumber;
List<ProductInfoList> get productInfoList => _productInfoList;
Map<String, dynamic> toJson() {
@ -417,7 +429,6 @@ class ProductSetMeals {
}
return map;
}
}
/// productId : "1372091668961951744"
@ -436,7 +447,8 @@ class ProductInfoList {
bool allSku,
List<SkuInfoList> skuInfoList,
List<ProductAttrInfoList> productAttrInfoList,
int number,}){
int number,
}) {
_productId = productId;
_productName = productName;
_productImg = productImg;
@ -465,6 +477,7 @@ class ProductInfoList {
}
_number = json['number'];
}
String _productId;
String _productName;
String _productImg;
@ -473,14 +486,18 @@ class ProductInfoList {
List<ProductAttrInfoList> _productAttrInfoList;
int _number;
int _count = 0;
ProductInfoList copyWith({ String productId,
ProductInfoList copyWith({
String productId,
String productName,
String productImg,
bool allSku,
List<SkuInfoList> skuInfoList,
List<ProductAttrInfoList> productAttrInfoList,
int number,
}) => ProductInfoList( productId: productId ?? _productId,
}) =>
ProductInfoList(
productId: productId ?? _productId,
productName: productName ?? _productName,
productImg: productImg ?? _productImg,
allSku: allSku ?? _allSku,
@ -488,11 +505,17 @@ class ProductInfoList {
productAttrInfoList: productAttrInfoList ?? _productAttrInfoList,
number: number ?? _number,
);
String get productId => _productId;
String get productName => _productName;
String get productImg => _productImg;
bool get allSku => _allSku;
List<SkuInfoList> get skuInfoList => _skuInfoList;
List<ProductAttrInfoList> get productAttrInfoList => _productAttrInfoList;
int number;
@ -502,8 +525,6 @@ class ProductInfoList {
_count = value;
}
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['productId'] = _productId;
@ -514,12 +535,12 @@ class ProductInfoList {
map['skuInfoList'] = _skuInfoList.map((v) => v.toJson()).toList();
}
if (_productAttrInfoList != null) {
map['productAttrInfoList'] = _productAttrInfoList.map((v) => v.toJson()).toList();
map['productAttrInfoList'] =
_productAttrInfoList.map((v) => v.toJson()).toList();
}
map['number'] = _number;
return map;
}
}
/// attrId : "1372091668978728960"
@ -530,7 +551,8 @@ class ProductAttrInfoList {
ProductAttrInfoList({
String attrId,
String attrName,
List<AttrValueList> attrValueList,}){
List<AttrValueList> attrValueList,
}) {
_attrId = attrId;
_attrName = attrName;
_attrValueList = attrValueList;
@ -546,21 +568,28 @@ class ProductAttrInfoList {
});
}
}
String _attrId;
String _attrName;
List<AttrValueList> _attrValueList;
String _selectSku;
ProductAttrInfoList copyWith({ String attrId,
ProductAttrInfoList copyWith({
String attrId,
String attrName,
List<AttrValueList> attrValueList,
}) => ProductAttrInfoList( attrId: attrId ?? _attrId,
}) =>
ProductAttrInfoList(
attrId: attrId ?? _attrId,
attrName: attrName ?? _attrName,
attrValueList: attrValueList ?? _attrValueList,
);
String get attrId => _attrId;
String get attrName => _attrName;
List<AttrValueList> get attrValueList => _attrValueList;
List<AttrValueList> get attrValueList => _attrValueList;
String get selectSku => _selectSku;
@ -577,7 +606,6 @@ class ProductAttrInfoList {
}
return map;
}
}
/// attrId : "1372091668987117568"
@ -588,7 +616,8 @@ class AttrValueList {
AttrValueList({
String attrId,
String attrName,
dynamic attrValueList,}){
dynamic attrValueList,
}) {
_attrId = attrId;
_attrName = attrName;
_attrValueList = attrValueList;
@ -599,18 +628,26 @@ class AttrValueList {
_attrName = json['attrName'];
_attrValueList = json['attrValueList'];
}
String _attrId;
String _attrName;
dynamic _attrValueList;
AttrValueList copyWith({ String attrId,
AttrValueList copyWith({
String attrId,
String attrName,
dynamic attrValueList,
}) => AttrValueList( attrId: attrId ?? _attrId,
}) =>
AttrValueList(
attrId: attrId ?? _attrId,
attrName: attrName ?? _attrName,
attrValueList: attrValueList ?? _attrValueList,
);
String get attrId => _attrId;
String get attrName => _attrName;
dynamic get attrValueList => _attrValueList;
Map<String, dynamic> toJson() {
@ -620,7 +657,6 @@ class AttrValueList {
map['attrValueList'] = _attrValueList;
return map;
}
}
/// id : "1372091669003894784"
@ -631,7 +667,8 @@ class SkuInfoList {
SkuInfoList({
String id,
String skuName,
List<ProductSkuAttrList> productSkuAttrList,}){
List<ProductSkuAttrList> productSkuAttrList,
}) {
_id = id;
_skuName = skuName;
_productSkuAttrList = productSkuAttrList;
@ -647,19 +684,27 @@ class SkuInfoList {
});
}
}
String _id;
String _skuName;
bool _isSelected = false;
List<ProductSkuAttrList> _productSkuAttrList;
SkuInfoList copyWith({ String id,
SkuInfoList copyWith({
String id,
String skuName,
List<ProductSkuAttrList> productSkuAttrList,
}) => SkuInfoList( id: id ?? _id,
}) =>
SkuInfoList(
id: id ?? _id,
skuName: skuName ?? _skuName,
productSkuAttrList: productSkuAttrList ?? _productSkuAttrList,
);
String get id => _id;
String get skuName => _skuName;
List<ProductSkuAttrList> get productSkuAttrList => _productSkuAttrList;
bool get isSelected => _isSelected;
@ -673,11 +718,11 @@ class SkuInfoList {
map['id'] = _id;
map['skuName'] = _skuName;
if (_productSkuAttrList != null) {
map['productSkuAttrList'] = _productSkuAttrList.map((v) => v.toJson()).toList();
map['productSkuAttrList'] =
_productSkuAttrList.map((v) => v.toJson()).toList();
}
return map;
}
}
/// id : "1372091669012283392"
@ -702,7 +747,8 @@ class ProductSkuAttrList {
String attrId,
String attrValueId,
dynamic sortOrder,
int isDelete,}){
int isDelete,
}) {
_id = id;
_createTime = createTime;
_createUser = createUser;
@ -727,6 +773,7 @@ class ProductSkuAttrList {
_sortOrder = json['sortOrder'];
_isDelete = json['isDelete'];
}
String _id;
String _createTime;
String _createUser;
@ -737,7 +784,9 @@ class ProductSkuAttrList {
String _attrValueId;
dynamic _sortOrder;
int _isDelete;
ProductSkuAttrList copyWith({ String id,
ProductSkuAttrList copyWith({
String id,
String createTime,
String createUser,
String updateTime,
@ -747,7 +796,9 @@ class ProductSkuAttrList {
String attrValueId,
dynamic sortOrder,
int isDelete,
}) => ProductSkuAttrList( id: id ?? _id,
}) =>
ProductSkuAttrList(
id: id ?? _id,
createTime: createTime ?? _createTime,
createUser: createUser ?? _createUser,
updateTime: updateTime ?? _updateTime,
@ -758,15 +809,25 @@ class ProductSkuAttrList {
sortOrder: sortOrder ?? _sortOrder,
isDelete: isDelete ?? _isDelete,
);
String get id => _id;
String get createTime => _createTime;
String get createUser => _createUser;
String get updateTime => _updateTime;
String get updateUser => _updateUser;
String get skuId => _skuId;
String get attrId => _attrId;
String get attrValueId => _attrValueId;
dynamic get sortOrder => _sortOrder;
int get isDelete => _isDelete;
Map<String, dynamic> toJson() {
@ -783,7 +844,6 @@ class ProductSkuAttrList {
map['isDelete'] = _isDelete;
return map;
}
}
/// productId : "1433994980233314304"
@ -815,9 +875,8 @@ class AttrListBean {
attrListBean.isDelete = map['isDelete'];
attrListBean.attrCode = map['attrCode'];
attrListBean.id = map['id'];
attrListBean.attrValueList = []..addAll(
(map['attrValueList'] as List ?? []).map((o) => AttrValueListBean.fromJson(o))
);
attrListBean.attrValueList = []..addAll((map['attrValueList'] as List ?? [])
.map((o) => AttrValueListBean.fromJson(o)));
return attrListBean;
}
@ -911,3 +970,95 @@ class StoreDTOBean {
"soldNum": soldNum,
};
}
/// isEnableSubscribe : true
/// dayOrDate : 3
/// startAfterDays : null
/// daysValidate : null
/// subscribeStartTime : "2023-04-20 00:00:00"
/// subscribeEndTime : "2023-04-30 00:00:00"
/// stores : ["海峡姐妹","前进麦味","百年川椒","小吃街"]
class SubscribeParam {
SubscribeParam({
bool isEnableSubscribe,
num dayOrDate,
dynamic startAfterDays,
dynamic daysValidate,
String subscribeStartTime,
String subscribeEndTime,
List<String> stores,}) {
_isEnableSubscribe = isEnableSubscribe;
_dayOrDate = dayOrDate;
_startAfterDays = startAfterDays;
_daysValidate = daysValidate;
_subscribeStartTime = subscribeStartTime;
_subscribeEndTime = subscribeEndTime;
_stores = stores;
}
SubscribeParam.fromJson(dynamic json) {
if(json == null)
return;
_isEnableSubscribe = json['isEnableSubscribe'];
_dayOrDate = json['dayOrDate'];
_startAfterDays = json['startAfterDays'];
_daysValidate = json['daysValidate'];
_subscribeStartTime = json['subscribeStartTime'];
_subscribeEndTime = json['subscribeEndTime'];
_stores = json['stores'] != null ? json['stores'].cast<String>() : [];
}
bool _isEnableSubscribe;
num _dayOrDate;
dynamic _startAfterDays;
dynamic _daysValidate;
String _subscribeStartTime;
String _subscribeEndTime;
List<String> _stores;
SubscribeParam copyWith({ bool isEnableSubscribe,
num dayOrDate,
dynamic startAfterDays,
dynamic daysValidate,
String subscribeStartTime,
String subscribeEndTime,
List<String> stores,
}) =>
SubscribeParam(
isEnableSubscribe: isEnableSubscribe ?? _isEnableSubscribe,
dayOrDate: dayOrDate ?? _dayOrDate,
startAfterDays: startAfterDays ?? _startAfterDays,
daysValidate: daysValidate ?? _daysValidate,
subscribeStartTime: subscribeStartTime ?? _subscribeStartTime,
subscribeEndTime: subscribeEndTime ?? _subscribeEndTime,
stores: stores ?? _stores,
);
bool get isEnableSubscribe => _isEnableSubscribe;
num get dayOrDate => _dayOrDate;
dynamic get startAfterDays => _startAfterDays;
dynamic get daysValidate => _daysValidate;
String get subscribeStartTime => _subscribeStartTime;
String get subscribeEndTime => _subscribeEndTime;
List<String> get stores => _stores;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['isEnableSubscribe'] = _isEnableSubscribe;
map['dayOrDate'] = _dayOrDate;
map['startAfterDays'] = _startAfterDays;
map['daysValidate'] = _daysValidate;
map['subscribeStartTime'] = _subscribeStartTime;
map['subscribeEndTime'] = _subscribeEndTime;
map['stores'] = _stores;
return map;
}
}

5
lib/retrofit/data/placeOrderFirst.dart

@ -119,6 +119,7 @@ class PromotionInfoDTOBean {
String couponId;
String promotionId;
bool useVipPrice;
bool useBenefit;
PromotionInfoDTOBean({this.couponId, this.promotionId,this.useVipPrice});
@ -128,12 +129,14 @@ class PromotionInfoDTOBean {
promotionInfoDTOBean.couponId = json['couponId'];
promotionInfoDTOBean.promotionId = json['promotionId'];
promotionInfoDTOBean.useVipPrice = json['useVipPrice'];
promotionInfoDTOBean.useBenefit = json['useBenefit'];
return promotionInfoDTOBean;
}
Map<String, dynamic> toJson() => {
"couponId": couponId,
"promotionId": promotionId,
"useVipPrice":useVipPrice
"useVipPrice":useVipPrice,
"useBenefit": useBenefit,
};
}

231
lib/settlement/settlement.dart

@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart';
import 'package:flutter_baidu_mapapi_utils/flutter_baidu_mapapi_utils.dart';
import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:fluwx/fluwx.dart';
@ -33,9 +34,11 @@ import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/utils/min.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:intl/intl.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../retrofit/data/miNiDetail.dart';
import '../retrofit/data/shoppingCart.dart';
import '../view_widget/settlement_tips_dialog.dart';
@ -85,6 +88,11 @@ class _Settlement extends State<Settlement> {
bool showVipTips = false;
bool isRaiseChannel = false;
ShoppingCart shopCarGoods;
SubscribeParam subscribeParam;
String reservationTime;
String subscribeStoresName;
String subTime;
int storesIndex = 0;
@override
void initState() {
@ -108,7 +116,7 @@ class _Settlement extends State<Settlement> {
count1 = widget.arguments["buyNum"];
productId = widget.arguments["productId"];
shopCarGoods = widget.arguments["shoppingCart"];
subscribeParam = widget?.arguments["subscribeParam"] ?? null;
if (tableId == 0) {
placeOrder = true;
}
@ -122,8 +130,7 @@ class _Settlement extends State<Settlement> {
token: minToken,
tenant: tenant,
storeId: storeId,
showLoading: false
);
showLoading: false);
queryMemberInfo();
if (promotions != null && promotions != "" && tableId <= 0) {
queryOrderInfo(
@ -492,16 +499,25 @@ class _Settlement extends State<Settlement> {
placeOrderFirst.cartNum = settleOrderInfo.orderNum;
placeOrderFirst.cartSum = settleOrderInfo.price;
placeOrderFirst.addressId = address == null ? null : address.id;
placeOrderFirst.isSubscribe = false;
placeOrderFirst.isSubscribe =
((subscribeParam?.isEnableSubscribe ?? false) == true)
? true
: false; //
placeOrderFirst.isTakeOut = selectedBtn;
placeOrderFirst.notes = remakers;
placeOrderFirst.notes = remakers +
(reservationTime ?? "") +
(subscribeParam == null
? ""
: "预约门店:${((subscribeParam?.stores?.length ?? 0) == 1 ? (subscribeParam.stores[0]) : (subscribeStoresName ?? ""))}");
placeOrderFirst.numberOfPeople = "$numberOfPeople";
placeOrderFirst.orderSource = 2;
placeOrderFirst.orderType = "0";
placeOrderFirst.orderTypeId = 0;
placeOrderFirst.parentCode = parentCode; //
placeOrderFirst.parentId = parentId; //
placeOrderFirst.payChannel = ((placeOrderFirst.cartSum == "0.00") ? payChannel = 0 : (settleOrderInfo.isRaise ? 7:payChannel));
placeOrderFirst.payChannel = ((placeOrderFirst.cartSum == "0.00")
? payChannel = 0
: (settleOrderInfo.isRaise ? 7 : payChannel));
placeOrderFirst.promotionInfoDTO = PromotionInfoDTOBean();
placeOrderFirst.promotionInfoDTO.promotionId =
(promotion != null && tableId <= 0) ? promotion.id : "";
@ -510,16 +526,18 @@ class _Settlement extends State<Settlement> {
(couponListBean != null && tableId <= 0) ? couponListBean.id : "";
// : widget.arguments["cid"] ?? "";
placeOrderFirst.promotionInfoDTO.useVipPrice = useVipPriceSelect;
// placeOrderFirst.promotionInfoDTO.useBenefit = false;
placeOrderFirst.recMobile =
(mobile == null || mobile == "") ? mobile : storeInfo.headMobile;
placeOrderFirst.shoppingCartSkuItemList = settleOrderInfo.orderProductList;
placeOrderFirst.skuItemDTOList = [];
placeOrderFirst.source = 1;
placeOrderFirst.storeId = storeInfo.id;
placeOrderFirst.subcribeTime = null;
placeOrderFirst.subcribeTime = subTime ?? ""; //
placeOrderFirst.tableId = "$tableId";
for (int i = 0; i < shopCarGoods.shoppingCartSkuItemList.length; i++) {
placeOrderFirst.shoppingCartSkuItemList[i].setMealDataList = shopCarGoods.shoppingCartSkuItemList[i].setMealDataList;
placeOrderFirst.shoppingCartSkuItemList[i].setMealDataList =
shopCarGoods.shoppingCartSkuItemList[i].setMealDataList;
}
if (tableId == 0) {
@ -759,8 +777,8 @@ class _Settlement extends State<Settlement> {
child: Container(
child: Column(
children: [
DistributionMode((addressId, isTake, memberCouponId,
orderId, promotionId) {
DistributionMode((addressId, isTake,
memberCouponId, orderId, promotionId) {
setState(() {
this.selectedBtn = 0;
});
@ -777,8 +795,13 @@ class _Settlement extends State<Settlement> {
count1,
payChannel,
tableId ?? 0);
}, queryAddress, storeInfo, address,
selectedAddress, pageType,widget.arguments["distance"]),
},
queryAddress,
storeInfo,
address,
selectedAddress,
pageType,
widget.arguments["distance"]),
SizedBox(
height: 16,
@ -791,19 +814,22 @@ class _Settlement extends State<Settlement> {
// ),
///
if(settleOrderInfo != null || minOrderInfo != null)
if (settleOrderInfo != null ||
minOrderInfo != null)
SettlementOrderCommodity(
selectedBtn,
settleOrderInfo,
minOrderInfo,
tableId,
pageType,
(coupons != "" || promotions!="") ? false :useVipPriceSelect,
this.showVipTips
),
(coupons != "" || promotions != "")
? false
: useVipPriceSelect,
this.showVipTips),
/////
if(settleOrderInfo != null || minOrderInfo != null)
if (settleOrderInfo != null ||
minOrderInfo != null)
ActivityCouponRemarks(
couponCart,
activityCart,
@ -817,24 +843,35 @@ class _Settlement extends State<Settlement> {
() {
Navigator.of(context).pushNamed(
'/router/edit_remarks_page',
arguments: {"remake":remakers}
).then((value) => {
arguments: {
"remake": remakers
}).then((value) => {
setState(() {
if (value != null) remakers = value;
})
});},
});
},
tableId,
vipPriceSelect,
() {
setState(() {
this.showVipTips = true;
});
}
},
subscribeParam,
showDateSelector,
reservationTime,
showAlertDialog,
subscribeStoresName,
),
if (settleOrderInfo != null && placeOrder && joinA != JoinActivity.BargainBug)
if (settleOrderInfo != null &&
placeOrder &&
joinA != JoinActivity.BargainBug)
///
PayMethod(payChannelCheck,coupons,promotions,useVipPriceSelect,settleOrderInfo),
PayMethod(payChannelCheck, coupons, promotions,
useVipPriceSelect, settleOrderInfo),
],
),
),
@ -902,6 +939,17 @@ class _Settlement extends State<Settlement> {
// return;
// } else
// orderButton = true;
if (subscribeParam != null && ((subscribeParam.isEnableSubscribe ?? false) ==
true) &&
(reservationTime == null ||
subscribeStoresName == null)) {
SmartDialog.showToast(
(reservationTime == null)
? "请选择预约时间"
: "请选择预约门店",
alignment: Alignment.center);
return;
}
pageType != null
? bargainOrderId != null
? activityPay()
@ -943,8 +991,8 @@ class _Settlement extends State<Settlement> {
useVipPriceSelect,
count1,
payChannel,
tableId);}
tableId);
}
}
vipPriceSelect(bool useVipPriceSelect) {
@ -964,7 +1012,8 @@ class _Settlement extends State<Settlement> {
useVipPriceSelect,
count1,
payChannel,
tableId);}
tableId);
}
}
mobileChange(String mobile) {
@ -1004,10 +1053,8 @@ class _Settlement extends State<Settlement> {
// promotions = "";
// this.promotion = null;
if (tableId > 0) {
if(couponBean == null)
queryCancelMemberCoupon(parentId);
if (couponBean.id != null)
queryUseMemberCoupon(couponBean.id);
if (couponBean == null) queryCancelMemberCoupon(parentId);
if (couponBean.id != null) queryUseMemberCoupon(couponBean.id);
} else {
queryOrderInfo(
address?.id,
@ -1056,5 +1103,127 @@ class _Settlement extends State<Settlement> {
payChannel,
tableId);
}
// }
///
showDateSelector() {
var minTime = DateTime.now().isAfter(
DateTime.tryParse(subscribeParam?.subscribeStartTime ?? ""))
? DateTime.now()
: DateTime.tryParse(subscribeParam?.subscribeStartTime ?? "");
DatePicker.showDateTimePicker(context,
showTitleActions: true,
minTime: minTime,
maxTime: DateTime.tryParse(subscribeParam?.subscribeEndTime ?? ""),
theme: DatePickerTheme(
headerColor: Colors.white,
backgroundColor: Colors.white,
itemStyle: TextStyle(
color: Colors.black,
fontWeight: MyFontWeight.bold,
fontSize: 18),
doneStyle: TextStyle(color: Color(0xFF32A060), fontSize: 16.sp)),
onChanged: (date) {
print('change $date in time zone ' +
date.timeZoneOffset.inHours.toString());
}, onConfirm: (date) {
reservationTime = date.toString().substring(0, 16);
subTime = date.toString().substring(0, 19);
setState(() {});
}, currentTime: minTime, locale: LocaleType.zh);
}
///
showAlertDialog() {
showModalBottomSheet(
builder: (BuildContext context) {
return StatefulBuilder(builder: (
context,
state,
) {
return Container(
width: double.infinity,
height: 270.h,
padding: EdgeInsets.symmetric(horizontal: 14.w, vertical: 16.h),
decoration: new BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
topRight: Radius.circular(8),
),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding:
EdgeInsets.symmetric(vertical: 10.h, horizontal: 14.w),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Text(
S.of(context).quxiao,
style:
TextStyle(fontSize: 18.sp, color: Colors.black),
),
),
GestureDetector(
onTap: () {
setState(() {
subscribeStoresName =
subscribeParam.stores[storesIndex];
});
Navigator.of(context).pop();
},
child: Text(
S.of(context).queding,
style: TextStyle(
fontSize: 18.sp, color: Color(0xFF32A060)),
),
)
],
),
),
Expanded(
child: ListView.builder(
itemCount: subscribeParam.stores.length ?? 0,
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
state(() {
storesIndex = position;
});
},
child: storesNameItem(position),
);
}),
),
],
),
);
});
},
backgroundColor: Colors.transparent,
context: context);
}
Widget storesNameItem(index) {
return Container(
width: double.infinity,
padding: EdgeInsets.symmetric(vertical: 10.h),
alignment: Alignment.center,
child: Text(
subscribeParam.stores[index],
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 16.sp,
color: storesIndex == index ? Color(0xFF32A060) : Colors.black,
),
),
);
}
}

118
lib/settlement/settlement_view/activity_coupon_remarks.dart

@ -2,15 +2,13 @@ import 'dart:io';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/min_order_info.dart';
import 'package:huixiang/retrofit/data/settleOrderInfo.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:intl/intl.dart';
import '../../view_widget/cupertino_date_picker.dart';
import '../../retrofit/data/miNiDetail.dart';
class ActivityCouponRemarks extends StatefulWidget {
final Function() couponCart;
@ -27,6 +25,11 @@ class ActivityCouponRemarks extends StatefulWidget {
final int tableId;
final Function(bool useVipPriceSelect) vipPriceSelect;
final Function showVipTips;
final SubscribeParam subscribeParam;
final Function() showDateSelector;
final String reservationTime;
final Function() showAlertDialog;
final String subscribeStoresName;
ActivityCouponRemarks(
this.couponCart,
@ -41,7 +44,12 @@ class ActivityCouponRemarks extends StatefulWidget {
this.editRemark,
this.tableId,
this.vipPriceSelect,
this.showVipTips);
this.showVipTips,
this.subscribeParam,
this.showDateSelector,
this.reservationTime,
this.showAlertDialog,
this.subscribeStoresName);
@override
State<StatefulWidget> createState() {
@ -79,7 +87,9 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
if( !(widget?.settleOrderInfo?.isRaise ?? false) && (widget?.settleOrderInfo?.memberVO?.isVip ?? false) && widget.placeOrder)
if (!(widget?.settleOrderInfo?.isRaise ?? false) &&
(widget?.settleOrderInfo?.memberVO?.isVip ?? false) &&
widget.placeOrder)
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
@ -95,14 +105,20 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
),
),
),
Platform.isAndroid ?
Switch.adaptive(
value: (widget.coupons != null && widget.coupons != ""||widget.promotions != null && widget.promotions != "") ? false:vipSelect,
Platform.isAndroid
? Switch.adaptive(
value:
(widget.coupons != null && widget.coupons != "" ||
widget.promotions != null &&
widget.promotions != "")
? false
: vipSelect,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
activeColor: Color(0xff32A060),
onChanged: (bool value) {
setState(() {
if((widget?.settleOrderInfo?.memberVO?.isVip ?? false)){
if ((widget?.settleOrderInfo?.memberVO?.isVip ??
false)) {
vipSelect = !vipSelect;
widget.vipPriceSelect(vipSelect);
} else {
@ -111,11 +127,12 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
}
});
},
):
GestureDetector(
)
: GestureDetector(
onTap: () {
setState(() {
if ((widget?.settleOrderInfo?.memberVO?.isVip ?? false)) {
if ((widget?.settleOrderInfo?.memberVO?.isVip ??
false)) {
vipSelect = !vipSelect;
widget.vipPriceSelect(vipSelect);
} else {
@ -128,7 +145,11 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
padding: EdgeInsets.only(bottom: 18.w),
alignment: Alignment.center,
child: Image.asset(
((widget.coupons != null && widget.coupons != ""||widget.promotions != null && widget.promotions != "") ? false:vipSelect)
((widget.coupons != null && widget.coupons != "" ||
widget.promotions != null &&
widget.promotions != "")
? false
: vipSelect)
? "assets/image/vip_price.webp"
: "assets/image/vip_unprice.webp",
width: 38.w,
@ -170,7 +191,9 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
],
),
),
if (widget.placeOrder && widget.tableId <= 0 && !(widget?.settleOrderInfo?.isRaise ?? false))
if (widget.placeOrder &&
widget.tableId <= 0 &&
!(widget?.settleOrderInfo?.isRaise ?? false))
InkWell(
onTap: () {
widget.activityCart();
@ -287,13 +310,14 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
],
),
),
if ((widget.subscribeParam?.isEnableSubscribe ?? false) == true)
SizedBox(
height: 13,
),
if ((widget.subscribeParam?.isEnableSubscribe ?? false) == true)
InkWell(
onTap: () {
showDateSelector();
widget.showDateSelector();
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
@ -312,7 +336,53 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
),
Expanded(
child: Text(
"请选择时间",
widget.reservationTime ?? "请选择时间",
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF858585),
fontWeight: MyFontWeight.medium,
),
),
),
Icon(
Icons.keyboard_arrow_right,
size: 16,
),
],
),
),
if ((widget.subscribeParam?.isEnableSubscribe ?? false) == true)
SizedBox(
height: 13,
),
if ((widget.subscribeParam?.isEnableSubscribe ?? false) == true)
InkWell(
onTap: () {
if (widget.subscribeParam.stores.length > 1)
widget.showAlertDialog();
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
flex: 1,
child: Text(
"预约店铺",
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 14.sp,
color: Color(0xFF353535),
),
),
),
Expanded(
child: Text(
((widget.subscribeParam.stores.length == 1)
? widget?.subscribeParam?.stores[0]
: widget.subscribeStoresName) ??
"请选择店铺",
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 14.sp,
@ -333,20 +403,6 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
);
}
///
showDateSelector() async {
DateTime dateTime = await showModalBottomSheet(
backgroundColor: Colors.transparent,
context: context,
builder: (_) {
return CupertinoDatePickerWidget();
});
if (dateTime != null) {
String time = DateFormat("yyyy-MM-dd").format(dateTime) ;
setState(() {});
}
}
String activityText() {
String promotion = "";
if (widget.promotions == null || widget.promotions == "") {

32
lib/store/shop_details_page.dart

@ -264,8 +264,16 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
"cid": cid,
"shoppingCart": shopCarGoods,
"numberOfPeople": numberOfPeople,
"distance": widget.arguments["distance"],
"subscribeParam": miNiDetail?.subscribeParam,
},
);
if ((miNiDetail?.subscribeParam?.isEnableSubscribe ?? false) == true) {
clearShopCar();
this.shopCarGoods = await queryShopCar();
}
if (tableId > 0) {
getParentInfo();
}
@ -365,6 +373,10 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
.replaceAll("]", "")
.replaceAll(",", "");
if ((miNiDetail.subscribeParam.isEnableSubscribe ?? false) == true) {
clearShopCar();
}
if (miNiDetail != null) {
BaseData<List<ShoppingCart>> baseDate = await minService.addShoppingCart({
"storeId": storeInfo.id,
@ -391,6 +403,8 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
if (baseDate != null && baseDate.isSuccess) {
queryShopCar().then((value) {
this.shopCarGoods = value;
if ((miNiDetail.subscribeParam.isEnableSubscribe ?? false) == true)
toDownOrder();
setState(() {});
});
} else {
@ -831,7 +845,8 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
)),
GestureDetector(
onTap: () {
if(storeInfo.posType.code == "NORMALSTORE" && tableId == 0){
if (storeInfo.posType.code == "NORMALSTORE" &&
tableId == 0) {
showDeleteDialog();
} else {
_queryMiNiDetail(id, counts);
@ -859,7 +874,11 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
width: 2,
),
Text(
"加入购物车",
((miNiDetail?.subscribeParam?.isEnableSubscribe ??
false) ==
true)
? "立即预约"
: "加入购物车",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
@ -1097,8 +1116,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
Icons.remove,
color: Color(0xFF32A060),
size: 24,
)
),
)),
Padding(
padding: EdgeInsets.only(left: 8, right: 8),
child: Text(
@ -1132,7 +1150,11 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
RoundButton(
width: double.infinity,
height: 54.h,
text: "加入购物车",
text: ((miNiDetail?.subscribeParam?.isEnableSubscribe ??
false) ==
true)
? "立即预约"
: "加入购物车",
textColor: Colors.white,
fontWeight: MyFontWeight.semi_bold,
radius: 27,

34
lib/store/store_order.dart

@ -34,6 +34,7 @@ import 'package:permission_handler/permission_handler.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../settlement/settlement.dart';
import '../view_widget/border_text.dart';
import '../view_widget/request_permission.dart';
@ -66,6 +67,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
String tenant = "";
String storeId = "";
int numberOfPeople = 0;
MiNiDetail miNiDetail;
///token
String minToken;
@ -426,6 +428,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
];
},
body:
///
TabBarView(
physics: NeverScrollableScrollPhysics(),
@ -515,12 +518,19 @@ class _StoreOrderPage extends State<StoreOrderPage>
Spacer(),
GestureDetector(
onTap: () {
if(AppUtils.compareTime(storeInfo.openStartTime,DateFormat('HH:mm:ss').format(DateTime.now()))
&&(!AppUtils.compareTime(storeInfo.openEndTime,DateFormat('HH:mm:ss').format(DateTime.now())))){
if (AppUtils.compareTime(
storeInfo.openStartTime,
DateFormat('HH:mm:ss')
.format(DateTime.now())) &&
(!AppUtils.compareTime(
storeInfo.openEndTime,
DateFormat('HH:mm:ss')
.format(DateTime.now())))) {
toDownOrder();
}
else
SmartDialog.showToast("营业时间:${storeInfo.openStartTime}-${storeInfo.openEndTime}", alignment: Alignment.center);
} else
SmartDialog.showToast(
"营业时间:${storeInfo.openStartTime}-${storeInfo.openEndTime}",
alignment: Alignment.center);
},
child: RoundButton(
width: 103.w,
@ -650,8 +660,15 @@ class _StoreOrderPage extends State<StoreOrderPage>
"shoppingCart": shopCarGoods,
"numberOfPeople": numberOfPeople,
"distance": widget.arguments["distance"],
"subscribeParam": miNiDetail?.subscribeParam,
},
);
if ((miNiDetail?.subscribeParam?.isEnableSubscribe ?? false) == true) {
clearShopCar();
this.shopCarGoods = await queryShopCar();
}
if (tableId > 0) {
getParentInfo();
}
@ -752,6 +769,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
BaseData<MiNiDetail> baseData = await minService.miNiDetail(id);
EasyLoading.dismiss();
if (baseData != null && baseData.isSuccess) {
miNiDetail = baseData.data;
showStoreSelector(baseData.data, id, count);
}
}
@ -804,6 +822,10 @@ class _StoreOrderPage extends State<StoreOrderPage>
.replaceAll("]", "")
.replaceAll(",", "");
if ((miNiDetail.subscribeParam.isEnableSubscribe ?? false) == true) {
clearShopCar();
}
if (miNiDetail != null) {
BaseData<List<ShoppingCart>> baseDate = await minService.addShoppingCart({
"storeId": storeInfo.id,
@ -829,6 +851,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
// EasyLoading.dismiss();
if (baseDate != null && baseDate.isSuccess) {
this.shopCarGoods = await queryShopCar();
if ((miNiDetail.subscribeParam.isEnableSubscribe ?? false) == true)
toDownOrder();
setState(() {});
} else {
SmartDialog.showToast(baseDate?.msg, alignment: Alignment.center);

2
lib/store/store_view/product_sku.dart

@ -292,7 +292,7 @@ class _ProductSku extends State<ProductSku> {
RoundButton(
width: double.infinity,
height: 54.h,
text: "加入购物车",
text: (widget?.miNiDetail?.subscribeParam?.isEnableSubscribe ?? false) == true ? "立即预约":"加入购物车",
textColor: Colors.white,
fontWeight: MyFontWeight.semi_bold,
radius: 27,

123
lib/store/store_view/shop_goods.dart

@ -42,7 +42,7 @@ class ShopGoods extends StatefulWidget {
this.queryShoppingCart,
this.queryMiNiDetail,
this.shoppingCartSkuItemListBean,
this.storeInfo
this.storeInfo,
});
@override
@ -51,9 +51,9 @@ class ShopGoods extends StatefulWidget {
}
}
class _ShopGoods extends State<ShopGoods> {
int _jumpType = -1;
MiNiDetail miNiDetail;
///
queryMiNiDetail(id) async {
@ -62,16 +62,18 @@ class _ShopGoods extends State<ShopGoods> {
String minToken = value.getString("minToken");
String tenant = value.getString("tenant");
String storeId = value.getString("storeId");
minService = MinApiService(Dio(),
minService = MinApiService(
Dio(),
context: context,
token: minToken,
tenant: tenant,
storeId: storeId,);
storeId: storeId,
);
});
BaseData<MiNiDetail> baseData =
await minService.miNiDetail(id).catchError((error) {
});
await minService.miNiDetail(id).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
miNiDetail = baseData.data;
if (baseData.data.productSkuVOList[0].productSetMeals.length == 0) {
_jumpType = 0;
widget.add(widget.shoppingCartSkuItemListBean);
@ -125,7 +127,8 @@ class _ShopGoods extends State<ShopGoods> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(padding: EdgeInsets.only(right: 16.w),
Padding(
padding: EdgeInsets.only(right: 16.w),
child: Row(
children: [
Expanded(
@ -157,18 +160,21 @@ class _ShopGoods extends State<ShopGoods> {
// ),
// ),
],
),),
),
),
SizedBox(
height: 2.h,
),
Padding(padding: EdgeInsets.only(right: 16.w),
Padding(
padding: EdgeInsets.only(right: 16.w),
child: Row(
children: [
Expanded(
child: Text(
(widget.productListBean != null
? widget.productListBean.shortName
: widget.shoppingCartSkuItemListBean.skuName ?? ""),
: widget.shoppingCartSkuItemListBean.skuName ??
""),
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
@ -223,11 +229,16 @@ class _ShopGoods extends State<ShopGoods> {
],
),
if (!widget.isShopCart &&
(widget.productListBean?.attrStyle ?? 0) == 1)
(widget.productListBean?.attrStyle ?? 0) == 1 &&
!(widget?.productListBean?.subscribeParam
?.isEnableSubscribe ??
false))
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () async {
if(widget.storeInfo.posType.code == "NORMALSTORE"&& widget.tableId == 0){
if (widget.storeInfo.posType.code ==
"NORMALSTORE" &&
widget.tableId == 0) {
showDeleteDialog();
} else {
widget.queryMiNiDetail(
@ -243,7 +254,11 @@ class _ShopGoods extends State<ShopGoods> {
child: Stack(
children: [
Container(
padding: EdgeInsets.only(left:35.w,top: 4.h,bottom: 4.h,),
padding: EdgeInsets.only(
left: 35.w,
top: 4.h,
bottom: 4.h,
),
margin: EdgeInsets.only(right: 8, top: 4),
child: RoundButton(
text: S.of(context).xuanguige,
@ -252,7 +267,8 @@ class _ShopGoods extends State<ShopGoods> {
radius: 3,
backgroup: Color(0xFF32A060),
fontSize: 11.sp,
padding: EdgeInsets.symmetric(vertical: 5.h,horizontal: 3.w),
padding: EdgeInsets.symmetric(
vertical: 5.h, horizontal: 3.w),
),
),
Positioned(
@ -272,19 +288,28 @@ class _ShopGoods extends State<ShopGoods> {
),
),
],
),)),
),
)),
if (widget.isShopCart ||
(widget.productListBean?.attrStyle ?? 0) == 0)
(widget.productListBean?.attrStyle ?? 0) == 0 &&
!(widget?.productListBean?.subscribeParam
?.isEnableSubscribe ??
false))
Spacer(),
if (widget.isShopCart ||
(widget.productListBean?.attrStyle ?? 0) == 0)
(widget.productListBean?.attrStyle ?? 0) == 0 &&
!(widget?.productListBean?.subscribeParam
?.isEnableSubscribe ??
false))
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () async {
if(widget.storeInfo.posType.code == "NORMALSTORE" && widget.tableId == 0){
if (widget.storeInfo.posType.code == "NORMALSTORE" &&
widget.tableId == 0) {
showDeleteDialog();
} else {
widget.reduce(widget.shoppingCartSkuItemListBean);}
widget.reduce(widget.shoppingCartSkuItemListBean);
}
},
child: Container(
padding: EdgeInsets.only(left: 15.w, right: 6.w),
@ -296,7 +321,10 @@ class _ShopGoods extends State<ShopGoods> {
),
),
if (widget.isShopCart ||
(widget.productListBean?.attrStyle ?? 0) == 0)
(widget.productListBean?.attrStyle ?? 0) == 0 &&
!(widget?.productListBean?.subscribeParam
?.isEnableSubscribe ??
false))
Container(
alignment: Alignment.center,
child: Text(
@ -309,11 +337,15 @@ class _ShopGoods extends State<ShopGoods> {
),
),
if (widget.isShopCart ||
(widget.productListBean?.attrStyle ?? 0) == 0)
(widget.productListBean?.attrStyle ?? 0) == 0 &&
!(widget?.productListBean?.subscribeParam
?.isEnableSubscribe ??
false))
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () async {
if(widget.storeInfo.posType.code == "NORMALSTORE" && widget.tableId == 0){
if (widget.storeInfo.posType.code == "NORMALSTORE" &&
widget.tableId == 0) {
showDeleteDialog();
} else {
if (_jumpType == -1)
@ -321,8 +353,9 @@ class _ShopGoods extends State<ShopGoods> {
else if (_jumpType == 0)
widget.add(widget.shoppingCartSkuItemListBean);
else if (_jumpType == 1)
await Navigator.of(context)
.pushNamed('/router/product_meals_sku', arguments: {
await Navigator.of(context).pushNamed(
'/router/product_meals_sku',
arguments: {
"id": widget.productListBean.id,
"storeId": widget.productListBean.storeId,
"tableId": widget.tableId
@ -339,6 +372,47 @@ class _ShopGoods extends State<ShopGoods> {
),
),
),
if ((widget.productListBean.subscribeParam
.isEnableSubscribe ??
false) ==
true)
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () async {
if (widget.storeInfo.posType.code ==
"NORMALSTORE" &&
widget.tableId == 0) {
showDeleteDialog();
} else if (widget.isShopCart ||
(widget.productListBean?.attrStyle ?? 0) == 0) {
queryMiNiDetail(widget.productListBean.id);
} else {
widget.queryMiNiDetail(
widget.productListBean != null
? widget.productListBean.id
: widget.shoppingCartSkuItemListBean
.productId,
0);
}
},
child: Container(
padding: EdgeInsets.only(
left: 35.w,
top: 4.h,
bottom: 4.h,
),
margin: EdgeInsets.only(right: 8, top: 4),
child: RoundButton(
text: "立即预约",
textColor: Colors.white,
fontWeight: MyFontWeight.medium,
radius: 3,
backgroup: Color(0xFF32A060),
fontSize: 11.sp,
padding: EdgeInsets.symmetric(
vertical: 5.h, horizontal: 3.w),
),
)),
],
),
SizedBox(
@ -512,5 +586,4 @@ class _ShopGoods extends State<ShopGoods> {
await Permission.camera.request();
}
}
}

36
lib/store/store_view/store_order_list.dart

@ -39,8 +39,7 @@ class StoreOrderListPage extends StatefulWidget {
this.tableId,
this.queryMiNiDetail,
this.queryShoppingCart,
this.scrollPhysics
);
this.scrollPhysics);
@override
State<StatefulWidget> createState() {
@ -88,14 +87,14 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
token: widget.minToken,
tenant: widget.tenant,
storeId: widget.arguments["id"],
showLoading: true
);
showLoading: true);
BaseData<List<FindMiNiGroupList>> baseData =
await minService.findMiNiGroupList({
"id": widget.arguments["id"],
}).catchError((error) {
// refreshController.refreshFailed();
debugPrint(error);
});
if (baseData != null && baseData.isSuccess) {
// refreshController.refreshCompleted();
@ -139,8 +138,7 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
padding: EdgeInsets.only(top: 0, bottom: 25.h),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
},
onTap: () {},
child: orderItem(position),
);
},
@ -227,7 +225,8 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
color: Color(0xFF32A060),
margin: EdgeInsets.only(right: 10.w),
),
Expanded(child:Text(
Expanded(
child: Text(
appletProducts[index].groupName,
textAlign: TextAlign.center,
style: TextStyle(
@ -236,7 +235,8 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
: Color(0xFF000000),
fontSize: 12.sp,
fontWeight: currentIndex != index
? MyFontWeight.medium : MyFontWeight.semi_bold ,
? MyFontWeight.medium
: MyFontWeight.semi_bold,
),
)),
],
@ -267,7 +267,12 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
Widget rightOrderItem(int rightIndex) {
return Container(
color: Colors.white,
margin: EdgeInsets.only(bottom: (rightIndex == appletProducts.length -1)?(_viewportDimension > appletProducts[rightIndex].height?_viewportDimension-appletProducts[rightIndex].height:30.h):0),
margin: EdgeInsets.only(
bottom: (rightIndex == appletProducts.length - 1)
? (_viewportDimension > appletProducts[rightIndex].height
? _viewportDimension - appletProducts[rightIndex].height
: 30.h)
: 0),
padding: EdgeInsets.only(
right: 16.w,
),
@ -275,8 +280,9 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 50.h,child:
Padding(
SizedBox(
height: 50.h,
child: Padding(
padding: EdgeInsets.only(left: 16.w, top: 10.h),
child: Text(
appletProducts[rightIndex].groupName,
@ -287,13 +293,13 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
fontWeight: MyFontWeight.semi_bold,
),
),
),),
),
),
Column(
children: appletProducts[rightIndex].productList.map((e) {
return GestureDetector(
onTap: () {
if (widget.storeInfo.posType.code ==
"NORMALSTORE")
if (widget.storeInfo.posType.code == "NORMALSTORE")
return;
else
goShopDetailsPage(e);
@ -350,7 +356,7 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
queryShoppingCart: widget.queryShoppingCart,
queryMiNiDetail: widget.queryMiNiDetail,
shoppingCartSkuItemListBean: shoppingCartSkuItemListBean,
storeInfo:widget.storeInfo
storeInfo: widget.storeInfo,
);
}
}

8
lib/view_widget/cupertino_date_picker.dart

@ -5,7 +5,9 @@ import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/utils/font_weight.dart';
class CupertinoDatePickerWidget extends StatelessWidget {
final DateTime minimumDate;
final DateTime maximumDate;
CupertinoDatePickerWidget({this.minimumDate,this.maximumDate});
@override
Widget build(BuildContext context) {
@ -72,8 +74,8 @@ class CupertinoDatePickerWidget extends StatelessWidget {
mode: CupertinoDatePickerMode.date,
backgroundColor: Colors.white,
initialDateTime: DateTime.now(),
minimumDate: DateTime(1900),
maximumDate: DateTime.now(),
minimumDate: minimumDate ?? DateTime(1900),
maximumDate: maximumDate ?? DateTime.now(),
onDateTimeChanged: (data) {
dateTime = data;
},

7
pubspec.lock

@ -202,6 +202,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.2.1"
flutter_datetime_picker:
dependency: "direct main"
description:
name: flutter_datetime_picker
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.5.1"
flutter_easyloading:
dependency: "direct main"
description:

3
pubspec.yaml

@ -105,6 +105,9 @@ dependencies:
mqtt_client: ^9.6.8
# 时间选择器
flutter_datetime_picker: ^1.5.1
dev_dependencies:
flutter_test:
sdk: flutter

Loading…
Cancel
Save