mod: 一些样式修改
This commit is contained in:
@ -138,7 +138,12 @@ class VideoHttp {
|
|||||||
'data': PlayUrlModel.fromJson(res.data['data'])
|
'data': PlayUrlModel.fromJson(res.data['data'])
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
return {'status': false, 'data': []};
|
return {
|
||||||
|
'status': false,
|
||||||
|
'data': [],
|
||||||
|
'code': res.data['code'],
|
||||||
|
'msg': res.data['message'],
|
||||||
|
};
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return {'status': false, 'data': [], 'msg': err};
|
return {'status': false, 'data': [], 'msg': err};
|
||||||
@ -155,13 +160,14 @@ class VideoHttp {
|
|||||||
Map errMap = {
|
Map errMap = {
|
||||||
-400: '请求错误',
|
-400: '请求错误',
|
||||||
-403: '权限不足',
|
-403: '权限不足',
|
||||||
-404: '无视频',
|
-404: '视频资源失效',
|
||||||
62002: '稿件不可见',
|
62002: '稿件不可见',
|
||||||
62004: '稿件审核中',
|
62004: '稿件审核中',
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
'status': false,
|
'status': false,
|
||||||
'data': null,
|
'data': null,
|
||||||
|
'code': result.code,
|
||||||
'msg': errMap[result.code] ?? '请求异常',
|
'msg': errMap[result.code] ?? '请求异常',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -130,7 +130,6 @@ class LevelInfo {
|
|||||||
currentLevel = json['current_level'];
|
currentLevel = json['current_level'];
|
||||||
currentMin = json['current_min'];
|
currentMin = json['current_min'];
|
||||||
currentExp = json['current_exp'];
|
currentExp = json['current_exp'];
|
||||||
// nextExp = json['next_exp'];
|
|
||||||
nextExp =
|
nextExp =
|
||||||
json['current_level'] == 6 ? json['current_exp'] : json['next_exp'];
|
json['current_level'] == 6 ? json['current_exp'] : json['next_exp'];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -50,7 +50,11 @@ class BangumiController extends GetxController {
|
|||||||
|
|
||||||
// 我的订阅
|
// 我的订阅
|
||||||
Future queryBangumiFollow() async {
|
Future queryBangumiFollow() async {
|
||||||
var result = await BangumiHttp.bangumiFollow(mid: 17340771);
|
userInfo = userInfo ?? userInfoCache.get('userInfoCache');
|
||||||
|
if (userInfo == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var result = await BangumiHttp.bangumiFollow(mid: userInfo.mid);
|
||||||
if (result['status']) {
|
if (result['status']) {
|
||||||
bangumiFollowList.value = result['data'].list;
|
bangumiFollowList.value = result['data'].list;
|
||||||
} else {}
|
} else {}
|
||||||
|
|||||||
@ -23,6 +23,7 @@ class _BangumiPageState extends State<BangumiPage>
|
|||||||
with AutomaticKeepAliveClientMixin {
|
with AutomaticKeepAliveClientMixin {
|
||||||
final BangumiController _bangumidController = Get.put(BangumiController());
|
final BangumiController _bangumidController = Get.put(BangumiController());
|
||||||
late Future? _futureBuilderFuture;
|
late Future? _futureBuilderFuture;
|
||||||
|
late Future? _futureBuilderFutureFollow;
|
||||||
late ScrollController scrollController;
|
late ScrollController scrollController;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -35,6 +36,7 @@ class _BangumiPageState extends State<BangumiPage>
|
|||||||
StreamController<bool> mainStream =
|
StreamController<bool> mainStream =
|
||||||
Get.find<MainController>().bottomBarStream;
|
Get.find<MainController>().bottomBarStream;
|
||||||
_futureBuilderFuture = _bangumidController.queryBangumiListFeed();
|
_futureBuilderFuture = _bangumidController.queryBangumiListFeed();
|
||||||
|
_futureBuilderFutureFollow = _bangumidController.queryBangumiFollow();
|
||||||
scrollController.addListener(
|
scrollController.addListener(
|
||||||
() async {
|
() async {
|
||||||
if (scrollController.position.pixels >=
|
if (scrollController.position.pixels >=
|
||||||
@ -89,43 +91,61 @@ class _BangumiPageState extends State<BangumiPage>
|
|||||||
'最近追番',
|
'最近追番',
|
||||||
style: Theme.of(context).textTheme.titleMedium,
|
style: Theme.of(context).textTheme.titleMedium,
|
||||||
),
|
),
|
||||||
|
IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
setState(() {
|
||||||
|
_futureBuilderFutureFollow =
|
||||||
|
_bangumidController.queryBangumiFollow();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.refresh,
|
||||||
|
size: 20,
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 258,
|
height: 258,
|
||||||
child: FutureBuilder(
|
child: FutureBuilder(
|
||||||
future: _bangumidController.queryBangumiFollow(),
|
future: _futureBuilderFutureFollow,
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
if (snapshot.connectionState ==
|
if (snapshot.connectionState ==
|
||||||
ConnectionState.done) {
|
ConnectionState.done) {
|
||||||
Map data = snapshot.data as Map;
|
Map data = snapshot.data as Map;
|
||||||
|
List list = _bangumidController.bangumiFollowList;
|
||||||
if (data['status']) {
|
if (data['status']) {
|
||||||
return Obx(
|
return Obx(
|
||||||
() => ListView.builder(
|
() => list.isNotEmpty
|
||||||
scrollDirection: Axis.horizontal,
|
? ListView.builder(
|
||||||
itemCount: _bangumidController
|
scrollDirection: Axis.horizontal,
|
||||||
.bangumiFollowList.length,
|
itemCount: list.length,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
return Container(
|
return Container(
|
||||||
width: Get.size.width / 3,
|
width: Get.size.width / 3,
|
||||||
height: 254,
|
height: 254,
|
||||||
margin: EdgeInsets.only(
|
margin: EdgeInsets.only(
|
||||||
left: StyleString.safeSpace,
|
left: StyleString.safeSpace,
|
||||||
right: index ==
|
right: index ==
|
||||||
_bangumidController
|
_bangumidController
|
||||||
.bangumiFollowList
|
.bangumiFollowList
|
||||||
.length -
|
.length -
|
||||||
1
|
1
|
||||||
? StyleString.safeSpace
|
? StyleString.safeSpace
|
||||||
: 0),
|
: 0),
|
||||||
child: BangumiCardV(
|
child: BangumiCardV(
|
||||||
bangumiItem: _bangumidController
|
bangumiItem: _bangumidController
|
||||||
.bangumiFollowList[index],
|
.bangumiFollowList[index],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
: const SizedBox(
|
||||||
|
child: Center(
|
||||||
|
child: Text('还没有追番'),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return const SizedBox();
|
return const SizedBox();
|
||||||
|
|||||||
@ -61,6 +61,7 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
|||||||
SliverAppBar(
|
SliverAppBar(
|
||||||
expandedHeight: 260 - MediaQuery.of(context).padding.top,
|
expandedHeight: 260 - MediaQuery.of(context).padding.top,
|
||||||
pinned: true,
|
pinned: true,
|
||||||
|
titleSpacing: 0,
|
||||||
title: StreamBuilder(
|
title: StreamBuilder(
|
||||||
stream: titleStreamC.stream,
|
stream: titleStreamC.stream,
|
||||||
initialData: false,
|
initialData: false,
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import 'package:get/get.dart';
|
|||||||
import 'package:pilipala/common/constants.dart';
|
import 'package:pilipala/common/constants.dart';
|
||||||
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||||
import 'package:pilipala/models/common/theme_type.dart';
|
import 'package:pilipala/models/common/theme_type.dart';
|
||||||
|
import 'package:pilipala/models/user/info.dart';
|
||||||
import 'package:pilipala/utils/event_bus.dart';
|
import 'package:pilipala/utils/event_bus.dart';
|
||||||
import 'controller.dart';
|
import 'controller.dart';
|
||||||
|
|
||||||
@ -160,10 +161,11 @@ class _MinePageState extends State<MinePage> {
|
|||||||
]))
|
]))
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 5),
|
const SizedBox(height: 25),
|
||||||
if (_mineController.userInfo.value.levelInfo != null) ...[
|
if (_mineController.userInfo.value.levelInfo != null) ...[
|
||||||
LayoutBuilder(
|
LayoutBuilder(
|
||||||
builder: (context, BoxConstraints box) {
|
builder: (context, BoxConstraints box) {
|
||||||
|
LevelInfo levelInfo = _mineController.userInfo.value.levelInfo;
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
width: box.maxWidth,
|
width: box.maxWidth,
|
||||||
height: 24,
|
height: 24,
|
||||||
@ -172,48 +174,27 @@ class _MinePageState extends State<MinePage> {
|
|||||||
Positioned(
|
Positioned(
|
||||||
top: 0,
|
top: 0,
|
||||||
right: 0,
|
right: 0,
|
||||||
child: SizedBox(
|
bottom: 0,
|
||||||
height: 22,
|
child: Container(
|
||||||
|
color: Theme.of(context).colorScheme.primary,
|
||||||
|
height: 24,
|
||||||
|
constraints:
|
||||||
|
const BoxConstraints(minWidth: 100), // 设置最小宽度为100
|
||||||
width: box.maxWidth *
|
width: box.maxWidth *
|
||||||
(1 -
|
(1 - (levelInfo.currentExp! / levelInfo.nextExp!)),
|
||||||
(_mineController
|
|
||||||
.userInfo.value.levelInfo!.currentExp! /
|
|
||||||
_mineController
|
|
||||||
.userInfo.value.levelInfo!.nextExp!)),
|
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
(_mineController
|
'${levelInfo.currentExp!}/${levelInfo.nextExp!}',
|
||||||
.userInfo.value.levelInfo!.nextExp! -
|
|
||||||
_mineController
|
|
||||||
.userInfo.value.levelInfo!.currentExp!)
|
|
||||||
.toString(),
|
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Theme.of(context).colorScheme.primary,
|
color: Theme.of(context).colorScheme.onPrimary,
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
LayoutBuilder(
|
|
||||||
builder: (context, BoxConstraints box) {
|
|
||||||
return Container(
|
|
||||||
width: box.maxWidth,
|
|
||||||
height: 1,
|
|
||||||
clipBehavior: Clip.hardEdge,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(4),
|
|
||||||
color: Theme.of(context).colorScheme.onInverseSurface,
|
|
||||||
),
|
|
||||||
child: Stack(
|
|
||||||
children: [
|
|
||||||
Positioned(
|
Positioned(
|
||||||
top: 0,
|
top: 23,
|
||||||
left: 0,
|
left: 0,
|
||||||
bottom: 0,
|
bottom: 0,
|
||||||
child: Container(
|
child: Container(
|
||||||
@ -224,7 +205,6 @@ class _MinePageState extends State<MinePage> {
|
|||||||
.userInfo.value.levelInfo!.nextExp!),
|
.userInfo.value.levelInfo!.nextExp!),
|
||||||
height: 1,
|
height: 1,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(4),
|
|
||||||
color: Theme.of(context).colorScheme.primary,
|
color: Theme.of(context).colorScheme.primary,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -234,6 +214,36 @@ class _MinePageState extends State<MinePage> {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
// LayoutBuilder(
|
||||||
|
// builder: (context, BoxConstraints box) {
|
||||||
|
// return Container(
|
||||||
|
// width: box.maxWidth,
|
||||||
|
// height: 1,
|
||||||
|
// color: Theme.of(context).colorScheme.onInverseSurface,
|
||||||
|
// child: Stack(
|
||||||
|
// children: [
|
||||||
|
// Positioned(
|
||||||
|
// top: 0,
|
||||||
|
// left: 0,
|
||||||
|
// bottom: 0,
|
||||||
|
// child: Container(
|
||||||
|
// width: box.maxWidth *
|
||||||
|
// (_mineController
|
||||||
|
// .userInfo.value.levelInfo!.currentExp! /
|
||||||
|
// _mineController
|
||||||
|
// .userInfo.value.levelInfo!.nextExp!),
|
||||||
|
// height: 1,
|
||||||
|
// decoration: BoxDecoration(
|
||||||
|
// borderRadius: BorderRadius.circular(4),
|
||||||
|
// color: Theme.of(context).colorScheme.primary,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
// ),
|
||||||
],
|
],
|
||||||
const SizedBox(height: 30),
|
const SizedBox(height: 30),
|
||||||
Padding(
|
Padding(
|
||||||
|
|||||||
@ -34,9 +34,6 @@ class _ImagePreviewState extends State<ImagePreview>
|
|||||||
super.initState();
|
super.initState();
|
||||||
// animationController = AnimationController(
|
// animationController = AnimationController(
|
||||||
// vsync: this, duration: const Duration(milliseconds: 400));
|
// vsync: this, duration: const Duration(milliseconds: 400));
|
||||||
SystemChrome.setEnabledSystemUIMode(
|
|
||||||
SystemUiMode.immersiveSticky,
|
|
||||||
);
|
|
||||||
_doubleClickAnimationController = AnimationController(
|
_doubleClickAnimationController = AnimationController(
|
||||||
duration: const Duration(milliseconds: 250), vsync: this);
|
duration: const Duration(milliseconds: 250), vsync: this);
|
||||||
}
|
}
|
||||||
@ -96,7 +93,6 @@ class _ImagePreviewState extends State<ImagePreview>
|
|||||||
// animationController.dispose();
|
// animationController.dispose();
|
||||||
_doubleClickAnimationController.dispose();
|
_doubleClickAnimationController.dispose();
|
||||||
clearGestureDetailsCache();
|
clearGestureDetailsCache();
|
||||||
exitFullScreen();
|
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,7 +104,7 @@ class _ImagePreviewState extends State<ImagePreview>
|
|||||||
primary: false,
|
primary: false,
|
||||||
toolbarHeight: 0,
|
toolbarHeight: 0,
|
||||||
backgroundColor: Colors.black,
|
backgroundColor: Colors.black,
|
||||||
systemOverlayStyle: SystemUiOverlayStyle.light,
|
systemOverlayStyle: SystemUiOverlayStyle.dark,
|
||||||
),
|
),
|
||||||
body: Stack(
|
body: Stack(
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
@ -274,6 +274,9 @@ class VideoDetailController extends GetxController
|
|||||||
// duration: data.timeLength ?? 0,
|
// duration: data.timeLength ?? 0,
|
||||||
// );
|
// );
|
||||||
} else {
|
} else {
|
||||||
|
if (result['code'] == -404) {
|
||||||
|
isShowCover.value = false;
|
||||||
|
}
|
||||||
SmartDialog.showToast(result['msg'].toString());
|
SmartDialog.showToast(result['msg'].toString());
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@ -30,9 +30,6 @@ class VideoIntroController extends GetxController {
|
|||||||
// 视频详情 请求返回
|
// 视频详情 请求返回
|
||||||
Rx<VideoDetailData> videoDetail = VideoDetailData().obs;
|
Rx<VideoDetailData> videoDetail = VideoDetailData().obs;
|
||||||
|
|
||||||
// 请求返回的信息
|
|
||||||
String responseMsg = '请求异常';
|
|
||||||
|
|
||||||
// up主粉丝数
|
// up主粉丝数
|
||||||
Map userStat = {'follower': '-'};
|
Map userStat = {'follower': '-'};
|
||||||
|
|
||||||
@ -79,7 +76,7 @@ class VideoIntroController extends GetxController {
|
|||||||
videoItem!['owner'] = args.owner;
|
videoItem!['owner'] = args.owner;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
userLogin = userInfo == null;
|
userLogin = userInfo != null;
|
||||||
lastPlayCid.value = int.parse(Get.parameters['cid']!);
|
lastPlayCid.value = int.parse(Get.parameters['cid']!);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,8 +93,6 @@ class VideoIntroController extends GetxController {
|
|||||||
.value = ['简介', '评论 ${result['data']!.stat!.reply}'];
|
.value = ['简介', '评论 ${result['data']!.stat!.reply}'];
|
||||||
// 获取到粉丝数再返回
|
// 获取到粉丝数再返回
|
||||||
await queryUserStat();
|
await queryUserStat();
|
||||||
} else {
|
|
||||||
responseMsg = result['msg'];
|
|
||||||
}
|
}
|
||||||
if (userLogin) {
|
if (userLogin) {
|
||||||
// 获取点赞状态
|
// 获取点赞状态
|
||||||
@ -329,6 +324,9 @@ class VideoIntroController extends GetxController {
|
|||||||
|
|
||||||
// 查询关注状态
|
// 查询关注状态
|
||||||
Future queryFollowStatus() async {
|
Future queryFollowStatus() async {
|
||||||
|
if (videoDetail.value.owner == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
var result = await VideoHttp.hasFollow(mid: videoDetail.value.owner!.mid!);
|
var result = await VideoHttp.hasFollow(mid: videoDetail.value.owner!.mid!);
|
||||||
if (result['status']) {
|
if (result['status']) {
|
||||||
followStatus.value = result['data'];
|
followStatus.value = result['data'];
|
||||||
|
|||||||
@ -71,6 +71,10 @@ class _VideoIntroPanelState extends State<VideoIntroPanel>
|
|||||||
// 请求错误
|
// 请求错误
|
||||||
return HttpError(
|
return HttpError(
|
||||||
errMsg: snapshot.data['msg'],
|
errMsg: snapshot.data['msg'],
|
||||||
|
btnText: snapshot.data['code'] == -404 ||
|
||||||
|
snapshot.data['code'] == 62002
|
||||||
|
? '返回上一页'
|
||||||
|
: null,
|
||||||
fn: () => Get.back(),
|
fn: () => Get.back(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user