diff --git a/lib/order/order_detail_page.dart b/lib/order/order_detail_page.dart index 54c00298..727e2725 100644 --- a/lib/order/order_detail_page.dart +++ b/lib/order/order_detail_page.dart @@ -70,6 +70,7 @@ class _OrderDetailPage extends State { if (mounted) setState(() { statusTitle(); + }); } } @@ -95,8 +96,8 @@ class _OrderDetailPage extends State { child: Scaffold( backgroundColor: Colors.transparent, appBar: MyAppBar( - title: title ?? S.of(context).jinxingzhongdedingdan, - titleColor: Colors.transparent, + title: "订单详情", + titleColor: Colors.white, background: Colors.transparent, leadingColor: Colors.white, // toolbarHeight: (orderStatus >= 4 ? 118.h : 118.h) + @@ -260,6 +261,7 @@ class _OrderDetailPage extends State { } } + Widget couponRemarks() { return Container( margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 8.h, bottom: 2.h), diff --git a/lib/order/order_view/order_status.dart b/lib/order/order_view/order_status.dart index 5a06d926..5aad2bbc 100644 --- a/lib/order/order_view/order_status.dart +++ b/lib/order/order_view/order_status.dart @@ -3,8 +3,8 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/order_info.dart'; import 'package:huixiang/utils/flutter_utils.dart'; +import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/border_text.dart'; -import 'package:huixiang/view_widget/icon_text.dart'; import 'package:huixiang/view_widget/round_button.dart'; class OrderStatus extends StatefulWidget { @@ -37,21 +37,21 @@ class _OrderStatus extends State { padding: EdgeInsets.fromLTRB(16.w, 0, 16.w, 10.h), child: Column( children: [ - Visibility( - visible: widget.center != null && widget.center != "", - child: Container( - child: IconText( - (widget.center != null && widget.center != "") ? widget.center : "", - leftImage: "assets/image/icon_order_ok.png", - iconSize: 40.w, - textStyle: TextStyle( - fontSize: 24.sp, - fontWeight: FontWeight.bold, - color: Colors.white, - ), - ), - ), - ), + // Visibility( + // visible: widget.center != null && widget.center != "", + // child: Container( + // child: IconText( + // (widget.center != null && widget.center != "") ? widget.center : "", + // // leftImage: "assets/image/icon_order_ok.png", + // // iconSize: 40.w, + // textStyle: TextStyle( + // fontSize: 18.sp, + // fontWeight: MyFontWeight.semi_bold, + // color: Colors.white, + // ), + // ), + // ), + // ), Expanded( child: Row( mainAxisAlignment: MainAxisAlignment.end, @@ -78,12 +78,24 @@ class _OrderStatus extends State { backgroup: Color(0xFF32A060), radius: 15.w, ), - Text( - widget.title, - style: TextStyle( - color: Colors.white, - fontSize: 12.sp, - ), + Row( + mainAxisAlignment:MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text( + widget.title, + style: TextStyle( + color: Colors.white, + fontWeight: MyFontWeight.regular, + fontSize: 15.sp, + ), + ), + Image.asset( + "assets/image/order_ok.png", + height: 66.h, + width:66.w, + ), + ], ), ], ), diff --git a/lib/retrofit/data/settleOrderInfo.dart b/lib/retrofit/data/settleOrderInfo.dart new file mode 100644 index 00000000..be4c82c1 --- /dev/null +++ b/lib/retrofit/data/settleOrderInfo.dart @@ -0,0 +1,787 @@ +/// couponList : [{"allProduct":true,"bizId":"","bizType":0,"couponId":0,"discountAmount":0,"discountPercent":0,"fullAmount":0,"fullNumber":0,"id":0,"mid":0,"productList":[{"applyPrice":0,"attrStyle":0,"categoryId":0,"groupId":0,"id":0,"isDelete":0,"materialId":0,"needLogistics":0,"oversold":0,"posShow":true,"price":0,"printerFlag":"","productCode":"","productName":"","productNumber":0,"productType":0,"sellCount":0,"sellDesc":"","setMeal":0,"shortName":"","status":0,"stock":0,"storeId":0,"supplierName":"","weight":0}],"promotionId":0,"promotionName":"","publishEndTime":"","publishStartTime":"","receiveTime":"","status":0,"storeId":0,"tenantCode":"","type":0,"usable":true,"useEndTime":"","useStartTime":"","useTime":""}] +/// discountAmount : 0 +/// freePostAge : 0 +/// memberVO : {"addressId":0,"age":0,"balance":0,"birth":"","createTime":"","headimg":"","isBind":true,"level":0,"memberRankVo":{"id":0,"nextId":0,"nextName":"","nextOrigin":0,"rankContent":"","rankImg":"","rankName":"","rankOrigin":0,"status":true},"money":0,"nickname":"","phone":"","points":0,"remark":"","sex":"","userType":true,"vipNo":""} +/// mins : 0 +/// orderNum : 0 +/// orderProductList : [{"actInfo":{"couponDiscountAmount":0,"couponDiscountRate":0,"couponId":0,"couponType":0,"discountAmount":0,"discountRate":0,"promotionId":0,"promotionType":0},"applyPrice":0,"batch":0,"buyNum":0,"discountAmount":0,"discountPercent":0,"id":0,"isDelete":0,"orderId":0,"postPay":0,"productId":0,"productName":"","reason":"","refundNum":0,"sellPrice":0,"skuId":0,"skuImg":"","skuNameStr":"","status":true,"storeId":0,"tenantCode":"","type":0,"weight":0}] +/// orderSum : 0 +/// postAge : 0 +/// price : 0 +/// productNum : 0 +/// promotionInfoList : [{"activityEndTime":"","activityStartTime":"","applyEndTime":"","applyStartTime":"","canPartake":true,"channels":[],"description":"","doEndTime":{"hour":0,"minute":0,"nano":0,"second":0},"doStartTime":{"hour":0,"minute":0,"nano":0,"second":0},"id":0,"image":"","isDelete":0,"isNeedSecurityDeposit":0,"isVip":true,"name":"","promotionDetail":[{}],"promotionPlan":0,"promotionProuctList":[{"id":0,"isDelete":0,"productId":0,"promotionId":0,"tenantCode":""}],"promotionType":0,"securityDeposit":0,"status":0,"storeId":0,"tag":""}] +/// threshold : 0 + +class SettleOrderInfo { + List couponList; + int discountAmount; + int freePostAge; + MemberVOBean memberVO; + int mins; + int orderNum; + List orderProductList; + int orderSum; + int postAge; + int price; + int productNum; + List promotionInfoList; + int threshold; + + static SettleOrderInfo fromJson(Map map) { + if (map == null) return null; + SettleOrderInfo settleOrderInfoBean = SettleOrderInfo(); + settleOrderInfoBean.couponList = List()..addAll( + (map['couponList'] as List ?? []).map((o) => CouponListBean.fromJson(o)) + ); + settleOrderInfoBean.discountAmount = map['discountAmount']; + settleOrderInfoBean.freePostAge = map['freePostAge']; + settleOrderInfoBean.memberVO = MemberVOBean.fromJson(map['memberVO']); + settleOrderInfoBean.mins = map['mins']; + settleOrderInfoBean.orderNum = map['orderNum']; + settleOrderInfoBean.orderProductList = List()..addAll( + (map['orderProductList'] as List ?? []).map((o) => OrderProductListBean.fromJson(o)) + ); + settleOrderInfoBean.orderSum = map['orderSum']; + settleOrderInfoBean.postAge = map['postAge']; + settleOrderInfoBean.price = map['price']; + settleOrderInfoBean.productNum = map['productNum']; + settleOrderInfoBean.promotionInfoList = List()..addAll( + (map['promotionInfoList'] as List ?? []).map((o) => PromotionInfoListBean.fromJson(o)) + ); + settleOrderInfoBean.threshold = map['threshold']; + return settleOrderInfoBean; + } + + Map toJson() => { + "couponList": couponList, + "discountAmount": discountAmount, + "freePostAge": freePostAge, + "memberVO": memberVO, + "mins": mins, + "orderNum": orderNum, + "orderProductList": orderProductList, + "orderSum": orderSum, + "postAge": postAge, + "price": price, + "productNum": productNum, + "promotionInfoList": promotionInfoList, + "threshold": threshold, + }; +} + +/// activityEndTime : "" +/// activityStartTime : "" +/// applyEndTime : "" +/// applyStartTime : "" +/// canPartake : true +/// channels : [] +/// description : "" +/// doEndTime : {"hour":0,"minute":0,"nano":0,"second":0} +/// doStartTime : {"hour":0,"minute":0,"nano":0,"second":0} +/// id : 0 +/// image : "" +/// isDelete : 0 +/// isNeedSecurityDeposit : 0 +/// isVip : true +/// name : "" +/// promotionDetail : [{}] +/// promotionPlan : 0 +/// promotionProuctList : [{"id":0,"isDelete":0,"productId":0,"promotionId":0,"tenantCode":""}] +/// promotionType : 0 +/// securityDeposit : 0 +/// status : 0 +/// storeId : 0 +/// tag : "" + +class PromotionInfoListBean { + String activityEndTime; + String activityStartTime; + String applyEndTime; + String applyStartTime; + bool canPartake; + List channels; + String description; + DoEndTimeBean doEndTime; + DoStartTimeBean doStartTime; + int id; + String image; + int isDelete; + int isNeedSecurityDeposit; + bool isVip; + String name; + List promotionDetail; + int promotionPlan; + List promotionProuctList; + int promotionType; + int securityDeposit; + int status; + int storeId; + String tag; + + static PromotionInfoListBean fromJson(Map map) { + if (map == null) return null; + PromotionInfoListBean promotionInfoListBean = PromotionInfoListBean(); + promotionInfoListBean.activityEndTime = map['activityEndTime']; + promotionInfoListBean.activityStartTime = map['activityStartTime']; + promotionInfoListBean.applyEndTime = map['applyEndTime']; + promotionInfoListBean.applyStartTime = map['applyStartTime']; + promotionInfoListBean.canPartake = map['canPartake']; + promotionInfoListBean.channels = map['channels']; + promotionInfoListBean.description = map['description']; + promotionInfoListBean.doEndTime = DoEndTimeBean.fromJson(map['doEndTime']); + promotionInfoListBean.doStartTime = DoStartTimeBean.fromJson(map['doStartTime']); + promotionInfoListBean.id = map['id']; + promotionInfoListBean.image = map['image']; + promotionInfoListBean.isDelete = map['isDelete']; + promotionInfoListBean.isNeedSecurityDeposit = map['isNeedSecurityDeposit']; + promotionInfoListBean.isVip = map['isVip']; + promotionInfoListBean.name = map['name']; + promotionInfoListBean.promotionDetail = List()..addAll( + (map['promotionDetail'] as List ?? []).map((o) => PromotionDetailBean.fromJson(o)) + ); + promotionInfoListBean.promotionPlan = map['promotionPlan']; + promotionInfoListBean.promotionProuctList = List()..addAll( + (map['promotionProuctList'] as List ?? []).map((o) => PromotionProuctListBean.fromJson(o)) + ); + promotionInfoListBean.promotionType = map['promotionType']; + promotionInfoListBean.securityDeposit = map['securityDeposit']; + promotionInfoListBean.status = map['status']; + promotionInfoListBean.storeId = map['storeId']; + promotionInfoListBean.tag = map['tag']; + return promotionInfoListBean; + } + + Map toJson() => { + "activityEndTime": activityEndTime, + "activityStartTime": activityStartTime, + "applyEndTime": applyEndTime, + "applyStartTime": applyStartTime, + "canPartake": canPartake, + "channels": channels, + "description": description, + "doEndTime": doEndTime, + "doStartTime": doStartTime, + "id": id, + "image": image, + "isDelete": isDelete, + "isNeedSecurityDeposit": isNeedSecurityDeposit, + "isVip": isVip, + "name": name, + "promotionDetail": promotionDetail, + "promotionPlan": promotionPlan, + "promotionProuctList": promotionProuctList, + "promotionType": promotionType, + "securityDeposit": securityDeposit, + "status": status, + "storeId": storeId, + "tag": tag, + }; +} + +/// id : 0 +/// isDelete : 0 +/// productId : 0 +/// promotionId : 0 +/// tenantCode : "" + +class PromotionProuctListBean { + int id; + int isDelete; + int productId; + int promotionId; + String tenantCode; + + static PromotionProuctListBean fromJson(Map map) { + if (map == null) return null; + PromotionProuctListBean promotionProuctListBean = PromotionProuctListBean(); + promotionProuctListBean.id = map['id']; + promotionProuctListBean.isDelete = map['isDelete']; + promotionProuctListBean.productId = map['productId']; + promotionProuctListBean.promotionId = map['promotionId']; + promotionProuctListBean.tenantCode = map['tenantCode']; + return promotionProuctListBean; + } + + Map toJson() => { + "id": id, + "isDelete": isDelete, + "productId": productId, + "promotionId": promotionId, + "tenantCode": tenantCode, + }; +} + + +class PromotionDetailBean { + + static PromotionDetailBean fromJson(Map map) { + if (map == null) return null; + PromotionDetailBean promotionDetailBean = PromotionDetailBean(); + return promotionDetailBean; + } + + Map toJson() => { + }; +} + +/// hour : 0 +/// minute : 0 +/// nano : 0 +/// second : 0 + +class DoStartTimeBean { + int hour; + int minute; + int nano; + int second; + + static DoStartTimeBean fromJson(Map map) { + if (map == null) return null; + DoStartTimeBean doStartTimeBean = DoStartTimeBean(); + doStartTimeBean.hour = map['hour']; + doStartTimeBean.minute = map['minute']; + doStartTimeBean.nano = map['nano']; + doStartTimeBean.second = map['second']; + return doStartTimeBean; + } + + Map toJson() => { + "hour": hour, + "minute": minute, + "nano": nano, + "second": second, + }; +} + +/// hour : 0 +/// minute : 0 +/// nano : 0 +/// second : 0 + +class DoEndTimeBean { + int hour; + int minute; + int nano; + int second; + + static DoEndTimeBean fromJson(Map map) { + if (map == null) return null; + DoEndTimeBean doEndTimeBean = DoEndTimeBean(); + doEndTimeBean.hour = map['hour']; + doEndTimeBean.minute = map['minute']; + doEndTimeBean.nano = map['nano']; + doEndTimeBean.second = map['second']; + return doEndTimeBean; + } + + Map toJson() => { + "hour": hour, + "minute": minute, + "nano": nano, + "second": second, + }; +} + +/// actInfo : {"couponDiscountAmount":0,"couponDiscountRate":0,"couponId":0,"couponType":0,"discountAmount":0,"discountRate":0,"promotionId":0,"promotionType":0} +/// applyPrice : 0 +/// batch : 0 +/// buyNum : 0 +/// discountAmount : 0 +/// discountPercent : 0 +/// id : 0 +/// isDelete : 0 +/// orderId : 0 +/// postPay : 0 +/// productId : 0 +/// productName : "" +/// reason : "" +/// refundNum : 0 +/// sellPrice : 0 +/// skuId : 0 +/// skuImg : "" +/// skuNameStr : "" +/// status : true +/// storeId : 0 +/// tenantCode : "" +/// type : 0 +/// weight : 0 + +class OrderProductListBean { + ActInfoBean actInfo; + int applyPrice; + int batch; + int buyNum; + int discountAmount; + int discountPercent; + int id; + int isDelete; + int orderId; + int postPay; + int productId; + String productName; + String reason; + int refundNum; + int sellPrice; + int skuId; + String skuImg; + String skuNameStr; + bool status; + int storeId; + String tenantCode; + int type; + int weight; + + static OrderProductListBean fromJson(Map map) { + if (map == null) return null; + OrderProductListBean orderProductListBean = OrderProductListBean(); + orderProductListBean.actInfo = ActInfoBean.fromJson(map['actInfo']); + orderProductListBean.applyPrice = map['applyPrice']; + orderProductListBean.batch = map['batch']; + orderProductListBean.buyNum = map['buyNum']; + orderProductListBean.discountAmount = map['discountAmount']; + orderProductListBean.discountPercent = map['discountPercent']; + orderProductListBean.id = map['id']; + orderProductListBean.isDelete = map['isDelete']; + orderProductListBean.orderId = map['orderId']; + orderProductListBean.postPay = map['postPay']; + orderProductListBean.productId = map['productId']; + orderProductListBean.productName = map['productName']; + orderProductListBean.reason = map['reason']; + orderProductListBean.refundNum = map['refundNum']; + orderProductListBean.sellPrice = map['sellPrice']; + orderProductListBean.skuId = map['skuId']; + orderProductListBean.skuImg = map['skuImg']; + orderProductListBean.skuNameStr = map['skuNameStr']; + orderProductListBean.status = map['status']; + orderProductListBean.storeId = map['storeId']; + orderProductListBean.tenantCode = map['tenantCode']; + orderProductListBean.type = map['type']; + orderProductListBean.weight = map['weight']; + return orderProductListBean; + } + + Map toJson() => { + "actInfo": actInfo, + "applyPrice": applyPrice, + "batch": batch, + "buyNum": buyNum, + "discountAmount": discountAmount, + "discountPercent": discountPercent, + "id": id, + "isDelete": isDelete, + "orderId": orderId, + "postPay": postPay, + "productId": productId, + "productName": productName, + "reason": reason, + "refundNum": refundNum, + "sellPrice": sellPrice, + "skuId": skuId, + "skuImg": skuImg, + "skuNameStr": skuNameStr, + "status": status, + "storeId": storeId, + "tenantCode": tenantCode, + "type": type, + "weight": weight, + }; +} + +/// couponDiscountAmount : 0 +/// couponDiscountRate : 0 +/// couponId : 0 +/// couponType : 0 +/// discountAmount : 0 +/// discountRate : 0 +/// promotionId : 0 +/// promotionType : 0 + +class ActInfoBean { + int couponDiscountAmount; + int couponDiscountRate; + int couponId; + int couponType; + int discountAmount; + int discountRate; + int promotionId; + int promotionType; + + static ActInfoBean fromJson(Map map) { + if (map == null) return null; + ActInfoBean actInfoBean = ActInfoBean(); + actInfoBean.couponDiscountAmount = map['couponDiscountAmount']; + actInfoBean.couponDiscountRate = map['couponDiscountRate']; + actInfoBean.couponId = map['couponId']; + actInfoBean.couponType = map['couponType']; + actInfoBean.discountAmount = map['discountAmount']; + actInfoBean.discountRate = map['discountRate']; + actInfoBean.promotionId = map['promotionId']; + actInfoBean.promotionType = map['promotionType']; + return actInfoBean; + } + + Map toJson() => { + "couponDiscountAmount": couponDiscountAmount, + "couponDiscountRate": couponDiscountRate, + "couponId": couponId, + "couponType": couponType, + "discountAmount": discountAmount, + "discountRate": discountRate, + "promotionId": promotionId, + "promotionType": promotionType, + }; +} + +/// addressId : 0 +/// age : 0 +/// balance : 0 +/// birth : "" +/// createTime : "" +/// headimg : "" +/// isBind : true +/// level : 0 +/// memberRankVo : {"id":0,"nextId":0,"nextName":"","nextOrigin":0,"rankContent":"","rankImg":"","rankName":"","rankOrigin":0,"status":true} +/// money : 0 +/// nickname : "" +/// phone : "" +/// points : 0 +/// remark : "" +/// sex : "" +/// userType : true +/// vipNo : "" + +class MemberVOBean { + int addressId; + int age; + int balance; + String birth; + String createTime; + String headimg; + bool isBind; + int level; + MemberRankVoBean memberRankVo; + int money; + String nickname; + String phone; + int points; + String remark; + String sex; + bool userType; + String vipNo; + + static MemberVOBean fromJson(Map map) { + if (map == null) return null; + MemberVOBean memberVOBean = MemberVOBean(); + memberVOBean.addressId = map['addressId']; + memberVOBean.age = map['age']; + memberVOBean.balance = map['balance']; + memberVOBean.birth = map['birth']; + memberVOBean.createTime = map['createTime']; + memberVOBean.headimg = map['headimg']; + memberVOBean.isBind = map['isBind']; + memberVOBean.level = map['level']; + memberVOBean.memberRankVo = MemberRankVoBean.fromJson(map['memberRankVo']); + memberVOBean.money = map['money']; + memberVOBean.nickname = map['nickname']; + memberVOBean.phone = map['phone']; + memberVOBean.points = map['points']; + memberVOBean.remark = map['remark']; + memberVOBean.sex = map['sex']; + memberVOBean.userType = map['userType']; + memberVOBean.vipNo = map['vipNo']; + return memberVOBean; + } + + Map toJson() => { + "addressId": addressId, + "age": age, + "balance": balance, + "birth": birth, + "createTime": createTime, + "headimg": headimg, + "isBind": isBind, + "level": level, + "memberRankVo": memberRankVo, + "money": money, + "nickname": nickname, + "phone": phone, + "points": points, + "remark": remark, + "sex": sex, + "userType": userType, + "vipNo": vipNo, + }; +} + +/// id : 0 +/// nextId : 0 +/// nextName : "" +/// nextOrigin : 0 +/// rankContent : "" +/// rankImg : "" +/// rankName : "" +/// rankOrigin : 0 +/// status : true + +class MemberRankVoBean { + int id; + int nextId; + String nextName; + int nextOrigin; + String rankContent; + String rankImg; + String rankName; + int rankOrigin; + bool status; + + static MemberRankVoBean fromJson(Map map) { + if (map == null) return null; + MemberRankVoBean memberRankVoBean = MemberRankVoBean(); + memberRankVoBean.id = map['id']; + memberRankVoBean.nextId = map['nextId']; + memberRankVoBean.nextName = map['nextName']; + memberRankVoBean.nextOrigin = map['nextOrigin']; + memberRankVoBean.rankContent = map['rankContent']; + memberRankVoBean.rankImg = map['rankImg']; + memberRankVoBean.rankName = map['rankName']; + memberRankVoBean.rankOrigin = map['rankOrigin']; + memberRankVoBean.status = map['status']; + return memberRankVoBean; + } + + Map toJson() => { + "id": id, + "nextId": nextId, + "nextName": nextName, + "nextOrigin": nextOrigin, + "rankContent": rankContent, + "rankImg": rankImg, + "rankName": rankName, + "rankOrigin": rankOrigin, + "status": status, + }; +} + +/// allProduct : true +/// bizId : "" +/// bizType : 0 +/// couponId : 0 +/// discountAmount : 0 +/// discountPercent : 0 +/// fullAmount : 0 +/// fullNumber : 0 +/// id : 0 +/// mid : 0 +/// productList : [{"applyPrice":0,"attrStyle":0,"categoryId":0,"groupId":0,"id":0,"isDelete":0,"materialId":0,"needLogistics":0,"oversold":0,"posShow":true,"price":0,"printerFlag":"","productCode":"","productName":"","productNumber":0,"productType":0,"sellCount":0,"sellDesc":"","setMeal":0,"shortName":"","status":0,"stock":0,"storeId":0,"supplierName":"","weight":0}] +/// promotionId : 0 +/// promotionName : "" +/// publishEndTime : "" +/// publishStartTime : "" +/// receiveTime : "" +/// status : 0 +/// storeId : 0 +/// tenantCode : "" +/// type : 0 +/// usable : true +/// useEndTime : "" +/// useStartTime : "" +/// useTime : "" + +class CouponListBean { + bool allProduct; + String bizId; + int bizType; + int couponId; + int discountAmount; + int discountPercent; + int fullAmount; + int fullNumber; + int id; + int mid; + List productList; + int promotionId; + String promotionName; + String publishEndTime; + String publishStartTime; + String receiveTime; + int status; + int storeId; + String tenantCode; + int type; + bool usable; + String useEndTime; + String useStartTime; + String useTime; + + static CouponListBean fromJson(Map map) { + if (map == null) return null; + CouponListBean couponListBean = CouponListBean(); + couponListBean.allProduct = map['allProduct']; + couponListBean.bizId = map['bizId']; + couponListBean.bizType = map['bizType']; + couponListBean.couponId = map['couponId']; + couponListBean.discountAmount = map['discountAmount']; + couponListBean.discountPercent = map['discountPercent']; + couponListBean.fullAmount = map['fullAmount']; + couponListBean.fullNumber = map['fullNumber']; + couponListBean.id = map['id']; + couponListBean.mid = map['mid']; + couponListBean.productList = List()..addAll( + (map['productList'] as List ?? []).map((o) => ProductListBean.fromJson(o)) + ); + couponListBean.promotionId = map['promotionId']; + couponListBean.promotionName = map['promotionName']; + couponListBean.publishEndTime = map['publishEndTime']; + couponListBean.publishStartTime = map['publishStartTime']; + couponListBean.receiveTime = map['receiveTime']; + couponListBean.status = map['status']; + couponListBean.storeId = map['storeId']; + couponListBean.tenantCode = map['tenantCode']; + couponListBean.type = map['type']; + couponListBean.usable = map['usable']; + couponListBean.useEndTime = map['useEndTime']; + couponListBean.useStartTime = map['useStartTime']; + couponListBean.useTime = map['useTime']; + return couponListBean; + } + + Map toJson() => { + "allProduct": allProduct, + "bizId": bizId, + "bizType": bizType, + "couponId": couponId, + "discountAmount": discountAmount, + "discountPercent": discountPercent, + "fullAmount": fullAmount, + "fullNumber": fullNumber, + "id": id, + "mid": mid, + "productList": productList, + "promotionId": promotionId, + "promotionName": promotionName, + "publishEndTime": publishEndTime, + "publishStartTime": publishStartTime, + "receiveTime": receiveTime, + "status": status, + "storeId": storeId, + "tenantCode": tenantCode, + "type": type, + "usable": usable, + "useEndTime": useEndTime, + "useStartTime": useStartTime, + "useTime": useTime, + }; +} + +/// applyPrice : 0 +/// attrStyle : 0 +/// categoryId : 0 +/// groupId : 0 +/// id : 0 +/// isDelete : 0 +/// materialId : 0 +/// needLogistics : 0 +/// oversold : 0 +/// posShow : true +/// price : 0 +/// printerFlag : "" +/// productCode : "" +/// productName : "" +/// productNumber : 0 +/// productType : 0 +/// sellCount : 0 +/// sellDesc : "" +/// setMeal : 0 +/// shortName : "" +/// status : 0 +/// stock : 0 +/// storeId : 0 +/// supplierName : "" +/// weight : 0 + +class ProductListBean { + int applyPrice; + int attrStyle; + int categoryId; + int groupId; + int id; + int isDelete; + int materialId; + int needLogistics; + int oversold; + bool posShow; + int price; + String printerFlag; + String productCode; + String productName; + int productNumber; + int productType; + int sellCount; + String sellDesc; + int setMeal; + String shortName; + int status; + int stock; + int storeId; + String supplierName; + int weight; + + static ProductListBean fromJson(Map map) { + if (map == null) return null; + ProductListBean productListBean = ProductListBean(); + productListBean.applyPrice = map['applyPrice']; + productListBean.attrStyle = map['attrStyle']; + productListBean.categoryId = map['categoryId']; + productListBean.groupId = map['groupId']; + productListBean.id = map['id']; + productListBean.isDelete = map['isDelete']; + productListBean.materialId = map['materialId']; + productListBean.needLogistics = map['needLogistics']; + productListBean.oversold = map['oversold']; + productListBean.posShow = map['posShow']; + productListBean.price = map['price']; + productListBean.printerFlag = map['printerFlag']; + productListBean.productCode = map['productCode']; + productListBean.productName = map['productName']; + productListBean.productNumber = map['productNumber']; + productListBean.productType = map['productType']; + productListBean.sellCount = map['sellCount']; + productListBean.sellDesc = map['sellDesc']; + productListBean.setMeal = map['setMeal']; + productListBean.shortName = map['shortName']; + productListBean.status = map['status']; + productListBean.stock = map['stock']; + productListBean.storeId = map['storeId']; + productListBean.supplierName = map['supplierName']; + productListBean.weight = map['weight']; + return productListBean; + } + + Map toJson() => { + "applyPrice": applyPrice, + "attrStyle": attrStyle, + "categoryId": categoryId, + "groupId": groupId, + "id": id, + "isDelete": isDelete, + "materialId": materialId, + "needLogistics": needLogistics, + "oversold": oversold, + "posShow": posShow, + "price": price, + "printerFlag": printerFlag, + "productCode": productCode, + "productName": productName, + "productNumber": productNumber, + "productType": productType, + "sellCount": sellCount, + "sellDesc": sellDesc, + "setMeal": setMeal, + "shortName": shortName, + "status": status, + "stock": stock, + "storeId": storeId, + "supplierName": supplierName, + "weight": weight, + }; +} \ No newline at end of file diff --git a/lib/retrofit/data/shoppingCart.dart b/lib/retrofit/data/shoppingCart.dart index c6a85668..d1e36005 100644 --- a/lib/retrofit/data/shoppingCart.dart +++ b/lib/retrofit/data/shoppingCart.dart @@ -15,14 +15,14 @@ class ShoppingCart { String storeName; int tableId; - static ShoppingCart fromJon(Map map) { + static ShoppingCart fromJson(Map map) { if (map == null) return null; ShoppingCart shoppingCartBean = ShoppingCart(); shoppingCartBean.cartSum = map['cartSum']; shoppingCartBean.numberOfPeople = map['numberOfPeople']; shoppingCartBean.selected = map['selected']; shoppingCartBean.shoppingCartSkuItemList = List()..addAll( - (map['shoppingCartSkuItemList'] as List ?? []).map((o) => ShoppingCartSkuItemListBean.fromJon(o)) + (map['shoppingCartSkuItemList'] as List ?? []).map((o) => ShoppingCartSkuItemListBean.fromJson(o)) ); shoppingCartBean.storeId = map['storeId']; shoppingCartBean.storeName = map['storeName']; @@ -72,7 +72,7 @@ class ShoppingCartSkuItemListBean { int storeId; int tableId; - static ShoppingCartSkuItemListBean fromJon(Map map) { + static ShoppingCartSkuItemListBean fromJson(Map map) { if (map == null) return null; ShoppingCartSkuItemListBean shoppingCartSkuItemListBean = ShoppingCartSkuItemListBean(); shoppingCartSkuItemListBean.buyNum = map['buyNum']; @@ -80,7 +80,7 @@ class ShoppingCartSkuItemListBean { shoppingCartSkuItemListBean.groupId = map['groupId']; shoppingCartSkuItemListBean.id = map['id']; shoppingCartSkuItemListBean.platterList = List()..addAll( - (map['platterList'] as List ?? []).map((o) => PlatterListBean.fromJon(o)) + (map['platterList'] as List ?? []).map((o) => PlatterListBean.fromJson(o)) ); shoppingCartSkuItemListBean.productId = map['productId']; shoppingCartSkuItemListBean.productName = map['productName']; @@ -125,7 +125,7 @@ class PlatterListBean { bool required; int skuId; - static PlatterListBean fromJon(Map map) { + static PlatterListBean fromJson(Map map) { if (map == null) return null; PlatterListBean platterListBean = PlatterListBean(); platterListBean.deleted = map['deleted']; diff --git a/lib/store/store_order.dart b/lib/store/store_order.dart index c1a28881..2c497735 100644 --- a/lib/store/store_order.dart +++ b/lib/store/store_order.dart @@ -9,6 +9,7 @@ import 'package:huixiang/retrofit/data/activity.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/findMiNiGroupList.dart'; import 'package:huixiang/retrofit/data/miNiDetail.dart'; +import 'package:huixiang/retrofit/data/shoppingCart.dart'; import 'package:huixiang/retrofit/data/store_info.dart'; import 'package:huixiang/retrofit/min_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; @@ -266,16 +267,13 @@ class _StoreOrderPage extends State coupon: true, ), - SizedBox( - height: 8, - ), - ///门店对应VIP信息 Vip(storeInfo, () {}, false), + ], ), ), - top: 110.h, + top:100.h, bottom: 0, left: 0, right: 0, @@ -483,17 +481,7 @@ class _StoreOrderPage extends State } } - ///添加购物车 - addsShoppingCart() async { - BaseData baseDate = await apiService.creditOrder({ - "parentId": widget.arguments["parentId"], - "skuImg": widget.arguments["skuImg"], - "skuNameStr": widget.arguments["skuNameStr"], - "skuPrice": widget.arguments["skuPrice"], - "skuStock": widget.arguments["skuStock"], - }); - if (baseDate != null && baseDate.isSuccess) {} - } + ///选规格弹窗 showStoreSelector(MiNiDetail miNiDetail) { diff --git a/lib/store/store_view/settlement.dart b/lib/store/store_view/settlement.dart index 5ab3b2bf..06605b0d 100644 --- a/lib/store/store_view/settlement.dart +++ b/lib/store/store_view/settlement.dart @@ -1,10 +1,13 @@ import 'package:dio/dio.dart'; 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/order/order_view/order_commodity.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/order_info.dart'; +import 'package:huixiang/retrofit/data/settleOrderInfo.dart'; +import 'package:huixiang/retrofit/min_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; @@ -26,6 +29,7 @@ class Settlement extends StatefulWidget { class _Settlement extends State { ApiService apiService; + MinApiService minService; int selectedBtn = 0; @override @@ -38,7 +42,7 @@ class _Settlement extends State { context: context, token: value.getString("token"), ); - queryDetails(); + queryOrderInfo(); }); } @@ -72,6 +76,20 @@ class _Settlement extends State { } } + ///订单结算信息 + queryOrderInfo() async { + BaseData baseData = await minService.getOrderInfo({ + "addressId":0, + "isTake": 0, + "memberCouponId": 0, + "orderId": widget.arguments["orderId"], + "promotionId": 0 + }); + if (baseData != null && baseData.isSuccess) { + setState(() {}); + } + } + @override Widget build(BuildContext context) { return Stack( @@ -113,9 +131,10 @@ class _Settlement extends State { // if (payStatus == 0) couponRemarks(), /*(payStatus == 0) ? paySelector() : */ - ///显示订单信息 + ///优惠券/备注 activityRemarks(), + ///支付方式 payMethod(), @@ -387,7 +406,8 @@ class _Settlement extends State { child: GestureDetector( onTap: () { setState(() { - selectedBtn = 2; + // selectedBtn = 2; + SmartDialog.showToast("该功能暂未开放!", alignment: Alignment.center); }); }, child: Stack( @@ -408,6 +428,7 @@ class _Settlement extends State { ], ), ), + selectedBtn == 0 ? Container( width: double.infinity, padding: EdgeInsets.only(left: 16, right: 16, top: 15), @@ -510,15 +531,64 @@ class _Settlement extends State { ) ], ), + ) + : Container( + width: double.infinity, + padding: EdgeInsets.only(left: 16, right: 16, top: 15), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/image/icon_permission_location.png", + height:24.h, + width:24.w, + ), Text( + "张先生", + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 15.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF4C4C4C), + ), + ), + SizedBox( + width: 13, + ), + Expanded(child: Text( + "12309090909", + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + fontSize: 15.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF4C4C4C), + ), + ),), + Icon( + Icons.keyboard_arrow_right, + size:24, + ), + ], + ), + Padding(padding:EdgeInsets.only(top: 4,left:25), + child: Text( + "武昌区中国铁建凯德1818蓝调步行街中北路109附33门牌号05", + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF727272), + ), + ),), + ], + ), ), ], ), - // Image.asset( - // "assets/image/shadow.png", - // width: 24.w, - // height: 24.h, - // fit: BoxFit.contain, - // ), ], ), ); diff --git a/lib/store/store_view/shop_goods.dart b/lib/store/store_view/shop_goods.dart index 5a4fc84b..cf4266a2 100644 --- a/lib/store/store_view/shop_goods.dart +++ b/lib/store/store_view/shop_goods.dart @@ -141,7 +141,8 @@ class _ShopGoods extends State { ), Spacer(), widget.productListBeans[widget.position].attrStyle == 1 - ? RoundButton( + ? + RoundButton( width: 49.w, text: S.of(context).xuanguige, textColor: Colors.white,