Browse Source

首页整体优化;

联盟:更改门店列表ui;
     更改曾是选择范围,暂定(武汉,北京,郑州);
     门店列表接口新增(productShow列表,显示商品数据);
所有loading更改,loading新增遮罩层,避免加载数据时用户过快操作导致数据不准确的错误操作;
dev
huixiang_app 1 year ago
parent
commit
92100c224b
  1. 4
      lib/community/community_details.dart
  2. 684
      lib/home/home_page.dart
  3. 2
      lib/home/huixiang_brand_page.dart
  4. 2
      lib/home/points_mall_page.dart
  5. 2
      lib/home/welfare_exchange.dart
  6. 2
      lib/integral/integral_page.dart
  7. 2
      lib/login/login_page.dart
  8. 18
      lib/login/new_login_page.dart
  9. 2
      lib/mine/scan_web.dart
  10. 2
      lib/order/order_detail_page.dart
  11. 749
      lib/retrofit/data/product_show.dart
  12. 160
      lib/retrofit/data/store.dart
  13. 6
      lib/retrofit/min_api.dart
  14. 14
      lib/retrofit/retrofit_api.dart
  15. 2
      lib/retrofit/retrofit_api.g.dart
  16. 2
      lib/setting/account_security_page.dart
  17. 2
      lib/setting/treaty_page.dart
  18. 2
      lib/setting/user_service_page.dart
  19. 6
      lib/settlement/settlement.dart
  20. 4
      lib/store/shop_details_page.dart
  21. 2
      lib/store/shopping/activity_prefecture_details.dart
  22. 2
      lib/store/shopping/shopping_goods_details.dart
  23. 2
      lib/store/shopping/shopping_mall_home.dart
  24. 4
      lib/store/store_order.dart
  25. 4
      lib/store/store_view/product_sku.dart
  26. 206
      lib/union/union_list.dart
  27. 95
      lib/union/union_page.dart
  28. 2
      lib/view_widget/channel_dialog.dart
  29. 2
      lib/vip/user_vip_service_page.dart

4
lib/community/community_details.dart

