哈哈哈 4 years ago
parent
commit
169367d62a
  1. 15
      android/app/build.gradle
  2. BIN
      android/app/libs/payment-weixin-release.aar
  3. BIN
      android/app/libs/wechat-sdk-android-without-mta-6.6.5.aar
  4. 14
      android/app/src/main/AndroidManifest.xml
  5. 29
      android/app/src/main/kotlin/com/zsw/huixiang/wxapi/WXPayEntryActivity.kt
  6. BIN
      assets/image/2x/icon_bread.webp
  7. BIN
      assets/image/2x/icon_chili.webp
  8. BIN
      assets/image/2x/icon_milk_tea.webp
  9. BIN
      assets/image/2x/icon_today_video.png
  10. BIN
      assets/image/3x/icon_bread.webp
  11. BIN
      assets/image/3x/icon_chili.webp
  12. BIN
      assets/image/3x/icon_milk_tea.webp
  13. BIN
      assets/image/3x/icon_today_video.png.png
  14. BIN
      assets/image/icon_bread.webp
  15. BIN
      assets/image/icon_chili.webp
  16. BIN
      assets/image/icon_milk_tea.webp
  17. BIN
      assets/image/icon_today_video.png
  18. 10
      ios/Podfile.lock
  19. 12
      ios/Runner.xcodeproj/project.pbxproj
  20. 11
      ios/Runner/Info.plist
  21. 2
      ios/Runner/Runner.entitlements
  22. 11
      lib/address/address_map_page.dart
  23. 14
      lib/address/edit_address_page.dart
  24. 2
      lib/generated/intl/messages_zh_TW.dart
  25. 20
      lib/home/activity_list_page.dart
  26. 32
      lib/home/home_page.dart
  27. 208
      lib/home/points_mall_page.dart
  28. 3
      lib/integral/integral_detailed_page.dart
  29. 169
      lib/integral/integral_page.dart
  30. 17
      lib/integral_store/integral_store_details_page.dart
  31. 2
      lib/l10n/intl_zh_TW.arb
  32. 26
      lib/login/login_page.dart
  33. 7
      lib/mine/coupons_page.dart
  34. 4
      lib/mine/edit_name.dart
  35. 8
      lib/mine/manage_address_page.dart
  36. 3
      lib/mine/mine_card_invalid_page.dart
  37. 1
      lib/mine/mine_page.dart
  38. 4
      lib/mine/mine_vip_level_page.dart
  39. 7
      lib/mine/mine_wallet_page.dart
  40. 7
      lib/mine/roll_center_page.dart
  41. 4
      lib/mine/user_info_page.dart
  42. 5
      lib/mine/vip_balance_page.dart
  43. 3
      lib/mine/vip_card_page.dart
  44. 4
      lib/mine/vip_detail_page.dart
  45. 5
      lib/order/exchange_history_page.dart
  46. 8
      lib/order/exchange_order_page.dart
  47. 4
      lib/order/exchange_order_success_page.dart
  48. 6
      lib/order/order_detail_page.dart
  49. 3
      lib/order/order_history_page.dart
  50. 15
      lib/order/store_selector_page.dart
  51. 3
      lib/retrofit/retrofit_api.dart
  52. 765
      lib/retrofit/retrofit_api.g.dart
  53. 1
      lib/setting/setting_page.dart
  54. 386
      lib/union/union_details_page.dart
  55. 3
      lib/union/union_page.dart
  56. 6
      lib/view_widget/store_title_tab.dart
  57. 296
      pubspec.lock
  58. 4
      pubspec.yaml

15
android/app/build.gradle

@ -60,12 +60,27 @@ android {
v1SigningEnabled true //v1 v1SigningEnabled true //v1
v2SigningEnabled true //v2 v2SigningEnabled true //v2
} }
debug {//debug版签名配置
keyAlias 'huixiang'
keyPassword 'huixiang'
storeFile file('huixiang.jks')
storePassword 'huixiang'
v1SigningEnabled true //v1
v2SigningEnabled true //v2
}
} }
buildTypes { buildTypes {
release { release {
signingConfig signingConfigs.config signingConfig signingConfigs.config
} }
debug {
signingConfig signingConfigs.config
}
profile {
signingConfig signingConfigs.config
}
} }
aaptOptions { aaptOptions {

BIN
android/app/libs/payment-weixin-release.aar

Binary file not shown.

BIN
android/app/libs/wechat-sdk-android-without-mta-6.6.5.aar

Binary file not shown.

14
android/app/src/main/AndroidManifest.xml

@ -28,6 +28,12 @@
<uses-permission android:name="android.permission.CAMERA" /> <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 <application
android:label="回乡" android:label="回乡"
android:icon="@mipmap/ic_launcher"> android:icon="@mipmap/ic_launcher">
@ -53,7 +59,13 @@
<category android:name="android.intent.category.LAUNCHER"/> <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter> </intent-filter>
</activity> </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 <activity
android:name="com.yalantis.ucrop.UCropActivity" android:name="com.yalantis.ucrop.UCropActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"

29
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")
}
}

BIN
assets/image/2x/icon_bread.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 902 B

BIN
assets/image/2x/icon_chili.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1004 B

BIN
assets/image/2x/icon_milk_tea.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 894 B

BIN
assets/image/2x/icon_today_video.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 486 B

BIN
assets/image/3x/icon_bread.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
assets/image/3x/icon_chili.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
assets/image/3x/icon_milk_tea.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
assets/image/3x/icon_today_video.png.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 834 B

BIN
assets/image/icon_bread.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 B

BIN
assets/image/icon_chili.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 552 B

BIN
assets/image/icon_milk_tea.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 532 B

BIN
assets/image/icon_today_video.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 293 B

10
ios/Podfile.lock

@ -11,9 +11,6 @@ PODS:
- AMapLocation (2.6.8): - AMapLocation (2.6.8):
- AMapFoundation (~> 1.6.4) - AMapFoundation (~> 1.6.4)
- Flutter (1.0.0) - Flutter (1.0.0)
- fluttertoast (0.0.2):
- Flutter
- Toast
- FMDB (2.7.5): - FMDB (2.7.5):
- FMDB/standard (= 2.7.5) - FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5) - FMDB/standard (2.7.5)
@ -35,7 +32,6 @@ PODS:
- sqflite (0.0.2): - sqflite (0.0.2):
- Flutter - Flutter
- FMDB (>= 2.7.5) - FMDB (>= 2.7.5)
- Toast (4.0.0)
- TOCropViewController (2.6.0) - TOCropViewController (2.6.0)
- video_player (0.0.1): - video_player (0.0.1):
- Flutter - Flutter
@ -48,7 +44,6 @@ DEPENDENCIES:
- amap_flutter_location (from `.symlinks/plugins/amap_flutter_location/ios`) - amap_flutter_location (from `.symlinks/plugins/amap_flutter_location/ios`)
- amap_flutter_map (from `.symlinks/plugins/amap_flutter_map/ios`) - amap_flutter_map (from `.symlinks/plugins/amap_flutter_map/ios`)
- Flutter (from `Flutter`) - Flutter (from `Flutter`)
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
- image_cropper (from `.symlinks/plugins/image_cropper/ios`) - image_cropper (from `.symlinks/plugins/image_cropper/ios`)
- image_picker (from `.symlinks/plugins/image_picker/ios`) - image_picker (from `.symlinks/plugins/image_picker/ios`)
- package_info (from `.symlinks/plugins/package_info/ios`) - package_info (from `.symlinks/plugins/package_info/ios`)
@ -67,7 +62,6 @@ SPEC REPOS:
- AMapFoundation - AMapFoundation
- AMapLocation - AMapLocation
- FMDB - FMDB
- Toast
- TOCropViewController - TOCropViewController
EXTERNAL SOURCES: EXTERNAL SOURCES:
@ -77,8 +71,6 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/amap_flutter_map/ios" :path: ".symlinks/plugins/amap_flutter_map/ios"
Flutter: Flutter:
:path: Flutter :path: Flutter
fluttertoast:
:path: ".symlinks/plugins/fluttertoast/ios"
image_cropper: image_cropper:
:path: ".symlinks/plugins/image_cropper/ios" :path: ".symlinks/plugins/image_cropper/ios"
image_picker: image_picker:
@ -109,7 +101,6 @@ SPEC CHECKSUMS:
AMapFoundation: c7da72b42a713f1429c88af1858d623dde88934b AMapFoundation: c7da72b42a713f1429c88af1858d623dde88934b
AMapLocation: dad27669c4ca68e395ce7532ff614b7d4d45f7b7 AMapLocation: dad27669c4ca68e395ce7532ff614b7d4d45f7b7
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
fluttertoast: 6122fa75143e992b1d3470f61000f591a798cc58
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
image_cropper: f1668dd8d2cad2d357955caad15a40547856edcb image_cropper: f1668dd8d2cad2d357955caad15a40547856edcb
image_picker: 9c3312491f862b28d21ecd8fdf0ee14e601b3f09 image_picker: 9c3312491f862b28d21ecd8fdf0ee14e601b3f09
@ -119,7 +110,6 @@ SPEC CHECKSUMS:
share: 0b2c3e82132f5888bccca3351c504d0003b3b410 share: 0b2c3e82132f5888bccca3351c504d0003b3b410
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904 sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
TOCropViewController: 3105367e808b7d3d886a74ff59bf4804e7d3ab38 TOCropViewController: 3105367e808b7d3d886a74ff59bf4804e7d3ab38
video_player: 9cc823b1d9da7e8427ee591e8438bfbcde500e6e video_player: 9cc823b1d9da7e8427ee591e8438bfbcde500e6e
wakelock: bfc7955c418d0db797614075aabbc58a39ab5107 wakelock: bfc7955c418d0db797614075aabbc58a39ab5107

