Browse Source

Merge branches 'dev' and 'master' of https://git.lotus-wallet.com/fmk/huixiang_app

 Conflicts:
	lib/main.dart
	lib/store/store_view/settlement.dart
master
fmk 3 years ago
parent
commit
ec05e43786
  1. 491
      lib/retrofit/data/placeOrderFirst.dart
  2. 3
      lib/retrofit/data/settleOrderInfo.dart
  3. 880
      lib/retrofit/data/settlement_bean.dart
  4. 7
      lib/retrofit/data/shoppingCart.dart
  5. 12
      lib/retrofit/min_api.dart
  6. 47
      lib/retrofit/min_api.g.dart
  7. 15
      lib/store/store_order.dart
  8. 8
      lib/store/store_view/product_sku.dart
  9. 250
      lib/store/store_view/settlement.dart

491
lib/retrofit/data/placeOrderFirst.dart

@ -0,0 +1,491 @@
import 'package:huixiang/retrofit/data/shoppingCart.dart';
/// addressId : 0
/// isSubscribe : true
/// isTakeOut : 0
/// notes : ""
/// numberOfPeople : 0
/// orderSource : 0
/// orderType : 0
/// orderTypeId : 0
/// parentCode : ""
/// parentId : 0
/// payChannel : 0
/// promotionInfoDTO : {"couponId":0,"promotionId":0}
/// recMobile : ""
/// shoppingCartSkuItemList : []
/// skuItemDTOList : [{"buyNum":0,"couponId":0,"couponName":"","discountPercent":0,"orderId":0,"orderProductId":0,"platterList":[{"deleted":true,"id":0,"productId":0,"required":true,"skuId":0}],"promotionId":0,"promotionName":"","refundNum":0,"skuId":0}]
/// source : 0
/// storeId : 0
/// subcribeTime : ""
/// tableId : 0
class PlaceOrderFirst {
PlaceOrderFirst({
String addressId,
bool isSubscribe,
int isTakeOut,
String notes,
String numberOfPeople,
int orderSource,
int orderType,
int orderTypeId,
String parentCode,
int parentId,
int payChannel,
PlaceOrderFirstPromotionInfoDTO promotionInfoDTO,
String recMobile,
List<ShoppingCartSkuItemListBean> shoppingCartSkuItemList,
List<SkuItemDTOList> skuItemDTOList,
int source,
String storeId,
String subcribeTime,
int tableId,}){
_addressId = addressId;
_isSubscribe = isSubscribe;
_isTakeOut = isTakeOut;
_notes = notes;
_numberOfPeople = numberOfPeople;
_orderSource = orderSource;
_orderType = orderType;
_orderTypeId = orderTypeId;
_parentCode = parentCode;
_parentId = parentId;
_payChannel = payChannel;
_promotionInfoDTO = promotionInfoDTO;
_recMobile = recMobile;
_skuItemDTOList = skuItemDTOList;
_shoppingCartSkuItemList = shoppingCartSkuItemList;
_source = source;
_storeId = storeId;
_subcribeTime = subcribeTime;
_tableId = tableId;
}
PlaceOrderFirst.fromJson(dynamic json) {
_addressId = json['addressId'];
_isSubscribe = json['isSubscribe'];
_isTakeOut = json['isTakeOut'];
_notes = json['notes'];
_numberOfPeople = json['numberOfPeople'];
_orderSource = json['orderSource'];
_orderType = json['orderType'];
_orderTypeId = json['orderTypeId'];
_parentCode = json['parentCode'];
_parentId = json['parentId'];
_payChannel = json['payChannel'];
_promotionInfoDTO = json['promotionInfoDTO'] != null ? PlaceOrderFirstPromotionInfoDTO.fromJson(json['promotionInfoDTO']) : null;
_recMobile = json['recMobile'];
if (json['skuItemDTOList'] != null) {
_skuItemDTOList = [];
json['skuItemDTOList'].forEach((v) {
_skuItemDTOList.add(SkuItemDTOList.fromJson(v));
});
}
if (json['shoppingCartSkuItemList'] != null) {
_shoppingCartSkuItemList = [];
json['shoppingCartSkuItemList'].forEach((v) {
_shoppingCartSkuItemList.add(ShoppingCartSkuItemListBean.fromJson(v));
});
}
_source = json['source'];
_storeId = json['storeId'];
_subcribeTime = json['subcribeTime'];
_tableId = json['tableId'];
}
String _addressId;
bool _isSubscribe;
int _isTakeOut;
String _notes;
String _numberOfPeople;
int _orderSource;
int _orderType;
int _orderTypeId;
String _parentCode;
int _parentId;
int _payChannel;
PlaceOrderFirstPromotionInfoDTO _promotionInfoDTO;
String _recMobile;
List<SkuItemDTOList> _skuItemDTOList;
List<ShoppingCartSkuItemListBean> _shoppingCartSkuItemList;
int _source;
String _storeId;
String _subcribeTime;
int _tableId;
set addressId(String value) {
_addressId = value;
}
String get addressId => _addressId;
bool get isSubscribe => _isSubscribe;
int get isTakeOut => _isTakeOut;
String get notes => _notes;
String get numberOfPeople => _numberOfPeople;
int get orderSource => _orderSource;
int get orderType => _orderType;
int get orderTypeId => _orderTypeId;
String get parentCode => _parentCode;
int get parentId => _parentId;
int get payChannel => _payChannel;
PlaceOrderFirstPromotionInfoDTO get promotionInfoDTO => _promotionInfoDTO;
String get recMobile => _recMobile;
List<SkuItemDTOList> get skuItemDTOList => _skuItemDTOList;
List<ShoppingCartSkuItemListBean> get shoppingCartSkuItemList => _shoppingCartSkuItemList;
int get source => _source;
String get storeId => _storeId;
String get subcribeTime => _subcribeTime;
int get tableId => _tableId;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['addressId'] = _addressId;
map['isSubscribe'] = _isSubscribe;
map['isTakeOut'] = _isTakeOut;
map['notes'] = _notes;
map['numberOfPeople'] = _numberOfPeople;
map['orderSource'] = _orderSource;
map['orderType'] = _orderType;
map['orderTypeId'] = _orderTypeId;
map['parentCode'] = _parentCode;
map['parentId'] = _parentId;
map['payChannel'] = _payChannel;
if (_promotionInfoDTO != null) {
map['promotionInfoDTO'] = _promotionInfoDTO.toJson();
}
map['recMobile'] = _recMobile;
if (_skuItemDTOList != null) {
map['skuItemDTOList'] = _skuItemDTOList.map((v) => v.toJson()).toList();
}
if (_shoppingCartSkuItemList != null) {
map['shoppingCartSkuItemList'] = _shoppingCartSkuItemList.map((v) => v.toJson()).toList();
}
map['source'] = _source;
map['storeId'] = _storeId;
map['subcribeTime'] = _subcribeTime;
map['tableId'] = _tableId;
return map;
}
set isSubscribe(bool value) {
_isSubscribe = value;
}
set isTakeOut(int value) {
_isTakeOut = value;
}
set notes(String value) {
_notes = value;
}
set numberOfPeople(String value) {
_numberOfPeople = value;
}
set orderSource(int value) {
_orderSource = value;
}
set orderType(int value) {
_orderType = value;
}
set orderTypeId(int value) {
_orderTypeId = value;
}
set parentCode(String value) {
_parentCode = value;
}
set parentId(int value) {
_parentId = value;
}
set payChannel(int value) {
_payChannel = value;
}
set promotionInfoDTO(PlaceOrderFirstPromotionInfoDTO value) {
_promotionInfoDTO = value;
}
set recMobile(String value) {
_recMobile = value;
}
set skuItemDTOList(List<SkuItemDTOList> value) {
_skuItemDTOList = value;
}
set shoppingCartSkuItemList(List<ShoppingCartSkuItemListBean> value) {
_shoppingCartSkuItemList = value;
}
set source(int value) {
_source = value;
}
set storeId(String value) {
_storeId = value;
}
set subcribeTime(String value) {
_subcribeTime = value;
}
set tableId(int value) {
_tableId = value;
}
}
/// buyNum : 0
/// couponId : 0
/// couponName : ""
/// discountPercent : 0
/// orderId : 0
/// orderProductId : 0
/// platterList : [{"deleted":true,"id":0,"productId":0,"required":true,"skuId":0}]
/// promotionId : 0
/// promotionName : ""
/// refundNum : 0
/// skuId : 0
class SkuItemDTOList {
SkuItemDTOList({
int buyNum,
int couponId,
String couponName,
int discountPercent,
int orderId,
int orderProductId,
List<PlatterList> platterList,
int promotionId,
String promotionName,
int refundNum,
String skuId,}){
_buyNum = buyNum;
_couponId = couponId;
_couponName = couponName;
_discountPercent = discountPercent;
_orderId = orderId;
_orderProductId = orderProductId;
_platterList = platterList;
_promotionId = promotionId;
_promotionName = promotionName;
_refundNum = refundNum;
_skuId = skuId;
}
SkuItemDTOList.fromJson(dynamic json) {
_buyNum = json['buyNum'];
_couponId = json['couponId'];
_couponName = json['couponName'];
_discountPercent = json['discountPercent'];
_orderId = json['orderId'];
_orderProductId = json['orderProductId'];
if (json['platterList'] != null) {
_platterList = [];
json['platterList'].forEach((v) {
_platterList.add(PlatterList.fromJson(v));
});
}
_promotionId = json['promotionId'];
_promotionName = json['promotionName'];
_refundNum = json['refundNum'];
_skuId = json['skuId'];
}
int _buyNum;
int _couponId;
String _couponName;
int _discountPercent;
int _orderId;
int _orderProductId;
List<PlatterList> _platterList;
int _promotionId;
String _promotionName;
int _refundNum;
String _skuId;
int get buyNum => _buyNum;
int get couponId => _couponId;
String get couponName => _couponName;
int get discountPercent => _discountPercent;
int get orderId => _orderId;
int get orderProductId => _orderProductId;
List<PlatterList> get platterList => _platterList;
int get promotionId => _promotionId;
String get promotionName => _promotionName;
int get refundNum => _refundNum;
String get skuId => _skuId;
set buyNum(int value) {
_buyNum = value;
}
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['buyNum'] = _buyNum;
map['couponId'] = _couponId;
map['couponName'] = _couponName;
map['discountPercent'] = _discountPercent;
map['orderId'] = _orderId;
map['orderProductId'] = _orderProductId;
if (_platterList != null) {
map['platterList'] = _platterList.map((v) => v.toJson()).toList();
}
map['promotionId'] = _promotionId;
map['promotionName'] = _promotionName;
map['refundNum'] = _refundNum;
map['skuId'] = _skuId;
return map;
}
set couponId(int value) {
_couponId = value;
}
set couponName(String value) {
_couponName = value;
}
set discountPercent(int value) {
_discountPercent = value;
}
set orderId(int value) {
_orderId = value;
}
set orderProductId(int value) {
_orderProductId = value;
}
set platterList(List<PlatterList> value) {
_platterList = value;
}
set promotionId(int value) {
_promotionId = value;
}
set promotionName(String value) {
_promotionName = value;
}
set refundNum(int value) {
_refundNum = value;
}
set skuId(String value) {
_skuId = value;
}
}
/// deleted : true
/// id : 0
/// productId : 0
/// required : true
/// skuId : 0
class PlatterList {
PlatterList({
bool deleted,
int id,
String productId,
bool required,
String skuId,}){
_deleted = deleted;
_id = id;
_productId = productId;
_required = required;
_skuId = skuId;
}
PlatterList.fromJson(dynamic json) {
_deleted = json['deleted'];
_id = json['id'];
_productId = json['productId'];
_required = json['required'];
_skuId = json['skuId'];
}
bool _deleted;
int _id;
String _productId;
bool _required;
String _skuId;
bool get deleted => _deleted;
int get id => _id;
String get productId => _productId;
bool get required => _required;
String get skuId => _skuId;
set deleted(bool value) {
_deleted = value;
}
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['deleted'] = _deleted;
map['id'] = _id;
map['productId'] = _productId;
map['required'] = _required;
map['skuId'] = _skuId;
return map;
}
set id(int value) {
_id = value;
}
set productId(String value) {
_productId = value;
}
set required(bool value) {
_required = value;
}
set skuId(String value) {
_skuId = value;
}
}
/// couponId : 0
/// promotionId : 0
class PlaceOrderFirstPromotionInfoDTO {
PlaceOrderFirstPromotionInfoDTO({
String couponId,
String promotionId,}){
_couponId = couponId;
_promotionId = promotionId;
}
PlaceOrderFirstPromotionInfoDTO.fromJson(dynamic json) {
_couponId = json['couponId'];
_promotionId = json['promotionId'];
}
String _couponId;
String _promotionId;
set couponId(String value) {
_couponId = value;
}
String get couponId => _couponId;
String get promotionId => _promotionId;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['couponId'] = _couponId;
map['promotionId'] = _promotionId;
return map;
}
set promotionId(String value) {
_promotionId = value;
}
}