@ -100,7 +100,7 @@ class _CommunityDetails extends State<CommunityDetails>
void initState() { void initState() {
super.initState(); super.initState();
// comunity = widget.arguments["comment"]; // comunity = widget.arguments["comment"];
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
businessId = widget.arguments["businessId"]; businessId = widget.arguments["businessId"];
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance.addObserver(this);
commentFocus.addListener(_focusNodeListener); commentFocus.addListener(_focusNodeListener);
@ -399,7 +399,7 @@ class _CommunityDetails extends State<CommunityDetails>
/// ///
_queryMemberCommentList(bool isOnRefresh) async { _queryMemberCommentList(bool isOnRefresh) async {
if (!isOnRefresh) EasyLoading.show(status: S.current.zhengzaijiazai); if (!isOnRefresh) EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
if (apiService == null) if (apiService == null)
apiService = ApiService( apiService = ApiService(

684
lib/home/home_page.dart

@ -8,7 +8,6 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/home/home_view/discount_zone.dart'; import 'package:huixiang/home/home_view/discount_zone.dart';
import 'package:huixiang/home/home_view/home_banner.dart';
import 'package:huixiang/home/home_view/home_recommend_goods.dart'; import 'package:huixiang/home/home_view/home_recommend_goods.dart';
import 'package:huixiang/home/home_view/top_selling_list.dart'; import 'package:huixiang/home/home_view/top_selling_list.dart';
import 'package:huixiang/home/home_view/union_entry.dart'; import 'package:huixiang/home/home_view/union_entry.dart';
@ -27,7 +26,6 @@ import 'package:huixiang/retrofit/data/goods.dart';
import 'package:huixiang/retrofit/data/goods_category.dart'; import 'package:huixiang/retrofit/data/goods_category.dart';
import 'package:huixiang/retrofit/data/home_rank.dart'; import 'package:huixiang/retrofit/data/home_rank.dart';
import 'package:huixiang/retrofit/data/login_info.dart'; import 'package:huixiang/retrofit/data/login_info.dart';
import 'package:huixiang/retrofit/data/msg_stats.dart';
import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/event_type.dart'; import 'package:huixiang/utils/event_type.dart';
@ -42,8 +40,8 @@ import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../retrofit/data/user_info.dart'; import '../retrofit/data/user_info.dart';
import '../utils/flutter_utils.dart';
import '../view_widget/channel_dialog.dart'; import '../view_widget/channel_dialog.dart';
import '../view_widget/custom_image.dart';
import 'home_view/happy_help_farmers.dart'; import 'home_view/happy_help_farmers.dart';
import 'home_view/shortcut_operation.dart'; import 'home_view/shortcut_operation.dart';
@ -54,7 +52,8 @@ class HomePage extends StatefulWidget {
final List<FirstLoginCouponList> firstLoginCouponList; final List<FirstLoginCouponList> firstLoginCouponList;
HomePage(Key key, this.changeTab, HomePage(Key key, this.changeTab,
{this.invite, this.interviewCouponList, this.firstLoginCouponList}): super(key: key); {this.invite, this.interviewCouponList, this.firstLoginCouponList})
: super(key: key);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -64,6 +63,30 @@ class HomePage extends StatefulWidget {
class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin { class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
ApiService apiService; ApiService apiService;
final RefreshController refreshController = RefreshController();
String categoryId;
bool showInvite = false;
bool showNew = false;
//1-2-3-
int orderType = 1;
//
bool orderDesc = true;
List<Goods> goods = [];
List<GoodsCategory> gooodsCategorys = [];
List<BannerData> bannerData = [];
List<Brand> brandData = [];
List<Article> articles = [];
Founder founder;
bool isSigned = false;
int totalMsg = 0;
List<Coupon> coupons = [];
int state = 1;
HomeRank homeRank;
UserInfo userInfo;
dynamic mRaiseMoney = 0; //
int _loadCount = 0;
@override @override
void initState() { void initState() {
@ -74,8 +97,11 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
setState(() {}); setState(() {});
} }
}); });
queryActivity(); _onRefresh(isFirstIn: true);
_onRefresh(); if (showInvite) {
inviteShowAlertDialog(widget.invite, widget.interviewCouponList[0]);
showInvite = false;
}
if ((widget.invite ?? "") != "" || if ((widget.invite ?? "") != "" ||
widget.interviewCouponList != null && widget.interviewCouponList != null &&
@ -84,7 +110,6 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
// //
// if (widget.firstLoginCouponList != null && widget.firstLoginCouponList.length > 0) // if (widget.firstLoginCouponList != null && widget.firstLoginCouponList.length > 0)
// showNew = true; // showNew = true;
} }
/// ///
@ -99,18 +124,21 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
} }
/// ///
posterShowAlertDialog(ActivityPos activityPos,firstLoginCouponList) { posterShowAlertDialog(ActivityPos activityPos, firstLoginCouponList) {
var today = DateTime.now().day; var today = DateTime.now().day;
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {
if(value.getInt("today")==today && (value.getString("ActivityPosCode") ?? "").contains("${activityPos.code}_${value.getString("userId")};")) if (value.getInt("today") == today &&
(value.getString("ActivityPosCode") ?? "")
.contains("${activityPos.code}_${value.getString("userId")};"))
return; return;
value.setString("ActivityPosCode", "${(value.getString("ActivityPosCode")??"")}${activityPos.code}_${value.getString("userId")};"); value.setString("ActivityPosCode",
"${(value.getString("ActivityPosCode") ?? "")}${activityPos.code}_${value.getString("userId")};");
value.setInt("today", today); value.setInt("today", today);
// //
showDialog( showDialog(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return ActivityPoster(activityPos,firstLoginCouponList); return ActivityPoster(activityPos, firstLoginCouponList);
}, },
); );
}); });
@ -127,178 +155,111 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
); );
} }
final SwiperController controller = SwiperController(); ///banner
queryBanner() async {
String categoryId; try {
int pageNum = 1; BaseData<PageInfo<BannerData>> baseData = await apiService.queryBanner({
int couponPageNum = 1; "model": {"type": "HOME_PAGE"},
bool showInvite = false; }).catchError((onError) {});
bool showNew = false; if (baseData != null && baseData.isSuccess) {
bannerData = baseData.data.records;
//1-2-3- // if (bannerData.length > 0) swiperController.move(0, animation: false);
int orderType = 1; }
} finally {
// addLoadCount();
bool orderDesc = true;
List<Goods> goods = [];
List<GoodsCategory> gooodsCategorys = [];
List<BannerData> bannerData = [];
List<Brand> brandData = [];
List<Article> articles = [];
List<Goods> gooods = [];
Founder founder;
bool isSigned = false;
int totalMsg = 0;
List<Coupon> coupons = [];
int state = 1;
HomeRank homeRank;
UserInfo userInfo;
dynamic mRaiseMoney = 0;//
queryHome() async {
// EasyLoading.show(status: S.of(context).zhengzaijiazai);
final SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(Dio(),
context: context, token: value.getString('token'), showLoading: false);
final BaseData brand =
await apiService.queryHomeBrand().catchError((onError) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type),
alignment: Alignment.center);
refreshController.refreshFailed();
});
if (brand != null && brand.isSuccess) {
brandData.clear();
brandData.addAll((brand.data["brandList"] as List<dynamic>)
.map((e) => Brand.fromJson(e))
.toList());
founder = Founder.fromJson(brand.data["founder"]);
}
final BaseData<PageInfo<Article>> article = await apiService.queryArticle({
"pageNum": 1,
"pageSize": 3,
"searchKey": "",
"state": 1,
"type": 2
}).catchError((onError) {
refreshController.refreshFailed();
});
articles.clear();
if (article != null && article.isSuccess) {
articles.addAll(article.data.list);
} }
}
final BaseData<HomeRank> rank = await apiService.recommendRank().catchError((onError) {}); addLoadCount() {
if (rank != null && rank.isSuccess) { _loadCount += 1;
homeRank = rank.data; if (_loadCount == 6) {
_loadCount = 0;
EasyLoading.dismiss();
if (refreshController.isRefresh) refreshController.refreshCompleted();
if (mounted) setState(() {});
} }
}
final BaseData<PageInfo<Goods>> goodsData = await apiService.creditGoods({ ///
"orderDesc": true, queryRecommendRank() async {
"orderType": 1, try {
"pageNum": 1, BaseData<HomeRank> rank =
"pageSize": 100, await apiService.recommendRank().catchError((onError) {});
"state": 1 if (rank != null && rank.isSuccess) {
}).catchError((onError) { homeRank = rank.data;
refreshController.refreshFailed(); }
}); } finally {
if (goodsData != null && goodsData.isSuccess) { addLoadCount();
gooods.clear();
gooods.addAll(goodsData.data.list);
} }
}
BaseData<PageInfo<GoodsCategory>> dataCategory = ///
await apiService.goodsCategory({ queryGoodsCategory() async {
"current": 1, try {
"map": {}, BaseData<PageInfo<GoodsCategory>> dataCategory =
"model": {"pageNum": 1, "pageSize": 20, "searchKey": ""}, await apiService.goodsCategory({
"order": "descending", "current": 1,
"size": 20, "map": {},
"sort": "sortOrder" "model": {"pageNum": 1, "pageSize": 20, "searchKey": ""},
}).catchError((onError) { "order": "descending",
refreshController.loadFailed(); "size": 20,
refreshController.refreshFailed(); "sort": "sortOrder"
}); }).catchError((onError) {});
if (dataCategory != null &&
if (dataCategory != null && dataCategory.isSuccess &&
dataCategory.isSuccess && dataCategory.data != null &&
dataCategory.data != null && dataCategory.data.records != null &&
dataCategory.data.records != null && dataCategory.data.records.length > 0) {
dataCategory.data.records.length > 0) { gooodsCategorys.clear();
gooodsCategorys.clear(); gooodsCategorys.add(GoodsCategory(name: S.of(context).quanbu));
gooodsCategorys.add(GoodsCategory(name: S.of(context).quanbu)); gooodsCategorys.addAll(dataCategory.data.records);
gooodsCategorys.addAll(dataCategory.data.records); }
} finally {
addLoadCount();
} }
}
var param = { ///
"categoryId": categoryId ?? "", queryPointsProductList(bool isRefresh) async {
"orderDesc": orderDesc, try {
"orderType": orderType, if (!isRefresh)
"pageNum": pageNum, EasyLoading.show(
"pageSize": 100, status: S.current.zhengzaijiazai,
"state": 1 maskType: EasyLoadingMaskType.black);
}; var param = {
BaseData<PageInfo<Goods>> pageGoods = "categoryId": categoryId ?? "",
await apiService.creditGoods(param).catchError((onError) { "orderDesc": orderDesc,
refreshController.loadFailed(); "orderType": orderType,
refreshController.refreshFailed(); "pageNum": 1,
}); "pageSize": 100,
EasyLoading.dismiss(); "state": 1
if (pageGoods != null && pageGoods.isSuccess) { };
if (pageNum == 1) { BaseData<PageInfo<Goods>> pageGoods =
goods.clear(); await apiService.creditGoods(param).catchError((onError) {});
if (pageGoods != null && pageGoods.isSuccess) {
goods = pageGoods.data.list;
} }
goods.addAll(pageGoods.data.list); } finally {
refreshController.refreshCompleted(); if(isRefresh)
refreshController.loadComplete(); addLoadCount();
if (pageGoods.data.pageNum == pageGoods.data.pages) { else {
refreshController.loadNoData(); EasyLoading.dismiss();
} else { setState((){});
pageNum += 1;
} }
} else {
refreshController.loadFailed();
refreshController.refreshFailed();
}
final 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);
refreshController.refreshCompleted();
if (bannerData.length > 0) controller.move(0, animation: false);
} else {
refreshController.refreshFailed();
} }
EasyLoading.dismiss();
if (showInvite) {
inviteShowAlertDialog(widget.invite, widget.interviewCouponList[0]);
showInvite = false;
}
//
// if (showNew) {
// newShowAlertDialog(widget.firstLoginCouponList);
// showNew = false;
// }
} }
/// ///
queryUserBalance() async { queryUserBalance() async {
BaseData<UserInfo> baseData = try {
await apiService.queryInfo().catchError((onError) {}); BaseData<UserInfo> baseData =
if (baseData != null && baseData.isSuccess) { await apiService.queryInfo().catchError((onError) {});
userInfo = baseData.data; if (baseData != null && baseData.isSuccess) {
mRaiseMoney = double.tryParse(userInfo.raiseMoney); userInfo = baseData.data;
if (mounted) setState(() {}); mRaiseMoney = double.tryParse(userInfo.raiseMoney);
}
} finally {
addLoadCount();
} }
} }
@ -326,35 +287,18 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
/// ///
queryActivity() async { queryActivity() async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
showLoading: true
);
}
BaseData<ActivityPos> baseData = BaseData<ActivityPos> baseData =
await apiService.appPopup().catchError((onError) { await apiService.appPopup().catchError((onError) {});
});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
if(baseData.data?.enabled ?? true) if (baseData.data?.enabled ?? true)
posterShowAlertDialog(baseData.data,widget.firstLoginCouponList); posterShowAlertDialog(baseData.data, widget.firstLoginCouponList);
} }
} }
/// ///
queryWiped(memberCouponId) async { queryWiped(memberCouponId) async {
if (apiService == null) { BaseData baseData =
SharedPreferences value = await SharedPreferences.getInstance(); await apiService.wiped(memberCouponId).catchError((onError) {});
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData baseData = await apiService.wiped(memberCouponId).catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
SmartDialog.showToast("核销成功", alignment: Alignment.center); SmartDialog.showToast("核销成功", alignment: Alignment.center);
} else { } else {
@ -363,6 +307,25 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
} }
queryCoupon() async { queryCoupon() async {
try {
BaseData<PageInfo<Coupon>> baseData = await apiService.queryCoupon({
"centre": true,
"pageNum": 1,
"pageSize": 10,
"searchKey": "",
"state": 0
}).catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
coupons = baseData.data.list;
}
} finally {
addLoadCount();
}
}
_onRefresh({bool isFirstIn = false}) async {
EasyLoading.show(
status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
if (apiService == null) { if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance(); SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService( apiService = ApiService(
@ -371,39 +334,14 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
token: value.getString("token"), token: value.getString("token"),
); );
} }
BaseData<PageInfo<Coupon>> baseData = await apiService.queryCoupon({ if (isFirstIn) queryActivity();
"centre": true, queryBanner();
"pageNum": couponPageNum, queryRecommendRank();
"pageSize": 10, queryGoodsCategory();
"searchKey": "", queryPointsProductList(true);
"state": 0 queryUserBalance();
}).catchError((onError) {
refreshController.refreshFailed();
refreshController.loadFailed();
});
if (couponPageNum == 1) coupons.clear();
if (baseData != null && baseData.isSuccess) {
coupons.addAll(baseData.data.list);
refreshController.refreshCompleted();
refreshController.loadComplete();
if (baseData.data.pageNum == baseData.data.pages) {
refreshController.loadNoData();
} else {
couponPageNum += 1;
}
setState(() {});
}
else {
refreshController.refreshFailed();
refreshController.loadFailed();
}
}
_onRefresh() async{
await queryHome();
await queryUserBalance();
// queryMsgStats(); // queryMsgStats();
await queryCoupon(); queryCoupon();
} }
@override @override
@ -412,8 +350,6 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
if (refreshController != null) refreshController.dispose(); if (refreshController != null) refreshController.dispose();
} }
final RefreshController refreshController = RefreshController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context); super.build(context);
@ -502,96 +438,90 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
enablePullUp: false, enablePullUp: false,
header: MyHeader(), header: MyHeader(),
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
onRefresh: () { onRefresh: _onRefresh,
setState(() {_onRefresh();
});
},
child: SingleChildScrollView( child: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
child: FutureBuilder( child: Column(
future: queryHome(), children: [
builder: (context, snapshot) { ///banner
return Column( homeBanner(),
children: [
///banner ///
HomeBanner(bannerData, controller), UnionEntry((int jpIndex) {
widget.changeTab(1, jpIndex);
/// }),
UnionEntry((int jpIndex) {
widget.changeTab(1,jpIndex); ///
}), ShortcutOperation((int jpIndex) {
widget.changeTab(1, jpIndex);
/// }),
ShortcutOperation((int jpIndex) {
widget.changeTab(1,jpIndex); ///广
}), spread(),
///广 // ///
spread(), // SignView(isSigned, (value) {
// setState(() {
// /// // isSigned = value;
// SignView(isSigned, (value) { // });
// setState(() { // }),
// isSigned = value;
// }); ///
// }), if (coupons != null && coupons.length != 0)
DiscountZone(coupons),
///
if(coupons != null && coupons.length != 0) ///-
DiscountZone(coupons), if (homeRank != null &&
homeRank.commodityZone.length != 0)
///- HomeRecommendGoods(homeRank),
if(homeRank != null && homeRank.commodityZone.length != 0)
HomeRecommendGoods(homeRank), ///
// if(mRaiseMoney != 0)
/// HappyHelpFarmers(),
// if(mRaiseMoney != 0)
HappyHelpFarmers(), ///
WelfareCore(),
///
WelfareCore(), ///
if (homeRank != null &&
/// homeRank.commodityList.length != 0)
if(homeRank != null && homeRank.commodityList.length != 0) TopSellingList(homeRank),
TopSellingList(homeRank),
// ///
// /// // QuickOrder(),
// QuickOrder(),
// ///
// /// // CouponView(),
// CouponView(),
// ///
// /// // FeaturedActivity(),
// FeaturedActivity(),
// ///
// /// // HomeIntegralStore(gooods),
// HomeIntegralStore(gooods),
///Tab
///Tab PointsGoodsTitle(
PointsGoodsTitle( gooodsCategorys,
gooodsCategorys, (orderType, orderDesc) {
(orderType, orderDesc) { this.orderType = orderType;
this.orderType = orderType; this.orderDesc = orderDesc;
this.orderDesc = orderDesc; queryPointsProductList(false);
setState(() {}); },
}, (index) {
(index) { categoryId = gooodsCategorys[index].id;
categoryId = gooodsCategorys[index].id; queryPointsProductList(false);
pageNum = 1; },
setState(() {}); ),
},
), ///
PointGoods(
/// goods,
PointGoods( (index) {
goods, _toDetails(index);
(index) { },
_toDetails(index); ),
}, ],
), )),
],
);})
),
), ),
), ),
), ),
@ -602,7 +532,99 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
); );
} }
Widget spread(){ Widget homeBanner() {
return Container(
child: AspectRatio(
aspectRatio: 1.25,
child: bannerData != null && bannerData.isNotEmpty
? Swiper(
pagination: SwiperPagination(
margin: EdgeInsets.only(bottom: 12.h),
alignment: Alignment.bottomCenter,
builder: DotSwiperPaginationBuilder(
size: 8,
activeSize: 8,
space: 5,
activeColor: Colors.white,
color: Colors.white.withAlpha(76),
),
),
autoplay: true,
duration: 1000,
autoplayDelay: 2000,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return InkWell(
onTap: () {
bannerClick(bannerData[position]);
},
child: Container(
child: MImage(
bannerData[position].imgUrl,
fit: BoxFit.cover,
errorSrc: "assets/image/default_2_1.webp",
fadeSrc: "assets/image/default_2_1.webp",
),
),
);
},
itemCount: bannerData.length,
)
: Image.asset(
"assets/image/default_2_1.webp",
fit: BoxFit.cover,
),
),
);
}
/// contentType 0123,4:,5:7
bannerClick(BannerData bannerData) async {
switch (bannerData.contentType) {
case 1:
Navigator.of(context).pushNamed('/router/integral_store_page',
arguments: {"goodsId": bannerData.content});
break;
case 2:
Navigator.of(context).pushNamed('/router/web_page', arguments: {
"activityId": bannerData.content,
});
break;
case 3:
Navigator.of(context).pushNamed('/router/web_page', arguments: {
"articleId": bannerData.content,
});
break;
case 4:
String router = bannerData.content;
// String router = "/router/store_order?{\"id\":\"1512378184161558528\",\"tenant\":\"1188\",\"storeName\":\"农场煮意\"}";
if (router.contains("?")) {
String params = router.substring(router.indexOf("?") + 1);
Map map = jsonDecode(params);
Navigator.of(context).pushNamed(
router.substring(0, router.indexOf("?")),
arguments: map);
} else {
Navigator.of(context).pushNamed(router);
}
break;
case 5:
Navigator.of(context).pushNamed('/router/class_details', arguments: {
"id": bannerData.content,
});
break;
case 7:
String params =
bannerData.content.substring(bannerData.content.indexOf("?") + 1);
Map map = jsonDecode(params);
Navigator.of(context).pushNamed(
bannerData.content.substring(0, bannerData.content.indexOf("?")),
arguments: map);
break;
}
}
Widget spread() {
return Container( return Container(
width: double.infinity, width: double.infinity,
height: 85.h, height: 85.h,
@ -618,33 +640,33 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
color: Colors.white.withAlpha(76), color: Colors.white.withAlpha(76),
), ),
), ),
autoplay:true, autoplay: true,
duration: 1000, duration: 1000,
autoplayDelay: 2000, autoplayDelay: 2000,
itemBuilder: (context, position) { itemBuilder: (context, position) {
return GestureDetector( return GestureDetector(
onTap: (){ onTap: () {
if(position == 0){ if (position == 0) {
Navigator.of(context).pushNamed('/router/invite_friends'); Navigator.of(context).pushNamed('/router/invite_friends');
}else if(position == 1){ } else if (position == 1) {
Navigator.of(context).pushNamed('/router/trading_card_page'); Navigator.of(context).pushNamed('/router/trading_card_page');
} }
}, },
child:Container( child: Container(
margin: EdgeInsets.symmetric(horizontal:14.w), margin: EdgeInsets.symmetric(horizontal: 14.w),
child: ClipRRect( child: ClipRRect(
child:Image.asset( child: Image.asset(
spreadItem[position], spreadItem[position],
width:double.infinity, width: double.infinity,
fit: BoxFit.fill, fit: BoxFit.fill,
height:double.infinity, height: double.infinity,
), ),
borderRadius: BorderRadius.circular(6.w), borderRadius: BorderRadius.circular(6.w),
), ),
), ),
); );
}, },
itemCount:2, itemCount: 2,
), ),
); );
} }
@ -678,20 +700,24 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
// //
// http://miniscan.lotus-wallet.com/placeorder?tenant_code=1194&table_id=1669609340031467520&store_id=1637659387134738432 // http://miniscan.lotus-wallet.com/placeorder?tenant_code=1194&table_id=1669609340031467520&store_id=1637659387134738432
var result = await Navigator.of(context).pushNamed('/router/qr_scan'); var result = await Navigator.of(context).pushNamed('/router/qr_scan');
if(result.toString().contains("type\":\"coupon")){ if (result.toString().contains("type\":\"coupon")) {
/// ///
activityShowAlertDialog(result.toString()); activityShowAlertDialog(result.toString());
return; return;
}if(result.toString().contains("type\":\"wiped")){ }
if (result.toString().contains("type\":\"wiped")) {
/// ///
queryWiped(jsonDecode(result.toString())["memberCouponId"]); queryWiped(jsonDecode(result.toString())["memberCouponId"]);
return; return;
} }
// String result = await scanner.scan(); // String result = await scanner.scan();
Uri uri = Uri.parse(result); Uri uri = Uri.parse(result);
String tableId = uri.queryParameters["tableId"] ?? uri.queryParameters["table_id"]; String tableId =
String tenantCode = uri.queryParameters["tenantCode"] ?? uri.queryParameters["tenant_code"]; uri.queryParameters["tableId"] ?? uri.queryParameters["table_id"];
String shopId = uri.queryParameters["shopId"] ?? uri.queryParameters["store_id"]; String tenantCode = uri.queryParameters["tenantCode"] ??
uri.queryParameters["tenant_code"];
String shopId =
uri.queryParameters["shopId"] ?? uri.queryParameters["store_id"];
if (tableId != null && if (tableId != null &&
tableId != "" && tableId != "" &&
tenantCode != null && tenantCode != null &&

2
lib/home/huixiang_brand_page.dart

@ -44,7 +44,7 @@ class _BrandPage extends State<BrandPage>
Founder founder; Founder founder;
queryHome() async { queryHome() async {
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
final SharedPreferences value = await SharedPreferences.getInstance(); final SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService( apiService = ApiService(

2
lib/home/points_mall_page.dart

@ -95,7 +95,7 @@ class _PointsMallPage extends State<PointsMallPage>
} }
creditGoods() async { creditGoods() async {
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
final SharedPreferences value = await SharedPreferences.getInstance(); final SharedPreferences value = await SharedPreferences.getInstance();
client = ApiService(Dio(), client = ApiService(Dio(),

2
lib/home/welfare_exchange.dart

@ -62,7 +62,7 @@ class _WelfareExchange extends State<WelfareExchange>
} }
queryUser() async { queryUser() async {
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
BaseData<UserInfo> baseData = BaseData<UserInfo> baseData =
await apiService.queryInfo().catchError((onError) {}); await apiService.queryInfo().catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {

2
lib/integral/integral_page.dart

@ -191,7 +191,7 @@ class _IntegralPage extends State<IntegralPage> {
SmartDialog.showToast("今日已签到了", alignment: Alignment.center); SmartDialog.showToast("今日已签到了", alignment: Alignment.center);
return; return;
} }
EasyLoading.show(status: S.of(context).zhengzaijiazai); EasyLoading.show(status: S.of(context).zhengzaijiazai,maskType: EasyLoadingMaskType.black);
BaseData baseData = await apiService.signIn().catchError((onError) {}); BaseData baseData = await apiService.signIn().catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
setState(() {}); setState(() {});

2
lib/login/login_page.dart

@ -326,7 +326,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
"mobile": mobile, "mobile": mobile,
"invite":invite, "invite":invite,
}; };
EasyLoading.show(status: S.of(context).zhengzaijiazai); EasyLoading.show(status: S.of(context).zhengzaijiazai,maskType: EasyLoadingMaskType.black);
BaseData<LoginInfo> value = await client.memberLogin(param).catchError((error) { BaseData<LoginInfo> value = await client.memberLogin(param).catchError((error) {
print(error.message); print(error.message);
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), alignment: Alignment.center); SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), alignment: Alignment.center);

18
lib/login/new_login_page.dart

@ -61,17 +61,9 @@ class _NewLoginPage extends State<NewLoginPage> {
void initState() { void initState() {
super.initState(); super.initState();
isLogin(); isLogin();
queryChannels();
} }
queryChannels() async{ queryChannels() async{
SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
if (!sharedPreferences.containsKey("isShowPrivacyPolicy") ||
!sharedPreferences.getBool("isShowPrivacyPolicy")) {
showAlertDialog();
return;
}
apiService = ApiService(Dio(), context: context);
BaseData<ChannelsList> baseData = await apiService.appChannels().catchError((error) { BaseData<ChannelsList> baseData = await apiService.appChannels().catchError((error) {
print(error.message); print(error.message);
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
@ -80,7 +72,6 @@ class _NewLoginPage extends State<NewLoginPage> {
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
channelsList = baseData.data; channelsList = baseData.data;
setState((){}); setState((){});
EasyLoading.dismiss();
} else { } else {
if (baseData?.msg != null) if (baseData?.msg != null)
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
@ -241,7 +232,7 @@ class _NewLoginPage extends State<NewLoginPage> {
"areaCode": area, "areaCode": area,
"regChannel":channelName ?? "" "regChannel":channelName ?? ""
}; };
EasyLoading.show(status: S.of(context).zhengzaijiazai); EasyLoading.show(status: S.of(context).zhengzaijiazai,maskType: EasyLoadingMaskType.black);
BaseData value = await apiService.memberLogin(param).catchError((error) { BaseData value = await apiService.memberLogin(param).catchError((error) {
print(error.message); print(error.message);
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
@ -262,11 +253,11 @@ class _NewLoginPage extends State<NewLoginPage> {
"interviewCouponList": userInfo.interviewCouponList, "interviewCouponList": userInfo.interviewCouponList,
"firstLoginCouponList": userInfo.firstLoginCouponList "firstLoginCouponList": userInfo.firstLoginCouponList
}); });
EasyLoading.dismiss();
} else { } else {
if (value.msg != null) if (value.msg != null)
SmartDialog.showToast(value?.msg, alignment: Alignment.center); SmartDialog.showToast(value?.msg, alignment: Alignment.center);
} }
EasyLoading.dismiss();
} }
saveUserJson(userJson) { saveUserJson(userJson) {
@ -295,11 +286,10 @@ class _NewLoginPage extends State<NewLoginPage> {
sharedPreferences.getString("mobile") == "13800138000"; sharedPreferences.getString("mobile") == "13800138000";
Navigator.of(context).popAndPushNamed('/router/main_page'); Navigator.of(context).popAndPushNamed('/router/main_page');
} else { } else {
initController();
apiService = ApiService(Dio(), context: context); apiService = ApiService(Dio(), context: context);
initController();
isShowLogin = true; isShowLogin = true;
setState(() {}); queryChannels();
} }
} }

2
lib/mine/scan_web.dart

@ -26,7 +26,7 @@ class _ScanWeb extends State<ScanWeb> {
super.initState(); super.initState();
result = widget.arguments["result"]; result = widget.arguments["result"];
title = widget.arguments["title"]; title = widget.arguments["title"];
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
} }
@override @override

2
lib/order/order_detail_page.dart

@ -48,7 +48,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
super.initState(); super.initState();
jumpState = widget.arguments["jumpState"]; jumpState = widget.arguments["jumpState"];
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {
EasyLoading.show(status: S.of(context).zhengzaijiazai); EasyLoading.show(status: S.of(context).zhengzaijiazai,maskType: EasyLoadingMaskType.black);
apiService = ApiService(Dio(), apiService = ApiService(Dio(),
context: context, token: value.getString("token"),); context: context, token: value.getString("token"),);
queryDetails(); queryDetails();

749
lib/retrofit/data/product_show.dart

@ -0,0 +1,749 @@
/// id : "1484156758195699712"
/// createTime : "2022-01-20 21:32:00"
/// createUser : "1364043181062094848"
/// updateTime : "2022-01-21 18:27:02"
/// updateUser : "1364043181062094848"
/// supplierName : "一心回乡生态农场"
/// storeId : "1460885296764682240"
/// categoryId : "1460889654206136320"
/// groupId : "1484146679266410496"
/// shortName : "【一心回乡】三益米 筋道绵润、鲜稻尝鲜;自留种老品种,非转基因种子"
/// productName : "三益米1kg"
/// sellDesc : ""
/// productCode : "PRO202201202132000000000000001"
/// weight : "0"
/// applyPrice : "39.00"
/// price : "24.00"
/// vipPrice : null
/// stock : -13
/// sellCount : 19
/// needLogistics : 1
/// oversold : 1
/// organic : 0
/// status : 1
/// posShow : true
/// subscribeParam : null
/// isRaise : false
/// productType : 0
/// productNumber : 1
/// setMeal : 1
/// attrStyle : 0
/// detail : ""
/// isDelete : 0
/// printerFlag : "DEFAULT"
/// materials : null
/// materialId : null
/// details : ""
/// thumbnailImg : ""
/// info : ""
/// buyCount : 12
/// sellCountLimit : 0
/// stockRecoveryTime : null
/// isAddPurchase : null
/// limitNum : 0
/// rankId : "0"
/// happyBean : 0
/// imgs : ["https://pos.upload.lotus-wallet.com/1179/2022/01/243f54db-2dc8-4a9b-9ccc-09fc7a4e2a2e.jpg"]
/// productSkuList : [{"id":"1484156758229254144","createTime":"2022-01-20 21:32:00","createUser":"1364043181062094848","updateTime":"2022-01-20 21:32:00","updateUser":"1364043181062094848","storeId":"1460885296764682240","skuCode":"P202201202132002","skuNameStr":"","productId":"1484156758195699712","skuPrice":"24.00","applyPrice":"39.00","vipPrice":"24.00","packagingFee":"0.00","skuImg":null,"skuStock":-13,"autoRenewSkuStock":0,"deliveries":0,"ticketType":"","ticketWipedTimeTemplateId":null,"takeType":null,"ticketDays":"0","ticketExpireTime":"23:59:59","sort":50,"setMeal":"","productSetMeals":null,"weight":0.0,"volume":0.0,"isDelete":0,"material":null,"version":0,"skuTickets":null,"ticketStyle":""}]
class ProductShow {
ProductShow({
String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
String supplierName,
String storeId,
String categoryId,
String groupId,
String shortName,
String productName,
String sellDesc,
String productCode,
String weight,
String applyPrice,
String price,
dynamic vipPrice,
num stock,
num sellCount,
num needLogistics,
num oversold,
num organic,
num status,
bool posShow,
dynamic subscribeParam,
bool isRaise,
num productType,
num productNumber,
num setMeal,
num attrStyle,
String detail,
num isDelete,
String printerFlag,
dynamic materials,
dynamic materialId,
String details,
String thumbnailImg,
String info,
num buyCount,
num sellCountLimit,
dynamic stockRecoveryTime,
dynamic isAddPurchase,
num limitNum,
String rankId,
num happyBean,
List<String> imgs,
List<ProductSkuList> productSkuList,}){
_id = id;
_createTime = createTime;
_createUser = createUser;
_updateTime = updateTime;
_updateUser = updateUser;
_supplierName = supplierName;
_storeId = storeId;
_categoryId = categoryId;
_groupId = groupId;
_shortName = shortName;
_productName = productName;
_sellDesc = sellDesc;
_productCode = productCode;
_weight = weight;
_applyPrice = applyPrice;
_price = price;
_vipPrice = vipPrice;
_stock = stock;
_sellCount = sellCount;
_needLogistics = needLogistics;
_oversold = oversold;
_organic = organic;
_status = status;
_posShow = posShow;
_subscribeParam = subscribeParam;
_isRaise = isRaise;
_productType = productType;
_productNumber = productNumber;
_setMeal = setMeal;
_attrStyle = attrStyle;
_detail = detail;
_isDelete = isDelete;
_printerFlag = printerFlag;
_materials = materials;
_materialId = materialId;
_details = details;
_thumbnailImg = thumbnailImg;
_info = info;
_buyCount = buyCount;
_sellCountLimit = sellCountLimit;
_stockRecoveryTime = stockRecoveryTime;
_isAddPurchase = isAddPurchase;
_limitNum = limitNum;
_rankId = rankId;
_happyBean = happyBean;
_imgs = imgs;
_productSkuList = productSkuList;
}
ProductShow.fromJson(dynamic json) {
_id = json['id'];
_createTime = json['createTime'];
_createUser = json['createUser'];
_updateTime = json['updateTime'];
_updateUser = json['updateUser'];
_supplierName = json['supplierName'];
_storeId = json['storeId'];
_categoryId = json['categoryId'];
_groupId = json['groupId'];
_shortName = json['shortName'];
_productName = json['productName'];
_sellDesc = json['sellDesc'];
_productCode = json['productCode'];
_weight = json['weight'];
_applyPrice = json['applyPrice'];
_price = json['price'];
_vipPrice = json['vipPrice'];
_stock = json['stock'];
_sellCount = json['sellCount'];
_needLogistics = json['needLogistics'];
_oversold = json['oversold'];
_organic = json['organic'];
_status = json['status'];
_posShow = json['posShow'];
_subscribeParam = json['subscribeParam'];
_isRaise = json['isRaise'];
_productType = json['productType'];
_productNumber = json['productNumber'];
_setMeal = json['setMeal'];
_attrStyle = json['attrStyle'];
_detail = json['detail'];
_isDelete = json['isDelete'];
_printerFlag = json['printerFlag'];
_materials = json['materials'];
_materialId = json['materialId'];
_details = json['details'];
_thumbnailImg = json['thumbnailImg'];
_info = json['info'];
_buyCount = json['buyCount'];
_sellCountLimit = json['sellCountLimit'];
_stockRecoveryTime = json['stockRecoveryTime'];
_isAddPurchase = json['isAddPurchase'];
_limitNum = json['limitNum'];
_rankId = json['rankId'];
_happyBean = json['happyBean'];
_imgs = json['imgs'] != null ? json['imgs'].cast<String>() : [];
if (json['productSkuList'] != null) {
_productSkuList = [];
json['productSkuList'].forEach((v) {
_productSkuList.add(ProductSkuList.fromJson(v));
});
}
}
String _id;
String _createTime;
String _createUser;
String _updateTime;
String _updateUser;
String _supplierName;
String _storeId;
String _categoryId;
String _groupId;
String _shortName;
String _productName;
String _sellDesc;
String _productCode;
String _weight;
String _applyPrice;
String _price;
dynamic _vipPrice;
num _stock;
num _sellCount;
num _needLogistics;
num _oversold;
num _organic;
num _status;
bool _posShow;
dynamic _subscribeParam;
bool _isRaise;
num _productType;
num _productNumber;
num _setMeal;
num _attrStyle;
String _detail;
num _isDelete;
String _printerFlag;
dynamic _materials;
dynamic _materialId;
String _details;
String _thumbnailImg;
String _info;
num _buyCount;
num _sellCountLimit;
dynamic _stockRecoveryTime;
dynamic _isAddPurchase;
num _limitNum;
String _rankId;
num _happyBean;
List<String> _imgs;
List<ProductSkuList> _productSkuList;
ProductShow copyWith({ String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
String supplierName,
String storeId,
String categoryId,
String groupId,
String shortName,
String productName,
String sellDesc,
String productCode,
String weight,
String applyPrice,
String price,
dynamic vipPrice,
num stock,
num sellCount,
num needLogistics,
num oversold,
num organic,
num status,
bool posShow,
dynamic subscribeParam,
bool isRaise,
num productType,
num productNumber,
num setMeal,
num attrStyle,
String detail,
num isDelete,
String printerFlag,
dynamic materials,
dynamic materialId,
String details,
String thumbnailImg,
String info,
num buyCount,
num sellCountLimit,
dynamic stockRecoveryTime,
dynamic isAddPurchase,
num limitNum,
String rankId,
num happyBean,
List<String> imgs,
List<ProductSkuList> productSkuList,
}) => ProductShow( id: id ?? _id,
createTime: createTime ?? _createTime,
createUser: createUser ?? _createUser,
updateTime: updateTime ?? _updateTime,
updateUser: updateUser ?? _updateUser,
supplierName: supplierName ?? _supplierName,
storeId: storeId ?? _storeId,
categoryId: categoryId ?? _categoryId,
groupId: groupId ?? _groupId,
shortName: shortName ?? _shortName,
productName: productName ?? _productName,
sellDesc: sellDesc ?? _sellDesc,
productCode: productCode ?? _productCode,
weight: weight ?? _weight,
applyPrice: applyPrice ?? _applyPrice,
price: price ?? _price,
vipPrice: vipPrice ?? _vipPrice,
stock: stock ?? _stock,
sellCount: sellCount ?? _sellCount,
needLogistics: needLogistics ?? _needLogistics,
oversold: oversold ?? _oversold,
organic: organic ?? _organic,
status: status ?? _status,
posShow: posShow ?? _posShow,
subscribeParam: subscribeParam ?? _subscribeParam,
isRaise: isRaise ?? _isRaise,
productType: productType ?? _productType,
productNumber: productNumber ?? _productNumber,
setMeal: setMeal ?? _setMeal,
attrStyle: attrStyle ?? _attrStyle,
detail: detail ?? _detail,
isDelete: isDelete ?? _isDelete,
printerFlag: printerFlag ?? _printerFlag,
materials: materials ?? _materials,
materialId: materialId ?? _materialId,
details: details ?? _details,
thumbnailImg: thumbnailImg ?? _thumbnailImg,
info: info ?? _info,
buyCount: buyCount ?? _buyCount,
sellCountLimit: sellCountLimit ?? _sellCountLimit,
stockRecoveryTime: stockRecoveryTime ?? _stockRecoveryTime,
isAddPurchase: isAddPurchase ?? _isAddPurchase,
limitNum: limitNum ?? _limitNum,
rankId: rankId ?? _rankId,
happyBean: happyBean ?? _happyBean,
imgs: imgs ?? _imgs,
productSkuList: productSkuList ?? _productSkuList,
);
String get id => _id;
String get createTime => _createTime;
String get createUser => _createUser;
String get updateTime => _updateTime;
String get updateUser => _updateUser;
String get supplierName => _supplierName;
String get storeId => _storeId;
String get categoryId => _categoryId;
String get groupId => _groupId;
String get shortName => _shortName;
String get productName => _productName;
String get sellDesc => _sellDesc;
String get productCode => _productCode;
String get weight => _weight;
String get applyPrice => _applyPrice;
String get price => _price;
dynamic get vipPrice => _vipPrice;
num get stock => _stock;
num get sellCount => _sellCount;
num get needLogistics => _needLogistics;
num get oversold => _oversold;
num get organic => _organic;
num get status => _status;
bool get posShow => _posShow;
dynamic get subscribeParam => _subscribeParam;
bool get isRaise => _isRaise;
num get productType => _productType;
num get productNumber => _productNumber;
num get setMeal => _setMeal;
num get attrStyle => _attrStyle;
String get detail => _detail;
num get isDelete => _isDelete;
String get printerFlag => _printerFlag;
dynamic get materials => _materials;
dynamic get materialId => _materialId;
String get details => _details;
String get thumbnailImg => _thumbnailImg;
String get info => _info;
num get buyCount => _buyCount;
num get sellCountLimit => _sellCountLimit;
dynamic get stockRecoveryTime => _stockRecoveryTime;
dynamic get isAddPurchase => _isAddPurchase;
num get limitNum => _limitNum;
String get rankId => _rankId;
num get happyBean => _happyBean;
List<String> get imgs => _imgs;
List<ProductSkuList> get productSkuList => _productSkuList;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = _id;
map['createTime'] = _createTime;
map['createUser'] = _createUser;
map['updateTime'] = _updateTime;
map['updateUser'] = _updateUser;
map['supplierName'] = _supplierName;
map['storeId'] = _storeId;
map['categoryId'] = _categoryId;
map['groupId'] = _groupId;
map['shortName'] = _shortName;
map['productName'] = _productName;
map['sellDesc'] = _sellDesc;
map['productCode'] = _productCode;
map['weight'] = _weight;
map['applyPrice'] = _applyPrice;
map['price'] = _price;
map['vipPrice'] = _vipPrice;
map['stock'] = _stock;
map['sellCount'] = _sellCount;
map['needLogistics'] = _needLogistics;
map['oversold'] = _oversold;
map['organic'] = _organic;
map['status'] = _status;
map['posShow'] = _posShow;
map['subscribeParam'] = _subscribeParam;
map['isRaise'] = _isRaise;
map['productType'] = _productType;
map['productNumber'] = _productNumber;
map['setMeal'] = _setMeal;
map['attrStyle'] = _attrStyle;
map['detail'] = _detail;
map['isDelete'] = _isDelete;
map['printerFlag'] = _printerFlag;
map['materials'] = _materials;
map['materialId'] = _materialId;
map['details'] = _details;
map['thumbnailImg'] = _thumbnailImg;
map['info'] = _info;
map['buyCount'] = _buyCount;
map['sellCountLimit'] = _sellCountLimit;
map['stockRecoveryTime'] = _stockRecoveryTime;
map['isAddPurchase'] = _isAddPurchase;
map['limitNum'] = _limitNum;
map['rankId'] = _rankId;
map['happyBean'] = _happyBean;
map['imgs'] = _imgs;
if (_productSkuList != null) {
map['productSkuList'] = _productSkuList.map((v) => v.toJson()).toList();
}
return map;
}
}
/// id : "1484156758229254144"
/// createTime : "2022-01-20 21:32:00"
/// createUser : "1364043181062094848"
/// updateTime : "2022-01-20 21:32:00"
/// updateUser : "1364043181062094848"
/// storeId : "1460885296764682240"
/// skuCode : "P202201202132002"
/// skuNameStr : ""
/// productId : "1484156758195699712"
/// skuPrice : "24.00"
/// applyPrice : "39.00"
/// vipPrice : "24.00"
/// packagingFee : "0.00"
/// skuImg : null
/// skuStock : -13
/// autoRenewSkuStock : 0
/// deliveries : 0
/// ticketType : ""
/// ticketWipedTimeTemplateId : null
/// takeType : null
/// ticketDays : "0"
/// ticketExpireTime : "23:59:59"
/// sort : 50
/// setMeal : ""
/// productSetMeals : null
/// weight : 0.0
/// volume : 0.0
/// isDelete : 0
/// material : null
/// version : 0
/// skuTickets : null
/// ticketStyle : ""
class ProductSkuList {
ProductSkuList({
String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
String storeId,
String skuCode,
String skuNameStr,
String productId,
String skuPrice,
String applyPrice,
String vipPrice,
String packagingFee,
dynamic skuImg,
num skuStock,
num autoRenewSkuStock,
num deliveries,
String ticketType,
dynamic ticketWipedTimeTemplateId,
dynamic takeType,
String ticketDays,
String ticketExpireTime,
num sort,
String setMeal,
dynamic productSetMeals,
num weight,
num volume,
num isDelete,
dynamic material,
num version,
dynamic skuTickets,
String ticketStyle,}){
_id = id;
_createTime = createTime;
_createUser = createUser;
_updateTime = updateTime;
_updateUser = updateUser;
_storeId = storeId;
_skuCode = skuCode;
_skuNameStr = skuNameStr;
_productId = productId;
_skuPrice = skuPrice;
_applyPrice = applyPrice;
_vipPrice = vipPrice;
_packagingFee = packagingFee;
_skuImg = skuImg;
_skuStock = skuStock;
_autoRenewSkuStock = autoRenewSkuStock;
_deliveries = deliveries;
_ticketType = ticketType;
_ticketWipedTimeTemplateId = ticketWipedTimeTemplateId;
_takeType = takeType;
_ticketDays = ticketDays;
_ticketExpireTime = ticketExpireTime;
_sort = sort;
_setMeal = setMeal;
_productSetMeals = productSetMeals;
_weight = weight;
_volume = volume;
_isDelete = isDelete;
_material = material;
_version = version;
_skuTickets = skuTickets;
_ticketStyle = ticketStyle;
}
ProductSkuList.fromJson(dynamic json) {
_id = json['id'];
_createTime = json['createTime'];
_createUser = json['createUser'];
_updateTime = json['updateTime'];
_updateUser = json['updateUser'];
_storeId = json['storeId'];
_skuCode = json['skuCode'];
_skuNameStr = json['skuNameStr'];
_productId = json['productId'];
_skuPrice = json['skuPrice'];
_applyPrice = json['applyPrice'];
_vipPrice = json['vipPrice'];
_packagingFee = json['packagingFee'];
_skuImg = json['skuImg'];
_skuStock = json['skuStock'];
_autoRenewSkuStock = json['autoRenewSkuStock'];
_deliveries = json['deliveries'];
_ticketType = json['ticketType'];
_ticketWipedTimeTemplateId = json['ticketWipedTimeTemplateId'];
_takeType = json['takeType'];
_ticketDays = json['ticketDays'];
_ticketExpireTime = json['ticketExpireTime'];
_sort = json['sort'];
_setMeal = json['setMeal'];
_productSetMeals = json['productSetMeals'];
_weight = json['weight'];
_volume = json['volume'];
_isDelete = json['isDelete'];
_material = json['material'];
_version = json['version'];
_skuTickets = json['skuTickets'];
_ticketStyle = json['ticketStyle'];
}
String _id;
String _createTime;
String _createUser;
String _updateTime;
String _updateUser;
String _storeId;
String _skuCode;
String _skuNameStr;
String _productId;
String _skuPrice;
String _applyPrice;
String _vipPrice;
String _packagingFee;
dynamic _skuImg;
num _skuStock;
num _autoRenewSkuStock;
num _deliveries;
String _ticketType;
dynamic _ticketWipedTimeTemplateId;
dynamic _takeType;
String _ticketDays;
String _ticketExpireTime;
num _sort;
String _setMeal;
dynamic _productSetMeals;
num _weight;
num _volume;
num _isDelete;
dynamic _material;
num _version;
dynamic _skuTickets;
String _ticketStyle;
ProductSkuList copyWith({ String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
String storeId,
String skuCode,
String skuNameStr,
String productId,
String skuPrice,
String applyPrice,
String vipPrice,
String packagingFee,
dynamic skuImg,
num skuStock,
num autoRenewSkuStock,
num deliveries,
String ticketType,
dynamic ticketWipedTimeTemplateId,
dynamic takeType,
String ticketDays,
String ticketExpireTime,
num sort,
String setMeal,
dynamic productSetMeals,
num weight,
num volume,
num isDelete,
dynamic material,
num version,
dynamic skuTickets,
String ticketStyle,
}) => ProductSkuList( id: id ?? _id,
createTime: createTime ?? _createTime,
createUser: createUser ?? _createUser,
updateTime: updateTime ?? _updateTime,
updateUser: updateUser ?? _updateUser,
storeId: storeId ?? _storeId,
skuCode: skuCode ?? _skuCode,
skuNameStr: skuNameStr ?? _skuNameStr,
productId: productId ?? _productId,
skuPrice: skuPrice ?? _skuPrice,
applyPrice: applyPrice ?? _applyPrice,
vipPrice: vipPrice ?? _vipPrice,
packagingFee: packagingFee ?? _packagingFee,
skuImg: skuImg ?? _skuImg,
skuStock: skuStock ?? _skuStock,
autoRenewSkuStock: autoRenewSkuStock ?? _autoRenewSkuStock,
deliveries: deliveries ?? _deliveries,
ticketType: ticketType ?? _ticketType,
ticketWipedTimeTemplateId: ticketWipedTimeTemplateId ?? _ticketWipedTimeTemplateId,
takeType: takeType ?? _takeType,
ticketDays: ticketDays ?? _ticketDays,
ticketExpireTime: ticketExpireTime ?? _ticketExpireTime,
sort: sort ?? _sort,
setMeal: setMeal ?? _setMeal,
productSetMeals: productSetMeals ?? _productSetMeals,
weight: weight ?? _weight,
volume: volume ?? _volume,
isDelete: isDelete ?? _isDelete,
material: material ?? _material,
version: version ?? _version,
skuTickets: skuTickets ?? _skuTickets,
ticketStyle: ticketStyle ?? _ticketStyle,
);
String get id => _id;
String get createTime => _createTime;
String get createUser => _createUser;
String get updateTime => _updateTime;
String get updateUser => _updateUser;
String get storeId => _storeId;
String get skuCode => _skuCode;
String get skuNameStr => _skuNameStr;
String get productId => _productId;
String get skuPrice => _skuPrice;
String get applyPrice => _applyPrice;
String get vipPrice => _vipPrice;
String get packagingFee => _packagingFee;
dynamic get skuImg => _skuImg;
num get skuStock => _skuStock;
num get autoRenewSkuStock => _autoRenewSkuStock;
num get deliveries => _deliveries;
String get ticketType => _ticketType;
dynamic get ticketWipedTimeTemplateId => _ticketWipedTimeTemplateId;
dynamic get takeType => _takeType;
String get ticketDays => _ticketDays;
String get ticketExpireTime => _ticketExpireTime;
num get sort => _sort;
String get setMeal => _setMeal;
dynamic get productSetMeals => _productSetMeals;
num get weight => _weight;
num get volume => _volume;
num get isDelete => _isDelete;
dynamic get material => _material;
num get version => _version;
dynamic get skuTickets => _skuTickets;
String get ticketStyle => _ticketStyle;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = _id;
map['createTime'] = _createTime;
map['createUser'] = _createUser;
map['updateTime'] = _updateTime;
map['updateUser'] = _updateUser;
map['storeId'] = _storeId;
map['skuCode'] = _skuCode;
map['skuNameStr'] = _skuNameStr;
map['productId'] = _productId;
map['skuPrice'] = _skuPrice;
map['applyPrice'] = _applyPrice;
map['vipPrice'] = _vipPrice;
map['packagingFee'] = _packagingFee;
map['skuImg'] = _skuImg;
map['skuStock'] = _skuStock;
map['autoRenewSkuStock'] = _autoRenewSkuStock;
map['deliveries'] = _deliveries;
map['ticketType'] = _ticketType;
map['ticketWipedTimeTemplateId'] = _ticketWipedTimeTemplateId;
map['takeType'] = _takeType;
map['ticketDays'] = _ticketDays;
map['ticketExpireTime'] = _ticketExpireTime;
map['sort'] = _sort;
map['setMeal'] = _setMeal;
map['productSetMeals'] = _productSetMeals;
map['weight'] = _weight;
map['volume'] = _volume;
map['isDelete'] = _isDelete;
map['material'] = _material;
map['version'] = _version;
map['skuTickets'] = _skuTickets;
map['ticketStyle'] = _ticketStyle;
return map;
}
}

160
lib/retrofit/data/store.dart

@ -1,8 +1,7 @@
import 'package:huixiang/retrofit/data/coupon_vo.dart'; import 'package:huixiang/retrofit/data/coupon_vo.dart';
import 'package:huixiang/retrofit/data/product_show.dart';
import 'package:huixiang/retrofit/data/store_type.dart'; import 'package:huixiang/retrofit/data/store_type.dart';
class Store { class Store {
Store(); Store();
@ -38,81 +37,94 @@ class Store {
CouponVo couponVO; CouponVo couponVO;
dynamic deliveryInfo; dynamic deliveryInfo;
String businessType; String businessType;
String businessService;
List<ProductShow> productShow;
StoreType posType; StoreType posType;
factory Store.fromJson(Map<String, dynamic> json) => Store() factory Store.fromJson(Map<String, dynamic> json) =>
..id = json['id'] as String Store()
..createTime = json['createTime'] as String ..id = json['id'] as String
..createUser = json['createUser'] as String ..createTime = json['createTime'] as String
..updateTime = json['updateTime'] as String ..createUser = json['createUser'] as String
..updateUser = json['updateUser'] as String ..updateTime = json['updateTime'] as String
..tenantCode = json['tenantCode'] as String ..updateUser = json['updateUser'] as String
..useErp = json['useErp'] as bool ..tenantCode = json['tenantCode'] as String
..openStartTime = json['openStartTime'] as String ..useErp = json['useErp'] as bool
..openEndTime = json['openEndTime'] as String ..openStartTime = json['openStartTime'] as String
..perCapitaConsumption = json['perCapitaConsumption'] as String ..openEndTime = json['openEndTime'] as String
..storeName = json['storeName'] as String ..perCapitaConsumption = json['perCapitaConsumption'] as String
..distance = (json['distance'] as num)?.toDouble() ..storeName = json['storeName'] as String
..logo = json['logo'] as String ..distance = (json['distance'] as num)?.toDouble()
..facade = json['facade'] as String ..logo = json['logo'] as String
..shipAddress = json['shipAddress'] as String ..facade = json['facade'] as String
..remark = json['remark'] ..shipAddress = json['shipAddress'] as String
..mobile = json['mobile'] as String ..remark = json['remark']
..longitude = json['longitude'] as String ..mobile = json['mobile'] as String
..latitude = json['latitude'] as String ..longitude = json['longitude'] as String
..refundAddress = json['refundAddress'] ..latitude = json['latitude'] as String
..refundTel = json['refundTel'] ..refundAddress = json['refundAddress']
..refundContact = json['refundContact'] ..refundTel = json['refundTel']
..isAutoSendRefundAddress = json['isAutoSendRefundAddress'] as int ..refundContact = json['refundContact']
..province = json['province'] as String ..isAutoSendRefundAddress = json['isAutoSendRefundAddress'] as int
..city = json['city'] as String ..province = json['province'] as String
..district = json['district'] as String ..city = json['city'] as String
..address = json['address'] as String ..district = json['district'] as String
..headName = json['headName'] as String ..address = json['address'] as String
..headMobile = json['headMobile'] as String ..headName = json['headName'] as String
..deliveryInfo = json['deliveryInfo'] ..headMobile = json['headMobile'] as String
..businessType = json['businessType'] as String ..deliveryInfo = json['deliveryInfo']
..couponVO = json['couponVO'] == null ? null : CouponVo.fromJson(json['couponVO']) ..businessType = json['businessType'] as String
..posType = json['posType'] == null ..businessService = json['businessService'] as String
? null ..couponVO = json['couponVO'] == null ? null : CouponVo.fromJson(
: StoreType.fromJson(json['posType'] as Map<String, dynamic>); json['couponVO'])
..productShow = (json['productShow'] as List)
Map<String, dynamic> toJson() => <String, dynamic>{ ?.map((e) =>
'id': this.id, e == null ? null : ProductShow.fromJson(e as Map<String, dynamic>))
'createTime': this.createTime, ?.toList()
'createUser': this.createUser, ..posType = json['posType'] == null
'updateTime': this.updateTime, ? null
'updateUser': this.updateUser, : StoreType.fromJson(json['posType'] as Map<String, dynamic>);
'tenantCode': this.tenantCode,
'useErp': this.useErp,
'openStartTime': this.openStartTime,
'openEndTime': this.openEndTime,
'perCapitaConsumption': this.perCapitaConsumption,
'storeName': this.storeName,
'distance': this.distance,
'logo': this.logo,
'facade': this.facade,
'shipAddress': this.shipAddress,
'remark': this.remark,
'mobile': this.mobile,
'longitude': this.longitude,
'latitude': this.latitude,
'refundAddress': this.refundAddress,
'refundTel': this.refundTel,
'refundContact': this.refundContact,
'isAutoSendRefundAddress': this.isAutoSendRefundAddress,
'province': this.province,
'city': this.city,
'district': this.district,
'address': this.address,
'headName': this.headName,
'headMobile': this.headMobile,
'deliveryInfo': this.deliveryInfo,
'businessType': this.businessType,
'couponVO': this.couponVO != null ? this.couponVO.toJson() : null,
'posType': this.posType,
};
Map<String, dynamic> toJson() =>
<String, dynamic>{
'id': this.id,
'createTime': this.createTime,
'createUser': this.createUser,
'updateTime': this.updateTime,
'updateUser': this.updateUser,
'tenantCode': this.tenantCode,
'useErp': this.useErp,
'openStartTime': this.openStartTime,
'openEndTime': this.openEndTime,
'perCapitaConsumption': this.perCapitaConsumption,
'storeName': this.storeName,
'distance': this.distance,
'logo': this.logo,
'facade': this.facade,
'shipAddress': this.shipAddress,
'remark': this.remark,
'mobile': this.mobile,
'longitude': this.longitude,
'latitude': this.latitude,
'refundAddress': this.refundAddress,
'refundTel': this.refundTel,
'refundContact': this.refundContact,
'isAutoSendRefundAddress': this.isAutoSendRefundAddress,
'province': this.province,
'city': this.city,
'district': this.district,
'address': this.address,
'headName': this.headName,
'headMobile': this.headMobile,
'deliveryInfo': this.deliveryInfo,
'businessType': this.businessType,
'businessService': this.businessService,
'couponVO': this.couponVO != null ? this.couponVO.toJson() : null,
'productShow': this.productShow.map((e) => e.toJson()).toList(),
'posType': this.posType,
};
} }

6
lib/retrofit/min_api.dart

@ -26,7 +26,7 @@ import 'data/shopping_home_config.dart';
part 'min_api.g.dart'; part 'min_api.g.dart';
const localBaseUrl = "http://192.168.10.15:8765/app/";/// const localBaseUrl = "http://app-api.test.yixinhuixiang.com/app/";///
// const localBaseUrl = "http://pos-test.api.lotus-wallet.com/app/";/// // const localBaseUrl = "http://pos-test.api.lotus-wallet.com/app/";///
const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线 const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线
@ -49,7 +49,7 @@ abstract class MinApiService {
headers["tenant"] = tenant; headers["tenant"] = tenant;
} }
if (storeId != null && storeId != "") { if (storeId != null && storeId != "") {
headers["store_id"] = storeId; headers["store-id"] = storeId;
} }
headers["Environment"] = "app"; headers["Environment"] = "app";
dio.options = BaseOptions( dio.options = BaseOptions(
@ -67,7 +67,7 @@ abstract class MinApiService {
debugPrint("headers = ${options.headers}"); debugPrint("headers = ${options.headers}");
if (showLoading && !EasyLoading.isShow) { if (showLoading && !EasyLoading.isShow) {
//loading //loading
EasyLoading.show(status: S.of(context).zhengzaijiazai); EasyLoading.show(status: S.of(context).zhengzaijiazai,maskType: EasyLoadingMaskType.black);
} }
if (options.data is FormData) { if (options.data is FormData) {
debugPrint("params data = FormData"); debugPrint("params data = FormData");

14
lib/retrofit/retrofit_api.dart

@ -67,17 +67,11 @@ import 'data/wx_pay.dart';
part 'retrofit_api.g.dart'; part 'retrofit_api.g.dart';
const localBaseUrl = "http://platform-api.test.yixinhuixiang.com/app/"; const localBaseUrl = "http://platform-api.test.yixinhuixiang.com/app/";///
///
// const localBaseUrl = "http://platform.test.api.lotus-wallet.com/app/";/// // const localBaseUrl = "http://platform.test.api.lotus-wallet.com/app/";///
const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/"; const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///线
///线
const ipBaseUrl = "https://api.ooomn.com";
///ip const ipBaseUrl = "https://api.ooomn.com";///ip
@RestApi(baseUrl: localBaseUrl) @RestApi(baseUrl: localBaseUrl)
abstract class ApiService { abstract class ApiService {
@ -110,7 +104,7 @@ abstract class ApiService {
debugPrint("headers = ${options.headers}"); debugPrint("headers = ${options.headers}");
if (showLoading && !EasyLoading.isShow) { if (showLoading && !EasyLoading.isShow) {
//loading //loading
EasyLoading.show(status: S.of(context).zhengzaijiazai); EasyLoading.show(status: S.of(context).zhengzaijiazai,maskType: EasyLoadingMaskType.black);
} }
if (options.data is FormData) { if (options.data is FormData) {
debugPrint("params data = FormData"); debugPrint("params data = FormData");

2
lib/retrofit/retrofit_api.g.dart

@ -592,7 +592,7 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<List<Store>>.fromJson( final value = BaseData<List<Store>>.fromJson(
_result.data, _result.data,
(json) => (json as List<dynamic>) (json) => ((json??"") == "")?null:(json as List<dynamic>)
.map<Store>((i) => Store.fromJson(i as Map<String, dynamic>)) .map<Store>((i) => Store.fromJson(i as Map<String, dynamic>))
.toList()); .toList());
return value; return value;

2
lib/setting/account_security_page.dart

@ -26,7 +26,7 @@ class _AccountSecurityPage extends State<AccountSecurityPage> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
SharedPreferences.getInstance().then((value) => { SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(), apiService = ApiService(Dio(),
context: context, token: value.getString("token"),), context: context, token: value.getString("token"),),

2
lib/setting/treaty_page.dart

@ -23,7 +23,7 @@ class _TreatyPage extends State<TreatyPage> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
// if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView(); // if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView();
// if (Platform.isIOS) WebView.platform = CupertinoWebView(); // if (Platform.isIOS) WebView.platform = CupertinoWebView();
} }

2
lib/setting/user_service_page.dart

@ -25,7 +25,7 @@ class _UserServicePage extends State<UserServicePage> with WidgetsBindingObserve
void initState() { void initState() {
super.initState(); super.initState();
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance.addObserver(this);
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView(); if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView();
if (Platform.isIOS) WebView.platform = CupertinoWebView(); if (Platform.isIOS) WebView.platform = CupertinoWebView();
} }

6
lib/settlement/settlement.dart

@ -228,7 +228,7 @@ class _Settlement extends State<Settlement> {
payChannel, payChannel,
tableId) async { tableId) async {
try { try {
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
BaseData<SettleOrderInfo> baseData = await minService.getOrderInfo({ BaseData<SettleOrderInfo> baseData = await minService.getOrderInfo({
"addressId": addressId, "addressId": addressId,
@ -329,7 +329,7 @@ class _Settlement extends State<Settlement> {
/// ///
queryOrderDetails(id) async { queryOrderDetails(id) async {
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
BaseData<MinOrderInfo> baseData = await minService.getOrderDetails({ BaseData<MinOrderInfo> baseData = await minService.getOrderDetails({
"id": pageType != null ? widget.arguments["orderId"] : id ?? parentId, "id": pageType != null ? widget.arguments["orderId"] : id ?? parentId,
}).catchError((error) {}); }).catchError((error) {});
@ -632,7 +632,7 @@ class _Settlement extends State<Settlement> {
print("error: $error"); print("error: $error");
}); });
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
placeOrder = true; placeOrder = true;
this.downOrder = DownOrder.fromJson(baseData.data); this.downOrder = DownOrder.fromJson(baseData.data);
querySettlement(); querySettlement();

4
lib/store/shop_details_page.dart

@ -94,7 +94,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
/// ///
queryStoreInfo() async { queryStoreInfo() async {
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
SharedPreferences value = await SharedPreferences.getInstance(); SharedPreferences value = await SharedPreferences.getInstance();
if (apiService == null) if (apiService == null)
apiService = ApiService( apiService = ApiService(
@ -321,7 +321,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
/// ///
_queryMiNiDetail(String id, int count) async { _queryMiNiDetail(String id, int count) async {
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
if (count < 0) { if (count < 0) {
shopCarGoods.shoppingCartSkuItemList.forEach((element) { shopCarGoods.shoppingCartSkuItemList.forEach((element) {
if (element.productId == id) { if (element.productId == id) {

2
lib/store/shopping/activity_prefecture_details.dart

@ -95,7 +95,7 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
/// ///
minLogin(SharedPreferences shared) async { minLogin(SharedPreferences shared) async {
EasyLoading.show(status: S.of(context).zhengzaijiazai); EasyLoading.show(status: S.of(context).zhengzaijiazai,maskType: EasyLoadingMaskType.black);
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
context: context, context: context,

2
lib/store/shopping/shopping_goods_details.dart

@ -116,7 +116,7 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
/// ///
minLogin(SharedPreferences shared) async { minLogin(SharedPreferences shared) async {
EasyLoading.show(status: S.of(context).zhengzaijiazai); EasyLoading.show(status: S.of(context).zhengzaijiazai,maskType: EasyLoadingMaskType.black);
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
context: context, context: context,

2
lib/store/shopping/shopping_mall_home.dart

@ -55,7 +55,7 @@ class _ShoppingMallHome extends State<ShoppingMallHome>
/// ///
minLogin(SharedPreferences shared) async { minLogin(SharedPreferences shared) async {
EasyLoading.show(status: S.of(context).zhengzaijiazai); EasyLoading.show(status: S.of(context).zhengzaijiazai,maskType: EasyLoadingMaskType.black);
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
context: context, context: context,

4
lib/store/store_order.dart

@ -97,7 +97,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
/// ///
minLogin(SharedPreferences shared) async { minLogin(SharedPreferences shared) async {
EasyLoading.show(status: S.of(context).zhengzaijiazai); EasyLoading.show(status: S.of(context).zhengzaijiazai,maskType: EasyLoadingMaskType.black);
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
context: context, context: context,
@ -754,7 +754,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
/// ///
_queryMiNiDetail(String id, int count) async { _queryMiNiDetail(String id, int count) async {
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
if (count < 0) { if (count < 0) {
shopCarGoods.shoppingCartSkuItemList.forEach((element) async { shopCarGoods.shoppingCartSkuItemList.forEach((element) async {
if (element.productId == id) { if (element.productId == id) {

4
lib/store/store_view/product_sku.dart

@ -244,7 +244,7 @@ class _ProductSku extends State<ProductSku> {
false) == false) ==
false) { false) {
_isTapEd = true; _isTapEd = true;
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
await widget.reduce(widget.miNiDetail, selectSkus); await widget.reduce(widget.miNiDetail, selectSkus);
} }
count -= 1; count -= 1;
@ -275,7 +275,7 @@ class _ProductSku extends State<ProductSku> {
false) == false) ==
false) { false) {
_isTapEd = true; _isTapEd = true;
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
if (count == 1 && realCount == 0) if (count == 1 && realCount == 0)
await widget.addShopCar( await widget.addShopCar(
widget.miNiDetail, selectSkus, 2); widget.miNiDetail, selectSkus, 2);

206
lib/union/union_list.dart

@ -2,11 +2,14 @@ import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart';
import 'package:flutter_baidu_mapapi_utils/flutter_baidu_mapapi_utils.dart';
import 'package:flutter_bmflocation/flutter_bmflocation.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/store.dart'; import 'package:huixiang/retrofit/data/store.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/utils/location.dart';
import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/custom_image.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
@ -14,10 +17,12 @@ import 'package:shared_preferences/shared_preferences.dart';
import 'package:shimmer/shimmer.dart'; import 'package:shimmer/shimmer.dart';
import '../retrofit/data/base_data.dart'; import '../retrofit/data/base_data.dart';
import '../retrofit/data/product_show.dart';
import '../retrofit/retrofit_api.dart'; import '../retrofit/retrofit_api.dart';
import '../utils/flutter_utils.dart'; import '../utils/flutter_utils.dart';
import '../view_widget/classic_header.dart'; import '../view_widget/classic_header.dart';
import '../view_widget/no_data_view.dart'; import '../view_widget/no_data_view.dart';
import '../view_widget/round_button.dart';
class UnionList extends StatefulWidget { class UnionList extends StatefulWidget {
final String serviceType; final String serviceType;
@ -37,6 +42,7 @@ class UnionList extends StatefulWidget {
class _UnionList extends State<UnionList> with AutomaticKeepAliveClientMixin { class _UnionList extends State<UnionList> with AutomaticKeepAliveClientMixin {
ApiService apiService; ApiService apiService;
List<Store> storeList; List<Store> storeList;
BMFCoordinate latLng;
final RefreshController _refreshController = RefreshController(); final RefreshController _refreshController = RefreshController();
@override @override
@ -84,7 +90,9 @@ class _UnionList extends State<UnionList> with AutomaticKeepAliveClientMixin {
controller: _refreshController, controller: _refreshController,
enablePullDown: true, enablePullDown: true,
enablePullUp: false, enablePullUp: false,
header: MyHeader(color: Colors.white,), header: MyHeader(
color: Colors.white,
),
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
onRefresh: queryStore, onRefresh: queryStore,
child: (storeList == null || storeList.length == 0) child: (storeList == null || storeList.length == 0)
@ -182,6 +190,202 @@ class _UnionList extends State<UnionList> with AutomaticKeepAliveClientMixin {
} }
Widget buildStoreItem(Store store, position) { Widget buildStoreItem(Store store, position) {
return Container(
margin: EdgeInsets.fromLTRB(16.w, 8.h, 16.w, 12.h),
padding: EdgeInsets.all(12.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(6)),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(25),
offset: Offset(0, 1),
blurRadius: 12,
spreadRadius: 0,
)
]),
width: double.infinity,
// height: 235.h,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Stack(
children: [
MImage(
store.facade,
width: 74,
height: 74,
fit: BoxFit.cover,
radius: BorderRadius.circular(6),
errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp",
),
Container(
decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(6),
bottomRight: Radius.circular(6),
topRight: Radius.circular(2),
bottomLeft: Radius.circular(2)),
),
padding: EdgeInsets.symmetric(horizontal: 3.w, vertical: 2.h),
child: Text(
"品牌",
style: TextStyle(
color: Colors.white,
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
),
),
)
],
),
SizedBox(
width: 12.w,
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
store?.storeName ?? "",
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFF0D0D0D),
fontSize: 14.sp,
fontWeight: MyFontWeight.bold,
),
),
SizedBox(height: 6.h),
Row(
children: [
Text(
S.of(context).ren(
store?.perCapitaConsumption ?? "",
),
style: TextStyle(
color: Color(0xFF4D4D4D),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
SizedBox(width: 22.w),
Image.asset(
"assets/image/icon_union_location_black.webp",
fit: BoxFit.fill,
height: 12,
width: 12,
),
SizedBox(width: 4.w),
Text(
(store.distance ?? 0) > 1000
? S.of(context).gongli(
((store.distance ?? 0) / 1000 * 100).toInt() /
100.0)
: S
.of(context)
.mi(((store.distance ?? 0) * 100).toInt() / 100.0),
style: TextStyle(
color: Color(0xFF4D4D4D),
fontSize: 12.sp,
),
),
],
),
SizedBox(height: 10.h),
Row(
children: []..addAll(
itemServer(store != null ? store.businessService : "")),
),
SizedBox(height: store.businessService == ""?40.h:23.h),
if(storeList[position].productShow != null)
Container(
height: 100.h,
child: ListView.builder(
padding: EdgeInsets.zero,
itemCount: (storeList[position].productShow?.length ??0) > 3 ?3:storeList[position].productShow?.length ?? 0,
scrollDirection: Axis.horizontal,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
return GestureDetector(
onTap: () {},
child: unionGoodsItem(
storeList[position].productShow[index]),
);
},
),
),
],
))
],
),
);
}
///
List<Widget> itemServer(String businessService) {
if (businessService == null || businessService == "") return [];
var list = businessService.split(",");
return list
.map((e) => Container(
margin: EdgeInsets.only(right: 8.w),
child: Container(
decoration: BoxDecoration(
color: Color(0xFFF65720),
borderRadius: BorderRadius.circular(1),
),
padding: EdgeInsets.all(2),
margin: EdgeInsets.only(right: 10.w),
child: Text(
"$e",
style: TextStyle(
color: Colors.white,
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
),
),
),
))
.toList();
}
///
Widget unionGoodsItem(ProductShow productShow) {
return Container(
width: 74.w,
margin: EdgeInsets.only(right: 8.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
MImage(
productShow?.imgs[0] ?? "",
width: 74,
height: 74,
fit: BoxFit.cover,
radius: BorderRadius.circular(4),
errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp",
),
Padding(padding:EdgeInsets.only(top: 8.h),
child: Text(
productShow?.productName ?? "",
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFFA29E9E),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),),
],
),
);
}
//ui
Widget buildStoreItems(Store store, position) {
return Container( return Container(
margin: EdgeInsets.fromLTRB(16.w, 8.h, 16.w, 12.h), margin: EdgeInsets.fromLTRB(16.w, 8.h, 16.w, 12.h),
decoration: BoxDecoration( decoration: BoxDecoration(

95
lib/union/union_page.dart

@ -15,6 +15,7 @@ import 'package:huixiang/union/union_list.dart';
import 'package:huixiang/utils/event_type.dart'; import 'package:huixiang/utils/event_type.dart';
import 'package:huixiang/utils/location.dart'; import 'package:huixiang/utils/location.dart';
import 'package:huixiang/view_widget/my_tab.dart'; import 'package:huixiang/view_widget/my_tab.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter/rendering.dart'; import 'package:flutter/rendering.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -54,8 +55,13 @@ class UnionPageState extends State<UnionPage>
super.dispose(); super.dispose();
WidgetsBinding.instance.removeObserver(this); WidgetsBinding.instance.removeObserver(this);
if (Location.getInstance() != null && if (Location.getInstance() != null &&
Location.getInstance().aMapFlutterLocation != null) Location
Location.getInstance().aMapFlutterLocation.stopLocation(); .getInstance()
.aMapFlutterLocation != null)
Location
.getInstance()
.aMapFlutterLocation
.stopLocation();
} }
@override @override
@ -63,8 +69,14 @@ class UnionPageState extends State<UnionPage>
super.didChangeMetrics(); super.didChangeMetrics();
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
setState(() { setState(() {
print("object: ${MediaQuery.of(context).viewInsets.bottom}"); print("object: ${MediaQuery
if (MediaQuery.of(context).viewInsets.bottom == 0) { .of(context)
.viewInsets
.bottom}");
if (MediaQuery
.of(context)
.viewInsets
.bottom == 0) {
if (isKeyBoardShow) { if (isKeyBoardShow) {
isKeyBoardShow = false; isKeyBoardShow = false;
// //
@ -92,25 +104,37 @@ class UnionPageState extends State<UnionPage>
} }
startLocation() async { startLocation() async {
Location.getInstance().startLocation(context, (BaiduLocation result) async { bool powerFlag = false;
if (result != null && try {
result.latitude != null && powerFlag = await Location.getInstance().startLocation(context,
result.longitude != null) { (BaiduLocation result) async {
print("location: $result"); if (result != null &&
latLng = BMFCoordinate(result.latitude, result.longitude); result.latitude != null &&
latLng = await BMFCalculateUtils.coordConvert( result.longitude != null) {
coordinate: latLng, print("location: $result");
fromType: BMF_COORD_TYPE.BD09LL, latLng = BMFCoordinate(result.latitude, result.longitude);
toType: BMF_COORD_TYPE.COMMON); latLng = await BMFCalculateUtils.coordConvert(
await saveLatLng(latLng, result.province, result.city, result.district); coordinate: latLng,
print("union: Location result ${latLng.latitude} " fromType: BMF_COORD_TYPE.BD09LL,
"${latLng.longitude}"); toType: BMF_COORD_TYPE.COMMON);
Location.getInstance().stopLocation(); await saveLatLng(
} else { latLng, result.province, result.city, result.district);
await getLatLng(); print("union: Location result ${latLng.latitude} "
} "${latLng.longitude}");
loadFinish(showLoading: false); Location.getInstance().stopLocation();
}); } else {
await getLatLng();
}
loadFinish(showLoading: false);
});
} finally {
if (!powerFlag) {
if (await Permission.locationWhenInUse.status.isGranted) {
startLocation();
} else
loadFinish(showLoading: false);
}
}
} }
saveLatLng(BMFCoordinate latLng, province, city, district) async { saveLatLng(BMFCoordinate latLng, province, city, district) async {
@ -135,7 +159,7 @@ class UnionPageState extends State<UnionPage>
} }
queryIpInfo() async { queryIpInfo() async {
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
ApiService apiIpService = ApiService(Dio(), context: context, isIp: true); ApiService apiIpService = ApiService(Dio(), context: context, isIp: true);
IpData baseData = await apiIpService.getIpInfo().catchError((onError) {}); IpData baseData = await apiIpService.getIpInfo().catchError((onError) {});
if (baseData != null) { if (baseData != null) {
@ -145,7 +169,7 @@ class UnionPageState extends State<UnionPage>
} }
loadFinish({bool showLoading = true}) { loadFinish({bool showLoading = true}) {
if (showLoading) EasyLoading.show(status: S.current.zhengzaijiazai); if (showLoading) EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
_allKey = [GlobalKey(), GlobalKey(), GlobalKey(), GlobalKey()]; _allKey = [GlobalKey(), GlobalKey(), GlobalKey(), GlobalKey()];
setState(() {}); setState(() {});
} }
@ -221,10 +245,18 @@ class UnionPageState extends State<UnionPage>
indicatorSize: TabBarIndicatorSize.label, indicatorSize: TabBarIndicatorSize.label,
// //
tabs: <Widget>[ tabs: <Widget>[
MyTab(text: S.of(context).quanbu), MyTab(text: S
MyTab(text: S.of(context).chi), .of(context)
MyTab(text: S.of(context).he), .quanbu),
MyTab(text: S.of(context).wan), MyTab(text: S
.of(context)
.chi),
MyTab(text: S
.of(context)
.he),
MyTab(text: S
.of(context)
.wan),
], ],
), ),
), ),
@ -254,7 +286,10 @@ class UnionPageState extends State<UnionPage>
], ],
), ),
padding: padding:
EdgeInsets.only(top: MediaQuery.of(context).padding.top + 17.h), EdgeInsets.only(top: MediaQuery
.of(context)
.padding
.top + 17.h),
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: LinearGradient( gradient: LinearGradient(
begin: Alignment.topCenter, begin: Alignment.topCenter,

2
lib/view_widget/channel_dialog.dart

@ -28,7 +28,7 @@ class _ChannelDialog extends State<ChannelDialog> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
queryChannels(); queryChannels();
} }

2
lib/vip/user_vip_service_page.dart

@ -25,7 +25,7 @@ class _UserVipServicePage extends State<UserVipServicePage> with WidgetsBindingO
void initState() { void initState() {
super.initState(); super.initState();
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance.addObserver(this);
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView(); if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView();
if (Platform.isIOS) WebView.platform = CupertinoWebView(); if (Platform.isIOS) WebView.platform = CupertinoWebView();
} }

Loading…
Cancel
Save