Merge branch 'main' into fix
This commit is contained in:
@ -1,5 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
|
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||||
import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';
|
import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';
|
||||||
import '../models/common/video_episode_type.dart';
|
import '../models/common/video_episode_type.dart';
|
||||||
|
|
||||||
@ -44,25 +45,38 @@ class EpisodeBottomSheet {
|
|||||||
title = '第${episode.title}话 ${episode.longTitle!}';
|
title = '第${episode.title}话 ${episode.longTitle!}';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return ListTile(
|
return InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
SmartDialog.showToast('切换至「$title」');
|
SmartDialog.showToast('切换至「$title」');
|
||||||
changeFucCall.call(episode, index);
|
changeFucCall.call(episode, index);
|
||||||
},
|
},
|
||||||
dense: false,
|
child: Padding(
|
||||||
leading: isCurrentIndex
|
padding: const EdgeInsets.only(left: 14, right: 14, top: 8, bottom: 8),
|
||||||
? Image.asset(
|
child: isFullScreen
|
||||||
'assets/images/live.gif',
|
? Text(
|
||||||
color: primary,
|
title,
|
||||||
height: 12,
|
maxLines: 1,
|
||||||
)
|
style: TextStyle(
|
||||||
: null,
|
fontSize: 14,
|
||||||
title: Text(
|
color: isCurrentIndex ? primary : onSurface,
|
||||||
title,
|
),
|
||||||
style: TextStyle(
|
)
|
||||||
fontSize: 14,
|
: Row(
|
||||||
color: isCurrentIndex ? primary : onSurface,
|
children: [
|
||||||
),
|
NetworkImgLayer(width: 130, height: 75, src: episode.cover),
|
||||||
|
const SizedBox(width: 10),
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
title,
|
||||||
|
maxLines: 2,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
color: isCurrentIndex ? primary : onSurface,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,6 +23,7 @@ class VideoCardH extends StatelessWidget {
|
|||||||
this.showView = true,
|
this.showView = true,
|
||||||
this.showDanmaku = true,
|
this.showDanmaku = true,
|
||||||
this.showPubdate = false,
|
this.showPubdate = false,
|
||||||
|
this.showCharge = false,
|
||||||
});
|
});
|
||||||
// ignore: prefer_typing_uninitialized_variables
|
// ignore: prefer_typing_uninitialized_variables
|
||||||
final videoItem;
|
final videoItem;
|
||||||
@ -33,6 +34,7 @@ class VideoCardH extends StatelessWidget {
|
|||||||
final bool showView;
|
final bool showView;
|
||||||
final bool showDanmaku;
|
final bool showDanmaku;
|
||||||
final bool showPubdate;
|
final bool showPubdate;
|
||||||
|
final bool showCharge;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -121,6 +123,13 @@ class VideoCardH extends StatelessWidget {
|
|||||||
// videoItem.rcmdReason.content != '')
|
// videoItem.rcmdReason.content != '')
|
||||||
// pBadge(videoItem.rcmdReason.content, context,
|
// pBadge(videoItem.rcmdReason.content, context,
|
||||||
// 6.0, 6.0, null, null),
|
// 6.0, 6.0, null, null),
|
||||||
|
if (showCharge && videoItem?.isChargingSrc)
|
||||||
|
const PBadge(
|
||||||
|
text: '充电专属',
|
||||||
|
right: 6.0,
|
||||||
|
top: 6.0,
|
||||||
|
type: 'primary',
|
||||||
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@ -22,19 +22,14 @@ class ReplyHttp {
|
|||||||
return {
|
return {
|
||||||
'status': true,
|
'status': true,
|
||||||
'data': ReplyData.fromJson(res.data['data']),
|
'data': ReplyData.fromJson(res.data['data']),
|
||||||
|
'code': 200,
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
Map errMap = {
|
|
||||||
-400: '请求错误',
|
|
||||||
-404: '无此项',
|
|
||||||
12002: '当前页面评论功能已关闭',
|
|
||||||
12009: '评论主体的type不合法',
|
|
||||||
12061: 'UP主已关闭评论区',
|
|
||||||
};
|
|
||||||
return {
|
return {
|
||||||
'status': false,
|
'status': false,
|
||||||
'date': [],
|
'date': [],
|
||||||
'msg': errMap[res.data['code']] ?? res.data['message'],
|
'code': res.data['code'],
|
||||||
|
'msg': res.data['message'],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,7 +35,7 @@ class VideoHttp {
|
|||||||
Api.recommendListWeb,
|
Api.recommendListWeb,
|
||||||
data: {
|
data: {
|
||||||
'version': 1,
|
'version': 1,
|
||||||
'feed_version': 'V8',
|
'feed_version': 'V3',
|
||||||
'homepage_ver': 1,
|
'homepage_ver': 1,
|
||||||
'ps': ps,
|
'ps': ps,
|
||||||
'fresh_idx': freshIdx,
|
'fresh_idx': freshIdx,
|
||||||
|
|||||||
@ -23,6 +23,7 @@ class HotVideoItemModel {
|
|||||||
this.dimension,
|
this.dimension,
|
||||||
this.shortLinkV2,
|
this.shortLinkV2,
|
||||||
this.firstFrame,
|
this.firstFrame,
|
||||||
|
this.cover,
|
||||||
this.pubLocation,
|
this.pubLocation,
|
||||||
this.seasontype,
|
this.seasontype,
|
||||||
this.isOgv,
|
this.isOgv,
|
||||||
@ -50,6 +51,7 @@ class HotVideoItemModel {
|
|||||||
Dimension? dimension;
|
Dimension? dimension;
|
||||||
String? shortLinkV2;
|
String? shortLinkV2;
|
||||||
String? firstFrame;
|
String? firstFrame;
|
||||||
|
String? cover;
|
||||||
String? pubLocation;
|
String? pubLocation;
|
||||||
int? seasontype;
|
int? seasontype;
|
||||||
bool? isOgv;
|
bool? isOgv;
|
||||||
@ -77,6 +79,7 @@ class HotVideoItemModel {
|
|||||||
dimension = Dimension.fromMap(json['dimension']);
|
dimension = Dimension.fromMap(json['dimension']);
|
||||||
shortLinkV2 = json["short_link_v2"];
|
shortLinkV2 = json["short_link_v2"];
|
||||||
firstFrame = json["first_frame"];
|
firstFrame = json["first_frame"];
|
||||||
|
cover = json["first_frame"];
|
||||||
pubLocation = json["pub_location"];
|
pubLocation = json["pub_location"];
|
||||||
seasontype = json["seasontype"];
|
seasontype = json["seasontype"];
|
||||||
isOgv = json["isOgv"];
|
isOgv = json["isOgv"];
|
||||||
|
|||||||
@ -382,6 +382,7 @@ class Part {
|
|||||||
String? weblink;
|
String? weblink;
|
||||||
Dimension? dimension;
|
Dimension? dimension;
|
||||||
String? firstFrame;
|
String? firstFrame;
|
||||||
|
String? cover;
|
||||||
|
|
||||||
Part({
|
Part({
|
||||||
this.cid,
|
this.cid,
|
||||||
@ -393,6 +394,7 @@ class Part {
|
|||||||
this.weblink,
|
this.weblink,
|
||||||
this.dimension,
|
this.dimension,
|
||||||
this.firstFrame,
|
this.firstFrame,
|
||||||
|
this.cover,
|
||||||
});
|
});
|
||||||
|
|
||||||
fromRawJson(String str) => Part.fromJson(json.decode(str));
|
fromRawJson(String str) => Part.fromJson(json.decode(str));
|
||||||
@ -411,6 +413,7 @@ class Part {
|
|||||||
? null
|
? null
|
||||||
: Dimension.fromJson(json["dimension"]);
|
: Dimension.fromJson(json["dimension"]);
|
||||||
firstFrame = json["first_frame"];
|
firstFrame = json["first_frame"];
|
||||||
|
cover = json["first_frame"];
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
@ -634,6 +637,7 @@ class EpisodeItem {
|
|||||||
this.attribute,
|
this.attribute,
|
||||||
this.page,
|
this.page,
|
||||||
this.bvid,
|
this.bvid,
|
||||||
|
this.cover,
|
||||||
});
|
});
|
||||||
int? seasonId;
|
int? seasonId;
|
||||||
int? sectionId;
|
int? sectionId;
|
||||||
@ -644,6 +648,7 @@ class EpisodeItem {
|
|||||||
int? attribute;
|
int? attribute;
|
||||||
Part? page;
|
Part? page;
|
||||||
String? bvid;
|
String? bvid;
|
||||||
|
String? cover;
|
||||||
|
|
||||||
EpisodeItem.fromJson(Map<String, dynamic> json) {
|
EpisodeItem.fromJson(Map<String, dynamic> json) {
|
||||||
seasonId = json['season_id'];
|
seasonId = json['season_id'];
|
||||||
@ -655,6 +660,7 @@ class EpisodeItem {
|
|||||||
attribute = json['attribute'];
|
attribute = json['attribute'];
|
||||||
page = Part.fromJson(json['page']);
|
page = Part.fromJson(json['page']);
|
||||||
bvid = json['bvid'];
|
bvid = json['bvid'];
|
||||||
|
cover = json['arc']['pic'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -131,51 +131,37 @@ class BangumiIntroController extends GetxController {
|
|||||||
builder: (context) {
|
builder: (context) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
title: const Text('选择投币个数'),
|
title: const Text('选择投币个数'),
|
||||||
contentPadding: const EdgeInsets.fromLTRB(0, 12, 0, 12),
|
contentPadding: const EdgeInsets.fromLTRB(0, 12, 0, 24),
|
||||||
content: StatefulBuilder(builder: (context, StateSetter setState) {
|
content: StatefulBuilder(builder: (context, StateSetter setState) {
|
||||||
return Column(
|
return Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [1, 2]
|
||||||
RadioListTile(
|
.map(
|
||||||
value: 1,
|
(e) => RadioListTile(
|
||||||
title: const Text('1枚'),
|
value: e,
|
||||||
groupValue: _tempThemeValue,
|
title: Text('$e枚'),
|
||||||
onChanged: (value) {
|
groupValue: _tempThemeValue,
|
||||||
_tempThemeValue = value!;
|
onChanged: (value) async {
|
||||||
Get.appUpdate();
|
_tempThemeValue = value!;
|
||||||
},
|
setState(() {});
|
||||||
),
|
var res = await VideoHttp.coinVideo(
|
||||||
RadioListTile(
|
bvid: bvid, multiply: _tempThemeValue);
|
||||||
value: 2,
|
if (res['status']) {
|
||||||
title: const Text('2枚'),
|
SmartDialog.showToast('投币成功 👏');
|
||||||
groupValue: _tempThemeValue,
|
hasCoin.value = true;
|
||||||
onChanged: (value) {
|
bangumiDetail.value.stat!['coins'] =
|
||||||
_tempThemeValue = value!;
|
bangumiDetail.value.stat!['coins'] +
|
||||||
Get.appUpdate();
|
_tempThemeValue;
|
||||||
},
|
} else {
|
||||||
),
|
SmartDialog.showToast(res['msg']);
|
||||||
],
|
}
|
||||||
|
Get.back();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.toList(),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
actions: [
|
|
||||||
TextButton(onPressed: () => Get.back(), child: const Text('取消')),
|
|
||||||
TextButton(
|
|
||||||
onPressed: () async {
|
|
||||||
var res = await VideoHttp.coinVideo(
|
|
||||||
bvid: bvid, multiply: _tempThemeValue);
|
|
||||||
if (res['status']) {
|
|
||||||
SmartDialog.showToast('投币成功 👏');
|
|
||||||
hasCoin.value = true;
|
|
||||||
bangumiDetail.value.stat!['coins'] =
|
|
||||||
bangumiDetail.value.stat!['coins'] + _tempThemeValue;
|
|
||||||
} else {
|
|
||||||
SmartDialog.showToast(res['msg']);
|
|
||||||
}
|
|
||||||
Get.back();
|
|
||||||
},
|
|
||||||
child: const Text('确定'),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -229,7 +215,7 @@ class BangumiIntroController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 修改分P或番剧分集
|
// 修改分P或番剧分集
|
||||||
Future changeSeasonOrbangu(bvid, cid, aid) async {
|
Future changeSeasonOrbangu(bvid, cid, aid, cover) async {
|
||||||
// 重新获取视频资源
|
// 重新获取视频资源
|
||||||
VideoDetailController videoDetailCtr =
|
VideoDetailController videoDetailCtr =
|
||||||
Get.find<VideoDetailController>(tag: Get.arguments['heroTag']);
|
Get.find<VideoDetailController>(tag: Get.arguments['heroTag']);
|
||||||
@ -237,6 +223,7 @@ class BangumiIntroController extends GetxController {
|
|||||||
videoDetailCtr.cid.value = cid;
|
videoDetailCtr.cid.value = cid;
|
||||||
videoDetailCtr.danmakuCid.value = cid;
|
videoDetailCtr.danmakuCid.value = cid;
|
||||||
videoDetailCtr.oid.value = aid;
|
videoDetailCtr.oid.value = aid;
|
||||||
|
videoDetailCtr.cover.value = cover;
|
||||||
videoDetailCtr.queryVideoUrl();
|
videoDetailCtr.queryVideoUrl();
|
||||||
// 重新请求评论
|
// 重新请求评论
|
||||||
try {
|
try {
|
||||||
@ -295,7 +282,8 @@ class BangumiIntroController extends GetxController {
|
|||||||
int cid = episodes[nextIndex].cid!;
|
int cid = episodes[nextIndex].cid!;
|
||||||
String bvid = episodes[nextIndex].bvid!;
|
String bvid = episodes[nextIndex].bvid!;
|
||||||
int aid = episodes[nextIndex].aid!;
|
int aid = episodes[nextIndex].aid!;
|
||||||
changeSeasonOrbangu(bvid, cid, aid);
|
String cover = episodes[nextIndex].cover!;
|
||||||
|
changeSeasonOrbangu(bvid, cid, aid, cover);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 播放器底栏 选集 回调
|
// 播放器底栏 选集 回调
|
||||||
@ -316,7 +304,7 @@ class BangumiIntroController extends GetxController {
|
|||||||
sheetHeight: Get.size.height,
|
sheetHeight: Get.size.height,
|
||||||
isFullScreen: true,
|
isFullScreen: true,
|
||||||
changeFucCall: (item, index) {
|
changeFucCall: (item, index) {
|
||||||
changeSeasonOrbangu(item.bvid, item.cid, item.aid);
|
changeSeasonOrbangu(item.bvid, item.cid, item.aid, item.cover);
|
||||||
SmartDialog.dismiss();
|
SmartDialog.dismiss();
|
||||||
},
|
},
|
||||||
).buildShowContent(Get.context!),
|
).buildShowContent(Get.context!),
|
||||||
|
|||||||
@ -322,8 +322,8 @@ class _BangumiInfoState extends State<BangumiInfo> {
|
|||||||
pages: widget.bangumiDetail!.episodes!,
|
pages: widget.bangumiDetail!.episodes!,
|
||||||
cid: cid! ?? widget.bangumiDetail!.episodes!.first.cid!,
|
cid: cid! ?? widget.bangumiDetail!.episodes!.first.cid!,
|
||||||
sheetHeight: sheetHeight,
|
sheetHeight: sheetHeight,
|
||||||
changeFuc: (bvid, cid, aid) =>
|
changeFuc: (bvid, cid, aid, cover) => bangumiIntroController
|
||||||
bangumiIntroController.changeSeasonOrbangu(bvid, cid, aid),
|
.changeSeasonOrbangu(bvid, cid, aid, cover),
|
||||||
bangumiDetail: bangumiIntroController.bangumiDetail.value,
|
bangumiDetail: bangumiIntroController.bangumiDetail.value,
|
||||||
bangumiIntroController: bangumiIntroController,
|
bangumiIntroController: bangumiIntroController,
|
||||||
)
|
)
|
||||||
|
|||||||
@ -84,11 +84,12 @@ class _BangumiPanelState extends State<BangumiPanel> {
|
|||||||
item.bvid,
|
item.bvid,
|
||||||
item.cid,
|
item.cid,
|
||||||
item.aid,
|
item.aid,
|
||||||
|
item.cover,
|
||||||
);
|
);
|
||||||
if (_bottomSheetController != null) {
|
if (_bottomSheetController != null) {
|
||||||
_bottomSheetController?.close();
|
_bottomSheetController?.close();
|
||||||
}
|
}
|
||||||
currentIndex = i;
|
currentIndex.value = i;
|
||||||
scrollToIndex();
|
scrollToIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -25,6 +25,7 @@ class DynamicDetailController extends GetxController {
|
|||||||
RxString sortTypeTitle = ReplySortType.time.titles.obs;
|
RxString sortTypeTitle = ReplySortType.time.titles.obs;
|
||||||
RxString sortTypeLabel = ReplySortType.time.labels.obs;
|
RxString sortTypeLabel = ReplySortType.time.labels.obs;
|
||||||
Box setting = GStrorage.setting;
|
Box setting = GStrorage.setting;
|
||||||
|
RxInt replyReqCode = 200.obs;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
@ -84,6 +85,7 @@ class DynamicDetailController extends GetxController {
|
|||||||
replyList.addAll(replies);
|
replyList.addAll(replies);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
replyReqCode.value = res['code'];
|
||||||
isLoadingMore = false;
|
isLoadingMore = false;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -106,7 +106,7 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 查看二级评论
|
// 查看二级评论
|
||||||
void replyReply(replyItem) {
|
void replyReply(replyItem, currentReply) {
|
||||||
int oid = replyItem.oid;
|
int oid = replyItem.oid;
|
||||||
int rpid = replyItem.rpid!;
|
int rpid = replyItem.rpid!;
|
||||||
Get.to(
|
Get.to(
|
||||||
@ -324,8 +324,8 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
|||||||
replyItem: replyList[index],
|
replyItem: replyList[index],
|
||||||
showReplyRow: true,
|
showReplyRow: true,
|
||||||
replyLevel: '1',
|
replyLevel: '1',
|
||||||
replyReply: (replyItem) =>
|
replyReply: (replyItem, currentReply) =>
|
||||||
replyReply(replyItem),
|
replyReply(replyItem, currentReply),
|
||||||
replyType: ReplyType.values[replyType],
|
replyType: ReplyType.values[replyType],
|
||||||
addReply: (replyItem) {
|
addReply: (replyItem) {
|
||||||
replyList[index]
|
replyList[index]
|
||||||
@ -369,35 +369,40 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
|||||||
curve: Curves.easeInOut,
|
curve: Curves.easeInOut,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: FloatingActionButton(
|
child: Obx(
|
||||||
heroTag: null,
|
() => _dynamicDetailController.replyReqCode.value == 12061
|
||||||
onPressed: () {
|
? const SizedBox()
|
||||||
feedBack();
|
: FloatingActionButton(
|
||||||
showModalBottomSheet(
|
heroTag: null,
|
||||||
context: context,
|
onPressed: () {
|
||||||
isScrollControlled: true,
|
feedBack();
|
||||||
builder: (BuildContext context) {
|
showModalBottomSheet(
|
||||||
return VideoReplyNewDialog(
|
context: context,
|
||||||
oid: _dynamicDetailController.oid ??
|
isScrollControlled: true,
|
||||||
IdUtils.bv2av(Get.parameters['bvid']!),
|
builder: (BuildContext context) {
|
||||||
root: 0,
|
return VideoReplyNewDialog(
|
||||||
parent: 0,
|
oid: _dynamicDetailController.oid ??
|
||||||
replyType: ReplyType.values[replyType],
|
IdUtils.bv2av(Get.parameters['bvid']!),
|
||||||
);
|
root: 0,
|
||||||
},
|
parent: 0,
|
||||||
).then(
|
replyType: ReplyType.values[replyType],
|
||||||
(value) => {
|
);
|
||||||
// 完成评论,数据添加
|
},
|
||||||
if (value != null && value['data'] != null)
|
).then(
|
||||||
{
|
(value) => {
|
||||||
_dynamicDetailController.replyList.add(value['data']),
|
// 完成评论,数据添加
|
||||||
_dynamicDetailController.acount.value++
|
if (value != null && value['data'] != null)
|
||||||
}
|
{
|
||||||
},
|
_dynamicDetailController.replyList
|
||||||
);
|
.add(value['data']),
|
||||||
},
|
_dynamicDetailController.acount.value++
|
||||||
tooltip: '评论动态',
|
}
|
||||||
child: const Icon(Icons.reply),
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
tooltip: '评论动态',
|
||||||
|
child: const Icon(Icons.reply),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -79,6 +79,7 @@ class _MemberArchivePageState extends State<MemberArchivePage> {
|
|||||||
videoItem: list[index],
|
videoItem: list[index],
|
||||||
showOwner: false,
|
showOwner: false,
|
||||||
showPubdate: true,
|
showPubdate: true,
|
||||||
|
showCharge: true,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
childCount: list.length,
|
childCount: list.length,
|
||||||
|
|||||||
@ -131,7 +131,7 @@ class _PlaySettingState extends State<PlaySetting> {
|
|||||||
title: '开启硬解',
|
title: '开启硬解',
|
||||||
subTitle: '以较低功耗播放视频',
|
subTitle: '以较低功耗播放视频',
|
||||||
setKey: SettingBoxKey.enableHA,
|
setKey: SettingBoxKey.enableHA,
|
||||||
defaultVal: true,
|
defaultVal: false,
|
||||||
),
|
),
|
||||||
const SetSwitchItem(
|
const SetSwitchItem(
|
||||||
title: '观看人数',
|
title: '观看人数',
|
||||||
|
|||||||
@ -29,7 +29,7 @@ class _SelectDialogState<T> extends State<SelectDialog<T>> {
|
|||||||
|
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
title: Text(widget.title),
|
title: Text(widget.title),
|
||||||
contentPadding: const EdgeInsets.fromLTRB(0, 12, 0, 12),
|
contentPadding: const EdgeInsets.fromLTRB(0, 12, 0, 24),
|
||||||
content: StatefulBuilder(builder: (context, StateSetter setState) {
|
content: StatefulBuilder(builder: (context, StateSetter setState) {
|
||||||
return SingleChildScrollView(
|
return SingleChildScrollView(
|
||||||
child: Column(
|
child: Column(
|
||||||
|
|||||||
@ -59,7 +59,7 @@ class VideoDetailController extends GetxController
|
|||||||
// 封面图的展示
|
// 封面图的展示
|
||||||
RxBool isShowCover = true.obs;
|
RxBool isShowCover = true.obs;
|
||||||
// 硬解
|
// 硬解
|
||||||
RxBool enableHA = true.obs;
|
RxBool enableHA = false.obs;
|
||||||
|
|
||||||
/// 本地存储
|
/// 本地存储
|
||||||
Box userInfoCache = GStrorage.userInfo;
|
Box userInfoCache = GStrorage.userInfo;
|
||||||
@ -73,6 +73,7 @@ class VideoDetailController extends GetxController
|
|||||||
ReplyItemModel? firstFloor;
|
ReplyItemModel? firstFloor;
|
||||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||||
RxString bgCover = ''.obs;
|
RxString bgCover = ''.obs;
|
||||||
|
RxString cover = ''.obs;
|
||||||
PlPlayerController plPlayerController = PlPlayerController.getInstance();
|
PlPlayerController plPlayerController = PlPlayerController.getInstance();
|
||||||
|
|
||||||
late VideoItem firstVideo;
|
late VideoItem firstVideo;
|
||||||
@ -120,16 +121,18 @@ class VideoDetailController extends GetxController
|
|||||||
var args = argMap['videoItem'];
|
var args = argMap['videoItem'];
|
||||||
if (args.pic != null && args.pic != '') {
|
if (args.pic != null && args.pic != '') {
|
||||||
videoItem['pic'] = args.pic;
|
videoItem['pic'] = args.pic;
|
||||||
|
cover.value = args.pic;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (keys.contains('pic')) {
|
if (keys.contains('pic')) {
|
||||||
videoItem['pic'] = argMap['pic'];
|
videoItem['pic'] = argMap['pic'];
|
||||||
|
cover.value = argMap['pic'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tabCtr = TabController(length: 2, vsync: this);
|
tabCtr = TabController(length: 2, vsync: this);
|
||||||
autoPlay.value =
|
autoPlay.value =
|
||||||
setting.get(SettingBoxKey.autoPlayEnable, defaultValue: true);
|
setting.get(SettingBoxKey.autoPlayEnable, defaultValue: true);
|
||||||
enableHA.value = setting.get(SettingBoxKey.enableHA, defaultValue: true);
|
enableHA.value = setting.get(SettingBoxKey.enableHA, defaultValue: false);
|
||||||
enableRelatedVideo =
|
enableRelatedVideo =
|
||||||
setting.get(SettingBoxKey.enableRelatedVideo, defaultValue: true);
|
setting.get(SettingBoxKey.enableRelatedVideo, defaultValue: true);
|
||||||
if (userInfo == null ||
|
if (userInfo == null ||
|
||||||
@ -162,11 +165,11 @@ class VideoDetailController extends GetxController
|
|||||||
getSubtitle();
|
getSubtitle();
|
||||||
}
|
}
|
||||||
|
|
||||||
showReplyReplyPanel() {
|
showReplyReplyPanel(oid, fRpid, firstFloor, currentReply) {
|
||||||
replyReplyBottomSheetCtr =
|
replyReplyBottomSheetCtr =
|
||||||
scaffoldKey.currentState?.showBottomSheet((BuildContext context) {
|
scaffoldKey.currentState?.showBottomSheet((BuildContext context) {
|
||||||
return VideoReplyReplyPanel(
|
return VideoReplyReplyPanel(
|
||||||
oid: oid.value,
|
oid: oid,
|
||||||
rpid: fRpid,
|
rpid: fRpid,
|
||||||
closePanel: () => {
|
closePanel: () => {
|
||||||
fRpid = 0,
|
fRpid = 0,
|
||||||
@ -175,6 +178,7 @@ class VideoDetailController extends GetxController
|
|||||||
replyType: ReplyType.video,
|
replyType: ReplyType.video,
|
||||||
source: 'videoDetail',
|
source: 'videoDetail',
|
||||||
sheetHeight: sheetHeight.value,
|
sheetHeight: sheetHeight.value,
|
||||||
|
currentReply: currentReply,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
replyReplyBottomSheetCtr?.closed.then((value) {
|
replyReplyBottomSheetCtr?.closed.then((value) {
|
||||||
|
|||||||
@ -219,50 +219,36 @@ class VideoIntroController extends GetxController {
|
|||||||
builder: (context) {
|
builder: (context) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
title: const Text('选择投币个数'),
|
title: const Text('选择投币个数'),
|
||||||
contentPadding: const EdgeInsets.fromLTRB(0, 12, 0, 12),
|
contentPadding: const EdgeInsets.fromLTRB(0, 12, 0, 24),
|
||||||
content: StatefulBuilder(builder: (context, StateSetter setState) {
|
content: StatefulBuilder(builder: (context, StateSetter setState) {
|
||||||
return Column(
|
return Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [1, 2]
|
||||||
RadioListTile(
|
.map(
|
||||||
value: 1,
|
(e) => RadioListTile(
|
||||||
title: const Text('1枚'),
|
value: e,
|
||||||
groupValue: _tempThemeValue,
|
title: Text('$e枚'),
|
||||||
onChanged: (value) {
|
groupValue: _tempThemeValue,
|
||||||
_tempThemeValue = value!;
|
onChanged: (value) async {
|
||||||
Get.appUpdate();
|
_tempThemeValue = value!;
|
||||||
},
|
setState(() {});
|
||||||
),
|
var res = await VideoHttp.coinVideo(
|
||||||
RadioListTile(
|
bvid: bvid, multiply: _tempThemeValue);
|
||||||
value: 2,
|
if (res['status']) {
|
||||||
title: const Text('2枚'),
|
SmartDialog.showToast('投币成功 👏');
|
||||||
groupValue: _tempThemeValue,
|
hasCoin.value = true;
|
||||||
onChanged: (value) {
|
videoDetail.value.stat!.coin =
|
||||||
_tempThemeValue = value!;
|
videoDetail.value.stat!.coin! + _tempThemeValue;
|
||||||
Get.appUpdate();
|
} else {
|
||||||
},
|
SmartDialog.showToast(res['msg']);
|
||||||
),
|
}
|
||||||
],
|
Get.back();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.toList(),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
actions: [
|
|
||||||
TextButton(onPressed: () => Get.back(), child: const Text('取消')),
|
|
||||||
TextButton(
|
|
||||||
onPressed: () async {
|
|
||||||
var res = await VideoHttp.coinVideo(
|
|
||||||
bvid: bvid, multiply: _tempThemeValue);
|
|
||||||
if (res['status']) {
|
|
||||||
SmartDialog.showToast('投币成功 👏');
|
|
||||||
hasCoin.value = true;
|
|
||||||
videoDetail.value.stat!.coin =
|
|
||||||
videoDetail.value.stat!.coin! + _tempThemeValue;
|
|
||||||
} else {
|
|
||||||
SmartDialog.showToast(res['msg']);
|
|
||||||
}
|
|
||||||
Get.back();
|
|
||||||
},
|
|
||||||
child: const Text('确定'))
|
|
||||||
],
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -446,7 +432,7 @@ class VideoIntroController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 修改分P或番剧分集
|
// 修改分P或番剧分集
|
||||||
Future changeSeasonOrbangu(bvid, cid, aid) async {
|
Future changeSeasonOrbangu(bvid, cid, aid, cover) async {
|
||||||
// 重新获取视频资源
|
// 重新获取视频资源
|
||||||
final VideoDetailController videoDetailCtr =
|
final VideoDetailController videoDetailCtr =
|
||||||
Get.find<VideoDetailController>(tag: heroTag);
|
Get.find<VideoDetailController>(tag: heroTag);
|
||||||
@ -461,6 +447,7 @@ class VideoIntroController extends GetxController {
|
|||||||
videoDetailCtr.oid.value = aid ?? IdUtils.bv2av(bvid);
|
videoDetailCtr.oid.value = aid ?? IdUtils.bv2av(bvid);
|
||||||
videoDetailCtr.cid.value = cid;
|
videoDetailCtr.cid.value = cid;
|
||||||
videoDetailCtr.danmakuCid.value = cid;
|
videoDetailCtr.danmakuCid.value = cid;
|
||||||
|
videoDetailCtr.cover.value = cover;
|
||||||
videoDetailCtr.queryVideoUrl();
|
videoDetailCtr.queryVideoUrl();
|
||||||
// 重新请求评论
|
// 重新请求评论
|
||||||
try {
|
try {
|
||||||
@ -508,6 +495,7 @@ class VideoIntroController extends GetxController {
|
|||||||
void nextPlay() {
|
void nextPlay() {
|
||||||
final List episodes = [];
|
final List episodes = [];
|
||||||
bool isPages = false;
|
bool isPages = false;
|
||||||
|
late String cover;
|
||||||
if (videoDetail.value.ugcSeason != null) {
|
if (videoDetail.value.ugcSeason != null) {
|
||||||
final UgcSeason ugcSeason = videoDetail.value.ugcSeason!;
|
final UgcSeason ugcSeason = videoDetail.value.ugcSeason!;
|
||||||
final List<SectionItem> sections = ugcSeason.sections!;
|
final List<SectionItem> sections = ugcSeason.sections!;
|
||||||
@ -524,6 +512,7 @@ class VideoIntroController extends GetxController {
|
|||||||
final int currentIndex =
|
final int currentIndex =
|
||||||
episodes.indexWhere((e) => e.cid == lastPlayCid.value);
|
episodes.indexWhere((e) => e.cid == lastPlayCid.value);
|
||||||
int nextIndex = currentIndex + 1;
|
int nextIndex = currentIndex + 1;
|
||||||
|
cover = episodes[nextIndex].cover;
|
||||||
final VideoDetailController videoDetailCtr =
|
final VideoDetailController videoDetailCtr =
|
||||||
Get.find<VideoDetailController>(tag: heroTag);
|
Get.find<VideoDetailController>(tag: heroTag);
|
||||||
final PlayRepeat platRepeat = videoDetailCtr.plPlayerController.playRepeat;
|
final PlayRepeat platRepeat = videoDetailCtr.plPlayerController.playRepeat;
|
||||||
@ -540,7 +529,7 @@ class VideoIntroController extends GetxController {
|
|||||||
final int cid = episodes[nextIndex].cid!;
|
final int cid = episodes[nextIndex].cid!;
|
||||||
final String rBvid = isPages ? bvid : episodes[nextIndex].bvid;
|
final String rBvid = isPages ? bvid : episodes[nextIndex].bvid;
|
||||||
final int rAid = isPages ? IdUtils.bv2av(bvid) : episodes[nextIndex].aid!;
|
final int rAid = isPages ? IdUtils.bv2av(bvid) : episodes[nextIndex].aid!;
|
||||||
changeSeasonOrbangu(rBvid, cid, rAid);
|
changeSeasonOrbangu(rBvid, cid, rAid, cover);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置关注分组
|
// 设置关注分组
|
||||||
@ -605,10 +594,11 @@ class VideoIntroController extends GetxController {
|
|||||||
isFullScreen: true,
|
isFullScreen: true,
|
||||||
changeFucCall: (item, index) {
|
changeFucCall: (item, index) {
|
||||||
if (dataType == VideoEpidoesType.videoEpisode) {
|
if (dataType == VideoEpidoesType.videoEpisode) {
|
||||||
changeSeasonOrbangu(IdUtils.av2bv(item.aid), item.cid, item.aid);
|
changeSeasonOrbangu(
|
||||||
|
IdUtils.av2bv(item.aid), item.cid, item.aid, item.cover);
|
||||||
}
|
}
|
||||||
if (dataType == VideoEpidoesType.videoPart) {
|
if (dataType == VideoEpidoesType.videoPart) {
|
||||||
changeSeasonOrbangu(bvid, item.cid, null);
|
changeSeasonOrbangu(bvid, item.cid, null, item.cover);
|
||||||
}
|
}
|
||||||
SmartDialog.dismiss();
|
SmartDialog.dismiss();
|
||||||
},
|
},
|
||||||
|
|||||||
@ -383,11 +383,12 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
|||||||
? videoIntroController.lastPlayCid.value
|
? videoIntroController.lastPlayCid.value
|
||||||
: widget.videoDetail!.pages!.first.cid,
|
: widget.videoDetail!.pages!.first.cid,
|
||||||
sheetHeight: videoDetailCtr.sheetHeight.value,
|
sheetHeight: videoDetailCtr.sheetHeight.value,
|
||||||
changeFuc: (bvid, cid, aid) =>
|
changeFuc: (bvid, cid, aid, cover) =>
|
||||||
videoIntroController.changeSeasonOrbangu(
|
videoIntroController.changeSeasonOrbangu(
|
||||||
bvid,
|
bvid,
|
||||||
cid,
|
cid,
|
||||||
aid,
|
aid,
|
||||||
|
cover,
|
||||||
),
|
),
|
||||||
videoIntroCtr: videoIntroController,
|
videoIntroCtr: videoIntroController,
|
||||||
),
|
),
|
||||||
@ -401,10 +402,12 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
|||||||
pages: widget.videoDetail!.pages!,
|
pages: widget.videoDetail!.pages!,
|
||||||
cid: videoIntroController.lastPlayCid.value,
|
cid: videoIntroController.lastPlayCid.value,
|
||||||
sheetHeight: videoDetailCtr.sheetHeight.value,
|
sheetHeight: videoDetailCtr.sheetHeight.value,
|
||||||
changeFuc: (cid) => videoIntroController.changeSeasonOrbangu(
|
changeFuc: (cid, cover) =>
|
||||||
|
videoIntroController.changeSeasonOrbangu(
|
||||||
videoIntroController.bvid,
|
videoIntroController.bvid,
|
||||||
cid,
|
cid,
|
||||||
null,
|
null,
|
||||||
|
cover,
|
||||||
),
|
),
|
||||||
videoIntroCtr: videoIntroController,
|
videoIntroCtr: videoIntroController,
|
||||||
),
|
),
|
||||||
|
|||||||
@ -58,7 +58,7 @@ class _PagesPanelState extends State<PagesPanel> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void changeFucCall(item, i) async {
|
void changeFucCall(item, i) async {
|
||||||
widget.changeFuc?.call(item.cid);
|
widget.changeFuc?.call(item.cid, item.cover);
|
||||||
currentIndex.value = i;
|
currentIndex.value = i;
|
||||||
_bottomSheetController?.close();
|
_bottomSheetController?.close();
|
||||||
scrollToIndex();
|
scrollToIndex();
|
||||||
@ -129,7 +129,7 @@ class _PagesPanelState extends State<PagesPanel> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
height: 35,
|
height: 55,
|
||||||
margin: const EdgeInsets.only(bottom: 8),
|
margin: const EdgeInsets.only(bottom: 8),
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
scrollDirection: Axis.horizontal,
|
scrollDirection: Axis.horizontal,
|
||||||
@ -163,7 +163,7 @@ class _PagesPanelState extends State<PagesPanel> {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
widget.pages[i].pagePart!,
|
widget.pages[i].pagePart!,
|
||||||
maxLines: 1,
|
maxLines: 2,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
color: isCurrentIndex
|
color: isCurrentIndex
|
||||||
|
|||||||
@ -67,6 +67,7 @@ class _SeasonPanelState extends State<SeasonPanel> {
|
|||||||
IdUtils.av2bv(item.aid),
|
IdUtils.av2bv(item.aid),
|
||||||
item.cid,
|
item.cid,
|
||||||
item.aid,
|
item.aid,
|
||||||
|
item.cover,
|
||||||
);
|
);
|
||||||
currentIndex.value = i;
|
currentIndex.value = i;
|
||||||
_bottomSheetController?.close();
|
_bottomSheetController?.close();
|
||||||
|
|||||||
@ -37,6 +37,7 @@ class VideoReplyController extends GetxController {
|
|||||||
RxString sortTypeLabel = ReplySortType.time.labels.obs;
|
RxString sortTypeLabel = ReplySortType.time.labels.obs;
|
||||||
|
|
||||||
Box setting = GStrorage.setting;
|
Box setting = GStrorage.setting;
|
||||||
|
RxInt replyReqCode = 200.obs;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
@ -106,6 +107,7 @@ class VideoReplyController extends GetxController {
|
|||||||
replyList.addAll(replies);
|
replyList.addAll(replies);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
replyReqCode.value = res['code'];
|
||||||
isLoadingMore = false;
|
isLoadingMore = false;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -110,14 +110,15 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 展示二级回复
|
// 展示二级回复
|
||||||
void replyReply(replyItem) {
|
void replyReply(replyItem, currentReply) {
|
||||||
final VideoDetailController videoDetailCtr =
|
final VideoDetailController videoDetailCtr =
|
||||||
Get.find<VideoDetailController>(tag: heroTag);
|
Get.find<VideoDetailController>(tag: heroTag);
|
||||||
if (replyItem != null) {
|
if (replyItem != null) {
|
||||||
videoDetailCtr.oid.value = replyItem.oid;
|
videoDetailCtr.oid.value = replyItem.oid;
|
||||||
videoDetailCtr.fRpid = replyItem.rpid!;
|
videoDetailCtr.fRpid = replyItem.rpid!;
|
||||||
videoDetailCtr.firstFloor = replyItem;
|
videoDetailCtr.firstFloor = replyItem;
|
||||||
videoDetailCtr.showReplyReplyPanel();
|
videoDetailCtr.showReplyReplyPanel(
|
||||||
|
replyItem.oid, replyItem.rpid!, replyItem, currentReply);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -228,8 +229,8 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
|
|||||||
.replyList[index],
|
.replyList[index],
|
||||||
showReplyRow: true,
|
showReplyRow: true,
|
||||||
replyLevel: replyLevel,
|
replyLevel: replyLevel,
|
||||||
replyReply: (replyItem) =>
|
replyReply: (replyItem, currentReply) =>
|
||||||
replyReply(replyItem),
|
replyReply(replyItem, currentReply),
|
||||||
replyType: ReplyType.video,
|
replyType: ReplyType.video,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -276,32 +277,39 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
|
|||||||
parent: fabAnimationCtr,
|
parent: fabAnimationCtr,
|
||||||
curve: Curves.easeInOut,
|
curve: Curves.easeInOut,
|
||||||
)),
|
)),
|
||||||
child: FloatingActionButton(
|
child: Obx(
|
||||||
heroTag: null,
|
() => _videoReplyController.replyReqCode.value == 12061
|
||||||
onPressed: () {
|
? const SizedBox()
|
||||||
feedBack();
|
: FloatingActionButton(
|
||||||
showModalBottomSheet(
|
heroTag: null,
|
||||||
context: context,
|
onPressed: () {
|
||||||
isScrollControlled: true,
|
feedBack();
|
||||||
builder: (BuildContext context) {
|
showModalBottomSheet(
|
||||||
return VideoReplyNewDialog(
|
context: context,
|
||||||
oid: _videoReplyController.aid ??
|
isScrollControlled: true,
|
||||||
IdUtils.bv2av(Get.parameters['bvid']!),
|
builder: (BuildContext context) {
|
||||||
root: 0,
|
return VideoReplyNewDialog(
|
||||||
parent: 0,
|
oid: _videoReplyController.aid ??
|
||||||
replyType: ReplyType.video,
|
IdUtils.bv2av(Get.parameters['bvid']!),
|
||||||
);
|
root: 0,
|
||||||
},
|
parent: 0,
|
||||||
).then(
|
replyType: ReplyType.video,
|
||||||
(value) => {
|
);
|
||||||
// 完成评论,数据添加
|
},
|
||||||
if (value != null && value['data'] != null)
|
).then(
|
||||||
{_videoReplyController.replyList.add(value['data'])}
|
(value) => {
|
||||||
},
|
// 完成评论,数据添加
|
||||||
);
|
if (value != null && value['data'] != null)
|
||||||
},
|
{
|
||||||
tooltip: '发表评论',
|
_videoReplyController.replyList
|
||||||
child: const Icon(Icons.reply),
|
.add(value['data'])
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
tooltip: '发表评论',
|
||||||
|
child: const Icon(Icons.reply),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -12,7 +12,6 @@ import 'package:pilipala/pages/preview/index.dart';
|
|||||||
import 'package:pilipala/pages/video/detail/index.dart';
|
import 'package:pilipala/pages/video/detail/index.dart';
|
||||||
import 'package:pilipala/pages/video/detail/reply_new/index.dart';
|
import 'package:pilipala/pages/video/detail/reply_new/index.dart';
|
||||||
import 'package:pilipala/utils/feed_back.dart';
|
import 'package:pilipala/utils/feed_back.dart';
|
||||||
import 'package:pilipala/utils/id_utils.dart';
|
|
||||||
import 'package:pilipala/utils/storage.dart';
|
import 'package:pilipala/utils/storage.dart';
|
||||||
import 'package:pilipala/utils/url_utils.dart';
|
import 'package:pilipala/utils/url_utils.dart';
|
||||||
import 'package:pilipala/utils/utils.dart';
|
import 'package:pilipala/utils/utils.dart';
|
||||||
@ -45,7 +44,7 @@ class ReplyItem extends StatelessWidget {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
feedBack();
|
feedBack();
|
||||||
if (replyReply != null) {
|
if (replyReply != null) {
|
||||||
replyReply!(replyItem);
|
replyReply!(replyItem, null);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLongPress: () {
|
onLongPress: () {
|
||||||
@ -59,28 +58,23 @@ class ReplyItem extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: Column(
|
child: Container(
|
||||||
children: [
|
padding: const EdgeInsets.fromLTRB(12, 14, 8, 5),
|
||||||
Padding(
|
decoration: BoxDecoration(
|
||||||
padding: const EdgeInsets.fromLTRB(12, 14, 8, 5),
|
border: Border(
|
||||||
child: content(context),
|
bottom: BorderSide(
|
||||||
),
|
width: 1,
|
||||||
Divider(
|
color:
|
||||||
indent: 55,
|
Theme.of(context).colorScheme.onInverseSurface.withOpacity(0.5),
|
||||||
endIndent: 15,
|
))),
|
||||||
height: 0.3,
|
child: content(context),
|
||||||
color: Theme.of(context)
|
|
||||||
.colorScheme
|
|
||||||
.onInverseSurface
|
|
||||||
.withOpacity(0.5),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget lfAvtar(BuildContext context, String heroTag) {
|
Widget lfAvtar(BuildContext context, String heroTag) {
|
||||||
|
ColorScheme colorScheme = Theme.of(context).colorScheme;
|
||||||
return Stack(
|
return Stack(
|
||||||
children: [
|
children: [
|
||||||
Hero(
|
Hero(
|
||||||
@ -100,11 +94,11 @@ class ReplyItem extends StatelessWidget {
|
|||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(7),
|
borderRadius: BorderRadius.circular(7),
|
||||||
color: Theme.of(context).colorScheme.background,
|
color: colorScheme.background,
|
||||||
),
|
),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.offline_bolt,
|
Icons.offline_bolt,
|
||||||
color: Theme.of(context).colorScheme.primary,
|
color: colorScheme.primary,
|
||||||
size: 16,
|
size: 16,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -117,7 +111,7 @@ class ReplyItem extends StatelessWidget {
|
|||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(7),
|
borderRadius: BorderRadius.circular(7),
|
||||||
color: Theme.of(context).colorScheme.background,
|
color: colorScheme.background,
|
||||||
),
|
),
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
'assets/images/big-vip.png',
|
'assets/images/big-vip.png',
|
||||||
@ -131,6 +125,8 @@ class ReplyItem extends StatelessWidget {
|
|||||||
|
|
||||||
Widget content(BuildContext context) {
|
Widget content(BuildContext context) {
|
||||||
final String heroTag = Utils.makeHeroTag(replyItem!.mid);
|
final String heroTag = Utils.makeHeroTag(replyItem!.mid);
|
||||||
|
ColorScheme colorScheme = Theme.of(context).colorScheme;
|
||||||
|
TextTheme textTheme = Theme.of(context).textTheme;
|
||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
@ -160,16 +156,17 @@ class ReplyItem extends StatelessWidget {
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: replyItem!.member!.vip!['vipStatus'] > 0
|
color: replyItem!.member!.vip!['vipStatus'] > 0
|
||||||
? const Color.fromARGB(255, 251, 100, 163)
|
? const Color.fromARGB(255, 251, 100, 163)
|
||||||
: Theme.of(context).colorScheme.outline,
|
: colorScheme.outline,
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 6),
|
Padding(
|
||||||
Image.asset(
|
padding: const EdgeInsets.only(left: 6, right: 6),
|
||||||
'assets/images/lv/lv${replyItem!.member!.level}.png',
|
child: Image.asset(
|
||||||
height: 11,
|
'assets/images/lv/lv${replyItem!.member!.level}.png',
|
||||||
|
height: 11,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 6),
|
|
||||||
if (replyItem!.isUp!)
|
if (replyItem!.isUp!)
|
||||||
const PBadge(
|
const PBadge(
|
||||||
text: 'UP',
|
text: 'UP',
|
||||||
@ -184,9 +181,8 @@ class ReplyItem extends StatelessWidget {
|
|||||||
Text(
|
Text(
|
||||||
Utils.dateFormat(replyItem!.ctime),
|
Utils.dateFormat(replyItem!.ctime),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize:
|
fontSize: textTheme.labelSmall!.fontSize,
|
||||||
Theme.of(context).textTheme.labelSmall!.fontSize,
|
color: colorScheme.outline,
|
||||||
color: Theme.of(context).colorScheme.outline,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (replyItem!.replyControl != null &&
|
if (replyItem!.replyControl != null &&
|
||||||
@ -194,11 +190,8 @@ class ReplyItem extends StatelessWidget {
|
|||||||
Text(
|
Text(
|
||||||
' • ${replyItem!.replyControl!.location!}',
|
' • ${replyItem!.replyControl!.location!}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: Theme.of(context)
|
fontSize: textTheme.labelSmall!.fontSize,
|
||||||
.textTheme
|
color: colorScheme.outline),
|
||||||
.labelSmall!
|
|
||||||
.fontSize,
|
|
||||||
color: Theme.of(context).colorScheme.outline),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
@ -256,6 +249,8 @@ class ReplyItem extends StatelessWidget {
|
|||||||
|
|
||||||
// 感谢、回复、复制
|
// 感谢、回复、复制
|
||||||
Widget bottonAction(BuildContext context, replyControl) {
|
Widget bottonAction(BuildContext context, replyControl) {
|
||||||
|
ColorScheme colorScheme = Theme.of(context).colorScheme;
|
||||||
|
TextTheme textTheme = Theme.of(context).textTheme;
|
||||||
return Row(
|
return Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
const SizedBox(width: 32),
|
const SizedBox(width: 32),
|
||||||
@ -287,15 +282,13 @@ class ReplyItem extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
child: Row(children: [
|
child: Row(children: [
|
||||||
Icon(Icons.reply,
|
Icon(Icons.reply,
|
||||||
size: 18,
|
size: 18, color: colorScheme.outline.withOpacity(0.8)),
|
||||||
color:
|
|
||||||
Theme.of(context).colorScheme.outline.withOpacity(0.8)),
|
|
||||||
const SizedBox(width: 3),
|
const SizedBox(width: 3),
|
||||||
Text(
|
Text(
|
||||||
'回复',
|
'回复',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
|
fontSize: textTheme.labelMedium!.fontSize,
|
||||||
color: Theme.of(context).colorScheme.outline,
|
color: colorScheme.outline,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
@ -306,8 +299,8 @@ class ReplyItem extends StatelessWidget {
|
|||||||
Text(
|
Text(
|
||||||
'up主觉得很赞',
|
'up主觉得很赞',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Theme.of(context).colorScheme.primary,
|
color: colorScheme.primary,
|
||||||
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize),
|
fontSize: textTheme.labelMedium!.fontSize),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 2),
|
const SizedBox(width: 2),
|
||||||
],
|
],
|
||||||
@ -316,8 +309,8 @@ class ReplyItem extends StatelessWidget {
|
|||||||
Text(
|
Text(
|
||||||
'热评',
|
'热评',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Theme.of(context).colorScheme.primary,
|
color: colorScheme.primary,
|
||||||
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize),
|
fontSize: textTheme.labelMedium!.fontSize),
|
||||||
),
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
ZanButton(replyItem: replyItem, replyType: replyType),
|
ZanButton(replyItem: replyItem, replyType: replyType),
|
||||||
@ -347,10 +340,13 @@ class ReplyItemRow extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final bool isShow = replyControl!.isShow!;
|
final bool isShow = replyControl!.isShow!;
|
||||||
final int extraRow = replyControl != null && isShow ? 1 : 0;
|
final int extraRow = replyControl != null && isShow ? 1 : 0;
|
||||||
|
ColorScheme colorScheme = Theme.of(context).colorScheme;
|
||||||
|
TextTheme textTheme = Theme.of(context).textTheme;
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
margin: const EdgeInsets.only(left: 42, right: 4, top: 0),
|
margin: const EdgeInsets.only(left: 42, right: 4, top: 0),
|
||||||
child: Material(
|
child: Material(
|
||||||
color: Theme.of(context).colorScheme.onInverseSurface,
|
color: colorScheme.onInverseSurface,
|
||||||
borderRadius: BorderRadius.circular(6),
|
borderRadius: BorderRadius.circular(6),
|
||||||
clipBehavior: Clip.hardEdge,
|
clipBehavior: Clip.hardEdge,
|
||||||
animationDuration: Duration.zero,
|
animationDuration: Duration.zero,
|
||||||
@ -361,7 +357,9 @@ class ReplyItemRow extends StatelessWidget {
|
|||||||
for (int i = 0; i < replies!.length; i++) ...[
|
for (int i = 0; i < replies!.length; i++) ...[
|
||||||
InkWell(
|
InkWell(
|
||||||
// 一楼点击评论展开评论详情
|
// 一楼点击评论展开评论详情
|
||||||
onTap: () => replyReply!(replyItem),
|
// onTap: () {
|
||||||
|
// replyReply?.call(replyItem, replies![i]);
|
||||||
|
// },
|
||||||
onLongPress: () {
|
onLongPress: () {
|
||||||
feedBack();
|
feedBack();
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
@ -379,7 +377,7 @@ class ReplyItemRow extends StatelessWidget {
|
|||||||
8,
|
8,
|
||||||
i == 0 && (extraRow == 1 || replies!.length > 1) ? 8 : 5,
|
i == 0 && (extraRow == 1 || replies!.length > 1) ? 8 : 5,
|
||||||
8,
|
8,
|
||||||
i == 0 && (extraRow == 1 || replies!.length > 1) ? 5 : 6,
|
6,
|
||||||
),
|
),
|
||||||
child: Text.rich(
|
child: Text.rich(
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
@ -393,7 +391,7 @@ class ReplyItemRow extends StatelessWidget {
|
|||||||
.textTheme
|
.textTheme
|
||||||
.titleSmall!
|
.titleSmall!
|
||||||
.fontSize,
|
.fontSize,
|
||||||
color: Theme.of(context).colorScheme.primary,
|
color: colorScheme.primary,
|
||||||
),
|
),
|
||||||
recognizer: TapGestureRecognizer()
|
recognizer: TapGestureRecognizer()
|
||||||
..onTap = () {
|
..onTap = () {
|
||||||
@ -429,15 +427,14 @@ class ReplyItemRow extends StatelessWidget {
|
|||||||
if (extraRow == 1)
|
if (extraRow == 1)
|
||||||
InkWell(
|
InkWell(
|
||||||
// 一楼点击【共xx条回复】展开评论详情
|
// 一楼点击【共xx条回复】展开评论详情
|
||||||
onTap: () => replyReply!(replyItem),
|
onTap: () => replyReply!(replyItem, null),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
padding: const EdgeInsets.fromLTRB(8, 5, 8, 8),
|
padding: const EdgeInsets.fromLTRB(8, 5, 8, 8),
|
||||||
child: Text.rich(
|
child: Text.rich(
|
||||||
TextSpan(
|
TextSpan(
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize:
|
fontSize: textTheme.labelMedium!.fontSize,
|
||||||
Theme.of(context).textTheme.labelMedium!.fontSize,
|
|
||||||
),
|
),
|
||||||
children: [
|
children: [
|
||||||
if (replyControl!.upReply!)
|
if (replyControl!.upReply!)
|
||||||
@ -445,7 +442,7 @@ class ReplyItemRow extends StatelessWidget {
|
|||||||
TextSpan(
|
TextSpan(
|
||||||
text: replyControl!.entryText!,
|
text: replyControl!.entryText!,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Theme.of(context).colorScheme.primary,
|
color: colorScheme.primary,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
@ -464,6 +461,7 @@ InlineSpan buildContent(
|
|||||||
BuildContext context, replyItem, replyReply, fReplyItem) {
|
BuildContext context, replyItem, replyReply, fReplyItem) {
|
||||||
final String routePath = Get.currentRoute;
|
final String routePath = Get.currentRoute;
|
||||||
bool isVideoPage = routePath.startsWith('/video');
|
bool isVideoPage = routePath.startsWith('/video');
|
||||||
|
ColorScheme colorScheme = Theme.of(context).colorScheme;
|
||||||
|
|
||||||
// replyItem 当前回复内容
|
// replyItem 当前回复内容
|
||||||
// replyReply 查看二楼回复(回复详情)回调
|
// replyReply 查看二楼回复(回复详情)回调
|
||||||
@ -533,8 +531,10 @@ InlineSpan buildContent(
|
|||||||
TextSpan(
|
TextSpan(
|
||||||
text: str,
|
text: str,
|
||||||
recognizer: TapGestureRecognizer()
|
recognizer: TapGestureRecognizer()
|
||||||
..onTap = () =>
|
..onTap = () => replyReply?.call(
|
||||||
replyReply?.call(replyItem.root == 0 ? replyItem : fReplyItem),
|
replyItem.root == 0 ? replyItem : fReplyItem,
|
||||||
|
replyItem,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -564,7 +564,7 @@ InlineSpan buildContent(
|
|||||||
TextSpan(
|
TextSpan(
|
||||||
text: matchStr,
|
text: matchStr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Theme.of(context).colorScheme.primary,
|
color: colorScheme.primary,
|
||||||
),
|
),
|
||||||
recognizer: TapGestureRecognizer()
|
recognizer: TapGestureRecognizer()
|
||||||
..onTap = () {
|
..onTap = () {
|
||||||
@ -584,7 +584,7 @@ InlineSpan buildContent(
|
|||||||
text: ' $matchStr ',
|
text: ' $matchStr ',
|
||||||
style: isVideoPage
|
style: isVideoPage
|
||||||
? TextStyle(
|
? TextStyle(
|
||||||
color: Theme.of(context).colorScheme.primary,
|
color: colorScheme.primary,
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
recognizer: TapGestureRecognizer()
|
recognizer: TapGestureRecognizer()
|
||||||
@ -624,14 +624,14 @@ InlineSpan buildContent(
|
|||||||
child: Image.network(
|
child: Image.network(
|
||||||
content.jumpUrl[matchStr]['prefix_icon'],
|
content.jumpUrl[matchStr]['prefix_icon'],
|
||||||
height: 19,
|
height: 19,
|
||||||
color: Theme.of(context).colorScheme.primary,
|
color: colorScheme.primary,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: content.jumpUrl[matchStr]['title'],
|
text: content.jumpUrl[matchStr]['title'],
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Theme.of(context).colorScheme.primary,
|
color: colorScheme.primary,
|
||||||
),
|
),
|
||||||
recognizer: TapGestureRecognizer()
|
recognizer: TapGestureRecognizer()
|
||||||
..onTap = () async {
|
..onTap = () async {
|
||||||
@ -721,7 +721,7 @@ InlineSpan buildContent(
|
|||||||
TextSpan(
|
TextSpan(
|
||||||
text: matchStr,
|
text: matchStr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Theme.of(context).colorScheme.primary,
|
color: colorScheme.primary,
|
||||||
),
|
),
|
||||||
recognizer: TapGestureRecognizer()
|
recognizer: TapGestureRecognizer()
|
||||||
..onTap = () {
|
..onTap = () {
|
||||||
@ -747,7 +747,7 @@ InlineSpan buildContent(
|
|||||||
text: ' $matchStr ',
|
text: ' $matchStr ',
|
||||||
style: isVideoPage
|
style: isVideoPage
|
||||||
? TextStyle(
|
? TextStyle(
|
||||||
color: Theme.of(context).colorScheme.primary,
|
color: colorScheme.primary,
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
recognizer: TapGestureRecognizer()
|
recognizer: TapGestureRecognizer()
|
||||||
@ -786,14 +786,14 @@ InlineSpan buildContent(
|
|||||||
child: Image.network(
|
child: Image.network(
|
||||||
content.jumpUrl[patternStr]['prefix_icon'],
|
content.jumpUrl[patternStr]['prefix_icon'],
|
||||||
height: 19,
|
height: 19,
|
||||||
color: Theme.of(context).colorScheme.primary,
|
color: colorScheme.primary,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: content.jumpUrl[patternStr]['title'],
|
text: content.jumpUrl[patternStr]['title'],
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Theme.of(context).colorScheme.primary,
|
color: colorScheme.primary,
|
||||||
),
|
),
|
||||||
recognizer: TapGestureRecognizer()
|
recognizer: TapGestureRecognizer()
|
||||||
..onTap = () {
|
..onTap = () {
|
||||||
@ -997,7 +997,8 @@ class MorePanel extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
Color errorColor = Theme.of(context).colorScheme.error;
|
ColorScheme colorScheme = Theme.of(context).colorScheme;
|
||||||
|
TextTheme textTheme = Theme.of(context).textTheme;
|
||||||
return Container(
|
return Container(
|
||||||
padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
|
padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -1013,7 +1014,7 @@ class MorePanel extends StatelessWidget {
|
|||||||
width: 32,
|
width: 32,
|
||||||
height: 3,
|
height: 3,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Theme.of(context).colorScheme.outline,
|
color: colorScheme.outline,
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(3))),
|
borderRadius: const BorderRadius.all(Radius.circular(3))),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -1023,13 +1024,13 @@ class MorePanel extends StatelessWidget {
|
|||||||
onTap: () async => await menuActionHandler('copyAll'),
|
onTap: () async => await menuActionHandler('copyAll'),
|
||||||
minLeadingWidth: 0,
|
minLeadingWidth: 0,
|
||||||
leading: const Icon(Icons.copy_all_outlined, size: 19),
|
leading: const Icon(Icons.copy_all_outlined, size: 19),
|
||||||
title: Text('复制全部', style: Theme.of(context).textTheme.titleSmall),
|
title: Text('复制全部', style: textTheme.titleSmall),
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
onTap: () async => await menuActionHandler('copyFreedom'),
|
onTap: () async => await menuActionHandler('copyFreedom'),
|
||||||
minLeadingWidth: 0,
|
minLeadingWidth: 0,
|
||||||
leading: const Icon(Icons.copy_outlined, size: 19),
|
leading: const Icon(Icons.copy_outlined, size: 19),
|
||||||
title: Text('自由复制', style: Theme.of(context).textTheme.titleSmall),
|
title: Text('自由复制', style: textTheme.titleSmall),
|
||||||
),
|
),
|
||||||
// ListTile(
|
// ListTile(
|
||||||
// onTap: () async => await menuActionHandler('block'),
|
// onTap: () async => await menuActionHandler('block'),
|
||||||
|
|||||||
@ -43,6 +43,7 @@ class _VideoReplyNewDialogState extends State<VideoReplyNewDialog>
|
|||||||
String toolbarType = 'input';
|
String toolbarType = 'input';
|
||||||
RxBool isForward = false.obs;
|
RxBool isForward = false.obs;
|
||||||
RxBool showForward = false.obs;
|
RxBool showForward = false.obs;
|
||||||
|
RxString message = ''.obs;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@ -80,15 +81,15 @@ class _VideoReplyNewDialogState extends State<VideoReplyNewDialog>
|
|||||||
|
|
||||||
Future submitReplyAdd() async {
|
Future submitReplyAdd() async {
|
||||||
feedBack();
|
feedBack();
|
||||||
String message = _replyContentController.text;
|
// String message = _replyContentController.text;
|
||||||
var result = await VideoHttp.replyAdd(
|
var result = await VideoHttp.replyAdd(
|
||||||
type: widget.replyType ?? ReplyType.video,
|
type: widget.replyType ?? ReplyType.video,
|
||||||
oid: widget.oid!,
|
oid: widget.oid!,
|
||||||
root: widget.root!,
|
root: widget.root!,
|
||||||
parent: widget.parent!,
|
parent: widget.parent!,
|
||||||
message: widget.replyItem != null && widget.replyItem!.root != 0
|
message: widget.replyItem != null && widget.replyItem!.root != 0
|
||||||
? ' 回复 @${widget.replyItem!.member!.uname!} : $message'
|
? ' 回复 @${widget.replyItem!.member!.uname!} : ${message.value}'
|
||||||
: message,
|
: message.value,
|
||||||
);
|
);
|
||||||
if (result['status']) {
|
if (result['status']) {
|
||||||
SmartDialog.showToast(result['data']['success_toast']);
|
SmartDialog.showToast(result['data']['success_toast']);
|
||||||
@ -100,7 +101,7 @@ class _VideoReplyNewDialogState extends State<VideoReplyNewDialog>
|
|||||||
if (isForward.value) {
|
if (isForward.value) {
|
||||||
await DynamicsHttp.dynamicCreate(
|
await DynamicsHttp.dynamicCreate(
|
||||||
mid: 0,
|
mid: 0,
|
||||||
rawText: message,
|
rawText: message.value,
|
||||||
oid: widget.oid!,
|
oid: widget.oid!,
|
||||||
scene: 5,
|
scene: 5,
|
||||||
);
|
);
|
||||||
@ -188,7 +189,7 @@ class _VideoReplyNewDialogState extends State<VideoReplyNewDialog>
|
|||||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||||
child: TextField(
|
child: TextField(
|
||||||
controller: _replyContentController,
|
controller: _replyContentController,
|
||||||
minLines: 1,
|
minLines: 3,
|
||||||
maxLines: null,
|
maxLines: null,
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
focusNode: replyContentFocusNode,
|
focusNode: replyContentFocusNode,
|
||||||
@ -199,6 +200,9 @@ class _VideoReplyNewDialogState extends State<VideoReplyNewDialog>
|
|||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
)),
|
)),
|
||||||
style: Theme.of(context).textTheme.bodyLarge,
|
style: Theme.of(context).textTheme.bodyLarge,
|
||||||
|
onChanged: (text) {
|
||||||
|
message.value = text;
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -267,9 +271,11 @@ class _VideoReplyNewDialogState extends State<VideoReplyNewDialog>
|
|||||||
const Spacer(),
|
const Spacer(),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 36,
|
height: 36,
|
||||||
child: FilledButton(
|
child: Obx(
|
||||||
onPressed: () => submitReplyAdd(),
|
() => FilledButton(
|
||||||
child: const Text('发送'),
|
onPressed: message.isNotEmpty ? submitReplyAdd : null,
|
||||||
|
child: const Text('发送'),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@ -26,7 +26,7 @@ class VideoReplyReplyController extends GetxController {
|
|||||||
currentPage = 0;
|
currentPage = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future queryReplyList({type = 'init'}) async {
|
Future queryReplyList({type = 'init', currentReply}) async {
|
||||||
if (type == 'init') {
|
if (type == 'init') {
|
||||||
currentPage = 0;
|
currentPage = 0;
|
||||||
}
|
}
|
||||||
@ -63,6 +63,14 @@ class VideoReplyReplyController extends GetxController {
|
|||||||
// res['data'].replies.addAll(replyList);
|
// res['data'].replies.addAll(replyList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (replyList.isNotEmpty && currentReply != null) {
|
||||||
|
int indexToRemove =
|
||||||
|
replyList.indexWhere((item) => currentReply.rpid == item.rpid);
|
||||||
|
// 如果找到了指定ID的项,则移除
|
||||||
|
if (indexToRemove != -1) {
|
||||||
|
replyList.removeAt(indexToRemove);
|
||||||
|
}
|
||||||
|
}
|
||||||
isLoadingMore = false;
|
isLoadingMore = false;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,6 +20,7 @@ class VideoReplyReplyPanel extends StatefulWidget {
|
|||||||
this.source,
|
this.source,
|
||||||
this.replyType,
|
this.replyType,
|
||||||
this.sheetHeight,
|
this.sheetHeight,
|
||||||
|
this.currentReply,
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
final int? oid;
|
final int? oid;
|
||||||
@ -29,6 +30,7 @@ class VideoReplyReplyPanel extends StatefulWidget {
|
|||||||
final String? source;
|
final String? source;
|
||||||
final ReplyType? replyType;
|
final ReplyType? replyType;
|
||||||
final double? sheetHeight;
|
final double? sheetHeight;
|
||||||
|
final dynamic currentReply;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<VideoReplyReplyPanel> createState() => _VideoReplyReplyPanelState();
|
State<VideoReplyReplyPanel> createState() => _VideoReplyReplyPanelState();
|
||||||
@ -63,7 +65,9 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
_futureBuilderFuture = _videoReplyReplyController.queryReplyList();
|
_futureBuilderFuture = _videoReplyReplyController.queryReplyList(
|
||||||
|
currentReply: widget.currentReply,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void replyReply(replyItem) {}
|
void replyReply(replyItem) {}
|
||||||
@ -107,7 +111,9 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
|
|||||||
onRefresh: () async {
|
onRefresh: () async {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
_videoReplyReplyController.currentPage = 0;
|
_videoReplyReplyController.currentPage = 0;
|
||||||
return await _videoReplyReplyController.queryReplyList();
|
return await _videoReplyReplyController.queryReplyList(
|
||||||
|
currentReply: widget.currentReply,
|
||||||
|
);
|
||||||
},
|
},
|
||||||
child: CustomScrollView(
|
child: CustomScrollView(
|
||||||
controller: _videoReplyReplyController.scrollController,
|
controller: _videoReplyReplyController.scrollController,
|
||||||
@ -140,6 +146,10 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
|
|||||||
if (snapshot.connectionState == ConnectionState.done) {
|
if (snapshot.connectionState == ConnectionState.done) {
|
||||||
Map? data = snapshot.data;
|
Map? data = snapshot.data;
|
||||||
if (data != null && data['status']) {
|
if (data != null && data['status']) {
|
||||||
|
if (widget.currentReply != null) {
|
||||||
|
_videoReplyReplyController.replyList
|
||||||
|
.insert(0, widget.currentReply);
|
||||||
|
}
|
||||||
// 请求成功
|
// 请求成功
|
||||||
return Obx(
|
return Obx(
|
||||||
() => SliverList(
|
() => SliverList(
|
||||||
|
|||||||
@ -458,11 +458,17 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
handlePlay();
|
handlePlay();
|
||||||
},
|
},
|
||||||
child: NetworkImgLayer(
|
child: Obx(
|
||||||
type: 'emote',
|
() => AnimatedOpacity(
|
||||||
src: vdCtr.videoItem['pic'],
|
duration: const Duration(milliseconds: 100), // 渐变动画的持续时间
|
||||||
width: Get.width,
|
opacity: 1, // 设置不透明度
|
||||||
height: videoHeight.value,
|
child: NetworkImgLayer(
|
||||||
|
type: 'emote',
|
||||||
|
src: vdCtr.cover.value,
|
||||||
|
width: Get.width,
|
||||||
|
height: videoHeight.value,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Positioned(
|
Positioned(
|
||||||
|
|||||||
@ -353,7 +353,7 @@ class PlPlayerController {
|
|||||||
// 初始化播放速度
|
// 初始化播放速度
|
||||||
double speed = 1.0,
|
double speed = 1.0,
|
||||||
// 硬件加速
|
// 硬件加速
|
||||||
bool enableHA = true,
|
bool enableHA = false,
|
||||||
double? width,
|
double? width,
|
||||||
double? height,
|
double? height,
|
||||||
Duration? duration,
|
Duration? duration,
|
||||||
|
|||||||
Reference in New Issue
Block a user