Browse Source

Merge branch 'wu_2023_map' into wr_2023_business

# Conflicts:
#	ios/Podfile.lock
#	ios/Runner.xcodeproj/project.pbxproj
#	lib/home/home_page.dart
#	lib/main.dart
wr_2023_business
huixiang_app 1 year ago
parent
commit
2a2bebe36f
  1. 3
      README.md
  2. BIN
      assets/image/2x/icon_by_bike.webp
  3. BIN
      assets/image/2x/icon_drive.webp
  4. BIN
      assets/image/2x/icon_search.webp
  5. BIN
      assets/image/2x/icon_transit.webp
  6. BIN
      assets/image/2x/icon_walk.webp
  7. BIN
      assets/image/2x/position_sort.webp
  8. BIN
      assets/image/3x/icon_by_bike.webp
  9. BIN
      assets/image/3x/icon_drive.webp
  10. BIN
      assets/image/3x/icon_search.webp
  11. BIN
      assets/image/3x/icon_transit.webp
  12. BIN
      assets/image/3x/icon_walk.webp
  13. BIN
      assets/image/3x/position_sort.webp
  14. BIN
      assets/image/icon_by_bike.webp
  15. BIN
      assets/image/icon_drive.webp
  16. BIN
      assets/image/icon_end.png
  17. BIN
      assets/image/icon_search.webp
  18. BIN
      assets/image/icon_start.png
  19. BIN
      assets/image/icon_transit.webp
  20. BIN
      assets/image/icon_walk.webp
  21. BIN
      assets/image/position_sort.webp
  22. BIN
      assets/image/traffic_texture_smooth.png
  23. BIN
      assets/image/traffic_texture_unknown.png
  24. 14
      assets/map_style/chinese_cities.json
  25. 15
      ios/Podfile.lock
  26. 12
      ios/Runner.xcodeproj/project.pbxproj
  27. 6
      ios/Runner/Info.plist
  28. 11
      lib/address/address_map_page.dart
  29. 4
      lib/community/community_details.dart
  30. 538
      lib/home/home_page.dart
  31. 2
      lib/home/huixiang_brand_page.dart
  32. 2
      lib/home/points_mall_page.dart
  33. 2
      lib/home/welfare_exchange.dart
  34. 246
      lib/home/welfare_page.dart
  35. 40
      lib/integral/integral_page.dart
  36. 16
      lib/integral/intergra_view/integral_task.dart
  37. 2
      lib/login/login_page.dart
  38. 18
      lib/login/new_login_page.dart
  39. 6
      lib/main.dart
  40. 102
      lib/mine/mine_page.dart
  41. 6
      lib/mine/mine_shop_details.dart
  42. 151
      lib/mine/mine_shop_page.dart
  43. 908
      lib/mine/mine_shop_recharge.dart
  44. 74
      lib/mine/mine_view/mine_item.dart
  45. 16
      lib/mine/mine_view/mine_navbar.dart
  46. 93
      lib/mine/mine_view/mine_view.dart
  47. 32
      lib/mine/mine_vip/mine_attainment_page.dart
  48. 168
      lib/mine/recharge_page.dart
  49. 2
      lib/mine/scan_web.dart
  50. 2
      lib/order/order_detail_page.dart
  51. 348
      lib/order/order_history_page.dart
  52. 105
      lib/retrofit/data/ip_data.dart
  53. 159
      lib/retrofit/data/member_recharge_list.dart
  54. 749
      lib/retrofit/data/product_show.dart
  55. 24
      lib/retrofit/data/store.dart
  56. 18
      lib/retrofit/min_api.dart
  57. 45
      lib/retrofit/min_api.g.dart
  58. 101
      lib/retrofit/retrofit_api.dart
  59. 59
      lib/retrofit/retrofit_api.g.dart
  60. 2
      lib/setting/account_security_page.dart
  61. 2
      lib/setting/treaty_page.dart
  62. 2
      lib/setting/user_service_page.dart
  63. 18
      lib/settlement/settlement.dart
  64. 4
      lib/settlement/settlement_view/pay_method.dart
  65. 4
      lib/store/shop_details_page.dart
  66. 2
      lib/store/shopping/activity_prefecture_details.dart
  67. 2
      lib/store/shopping/shopping_goods_details.dart
  68. 2
      lib/store/shopping/shopping_mall_home.dart
  69. 35
      lib/store/store_order.dart
  70. 4
      lib/store/store_view/product_sku.dart
  71. 10
      lib/store/store_view/shop_goods.dart
  72. 2
      lib/store/store_view/store_header.dart
  73. 25
      lib/store/store_view/store_info.dart
  74. 1128
      lib/union/location_map_page.dart
  75. 511
      lib/union/union_list.dart
  76. 942
      lib/union/union_page.dart
  77. 372
      lib/union/union_select_city.dart
  78. 11
      lib/utils/flutter_utils.dart
  79. 191
      lib/utils/location.dart
  80. 2
      lib/view_widget/channel_dialog.dart
  81. 120
      lib/view_widget/location_tips.dart
  82. 3
      lib/view_widget/my_appbar.dart
  83. 20
      lib/view_widget/new_people_reward.dart
  84. 8
      lib/view_widget/recharge_details_dialog.dart
  85. 2
      lib/vip/user_vip_service_page.dart
  86. 18
      pubspec.lock
  87. 25
      pubspec.yaml

3
README.md

@ -85,6 +85,9 @@ samples, guidance on mobile development, and a full API reference.
推送:使用腾讯云推送 tpns 需扫码登录 (有问题同华为➕微信||或重新注册账号替换相关appKey)
友盟: wu_rong 密码:Zxc09876
https://pos.platform.lotus-wallet.com/app/ 生产环境
http://192.168.10.236:8765/app/ 测试环境
https://pos.platform.lotus-wallet.com/app/ 生产环境

BIN
assets/image/2x/icon_by_bike.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 812 B

BIN
assets/image/2x/icon_drive.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 736 B

BIN
assets/image/2x/icon_search.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
assets/image/2x/icon_transit.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 840 B

BIN
assets/image/2x/icon_walk.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 824 B

BIN
assets/image/2x/position_sort.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 596 B

BIN
assets/image/3x/icon_by_bike.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
assets/image/3x/icon_drive.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1016 B

BIN
assets/image/3x/icon_search.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
assets/image/3x/icon_transit.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
assets/image/3x/icon_walk.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
assets/image/3x/position_sort.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 666 B

BIN
assets/image/icon_by_bike.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 672 B

BIN
assets/image/icon_drive.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 622 B

BIN
assets/image/icon_end.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

BIN
assets/image/icon_search.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 724 B

BIN
assets/image/icon_start.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
assets/image/icon_transit.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 624 B

BIN
assets/image/icon_walk.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 666 B

BIN
assets/image/position_sort.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 574 B

BIN
assets/image/traffic_texture_smooth.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 980 B

BIN
assets/image/traffic_texture_unknown.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 888 B

14
assets/map_style/chinese_cities.json

@ -0,0 +1,14 @@
{
"热门城市": [
{"area": "武汉"},
{"area": "北京"},
{ "area": "郑州" }
],
"B": [
{ "area": "北京" }
],
"W": [{ "area": "武汉" }],
"Z": [
{ "area": "郑州" }
]
}

15
ios/Podfile.lock

@ -1,4 +1,5 @@
PODS:
- AEINFoundation (3.2.40)
- AFNetworking (4.0.1):
- AFNetworking/NSURLSession (= 4.0.1)
- AFNetworking/Reachability (= 4.0.1)
@ -49,8 +50,7 @@ PODS:
- image_pickers (0.0.1):
- AFNetworking
- Flutter
- SDWebImage
- ZLPhotoBrowser (~> 4.3.9)
- ZLPhotoBrowser-objc (= 1.0.4)
- mob_sharesdk (4.4.15):
- mob_sharesdk/ShareSDK (= 4.4.15)
- MOBFoundation (>= 3.2.9)
@ -240,9 +240,8 @@ PODS:
- Flutter
- webview_flutter (0.0.1):
- Flutter
- ZLPhotoBrowser (4.3.9):
- ZLPhotoBrowser/Core (= 4.3.9)
- ZLPhotoBrowser/Core (4.3.9)
- ZLPhotoBrowser-objc (1.0.4):
- SDWebImage
DEPENDENCIES:
- emoji_picker_flutter (from `.symlinks/plugins/emoji_picker_flutter/ios`)
@ -283,7 +282,7 @@ SPEC REPOS:
- TPNS-iOS
- UMCommon
- UMDevice
- ZLPhotoBrowser
- ZLPhotoBrowser-objc
EXTERNAL SOURCES:
emoji_picker_flutter:
@ -347,7 +346,7 @@ SPEC CHECKSUMS:
flutter_baidu_mapapi_utils: f6a5d23da26b0e58f1ae9908da7ba87fd48384b1
flutter_bmflocation: 1bd73181196567fe1529f765aa4f8e2615a8a3cf
fluwx: 838466d89c1ba099f6eec36c514801658371cda5
image_pickers: 4406949954a5eb4fac5ada5f13810e6419ef4467
image_pickers: 25c8916d358bc9d2707cb470ba3d57497f105773
mob_sharesdk: 0698d60b3c1549a5b0bcfdec6f407439dd2960c0
MOBFoundation: 6df2684b4db4f0f5bd71b0623f82e11271bf7ac8
number_precision: 26fa2be2212f9d1429f92d667d6b0aa4df0058d8
@ -370,7 +369,7 @@ SPEC CHECKSUMS:
video_player_avfoundation: 6d971a232d72e6ee25368378d48a079dea01f1cf
wakelock: d0fc7c864128eac40eba1617cb5264d9c940b46f
webview_flutter: 5fb4def2bbd4339889ee14d045b605cefc5bc232
ZLPhotoBrowser: 02b3569b8f702d2e153e8fdb1f6b32fef3a2867c
ZLPhotoBrowser-objc: c7657d3bc85ae231884e058d0e3638f619164736
PODFILE CHECKSUM: f8bac8842dd5d4f36a3709c129ae7a2ccd5be619

12
ios/Runner.xcodeproj/project.pbxproj

