Compare commits
4 Commits
v1.0.9.101
...
v1.0.10.10
Author | SHA1 | Date | |
---|---|---|---|
45bd4fc6d5 | |||
789d95e728 | |||
86c87dc1d5 | |||
3d6c270070 |
4
change_log/1.0.10.1016.md
Normal file
4
change_log/1.0.10.1016.md
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
## 1.0.9
|
||||||
|
|
||||||
|
### 修复
|
||||||
|
+ 长按倍速抬起后未恢复默认倍速
|
@ -5,6 +5,7 @@ import 'package:pilipala/common/constants.dart';
|
|||||||
import 'package:pilipala/common/widgets/badge.dart';
|
import 'package:pilipala/common/widgets/badge.dart';
|
||||||
import 'package:pilipala/common/widgets/stat/danmu.dart';
|
import 'package:pilipala/common/widgets/stat/danmu.dart';
|
||||||
import 'package:pilipala/common/widgets/stat/view.dart';
|
import 'package:pilipala/common/widgets/stat/view.dart';
|
||||||
|
import 'package:pilipala/http/dynamics.dart';
|
||||||
import 'package:pilipala/http/search.dart';
|
import 'package:pilipala/http/search.dart';
|
||||||
import 'package:pilipala/http/user.dart';
|
import 'package:pilipala/http/user.dart';
|
||||||
import 'package:pilipala/models/common/search_type.dart';
|
import 'package:pilipala/models/common/search_type.dart';
|
||||||
@ -27,6 +28,11 @@ class VideoCardV extends StatelessWidget {
|
|||||||
this.longPressEnd,
|
this.longPressEnd,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
|
bool isStringNumeric(String str) {
|
||||||
|
RegExp numericRegex = RegExp(r'^\d+$');
|
||||||
|
return numericRegex.hasMatch(str);
|
||||||
|
}
|
||||||
|
|
||||||
void onPushDetail(heroTag) async {
|
void onPushDetail(heroTag) async {
|
||||||
String goto = videoItem.goto;
|
String goto = videoItem.goto;
|
||||||
switch (goto) {
|
switch (goto) {
|
||||||
@ -64,11 +70,35 @@ class VideoCardV extends StatelessWidget {
|
|||||||
break;
|
break;
|
||||||
// 动态
|
// 动态
|
||||||
case 'picture':
|
case 'picture':
|
||||||
|
String dynamicType = 'picture';
|
||||||
|
String uri = videoItem.uri;
|
||||||
|
if (videoItem.uri.contains('bilibili://article/')) {
|
||||||
|
dynamicType = 'article';
|
||||||
|
RegExp regex = RegExp(r'\d+');
|
||||||
|
Match match = regex.firstMatch(videoItem.uri)!;
|
||||||
|
String matchedNumber = match.group(0)!;
|
||||||
|
videoItem.param = 'cv' + matchedNumber;
|
||||||
|
}
|
||||||
|
if (uri.startsWith('http')) {
|
||||||
|
String path = Uri.parse(uri).path;
|
||||||
|
if (isStringNumeric(path.split('/')[1])) {
|
||||||
|
// 请求接口
|
||||||
|
var res = await DynamicsHttp.dynamicDetail(id: path.split('/')[1]);
|
||||||
|
if (res['status']) {
|
||||||
|
Get.toNamed('/dynamicDetail', arguments: {
|
||||||
|
'item': res['data'],
|
||||||
|
'floor': 1,
|
||||||
|
'action': 'detail'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
Get.toNamed('/htmlRender', parameters: {
|
Get.toNamed('/htmlRender', parameters: {
|
||||||
'url': videoItem.uri,
|
'url': uri,
|
||||||
'title': videoItem.title,
|
'title': videoItem.title,
|
||||||
'id': videoItem.param.toString(),
|
'id': videoItem.param.toString(),
|
||||||
'dynamicType': 'picture'
|
'dynamicType': dynamicType
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -321,4 +321,10 @@ class Api {
|
|||||||
|
|
||||||
// 获取指定分组下的up
|
// 获取指定分组下的up
|
||||||
static const String followUpGroup = '/x/relation/tag';
|
static const String followUpGroup = '/x/relation/tag';
|
||||||
|
|
||||||
|
// 获取某个动态详情
|
||||||
|
// timezone_offset=-480
|
||||||
|
// id=849312409672744983
|
||||||
|
// features=itemOpusStyle
|
||||||
|
static const String dynamicDetail = '/x/polymer/web-dynamic/v1/detail';
|
||||||
}
|
}
|
||||||
|
@ -86,4 +86,35 @@ class DynamicsHttp {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
static Future dynamicDetail({
|
||||||
|
String? id,
|
||||||
|
}) async {
|
||||||
|
var res = await Request().get(Api.dynamicDetail, data: {
|
||||||
|
'timezone_offset': -480,
|
||||||
|
'id': id,
|
||||||
|
'features': 'itemOpusStyle',
|
||||||
|
});
|
||||||
|
if (res.data['code'] == 0) {
|
||||||
|
try {
|
||||||
|
return {
|
||||||
|
'status': true,
|
||||||
|
'data': DynamicItemModel.fromJson(res.data['data']['item']),
|
||||||
|
};
|
||||||
|
} catch (err) {
|
||||||
|
return {
|
||||||
|
'status': false,
|
||||||
|
'data': [],
|
||||||
|
'msg': err.toString(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
'status': false,
|
||||||
|
'data': [],
|
||||||
|
'msg': res.data['message'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,37 +9,57 @@ class HtmlHttp {
|
|||||||
"https://www.bilibili.com/opus/$id",
|
"https://www.bilibili.com/opus/$id",
|
||||||
extra: {'ua': 'pc'},
|
extra: {'ua': 'pc'},
|
||||||
);
|
);
|
||||||
Document rootTree = parse(response.data);
|
|
||||||
Element body = rootTree.body!;
|
if (response.data.contains('Redirecting to')) {
|
||||||
Element appDom = body.querySelector('#app')!;
|
RegExp regex = RegExp(r'//([\w\.]+)/(\w+)/(\w+)');
|
||||||
Element authorHeader = appDom.querySelector('.fixed-author-header')!;
|
Match match = regex.firstMatch(response.data)!;
|
||||||
// 头像
|
String matchedString = match.group(0)!;
|
||||||
String avatar = authorHeader.querySelector('img')!.attributes['src']!;
|
response = await Request().get(
|
||||||
avatar = 'https:${avatar.split('@')[0]}';
|
'https:$matchedString' + '/',
|
||||||
String uname =
|
extra: {'ua': 'pc'},
|
||||||
authorHeader.querySelector('.fixed-author-header__author__name')!.text;
|
);
|
||||||
// 动态详情
|
}
|
||||||
Element opusDetail = appDom.querySelector('.opus-detail')!;
|
try {
|
||||||
// 发布时间
|
Document rootTree = parse(response.data);
|
||||||
String updateTime =
|
// log(response.data.body.toString());
|
||||||
opusDetail.querySelector('.opus-module-author__pub__text')!.text;
|
Element body = rootTree.body!;
|
||||||
//
|
Element appDom = body.querySelector('#app')!;
|
||||||
String opusContent =
|
Element authorHeader = appDom.querySelector('.fixed-author-header')!;
|
||||||
opusDetail.querySelector('.opus-module-content')!.innerHtml;
|
// 头像
|
||||||
String commentId = opusDetail
|
String avatar = authorHeader.querySelector('img')!.attributes['src']!;
|
||||||
.querySelector('.bili-comment-container')!
|
avatar = 'https:${avatar.split('@')[0]}';
|
||||||
.className
|
String uname = authorHeader
|
||||||
.split(' ')[1]
|
.querySelector('.fixed-author-header__author__name')!
|
||||||
.split('-')[2];
|
.text;
|
||||||
// List imgList = opusDetail.querySelectorAll('bili-album__preview__picture__img');
|
|
||||||
return {
|
// 动态详情
|
||||||
'status': true,
|
Element opusDetail = appDom.querySelector('.opus-detail')!;
|
||||||
'avatar': avatar,
|
// 发布时间
|
||||||
'uname': uname,
|
String updateTime =
|
||||||
'updateTime': updateTime,
|
opusDetail.querySelector('.opus-module-author__pub__text')!.text;
|
||||||
'content': opusContent,
|
//
|
||||||
'commentId': int.parse(commentId)
|
String opusContent =
|
||||||
};
|
opusDetail.querySelector('.opus-module-content')!.innerHtml;
|
||||||
|
String test = opusDetail
|
||||||
|
.querySelector('.horizontal-scroll-album__pic__img')!
|
||||||
|
.innerHtml;
|
||||||
|
String commentId = opusDetail
|
||||||
|
.querySelector('.bili-comment-container')!
|
||||||
|
.className
|
||||||
|
.split(' ')[1]
|
||||||
|
.split('-')[2];
|
||||||
|
// List imgList = opusDetail.querySelectorAll('bili-album__preview__picture__img');
|
||||||
|
return {
|
||||||
|
'status': true,
|
||||||
|
'avatar': avatar,
|
||||||
|
'uname': uname,
|
||||||
|
'updateTime': updateTime,
|
||||||
|
'content': test + opusContent,
|
||||||
|
'commentId': int.parse(commentId)
|
||||||
|
};
|
||||||
|
} catch (err) {
|
||||||
|
print('err: $err');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// read
|
// read
|
||||||
|
@ -139,7 +139,7 @@ class _HtmlRenderPageState extends State<HtmlRenderPage>
|
|||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Get.toNamed('/webview', parameters: {
|
Get.toNamed('/webview', parameters: {
|
||||||
'url': 'https:$url',
|
'url': url.startsWith('http') ? url : 'https:$url',
|
||||||
'type': 'url',
|
'type': 'url',
|
||||||
'pageTitle': title,
|
'pageTitle': title,
|
||||||
});
|
});
|
||||||
|
@ -577,7 +577,8 @@ class PlPlayerController {
|
|||||||
duration: (currentOption.duration / speed) * playbackSpeed);
|
duration: (currentOption.duration / speed) * playbackSpeed);
|
||||||
danmakuController!.updateOption(updatedOption);
|
danmakuController!.updateOption(updatedOption);
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
_playbackSpeed.value = speed;
|
// fix 长按倍速后放开不恢复
|
||||||
|
// _playbackSpeed.value = speed;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 设置倍速
|
/// 设置倍速
|
||||||
|
@ -187,21 +187,15 @@ class Utils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 版本对比
|
// 版本对比
|
||||||
static bool needUpdate(String currentVersion, String remoteVersion) {
|
static bool needUpdate(localVersion, remoteVersion) {
|
||||||
List<int> current = currentVersion.split('.').map(int.parse).toList();
|
List<String> localVersionList = localVersion.split('.');
|
||||||
List<int> remote =
|
List<String> remoteVersionList = remoteVersion.split('v')[1].split('.');
|
||||||
remoteVersion.split('v')[1].split('.').map(int.parse).toList();
|
for (int i = 0; i < localVersionList.length; i++) {
|
||||||
|
int localVersion = int.parse(localVersionList[i]);
|
||||||
int maxLength =
|
int remoteVersion = int.parse(remoteVersionList[i]);
|
||||||
current.length > remote.length ? current.length : remote.length;
|
if (remoteVersion > localVersion) {
|
||||||
|
|
||||||
for (int i = 0; i < maxLength; i++) {
|
|
||||||
int currentValue = i < current.length ? current[i] : 0;
|
|
||||||
int remoteValue = i < remote.length ? remote[i] : 0;
|
|
||||||
|
|
||||||
if (currentValue < remoteValue) {
|
|
||||||
return true;
|
return true;
|
||||||
} else if (currentValue > remoteValue) {
|
} else if (remoteVersion < localVersion) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -212,7 +206,7 @@ class Utils {
|
|||||||
static Future<bool> checkUpdata() async {
|
static Future<bool> checkUpdata() async {
|
||||||
SmartDialog.dismiss();
|
SmartDialog.dismiss();
|
||||||
var currentInfo = await PackageInfo.fromPlatform();
|
var currentInfo = await PackageInfo.fromPlatform();
|
||||||
var result = await Request().get(Api.latestApp);
|
var result = await Request().get(Api.latestApp, extra: {'ua': 'mob'});
|
||||||
LatestDataModel data = LatestDataModel.fromJson(result.data);
|
LatestDataModel data = LatestDataModel.fromJson(result.data);
|
||||||
bool isUpdate = Utils.needUpdate(currentInfo.version, data.tagName!);
|
bool isUpdate = Utils.needUpdate(currentInfo.version, data.tagName!);
|
||||||
if (isUpdate) {
|
if (isUpdate) {
|
||||||
|
Reference in New Issue
Block a user