Browse Source

UI

null_safety
fmk 3 years ago
parent
commit
cc04bdbc00
  1. BIN
      assets/image/2x/icon_like.png
  2. BIN
      assets/image/2x/icon_like_h.png
  3. BIN
      assets/image/3x/icon_like.png
  4. BIN
      assets/image/3x/icon_like_h.png
  5. BIN
      assets/image/icon_like.png
  6. BIN
      assets/image/icon_like_h.png
  7. 7
      lib/article/hot_article_item.dart
  8. 5
      lib/home/activity_list_page.dart
  9. 23
      lib/home/home_page.dart
  10. 12
      lib/home/huixiang_brand_page.dart
  11. 24
      lib/home/points_mall_page.dart
  12. 8
      lib/integral/integral_detailed_page.dart
  13. 10
      lib/integral/integral_page.dart
  14. 4
      lib/integral_store/integral_store_details_page.dart
  15. 2
      lib/login/login_page.dart
  16. 7
      lib/message/system_message.dart
  17. 7
      lib/mine/coupons_page.dart
  18. 6
      lib/mine/manage_address_page.dart
  19. 7
      lib/mine/mine_card_invalid_page.dart
  20. 10
      lib/mine/mine_page.dart
  21. 6
      lib/mine/mine_vip_level_page.dart
  22. 12
      lib/mine/mine_wallet_page.dart
  23. 5
      lib/mine/recharge_page.dart
  24. 8
      lib/mine/roll_center_page.dart
  25. 4
      lib/mine/user_info_page.dart
  26. 7
      lib/mine/vip_balance_page.dart
  27. 5
      lib/mine/vip_card_page.dart
  28. 4
      lib/mine/vip_detail_page.dart
  29. 8
      lib/order/exchange_history_page.dart
  30. 4
      lib/order/logistics_information_page.dart
  31. 4
      lib/order/order_detail_page.dart
  32. 8
      lib/order/order_history_page.dart
  33. 12
      lib/order/store_selector_page.dart
  34. 21
      lib/retrofit/data/article.dart
  35. 36
      lib/retrofit/data/base_data.dart
  36. 2
      lib/retrofit/data/logistics.dart
  37. 2
      lib/retrofit/data/member_comment_list.dart
  38. 45
      lib/retrofit/data/page.dart
  39. 6
      lib/retrofit/data/store_info.dart
  40. 2
      lib/retrofit/data/vip_card.dart
  41. 84
      lib/retrofit/retrofit_api.dart
  42. 939
      lib/retrofit/retrofit_api.g.dart
  43. 244
      lib/union/store_details_page.dart
  44. 13
      lib/union/union_details_page.dart
  45. 7
      lib/union/union_page.dart
  46. 4
      pubspec.lock

BIN
assets/image/2x/icon_like.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 652 B

After

Width:  |  Height:  |  Size: 972 B

BIN
assets/image/2x/icon_like_h.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 927 B

BIN
assets/image/3x/icon_like.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
assets/image/3x/icon_like_h.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
assets/image/icon_like.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 349 B

After

Width:  |  Height:  |  Size: 504 B

BIN
assets/image/icon_like_h.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 529 B

After

Width:  |  Height:  |  Size: 462 B

7
lib/article/hot_article_item.dart