@ -617,7 +617,7 @@
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 14;
DEVELOPMENT_TEAM = YF3Q8DVP52;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
@ -668,7 +668,7 @@
"$(PROJECT_DIR)/baidu",
"$(PROJECT_DIR)/Runner/baidu",
);
MARKETING_VERSION = 3.2.19;
MARKETING_VERSION = 3.2.20;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = (
"$(inherited)",
@ -820,7 +820,7 @@
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 14;
DEVELOPMENT_TEAM = YF3Q8DVP52;
ENABLE_BITCODE = NO;
ENABLE_TESTABILITY = YES;
@ -872,7 +872,7 @@
"$(PROJECT_DIR)/baidu",
"$(PROJECT_DIR)/Runner/baidu",
);
MARKETING_VERSION = 3.2.19;
MARKETING_VERSION = 3.2.20;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = (
"$(inherited)",
@ -915,7 +915,7 @@
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 14;
DEVELOPMENT_TEAM = YF3Q8DVP52;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
@ -966,7 +966,7 @@
"$(PROJECT_DIR)/baidu",
"$(PROJECT_DIR)/Runner/baidu",
);
MARKETING_VERSION = 3.2.19;
MARKETING_VERSION = 3.2.20;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = (
"$(inherited)",

6
ios/Runner/Info.plist

@ -177,5 +177,11 @@
<array>
<string>location</string>
</array>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>iosamap</string>
<string>qqmap</string>
<string>baidumap</string>
</array>
</dict>
</plist>

11
lib/address/address_map_page.dart

@ -80,6 +80,9 @@ class _AddressMapPage extends State<AddressMapPage> {
BMFMapOptions(
center: latLng,
zoomLevel: 15,
showZoomControl: false,
showMapScaleBar: false,
rotateEnabled: false,
),
);
}
@ -339,6 +342,9 @@ class _AddressMapPage extends State<AddressMapPage> {
double.tryParse(value.getString("longitude")),
),
zoomLevel: 15,
showZoomControl: false,
showMapScaleBar: false,
rotateEnabled: false,
),
);
}
@ -362,7 +368,10 @@ class _AddressMapPage extends State<AddressMapPage> {
child: BMFMapWidget(
mapOptions: BMFMapOptions(
center: BMFCoordinate(30.553111, 114.342366),
zoomLevel: 12,
zoomLevel: 15,
showZoomControl: false,
showMapScaleBar: false,
rotateEnabled: false,
),
onBMFMapCreated: onMapCreated,
// onCameraMoveEnd: (cameraPosition) {

4
lib/community/community_details.dart

@ -100,7 +100,7 @@ class _CommunityDetails extends State<CommunityDetails>
void initState() {
super.initState();
// comunity = widget.arguments["comment"];
EasyLoading.show(status: S.current.zhengzaijiazai);
EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
businessId = widget.arguments["businessId"];
WidgetsBinding.instance.addObserver(this);
commentFocus.addListener(_focusNodeListener);
@ -399,7 +399,7 @@ class _CommunityDetails extends State<CommunityDetails>
///
_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();
if (apiService == null)
apiService = ApiService(

538
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:huixiang/generated/l10n.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/top_selling_list.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/home_rank.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/retrofit_api.dart';
import 'package:huixiang/utils/event_type.dart';
@ -44,6 +42,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../retrofit/data/user_info.dart';
import '../utils/flutter_utils.dart';
import '../view_widget/channel_dialog.dart';
import '../view_widget/custom_image.dart';
import 'home_view/happy_help_farmers.dart';
import 'home_view/shortcut_operation.dart';
@ -54,7 +53,8 @@ class HomePage extends StatefulWidget {
final List<FirstLoginCouponList> firstLoginCouponList;
HomePage(Key key, this.changeTab,
{this.invite, this.interviewCouponList, this.firstLoginCouponList}): super(key: key);
{this.invite, this.interviewCouponList, this.firstLoginCouponList})
: super(key: key);
@override
State<StatefulWidget> createState() {
@ -64,6 +64,32 @@ class HomePage extends StatefulWidget {
class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
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<BannerData> activityBannerData = [];
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;
DioErrorType dioErrorType;
@override
void initState() {
@ -74,8 +100,11 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
setState(() {});
}
});
queryActivity();
_onRefresh();
_onRefresh(isFirstIn: true);
if (showInvite) {
inviteShowAlertDialog(widget.invite, widget.interviewCouponList[0]);
showInvite = false;
}
if ((widget.invite ?? "") != "" ||
widget.interviewCouponList != null &&
@ -84,7 +113,6 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
//
// if (widget.firstLoginCouponList != null && widget.firstLoginCouponList.length > 0)
// showNew = true;
}
///
@ -102,9 +130,12 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
posterShowAlertDialog(ActivityPos activityPos, firstLoginCouponList) {
var today = DateTime.now().day;
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;
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);
//
showDialog(
@ -127,89 +158,69 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
);
}
final SwiperController controller = SwiperController();
String categoryId;
int pageNum = 1;
int couponPageNum = 1;
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 = [];
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);
///banner
queryBanner() async {
try {
BaseData<PageInfo<BannerData>> baseData = await apiService.queryBanner({
"model": {"type": "HOME_PAGE"},
}).catchError((onError) {
dioErrorType = onError.type;
});
if (baseData != null && baseData.isSuccess) {
bannerData = baseData.data.records;
// if (bannerData.length > 0) swiperController.move(0, animation: false);
}
} finally {
addLoadCount();
}
}
final SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(Dio(),
context: context, token: value.getString('token'), showLoading: false);
///banner
queryActivityBanner() async {
try {
BaseData<PageInfo<BannerData>> baseData = await apiService.queryBanner({
"model": {"type": "HOME_STORE_PAGE"},
}).catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
activityBannerData = baseData.data.records;
}
} finally {
addLoadCount();
}
}
final BaseData brand =
await apiService.queryHomeBrand().catchError((onError) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type),
addLoadCount() {
_loadCount += 1;
if (_loadCount == 7) {
_loadCount = 0;
EasyLoading.dismiss();
if (dioErrorType == null)
refreshController.refreshCompleted();
else {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(dioErrorType),
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);
if (mounted) setState(() {});
}
}
final BaseData<HomeRank> rank = await apiService.recommendRank().catchError((onError) {});
///
queryRecommendRank() async {
try {
BaseData<HomeRank> rank =
await apiService.recommendRank().catchError((onError) {});
if (rank != null && rank.isSuccess) {
homeRank = rank.data;
}
final BaseData<PageInfo<Goods>> goodsData = await apiService.creditGoods({
"orderDesc": true,
"orderType": 1,
"pageNum": 1,
"pageSize": 100,
"state": 1
}).catchError((onError) {
refreshController.refreshFailed();
});
if (goodsData != null && goodsData.isSuccess) {
gooods.clear();
gooods.addAll(goodsData.data.list);
} finally {
addLoadCount();
}
}
///
queryGoodsCategory() async {
try {
BaseData<PageInfo<GoodsCategory>> dataCategory =
await apiService.goodsCategory({
"current": 1,
@ -218,11 +229,7 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
"order": "descending",
"size": 20,
"sort": "sortOrder"
}).catchError((onError) {
refreshController.loadFailed();
refreshController.refreshFailed();
});
}).catchError((onError) {});
if (dataCategory != null &&
dataCategory.isSuccess &&
dataCategory.data != null &&
@ -232,73 +239,52 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
gooodsCategorys.add(GoodsCategory(name: S.of(context).quanbu));
gooodsCategorys.addAll(dataCategory.data.records);
}
} finally {
addLoadCount();
}
}
///
queryPointsProductList(bool isRefresh) async {
try {
if (!isRefresh)
EasyLoading.show(
status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
var param = {
"categoryId": categoryId ?? "",
"orderDesc": orderDesc,
"orderType": orderType,
"pageNum": pageNum,
"pageNum": 1,
"pageSize": 100,
"state": 1
};
BaseData<PageInfo<Goods>> pageGoods =
await apiService.creditGoods(param).catchError((onError) {
refreshController.loadFailed();
refreshController.refreshFailed();
});
EasyLoading.dismiss();
await apiService.creditGoods(param).catchError((onError) {});
if (pageGoods != null && pageGoods.isSuccess) {
if (pageNum == 1) {
goods.clear();
}
goods.addAll(pageGoods.data.list);
refreshController.refreshCompleted();
refreshController.loadComplete();
if (pageGoods.data.pageNum == pageGoods.data.pages) {
refreshController.loadNoData();
} else {
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();
goods = pageGoods.data.list;
}
} finally {
if (isRefresh)
addLoadCount();
else {
EasyLoading.dismiss();
if (showInvite) {
inviteShowAlertDialog(widget.invite, widget.interviewCouponList[0]);
showInvite = false;
setState(() {});
}
}
//
// if (showNew) {
// newShowAlertDialog(widget.firstLoginCouponList);
// showNew = false;
// }
}
///
queryUserBalance() async {
try {
BaseData<UserInfo> baseData =
await apiService.queryInfo().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
userInfo = baseData.data;
mRaiseMoney = double.tryParse(userInfo.raiseMoney);
if (mounted) setState(() {});
}
} finally {
addLoadCount();
}
}
@ -326,18 +312,8 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
///
queryActivity() async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
showLoading: true
);
}
BaseData<ActivityPos> baseData =
await apiService.appPopup().catchError((onError) {
});
await apiService.appPopup().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
if (baseData.data?.enabled ?? true)
posterShowAlertDialog(baseData.data, widget.firstLoginCouponList);
@ -346,15 +322,8 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
///
queryWiped(memberCouponId) async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData baseData = await apiService.wiped(memberCouponId).catchError((onError) {});
BaseData baseData =
await apiService.wiped(memberCouponId).catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
SmartDialog.showToast("核销成功", alignment: Alignment.center);
} else {
@ -363,47 +332,43 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
}
queryCoupon() async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
try {
BaseData<PageInfo<Coupon>> baseData = await apiService.queryCoupon({
"centre": true,
"pageNum": couponPageNum,
"pageNum": 1,
"pageSize": 10,
"searchKey": "",
"state": 0
}).catchError((onError) {
refreshController.refreshFailed();
refreshController.loadFailed();
});
if (couponPageNum == 1) coupons.clear();
}).catchError((onError) {});
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;
coupons = baseData.data.list;
}
setState(() {});
}
else {
refreshController.refreshFailed();
refreshController.loadFailed();
} finally {
addLoadCount();
}
}
_onRefresh() async{
await queryHome();
await queryUserBalance();
_onRefresh({bool isFirstIn = false}) async {
EasyLoading.show(
status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
dioErrorType = null;
if (isFirstIn) queryActivity();
queryBanner();
queryActivityBanner();
queryRecommendRank();
queryGoodsCategory();
queryPointsProductList(true);
queryUserBalance();
// queryMsgStats();
await queryCoupon();
queryCoupon();
}
@override
@ -412,8 +377,6 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
if (refreshController != null) refreshController.dispose();
}
final RefreshController refreshController = RefreshController();
@override
Widget build(BuildContext context) {
super.build(context);
@ -502,19 +465,13 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
enablePullUp: false,
header: MyHeader(),
physics: BouncingScrollPhysics(),
onRefresh: () {
setState(() {_onRefresh();
});
},
onRefresh: _onRefresh,
child: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(),
child: FutureBuilder(
future: queryHome(),
builder: (context, snapshot) {
return Column(
child: Column(
children: [
///banner
HomeBanner(bannerData, controller),
homeBanner(),
///
UnionEntry((int jpIndex) {
@ -527,6 +484,7 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
}),
///广
if(activityBannerData.length > 0)
spread(),
// ///
@ -541,7 +499,8 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
DiscountZone(coupons),
///-
if(homeRank != null && homeRank.commodityZone.length != 0)
if (homeRank != null &&
homeRank.commodityZone.length != 0)
HomeRecommendGoods(homeRank),
if((homeRank?.commodityZone?.length ??0) == 0)
@ -555,7 +514,8 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
WelfareCore(),
///
if(homeRank != null && homeRank.commodityList.length != 0)
if (homeRank != null &&
homeRank.commodityList.length != 0)
TopSellingList(homeRank),
// ///
@ -576,12 +536,11 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
(orderType, orderDesc) {
this.orderType = orderType;
this.orderDesc = orderDesc;
setState(() {});
queryPointsProductList(false);
},
(index) {
categoryId = gooodsCategorys[index].id;
pageNum = 1;
setState(() {});
queryPointsProductList(false);
},
),
@ -593,8 +552,7 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
},
),
],
);})
),
)),
),
),
),
@ -605,11 +563,105 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
);
}
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(
width: double.infinity,
// margin: EdgeInsets.symmetric(horizontal:14.w),
height: 85.h,
child: Swiper(
child: activityBannerData != null && activityBannerData.isNotEmpty
? Swiper(
pagination: SwiperPagination(
alignment: Alignment.bottomCenter,
margin: EdgeInsets.only(top: 5.h),
@ -625,37 +677,77 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
duration: 1000,
autoplayDelay: 2000,
itemBuilder: (context, position) {
return GestureDetector(
return InkWell(
onTap: () {
if(position == 0){
Navigator.of(context).pushNamed('/router/invite_friends');
}else if(position == 1){
Navigator.of(context).pushNamed('/router/trading_card_page');
}
spreadBannerClick(activityBannerData[position]);
},
child: Container(
margin: EdgeInsets.symmetric(horizontal: 14.w),
child: ClipRRect(
child:Image.asset(
spreadItem[position],
width:double.infinity,
fit: BoxFit.fill,
height:double.infinity,
),
borderRadius: BorderRadius.circular(6.w),
child: MImage(
activityBannerData[position].imgUrl,
fit: BoxFit.cover,
radius: BorderRadius.circular(6),
errorSrc: "assets/image/default_2_1.webp",
fadeSrc: "assets/image/default_2_1.webp",
),
),
);
},
itemCount:2,
itemCount: activityBannerData.length,
)
: Image.asset(
"assets/image/default_2_1.webp",
fit: BoxFit.cover,
),
);
}
final List<String> spreadItem = [
"assets/image/welfare_spread.webp",
"assets/image/welfare_yz.webp",
];
/// contentType 0123,4:,5:7
spreadBannerClick(BannerData activityBannerData) async {
switch (activityBannerData.contentType) {
case 1:
Navigator.of(context).pushNamed('/router/integral_store_page',
arguments: {"goodsId": activityBannerData.content});
break;
case 2:
Navigator.of(context).pushNamed('/router/web_page', arguments: {
"activityId": activityBannerData.content,
});
break;
case 3:
Navigator.of(context).pushNamed('/router/web_page', arguments: {
"articleId": activityBannerData.content,
});
break;
case 4:
String router = activityBannerData.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": activityBannerData.content,
});
break;
case 7:
String params = activityBannerData.content
.substring(activityBannerData.content.indexOf("?") + 1);
Map map = jsonDecode(params);
Navigator.of(context).pushNamed(
activityBannerData.content
.substring(0, activityBannerData.content.indexOf("?")),
arguments: map);
break;
}
}
///
toScan() async {
@ -685,16 +777,20 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
///
activityShowAlertDialog(result.toString());
return;
}if(result.toString().contains("type\":\"wiped")){
}
if (result.toString().contains("type\":\"wiped")) {
///
queryWiped(jsonDecode(result.toString())["memberCouponId"]);
return;
}
// String result = await scanner.scan();
Uri uri = Uri.parse(result);
String tableId = uri.queryParameters["tableId"] ?? uri.queryParameters["table_id"];
String tenantCode = uri.queryParameters["tenantCode"] ?? uri.queryParameters["tenant_code"];
String shopId = uri.queryParameters["shopId"] ?? uri.queryParameters["store_id"];
String tableId =
uri.queryParameters["tableId"] ?? uri.queryParameters["table_id"];
String tenantCode = uri.queryParameters["tenantCode"] ??
uri.queryParameters["tenant_code"];
String shopId =
uri.queryParameters["shopId"] ?? uri.queryParameters["store_id"];
if (tableId != null &&
tableId != "" &&
tenantCode != null &&

2
lib/home/huixiang_brand_page.dart

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

2
lib/home/points_mall_page.dart

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

2
lib/home/welfare_exchange.dart

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

246
lib/home/welfare_page.dart

@ -46,26 +46,16 @@ class _WelfarePage extends State<WelfarePage> {
int type = 1;
int couponIndex = 0;
int swiperIndex = 0;
int _loadCount = 0;
@override
void initState() {
super.initState();
SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(), context: context, token: value.getString("token")),
_onRefresh(),
});
_onRefresh();
}
queryGoods() async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
try {
var param = {
"categoryId": categoryId ?? "",
"orderDesc": orderDesc,
@ -81,27 +71,16 @@ class _WelfarePage extends State<WelfarePage> {
});
EasyLoading.dismiss();
if (pageGoods != null && pageGoods.isSuccess) {
setState(() {
goods.clear();
goods.addAll(pageGoods.data.list);
});
refreshController.refreshCompleted();
refreshController.loadComplete();
} else {
refreshController.loadFailed();
refreshController.refreshFailed();
}
} finally {
addLoadCount();
}
}
queryCoupon() async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
try{
BaseData<PageInfo<Coupon>> baseData = await apiService.queryCoupon({
"centre": true,
"pageNum": 1,
@ -111,8 +90,6 @@ class _WelfarePage extends State<WelfarePage> {
}).catchError((onError) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type),
alignment: Alignment.center);
refreshController.refreshFailed();
refreshController.loadFailed();
});
coupons.clear();
coupon.clear();
@ -120,26 +97,40 @@ class _WelfarePage extends State<WelfarePage> {
coupons.addAll(baseData.data.list);
for (var i = 0; i < coupons.length ~/ 3 + 1; i++) {
List<Coupon> con = [];
con = coupons.skip(i*3).take((i*3<coupons.length)?3:(coupons.length - (i*3))).toList();
con = coupons
.skip(i * 3)
.take((i * 3 < coupons.length) ? 3 : (coupons.length - (i * 3)))
.toList();
coupon.add(con);
}
if (coupon.length > 0 && coupon[coupon.length - 1].isEmpty)
coupon.removeAt(coupon.length - 1);
refreshController.refreshCompleted();
refreshController.loadComplete();
setState(() {});
} else {
refreshController.refreshFailed();
refreshController.loadFailed();
}}finally{
addLoadCount();
}
}
_onRefresh(){
_onRefresh() async{
EasyLoading.show(status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService =
ApiService(Dio(), context: context, token: value.getString("token"));
}
queryGoods();
queryCoupon();
}
addLoadCount() {
_loadCount += 1;
if (_loadCount == 2) {
_loadCount = 0;
EasyLoading.dismiss();
if (refreshController.isRefresh) refreshController.refreshCompleted();
if (mounted) setState(() {});
}
}
@override
Widget build(BuildContext context) {
@ -157,7 +148,10 @@ class _WelfarePage extends State<WelfarePage> {
width: double.infinity,
height: 236.h,
),
Expanded(child: Container(color: Colors.white,))
Expanded(
child: Container(
color: Colors.white,
))
],
),
Scaffold(
@ -180,18 +174,15 @@ class _WelfarePage extends State<WelfarePage> {
return MyFooter(mode);
},
),
onRefresh:(){
setState(() {
_onRefresh();
});
},
onRefresh:_onRefresh,
physics: BouncingScrollPhysics(),
scrollController: ScrollController(),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(6),
topRight: Radius.circular(6),),
topRight: Radius.circular(6),
),
color: Colors.white,
boxShadow: [
BoxShadow(
@ -216,9 +207,7 @@ class _WelfarePage extends State<WelfarePage> {
padding: EdgeInsets.only(left: 14, right: 14),
child: Column(
children: [
inviteFriends(),
benefitExchange(),
],
),
@ -242,7 +231,8 @@ class _WelfarePage extends State<WelfarePage> {
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(6),
topRight: Radius.circular(6),),
topRight: Radius.circular(6),
),
color: Colors.white,
boxShadow: [
BoxShadow(
@ -259,8 +249,7 @@ class _WelfarePage extends State<WelfarePage> {
children: [
Padding(
padding: EdgeInsets.symmetric(horizontal: 17.w, vertical: 16.h),
child:
Row(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
@ -282,13 +271,14 @@ class _WelfarePage extends State<WelfarePage> {
),
],
)),
coupon.length == 0?
NoDataView(
coupon.length == 0
? NoDataView(
src: "assets/image/ka.webp",
isShowBtn: false,
text: S.of(context).haimeiyouyouhuiquankeyilingqu,
fontSize: 16.sp,
): AspectRatio(
)
: AspectRatio(
aspectRatio: 1.10,
child: Swiper(
onIndexChanged: (it) {
@ -322,19 +312,19 @@ class _WelfarePage extends State<WelfarePage> {
),
)
],
)
);
));
}
Widget weekList(List<Coupon> cops) {
return Expanded(
child:(cops == null && cops.length == 0)?
NoDataView(
child: (cops == null && cops.length == 0)
? NoDataView(
src: "assets/image/ka.webp",
isShowBtn: false,
text: S.of(context).haimeiyouyouhuiquankeyilingqu,
fontSize: 16.sp,
):ListView.builder(
)
: ListView.builder(
padding: EdgeInsets.zero,
itemCount: cops.length,
scrollDirection: Axis.vertical,
@ -342,12 +332,12 @@ class _WelfarePage extends State<WelfarePage> {
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
},
onTap: () {},
child: weekCoupon(cops[position]),
);
},
),);
),
);
}
///
@ -367,7 +357,8 @@ class _WelfarePage extends State<WelfarePage> {
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(child: Container(
Expanded(
child: Container(
margin: EdgeInsets.only(top: 12, bottom: 12),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
@ -383,31 +374,37 @@ class _WelfarePage extends State<WelfarePage> {
color: Color(0xFF0D0D0D),
),
),
SizedBox(height: 12,),
(cop.status == 0)?
Text(
SizedBox(
height: 12,
),
(cop.status == 0)
? Text(
"发放时间: ${cop?.publishStartTime ?? ""}",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: cop.status == 3 ? Color(0xFFB3B3B3) :Color(0xFF4D4D4D),
color: cop.status == 3
? Color(0xFFB3B3B3)
: Color(0xFF4D4D4D),
),
):Text(
)
: Text(
"有效期至 ${cop?.useEndTime ?? ""}",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: cop.status == 3 ? Color(0xFFB3B3B3) :Color(0xFF4D4D4D),
color: cop.status == 3
? Color(0xFFB3B3B3)
: Color(0xFF4D4D4D),
),
)
],
),
)),
Column(
// mainAxisAlignment: MainAxisAlignment.start,
// crossAxisAlignment: CrossAxisAlignment.end,
@ -441,7 +438,8 @@ class _WelfarePage extends State<WelfarePage> {
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.medium,
color: cop.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
color:
cop.status == 3 ? Color(0xFFB3B3B3) : Color(0xff32A060),
),
),
SizedBox(
@ -456,16 +454,15 @@ class _WelfarePage extends State<WelfarePage> {
style: TextStyle(
fontSize: 24.sp,
fontWeight: MyFontWeight.semi_bold,
color: cop.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
color:
cop.status == 3 ? Color(0xFFB3B3B3) : Color(0xff32A060),
),
),
],
),
Text(
S.of(context).manyuankeyong(coupon != null
? ("${cop.fullAmount}" ?? "0")
.toString()
: ""),
S.of(context).manyuankeyong(
coupon != null ? ("${cop.fullAmount}" ?? "0").toString() : ""),
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold,
@ -489,7 +486,8 @@ class _WelfarePage extends State<WelfarePage> {
style: TextStyle(
fontSize: 22.sp,
fontWeight: MyFontWeight.semi_bold,
color:cop.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
color:
cop.status == 3 ? Color(0xFFB3B3B3) : Color(0xff32A060),
),
),
],
@ -520,7 +518,8 @@ class _WelfarePage extends State<WelfarePage> {
style: TextStyle(
fontSize: 26.sp,
fontWeight: MyFontWeight.semi_bold,
color: cop.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
color:
cop.status == 3 ? Color(0xFFB3B3B3) : Color(0xff32A060),
),
),
],
@ -551,20 +550,24 @@ class _WelfarePage extends State<WelfarePage> {
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.medium,
color: cop.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
color:
cop.status == 3 ? Color(0xFFB3B3B3) : Color(0xff32A060),
),
),
SizedBox(
height: 4.h,
),
Text(
cop.limitAmount != "0.00"?(coupon != null
cop.limitAmount != "0.00"
? (coupon != null
? "${AppUtils.calculateDouble(double.tryParse(cop.limitAmount) ?? 0)}"
: "") :"",
: "")
: "",
style: TextStyle(
fontSize: 24.sp,
fontWeight: FontWeight.bold,
color: cop.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
color:
cop.status == 3 ? Color(0xFFB3B3B3) : Color(0xff32A060),
),
),
],
@ -582,14 +585,17 @@ class _WelfarePage extends State<WelfarePage> {
textBaseline: TextBaseline.alphabetic,
children: [
Text(
cop.discountPercent != 0 ? (coupon != null
cop.discountPercent != 0
? (coupon != null
? "${(cop.discountPercent / 10.0 >= 10) ? 10 : cop.discountPercent / 10.0}" ??
"0"
: ""):"",
: "")
: "",
style: TextStyle(
fontSize: 30.sp,
fontWeight: MyFontWeight.semi_bold,
color: cop.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
color:
cop.status == 3 ? Color(0xFFB3B3B3) : Color(0xff32A060),
),
),
SizedBox(
@ -600,7 +606,8 @@ class _WelfarePage extends State<WelfarePage> {
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
color: cop.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
color:
cop.status == 3 ? Color(0xFFB3B3B3) : Color(0xff32A060),
),
),
],
@ -642,9 +649,8 @@ class _WelfarePage extends State<WelfarePage> {
child: InkWell(
onTap: () {
if (cop.bizType == 5 || cop.bizType == 3) {
Navigator.of(context).pushNamed(
'/router/write_off_page',
arguments: {
Navigator.of(context)
.pushNamed('/router/write_off_page', arguments: {
"couponId": cop.id,
"coupon": jsonEncode(cop.toJson()),
});
@ -723,7 +729,9 @@ class _WelfarePage extends State<WelfarePage> {
color: Color(0xFF0D0D0D),
),
),
SizedBox(height: 12,),
SizedBox(
height: 12,
),
GestureDetector(
onTap: () {
Navigator.of(context).pushNamed('/router/invite_friends');
@ -760,15 +768,16 @@ class _WelfarePage extends State<WelfarePage> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(child:
Text(
Expanded(
child: Text(
S.of(context).fuliduihuan,
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.bold,
color: Color(0xFF0D0D0D),
),
),),
),
),
Text(
S.of(context).gengduo,
style: TextStyle(
@ -785,8 +794,11 @@ class _WelfarePage extends State<WelfarePage> {
],
),
),
SizedBox(height: 12,),
(goods == null || goods.length == 0)? NoDataView(
SizedBox(
height: 12,
),
(goods == null || goods.length == 0)
? NoDataView(
src: "assets/image/xiao_fei.webp",
isShowBtn: false,
text: "暂无商品可兑换",
@ -811,8 +823,8 @@ class _WelfarePage extends State<WelfarePage> {
//Widget之间间距
mainAxisSpacing: 16.w,
//Widget宽高比例 0.59
childAspectRatio:
200 / (285 / 2 + (285 / 2) * AppUtils.textScale(context)),
childAspectRatio: 200 /
(285 / 2 + (285 / 2) * AppUtils.textScale(context)),
),
itemBuilder: (context, index) {
return GestureDetector(
@ -871,10 +883,8 @@ class _WelfarePage extends State<WelfarePage> {
margin: EdgeInsets.only(
right: 12.w,
top: 10.h,
),padding: EdgeInsets.only(
bottom: 8,
left: 8
),
padding: EdgeInsets.only(bottom: 8, left: 8),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
@ -913,14 +923,20 @@ class _WelfarePage extends State<WelfarePage> {
}
String pointPrice(Goods goodsPrice) {
if(goodsPrice == null)
return "";
if (goodsPrice == null) return "";
if (goodsPrice?.oneBean != null && goodsPrice?.oneBean != "0") {
return "${goodsPrice?.oneBean}印章";
} else if (goodsPrice?.onePrice != null && goodsPrice?.onePrice != "0") {
return S.of(context).jifen_(goodsPrice?.onePrice);
}else if((goodsPrice?.onePrice == null || goodsPrice?.onePrice == "0") && ((goodsPrice?.price != null && goodsPrice?.price != "0") || (goodsPrice?.money != null && goodsPrice?.money != "0.00"))){
return (goodsPrice?.price== "0"|| goodsPrice?.price == null ? "" : S.of(context).jifen_(goodsPrice?.price)) + (goodsPrice?.money== "0"|| goodsPrice?.money == null ? "" : " + ${AppUtils.calculateDouble(double.tryParse(goodsPrice?.money) ?? 0)}");
} else if ((goodsPrice?.onePrice == null || goodsPrice?.onePrice == "0") &&
((goodsPrice?.price != null && goodsPrice?.price != "0") ||
(goodsPrice?.money != null && goodsPrice?.money != "0.00"))) {
return (goodsPrice?.price == "0" || goodsPrice?.price == null
? ""
: S.of(context).jifen_(goodsPrice?.price)) +
(goodsPrice?.money == "0" || goodsPrice?.money == null
? ""
: " + ${AppUtils.calculateDouble(double.tryParse(goodsPrice?.money) ?? 0)}");
} else if (goodsPrice.oneMoney != null && goodsPrice.oneMoney != "0.00") {
return "${AppUtils.calculateDouble(double.tryParse(goodsPrice.oneMoney) ?? 0)}";
}
@ -929,7 +945,9 @@ class _WelfarePage extends State<WelfarePage> {
///
Widget activityTask() {
return Container(
margin: EdgeInsets.only(bottom:20.h,),
margin: EdgeInsets.only(
bottom: 20.h,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
@ -956,7 +974,9 @@ class _WelfarePage extends State<WelfarePage> {
),
],
),
SizedBox(height: 12.h,),
SizedBox(
height: 12.h,
),
ListView.builder(
padding: EdgeInsets.zero,
itemCount: 6,
@ -965,8 +985,7 @@ class _WelfarePage extends State<WelfarePage> {
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
},
onTap: () {},
child: taskItem(),
);
},
@ -998,7 +1017,8 @@ class _WelfarePage extends State<WelfarePage> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(child:Column(
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -1017,7 +1037,8 @@ class _WelfarePage extends State<WelfarePage> {
fontWeight: MyFontWeight.regular,
color: Color(0xFF4D4D4D),
),
), Text(
),
Text(
"购买任意3杯新品",
style: TextStyle(
fontSize: 10.sp,
@ -1026,7 +1047,8 @@ class _WelfarePage extends State<WelfarePage> {
),
),
],
),),
),
),
Container(
width: 55.w,
height: 21.h,
@ -1037,7 +1059,8 @@ class _WelfarePage extends State<WelfarePage> {
colors: [
Color(0xFFFF2700),
Color(0xFFFF4F00),
],),
],
),
// border: Border.all(color: Colors.white,width: 0.5),
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(3),
@ -1056,5 +1079,4 @@ class _WelfarePage extends State<WelfarePage> {
),
);
}
}

40
lib/integral/integral_page.dart

@ -19,10 +19,10 @@ import 'package:huixiang/view_widget/sign_in_widget.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../utils/flutter_utils.dart';
import 'intergra_view/integral_task.dart';
class IntegralPage extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _IntegralPage();
@ -51,8 +51,12 @@ class _IntegralPage extends State<IntegralPage> {
);
userInfo = UserInfo.fromJson(jsonDecode(value.getString("user")));
BaseData<List<Rank>> rankData = await apiService.rankList()
.catchError((onError) {});
BaseData<List<Rank>> rankData =
await apiService.rankList().catchError((onError) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type),
alignment: Alignment.center);
refreshController.refreshFailed();
});
if (rankData != null && rankData.isSuccess) {
ranks.clear();
ranks.addAll(rankData.data);
@ -112,7 +116,9 @@ class _IntegralPage extends State<IntegralPage> {
Scaffold(
backgroundColor: Colors.transparent,
appBar: MyAppBar(
exit: (){Navigator.of(context).pop(signInfo.todayHasSignin ?? false);},
exit: () {
Navigator.of(context).pop(signInfo?.todayHasSignin ?? false);
},
background: Colors.transparent,
leadingColor: Colors.white,
title: "",
@ -124,7 +130,9 @@ class _IntegralPage extends State<IntegralPage> {
margin: EdgeInsets.only(right: 16.w),
child: GestureDetector(
onTap: () {
Navigator.of(context).pushNamed('/router/integral_detailed_page',arguments:{"titleType":2});
Navigator.of(context).pushNamed(
'/router/integral_detailed_page',
arguments: {"titleType": 2});
},
child: Text(
S.of(context).mingxi,
@ -141,7 +149,7 @@ class _IntegralPage extends State<IntegralPage> {
controller: refreshController,
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
header: MyHeader(color: Colors.white,),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
@ -163,9 +171,19 @@ class _IntegralPage extends State<IntegralPage> {
return Column(
children: [
/// VIP等级显示
IntegralVip(rankLevel, signInfo, userInfo,"${ (signInfo?.signInList?.length ) ?? "0"}",
((signInfo?.rewardList != null && signInfo.rewardList.length > (signInfo?.signInList?.length ?? 0)) ?
signInfo.rewardList[signInfo?.signInList?.length ?? 0]:0).toString()),
IntegralVip(
rankLevel,
signInfo,
userInfo,
"${(signInfo?.signInList?.length) ?? "0"}",
((signInfo?.rewardList != null &&
signInfo.rewardList.length >
(signInfo?.signInList?.length ??
0))
? signInfo.rewardList[
signInfo?.signInList?.length ?? 0]
: 0)
.toString()),
///
InForPoints(signInfo, _signIn),
@ -191,7 +209,9 @@ class _IntegralPage extends State<IntegralPage> {
SmartDialog.showToast("今日已签到了", alignment: Alignment.center);
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) {});
if (baseData != null && baseData.isSuccess) {
setState(() {});

16
lib/integral/intergra_view/integral_task.dart

@ -6,6 +6,8 @@ import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/round_button.dart';
import '../../view_widget/no_data_view.dart';
class IntegralTask extends StatefulWidget {
final SignInfo signInfo;
@ -57,7 +59,10 @@ class _IntegralTask extends State<IntegralTask> {
),
Expanded(
child: Container(
child: ListView.builder(
child: (widget.signInfo != null &&
widget.signInfo.taskList != null &&
widget.signInfo.taskList.length > 0)
? ListView.builder(
padding: EdgeInsets.only(left: 10.w, top: 20.h),
physics: BouncingScrollPhysics(),
// loop: false,
@ -78,7 +83,14 @@ class _IntegralTask extends State<IntegralTask> {
widget.signInfo.taskList != null &&
widget.signInfo.taskList.length > 0)
? widget.signInfo.taskList.length
: 0),
: 0)
: NoDataView(
src: "assets/image/xiao_fei.webp",
isShowBtn: false,
text: "暂无任务可做~",
fontSize: 16.sp,
margin: EdgeInsets.only(left: 60.w, right: 60.w),
),
),
flex: 1,
)

2
lib/login/login_page.dart

@ -326,7 +326,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
"mobile": mobile,
"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) {
print(error.message);
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() {
super.initState();
isLogin();
queryChannels();
}
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) {
print(error.message);
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
@ -80,7 +72,6 @@ class _NewLoginPage extends State<NewLoginPage> {
if (baseData != null && baseData.isSuccess) {
channelsList = baseData.data;
setState((){});
EasyLoading.dismiss();
} else {
if (baseData?.msg != null)
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
@ -241,7 +232,7 @@ class _NewLoginPage extends State<NewLoginPage> {
"areaCode": area,
"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) {
print(error.message);
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
@ -262,11 +253,11 @@ class _NewLoginPage extends State<NewLoginPage> {
"interviewCouponList": userInfo.interviewCouponList,
"firstLoginCouponList": userInfo.firstLoginCouponList
});
EasyLoading.dismiss();
} else {
if (value.msg != null)
SmartDialog.showToast(value?.msg, alignment: Alignment.center);
}
EasyLoading.dismiss();
}
saveUserJson(userJson) {
@ -295,11 +286,10 @@ class _NewLoginPage extends State<NewLoginPage> {
sharedPreferences.getString("mobile") == "13800138000";
Navigator.of(context).popAndPushNamed('/router/main_page');
} else {
initController();
apiService = ApiService(Dio(), context: context);
initController();
isShowLogin = true;
setState(() {});
queryChannels();
}
}

6
lib/main.dart

@ -73,6 +73,7 @@ import 'package:huixiang/settlement/settlement.dart';
import 'package:huixiang/store/store_view/product_meals_sku.dart';
import 'package:huixiang/test_page.dart';
import 'package:huixiang/union/location_map_page.dart';
import 'package:huixiang/union/union_select_city.dart';
import 'package:huixiang/utils/ImgCachePath.dart';
import 'package:huixiang/vip/user_vip_service_page.dart';
@ -133,6 +134,7 @@ import 'mine/manage_address_page.dart';
import 'mine/mine_greenery.dart';
import 'mine/mine_shop_details.dart';
import 'mine/mine_shop_page.dart';
import 'mine/mine_shop_recharge.dart';
import 'mine/mine_view/community_follow.dart';
import 'mine/mine_vip/binding_assistant_card.dart';
import 'mine/mine_vip/legal_right_details.dart';
@ -426,6 +428,8 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
MineGreenery(),
'/router/mine_shop_page': (context, {arguments}) =>
MineShopPage(),
'/router/mine_shop_recharge': (context, {arguments}) =>
MineShopRecharge(arguments: arguments,),
'/router/mine_shop_details': (context, {arguments}) =>
MineShopDetails(arguments:arguments,),
'/router/coupon_page': (context, {arguments}) =>
@ -462,6 +466,8 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
BindingPhonePage(arguments:arguments),
'/router/trading_card_page': (context, {arguments}) =>
TradingCardPage(),
'/router/union_select_city': (context, {arguments}) =>
UnionSelectCity(arguments:arguments),
'/router/business_login_page': (context, {arguments}) =>
BusinessLoginPage(arguments: arguments),
'/router/business_page': (context, {arguments}) =>

102
lib/mine/mine_page.dart

@ -26,9 +26,11 @@ import 'package:shared_preferences/shared_preferences.dart';
import 'package:dio/dio.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../retrofit/data/banner.dart';
import '../retrofit/data/coupon.dart';
import '../retrofit/data/page.dart';
import '../utils/flutter_utils.dart';
import '../view_widget/custom_image.dart';
import 'mine_view/mine_item.dart';
import 'mine_view/mine_view.dart';
@ -49,6 +51,7 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
final RefreshController _refreshController = RefreshController();
int totalMsg = 0;
String couponNum;
List<BannerData> activityBannerData = [];
_toUserInfo() async {
SharedPreferences shared = await SharedPreferences.getInstance();
@ -78,6 +81,7 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
querySocialInfo();
queryMsgStats();
queryCoupon();
queryActivityBanner();
// queryCard();
eventBus.on<EventType>().listen((event) {
@ -136,6 +140,23 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
// EasyLoading.dismiss();
}
///banner
queryActivityBanner() async {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
showLoading: false,
);
BaseData<PageInfo<BannerData>> baseData = await apiService.queryBanner({
"model": {"type": "HOME_STORE_PAGE"},
}).catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
activityBannerData = baseData.data.records;
}
}
queryCoupon() async {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
@ -166,6 +187,7 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
queryCoupon();
querySocialInfo();
queryMsgStats();
queryActivityBanner();
}
///(//)
@ -427,10 +449,11 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
///广
Widget spreadImage() {
return Container(
margin: EdgeInsets.only(bottom: 30.h,),
width: double.infinity,
margin: EdgeInsets.only(bottom:24.h),
height: 85.h,
child: Swiper(
child: activityBannerData != null && activityBannerData.isNotEmpty
? Swiper(
pagination: SwiperPagination(
alignment: Alignment.bottomCenter,
margin: EdgeInsets.only(top: 5.h),
@ -446,33 +469,78 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
duration: 1000,
autoplayDelay: 2000,
itemBuilder: (context, position) {
return GestureDetector(
return InkWell(
onTap: () {
if(position == 0){
Navigator.of(context).pushNamed('/router/invite_friends');
}else if(position == 1){
Navigator.of(context).pushNamed('/router/trading_card_page');
}
spreadBannerClick(activityBannerData[position]);
},
child: Container(
margin: EdgeInsets.symmetric(horizontal: 14.w),
child: ClipRRect(
child:Image.asset(
spreadItem[position],
width:double.infinity,
fit: BoxFit.fill,
height:double.infinity,
),
borderRadius: BorderRadius.circular(6.w),
child: MImage(
activityBannerData[position].imgUrl,
fit: BoxFit.cover,
radius: BorderRadius.circular(6),
errorSrc: "assets/image/default_2_1.webp",
fadeSrc: "assets/image/default_2_1.webp",
),
),
);
},
itemCount:2,
itemCount: activityBannerData.length,
)
: Image.asset(
"assets/image/default_2_1.webp",
fit: BoxFit.cover,
),
);
}
/// contentType 0123,4:,5:7
spreadBannerClick(BannerData activityBannerData) async {
switch (activityBannerData.contentType) {
case 1:
Navigator.of(context).pushNamed('/router/integral_store_page',
arguments: {"goodsId": activityBannerData.content});
break;
case 2:
Navigator.of(context).pushNamed('/router/web_page', arguments: {
"activityId": activityBannerData.content,
});
break;
case 3:
Navigator.of(context).pushNamed('/router/web_page', arguments: {
"articleId": activityBannerData.content,
});
break;
case 4:
String router = activityBannerData.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": activityBannerData.content,
});
break;
case 7:
String params = activityBannerData.content
.substring(activityBannerData.content.indexOf("?") + 1);
Map map = jsonDecode(params);
Navigator.of(context).pushNamed(
activityBannerData.content
.substring(0, activityBannerData.content.indexOf("?")),
arguments: map);
break;
}
}
final List<String> spreadItem = [
"assets/image/welfare_spread.webp",
"assets/image/welfare_yz.webp",

6
lib/mine/mine_shop_details.dart

@ -511,6 +511,12 @@ class _MineShopDetails extends State<MineShopDetails> {
),
),
),
if(((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)) != "0.0米")
Text(
(store.distance ?? 0) > 1000
? S.of(context).gongli(

151
lib/mine/mine_shop_page.dart

@ -2,6 +2,7 @@ import 'dart:convert';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/page.dart';
@ -27,56 +28,109 @@ class MineShopPage extends StatefulWidget {
}
}
class _MineShopPage extends State<MineShopPage> {
class _MineShopPage extends State<MineShopPage> with WidgetsBindingObserver{
List<VipCard> coupons = [];
ApiService apiService;
int current = 1;
RefreshController refreshController ;
final TextEditingController editingController = TextEditingController();
int optionIndex = 0;
bool isKeyBoardShow = false;
List<String> hotSearch = [];
List<String> historySearch = [];
FocusNode _focusNode = FocusNode();
bool hasFocus = true;
int priceOrder = 0;
@override
void initState() {
super.initState();
refreshController = RefreshController();
SharedPreferences.getInstance().then((value) {
apiService =
ApiService(Dio(), context: context, token: value.getString("token"));
queryVipCard();
});
_focusNode.addListener(() {
setState(() {
hasFocus = _focusNode.hasFocus;
});
});
}
_onRefresh() {
current = 1;
queryVipCard();
@override
void didChangeMetrics() {
super.didChangeMetrics();
WidgetsBinding.instance.addPostFrameCallback((_) {
setState(() {
print("object: ${MediaQuery.of(context).viewInsets.bottom}");
if (MediaQuery.of(context).viewInsets.bottom == 0) {
if (isKeyBoardShow) {
isKeyBoardShow = false;
//
FocusScope.of(context).requestFocus(FocusNode());
}
} else {
isKeyBoardShow = true;
}
});
});
}
queryVipCard() async {
///
@override
void dispose() {
_focusNode.unfocus();
refreshController.dispose();
super.dispose();
}
queryVipCard({bool showLoading = true}) async {
try{
if(showLoading)EasyLoading.show(status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
BaseData<List<VipCard>> baseData =
await apiService.vipList({}).catchError((error) {
await apiService.vipList({
"keywords":editingController.text,
}).catchError((error) {
refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
coupons.clear();
coupons.addAll(baseData.data);
setState(() {
refreshController.refreshCompleted();
});
} else {
refreshController.refreshFailed();
}
}finally{
EasyLoading.dismiss();
setState(() {});
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
FocusScope.of(context).requestFocus(FocusNode());
},
child: Scaffold(
resizeToAvoidBottomInset: false,
appBar: MyAppBar(
title: S.of(context).dianpuyue,
title: "店铺充值",
titleColor: Colors.black,
background: Colors.white,
leadingColor: Colors.black,
),
body: SmartRefresher(
body:Column(
children: [
Container(
color: Colors.white,
padding: EdgeInsets.only(top:10.h,bottom:18.h,),
child: searchShopItem(),
),
Expanded(child: SmartRefresher(
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
@ -95,8 +149,14 @@ class _MineShopPage extends State<MineShopPage> {
return GestureDetector(
onTap: () {
Navigator.of(context).pushNamed(
'/router/mine_shop_details',
arguments: {"id": coupons[position].id});
'/router/mine_shop_recharge',
arguments: {
"id": coupons[position].id,
"tenantCode":coupons[position].tenantCode,
"storeId":coupons[position].storeList[0].id
}).then((value) {
queryVipCard(showLoading: false);
});
},
child: shopItem(coupons[position]),
);
@ -110,6 +170,54 @@ class _MineShopPage extends State<MineShopPage> {
fontSize: 16.sp,
margin: EdgeInsets.only(top: 120.h),
),
),)
],
),
),
);
}
Widget searchShopItem() {
return Container(
margin: EdgeInsets.fromLTRB(14.w, 0, 14.w, 0),
padding: EdgeInsets.symmetric(vertical: 6.h),
decoration: BoxDecoration(
color: Color(0xFFF5FAF7),
borderRadius: BorderRadius.circular(4),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
),
child: TextField(
textInputAction: TextInputAction.search,
onEditingComplete: () {
FocusScope.of(context).requestFocus(FocusNode());
queryVipCard();
},
controller: editingController,
style: TextStyle(
fontSize: 14.sp,
),
decoration: InputDecoration(
hintText: "搜索联盟会员店",
hintStyle: TextStyle(
fontSize: 12.sp,
color: Color(0xFFB3B3B3),
),
isCollapsed: true,
prefixIcon:Padding(padding: EdgeInsets.only(left: 5.w,right: 5.w),child: Image.asset(
"assets/image/icon_search.webp",
width: 16.h,
height: 16.h,
),),
prefixIconConstraints: BoxConstraints(),
border: InputBorder.none,
),
),
);
}
@ -218,19 +326,20 @@ class _MineShopPage extends State<MineShopPage> {
),
)),
Text(
S.of(context).chakanxiangqing,
"去充值",
style: TextStyle(
color: Color(0xFF353535),
color: Color(0xFF262626),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
SizedBox(width: 2,),
Icon(
Icons.chevron_right,
size: 24,
color: Colors.black,
),
Image.asset(
"assets/image/icon_right_z.webp",
width: 16,
height: 16,
color: Color(0xFF262626),
)
],
),
],

908
lib/mine/mine_shop_recharge.dart

@ -0,0 +1,908 @@
import 'dart:io';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:fluwx/fluwx.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/vip_card.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/store/scan.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../retrofit/data/member_recharge_list.dart';
import '../retrofit/data/rechargeActLists.dart';
import '../retrofit/data/wx_pay.dart';
import '../retrofit/min_api.dart';
import '../utils/flutter_utils.dart';
import '../utils/min.dart';
import '../view_widget/classic_header.dart';
import '../view_widget/my_footer.dart';
import '../view_widget/no_data_view.dart';
import '../view_widget/recharge_details_dialog.dart';
import 'package:tobias/tobias.dart' as tobias;
class MineShopRecharge extends StatefulWidget {
final Map<String, dynamic> arguments;
MineShopRecharge({this.arguments});
@override
State<StatefulWidget> createState() {
return _MineShopRecharge();
}
}
class _MineShopRecharge extends State<MineShopRecharge> {
ApiService apiService;
MinApiService minService;
VipCard vipCard;
List<MemberRechargeList> memberRechargeList = [];
int selectIndex = 0;
double discount = 100;
var checkIndex = 2;
dynamic payListen;
int _loadCount = 0;
String tenant;
String storeId;
String minToken;
final RefreshController refreshController = RefreshController();
@override
void dispose() {
super.dispose();
refreshController.dispose();
if (payListen != null) payListen.cancel();
}
@override
void initState() {
super.initState();
storeId = widget.arguments["storeId"];
tenant = widget.arguments["tenantCode"];
_onRefresh();
payListen = weChatResponseEventHandler.listen((event) async {
print("payCallback: ${event.errCode}");
if (event.errCode == 0) {
SmartDialog.showToast("充值成功", alignment: Alignment.center);
} else {
SmartDialog.showToast("充值失败", alignment: Alignment.center);
}
vipDetail();
});
}
///
vipDetail({bool isSingle = true}) async {
try {
BaseData<VipCard> baseData = await apiService.vipDetail({
"id": widget.arguments["id"],
"latitude": "",
"longitude": "",
}).catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
vipCard = baseData.data;
}
} finally {
if (isSingle)
setState(() {});
else
addLoadCount();
}
}
///
minLogin() async {
try {
var baseData = await apiService.minLogin(storeId).catchError((onError) {
debugPrint(onError.toString());
});
if (baseData != null && baseData.isSuccess) {
minToken = baseData.data["token"];
SharedPreferences.getInstance().then(
(value) => {
value.setString('minToken', minToken),
value.setString('tenant', tenant),
value.setString('storeId', storeId),
},
);
minService = MinApiService(
Dio(),
context: context,
token: minToken,
tenant: tenant,
storeId: storeId,
);
}
} finally {}
}
///
queryRechargeActList() async {
try {
BaseData<List<MemberRechargeList>> baseData =
await minService.memberRechargeList().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
memberRechargeList = baseData.data;
}
} finally {
addLoadCount();
}
}
///
shopRecharge() async {
if (minService == null) await minLogin();
BaseData<dynamic> baseData = await minService.memberRecharge({
"money": 0,
"rechargeId": memberRechargeList[selectIndex].id,
"type": checkIndex == 2 ? "wechat" : "alipay",
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
if (checkIndex == 2) {
if (Platform.isAndroid) {
if (!(await Min.isInitialize())) {
// app的充值支付使用同一个WXPayEntryActivity回调
// getPackage空指针
//
await Min.initialize();
}
}
WxPay wxPay = WxPay.fromJson(baseData.data);
await registerWxApi(
appId: wxPay.appId,
doOnAndroid: true,
universalLink: "https://hx.lotus-wallet.com/app/",
);
payWithWeChat(
appId: wxPay.appId,
partnerId: wxPay.partnerId,
prepayId: wxPay.prepayId,
packageValue: wxPay.packageValue,
nonceStr: wxPay.nonceStr,
timeStamp: int.tryParse(wxPay.timeStamp),
sign: wxPay.sign,
);
} else {
tobias.isAliPayInstalled().then((value) => {
//
if (!value)
{SmartDialog.showToast("请安装支付宝", alignment: Alignment.center)}
else
{
tobias.aliPay(baseData.data["body"]).then((payRes) {
if (payRes['resultStatus'] == 9000 ||
payRes['resultStatus'] == '9000') {
SmartDialog.showToast("充值成功",
alignment: Alignment.center);
} else {
SmartDialog.showToast(payRes['memo'],
alignment: Alignment.center);
}
vipDetail();
})
}
});
}
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
_onRefresh() async {
EasyLoading.show(
status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService =
ApiService(Dio(), context: context, token: value.getString("token"));
}
if (minService == null) await minLogin();
vipDetail(isSingle: false);
queryRechargeActList();
}
addLoadCount() {
_loadCount += 1;
if (_loadCount == 2) {
_loadCount = 0;
EasyLoading.dismiss();
if (refreshController.isRefresh) refreshController.refreshCompleted();
if (mounted) setState(() {});
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: MyAppBar(
title: "店铺充值",
titleColor: Colors.black,
background: Colors.white,
brightness: Brightness.dark,
leadingColor: Colors.black,
),
body: SmartRefresher(
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
controller: refreshController,
onRefresh: _onRefresh,
physics: BouncingScrollPhysics(),
child: Column(
children: [
shopRechargeCard(),
(memberRechargeList != null &&
(memberRechargeList?.length ?? 0) > 0)
? Expanded(
child: ListView.builder(
padding: EdgeInsets.zero,
itemCount: (memberRechargeList != null &&
(memberRechargeList?.length ?? 0) > 0)
? memberRechargeList.length
: 0,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
setState(() {
selectIndex = position;
});
},
child: rechargeItem(
memberRechargeList[position], position));
},
))
: NoDataView(
src: "assets/image/xiao_fei.webp",
isShowBtn: false,
text: "当前店铺暂无充值套餐~",
fontSize: 16.sp,
margin:
EdgeInsets.only(top: 90.h, left: 60.w, right: 60.w),
),
if (memberRechargeList != null &&
(memberRechargeList?.length ?? 0) > 0)
Container(
width: double.infinity,
margin: EdgeInsets.only(left: 16, right: 16),
padding: EdgeInsets.only(
top: 20.h,
bottom: 24.h,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(bottom: 16.h),
child: Text(
S.of(context).zhifufangshi,
style: TextStyle(
fontSize: 16.sp,
color: Colors.black,
fontWeight: FontWeight.bold,
),
),
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
checkIndex = 2;
});
},
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset("assets/image/icon_we_chat.webp"),
Expanded(
flex: 1,
child: Padding(
padding: EdgeInsets.only(left: 8.w),
child: Text(
S.of(context).weixinzhifu,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xff353535),
),
),
),
),
checkView(2),
],
),
),
SizedBox(height: 10.h),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
checkIndex = 3;
});
},
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset("assets/image/icon_alipay.webp"),
Expanded(
flex: 1,
child: Padding(
padding: EdgeInsets.only(left: 8.w),
child: Text(
S.of(context).zhifubao,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xff353535),
),
),
),
),
checkView(3),
],
),
),
],
),
),
if (memberRechargeList != null &&
(memberRechargeList?.length ?? 0) > 0)
Align(
alignment: Alignment.bottomCenter,
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
shopRecharge();
},
child: Container(
height: 56.h,
width: double.infinity,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(27),
),
margin: EdgeInsets.only(
top: 12.h, left: 16.w, right: 16.w, bottom: 21.h),
child: Text(
S.of(context).querenchongzhi,
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
),
),
)
],
),
));
}
///
int colorByName(String storeName) {
if (storeName == null) return 0xFF32A060;
if (storeName.contains("百年川椒") || storeName.contains("百年川椒")) {
return 0xFFC30D23;
} else if (storeName.contains("海峡姐妹") || storeName.contains("海峽姐妹")) {
return 0xFFE4C796;
} else if (storeName.contains("前进麦味") || storeName.contains("前進麥味")) {
return 0xFF265782;
}
return 0xFF32A060;
}
///
Widget shopRechargeCard() {
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context).pushNamed('/router/mine_shop_details',
arguments: {"id": widget.arguments["id"]});
},
child: Container(
width: double.infinity,
// height:140.h,
margin:
EdgeInsets.only(bottom: 24.h, top: 14.h, left: 14.w, right: 14.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
decoration: BoxDecoration(
borderRadius: new BorderRadius.only(
topLeft: Radius.circular(6),
topRight: Radius.circular(6),
),
color: Color(colorByName(vipCard?.tenantName ?? "")),
),
padding: EdgeInsets.only(left: 12.w),
height: 62.h,
child: Row(
children: [
MImage(
(vipCard?.storeList?.length ?? 0) > 0
? vipCard.storeList[0].logo
: "",
width: 38,
height: 38,
radius: BorderRadius.circular(100),
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp",
),
SizedBox(
width: 6,
),
Text(
vipCard != null ? vipCard.tenantName : "",
style: TextStyle(
color: Color(0xFFFFFFFF),
fontSize: 15.sp,
fontWeight: MyFontWeight.medium,
),
),
],
),
),
Container(
decoration: BoxDecoration(
borderRadius: new BorderRadius.only(
bottomRight: Radius.circular(6),
topRight: Radius.circular(6),
),
color: Colors.white,
),
padding: EdgeInsets.all(12.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"店铺余额(元)",
style: TextStyle(
color: Color(0xFF262626),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
Text(
"No.${vipCard?.id ?? ""}",
style: TextStyle(
color: Color(0xFF262626),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
],
),
SizedBox(
height: 4.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Text(
"${vipCard != null ? vipCard.balance : ""}",
style: TextStyle(
color: Color(0xFF262626),
fontSize: 24.sp,
fontFamily: 'JDZhengHT',
fontWeight: MyFontWeight.medium,
),
),
),
Text(
"适用门店",
style: TextStyle(
color: Color(0xFF262626),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
SizedBox(
width: 2,
),
Image.asset(
"assets/image/icon_right_z.webp",
width: 16,
height: 16,
color: Color(0xFF262626),
)
],
),
],
),
),
],
),
),
);
}
///item
Widget rechargeItem(MemberRechargeList memberRechargeList, index) {
return Container(
width: double.infinity,
height: 69.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
border: Border.all(
color:
selectIndex == index ? Color(0xFF32A060) : Color(0xFFFAFAFA),
width: selectIndex == index ? 1 : 0,
),
color: selectIndex == index ? Color(0XFFF0FAF4) : Colors.white),
margin: EdgeInsets.only(bottom: 14.h, left: 14.w, right: 14.w),
padding: EdgeInsets.only(left: 16),
child: Flex(
direction: Axis.horizontal,
children: [
Expanded(
flex: 1,
child: Container(
child: Text.rich(
TextSpan(children: [
TextSpan(
text: "储值 ",
style: TextStyle(
fontSize: 12.sp,
color: selectIndex == index
? Color(0xFF4D4D4D)
: Color(0xFF868686),
fontWeight: MyFontWeight.regular),
),
TextSpan(
text:
"${AppUtils.calculateDouble(double.tryParse(memberRechargeList.rechargeMoney) ?? 0)}",
style: TextStyle(
fontSize: 18.sp,
fontFamily: 'JDZhengHT',
color: selectIndex == index
? Color(0xFF353535)
: Color(0xFF868686),
fontWeight: MyFontWeight.semi_bold),
),
]),
),
)),
Container(
width: 1.w,
height: 37.h,
color:
selectIndex == index ? Color(0xFF32A060) : Color(0xFF979797),
margin: EdgeInsets.only(right: 16.w, left: 12),
),
Expanded(
flex: 2,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text.rich(
TextSpan(children: [
TextSpan(
text: "实际到账 ",
style: TextStyle(
fontSize: 12.sp,
color: selectIndex == index
? Color(0xFF353535)
: Color(0xFF868686),
fontWeight: MyFontWeight.regular),
),
TextSpan(
text:
"${((memberRechargeList?.limitNum ?? 0) != 0 && ((memberRechargeList?.limitNum ?? 0) - (memberRechargeList?.useNum ?? 0) <= 0)) ?
(AppUtils.calculateDouble(double.tryParse(memberRechargeList.rechargeMoney) ?? 0)) :
(AppUtils.calculateDouble((double.tryParse(memberRechargeList.rechargeMoney) ?? 0) + (double.tryParse(memberRechargeList.giftdMoney) ?? 0) + ((double.tryParse(memberRechargeList.rechargeMoney) ?? 0) - ((double.tryParse(memberRechargeList.rechargeMoney) ?? 0) * (discount / 100)))))}",
style: TextStyle(
fontSize: 18.sp,
fontFamily: 'JDZhengHT',
color: selectIndex == index
? Color(0xFF353535)
: Color(0xFF868686),
fontWeight: MyFontWeight.semi_bold),
),
]),
),
SizedBox(
height: 4.h,
),
GestureDetector(
onTap: () {
setState(() {
if (selectIndex == index)
showRecharge(memberRechargeList, index);
});
},
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"充值说明",
style: TextStyle(
color: selectIndex == index
? Color(0xFF4D4D4D)
: Color(0xFF868686),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
Icon(
Icons.chevron_right,
size: 20,
color: selectIndex == index
? Color(0xFF353535)
: Color(0xFF868686),
),
],
)),
],
))
],
));
}
Widget checkView(var index) {
return Container(
padding: EdgeInsets.only(right: 16.w, left: 46.w),
alignment: Alignment.center,
child: Image.asset(
checkIndex != index
? "assets/image/icon_radio_unselected.webp"
: "assets/image/icon_radio_selected.webp",
width: 15.w,
height: 15.h,
),
);
}
///
showRecharge(MemberRechargeList memberRechargeList, index) {
showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return Container(
padding: EdgeInsets.only(top: 12),
decoration: new BoxDecoration(
color: Colors.white,
borderRadius: new BorderRadius.only(
topLeft: const Radius.circular(25.0),
topRight: const Radius.circular(25.0))),
child: Container(
height: 355,
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Container(
margin: EdgeInsets.symmetric(vertical: 12.h),
alignment: Alignment.center,
child: Text(
"充值说明",
style: TextStyle(
fontWeight: MyFontWeight.bold,
fontSize: 15.sp,
color: Color(0xFF353535),
),
),
)),
GestureDetector(
onTap: () {
setState(() {
Navigator.of(context).pop();
});
},
child: Icon(
Icons.clear,
color: Colors.black,
size: 18,
),
),
SizedBox(width: 14),
],
),
SizedBox(
height: 12.h,
),
Container(
width: double.infinity,
height: 1.h,
color: Color(0xFFF2F2F2),
margin: EdgeInsets.only(bottom: 13.h),
),
Padding(
padding: EdgeInsets.only(left: 14),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Expanded(
child: Container(
color: Colors.white,
child: Html(
data: memberRechargeList?.remark ?? "",
customImageRenders: {
networkSourceMatcher():
networkImageRender(
loadingWidget: () {
return Container();
},
),
},
),
),
)
],
),
)
],
),
)));
});
}
Widget shopItem(StoreListBean store) {
return Container(
decoration: BoxDecoration(
borderRadius: new BorderRadius.circular(6),
color: Colors.white,
),
padding: EdgeInsets.all(12),
margin: EdgeInsets.symmetric(horizontal: 16.w, vertical: 8.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
flex: 1,
child: Text(
(store != null) ? store.storeName : "",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold,
color: Colors.black,
),
),
),
GestureDetector(
onTap: () {
// Navigator.of(context).pushNamed('/router/union_detail_page',
// arguments: {"id": store.id});
if (store.posType.code == "NORMALSTORE") {
Scan.toScan(
context,
store.id,
store.tenantCode,
store.storeName,
);
} else {
Navigator.of(context).pushNamed(
'/router/store_order',
arguments: {
"id": store.id,
"tenant": store.tenantCode,
"storeName": store.storeName
},
);
}
},
child: Text(
S.of(context).chakan,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xff32A060),
),
),
),
Icon(
Icons.chevron_right,
color: Color(0xff32A060),
size: 16,
),
],
),
SizedBox(
height: 8.h,
),
Row(
children: [
Text(
"${S.of(context).dizhi}: ",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xff353535),
),
),
Expanded(
child: Text(
store.address,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xff353535),
),
),
flex: 1,
)
],
),
SizedBox(
height: 4.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
flex: 1,
child: Text(
S.of(context).yingyeshijian((store.openStartTime == null &&
store.openEndTime == null)
? S.of(context).quantian
: "${store.openStartTime.substring(0, store.openStartTime.lastIndexOf(":"))} - ${store.openEndTime.substring(0, store.openEndTime.lastIndexOf(":"))}"),
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xff353535),
),
),
),
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(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xff868686),
),
),
],
),
],
),
);
}
}