12
ios/Runner.xcodeproj/project.pbxproj

@ -856,10 +856,8 @@
HEADER_SEARCH_PATHS = ( HEADER_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"\"${PODS_ROOT}/Headers/Public\"", "\"${PODS_ROOT}/Headers/Public\"",
"\"${PODS_ROOT}/Headers/Public/Toast\"",
"\"${PODS_ROOT}/Headers/Public/amap_flutter_location\"", "\"${PODS_ROOT}/Headers/Public/amap_flutter_location\"",
"\"${PODS_ROOT}/Headers/Public/amap_flutter_map\"", "\"${PODS_ROOT}/Headers/Public/amap_flutter_map\"",
"\"${PODS_ROOT}/Headers/Public/fluttertoast\"",
"\"${PODS_ROOT}/Headers/Public/image_cropper\"", "\"${PODS_ROOT}/Headers/Public/image_cropper\"",
"\"${PODS_ROOT}/Headers/Public/image_picker\"", "\"${PODS_ROOT}/Headers/Public/image_picker\"",
"\"${PODS_ROOT}/Headers/Public/path_provider\"", "\"${PODS_ROOT}/Headers/Public/path_provider\"",
@ -887,11 +885,9 @@
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",
"-ObjC", "-ObjC",
"-l\"Toast\"",
"-l\"amap_flutter_location\"", "-l\"amap_flutter_location\"",
"-l\"amap_flutter_map\"", "-l\"amap_flutter_map\"",
"-l\"c++\"", "-l\"c++\"",
"-l\"fluttertoast\"",
"-l\"image_cropper\"", "-l\"image_cropper\"",
"-l\"image_picker\"", "-l\"image_picker\"",
"-l\"path_provider\"", "-l\"path_provider\"",
@ -1059,10 +1055,8 @@
HEADER_SEARCH_PATHS = ( HEADER_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"\"${PODS_ROOT}/Headers/Public\"", "\"${PODS_ROOT}/Headers/Public\"",
"\"${PODS_ROOT}/Headers/Public/Toast\"",
"\"${PODS_ROOT}/Headers/Public/amap_flutter_location\"", "\"${PODS_ROOT}/Headers/Public/amap_flutter_location\"",
"\"${PODS_ROOT}/Headers/Public/amap_flutter_map\"", "\"${PODS_ROOT}/Headers/Public/amap_flutter_map\"",
"\"${PODS_ROOT}/Headers/Public/fluttertoast\"",
"\"${PODS_ROOT}/Headers/Public/image_cropper\"", "\"${PODS_ROOT}/Headers/Public/image_cropper\"",
"\"${PODS_ROOT}/Headers/Public/image_picker\"", "\"${PODS_ROOT}/Headers/Public/image_picker\"",
"\"${PODS_ROOT}/Headers/Public/path_provider\"", "\"${PODS_ROOT}/Headers/Public/path_provider\"",
@ -1090,11 +1084,9 @@
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",
"-ObjC", "-ObjC",
"-l\"Toast\"",
"-l\"amap_flutter_location\"", "-l\"amap_flutter_location\"",
"-l\"amap_flutter_map\"", "-l\"amap_flutter_map\"",
"-l\"c++\"", "-l\"c++\"",
"-l\"fluttertoast\"",
"-l\"image_cropper\"", "-l\"image_cropper\"",
"-l\"image_picker\"", "-l\"image_picker\"",
"-l\"path_provider\"", "-l\"path_provider\"",
@ -1155,10 +1147,8 @@
HEADER_SEARCH_PATHS = ( HEADER_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"\"${PODS_ROOT}/Headers/Public\"", "\"${PODS_ROOT}/Headers/Public\"",
"\"${PODS_ROOT}/Headers/Public/Toast\"",
"\"${PODS_ROOT}/Headers/Public/amap_flutter_location\"", "\"${PODS_ROOT}/Headers/Public/amap_flutter_location\"",
"\"${PODS_ROOT}/Headers/Public/amap_flutter_map\"", "\"${PODS_ROOT}/Headers/Public/amap_flutter_map\"",
"\"${PODS_ROOT}/Headers/Public/fluttertoast\"",
"\"${PODS_ROOT}/Headers/Public/image_cropper\"", "\"${PODS_ROOT}/Headers/Public/image_cropper\"",
"\"${PODS_ROOT}/Headers/Public/image_picker\"", "\"${PODS_ROOT}/Headers/Public/image_picker\"",
"\"${PODS_ROOT}/Headers/Public/path_provider\"", "\"${PODS_ROOT}/Headers/Public/path_provider\"",
@ -1186,11 +1176,9 @@
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",
"-ObjC", "-ObjC",
"-l\"Toast\"",
"-l\"amap_flutter_location\"", "-l\"amap_flutter_location\"",
"-l\"amap_flutter_map\"", "-l\"amap_flutter_map\"",
"-l\"c++\"", "-l\"c++\"",
"-l\"fluttertoast\"",
"-l\"image_cropper\"", "-l\"image_cropper\"",
"-l\"image_picker\"", "-l\"image_picker\"",
"-l\"path_provider\"", "-l\"path_provider\"",

11
ios/Runner/Info.plist

@ -28,7 +28,16 @@
<string>????</string> <string>????</string>
<key>CFBundleURLTypes</key> <key>CFBundleURLTypes</key>
<array> <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> </array>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string> <string>$(CURRENT_PROJECT_VERSION)</string>

2
ios/Runner/Runner.entitlements

@ -7,6 +7,8 @@
<key>com.apple.developer.associated-domains</key> <key>com.apple.developer.associated-domains</key>
<array> <array>
<string>applinks:demo.dcloud.net.cn</string> <string>applinks:demo.dcloud.net.cn</string>
<string>hx.lotus-wallet.com</string>
<string>applinks:hx.lotus-wallet.com</string>
</array> </array>
</dict> </dict>
</plist> </plist>

11
lib/address/address_map_page.dart

@ -9,7 +9,7 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.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/data/address.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
@ -152,14 +152,7 @@ class _AddressMapPage extends State<AddressMapPage> {
if (await Permission.locationWhenInUse.serviceStatus.isEnabled) { if (await Permission.locationWhenInUse.serviceStatus.isEnabled) {
bool isShown = await Permission.contacts.shouldShowRequestRationale; bool isShown = await Permission.contacts.shouldShowRequestRationale;
if (isShown) { if (isShown) {
Fluttertoast.showToast( SmartDialog.showToast("shouldShowRequest");
msg: "shouldShowRequest",
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.CENTER,
timeInSecForIosWeb: 1,
backgroundColor: Colors.red,
textColor: Colors.white,
fontSize: 16.0.sp);
} }
if (await Permission.location.isPermanentlyDenied) { if (await Permission.location.isPermanentlyDenied) {
//openAppSettings //openAppSettings

14
lib/address/edit_address_page.dart

@ -1,6 +1,6 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/material.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/address.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
@ -151,19 +151,19 @@ class _EditAddressPage extends State<EditAddressPage> {
String city = addressController.text; String city = addressController.text;
String address = houseNumberController.text; String address = houseNumberController.text;
if (name == null || name == "") { if (name == null || name == "") {
Fluttertoast.showToast(msg: "请输入收货人姓名"); SmartDialog.showToast("请输入收货人姓名");
return; return;
} }
if (mobile == null || mobile == "") { if (mobile == null || mobile == "") {
Fluttertoast.showToast(msg: "请输入收货人手机号"); SmartDialog.showToast("请输入收货人手机号");
return; return;
} }
if (city == null || city == "") { if (city == null || city == "") {
Fluttertoast.showToast(msg: "请输入收货人地址"); SmartDialog.showToast("请输入收货人地址");
return; return;
} }
if (address == null || address == "") { if (address == null || address == "") {
Fluttertoast.showToast(msg: "请输入收货人详细地址"); SmartDialog.showToast("请输入收货人详细地址");
return; return;
} }
BaseData baseData; BaseData baseData;
@ -199,10 +199,8 @@ class _EditAddressPage extends State<EditAddressPage> {
} }
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
Fluttertoast.showToast(msg: preAddress == null ? "保存成功" : "修改成功"); SmartDialog.showToast(preAddress == null ? "保存成功" : "修改成功");
Navigator.of(context).pop(); Navigator.of(context).pop();
} else {
Fluttertoast.showToast(msg: baseData.msg);
} }
} }

2
lib/generated/intl/messages_zh_TW.dart

@ -244,7 +244,7 @@ class MessageLookup extends MessageLookupByLibrary {
"muqianzanwuxingdianhuodong" : MessageLookupByLibrary.simpleMessage("目前暫無星店活動"), "muqianzanwuxingdianhuodong" : MessageLookupByLibrary.simpleMessage("目前暫無星店活動"),
"nindingweigongnengweikaiqi" : MessageLookupByLibrary.simpleMessage("您定位功能開關未開啟,請點擊去開啟定位"), "nindingweigongnengweikaiqi" : MessageLookupByLibrary.simpleMessage("您定位功能開關未開啟,請點擊去開啟定位"),
"nindingweiquanxianweiyunxu" : MessageLookupByLibrary.simpleMessage("您未开启位置权限,请点击确定申请权限"), "nindingweiquanxianweiyunxu" : MessageLookupByLibrary.simpleMessage("您未开启位置权限,请点击确定申请权限"),
"ninweidenglu" : MessageLookupByLibrary.simpleMessage("您未登錄,請點擊去燈籠"), "ninweidenglu" : MessageLookupByLibrary.simpleMessage("您未登錄,請點擊去登錄"),
"ninyouyigedingdanyaolingqu" : MessageLookupByLibrary.simpleMessage("您有一個訂單需要前往門店領取"), "ninyouyigedingdanyaolingqu" : MessageLookupByLibrary.simpleMessage("您有一個訂單需要前往門店領取"),
"ninyouyigexindedingdan" : MessageLookupByLibrary.simpleMessage("您有一個新訂單"), "ninyouyigexindedingdan" : MessageLookupByLibrary.simpleMessage("您有一個新訂單"),
"peisong" : MessageLookupByLibrary.simpleMessage("配送"), "peisong" : MessageLookupByLibrary.simpleMessage("配送"),

20
lib/home/activity_list_page.dart

@ -1,14 +1,15 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package: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/activity.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/event_type.dart';
import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/custom_image.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:huixiang/view_widget/my_footer.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.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')), apiService = ApiService(Dio(), context: context, token: value.getString('token')),
queryActivity(), queryActivity(),
}); });
eventBus.on<EventType>().listen((event) {
if (event.type < 3) {
setState(() {});
}
});
} }
List<Activity> activityList; List<Activity> activityList;
queryActivity() async { queryActivity() async {
// showCupertinoDialog(
// context: context,
// barrierDismissible: true,
// builder: (context) {
// return LoadingView();
// });
BaseData baseData = await apiService.informationList({ BaseData baseData = await apiService.informationList({
"pageNum": 1, "pageNum": 1,
"pageSize": 10, "pageSize": 10,
@ -52,15 +53,12 @@ class _ActivityListPage extends State<ActivityListPage>
}).catchError((error) { }).catchError((error) {
_refreshController.refreshFailed(); _refreshController.refreshFailed();
}); });
// if (Navigator.canPop(context)) Navigator.of(context).pop();
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
PageInfo pageInfo = PageInfo.fromJson(baseData.data); PageInfo pageInfo = PageInfo.fromJson(baseData.data);
_refreshController.refreshCompleted(); _refreshController.refreshCompleted();
setState(() { setState(() {
activityList = pageInfo.list.map((e) => Activity.fromJson(e)).toList(); activityList = pageInfo.list.map((e) => Activity.fromJson(e)).toList();
}); });
} else {
Fluttertoast.showToast(msg: baseData.msg);
} }
} }

