哈哈哈 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. 24
      lib/home/home_page.dart
  27. 66
      lib/home/points_mall_page.dart
  28. 3
      lib/integral/integral_detailed_page.dart
  29. 39
      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. 82
      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
v2SigningEnabled true //v2
}
debug {//debug版签名配置
keyAlias 'huixiang'
keyPassword 'huixiang'
storeFile file('huixiang.jks')
storePassword 'huixiang'
v1SigningEnabled true //v1
v2SigningEnabled true //v2
}
}
buildTypes {
release {
signingConfig signingConfigs.config
}
debug {
signingConfig signingConfigs.config
}
profile {
signingConfig signingConfigs.config
}
}
aaptOptions {

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.MODIFY_AUDIO_SETTINGS"/>
<queries>
<package android:name="com.tencent.mm" />
</queries>
<application
android:label="回乡"
android:icon="@mipmap/ic_launcher">
@ -53,7 +59,13 @@
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<meta-data android:name="WX_APPID" android:value="wx3b269e795ed23e5f" />
<meta-data android:name="WX_SECRET" android:value="c7e6d17959743ca40602acb402292e2b"/>
<activity
android:name="com.zsw.huixiang.wxapi.WXPayEntryActivity"
android:exported="true"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:launchMode="singleTop" />
<activity
android:name="com.yalantis.ucrop.UCropActivity"
android:screenOrientation="portrait"

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

12
ios/Runner.xcodeproj/project.pbxproj

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

11
ios/Runner/Info.plist

@ -28,7 +28,16 @@
<string>????</string>
<key>CFBundleURLTypes</key>
<array>
<dict/>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>weixin</string>
<key>CFBundleURLSchemes</key>
<array>
<string>wx3b269e795ed23e5f</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>

2
ios/Runner/Runner.entitlements

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

11
lib/address/address_map_page.dart

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

14
lib/address/edit_address_page.dart

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

2
lib/generated/intl/messages_zh_TW.dart

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

20
lib/home/activity_list_page.dart

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

24
lib/home/home_page.dart

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

66
lib/home/points_mall_page.dart

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

3
lib/integral/integral_detailed_page.dart

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

39
lib/integral/integral_page.dart

@ -3,7 +3,7 @@ import 'dart:convert';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/rank.dart';
@ -66,8 +66,6 @@ class _IntegralPage extends State<IntegralPage> {
if (baseData != null && baseData.isSuccess) {
signInfo = SignInfo.fromJson(baseData.data);
setState(() {});
} else {
Fluttertoast.showToast(msg: baseData.msg);
}
}
@ -122,13 +120,26 @@ class _IntegralPage extends State<IntegralPage> {
),
body: SingleChildScrollView(
child: Container(
child: Column(
child: Stack(
children: [
Positioned(
child: Container(
height: 122.h,
color: Color(0xFF3A405A),
),
top: 0,
left: 0,
right: 0,
),
Column(
children: [
integralAndVip(),
inForPoints(),
integralTask(),
],
),
],
),
),
),
);
@ -418,19 +429,12 @@ class _IntegralPage extends State<IntegralPage> {
///
Widget inForPoints() {
return Container(
child: Stack(
children: [
Container(
height: 42.h,
color: Color(0xFF3A405A),
),
Container(
width: double.infinity,
margin: EdgeInsets.all(16),
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.all(Radius.circular(8)),
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
@ -496,24 +500,19 @@ class _IntegralPage extends State<IntegralPage> {
)
],
),
)
],
),
);
}
///
signIn() async {
if ((signInfo != null && signInfo.todayHasSignin)) {
Fluttertoast.showToast(msg: "今日已签到了");
SmartDialog.showToast("今日已签到了");
return;
}
BaseData baseData = await apiService.signIn();
if (baseData != null && baseData.isSuccess) {
querySignInfo();
Fluttertoast.showToast(msg: "签到成功");
} else {
Fluttertoast.showToast(msg: baseData.msg);
SmartDialog.showToast("签到成功");
}
}

17
lib/integral_store/integral_store_details_page.dart

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

2
lib/l10n/intl_zh_TW.arb

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