74
lib/mine/mine_view/mine_item.dart

@ -1,6 +1,5 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/login_tips_dialog.dart';
@ -182,7 +181,7 @@ class _MineItem extends State<MineItem> {
});
},
child: mineItem(
S.of(context).dianpuyue,
"店铺充值",
"assets/image/shop_yue.webp",
),
),),
@ -224,7 +223,7 @@ class _MineItem extends State<MineItem> {
],
),
SizedBox(height: 12.h,),
if(isShowMore)
// if(isShowMore)
Row(
children: [
///
@ -323,9 +322,9 @@ class _MineItem extends State<MineItem> {
// ),),
],
),
if(isShowMore)
// if(isShowMore)
SizedBox(height: 12.h,),
if(isShowMore)
// if(isShowMore)
Row(
children: [
////
@ -354,38 +353,39 @@ class _MineItem extends State<MineItem> {
Expanded(child:Container(),),
],
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
isShowMore = !isShowMore;
});
},
child: Container(
margin: EdgeInsets.symmetric(vertical: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: [
Text(
(isShowMore != null && !isShowMore)?S.of(context).zhankai: S.of(context).shouqi,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF32A060),
),
),
Icon(
(isShowMore != null && !isShowMore)
? Icons.keyboard_arrow_down
: Icons.keyboard_arrow_up,
color: Color(0xFF32A060),
size: 18,
),
],
),),
)
///
// GestureDetector(
// behavior: HitTestBehavior.opaque,
// onTap: () {
// setState(() {
// isShowMore = !isShowMore;
// });
// },
// child: Container(
// margin: EdgeInsets.symmetric(vertical: 10),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisSize: MainAxisSize.max,
// children: [
// Text(
// (isShowMore != null && !isShowMore)?S.of(context).zhankai: S.of(context).shouqi,
// style: TextStyle(
// fontSize: 12.sp,
// fontWeight: MyFontWeight.regular,
// color: Color(0xFF32A060),
// ),
// ),
// Icon(
// (isShowMore != null && !isShowMore)
// ? Icons.keyboard_arrow_down
// : Icons.keyboard_arrow_up,
// color: Color(0xFF32A060),
// size: 18,
// ),
// ],
// ),),
// )
],
),
);

