diff --git a/assets/image/2x/browse.png b/assets/image/2x/browse.png new file mode 100644 index 00000000..26b5ca48 Binary files /dev/null and b/assets/image/2x/browse.png differ diff --git a/assets/image/2x/follow.png b/assets/image/2x/follow.png new file mode 100644 index 00000000..c3a41e33 Binary files /dev/null and b/assets/image/2x/follow.png differ diff --git a/assets/image/2x/leaving_message.png b/assets/image/2x/leaving_message.png new file mode 100644 index 00000000..a8bb451c Binary files /dev/null and b/assets/image/2x/leaving_message.png differ diff --git a/assets/image/3x/browse.png b/assets/image/3x/browse.png new file mode 100644 index 00000000..b16f7196 Binary files /dev/null and b/assets/image/3x/browse.png differ diff --git a/assets/image/3x/follow.png b/assets/image/3x/follow.png new file mode 100644 index 00000000..bae709e5 Binary files /dev/null and b/assets/image/3x/follow.png differ diff --git a/assets/image/3x/leaving_message.png b/assets/image/3x/leaving_message.png new file mode 100644 index 00000000..4747c584 Binary files /dev/null and b/assets/image/3x/leaving_message.png differ diff --git a/assets/image/browse.png b/assets/image/browse.png new file mode 100644 index 00000000..44820e93 Binary files /dev/null and b/assets/image/browse.png differ diff --git a/assets/image/follow.png b/assets/image/follow.png new file mode 100644 index 00000000..a241b48e Binary files /dev/null and b/assets/image/follow.png differ diff --git a/assets/image/leaving_message.png b/assets/image/leaving_message.png new file mode 100644 index 00000000..6cabe1af Binary files /dev/null and b/assets/image/leaving_message.png differ diff --git a/lib/mine/release_page.dart b/lib/mine/release_page.dart index dd99cb28..e621ce45 100644 --- a/lib/mine/release_page.dart +++ b/lib/mine/release_page.dart @@ -192,17 +192,42 @@ class _ReleasePage extends State { height: 310.h, ), SizedBox(height: 17.h), - Row( + Padding(padding: EdgeInsets.only(bottom: 16), + child:Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ InkWell( onTap: () { }, - child: Icon( - Icons.close, - color: Colors.black, - size: 16, + child: Image.asset( + "assets/image/browse.png", + height: 16.h, + width: 16.w, + ), + ), + SizedBox(width:4), + Text( + "15", + style: TextStyle( + fontSize: 12.sp, + color:Color(0xFF1A1A1A), + fontWeight: MyFontWeight.regular, + ), + ), + ], + ), + Row( + children: [ + InkWell( + onTap: () { + }, + child: Image.asset( + "assets/image/leaving_message.png", + height: 16.h, + width: 16.w, ), ), SizedBox(width:4), @@ -216,9 +241,30 @@ class _ReleasePage extends State { ), ], ), + Row( + children: [ + InkWell( + onTap: () { + }, + child: Image.asset( + "assets/image/follow.png", + height: 16.h, + width: 16.w, + ), + ), + SizedBox(width:4), + Text( + "25", + style: TextStyle( + fontSize: 12.sp, + color:Color(0xFF1A1A1A), + fontWeight: MyFontWeight.regular, + ), + ), + ], + ), ], - ), - SizedBox(height: 16.h), + ),), ], ), ); diff --git a/lib/retrofit/data/settleOrderInfo.dart b/lib/retrofit/data/settleOrderInfo.dart index be4c82c1..7e62c6b7 100644 --- a/lib/retrofit/data/settleOrderInfo.dart +++ b/lib/retrofit/data/settleOrderInfo.dart @@ -1,787 +1,453 @@ -/// 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; + int mins; + dynamic memberVO; + String postAge; + String price; + String orderSum; + String discountAmount; List promotionInfoList; - int threshold; + List couponList; + String threshold; + String freePostAge; + List orderProductList; 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.productNum = map['productNum']; + settleOrderInfoBean.mins = map['mins']; + settleOrderInfoBean.memberVO = map['memberVO']; settleOrderInfoBean.postAge = map['postAge']; settleOrderInfoBean.price = map['price']; - settleOrderInfoBean.productNum = map['productNum']; + settleOrderInfoBean.orderSum = map['orderSum']; + settleOrderInfoBean.discountAmount = map['discountAmount']; settleOrderInfoBean.promotionInfoList = List()..addAll( (map['promotionInfoList'] as List ?? []).map((o) => PromotionInfoListBean.fromJson(o)) ); + settleOrderInfoBean.couponList = List()..addAll( + (map['couponList'] as List ?? []).map((o) => CouponListBean.fromJson(o)) + ); settleOrderInfoBean.threshold = map['threshold']; + settleOrderInfoBean.freePostAge = map['freePostAge']; + settleOrderInfoBean.orderProductList = List()..addAll( + (map['orderProductList'] as List ?? []).map((o) => OrderProductListBean.fromJson(o)) + ); return settleOrderInfoBean; } Map toJson() => { - "couponList": couponList, - "discountAmount": discountAmount, - "freePostAge": freePostAge, - "memberVO": memberVO, - "mins": mins, "orderNum": orderNum, - "orderProductList": orderProductList, - "orderSum": orderSum, + "productNum": productNum, + "mins": mins, + "memberVO": memberVO, "postAge": postAge, "price": price, - "productNum": productNum, + "orderSum": orderSum, + "discountAmount": discountAmount, "promotionInfoList": promotionInfoList, + "couponList": couponList, "threshold": threshold, + "freePostAge": freePostAge, + "orderProductList": orderProductList, }; } -/// 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 +/// id : null +/// createTime : null +/// createUser : null +/// updateTime : null +/// updateUser : null +/// tenantCode : null +/// storeId : null +/// orderId : null +/// actInfo : null +/// productId : "1426095718614958080" +/// productName : "ɣ�������̸�" +/// skuId : "1426095718740787200" +/// skuNameStr : "ɳ�� ������ 700ml" +/// skuImg : null +/// buyNum : 1 +/// refundNum : null +/// type : null +/// reason : null +/// weight : 0.0 +/// applyPrice : "28.00" +/// sellPrice : "28.00" +/// postPay : null +/// isDelete : null +/// discountAmount : null +/// discountPercent : null +/// status : null +/// batch : null class OrderProductListBean { - ActInfoBean actInfo; - int applyPrice; - int batch; - int buyNum; - int discountAmount; - int discountPercent; - int id; - int isDelete; - int orderId; - int postPay; - int productId; + dynamic id; + dynamic createTime; + dynamic createUser; + dynamic updateTime; + dynamic updateUser; + dynamic tenantCode; + dynamic storeId; + dynamic orderId; + dynamic actInfo; + String productId; String productName; - String reason; - int refundNum; - int sellPrice; - int skuId; - String skuImg; + String skuId; String skuNameStr; - bool status; - int storeId; - String tenantCode; - int type; - int weight; + dynamic skuImg; + int buyNum; + dynamic refundNum; + dynamic type; + dynamic reason; + double weight; + String applyPrice; + String sellPrice; + dynamic postPay; + dynamic isDelete; + dynamic discountAmount; + dynamic discountPercent; + dynamic status; + dynamic batch; 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.createTime = map['createTime']; + orderProductListBean.createUser = map['createUser']; + orderProductListBean.updateTime = map['updateTime']; + orderProductListBean.updateUser = map['updateUser']; + orderProductListBean.tenantCode = map['tenantCode']; + orderProductListBean.storeId = map['storeId']; orderProductListBean.orderId = map['orderId']; - orderProductListBean.postPay = map['postPay']; + orderProductListBean.actInfo = map['actInfo']; 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.skuImg = map['skuImg']; + orderProductListBean.buyNum = map['buyNum']; + orderProductListBean.refundNum = map['refundNum']; orderProductListBean.type = map['type']; + orderProductListBean.reason = map['reason']; orderProductListBean.weight = map['weight']; + orderProductListBean.applyPrice = map['applyPrice']; + orderProductListBean.sellPrice = map['sellPrice']; + orderProductListBean.postPay = map['postPay']; + orderProductListBean.isDelete = map['isDelete']; + orderProductListBean.discountAmount = map['discountAmount']; + orderProductListBean.discountPercent = map['discountPercent']; + orderProductListBean.status = map['status']; + orderProductListBean.batch = map['batch']; return orderProductListBean; } Map toJson() => { - "actInfo": actInfo, - "applyPrice": applyPrice, - "batch": batch, - "buyNum": buyNum, - "discountAmount": discountAmount, - "discountPercent": discountPercent, "id": id, - "isDelete": isDelete, + "createTime": createTime, + "createUser": createUser, + "updateTime": updateTime, + "updateUser": updateUser, + "tenantCode": tenantCode, + "storeId": storeId, "orderId": orderId, - "postPay": postPay, + "actInfo": actInfo, "productId": productId, "productName": productName, - "reason": reason, - "refundNum": refundNum, - "sellPrice": sellPrice, "skuId": skuId, - "skuImg": skuImg, "skuNameStr": skuNameStr, - "status": status, - "storeId": storeId, - "tenantCode": tenantCode, + "skuImg": skuImg, + "buyNum": buyNum, + "refundNum": refundNum, "type": type, + "reason": reason, "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, + "applyPrice": applyPrice, + "sellPrice": sellPrice, + "postPay": postPay, + "isDelete": isDelete, "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, + "discountPercent": discountPercent, "status": status, + "batch": batch, }; } -/// allProduct : true +/// id : "1448907890034212864" +/// storeId : "1333246101343436800" +/// bizType : 1 +/// fullAmount : "10.00" +/// discountAmount : "8.00" +/// fullNumber : 1 +/// discountPercent : 100 /// 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 +/// publishStartTime : "2021-10-01" +/// publishEndTime : "2021-10-29" +/// useStartTime : "2021-10-02" +/// useEndTime : "2021-10-31" +/// promotionId : "0" +/// mid : "1438443365845696512" +/// couponId : "1448902034085380096" +/// receiveTime : "2021-10-15" +/// useTime : null +/// status : 1 +/// tenantCode : "1175" +/// type : 1 +/// promotionName : "��10-8" /// usable : true -/// useEndTime : "" -/// useStartTime : "" -/// useTime : "" +/// allProduct : true +/// productList : null class CouponListBean { - bool allProduct; - String bizId; + String id; + String storeId; int bizType; - int couponId; - int discountAmount; - int discountPercent; - int fullAmount; + String fullAmount; + String discountAmount; int fullNumber; - int id; - int mid; - List productList; - int promotionId; - String promotionName; - String publishEndTime; + int discountPercent; + String bizId; String publishStartTime; + String publishEndTime; + String useStartTime; + String useEndTime; + String promotionId; + String mid; + String couponId; String receiveTime; + dynamic useTime; int status; - int storeId; String tenantCode; int type; + String promotionName; bool usable; - String useEndTime; - String useStartTime; - String useTime; + bool allProduct; + dynamic productList; static CouponListBean fromJson(Map map) { if (map == null) return null; CouponListBean couponListBean = CouponListBean(); - couponListBean.allProduct = map['allProduct']; - couponListBean.bizId = map['bizId']; + couponListBean.id = map['id']; + couponListBean.storeId = map['storeId']; couponListBean.bizType = map['bizType']; - couponListBean.couponId = map['couponId']; - couponListBean.discountAmount = map['discountAmount']; - couponListBean.discountPercent = map['discountPercent']; couponListBean.fullAmount = map['fullAmount']; + couponListBean.discountAmount = map['discountAmount']; 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.discountPercent = map['discountPercent']; + couponListBean.bizId = map['bizId']; couponListBean.publishStartTime = map['publishStartTime']; + couponListBean.publishEndTime = map['publishEndTime']; + couponListBean.useStartTime = map['useStartTime']; + couponListBean.useEndTime = map['useEndTime']; + couponListBean.promotionId = map['promotionId']; + couponListBean.mid = map['mid']; + couponListBean.couponId = map['couponId']; couponListBean.receiveTime = map['receiveTime']; + couponListBean.useTime = map['useTime']; couponListBean.status = map['status']; - couponListBean.storeId = map['storeId']; couponListBean.tenantCode = map['tenantCode']; couponListBean.type = map['type']; + couponListBean.promotionName = map['promotionName']; couponListBean.usable = map['usable']; - couponListBean.useEndTime = map['useEndTime']; - couponListBean.useStartTime = map['useStartTime']; - couponListBean.useTime = map['useTime']; + couponListBean.allProduct = map['allProduct']; + couponListBean.productList = map['productList']; return couponListBean; } Map toJson() => { - "allProduct": allProduct, - "bizId": bizId, + "id": id, + "storeId": storeId, "bizType": bizType, - "couponId": couponId, - "discountAmount": discountAmount, - "discountPercent": discountPercent, "fullAmount": fullAmount, + "discountAmount": discountAmount, "fullNumber": fullNumber, - "id": id, - "mid": mid, - "productList": productList, - "promotionId": promotionId, - "promotionName": promotionName, - "publishEndTime": publishEndTime, + "discountPercent": discountPercent, + "bizId": bizId, "publishStartTime": publishStartTime, + "publishEndTime": publishEndTime, + "useStartTime": useStartTime, + "useEndTime": useEndTime, + "promotionId": promotionId, + "mid": mid, + "couponId": couponId, "receiveTime": receiveTime, + "useTime": useTime, "status": status, - "storeId": storeId, "tenantCode": tenantCode, "type": type, + "promotionName": promotionName, "usable": usable, - "useEndTime": useEndTime, - "useStartTime": useStartTime, - "useTime": useTime, + "allProduct": allProduct, + "productList": productList, }; } -/// applyPrice : 0 -/// attrStyle : 0 -/// categoryId : 0 -/// groupId : 0 -/// id : 0 +/// id : "1437254523520286720" +/// createTime : "2021-09-13 11:19:16" +/// createUser : "1333246101196636160" +/// updateTime : "2021-09-13 17:30:00" +/// updateUser : "0" +/// storeId : "1433719074906439680" +/// name : "�����ŵ�" +/// image : "https://pos.upload.gznl.top/1175/2021/09/44d60dab-0ae3-4d07-b624-50b8ab99d0fc.jpg" +/// description : "1" +/// status : 4 +/// applyStartTime : "2021-09-13 11:19:16" +/// applyEndTime : "2021-09-13 11:19:16" +/// activityStartTime : "2021-09-01 00:00:00" +/// activityEndTime : "2021-10-30 00:00:00" +/// doStartTime : null +/// doEndTime : null +/// isNeedSecurityDeposit : 0 +/// securityDeposit : "0" +/// tag : "11" +/// promotionType : 1 +/// promotionPlan : 0 +/// promotionDetail : [{"limitTime":"0","discountRate":"0","discountAmount":"0","fullAmount":"0","collageNumber":"0","fullNumber":"1"}] +/// channels : ["MINI","POS"] +/// isVip : false /// 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 +/// tenantCode : "1175" +/// canPartake : true +/// promotionProuctList : null -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; +class PromotionInfoListBean { + String id; + String createTime; + String createUser; + String updateTime; + String updateUser; + String storeId; + String name; + String image; + String description; int status; - int stock; - int storeId; - String supplierName; - int weight; + String applyStartTime; + String applyEndTime; + String activityStartTime; + String activityEndTime; + dynamic doStartTime; + dynamic doEndTime; + int isNeedSecurityDeposit; + String securityDeposit; + String tag; + int promotionType; + int promotionPlan; + List promotionDetail; + List channels; + bool isVip; + int isDelete; + String tenantCode; + bool canPartake; + dynamic promotionProuctList; - static ProductListBean fromJson(Map map) { + static PromotionInfoListBean 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; + PromotionInfoListBean promotionInfoListBean = PromotionInfoListBean(); + promotionInfoListBean.id = map['id']; + promotionInfoListBean.createTime = map['createTime']; + promotionInfoListBean.createUser = map['createUser']; + promotionInfoListBean.updateTime = map['updateTime']; + promotionInfoListBean.updateUser = map['updateUser']; + promotionInfoListBean.storeId = map['storeId']; + promotionInfoListBean.name = map['name']; + promotionInfoListBean.image = map['image']; + promotionInfoListBean.description = map['description']; + promotionInfoListBean.status = map['status']; + promotionInfoListBean.applyStartTime = map['applyStartTime']; + promotionInfoListBean.applyEndTime = map['applyEndTime']; + promotionInfoListBean.activityStartTime = map['activityStartTime']; + promotionInfoListBean.activityEndTime = map['activityEndTime']; + promotionInfoListBean.doStartTime = map['doStartTime']; + promotionInfoListBean.doEndTime = map['doEndTime']; + promotionInfoListBean.isNeedSecurityDeposit = map['isNeedSecurityDeposit']; + promotionInfoListBean.securityDeposit = map['securityDeposit']; + promotionInfoListBean.tag = map['tag']; + promotionInfoListBean.promotionType = map['promotionType']; + promotionInfoListBean.promotionPlan = map['promotionPlan']; + promotionInfoListBean.promotionDetail = List()..addAll( + (map['promotionDetail'] as List ?? []).map((o) => PromotionDetailBean.fromJson(o)) + ); + promotionInfoListBean.channels = List()..addAll( + (map['channels'] as List ?? []).map((o) => o.toString()) + ); + promotionInfoListBean.isVip = map['isVip']; + promotionInfoListBean.isDelete = map['isDelete']; + promotionInfoListBean.tenantCode = map['tenantCode']; + promotionInfoListBean.canPartake = map['canPartake']; + promotionInfoListBean.promotionProuctList = map['promotionProuctList']; + return promotionInfoListBean; } 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, + "createTime": createTime, + "createUser": createUser, + "updateTime": updateTime, + "updateUser": updateUser, "storeId": storeId, - "supplierName": supplierName, - "weight": weight, + "name": name, + "image": image, + "description": description, + "status": status, + "applyStartTime": applyStartTime, + "applyEndTime": applyEndTime, + "activityStartTime": activityStartTime, + "activityEndTime": activityEndTime, + "doStartTime": doStartTime, + "doEndTime": doEndTime, + "isNeedSecurityDeposit": isNeedSecurityDeposit, + "securityDeposit": securityDeposit, + "tag": tag, + "promotionType": promotionType, + "promotionPlan": promotionPlan, + "promotionDetail": promotionDetail, + "channels": channels, + "isVip": isVip, + "isDelete": isDelete, + "tenantCode": tenantCode, + "canPartake": canPartake, + "promotionProuctList": promotionProuctList, + }; +} + +/// limitTime : "0" +/// discountRate : "0" +/// discountAmount : "0" +/// fullAmount : "0" +/// collageNumber : "0" +/// fullNumber : "1" + +class PromotionDetailBean { + String limitTime; + String discountRate; + String discountAmount; + String fullAmount; + String collageNumber; + String fullNumber; + + static PromotionDetailBean fromJson(Map map) { + if (map == null) return null; + PromotionDetailBean promotionDetailBean = PromotionDetailBean(); + promotionDetailBean.limitTime = map['limitTime']; + promotionDetailBean.discountRate = map['discountRate']; + promotionDetailBean.discountAmount = map['discountAmount']; + promotionDetailBean.fullAmount = map['fullAmount']; + promotionDetailBean.collageNumber = map['collageNumber']; + promotionDetailBean.fullNumber = map['fullNumber']; + return promotionDetailBean; + } + + Map toJson() => { + "limitTime": limitTime, + "discountRate": discountRate, + "discountAmount": discountAmount, + "fullAmount": fullAmount, + "collageNumber": collageNumber, + "fullNumber": fullNumber, }; } \ No newline at end of file diff --git a/lib/store/store_view/settlement_order_commodity.dart b/lib/store/store_view/settlement_order_commodity.dart new file mode 100644 index 00000000..fdd9bbc5 --- /dev/null +++ b/lib/store/store_view/settlement_order_commodity.dart @@ -0,0 +1,361 @@ + + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/order_info.dart'; +import 'package:huixiang/retrofit/data/settleOrderInfo.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/custom_image.dart'; +import 'package:huixiang/view_widget/separator.dart'; + +class SettlementOrderCommodity extends StatefulWidget { + final int isTakeOut; + final SettleOrderInfo orderInfo; + + SettlementOrderCommodity(this.orderInfo,this.isTakeOut); + + @override + State createState() { + return _SettlementOrderCommodity(); + } + +} + +class _SettlementOrderCommodity extends State { + @override + Widget build(BuildContext context) { + return Stack( + alignment: Alignment.centerRight, + children: [ + Container( + margin: EdgeInsets.only( + left: 16.w, + right: 16.w, + top: 16.h, + bottom: 8.h, + ), + padding: EdgeInsets.only( + left: 20.w, + right: 20.w, + top: 12.h, + bottom: 12.h, + ), + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 1), + blurRadius: 12, + spreadRadius: 0, + ), + ], + borderRadius: BorderRadius.circular(8), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: commodityList(), + ), + ), + Visibility( + child: buildQrCode(), + visible: false, + ), + ], + ); + } + + + List commodityList() { + if (widget.orderInfo == null) return []; + List widgets = []; + if (widget.orderInfo.orderProductList != null) { + widgets + .addAll(widget.orderInfo.orderProductList.map((e) => commodityItem(e)).toList()); + } + widgets.add(SizedBox(height: 20.h)); + + if (widget.isTakeOut != 0) { + // 配送费 + widgets.add(discountItem( + Color(0xFFFF7A1A), + widget.isTakeOut == 1 + ? S.of(context).peisongfei + : S.of(context).yunfei, + "", + "+${widget.orderInfo.postAge}")); + } + + widgets.add(Container( + margin: EdgeInsets.only( + top: 24.h, + bottom: 4.h, + ), + child: MySeparator( + height: 1, + width: 5.w, + color: Colors.grey, + ), + )); + widgets.add(buildTotalPrice()); + return widgets; + } + + Widget commodityItem(OrderProductListBean productList) { + return Container( + margin: EdgeInsets.only(top: 8.h, bottom: 8.h), + child: Row( + children: [ + MImage( + productList.skuImg, + width: 44.w, + height: 44, + fit: BoxFit.cover, + errorSrc: "assets/image/default_1.png", + fadeSrc: "assets/image/default_1.png", + ), + Expanded( + flex: 1, + child: Container( + margin: EdgeInsets.only( + left: 16.w, + ), + height: 44.h, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + productList.productName, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 14.sp, + color: Color(0xFF353535), + ), + ), + Text( + "x${productList.buyNum}", + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF727272), + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + flex: 1, + child: Text( + productList.weight != null + ? "${productList.weight}kg" + : "", + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFFA29E9E), + ), + ), + ), + Text( + S.of(context).yuan_(productList.sellPrice), + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 12.sp, + color: Color(0xFF4C4C4C), + ), + ) + ], + ), + ], + ), + ), + ), + ], + ), + ); + } + + Widget discountItem(Color color, textName, condition, amount) { + return Container( + margin: EdgeInsets.only(top: 9.h, bottom: 9.h), + child: Row( + children: [ + Container( + padding: EdgeInsets.fromLTRB(4.w, 2.h, 4.w, 2.h), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(2)), + border: Border.all( + width: 1, + color: color, + style: BorderStyle.solid, + ), + ), + child: Text( + textName, + style: TextStyle( + fontSize: 10.sp, + color: color, + ), + ), + ), + SizedBox( + width: 27.w, + ), + Expanded( + child: Text( + condition ?? "", + style: TextStyle( + fontSize: 10.sp, + color: Color(0xFFA29E9E), + ), + ), + flex: 1, + ), + Text( + S.of(context).yuan_("$amount"), + style: TextStyle( + fontSize: 12.sp, + color: color, + ), + ), + ], + ), + ); + } + + Widget buildQrCode() { + return Container( + margin: EdgeInsets.only(right: 16.w), + child: Stack( + children: [ + Container( + width: 94.w, + height: 33.h, + margin: EdgeInsets.only(left: 12.w), + padding: EdgeInsets.only(left: 16.w), + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(25), + offset: Offset(0, 1), + blurRadius: 12, + spreadRadius: 0, + ) + ], + borderRadius: BorderRadius.only( + topLeft: Radius.circular(2), + bottomLeft: Radius.circular(2), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + S.of(context).qujianma, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 12.sp, + color: Colors.black, + ), + ), + Icon( + Icons.keyboard_arrow_right, + color: Colors.black, + size: 16, + ) + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 6.h, bottom: 6.h), + // padding: EdgeInsets.all(2), + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(25), + offset: Offset(0, 1), + blurRadius: 12, + spreadRadius: 0, + ) + ], + borderRadius: BorderRadius.circular(2), + ), + child: Icon( + Icons.qr_code, + size: 20, + color: Color(0xFF32A060), + ), + ), + ], + ), + ); + } + + Widget buildTotalPrice() { + return Container( + margin: EdgeInsets.only(top: 7.h, bottom: 11.h), + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.baseline, + textBaseline: TextBaseline.alphabetic, + children: [ + Expanded( + child: Text( + S.of(context).gongjijianshangpin( + (widget.orderInfo != null && widget.orderInfo.orderProductList != null) + ? widget.orderInfo.orderProductList.length + : "0"), + style: TextStyle( + fontSize: 10.sp, + color: Color(0xFFA29E9E), + fontWeight: MyFontWeight.semi_bold + ), + ), + flex: 1, + ), + Container( + child: Text( + S.of(context).jiesuanjine, + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF353535), + fontWeight:MyFontWeight.semi_bold + ), + ), + ), + SizedBox( + width: 5.w, + ), + Text( + totalPrice(), + textAlign: TextAlign.end, + style: TextStyle( + fontSize:14.sp, + color: Color(0xFF32A060), + fontWeight: MyFontWeight.semi_bold + ), + ) + ], + ), + ); + } + + String totalPrice() { + if (widget.orderInfo == null) return ""; + double totalPrice = (double.tryParse(widget.orderInfo.orderSum) + + double.tryParse(widget.orderInfo.postAge)); + return "$totalPrice"; + } + +} \ No newline at end of file