3
lib/retrofit/data/settleOrderInfo.dart

@ -227,6 +227,8 @@ class CouponListBean {
bool usable; bool usable;
bool allProduct; bool allProduct;
dynamic productList; dynamic productList;
bool isEx;
static CouponListBean fromJson(Map<String, dynamic> map) { static CouponListBean fromJson(Map<String, dynamic> map) {
if (map == null) return null; if (map == null) return null;
@ -283,6 +285,7 @@ class CouponListBean {
"usable": usable, "usable": usable,
"allProduct": allProduct, "allProduct": allProduct,
"productList": productList, "productList": productList,
}; };
} }

880
lib/retrofit/data/settlement_bean.dart

@ -0,0 +1,880 @@
/// addressId : 0
/// buyNum : 0
/// id : 0
/// is_logistics : true
/// orderProductVOList : [{"actInfo":{"couponDiscountAmount":0,"couponDiscountRate":0,"couponId":0,"couponType":0,"discountAmount":0,"discountRate":0,"promotionId":0,"promotionType":0},"additionalComment":{"bizType":0,"commentImgs":"","commentImgsFlag":true,"commentStar":0,"commentText":"","descStar":0,"hideFlag":true,"id":0,"isDelete":true,"likeNum":0,"logisticsStar":0,"mid":0,"orderProductId":0,"parentId":0,"productId":0,"sensitiveFlag":true,"serviceStar":0,"storeId":0},"buyNum":0,"canApplyIntervention":0,"comment":{"bizType":0,"commentImgs":"","commentImgsFlag":true,"commentStar":0,"commentText":"","descStar":0,"hideFlag":true,"id":0,"isDelete":true,"likeNum":0,"logisticsStar":0,"mid":0,"orderProductId":0,"parentId":0,"productId":0,"sensitiveFlag":true,"serviceStar":0,"storeId":0},"commentStatus":0,"discountAmount":0,"id":0,"productId":0,"productName":"","returnCode":"","returnStatus":0,"returnType":0,"sellPrice":0,"skuId":0,"skuImg":"","skuNameStr":""}]
/// payChannel : 0
/// promotionInfoDTO : {"couponId":0,"promotionId":0}
class SettlementBean {
SettlementBean({
int addressId,
int buyNum,
int id,
bool isLogistics,
List<OrderProductVOList> orderProductVOList,
int payChannel,
PromotionInfoDTO promotionInfoDTO,}){
_addressId = addressId;
_buyNum = buyNum;
_id = id;
_isLogistics = isLogistics;
_orderProductVOList = orderProductVOList;
_payChannel = payChannel;
_promotionInfoDTO = promotionInfoDTO;
}
SettlementBean.fromJson(dynamic json) {
_addressId = json['addressId'];
_buyNum = json['buyNum'];
_id = json['id'];
_isLogistics = json['is_logistics'];
if (json['orderProductVOList'] != null) {
_orderProductVOList = [];
json['orderProductVOList'].forEach((v) {
_orderProductVOList.add(OrderProductVOList.fromJson(v));
});
}
_payChannel = json['payChannel'];
_promotionInfoDTO = json['promotionInfoDTO'] != null ? PromotionInfoDTO.fromJson(json['promotionInfoDTO']) : null;
}
int _addressId;
int _buyNum;
int _id;
bool _isLogistics;
List<OrderProductVOList> _orderProductVOList;
int _payChannel;
PromotionInfoDTO _promotionInfoDTO;
int get addressId => _addressId;
int get buyNum => _buyNum;
int get id => _id;
bool get isLogistics => _isLogistics;
List<OrderProductVOList> get orderProductVOList => _orderProductVOList;
int get payChannel => _payChannel;
PromotionInfoDTO get promotionInfoDTO => _promotionInfoDTO;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['addressId'] = _addressId;
map['buyNum'] = _buyNum;
map['id'] = _id;
map['is_logistics'] = _isLogistics;
if (_orderProductVOList != null) {
map['orderProductVOList'] = _orderProductVOList.map((v) => v.toJson()).toList();
}
map['payChannel'] = _payChannel;
if (_promotionInfoDTO != null) {
map['promotionInfoDTO'] = _promotionInfoDTO.toJson();
}
return map;
}
set addressId(int value) {
_addressId = value;
}
set buyNum(int value) {
_buyNum = value;
}
set id(int value) {
_id = value;
}
set isLogistics(bool value) {
_isLogistics = value;
}
set orderProductVOList(List<OrderProductVOList> value) {
_orderProductVOList = value;
}
set payChannel(int value) {
_payChannel = value;
}
set promotionInfoDTO(PromotionInfoDTO value) {
_promotionInfoDTO = value;
}
}
/// couponId : 0
/// promotionId : 0
class PromotionInfoDTO {
PromotionInfoDTO({
int couponId,
int promotionId,}){
_couponId = couponId;
_promotionId = promotionId;
}
PromotionInfoDTO.fromJson(dynamic json) {
_couponId = json['couponId'];
_promotionId = json['promotionId'];
}
int _couponId;
int _promotionId;
int get couponId => _couponId;
int get promotionId => _promotionId;
set couponId(int value) {
_couponId = value;
}
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['couponId'] = _couponId;
map['promotionId'] = _promotionId;
return map;
}
set promotionId(int value) {
_promotionId = value;
}
}
/// actInfo : {"couponDiscountAmount":0,"couponDiscountRate":0,"couponId":0,"couponType":0,"discountAmount":0,"discountRate":0,"promotionId":0,"promotionType":0}
/// additionalComment : {"bizType":0,"commentImgs":"","commentImgsFlag":true,"commentStar":0,"commentText":"","descStar":0,"hideFlag":true,"id":0,"isDelete":true,"likeNum":0,"logisticsStar":0,"mid":0,"orderProductId":0,"parentId":0,"productId":0,"sensitiveFlag":true,"serviceStar":0,"storeId":0}
/// buyNum : 0
/// canApplyIntervention : 0
/// comment : {"bizType":0,"commentImgs":"","commentImgsFlag":true,"commentStar":0,"commentText":"","descStar":0,"hideFlag":true,"id":0,"isDelete":true,"likeNum":0,"logisticsStar":0,"mid":0,"orderProductId":0,"parentId":0,"productId":0,"sensitiveFlag":true,"serviceStar":0,"storeId":0}
/// commentStatus : 0
/// discountAmount : 0
/// id : 0
/// productId : 0
/// productName : ""
/// returnCode : ""
/// returnStatus : 0
/// returnType : 0
/// sellPrice : 0
/// skuId : 0
/// skuImg : ""
/// skuNameStr : ""
class OrderProductVOList {
OrderProductVOList({
ActInfo actInfo,
AdditionalComment additionalComment,
int buyNum,
int canApplyIntervention,
Comment comment,
int commentStatus,
int discountAmount,
int id,
int productId,
String productName,
String returnCode,
int returnStatus,
int returnType,
int sellPrice,
int skuId,
String skuImg,
String skuNameStr,}){
_actInfo = actInfo;
_additionalComment = additionalComment;
_buyNum = buyNum;
_canApplyIntervention = canApplyIntervention;
_comment = comment;
_commentStatus = commentStatus;
_discountAmount = discountAmount;
_id = id;
_productId = productId;
_productName = productName;
_returnCode = returnCode;
_returnStatus = returnStatus;
_returnType = returnType;
_sellPrice = sellPrice;
_skuId = skuId;
_skuImg = skuImg;
_skuNameStr = skuNameStr;
}
OrderProductVOList.fromJson(dynamic json) {
_actInfo = json['actInfo'] != null ? ActInfo.fromJson(json['actInfo']) : null;
_additionalComment = json['additionalComment'] != null ? AdditionalComment.fromJson(json['additionalComment']) : null;
_buyNum = json['buyNum'];
_canApplyIntervention = json['canApplyIntervention'];
_comment = json['comment'] != null ? Comment.fromJson(json['comment']) : null;
_commentStatus = json['commentStatus'];
_discountAmount = json['discountAmount'];
_id = json['id'];
_productId = json['productId'];
_productName = json['productName'];
_returnCode = json['returnCode'];
_returnStatus = json['returnStatus'];
_returnType = json['returnType'];
_sellPrice = json['sellPrice'];
_skuId = json['skuId'];
_skuImg = json['skuImg'];
_skuNameStr = json['skuNameStr'];
}
ActInfo _actInfo;
AdditionalComment _additionalComment;
int _buyNum;
int _canApplyIntervention;
Comment _comment;
int _commentStatus;
int _discountAmount;
int _id;
int _productId;
String _productName;
String _returnCode;
int _returnStatus;
int _returnType;
int _sellPrice;
int _skuId;
String _skuImg;
String _skuNameStr;
ActInfo get actInfo => _actInfo;
AdditionalComment get additionalComment => _additionalComment;
int get buyNum => _buyNum;
int get canApplyIntervention => _canApplyIntervention;
Comment get comment => _comment;
int get commentStatus => _commentStatus;
int get discountAmount => _discountAmount;
int get id => _id;
int get productId => _productId;
String get productName => _productName;
String get returnCode => _returnCode;
int get returnStatus => _returnStatus;
int get returnType => _returnType;
int get sellPrice => _sellPrice;
int get skuId => _skuId;
String get skuImg => _skuImg;
String get skuNameStr => _skuNameStr;
set actInfo(ActInfo value) {
_actInfo = value;
}
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (_actInfo != null) {
map['actInfo'] = _actInfo.toJson();
}
if (_additionalComment != null) {
map['additionalComment'] = _additionalComment.toJson();
}
map['buyNum'] = _buyNum;
map['canApplyIntervention'] = _canApplyIntervention;
if (_comment != null) {
map['comment'] = _comment.toJson();
}
map['commentStatus'] = _commentStatus;
map['discountAmount'] = _discountAmount;
map['id'] = _id;
map['productId'] = _productId;
map['productName'] = _productName;
map['returnCode'] = _returnCode;
map['returnStatus'] = _returnStatus;
map['returnType'] = _returnType;
map['sellPrice'] = _sellPrice;
map['skuId'] = _skuId;
map['skuImg'] = _skuImg;
map['skuNameStr'] = _skuNameStr;
return map;
}
set additionalComment(AdditionalComment value) {
_additionalComment = value;
}
set buyNum(int value) {
_buyNum = value;
}
set canApplyIntervention(int value) {
_canApplyIntervention = value;
}
set comment(Comment value) {
_comment = value;
}
set commentStatus(int value) {
_commentStatus = value;
}
set discountAmount(int value) {
_discountAmount = value;
}
set id(int value) {
_id = value;
}
set productId(int value) {
_productId = value;
}
set productName(String value) {
_productName = value;
}
set returnCode(String value) {
_returnCode = value;
}
set returnStatus(int value) {
_returnStatus = value;
}
set returnType(int value) {
_returnType = value;
}
set sellPrice(int value) {
_sellPrice = value;
}
set skuId(int value) {
_skuId = value;
}
set skuImg(String value) {
_skuImg = value;
}
set skuNameStr(String value) {
_skuNameStr = value;
}
}
/// bizType : 0
/// commentImgs : ""
/// commentImgsFlag : true
/// commentStar : 0
/// commentText : ""
/// descStar : 0
/// hideFlag : true
/// id : 0
/// isDelete : true
/// likeNum : 0
/// logisticsStar : 0
/// mid : 0
/// orderProductId : 0
/// parentId : 0
/// productId : 0
/// sensitiveFlag : true
/// serviceStar : 0
/// storeId : 0
class Comment {
Comment({
int bizType,
String commentImgs,
bool commentImgsFlag,
int commentStar,
String commentText,
int descStar,
bool hideFlag,
int id,
bool isDelete,
int likeNum,
int logisticsStar,
int mid,
int orderProductId,
int parentId,
int productId,
bool sensitiveFlag,
int serviceStar,
int storeId,}){
_bizType = bizType;
_commentImgs = commentImgs;
_commentImgsFlag = commentImgsFlag;
_commentStar = commentStar;
_commentText = commentText;
_descStar = descStar;
_hideFlag = hideFlag;
_id = id;
_isDelete = isDelete;
_likeNum = likeNum;
_logisticsStar = logisticsStar;
_mid = mid;
_orderProductId = orderProductId;
_parentId = parentId;
_productId = productId;
_sensitiveFlag = sensitiveFlag;
_serviceStar = serviceStar;
_storeId = storeId;
}
Comment.fromJson(dynamic json) {
_bizType = json['bizType'];
_commentImgs = json['commentImgs'];
_commentImgsFlag = json['commentImgsFlag'];
_commentStar = json['commentStar'];
_commentText = json['commentText'];
_descStar = json['descStar'];
_hideFlag = json['hideFlag'];
_id = json['id'];
_isDelete = json['isDelete'];
_likeNum = json['likeNum'];
_logisticsStar = json['logisticsStar'];
_mid = json['mid'];
_orderProductId = json['orderProductId'];
_parentId = json['parentId'];
_productId = json['productId'];
_sensitiveFlag = json['sensitiveFlag'];
_serviceStar = json['serviceStar'];
_storeId = json['storeId'];
}
int _bizType;
String _commentImgs;
bool _commentImgsFlag;
int _commentStar;
String _commentText;
int _descStar;
bool _hideFlag;
int _id;
bool _isDelete;
int _likeNum;
int _logisticsStar;
int _mid;
int _orderProductId;
int _parentId;
int _productId;
bool _sensitiveFlag;
int _serviceStar;
int _storeId;
int get bizType => _bizType;
String get commentImgs => _commentImgs;
bool get commentImgsFlag => _commentImgsFlag;
int get commentStar => _commentStar;
String get commentText => _commentText;
int get descStar => _descStar;
bool get hideFlag => _hideFlag;
int get id => _id;
bool get isDelete => _isDelete;
int get likeNum => _likeNum;
int get logisticsStar => _logisticsStar;
int get mid => _mid;
int get orderProductId => _orderProductId;
int get parentId => _parentId;
int get productId => _productId;
bool get sensitiveFlag => _sensitiveFlag;
int get serviceStar => _serviceStar;
int get storeId => _storeId;
set bizType(int value) {
_bizType = value;
}
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['bizType'] = _bizType;
map['commentImgs'] = _commentImgs;
map['commentImgsFlag'] = _commentImgsFlag;
map['commentStar'] = _commentStar;
map['commentText'] = _commentText;
map['descStar'] = _descStar;
map['hideFlag'] = _hideFlag;
map['id'] = _id;
map['isDelete'] = _isDelete;
map['likeNum'] = _likeNum;
map['logisticsStar'] = _logisticsStar;
map['mid'] = _mid;
map['orderProductId'] = _orderProductId;
map['parentId'] = _parentId;
map['productId'] = _productId;
map['sensitiveFlag'] = _sensitiveFlag;
map['serviceStar'] = _serviceStar;
map['storeId'] = _storeId;
return map;
}
set commentImgs(String value) {
_commentImgs = value;
}
set commentImgsFlag(bool value) {
_commentImgsFlag = value;
}
set commentStar(int value) {
_commentStar = value;
}
set commentText(String value) {
_commentText = value;
}
set descStar(int value) {
_descStar = value;
}
set hideFlag(bool value) {
_hideFlag = value;
}
set id(int value) {
_id = value;
}
set isDelete(bool value) {
_isDelete = value;
}
set likeNum(int value) {
_likeNum = value;
}
set logisticsStar(int value) {
_logisticsStar = value;
}
set mid(int value) {
_mid = value;
}
set orderProductId(int value) {
_orderProductId = value;
}
set parentId(int value) {
_parentId = value;
}
set productId(int value) {
_productId = value;
}
set sensitiveFlag(bool value) {
_sensitiveFlag = value;
}
set serviceStar(int value) {
_serviceStar = value;
}
set storeId(int value) {
_storeId = value;
}
}
/// bizType : 0
/// commentImgs : ""
/// commentImgsFlag : true
/// commentStar : 0
/// commentText : ""
/// descStar : 0
/// hideFlag : true
/// id : 0
/// isDelete : true
/// likeNum : 0
/// logisticsStar : 0
/// mid : 0
/// orderProductId : 0
/// parentId : 0
/// productId : 0
/// sensitiveFlag : true
/// serviceStar : 0
/// storeId : 0
class AdditionalComment {
AdditionalComment({
int bizType,
String commentImgs,
bool commentImgsFlag,
int commentStar,
String commentText,
int descStar,
bool hideFlag,
int id,
bool isDelete,
int likeNum,
int logisticsStar,
int mid,
int orderProductId,
int parentId,
int productId,
bool sensitiveFlag,
int serviceStar,
int storeId,}){
_bizType = bizType;
_commentImgs = commentImgs;
_commentImgsFlag = commentImgsFlag;
_commentStar = commentStar;
_commentText = commentText;
_descStar = descStar;
_hideFlag = hideFlag;
_id = id;
_isDelete = isDelete;
_likeNum = likeNum;
_logisticsStar = logisticsStar;
_mid = mid;
_orderProductId = orderProductId;
_parentId = parentId;
_productId = productId;
_sensitiveFlag = sensitiveFlag;
_serviceStar = serviceStar;
_storeId = storeId;
}
AdditionalComment.fromJson(dynamic json) {
_bizType = json['bizType'];
_commentImgs = json['commentImgs'];
_commentImgsFlag = json['commentImgsFlag'];
_commentStar = json['commentStar'];
_commentText = json['commentText'];
_descStar = json['descStar'];
_hideFlag = json['hideFlag'];
_id = json['id'];
_isDelete = json['isDelete'];
_likeNum = json['likeNum'];
_logisticsStar = json['logisticsStar'];
_mid = json['mid'];
_orderProductId = json['orderProductId'];
_parentId = json['parentId'];
_productId = json['productId'];
_sensitiveFlag = json['sensitiveFlag'];
_serviceStar = json['serviceStar'];
_storeId = json['storeId'];
}
int _bizType;
String _commentImgs;
bool _commentImgsFlag;
int _commentStar;
String _commentText;
int _descStar;
bool _hideFlag;
int _id;
bool _isDelete;
int _likeNum;
int _logisticsStar;
int _mid;
int _orderProductId;
int _parentId;
int _productId;
bool _sensitiveFlag;
int _serviceStar;
int _storeId;
int get bizType => _bizType;
String get commentImgs => _commentImgs;
bool get commentImgsFlag => _commentImgsFlag;
int get commentStar => _commentStar;
String get commentText => _commentText;
int get descStar => _descStar;
bool get hideFlag => _hideFlag;
int get id => _id;
bool get isDelete => _isDelete;
int get likeNum => _likeNum;
int get logisticsStar => _logisticsStar;
int get mid => _mid;
int get orderProductId => _orderProductId;
int get parentId => _parentId;
int get productId => _productId;
bool get sensitiveFlag => _sensitiveFlag;
int get serviceStar => _serviceStar;
int get storeId => _storeId;
set bizType(int value) {
_bizType = value;
}
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['bizType'] = _bizType;
map['commentImgs'] = _commentImgs;
map['commentImgsFlag'] = _commentImgsFlag;
map['commentStar'] = _commentStar;
map['commentText'] = _commentText;
map['descStar'] = _descStar;
map['hideFlag'] = _hideFlag;
map['id'] = _id;
map['isDelete'] = _isDelete;
map['likeNum'] = _likeNum;
map['logisticsStar'] = _logisticsStar;
map['mid'] = _mid;
map['orderProductId'] = _orderProductId;
map['parentId'] = _parentId;
map['productId'] = _productId;
map['sensitiveFlag'] = _sensitiveFlag;
map['serviceStar'] = _serviceStar;
map['storeId'] = _storeId;
return map;
}
set commentImgs(String value) {
_commentImgs = value;
}
set commentImgsFlag(bool value) {
_commentImgsFlag = value;
}
set commentStar(int value) {
_commentStar = value;
}
set commentText(String value) {
_commentText = value;
}
set descStar(int value) {
_descStar = value;
}
set hideFlag(bool value) {
_hideFlag = value;
}
set id(int value) {
_id = value;
}
set isDelete(bool value) {
_isDelete = value;
}
set likeNum(int value) {
_likeNum = value;
}
set logisticsStar(int value) {
_logisticsStar = value;
}
set mid(int value) {
_mid = value;
}
set orderProductId(int value) {
_orderProductId = value;
}
set parentId(int value) {
_parentId = value;
}
set productId(int value) {
_productId = value;
}
set sensitiveFlag(bool value) {
_sensitiveFlag = value;
}
set serviceStar(int value) {
_serviceStar = value;
}
set storeId(int value) {
_storeId = value;
}
}
/// couponDiscountAmount : 0
/// couponDiscountRate : 0
/// couponId : 0
/// couponType : 0
/// discountAmount : 0
/// discountRate : 0
/// promotionId : 0
/// promotionType : 0
class ActInfo {
ActInfo({
int couponDiscountAmount,
int couponDiscountRate,
int couponId,
int couponType,
int discountAmount,
int discountRate,
int promotionId,
int promotionType,}){
_couponDiscountAmount = couponDiscountAmount;
_couponDiscountRate = couponDiscountRate;
_couponId = couponId;
_couponType = couponType;
_discountAmount = discountAmount;
_discountRate = discountRate;
_promotionId = promotionId;
_promotionType = promotionType;
}
ActInfo.fromJson(dynamic json) {
_couponDiscountAmount = json['couponDiscountAmount'];
_couponDiscountRate = json['couponDiscountRate'];
_couponId = json['couponId'];
_couponType = json['couponType'];
_discountAmount = json['discountAmount'];
_discountRate = json['discountRate'];
_promotionId = json['promotionId'];
_promotionType = json['promotionType'];
}
int _couponDiscountAmount;
int _couponDiscountRate;
int _couponId;
int _couponType;
int _discountAmount;
int _discountRate;
int _promotionId;
int _promotionType;
int get couponDiscountAmount => _couponDiscountAmount;
int get couponDiscountRate => _couponDiscountRate;
int get couponId => _couponId;
int get couponType => _couponType;
int get discountAmount => _discountAmount;
int get discountRate => _discountRate;
int get promotionId => _promotionId;
int get promotionType => _promotionType;
set couponDiscountAmount(int value) {
_couponDiscountAmount = value;
}
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['couponDiscountAmount'] = _couponDiscountAmount;
map['couponDiscountRate'] = _couponDiscountRate;
map['couponId'] = _couponId;
map['couponType'] = _couponType;
map['discountAmount'] = _discountAmount;
map['discountRate'] = _discountRate;
map['promotionId'] = _promotionId;
map['promotionType'] = _promotionType;
return map;
}
set couponDiscountRate(int value) {
_couponDiscountRate = value;
}
set couponId(int value) {
_couponId = value;
}
set couponType(int value) {
_couponType = value;
}
set discountAmount(int value) {
_discountAmount = value;
}
set discountRate(int value) {
_discountRate = value;
}
set promotionId(int value) {
_promotionId = value;
}
set promotionType(int value) {
_promotionType = value;
}
}