16
lib/mine/mine_view/mine_navbar.dart

@ -175,14 +175,14 @@ class _MineNavbar extends State<MineNavbar> {
Expanded(
child: InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
widget.toIntegralPage();
});
// SharedPreferences.getInstance().then((value) {
// if (value.getString("token") == null ||
// value.getString("token") == "") {
// LoginTipsDialog().show(context);
// return;
// }
// widget.toIntegralPage();
// });
},
child: mineBottomItem(
widget?.userInfo?.points?? "0",

93
lib/mine/mine_view/mine_view.dart

@ -373,55 +373,56 @@ class _MineView extends State<MineView> {
),
),
),
widget.userInfo == null
? Container(
alignment: Alignment.center,
height: 50.h,
child: Icon(
Icons.keyboard_arrow_right,
size: 20,
color: Colors.black,
),
)
: Container(
alignment: Alignment.bottomRight,
height: 50.h,
child: GestureDetector(
onTap: () {
widget.toIntegralPage();
},
child: Container(
padding: EdgeInsets.only(
top: 4.h, bottom: 4.h, right: 16.w, left: 7.w),
margin: EdgeInsets.only(right: 14.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Image.asset(
"assets/image/icon_gold_coin.webp",
width: 16,
height: 16,
),
Text(
S.of(context).tiantianlingjifen,
style: TextStyle(
color: Color(0xFF32A060),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
// Icon(
///
// widget.userInfo == null
// ? Container(
// alignment: Alignment.center,
// height: 50.h,
// child: Icon(
// Icons.keyboard_arrow_right,
// size: 16,
// size: 20,
// color: Colors.black,
// ),
// )
],
),
)),
),
// : Container(
// alignment: Alignment.bottomRight,
// height: 50.h,
// child: GestureDetector(
// onTap: () {
// widget.toIntegralPage();
// },
// child: Container(
// padding: EdgeInsets.only(
// top: 4.h, bottom: 4.h, right: 16.w, left: 7.w),
// margin: EdgeInsets.only(right: 14.w),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(12),
// color: Colors.white),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.end,
// children: [
// Image.asset(
// "assets/image/icon_gold_coin.webp",
// width: 16,
// height: 16,
// ),
// Text(
// S.of(context).tiantianlingjifen,
// style: TextStyle(
// color: Color(0xFF32A060),
// fontSize: 12.sp,
// fontWeight: MyFontWeight.regular,
// ),
// ),
// // Icon(
// // Icons.keyboard_arrow_right,
// // size: 16,
// // color: Colors.black,
// // )
// ],
// ),
// )),
// ),
],
),
);

32
lib/mine/mine_vip/mine_attainment_page.dart

