Skip to content

Commit

Permalink
v1.5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
niuhuan committed Jul 12, 2022
1 parent 7b10874 commit 37a5523
Show file tree
Hide file tree
Showing 18 changed files with 140 additions and 52 deletions.
2 changes: 1 addition & 1 deletion ci/version.code.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.5.5
v1.5.6
12 changes: 5 additions & 7 deletions ci/version.info.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
更新
v1.5.6
- [x] 从服务器获取最新的分流
- [x] 优化排行榜/骑士榜/以及各个异步加载页的刷新逻辑

v1.5.5

- [x] 对历史记录页面进行优化
- [x] 对导入进行优化
- [x] 增加了批量导出ZIP/PKI到文件夹
- [x] 增加了从一个文件夹中导入所有ZIP/PKI的功能
- [x] 增加了发电页面, 对作者发过电的用户会展示发电特权图标

计划

- [ ] 本地骑士书签 (漫画书签?/快捷搜索书签?)
- [ ] 将Jasmine导出的PKI/JMI/导入, 阅读Jasmine导出的PKI

9 changes: 9 additions & 0 deletions lib/basic/Method.dart
Original file line number Diff line number Diff line change
Expand Up @@ -875,4 +875,13 @@ class Method {
Future inputCdKey(String cdKey) {
return _flatInvoke("inputCdKey", cdKey);
}

Future reloadSwitchAddress() {
return _flatInvoke("reloadSwitchAddress", "");
}

Future resetSwitchAddress() {
return _flatInvoke("resetSwitchAddress", "");
}

}
36 changes: 36 additions & 0 deletions lib/basic/config/Address.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// addr = "172.67.208.169:443"

import 'package:flutter/material.dart';
import 'package:pikapika/basic/Common.dart';

import '../Method.dart';

Expand Down Expand Up @@ -62,3 +63,38 @@ Widget switchAddressSetting() {
},
);
}

