From 49e1f806a71bf5b6d1f013c39689450420fd5a0f Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Sat, 9 Oct 2021 11:12:00 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/generated/l10n.dart | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/lib/generated/l10n.dart b/lib/generated/l10n.dart index d5f155d9..7d5b357b 100644 --- a/lib/generated/l10n.dart +++ b/lib/generated/l10n.dart @@ -5015,6 +5015,26 @@ class S { ); } + /// `推广码` + String get tuiguangma { + return Intl.message( + '推广码', + name: 'tuiguangma', + desc: '', + args: [], + ); + } + + /// `我的工具` + String get wodegongju { + return Intl.message( + '我的工具', + name: 'wodegongju', + desc: '', + args: [], + ); + } + /// `订单结算` String get dingdanjiesuan { return Intl.message( @@ -5065,26 +5085,6 @@ class S { ); } - /// `推广码` - String get tuiguangma { - return Intl.message( - '推广码', - name: 'tuiguangma', - desc: '', - args: [], - ); - } - - /// `我的工具` - String get wodegongju { - return Intl.message( - '我的工具', - name: 'wodegongju', - desc: '', - args: [], - ); - } - /// `备注信息` String get beizhuxinxi { return Intl.message( From 4877cc063459f5a725ff742371c68541af699243 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Mon, 11 Oct 2021 15:01:13 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=82=B9=E5=8D=95=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/address/address_map_page.dart | 2 - lib/generated/intl/messages_en.dart | 3 + lib/generated/intl/messages_zh_CN.dart | 3 + lib/generated/intl/messages_zh_Hans_CN.dart | 3 + lib/generated/intl/messages_zh_Hant_CN.dart | 3 + lib/generated/intl/messages_zh_TW.dart | 3 + lib/generated/l10n.dart | 30 ++++ lib/l10n/intl_en.arb | 4 + lib/l10n/intl_zh_CN.arb | 3 + lib/l10n/intl_zh_Hans_CN.arb | 3 + lib/l10n/intl_zh_Hant_CN.arb | 3 + lib/l10n/intl_zh_TW.arb | 3 + lib/retrofit/data/findMiNiGroupList.dart | 167 ++++++++++++++++++++ lib/retrofit/min_api.dart | 16 +- lib/store/store_order.dart | 71 +++------ lib/store/store_view/store_order_list.dart | 118 ++++++++++---- 16 files changed, 353 insertions(+), 82 deletions(-) create mode 100644 lib/retrofit/data/findMiNiGroupList.dart diff --git a/lib/address/address_map_page.dart b/lib/address/address_map_page.dart index 1f75590f..f6edda2a 100644 --- a/lib/address/address_map_page.dart +++ b/lib/address/address_map_page.dart @@ -10,13 +10,11 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; import 'package:flutter_baidu_mapapi_map/flutter_baidu_mapapi_map.dart'; -import 'package:flutter_baidu_mapapi_search/flutter_baidu_mapapi_search.dart'; import 'package:flutter_baidu_mapapi_utils/flutter_baidu_mapapi_utils.dart'; import 'package:flutter_bmflocation/bdmap_location_flutter_plugin.dart'; import 'package:flutter_bmflocation/flutter_baidu_location_android_option.dart'; import 'package:flutter_bmflocation/flutter_baidu_location_ios_option.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; -import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/address.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; diff --git a/lib/generated/intl/messages_en.dart b/lib/generated/intl/messages_en.dart index 04c0276d..8c55b608 100644 --- a/lib/generated/intl/messages_en.dart +++ b/lib/generated/intl/messages_en.dart @@ -232,6 +232,7 @@ class MessageLookup extends MessageLookupByLibrary { "huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("回乡头条"), "huiyuandengji" : MessageLookupByLibrary.simpleMessage("会员等级"), "huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("会员等级说明"), + "huiyuanjia" : MessageLookupByLibrary.simpleMessage("会员价"), "huiyuanjifen" : MessageLookupByLibrary.simpleMessage("会员积分"), "huiyuanka" : MessageLookupByLibrary.simpleMessage("会员卡"), "huiyuankaxiangqing" : MessageLookupByLibrary.simpleMessage("会员卡详情"), @@ -523,6 +524,7 @@ class MessageLookup extends MessageLookupByLibrary { "xitongtongzhi" : MessageLookupByLibrary.simpleMessage("系统通知"), "xitongxiaoxi" : MessageLookupByLibrary.simpleMessage("系统消息"), "xiugaichenggong" : MessageLookupByLibrary.simpleMessage("修改成功"), + "xuanguige" : MessageLookupByLibrary.simpleMessage("选规格"), "xuni" : MessageLookupByLibrary.simpleMessage("虚拟"), "yaoqingrenshoujihao_" : m32, "yiduihuan" : MessageLookupByLibrary.simpleMessage("已兑换"), @@ -572,6 +574,7 @@ class MessageLookup extends MessageLookupByLibrary { "youxiaoqizhi" : m36, "yuan" : MessageLookupByLibrary.simpleMessage("元"), "yuan_" : m37, + "yuanjia" : MessageLookupByLibrary.simpleMessage("原价"), "yue" : MessageLookupByLibrary.simpleMessage("余额"), "yue_" : m38, "yuemingxi" : MessageLookupByLibrary.simpleMessage("余额明细"), diff --git a/lib/generated/intl/messages_zh_CN.dart b/lib/generated/intl/messages_zh_CN.dart index f50fb90b..cdf576dc 100644 --- a/lib/generated/intl/messages_zh_CN.dart +++ b/lib/generated/intl/messages_zh_CN.dart @@ -231,6 +231,7 @@ class MessageLookup extends MessageLookupByLibrary { "huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("回乡头条"), "huiyuandengji" : MessageLookupByLibrary.simpleMessage("会员等级"), "huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("会员等级说明"), + "huiyuanjia" : MessageLookupByLibrary.simpleMessage("会员价"), "huiyuanjifen" : MessageLookupByLibrary.simpleMessage("会员积分"), "huiyuanka" : MessageLookupByLibrary.simpleMessage("会员卡"), "huiyuankaxiangqing" : MessageLookupByLibrary.simpleMessage("会员卡详情"), @@ -522,6 +523,7 @@ class MessageLookup extends MessageLookupByLibrary { "xitongtongzhi" : MessageLookupByLibrary.simpleMessage("系统通知"), "xitongxiaoxi" : MessageLookupByLibrary.simpleMessage("系统消息"), "xiugaichenggong" : MessageLookupByLibrary.simpleMessage("修改成功"), + "xuanguige" : MessageLookupByLibrary.simpleMessage("选规格"), "xuni" : MessageLookupByLibrary.simpleMessage("虚拟"), "yaoqingrenshoujihao_" : m32, "yiduihuan" : MessageLookupByLibrary.simpleMessage("已兑换"), @@ -571,6 +573,7 @@ class MessageLookup extends MessageLookupByLibrary { "youxiaoqizhi" : m36, "yuan" : MessageLookupByLibrary.simpleMessage("元"), "yuan_" : m37, + "yuanjia" : MessageLookupByLibrary.simpleMessage("原价"), "yue" : MessageLookupByLibrary.simpleMessage("余额"), "yue_" : m38, "yuemingxi" : MessageLookupByLibrary.simpleMessage("余额明细"), diff --git a/lib/generated/intl/messages_zh_Hans_CN.dart b/lib/generated/intl/messages_zh_Hans_CN.dart index 49ea9fe1..4955ede9 100644 --- a/lib/generated/intl/messages_zh_Hans_CN.dart +++ b/lib/generated/intl/messages_zh_Hans_CN.dart @@ -231,6 +231,7 @@ class MessageLookup extends MessageLookupByLibrary { "huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("回乡头条"), "huiyuandengji" : MessageLookupByLibrary.simpleMessage("会员等级"), "huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("会员等级说明"), + "huiyuanjia" : MessageLookupByLibrary.simpleMessage("会员价"), "huiyuanjifen" : MessageLookupByLibrary.simpleMessage("会员积分"), "huiyuanka" : MessageLookupByLibrary.simpleMessage("会员卡"), "huiyuankaxiangqing" : MessageLookupByLibrary.simpleMessage("会员卡详情"), @@ -522,6 +523,7 @@ class MessageLookup extends MessageLookupByLibrary { "xitongtongzhi" : MessageLookupByLibrary.simpleMessage("系统通知"), "xitongxiaoxi" : MessageLookupByLibrary.simpleMessage("系统消息"), "xiugaichenggong" : MessageLookupByLibrary.simpleMessage("修改成功"), + "xuanguige" : MessageLookupByLibrary.simpleMessage("选规格"), "xuni" : MessageLookupByLibrary.simpleMessage("虚拟"), "yaoqingrenshoujihao_" : m32, "yiduihuan" : MessageLookupByLibrary.simpleMessage("已兑换"), @@ -571,6 +573,7 @@ class MessageLookup extends MessageLookupByLibrary { "youxiaoqizhi" : m36, "yuan" : MessageLookupByLibrary.simpleMessage("元"), "yuan_" : m37, + "yuanjia" : MessageLookupByLibrary.simpleMessage("原价"), "yue" : MessageLookupByLibrary.simpleMessage("余额"), "yue_" : m38, "yuemingxi" : MessageLookupByLibrary.simpleMessage("余额明细"), diff --git a/lib/generated/intl/messages_zh_Hant_CN.dart b/lib/generated/intl/messages_zh_Hant_CN.dart index c0caa0ad..b16610ba 100644 --- a/lib/generated/intl/messages_zh_Hant_CN.dart +++ b/lib/generated/intl/messages_zh_Hant_CN.dart @@ -231,6 +231,7 @@ class MessageLookup extends MessageLookupByLibrary { "huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("回鄉頭條"), "huiyuandengji" : MessageLookupByLibrary.simpleMessage("會員等級"), "huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("會員等級説明"), + "huiyuanjia" : MessageLookupByLibrary.simpleMessage("會員價"), "huiyuanjifen" : MessageLookupByLibrary.simpleMessage("會員積分"), "huiyuanka" : MessageLookupByLibrary.simpleMessage("會員卡"), "huiyuankaxiangqing" : MessageLookupByLibrary.simpleMessage("會員卡詳情"), @@ -522,6 +523,7 @@ class MessageLookup extends MessageLookupByLibrary { "xitongtongzhi" : MessageLookupByLibrary.simpleMessage("系統通知"), "xitongxiaoxi" : MessageLookupByLibrary.simpleMessage("系統消息"), "xiugaichenggong" : MessageLookupByLibrary.simpleMessage("修改成功"), + "xuanguige" : MessageLookupByLibrary.simpleMessage("選規格"), "xuni" : MessageLookupByLibrary.simpleMessage("虛擬"), "yaoqingrenshoujihao_" : m32, "yiduihuan" : MessageLookupByLibrary.simpleMessage("已兌換"), @@ -571,6 +573,7 @@ class MessageLookup extends MessageLookupByLibrary { "youxiaoqizhi" : m36, "yuan" : MessageLookupByLibrary.simpleMessage("元"), "yuan_" : m37, + "yuanjia" : MessageLookupByLibrary.simpleMessage("原價"), "yue" : MessageLookupByLibrary.simpleMessage("餘額"), "yue_" : m38, "yuemingxi" : MessageLookupByLibrary.simpleMessage("餘額明細"), diff --git a/lib/generated/intl/messages_zh_TW.dart b/lib/generated/intl/messages_zh_TW.dart index f6ccc84f..53548694 100644 --- a/lib/generated/intl/messages_zh_TW.dart +++ b/lib/generated/intl/messages_zh_TW.dart @@ -231,6 +231,7 @@ class MessageLookup extends MessageLookupByLibrary { "huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("回鄉頭條"), "huiyuandengji" : MessageLookupByLibrary.simpleMessage("會員等級"), "huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("會員等級説明"), + "huiyuanjia" : MessageLookupByLibrary.simpleMessage("會員價"), "huiyuanjifen" : MessageLookupByLibrary.simpleMessage("會員積分"), "huiyuanka" : MessageLookupByLibrary.simpleMessage("會員卡"), "huiyuankaxiangqing" : MessageLookupByLibrary.simpleMessage("會員卡詳情"), @@ -522,6 +523,7 @@ class MessageLookup extends MessageLookupByLibrary { "xitongtongzhi" : MessageLookupByLibrary.simpleMessage("系統通知"), "xitongxiaoxi" : MessageLookupByLibrary.simpleMessage("系統消息"), "xiugaichenggong" : MessageLookupByLibrary.simpleMessage("修改成功"), + "xuanguige" : MessageLookupByLibrary.simpleMessage("選規格"), "xuni" : MessageLookupByLibrary.simpleMessage("虛擬"), "yaoqingrenshoujihao_" : m32, "yiduihuan" : MessageLookupByLibrary.simpleMessage("已兌換"), @@ -571,6 +573,7 @@ class MessageLookup extends MessageLookupByLibrary { "youxiaoqizhi" : m36, "yuan" : MessageLookupByLibrary.simpleMessage("元"), "yuan_" : m37, + "yuanjia" : MessageLookupByLibrary.simpleMessage("原價"), "yue" : MessageLookupByLibrary.simpleMessage("餘額"), "yue_" : m38, "yuemingxi" : MessageLookupByLibrary.simpleMessage("餘額明細"), diff --git a/lib/generated/l10n.dart b/lib/generated/l10n.dart index 7d5b357b..c4024160 100644 --- a/lib/generated/l10n.dart +++ b/lib/generated/l10n.dart @@ -5095,6 +5095,36 @@ class S { ); } + /// `会员价` + String get huiyuanjia { + return Intl.message( + '会员价', + name: 'huiyuanjia', + desc: '', + args: [], + ); + } + + /// `原价` + String get yuanjia { + return Intl.message( + '原价', + name: 'yuanjia', + desc: '', + args: [], + ); + } + + /// `选规格` + String get xuanguige { + return Intl.message( + '选规格', + name: 'xuanguige', + desc: '', + args: [], + ); + } + /// `并使用本机号码登录` String get privacy_policy4 { return Intl.message( diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index d54801d5..2b8c93ca 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -529,6 +529,10 @@ "tuiguangma": "推广码", "wodegongju": "我的工具", "beizhuxinxi": "备注信息", + "huiyuanjia": "会员价", + "yuanjia": "原价", + "xuanguige": "选规格", + diff --git a/lib/l10n/intl_zh_CN.arb b/lib/l10n/intl_zh_CN.arb index 2b89515d..34e76b93 100644 --- a/lib/l10n/intl_zh_CN.arb +++ b/lib/l10n/intl_zh_CN.arb @@ -529,6 +529,9 @@ "tuiguangma": "推广码", "wodegongju": "我的工具", "beizhuxinxi": "备注信息", + "huiyuanjia": "会员价", + "yuanjia": "原价", + "xuanguige": "选规格", diff --git a/lib/l10n/intl_zh_Hans_CN.arb b/lib/l10n/intl_zh_Hans_CN.arb index 329a03f4..af4f27fe 100644 --- a/lib/l10n/intl_zh_Hans_CN.arb +++ b/lib/l10n/intl_zh_Hans_CN.arb @@ -529,6 +529,9 @@ "tuiguangma": "推广码", "wodegongju": "我的工具", "beizhuxinxi": "备注信息", + "huiyuanjia": "会员价", + "yuanjia": "原价", + "xuanguige": "选规格", diff --git a/lib/l10n/intl_zh_Hant_CN.arb b/lib/l10n/intl_zh_Hant_CN.arb index d116dcae..89980a93 100644 --- a/lib/l10n/intl_zh_Hant_CN.arb +++ b/lib/l10n/intl_zh_Hant_CN.arb @@ -524,6 +524,9 @@ "tuiguangma": "推廣碼", "wodegongju": "我的工具", "beizhuxinxi": "備注信息", + "huiyuanjia": "會員價", + "yuanjia": "原價", + "xuanguige": "選規格", diff --git a/lib/l10n/intl_zh_TW.arb b/lib/l10n/intl_zh_TW.arb index 26437954..3a28318d 100644 --- a/lib/l10n/intl_zh_TW.arb +++ b/lib/l10n/intl_zh_TW.arb @@ -523,6 +523,9 @@ "tuiguangma": "推廣碼", "wodegongju": "我的工具", "beizhuxinxi": "備注信息", + "huiyuanjia": "會員價", + "yuanjia": "原價", + "xuanguige": "選規格", diff --git a/lib/retrofit/data/findMiNiGroupList.dart b/lib/retrofit/data/findMiNiGroupList.dart new file mode 100644 index 00000000..e41b2a90 --- /dev/null +++ b/lib/retrofit/data/findMiNiGroupList.dart @@ -0,0 +1,167 @@ +/// id : "1435148069191548928" +/// storeId : "1333246101343436800" +/// groupName : "��Ʒ�人" +/// groupImg : "https://pos.upload.gznl.top/1175/2021/09/c9abb054-4509-4f22-9671-6f712ab7e493.png" +/// sort : 0 +/// productList : [{"id":"1440501052276211712","supplierName":"����","storeId":"1333246101343436800","categoryId":"1300688133322440704","groupId":"1435148069191548928","shortName":"����","productName":"֧������","sellDesc":"","productCode":"PRO202109221019480000000000001","weight":"0","applyPrice":"0.00","price":"0.01","stock":-48,"sellCount":48,"needLogistics":1,"oversold":1,"status":1,"posShow":true,"attrStyle":0,"isDelete":0,"productAttrValues":null,"skuList":null,"imgPathList":null,"buyNum":0,"imgPath":"https://pos.upload.gznl.top/1175/2021/09/ade72b41-23a2-4f29-ae50-4e620b7e9011.png","setMeal":1,"printerFlag":"DEFAULT","markProductNone":null},{"id":"1435893909921202176","supplierName":"����","storeId":"1333246101343436800","categoryId":"1300688133322440704","groupId":"1435148069191548928","shortName":"����","productName":"������","sellDesc":"","productCode":"PRO202109091712400000000000003","weight":"0","applyPrice":"0.00","price":"9999.00","stock":-10,"sellCount":10,"needLogistics":1,"oversold":1,"status":1,"posShow":true,"attrStyle":0,"isDelete":0,"productAttrValues":null,"skuList":null,"imgPathList":null,"buyNum":0,"imgPath":"https://pos.upload.gznl.top/1175/2021/09/1d212bc1-b952-4aba-a870-8538009da680.png","setMeal":1,"printerFlag":"DEFAULT","markProductNone":null},{"id":"1435781813317402624","supplierName":"��Ͽ����","storeId":"1333246101343436800","categoryId":"1300688133322440704","groupId":"1435148069191548928","shortName":"ƴ�̲���","productName":"ƴ�̲���(��ѡ��)","sellDesc":"","productCode":"PRO202109090947140000000000001","weight":"0","applyPrice":"0.00","price":"2.00","stock":-15,"sellCount":17,"needLogistics":1,"oversold":1,"status":1,"posShow":true,"attrStyle":0,"isDelete":0,"productAttrValues":null,"skuList":null,"imgPathList":null,"buyNum":0,"imgPath":"https://pos.upload.gznl.top/1175/2021/09/c1412e9a-2c5a-4658-9850-8dde8d1e9321.png","setMeal":1,"printerFlag":"DEFAULT","markProductNone":null}] +/// productPageVO : null + +class FindMiNiGroupList { + String id; + String storeId; + String groupName; + String groupImg; + int sort; + List productList; + dynamic productPageVO; + + static FindMiNiGroupList fromMap(Map map) { + if (map == null) return null; + FindMiNiGroupList findMiNiGroupListBean = FindMiNiGroupList(); + findMiNiGroupListBean.id = map['id']; + findMiNiGroupListBean.storeId = map['storeId']; + findMiNiGroupListBean.groupName = map['groupName']; + findMiNiGroupListBean.groupImg = map['groupImg']; + findMiNiGroupListBean.sort = map['sort']; + findMiNiGroupListBean.productList = List()..addAll( + (map['productList'] as List ?? []).map((o) => ProductListBean.fromMap(o)) + ); + findMiNiGroupListBean.productPageVO = map['productPageVO']; + return findMiNiGroupListBean; + } + + Map toJson() => { + "id": id, + "storeId": storeId, + "groupName": groupName, + "groupImg": groupImg, + "sort": sort, + "productList": productList, + "productPageVO": productPageVO, + }; +} + +/// id : "1440501052276211712" +/// supplierName : "����" +/// storeId : "1333246101343436800" +/// categoryId : "1300688133322440704" +/// groupId : "1435148069191548928" +/// shortName : "����" +/// productName : "֧������" +/// sellDesc : "" +/// productCode : "PRO202109221019480000000000001" +/// weight : "0" +/// applyPrice : "0.00" +/// price : "0.01" +/// stock : -48 +/// sellCount : 48 +/// needLogistics : 1 +/// oversold : 1 +/// status : 1 +/// posShow : true +/// attrStyle : 0 +/// isDelete : 0 +/// productAttrValues : null +/// skuList : null +/// imgPathList : null +/// buyNum : 0 +/// imgPath : "https://pos.upload.gznl.top/1175/2021/09/ade72b41-23a2-4f29-ae50-4e620b7e9011.png" +/// setMeal : 1 +/// printerFlag : "DEFAULT" +/// markProductNone : null + +class ProductListBean { + String id; + String supplierName; + String storeId; + String categoryId; + String groupId; + String shortName; + String productName; + String sellDesc; + String productCode; + String weight; + String applyPrice; + String price; + int stock; + int sellCount; + int needLogistics; + int oversold; + int status; + bool posShow; + int attrStyle; + int isDelete; + dynamic productAttrValues; + dynamic skuList; + dynamic imgPathList; + int buyNum; + String imgPath; + int setMeal; + String printerFlag; + dynamic markProductNone; + + static ProductListBean fromMap(Map map) { + if (map == null) return null; + ProductListBean productListBean = ProductListBean(); + productListBean.id = map['id']; + productListBean.supplierName = map['supplierName']; + productListBean.storeId = map['storeId']; + productListBean.categoryId = map['categoryId']; + productListBean.groupId = map['groupId']; + productListBean.shortName = map['shortName']; + productListBean.productName = map['productName']; + productListBean.sellDesc = map['sellDesc']; + productListBean.productCode = map['productCode']; + productListBean.weight = map['weight']; + productListBean.applyPrice = map['applyPrice']; + productListBean.price = map['price']; + productListBean.stock = map['stock']; + productListBean.sellCount = map['sellCount']; + productListBean.needLogistics = map['needLogistics']; + productListBean.oversold = map['oversold']; + productListBean.status = map['status']; + productListBean.posShow = map['posShow']; + productListBean.attrStyle = map['attrStyle']; + productListBean.isDelete = map['isDelete']; + productListBean.productAttrValues = map['productAttrValues']; + productListBean.skuList = map['skuList']; + productListBean.imgPathList = map['imgPathList']; + productListBean.buyNum = map['buyNum']; + productListBean.imgPath = map['imgPath']; + productListBean.setMeal = map['setMeal']; + productListBean.printerFlag = map['printerFlag']; + productListBean.markProductNone = map['markProductNone']; + return productListBean; + } + + Map toJson() => { + "id": id, + "supplierName": supplierName, + "storeId": storeId, + "categoryId": categoryId, + "groupId": groupId, + "shortName": shortName, + "productName": productName, + "sellDesc": sellDesc, + "productCode": productCode, + "weight": weight, + "applyPrice": applyPrice, + "price": price, + "stock": stock, + "sellCount": sellCount, + "needLogistics": needLogistics, + "oversold": oversold, + "status": status, + "posShow": posShow, + "attrStyle": attrStyle, + "isDelete": isDelete, + "productAttrValues": productAttrValues, + "skuList": skuList, + "imgPathList": imgPathList, + "buyNum": buyNum, + "imgPath": imgPath, + "setMeal": setMeal, + "printerFlag": printerFlag, + "markProductNone": markProductNone, + }; +} \ No newline at end of file diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index 64514542..3d91dc41 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -10,13 +10,16 @@ import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/view_widget/login_tips_dialog.dart'; import 'package:retrofit/retrofit.dart'; +import 'data/findMiNiGroupList.dart'; +import 'data/page.dart'; + part 'min_api.g.dart'; -const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///正式 -const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///正式 +// const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///正式 +// const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///正式 -// const base_url = "http://192.168.10.236:8766/app/"; ///费韬 -// const baseUrl = "http://192.168.10.236:8766/app/"; ///费韬 +const base_url = "http://192.168.10.236:8766/app/"; ///费韬 +const baseUrl = "http://192.168.10.236:8766/app/"; ///费韬 // const base_url = "http://192.168.10.37:8766/app/"; // const baseUrl = "http://192.168.10.37:8766/app/"; @@ -105,4 +108,9 @@ abstract class MinApiService { debugPrint(msg); } + ///小程序查询分组及商品列表 + @POST("product/findMiNiGroupList") + Future>> findMiNiGroupList( + @Body() Map param,Map header); + } \ No newline at end of file diff --git a/lib/store/store_order.dart b/lib/store/store_order.dart index bbe9a348..fb858388 100644 --- a/lib/store/store_order.dart +++ b/lib/store/store_order.dart @@ -6,8 +6,8 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/activity.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/order_info.dart'; import 'package:huixiang/retrofit/data/store_info.dart'; -import 'package:huixiang/retrofit/data/user_entity.dart'; import 'package:huixiang/retrofit/min_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/store/store_view/store_activity.dart'; @@ -17,6 +17,7 @@ import 'package:huixiang/union/union_view/union_coupon.dart'; import 'package:huixiang/union/union_view/vip.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/classic_header.dart'; +import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/my_tab.dart'; import 'package:huixiang/view_widget/round_button.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; @@ -26,8 +27,10 @@ class StoreOrderPage extends StatefulWidget { final Map arguments; final List activitys; final StoreInfo storeInfo; + final List productList; + - StoreOrderPage({this.arguments, this.activitys, this.storeInfo}); + StoreOrderPage({this.arguments, this.activitys, this.storeInfo,this.productList}); @override State createState() { @@ -58,6 +61,7 @@ class _StoreOrderPage extends State StoreOrderListPage( widget.arguments, widget.activitys, storeInfo, controller), + ///星店活动, StoreActivity( widget.arguments, @@ -68,25 +72,6 @@ class _StoreOrderPage extends State queryStoreInfo(); } - /// 小程序登录 - minLogin() { - apiService.minLogin(widget.arguments["id"]) - .catchError((onError){}).then((baseData) { - if (baseData != null && baseData.isSuccess) { - UserEntity userEntity = UserEntity.fromJson(baseData.data); - String minToken = userEntity.token; - SharedPreferences.getInstance().then((value) => { - value.setString('minToken', minToken), - }); - minService = MinApiService( - Dio(), - context: context, - token: minToken, - ); - } - }); - } - /// 查询店铺信息 queryStoreInfo() async { final SharedPreferences value = await SharedPreferences.getInstance(); @@ -96,8 +81,6 @@ class _StoreOrderPage extends State token: value.getString('token'), ); - minLogin(); - BaseData baseData = await apiService .queryStoreInfo(widget.arguments["id"]) .catchError((error) { @@ -147,9 +130,7 @@ class _StoreOrderPage extends State handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context), sliver: SliverAppBar( title: Text( - storeInfo != null - ? storeInfo.storeName - : '', + "", style: TextStyle( color: Colors.black, fontWeight: FontWeight.bold, @@ -178,7 +159,7 @@ class _StoreOrderPage extends State padding: EdgeInsets.all(6), child: Icon( Icons.arrow_back_ios, - color: Colors.black, + color: Colors.white, size: 24, ), ), @@ -458,10 +439,15 @@ class _StoreOrderPage extends State right: 16, ), child: ListView.builder( - itemCount: 2, + itemCount: widget.productList == null ? 0 : widget.productList.length, physics: BouncingScrollPhysics(), itemBuilder: (context, position) { - return shoppGoodsItem(); + // return shoppGoodsItem(); + return GestureDetector( + onTap: () { + }, + child: shoppGoodsItem(widget.productList[position], position), + ); }, ), ), @@ -554,16 +540,19 @@ class _StoreOrderPage extends State ); } - Widget shoppGoodsItem() { + ///购物车商品列表 + Widget shoppGoodsItem(ProductList productList,position) { return Container( padding: EdgeInsets.only(bottom: 10), child: Row( children: [ - Image.asset( - "assets/image/default_1.png", + MImage( + productList != null ? productList.skuImg : "", width: 60, - height: 60, + height:60, fit: BoxFit.cover, + errorSrc: "assets/image/default_1.png", + fadeSrc: "assets/image/default_1.png", ), SizedBox(width: 10), Expanded( @@ -571,7 +560,7 @@ class _StoreOrderPage extends State crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - "手工啵啵奶茶", + productList.productName, style: TextStyle( color: Colors.black, fontSize: 12.sp, @@ -582,7 +571,7 @@ class _StoreOrderPage extends State Row( children: [ Text( - "无香精", + productList.skuNameStr, style: TextStyle( color: Color(0xFF4C4C4C), fontSize: 11.sp, @@ -590,14 +579,6 @@ class _StoreOrderPage extends State ), ), SizedBox(width: 10), - Text( - "无香精", - style: TextStyle( - color: Color(0xFF4C4C4C), - fontSize: 11.sp, - fontWeight: MyFontWeight.regular, - ), - ) ], ), SizedBox(height: 6), @@ -609,7 +590,7 @@ class _StoreOrderPage extends State Row( children: [ Text( - "会员价", + S.of(context).huiyuanjia, style: TextStyle( color: Color(0xFFFF7A1A), fontSize: 13.sp, @@ -617,7 +598,7 @@ class _StoreOrderPage extends State ), ), Text( - "¥19.00", + productList.sellPrice, style: TextStyle( color: Color(0xFFFF7A1A), fontSize: 14.sp, diff --git a/lib/store/store_view/store_order_list.dart b/lib/store/store_view/store_order_list.dart index 6f5e134d..29fc3454 100644 --- a/lib/store/store_view/store_order_list.dart +++ b/lib/store/store_view/store_order_list.dart @@ -1,12 +1,22 @@ +import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:huixiang/generated/l10n.dart'; 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/findMiNiGroupList.dart'; +import 'package:huixiang/retrofit/data/findMiNiGroupList.dart'; +import 'package:huixiang/retrofit/data/findMiNiGroupList.dart'; import 'package:huixiang/retrofit/data/store_info.dart'; +import 'package:huixiang/retrofit/data/user_entity.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/custom_image.dart'; import 'package:huixiang/view_widget/round_button.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:shared_preferences/shared_preferences.dart'; class StoreOrderListPage extends StatefulWidget { final Map arguments; @@ -44,14 +54,63 @@ class _StoreOrderListPage extends State { int isSelected = 0; int isChoice = 0; int tempClickIndex = 0; + ApiService apiService; + MinApiService minService; + List appletProducts; + List productListBeans; @override void initState() { super.initState(); + minLogin(); + widget.controller.addListener(() {}); } + /// 小程序登录 + minLogin() async { + final SharedPreferences value = await SharedPreferences.getInstance(); + apiService = ApiService( + Dio(), + context: context, + token: value.getString('token'), + ); + apiService.minLogin(widget.arguments["id"]) + .catchError((onError){}).then((baseData) { + if (baseData != null && baseData.isSuccess) { + UserEntity userEntity = UserEntity.fromJson(baseData.data); + String minToken = userEntity.token; + SharedPreferences.getInstance().then((value) => { + value.setString('minToken', minToken), + }); + minService = MinApiService( + Dio(), + context: context, + token: minToken, + ); + appletGoods(); + } + }); + } + + ///小程序查询分组及商品列表 + appletGoods() async{ + BaseData> baseData = await minService.findMiNiGroupList({ + "id":widget.arguments["id"] + },{ + "store_id":widget.arguments["id"], + "tenant":"1175" + }); + if (baseData != null && baseData.isSuccess) { + setState(() { + appletProducts = baseData.data; + if(appletProducts.length > 0) + productListBeans = appletProducts[0].productList; + }); + } + } + @override Widget build(BuildContext context) { return Container( @@ -65,22 +124,20 @@ class _StoreOrderListPage extends State { width: 100.w, height: MediaQuery.of(context).size.height, child: ListView.builder( - itemCount: 28, - padding: EdgeInsets.only(top: 25, bottom: 50), + itemCount: appletProducts == null ? 0 : appletProducts.length, controller: widget.controller, itemBuilder: (context, position) { - return orderItem(position); + return orderItem(appletProducts[position],position); }, ), ), Container( width: MediaQuery.of(context).size.width - 100.w, child: ListView.builder( - itemCount: 15, - padding: EdgeInsets.only(top: 25, bottom: 50), + itemCount: productListBeans == null ? 0 : productListBeans.length, // controller: widget.controller, itemBuilder: (context, position) { - return goodsItem(); + return goodsItem(productListBeans[position], position); }, ), ), @@ -92,8 +149,9 @@ class _StoreOrderListPage extends State { ScrollController controller1 = ScrollController(); ScrollController controller2 = ScrollController(); - Widget orderItem(int index) { + Widget orderItem(FindMiNiGroupList findMiNiGroupList,int index) { return Container( + padding: EdgeInsets.only(top:100.h), child: Column( mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.center, @@ -102,6 +160,7 @@ class _StoreOrderListPage extends State { onTap:() { setState(() { isSelected = index; + productListBeans = findMiNiGroupList.productList; }); }, child: Container( @@ -109,7 +168,7 @@ class _StoreOrderListPage extends State { alignment: Alignment.center, padding: EdgeInsets.all(15), child: Text( - "人气推荐", + findMiNiGroupList.groupName, textAlign: TextAlign.center, style: TextStyle( color: isSelected != index @@ -126,26 +185,28 @@ class _StoreOrderListPage extends State { ); } - Widget goodsItem() { + Widget goodsItem(ProductListBean productListBean,position) { return Container( color: Colors.white, - padding: EdgeInsets.only(right: 16.w, bottom: 10, top: 10), + padding: EdgeInsets.only(right: 16.w, bottom: 10.h,top:10.h), child: Row( children: [ SizedBox(width: 12.w), - Image.asset( - "assets/image/default_1.png", + MImage( + productListBean != null ? productListBean.imgPath : "", width: 70, - height: 70, + height:70, fit: BoxFit.cover, + errorSrc: "assets/image/default_1.png", + fadeSrc: "assets/image/default_1.png", ), SizedBox(width: 10), Expanded( child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - "手工啵啵奶茶", + productListBean.productName, style: TextStyle( color: Colors.black, fontSize: 13.sp, @@ -155,23 +216,18 @@ class _StoreOrderListPage extends State { SizedBox(height: 2), Row( children: [ - Text( - "无香精", + Expanded(child: Text( + productListBean.shortName, + overflow: TextOverflow.ellipsis, + maxLines: 2, style: TextStyle( color: Color(0xFF4C4C4C), fontSize: 10.sp, fontWeight: MyFontWeight.regular, ), - ), + ), ), + SizedBox(width: 10), - Text( - "无香精", - style: TextStyle( - color: Color(0xFF4C4C4C), - fontSize: 10.sp, - fontWeight: MyFontWeight.regular, - ), - ) ], ), SizedBox(height: 7), @@ -183,7 +239,7 @@ class _StoreOrderListPage extends State { Row( children: [ Text( - "会员价", + S.of(context).huiyuanjia, style: TextStyle( color: Color(0xFFFF7A1A), fontSize: 10.sp, @@ -191,7 +247,7 @@ class _StoreOrderListPage extends State { ), ), Text( - "¥19.00", + productListBean.applyPrice, style: TextStyle( color: Color(0xFFFF7A1A), fontSize: 11.sp, @@ -203,7 +259,7 @@ class _StoreOrderListPage extends State { Row( children: [ Text( - "原价", + S.of(context).yuanjia, style: TextStyle( color: Color(0xFFA29E9E), fontSize: 9.sp, @@ -212,7 +268,7 @@ class _StoreOrderListPage extends State { ), SizedBox(width: 10), Text( - "¥19.00", + productListBean.price, style: TextStyle( color: Color(0xFFA29E9E), fontSize: 10.sp, @@ -231,7 +287,7 @@ class _StoreOrderListPage extends State { }, child: RoundButton( width: 49.w, - text: "选规格", + text: S.of(context).xuanguige, textColor: Colors.white, fontWeight: MyFontWeight.medium, radius: 11,