@ -20,6 +20,8 @@ import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../../view_widget/no_data_view.dart';
class MineAttainmentPage extends StatefulWidget {
final Map<String, dynamic> arguments;
@ -41,7 +43,6 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
SocialInfo infoNumber;
final RefreshController refreshController = RefreshController();
@override
void dispose() {
super.dispose();
@ -165,8 +166,7 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
},
physics: BouncingScrollPhysics(),
child: Container(
child:
SingleChildScrollView(
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
children: [
@ -191,8 +191,8 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
),
SizedBox(height: 28),
Container(
margin:
EdgeInsets.only(left: 16, right: 16, top: 26, bottom: 8),
margin: EdgeInsets.only(
left: 16, right: 16, top: 26, bottom: 8),
padding: EdgeInsets.all(20),
decoration: BoxDecoration(
color: Colors.white,
@ -228,7 +228,9 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
color: Color(0xFF353535)),
),
Text(
infoNumber != null ? infoNumber.achievementNumber.toString() :"0",
infoNumber != null
? infoNumber.achievementNumber.toString()
: "0",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 14,
@ -252,13 +254,15 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
),
),
),
),),
),
),
);
}
///
Widget attainmentBadge() {
return GridView.builder(
return (vipBadgesList != null && (vipBadgesList?.length ?? 0) > 0)
? GridView.builder(
itemCount: vipBadgesList == null ? 0 : vipBadgesList.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
@ -284,7 +288,15 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
child: badgeItem(vipBadgesList[index]),
);
},
)
: NoDataView(
src: "assets/image/xiao_fei.webp",
isShowBtn: false,
text: "当前暂无成就徽章~",
fontSize: 16.sp,
margin: EdgeInsets.only(left: 60.w, right: 60.w),
);
;
}
Widget badgeItem(VipBadgesList vipBadgesList) {
@ -396,7 +408,9 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children:
achievementDetail[checkPosition].rewardList != null
? achievementDetail[checkPosition].rewardList.map((e) {
? achievementDetail[checkPosition]
.rewardList
.map((e) {
return Text(
rewardStr(e),
style: TextStyle(

168
lib/mine/recharge_page.dart

@ -19,9 +19,14 @@ import 'package:huixiang/utils/min.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/recharge_details_dialog.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:tobias/tobias.dart' as tobias;
import '../view_widget/classic_header.dart';
import '../view_widget/my_footer.dart';
import '../view_widget/no_data_view.dart';
class RechargePage extends StatefulWidget {
@override
State<StatefulWidget> createState() {
@ -43,19 +48,13 @@ class _RechargePage extends State<RechargePage> {
RechargeActLists rechargeActLists;
int selectStoreIndex = 0;
String recommendName;
final RefreshController refreshController = RefreshController();
int _loadCount = 0;
@override
void initState() {
super.initState();
SharedPreferences.getInstance().then((value) {
apiService = ApiService(Dio(),
context: context, token: value.getString("token"), pay: true);
queryBenefitList();
queryRuleDetails();
queryRechargeActList();
queryUserBalance();
});
_onRefresh();
payListen = weChatResponseEventHandler.listen((event) async {
print("payCallback: ${event.errCode}");
if (event.errCode == 0) {
@ -77,10 +76,10 @@ class _RechargePage extends State<RechargePage> {
///
queryBenefitList() async {
try {
BaseData<List<VipBenefitList>> baseData =
await apiService.benefitList().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
setState(() {
vipBenefitList.clear();
vipBenefitList.addAll(baseData.data);
vipBenefitList.forEach((element) {
@ -90,51 +89,77 @@ class _RechargePage extends State<RechargePage> {
discount = double.parse(element.config);
}
});
});
}
EasyLoading.dismiss();
} finally {
addLoadCount();
}
}
queryUserBalance() async {
try {
BaseData<UserInfo> baseData =
await apiService.queryInfo().catchError((onError) {});
await apiService.queryInfo().catchError((onError) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type),
alignment: Alignment.center);
refreshController.refreshFailed();
refreshController.loadFailed();
});
if (baseData != null && baseData.isSuccess) {
userInfo = baseData.data;
mBalance = userInfo?.money ?? "0";
if (mounted) setState(() {});
}
} finally {
addLoadCount();
}
}
//////
queryRuleDetails() async {
try {
BaseData<VipRuleDetails> baseData =
await apiService.vipBenefit().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
setState(() {
vipRuleDetails = baseData.data;
});
}
EasyLoading.dismiss();
} finally {
addLoadCount();
}
}
///
queryRechargeActList() async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
try {
BaseData<RechargeActLists> baseData =
await apiService.rechargeActList().catchError((onError) {});
await apiService.rechargeActList("admin").catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
setState(() {
rechargeActLists = baseData.data;
});
}
} finally {
addLoadCount();
}
}
_onRefresh() async {
EasyLoading.show(
status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
SharedPreferences value = await SharedPreferences.getInstance();
if (apiService == null)
apiService = ApiService(Dio(),
context: context, token: value.getString("token"), pay: true);
queryBenefitList();
queryRuleDetails();
queryRechargeActList();
queryUserBalance();
}
addLoadCount() {
_loadCount += 1;
if (_loadCount == 4) {
_loadCount = 0;
EasyLoading.dismiss();
if (refreshController.isRefresh) refreshController.refreshCompleted();
if (mounted) setState(() {});
}
}
@override
@ -149,13 +174,19 @@ class _RechargePage extends State<RechargePage> {
),
body: Container(
color: Color(0xFFFFFFFF),
child: SmartRefresher(
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
controller: refreshController,
onRefresh: _onRefresh,
physics: BouncingScrollPhysics(),
child: SingleChildScrollView(
child: Container(
child: Stack(
children: [
Column(
children: [
SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
child: Column(
@ -208,8 +239,7 @@ class _RechargePage extends State<RechargePage> {
fontSize: 15.sp,
color: Color(0xFF181818),
fontFamily: 'JDZhengHT',
fontWeight:
MyFontWeight.semi_bold),
fontWeight: MyFontWeight.semi_bold),
)),
Text.rich(
TextSpan(children: [
@ -219,16 +249,14 @@ class _RechargePage extends State<RechargePage> {
fontSize: 26.sp,
fontFamily: 'JDZhengHT',
color: Color(0xFF181818),
fontWeight:
MyFontWeight.semi_bold),
fontWeight: MyFontWeight.semi_bold),
),
TextSpan(
text: "",
style: TextStyle(
fontSize: 15.sp,
color: Color(0xFF181818),
fontWeight:
MyFontWeight.semi_bold),
fontWeight: MyFontWeight.semi_bold),
),
]),
),
@ -261,6 +289,8 @@ class _RechargePage extends State<RechargePage> {
// ),
],
)),
if (rechargeActLists != null &&
(rechargeActLists?.preferentialList?.length ?? 0) > 0)
Container(
width: double.infinity,
margin: EdgeInsets.only(left: 16, right: 16),
@ -273,8 +303,7 @@ class _RechargePage extends State<RechargePage> {
// borderRadius: BorderRadius.circular(4),
// ),
child: Column(
mainAxisAlignment:
MainAxisAlignment.spaceAround,
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
@ -296,13 +325,10 @@ class _RechargePage extends State<RechargePage> {
});
},
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset(
"assets/image/icon_we_chat.webp"),
Image.asset("assets/image/icon_we_chat.webp"),
Expanded(
flex: 1,
child: Padding(
@ -329,13 +355,10 @@ class _RechargePage extends State<RechargePage> {
});
},
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset(
"assets/image/icon_alipay.webp"),
Image.asset("assets/image/icon_alipay.webp"),
Expanded(
flex: 1,
child: Padding(
@ -388,7 +411,9 @@ class _RechargePage extends State<RechargePage> {
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
color: (recommendName != null) ?Color(0xFF32A060):Color(0xFF868686),
color: (recommendName != null)
? Color(0xFF32A060)
: Color(0xFF868686),
),
)),
Icon(
@ -398,6 +423,8 @@ class _RechargePage extends State<RechargePage> {
],
)),
),
if (rechargeActLists != null &&
(rechargeActLists?.preferentialList?.length ?? 0) > 0)
Align(
alignment: Alignment.bottomCenter,
child: GestureDetector(
@ -424,7 +451,6 @@ class _RechargePage extends State<RechargePage> {
),
),
),
// Container(
// height: 56.h,
// color: Colors.white,
@ -527,23 +553,22 @@ class _RechargePage extends State<RechargePage> {
],
),
),
)
],
),
],
),
),
),
),
)),
);
}
var checkIndex = 2;
Widget rechargeList() {
return ListView.builder(
return (rechargeActLists != null &&
(rechargeActLists?.preferentialList?.length ?? 0) > 0)
? ListView.builder(
padding: EdgeInsets.zero,
itemCount: (rechargeActLists != null && (rechargeActLists?.preferentialList?.length ?? 0) > 0) ? rechargeActLists.preferentialList.length : 0,
itemCount: (rechargeActLists != null &&
(rechargeActLists?.preferentialList?.length ?? 0) > 0)
? rechargeActLists.preferentialList.length
: 0,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
@ -554,8 +579,16 @@ class _RechargePage extends State<RechargePage> {
selectIndex = position;
});
},
child: rechargeItem(rechargeActLists.preferentialList[position], position));
child: rechargeItem(
rechargeActLists.preferentialList[position], position));
},
)
: NoDataView(
src: "assets/image/xiao_fei.webp",
isShowBtn: false,
text: "暂无充值套餐~",
fontSize: 16.sp,
margin: EdgeInsets.only(top: 90.h, left: 60.w, right: 60.w),
);
}
@ -809,7 +842,8 @@ class _RechargePage extends State<RechargePage> {
),
);
});
},);
},
);
}
Widget recommendStoreItem(index) {

2
lib/mine/scan_web.dart

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

2
lib/order/order_detail_page.dart

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

348
lib/order/order_history_page.dart

@ -1,5 +1,6 @@
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/order/order_utils.dart';
@ -132,57 +133,29 @@ class OrderHistoryList extends StatefulWidget {
class _OrderHistoryList extends State<OrderHistoryList>
with AutomaticKeepAliveClientMixin {
final RefreshController refreshController = RefreshController();
@override
Widget build(BuildContext context) {
super.build(context);
return SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: true,
physics: BouncingScrollPhysics(),
header: MyHeader(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onRefresh: _onRefresh,
onLoading: queryOrder,
child: (orderInfos != null && orderInfos.length > 0)
? ListView.builder(
itemCount: orderInfos != null ? orderInfos.length : 0,
itemBuilder: (context, position) {
return InkWell(
onTap: () {
Navigator.of(context).pushNamed('/router/order_details',
arguments: {"id": orderInfos[position].id,"jumpState":2});
},
child: orderItem(orderInfos[position]),
);
})
: NoDataView(
src: "assets/image/ding_dan.webp",
isShowBtn: false,
text: "目前暂无订单,快去下一单吧~",
fontSize: 16.sp,
margin: EdgeInsets.only(top: 120),
),
);
}
bool isRemake = true;
ApiService apiService;
int current = 1;
List<OrderInfo> orderInfos = [];
UserInfo userInfo;
@override
void initState() {
super.initState();
SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(),
showLoading: true,
context: context,
token: value.getString("token")),
queryOrder(),
queryUserBalance(),
});
}
_onRefresh() {
current = 1;
queryOrder();
}
List<OrderInfo> orderInfos = [];
queryOrder() async {
BaseData<PageInfo<OrderInfo>> baseData = await apiService.orderList({
"current": current,
@ -213,24 +186,173 @@ class _OrderHistoryList extends State<OrderHistoryList>
}
setState(() {});
} else {
SmartDialog.showToast(baseData?.msg ?? "",alignment: Alignment.center);
if((baseData?.msg ?? "") != "")
SmartDialog.showToast(baseData.msg,alignment: Alignment.center);
refreshController.refreshFailed();
refreshController.loadFailed();
}
}
@override
void initState() {
super.initState();
minLogin(OrderInfo orderInfo) {
apiService.minLogin(orderInfo.storeId).catchError((onError) {
debugPrint(onError);
}).then((baseData) {
if (baseData != null && baseData.isSuccess) {
Map<String, dynamic> minStoreInfo = baseData.data;
String minToken = minStoreInfo["token"];
String tenant = orderInfo.tenantCode;
String storeId = orderInfo.storeId;
SharedPreferences.getInstance().then(
(value) => {
value.setString('minToken', minToken),
value.setString('tenant', tenant),
value.setString('storeId', storeId),
},
);
paySelected(
orderInfo,
MinApiService(
Dio(),
context: context,
token: minToken,
tenant: tenant,
storeId: storeId,
));
}
});
}
SharedPreferences.getInstance().then((value) => {
queryDetails(id) async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(Dio(),
showLoading: true,
context: context, token: value.getString("token"), showLoading: true);
}
BaseData<OrderInfo> baseData =
await apiService.orderDetail(id).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
return baseData.data;
}
}
queryUserBalance() async {
BaseData<UserInfo> baseData =
await apiService.queryInfo().catchError((onError) {
});
if (baseData != null && baseData.isSuccess) {
userInfo = baseData.data;
if (mounted) setState(() {});
}else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
paySelected(OrderInfo orderInfo, MinApiService minService) async {
var payChannel = await showModalBottomSheet(
context: context,
token: value.getString("token")),
queryOrder(),
queryUserBalance(),
backgroundColor: Colors.transparent,
builder: (context) {
return OrderPaySelected(userInfo);
},
);
if (payChannel != null && payChannel > 0) {
orderInfo = await queryDetails(orderInfo.id);
OrderUtils.carryOnPay(
payChannel,
minService,
orderInfo,
(BaseData baseData) {
SmartDialog.showToast(
baseData?.msg == "ok" ? "订单支付成功" : baseData?.msg,
alignment: Alignment.center);
Future.delayed(Duration(seconds: 3), () {
_onRefresh();
});
},
);
}
}
payResult(BaseData baseData) {}
orderCancel(String orderId) async {
BaseData baseData =
await apiService.orderCancel(orderId).catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
SmartDialog.showToast("订单取消成功");
_onRefresh();
}else{
if(baseData.msg != null)
SmartDialog.showToast(baseData.msg,alignment: Alignment.center);
}
}
aginOrder(OrderInfo orderInfo) {
// Navigator.of(context).pushNamed(
// '/router/union_detail_page',
// arguments: {"id": storeId},
// );
// String storeId = (orderInfo != null &&
// orderInfo.storeVO != null)
// ? (orderInfo.storeVO.id ?? "")
// : "";
if (orderInfo.storeVO.posType.code == "NORMALSTORE") {
Scan.toScan(
context,
orderInfo.storeVO.id,
orderInfo.tenantCode,
orderInfo.storeVO.storeName,
);
} else {
Navigator.of(context).pushNamed(
'/router/store_order',
arguments: {
"id": orderInfo.storeVO.id,
"tenant": orderInfo.tenantCode,
"storeName": orderInfo.storeVO.storeName
},
);
}
}
@override
Widget build(BuildContext context) {
super.build(context);
return SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: true,
physics: BouncingScrollPhysics(),
header: MyHeader(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onRefresh: _onRefresh,
onLoading: queryOrder,
child: (orderInfos != null && orderInfos.length > 0)
? ListView.builder(
itemCount: orderInfos != null ? orderInfos.length : 0,
itemBuilder: (context, position) {
return InkWell(
onTap: () {
Navigator.of(context).pushNamed('/router/order_details',
arguments: {"id": orderInfos[position].id,"jumpState":2});
},
child: orderItem(orderInfos[position]),
);
})
: NoDataView(
src: "assets/image/ding_dan.webp",
isShowBtn: false,
text: "目前暂无订单,快去下一单吧~",
fontSize: 16.sp,
margin: EdgeInsets.only(top: 120),
),
);
}
String orderAllGoods(OrderInfo orderInfo) {
@ -535,130 +657,6 @@ class _OrderHistoryList extends State<OrderHistoryList>
);
}
minLogin(OrderInfo orderInfo) {
apiService.minLogin(orderInfo.storeId).catchError((onError) {
debugPrint(onError);
}).then((baseData) {
if (baseData != null && baseData.isSuccess) {
Map<String, dynamic> minStoreInfo = baseData.data;
String minToken = minStoreInfo["token"];
String tenant = orderInfo.tenantCode;
String storeId = orderInfo.storeId;
SharedPreferences.getInstance().then(
(value) => {
value.setString('minToken', minToken),
value.setString('tenant', tenant),
value.setString('storeId', storeId),
},
);
paySelected(
orderInfo,
MinApiService(
Dio(),
context: context,
token: minToken,
tenant: tenant,
storeId: storeId,
));
}
});
}
queryDetails(id) async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(Dio(),
context: context, token: value.getString("token"), showLoading: true);
}
BaseData<OrderInfo> baseData =
await apiService.orderDetail(id).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
return baseData.data;
}
}
UserInfo userInfo;
queryUserBalance() async {
BaseData<UserInfo> baseData =
await apiService.queryInfo().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
userInfo = baseData.data;
if (mounted) setState(() {});
}else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
paySelected(OrderInfo orderInfo, MinApiService minService) async {
var payChannel = await showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return OrderPaySelected(userInfo);
},
);
if (payChannel != null && payChannel > 0) {
orderInfo = await queryDetails(orderInfo.id);
OrderUtils.carryOnPay(
payChannel,
minService,
orderInfo,
(BaseData baseData) {
SmartDialog.showToast(
baseData?.msg == "ok" ? "订单支付成功" : baseData?.msg,
alignment: Alignment.center);
Future.delayed(Duration(seconds: 3), () {
_onRefresh();
});
},
);
}
}
payResult(BaseData baseData) {}
orderCancel(String orderId) async {
BaseData baseData =
await apiService.orderCancel(orderId).catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
SmartDialog.showToast("订单取消成功");
_onRefresh();
}else{
if(baseData.msg != null)
SmartDialog.showToast(baseData.msg,alignment: Alignment.center);
}
}
aginOrder(OrderInfo orderInfo) {
// Navigator.of(context).pushNamed(
// '/router/union_detail_page',
// arguments: {"id": storeId},
// );
// String storeId = (orderInfo != null &&
// orderInfo.storeVO != null)
// ? (orderInfo.storeVO.id ?? "")
// : "";
if (orderInfo.storeVO.posType.code == "NORMALSTORE") {
Scan.toScan(
context,
orderInfo.storeVO.id,
orderInfo.tenantCode,
orderInfo.storeVO.storeName,
);
} else {
Navigator.of(context).pushNamed(
'/router/store_order',
arguments: {
"id": orderInfo.storeVO.id,
"tenant": orderInfo.tenantCode,
"storeName": orderInfo.storeVO.storeName
},
);
}
}
String totalPrice(orderInfo) {
if (orderInfo == null) return "";
double totalPrice = (double.tryParse(orderInfo.orderSum) +

105
lib/retrofit/data/ip_data.dart

@ -0,0 +1,105 @@
/// ip : "27.18.151.119"
/// pro : "湖北省"
/// proCode : "420000"
/// city : "武汉市"
/// cityCode : "420100"
/// region : ""
/// regionCode : "0"
/// addr : "湖北省武汉市 电信"
/// regionNames : ""
/// err : ""
class IpData {
IpData({
String ip,
String pro,
String proCode,
String city,
String cityCode,
String region,
String regionCode,
String addr,
String regionNames,
String err,}){
_ip = ip;
_pro = pro;
_proCode = proCode;
_city = city;
_cityCode = cityCode;
_region = region;
_regionCode = regionCode;
_addr = addr;
_regionNames = regionNames;
_err = err;
}
IpData.fromJson(dynamic json) {
_ip = json['ip'];
_pro = json['pro'];
_proCode = json['proCode'];
_city = json['city'];
_cityCode = json['cityCode'];
_region = json['region'];
_regionCode = json['regionCode'];
_addr = json['addr'];
_regionNames = json['regionNames'];
_err = json['err'];
}
String _ip;
String _pro;
String _proCode;
String _city;
String _cityCode;
String _region;
String _regionCode;
String _addr;
String _regionNames;
String _err;
IpData copyWith({ String ip,
String pro,
String proCode,
String city,
String cityCode,
String region,
String regionCode,
String addr,
String regionNames,
String err,
}) => IpData( ip: ip ?? _ip,
pro: pro ?? _pro,
proCode: proCode ?? _proCode,
city: city ?? _city,
cityCode: cityCode ?? _cityCode,
region: region ?? _region,
regionCode: regionCode ?? _regionCode,
addr: addr ?? _addr,
regionNames: regionNames ?? _regionNames,
err: err ?? _err,
);
String get ip => _ip;
String get pro => _pro;
String get proCode => _proCode;
String get city => _city;
String get cityCode => _cityCode;
String get region => _region;
String get regionCode => _regionCode;
String get addr => _addr;
String get regionNames => _regionNames;
String get err => _err;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['ip'] = _ip;
map['pro'] = _pro;
map['proCode'] = _proCode;
map['city'] = _city;
map['cityCode'] = _cityCode;
map['region'] = _region;
map['regionCode'] = _regionCode;
map['addr'] = _addr;
map['regionNames'] = _regionNames;
map['err'] = _err;
return map;
}
}

159
lib/retrofit/data/member_recharge_list.dart

@ -0,0 +1,159 @@
/// id : "1681490552371019776"
/// rechargeMoney : "100.00"
/// giftdMoney : "10.00"
/// limitNum : 0
/// gitfdCouponId : null
/// startDate : null
/// endDate : null
/// startTime : null
/// endTime : null
/// tenantCode : "1175"
/// createTime : "2023-07-21 09:22:53"
/// isDeleted : 0
/// rechargeType : 0
/// remark : "充值100.00 赠送10.00"
/// sortValue : 0
/// useNum : 0
class MemberRechargeList {
MemberRechargeList({
String id,
String rechargeMoney,
String giftdMoney,
dynamic limitNum,
dynamic gitfdCouponId,
dynamic startDate,
dynamic endDate,
dynamic startTime,
dynamic endTime,
String tenantCode,
String createTime,
num isDeleted,
num rechargeType,
String remark,
num sortValue,
dynamic useNum,}){
_id = id;
_rechargeMoney = rechargeMoney;
_giftdMoney = giftdMoney;
_limitNum = limitNum;
_gitfdCouponId = gitfdCouponId;
_startDate = startDate;
_endDate = endDate;
_startTime = startTime;
_endTime = endTime;
_tenantCode = tenantCode;
_createTime = createTime;
_isDeleted = isDeleted;
_rechargeType = rechargeType;
_remark = remark;
_sortValue = sortValue;
_useNum = useNum;
}
MemberRechargeList.fromJson(dynamic json) {
_id = json['id'];
_rechargeMoney = json['rechargeMoney'];
_giftdMoney = json['giftdMoney'];
_limitNum = json['limitNum'];
_gitfdCouponId = json['gitfdCouponId'];
_startDate = json['startDate'];
_endDate = json['endDate'];
_startTime = json['startTime'];
_endTime = json['endTime'];
_tenantCode = json['tenantCode'];
_createTime = json['createTime'];
_isDeleted = json['isDeleted'];
_rechargeType = json['rechargeType'];
_remark = json['remark'];
_sortValue = json['sortValue'];
_useNum = json['useNum'];
}
String _id;
String _rechargeMoney;
String _giftdMoney;
dynamic _limitNum;
dynamic _gitfdCouponId;
dynamic _startDate;
dynamic _endDate;
dynamic _startTime;
dynamic _endTime;
String _tenantCode;
String _createTime;
num _isDeleted;
num _rechargeType;
String _remark;
num _sortValue;
dynamic _useNum;
MemberRechargeList copyWith({ String id,
String rechargeMoney,
String giftdMoney,
dynamic limitNum,
dynamic gitfdCouponId,
dynamic startDate,
dynamic endDate,
dynamic startTime,
dynamic endTime,
String tenantCode,
String createTime,
num isDeleted,
num rechargeType,
String remark,
num sortValue,
dynamic useNum,
}) => MemberRechargeList( id: id ?? _id,
rechargeMoney: rechargeMoney ?? _rechargeMoney,
giftdMoney: giftdMoney ?? _giftdMoney,
limitNum: limitNum ?? _limitNum,
gitfdCouponId: gitfdCouponId ?? _gitfdCouponId,
startDate: startDate ?? _startDate,
endDate: endDate ?? _endDate,
startTime: startTime ?? _startTime,
endTime: endTime ?? _endTime,
tenantCode: tenantCode ?? _tenantCode,
createTime: createTime ?? _createTime,
isDeleted: isDeleted ?? _isDeleted,
rechargeType: rechargeType ?? _rechargeType,
remark: remark ?? _remark,
sortValue: sortValue ?? _sortValue,
useNum: useNum ?? _useNum,
);
String get id => _id;
String get rechargeMoney => _rechargeMoney;
String get giftdMoney => _giftdMoney;
dynamic get limitNum => _limitNum;
dynamic get gitfdCouponId => _gitfdCouponId;
dynamic get startDate => _startDate;
dynamic get endDate => _endDate;
dynamic get startTime => _startTime;
dynamic get endTime => _endTime;
String get tenantCode => _tenantCode;
String get createTime => _createTime;
num get isDeleted => _isDeleted;
num get rechargeType => _rechargeType;
String get remark => _remark;
num get sortValue => _sortValue;
dynamic get useNum => _useNum;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = _id;
map['rechargeMoney'] = _rechargeMoney;
map['giftdMoney'] = _giftdMoney;
map['limitNum'] = _limitNum;
map['gitfdCouponId'] = _gitfdCouponId;
map['startDate'] = _startDate;
map['endDate'] = _endDate;
map['startTime'] = _startTime;
map['endTime'] = _endTime;
map['tenantCode'] = _tenantCode;
map['createTime'] = _createTime;
map['isDeleted'] = _isDeleted;
map['rechargeType'] = _rechargeType;
map['remark'] = _remark;
map['sortValue'] = _sortValue;
map['useNum'] = _useNum;
return map;
}
}

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;
}
}

24
lib/retrofit/data/store.dart