32
lib/home/home_page.dart

@ -38,9 +38,6 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
super.initState(); super.initState();
SharedPreferences.getInstance().then((value) => { SharedPreferences.getInstance().then((value) => {
isLogin = (value.containsKey("token") &&
value.getString('token') != null &&
value.getString('token') != ""),
apiService = ApiService(Dio(), apiService = ApiService(Dio(),
context: context, context: context,
token: value.getString('token'), token: value.getString('token'),
@ -52,12 +49,9 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
if (event.type < 3) { if (event.type < 3) {
setState(() {}); setState(() {});
} }
;
}); });
} }
bool isLogin = false;
loginTips() { loginTips() {
SmartDialog.show( SmartDialog.show(
widget: LoginTips( widget: LoginTips(
@ -173,26 +167,30 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
imgPath: "assets/image/icon_today_task.png", imgPath: "assets/image/icon_today_task.png",
moreText: S.of(context).renwuzhongxin, moreText: S.of(context).renwuzhongxin,
onTap: () { onTap: () {
if (!isLogin) { SharedPreferences.getInstance().then((value) {
loginTips(); if (value.getString('token') == null) {
return; loginTips();
} } else {
Navigator.of(context).pushNamed('/router/integral_page'); Navigator.of(context).pushNamed('/router/integral_page');
}
});
}, },
), ),
InkWell( InkWell(
onTap: () { onTap: () {
if (!isLogin) { SharedPreferences.getInstance().then((value) {
loginTips(); if (value.getString('token') == null) {
return; loginTips();
} } else {
Navigator.of(context).pushNamed('/router/integral_page'); Navigator.of(context).pushNamed('/router/integral_page');
}
});
}, },
child: signIn(), child: signIn(),
), ),
ItemTitle( ItemTitle(
text: S.of(context).remenwenzhangshipin, text: S.of(context).remenwenzhangshipin,
imgPath: "assets/image/icon_today_task.png", imgPath: "assets/image/icon_today_video.png",
moreText: S.of(context).chakangengduo, moreText: S.of(context).chakangengduo,
onTap: () { onTap: () {
Navigator.of(context).pushNamed('/router/hot_article_page'); Navigator.of(context).pushNamed('/router/hot_article_page');

208
lib/home/points_mall_page.dart

@ -4,17 +4,21 @@ import 'dart:ui';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:huixiang/generated/l10n.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/base_data.dart';
import 'package:huixiang/retrofit/data/goods.dart'; import 'package:huixiang/retrofit/data/goods.dart';
import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/data/user_info.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/event_type.dart';
import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/item_title.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:huixiang/view_widget/my_footer.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.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:dio/dio.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import '../retrofit/data/banner.dart';
class PointsMallPage extends StatefulWidget { class PointsMallPage extends StatefulWidget {
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -50,11 +52,25 @@ class _PointsMallPage extends State<PointsMallPage>
void initState() { void initState() {
super.initState(); super.initState();
refreshUserInfo();
eventBus.on<EventType>().listen((event) {
if (event.type < 3) {
setState(() {});
}
if (event.type == 3) {
refreshUserInfo();
};
});
}
refreshUserInfo(){
SharedPreferences.getInstance().then((value) => { SharedPreferences.getInstance().then((value) => {
client = ApiService(Dio(), context: context, token: value.getString('token')), client = ApiService(Dio(), context: context, token: value.getString('token')),
creditGoods(), creditGoods(),
queryUser(), queryUser(),
}); });
} }
int pageNum = 1; int pageNum = 1;
@ -70,8 +86,6 @@ class _PointsMallPage extends State<PointsMallPage>
List<BannerData> bannerData = []; List<BannerData> bannerData = [];
queryUser() async { queryUser() async {
BaseData baseData = await client.queryInfo();
BaseData banner = await client.queryBanner({ BaseData banner = await client.queryBanner({
"model": {"type": "CREDIT_INDEX"}, "model": {"type": "CREDIT_INDEX"},
}); });
@ -81,16 +95,16 @@ class _PointsMallPage extends State<PointsMallPage>
bannerData.addAll((banner.data["records"] as List<dynamic>) bannerData.addAll((banner.data["records"] as List<dynamic>)
.map((e) => BannerData.fromJson(e)) .map((e) => BannerData.fromJson(e))
.toList()); .toList());
setState(() {});
} }
BaseData baseData = await client.queryInfo();
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
userinfo = UserInfo.fromJson(baseData.data); userinfo = UserInfo.fromJson(baseData.data);
SharedPreferences.getInstance().then((value) => { SharedPreferences.getInstance().then((value) => {
value.setString('user', jsonEncode(baseData.data)), value.setString('user', jsonEncode(baseData.data)),
}); });
setState(() {}); setState(() {});
} else {
Fluttertoast.showToast(msg: baseData.msg);
} }
} }
@ -121,7 +135,6 @@ class _PointsMallPage extends State<PointsMallPage>
} else { } else {
_refreshController.loadFailed(); _refreshController.loadFailed();
_refreshController.refreshFailed(); _refreshController.refreshFailed();
Fluttertoast.showToast(msg: baseData.msg);
} }
} }
@ -200,7 +213,10 @@ class _PointsMallPage extends State<PointsMallPage>
_toDetails(index) async { _toDetails(index) async {
await Navigator.of(context).pushNamed('/router/integral_store_page', await Navigator.of(context).pushNamed('/router/integral_store_page',
arguments: {"goodsId": gooods[index].id}); arguments: {"goodsId": gooods[index].id});
queryUser(); SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
String token = sharedPreferences.getString("token");
if (token != null)
queryUser();
} }
_sortChange(item) { _sortChange(item) {
@ -278,7 +294,7 @@ class _PointsMallPage extends State<PointsMallPage>
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 16, fontSize: 16.sp,
), ),
), ),
SizedBox( SizedBox(
@ -317,14 +333,14 @@ class _PointsMallPage extends State<PointsMallPage>
color: Color(0xFF585858), color: Color(0xFF585858),
decoration: TextDecoration.lineThrough, decoration: TextDecoration.lineThrough,
decorationColor: Color(0xFF585858), decorationColor: Color(0xFF585858),
fontSize: 12, fontSize: 12.sp,
), ),
), ),
Text( Text(
S.of(context).jifen_(goods.price), S.of(context).jifen_(goods.price),
style: TextStyle( style: TextStyle(
color: Color(0xFF32A060), color: Color(0xFF32A060),
fontSize: 14, fontSize: 14.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),
@ -334,7 +350,7 @@ class _PointsMallPage extends State<PointsMallPage>
), ),
], ],
), ),
) ),
], ],
), ),
Visibility( Visibility(
@ -343,8 +359,8 @@ class _PointsMallPage extends State<PointsMallPage>
borderRadius: BorderRadius.only(topRight: Radius.circular(4)), borderRadius: BorderRadius.only(topRight: Radius.circular(4)),
child: Image.asset( child: Image.asset(
"assets/image/icon_hot_right_top.png", "assets/image/icon_hot_right_top.png",
width: 36, width: 36.w,
height: 36, height: 36.h,
), ),
), ),
), ),
@ -354,82 +370,100 @@ class _PointsMallPage extends State<PointsMallPage>
} }
Widget userItem() { Widget userItem() {
return Container( return InkWell(
margin: EdgeInsets.all(16), onTap: () {
child: Row( SharedPreferences.getInstance().then((value) {
children: [ if (value.getString("token") == null) {
MImage( SmartDialog.show(
userinfo != null ? userinfo.headimg : "", widget: LoginTips(
width: 50, click: () {
height: 50, value.clear();
radius: BorderRadius.all(Radius.circular(2)), Navigator.of(context).pushNamed('/router/login_page', arguments: {"login":"login"});
fit: BoxFit.cover, },
errorSrc: "assets/image/default_1.png", ),
fadeSrc: "assets/image/default_1.png", clickBgDismissTemp: false,
), );
Expanded( }
child: Container( });
margin: EdgeInsets.only(left: 15), },
child: Column( child:Container(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, margin: EdgeInsets.all(16),
crossAxisAlignment: CrossAxisAlignment.start, child: Row(
children: [ children: [
Text( MImage(
userinfo != null ? userinfo.nickname : "", userinfo != null ? userinfo.headimg : "",
style: TextStyle( width: 50,
fontSize: 14, height: 50,
fontWeight: FontWeight.bold, radius: BorderRadius.all(Radius.circular(2)),
color: Color(0xFF353535)), fit: BoxFit.cover,
), errorSrc: "assets/image/default_1.png",
Row( 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: [ children: [
Image.asset(
"assets/image/icon_an_crown.png",
width: 14,
height: 14,
),
SizedBox(
width: 5,
),
Text( Text(
(userinfo != null && userinfo.memberRankVo != null) userinfo != null ? userinfo.nickname : S.of(context).qudenglu,
? userinfo.memberRankVo.rankName style: TextStyle(
: "", fontSize: 14,
style: 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)), 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( flex: 1,
(userinfo != null) ? "${userinfo.points}" : "", ),
style: TextStyle( Container(
fontSize: 16, margin: EdgeInsets.only(left: 15),
color: Color(0xFFF8BA61), child: Column(
fontWeight: FontWeight.bold), 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),
),
],
), ),
], )
), ],
) ),
], ),
),
); );
} }

3
lib/integral/integral_detailed_page.dart

@ -2,7 +2,7 @@ import 'dart:convert';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/material.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/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/data/page.dart';
@ -91,7 +91,6 @@ class _IntegralDetailedPage extends State<IntegralDetailedPage>
} }
setState(() {}); setState(() {});
} else { } else {
Fluttertoast.showToast(msg: baseData.msg);
refreshController.loadFailed(); refreshController.loadFailed();
refreshController.refreshFailed(); refreshController.refreshFailed();
} }

