Skip to content

Commit 2d75910

Browse files
committed
feat: 赞助功能
1 parent 20f9a76 commit 2d75910

15 files changed

Lines changed: 421 additions & 9 deletions

File tree

MaiChartManager/Browser.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public Browser(string url)
1313
webView21.Source = new Uri(url);
1414
webView21.DefaultBackgroundColor = Color.Transparent;
1515
UI.SetBlurStyle(this, blurType: UI.BlurType.Mica, UI.Mode.LightMode);
16+
IapManager.BindToForm(this);
1617
}
1718

1819
private void webView21_CoreWebView2InitializationCompleted(object sender, Microsoft.Web.WebView2.Core.CoreWebView2InitializationCompletedEventArgs e)
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using Windows.Services.Store;
2+
using Microsoft.AspNetCore.Mvc;
3+
4+
namespace MaiChartManager.Controllers;
5+
6+
[ApiController]
7+
[Route("MaiChartManagerServlet/[action]Api")]
8+
public class AppLicenseController
9+
{
10+
public record AppLicenseDto(bool isPurchased);
11+
12+
[HttpGet]
13+
public AppLicenseDto GetAppLicenseStatus()
14+
{
15+
return new AppLicenseDto(IapManager.IsPurchased);
16+
}
17+
18+
public record RequestPurchaseResult(string? ErrorMessage, StorePurchaseStatus Status);
19+
20+
[HttpPost]
21+
public async Task<RequestPurchaseResult> RequestPurchase()
22+
{
23+
var res = await IapManager.Purchase();
24+
if (res.ExtendedError is not null)
25+
{
26+
return new RequestPurchaseResult(res.ExtendedError.Message, res.Status);
27+
}
28+
29+
return new RequestPurchaseResult(null, res.Status);
30+
}
31+
}

MaiChartManager/Front/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
},
1212
"devDependencies": {
1313
"@fontsource/nerko-one": "^5.0.21",
14+
"@iconify-json/fluent": "^1.2.1",
1415
"@iconify-json/ic": "^1.1.18",
1516
"@iconify-json/material-symbols": "^1.1.88",
1617
"@iconify-json/mdi": "^1.1.68",
@@ -41,6 +42,7 @@
4142
"unity-webgl": "^3.5.5",
4243
"unocss": "^0.62.2",
4344
"vite": "^5.4.1",
45+
"vite-svg-loader": "^5.1.0",
4446
"vue": "^3.4.38",
4547
"vue-contenteditable": "^4.1.0",
4648
"vue-router": "^4.4.3"

MaiChartManager/Front/pnpm-lock.yaml

Lines changed: 132 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)