@ -1,8 +1,7 @@
import 'package:huixiang/retrofit/data/coupon_vo.dart';
import 'package:huixiang/retrofit/data/product_show.dart';
import 'package:huixiang/retrofit/data/store_type.dart';
class Store {
Store();
@ -38,9 +37,12 @@ class Store {
CouponVo couponVO;
dynamic deliveryInfo;
String businessType;
String businessService;
List<ProductShow> productShow;
StoreType posType;
factory Store.fromJson(Map<String, dynamic> json) => Store()
factory Store.fromJson(Map<String, dynamic> json) =>
Store()
..id = json['id'] as String
..createTime = json['createTime'] as String
..createUser = json['createUser'] as String
@ -72,12 +74,19 @@ class Store {
..headMobile = json['headMobile'] as String
..deliveryInfo = json['deliveryInfo']
..businessType = json['businessType'] as String
..couponVO = json['couponVO'] == null ? null : CouponVo.fromJson(json['couponVO'])
..businessService = json['businessService'] as String
..couponVO = json['couponVO'] == null ? null : CouponVo.fromJson(
json['couponVO'])
..productShow = (json['productShow'] as List)
?.map((e) =>
e == null ? null : ProductShow.fromJson(e as Map<String, dynamic>))
?.toList()
..posType = json['posType'] == null
? null
: StoreType.fromJson(json['posType'] as Map<String, dynamic>);
Map<String, dynamic> toJson() => <String, dynamic>{
Map<String, dynamic> toJson() =>
<String, dynamic>{
'id': this.id,
'createTime': this.createTime,
'createUser': this.createUser,
@ -109,10 +118,13 @@ class Store {
'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,
};
}

18
lib/retrofit/min_api.dart

@ -19,6 +19,7 @@ import 'data/activity_order_list.dart';
import 'data/findMiNiGroupList.dart';
import 'data/home_recommend_list.dart';
import 'data/launch_join_act.dart';
import 'data/member_recharge_list.dart';
import 'data/miNiDetail.dart';
import 'data/settleOrderInfo.dart';
import 'data/shoppingCart.dart';
@ -26,8 +27,8 @@ import 'data/shopping_home_config.dart';
part 'min_api.g.dart';
const localBaseUrl = "http://192.168.10.78:8765/app/";///
// const localBaseUrl = "http://pos-test.api.lotus-wallet.com/app/";///
// const localBaseUrl = "http://app-api.test.yixinhuixiang.com/app/";///
const localBaseUrl = "http://pos-test.api.lotus-wallet.com/app/";///
const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线
@ -49,7 +50,7 @@ abstract class MinApiService {
headers["tenant"] = tenant;
}
if (storeId != null && storeId != "") {
headers["store_id"] = storeId;
headers["store-id"] = storeId;
}
headers["Environment"] = "app";
dio.options = BaseOptions(
@ -67,7 +68,7 @@ abstract class MinApiService {
debugPrint("headers = ${options.headers}");
if (showLoading && !EasyLoading.isShow) {
//loading
EasyLoading.show(status: S.of(context).zhengzaijiazai);
EasyLoading.show(status: S.of(context).zhengzaijiazai,maskType: EasyLoadingMaskType.black);
}
if (options.data is FormData) {
debugPrint("params data = FormData");
@ -243,4 +244,13 @@ abstract class MinApiService {
@POST("promotion/useMemberCoupon")
Future<BaseData> useMemberCoupon(@Body() Map<String, dynamic> param);
///
@POST("/member/recharge")
Future<BaseData<dynamic>> memberRecharge(@Body() Map<String, dynamic> param);
///
@GET("/store/getRechargePreferential")
Future<BaseData<List<MemberRechargeList>>> memberRechargeList();
}

45
lib/retrofit/min_api.g.dart

@ -651,4 +651,49 @@ class _MinApiService implements MinApiService {
);
return value;
}
@override
Future<BaseData<dynamic>> memberRecharge(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/recharge',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<dynamic>.fromJson(
_result.data,
(json) => json as dynamic,
);
return value;
}
@override
Future<BaseData<List<MemberRechargeList>>> memberRechargeList() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/store/getRechargePreferential',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<List<MemberRechargeList>>.fromJson(
_result.data,
(json) => (json as List<dynamic>)
.map<MemberRechargeList>(
(i) => MemberRechargeList.fromJson(i as Map<String, dynamic>))
.toList());
return value;
}
}

101
lib/retrofit/retrofit_api.dart

@ -6,7 +6,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:gbk2utf8/gbk2utf8.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/retrofit/data/article.dart';
@ -14,7 +14,6 @@ import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/comunity_comment.dart';
import 'package:huixiang/retrofit/data/coupon.dart';
import 'package:huixiang/retrofit/data/farmers_list.dart';
import 'package:huixiang/retrofit/data/login_info.dart';
import 'package:huixiang/retrofit/data/order_info.dart';
import 'package:huixiang/view_widget/login_tips_dialog.dart';
import 'package:retrofit/retrofit.dart';
@ -41,6 +40,7 @@ import 'data/headlines_list.dart';
import 'data/headlines_list_details.dart';
import 'data/home_rank.dart';
import 'data/invitation_list.dart';
import 'data/ip_data.dart';
import 'data/logistics.dart';
import 'data/member_Infor.dart';
import 'data/member_comment_list.dart';
@ -49,7 +49,6 @@ import 'data/msg_stats.dart';
import 'data/page.dart';
import 'data/rank.dart';
import 'data/rechargeActLists.dart';
import 'data/recharge_list.dart';
import 'data/second_card_list.dart';
import 'data/sign_info.dart';
import 'data/social_info.dart';
@ -66,9 +65,15 @@ import 'data/wx_pay.dart';
part 'retrofit_api.g.dart';
const localBaseUrl = "http://192.168.10.78:8766/app/";///
// const localBaseUrl = "http://platform.test.api.lotus-wallet.com/app/";///
const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///线
// const localBaseUrl = "http://platform-api.test.yixinhuixiang.com/app/";///
const localBaseUrl = "http://platform.test.api.lotus-wallet.com/app/";///
const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";
///线
const ipBaseUrl = "http://whois.pconline.com.cn";
///ip
@RestApi(baseUrl: localBaseUrl)
abstract class ApiService {
@ -78,6 +83,7 @@ abstract class ApiService {
BuildContext context,
String token,
bool showLoading = false,
bool isIp = false,
bool pay = true,
}) {
Map<String, dynamic> headers =
@ -85,6 +91,8 @@ abstract class ApiService {
if (pay) {
headers["Environment"] = "app";
}
if (kReleaseMode) baseUrl = serviceBaseUrl;
if (isIp) baseUrl = ipBaseUrl;
dio.options = BaseOptions(
connectTimeout: 60000,
receiveTimeout: 60000,
@ -93,13 +101,16 @@ abstract class ApiService {
);
dio.interceptors.add(
InterceptorsWrapper(onRequest: (RequestOptions options) {
try {
debugPrint("\n======================= 请求数据 =======================");
debugPrint("method = ${options.method.toString()}");
debugPrint("url = ${options.uri.toString()}");
debugPrint("headers = ${options.headers}");
if (showLoading && !EasyLoading.isShow) {
//loading
EasyLoading.show(status: S.of(context).zhengzaijiazai);
EasyLoading.show(
status: S.of(context).zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
}
if (options.data is FormData) {
debugPrint("params data = FormData");
@ -107,20 +118,24 @@ abstract class ApiService {
debugPrint("params data = ${jsonEncode(options.data)}");
}
debugPrint("params queryParameters = ${options.queryParameters}");
} catch (e1) {}
}, onResponse: (Response response) {
try {
debugPrint("\n======================= 响应数据开始 =======================");
if (showLoading && EasyLoading.isShow) {
EasyLoading.dismiss();
}
debugPrint("code = ${response.statusCode}");
if (response.request.path != "/creditGoods/list")
p(jsonEncode(response.data));
// debugPrint(jsonEncode(response.data), wrapWidth: response.data.toString().length * 10);
Map map = response.data;
if (map["code"] != 0) {
EasyLoading.dismiss();
}
// if (map["code"] != 0) {
// EasyLoading.dismiss();
// }
if (map["code"] == 40005 || map["code"] == 40001) {
if (!LoginTipsDialog().isShow) {
print("show: ${LoginTipsDialog().isShow}");
@ -131,6 +146,7 @@ abstract class ApiService {
// SmartDialog.showToast(map["msg"], alignment: Alignment.center);
}
debugPrint("======================= 响应数据结束 =======================\n");
} catch (e2) {}
}, onError: (DioError e) {
if (EasyLoading.isShow) {
EasyLoading.dismiss();
@ -143,10 +159,6 @@ abstract class ApiService {
debugPrint("\n");
}),
);
if (kReleaseMode) {
baseUrl = serviceBaseUrl;
}
return _ApiService(dio, baseUrl: baseUrl);
}
@ -166,11 +178,12 @@ abstract class ApiService {
///
@POST("/file/upload")
@MultiPart()
Future<BaseData<UploadResult>> upload(
@Part(name: "file") File data, @Part(name: "folderId") int folderId,bool isVideo);
Future<BaseData<UploadResult>> upload(@Part(name: "file") File data,
@Part(name: "folderId") int folderId, bool isVideo);
///
@GET("https://restapi.amap.com/v3/place/around?key=542b46afa8e4b88fe1eb3c4d0ba0872f&location={lat},{lng}&keywords={keywords}&offset={size}&page={page}&extensions=all")
@GET(
"https://restapi.amap.com/v3/place/around?key=542b46afa8e4b88fe1eb3c4d0ba0872f&location={lat},{lng}&keywords={keywords}&offset={size}&page={page}&extensions=all")
Future<dynamic> searchPoi(@Path("lat") String lat, @Path("lng") String lng,
@Path("keywords") String keywords, int size, int page);
@ -184,7 +197,8 @@ abstract class ApiService {
///
@GET("/auth/sendVerify/{areaCode}/{mobile}")
Future<BaseData> sendVerify(@Path("areaCode") String areaCode, @Path("mobile") String mobile);
Future<BaseData> sendVerify(
@Path("areaCode") String areaCode, @Path("mobile") String mobile);
///
@POST("/creditGoods/list")
@ -221,8 +235,9 @@ abstract class ApiService {
Future<BaseData<dynamic>> recharge(@Body() Map<String, dynamic> param);
///
@GET("/wallet/rechargeActList")
Future<BaseData<RechargeActLists>> rechargeActList();
@GET("/wallet/rechargeActList?tenantCode={tenantCode}")
Future<BaseData<RechargeActLists>> rechargeActList(
@Path("tenantCode") String tenantCode);
///
@GET("/coupon/receive?couponId={couponId}")
@ -298,11 +313,13 @@ abstract class ApiService {
///
@POST("/information/list")
Future<BaseData<PageInfo<Article>>> queryArticle(@Body() Map<String, dynamic> param);
Future<BaseData<PageInfo<Article>>> queryArticle(
@Body() Map<String, dynamic> param);
///banner查询
@POST("/banner/page")
Future<BaseData<PageInfo<BannerData>>> queryBanner(@Body() Map<String, dynamic> param);
Future<BaseData<PageInfo<BannerData>>> queryBanner(
@Body() Map<String, dynamic> param);
///
@GET("/home/brand")
@ -404,11 +421,13 @@ abstract class ApiService {
///
@POST("/information/trend-list")
Future<BaseData<PageInfo<ComunityComment>>> trendList(@Body() Map<String, dynamic> map);
Future<BaseData<PageInfo<ComunityComment>>> trendList(
@Body() Map<String, dynamic> map);
/// /
@POST("/member/follow/list")
Future<BaseData<PageInfo<ListData>>> followList(@Body() Map<String, dynamic> map);
Future<BaseData<PageInfo<ListData>>> followList(
@Body() Map<String, dynamic> map);
////
@PUT("/member/follow/{followId}")
@ -428,11 +447,13 @@ abstract class ApiService {
///
@GET("/course/catalogList/{courseId}")
Future<BaseData<List<Chapter>>> catalogList(@Path("courseId") String courseId);
Future<BaseData<List<Chapter>>> catalogList(
@Path("courseId") String courseId);
///
@POST("/course/list")
Future<BaseData<PageInfo<CourseList>>> courseList(@Body() Map<String, dynamic> map);
Future<BaseData<PageInfo<CourseList>>> courseList(
@Body() Map<String, dynamic> map);
///
@GET("/course/collectList")
@ -440,7 +461,8 @@ abstract class ApiService {
///
@GET("/course/collect/{collectId}")
Future<BaseData<List<CourseList>>> collect(@Path("collectId") String collectId);
Future<BaseData<List<CourseList>>> collect(
@Path("collectId") String collectId);
///
@GET("/course/{id}")
@ -452,11 +474,14 @@ abstract class ApiService {
/// APP查询所有成就徽章
@POST("/app-memberAchievement/findBadges")
Future<BaseData<List<VipBadgesList>>> findBadges(@Body() Map<String, dynamic> map);
Future<BaseData<List<VipBadgesList>>> findBadges(
@Body() Map<String, dynamic> map);
///
@GET("/app-memberAchievement/getAchievementDetail?achievementCategoryId={achievementCategoryId}")
Future<BaseData<List<AchievementDetailList>>> getAchievementDetail(@Path("achievementCategoryId") String achievementCategoryId);
@GET(
"/app-memberAchievement/getAchievementDetail?achievementCategoryId={achievementCategoryId}")
Future<BaseData<List<AchievementDetailList>>> getAchievementDetail(
@Path("achievementCategoryId") String achievementCategoryId);
///
@GET("/member/benefitList")
@ -480,7 +505,8 @@ abstract class ApiService {
///
@GET("/creditOrder/getAppShippingTrace?orderId={orderId}")
Future<BaseData<Logistics>> getAppShippingTrace(@Path("orderId") String orderId);
Future<BaseData<Logistics>> getAppShippingTrace(
@Path("orderId") String orderId);
///
@POST("/member/rankBuy")
@ -492,11 +518,13 @@ abstract class ApiService {
///
@GET("/information/category/{id}")
Future<BaseData<HeadlinesListDetails>> headlinesDetails(@Path("id") String id);
Future<BaseData<HeadlinesListDetails>> headlinesDetails(
@Path("id") String id);
///
@POST("/member/inviteMemberList")
Future<BaseData<PageInfo<InvitationList>>> inviteMemberList(@Body() Map<String, dynamic> map);
Future<BaseData<PageInfo<InvitationList>>> inviteMemberList(
@Body() Map<String, dynamic> map);
///
@GET("/coupon/wiped/{memberCouponId}")
@ -564,5 +592,10 @@ abstract class ApiService {
///
@GET("/store/storeListByCreditId/{creditGoodsId}")
Future<BaseData<List<Store>>> storeListByCreditId(@Path("creditGoodsId") String creditGoodsId);
Future<BaseData<List<Store>>> storeListByCreditId(
@Path("creditGoodsId") String creditGoodsId);
///APP门店推广渠道
@GET("/ipJson.jsp")
Future<IpData> getIpInfo();
}

59
lib/retrofit/retrofit_api.g.dart

@ -26,12 +26,9 @@ class _ApiService implements ApiService {
String fileName = data.path.split(Platform.pathSeparator).last;
if (!isVideo && !fileName.contains(".jpeg") && !fileName.contains(".png"))
fileName += ".jpeg";
else if(isVideo && !fileName.contains(".mp4"))
fileName += ".mp4";
else if (isVideo && !fileName.contains(".mp4")) fileName += ".mp4";
_data.files.add(MapEntry(
'file',
MultipartFile.fromFileSync(data.path,
filename: fileName)));
'file', MultipartFile.fromFileSync(data.path, filename: fileName)));
print("filename:$fileName");
if (folderId != null) {
_data.fields.add(MapEntry('folderId', folderId.toString()));
@ -322,12 +319,12 @@ class _ApiService implements ApiService {
}
@override
Future<BaseData<RechargeActLists>> rechargeActList() async {
Future<BaseData<RechargeActLists>> rechargeActList(tenantCode) async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/wallet/rechargeActList',
'/wallet/rechargeActList?tenantCode=$tenantCode',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
@ -592,7 +589,9 @@ class _ApiService implements ApiService {
data: _data);
final value = BaseData<List<Store>>.fromJson(
_result.data,
(json) => (json as List<dynamic>)
(json) => ((json ?? "") == "")
? null
: (json as List<dynamic>)
.map<Store>((i) => Store.fromJson(i as Map<String, dynamic>))
.toList());
return value;
@ -885,7 +884,9 @@ class _ApiService implements ApiService {
data: _data);
final value = BaseData<PageInfo<OrderInfo>>.fromJson(
_result.data,
(json) => ((json??"") == "")?null:PageInfo<OrderInfo>.fromJson(
(json) => ((json ?? "") == "")
? null
: PageInfo<OrderInfo>.fromJson(
json,
(json) => OrderInfo.fromJson(json),
),
@ -1881,7 +1882,8 @@ class _ApiService implements ApiService {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>('coupon/detail/$memberCouponId',
final _result = await _dio.request<Map<String, dynamic>>(
'coupon/detail/$memberCouponId',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
@ -2051,7 +2053,8 @@ class _ApiService implements ApiService {
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/member/updatePayPwd',
final _result = await _dio.request<Map<String, dynamic>>(
'/member/updatePayPwd',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
@ -2073,7 +2076,8 @@ class _ApiService implements ApiService {
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/member/verifyByUpdatePayPwd',
final _result = await _dio.request<Map<String, dynamic>>(
'/member/verifyByUpdatePayPwd',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
@ -2093,8 +2097,7 @@ class _ApiService implements ApiService {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/vipCard/index',
final _result = await _dio.request<Map<String, dynamic>>('/vipCard/index',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
@ -2109,6 +2112,22 @@ class _ApiService implements ApiService {
return value;
}
@override
Future<IpData> getIpInfo() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<List<int>>('/ipJson.jsp',
queryParameters: queryParameters,
options: RequestOptions(method: 'GET', extra: _extra, baseUrl: baseUrl,responseType: ResponseType.bytes),
data: _data);
var ts = gbk.decode(_result.data);
final value = IpData.fromJson(jsonDecode(ts
.substring(ts.indexOf("{\"ip\":\""))
.replaceAll(");}", "")));
return value;
}
@override
Future<BaseData<dynamic>> orderVip(param) async {
ArgumentError.checkNotNull(param, 'param');
@ -2116,7 +2135,8 @@ class _ApiService implements ApiService {
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/vipCard/orderVip',
final _result = await _dio.request<Map<String, dynamic>>(
'/vipCard/orderVip',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
@ -2136,8 +2156,7 @@ class _ApiService implements ApiService {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/raise/products',
final _result = await _dio.request<Map<String, dynamic>>('/raise/products',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
@ -2161,7 +2180,8 @@ class _ApiService implements ApiService {
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/auth/changePhone',
final _result = await _dio.request<Map<String, dynamic>>(
'/auth/changePhone',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
@ -2216,8 +2236,7 @@ class _ApiService implements ApiService {
final value = BaseData<List<Store>>.fromJson(
_result.data,
(json) => (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());
return value;
}

2
lib/setting/account_security_page.dart

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

2
lib/setting/treaty_page.dart

@ -23,7 +23,7 @@ class _TreatyPage extends State<TreatyPage> {
@override
void 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.isIOS) WebView.platform = CupertinoWebView();
}

2
lib/setting/user_service_page.dart

@ -25,7 +25,7 @@ class _UserServicePage extends State<UserServicePage> with WidgetsBindingObserve
void initState() {
super.initState();
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.isIOS) WebView.platform = CupertinoWebView();
}

18
lib/settlement/settlement.dart

@ -140,7 +140,7 @@ class _Settlement extends State<Settlement> {
storeId: storeId,
showLoading: false);
queryMemberInfo();
if (promotions != null && promotions != "" && tableId <= 0) {
if (widget.arguments["pid"] != null && widget.arguments["pid"] != "" && tableId <= 0) {
queryOrderInfo(
address != null ? address.id : null,
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true &&
@ -155,13 +155,13 @@ class _Settlement extends State<Settlement> {
productSkuId ?? "",
actProductId ?? "",
actProductSkuId ?? "",
"ACTIVITY",
"AUTO",
// useVipPriceSelect,
// useBenefitSelect,
count1,
payChannel,
tableId);
} else if (coupons != null && coupons != "" && tableId <= 0) {
} else if ( widget.arguments["cid"] != null && widget.arguments["cid"] != "" && tableId <= 0) {
queryOrderInfo(
address != null ? address.id : null,
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true &&
@ -170,13 +170,13 @@ class _Settlement extends State<Settlement> {
selectedBtn != 2)
? diningStatus
: selectedBtn,
widget.arguments["cid"],
widget.arguments["cid"]??0,
0,
productId ?? 0,
productSkuId ?? "",
actProductId ?? "",
actProductSkuId ?? "",
"COUPON",
"AUTO",
// useVipPriceSelect,
// useBenefitSelect,
count1,
@ -228,7 +228,7 @@ class _Settlement extends State<Settlement> {
payChannel,
tableId) async {
try {
EasyLoading.show(status: S.current.zhengzaijiazai);
EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
BaseData<SettleOrderInfo> baseData = await minService.getOrderInfo({
"addressId": addressId,
@ -329,7 +329,7 @@ class _Settlement extends State<Settlement> {
///
queryOrderDetails(id) async {
EasyLoading.show(status: S.current.zhengzaijiazai);
EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
BaseData<MinOrderInfo> baseData = await minService.getOrderDetails({
"id": pageType != null ? widget.arguments["orderId"] : id ?? parentId,
}).catchError((error) {});
@ -632,7 +632,7 @@ class _Settlement extends State<Settlement> {
print("error: $error");
});
if (baseData != null && baseData.isSuccess) {
EasyLoading.show(status: S.current.zhengzaijiazai);
EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
placeOrder = true;
this.downOrder = DownOrder.fromJson(baseData.data);
querySettlement();
@ -1383,7 +1383,7 @@ class _Settlement extends State<Settlement> {
0,
(settleOrderInfo.isRaise || payChannel == 5)
? ""
: promotion?.id ?? productId,
: widget.arguments["pid"] ?? (promotion?.id ?? productId),
productSkuId ?? "",
actProductId ?? "",
actProductSkuId ?? "",

4
lib/settlement/settlement_view/pay_method.dart

@ -287,9 +287,7 @@ class _PayMethod extends State<PayMethod> {
),
),
if(mRaiseMoney !="0" && (widget.tableId > 0 ? !(widget?.minOrderInfo?.isRaise ?? false) : !(widget?.settleOrderInfo?.isRaise ?? false)))
SizedBox(
height: 10,
),
if(widget.tableId > 0 ? !(widget?.minOrderInfo?.isRaise ?? false) : !(widget?.settleOrderInfo?.isRaise ?? false))
GestureDetector(
behavior: HitTestBehavior.opaque,

4
lib/store/shop_details_page.dart

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

2
lib/store/shopping/shopping_goods_details.dart

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

2
lib/store/shopping/shopping_mall_home.dart

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

35
lib/store/store_order.dart

@ -97,12 +97,13 @@ class _StoreOrderPage extends State<StoreOrderPage>
///
minLogin(SharedPreferences shared) async {
EasyLoading.show(status: S.of(context).zhengzaijiazai);
EasyLoading.show(
status: S.of(context).zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
apiService = ApiService(
Dio(),
context: context,
token: shared.getString('token'),
showLoading: true,
);
apiService.minLogin(storeId).catchError((onError) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type),
@ -128,8 +129,6 @@ class _StoreOrderPage extends State<StoreOrderPage>
storeId: storeId,
);
EasyLoading.dismiss();
queryMemberInfo();
queryShopCar().then((value) {
@ -207,7 +206,6 @@ class _StoreOrderPage extends State<StoreOrderPage>
setState(() {});
}
}
EasyLoading.dismiss();
}
RefreshController refreshController;
@ -330,7 +328,10 @@ class _StoreOrderPage extends State<StoreOrderPage>
CrossAxisAlignment.start,
children: [
///
StoreInfoView(storeInfo),
StoreInfoView(
storeInfo,
widget.arguments["distance"],
),
// Padding(padding:EdgeInsets.only(left: 14.w),
// child: Text(
// S.of(context).diandan,
@ -660,7 +661,6 @@ class _StoreOrderPage extends State<StoreOrderPage>
"distance": widget.arguments["distance"],
"vipLevelName": memberVo?.memberRankVo?.rankName ?? "",
"isVips": memberVo?.isVip ?? false,
"distance": widget.arguments["distance"],
"subscribeParam": miNiDetail?.subscribeParam,
},
);
@ -757,7 +757,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
///
_queryMiNiDetail(String id, int count) async {
EasyLoading.show(status: S.current.zhengzaijiazai);
EasyLoading.show(
status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
if (count < 0) {
shopCarGoods.shoppingCartSkuItemList.forEach((element) async {
if (element.productId == id) {
@ -1058,17 +1059,17 @@ class _Title extends State<Title> {
double maxScrollExtent = widget.controller.position.maxScrollExtent;
double alphaHeight = (kToolbarHeight) / 2;
double alphaProgress = maxScrollExtent - widget.controller.offset;
double alphatemp = 0;
double alphaTemp = 0;
if (alphaProgress <= 1) {
alphatemp = 1;
alphaTemp = 1;
} else if (alphaProgress <= alphaHeight) {
alphatemp =
alphaTemp =
(((alphaHeight - alphaProgress) / alphaHeight) > 0.5) ? 1 : 0;
} else {
alphatemp = 0;
alphaTemp = 0;
}
if (alpha != alphatemp && mounted) {
alpha = alphatemp;
if (alpha != alphaTemp && mounted) {
alpha = alphaTemp;
print("object: $alpha");
widget.scrollChange(alpha);
setState(() {});
@ -1080,10 +1081,12 @@ class _Title extends State<Title> {
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(bottom: 38.h),
child: Text(
child: alpha == 0
? null
: Text(
widget.title ?? "",
style: TextStyle(
color: Colors.black.withOpacity(alpha),
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 18.sp,
),

4
lib/store/store_view/product_sku.dart

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

10
lib/store/store_view/shop_goods.dart

@ -497,6 +497,7 @@ class _ShopGoods extends State<ShopGoods> {
SizedBox(
height: 4.h,
),
///VIP价格
// if (widget.productListBean.vipPrice != null)
// Row(
@ -645,9 +646,12 @@ class _ShopGoods extends State<ShopGoods> {
//
// http://miniscan.lotus-wallet.com/placeorder?tenant_code=1194&table_id=1669609340031467520&store_id=1637659387134738432
Uri uri = Uri.parse(result);
String tableId = uri.queryParameters["tableId"] ?? uri.queryParameters["table_id"];
String tenantCode = uri.queryParameters["tenantCode"] ?? uri.queryParameters["tenant_code"];
String shopId = uri.queryParameters["shopId"] ?? uri.queryParameters["store_id"];
String tableId =
uri.queryParameters["tableId"] ?? uri.queryParameters["table_id"];
String tenantCode = uri.queryParameters["tenantCode"] ??
uri.queryParameters["tenant_code"];
String shopId =
uri.queryParameters["shopId"] ?? uri.queryParameters["store_id"];
if (tableId != null &&
tableId != "" &&
tenantCode != null &&

2
lib/store/store_view/store_header.dart

@ -43,7 +43,7 @@ class StoreHeader extends SliverPersistentHeaderDelegate {
child: Column(
children: [
///
StoreInfoView(storeInfo),
StoreInfoView(storeInfo,0),
///
if (storeInfo != null && storeInfo.couponVOList != null)

25
lib/store/store_view/store_info.dart

@ -11,8 +11,9 @@ import 'package:url_launcher/url_launcher.dart';
class StoreInfoView extends StatefulWidget {
final StoreInfo storeInfo;
final double distance;
StoreInfoView(this.storeInfo);
StoreInfoView(this.storeInfo,this.distance);
@override
State<StatefulWidget> createState() {
@ -172,13 +173,14 @@ class _StoreInfoView extends State<StoreInfoView> {
arguments: {
"lat": widget.storeInfo.latitude,
"lng": widget.storeInfo.longitude,
"storeName": widget.storeInfo.storeName,
"storeInfo":widget.storeInfo,
"distance":widget.distance
},
);
},
child:Container(
color: Colors.transparent,
padding:EdgeInsets.only(right: 8.w) ,
padding:EdgeInsets.only(right: 8.w,bottom: 16.h) ,
child: Image.asset(
"assets/image/icon_union_location.webp",
width: 20,
@ -190,15 +192,21 @@ class _StoreInfoView extends State<StoreInfoView> {
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
if(widget.storeInfo.longitude != null && widget.storeInfo.latitude != null){
Navigator.of(context).pushNamed(
'/router/location_map',
arguments: {
"lat": widget.storeInfo.latitude,
"lng": widget.storeInfo.longitude,
"storeName": widget.storeInfo.storeName,
"storeInfo":widget.storeInfo,
"distance":widget.distance
},
);
}else{
return;
}
},
child:Padding(padding: EdgeInsets.only(bottom: 16.h,),
child: Text(
"${S.of(context).dizhi}:${widget.storeInfo != null ? widget.storeInfo.address : ""}",
maxLines: 2,
@ -211,7 +219,7 @@ class _StoreInfoView extends State<StoreInfoView> {
),
),
),
),
if((widget?.storeInfo?.tel ?? "") != "")
GestureDetector(
behavior: HitTestBehavior.opaque,
@ -219,7 +227,7 @@ class _StoreInfoView extends State<StoreInfoView> {
showCallMobile();
},
child: Container(
padding:EdgeInsets.only(left: 16.w,right: 8.w) ,
padding:EdgeInsets.only(left: 16.w,right: 8.w,bottom: 16.h) ,
child: Image.asset(
"assets/image/icon_union_call.webp",
width: 24,
@ -233,7 +241,6 @@ class _StoreInfoView extends State<StoreInfoView> {
width: double.infinity,
height: 1,
color: Color(0xFFF4F5F2),
margin: EdgeInsets.only(top: 16),
)
],
),
@ -291,8 +298,8 @@ class _StoreInfoView extends State<StoreInfoView> {
text: "$e",
backgroup: Color(0xFFFF7A1A),
padding: EdgeInsets.only(
left: 2.w,
right: 2.w,
left: 4.w,
right: 4.w,
),
fontSize: 10.sp,
textColor: Colors.white,

1128
lib/union/location_map_page.dart

File diff suppressed because it is too large Load Diff

511
lib/union/union_list.dart

@ -1,28 +1,37 @@
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.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_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/store.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/border_text.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/utils/location.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/request_permission.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:shimmer/shimmer.dart';
import '../retrofit/data/base_data.dart';
import '../retrofit/data/product_show.dart';
import '../retrofit/retrofit_api.dart';
import '../utils/flutter_utils.dart';
import '../view_widget/classic_header.dart';
import '../view_widget/no_data_view.dart';
import '../view_widget/round_button.dart';
class UnionList extends StatefulWidget {
final RefreshController refreshController;
final List<Store> storeList;
final Function onRefresh;
final Function queryStore;
UnionList(this.refreshController,this.storeList,this.onRefresh,this.queryStore);
final String serviceType;
final BMFCoordinate latLng;
final String searchKey;
final String city;
UnionList(Key key, this.serviceType, this.latLng, this.searchKey, this.city)
: super(key: key);
@override
State<StatefulWidget> createState() {
@ -30,76 +39,99 @@ class UnionList extends StatefulWidget {
}
}
class _UnionList extends State<UnionList> {
final TextEditingController editingController = TextEditingController();
class _UnionList extends State<UnionList> with AutomaticKeepAliveClientMixin {
ApiService apiService;
List<Store> storeList;
BMFCoordinate latLng;
final RefreshController _refreshController = RefreshController();
@override
bool get wantKeepAlive => true;
@override
void initState() {
super.initState();
queryStore();
}
queryStore() async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData<List<Store>> baseData = await apiService.queryStore({
"city": widget.city ?? "",
// "district": district,
// "province": province,
"latitude": (widget.latLng?.latitude ?? "").toString(),
"longitude": (widget.latLng?.longitude ?? "").toString(),
if (widget.searchKey != "") "searchKey": widget.searchKey,
"serviceType": widget.serviceType,
"exchange": false,
}).catchError((error) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
alignment: Alignment.center);
_refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
storeList = baseData.data;
_refreshController.refreshCompleted();
} else {
_refreshController.refreshFailed();
}
EasyLoading.dismiss();
setState(() {});
}
@override
Widget build(BuildContext context) {
return Column(
children: [
buildSearchItem(),
Container(
height: MediaQuery.of(context).size.height -
103.h -
MediaQuery.of(context).padding.top,
child: SmartRefresher(
controller: widget.refreshController,
enablePullUp: false,
return SmartRefresher(
controller: _refreshController,
enablePullDown: true,
enablePullUp: false,
header: MyHeader(
color: Colors.white,
),
physics: BouncingScrollPhysics(),
header: MyHeader(),
onRefresh: widget.onRefresh,
child: (widget.storeList == null || widget.storeList.length == 0)
onRefresh: queryStore,
child: (storeList == null || storeList.length == 0)
? NoDataView(
src: "assets/image/di_zhi.webp",
isShowBtn: false,
text: "暂无店铺列表~",
text: ((widget.city??"") != "武汉" && (widget.city??"") != "郑州" && (widget.city??"") != "北京") ?
" 当前回乡开放门店 仅包含 武汉/北京/郑州,您当前的位置无法获取,请手动更换城市" :"暂无店铺列表~",
fontSize: 16.sp,
margin: EdgeInsets.only(top: 120.h),
):ListView.builder(
itemCount:widget.storeList == null ? 0 : widget.storeList.length,
margin: EdgeInsets.only(top: 120.h,left:45.w,right:45.w),
)
: ListView.builder(
itemCount: storeList.length,
padding: EdgeInsets.only(
top: 8.h,
bottom: 100.h, /* + (375.h - 88.h) + 4.h*/
bottom: 100.h,
),
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return InkWell(
onTap: () {
// if (widget.storeList[position].posType.code == "NORMALSTORE") {
// showDeleteDialog();
// }
// else
// if ( widget.storeList[position].storeName == "一心回乡商城") {
// Navigator.of(context).pushNamed(
// '/router/shopping_mall_home',
// arguments: {
// "type": 0,
// "id": widget.storeList[position].id,
// "tenant": widget.storeList[position].tenantCode,
// "storeName": widget.storeList[position].storeName
// },
// );
// }
// else
{
Navigator.of(context).pushNamed(
'/router/store_order',
arguments: {
"id": widget.storeList[position].id,
"tenant": widget.storeList[position].tenantCode,
"storeName": widget.storeList[position].storeName,
"distance":widget.storeList[position].distance
"id": storeList[position].id,
"tenant": storeList[position].tenantCode,
"storeName": storeList[position].storeName,
"distance": storeList[position].distance
},
);
}
},
child:
buildStoreItem(widget.storeList[position], position),
child: buildStoreItem(storeList[position], position),
);
})),
)
],
},
),
);
}
@ -124,7 +156,8 @@ class _UnionList extends State<UnionList> {
height: 140.h,
),
),
Padding(padding: EdgeInsets.only(left: 6.w,bottom: 5.h,top: 12.h),
Padding(
padding: EdgeInsets.only(left: 6.w, bottom: 5.h, top: 12.h),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
@ -136,7 +169,12 @@ class _UnionList extends State<UnionList> {
width: 108.w,
height: 20.h,
),
),),Padding(padding: EdgeInsets.only(left: 6.w,),
),
),
Padding(
padding: EdgeInsets.only(
left: 6.w,
),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
@ -148,68 +186,212 @@ class _UnionList extends State<UnionList> {
width: 260.w,
height: 20.h,
),
),),
),
),
],
),
);
}
Widget buildSearchItem() {
Widget buildStoreItem(Store store, position) {
return Container(
height: 36.h,
margin: EdgeInsets.fromLTRB(6.w, 0, 14.w, 0),
padding: EdgeInsets.fromLTRB(0, 6.h, 0, 6.h),
margin: EdgeInsets.fromLTRB(16.w, 8.h, 16.w, 12.h),
padding: EdgeInsets.symmetric(horizontal:12.w,vertical: 12.h),
decoration: BoxDecoration(
color: Color(0xFFF5FAF7),
borderRadius: BorderRadius.circular(4),
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(6)),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
color: Colors.black.withAlpha(25),
offset: Offset(0, 1),
blurRadius: 12,
spreadRadius: 0,
)
]),
width: double.infinity,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Stack(
children: [
MImage(
store.facade,
width: 74.h,
height: 74.h,
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,
),
),
)
],
),
child: TextField(
textInputAction: TextInputAction.search,
onEditingComplete: () {
FocusScope.of(context).requestFocus(FocusNode());
widget.queryStore(editingController.text);
},
controller: editingController,
cursorHeight: 25.h,
decoration: InputDecoration(
contentPadding: EdgeInsets.symmetric(
vertical: 12.h,
SizedBox(
width: 12.w,
),
prefixIcon:InkWell(
onTap: () {
widget.queryStore(editingController.text);
},
child: Icon(
Icons.search,
size: 24,
color: Colors.black,
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,
),
),
suffixIcon: InkWell(
onTap: () {
editingController.clear();
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),
if (store.distance != null)
Image.asset(
"assets/image/icon_union_location_black.webp",
fit: BoxFit.fill,
height: 12,
width: 12,
),
SizedBox(width: 4.w),
if (store.distance != null)
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 : "")),
),
if (storeList[position].productShow != null)
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:BouncingScrollPhysics(),
itemBuilder: (context, index) {
return GestureDetector(
onTap: () {},
child: unionGoodsItem(
storeList[position].productShow[index]),
);
},
child: Icon(
Icons.close,
size: 19,
color: Colors.grey,
),
),
border: InputBorder.none,
],
))
],
),
);
}
///
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: RoundButton(
height: 17.h * AppUtils.textScale(context),
text: "$e",
backgroup: Color(0xFFF65720),
padding: EdgeInsets.only(
left: 4.w,
right: 4.w,
),
fontSize: 10.sp,
textColor: Colors.white,
),
))
.toList();
}
Widget unionGoodsItem(ProductShow productShow) {
return Container(
width: 74.h,
margin: EdgeInsets.only(right: 8.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
MImage(
productShow?.imgs[0] ?? "",
width: 74.h,
height: 74.h,
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,
),
),
),
],
),
);
}
Widget buildStoreItem(Store store, position) {
//ui
Widget buildStoreItems(Store store, position) {
return Container(
margin: EdgeInsets.fromLTRB(16.w, 8.h, 16.w, 12.h),
decoration: BoxDecoration(
@ -293,7 +475,8 @@ class _UnionList extends State<UnionList> {
SizedBox(
height: 5.h,
),
Expanded(child: Text(
Expanded(
child: Text(
"${S.of(context).dizhi}:${store.address}",
maxLines: 2,
overflow: TextOverflow.ellipsis,
@ -302,7 +485,8 @@ class _UnionList extends State<UnionList> {
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),)
),
)
],
)),
if (store.distance != null)
@ -322,7 +506,8 @@ class _UnionList extends State<UnionList> {
((store.distance ?? 0) / 1000 * 100).toInt() /
100.0)
: S.of(context).mi(
((store.distance ?? 0) * 100).toInt() / 100.0),
((store.distance ?? 0) * 100).toInt() /
100.0),
style: TextStyle(
color: Color(0xFFFFFFFF),
fontSize: 10.sp,
@ -339,130 +524,4 @@ class _UnionList extends State<UnionList> {
),
);
}
///
showDeleteDialog() {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
content: Container(
width: MediaQuery.of(context).size.width - 84.w,
height: 130.h,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"您即将进行扫码点餐",
style: TextStyle(
fontSize: 17.sp,
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
SizedBox(
height: 30.h,
),
Row(
children: [
Expanded(
child: InkWell(
child: BorderText(
text: "取消",
textColor: Color(0xFF32A060),
fontSize: 16.sp,
fontWeight: FontWeight.bold,
borderColor: Color(0xFF32A060),
radius: 4,
padding: EdgeInsets.all(12),
borderWidth: 1,
),
onTap: () {
Navigator.of(context).pop();
},
),
flex: 1,
),
SizedBox(
width: 16.w,
),
Expanded(
child: InkWell(
child: RoundButton(
text: "确定",
textColor: Colors.white,
radius: 4,
padding: EdgeInsets.all(12),
backgroup: Color(0xFF32A060),
fontSize: 16.sp,
fontWeight: FontWeight.bold,
),
onTap: () {
toScan();
Navigator.of(context).pop();
},
),
flex: 1,
),
],
)
],
),
),
);
},
);
}
///
toScan() async {
if (await Permission.camera.isPermanentlyDenied) {
showCupertinoDialog(
context: context,
builder: (context) {
return RequestPermission(
"assets/image/icon_camera_permission_tips.webp",
S.of(context).ninxiangjiquanxianweikaiqi,
S.of(context).weilekaipaizhaoxuanzhetouxiang,
S.of(context).kaiqiquanxian,
(result) async {
if (result) {
await openAppSettings();
}
},
heightRatioWithWidth: 0.82,
);
});
} else if (await Permission.camera.isGranted) {
// http://pos.app.gznl.top/placeorder/?tableId=1315903669597634560&tenantCode=1166&shopId=1300372027722432512
//
// 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');
// String result = await scanner.scan();
Uri uri = Uri.parse(result);
String tableId = uri.queryParameters["tableId"] ?? uri.queryParameters["table_id"];
String tenantCode = uri.queryParameters["tenantCode"] ?? uri.queryParameters["tenant_code"];
String shopId = uri.queryParameters["shopId"] ?? uri.queryParameters["store_id"];
if (tableId != null &&
tableId != "" &&
tenantCode != null &&
tenantCode != "" &&
shopId != null &&
shopId != "") {
Navigator.of(context).pushNamed(
'/router/store_order',
arguments: {
"id": shopId,
"tenant": tenantCode,
"storeName": "",
"tableId": int.tryParse(tableId),
},
);
}
} else {
await Permission.camera.request();
}
}
}

942
lib/union/union_page.dart

File diff suppressed because it is too large Load Diff

372
lib/union/union_select_city.dart

@ -0,0 +1,372 @@
import 'dart:convert';
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import '../retrofit/data/ip_data.dart';
import '../retrofit/retrofit_api.dart';
class UnionSelectCity extends StatefulWidget {
final Map<String, dynamic> arguments;
UnionSelectCity({this.arguments});
@override
State<StatefulWidget> createState() {
return _UnionSelectCity();
}
}
class _UnionSelectCity extends State<UnionSelectCity> {
RefreshController refreshController = RefreshController();
Map<String, dynamic> areaMap;
ApiService apiIpService;
String ipName;
int ipState = 0;
List<String> hotCity = [];
List<String> areaList = [];
@override
void initState() {
super.initState();
areaCode();
queryIpInfo();
}
void areaCode({String searchTxt}) async {
var value =
await rootBundle.loadString('assets/map_style/chinese_cities.json');
areaList.clear();
areaMap = jsonDecode(value);
hotCity = (areaMap["热门城市"] as List).map((e) {
return e["area"].toString();
}).toList();
areaMap.remove("热门城市");
Map<String, dynamic> tempAreaMap = jsonDecode(value);
areaMap.forEach((key, value) {
if (searchTxt != null && searchTxt.trim() != "")
value.forEach((element) {
if (!element["area"].contains(searchTxt))
(tempAreaMap[key] as List)
.removeWhere((el) => el["area"] == element["area"]);
});
if (tempAreaMap[key].isNotEmpty) areaList.add(key);
});
areaMap = tempAreaMap;
setState(() {});
}
queryIpInfo() async {
apiIpService = ApiService(
Dio(),
context: context,
isIp: true
);
IpData baseData = await apiIpService.getIpInfo().catchError((onError) {});
if (baseData?.city != null) {
ipName = baseData.city.replaceAll("", "");
if(ipName != widget.arguments["cityName"] ){
ipState=2;
setState((){});
}
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: false,
backgroundColor: Color(0xFFF0F0F0),
body: Container(
color: Color(0xFFF0F0F0),
child: Column(
children: [
Container(
color: Colors.white,
padding: EdgeInsets.only(left: 14.w, top: 44.h, bottom: 24.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context).pop();
},
child: Container(
padding: EdgeInsets.only(right: 21.w),
child: Icon(
Icons.arrow_back_ios,
color: Colors.black,
),
)),
Expanded(child: searchCityItem())
],
),
Padding(
padding: EdgeInsets.only(top: 16.h, bottom: 24.h),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Padding(
padding: EdgeInsets.only(right: 10.w),
child: Text(
(ipState == 0||ipState == 1) ? "当前位置" : "已选:",
style: TextStyle(
color: Color(0xFFA29E9E),
fontWeight: MyFontWeight.medium,
fontSize: 16.sp,
),
),
),
Image.asset(
"assets/image/icon_union_location.webp",
width: 20,
height: 20,
),
Expanded(
// padding: EdgeInsets.only(
// left: 8.w,
// ),
child: Text(
(ipState== 1) ? (ipName??""):widget.arguments["cityName"] ?? "",
style: TextStyle(
color: Color(0xFF4D4D4D),
fontWeight: MyFontWeight.medium,
fontSize: 16.sp,
),
),
),
if(ipState == 2)
Icon(
Icons.gps_fixed,
color: Colors.grey,
size: 18,
),
if(ipState == 2)
Padding(padding:EdgeInsets.only(left:5.w,right: 12.w),
child:GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
setState((){
ipState = 1;
Navigator.of(context).pop(ipName);
});
},
child: Text(
"重新定位",
style: TextStyle(
color: Color(0xFF4D4D4D),
fontWeight: MyFontWeight.medium,
fontSize: 16.sp,
),
),
),)
],
)),
Padding(
padding: EdgeInsets.only(bottom: 16.h),
child: Text(
"热门城市",
style: TextStyle(
color: Color(0xFFA29E9E),
fontWeight: MyFontWeight.medium,
fontSize: 16.sp,
),
),
),
GridView.builder(
itemCount: hotCity.length,
padding: EdgeInsets.only(right: 14.h, bottom: 14.h),
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 4,
crossAxisSpacing: 12.w,
mainAxisSpacing: 12.w,
childAspectRatio: 2.5,
),
itemBuilder: (context, index) {
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context).pop(hotCity[index]);
setState((){});
},
child: Container(
decoration: BoxDecoration(
color: Color(0xFFF7F7F7),
borderRadius: BorderRadius.circular(4),
),
alignment: Alignment.center,
child: Text(
hotCity[index],
style: TextStyle(
color: Color(0xFF4D4D4D),
fontWeight: MyFontWeight.medium,
fontSize: 16.sp,
),
)));
},
),
],
),
),
Expanded(child: sortList())
],
),
),
);
}
Widget searchCityItem() {
return Container(
margin: EdgeInsets.fromLTRB(6.w, 0, 14.w, 0),
padding: EdgeInsets.symmetric(vertical: 6.h),
decoration: BoxDecoration(
color: Color(0xFFF1F1F1),
borderRadius: BorderRadius.circular(6),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
),
child: TextField(
textInputAction: TextInputAction.search,
onEditingComplete: () {
FocusScope.of(context).requestFocus(FocusNode());
},
onChanged: (txt) {
areaCode(searchTxt: txt);
},
style: TextStyle(
fontSize: 14.sp,
),
decoration: InputDecoration(
hintText: "搜索联盟会员店",
hintStyle: TextStyle(
fontSize: 12.sp,
color: Color(0xFFB3B3B3),
),
isCollapsed: true,
prefixIcon:Padding(padding: EdgeInsets.only(left: 5.w,right: 5.w),child: Image.asset(
"assets/image/icon_search.webp",
width: 16.h,
height: 16.h,
),),
prefixIconConstraints: BoxConstraints(),
border: InputBorder.none,
),
),
);
}
Widget sortList() {
return areaList.length != 0 ?ListView.builder(
padding: EdgeInsets.zero,
itemCount: areaList.length,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {},
child: sortItem(position),
);
},
):Padding(padding:EdgeInsets.only(top:12.h),
child: Text(
"抱歉,未找到相关位置,可尝试修改后重试",
style: TextStyle(
color: Color(0xFF4D4D4D),
fontWeight: MyFontWeight.medium,
fontSize: 14.sp,
),
));
}
Widget sortItem(int position) {
return Column(
children: [
Container(
width: double.infinity,
// color: Colors.white,
padding: EdgeInsets.only(top: 14.h, bottom: 4.h, left: 16.w),
margin: EdgeInsets.only(bottom: 12.h),
child: Text(
areaList[position],
style: TextStyle(
color: Color(0xFF4D4D4D),
fontWeight: MyFontWeight.medium,
fontSize: 16.sp,
),
),
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.w),
color: Colors.white,
),
margin: EdgeInsets.symmetric(horizontal: 14.w),
padding: EdgeInsets.only(
top: 8.h,
),
child: mapWidget(position),
)
],
);
}
Widget mapWidget(position) {
int mapIndex = 0;
return Column(
children: (areaMap[areaList[position]] as List).map((e) {
mapIndex += 1;
return globalRoamingItem(
e, mapIndex == areaMap[areaList[position]].length);
}).toList(),
);
}
Widget globalRoamingItem(data, isLast) {
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context).pop(data["area"]);
},
child: Container(
width: double.infinity,
child: Text(
data["area"],
style: TextStyle(
color: Color(0xFF000000),
fontWeight: MyFontWeight.regular,
fontSize: 14.sp,
),
),
decoration: BoxDecoration(
border: isLast
? null
: Border(
bottom: BorderSide(
width: 1.w,
color: Color(0xFFDCDCDC),
style: BorderStyle.solid,
),
),
),
padding: EdgeInsets.only(top: 16.h, bottom: 16.h, left: 16.w),
),
);
}
}

11
lib/utils/flutter_utils.dart

@ -1,3 +1,4 @@
import 'dart:convert';
import 'dart:io';
import 'package:dio/dio.dart';
@ -10,11 +11,11 @@ import 'package:path_provider/path_provider.dart';
class AppUtils {
///线
static Future<String> calculateDistance(
BMFCoordinate bmfCoordinate, BMFCoordinate myLatLng) async {
BMFCoordinate bmfCoordinate, BMFCoordinate myLatLng, {bool isMi = false}) async {
double mi =
await BMFCalculateUtils.getLocationDistance(bmfCoordinate, myLatLng);
NumberFormat numberFormat = NumberFormat("#.#");
return "${numberFormat.format(mi / 1000)}";
return "${numberFormat.format(mi / (isMi ? 1 :1000))}";
}
@ -77,12 +78,12 @@ class AppUtils {
return resString;
}
///
///()
static Future<BMFCoordinate> coordConvert(BMFCoordinate latLng) async {
return BMFCalculateUtils.coordConvert(
coordinate: latLng,
fromType: BMF_COORD_TYPE.BD09LL,
toType: BMF_COORD_TYPE.COMMON);
fromType: BMF_COORD_TYPE.COMMON,
toType: BMF_COORD_TYPE.BD09LL);
}
static bool isPhone(mobile) {

191
lib/utils/location.dart

@ -11,7 +11,6 @@ import 'package:permission_handler/permission_handler.dart';
import 'font_weight.dart';
BaiduLocationAndroidOption initAndroidOptions() {
BaiduLocationAndroidOption options = BaiduLocationAndroidOption(
//
@ -63,7 +62,6 @@ BaiduLocationIOSOption initIOSOptions() {
return options;
}
class Location {
static Location _instance;
@ -80,17 +78,18 @@ class Location {
LocationFlutterPlugin aMapFlutterLocation;
Future<bool> startLocation(context, Function(BaiduLocation result) locationCallback) async {
aMapFlutterLocation.prepareLoc(initAndroidOptions().getMap(), initIOSOptions().getMap());
if (!(await Permission.locationWhenInUse.serviceStatus.isEnabled)) {
enableLocation(context);
return false;
}
if (await Permission.location.isPermanentlyDenied) {
requestDialog(context, locationCallback);
Future<bool> startLocation(
context, Function(BaiduLocation result) locationCallback) async {
aMapFlutterLocation.prepareLoc(
initAndroidOptions().getMap(), initIOSOptions().getMap());
var permissionStatus = await Permission.location.status;
if (!permissionStatus.isGranted) {
if (permissionStatus.isUndetermined)
showTipsAlertDialog(context);
return false;
} else if (await Permission.location.isGranted) {
aMapFlutterLocation.singleLocationCallback(callback: (BaiduLocation result) {
} else {
aMapFlutterLocation.singleLocationCallback(
callback: (BaiduLocation result) {
locationCallback.call(result);
});
if (Platform.isIOS) {
@ -102,21 +101,6 @@ class Location {
await aMapFlutterLocation.startLocation();
}
return true;
} else if (await Permission.location.isUndetermined) {
showAlertDialog(context);
await Permission.location.request();
Navigator.of(context).pop();
return false;
} else {
if (Platform.isIOS) {
//
requestDialog(context, locationCallback);
} else {
showAlertDialog(context);
await Permission.location.request();
Navigator.of(context).pop();
}
return false;
}
}
@ -172,45 +156,53 @@ class Location {
}
///
showAlertDialog(context) {
showTipsAlertDialog(context) async {
//
showDialog(
context: context,
barrierDismissible: false,
barrierColor: null,
builder: (BuildContext context) {
return SimpleDialog(
titlePadding: EdgeInsets.all(10),
backgroundColor: Colors.transparent,
elevation: 0,
alignment: Alignment.topCenter,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(6),
),
children: <Widget>[
return Column(
children: [
Container(
width: double.infinity,
height: 120.h,
padding: EdgeInsets.all(16),
padding: EdgeInsets.all(15),
margin: EdgeInsets.all(15),
decoration: new BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
borderRadius: BorderRadius.circular(10),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(
Icons.location_on_outlined,
color: Colors.black,
size: 22,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
"访问精确地理位置信息权限说明",
// "访问精确地理位置信息权限说明",
"位置权限使用说明",
style: TextStyle(
fontSize: 15.sp,
fontSize: 18.sp,
fontWeight: MyFontWeight.regular,
color: Colors.black,
),
),
SizedBox(height: 3.h,),
SizedBox(
height: 3.h,
),
Text(
"为了向您推荐附近的门店信息,推荐您在使用期间让我们使用位置信息,不授权该权限不影响app正常使用。",
// "为了向您推荐附近的门店信息,推荐您在使用期间让我们使用位置信息,不授权该权限不影响app正常使用。",
"为了向您推荐附近的门店信息,推荐您在使用期间让我们使用位置信息",
style: TextStyle(
fontSize: 13.sp,
height: 1.3.h,
fontWeight: MyFontWeight.regular,
color: Colors.black,
),
@ -219,9 +211,118 @@ class Location {
),
),
],
),
)
],
mainAxisSize: MainAxisSize.min,
);
},
);
await Permission.location.request();
Navigator.of(context).pop();
}
///
showAlertDialog(context) {
//
showDialog(
context: context,
barrierDismissible: true,
barrierColor: null,
builder: (BuildContext context) {
return Column(
children: [
Container(
width: double.infinity,
padding: EdgeInsets.all(15),
margin: EdgeInsets.all(15),
decoration: new BoxDecoration(
color: Colors.black.withOpacity(0.6),
borderRadius: BorderRadius.circular(10),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
// "访问精确地理位置信息权限说明",
"定位服务未开启",
style: TextStyle(
fontSize: 18.sp,
fontWeight: MyFontWeight.regular,
color: Colors.white,
),
),
SizedBox(
height: 3.h,
),
Text(
// "为了向您推荐附近的门店信息,推荐您在使用期间让我们使用位置信息,不授权该权限不影响app正常使用。",
"开启后才能提供更详细的定位服务哦!",
style: TextStyle(
fontSize: 13.sp,
fontWeight: MyFontWeight.regular,
color: Colors.white,
),
),
],
),
),
GestureDetector(
child: Container(
child: Text(
"去开启",
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.regular,
color: Colors.white,
),
),
margin: EdgeInsets.symmetric(
horizontal: 15.w, vertical: 25.h),
padding:
EdgeInsets.symmetric(vertical: 2.h, horizontal: 10.w),
decoration: BoxDecoration(
color: Colors.green,
borderRadius: BorderRadius.circular(100),
),
),
onTap: () async {
await openAppSettings();
if (await Permission.location.isGranted)
Navigator.of(context).pop();
},
behavior: HitTestBehavior.opaque,
),
GestureDetector(
behavior: HitTestBehavior.opaque,
child: Container(
child: Icon(
Icons.close,
color: Colors.white.withOpacity(0.8),
size: 12,
),
decoration: BoxDecoration(
color: Colors.black.withOpacity(0.8),
borderRadius: BorderRadius.circular(100),
),
padding: EdgeInsets.all(5),
),
onTap: () {
Navigator.of(context).pop();
},
)
],
),
)
],
mainAxisSize: MainAxisSize.min,
);
},
);
}
}

2
lib/view_widget/channel_dialog.dart

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

120
lib/view_widget/location_tips.dart

@ -0,0 +1,120 @@
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/retrofit/data/activity_pos.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:permission_handler/permission_handler.dart';
import '../retrofit/data/login_info.dart';
import '../utils/font_weight.dart';
import 'custom_image.dart';
import 'new_people_reward.dart';
class LocationTips extends StatefulWidget {
final Function disMissLocationTips;
LocationTips(this.disMissLocationTips);
@override
State<StatefulWidget> createState() {
return _LocationTips();
}
}
class _LocationTips extends State<LocationTips> {
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return Container(
width: double.infinity,
padding: EdgeInsets.all(10),
margin: EdgeInsets.only(left: 15.w, right: 15.w, bottom: 15.h),
decoration: new BoxDecoration(
color: Colors.black.withOpacity(0.8),
borderRadius: BorderRadius.circular(10),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
// "访问精确地理位置信息权限说明",
"定位服务未开启",
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.regular,
color: Colors.white,
),
),
SizedBox(
height: 3.h,
),
Text(
// "为了向您推荐附近的门店信息,推荐您在使用期间让我们使用位置信息,不授权该权限不影响app正常使用。",
"开启后才能提供更详细的定位服务哦!",
style: TextStyle(
fontSize: 13.sp,
fontWeight: MyFontWeight.regular,
color: Colors.white,
),
),
],
),
),
GestureDetector(
child: Container(
child: Text(
"去开启",
style: TextStyle(
fontSize: 13.sp,
fontWeight: MyFontWeight.regular,
color: Colors.white,
),
),
margin: EdgeInsets.only(left: 15.w, right: 15.w, top: 15.h),
padding: EdgeInsets.symmetric(vertical: 2.h, horizontal: 10.w),
decoration: BoxDecoration(
color: Colors.green,
borderRadius: BorderRadius.circular(100),
),
),
onTap: () async {
if (!await openAppSettings()) {
SmartDialog.showToast("打开应用设置失败,请手动前往系统设置中心开启应用位置权限",
alignment: Alignment.center);
}
},
behavior: HitTestBehavior.opaque,
),
GestureDetector(
behavior: HitTestBehavior.opaque,
child: Container(
child: Icon(
Icons.close,
color: Colors.white.withOpacity(0.8),
size: 10,
),
decoration: BoxDecoration(
color: Colors.black.withOpacity(0.8),
borderRadius: BorderRadius.circular(100),
),
padding: EdgeInsets.all(3),
),
onTap: () {
widget.disMissLocationTips();
},
)
],
),
);
}
}

3
lib/view_widget/my_appbar.dart

@ -70,8 +70,7 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
},
child: Container(
alignment: Alignment.centerRight,
margin: EdgeInsets.only(left: 12,),
padding: EdgeInsets.all(6),
padding: EdgeInsets.only(top: 6.h,bottom: 6.h,left:20.w,right:6.w),
child: Icon(
Icons.arrow_back_ios,
color: leadingColor,

20
lib/view_widget/new_people_reward.dart

@ -27,7 +27,7 @@ class _NewPeopleReward extends State<NewPeopleReward> {
width: double.infinity,
height: 500.h,
padding: EdgeInsets.only(top: 210.h),
margin: EdgeInsets.only(top: 20.h, left: 20, right: 20),
margin: EdgeInsets.only(top: 20.h, left: 20.w, right: 20.w),
decoration: BoxDecoration(
image: DecorationImage(
fit: BoxFit.fill,
@ -58,7 +58,7 @@ class _NewPeopleReward extends State<NewPeopleReward> {
borderRadius: BorderRadius.circular(22.5),
),
width: MediaQuery.of(context).size.width,
height: 40,
height: 40.h,
alignment: Alignment.center,
child: Text(
S.of(context).lijilingqu,
@ -73,7 +73,7 @@ class _NewPeopleReward extends State<NewPeopleReward> {
],
),
),
SizedBox(height: 35),
SizedBox(height: 35.h),
GestureDetector(
onTap: () {
setState(() {
@ -82,8 +82,8 @@ class _NewPeopleReward extends State<NewPeopleReward> {
},
child: Image.asset(
"assets/image/yq_qx.webp",
width: 34,
height: 34,
width: 34.h,
height: 34.h,
),
)
],
@ -117,7 +117,7 @@ class _NewPeopleReward extends State<NewPeopleReward> {
image: AssetImage("assets/image/xin_rq.webp"),
),
),
margin: EdgeInsets.symmetric(horizontal: 60, vertical: 5),
margin: EdgeInsets.symmetric(horizontal: 50.w, vertical: 5.h),
padding: EdgeInsets.only(left: 16.w, right: 25.w),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
@ -150,13 +150,13 @@ class _NewPeopleReward extends State<NewPeopleReward> {
),
),
Expanded(child:Padding(
padding: EdgeInsets.only(top: 4, bottom: 4,left:30),
padding: EdgeInsets.only(top: 4.h, bottom: 4.h,left:30.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
firstLoginCouponList.storeName,
firstLoginCouponList.couponName,
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
@ -166,7 +166,7 @@ class _NewPeopleReward extends State<NewPeopleReward> {
),
),
Text(
firstLoginCouponList.couponName,
firstLoginCouponList.storeName,
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(

8
lib/view_widget/recharge_details_dialog.dart

@ -1,15 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/coupon.dart';
import 'package:huixiang/retrofit/data/recharge_list.dart';
import 'package:huixiang/retrofit/data/store.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/store/scan.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/border_text.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/round_button.dart';
import '../retrofit/data/rechargeActLists.dart';

2
lib/vip/user_vip_service_page.dart

@ -25,7 +25,7 @@ class _UserVipServicePage extends State<UserVipServicePage> with WidgetsBindingO
void initState() {
super.initState();
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.isIOS) WebView.platform = CupertinoWebView();
}

18
pubspec.lock

@ -311,7 +311,7 @@ packages:
name: flutter_smart_dialog
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.5.0"
version: "3.0.6"
flutter_spinkit:
dependency: "direct main"
description:
@ -364,6 +364,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "9.2.0"
gbk2utf8:
dependency: "direct main"
description:
name: gbk2utf8
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.1"
gradient_widgets:
dependency: "direct main"
description:
@ -836,7 +843,7 @@ packages:
description:
path: "."
ref: "V1.1.6"
resolved-ref: c21ce8a966f9238a5bf70a617c30468b79baa5a7
resolved-ref: a7e45d151171f9ec4b56bc97a720f545aa4a8722
url: "https://github.com/TencentCloud/TPNS-Flutter-Plugin"
source: git
version: "1.1.6"
@ -952,6 +959,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.15"
visibility_detector:
dependency: "direct main"
description:
name: visibility_detector
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.3"
wakelock:
dependency: transitive
description:

25
pubspec.yaml

@ -3,7 +3,7 @@ description: 一心回乡.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 3.2.16+60
version: 3.2.20+63
environment:
sdk: ">=2.7.0 <3.0.0"
@ -13,9 +13,10 @@ dependencies:
sdk: flutter
flutter_localizations:
sdk: flutter
fluwx: ^3.9.0+2
fluwx: 3.9.0+2
tobias: 2.4.1
tobias: ^2.4.1
gradient_widgets: ^0.6.0
@ -40,11 +41,11 @@ dependencies:
permission_handler: ^5.0.1+1
flutter_bmflocation: ^3.2.1
flutter_baidu_mapapi_base: ^3.2.0
flutter_baidu_mapapi_map: ^3.2.1
flutter_baidu_mapapi_search: ^3.2.0
flutter_baidu_mapapi_utils: ^3.2.0
flutter_bmflocation: 3.2.1
flutter_baidu_mapapi_base: 3.2.0
flutter_baidu_mapapi_map: 3.2.1
flutter_baidu_mapapi_search: 3.2.0
flutter_baidu_mapapi_utils: 3.2.0
dio: ^3.0.10
rxdart: ^0.26.0
@ -54,9 +55,13 @@ dependencies:
pin_input_text_field: ^4.1.2
android_intent_plus: ^1.0.2
flutter_screenutil: ^5.0.0+1
flutter_screenutil: 5.0.0+1
bubble_tab_indicator: ^0.1.6
gbk2utf8: ^1.0.1
visibility_detector: ^0.3.3
event_bus: ^2.0.0
intl: ^0.17.0
shared_preferences: ^2.0.6
@ -67,7 +72,7 @@ dependencies:
url_launcher: ^5.0.0
#多图, 裁剪
image_pickers: ^2.0.0
image_pickers: 2.0.0
# flutter_scankit: ^1.2.0
# qrscan: ^0.3.1

Loading…
Cancel
Save