7
lib/retrofit/data/shoppingCart.dart

@ -62,14 +62,15 @@ class ShoppingCartSkuItemListBean {
int groupId; int groupId;
int id; int id;
List<PlatterListBean> platterList; List<PlatterListBean> platterList;
int productId; String productId;
String productName; String productName;
String skuId;
int selected; int selected;
String skuImg; String skuImg;
String skuName; String skuName;
int skuPrice; int skuPrice;
int skuStock; int skuStock;
int storeId; String storeId;
int tableId; int tableId;
static ShoppingCartSkuItemListBean fromJson(Map<String, dynamic> map) { static ShoppingCartSkuItemListBean fromJson(Map<String, dynamic> map) {
@ -83,6 +84,7 @@ class ShoppingCartSkuItemListBean {
(map['platterList'] as List ?? []).map((o) => PlatterListBean.fromJson(o)) (map['platterList'] as List ?? []).map((o) => PlatterListBean.fromJson(o))
); );
shoppingCartSkuItemListBean.productId = map['productId']; shoppingCartSkuItemListBean.productId = map['productId'];
shoppingCartSkuItemListBean.skuId = map['skuId'];
shoppingCartSkuItemListBean.productName = map['productName']; shoppingCartSkuItemListBean.productName = map['productName'];
shoppingCartSkuItemListBean.selected = map['selected']; shoppingCartSkuItemListBean.selected = map['selected'];
shoppingCartSkuItemListBean.skuImg = map['skuImg']; shoppingCartSkuItemListBean.skuImg = map['skuImg'];
@ -101,6 +103,7 @@ class ShoppingCartSkuItemListBean {
"id": id, "id": id,
"platterList": platterList, "platterList": platterList,
"productId": productId, "productId": productId,
"skuId": skuId,
"productName": productName, "productName": productName,
"selected": selected, "selected": selected,
"skuImg": skuImg, "skuImg": skuImg,

12
lib/retrofit/min_api.dart

@ -8,6 +8,8 @@ import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/placeOrderFirst.dart';
import 'package:huixiang/retrofit/data/settlement_bean.dart';
import 'package:huixiang/view_widget/login_tips_dialog.dart'; import 'package:huixiang/view_widget/login_tips_dialog.dart';
import 'package:retrofit/retrofit.dart'; import 'package:retrofit/retrofit.dart';
@ -146,4 +148,14 @@ abstract class MinApiService {
@POST("order/getOrderInfo") @POST("order/getOrderInfo")
Future<BaseData<SettleOrderInfo>> getOrderInfo( Future<BaseData<SettleOrderInfo>> getOrderInfo(
@Body() Map<String, dynamic> param); @Body() Map<String, dynamic> param);
///
@POST("order/placeOrderFirst")
Future<BaseData> placeOrderFirst(@Body() Map<String, dynamic> param);
///
@POST("order/settlement")
Future<BaseData> settlementApi(@Body() Map<String, dynamic> param);
} }

47
lib/retrofit/min_api.g.dart

@ -108,4 +108,51 @@ class _MinApiService implements MinApiService {
); );
return value; return value;
} }
@override
Future<BaseData<dynamic>> placeOrderFirst(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'order/placeOrderFirst',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<dynamic>.fromJson(
_result.data,
(json) => json as dynamic,
);
return value;
}
@override
Future<BaseData<dynamic>> settlementApi(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'order/settlement',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<dynamic>.fromJson(
_result.data,
(json) => json as dynamic,
);
return value;
}
} }

