mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-28 03:58:39 +00:00
feat: member shop
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -959,4 +959,7 @@ class Api {
|
||||
|
||||
static const String bgmRecommend =
|
||||
'/x/copyright-music-publicity/bgm/recommend_list';
|
||||
|
||||
static const String spaceShop =
|
||||
'${HttpString.mallBaseUrl}/community-hub/small_shop/feed/tab/item';
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ class HttpString {
|
||||
static const String dynamicShareBaseUrl = 'https://t.bilibili.com';
|
||||
static const String spaceBaseUrl = 'https://space.bilibili.com';
|
||||
static const String accountBaseUrl = 'https://account.bilibili.com';
|
||||
static const String mallBaseUrl = 'https://mall.bilibili.com';
|
||||
|
||||
static const String sponsorBlockBaseUrl = 'https://www.bsbsb.top';
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ class LiveHttp {
|
||||
bool? moduleSelect,
|
||||
}) async {
|
||||
final params = {
|
||||
if (isLogin) 'access_key': Accounts.main.accessKey,
|
||||
'access_key': ?Accounts.main.accessKey,
|
||||
'appkey': Constants.appKey,
|
||||
'channel': 'master',
|
||||
'actionKey': 'appkey',
|
||||
@@ -250,7 +250,7 @@ class LiveHttp {
|
||||
String? sortType,
|
||||
}) async {
|
||||
final params = {
|
||||
if (isLogin) 'access_key': Accounts.main.accessKey,
|
||||
'access_key': ?Accounts.main.accessKey,
|
||||
'appkey': Constants.appKey,
|
||||
'actionKey': 'appkey',
|
||||
'channel': 'master',
|
||||
@@ -316,7 +316,7 @@ class LiveHttp {
|
||||
required bool isLogin,
|
||||
}) async {
|
||||
final params = {
|
||||
if (isLogin) 'access_key': Accounts.main.accessKey,
|
||||
'access_key': ?Accounts.main.accessKey,
|
||||
'appkey': Constants.appKey,
|
||||
'actionKey': 'appkey',
|
||||
'build': 8430300,
|
||||
@@ -355,7 +355,7 @@ class LiveHttp {
|
||||
required bool isLogin,
|
||||
}) async {
|
||||
final params = {
|
||||
if (isLogin) 'access_key': Accounts.main.accessKey,
|
||||
'access_key': ?Accounts.main.accessKey,
|
||||
'appkey': Constants.appKey,
|
||||
'actionKey': 'appkey',
|
||||
'build': 8430300,
|
||||
@@ -435,7 +435,7 @@ class LiveHttp {
|
||||
required parentid,
|
||||
}) async {
|
||||
final params = {
|
||||
if (isLogin) 'access_key': Accounts.main.accessKey,
|
||||
'access_key': ?Accounts.main.accessKey,
|
||||
'appkey': Constants.appKey,
|
||||
'actionKey': 'appkey',
|
||||
'build': 8430300,
|
||||
@@ -478,7 +478,7 @@ class LiveHttp {
|
||||
required LiveSearchType type,
|
||||
}) async {
|
||||
final params = {
|
||||
if (isLogin) 'access_key': Accounts.main.accessKey,
|
||||
'access_key': ?Accounts.main.accessKey,
|
||||
'appkey': Constants.appKey,
|
||||
'actionKey': 'appkey',
|
||||
'build': 8430300,
|
||||
|
||||
@@ -23,8 +23,10 @@ import 'package:PiliPlus/models_new/space/space_audio/data.dart';
|
||||
import 'package:PiliPlus/models_new/space/space_cheese/data.dart';
|
||||
import 'package:PiliPlus/models_new/space/space_opus/data.dart';
|
||||
import 'package:PiliPlus/models_new/space/space_season_series/item.dart';
|
||||
import 'package:PiliPlus/models_new/space/space_shop/data.dart';
|
||||
import 'package:PiliPlus/models_new/upower_rank/data.dart';
|
||||
import 'package:PiliPlus/utils/accounts.dart';
|
||||
import 'package:PiliPlus/utils/app_sign.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:PiliPlus/utils/wbi_sign.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
@@ -779,4 +781,34 @@ class MemberHttp {
|
||||
return Error(res.data['message']);
|
||||
}
|
||||
}
|
||||
|
||||
static Future<LoadingState<SpaceShopData>> spaceShop({
|
||||
required int mid,
|
||||
}) async {
|
||||
final params = {
|
||||
'access_key': ?Accounts.main.accessKey,
|
||||
'actionKey': 'appkey',
|
||||
'build': 8430300,
|
||||
'mVersion': 309,
|
||||
'mallVersion': 8430300,
|
||||
'statistics': Constants.statisticsApp,
|
||||
};
|
||||
AppSign.appSign(params);
|
||||
var res = await Request().post(
|
||||
Api.spaceShop,
|
||||
queryParameters: params,
|
||||
data: {
|
||||
"from": "cps_productTab_$mid",
|
||||
"searchAfter": 0,
|
||||
"msource": "cps_productTab_$mid",
|
||||
"pageSize": 8,
|
||||
"upMid": mid.toString(),
|
||||
},
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return Success(SpaceShopData.fromJson(res.data['data']));
|
||||
} else {
|
||||
return Error(res.data['message']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user