169
lib/integral/integral_page.dart

@ -3,7 +3,7 @@ import 'dart:convert';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.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/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/rank.dart'; import 'package:huixiang/retrofit/data/rank.dart';
@ -66,8 +66,6 @@ class _IntegralPage extends State<IntegralPage> {
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
signInfo = SignInfo.fromJson(baseData.data); signInfo = SignInfo.fromJson(baseData.data);
setState(() {}); setState(() {});
} else {
Fluttertoast.showToast(msg: baseData.msg);
} }
} }
@ -122,11 +120,24 @@ class _IntegralPage extends State<IntegralPage> {
), ),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
child: Column( child: Stack(
children: [ children: [
integralAndVip(), Positioned(
inForPoints(), child: Container(
integralTask(), 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() { Widget inForPoints() {
return Container( 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: [ children: [
Container( Text(
height: 42.h, S.of(context).qiandaolingjifen,
color: Color(0xFF3A405A), style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16.sp,
color: Color(0xFF353535)),
), ),
Container( Text(
width: double.infinity, S.of(context).lianxuqiandaolingqushuangbeijifen,
margin: EdgeInsets.all(16), style: TextStyle(
padding: EdgeInsets.fromLTRB(20.w, 20.h, 20.w, 20.h), fontWeight: FontWeight.bold,
decoration: BoxDecoration( fontSize: 11.sp,
color: Colors.white, color: Color(0xFF727272),
borderRadius: BorderRadius.all(Radius.circular(8)),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
), ),
child: Column( ),
mainAxisAlignment: MainAxisAlignment.center, SizedBox(
crossAxisAlignment: CrossAxisAlignment.start, height: 32.h,
children: [ ),
Text( StaggeredGridView.countBuilder(
S.of(context).qiandaolingjifen, crossAxisCount: 4,
style: TextStyle( shrinkWrap: true,
fontWeight: FontWeight.bold, itemCount: 7,
fontSize: 16.sp, mainAxisSpacing: 8.h,
color: Color(0xFF353535)), crossAxisSpacing: 18.w,
), padding: EdgeInsets.only(bottom: 32.h),
Text( physics: new NeverScrollableScrollPhysics(),
S.of(context).lianxuqiandaolingqushuangbeijifen, itemBuilder: (context, position) {
style: TextStyle( return signInItem(position);
fontWeight: FontWeight.bold, },
fontSize: 11.sp, staggeredTileBuilder: (position) {
color: Color(0xFF727272), return StaggeredTile.count(position == 6 ? 2 : 1, 1.28);
), }),
), InkWell(
SizedBox( onTap: signIn,
height: 32.h, child: Container(
), alignment: Alignment.center,
StaggeredGridView.countBuilder( child: RoundButton(
crossAxisCount: 4, text: (signInfo != null && signInfo.todayHasSignin)
shrinkWrap: true, ? S.of(context).yiqiandao
itemCount: 7, : S.of(context).lijiqiandao,
mainAxisSpacing: 8.h, textColor: Colors.white,
crossAxisSpacing: 18.w, backgroup: (signInfo != null && signInfo.todayHasSignin)
padding: EdgeInsets.only(bottom: 32.h), ? Colors.grey
physics: new NeverScrollableScrollPhysics(), : Color(0xFF32A060),
itemBuilder: (context, position) { fontSize: 16.sp,
return signInItem(position); padding: EdgeInsets.fromLTRB(16.w, 6.h, 16.w, 6.h),
}, radius: 4,
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 { signIn() async {
if ((signInfo != null && signInfo.todayHasSignin)) { if ((signInfo != null && signInfo.todayHasSignin)) {
Fluttertoast.showToast(msg: "今日已签到了"); SmartDialog.showToast("今日已签到了");
return; return;
} }
BaseData baseData = await apiService.signIn(); BaseData baseData = await apiService.signIn();
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
querySignInfo(); querySignInfo();
Fluttertoast.showToast(msg: "签到成功"); SmartDialog.showToast("签到成功");
} else {
Fluttertoast.showToast(msg: baseData.msg);
} }
} }

17
lib/integral_store/integral_store_details_page.dart

@ -3,7 +3,7 @@ import 'dart:convert';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.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/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/goods.dart'; import 'package:huixiang/retrofit/data/goods.dart';
@ -35,11 +35,12 @@ class _IntegralStoreDetailsPage extends State {
void initState() { void initState() {
super.initState(); super.initState();
SharedPreferences.getInstance().then((value) => { SharedPreferences.getInstance().then((value) {
apiService = ApiService(Dio(), context: context, token: value.getString("token")), apiService = ApiService(Dio(), context: context, token: value.getString("token"));
points = queryGoodsById();
UserInfo.fromJson(jsonDecode(value.getString('user'))).points, if (value.getString('user') != null) {
queryGoodsById(), points = UserInfo.fromJson(jsonDecode(value.getString('user'))).points;
}
}); });
} }
@ -51,8 +52,6 @@ class _IntegralStoreDetailsPage extends State {
setState(() { setState(() {
goods = Goods.fromJson(baseData.data); goods = Goods.fromJson(baseData.data);
}); });
} else {
Fluttertoast.showToast(msg: baseData.msg);
} }
} }
@ -145,7 +144,7 @@ class _IntegralStoreDetailsPage extends State {
child: Container( child: Container(
padding: EdgeInsets.only(top: 16.h, bottom: 16.h), padding: EdgeInsets.only(top: 16.h, bottom: 16.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: (goods != null && color: (goods != null && points != null &&
int.tryParse(goods.price) < int.tryParse(points)) int.tryParse(goods.price) < int.tryParse(points))
? Color(0xFF32A060) ? Color(0xFF32A060)
: Color(0xFFD8D8D8), : Color(0xFFD8D8D8),

2
lib/l10n/intl_zh_TW.arb

@ -371,7 +371,7 @@
"huiyuanjifen": "會員積分", "huiyuanjifen": "會員積分",
"huiyuanyue": "會員餘額", "huiyuanyue": "會員餘額",
"gongxinichengweibendianhuiyuan": "恭喜您,成為本店會員,快去享受超多的會員權益吧。", "gongxinichengweibendianhuiyuan": "恭喜您,成為本店會員,快去享受超多的會員權益吧。",
"ninweidenglu": "您未登錄,請點擊去燈籠", "ninweidenglu": "您未登錄,請點擊去登錄",
"weilegeiningenghaodefuwu": "為了給您提供更好的服務,以及享受更加精彩的信息內容,請在使用使用期間登錄", "weilegeiningenghaodefuwu": "為了給您提供更好的服務,以及享受更加精彩的信息內容,請在使用使用期間登錄",
"qudenglu": "去登錄", "qudenglu": "去登錄",
"weidenglu": "未登錄", "weidenglu": "未登錄",

26
lib/login/login_page.dart

@ -5,7 +5,7 @@ import 'dart:ui';
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.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/main.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/retrofit_api.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:huixiang/generated/l10n.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:dio/dio.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'; import 'package:shared_preferences/shared_preferences.dart';
class LoginPage extends StatefulWidget { class LoginPage extends StatefulWidget {
@ -155,7 +155,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
_sendCode() async { _sendCode() async {
if (!checkStatus) { if (!checkStatus) {
Fluttertoast.showToast(msg: S.of(context).gouxuanxieyi); SmartDialog.showToast(S.of(context).gouxuanxieyi);
return; return;
} }
var mobile = _controllerPhone.text; var mobile = _controllerPhone.text;
@ -175,12 +175,12 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
{ {
btnText = S.of(context).send_code, btnText = S.of(context).send_code,
_sendCodeStatus = 0, _sendCodeStatus = 0,
Fluttertoast.showToast(msg: "${value.msg}"), SmartDialog.showToast("${value.msg}"),
refresh() refresh()
} }
}) })
.catchError((error) { .catchError((error) {
Fluttertoast.showToast(msg: "$error"); SmartDialog.showToast("$error");
}); });
} }
} }
@ -224,7 +224,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
} }
if (!checkStatus) { if (!checkStatus) {
Fluttertoast.showToast(msg: S.of(context).gouxuanxieyi); SmartDialog.showToast(S.of(context).gouxuanxieyi);
return; return;
} }
var mobile = _controllerPhone.text; var mobile = _controllerPhone.text;
@ -260,7 +260,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
SmartDialog.showLoading(msg: S.of(context).zhengzaijiazai); SmartDialog.showLoading(msg: S.of(context).zhengzaijiazai);
BaseData value = await client.memberLogin(param).catchError((error) { BaseData value = await client.memberLogin(param).catchError((error) {
print(error); print(error);
Fluttertoast.showToast(msg: "$error"); SmartDialog.showToast("$error");
}); });
Future.delayed(Duration(seconds: 2), () { Future.delayed(Duration(seconds: 2), () {
SmartDialog.dismiss(); SmartDialog.dismiss();
@ -273,7 +273,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
Navigator.of(context).popAndPushNamed('/router/main_page'); Navigator.of(context).popAndPushNamed('/router/main_page');
} }
} else { } else {
Fluttertoast.showToast(msg: "${value.msg}"); SmartDialog.showToast("${value.msg}");
} }
}); });
} }
@ -391,11 +391,11 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
child: Stack( child: Stack(
alignment: Alignment.center, alignment: Alignment.center,
children: [ children: [
PhotoView( // PhotoView(
imageProvider: AssetImage("assets/image/laoban.png"), // imageProvider: AssetImage("assets/image/laoban.png"),
initialScale: Platform.isAndroid ? 1.02 : 1.2, // initialScale: Platform.isAndroid ? 1.02 : 1.2,
basePosition: alignmentProgress, // basePosition: alignmentProgress,
), // ),
Positioned( Positioned(
top: 54.h, top: 54.h,
left: 28.w, left: 28.w,

7
lib/mine/coupons_page.dart

@ -1,7 +1,7 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/coupon.dart'; import 'package:huixiang/retrofit/data/coupon.dart';
@ -78,7 +78,6 @@ class _CouponsPage extends State<CouponsPage> {
} else { } else {
_refreshController.loadFailed(); _refreshController.loadFailed();
_refreshController.refreshFailed(); _refreshController.refreshFailed();
Fluttertoast.showToast(msg: baseData.msg);
} }
} }
@ -186,11 +185,9 @@ class _CouponsPage extends State<CouponsPage> {
receiveCoupon(couponId) async { receiveCoupon(couponId) async {
BaseData baseData = await apiService.receiveCoupon(couponId); BaseData baseData = await apiService.receiveCoupon(couponId);
if (baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
_onRefresh(); _onRefresh();
showAlertDialog(); showAlertDialog();
} else {
Fluttertoast.showToast(msg: baseData.msg);
} }
} }

4
lib/mine/edit_name.dart

@ -1,6 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.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:huixiang/view_widget/my_appbar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -35,7 +35,7 @@ class _EditName extends State<EditName> {
if(name != null && name != "") { if(name != null && name != "") {
Navigator.of(context).pop(name); Navigator.of(context).pop(name);
} else { } else {
Fluttertoast.showToast(msg: "请输入用户名"); SmartDialog.showToast("请输入用户名");
} }
}, },
child: Text( child: Text(

8
lib/mine/manage_address_page.dart

@ -1,7 +1,7 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/address.dart'; import 'package:huixiang/retrofit/data/address.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
@ -47,8 +47,6 @@ class _ManageAddressPage extends State<ManageAddressPage> {
.map((e) => Address.fromJson(e)) .map((e) => Address.fromJson(e))
.toList(); .toList();
setState(() {}); setState(() {});
} else {
Fluttertoast.showToast(msg: baseData.msg);
} }
} }
@ -358,8 +356,6 @@ class _ManageAddressPage extends State<ManageAddressPage> {
await apiService.deleteAddress(addressList[position].toJson()); await apiService.deleteAddress(addressList[position].toJson());
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
queryMemberAddress(); queryMemberAddress();
} else {
Fluttertoast.showToast(msg: baseData.msg);
} }
} }
@ -371,8 +367,6 @@ class _ManageAddressPage extends State<ManageAddressPage> {
BaseData baseData = BaseData baseData =
await apiService.updateAddress(addressList[position].toJson()); await apiService.updateAddress(addressList[position].toJson());
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
} else {
Fluttertoast.showToast(msg: baseData.msg);
} }
setState(() {}); setState(() {});
} }