Widget reloadSwitchAddressSetting() {
return StatefulBuilder(
builder: (BuildContext context, void Function(void Function()) setState) {
return ListTile(
title: const Text("==== 分流 ===="),
onTap: () async {
String? choose = await chooseListDialog(context, "==== 分流 ====", [
"从服务器获取最新的分流地址",
"重制分流为默认值",
]);
if (choose != null) {
if (choose == "从服务器获取最新的分流地址") {
try {
await method.reloadSwitchAddress();
defaultToast(context, "分流2/3已同步");
} catch (e, s) {
print("$e\$s");
defaultToast(context, "分流同步失败");
}
} else if (choose == "重制分流为默认值") {
try {
await method.resetSwitchAddress();
defaultToast(context, "分流2/3已重制为默认值");
} catch (e, s) {
print("$e\$s");
defaultToast(context, "分流重制失败");
}
}
}
},
);
},
);
}
3 changes: 3 additions & 0 deletions lib/screens/ComicCollectionsScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class ComicCollectionsScreen extends StatefulWidget {

class _ComicCollectionsScreenState extends State<ComicCollectionsScreen> {
late Future<List<Collection>> _future;
late Key _key = UniqueKey();

@override
void initState() {
Expand All @@ -42,10 +43,12 @@ class _ComicCollectionsScreenState extends State<ComicCollectionsScreen> {
return Scaffold(
appBar: AppBar(title: const Text("推荐")),
body: ContentBuilder(
key: _key,
future: _future,
onRefresh: () async {
setState(() {
_future = method.collections();
_key = UniqueKey();
});
},
successBuilder: (
Expand Down
7 changes: 6 additions & 1 deletion lib/screens/CommentScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class CommentScreen extends StatefulWidget {
class _CommentScreenState extends State<CommentScreen> {
late int _currentPage = 1;
late Future<_CommentChildPage> _future = _loadPage();
late Key _key = UniqueKey();

Future<_CommentChildPage> _loadPage() async {
switch (widget.mainType) {
Expand All @@ -60,6 +61,7 @@ class _CommentScreenState extends State<CommentScreen> {

Widget _buildChildrenPager() {
return ContentBuilder(
key: _key,
future: _future,
onRefresh: _loadPage,
successBuilder:
Expand All @@ -78,7 +80,7 @@ class _CommentScreenState extends State<CommentScreen> {
}

@override
Widget build(BuildContext context){
Widget build(BuildContext context) {
return rightClickPop(
child: buildScreen(context),
context: context,
Expand Down Expand Up @@ -126,6 +128,7 @@ class _CommentScreenState extends State<CommentScreen> {
}
setState(() {
_future = _loadPage();
_key = UniqueKey();
widget.comment.commentsCount++;
});
} catch (e) {
Expand Down Expand Up @@ -163,6 +166,7 @@ class _CommentScreenState extends State<CommentScreen> {
setState(() {
_currentPage = page.page - 1;
_future = _loadPage();
_key = UniqueKey();
});
},
child: Container(
Expand All @@ -183,6 +187,7 @@ class _CommentScreenState extends State<CommentScreen> {
setState(() {
_currentPage = page.page + 1;
_future = _loadPage();
_key = UniqueKey();
});
},
child: Container(
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/DownloadImportScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class _DownloadImportScreenState extends State<DownloadImportScreen> {
}
},
child: Text(
'选择文件夹\n(导入里面所有的zip)' + (!isPro ? "\n(发电后使用)" : ""),
'选择文件夹\n(导入里面所有的zip/pki)' + (!isPro ? "\n(发电后使用)" : ""),
style: TextStyle(),
textAlign: TextAlign.center,
),
Expand Down
5 changes: 4 additions & 1 deletion lib/screens/GamesScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class GamesScreen extends StatefulWidget {
class _GamesScreenState extends State<GamesScreen> {
int _currentPage = 1;
late Future<GamePage> _future = _loadPage();
late Key _key = UniqueKey();

Future<GamePage> _loadPage() {
return method.games(_currentPage);
Expand All @@ -28,11 +29,12 @@ class _GamesScreenState extends State<GamesScreen> {
setState(() {
_currentPage = number;
_future = _loadPage();
_key = UniqueKey();
});
}

@override
Widget build(BuildContext context){
Widget build(BuildContext context) {
return rightClickPop(
child: buildScreen(context),
context: context,
Expand All @@ -46,6 +48,7 @@ class _GamesScreenState extends State<GamesScreen> {
title: const Text('游戏'),
),
body: ContentBuilder(
key: _key,
future: _future,
onRefresh: _loadPage,
successBuilder:
Expand Down
2 changes: 2 additions & 0 deletions lib/screens/MigrateScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class MigrateScreen extends StatefulWidget {
}

class _MigrateScreenState extends State<MigrateScreen> {
late final Key _key = UniqueKey();
late final Future _future = _load();
late String _current;
late List<String> paths;
Expand Down Expand Up @@ -47,6 +48,7 @@ class _MigrateScreenState extends State<MigrateScreen> {
title: const Text('数据迁移'),
),
body: ContentBuilder(
key: _key,
future: _future,
onRefresh: () async {},
successBuilder:
Expand Down
4 changes: 4 additions & 0 deletions lib/screens/PkzArchiveScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class _PkzArchiveScreenState extends State<PkzArchiveScreen> with RouteAware {
Map<String, PkzComicViewLog> _logMap = {};
late String _fileName;
late Future _future;
late Key _key;
late PkzArchive _info;
StreamSubscription<String?>? _linkSubscription;

Expand All @@ -43,6 +44,7 @@ class _PkzArchiveScreenState extends State<PkzArchiveScreen> with RouteAware {
}
_fileName = p.basename(widget.pkzPath);
_future = _load();
_key = UniqueKey();
super.initState();
}

Expand Down Expand Up @@ -99,10 +101,12 @@ class _PkzArchiveScreenState extends State<PkzArchiveScreen> with RouteAware {
title: Text(_fileName),
),
body: ContentBuilder(
key: _key,
future: _future,
onRefresh: () async {
setState(() {
_future = _load();
_key = UniqueKey();
});
},
successBuilder: (
Expand Down
10 changes: 10 additions & 0 deletions lib/screens/ProScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ class _ProScreenState extends State<ProScreen> {
),
),
const Divider(),
const Padding(
padding: EdgeInsets.all(20),
child: Text(
"发电小功能 \n"
" 多线程下载\n"
" 批量导入导出\n"
" 跳页",
),
),
const Divider(),
ListTile(
title: const Text("发电详情"),
subtitle: Text(
Expand Down
9 changes: 1 addition & 8 deletions lib/screens/RandomComicsScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ class RandomComicsScreen extends StatefulWidget {
}

class _RandomComicsScreenState extends State<RandomComicsScreen> {
Future<List<ComicSimple>> _future = method.randomComics();

Future<void> _reload() async {
setState(() {
_future = method.randomComics();
});
}

@override
Widget build(BuildContext context){
Expand All @@ -42,7 +35,7 @@ class _RandomComicsScreenState extends State<RandomComicsScreen> {
chooseLayoutActionButton(context),
],
),
body: ComicListBuilder(_future, _reload),
body: ComicListBuilder(method.randomComics),
);
}
}
12 changes: 2 additions & 10 deletions lib/screens/RankingsScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,9 @@ class _Leaderboard extends StatefulWidget {
}

class _LeaderboardState extends State<_Leaderboard> {
late Future<List<ComicSimple>> _future = method.leaderboard(widget.type);

Future<void> _reload() async {
setState(() {
_future = method.leaderboard(widget.type);
});
}

@override
Widget build(BuildContext context) {
return ComicListBuilder(_future, _reload);
return ComicListBuilder(() => method.leaderboard(widget.type));
}
}

Expand Down Expand Up @@ -205,7 +197,7 @@ class _KnightLeaderBoardState extends State<_KnightLeaderBoard> {
onTap: () {
navPushOrReplace(
context,
(context) => ComicsScreen(
(context) => ComicsScreen(
creatorId: e.id,
creatorName: e.name,
),
Expand Down
10 changes: 5 additions & 5 deletions lib/screens/RegisterScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,13 @@ class _RegisterScreenState extends State<RegisterScreen> {
children: [
const Divider(),
ListTile(
title: const Text("账号 (不一定是邮箱/登录使用)"),
title: const Text("账号 (小写字母+数字/登录使用)"),
subtitle: Text(_email == "" ? "未设置" : _email),
onTap: () async {
String? input = await displayTextInputDialog(
context,
src: _email,
title: '账号',
title: '账号 (小写字母+数字/登录使用)',
hint: '请输入账号',
);
if (input != null) {
Expand All @@ -148,13 +148,13 @@ class _RegisterScreenState extends State<RegisterScreen> {
},
),
ListTile(
title: const Text("密码 (8位以上)"),
title: const Text("密码 (大小写字母+数字/8位以上)"),
subtitle: Text(_password == "" ? "未设置" : '\u2022' * 10),
onTap: () async {
String? input = await displayTextInputDialog(
context,
src: _password,
title: '密码',
title: '密码 (大小写字母+数字/8位以上)',
hint: '请输入密码',
isPasswd: true,
);
Expand All @@ -166,7 +166,7 @@ class _RegisterScreenState extends State<RegisterScreen> {
},
),
ListTile(
title: const Text("昵称 (2-50字)"),
title: const Text("昵称 (可使用中文/2-50字)"),
subtitle: Text(_name == "" ? "未设置" : _name),
onTap: () async {
String? input = await displayTextInputDialog(
Expand Down
Loading

0 comments on commit 37a5523

Please sign in to comment.