15
lib/store/store_order.dart

@ -554,6 +554,21 @@ class _StoreOrderPage extends State<StoreOrderPage>
}, },
); );
if (result != null) { if (result != null) {
result["name"] = miNiDetail.productName;
miNiDetail.productSkuVOList.forEach((e0) {
String attr1 = "";
String attr2 = "";
e0.skuAttrList.forEach((e2) {
attr1 += e2.attrValueId;
});
(result["attr"] as List).forEach((e1) {
attr2 += e1["attrValue"];
});
if(attr1 == attr2){
result["skuId"] = e0.id;
return;
}
});
if (shopCarGoods == null || shopCarGoods.length == 0) { if (shopCarGoods == null || shopCarGoods.length == 0) {
shopCarGoods = []; shopCarGoods = [];
shopCarGoods.add(result); shopCarGoods.add(result);

8
lib/store/store_view/product_sku.dart

@ -152,6 +152,14 @@ class _ProductSku extends State<ProductSku> {
if (tempSelected["attr"] == null) { if (tempSelected["attr"] == null) {
tempSelected["attr"] = []; tempSelected["attr"] = [];
} }
bool flag = false;
(tempSelected["attr"] as List).forEach((e0) {
if(e0["attrId"] == widget.miNiDetail.attrList[position].id){
e0["attrValue"] = widget.miNiDetail.attrList[position].attrValueList[index].id;
flag = true;
}
});
if(!flag)
(tempSelected["attr"] as List).add({ (tempSelected["attr"] as List).add({
"attrId": "${widget.miNiDetail.attrList[position].id}", "attrId": "${widget.miNiDetail.attrList[position].id}",
"attrValue": "${widget.miNiDetail.attrList[position].attrValueList[index].id}", "attrValue": "${widget.miNiDetail.attrList[position].attrValueList[index].id}",

250
lib/store/store_view/settlement.dart

@ -8,10 +8,11 @@ import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/order/order_view/order_commodity.dart'; import 'package:huixiang/order/order_view/order_commodity.dart';
import 'package:huixiang/order/order_view/order_info.dart'; import 'package:huixiang/order/order_view/order_info.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/coupon.dart';
import 'package:huixiang/retrofit/data/findMiNiGroupList.dart'; import 'package:huixiang/retrofit/data/findMiNiGroupList.dart';
import 'package:huixiang/retrofit/data/order_info.dart'; import 'package:huixiang/retrofit/data/placeOrderFirst.dart';
import 'package:huixiang/retrofit/data/settleOrderInfo.dart'; import 'package:huixiang/retrofit/data/settleOrderInfo.dart';
import 'package:huixiang/retrofit/data/settlement_bean.dart';
import 'package:huixiang/retrofit/data/shoppingCart.dart';
import 'package:huixiang/retrofit/data/store_info.dart'; import 'package:huixiang/retrofit/data/store_info.dart';
import 'package:huixiang/retrofit/min_api.dart'; import 'package:huixiang/retrofit/min_api.dart';
import 'package:huixiang/store/store_view/settlement_order_commodity.dart'; import 'package:huixiang/store/store_view/settlement_order_commodity.dart';
@ -38,10 +39,7 @@ class Settlement extends StatefulWidget {
class _Settlement extends State<Settlement> { class _Settlement extends State<Settlement> {
MinApiService minService; MinApiService minService;
int selectedBtn = 0; int selectedBtn = 0;
Coupon coupon;
Function(int type) callback; Function(int type) callback;
GestureTapCallback callbackEx;
int isSelected = 0;
StoreInfo storeInfo; StoreInfo storeInfo;
SettleOrderInfo settleOrderInfo; SettleOrderInfo settleOrderInfo;
int selectedCouponIndex = -1; int selectedCouponIndex = -1;
@ -60,6 +58,8 @@ class _Settlement extends State<Settlement> {
void initState() { void initState() {
super.initState(); super.initState();
storeInfo = widget.arguments["storeInfo"]; storeInfo = widget.arguments["storeInfo"];
shopCar = widget.arguments["shopProduct"];
shopCarGoods = widget.arguments["shopGoods"];
_vc = TextEditingController( _vc = TextEditingController(
text: storeInfo != null ? storeInfo.headMobile : ""); text: storeInfo != null ? storeInfo.headMobile : "");
@ -83,18 +83,163 @@ class _Settlement extends State<Settlement> {
"addressId": null, "addressId": null,
"isTake": 0, "isTake": 0,
"memberCouponId": null, "memberCouponId": null,
// "orderId": widget.arguments["orderId"], "orderId": 0,
"orderId": "1449199929208602624",
"promotionId": null "promotionId": null
}); });
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
settleOrderInfo = baseData.data; setState(() {
setState(() {}); settleOrderInfo = baseData.data;
});
}
}
///
queryPlaceOrderFirst() async {
PlaceOrderFirst placeOrderFirst = PlaceOrderFirst();
placeOrderFirst.addressId = null;
placeOrderFirst.isSubscribe = false;
placeOrderFirst.isTakeOut = 0;
placeOrderFirst.notes = "";
placeOrderFirst.numberOfPeople = null;
placeOrderFirst.orderSource = 0;
placeOrderFirst.orderType = 0;
placeOrderFirst.orderTypeId = 0;
placeOrderFirst.parentCode = "";
placeOrderFirst.parentId = 0;
placeOrderFirst.payChannel = 1;
placeOrderFirst.promotionInfoDTO = PlaceOrderFirstPromotionInfoDTO();
placeOrderFirst.promotionInfoDTO.couponId = selectedCouponIndex == -1?null : settleOrderInfo.couponList[selectedCouponIndex].couponId;
placeOrderFirst.promotionInfoDTO.promotionId = "0";
placeOrderFirst.recMobile = storeInfo.headMobile;
placeOrderFirst.shoppingCartSkuItemList = [];
placeOrderFirst.skuItemDTOList = [];
shopCarGoods.forEach((e0) {
SkuItemDTOList skuItemDTOListBean = SkuItemDTOList();
skuItemDTOListBean.skuId = e0["skuId"];
skuItemDTOListBean.buyNum = e0["count"];
PlatterList platterListBean = PlatterList();
platterListBean.skuId = e0["skuId"];
platterListBean.productId = e0["id"];
skuItemDTOListBean.platterList = [];
skuItemDTOListBean.platterList.add(platterListBean);
placeOrderFirst.skuItemDTOList.add(skuItemDTOListBean);
ShoppingCartSkuItemListBean shoppingCartSkuItemListBean = ShoppingCartSkuItemListBean();
shoppingCartSkuItemListBean.buyNum = e0["count"];
shoppingCartSkuItemListBean.productId = e0["id"];
shoppingCartSkuItemListBean.productName = e0["name"];
shoppingCartSkuItemListBean.skuId = e0["skuId"];
placeOrderFirst.shoppingCartSkuItemList.add(shoppingCartSkuItemListBean);
});
placeOrderFirst.source = 1;
placeOrderFirst.storeId = storeInfo.id;
placeOrderFirst.subcribeTime = null;
placeOrderFirst.tableId = 0;
BaseData baseData = await minService.placeOrderFirst(
placeOrderFirst.toJson()).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
querySettlement();
}
}
///
querySettlement() async {
SettlementBean settlementBean = SettlementBean();
settlementBean.addressId = 0;
settlementBean.buyNum = 0;
settlementBean.id = 0;
settlementBean.isLogistics = true;
settlementBean.orderProductVOList = [];
shopCarGoods.forEach((e0) {
OrderProductVOList orderProductVOListBean = OrderProductVOList();
orderProductVOListBean.skuId = e0["skuId"];
orderProductVOListBean.buyNum = e0["count"];
ActInfo actInfoBean = ActInfo();
actInfoBean.couponDiscountAmount = 0;
actInfoBean.couponDiscountRate = 0;
actInfoBean.couponId = 0;
actInfoBean.couponType = 0;
actInfoBean.discountAmount = 0;
actInfoBean.discountRate = 0;
actInfoBean.promotionId = 0;
actInfoBean.promotionType = 0;
AdditionalComment additionalCommentBean = AdditionalComment();
additionalCommentBean.bizType = 0;
additionalCommentBean.commentImgs = "";
additionalCommentBean.commentImgsFlag = false;
additionalCommentBean.commentStar = 0;
additionalCommentBean.commentText = "";
additionalCommentBean.descStar = 0;
additionalCommentBean.hideFlag = true;
additionalCommentBean.id = 0;
additionalCommentBean.isDelete = true;
additionalCommentBean.likeNum = 0;
additionalCommentBean.logisticsStar = 0;
additionalCommentBean.mid = 0;
additionalCommentBean.orderProductId = 0;
additionalCommentBean.parentId = 0;
additionalCommentBean.productId = 0;
additionalCommentBean.sensitiveFlag = true;
additionalCommentBean.serviceStar = 0;
additionalCommentBean.storeId = 0;
settlementBean.buyNum = 0;
Comment commentBean = Comment();
commentBean.bizType = 0;
commentBean.commentImgs = "";
commentBean.commentImgsFlag = true;
commentBean.commentStar = 0;
commentBean.commentText = "";
commentBean.descStar = 0;
commentBean.hideFlag = true;
commentBean.id = 0;
commentBean.isDelete = true;
commentBean.logisticsStar = 0;
commentBean.mid = 0;
commentBean.orderProductId = 0;
commentBean.parentId = 0;
commentBean.productId = 0;
commentBean.sensitiveFlag = true;
commentBean.serviceStar = 0;
commentBean.storeId = 0;
orderProductVOListBean.commentStatus = 0;
orderProductVOListBean.discountAmount = 0;
orderProductVOListBean.id = 0;
orderProductVOListBean.productId = 0;
orderProductVOListBean.productName = "";
orderProductVOListBean.returnCode = "";
orderProductVOListBean.returnStatus = 0;
orderProductVOListBean.returnType = 0;
orderProductVOListBean.sellPrice = 0;
orderProductVOListBean.skuId = 0;
orderProductVOListBean.skuImg = "";
orderProductVOListBean.skuNameStr = "";
settlementBean.orderProductVOList.add(orderProductVOListBean);
});
settlementBean.payChannel = 0;
settlementBean.promotionInfoDTO = PromotionInfoDTO();
settlementBean.promotionInfoDTO.couponId = 0;
settlementBean.promotionInfoDTO.promotionId = 0;
BaseData baseData = await minService.settlementApi({
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
} }
} }
bool isEdit = false; bool isEdit = false;
String totalPrice(bool discountFlag) {
if (shopCarGoods == null) return "";
double totalPrice = 0;
shopCarGoods.forEach((element) {
totalPrice += double.tryParse(element["price"]) * element["count"];
});
if(selectedCouponIndex != -1 && discountFlag){
double discountA = double.parse(settleOrderInfo.couponList[selectedCouponIndex].discountAmount);
totalPrice -= discountA;
}
return totalPrice.toStringAsFixed(2);
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Stack( return Stack(
@ -546,10 +691,16 @@ class _Settlement extends State<Settlement> {
color: Color(0xFF4C4C4C), color: Color(0xFF4C4C4C),
), ),
), ),
), ), InkWell(
Icon( onTap: () {
Icons.keyboard_arrow_right, setState(() {
size: 24, Navigator.of(context).popAndPushNamed('/router/manage_address_page');
});
},
child:Icon(
Icons.keyboard_arrow_right,
size: 24,
),
), ),
], ],
), ),
@ -859,20 +1010,12 @@ class _Settlement extends State<Settlement> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(
"可用优惠券",
style: TextStyle(
color: Color(0xFF000000),
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
),
SizedBox(
width: 4,
),
Expanded( Expanded(
child: Text( child: Text(
"(1)", (settleOrderInfo?.couponList == null || settleOrderInfo.couponList.length == 0)
? "暂无可用优惠券" : (selectedCouponIndex == -1
? "拥有${settleOrderInfo.couponList.length}张优惠券":
settleOrderInfo.couponList[selectedCouponIndex].promotionName),
style: TextStyle( style: TextStyle(
color: Color(0xFF000000), color: Color(0xFF000000),
fontSize: 14.sp, fontSize: 14.sp,
@ -901,13 +1044,13 @@ class _Settlement extends State<Settlement> {
right: 16, right: 16,
), ),
child: ListView.builder( child: ListView.builder(
itemCount: 5, itemCount:settleOrderInfo == null ? 0 : settleOrderInfo.couponList.length,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
itemBuilder: (context, position) { itemBuilder: (context, position) {
// return shoppGoodsItem(); // return shoppGoodsItem();
return GestureDetector( return GestureDetector(
onTap: () {}, onTap: () {},
child: couponItem(position), child: couponItem(settleOrderInfo.couponList[position],position),
); );
}, },
), ),
@ -922,7 +1065,7 @@ class _Settlement extends State<Settlement> {
} }
/// ///
Widget couponItem(int index) { Widget couponItem(CouponListBean couponList,int index) {
return StatefulBuilder(builder: (context1, state) { return StatefulBuilder(builder: (context1, state) {
return Container( return Container(
height: 170, height: 170,
@ -974,7 +1117,7 @@ class _Settlement extends State<Settlement> {
height: 4.h, height: 4.h,
), ),
Text( Text(
"5", couponList.discountAmount,
style: TextStyle( style: TextStyle(
fontSize: 40.sp, fontSize: 40.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
@ -985,7 +1128,7 @@ class _Settlement extends State<Settlement> {
), ),
), ),
Text( Text(
S.of(context).manyuankeyong(30), S.of(context).manyuankeyong(couponList.fullAmount),
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
@ -1028,7 +1171,7 @@ class _Settlement extends State<Settlement> {
), ),
Expanded( Expanded(
child: Text( child: Text(
"百年川椒火锅店", storeInfo.storeName,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
@ -1041,7 +1184,7 @@ class _Settlement extends State<Settlement> {
], ],
), ),
Text( Text(
"#新客户满减优惠#", couponList.promotionName,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
@ -1063,12 +1206,27 @@ class _Settlement extends State<Settlement> {
margin: EdgeInsets.only(right: 23.w), margin: EdgeInsets.only(right: 23.w),
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
state(() { setState(() {
isSelected = index; // if (!couponList.usable){
// SmartDialog.showToast("当前优惠券不可用", alignment: Alignment.center);
// return;
// }
double toPrice = double.parse(totalPrice(false));
double amount = double.parse(couponList.fullAmount);
if(toPrice <= amount){
SmartDialog.showToast("当前金额不够使用优惠券", alignment: Alignment.center);
return;
}
state(() {
if(selectedCouponIndex == index)
selectedCouponIndex = -1;
else {selectedCouponIndex = index;}
});
Navigator.of(context).pop();
}); });
}, },
child: Image.asset( child: Image.asset(
isSelected != index selectedCouponIndex != index
? "assets/image/icon_radio_unselected.png" ? "assets/image/icon_radio_unselected.png"
: "assets/image/icon_radio_selected.png", : "assets/image/icon_radio_selected.png",
width: 24, width: 24,
@ -1084,7 +1242,7 @@ class _Settlement extends State<Settlement> {
], ],
), ),
), ),
flex: (coupon != null && coupon.isEx) ? 97 : 97, flex: (couponList?.isEx??false) ? 97 : 97,
), ),
Container( Container(
padding: EdgeInsets.symmetric(horizontal: 23.w), padding: EdgeInsets.symmetric(horizontal: 23.w),
@ -1095,7 +1253,7 @@ class _Settlement extends State<Settlement> {
), ),
), ),
Expanded( Expanded(
flex: (coupon != null && coupon.isEx) ? 56 : 42, flex: (couponList?.isEx??false) ? 56 : 42,
child: Container( child: Container(
margin: EdgeInsets.symmetric(horizontal: 23.w, vertical: 8.h), margin: EdgeInsets.symmetric(horizontal: 23.w, vertical: 8.h),
child: Column( child: Column(
@ -1114,17 +1272,23 @@ class _Settlement extends State<Settlement> {
), ),
GestureDetector( GestureDetector(
child: Icon( child: Icon(
(coupon != null && !coupon.isEx) (!(couponList?.isEx??false))
? Icons.keyboard_arrow_down ? Icons.keyboard_arrow_down
: Icons.keyboard_arrow_up, : Icons.keyboard_arrow_up,
color: Colors.black, color: Colors.black,
size: 18, size: 18,
), // ), //
onTap: callbackEx, onTap: (){
setState(() {
state((){
this.settleOrderInfo.couponList[index].isEx = !(this.settleOrderInfo.couponList[index].isEx??false);
});
});
},
), ),
], ],
), ),
if (coupon != null && coupon.isEx) if (couponList?.isEx??false)
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -1136,10 +1300,10 @@ class _Settlement extends State<Settlement> {
), ),
), ),
Text( Text(
(coupon.useStartTime == null && (couponList.useStartTime == null &&
coupon.useEndTime == null) couponList.useEndTime == null)
? S.of(context).quantian ? S.of(context).quantian
: "${coupon.useStartTime.replaceAll("-", ".").split(" ")[0]} - ${coupon.useEndTime.replaceAll("-", ".").split(" ")[0]}", : "${couponList.useStartTime.replaceAll("-", ".").split(" ")[0]} - ${couponList.useEndTime.replaceAll("-", ".").split(" ")[0]}",
style: TextStyle( style: TextStyle(
color: Color(0xFF353535), color: Color(0xFF353535),
fontSize: 10.sp, fontSize: 10.sp,

Loading…
Cancel
Save