Skip to content

Commit

Permalink
Merge pull request #162 from virskor/hotfix/review
Browse files Browse the repository at this point in the history
更新ui
  • Loading branch information
virskor authored Jan 16, 2021
2 parents 6003ef8 + 7044c0b commit 57a42f7
Show file tree
Hide file tree
Showing 70 changed files with 917 additions and 794 deletions.
4 changes: 2 additions & 2 deletions mobile/.packages
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by pub on 2021-01-03 15:47:21.908883.
# Generated by pub on 2021-01-16 11:55:17.200790.
archive:file:///Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.flutter-io.cn/archive-2.0.13/lib/
args:file:///Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.flutter-io.cn/args-1.6.0/lib/
assets_audio_player:../packages/flutter_assetsAudioPlayer/lib/
Expand Down Expand Up @@ -126,7 +126,7 @@ video_player:file:///Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pu
video_player_platform_interface:file:///Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.flutter-io.cn/video_player_platform_interface-2.2.0/lib/
video_player_web:file:///Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.flutter-io.cn/video_player_web-0.1.4+1/lib/
wakelock:file:///Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.flutter-io.cn/wakelock-0.1.4+2/lib/
webview_flutter:file:///Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.flutter-io.cn/webview_flutter-1.0.3/lib/
webview_flutter:file:///Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.flutter-io.cn/webview_flutter-1.0.7/lib/
win32:file:///Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4/lib/
xdg_directories:file:///Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.flutter-io.cn/xdg_directories-0.1.2/lib/
xml:file:///Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.flutter-io.cn/xml-4.5.1/lib/
Expand Down
2 changes: 1 addition & 1 deletion mobile/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<application
tools:replace="icon, label"
android:name="io.flutter.app.FlutterApplication"
android:label="DiscuzQ"
android:label="Discuz!Q"
android:usesCleartextTraffic="true"
android:icon="@mipmap/ic_launcher">
<!--头像剪裁-->
Expand Down
Binary file modified mobile/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mobile/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mobile/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mobile/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mobile/app_android.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mobile/assets/images/app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mobile/assets/images/inbox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 15 additions & 7 deletions mobile/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ development:
# You are not gonna get a health application when you add a domain like https://google.com redirected into https://www.google.com
#
# YOUR DOMAIN SHOULD NEVER ENDED WITH PATH SEPARATOR LIKE : https://www.example.com/
domain: https://discuz.chat
appname: DiscuzQ
domain: https://m.clodra.com
appname: ClodraAPP
# 帮助中心链接
helpCenter: https://app.clodra.com/helpcenter/
# 技术支持链接
technicalSupport: https://app.clodra.com
# Allow to show checked mode banner
debugShowCheckedModeBanner: true
debugShowCheckedModeBanner: false
# Allow and show performance overlay setting
enablePerformanceOverlay: true
# HTTP2
Expand All @@ -37,7 +41,7 @@ development:
#
# Financial fatures
# Set this item into FALSE, wallet and financial amount will be displayed
financial: true
financial: false
# Bugly
bugly:
IOS: de3ab42b91
Expand All @@ -47,8 +51,12 @@ development:
# 构建生产环境的APP时加载的信息
# Parameters for building prodution package
production:
domain: https://discuz.chat
appname: DiscuzQ
domain: https://m.clodra.com
appname: ClodraAPP
## 帮助中心链接
helpCenter: https://app.clodra.com/helpcenter/
# 技术支持链接
technicalSupport: https://app.clodra.com
## DO NOT ENABLE THIS ITEM WHEN YOU ARE BUILD AN APPLICATION FOR YOUR USERS
enablePerformanceOverlay: false
## DO NOT ENABLE THIS ITEM WHEN YOU ARE BUILD AN APPLICATION FOR YOUR USERS
Expand All @@ -57,7 +65,7 @@ production:
enableHttp2: false
onBadCertificate: true
http2idleTimeout: 15000
financial: true
financial: false
# Bugly
bugly:
IOS: de3ab42b91
Expand Down
2 changes: 1 addition & 1 deletion mobile/ios/Flutter/.last_build_id
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cbcc2527cf03f6794e5fbef48ae5d5fd
a06c9e6ee74aebe4aa13e3e9300a5b89
6 changes: 3 additions & 3 deletions mobile/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
CURRENT_PROJECT_VERSION = 78;
DEVELOPMENT_TEAM = T92T456454;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -511,7 +511,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
CURRENT_PROJECT_VERSION = 78;
DEVELOPMENT_TEAM = T92T456454;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -542,7 +542,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
CURRENT_PROJECT_VERSION = 78;
DEVELOPMENT_TEAM = T92T456454;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
Expand Down
22 changes: 22 additions & 0 deletions mobile/lib/core.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import 'package:discuzq/providers/forumProvider.dart';
import 'package:discuzq/providers/categoriesProvider.dart';
import 'package:discuzq/providers/editorProvider.dart';
import 'package:discuzq/widgets/update/upgrader.dart';
import 'package:discuzq/widgets/settings/privacyConfirm.dart';

///
/// 执行
Expand Down Expand Up @@ -80,11 +81,30 @@ class DiscuzQ extends StatelessWidget {

/// 加载本地的用户信息
await AuthHelper.getUserFromLocal(context: context);

await _userPrivaciesNotice(context);
}

/// 加载本地的配置
Future<bool> _initAppSettings() async =>
await AppConfigurations().initAppSetting();


/// 弹出用户隐私提示
void _userPrivaciesNotice(BuildContext context) {
final dynamic appConf = context.read<AppConfigProvider>().appConf;
if (appConf['confrimedPrivacy'] != null &&
appConf['confrimedPrivacy'] == false) {
showModalBottomSheet(
context: context,
isDismissible: false,
enableDrag: false,
backgroundColor: Colors.transparent,
builder: (BuildContext context) {
return const PrivacyConfirm();
});
}
}
}

