diff --git a/android/app/build.gradle b/android/app/build.gradle index e096a5e2..3f4e7beb 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -60,12 +60,27 @@ android { v1SigningEnabled true //兼容v1 v2SigningEnabled true //兼容v2 } + debug {//debug版签名配置 + keyAlias 'huixiang' + keyPassword 'huixiang' + storeFile file('huixiang.jks') + storePassword 'huixiang' + v1SigningEnabled true //兼容v1 + v2SigningEnabled true //兼容v2 + } + } buildTypes { release { signingConfig signingConfigs.config } + debug { + signingConfig signingConfigs.config + } + profile { + signingConfig signingConfigs.config + } } aaptOptions { diff --git a/android/app/libs/payment-weixin-release.aar b/android/app/libs/payment-weixin-release.aar new file mode 100644 index 00000000..1e928015 Binary files /dev/null and b/android/app/libs/payment-weixin-release.aar differ diff --git a/android/app/libs/wechat-sdk-android-without-mta-6.6.5.aar b/android/app/libs/wechat-sdk-android-without-mta-6.6.5.aar new file mode 100644 index 00000000..43719c13 Binary files /dev/null and b/android/app/libs/wechat-sdk-android-without-mta-6.6.5.aar differ diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 2f03763c..1fcdf9a2 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -28,6 +28,12 @@ <uses-permission android:name="android.permission.CAMERA" /> + <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/> + + <queries> + <package android:name="com.tencent.mm" /> + </queries> + <application android:label="回乡" android:icon="@mipmap/ic_launcher"> @@ -53,7 +59,13 @@ <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> - + <meta-data android:name="WX_APPID" android:value="wx3b269e795ed23e5f" /> + <meta-data android:name="WX_SECRET" android:value="c7e6d17959743ca40602acb402292e2b"/> + <activity + android:name="com.zsw.huixiang.wxapi.WXPayEntryActivity" + android:exported="true" + android:theme="@android:style/Theme.Translucent.NoTitleBar" + android:launchMode="singleTop" /> <activity android:name="com.yalantis.ucrop.UCropActivity" android:screenOrientation="portrait" diff --git a/android/app/src/main/kotlin/com/zsw/huixiang/wxapi/WXPayEntryActivity.kt b/android/app/src/main/kotlin/com/zsw/huixiang/wxapi/WXPayEntryActivity.kt new file mode 100644 index 00000000..0c183201 --- /dev/null +++ b/android/app/src/main/kotlin/com/zsw/huixiang/wxapi/WXPayEntryActivity.kt @@ -0,0 +1,29 @@ +package com.zsw.huixiang.wxapi + +import android.os.Bundle +import android.util.Log +import com.tencent.mm.opensdk.modelbase.BaseReq +import com.tencent.mm.opensdk.modelbase.BaseResp +import io.dcloud.feature.payment.weixin.AbsWXPayCallbackActivity + + +class WXPayEntryActivity : AbsWXPayCallbackActivity() { + + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + Log.e("WXPayEntryActivity", "onCreate") + } + + override fun onReq(req: BaseReq?) { + super.onReq(req) + Log.e("WXPayEntryActivity", "req: $req") + + } + + override fun onResp(resp: BaseResp?) { + super.onResp(resp) + Log.e("WXPayEntryActivity", "resp: $resp") + } + +} \ No newline at end of file diff --git a/assets/image/2x/icon_bread.webp b/assets/image/2x/icon_bread.webp new file mode 100644 index 00000000..86cb05b8 Binary files /dev/null and b/assets/image/2x/icon_bread.webp differ diff --git a/assets/image/2x/icon_chili.webp b/assets/image/2x/icon_chili.webp new file mode 100644 index 00000000..56159f54 Binary files /dev/null and b/assets/image/2x/icon_chili.webp differ diff --git a/assets/image/2x/icon_milk_tea.webp b/assets/image/2x/icon_milk_tea.webp new file mode 100644 index 00000000..fc54a2c4 Binary files /dev/null and b/assets/image/2x/icon_milk_tea.webp differ diff --git a/assets/image/2x/icon_today_video.png b/assets/image/2x/icon_today_video.png new file mode 100644 index 00000000..3039e2f2 Binary files /dev/null and b/assets/image/2x/icon_today_video.png differ diff --git a/assets/image/3x/icon_bread.webp b/assets/image/3x/icon_bread.webp new file mode 100644 index 00000000..1740209e Binary files /dev/null and b/assets/image/3x/icon_bread.webp differ diff --git a/assets/image/3x/icon_chili.webp b/assets/image/3x/icon_chili.webp new file mode 100644 index 00000000..2a3e9173 Binary files /dev/null and b/assets/image/3x/icon_chili.webp differ diff --git a/assets/image/3x/icon_milk_tea.webp b/assets/image/3x/icon_milk_tea.webp new file mode 100644 index 00000000..161661e0 Binary files /dev/null and b/assets/image/3x/icon_milk_tea.webp differ diff --git a/assets/image/3x/icon_today_video.png.png b/assets/image/3x/icon_today_video.png.png new file mode 100644 index 00000000..b2d20e09 Binary files /dev/null and b/assets/image/3x/icon_today_video.png.png differ diff --git a/assets/image/icon_bread.webp b/assets/image/icon_bread.webp new file mode 100644 index 00000000..8643f8ae Binary files /dev/null and b/assets/image/icon_bread.webp differ diff --git a/assets/image/icon_chili.webp b/assets/image/icon_chili.webp new file mode 100644 index 00000000..7017a756 Binary files /dev/null and b/assets/image/icon_chili.webp differ diff --git a/assets/image/icon_milk_tea.webp b/assets/image/icon_milk_tea.webp new file mode 100644 index 00000000..22b5521f Binary files /dev/null and b/assets/image/icon_milk_tea.webp differ diff --git a/assets/image/icon_today_video.png b/assets/image/icon_today_video.png new file mode 100644 index 00000000..62ab896b Binary files /dev/null and b/assets/image/icon_today_video.png differ diff --git a/ios/Podfile.lock b/ios/Podfile.lock index e591195b..c568140b 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -11,9 +11,6 @@ PODS: - AMapLocation (2.6.8): - AMapFoundation (~> 1.6.4) - Flutter (1.0.0) - - fluttertoast (0.0.2): - - Flutter - - Toast - FMDB (2.7.5): - FMDB/standard (= 2.7.5) - FMDB/standard (2.7.5) @@ -35,7 +32,6 @@ PODS: - sqflite (0.0.2): - Flutter - FMDB (>= 2.7.5) - - Toast (4.0.0) - TOCropViewController (2.6.0) - video_player (0.0.1): - Flutter @@ -48,7 +44,6 @@ DEPENDENCIES: - amap_flutter_location (from `.symlinks/plugins/amap_flutter_location/ios`) - amap_flutter_map (from `.symlinks/plugins/amap_flutter_map/ios`) - Flutter (from `Flutter`) - - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`) - image_cropper (from `.symlinks/plugins/image_cropper/ios`) - image_picker (from `.symlinks/plugins/image_picker/ios`) - package_info (from `.symlinks/plugins/package_info/ios`) @@ -67,7 +62,6 @@ SPEC REPOS: - AMapFoundation - AMapLocation - FMDB - - Toast - TOCropViewController EXTERNAL SOURCES: @@ -77,8 +71,6 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/amap_flutter_map/ios" Flutter: :path: Flutter - fluttertoast: - :path: ".symlinks/plugins/fluttertoast/ios" image_cropper: :path: ".symlinks/plugins/image_cropper/ios" image_picker: @@ -109,7 +101,6 @@ SPEC CHECKSUMS: AMapFoundation: c7da72b42a713f1429c88af1858d623dde88934b AMapLocation: dad27669c4ca68e395ce7532ff614b7d4d45f7b7 Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c - fluttertoast: 6122fa75143e992b1d3470f61000f591a798cc58 FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a image_cropper: f1668dd8d2cad2d357955caad15a40547856edcb image_picker: 9c3312491f862b28d21ecd8fdf0ee14e601b3f09 @@ -119,7 +110,6 @@ SPEC CHECKSUMS: share: 0b2c3e82132f5888bccca3351c504d0003b3b410 shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904 - Toast: 91b396c56ee72a5790816f40d3a94dd357abc196 TOCropViewController: 3105367e808b7d3d886a74ff59bf4804e7d3ab38 video_player: 9cc823b1d9da7e8427ee591e8438bfbcde500e6e wakelock: bfc7955c418d0db797614075aabbc58a39ab5107 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index d1bdf66c..9ed572f8 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -856,10 +856,8 @@ HEADER_SEARCH_PATHS = ( "$(inherited)", "\"${PODS_ROOT}/Headers/Public\"", - "\"${PODS_ROOT}/Headers/Public/Toast\"", "\"${PODS_ROOT}/Headers/Public/amap_flutter_location\"", "\"${PODS_ROOT}/Headers/Public/amap_flutter_map\"", - "\"${PODS_ROOT}/Headers/Public/fluttertoast\"", "\"${PODS_ROOT}/Headers/Public/image_cropper\"", "\"${PODS_ROOT}/Headers/Public/image_picker\"", "\"${PODS_ROOT}/Headers/Public/path_provider\"", @@ -887,11 +885,9 @@ OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", - "-l\"Toast\"", "-l\"amap_flutter_location\"", "-l\"amap_flutter_map\"", "-l\"c++\"", - "-l\"fluttertoast\"", "-l\"image_cropper\"", "-l\"image_picker\"", "-l\"path_provider\"", @@ -1059,10 +1055,8 @@ HEADER_SEARCH_PATHS = ( "$(inherited)", "\"${PODS_ROOT}/Headers/Public\"", - "\"${PODS_ROOT}/Headers/Public/Toast\"", "\"${PODS_ROOT}/Headers/Public/amap_flutter_location\"", "\"${PODS_ROOT}/Headers/Public/amap_flutter_map\"", - "\"${PODS_ROOT}/Headers/Public/fluttertoast\"", "\"${PODS_ROOT}/Headers/Public/image_cropper\"", "\"${PODS_ROOT}/Headers/Public/image_picker\"", "\"${PODS_ROOT}/Headers/Public/path_provider\"", @@ -1090,11 +1084,9 @@ OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", - "-l\"Toast\"", "-l\"amap_flutter_location\"", "-l\"amap_flutter_map\"", "-l\"c++\"", - "-l\"fluttertoast\"", "-l\"image_cropper\"", "-l\"image_picker\"", "-l\"path_provider\"", @@ -1155,10 +1147,8 @@ HEADER_SEARCH_PATHS = ( "$(inherited)", "\"${PODS_ROOT}/Headers/Public\"", - "\"${PODS_ROOT}/Headers/Public/Toast\"", "\"${PODS_ROOT}/Headers/Public/amap_flutter_location\"", "\"${PODS_ROOT}/Headers/Public/amap_flutter_map\"", - "\"${PODS_ROOT}/Headers/Public/fluttertoast\"", "\"${PODS_ROOT}/Headers/Public/image_cropper\"", "\"${PODS_ROOT}/Headers/Public/image_picker\"", "\"${PODS_ROOT}/Headers/Public/path_provider\"", @@ -1186,11 +1176,9 @@ OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", - "-l\"Toast\"", "-l\"amap_flutter_location\"", "-l\"amap_flutter_map\"", "-l\"c++\"", - "-l\"fluttertoast\"", "-l\"image_cropper\"", "-l\"image_picker\"", "-l\"path_provider\"", diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index fc62f260..7adc16ef 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -28,7 +28,16 @@ <string>????</string> <key>CFBundleURLTypes</key> <array> - <dict/> + <dict> + <key>CFBundleTypeRole</key> + <string>Editor</string> + <key>CFBundleURLName</key> + <string>weixin</string> + <key>CFBundleURLSchemes</key> + <array> + <string>wx3b269e795ed23e5f</string> + </array> + </dict> </array> <key>CFBundleVersion</key> <string>$(CURRENT_PROJECT_VERSION)</string> diff --git a/ios/Runner/Runner.entitlements b/ios/Runner/Runner.entitlements index df225489..9c897b6e 100644 --- a/ios/Runner/Runner.entitlements +++ b/ios/Runner/Runner.entitlements @@ -7,6 +7,8 @@ <key>com.apple.developer.associated-domains</key> <array> <string>applinks:demo.dcloud.net.cn</string> + <string>hx.lotus-wallet.com</string> + <string>applinks:hx.lotus-wallet.com</string> </array> </dict> </plist> diff --git a/lib/address/address_map_page.dart b/lib/address/address_map_page.dart index f567ba31..94eede08 100644 --- a/lib/address/address_map_page.dart +++ b/lib/address/address_map_page.dart @@ -9,7 +9,7 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:fluttertoast/fluttertoast.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/retrofit/data/address.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:permission_handler/permission_handler.dart'; @@ -152,14 +152,7 @@ class _AddressMapPage extends State<AddressMapPage> { if (await Permission.locationWhenInUse.serviceStatus.isEnabled) { bool isShown = await Permission.contacts.shouldShowRequestRationale; if (isShown) { - Fluttertoast.showToast( - msg: "shouldShowRequest", - toastLength: Toast.LENGTH_SHORT, - gravity: ToastGravity.CENTER, - timeInSecForIosWeb: 1, - backgroundColor: Colors.red, - textColor: Colors.white, - fontSize: 16.0.sp); + SmartDialog.showToast("shouldShowRequest"); } if (await Permission.location.isPermanentlyDenied) { //openAppSettings diff --git a/lib/address/edit_address_page.dart b/lib/address/edit_address_page.dart index 418c2b13..b1de27fe 100644 --- a/lib/address/edit_address_page.dart +++ b/lib/address/edit_address_page.dart @@ -1,6 +1,6 @@ import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; -import 'package:fluttertoast/fluttertoast.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/retrofit/data/address.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; @@ -151,19 +151,19 @@ class _EditAddressPage extends State<EditAddressPage> { String city = addressController.text; String address = houseNumberController.text; if (name == null || name == "") { - Fluttertoast.showToast(msg: "请输入收货人姓名"); + SmartDialog.showToast("请输入收货人姓名"); return; } if (mobile == null || mobile == "") { - Fluttertoast.showToast(msg: "请输入收货人手机号"); + SmartDialog.showToast("请输入收货人手机号"); return; } if (city == null || city == "") { - Fluttertoast.showToast(msg: "请输入收货人地址"); + SmartDialog.showToast("请输入收货人地址"); return; } if (address == null || address == "") { - Fluttertoast.showToast(msg: "请输入收货人详细地址"); + SmartDialog.showToast("请输入收货人详细地址"); return; } BaseData baseData; @@ -199,10 +199,8 @@ class _EditAddressPage extends State<EditAddressPage> { } if (baseData != null && baseData.isSuccess) { - Fluttertoast.showToast(msg: preAddress == null ? "保存成功" : "修改成功"); + SmartDialog.showToast(preAddress == null ? "保存成功" : "修改成功"); Navigator.of(context).pop(); - } else { - Fluttertoast.showToast(msg: baseData.msg); } } diff --git a/lib/generated/intl/messages_zh_TW.dart b/lib/generated/intl/messages_zh_TW.dart index e85f588c..8f66d586 100644 --- a/lib/generated/intl/messages_zh_TW.dart +++ b/lib/generated/intl/messages_zh_TW.dart @@ -244,7 +244,7 @@ class MessageLookup extends MessageLookupByLibrary { "muqianzanwuxingdianhuodong" : MessageLookupByLibrary.simpleMessage("目前暫無星店活動"), "nindingweigongnengweikaiqi" : MessageLookupByLibrary.simpleMessage("您定位功能開關未開啟,請點擊去開啟定位"), "nindingweiquanxianweiyunxu" : MessageLookupByLibrary.simpleMessage("您未开启位置权限,请点击确定申请权限"), - "ninweidenglu" : MessageLookupByLibrary.simpleMessage("您未登錄,請點擊去燈籠"), + "ninweidenglu" : MessageLookupByLibrary.simpleMessage("您未登錄,請點擊去登錄"), "ninyouyigedingdanyaolingqu" : MessageLookupByLibrary.simpleMessage("您有一個訂單需要前往門店領取"), "ninyouyigexindedingdan" : MessageLookupByLibrary.simpleMessage("您有一個新訂單"), "peisong" : MessageLookupByLibrary.simpleMessage("配送"), diff --git a/lib/home/activity_list_page.dart b/lib/home/activity_list_page.dart index 1246c794..5615e50d 100644 --- a/lib/home/activity_list_page.dart +++ b/lib/home/activity_list_page.dart @@ -1,14 +1,15 @@ import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:fluttertoast/fluttertoast.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:huixiang/main.dart'; import 'package:huixiang/retrofit/data/activity.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/event_type.dart'; import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/custom_image.dart'; -import 'package:huixiang/view_widget/loading_view.dart'; import 'package:huixiang/view_widget/my_footer.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -32,17 +33,17 @@ class _ActivityListPage extends State<ActivityListPage> apiService = ApiService(Dio(), context: context, token: value.getString('token')), queryActivity(), }); + + eventBus.on<EventType>().listen((event) { + if (event.type < 3) { + setState(() {}); + } + }); } List<Activity> activityList; queryActivity() async { - // showCupertinoDialog( - // context: context, - // barrierDismissible: true, - // builder: (context) { - // return LoadingView(); - // }); BaseData baseData = await apiService.informationList({ "pageNum": 1, "pageSize": 10, @@ -52,15 +53,12 @@ class _ActivityListPage extends State<ActivityListPage> }).catchError((error) { _refreshController.refreshFailed(); }); - // if (Navigator.canPop(context)) Navigator.of(context).pop(); if (baseData != null && baseData.isSuccess) { PageInfo pageInfo = PageInfo.fromJson(baseData.data); _refreshController.refreshCompleted(); setState(() { activityList = pageInfo.list.map((e) => Activity.fromJson(e)).toList(); }); - } else { - Fluttertoast.showToast(msg: baseData.msg); } } diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index 0a829da1..6509e50b 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -38,9 +38,6 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin { super.initState(); SharedPreferences.getInstance().then((value) => { - isLogin = (value.containsKey("token") && - value.getString('token') != null && - value.getString('token') != ""), apiService = ApiService(Dio(), context: context, token: value.getString('token'), @@ -52,12 +49,9 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin { if (event.type < 3) { setState(() {}); } - ; }); } - bool isLogin = false; - loginTips() { SmartDialog.show( widget: LoginTips( @@ -173,26 +167,30 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin { imgPath: "assets/image/icon_today_task.png", moreText: S.of(context).renwuzhongxin, onTap: () { - if (!isLogin) { - loginTips(); - return; - } - Navigator.of(context).pushNamed('/router/integral_page'); + SharedPreferences.getInstance().then((value) { + if (value.getString('token') == null) { + loginTips(); + } else { + Navigator.of(context).pushNamed('/router/integral_page'); + } + }); }, ), InkWell( onTap: () { - if (!isLogin) { - loginTips(); - return; - } - Navigator.of(context).pushNamed('/router/integral_page'); + SharedPreferences.getInstance().then((value) { + if (value.getString('token') == null) { + loginTips(); + } else { + Navigator.of(context).pushNamed('/router/integral_page'); + } + }); }, child: signIn(), ), ItemTitle( text: S.of(context).remenwenzhangshipin, - imgPath: "assets/image/icon_today_task.png", + imgPath: "assets/image/icon_today_video.png", moreText: S.of(context).chakangengduo, onTap: () { Navigator.of(context).pushNamed('/router/hot_article_page'); diff --git a/lib/home/points_mall_page.dart b/lib/home/points_mall_page.dart index 07745abc..18029f9e 100644 --- a/lib/home/points_mall_page.dart +++ b/lib/home/points_mall_page.dart @@ -4,17 +4,21 @@ import 'dart:ui'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_swiper/flutter_swiper.dart'; -import 'package:fluttertoast/fluttertoast.dart'; import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/main.dart'; +import 'package:huixiang/retrofit/data/banner.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/goods.dart'; import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/event_type.dart'; import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/item_title.dart'; +import 'package:huixiang/view_widget/login_tips.dart'; import 'package:huixiang/view_widget/my_footer.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -22,8 +26,6 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:dio/dio.dart'; import 'package:shared_preferences/shared_preferences.dart'; -import '../retrofit/data/banner.dart'; - class PointsMallPage extends StatefulWidget { @override State<StatefulWidget> createState() { @@ -50,11 +52,25 @@ class _PointsMallPage extends State<PointsMallPage> void initState() { super.initState(); + refreshUserInfo(); + + eventBus.on<EventType>().listen((event) { + if (event.type < 3) { + setState(() {}); + } + if (event.type == 3) { + refreshUserInfo(); + }; + }); + + } + + refreshUserInfo(){ SharedPreferences.getInstance().then((value) => { - client = ApiService(Dio(), context: context, token: value.getString('token')), - creditGoods(), - queryUser(), - }); + client = ApiService(Dio(), context: context, token: value.getString('token')), + creditGoods(), + queryUser(), + }); } int pageNum = 1; @@ -70,8 +86,6 @@ class _PointsMallPage extends State<PointsMallPage> List<BannerData> bannerData = []; queryUser() async { - BaseData baseData = await client.queryInfo(); - BaseData banner = await client.queryBanner({ "model": {"type": "CREDIT_INDEX"}, }); @@ -81,16 +95,16 @@ class _PointsMallPage extends State<PointsMallPage> bannerData.addAll((banner.data["records"] as List<dynamic>) .map((e) => BannerData.fromJson(e)) .toList()); + setState(() {}); } + BaseData baseData = await client.queryInfo(); if (baseData != null && baseData.isSuccess) { userinfo = UserInfo.fromJson(baseData.data); SharedPreferences.getInstance().then((value) => { value.setString('user', jsonEncode(baseData.data)), }); setState(() {}); - } else { - Fluttertoast.showToast(msg: baseData.msg); } } @@ -121,7 +135,6 @@ class _PointsMallPage extends State<PointsMallPage> } else { _refreshController.loadFailed(); _refreshController.refreshFailed(); - Fluttertoast.showToast(msg: baseData.msg); } } @@ -200,7 +213,10 @@ class _PointsMallPage extends State<PointsMallPage> _toDetails(index) async { await Navigator.of(context).pushNamed('/router/integral_store_page', arguments: {"goodsId": gooods[index].id}); - queryUser(); + SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); + String token = sharedPreferences.getString("token"); + if (token != null) + queryUser(); } _sortChange(item) { @@ -278,7 +294,7 @@ class _PointsMallPage extends State<PointsMallPage> style: TextStyle( color: Colors.black, fontWeight: FontWeight.bold, - fontSize: 16, + fontSize: 16.sp, ), ), SizedBox( @@ -317,14 +333,14 @@ class _PointsMallPage extends State<PointsMallPage> color: Color(0xFF585858), decoration: TextDecoration.lineThrough, decorationColor: Color(0xFF585858), - fontSize: 12, + fontSize: 12.sp, ), ), Text( S.of(context).jifen_(goods.price), style: TextStyle( color: Color(0xFF32A060), - fontSize: 14, + fontSize: 14.sp, fontWeight: FontWeight.bold, ), ), @@ -334,7 +350,7 @@ class _PointsMallPage extends State<PointsMallPage> ), ], ), - ) + ), ], ), Visibility( @@ -343,8 +359,8 @@ class _PointsMallPage extends State<PointsMallPage> borderRadius: BorderRadius.only(topRight: Radius.circular(4)), child: Image.asset( "assets/image/icon_hot_right_top.png", - width: 36, - height: 36, + width: 36.w, + height: 36.h, ), ), ), @@ -354,82 +370,100 @@ class _PointsMallPage extends State<PointsMallPage> } Widget userItem() { - return Container( - margin: EdgeInsets.all(16), - child: Row( - children: [ - MImage( - userinfo != null ? userinfo.headimg : "", - width: 50, - height: 50, - radius: BorderRadius.all(Radius.circular(2)), - fit: BoxFit.cover, - errorSrc: "assets/image/default_1.png", - fadeSrc: "assets/image/default_1.png", - ), - Expanded( - child: Container( - margin: EdgeInsets.only(left: 15), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - userinfo != null ? userinfo.nickname : "", - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.bold, - color: Color(0xFF353535)), - ), - Row( + return InkWell( + onTap: () { + SharedPreferences.getInstance().then((value) { + if (value.getString("token") == null) { + SmartDialog.show( + widget: LoginTips( + click: () { + value.clear(); + Navigator.of(context).pushNamed('/router/login_page', arguments: {"login":"login"}); + }, + ), + clickBgDismissTemp: false, + ); + } + }); + }, + child:Container( + margin: EdgeInsets.all(16), + child: Row( + children: [ + MImage( + userinfo != null ? userinfo.headimg : "", + width: 50, + height: 50, + radius: BorderRadius.all(Radius.circular(2)), + fit: BoxFit.cover, + errorSrc: "assets/image/default_1.png", + fadeSrc: "assets/image/default_1.png", + ), + Expanded( + child: Container( + margin: EdgeInsets.only(left: 15), + height: 50.h, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Image.asset( - "assets/image/icon_an_crown.png", - width: 14, - height: 14, - ), - SizedBox( - width: 5, - ), Text( - (userinfo != null && userinfo.memberRankVo != null) - ? userinfo.memberRankVo.rankName - : "", - style: + userinfo != null ? userinfo.nickname : S.of(context).qudenglu, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + color: Color(0xFF353535)), + ), + Row( + children: [ + Image.asset( + "assets/image/icon_an_crown.png", + width: 14, + height: 14, + ), + SizedBox( + width: 5, + ), + Text( + (userinfo != null && userinfo.memberRankVo != null) + ? userinfo.memberRankVo.rankName + : "", + style: TextStyle(fontSize: 12, color: Color(0xFF353535)), + ), + ], ), ], ), - ], - ), - ), - flex: 1, - ), - Container( - margin: EdgeInsets.only(left: 15), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Text( - S.of(context).yiyoujifen, - style: TextStyle( - fontSize: 12, - fontWeight: FontWeight.bold, - color: Color(0xFF4C4C4C)), ), - Text( - (userinfo != null) ? "${userinfo.points}" : "", - style: TextStyle( - fontSize: 16, - color: Color(0xFFF8BA61), - fontWeight: FontWeight.bold), + flex: 1, + ), + Container( + margin: EdgeInsets.only(left: 15), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text( + S.of(context).yiyoujifen, + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.bold, + color: Color(0xFF4C4C4C)), + ), + Text( + (userinfo != null) ? "${userinfo.points}" : "", + style: TextStyle( + fontSize: 16, + color: Color(0xFFF8BA61), + fontWeight: FontWeight.bold), + ), + ], ), - ], - ), - ) - ], - ), + ) + ], + ), + ), ); } diff --git a/lib/integral/integral_detailed_page.dart b/lib/integral/integral_detailed_page.dart index 30ae23f8..93c825ce 100644 --- a/lib/integral/integral_detailed_page.dart +++ b/lib/integral/integral_detailed_page.dart @@ -2,7 +2,7 @@ import 'dart:convert'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; -import 'package:fluttertoast/fluttertoast.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/page.dart'; @@ -91,7 +91,6 @@ class _IntegralDetailedPage extends State<IntegralDetailedPage> } setState(() {}); } else { - Fluttertoast.showToast(msg: baseData.msg); refreshController.loadFailed(); refreshController.refreshFailed(); } diff --git a/lib/integral/integral_page.dart b/lib/integral/integral_page.dart index c4e0c055..d168d766 100644 --- a/lib/integral/integral_page.dart +++ b/lib/integral/integral_page.dart @@ -3,7 +3,7 @@ import 'dart:convert'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; import 'package:flutter_swiper/flutter_swiper.dart'; -import 'package:fluttertoast/fluttertoast.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/rank.dart'; @@ -66,8 +66,6 @@ class _IntegralPage extends State<IntegralPage> { if (baseData != null && baseData.isSuccess) { signInfo = SignInfo.fromJson(baseData.data); setState(() {}); - } else { - Fluttertoast.showToast(msg: baseData.msg); } } @@ -122,11 +120,24 @@ class _IntegralPage extends State<IntegralPage> { ), body: SingleChildScrollView( child: Container( - child: Column( + child: Stack( children: [ - integralAndVip(), - inForPoints(), - integralTask(), + Positioned( + child: Container( + height: 122.h, + color: Color(0xFF3A405A), + ), + top: 0, + left: 0, + right: 0, + ), + Column( + children: [ + integralAndVip(), + inForPoints(), + integralTask(), + ], + ), ], ), ), @@ -418,83 +429,73 @@ class _IntegralPage extends State<IntegralPage> { ///立即签到 Widget inForPoints() { return Container( - child: Stack( + width: double.infinity, + margin: EdgeInsets.symmetric(horizontal: 16.w, vertical: 6.h), + padding: EdgeInsets.fromLTRB(20.w, 20.h, 20.w, 20.h), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - height: 42.h, - color: Color(0xFF3A405A), + Text( + S.of(context).qiandaolingjifen, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16.sp, + color: Color(0xFF353535)), ), - Container( - width: double.infinity, - margin: EdgeInsets.all(16), - padding: EdgeInsets.fromLTRB(20.w, 20.h, 20.w, 20.h), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all(Radius.circular(8)), - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0, - ) - ], + Text( + S.of(context).lianxuqiandaolingqushuangbeijifen, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 11.sp, + color: Color(0xFF727272), ), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - S.of(context).qiandaolingjifen, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 16.sp, - color: Color(0xFF353535)), - ), - Text( - S.of(context).lianxuqiandaolingqushuangbeijifen, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 11.sp, - color: Color(0xFF727272), - ), - ), - SizedBox( - height: 32.h, - ), - StaggeredGridView.countBuilder( - crossAxisCount: 4, - shrinkWrap: true, - itemCount: 7, - mainAxisSpacing: 8.h, - crossAxisSpacing: 18.w, - padding: EdgeInsets.only(bottom: 32.h), - physics: new NeverScrollableScrollPhysics(), - itemBuilder: (context, position) { - return signInItem(position); - }, - staggeredTileBuilder: (position) { - return StaggeredTile.count(position == 6 ? 2 : 1, 1.28); - }), - InkWell( - onTap: signIn, - child: Container( - alignment: Alignment.center, - child: RoundButton( - text: (signInfo != null && signInfo.todayHasSignin) - ? S.of(context).yiqiandao - : S.of(context).lijiqiandao, - textColor: Colors.white, - backgroup: (signInfo != null && signInfo.todayHasSignin) - ? Colors.grey - : Color(0xFF32A060), - fontSize: 16.sp, - padding: EdgeInsets.fromLTRB(16.w, 6.h, 16.w, 6.h), - radius: 4, - ), - ), - ) - ], + ), + SizedBox( + height: 32.h, + ), + StaggeredGridView.countBuilder( + crossAxisCount: 4, + shrinkWrap: true, + itemCount: 7, + mainAxisSpacing: 8.h, + crossAxisSpacing: 18.w, + padding: EdgeInsets.only(bottom: 32.h), + physics: new NeverScrollableScrollPhysics(), + itemBuilder: (context, position) { + return signInItem(position); + }, + staggeredTileBuilder: (position) { + return StaggeredTile.count(position == 6 ? 2 : 1, 1.28); + }), + InkWell( + onTap: signIn, + child: Container( + alignment: Alignment.center, + child: RoundButton( + text: (signInfo != null && signInfo.todayHasSignin) + ? S.of(context).yiqiandao + : S.of(context).lijiqiandao, + textColor: Colors.white, + backgroup: (signInfo != null && signInfo.todayHasSignin) + ? Colors.grey + : Color(0xFF32A060), + fontSize: 16.sp, + padding: EdgeInsets.fromLTRB(16.w, 6.h, 16.w, 6.h), + radius: 4, + ), ), ) ], @@ -505,15 +506,13 @@ class _IntegralPage extends State<IntegralPage> { ///立即签到 signIn() async { if ((signInfo != null && signInfo.todayHasSignin)) { - Fluttertoast.showToast(msg: "今日已签到了"); + SmartDialog.showToast("今日已签到了"); return; } BaseData baseData = await apiService.signIn(); if (baseData != null && baseData.isSuccess) { querySignInfo(); - Fluttertoast.showToast(msg: "签到成功"); - } else { - Fluttertoast.showToast(msg: baseData.msg); + SmartDialog.showToast("签到成功"); } } diff --git a/lib/integral_store/integral_store_details_page.dart b/lib/integral_store/integral_store_details_page.dart index eef10bc2..8e67c85e 100644 --- a/lib/integral_store/integral_store_details_page.dart +++ b/lib/integral_store/integral_store_details_page.dart @@ -3,7 +3,7 @@ import 'dart:convert'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; import 'package:flutter_swiper/flutter_swiper.dart'; -import 'package:fluttertoast/fluttertoast.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/goods.dart'; @@ -35,11 +35,12 @@ class _IntegralStoreDetailsPage extends State { void initState() { super.initState(); - SharedPreferences.getInstance().then((value) => { - apiService = ApiService(Dio(), context: context, token: value.getString("token")), - points = - UserInfo.fromJson(jsonDecode(value.getString('user'))).points, - queryGoodsById(), + SharedPreferences.getInstance().then((value) { + apiService = ApiService(Dio(), context: context, token: value.getString("token")); + queryGoodsById(); + if (value.getString('user') != null) { + points = UserInfo.fromJson(jsonDecode(value.getString('user'))).points; + } }); } @@ -51,8 +52,6 @@ class _IntegralStoreDetailsPage extends State { setState(() { goods = Goods.fromJson(baseData.data); }); - } else { - Fluttertoast.showToast(msg: baseData.msg); } } @@ -145,7 +144,7 @@ class _IntegralStoreDetailsPage extends State { child: Container( padding: EdgeInsets.only(top: 16.h, bottom: 16.h), decoration: BoxDecoration( - color: (goods != null && + color: (goods != null && points != null && int.tryParse(goods.price) < int.tryParse(points)) ? Color(0xFF32A060) : Color(0xFFD8D8D8), diff --git a/lib/l10n/intl_zh_TW.arb b/lib/l10n/intl_zh_TW.arb index 6a3dbe1c..c1c245d8 100644 --- a/lib/l10n/intl_zh_TW.arb +++ b/lib/l10n/intl_zh_TW.arb @@ -371,7 +371,7 @@ "huiyuanjifen": "會員積分", "huiyuanyue": "會員餘額", "gongxinichengweibendianhuiyuan": "恭喜您,成為本店會員,快去享受超多的會員權益吧。", - "ninweidenglu": "您未登錄,請點擊去燈籠", + "ninweidenglu": "您未登錄,請點擊去登錄", "weilegeiningenghaodefuwu": "為了給您提供更好的服務,以及享受更加精彩的信息內容,請在使用使用期間登錄", "qudenglu": "去登錄", "weidenglu": "未登錄", diff --git a/lib/login/login_page.dart b/lib/login/login_page.dart index 09ab38d0..7c24e0fa 100644 --- a/lib/login/login_page.dart +++ b/lib/login/login_page.dart @@ -5,7 +5,7 @@ import 'dart:ui'; import 'package:flutter/gestures.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; -import 'package:fluttertoast/fluttertoast.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/main.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; @@ -18,7 +18,7 @@ import 'package:flutter/services.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:dio/dio.dart'; -import 'package:photo_view/photo_view.dart'; +// import 'package:photo_view/photo_view.dart'; import 'package:shared_preferences/shared_preferences.dart'; class LoginPage extends StatefulWidget { @@ -155,7 +155,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin { _sendCode() async { if (!checkStatus) { - Fluttertoast.showToast(msg: S.of(context).gouxuanxieyi); + SmartDialog.showToast(S.of(context).gouxuanxieyi); return; } var mobile = _controllerPhone.text; @@ -175,12 +175,12 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin { { btnText = S.of(context).send_code, _sendCodeStatus = 0, - Fluttertoast.showToast(msg: "${value.msg}"), + SmartDialog.showToast("${value.msg}"), refresh() } }) .catchError((error) { - Fluttertoast.showToast(msg: "$error"); + SmartDialog.showToast("$error"); }); } } @@ -224,7 +224,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin { } if (!checkStatus) { - Fluttertoast.showToast(msg: S.of(context).gouxuanxieyi); + SmartDialog.showToast(S.of(context).gouxuanxieyi); return; } var mobile = _controllerPhone.text; @@ -260,7 +260,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin { SmartDialog.showLoading(msg: S.of(context).zhengzaijiazai); BaseData value = await client.memberLogin(param).catchError((error) { print(error); - Fluttertoast.showToast(msg: "$error"); + SmartDialog.showToast("$error"); }); Future.delayed(Duration(seconds: 2), () { SmartDialog.dismiss(); @@ -273,7 +273,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin { Navigator.of(context).popAndPushNamed('/router/main_page'); } } else { - Fluttertoast.showToast(msg: "${value.msg}"); + SmartDialog.showToast("${value.msg}"); } }); } @@ -391,11 +391,11 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin { child: Stack( alignment: Alignment.center, children: [ - PhotoView( - imageProvider: AssetImage("assets/image/laoban.png"), - initialScale: Platform.isAndroid ? 1.02 : 1.2, - basePosition: alignmentProgress, - ), + // PhotoView( + // imageProvider: AssetImage("assets/image/laoban.png"), + // initialScale: Platform.isAndroid ? 1.02 : 1.2, + // basePosition: alignmentProgress, + // ), Positioned( top: 54.h, left: 28.w, diff --git a/lib/mine/coupons_page.dart b/lib/mine/coupons_page.dart index d513beaf..dcf9815b 100644 --- a/lib/mine/coupons_page.dart +++ b/lib/mine/coupons_page.dart @@ -1,7 +1,7 @@ import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:fluttertoast/fluttertoast.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/coupon.dart'; @@ -78,7 +78,6 @@ class _CouponsPage extends State<CouponsPage> { } else { _refreshController.loadFailed(); _refreshController.refreshFailed(); - Fluttertoast.showToast(msg: baseData.msg); } } @@ -186,11 +185,9 @@ class _CouponsPage extends State<CouponsPage> { receiveCoupon(couponId) async { BaseData baseData = await apiService.receiveCoupon(couponId); - if (baseData.isSuccess) { + if (baseData != null && baseData.isSuccess) { _onRefresh(); showAlertDialog(); - } else { - Fluttertoast.showToast(msg: baseData.msg); } } diff --git a/lib/mine/edit_name.dart b/lib/mine/edit_name.dart index a82dbf25..5900f76f 100644 --- a/lib/mine/edit_name.dart +++ b/lib/mine/edit_name.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:fluttertoast/fluttertoast.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -35,7 +35,7 @@ class _EditName extends State<EditName> { if(name != null && name != "") { Navigator.of(context).pop(name); } else { - Fluttertoast.showToast(msg: "请输入用户名"); + SmartDialog.showToast("请输入用户名"); } }, child: Text( diff --git a/lib/mine/manage_address_page.dart b/lib/mine/manage_address_page.dart index 121a87ce..018f7454 100644 --- a/lib/mine/manage_address_page.dart +++ b/lib/mine/manage_address_page.dart @@ -1,7 +1,7 @@ import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:fluttertoast/fluttertoast.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/address.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; @@ -47,8 +47,6 @@ class _ManageAddressPage extends State<ManageAddressPage> { .map((e) => Address.fromJson(e)) .toList(); setState(() {}); - } else { - Fluttertoast.showToast(msg: baseData.msg); } } @@ -358,8 +356,6 @@ class _ManageAddressPage extends State<ManageAddressPage> { await apiService.deleteAddress(addressList[position].toJson()); if (baseData != null && baseData.isSuccess) { queryMemberAddress(); - } else { - Fluttertoast.showToast(msg: baseData.msg); } } @@ -371,8 +367,6 @@ class _ManageAddressPage extends State<ManageAddressPage> { BaseData baseData = await apiService.updateAddress(addressList[position].toJson()); if (baseData != null && baseData.isSuccess) { - } else { - Fluttertoast.showToast(msg: baseData.msg); } setState(() {}); } diff --git a/lib/mine/mine_card_invalid_page.dart b/lib/mine/mine_card_invalid_page.dart index b5b051af..dc2c677d 100644 --- a/lib/mine/mine_card_invalid_page.dart +++ b/lib/mine/mine_card_invalid_page.dart @@ -1,7 +1,7 @@ import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:fluttertoast/fluttertoast.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/coupon.dart'; @@ -73,7 +73,6 @@ class _MineCardInvalidPage extends State<MineCardInvalidPage> { } else { _refreshController.loadFailed(); _refreshController.refreshFailed(); - Fluttertoast.showToast(msg: baseData.msg); } } diff --git a/lib/mine/mine_page.dart b/lib/mine/mine_page.dart index 0d4049b7..364cd691 100644 --- a/lib/mine/mine_page.dart +++ b/lib/mine/mine_page.dart @@ -3,7 +3,6 @@ import 'dart:convert'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; -import 'package:fluttertoast/fluttertoast.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/main.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; diff --git a/lib/mine/mine_vip_level_page.dart b/lib/mine/mine_vip_level_page.dart index caab2f35..abbe9bac 100644 --- a/lib/mine/mine_vip_level_page.dart +++ b/lib/mine/mine_vip_level_page.dart @@ -1,8 +1,8 @@ import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_swiper/flutter_swiper.dart'; -import 'package:fluttertoast/fluttertoast.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/rank.dart'; @@ -51,7 +51,7 @@ class _MineVipLevelPage extends State<MineVipLevelPage> { controller.index = widget.arguments["rankLevel"] - 1; }); } else { - Fluttertoast.showToast(msg: rankData.msg); + SmartDialog.showToast(rankData.msg); } } diff --git a/lib/mine/mine_wallet_page.dart b/lib/mine/mine_wallet_page.dart index 43dc8625..74ea50a0 100644 --- a/lib/mine/mine_wallet_page.dart +++ b/lib/mine/mine_wallet_page.dart @@ -2,7 +2,7 @@ import 'dart:convert'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; -import 'package:fluttertoast/fluttertoast.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/page.dart'; @@ -60,10 +60,8 @@ class _MineWalletPage extends State<MineWalletPage> { if (baseData != null && baseData.isSuccess) { userInfo = UserInfo.fromJson(baseData.data); mBalance = double.tryParse(userInfo.money).toInt(); - if (mounted) setState(() {}); + if (mounted) setState(() {}); - } else { - Fluttertoast.showToast(msg: baseData.msg); } } @@ -96,7 +94,6 @@ class _MineWalletPage extends State<MineWalletPage> { } else { refreshController.refreshFailed(); refreshController.loadFailed(); - Fluttertoast.showToast(msg: baseData.msg); } if (mounted) setState(() {}); } diff --git a/lib/mine/roll_center_page.dart b/lib/mine/roll_center_page.dart index cb2ccd4a..594258fd 100644 --- a/lib/mine/roll_center_page.dart +++ b/lib/mine/roll_center_page.dart @@ -1,7 +1,7 @@ import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:fluttertoast/fluttertoast.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/coupon.dart'; @@ -69,7 +69,6 @@ class _RollCenterPage extends State<RollCenterPage> { } setState(() {}); } else { - Fluttertoast.showToast(msg: baseData.msg); _refreshController.refreshFailed(); _refreshController.loadFailed(); } @@ -166,11 +165,9 @@ class _RollCenterPage extends State<RollCenterPage> { receiveCoupon(couponId) async { BaseData baseData = await apiService.receiveCoupon(couponId); - if (baseData.isSuccess) { + if (baseData != null && baseData.isSuccess) { refreshCoupon(); showAlertDialog(); - } else { - Fluttertoast.showToast(msg: baseData.msg); } } diff --git a/lib/mine/user_info_page.dart b/lib/mine/user_info_page.dart index 4543ad5d..938c284f 100644 --- a/lib/mine/user_info_page.dart +++ b/lib/mine/user_info_page.dart @@ -3,7 +3,7 @@ import 'dart:io'; import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:fluttertoast/fluttertoast.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/upload_result.dart'; @@ -354,7 +354,7 @@ class _UserInfoPage extends State<UserInfoPage> { var info = await apiService.editInfo(modifyInfo); if (info.isSuccess) { setState(() { - Fluttertoast.showToast(msg: "用户信息修改成功"); + SmartDialog.showToast("用户信息修改成功"); }); } } diff --git a/lib/mine/vip_balance_page.dart b/lib/mine/vip_balance_page.dart index c9db9dca..5cd8c9ae 100644 --- a/lib/mine/vip_balance_page.dart +++ b/lib/mine/vip_balance_page.dart @@ -1,7 +1,7 @@ import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:fluttertoast/fluttertoast.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/coupon.dart'; @@ -53,7 +53,7 @@ class _VipBalancePage extends State<VipBalancePage> { _refreshController.loadFailed(); _refreshController.refreshFailed(); }); - if (baseData.isSuccess) { + if (baseData != null && baseData.isSuccess) { PageInfo pageInfo = PageInfo.fromJson(baseData.data); if (pageNum == 1) { coupons.clear(); @@ -71,7 +71,6 @@ class _VipBalancePage extends State<VipBalancePage> { } else { _refreshController.loadFailed(); _refreshController.refreshFailed(); - Fluttertoast.showToast(msg: baseData.msg); } } diff --git a/lib/mine/vip_card_page.dart b/lib/mine/vip_card_page.dart index b93e2ef3..12c57f10 100644 --- a/lib/mine/vip_card_page.dart +++ b/lib/mine/vip_card_page.dart @@ -1,7 +1,7 @@ import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:fluttertoast/fluttertoast.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/vip_card.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; @@ -51,7 +51,6 @@ class _VipCardPage extends State<VipCardPage> { }); } else { _refreshController.refreshFailed(); - Fluttertoast.showToast(msg: baseData.msg); } } diff --git a/lib/mine/vip_detail_page.dart b/lib/mine/vip_detail_page.dart index 7661a32c..e380da02 100644 --- a/lib/mine/vip_detail_page.dart +++ b/lib/mine/vip_detail_page.dart @@ -1,7 +1,7 @@ import 'package:barcode_widget/barcode_widget.dart'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; -import 'package:fluttertoast/fluttertoast.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/vip_card.dart'; @@ -45,8 +45,6 @@ class _VipDetailPage extends State<VipDetailPage> { if (baseData != null && baseData.isSuccess) { vipCard = VipCard.fromJson(baseData.data); setState(() {}); - } else { - Fluttertoast.showToast(msg: baseData.msg); } } diff --git a/lib/order/exchange_history_page.dart b/lib/order/exchange_history_page.dart index 1267574f..0f10829c 100644 --- a/lib/order/exchange_history_page.dart +++ b/lib/order/exchange_history_page.dart @@ -1,7 +1,7 @@ import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:fluttertoast/fluttertoast.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/exchange_order.dart'; @@ -189,7 +189,6 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> { } else { _refreshController.refreshFailed(); _refreshController.loadFailed(); - Fluttertoast.showToast(msg: baseData.msg); } } @@ -462,8 +461,6 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> { BaseData baseData = await apiService.creditOrderReceive(id); if (baseData != null && baseData.isSuccess) { queryHistory(); - } else { - Fluttertoast.showToast(msg: baseData.msg); } } diff --git a/lib/order/exchange_order_page.dart b/lib/order/exchange_order_page.dart index 158d91ab..be5ef59d 100644 --- a/lib/order/exchange_order_page.dart +++ b/lib/order/exchange_order_page.dart @@ -3,7 +3,7 @@ import 'dart:convert'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:dio/dio.dart'; -import 'package:fluttertoast/fluttertoast.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/user_info.dart'; @@ -424,12 +424,12 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> { creditOrder() async { if (widget.arguments["useTyped"] == 1 && (storeId == null || storeId == "")) { - Fluttertoast.showToast(msg: "请选择一个门店"); + SmartDialog.showToast("请选择一个门店"); return; } if (widget.arguments["useTyped"] == 2 && (userAddressId == null || userAddressId == "")) { - Fluttertoast.showToast(msg: "请选择一个收货地址"); + SmartDialog.showToast("请选择一个收货地址"); return; } BaseData baseDate = await apiService.creditOrder({ @@ -447,7 +447,7 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> { "${int.tryParse(points) - int.tryParse(widget.arguments["price"])}"; Navigator.of(context).pop(); } else { - Fluttertoast.showToast(msg: baseDate.msg); + SmartDialog.showToast(baseDate.msg); } } } diff --git a/lib/order/exchange_order_success_page.dart b/lib/order/exchange_order_success_page.dart index a2b63c8b..5e5974a2 100644 --- a/lib/order/exchange_order_success_page.dart +++ b/lib/order/exchange_order_success_page.dart @@ -2,7 +2,7 @@ import 'dart:convert'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; -import 'package:fluttertoast/fluttertoast.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/user_info.dart'; @@ -227,8 +227,6 @@ class _ExchangeOrderSuccessPage extends State<ExchangeOrderSuccessPage> { if(baseData != null && baseData.isSuccess) { await Navigator.of(context).pushNamed('/router/mine_card'); Navigator.of(context).pop(); - } else { - Fluttertoast.showToast(msg: baseData.msg); } } diff --git a/lib/order/order_detail_page.dart b/lib/order/order_detail_page.dart index be479aaa..494c576a 100644 --- a/lib/order/order_detail_page.dart +++ b/lib/order/order_detail_page.dart @@ -1,6 +1,6 @@ import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; -import 'package:fluttertoast/fluttertoast.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/order_info.dart'; @@ -68,8 +68,6 @@ class _OrderDetailPage extends State<OrderDetailPage> { setState(() { statusTitle(); }); - } else { - Fluttertoast.showToast(msg: baseData.msg); } } @@ -482,7 +480,7 @@ class _OrderDetailPage extends State<OrderDetailPage> { // if (baseData != null && baseData.isSuccess) { // // queryDetails(); // } else { - // Fluttertoast.showToast(msg: baseData.msg); + // SmartDialog.showToast(baseData.msg); // } showDialog( context: context, diff --git a/lib/order/order_history_page.dart b/lib/order/order_history_page.dart index 48c71b1f..a9f45cac 100644 --- a/lib/order/order_history_page.dart +++ b/lib/order/order_history_page.dart @@ -1,6 +1,6 @@ import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; -import 'package:fluttertoast/fluttertoast.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/order_info.dart'; @@ -207,7 +207,6 @@ class _OrderHistoryList extends State<OrderHistoryList> } else { refreshController.refreshFailed(); refreshController.loadFailed(); - Fluttertoast.showToast(msg: baseData.msg); } } diff --git a/lib/order/store_selector_page.dart b/lib/order/store_selector_page.dart index a463f897..374bac0f 100644 --- a/lib/order/store_selector_page.dart +++ b/lib/order/store_selector_page.dart @@ -3,7 +3,7 @@ import 'package:amap_flutter_location/amap_location_option.dart'; import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:fluttertoast/fluttertoast.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/store.dart'; @@ -96,14 +96,7 @@ class _StoreSelectorPage extends State<StoreSelectorPage> { if (await Permission.locationWhenInUse.serviceStatus.isEnabled) { bool isShown = await Permission.contacts.shouldShowRequestRationale; if (isShown) { - Fluttertoast.showToast( - msg: "shouldShowRequestRationale", - toastLength: Toast.LENGTH_SHORT, - gravity: ToastGravity.CENTER, - timeInSecForIosWeb: 1, - backgroundColor: Colors.red, - textColor: Colors.white, - fontSize: 16.0); + SmartDialog.showToast("shouldShowRequestRationale"); } if (await Permission.location.isPermanentlyDenied) { openAppSettings(); @@ -172,8 +165,6 @@ class _StoreSelectorPage extends State<StoreSelectorPage> { .map((e) => Store.fromJson(e)) .toList(); if (mounted) setState(() {}); - } else { - Fluttertoast.showToast(msg: baseData.msg); } } @@ -232,7 +223,7 @@ class _StoreSelectorPage extends State<StoreSelectorPage> { InkWell( onTap: () { if (groupValue == null) { - Fluttertoast.showToast(msg: S.of(context).qingxuanzeyigemendian); + SmartDialog.showToast(S.of(context).qingxuanzeyigemendian); return; } Store store = storeList[groupValue]; diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 897224ac..672a3c6b 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -23,6 +23,7 @@ const baseUrl = "http://platform.test.api.lotus-wallet.com/app/"; @RestApi(baseUrl: baseUrl) abstract class ApiService { + factory ApiService(Dio dio, {String baseUrl, BuildContext context, @@ -74,6 +75,8 @@ abstract class ApiService { ), clickBgDismissTemp: false, ); + } else if (map["code"] != 0) { + SmartDialog.showToast(map["msg"]); } debugPrint("======================= 响应数据结束 =======================\n"); }, onError: (DioError e) { diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart new file mode 100644 index 00000000..6018ba50 --- /dev/null +++ b/lib/retrofit/retrofit_api.g.dart @@ -0,0 +1,765 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'retrofit_api.dart'; + +// ************************************************************************** +// RetrofitGenerator +// ************************************************************************** + +class _ApiService implements ApiService { + _ApiService(this._dio, {this.baseUrl}) { + ArgumentError.checkNotNull(_dio, '_dio'); + baseUrl ??= 'http://192.168.10.236:8766/app/'; + } + + final Dio _dio; + + String baseUrl; + + @override + Future<BaseData> upload(data, folderId) async { + ArgumentError.checkNotNull(data, 'data'); + ArgumentError.checkNotNull(folderId, 'folderId'); + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = FormData(); + _data.files.add(MapEntry( + 'file', + MultipartFile.fromFileSync(data.path, + filename: data.path.split(Platform.pathSeparator).last))); + if (folderId != null) { + _data.fields.add(MapEntry('folderId', folderId.toString())); + } + final _result = await _dio.request<Map<String, dynamic>>('/file/upload', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<dynamic> searchPoi(lat, lng, keywords, size, page) async { + ArgumentError.checkNotNull(lat, 'lat'); + ArgumentError.checkNotNull(lng, 'lng'); + ArgumentError.checkNotNull(keywords, 'keywords'); + ArgumentError.checkNotNull(size, 'size'); + ArgumentError.checkNotNull(page, 'page'); + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + final _result = await _dio.request( + 'https://restapi.amap.com/v3/place/around?key=542b46afa8e4b88fe1eb3c4d0ba0872f&location=$lat,$lng&keywords=$keywords&offset={size}&page={page}&extensions=all', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = _result.data; + return value; + } + + @override + Future<BaseData> memberLogin(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + _data.addAll(param ?? <String, dynamic>{}); + final _result = await _dio.request<Map<String, dynamic>>( + '/auth/platform/memberLogin', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> sendVerify(mobile) async { + ArgumentError.checkNotNull(mobile, 'mobile'); + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + final _result = await _dio.request<Map<String, dynamic>>( + '/auth/sendVerify/$mobile', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> creditGoods(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + _data.addAll(param ?? <String, dynamic>{}); + final _result = await _dio.request<Map<String, dynamic>>( + '/creditGoods/list', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> creditGoodsById(id) async { + ArgumentError.checkNotNull(id, 'id'); + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + final _result = await _dio.request<Map<String, dynamic>>('/creditGoods/$id', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> queryInfo() async { + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + final _result = await _dio.request<Map<String, dynamic>>('/member/info', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> editInfo(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + _data.addAll(param ?? <String, dynamic>{}); + final _result = await _dio.request<Map<String, dynamic>>( + '/member/editMemberInfo', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> signInInfo() async { + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + final _result = await _dio.request<Map<String, dynamic>>( + '/member/signInInfo', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> signIn() async { + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + final _result = await _dio.request<Map<String, dynamic>>('/member/signIn', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> recharge(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + _data.addAll(param ?? <String, dynamic>{}); + final _result = await _dio.request<Map<String, dynamic>>('/member/recharge', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> receiveCoupon(couponId) async { + ArgumentError.checkNotNull(couponId, 'couponId'); + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + final _result = await _dio.request<Map<String, dynamic>>( + '/coupon/receive?couponId=$couponId', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> creditOrderList(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + _data.addAll(param ?? <String, dynamic>{}); + final _result = await _dio.request<Map<String, dynamic>>( + '/creditOrder/list', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> creditOrder(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + _data.addAll(param ?? <String, dynamic>{}); + final _result = await _dio.request<Map<String, dynamic>>( + '/creditOrder/create', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> addAddress(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + _data.addAll(param ?? <String, dynamic>{}); + final _result = await _dio.request<Map<String, dynamic>>('/address/add', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> deleteAddress(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + _data.addAll(param ?? <String, dynamic>{}); + final _result = await _dio.request<Map<String, dynamic>>('/address/delete', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> queryAddress(id) async { + ArgumentError.checkNotNull(id, 'id'); + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + final _result = await _dio.request<Map<String, dynamic>>( + '/address/detail/$id', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> queryMemberAddress() async { + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + final _result = await _dio.request<Map<String, dynamic>>( + '/address/queryMemberAddress', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> updateAddress(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + _data.addAll(param ?? <String, dynamic>{}); + final _result = await _dio.request<Map<String, dynamic>>('/address/update', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> queryCoupon(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + _data.addAll(param ?? <String, dynamic>{}); + final _result = await _dio.request<Map<String, dynamic>>( + '/coupon/centreList', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> queryCard(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + _data.addAll(param ?? <String, dynamic>{}); + final _result = await _dio.request<Map<String, dynamic>>( + '/coupon/packageList', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> queryStore(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + _data.addAll(param ?? <String, dynamic>{}); + final _result = await _dio.request<Map<String, dynamic>>('/store/list', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> informationList(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + _data.addAll(param ?? <String, dynamic>{}); + final _result = await _dio.request<Map<String, dynamic>>( + '/information/list', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> informationInfo(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + _data.addAll(param ?? <String, dynamic>{}); + final _result = await _dio.request<Map<String, dynamic>>( + '/information/{id}', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> creditOrderReceive(id) async { + ArgumentError.checkNotNull(id, 'id'); + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + final _result = await _dio.request<Map<String, dynamic>>( + '/creditOrder/receive/$id', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> queryHome() async { + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + final _result = await _dio.request<Map<String, dynamic>>('/home/home', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> queryStoreInfo(id) async { + ArgumentError.checkNotNull(id, 'id'); + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + final _result = await _dio.request<Map<String, dynamic>>('/store/$id', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> queryArticle(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + _data.addAll(param ?? <String, dynamic>{}); + final _result = await _dio.request<Map<String, dynamic>>( + '/information/list', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> queryBanner(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + _data.addAll(param ?? <String, dynamic>{}); + final _result = await _dio.request<Map<String, dynamic>>('/banner/page', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> queryHomeBrand() async { + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + final _result = await _dio.request<Map<String, dynamic>>('/home/brand', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> minLogin(storeId) async { + ArgumentError.checkNotNull(storeId, 'storeId'); + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + final _result = await _dio.request<Map<String, dynamic>>( + '/auth/mini/login/$storeId', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> queryBillInfo(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + _data.addAll(param ?? <String, dynamic>{}); + final _result = await _dio.request<Map<String, dynamic>>('/member/listBill', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> rankList() async { + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + final _result = await _dio.request<Map<String, dynamic>>('/member/rankList', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> orderList(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + _data.addAll(param ?? <String, dynamic>{}); + final _result = await _dio.request<Map<String, dynamic>>('/order/list', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> orderDetail(id) async { + ArgumentError.checkNotNull(id, 'id'); + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + final _result = await _dio.request<Map<String, dynamic>>( + '/order/orderDetail?id=$id', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> continuePay(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + _data.addAll(param ?? <String, dynamic>{}); + final _result = await _dio.request<Map<String, dynamic>>( + '/order/continuePay', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> receiveToCard(id) async { + ArgumentError.checkNotNull(id, 'id'); + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + final _result = await _dio.request<Map<String, dynamic>>( + '/creditOrder/receive/$id', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> vipList() async { + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + final _result = await _dio.request<Map<String, dynamic>>('/member/vipList', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future<BaseData> vipDetail(id) async { + ArgumentError.checkNotNull(id, 'id'); + const _extra = <String, dynamic>{}; + final queryParameters = <String, dynamic>{}; + final _data = <String, dynamic>{}; + final _result = await _dio.request<Map<String, dynamic>>( + '/member/vipDetail/$id', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: <String, dynamic>{}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } +} diff --git a/lib/setting/setting_page.dart b/lib/setting/setting_page.dart index 118dd4b6..b3b5ece4 100644 --- a/lib/setting/setting_page.dart +++ b/lib/setting/setting_page.dart @@ -2,7 +2,6 @@ import 'dart:io'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:fluttertoast/fluttertoast.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/login/login_page.dart'; import 'package:huixiang/main.dart'; diff --git a/lib/union/union_details_page.dart b/lib/union/union_details_page.dart index d7ffe8e8..2f6dccf5 100644 --- a/lib/union/union_details_page.dart +++ b/lib/union/union_details_page.dart @@ -5,8 +5,8 @@ import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_swiper/flutter_swiper.dart'; -import 'package:fluttertoast/fluttertoast.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/activity.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; @@ -64,7 +64,9 @@ class _UnionDetailsPage extends State<UnionDetailsPage> { if (baseData != null && baseData.isSuccess) { refreshController.refreshCompleted(); storeInfo = StoreInfo.fromJson(baseData.data); - activitys = storeInfo.informationVOPageVO.list.map((e) => Activity.fromJson(e)).toList(); + activitys = storeInfo.informationVOPageVO.list + .map((e) => Activity.fromJson(e)) + .toList(); if (mounted) setState(() {}); } else { refreshController.refreshFailed(); @@ -405,7 +407,9 @@ class _UnionDetailsPage extends State<UnionDetailsPage> { width: 8.w, ), Text( - (storeInfo != null && storeInfo.memberSource != null) ? "${storeInfo.memberSource.integral}" : "", + (storeInfo != null && storeInfo.memberSource != null) + ? "${storeInfo.memberSource.integral}" + : "", style: TextStyle( fontSize: 14.sp, fontWeight: FontWeight.bold, @@ -416,7 +420,9 @@ class _UnionDetailsPage extends State<UnionDetailsPage> { ), ], ), - SizedBox(height: 10.h,), + SizedBox( + height: 10.h, + ), Text( S.of(context).gongxinichengweibendianhuiyuan, style: TextStyle( @@ -459,7 +465,9 @@ class _UnionDetailsPage extends State<UnionDetailsPage> { receiveVip(); }, child: RoundButton( - text: S.of(context).dianwolingqu, + text: isReceive + ? S.of(context).dianwolingqu + : S.of(context).yilingqu, textColor: isReceive ? Colors.white : Color(0xFF484D66), backgroup: isReceive ? Color(0xFF242B45) : Colors.white, padding: @@ -478,207 +486,208 @@ class _UnionDetailsPage extends State<UnionDetailsPage> { return Container( height: 109.h, child: ListView.builder( - itemCount: (storeInfo != null && storeInfo.couponVOList != null) - ? storeInfo.couponVOList.length - : 0, - physics: BouncingScrollPhysics(parent: PageScrollPhysics()), - scrollDirection: Axis.horizontal, - itemBuilder: (context, position) { - return Container( - width: MediaQuery.of(context).size.width * 0.784, - margin: EdgeInsets.only(left: 6.w), - child: AspectRatio( - aspectRatio: 2.86, - child: Stack( - children: [ - Image.asset( - "assets/image/icon_union_coupons_bg.png", - fit: BoxFit.fill, - width: double.infinity, - height: double.infinity, + itemCount: (storeInfo != null && storeInfo.couponVOList != null) + ? storeInfo.couponVOList.length + : 0, + physics: BouncingScrollPhysics(parent: PageScrollPhysics()), + scrollDirection: Axis.horizontal, + itemBuilder: (context, position) { + return Container( + width: MediaQuery.of(context).size.width * 0.784, + margin: EdgeInsets.only(left: 6.w), + child: AspectRatio( + aspectRatio: 2.86, + child: Stack( + children: [ + Image.asset( + "assets/image/icon_union_coupons_bg.png", + fit: BoxFit.fill, + width: double.infinity, + height: double.infinity, + ), + Container( + padding: EdgeInsets.only( + left: 24.w, + right: 24.w, + bottom: 17.h, + top: 11.h, ), - Container( - padding: EdgeInsets.only( - left: 24.w, - right: 24.w, - bottom: 17.h, - top: 11.h, - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - margin: EdgeInsets.only(left: 5), - child: Text.rich(TextSpan(children: [ - TextSpan( - text: (storeInfo != null && - storeInfo.couponVOList != null && - storeInfo.couponVOList[position] - .bizType == - 1) - ? "¥" - : "", - style: TextStyle( - fontSize: 22.sp, - color: Color(0xFFFF7A1A), - fontWeight: FontWeight.bold, - ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + margin: EdgeInsets.only(left: 5), + child: Text.rich(TextSpan(children: [ + TextSpan( + text: (storeInfo != null && + storeInfo.couponVOList != null && + storeInfo + .couponVOList[position].bizType == + 1) + ? "¥" + : "", + style: TextStyle( + fontSize: 22.sp, + color: Color(0xFFFF7A1A), + fontWeight: FontWeight.bold, ), - TextSpan( - text: (storeInfo != null && - storeInfo.couponVOList != null && - storeInfo.couponVOList[position] - .bizType == - 1) - ? "${double.tryParse(storeInfo.couponVOList[position].discountAmount).toInt()}" - : "${storeInfo.couponVOList[position].discountPercent}折", - style: TextStyle( - fontSize: 36.sp, - color: Color(0xFFFF7A1A), - fontWeight: FontWeight.bold, - ), + ), + TextSpan( + text: (storeInfo != null && + storeInfo.couponVOList != null && + storeInfo + .couponVOList[position].bizType == + 1) + ? "${double.tryParse(storeInfo.couponVOList[position].discountAmount).toInt()}" + : "${storeInfo.couponVOList[position].discountPercent}折", + style: TextStyle( + fontSize: 36.sp, + color: Color(0xFFFF7A1A), + fontWeight: FontWeight.bold, ), - ])), - alignment: Alignment.center, + ), + ])), + alignment: Alignment.center, + ), + Container( + margin: EdgeInsets.only( + top: 12.h, + bottom: 12.h, + left: 15.w, + right: 24.w, + ), + child: MySeparator( + width: 1.w, + height: 5.h, + color: Color(0xFF979797), ), - Container( + ), + Expanded( + child: Container( margin: EdgeInsets.only( - top: 12.h, bottom: 12.h, - left: 15.w, - right: 24.w, - ), - child: MySeparator( - width: 1.w, - height: 5.h, - color: Color(0xFF979797), + top: 12.h, ), - ), - Expanded( - child: Container( - margin: EdgeInsets.only( - bottom: 12.h, - top: 12.h, - ), - child: Column( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - (storeInfo != null && - storeInfo.couponVOList != null) - ? storeInfo - .couponVOList[position].couponName - : "", - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 10.sp, - fontWeight: FontWeight.bold, - color: Color(0xFF727272), - ), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + (storeInfo != null && + storeInfo.couponVOList != null) + ? storeInfo + .couponVOList[position].couponName + : "", + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 10.sp, + fontWeight: FontWeight.bold, + color: Color(0xFF727272), ), - Text( - (storeInfo != - null && - storeInfo.couponVOList != null) - ? (storeInfo.couponVOList[position] - .bizType == - 1 - ? S.of(context).manlijiandaijinquan( - double.tryParse(storeInfo - .couponVOList[position] - .fullAmount) - .toInt(), - double.tryParse(storeInfo - .couponVOList[position] - .discountAmount) - .toInt()) - : S.of(context).quanchangzhe( - storeInfo.couponVOList[position] - .discountPercent)) - : "", - // (storeInfo != null && storeInfo.couponVOList != null) ? storeInfo.couponVOList[position].couponImg : "", - // S.of(context).manlijiandaijinquan(30, 5), - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 12.sp, - fontWeight: FontWeight.bold, - color: Color(0xFFFF7A1A), - ), + ), + Text( + (storeInfo != null && + storeInfo.couponVOList != null) + ? (storeInfo.couponVOList[position] + .bizType == + 1 + ? S.of(context).manlijiandaijinquan( + double.tryParse(storeInfo + .couponVOList[position] + .fullAmount) + .toInt(), + double.tryParse(storeInfo + .couponVOList[position] + .discountAmount) + .toInt()) + : S.of(context).quanchangzhe(storeInfo + .couponVOList[position] + .discountPercent)) + : "", + // (storeInfo != null && storeInfo.couponVOList != null) ? storeInfo.couponVOList[position].couponImg : "", + // S.of(context).manlijiandaijinquan(30, 5), + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 12.sp, + fontWeight: FontWeight.bold, + color: Color(0xFFFF7A1A), ), - Text( - S.of(context).youxiaoqizhi( - (storeInfo != null && - storeInfo.couponVOList != - null && - storeInfo - .couponVOList[ - position] - .useStartTime != - null && - storeInfo - .couponVOList[ - position] - .useEndTime != - null) - ? "${storeInfo.couponVOList[position].useStartTime.replaceAll("-", ".").split(" ")[0]}-${storeInfo.couponVOList[position].useEndTime.replaceAll("-", ".").split(" ")[0]}" - : "", - ), - overflow: TextOverflow.ellipsis, - maxLines: 1, - style: TextStyle( - fontSize: 8.sp, - color: Color(0xFFA29E9E), - ), + ), + Text( + S.of(context).youxiaoqizhi( + (storeInfo != null && + storeInfo.couponVOList != + null && + storeInfo.couponVOList[position] + .useStartTime != + null && + storeInfo.couponVOList[position] + .useEndTime != + null) + ? "${storeInfo.couponVOList[position].useStartTime.replaceAll("-", ".").split(" ")[0]}-${storeInfo.couponVOList[position].useEndTime.replaceAll("-", ".").split(" ")[0]}" + : "", + ), + overflow: TextOverflow.ellipsis, + maxLines: 1, + style: TextStyle( + fontSize: 8.sp, + color: Color(0xFFA29E9E), ), - ], - ), + ), + ], ), ), - InkWell( - onTap: () { + ), + InkWell( + onTap: () { + if (storeInfo != null && + storeInfo.couponVOList != null && + storeInfo.couponVOList[position].status == 0) { receiveCoupon( storeInfo.couponVOList[position].id); - }, - child: Container( - height: 25.h, - child: RoundButton( - text: S.of(context).lingqu, - textColor: Colors.white, - backgroup: (storeInfo != null && - storeInfo.couponVOList != null && - storeInfo.couponVOList[position] - .status >= - 2) - ? Colors.grey - : Color(0xFF32A060), - padding: EdgeInsets.fromLTRB(8, 4, 8, 4), - fontSize: 12.sp, - ), + } + }, + child: Container( + height: 25.h, + child: RoundButton( + text: (storeInfo != null && + storeInfo.couponVOList != null && + storeInfo.couponVOList[position].status > + 0) + ? S.of(context).yilingqu + : S.of(context).lingqu, + textColor: Colors.white, + backgroup: (storeInfo != null && + storeInfo.couponVOList != null && + storeInfo.couponVOList[position].status > + 0) + ? Colors.grey + : Color(0xFF32A060), + padding: EdgeInsets.fromLTRB(8, 4, 8, 4), + fontSize: 12.sp, ), ), - ], - ), - ) - ], - ), + ), + ], + ), + ) + ], ), - ); - }), + ), + ); + }, + ), ); } ///领取优惠券 receiveCoupon(couponId) async { BaseData baseData = await apiService.receiveCoupon(couponId); - if (baseData.isSuccess) { + if (baseData != null && baseData.isSuccess) { queryStoreInfo(); showAlertDialog(); - } else { - Fluttertoast.showToast(msg: baseData.msg); } } @@ -697,12 +706,10 @@ class _UnionDetailsPage extends State<UnionDetailsPage> { receiveVip() async { BaseData baseData = await apiService.minLogin(storeInfo.id); if (baseData != null && baseData.isSuccess) { - Fluttertoast.showToast(msg: S.of(context).lingquchenggong); + SmartDialog.showToast(S.of(context).lingquchenggong); setState(() { isReceive = true; }); - } else { - Fluttertoast.showToast(msg: baseData.msg); } } @@ -809,8 +816,7 @@ class _UnionDetailsPage extends State<UnionDetailsPage> { ), child: Text( (activitys != null) - ? activitys[position].startTime - .split(" ")[0] + ? activitys[position].startTime.split(" ")[0] : "", style: TextStyle( fontWeight: FontWeight.bold, @@ -886,21 +892,19 @@ class _UnionDetailsPage extends State<UnionDetailsPage> { print("print getAppBasePath: ${await Min.getAppBasePath(miniAppId)}"); print("print currentPageUrl: ${await Min.currentPageUrl()}"); print("print runingAppid: ${await Min.runingAppid()}"); - print("print getAppVersionInfo: ${await Min.getAppVersionInfo(miniAppId)}"); + // print("print getAppVersionInfo: ${await Min.getAppVersionInfo(miniAppId)}"); } _loginMin() async { if (storeInfo == null) return; if (!isEnable()) { - Fluttertoast.showToast(msg: S.of(context).zanbuzhichixianshangdiancan); + SmartDialog.showToast(S.of(context).zanbuzhichixianshangdiancan); return; } BaseData baseData = await apiService.minLogin(storeInfo.id); if (baseData != null && baseData.isSuccess) { UserEntity userEntity = UserEntity.fromJson(baseData.data); startMin(userEntity.token, userEntity.userId); - } else { - Fluttertoast.showToast(msg: baseData.msg); } } @@ -992,7 +996,7 @@ class _UnionDetailsPage extends State<UnionDetailsPage> { crossAxisAlignment: CrossAxisAlignment.center, children: [ SizedBox( - height: 40.0.h, + height: 40.h, width: 40.w, child: CircularProgressIndicator( value: progressValue, diff --git a/lib/union/union_page.dart b/lib/union/union_page.dart index 2e2d7902..c30a762b 100644 --- a/lib/union/union_page.dart +++ b/lib/union/union_page.dart @@ -22,8 +22,6 @@ import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/item_title.dart'; import 'package:amap_flutter_base/amap_flutter_base.dart'; import 'package:amap_flutter_map/amap_flutter_map.dart'; -import 'package:fluttertoast/fluttertoast.dart'; -import 'package:huixiang/view_widget/loading_view.dart'; import 'package:huixiang/view_widget/request_permission.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; @@ -236,7 +234,6 @@ class _UnionPage extends State<UnionPage> setState(() {}); } else { refreshController.refreshFailed(); - Fluttertoast.showToast(msg: baseData.msg); } } diff --git a/lib/view_widget/store_title_tab.dart b/lib/view_widget/store_title_tab.dart index b047a259..1f96396f 100644 --- a/lib/view_widget/store_title_tab.dart +++ b/lib/view_widget/store_title_tab.dart @@ -31,9 +31,9 @@ class _StoreTitleTab extends State<StoreTitleTab> { bool isVisible = false; List<String> images = [ - "assets/image/icon_chili.png", - "assets/image/icon_milk_tea.png", - "assets/image/icon_bread.png", + "assets/image/icon_chili.webp", + "assets/image/icon_milk_tea.webp", + "assets/image/icon_bread.webp", ]; @override diff --git a/pubspec.lock b/pubspec.lock index fcee6b3f..76a491b7 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,294 +5,294 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "14.0.0" amap_flutter_base: dependency: transitive description: name: amap_flutter_base - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.2" amap_flutter_location: dependency: "direct main" description: name: amap_flutter_location - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" amap_flutter_map: dependency: "direct main" description: name: amap_flutter_map - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.2" analyzer: dependency: transitive description: name: analyzer - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.41.2" android_intent_plus: dependency: "direct main" description: name: android_intent_plus - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.2" args: dependency: transitive description: name: args - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.1" async: dependency: transitive description: name: async - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.5.0" + version: "2.6.1" barcode: dependency: transitive description: name: barcode - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" barcode_widget: dependency: "direct main" description: name: barcode_widget - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.1" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" bubble_tab_indicator: dependency: "direct main" description: name: bubble_tab_indicator - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.1.6" build: dependency: transitive description: name: build - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.6.2" build_config: dependency: transitive description: name: build_config - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.4.6" build_daemon: dependency: transitive description: name: build_daemon - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.10" build_resolvers: dependency: transitive description: name: build_resolvers - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.5.3" build_runner: dependency: "direct dev" description: name: build_runner - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.11.5" build_runner_core: dependency: transitive description: name: build_runner_core - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "6.1.10" built_collection: dependency: transitive description: name: built_collection - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.3.2" built_value: dependency: transitive description: name: built_value - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "7.1.0" cached_network_image: dependency: "direct main" description: name: cached_network_image - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" characters: dependency: transitive description: name: characters - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.0" charcode: dependency: transitive description: name: charcode - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.2.0" checked_yaml: dependency: transitive description: name: checked_yaml - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.4" chewie: dependency: "direct main" description: name: chewie - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.12.2" chewie_audio: dependency: transitive description: name: chewie_audio - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.2" cli_util: dependency: transitive description: name: cli_util - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.3.3" clock: dependency: transitive description: name: clock - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.0" code_builder: dependency: transitive description: name: code_builder - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.7.0" collection: dependency: transitive description: name: collection - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.15.0" convert: dependency: transitive description: name: convert - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.1" crypto: dependency: transitive description: name: crypto - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.5" css_colors: dependency: transitive description: name: css_colors - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.1" csslib: dependency: transitive description: name: csslib - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.16.2" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.3" dart_style: dependency: transitive description: name: dart_style - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.3.12" dio: dependency: "direct main" description: name: dio - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.10" event_bus: dependency: "direct main" description: name: event_bus - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.2.0" ffi: dependency: transitive description: name: ffi - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.2" file: dependency: transitive description: name: file - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "6.1.2" fixnum: dependency: transitive description: name: fixnum - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.10.11" flutter: @@ -304,21 +304,21 @@ packages: dependency: transitive description: name: flutter_cache_manager - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.3" flutter_html: dependency: "direct main" description: name: flutter_html - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.3.0" flutter_layout_grid: dependency: transitive description: name: flutter_layout_grid - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.10.5" flutter_localizations: @@ -330,49 +330,49 @@ packages: dependency: transitive description: name: flutter_page_indicator - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.0.3" flutter_plugin_android_lifecycle: dependency: transitive description: name: flutter_plugin_android_lifecycle - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.11" flutter_screenutil: dependency: "direct main" description: name: flutter_screenutil - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "5.0.0+2" flutter_smart_dialog: dependency: "direct main" description: name: flutter_smart_dialog - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.6" flutter_staggered_grid_view: dependency: "direct main" description: name: flutter_staggered_grid_view - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.4.0" flutter_svg: dependency: transitive description: name: flutter_svg - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.20.0-nullsafety.3" flutter_swiper: dependency: "direct main" description: name: flutter_swiper - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.6" flutter_test: @@ -385,403 +385,389 @@ packages: description: flutter source: sdk version: "0.0.0" - fluttertoast: - dependency: "direct main" - description: - name: fluttertoast - url: "https://pub.flutter-io.cn" - source: hosted - version: "8.0.7" glob: dependency: transitive description: name: glob - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.1" graphs: dependency: transitive description: name: graphs - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.2.0" html: dependency: transitive description: name: html - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.14.0+4" http: dependency: transitive description: name: http - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.12.2" http_multi_server: dependency: transitive description: name: http_multi_server - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.2.0" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.1.4" image_cropper: dependency: "direct main" description: name: image_cropper - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.4.1" image_picker: dependency: transitive description: name: image_picker - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.6.7+22" image_picker_gallery_camera: dependency: "direct main" description: name: image_picker_gallery_camera - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.1.6" image_picker_platform_interface: dependency: transitive description: name: image_picker_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.6" import_js_library: dependency: transitive description: name: import_js_library - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.2" intl: dependency: "direct main" description: name: intl - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.17.0" io: dependency: transitive description: name: io - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.3.5" js: dependency: transitive description: name: js - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.6.3" json_annotation: dependency: "direct main" description: name: json_annotation - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.1.1" json_serializable: dependency: "direct dev" description: name: json_serializable - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.5.1" logger: dependency: "direct main" description: name: logger - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.0" logging: dependency: transitive description: name: logging - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.1" matcher: dependency: transitive description: name: matcher - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.12.10" meta: dependency: transitive description: name: meta - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.3.0" mime: dependency: transitive description: name: mime - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.0" package_config: dependency: transitive description: name: package_config - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.9.3" package_info: dependency: "direct main" description: name: package_info - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.2" path: dependency: transitive description: name: path - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.8.0" path_drawing: dependency: transitive description: name: path_drawing - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.5.1" path_parsing: dependency: transitive description: name: path_parsing - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.2.1" path_provider: dependency: "direct main" description: name: path_provider - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.2.0" path_provider_linux: dependency: transitive description: name: path_provider_linux - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" path_provider_windows: dependency: transitive description: name: path_provider_windows - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.1" pedantic: dependency: transitive description: name: pedantic - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.11.1" permission_handler: dependency: "direct main" description: name: permission_handler - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "5.1.0+2" permission_handler_platform_interface: dependency: transitive description: name: permission_handler_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.2" petitparser: dependency: transitive description: name: petitparser - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.1.0" - photo_view: - dependency: "direct main" - description: - name: photo_view - url: "https://pub.flutter-io.cn" - source: hosted - version: "0.11.1" platform: dependency: transitive description: name: platform - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.3" pool: dependency: transitive description: name: pool - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.5.0" process: dependency: transitive description: name: process - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.2.1" pub_semver: dependency: transitive description: name: pub_semver - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" pubspec_parse: dependency: transitive description: name: pubspec_parse - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.1.8" pull_to_refresh: dependency: "direct main" description: name: pull_to_refresh - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" qr: dependency: transitive description: name: qr - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" quiver: dependency: transitive description: name: quiver - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.5" retrofit: dependency: "direct main" description: name: retrofit - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.3.4+1" retrofit_generator: dependency: "direct dev" description: name: retrofit_generator - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.4.1+3" rxdart: dependency: "direct main" description: name: rxdart - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.26.0" share: dependency: "direct main" description: name: share - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.6.4+5" shared_preferences: dependency: "direct main" description: name: shared_preferences - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.6" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" shared_preferences_macos: dependency: transitive description: name: shared_preferences_macos - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" shared_preferences_platform_interface: dependency: transitive description: name: shared_preferences_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" shared_preferences_web: dependency: transitive description: name: shared_preferences_web - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" shelf: dependency: transitive description: name: shelf - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.7.9" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.2.4+1" sky_engine: @@ -793,212 +779,212 @@ packages: dependency: transitive description: name: source_gen - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.9.10+3" source_span: dependency: transitive description: name: source_span - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.8.1" sqflite: dependency: transitive description: name: sqflite - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.3.2+4" sqflite_common: dependency: transitive description: name: sqflite_common - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.3+3" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" stream_transform: dependency: transitive description: name: stream_transform - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.2.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.0" synchronized: dependency: transitive description: name: synchronized - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.2.0+2" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.2.0" test_api: dependency: transitive description: name: test_api - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "0.2.19" + version: "0.3.0" timing: dependency: transitive description: name: timing - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.1.1+3" transformer_page_view: dependency: transitive description: name: transformer_page_view - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.1.6" tuple: dependency: transitive description: name: tuple - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.3" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.3.0" uuid: dependency: transitive description: name: uuid - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.2.2" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" video_player: dependency: "direct main" description: name: video_player - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.1" video_player_platform_interface: dependency: transitive description: name: video_player_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.2.0" video_player_web: dependency: transitive description: name: video_player_web - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.1.4+1" wakelock: dependency: transitive description: name: wakelock - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.2.1+1" wakelock_platform_interface: dependency: transitive description: name: wakelock_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.1.0+1" wakelock_web: dependency: transitive description: name: wakelock_web - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.1.0+3" watcher: dependency: transitive description: name: watcher - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.0" web_socket_channel: dependency: transitive description: name: web_socket_channel - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.2.0" webview_flutter: dependency: transitive description: name: webview_flutter - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.7" win32: dependency: transitive description: name: win32 - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.5" + version: "2.2.5" xdg_directories: dependency: transitive description: name: xdg_directories - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.2.0" xml: dependency: transitive description: name: xml - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "5.1.2" yaml: dependency: transitive description: name: yaml - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.1.0" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.13.0 <3.0.0" flutter: ">=2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 836d4a8c..65ebc426 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -63,7 +63,7 @@ dependencies: event_bus: ^2.0.0 intl: ^0.17.0 shared_preferences: ^2.0.6 - fluttertoast: ^8.0.7 +# fluttertoast: ^8.0.7 flutter_smart_dialog: ^2.1.6 # url_launcher: ^6.0.5 @@ -80,7 +80,7 @@ dependencies: cached_network_image: ^2.0.0 flutter_html: ^1.3.0 #2.1.0 - photo_view: ^0.11.1 +# photo_view: ^0.11.1 chewie: ^0.12.2 video_player: ^1.0.1