diff --git a/lib/home/guide_page.dart b/lib/home/guide_page.dart index 74ccf3d5..9f367238 100644 --- a/lib/home/guide_page.dart +++ b/lib/home/guide_page.dart @@ -4,6 +4,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/examine_instance.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/border_text.dart'; import 'package:huixiang/view_widget/round_button.dart'; @@ -23,7 +24,8 @@ class _GuidePage extends State { @override void initState() { super.initState(); - // isLogin(); + if(Platform.isAndroid&&!ExamineInstance.instance.isExamine) + isLogin(); } isLogin() async { diff --git a/lib/login/new_login_page.dart b/lib/login/new_login_page.dart index 2c1ee4c6..66d4bcea 100644 --- a/lib/login/new_login_page.dart +++ b/lib/login/new_login_page.dart @@ -9,25 +9,18 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; -import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:huixiang/generated/l10n.dart'; -import 'package:huixiang/retrofit/data/activity.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/examine_instance.dart'; import 'package:huixiang/retrofit/data/login_info.dart'; -import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/data/user_entity.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/event_type.dart'; import 'package:huixiang/utils/flutter_utils.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/border_text.dart'; -import 'package:huixiang/view_widget/classic_header.dart'; -import 'package:huixiang/view_widget/item_title.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:huixiang/view_widget/my_appbar.dart'; -import 'package:huixiang/view_widget/my_footer.dart'; import 'package:huixiang/view_widget/round_button.dart'; -import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:sharesdk_plugin/sharesdk_interface.dart'; @@ -223,6 +216,7 @@ class _NewLoginPage extends State { // EasyLoading.show(status: S.of(context).zhengzaijiazai); if (value != null && value.isSuccess) { var userInfo = LoginInfo.fromJson(value.data); + ExamineInstance.instance.isExamine = userInfo.authInfo.account == "13800138000"; saveUserJson(userInfo.authInfo.toJson()); eventBus.fire(EventType(3)); diff --git a/lib/main.dart b/lib/main.dart index ff373191..1782a9e2 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -46,6 +46,7 @@ import 'package:huixiang/order/write_off_success_page.dart'; import 'package:huixiang/qr/invite_friends.dart'; import 'package:huixiang/qr/qr_code_scan.dart'; import 'package:huixiang/qr/qr_share.dart'; +import 'package:huixiang/retrofit/data/examine_instance.dart'; import 'package:huixiang/setting/about_page.dart'; import 'package:huixiang/setting/account_security_page.dart'; import 'package:huixiang/setting/help_feedback_page.dart'; @@ -164,6 +165,7 @@ class MyApp extends StatelessWidget { designSize: Size(375, 812), builder: () => MaterialApp( debugShowCheckedModeBanner: false, + title: Platform.isAndroid ? (ExamineInstance.instance.isExamine?"一心回乡":""):"", theme: ThemeData( primarySwatch: Colors.blue, textTheme: TextTheme( diff --git a/lib/main_page.dart b/lib/main_page.dart index 05eef8b7..2f61661f 100644 --- a/lib/main_page.dart +++ b/lib/main_page.dart @@ -14,6 +14,7 @@ import 'package:huixiang/main.dart'; import 'package:huixiang/mine/mine_page.dart'; import 'package:huixiang/retrofit/data/app_update.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/examine_instance.dart'; import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/union/union_page.dart'; @@ -127,9 +128,8 @@ class _MainPage extends State with WidgetsBindingObserver { },invite:invite,interviewCouponList:interviewCouponList,firstLoginCouponList:firstLoginCouponList,), // MainHomePage(), UnionPage(unionPageKey,0), - // (Theme.of(context).platform == TargetPlatform.android) ? OrderPage() :CommunityPage(), - CommunityPage(), - // OrderPage(), + Platform.isAndroid ? (ExamineInstance.instance.isExamine?OrderPage():CommunityPage()) :CommunityPage(), + // CommunityPage(), MinePage(minePageKey), ]; @@ -424,8 +424,8 @@ class _MainPage extends State with WidgetsBindingObserver { // bottomNavigationBigItem(S.of(context).pinpai, 0), bottomNavigationItem(S.of(context).main_menu1, 0), bottomNavigationItem(S.of(context).main_menu2, 1), - bottomNavigationItem(S.of(context).main_menu3 , 2), - // bottomNavigationItem("订单", 2), + // bottomNavigationItem(S.of(context).main_menu3 , 2), + bottomNavigationItem(Platform.isAndroid ? (ExamineInstance.instance.isExamine?"订单":S.of(context).main_menu3) :S.of(context).main_menu3, 2), bottomNavigationItem(S.of(context).main_menu4, 3), ], ), diff --git a/lib/mine/mine_page.dart b/lib/mine/mine_page.dart index 72f134d7..897c0be8 100644 --- a/lib/mine/mine_page.dart +++ b/lib/mine/mine_page.dart @@ -1,4 +1,5 @@ import 'dart:convert'; +import 'dart:io'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -8,6 +9,7 @@ import 'package:huixiang/main.dart'; import 'package:huixiang/mine/mine_view/mine_calendar.dart'; import 'package:huixiang/mine/mine_view/mine_order.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/examine_instance.dart'; import 'package:huixiang/retrofit/data/msg_stats.dart'; import 'package:huixiang/retrofit/data/rank.dart'; import 'package:huixiang/retrofit/data/social_info.dart'; @@ -50,7 +52,8 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { .pushNamed('/router/new_login_page', arguments: {"login": "login"}); return; } - // await Navigator.of(context).pushNamed('/router/user_info_page'); + (Platform.isAndroid&&ExamineInstance.instance.isExamine)? + await Navigator.of(context).pushNamed('/router/user_info_page'): await Navigator.of(context).pushNamed('/router/personal_page',arguments:{"memberId":"0",}); setState(() {}); } diff --git a/lib/mine/mine_wallet_page.dart b/lib/mine/mine_wallet_page.dart index c05015f3..96ccbb14 100644 --- a/lib/mine/mine_wallet_page.dart +++ b/lib/mine/mine_wallet_page.dart @@ -1,10 +1,12 @@ import 'dart:convert'; +import 'dart:io'; import 'package:dio/dio.dart'; import 'package:flare_flutter/base/actor_ellipse.dart'; import 'package:flutter/material.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/examine_instance.dart'; import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/data/user_bill.dart'; import 'package:huixiang/retrofit/data/user_info.dart'; @@ -446,14 +448,14 @@ class _MineWalletPage extends State { //24.w, 24.h, 24.w, 24.h Padding( padding: EdgeInsets.only( - left: 24, - top: 24, + left: 24.w, + top: 24.h, ), child: Text( S.of(context).zongzichanyuan, style: TextStyle( color: Colors.white, - fontSize: 16, + fontSize: 16.sp, ), ), ), @@ -462,13 +464,13 @@ class _MineWalletPage extends State { crossAxisAlignment: CrossAxisAlignment.center, children: [ SizedBox( - width: 24, + width: 24.w, ), Text( "$pBalance", style: TextStyle( fontWeight: MyFontWeight.semi_bold, - fontSize: 50, + fontSize: 50.sp, color: Colors.white, ), ), @@ -501,7 +503,7 @@ class _MineWalletPage extends State { child: Text( S.of(context).chongzhi, style: TextStyle( - fontSize: 18, + fontSize: 18.sp, fontWeight: MyFontWeight.semi_bold, color: Color(0xFF32A060), ), @@ -517,11 +519,11 @@ class _MineWalletPage extends State { flex: 1, ), SizedBox( - height: 22, + height: 22.h, ), Padding( padding: EdgeInsets.symmetric( - horizontal: 24, + horizontal: 24.w, ), child: Row( children: [ @@ -531,20 +533,20 @@ class _MineWalletPage extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - S.of(context).yue, + "${S.of(context).yue}(含活动)", style: TextStyle( - fontSize: 14, + fontSize: 14.sp, fontWeight: MyFontWeight.semi_bold, color: Colors.white, ), ), SizedBox( - height: 4, + height: 4.h, ), Text( "$mBalance", style: TextStyle( - fontSize: 18, + fontSize: 18.sp, fontWeight: MyFontWeight.semi_bold, color: Colors.white, ), @@ -553,7 +555,7 @@ class _MineWalletPage extends State { ), ), SizedBox( - height: 8, + height: 8.h, ), Expanded( flex: 1, @@ -563,18 +565,18 @@ class _MineWalletPage extends State { Text( S.of(context).huodongyue, style: TextStyle( - fontSize: 14, + fontSize: 14.sp, fontWeight: MyFontWeight.semi_bold, color: Colors.white, ), ), SizedBox( - height: 4, + height: 4.h, ), Text( "$activityMoney", style: TextStyle( - fontSize: 18, + fontSize: 18.sp, fontWeight: MyFontWeight.semi_bold, color: Colors.white, ), @@ -583,7 +585,7 @@ class _MineWalletPage extends State { ), ), SizedBox( - height: 8, + height: 8.h, ), Expanded( flex: 1, @@ -593,18 +595,18 @@ class _MineWalletPage extends State { Text( S.of(context).lvbiyue, style: TextStyle( - fontSize: 14, + fontSize: 14.sp, fontWeight: MyFontWeight.semi_bold, color: Colors.white, ), ), SizedBox( - height: 4, + height: 4.h, ), Text( "$mgreenMoney", style: TextStyle( - fontSize: 18, + fontSize: 18.sp, fontWeight: MyFontWeight.semi_bold, color: Colors.white, ), @@ -616,7 +618,7 @@ class _MineWalletPage extends State { ), ), SizedBox( - height: 24, + height: 24.h, ), ], ), diff --git a/lib/retrofit/data/examine_instance.dart b/lib/retrofit/data/examine_instance.dart new file mode 100644 index 00000000..a5cd7287 --- /dev/null +++ b/lib/retrofit/data/examine_instance.dart @@ -0,0 +1,31 @@ + +class ExamineInstance{ + + factory ExamineInstance() => _getInstance(); + + static ExamineInstance get instance => _getInstance(); + + static ExamineInstance _instance; + + bool _isExamine = true; + + bool get isExamine => + _isExamine; + + set isExamine(bool value) { + this._isExamine = value; + } + + ExamineInstance._internal(){ + //单例初始化 + + } + + static ExamineInstance _getInstance(){ + if(_instance == null){ + _instance = ExamineInstance._internal(); + } + return _instance; + } + +} \ No newline at end of file diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index 1f2a6374..f7e60731 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -26,8 +26,8 @@ import 'data/shopping_home_config.dart'; part 'min_api.g.dart'; -// const localBaseUrl = "http://192.168.10.129:8765/app/";///本地 -const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///本地 +const localBaseUrl = "http://192.168.10.78:8765/app/";///本地 +// const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///本地 const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线上 diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 8f74e4cc..b55cfa21 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -61,8 +61,8 @@ import 'data/wx_pay.dart'; part 'retrofit_api.g.dart'; -// const localBaseUrl = "http://192.168.10.129:8765/app/";///本地 -const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///本地 +const localBaseUrl = "http://192.168.10.78:8766/app/";///本地 +// const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///本地 const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///线上 @RestApi(baseUrl: localBaseUrl) diff --git a/lib/union/union_list.dart b/lib/union/union_list.dart index f7880708..7c28d8d9 100644 --- a/lib/union/union_list.dart +++ b/lib/union/union_list.dart @@ -155,7 +155,7 @@ class _UnionList extends State { ) ]), width: double.infinity, - height: 228.h, + height: 235.h, child: Stack( children: [ Positioned( @@ -187,7 +187,7 @@ class _UnionList extends State { left: 12.w, right: 12.w, child: Container( - height: 100.h, + height: 107.h, child: Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/web/web_page.dart b/lib/web/web_page.dart index 167f11eb..ca9748da 100644 --- a/lib/web/web_page.dart +++ b/lib/web/web_page.dart @@ -10,6 +10,7 @@ import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/activity.dart'; import 'package:huixiang/retrofit/data/article.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/examine_instance.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/share_dialog.dart'; @@ -276,6 +277,7 @@ class _WebPage extends State with WidgetsBindingObserver { ), /// 富文本的评论 + if(Platform.isAndroid&&!ExamineInstance.instance.isExamine) CommentList( commentKey, article?.likes ?? activity?.likes ?? 0, @@ -300,6 +302,7 @@ class _WebPage extends State with WidgetsBindingObserver { ), /// 富文本评论的输入框 + if(Platform.isAndroid&&!ExamineInstance.instance.isExamine) InputComment( inputKey, hintText, diff --git a/pubspec.yaml b/pubspec.yaml index 3a51ea7f..c31d1ee4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: 一心回乡. publish_to: 'none' # Remove this line if you wish to publish to pub.dev -version: 2.0.38+26 +version: 3.1.4+28 environment: sdk: ">=2.7.0 <3.0.0"