From 0011135c91c6b33930e4a640e6db917c39c50b35 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Thu, 17 Feb 2022 14:51:13 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A0=8D=E4=BB=B7=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/mine/mine_view/mine_item.dart | 30 +-- lib/order/bargain_group_order.dart | 4 +- .../data/activity_actRecord_details.dart | 251 ++++++++++++++++-- lib/settlement/settlement.dart | 4 +- .../settlement_view/distribution.dart | 3 +- .../shopping/shopping_goods_details.dart | 1 + lib/store/store_view/product_sku.dart | 2 +- 7 files changed, 236 insertions(+), 59 deletions(-) diff --git a/lib/mine/mine_view/mine_item.dart b/lib/mine/mine_view/mine_item.dart index bfb150be..cfd1ea06 100644 --- a/lib/mine/mine_view/mine_item.dart +++ b/lib/mine/mine_view/mine_item.dart @@ -16,8 +16,8 @@ class _MineItem extends State { @override Widget build(BuildContext context) { return Container( - margin: EdgeInsets.fromLTRB(16.w, 10.h, 16.w, 28.h), - // padding: EdgeInsets.fromLTRB(20.w, 12.h, 20.w, 12.h), + margin: EdgeInsets.fromLTRB(16.w, 10.h, 16.w, 6.h), + padding: EdgeInsets.only(top: 12,bottom: 12), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(8), @@ -50,7 +50,7 @@ class _MineItem extends State { // ), // ), Container( - padding: EdgeInsets.only(left: 16,top:16,bottom:4), + padding: EdgeInsets.symmetric(vertical: 4.h,horizontal: 20.w), child: Text( S.of(context).wodegongju, style: TextStyle( @@ -168,30 +168,6 @@ class _MineItem extends State { Expanded(child: Text("")), ], ), - Row( - children: [ - Expanded(child:InkWell( - onTap: () { - Navigator.of(context).pushNamed('/router/qr_share', arguments: {}); - }, - child: mineItem( - S.of(context).tuiguangma, - "assets/image/icon_mine_promotion_code.png", - ), - ),), - Expanded(child:InkWell( - onTap: () { - Navigator.of(context).pushNamed('/router/invitation_record', arguments: {}); - }, - child: mineItem( - "邀请记录", - "assets/image/yao_q.png", - ), - ),), - Expanded(child:Container()), - Expanded(child:Container()) - ], - ), // mineItem( // S.of(context).bangzhuyufankui, // "assets/image/icon_mine_feedback.png", diff --git a/lib/order/bargain_group_order.dart b/lib/order/bargain_group_order.dart index b40bebff..7230f558 100644 --- a/lib/order/bargain_group_order.dart +++ b/lib/order/bargain_group_order.dart @@ -131,6 +131,7 @@ class _ExchangeHistoryList extends State { List activityOrderList = []; RefreshController _refreshController = RefreshController(initialRefresh: false); + int type = 0; @override void initState() { @@ -301,7 +302,8 @@ class _ExchangeHistoryList extends State { // orderInfo.sendStatus, // orderInfo.isTakeOut) // : "", - activityOrderList.howManyMore != 0 ? "还差${activityOrderList?.howManyMore ?? 0}人拼团成功" : "拼团成功", + (type == 1)?(activityOrderList.howManyMore != 0 ? "还差${activityOrderList?.howManyMore ?? 0}人拼团成功" : "拼团成功") + :(activityOrderList.howManyMoney != 0 ? "还差¥${activityOrderList?.howManyMoney ?? 0}砍价成功" : "成功"), style: TextStyle( fontSize: 14.sp, fontWeight: FontWeight.bold, diff --git a/lib/retrofit/data/activity_actRecord_details.dart b/lib/retrofit/data/activity_actRecord_details.dart index 36da4af6..367a2cc2 100644 --- a/lib/retrofit/data/activity_actRecord_details.dart +++ b/lib/retrofit/data/activity_actRecord_details.dart @@ -1,12 +1,18 @@ -/// actRecord : {"id":"1480458252863930368","createTime":"2022-01-10 16:35:28","createUser":"1478548720785031168","updateTime":"2022-01-10 16:35:28","updateUser":"1478548720785031168","storeId":"1460885296764682240","type":1,"actTemplateId":"1479377328797646848","actTimeId":"1479377329099636736","actProductId":"1479377402160218112","mid":"1478548720785031168","joinNum":1,"startTime":"2022-01-10 16:35:28","endTime":"2022-01-11 14:35:28","state":1,"isDelete":0} -/// actRecordJoinList : [{"id":"1480458253568573440","createTime":"2022-01-10 16:35:28","createUser":"1478548720785031168","updateTime":"2022-01-10 16:35:28","updateUser":"1478548720785031168","storeId":"1460885296764682240","type":1,"actTemplateId":"1479377328797646848","actTimeId":"1479377329099636736","actRecordId":"1480458252863930368","mid":"1478548720785031168","orderId":"1480458254545846272","isLeader":true,"memberAvatar":"","memberNickname":"斯基","productId":"1479377402160218112","actPrice":"78.00","state":false,"isDelete":0},{"id":"1480465728682328064","createTime":"2022-01-10 17:05:10","createUser":"1478548720785031168","updateTime":"2022-01-10 17:05:10","updateUser":"1478548720785031168","storeId":"1460885296764682240","type":1,"actTemplateId":"1479377328797646848","actTimeId":"1479377329099636736","actRecordId":"1480458252863930368","mid":"1478548720785031168","orderId":"1480465729634435072","isLeader":false,"memberAvatar":"","memberNickname":"斯基","productId":"1479377402160218112","actPrice":"78.00","state":true,"isDelete":0},{"id":"1480466261283438592","createTime":"2022-01-10 17:07:17","createUser":"1478548720785031168","updateTime":"2022-01-10 17:07:17","updateUser":"1478548720785031168","storeId":"1460885296764682240","type":1,"actTemplateId":"1479377328797646848","actTimeId":"1479377329099636736","actRecordId":"1480458252863930368","mid":"1478548720785031168","orderId":"1480466261941944320","isLeader":false,"memberAvatar":"","memberNickname":"斯基","productId":"1479377402160218112","actPrice":"78.00","state":false,"isDelete":0}] +/// actRecord : {"id":"1494198857058222080","createTime":"2022-02-17 14:35:43","createUser":"1478548720785031168","updateTime":"2022-02-17 14:35:43","updateUser":"1478548720785031168","storeId":"1460885296764682240","type":3,"actTemplateId":"1490572026815971328","actTimeId":"1490572027034075136","actProductId":"1494198261018263552","mid":"1478548720785031168","joinNum":1,"startTime":"2022-02-17 14:35:43","endTime":"2022-02-17 16:35:43","state":2,"isDelete":0} +/// actRecordJoinList : [{"id":"1494198857217605632","createTime":"2022-02-17 14:35:43","createUser":"1478548720785031168","updateTime":"2022-02-17 14:35:43","updateUser":"1478548720785031168","storeId":"1460885296764682240","type":3,"actTemplateId":"1490572026815971328","actTimeId":"1490572027034075136","actRecordId":"1494198857058222080","mid":"1478548720785031168","orderId":null,"isLeader":true,"memberAvatar":"","memberNickname":"","productId":"1494198261018263552","actPrice":"57.81","state":true,"isDelete":0}] +/// actProduct : {"id":"1494198261018263552","createTime":"2022-02-17 14:33:21","createUser":"1364043181062094848","updateTime":"2022-02-17 14:33:21","updateUser":"1364043181062094848","storeId":"1460885296764682240","templateId":"1490572026815971328","timeId":"1490572027034075136","productId":"1461246266586431488","productName":"野生羊肚菌","productImg":"https://pos.upload.gznl.top/1179/2021/11/298d1e1c-2a5f-4b9d-95a7-87b3f88a9cd1.jpg","productPrice":"150.00","promotionPrice":"11.00","productStock":200,"sellCount":0,"skuJson":[{"skuId":"1461246266661928960","skuPrice":11,"skuStock":100},{"skuId":"1461246266687094784","skuPrice":100,"skuStock":100}],"isDelete":0} +/// skuName : "50g/袋" class ActivityActRecordDetails { ActivityActRecordDetails({ ActRecord actRecord, - List actRecordJoinList,}){ + List actRecordJoinList, + ActProduct actProduct, + String skuName,}){ _actRecord = actRecord; _actRecordJoinList = actRecordJoinList; + _actProduct = actProduct; + _skuName = skuName; } ActivityActRecordDetails.fromJson(dynamic json) { @@ -17,12 +23,18 @@ class ActivityActRecordDetails { _actRecordJoinList.add(ActRecordJoinList.fromJson(v)); }); } + _actProduct = json['actProduct'] != null ? ActProduct.fromJson(json['actProduct']) : null; + _skuName = json['skuName']; } ActRecord _actRecord; List _actRecordJoinList; + ActProduct _actProduct; + String _skuName; ActRecord get actRecord => _actRecord; List get actRecordJoinList => _actRecordJoinList; + ActProduct get actProduct => _actProduct; + String get skuName => _skuName; Map toJson() { final map = {}; @@ -32,29 +44,212 @@ class ActivityActRecordDetails { if (_actRecordJoinList != null) { map['actRecordJoinList'] = _actRecordJoinList.map((v) => v.toJson()).toList(); } + if (_actProduct != null) { + map['actProduct'] = _actProduct.toJson(); + } + map['skuName'] = _skuName; + return map; + } + +} + +/// id : "1494198261018263552" +/// createTime : "2022-02-17 14:33:21" +/// createUser : "1364043181062094848" +/// updateTime : "2022-02-17 14:33:21" +/// updateUser : "1364043181062094848" +/// storeId : "1460885296764682240" +/// templateId : "1490572026815971328" +/// timeId : "1490572027034075136" +/// productId : "1461246266586431488" +/// productName : "野生羊肚菌" +/// productImg : "https://pos.upload.gznl.top/1179/2021/11/298d1e1c-2a5f-4b9d-95a7-87b3f88a9cd1.jpg" +/// productPrice : "150.00" +/// promotionPrice : "11.00" +/// productStock : 200 +/// sellCount : 0 +/// skuJson : [{"skuId":"1461246266661928960","skuPrice":11,"skuStock":100},{"skuId":"1461246266687094784","skuPrice":100,"skuStock":100}] +/// isDelete : 0 + +class ActProduct { + ActProduct({ + String id, + String createTime, + String createUser, + String updateTime, + String updateUser, + String storeId, + String templateId, + String timeId, + String productId, + String productName, + String productImg, + String productPrice, + String promotionPrice, + int productStock, + int sellCount, + List skuJson, + int isDelete,}){ + _id = id; + _createTime = createTime; + _createUser = createUser; + _updateTime = updateTime; + _updateUser = updateUser; + _storeId = storeId; + _templateId = templateId; + _timeId = timeId; + _productId = productId; + _productName = productName; + _productImg = productImg; + _productPrice = productPrice; + _promotionPrice = promotionPrice; + _productStock = productStock; + _sellCount = sellCount; + _skuJson = skuJson; + _isDelete = isDelete; +} + + ActProduct.fromJson(dynamic json) { + _id = json['id']; + _createTime = json['createTime']; + _createUser = json['createUser']; + _updateTime = json['updateTime']; + _updateUser = json['updateUser']; + _storeId = json['storeId']; + _templateId = json['templateId']; + _timeId = json['timeId']; + _productId = json['productId']; + _productName = json['productName']; + _productImg = json['productImg']; + _productPrice = json['productPrice']; + _promotionPrice = json['promotionPrice']; + _productStock = json['productStock']; + _sellCount = json['sellCount']; + if (json['skuJson'] != null) { + _skuJson = []; + json['skuJson'].forEach((v) { + _skuJson.add(SkuJson.fromJson(v)); + }); + } + _isDelete = json['isDelete']; + } + String _id; + String _createTime; + String _createUser; + String _updateTime; + String _updateUser; + String _storeId; + String _templateId; + String _timeId; + String _productId; + String _productName; + String _productImg; + String _productPrice; + String _promotionPrice; + int _productStock; + int _sellCount; + List _skuJson; + int _isDelete; + + String get id => _id; + String get createTime => _createTime; + String get createUser => _createUser; + String get updateTime => _updateTime; + String get updateUser => _updateUser; + String get storeId => _storeId; + String get templateId => _templateId; + String get timeId => _timeId; + String get productId => _productId; + String get productName => _productName; + String get productImg => _productImg; + String get productPrice => _productPrice; + String get promotionPrice => _promotionPrice; + int get productStock => _productStock; + int get sellCount => _sellCount; + List get skuJson => _skuJson; + int get isDelete => _isDelete; + + Map toJson() { + final map = {}; + map['id'] = _id; + map['createTime'] = _createTime; + map['createUser'] = _createUser; + map['updateTime'] = _updateTime; + map['updateUser'] = _updateUser; + map['storeId'] = _storeId; + map['templateId'] = _templateId; + map['timeId'] = _timeId; + map['productId'] = _productId; + map['productName'] = _productName; + map['productImg'] = _productImg; + map['productPrice'] = _productPrice; + map['promotionPrice'] = _promotionPrice; + map['productStock'] = _productStock; + map['sellCount'] = _sellCount; + if (_skuJson != null) { + map['skuJson'] = _skuJson.map((v) => v.toJson()).toList(); + } + map['isDelete'] = _isDelete; + return map; + } + +} + +/// skuId : "1461246266661928960" +/// skuPrice : 11 +/// skuStock : 100 + +class SkuJson { + SkuJson({ + String skuId, + int skuPrice, + int skuStock,}){ + _skuId = skuId; + _skuPrice = skuPrice; + _skuStock = skuStock; +} + + SkuJson.fromJson(dynamic json) { + _skuId = json['skuId']; + _skuPrice = json['skuPrice']; + _skuStock = json['skuStock']; + } + String _skuId; + int _skuPrice; + int _skuStock; + + String get skuId => _skuId; + int get skuPrice => _skuPrice; + int get skuStock => _skuStock; + + Map toJson() { + final map = {}; + map['skuId'] = _skuId; + map['skuPrice'] = _skuPrice; + map['skuStock'] = _skuStock; return map; } } -/// id : "1480458253568573440" -/// createTime : "2022-01-10 16:35:28" +/// id : "1494198857217605632" +/// createTime : "2022-02-17 14:35:43" /// createUser : "1478548720785031168" -/// updateTime : "2022-01-10 16:35:28" +/// updateTime : "2022-02-17 14:35:43" /// updateUser : "1478548720785031168" /// storeId : "1460885296764682240" -/// type : 1 -/// actTemplateId : "1479377328797646848" -/// actTimeId : "1479377329099636736" -/// actRecordId : "1480458252863930368" +/// type : 3 +/// actTemplateId : "1490572026815971328" +/// actTimeId : "1490572027034075136" +/// actRecordId : "1494198857058222080" /// mid : "1478548720785031168" -/// orderId : "1480458254545846272" +/// orderId : null /// isLeader : true /// memberAvatar : "" -/// memberNickname : "斯基" -/// productId : "1479377402160218112" -/// actPrice : "78.00" -/// state : false +/// memberNickname : "" +/// productId : "1494198261018263552" +/// actPrice : "57.81" +/// state : true /// isDelete : 0 class ActRecordJoinList { @@ -70,7 +265,7 @@ class ActRecordJoinList { String actTimeId, String actRecordId, String mid, - String orderId, + dynamic orderId, bool isLeader, String memberAvatar, String memberNickname, @@ -131,7 +326,7 @@ class ActRecordJoinList { String _actTimeId; String _actRecordId; String _mid; - String _orderId; + dynamic _orderId; bool _isLeader; String _memberAvatar; String _memberNickname; @@ -151,7 +346,7 @@ class ActRecordJoinList { String get actTimeId => _actTimeId; String get actRecordId => _actRecordId; String get mid => _mid; - String get orderId => _orderId; + dynamic get orderId => _orderId; bool get isLeader => _isLeader; String get memberAvatar => _memberAvatar; String get memberNickname => _memberNickname; @@ -186,21 +381,21 @@ class ActRecordJoinList { } -/// id : "1480458252863930368" -/// createTime : "2022-01-10 16:35:28" +/// id : "1494198857058222080" +/// createTime : "2022-02-17 14:35:43" /// createUser : "1478548720785031168" -/// updateTime : "2022-01-10 16:35:28" +/// updateTime : "2022-02-17 14:35:43" /// updateUser : "1478548720785031168" /// storeId : "1460885296764682240" -/// type : 1 -/// actTemplateId : "1479377328797646848" -/// actTimeId : "1479377329099636736" -/// actProductId : "1479377402160218112" +/// type : 3 +/// actTemplateId : "1490572026815971328" +/// actTimeId : "1490572027034075136" +/// actProductId : "1494198261018263552" /// mid : "1478548720785031168" /// joinNum : 1 -/// startTime : "2022-01-10 16:35:28" -/// endTime : "2022-01-11 14:35:28" -/// state : 1 +/// startTime : "2022-02-17 14:35:43" +/// endTime : "2022-02-17 16:35:43" +/// state : 2 /// isDelete : 0 class ActRecord { diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index 28c40564..b2298413 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -58,6 +58,7 @@ class _Settlement extends State { int payChannel = 4; int tableId = 0; int numberOfPeople = 0; + String pageType ="1"; Address address; CouponListBean couponListBean; @@ -75,6 +76,7 @@ class _Settlement extends State { numberOfPeople = widget.arguments["numberOfPeople"] ?? 0; promotions = widget.arguments["pName"] ?? ""; coupons = widget.arguments["cName"] ?? ""; + pageType = widget.arguments["pageType"]; if (tableId == 0) { placeOrder = true; } @@ -433,7 +435,7 @@ class _Settlement extends State { queryOrderInfo(addressId, isTake, memberCouponId, orderId, promotionId); }, queryAddress, storeInfo, address, - selectedAddress), + selectedAddress,pageType), SizedBox( height: 16, diff --git a/lib/settlement/settlement_view/distribution.dart b/lib/settlement/settlement_view/distribution.dart index 3a926178..d24559c9 100644 --- a/lib/settlement/settlement_view/distribution.dart +++ b/lib/settlement/settlement_view/distribution.dart @@ -23,9 +23,10 @@ class DistributionMode extends StatefulWidget { final Function(String addId) selectedNewAddress; final StoreInfo storeInfo; final Address address; + final String pageType; DistributionMode(this.queryOrderInfo, this.queryAddress, this.storeInfo, - this.address, this.selectedNewAddress); + this.address, this.selectedNewAddress,this.pageType); @override State createState() { diff --git a/lib/store/shopping/shopping_goods_details.dart b/lib/store/shopping/shopping_goods_details.dart index 568ecbe3..160fe3f1 100644 --- a/lib/store/shopping/shopping_goods_details.dart +++ b/lib/store/shopping/shopping_goods_details.dart @@ -438,6 +438,7 @@ class _ShoppingGoodsDetails extends State { "pid": pid, "cName": cName, "cid": cid, + "pageType":pageType, "shoppingCartSkuItemList": [ { "buyNum": count1, diff --git a/lib/store/store_view/product_sku.dart b/lib/store/store_view/product_sku.dart index 9f142870..f0500274 100644 --- a/lib/store/store_view/product_sku.dart +++ b/lib/store/store_view/product_sku.dart @@ -272,7 +272,7 @@ class _ProductSku extends State { SizedBox( height: 24, ), - if(widget.buttonType == 0) + if(widget.buttonType != 1) RoundButton( width: double.infinity, height: 54.h,