3
lib/mine/mine_card_invalid_page.dart

@ -1,7 +1,7 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/coupon.dart'; import 'package:huixiang/retrofit/data/coupon.dart';
@ -73,7 +73,6 @@ class _MineCardInvalidPage extends State<MineCardInvalidPage> {
} else { } else {
_refreshController.loadFailed(); _refreshController.loadFailed();
_refreshController.refreshFailed(); _refreshController.refreshFailed();
Fluttertoast.showToast(msg: baseData.msg);
} }
} }

1
lib/mine/mine_page.dart

@ -3,7 +3,6 @@ import 'dart:convert';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/main.dart'; import 'package:huixiang/main.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';

4
lib/mine/mine_vip_level_page.dart

@ -1,8 +1,8 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/rank.dart'; import 'package:huixiang/retrofit/data/rank.dart';
@ -51,7 +51,7 @@ class _MineVipLevelPage extends State<MineVipLevelPage> {
controller.index = widget.arguments["rankLevel"] - 1; controller.index = widget.arguments["rankLevel"] - 1;
}); });
} else { } else {
Fluttertoast.showToast(msg: rankData.msg); SmartDialog.showToast(rankData.msg);
} }
} }

7
lib/mine/mine_wallet_page.dart

@ -2,7 +2,7 @@ import 'dart:convert';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/material.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/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/data/page.dart';
@ -60,10 +60,8 @@ class _MineWalletPage extends State<MineWalletPage> {
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
userInfo = UserInfo.fromJson(baseData.data); userInfo = UserInfo.fromJson(baseData.data);
mBalance = double.tryParse(userInfo.money).toInt(); mBalance = double.tryParse(userInfo.money).toInt();
if (mounted) setState(() {}); if (mounted)
setState(() {}); setState(() {});
} else {
Fluttertoast.showToast(msg: baseData.msg);
} }
} }
@ -96,7 +94,6 @@ class _MineWalletPage extends State<MineWalletPage> {
} else { } else {
refreshController.refreshFailed(); refreshController.refreshFailed();
refreshController.loadFailed(); refreshController.loadFailed();
Fluttertoast.showToast(msg: baseData.msg);
} }
if (mounted) setState(() {}); if (mounted) setState(() {});
} }