@ -51,7 +51,7 @@ class _HotArticlePage extends State<HotArticlePage> {
List<Article> articles = [];
queryArticle() async {
BaseData baseData = await apiService.queryArticle({
BaseData<PageInfo<Article>> baseData = await apiService.queryArticle({
"pageNum": pageNum,
"pageSize": 10,
"searchKey": "",
@ -62,14 +62,13 @@ class _HotArticlePage extends State<HotArticlePage> {
refreshController.loadFailed();
});
if (baseData != null && baseData.isSuccess) {
PageInfo pageInfo = PageInfo.fromJson(baseData.data);
refreshController.refreshCompleted();
refreshController.loadComplete();
if(pageNum == 1) {
articles.clear();
}
articles.addAll(pageInfo.list.map((e) => Article.fromJson(e)).toList());
if (pageInfo.pageNum == pageInfo.pages) {
articles.addAll(baseData.data.list);
if (baseData.data.pageNum == baseData.data.pages) {
refreshController.loadNoData();
} else {
pageNum += 1;

5
lib/home/activity_list_page.dart

@ -46,7 +46,7 @@ class _ActivityListPage extends State<ActivityListPage>
List<Activity> activityList;
queryActivity() async {
BaseData baseData = await apiService.informationList({
BaseData<PageInfo<Activity>> baseData = await apiService.informationList({
"pageNum": 1,
"pageSize": 10,
"searchKey": "",
@ -56,10 +56,9 @@ class _ActivityListPage extends State<ActivityListPage>
_refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
PageInfo pageInfo = PageInfo.fromJson(baseData.data);
_refreshController.refreshCompleted();
setState(() {
activityList = pageInfo.list.map((e) => Activity.fromJson(e)).toList();
activityList = baseData.data.list;
});
}
}

23
lib/home/home_page.dart

@ -87,25 +87,22 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
SmartDialog.showLoading(
msg: S.of(context).zhengzaijiazai,
animationDurationTemp: Duration(seconds: 1));
BaseData baseData = await apiService.queryBanner({
BaseData<PageInfo<BannerData>> baseData = await apiService.queryBanner({
"model": {"type": "HOME_PAGE"},
}).catchError((onError) {
refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
bannerData.clear();
bannerData.addAll((baseData.data["records"] as List<dynamic>)
.map((e) => BannerData.fromJson(e))
.toList());
bannerData.addAll(baseData.data.records);
setState(() {
controller.move(0, animation: false);
if (bannerData.length > 0)
controller.move(0, animation: false);
});
}
BaseData brand = await apiService.queryHomeBrand().catchError((onError) {
refreshController.refreshFailed();
}).catchError((onError) {
refreshController.refreshFailed();
});
if (brand != null && brand.isSuccess) {
brandData.clear();
@ -115,7 +112,7 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
founder = Founder.fromJson(brand.data["founder"]);
}
BaseData article = await apiService.queryArticle({
BaseData<PageInfo<Article>> article = await apiService.queryArticle({
"pageNum": 1,
"pageSize": 10,
"searchKey": "",
@ -126,11 +123,10 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
});
articles.clear();
if (article != null && article.isSuccess) {
PageInfo pageInfo = PageInfo.fromJson(article.data);
articles.addAll(pageInfo.list.map((e) => Article.fromJson(e)).toList());
articles.addAll(article.data.list);
}
BaseData goodsData = await apiService.creditGoods({
BaseData<PageInfo<Goods>> goodsData = await apiService.creditGoods({
"orderDesc": true,
"orderType": 1,
"pageNum": 1,
@ -138,9 +134,8 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
"state": 1
});
if (goodsData != null && goodsData.isSuccess) {
PageInfo page = PageInfo.fromJson(goodsData.data);
gooods.clear();
gooods.addAll(page.list.map((e) => Goods.fromJson(e)));
gooods.addAll(goodsData.data.list);
}
SmartDialog.dismiss();
if (baseData != null && baseData.isSuccess) {
@ -678,7 +673,7 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
),
);
},
itemCount: bannerData != null ? bannerData.length : 1,
itemCount: (bannerData != null && bannerData.length > 0) ? bannerData.length : 1,
),
),
);

12
lib/home/huixiang_brand_page.dart

@ -12,6 +12,7 @@ import 'package:huixiang/retrofit/data/banner.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/brand.dart';
import 'package:huixiang/retrofit/data/brand_data.dart';
import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/MyPainter.dart';
import 'package:huixiang/utils/event_type.dart';
@ -43,18 +44,16 @@ class _BrandPage extends State<BrandPage>
var isShowMore = false;
queryHome() async {
BaseData baseData = await apiService.queryHome().catchError((error) {
BaseData<BrandData> baseData = await apiService.queryHome().catchError((error) {
refreshController.refreshFailed();
});
BaseData banner = await apiService.queryBanner({
BaseData<PageInfo<BannerData>> banner = await apiService.queryBanner({
"model": {"type": "BRAND_APP"},
}).catchError((error) {
refreshController.refreshFailed();
});
bannerData.clear();
bannerData.addAll((banner.data["records"] as List<dynamic>)
.map((e) => BannerData.fromJson(e))
.toList());
bannerData.addAll(banner.data.records);
BaseData brand = await apiService.queryHomeBrand().catchError((onError) {
refreshController.refreshFailed();
@ -77,8 +76,7 @@ class _BrandPage extends State<BrandPage>
if (baseData != null && baseData.isSuccess) {
refreshController.refreshCompleted();
brandData = BrandData.fromJson(baseData.data);
// brandText = (brandData.contents as Map<String, dynamic>).keys.toList();
brandData = baseData.data;
setState(() {});
} else {
refreshController.refreshFailed();

24
lib/home/points_mall_page.dart

@ -90,28 +90,25 @@ class _PointsMallPage extends State<PointsMallPage>
//
bool orderDesc = true;
PageInfo page;
List<Goods> goods = [];
List<GoodsCategory> gooodsCategorys = [];
UserInfo userinfo;
List<BannerData> bannerData = [];
queryUser() async {
BaseData banner = await client.queryBanner({
BaseData<PageInfo<BannerData>> banner = await client.queryBanner({
"model": {"type": "CREDIT_INDEX"},
});
if (banner != null) {
bannerData.clear();
bannerData.addAll((banner.data["records"] as List<dynamic>)
.map((e) => BannerData.fromJson(e))
.toList());
bannerData.addAll(banner.data.records);
setState(() {});
}
BaseData baseData = await client.queryInfo();
BaseData<UserInfo> baseData = await client.queryInfo();
if (baseData != null && baseData.isSuccess) {
userinfo = UserInfo.fromJson(baseData.data);
userinfo = baseData.data;
SharedPreferences.getInstance().then((value) => {
value.setString('user', jsonEncode(baseData.data)),
});
@ -120,7 +117,7 @@ class _PointsMallPage extends State<PointsMallPage>
}
creditGoods(categoryId) async {
BaseData dataCategory = await client.goodsCategory({
BaseData<PageInfo<GoodsCategory>> dataCategory = await client.goodsCategory({
"current": 1,
"map": {},
"model": {"pageNum": 1, "pageSize": 20, "searchKey": ""},
@ -133,11 +130,9 @@ class _PointsMallPage extends State<PointsMallPage>
});
if (dataCategory != null && dataCategory.isSuccess) {
PageInfo pageInfo = PageInfo.fromJson(dataCategory.data);
gooodsCategorys.clear();
gooodsCategorys.add(GoodsCategory(name: S.of(context).quanbu));
gooodsCategorys.addAll(
pageInfo.records.map((e) => GoodsCategory.fromJson(e)).toList());
gooodsCategorys.addAll(dataCategory.data.records);
}
var param = {
@ -148,21 +143,20 @@ class _PointsMallPage extends State<PointsMallPage>
"pageSize": 10,
"state": 1
};
BaseData baseData = await client.creditGoods(param).catchError((onError) {
BaseData<PageInfo<Goods>> baseData = await client.creditGoods(param).catchError((onError) {
_refreshController.loadFailed();
_refreshController.refreshFailed();
});
SmartDialog.dismiss();
if (baseData != null && baseData.isSuccess) {
page = PageInfo.fromJson(baseData.data);
if (pageNum == 1) {
goods.clear();
}
goods.addAll(page.list.map((e) => Goods.fromJson(e)));
goods.addAll(baseData.data.list);
setState(() {
_refreshController.refreshCompleted();
_refreshController.loadComplete();
if (page.pageNum == page.pages) {
if (baseData.data.pageNum == baseData.data.pages) {
_refreshController.loadNoData();
} else {
pageNum += 1;

8
lib/integral/integral_detailed_page.dart

@ -72,7 +72,7 @@ class _IntegralDetailedPage extends State<IntegralDetailedPage>
List<UserBill> userBill = [];
queryDetail(category) async {
BaseData baseData = await apiService.queryBillInfo({
BaseData<PageInfo<UserBill>> baseData = await apiService.queryBillInfo({
"current": current,
"model": {"category": category, "title": "bill_title_point", "type": ""},
"order": "descending",
@ -84,12 +84,10 @@ class _IntegralDetailedPage extends State<IntegralDetailedPage>
});
if (current == 1) userBill.clear();
if (baseData != null && baseData.isSuccess) {
PageInfo pageInfo = PageInfo.fromJson(baseData.data);
userBill
.addAll(pageInfo.records.map((e) => UserBill.fromJson(e)).toList());
userBill.addAll(baseData.data.records);
refreshController.loadComplete();
refreshController.refreshCompleted();
if (current * 10 > int.tryParse(pageInfo.total)) {
if (current * 10 > int.tryParse(baseData.data.total)) {
refreshController.loadNoData();
} else {
current += 1;

10
lib/integral/integral_page.dart

@ -49,14 +49,12 @@ class _IntegralPage extends State<IntegralPage> {
}
querySignInfo() async {
BaseData baseData = await apiService.signInInfo();
BaseData<SignInfo> baseData = await apiService.signInInfo();
BaseData rankData = await apiService.rankList();
BaseData<List<Rank>> rankData = await apiService.rankList();
if (rankData != null && rankData.isSuccess) {
ranks.clear();
ranks.addAll((rankData.data as List<dynamic>)
.map((e) => Rank.fromJson(e))
.toList());
ranks.addAll(rankData.data);
}
if (userinfo != null &&
@ -69,7 +67,7 @@ class _IntegralPage extends State<IntegralPage> {
}
SmartDialog.dismiss(closeType: 3);
if (baseData != null && baseData.isSuccess) {
signInfo = SignInfo.fromJson(baseData.data);
signInfo = baseData.data;
setState(() {});
}
}

4
lib/integral_store/integral_store_details_page.dart

@ -50,10 +50,10 @@ class _IntegralStoreDetailsPage extends State {
Goods goods;
queryGoodsById() async {
BaseData baseData = await apiService.creditGoodsById(arguments["goodsId"]);
BaseData<Goods> baseData = await apiService.creditGoodsById(arguments["goodsId"]);
if (baseData != null && baseData.isSuccess) {
setState(() {
goods = Goods.fromJson(baseData.data);
goods = baseData.data;
});
}
}

2
lib/login/login_page.dart

@ -274,7 +274,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
"capcha": code,
"mobile": mobile,
};
SmartDialog.showLoading(msg: S.of(context).zhengzaijiazai, animationDurationTemp: Duration(seconds: 1));
SmartDialog.showLoading(msg: S.of(context).zhengzaijiazai);
BaseData value = await client.memberLogin(param).catchError((error) {
print(error);
SmartDialog.showToast("$error", alignment: Alignment.center);

7
lib/message/system_message.dart

@ -44,7 +44,7 @@ class _SystemMessagePage extends State<SystemMessagePage> {
}
queryMessage() async {
BaseData baseData = await apiService.msgList({
BaseData<PageInfo<Message>> baseData = await apiService.msgList({
"pageNum": pageNum,
"pageSize": 10,
"searchKey": "",
@ -56,15 +56,14 @@ class _SystemMessagePage extends State<SystemMessagePage> {
});
if (baseData != null && baseData.isSuccess) {
PageInfo pageInfo = PageInfo.fromJson(baseData.data);
if (pageNum == 1) {
messages.clear();
}
messages.addAll(pageInfo.list.map((e) => Message.fromJson(e)).toList());
messages.addAll(baseData.data.list);
_refreshController.loadComplete();
_refreshController.refreshCompleted();
if (mounted) setState(() {});
if (pageNum * 10 > int.tryParse(pageInfo.total)) {
if (pageNum * 10 > int.tryParse(baseData.data.total)) {
_refreshController.loadNoData();
} else {
pageNum += 1;

7
lib/mine/coupons_page.dart

@ -54,7 +54,7 @@ class _CouponsPage extends State<CouponsPage> {
}
queryCard() async {
BaseData baseData = await apiService.queryCard({
BaseData<PageInfo<Coupon>> baseData = await apiService.queryCard({
"centre": true,
"pageNum": pageNum,
"pageSize": 10,
@ -65,15 +65,14 @@ class _CouponsPage extends State<CouponsPage> {
_refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
PageInfo pageInfo = PageInfo.fromJson(baseData.data);
if (pageNum == 1) {
coupons.clear();
}
coupons.addAll(pageInfo.list.map((e) => Coupon.fromJson(e)));
coupons.addAll(baseData.data.list);
setState(() {
_refreshController.refreshCompleted();
_refreshController.loadComplete();
if (pageInfo.pageNum == pageInfo.pages) {
if (baseData.data.pageNum == baseData.data.pages) {
_refreshController.loadNoData();
} else {
pageNum += 1;

6
lib/mine/manage_address_page.dart

@ -41,12 +41,10 @@ class _ManageAddressPage extends State<ManageAddressPage> {
List<Address> addressList;
queryMemberAddress() async {
BaseData baseData = await apiService.queryMemberAddress();
BaseData<List<Address>> baseData = await apiService.queryMemberAddress();
if (baseData != null && baseData.isSuccess) {
checkIndex = 0;
addressList = (baseData.data as List<dynamic>)
.map((e) => Address.fromJson(e))
.toList();
addressList = baseData.data;
setState(() {});
}
}

7
lib/mine/mine_card_invalid_page.dart

@ -52,7 +52,7 @@ class _MineCardInvalidPage extends State<MineCardInvalidPage> {
}
queryCard() async {
BaseData baseData = await apiService.queryCard({
BaseData<PageInfo<Coupon>> baseData = await apiService.queryCard({
"centre": true,
"pageNum": pageNum,
"pageSize": 10,
@ -63,15 +63,14 @@ class _MineCardInvalidPage extends State<MineCardInvalidPage> {
_refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
PageInfo pageInfo = PageInfo.fromJson(baseData.data);
if (pageNum == 1) {
coupons.clear();
}
coupons.addAll(pageInfo.list.map((e) => Coupon.fromJson(e)));
coupons.addAll(baseData.data.list);
setState(() {
_refreshController.refreshCompleted();
_refreshController.loadComplete();
if (pageInfo.pageNum == pageInfo.pages) {
if (baseData.data.pageNum == baseData.data.pages) {
_refreshController.loadNoData();
} else {
pageNum += 1;

10
lib/mine/mine_page.dart

@ -100,17 +100,15 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
queryUserInfo() async {
SmartDialog.showLoading(msg: S.of(context).zhengzaijiazai, animationDurationTemp: Duration(seconds: 1));
BaseData rankData = await apiService.rankList();
BaseData<List<Rank>> rankData = await apiService.rankList();
if (rankData != null && rankData.isSuccess) {
ranks.clear();
ranks.addAll((rankData.data as List<dynamic>)
.map((e) => Rank.fromJson(e))
.toList());
ranks.addAll(rankData.data);
}
BaseData baseDate = await apiService.queryInfo();
BaseData<UserInfo> baseDate = await apiService.queryInfo();
if (baseDate != null && baseDate.isSuccess) {
userinfo = UserInfo.fromJson(baseDate.data);
userinfo = baseDate.data;
if (userinfo != null &&
userinfo.memberRankVo != null &&
ranks != null &&

6
lib/mine/mine_vip_level_page.dart

@ -41,12 +41,10 @@ class _MineVipLevelPage extends State<MineVipLevelPage> {
}
queryVipLevel() async {
BaseData rankData = await apiService.rankList();
BaseData<List<Rank>> rankData = await apiService.rankList();
if (rankData != null && rankData.isSuccess) {
ranks.clear();
ranks.addAll((rankData.data as List<dynamic>)
.map((e) => Rank.fromJson(e))
.toList());
ranks.addAll(rankData.data);
setState(() {
controller.move((widget.arguments["rankLevel"] - 1), animation: false);
});

12
lib/mine/mine_wallet_page.dart

@ -57,9 +57,9 @@ class _MineWalletPage extends State<MineWalletPage> {
}
queryUserBalance() async {
BaseData baseData = await apiService.queryInfo();
BaseData<UserInfo> baseData = await apiService.queryInfo();
if (baseData != null && baseData.isSuccess) {
userInfo = UserInfo.fromJson(baseData.data);
userInfo = baseData.data;
mBalance = double.tryParse(userInfo.money);
if (mounted) setState(() {});
}
@ -67,7 +67,7 @@ class _MineWalletPage extends State<MineWalletPage> {
loadBillInfo() async {
queryUserBalance();
BaseData baseData = await apiService.queryBillInfo({
BaseData<PageInfo<UserBill>> baseData = await apiService.queryBillInfo({
"current": current,
"model": {"category": "", "title": "bill_title_balance", "type": ""},
"order": "descending",
@ -78,15 +78,13 @@ class _MineWalletPage extends State<MineWalletPage> {
refreshController.loadFailed();
});
if (baseData != null && baseData.isSuccess) {
PageInfo pageInfo = PageInfo.fromJson(baseData.data);
if (current == 1) {
userBills.clear();
}
userBills
.addAll(pageInfo.records.map((e) => UserBill.fromJson(e)).toList());
userBills.addAll(baseData.data.records);
refreshController.refreshCompleted();
refreshController.loadComplete();
if (current * 10 > int.tryParse(pageInfo.total)) {
if (current * 10 > int.tryParse(baseData.data.total)) {
refreshController.loadNoData();
} else {
current += 1;

5
lib/mine/recharge_page.dart

@ -216,10 +216,9 @@ class _RechargePage extends State<RechargePage> {
await Min.initialize();
}
BaseData baseData =
await apiService.recharge({"amount": amount, "rechargeType": 2});
BaseData<WxPay> baseData = await apiService.recharge({"amount": amount, "rechargeType": 2});
if (baseData != null && baseData.isSuccess) {
WxPay wxPay = WxPay.fromJson(baseData.data);
WxPay wxPay = baseData.data;
await registerWxApi(
appId: wxPay.appId,
doOnAndroid: true,

8
lib/mine/roll_center_page.dart

@ -45,7 +45,7 @@ class _RollCenterPage extends State<RollCenterPage> {
List<Coupon> coupons = [];
queryCoupon() async {
BaseData baseData = await apiService.queryCoupon({
BaseData<PageInfo<Coupon>> baseData = await apiService.queryCoupon({
"centre": true,
"pageNum": pageNum,
"pageSize": 10,
@ -57,12 +57,10 @@ class _RollCenterPage extends State<RollCenterPage> {
});
if (pageNum == 1) coupons.clear();
if (baseData != null && baseData.isSuccess) {
PageInfo pageInfo = PageInfo.fromJson(baseData.data);
coupons.addAll(pageInfo.list.map((e) => Coupon.fromJson(e)).toList());
coupons.addAll(baseData.data.list);
_refreshController.refreshCompleted();
_refreshController.loadComplete();
if (pageInfo.pageNum == pageInfo.pages) {
if (baseData.data.pageNum == baseData.data.pages) {
_refreshController.loadNoData();
} else {
pageNum += 1;

4
lib/mine/user_info_page.dart

@ -340,9 +340,9 @@ class _UserInfoPage extends State<UserInfoPage> {
///
fileUpload() async {
if (filePath != null && filePath != "" && await File(filePath).exists()) {
BaseData baseData = await apiService.upload(File(filePath), 123123123);
BaseData<UploadResult> baseData = await apiService.upload(File(filePath), 123123123);
if (baseData != null && baseData.isSuccess) {
UploadResult uploadResult = UploadResult.fromJson(baseData.data);
UploadResult uploadResult = baseData.data;
modifyInfo["headimg"] = uploadResult.url;
modifyInfos();
}

7
lib/mine/vip_balance_page.dart

@ -45,7 +45,7 @@ class _VipBalancePage extends State<VipBalancePage> {
List<UserBill> userBills = [];
queryBillInfo() async {
BaseData baseData = await apiService.queryBillInfo({
BaseData<PageInfo<UserBill>> baseData = await apiService.queryBillInfo({
"current": current,
"model": {
"category": "",
@ -61,15 +61,14 @@ class _VipBalancePage extends State<VipBalancePage> {
_refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
PageInfo pageInfo = PageInfo.fromJson(baseData.data);
if (current == 1) {
userBills.clear();
}
userBills.addAll(pageInfo.records.map((e) => UserBill.fromJson(e)));
userBills.addAll(baseData.data.records);
setState(() {
_refreshController.refreshCompleted();
_refreshController.loadComplete();
if (pageInfo.pageNum == pageInfo.pages) {
if (baseData.data.pageNum == baseData.data.pages) {
_refreshController.loadNoData();
} else {
current += 1;

5
lib/mine/vip_card_page.dart

@ -39,13 +39,12 @@ class _VipCardPage extends State<VipCardPage> {
List<VipCard> coupons = [];
queryVipCard() async {
BaseData baseData = await apiService.vipList({}).catchError((error) {
BaseData<List<VipCard>> baseData = await apiService.vipList({}).catchError((error) {
_refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
coupons.clear();
coupons.addAll(
(baseData.data as List<dynamic>).map((e) => VipCard.fromMap(e)));
coupons.addAll(baseData.data);
setState(() {
_refreshController.refreshCompleted();
});

4
lib/mine/vip_detail_page.dart

@ -65,13 +65,13 @@ class _VipDetailPage extends State<VipDetailPage> {
int current = 1;
vipDetail(latitude, longitude) async {
BaseData baseData = await apiService.vipDetail({
BaseData<VipCard> baseData = await apiService.vipDetail({
"id": widget.arguments["id"],
"latitude": "$latitude",
"longitude": "$longitude",
});
if (baseData != null && baseData.isSuccess) {
vipCard = VipCard.fromMap(baseData.data);
vipCard = baseData.data;
refreshController.loadComplete();
setState(() {});
} else {

8
lib/order/exchange_history_page.dart

@ -132,7 +132,6 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
}
int pageNum = 1;
PageInfo pageInfo;
List<ExchangeOrder> orders = [];
queryHistory() async {
@ -144,21 +143,20 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
if (widget.orderStatus != 0) {
map["state"] = widget.orderStatus;
}
BaseData baseData =
BaseData<PageInfo<ExchangeOrder>> baseData =
await apiService.creditOrderList(map).catchError((error) {
_refreshController.loadFailed();
_refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
pageInfo = PageInfo.fromJson(baseData.data);
if (pageNum == 1) {
orders.clear();
}
orders.addAll(pageInfo.list.map((e) => ExchangeOrder.fromJson(e)));
orders.addAll(baseData.data.list);
setState(() {
_refreshController.loadComplete();
_refreshController.refreshCompleted();
if (pageInfo.pages == pageInfo.pageNum) {
if (baseData.data.pages == baseData.data.pageNum) {
_refreshController.loadNoData();
} else {
pageNum += 1;

4
lib/order/logistics_information_page.dart

@ -43,13 +43,13 @@ class _LogisticsInformationPage extends State<LogisticsInformationPage> {
String shipStatus = "";
getShippingTrace(String shipperCode, String logisticCode) async {
BaseData baseData = await apiService
BaseData<Logistics> baseData = await apiService
.shippingTrace(shipperCode, logisticCode)
.catchError((error) {
_refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
Logistics lgs = Logistics.fromMap(baseData.data);
Logistics lgs = baseData.data;
logistics.clear();
logistics.addAll(lgs.traces.reversed);
setState(() {

4
lib/order/order_detail_page.dart

@ -55,9 +55,9 @@ class _OrderDetailPage extends State<OrderDetailPage> {
// String storeType = "NORMALSTORE"; //NORMALSTORE FASTSTORE RETAILSTORE
queryDetails() async {
BaseData baseData = await apiService.orderDetail(widget.arguments["id"]);
BaseData<OrderInfo> baseData = await apiService.orderDetail(widget.arguments["id"]);
if (baseData != null && baseData.isSuccess) {
orderInfo = OrderInfo.fromJson(baseData.data);
orderInfo = baseData.data;
payStatus = orderInfo.payStatus;
orderStatus = orderInfo.orderStatus;
sendStatus = orderInfo.sendStatus;

8
lib/order/order_history_page.dart

@ -164,7 +164,7 @@ class _OrderHistoryList extends State<OrderHistoryList>
List<OrderInfo> orderInfos = [];
queryOrder() async {
BaseData baseData = await apiService.orderList({
BaseData<PageInfo<OrderInfo>> baseData = await apiService.orderList({
"current": current,
"model": {"status": widget.orderStatus},
"order": "descending",
@ -176,15 +176,13 @@ class _OrderHistoryList extends State<OrderHistoryList>
});
if (baseData != null && baseData.isSuccess) {
PageInfo pageInfo = PageInfo.fromJson(baseData.data);
if (current == 1) {
orderInfos.clear();
}
orderInfos
.addAll(pageInfo.records.map((e) => OrderInfo.fromJson(e)).toList());
orderInfos.addAll(baseData.data.records);
refreshController.refreshCompleted();
refreshController.loadComplete();
if (current * 10 > int.tryParse(pageInfo.total)) {
if (current * 10 > int.tryParse(baseData.data.total)) {
refreshController.loadNoData();
} else {
current += 1;

12
lib/order/store_selector_page.dart

@ -102,9 +102,9 @@ class _StoreSelectorPage extends State<StoreSelectorPage> {
SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.setString("latitude", "${latLng.latitude}");
await prefs.setString("longitude", "${latLng.longitude}");
await prefs.setString("province", province);
await prefs.setString("city", city);
await prefs.setString("district", district);
await prefs.setString("province", province ?? "");
await prefs.setString("city", city ?? "");
await prefs.setString("district", district ?? "");
}
List<Store> storeList;
@ -210,7 +210,7 @@ class _StoreSelectorPage extends State<StoreSelectorPage> {
}
queryStore(latitude, longitude, province, city, district) async {
BaseData baseData = await apiService.queryStore({
BaseData<List<Store>> baseData = await apiService.queryStore({
"city": "",
"district": "",
"latitude": latitude,
@ -219,9 +219,7 @@ class _StoreSelectorPage extends State<StoreSelectorPage> {
"searchKey": ""
});
if (baseData != null && baseData.isSuccess) {
storeList = (baseData.data as List<dynamic>)
.map((e) => Store.fromJson(e))
.toList();
storeList = baseData.data;
if (mounted) setState(() {});
}
}

21
lib/retrofit/data/article.dart

@ -2,23 +2,6 @@ import 'dart:convert';
import 'package:huixiang/retrofit/data/author.dart';
/// id : "4"
/// createTime : "2021-07-05 14:20:43"
/// createUser : null
/// updateTime : "2021-07-05 14:23:47"
/// updateUser : null
/// storeId : "0"
/// mainTitle : "牡丹花的养护知识"
/// viceTitle : null
/// content : "阿斯顿发斯蒂芬"
/// coverImg : "https://pos.upload.gznl.top/MDAwMA==/2021/06/2a1060d8-08f6-4036-935a-0514aaade9d8.jpg"
/// author : "{\"name\":\"百花谷\",\"avatar\":\"https://pos.upload.gznl.top/MDAwMA==/2021/06/6a3586dc-a340-470f-b645-1e3155d5f558.jpg\"}"
/// type : 2
/// startTime : "2021-07-05 14:25:10"
/// endTime : "2099-01-01 00:00:00"
/// state : 1
/// isDelete : 0
/// storeName : null
class Article {
String _id;
@ -69,6 +52,10 @@ class Article {
_likes = value;
}
set liked(bool value) {
_liked = value;
}
set viewers(int value) {
_viewers = value;
}

36
lib/retrofit/data/base_data.dart

@ -1,8 +1,16 @@
class BaseData {
import 'package:json_annotation/json_annotation.dart';
part 'base_data.g.dart';
@JsonSerializable(genericArgumentFactories: true)
class BaseData<T> {
BaseData();
int code;
dynamic data;
T data;
dynamic extra;
bool isError;
bool isSuccess;
@ -10,24 +18,8 @@ class BaseData {
String path;
String timestamp;
factory BaseData.fromJson(Map<String, dynamic> json) => BaseData()
..code = json['code'] as int
..data = json['data']
..extra = json['extra']
..isError = json['isError'] as bool
..isSuccess = json['isSuccess'] as bool
..msg = json['msg'] as String
..path = json['path'] as String
..timestamp = json['timestamp'] as String;
Map<String, dynamic> toJson() => <String, dynamic>{
'code': this.code,
'data': this.data,
'extra': this.extra,
'isError': this.isError,
'isSuccess': this.isSuccess,
'msg': this.msg,
'path': this.path,
'timestamp': this.timestamp,
};
factory BaseData.fromJson(Map<String, dynamic> json, T Function(dynamic json) fromJsonT) => _$BaseDataFromJson(json, fromJsonT);
Map<String, dynamic> toJson(Object Function(T value) toJsonT) => _$BaseDataToJson(this, toJsonT);
}

2
lib/retrofit/data/logistics.dart

@ -11,7 +11,7 @@ class Logistics {
bool success;
List<TracesBean> traces;
static Logistics fromMap(Map<String, dynamic> map) {
static Logistics fromJson(Map<String, dynamic> map) {
if (map == null) return null;
Logistics logisticsBean = Logistics();
logisticsBean.logisticCode = map['logisticCode'];

2
lib/retrofit/data/member_comment_list.dart

@ -41,7 +41,7 @@ class MemberCommentList {
String username;
bool liked;
static MemberCommentList fromMap(Map<String, dynamic> map) {
static MemberCommentList fromJson(Map<String, dynamic> map) {
if (map == null) return null;
MemberCommentList listBean = MemberCommentList();
listBean.content = map['content'];

45
lib/retrofit/data/page.dart

@ -1,5 +1,14 @@
class PageInfo {
import 'package:json_annotation/json_annotation.dart';
part 'page.g.dart';
@JsonSerializable(genericArgumentFactories: true)
class PageInfo<D> {
PageInfo();
int pageNum;
@ -10,32 +19,10 @@ class PageInfo {
bool hasPreviousPage;
bool hasNextPage;
String total;
List<dynamic> list;
List<dynamic> records;
factory PageInfo.fromJson(Map<String, dynamic> json) =>
PageInfo()
..pageNum = json['pageNum'] as int
..current = json['current']
..pageSize = json['pageSize'] as int
..size = json['size']
..pages = json['pages']
..hasPreviousPage = json['hasPreviousPage'] as bool
..hasNextPage = json['hasNextPage'] as bool
..total = json['total'] as String
..list = json['list'] as List
..records = json['records'] as List;
Map<String, dynamic> toJson() => <String, dynamic>{
'pageNum': this.pageNum,
'current': this.current,
'pageSize': this.pageSize,
'size': this.size,
'pages': this.pages,
'hasPreviousPage': this.hasPreviousPage,
'hasNextPage': this.hasNextPage,
'total': this.total,
'list': this.list.map((e) => e.toString()).toList(),
'records': this.records.map((e) => e.toString()).toList(),
};
List<D> list;
List<D> records;
factory PageInfo.fromJson(Map<String, dynamic> json, D Function(dynamic d) fromJsonD) => _$PageInfoFromJson(json, fromJsonD);
Map<String, dynamic> toJson(Object Function(D value) toJsonD) => _$PageInfoToJson(this, toJsonD);
}

6
lib/retrofit/data/store_info.dart

@ -101,7 +101,9 @@ class StoreInfo {
..expireTime = json['expireTime'] as String
..vipFee = json['vipFee'] as String
..memberSource = json['memberSource'] != null ? MemberSource.fromJson(json['memberSource']) : null
..informationVOPageVO = json['informationVOPageVO'] != null ? PageInfo.fromJson(json['informationVOPageVO']) : null;
..informationVOPageVO = json['informationVOPageVO'] != null ? PageInfo.fromJson(json['informationVOPageVO'], (value){
return value;
}) : null;
Map<String, dynamic> toJson() => <String, dynamic>{
'address': this.address,
@ -142,7 +144,7 @@ class StoreInfo {
'expireTime': this.expireTime,
'vipFee': this.vipFee,
'memberSource': this.memberSource.toJson(),
'informationVOPageVO': this.informationVOPageVO.toJson(),
'informationVOPageVO': this.informationVOPageVO,
};
}

2
lib/retrofit/data/vip_card.dart

@ -60,7 +60,7 @@ class VipCard {
String tenantLogo;
List<StoreListBean> storeList;
static VipCard fromMap(Map<String, dynamic> map) {
static VipCard fromJson(Map<String, dynamic> map) {
if (map == null) return null;
VipCard vipCardBean = VipCard();
vipCardBean.id = map['id'];

84
lib/retrofit/retrofit_api.dart

@ -7,11 +7,37 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/retrofit/data/article.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/coupon.dart';
import 'package:huixiang/retrofit/data/order_info.dart';
import 'package:huixiang/view_widget/login_tips.dart';
import 'package:retrofit/retrofit.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'data/address.dart';
import 'data/banner.dart';
import 'data/brand.dart';
import 'data/brand_data.dart';
import 'data/exchange_order.dart';
import 'data/goods.dart';
import 'data/goods_category.dart';
import 'data/logistics.dart';
import 'data/member_comment_list.dart';
import 'data/message.dart';
import 'data/page.dart';
import 'data/rank.dart';
import 'data/sign_info.dart';
import 'data/store.dart';
import 'data/store_info.dart';
import 'data/upload_result.dart';
import 'data/user_bill.dart';
import 'data/user_entity.dart';
import 'data/user_info.dart';
import 'data/vip_card.dart';
import 'data/wx_pay.dart';
part 'retrofit_api.g.dart';
const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///
@ -131,7 +157,7 @@ abstract class ApiService {
///
@POST("/file/upload")
@MultiPart()
Future<BaseData> upload(
Future<BaseData<UploadResult>> upload(
@Part(name: "file") File data, @Part(name: "folderId") int folderId);
///
@ -150,19 +176,19 @@ abstract class ApiService {
///
@POST("/creditGoods/list")
Future<BaseData> creditGoods(@Body() Map<String, dynamic> param);
Future<BaseData<PageInfo<Goods>>> creditGoods(@Body() Map<String, dynamic> param);
///
@POST("/creditGoodsCategory/page")
Future<BaseData> goodsCategory(@Body() Map<String, dynamic> param);
Future<BaseData<PageInfo<GoodsCategory>>> goodsCategory(@Body() Map<String, dynamic> param);
///
@GET("/creditGoods/{id}")
Future<BaseData> creditGoodsById(@Path("id") String id);
Future<BaseData<Goods>> creditGoodsById(@Path("id") String id);
///
@GET("/member/info")
Future<BaseData> queryInfo();
Future<BaseData<UserInfo>> queryInfo();
///
@POST("/member/editMemberInfo")
@ -170,7 +196,7 @@ abstract class ApiService {
///
@GET("/member/signInInfo")
Future<BaseData> signInInfo();
Future<BaseData<SignInfo>> signInInfo();
///
@GET("/member/signIn")
@ -178,15 +204,15 @@ abstract class ApiService {
///
@POST("/wallet/recharge")
Future<BaseData> recharge(@Body() Map<String, dynamic> param);
Future<BaseData<WxPay>> recharge(@Body() Map<String, dynamic> param);
///
@GET("/coupon/receive?couponId={couponId}")
Future<BaseData> receiveCoupon(@Path("couponId") String couponId);
///
///
@POST("/creditOrder/list")
Future<BaseData> creditOrderList(@Body() Map<String, dynamic> param);
Future<BaseData<PageInfo<ExchangeOrder>>> creditOrderList(@Body() Map<String, dynamic> param);
///
@POST("/creditOrder/create")
@ -206,7 +232,7 @@ abstract class ApiService {
///
@GET("/address/queryMemberAddress")
Future<BaseData> queryMemberAddress();
Future<BaseData<List<Address>>> queryMemberAddress();
///
@POST("/address/update")
@ -214,23 +240,27 @@ abstract class ApiService {
///
@POST("/coupon/centreList")
Future<BaseData> queryCoupon(@Body() Map<String, dynamic> param);
Future<BaseData<PageInfo<Coupon>>> queryCoupon(@Body() Map<String, dynamic> param);
///
@POST("/coupon/packageList")
Future<BaseData> queryCard(@Body() Map<String, dynamic> param);
Future<BaseData<PageInfo<Coupon>>> queryCard(@Body() Map<String, dynamic> param);
///
@POST("/store/list")
Future<BaseData> queryStore(@Body() Map<String, dynamic> param);
Future<BaseData<List<Store>>> queryStore(@Body() Map<String, dynamic> param);
///
@POST("/information/list")
Future<BaseData> informationList(@Body() Map<String, dynamic> param);
Future<BaseData<PageInfo<Activity>>> informationList(@Body() Map<String, dynamic> param);
///
@GET("/information/{id}")
Future<BaseData> informationInfo(@Path("id") String id);
Future<BaseData<Article>> informationInfo(@Path("id") String id);
///
@GET("/information/{id}")
Future<BaseData<Activity>> activityInfo(@Path("id") String id);
///
@GET("/creditOrder/receive/{id}")
@ -238,7 +268,7 @@ abstract class ApiService {
///
@GET("/home/home")
Future<BaseData> queryHome();
Future<BaseData<BrandData>> queryHome();
///
@GET("/store/{id}")
@ -246,11 +276,11 @@ abstract class ApiService {
///
@POST("/information/list")
Future<BaseData> queryArticle(@Body() Map<String, dynamic> param);
Future<BaseData<PageInfo<Article>>> queryArticle(@Body() Map<String, dynamic> param);
///banner查询
@POST("/banner/page")
Future<BaseData> queryBanner(@Body() Map<String, dynamic> param);
Future<BaseData<PageInfo<BannerData>>> queryBanner(@Body() Map<String, dynamic> param);
///
@GET("/home/brand")
@ -262,19 +292,19 @@ abstract class ApiService {
///
@POST("/member/listBill")
Future<BaseData> queryBillInfo(@Body() Map<String, dynamic> param);
Future<BaseData<PageInfo<UserBill>>> queryBillInfo(@Body() Map<String, dynamic> param);
///
@GET("/member/rankList")
Future<BaseData> rankList();
Future<BaseData<List<Rank>>> rankList();
///
@POST("/order/list")
Future<BaseData> orderList(@Body() Map<String, dynamic> param);
Future<BaseData<PageInfo<OrderInfo>>> orderList(@Body() Map<String, dynamic> param);
///
@GET("/order/orderDetail?id={id}")
Future<BaseData> orderDetail(@Path("id") String id);
Future<BaseData<OrderInfo>> orderDetail(@Path("id") String id);
///
@POST("/order/continuePay")
@ -286,15 +316,15 @@ abstract class ApiService {
///
@POST("/member/vipList")
Future<BaseData> vipList(@Body() Map<String, dynamic> param);
Future<BaseData<List<VipCard>>> vipList(@Body() Map<String, dynamic> param);
///
@POST("/member/vipDetail")
Future<BaseData> vipDetail(@Body() Map<String, dynamic> param);
Future<BaseData<VipCard>> vipDetail(@Body() Map<String, dynamic> param);
///App消息列表
@POST("/app-msg/list")
Future<BaseData> msgList(@Body() Map<String, dynamic> param);
Future<BaseData<PageInfo<Message>>> msgList(@Body() Map<String, dynamic> param);
///App消息详情
@GET("/app-msg/{id}")
@ -310,7 +340,7 @@ abstract class ApiService {
///
@POST("/memberComment/list")
Future<BaseData> memberCommentList(@Body() Map<String, dynamic> param);
Future<BaseData<PageInfo<MemberCommentList>>> memberCommentList(@Body() Map<String, dynamic> param);
///
@GET("/memberComment/likes/{id}")
@ -322,6 +352,6 @@ abstract class ApiService {
///
@GET("/order/getShippingTrace/{shipperCode}/{logisticCode}")
Future<BaseData> shippingTrace(@Path("shipperCode") String shipperCode, @Path("logisticCode") String logisticCode);
Future<BaseData<Logistics>> shippingTrace(@Path("shipperCode") String shipperCode, @Path("logisticCode") String logisticCode);
}

939
lib/retrofit/retrofit_api.g.dart

@ -1,939 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'retrofit_api.dart';
// **************************************************************************
// RetrofitGenerator
// **************************************************************************
class _ApiService implements ApiService {
_ApiService(this._dio, {this.baseUrl}) {
ArgumentError.checkNotNull(_dio, '_dio');
baseUrl ??= 'https://pos.platform.lotus-wallet.com/app/';
}
final Dio _dio;
String baseUrl;
@override
Future<BaseData> upload(data, folderId) async {
ArgumentError.checkNotNull(data, 'data');
ArgumentError.checkNotNull(folderId, 'folderId');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = FormData();
_data.files.add(MapEntry(
'file',
MultipartFile.fromFileSync(data.path,
filename: data.path.split(Platform.pathSeparator).last)));
if (folderId != null) {
_data.fields.add(MapEntry('folderId', folderId.toString()));
}
final _result = await _dio.request<Map<String, dynamic>>('/file/upload',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<dynamic> searchPoi(lat, lng, keywords, size, page) async {
ArgumentError.checkNotNull(lat, 'lat');
ArgumentError.checkNotNull(lng, 'lng');
ArgumentError.checkNotNull(keywords, 'keywords');
ArgumentError.checkNotNull(size, 'size');
ArgumentError.checkNotNull(page, 'page');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request(
'https://restapi.amap.com/v3/place/around?key=542b46afa8e4b88fe1eb3c4d0ba0872f&location=$lat,$lng&keywords=$keywords&offset={size}&page={page}&extensions=all',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = _result.data;
return value;
}
@override
Future<BaseData> memberLogin(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'/auth/platform/memberLogin',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> sendVerify(mobile) async {
ArgumentError.checkNotNull(mobile, 'mobile');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/auth/sendVerify/$mobile',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> creditGoods(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'/creditGoods/list',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> goodsCategory(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'/creditGoodsCategory/page',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> creditGoodsById(id) async {
ArgumentError.checkNotNull(id, 'id');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>('/creditGoods/$id',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> queryInfo() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>('/member/info',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> editInfo(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'/member/editMemberInfo',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> signInInfo() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/member/signInInfo',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> signIn() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>('/member/signIn',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> recharge(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/wallet/recharge',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> receiveCoupon(couponId) async {
ArgumentError.checkNotNull(couponId, 'couponId');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/coupon/receive?couponId=$couponId',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> creditOrderList(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'/creditOrder/list',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> creditOrder(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'/creditOrder/create',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> addAddress(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/address/add',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> deleteAddress(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/address/delete',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> queryAddress(id) async {
ArgumentError.checkNotNull(id, 'id');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/address/detail/$id',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> queryMemberAddress() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/address/queryMemberAddress',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> updateAddress(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/address/update',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> queryCoupon(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'/coupon/centreList',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> queryCard(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'/coupon/packageList',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> queryStore(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/store/list',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> informationList(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'/information/list',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> informationInfo(id) async {
ArgumentError.checkNotNull(id, 'id');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>('/information/$id',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> creditOrderReceive(id) async {
ArgumentError.checkNotNull(id, 'id');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/creditOrder/receive/$id',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> queryHome() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>('/home/home',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> queryStoreInfo(id) async {
ArgumentError.checkNotNull(id, 'id');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>('/store/$id',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> queryArticle(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'/information/list',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> queryBanner(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/banner/page',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> queryHomeBrand() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>('/home/brand',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> minLogin(storeId) async {
ArgumentError.checkNotNull(storeId, 'storeId');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/auth/mini/login/$storeId',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> queryBillInfo(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/member/listBill',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> rankList() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>('/member/rankList',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> orderList(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/order/list',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> orderDetail(id) async {
ArgumentError.checkNotNull(id, 'id');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/order/orderDetail?id=$id',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> continuePay(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'/order/continuePay',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> receiveToCard(id) async {
ArgumentError.checkNotNull(id, 'id');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/creditOrder/receive/$id',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> vipList(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/member/vipList',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> vipDetail(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'/member/vipDetail',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> msgList(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/app-msg/list',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> queryMsg(id) async {
ArgumentError.checkNotNull(id, 'id');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>('/app-msg/$id',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> informationLikes(id) async {
ArgumentError.checkNotNull(id, 'id');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/information/likes/$id',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> memberComment(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/memberComment',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> memberCommentList(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'/memberComment/list',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> commentLike(id) async {
ArgumentError.checkNotNull(id, 'id');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/memberComment/likes/$id',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> delComment(id) async {
ArgumentError.checkNotNull(id, 'id');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/memberComment/delete/$id',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> shippingTrace(shipperCode, logisticCode) async {
ArgumentError.checkNotNull(shipperCode, 'shipperCode');
ArgumentError.checkNotNull(logisticCode, 'logisticCode');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/order/getShippingTrace/$shipperCode/$logisticCode',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
}

244
lib/union/store_details_page.dart

@ -3,6 +3,7 @@ import 'dart:ui';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:flutter_html/image_render.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -49,7 +50,6 @@ class _StoreDetailsPage extends State<StoreDetailsPage>
with WidgetsBindingObserver {
ApiService apiService;
RefreshController _refreshController;
bool isLiked = false;
int commentTotal = 0;
var commentTextController = TextEditingController();
var commentFocus = FocusNode();
@ -97,19 +97,25 @@ class _StoreDetailsPage extends State<StoreDetailsPage>
Activity activity;
Article article;
List<MemberCommentList> memberList = [];
GlobalKey commentKey = GlobalKey();
ScrollController scrollController = ScrollController();
queryHtml() async {
BaseData baseData = await apiService.informationInfo(
widget.arguments["activityId"] ?? widget.arguments["articleId"]);
if (baseData != null && baseData.isSuccess) {
setState(() {
if (widget.arguments.containsKey("activityId")) {
activity = Activity.fromJson(baseData.data);
} else if (widget.arguments.containsKey("articleId")) {
article = Article.fromJson(baseData.data);
}
});
queryHtml() async { //activityInfo
if (widget.arguments["activityId"] != null) {
BaseData<Activity> baseData = await apiService.activityInfo(widget.arguments["activityId"]);
if (baseData != null && baseData.isSuccess) {
setState(() {
activity = baseData.data;
});
}
}
if (widget.arguments["articleId"] != null) {
BaseData<Article> baseData = await apiService.informationInfo(widget.arguments["articleId"]);
if (baseData != null && baseData.isSuccess) {
setState(() {
article = baseData.data;
});
}
}
}
@ -177,7 +183,7 @@ class _StoreDetailsPage extends State<StoreDetailsPage>
//
queryMemberCommentList() async {
BaseData baseData = await apiService.memberCommentList({
BaseData<PageInfo<MemberCommentList>> baseData = await apiService.memberCommentList({
"pageNum": 1,
"pageSize": 100,
"relationalId":
@ -187,12 +193,10 @@ class _StoreDetailsPage extends State<StoreDetailsPage>
_refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
PageInfo pageInfo = PageInfo.fromJson(baseData.data);
_refreshController.refreshCompleted();
setState(() {
commentTotal = pageInfo.size;
memberList =
pageInfo.list.map((e) => MemberCommentList.fromMap(e)).toList();
commentTotal = baseData.data.size;
memberList = baseData.data.list;
});
}
}
@ -216,8 +220,7 @@ class _StoreDetailsPage extends State<StoreDetailsPage>
return;
}
BaseData baseData =
await apiService.commentLike(id).catchError((onError) {});
BaseData baseData = await apiService.commentLike(id).catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
setState(() {
memberList.forEach((element) {
@ -233,31 +236,29 @@ class _StoreDetailsPage extends State<StoreDetailsPage>
});
});
}
/* else {
if (baseData.msg == "您已点过赞") {
setState(() {
memberList.forEach((element) {
if (element.id == id) {
element.liked = true;
}
});
});
} else SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}*/
}
///
queryInformationLikes() async {
BaseData baseData = await apiService
.informationLikes(
widget.arguments["activityId"] ?? widget.arguments["articleId"])
.catchError((onError) {});
BaseData baseData = await apiService.informationLikes(
widget.arguments["activityId"] ?? widget.arguments["articleId"]);
if (baseData != null && baseData.isSuccess) {
setState(() {
isLiked = true;
if (article != null)
article.likes += 1;
else if (activity != null) activity.likes += 1;
if (article != null) {
if (article.liked) {
article.likes -= 1;
} else {
article.likes += 1;
}
article.liked = !article.liked;
} else if (activity != null) {
if (activity.liked) {
activity.likes -= 1;
} else {
activity.likes += 1;
}
activity.liked = !activity.liked;
}
});
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
@ -321,6 +322,7 @@ class _StoreDetailsPage extends State<StoreDetailsPage>
parenId = "0";
},
child: SingleChildScrollView(
controller: scrollController,
physics: BouncingScrollPhysics(),
child: Column(
children: [
@ -460,7 +462,8 @@ class _StoreDetailsPage extends State<StoreDetailsPage>
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
Container(
key: commentKey,
padding: EdgeInsets.all(16),
child: Row(
children: [
@ -489,27 +492,42 @@ class _StoreDetailsPage extends State<StoreDetailsPage>
],
),
),
ListView.builder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount:
memberList != null ? memberList.length : 0,
scrollDirection: Axis.vertical,
itemBuilder: (context, position) {
return Material(
color: Colors.white,
child: InkWell(
onTap: () {
showPressMenu(
memberList[position].createUser,
memberList[position]);
},
child: commentItem(memberList[position],
position, memberList.length),
if (memberList != null && memberList.length > 0)
ListView.builder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount:
memberList != null ? memberList.length : 0,
scrollDirection: Axis.vertical,
itemBuilder: (context, position) {
return Material(
color: Colors.white,
child: InkWell(
onTap: () {
showPressMenu(
memberList[position].createUser,
memberList[position]);
},
child: commentItem(memberList[position],
position, memberList.length),
),
);
},
)
else
Container(
width: double.infinity,
height: 80.h,
alignment: Alignment.center,
child: Text(
"暂无评论,快来评论吧",
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.bold,
color: Color(0xFFA0A0A0),
),
);
},
),
),
),
],
),
),
@ -622,7 +640,7 @@ class _StoreDetailsPage extends State<StoreDetailsPage>
hintText: hintText,
hintStyle: TextStyle(
fontSize: 14.sp,
color: Color(0xffCDCCCC),
color: Color(0xFF868686),
),
),
),
@ -631,9 +649,8 @@ class _StoreDetailsPage extends State<StoreDetailsPage>
),
),
),
Padding(
padding: EdgeInsets.only(left: 20.w, right: 20.w),
child: GestureDetector(
if (isKeyBoardShow)
GestureDetector(
onTap: () {
var commentText = commentTextController.text;
if (commentText == "") {
@ -641,35 +658,93 @@ class _StoreDetailsPage extends State<StoreDetailsPage>
}
queryMemberComment(commentText);
},
child: Text(
S.of(context).fasong,
style: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.bold,
color: Color(0XFF1A1A1A),
child: Container(
padding: EdgeInsets.symmetric(horizontal: 20.w),
child: Text(
S.of(context).fasong,
style: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.bold,
color: Color(0XFF1A1A1A),
),
),
),
),
),
GestureDetector(
onTap: () {
if (isLiked) return;
queryInformationLikes();
},
child: Image.asset(
isLiked
? "assets/image/icon_like.png"
: "assets/image/icon_like_h.png",
fit: BoxFit.fill,
width: 24,
height: 24,
if (!isKeyBoardShow)
InkWell(
onTap: toComment,
child: Container(
padding: EdgeInsets.only(left: 20, right: 10),
child: Image.asset(
"assets/image/icon_comment.png",
width: 24,
height: 24,
),
),
),
if (!isKeyBoardShow)
LikeButton(
padding: EdgeInsets.all(10),
size: 24,
circleSize: 24,
circleColor: CircleColor(
start: Color(0xff00ddff),
end: Color(0xff0099cc),
),
bubblesColor: BubblesColor(
dotPrimaryColor: Color(0xff33b5e5),
dotSecondaryColor: Color(0xff0099cc),
),
bubblesSize: 24,
likeBuilder: (bool isLiked) {
return isLiked
? Image.asset(
"assets/image/icon_like.png",
width: 24,
height: 24,
)
: Image.asset(
"assets/image/icon_like_h.png",
width: 24,
height: 24,
);
},
isLiked: (activity != null
? activity.liked
: article != null
? article.liked
: false),
onTap: (isLiked) async {
await queryInformationLikes();
return (activity != null
? activity.liked
: article != null
? article.liked
: false);
},
// likeCount: memberList.likes,
countBuilder: (int count, bool isLiked, String text) {
return Text(
text,
style: TextStyle(
color: Color(0xFF1A1A1A),
fontSize: 12.sp,
),
);
},
),
)
],
),
);
}
toComment() {
if (commentKey.currentContext == null) return;
RenderBox firstRenderBox = commentKey.currentContext.findRenderObject();
Offset first = firstRenderBox.localToGlobal(Offset.zero);
scrollController.animateTo(first.dy + scrollController.offset - (kToolbarHeight + MediaQuery.of(context).padding.top), duration: Duration(milliseconds: 100), curve: Curves.easeIn);
}
VideoPlayerController videoPlayerController;
ChewieController chewieAudioController;
Chewie chewies;
@ -784,7 +859,6 @@ class _StoreDetailsPage extends State<StoreDetailsPage>
alignment: Alignment.topRight,
child: LikeButton(
padding: EdgeInsets.all(10),
size: 16,
circleSize: 16,
circleColor: CircleColor(
start: Color(0xff00ddff), end: Color(0xff0099cc)),

13
lib/union/union_details_page.dart

@ -63,8 +63,7 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
List<Activity> activitys;
queryStoreInfo() async {
BaseData baseData = await apiService
.queryStoreInfo(widget.arguments["id"])
BaseData baseData = await apiService.queryStoreInfo(widget.arguments["id"])
.catchError((error) {
refreshController.refreshFailed();
});
@ -198,10 +197,8 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
),
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(
child: Text(
@ -258,14 +255,14 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
width: 24.w,
height: 24.h,
),
)
),
],
),
],
),
),
flex: 1,
)
),
],
),
),

7
lib/union/union_page.dart

@ -190,7 +190,7 @@ class _UnionPage extends State<UnionPage>
List<Store> storeList;
queryStore(latitude, longitude, province, city, district, searchKey) async {
BaseData baseData = await apiService.queryStore({
BaseData<List<Store>> baseData = await apiService.queryStore({
// "city": city,
// "district": district,
// "province": province,
@ -202,10 +202,7 @@ class _UnionPage extends State<UnionPage>
});
SmartDialog.dismiss();
if (baseData != null && baseData.isSuccess) {
storeList = (baseData.data as List<dynamic>)
.map((e) => Store.fromJson(e))
.toList();
// buildMarker();
storeList = baseData.data;
refreshController.refreshCompleted();
if (mounted) setState(() {});
} else {

4
pubspec.lock

@ -35,7 +35,7 @@ packages:
name: async
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.5.0"
version: "2.6.1"
barcode:
dependency: transitive
description:
@ -900,7 +900,7 @@ packages:
name: test_api
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.2.19"
version: "0.3.0"
timing:
dependency: transitive
description:

Loading…
Cancel
Save