26
lib/login/login_page.dart

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

7
lib/mine/coupons_page.dart

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

4
lib/mine/edit_name.dart

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

8
lib/mine/manage_address_page.dart

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

3
lib/mine/mine_card_invalid_page.dart

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

1
lib/mine/mine_page.dart

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

4
lib/mine/mine_vip_level_page.dart

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

7
lib/mine/mine_wallet_page.dart

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

7
lib/mine/roll_center_page.dart

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

4
lib/mine/user_info_page.dart

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

5
lib/mine/vip_balance_page.dart

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

3
lib/mine/vip_card_page.dart

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

4
lib/mine/vip_detail_page.dart

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

5
lib/order/exchange_history_page.dart

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

8
lib/order/exchange_order_page.dart

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

4
lib/order/exchange_order_success_page.dart

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

6
lib/order/order_detail_page.dart

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

3
lib/order/order_history_page.dart

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

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

3
lib/retrofit/retrofit_api.dart

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

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/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/login/login_page.dart';
import 'package:huixiang/main.dart';

82
lib/union/union_details_page.dart

@ -5,8 +5,8 @@ import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
@ -64,7 +64,9 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
if (baseData != null && baseData.isSuccess) {
refreshController.refreshCompleted();
storeInfo = StoreInfo.fromJson(baseData.data);
activitys = storeInfo.informationVOPageVO.list.map((e) => Activity.fromJson(e)).toList();
activitys = storeInfo.informationVOPageVO.list
.map((e) => Activity.fromJson(e))
.toList();
if (mounted) setState(() {});
} else {
refreshController.refreshFailed();
@ -405,7 +407,9 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
width: 8.w,
),
Text(
(storeInfo != null && storeInfo.memberSource != null) ? "${storeInfo.memberSource.integral}" : "",
(storeInfo != null && storeInfo.memberSource != null)
? "${storeInfo.memberSource.integral}"
: "",
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.bold,
@ -416,7 +420,9 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
),
],
),
SizedBox(height: 10.h,),
SizedBox(
height: 10.h,
),
Text(
S.of(context).gongxinichengweibendianhuiyuan,
style: TextStyle(
@ -459,7 +465,9 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
receiveVip();
},
child: RoundButton(
text: S.of(context).dianwolingqu,
text: isReceive
? S.of(context).dianwolingqu
: S.of(context).yilingqu,
textColor: isReceive ? Colors.white : Color(0xFF484D66),
backgroup: isReceive ? Color(0xFF242B45) : Colors.white,
padding:
@ -514,8 +522,8 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
TextSpan(
text: (storeInfo != null &&
storeInfo.couponVOList != null &&
storeInfo.couponVOList[position]
.bizType ==
storeInfo
.couponVOList[position].bizType ==
1)
? "¥"
: "",
@ -528,8 +536,8 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
TextSpan(
text: (storeInfo != null &&
storeInfo.couponVOList != null &&
storeInfo.couponVOList[position]
.bizType ==
storeInfo
.couponVOList[position].bizType ==
1)
? "${double.tryParse(storeInfo.couponVOList[position].discountAmount).toInt()}"
: "${storeInfo.couponVOList[position].discountPercent}",
@ -562,8 +570,7 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
top: 12.h,
),
child: Column(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
@ -581,8 +588,7 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
),
),
Text(
(storeInfo !=
null &&
(storeInfo != null &&
storeInfo.couponVOList != null)
? (storeInfo.couponVOList[position]
.bizType ==
@ -596,8 +602,8 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
.couponVOList[position]
.discountAmount)
.toInt())
: S.of(context).quanchangzhe(
storeInfo.couponVOList[position]
: S.of(context).quanchangzhe(storeInfo
.couponVOList[position]
.discountPercent))
: "",
// (storeInfo != null && storeInfo.couponVOList != null) ? storeInfo.couponVOList[position].couponImg : "",
@ -614,14 +620,10 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
(storeInfo != null &&
storeInfo.couponVOList !=
null &&
storeInfo
.couponVOList[
position]
storeInfo.couponVOList[position]
.useStartTime !=
null &&
storeInfo
.couponVOList[
position]
storeInfo.couponVOList[position]
.useEndTime !=
null)
? "${storeInfo.couponVOList[position].useStartTime.replaceAll("-", ".").split(" ")[0]}-${storeInfo.couponVOList[position].useEndTime.replaceAll("-", ".").split(" ")[0]}"
@ -640,19 +642,27 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
),
InkWell(
onTap: () {
if (storeInfo != null &&
storeInfo.couponVOList != null &&
storeInfo.couponVOList[position].status == 0) {
receiveCoupon(
storeInfo.couponVOList[position].id);
}
},
child: Container(
height: 25.h,
child: RoundButton(
text: S.of(context).lingqu,
text: (storeInfo != null &&
storeInfo.couponVOList != null &&
storeInfo.couponVOList[position].status >
0)
? S.of(context).yilingqu
: S.of(context).lingqu,
textColor: Colors.white,
backgroup: (storeInfo != null &&
storeInfo.couponVOList != null &&
storeInfo.couponVOList[position]
.status >=
2)
storeInfo.couponVOList[position].status >
0)
? Colors.grey
: Color(0xFF32A060),
padding: EdgeInsets.fromLTRB(8, 4, 8, 4),
@ -667,18 +677,17 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
),
),
);
}),
},
),
);
}
///
receiveCoupon(couponId) async {
BaseData baseData = await apiService.receiveCoupon(couponId);
if (baseData.isSuccess) {
if (baseData != null && baseData.isSuccess) {
queryStoreInfo();
showAlertDialog();
} else {
Fluttertoast.showToast(msg: baseData.msg);
}
}
@ -697,12 +706,10 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
receiveVip() async {
BaseData baseData = await apiService.minLogin(storeInfo.id);
if (baseData != null && baseData.isSuccess) {
Fluttertoast.showToast(msg: S.of(context).lingquchenggong);
SmartDialog.showToast(S.of(context).lingquchenggong);
setState(() {
isReceive = true;
});
} else {
Fluttertoast.showToast(msg: baseData.msg);
}
}
@ -809,8 +816,7 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
),
child: Text(
(activitys != null)
? activitys[position].startTime
.split(" ")[0]
? activitys[position].startTime.split(" ")[0]
: "",
style: TextStyle(
fontWeight: FontWeight.bold,
@ -886,21 +892,19 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
print("print getAppBasePath: ${await Min.getAppBasePath(miniAppId)}");
print("print currentPageUrl: ${await Min.currentPageUrl()}");
print("print runingAppid: ${await Min.runingAppid()}");
print("print getAppVersionInfo: ${await Min.getAppVersionInfo(miniAppId)}");
// print("print getAppVersionInfo: ${await Min.getAppVersionInfo(miniAppId)}");
}
_loginMin() async {
if (storeInfo == null) return;
if (!isEnable()) {
Fluttertoast.showToast(msg: S.of(context).zanbuzhichixianshangdiancan);
SmartDialog.showToast(S.of(context).zanbuzhichixianshangdiancan);
return;
}
BaseData baseData = await apiService.minLogin(storeInfo.id);
if (baseData != null && baseData.isSuccess) {
UserEntity userEntity = UserEntity.fromJson(baseData.data);
startMin(userEntity.token, userEntity.userId);
} else {
Fluttertoast.showToast(msg: baseData.msg);
}
}
@ -992,7 +996,7 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 40.0.h,
height: 40.h,
width: 40.w,
child: CircularProgressIndicator(
value: progressValue,

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

6
lib/view_widget/store_title_tab.dart

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

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
intl: ^0.17.0
shared_preferences: ^2.0.6
fluttertoast: ^8.0.7
# fluttertoast: ^8.0.7
flutter_smart_dialog: ^2.1.6
# url_launcher: ^6.0.5
@ -80,7 +80,7 @@ dependencies:
cached_network_image: ^2.0.0
flutter_html: ^1.3.0 #2.1.0
photo_view: ^0.11.1
# photo_view: ^0.11.1
chewie: ^0.12.2
video_player: ^1.0.1

Loading…
Cancel
Save