mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: pm share
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -28,17 +28,9 @@ import 'package:get/get.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class PageUtils {
|
||||
static void pmShareVideo({
|
||||
String? author,
|
||||
required int id,
|
||||
required int source,
|
||||
required String cover,
|
||||
required String title,
|
||||
String? bvid,
|
||||
String? url,
|
||||
int? authorId,
|
||||
String? sourceDesc,
|
||||
}) async {
|
||||
static void pmShare({required Map content}) async {
|
||||
// debugPrint(content.toString());
|
||||
|
||||
List<UserModel> userList = <UserModel>[];
|
||||
|
||||
final shareListRes = await GrpcRepo.shareList(size: 3);
|
||||
@@ -64,16 +56,8 @@ class PageUtils {
|
||||
|
||||
showModalBottomSheet(
|
||||
context: Get.context!,
|
||||
builder: (context) => ShareVideoPanel(
|
||||
author: author,
|
||||
id: id,
|
||||
source: source,
|
||||
cover: cover,
|
||||
title: title,
|
||||
bvid: bvid,
|
||||
url: url,
|
||||
authorId: authorId,
|
||||
sourceDesc: sourceDesc,
|
||||
builder: (context) => SharePanel(
|
||||
content: content,
|
||||
userList: userList,
|
||||
),
|
||||
useSafeArea: true,
|
||||
|
||||
@@ -39,17 +39,9 @@ class RequestUtils {
|
||||
// 16:番剧(id 为 epid)
|
||||
// 17:番剧
|
||||
// https://github.com/SocialSisterYi/bilibili-API-collect/tree/master/docs/message/private_msg_content.md
|
||||
static Future pmShareVideo({
|
||||
static Future pmShare({
|
||||
required int receiverId,
|
||||
String? author,
|
||||
required int id,
|
||||
required int source,
|
||||
required String cover,
|
||||
required String title,
|
||||
String? bvid,
|
||||
String? url,
|
||||
int? authorId,
|
||||
String? sourceDesc,
|
||||
required Map content,
|
||||
String? message,
|
||||
ValueChanged<bool>? callback,
|
||||
}) async {
|
||||
@@ -59,22 +51,10 @@ class RequestUtils {
|
||||
final videoRes = await GrpcRepo.sendMsg(
|
||||
senderUid: ownerMid,
|
||||
receiverId: receiverId,
|
||||
content: jsonEncode(
|
||||
{
|
||||
if (author != null) "author": author,
|
||||
"headline": title,
|
||||
"id": id,
|
||||
"source": source,
|
||||
"thumb": cover,
|
||||
"title": title,
|
||||
if (bvid != null) "bvid": bvid,
|
||||
// pgc
|
||||
if (url != null) "url": url,
|
||||
if (authorId != null) "author_id": authorId,
|
||||
if (sourceDesc != null) "source_desc": sourceDesc,
|
||||
},
|
||||
),
|
||||
msgType: MsgType.EN_MSG_TYPE_SHARE_V2,
|
||||
content: jsonEncode(content),
|
||||
msgType: content['source'] is String
|
||||
? MsgType.EN_MSG_TYPE_COMMON_SHARE_CARD
|
||||
: MsgType.EN_MSG_TYPE_SHARE_V2,
|
||||
);
|
||||
|
||||
if (videoRes['status']) {
|
||||
|
||||
Reference in New Issue
Block a user