7
lib/mine/roll_center_page.dart

@ -1,7 +1,7 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/coupon.dart'; import 'package:huixiang/retrofit/data/coupon.dart';
@ -69,7 +69,6 @@ class _RollCenterPage extends State<RollCenterPage> {
} }
setState(() {}); setState(() {});
} else { } else {
Fluttertoast.showToast(msg: baseData.msg);
_refreshController.refreshFailed(); _refreshController.refreshFailed();
_refreshController.loadFailed(); _refreshController.loadFailed();
} }
@ -166,11 +165,9 @@ class _RollCenterPage extends State<RollCenterPage> {
receiveCoupon(couponId) async { receiveCoupon(couponId) async {
BaseData baseData = await apiService.receiveCoupon(couponId); BaseData baseData = await apiService.receiveCoupon(couponId);
if (baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
refreshCoupon(); refreshCoupon();
showAlertDialog(); showAlertDialog();
} else {
Fluttertoast.showToast(msg: baseData.msg);
} }
} }

4
lib/mine/user_info_page.dart

@ -3,7 +3,7 @@ import 'dart:io';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/upload_result.dart'; import 'package:huixiang/retrofit/data/upload_result.dart';
@ -354,7 +354,7 @@ class _UserInfoPage extends State<UserInfoPage> {
var info = await apiService.editInfo(modifyInfo); var info = await apiService.editInfo(modifyInfo);
if (info.isSuccess) { if (info.isSuccess) {
setState(() { setState(() {
Fluttertoast.showToast(msg: "用户信息修改成功"); SmartDialog.showToast("用户信息修改成功");
}); });
} }
} }

5
lib/mine/vip_balance_page.dart

@ -1,7 +1,7 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/coupon.dart'; import 'package:huixiang/retrofit/data/coupon.dart';
@ -53,7 +53,7 @@ class _VipBalancePage extends State<VipBalancePage> {
_refreshController.loadFailed(); _refreshController.loadFailed();
_refreshController.refreshFailed(); _refreshController.refreshFailed();
}); });
if (baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
PageInfo pageInfo = PageInfo.fromJson(baseData.data); PageInfo pageInfo = PageInfo.fromJson(baseData.data);
if (pageNum == 1) { if (pageNum == 1) {
coupons.clear(); coupons.clear();
@ -71,7 +71,6 @@ class _VipBalancePage extends State<VipBalancePage> {
} else { } else {
_refreshController.loadFailed(); _refreshController.loadFailed();
_refreshController.refreshFailed(); _refreshController.refreshFailed();
Fluttertoast.showToast(msg: baseData.msg);
} }
} }

3
lib/mine/vip_card_page.dart

@ -1,7 +1,7 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package: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/base_data.dart';
import 'package:huixiang/retrofit/data/vip_card.dart'; import 'package:huixiang/retrofit/data/vip_card.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
@ -51,7 +51,6 @@ class _VipCardPage extends State<VipCardPage> {
}); });
} else { } else {
_refreshController.refreshFailed(); _refreshController.refreshFailed();
Fluttertoast.showToast(msg: baseData.msg);
} }
} }

4
lib/mine/vip_detail_page.dart

@ -1,7 +1,7 @@
import 'package:barcode_widget/barcode_widget.dart'; import 'package:barcode_widget/barcode_widget.dart';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/material.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/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/vip_card.dart'; import 'package:huixiang/retrofit/data/vip_card.dart';
@ -45,8 +45,6 @@ class _VipDetailPage extends State<VipDetailPage> {
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
vipCard = VipCard.fromJson(baseData.data); vipCard = VipCard.fromJson(baseData.data);
setState(() {}); setState(() {});
} else {
Fluttertoast.showToast(msg: baseData.msg);
} }
} }

5
lib/order/exchange_history_page.dart

@ -1,7 +1,7 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/exchange_order.dart'; import 'package:huixiang/retrofit/data/exchange_order.dart';
@ -189,7 +189,6 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
} else { } else {
_refreshController.refreshFailed(); _refreshController.refreshFailed();
_refreshController.loadFailed(); _refreshController.loadFailed();
Fluttertoast.showToast(msg: baseData.msg);
} }
} }
@ -462,8 +461,6 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
BaseData baseData = await apiService.creditOrderReceive(id); BaseData baseData = await apiService.creditOrderReceive(id);
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
queryHistory(); queryHistory();
} else {
Fluttertoast.showToast(msg: baseData.msg);
} }
} }

8
lib/order/exchange_order_page.dart

@ -3,7 +3,7 @@ import 'dart:convert';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:dio/dio.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/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/data/user_info.dart';
@ -424,12 +424,12 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
creditOrder() async { creditOrder() async {
if (widget.arguments["useTyped"] == 1 && if (widget.arguments["useTyped"] == 1 &&
(storeId == null || storeId == "")) { (storeId == null || storeId == "")) {
Fluttertoast.showToast(msg: "请选择一个门店"); SmartDialog.showToast("请选择一个门店");
return; return;
} }
if (widget.arguments["useTyped"] == 2 && if (widget.arguments["useTyped"] == 2 &&
(userAddressId == null || userAddressId == "")) { (userAddressId == null || userAddressId == "")) {
Fluttertoast.showToast(msg: "请选择一个收货地址"); SmartDialog.showToast("请选择一个收货地址");
return; return;
} }
BaseData baseDate = await apiService.creditOrder({ BaseData baseDate = await apiService.creditOrder({
@ -447,7 +447,7 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
"${int.tryParse(points) - int.tryParse(widget.arguments["price"])}"; "${int.tryParse(points) - int.tryParse(widget.arguments["price"])}";
Navigator.of(context).pop(); Navigator.of(context).pop();
} else { } else {
Fluttertoast.showToast(msg: baseDate.msg); SmartDialog.showToast(baseDate.msg);
} }
} }
} }

4
lib/order/exchange_order_success_page.dart

@ -2,7 +2,7 @@ import 'dart:convert';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/material.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/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/data/user_info.dart';
@ -227,8 +227,6 @@ class _ExchangeOrderSuccessPage extends State<ExchangeOrderSuccessPage> {
if(baseData != null && baseData.isSuccess) { if(baseData != null && baseData.isSuccess) {
await Navigator.of(context).pushNamed('/router/mine_card'); await Navigator.of(context).pushNamed('/router/mine_card');
Navigator.of(context).pop(); Navigator.of(context).pop();
} else {
Fluttertoast.showToast(msg: baseData.msg);
} }
} }

6
lib/order/order_detail_page.dart

@ -1,6 +1,6 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/material.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/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/order_info.dart'; import 'package:huixiang/retrofit/data/order_info.dart';
@ -68,8 +68,6 @@ class _OrderDetailPage extends State<OrderDetailPage> {
setState(() { setState(() {
statusTitle(); statusTitle();
}); });
} else {
Fluttertoast.showToast(msg: baseData.msg);
} }
} }
@ -482,7 +480,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
// if (baseData != null && baseData.isSuccess) { // if (baseData != null && baseData.isSuccess) {
// // queryDetails(); // // queryDetails();
// } else { // } else {
// Fluttertoast.showToast(msg: baseData.msg); // SmartDialog.showToast(baseData.msg);
// } // }
showDialog( showDialog(
context: context, context: context,

3
lib/order/order_history_page.dart

@ -1,6 +1,6 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/material.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/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/order_info.dart'; import 'package:huixiang/retrofit/data/order_info.dart';
@ -207,7 +207,6 @@ class _OrderHistoryList extends State<OrderHistoryList>
} else { } else {
refreshController.refreshFailed(); refreshController.refreshFailed();
refreshController.loadFailed(); refreshController.loadFailed();
Fluttertoast.showToast(msg: baseData.msg);
} }
} }