///
Expand All @@ -99,4 +119,6 @@ class _DiscuzAppIndicator extends StatelessWidget {
brightness: Brightness.dark,
),
);


}
45 changes: 13 additions & 32 deletions mobile/lib/discuz.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import 'package:discuzq/api/forum.dart';
import 'package:discuzq/router/routers.dart';
import 'package:discuzq/views/exploreDelagate.dart';
import 'package:discuzq/providers/appConfigProvider.dart';
import 'package:discuzq/widgets/settings/privacyConfirm.dart';

import 'widgets/ui/ui.dart';

Expand Down Expand Up @@ -166,6 +165,8 @@ class _DiscuzAppDelegate extends StatefulWidget {
class __DiscuzAppDelegateState extends State<_DiscuzAppDelegate> {
final CancelToken _cancelToken = CancelToken();

final PageController _pageController = PageController();

/// 页面集合
static const List<Widget> _views = [
const ForumDelegate(),
Expand All @@ -179,19 +180,16 @@ class __DiscuzAppDelegateState extends State<_DiscuzAppDelegate> {

/// 底部按钮菜单
final List<NavigatorItem> _items = [
const NavigatorItem(icon: 0xe63e, title: "首页"),
const NavigatorItem(icon: 0xe605, title: "发现", shouldLogin: true),
const NavigatorItem(icon: 0xe7f3, title: "首页"),
const NavigatorItem(icon: 0xe788, title: "发现", shouldLogin: true),
const NavigatorItem(isPublishButton: true),
const NavigatorItem(icon: 0xe677, title: "消息", shouldLogin: true),
const NavigatorItem(icon: 0xe7c7, title: "我的", size: 23, shouldLogin: true)
const NavigatorItem(icon: 0xe7c0, title: "消息", shouldLogin: true),
const NavigatorItem(icon: 0xe6f2, title: "我的", shouldLogin: true)
];

/// 使用global key
final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();

/// states
int _selected = 0;

/// _loaded means user forum api already requested! not means success or fail to load data
bool _loaded = false;

Expand All @@ -211,6 +209,7 @@ class __DiscuzAppDelegateState extends State<_DiscuzAppDelegate> {

@override
void dispose() {
_pageController.dispose();
super.dispose();
}

Expand All @@ -231,17 +230,17 @@ class __DiscuzAppDelegateState extends State<_DiscuzAppDelegate> {
canvasColor: DiscuzApp.themeOf(context).scaffoldBackgroundColor),
child: Scaffold(
key: _scaffoldKey,
//body: _views.elementAt(_selected),
body: IndexedStack(
body: PageView(
controller: _pageController,
children: _views,
index: _selected,
physics: const NeverScrollableScrollPhysics(),
),
resizeToAvoidBottomPadding: false,
bottomNavigationBar: DiscuzBottomNavigator(
items: _items,
onItemSelected: (index) => setState(() {
_selected = index;
}),
onItemSelected: (index) {
_pageController.jumpToPage(index);
},
),
),
);
Expand All @@ -262,23 +261,5 @@ class __DiscuzAppDelegateState extends State<_DiscuzAppDelegate> {
setState(() {
_loaded = true;
});

this._userPrivaciesNotice();
}

/// 弹出用户隐私提示
void _userPrivaciesNotice() {
final dynamic appConf = context.read<AppConfigProvider>().appConf;
if (appConf['confrimedPrivacy'] != null &&
appConf['confrimedPrivacy'] == false) {
showModalBottomSheet(
context: context,
isDismissible: false,
enableDrag: false,
backgroundColor: Colors.transparent,
builder: (BuildContext context) {
return const PrivacyConfirm();
});
}
}
}
8 changes: 8 additions & 0 deletions mobile/lib/models/buildInfoModel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,14 @@ class BuildInfoModel {
/// bugly配置
final dynamic bugly;

final String helpCenter;

final String technicalSupport;

const BuildInfoModel(
{this.domain = 'https://discuz.chat',
this.technicalSupport = "",
this.helpCenter = "",
this.appname = 'DiscuzQ',
this.enableHttp2 = false,
this.onBadCertificate = true,
Expand Down Expand Up @@ -79,6 +85,8 @@ class BuildInfoModel {
idleTimeout: data['idleTimeout'] ?? 15000,
financial: data['financial'] ?? false,
bugly: data['bugly'] ?? null,
helpCenter: data['helpCenter'] ?? "",
technicalSupport: data['technicalSupport'] ?? "",
debugShowCheckedModeBanner: data['debugShowCheckedModeBanner'] ?? false,
enablePerformanceOverlay: data['enablePerformanceOverlay'] ?? false);
}
Expand Down
11 changes: 11 additions & 0 deletions mobile/lib/router/routers.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:discuzq/views/settings/aboutDelegate.dart';
import 'package:discuzq/views/topics/appTopicsDelegate.dart';
import 'package:flutter/material.dart';
import 'package:fluro/fluro.dart';
Expand All @@ -11,6 +12,9 @@ class Routers {
/// 偏好设置
static const String preferences = "/preferences";

/// 关于
static const String about = "/about";

/// 话题列表
static const String topics = "/topics";

Expand All @@ -26,7 +30,14 @@ class Routers {
return const AppTopicsDelegate();
});

/// 话题
final Handler aboutHandler = Handler(
handlerFunc: (BuildContext context, Map<String, dynamic> params) {
return const AboutDelegate();
});

router.define(preferences, handler: preferencesHandler);
router.define(about, handler: aboutHandler);
router.define(topics, handler: topicsHandler);
}
}
Loading

0 comments on commit 57a42f7

Please sign in to comment.