15
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:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/store.dart'; import 'package:huixiang/retrofit/data/store.dart';
@ -96,14 +96,7 @@ class _StoreSelectorPage extends State<StoreSelectorPage> {
if (await Permission.locationWhenInUse.serviceStatus.isEnabled) { if (await Permission.locationWhenInUse.serviceStatus.isEnabled) {
bool isShown = await Permission.contacts.shouldShowRequestRationale; bool isShown = await Permission.contacts.shouldShowRequestRationale;
if (isShown) { if (isShown) {
Fluttertoast.showToast( SmartDialog.showToast("shouldShowRequestRationale");
msg: "shouldShowRequestRationale",
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.CENTER,
timeInSecForIosWeb: 1,
backgroundColor: Colors.red,
textColor: Colors.white,
fontSize: 16.0);
} }
if (await Permission.location.isPermanentlyDenied) { if (await Permission.location.isPermanentlyDenied) {
openAppSettings(); openAppSettings();
@ -172,8 +165,6 @@ class _StoreSelectorPage extends State<StoreSelectorPage> {
.map((e) => Store.fromJson(e)) .map((e) => Store.fromJson(e))
.toList(); .toList();
if (mounted) setState(() {}); if (mounted) setState(() {});
} else {
Fluttertoast.showToast(msg: baseData.msg);
} }
} }
@ -232,7 +223,7 @@ class _StoreSelectorPage extends State<StoreSelectorPage> {
InkWell( InkWell(
onTap: () { onTap: () {
if (groupValue == null) { if (groupValue == null) {
Fluttertoast.showToast(msg: S.of(context).qingxuanzeyigemendian); SmartDialog.showToast(S.of(context).qingxuanzeyigemendian);
return; return;
} }
Store store = storeList[groupValue]; Store store = storeList[groupValue];

3
lib/retrofit/retrofit_api.dart

@ -23,6 +23,7 @@ const baseUrl = "http://platform.test.api.lotus-wallet.com/app/";
@RestApi(baseUrl: baseUrl) @RestApi(baseUrl: baseUrl)
abstract class ApiService { abstract class ApiService {
factory ApiService(Dio dio, factory ApiService(Dio dio,
{String baseUrl, {String baseUrl,
BuildContext context, BuildContext context,
@ -74,6 +75,8 @@ abstract class ApiService {
), ),
clickBgDismissTemp: false, clickBgDismissTemp: false,
); );
} else if (map["code"] != 0) {
SmartDialog.showToast(map["msg"]);
} }
debugPrint("======================= 响应数据结束 =======================\n"); debugPrint("======================= 响应数据结束 =======================\n");
}, onError: (DioError e) { }, onError: (DioError e) {

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

1
lib/setting/setting_page.dart

@ -2,7 +2,6 @@ import 'dart:io';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/login/login_page.dart'; import 'package:huixiang/login/login_page.dart';
import 'package:huixiang/main.dart'; import 'package:huixiang/main.dart';

386
lib/union/union_details_page.dart

@ -5,8 +5,8 @@ import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart'; import 'package:flutter/rendering.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/activity.dart'; import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
@ -64,7 +64,9 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
refreshController.refreshCompleted(); refreshController.refreshCompleted();
storeInfo = StoreInfo.fromJson(baseData.data); 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(() {}); if (mounted) setState(() {});
} else { } else {
refreshController.refreshFailed(); refreshController.refreshFailed();
@ -405,7 +407,9 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
width: 8.w, width: 8.w,
), ),
Text( Text(
(storeInfo != null && storeInfo.memberSource != null) ? "${storeInfo.memberSource.integral}" : "", (storeInfo != null && storeInfo.memberSource != null)
? "${storeInfo.memberSource.integral}"
: "",
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -416,7 +420,9 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
), ),
], ],
), ),
SizedBox(height: 10.h,), SizedBox(
height: 10.h,
),
Text( Text(
S.of(context).gongxinichengweibendianhuiyuan, S.of(context).gongxinichengweibendianhuiyuan,
style: TextStyle( style: TextStyle(
@ -459,7 +465,9 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
receiveVip(); receiveVip();
}, },
child: RoundButton( child: RoundButton(
text: S.of(context).dianwolingqu, text: isReceive
? S.of(context).dianwolingqu
: S.of(context).yilingqu,
textColor: isReceive ? Colors.white : Color(0xFF484D66), textColor: isReceive ? Colors.white : Color(0xFF484D66),
backgroup: isReceive ? Color(0xFF242B45) : Colors.white, backgroup: isReceive ? Color(0xFF242B45) : Colors.white,
padding: padding:
@ -478,207 +486,208 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
return Container( return Container(
height: 109.h, height: 109.h,
child: ListView.builder( child: ListView.builder(
itemCount: (storeInfo != null && storeInfo.couponVOList != null) itemCount: (storeInfo != null && storeInfo.couponVOList != null)
? storeInfo.couponVOList.length ? storeInfo.couponVOList.length
: 0, : 0,
physics: BouncingScrollPhysics(parent: PageScrollPhysics()), physics: BouncingScrollPhysics(parent: PageScrollPhysics()),
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
itemBuilder: (context, position) { itemBuilder: (context, position) {
return Container( return Container(
width: MediaQuery.of(context).size.width * 0.784, width: MediaQuery.of(context).size.width * 0.784,
margin: EdgeInsets.only(left: 6.w), margin: EdgeInsets.only(left: 6.w),
child: AspectRatio( child: AspectRatio(
aspectRatio: 2.86, aspectRatio: 2.86,
child: Stack( child: Stack(
children: [ children: [
Image.asset( Image.asset(
"assets/image/icon_union_coupons_bg.png", "assets/image/icon_union_coupons_bg.png",
fit: BoxFit.fill, fit: BoxFit.fill,
width: double.infinity, width: double.infinity,
height: double.infinity, height: double.infinity,
),
Container(
padding: EdgeInsets.only(
left: 24.w,
right: 24.w,
bottom: 17.h,
top: 11.h,
), ),
Container( child: Row(
padding: EdgeInsets.only( mainAxisAlignment: MainAxisAlignment.spaceBetween,
left: 24.w, crossAxisAlignment: CrossAxisAlignment.center,
right: 24.w, children: [
bottom: 17.h, Container(
top: 11.h, margin: EdgeInsets.only(left: 5),
), child: Text.rich(TextSpan(children: [
child: Row( TextSpan(
mainAxisAlignment: MainAxisAlignment.spaceBetween, text: (storeInfo != null &&
crossAxisAlignment: CrossAxisAlignment.center, storeInfo.couponVOList != null &&
children: [ storeInfo
Container( .couponVOList[position].bizType ==
margin: EdgeInsets.only(left: 5), 1)
child: Text.rich(TextSpan(children: [ ? "¥"
TextSpan( : "",
text: (storeInfo != null && style: TextStyle(
storeInfo.couponVOList != null && fontSize: 22.sp,
storeInfo.couponVOList[position] color: Color(0xFFFF7A1A),
.bizType == fontWeight: FontWeight.bold,
1)
? "¥"
: "",
style: TextStyle(
fontSize: 22.sp,
color: Color(0xFFFF7A1A),
fontWeight: FontWeight.bold,
),
), ),
TextSpan( ),
text: (storeInfo != null && TextSpan(
storeInfo.couponVOList != null && text: (storeInfo != null &&
storeInfo.couponVOList[position] storeInfo.couponVOList != null &&
.bizType == storeInfo
1) .couponVOList[position].bizType ==
? "${double.tryParse(storeInfo.couponVOList[position].discountAmount).toInt()}" 1)
: "${storeInfo.couponVOList[position].discountPercent}", ? "${double.tryParse(storeInfo.couponVOList[position].discountAmount).toInt()}"
style: TextStyle( : "${storeInfo.couponVOList[position].discountPercent}",
fontSize: 36.sp, style: TextStyle(
color: Color(0xFFFF7A1A), fontSize: 36.sp,
fontWeight: FontWeight.bold, 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( margin: EdgeInsets.only(
top: 12.h,
bottom: 12.h, bottom: 12.h,
left: 15.w, top: 12.h,
right: 24.w,
),
child: MySeparator(
width: 1.w,
height: 5.h,
color: Color(0xFF979797),
), ),
), child: Column(
Expanded( mainAxisAlignment: MainAxisAlignment.spaceBetween,
child: Container( crossAxisAlignment: CrossAxisAlignment.start,
margin: EdgeInsets.only( children: [
bottom: 12.h, Text(
top: 12.h, (storeInfo != null &&
), storeInfo.couponVOList != null)
child: Column( ? storeInfo
mainAxisAlignment: .couponVOList[position].couponName
MainAxisAlignment.spaceBetween, : "",
crossAxisAlignment: CrossAxisAlignment.start, maxLines: 1,
children: [ overflow: TextOverflow.ellipsis,
Text( style: TextStyle(
(storeInfo != null && fontSize: 10.sp,
storeInfo.couponVOList != null) fontWeight: FontWeight.bold,
? storeInfo color: Color(0xFF727272),
.couponVOList[position].couponName
: "",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 10.sp,
fontWeight: FontWeight.bold,
color: Color(0xFF727272),
),
), ),
Text( ),
(storeInfo != Text(
null && (storeInfo != null &&
storeInfo.couponVOList != null) storeInfo.couponVOList != null)
? (storeInfo.couponVOList[position] ? (storeInfo.couponVOList[position]
.bizType == .bizType ==
1 1
? S.of(context).manlijiandaijinquan( ? S.of(context).manlijiandaijinquan(
double.tryParse(storeInfo double.tryParse(storeInfo
.couponVOList[position] .couponVOList[position]
.fullAmount) .fullAmount)
.toInt(), .toInt(),
double.tryParse(storeInfo double.tryParse(storeInfo
.couponVOList[position] .couponVOList[position]
.discountAmount) .discountAmount)
.toInt()) .toInt())
: S.of(context).quanchangzhe( : S.of(context).quanchangzhe(storeInfo
storeInfo.couponVOList[position] .couponVOList[position]
.discountPercent)) .discountPercent))
: "", : "",
// (storeInfo != null && storeInfo.couponVOList != null) ? storeInfo.couponVOList[position].couponImg : "", // (storeInfo != null && storeInfo.couponVOList != null) ? storeInfo.couponVOList[position].couponImg : "",
// S.of(context).manlijiandaijinquan(30, 5), // S.of(context).manlijiandaijinquan(30, 5),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Color(0xFFFF7A1A), color: Color(0xFFFF7A1A),
),
), ),
Text( ),
S.of(context).youxiaoqizhi( Text(
(storeInfo != null && S.of(context).youxiaoqizhi(
storeInfo.couponVOList != (storeInfo != null &&
null && storeInfo.couponVOList !=
storeInfo null &&
.couponVOList[ storeInfo.couponVOList[position]
position] .useStartTime !=
.useStartTime != null &&
null && storeInfo.couponVOList[position]
storeInfo .useEndTime !=
.couponVOList[ null)
position] ? "${storeInfo.couponVOList[position].useStartTime.replaceAll("-", ".").split(" ")[0]}-${storeInfo.couponVOList[position].useEndTime.replaceAll("-", ".").split(" ")[0]}"
.useEndTime != : "",
null) ),
? "${storeInfo.couponVOList[position].useStartTime.replaceAll("-", ".").split(" ")[0]}-${storeInfo.couponVOList[position].useEndTime.replaceAll("-", ".").split(" ")[0]}" overflow: TextOverflow.ellipsis,
: "", maxLines: 1,
), style: TextStyle(
overflow: TextOverflow.ellipsis, fontSize: 8.sp,
maxLines: 1, color: Color(0xFFA29E9E),
style: TextStyle(
fontSize: 8.sp,
color: Color(0xFFA29E9E),
),
), ),
], ),
), ],
), ),
), ),
InkWell( ),
onTap: () { InkWell(
onTap: () {
if (storeInfo != null &&
storeInfo.couponVOList != null &&
storeInfo.couponVOList[position].status == 0) {
receiveCoupon( receiveCoupon(
storeInfo.couponVOList[position].id); storeInfo.couponVOList[position].id);
}, }
child: Container( },
height: 25.h, child: Container(
child: RoundButton( height: 25.h,
text: S.of(context).lingqu, child: RoundButton(
textColor: Colors.white, text: (storeInfo != null &&
backgroup: (storeInfo != null && storeInfo.couponVOList != null &&
storeInfo.couponVOList != null && storeInfo.couponVOList[position].status >
storeInfo.couponVOList[position] 0)
.status >= ? S.of(context).yilingqu
2) : S.of(context).lingqu,
? Colors.grey textColor: Colors.white,
: Color(0xFF32A060), backgroup: (storeInfo != null &&
padding: EdgeInsets.fromLTRB(8, 4, 8, 4), storeInfo.couponVOList != null &&
fontSize: 12.sp, storeInfo.couponVOList[position].status >
), 0)
? Colors.grey
: Color(0xFF32A060),
padding: EdgeInsets.fromLTRB(8, 4, 8, 4),
fontSize: 12.sp,
), ),
), ),
], ),
), ],
) ),
], )
), ],
), ),
); ),
}), );
},
),
); );
} }
/// ///
receiveCoupon(couponId) async { receiveCoupon(couponId) async {
BaseData baseData = await apiService.receiveCoupon(couponId); BaseData baseData = await apiService.receiveCoupon(couponId);
if (baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
queryStoreInfo(); queryStoreInfo();
showAlertDialog(); showAlertDialog();
} else {
Fluttertoast.showToast(msg: baseData.msg);
} }
} }
@ -697,12 +706,10 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
receiveVip() async { receiveVip() async {
BaseData baseData = await apiService.minLogin(storeInfo.id); BaseData baseData = await apiService.minLogin(storeInfo.id);
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
Fluttertoast.showToast(msg: S.of(context).lingquchenggong); SmartDialog.showToast(S.of(context).lingquchenggong);
setState(() { setState(() {
isReceive = true; isReceive = true;
}); });
} else {
Fluttertoast.showToast(msg: baseData.msg);
} }
} }
@ -809,8 +816,7 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
), ),
child: Text( child: Text(
(activitys != null) (activitys != null)
? activitys[position].startTime ? activitys[position].startTime.split(" ")[0]
.split(" ")[0]
: "", : "",
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -886,21 +892,19 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
print("print getAppBasePath: ${await Min.getAppBasePath(miniAppId)}"); print("print getAppBasePath: ${await Min.getAppBasePath(miniAppId)}");
print("print currentPageUrl: ${await Min.currentPageUrl()}"); print("print currentPageUrl: ${await Min.currentPageUrl()}");
print("print runingAppid: ${await Min.runingAppid()}"); print("print runingAppid: ${await Min.runingAppid()}");
print("print getAppVersionInfo: ${await Min.getAppVersionInfo(miniAppId)}"); // print("print getAppVersionInfo: ${await Min.getAppVersionInfo(miniAppId)}");
} }
_loginMin() async { _loginMin() async {
if (storeInfo == null) return; if (storeInfo == null) return;
if (!isEnable()) { if (!isEnable()) {
Fluttertoast.showToast(msg: S.of(context).zanbuzhichixianshangdiancan); SmartDialog.showToast(S.of(context).zanbuzhichixianshangdiancan);
return; return;
} }
BaseData baseData = await apiService.minLogin(storeInfo.id); BaseData baseData = await apiService.minLogin(storeInfo.id);
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
UserEntity userEntity = UserEntity.fromJson(baseData.data); UserEntity userEntity = UserEntity.fromJson(baseData.data);
startMin(userEntity.token, userEntity.userId); startMin(userEntity.token, userEntity.userId);
} else {
Fluttertoast.showToast(msg: baseData.msg);
} }
} }
@ -992,7 +996,7 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
SizedBox( SizedBox(
height: 40.0.h, height: 40.h,
width: 40.w, width: 40.w,
child: CircularProgressIndicator( child: CircularProgressIndicator(
value: progressValue, value: progressValue,

3
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:huixiang/view_widget/item_title.dart';
import 'package:amap_flutter_base/amap_flutter_base.dart'; import 'package:amap_flutter_base/amap_flutter_base.dart';
import 'package:amap_flutter_map/amap_flutter_map.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:huixiang/view_widget/request_permission.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
@ -236,7 +234,6 @@ class _UnionPage extends State<UnionPage>
setState(() {}); setState(() {});
} else { } else {
refreshController.refreshFailed(); refreshController.refreshFailed();
Fluttertoast.showToast(msg: baseData.msg);
} }
} }

6
lib/view_widget/store_title_tab.dart

@ -31,9 +31,9 @@ class _StoreTitleTab extends State<StoreTitleTab> {
bool isVisible = false; bool isVisible = false;
List<String> images = [ List<String> images = [
"assets/image/icon_chili.png", "assets/image/icon_chili.webp",
"assets/image/icon_milk_tea.png", "assets/image/icon_milk_tea.webp",
"assets/image/icon_bread.png", "assets/image/icon_bread.webp",
]; ];
@override @override

296
pubspec.lock

File diff suppressed because it is too large Load Diff

4
pubspec.yaml

@ -63,7 +63,7 @@ dependencies:
event_bus: ^2.0.0 event_bus: ^2.0.0
intl: ^0.17.0 intl: ^0.17.0
shared_preferences: ^2.0.6 shared_preferences: ^2.0.6
fluttertoast: ^8.0.7 # fluttertoast: ^8.0.7
flutter_smart_dialog: ^2.1.6 flutter_smart_dialog: ^2.1.6
# url_launcher: ^6.0.5 # url_launcher: ^6.0.5
@ -80,7 +80,7 @@ dependencies:
cached_network_image: ^2.0.0 cached_network_image: ^2.0.0
flutter_html: ^1.3.0 #2.1.0 flutter_html: ^1.3.0 #2.1.0
photo_view: ^0.11.1 # photo_view: ^0.11.1
chewie: ^0.12.2 chewie: ^0.12.2
video_player: ^1.0.1 video_player: ^1.0.1

Loading…
Cancel
Save