sa2kit 1.6.113 → 1.6.114
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{index-CdtT3qtg.d.ts → index-CL4cXTf2.d.ts} +9 -92
- package/dist/{index-BQVl--uZ.d.mts → index-D78lqnFG.d.mts} +1 -1
- package/dist/{index-DGuqvsv-.d.ts → index-Dw9P_FAX.d.ts} +1 -1
- package/dist/{index-CcKFeVut.d.mts → index-DyTrbHIH.d.mts} +9 -92
- package/dist/{index-C0YVsYpz.d.ts → index-Sy5rj_Et.d.ts} +2 -2
- package/dist/{index-DPd4bnYA.d.mts → index-anBAKrnN.d.mts} +2 -2
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +53 -70
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +53 -70
- package/dist/index.mjs.map +1 -1
- package/dist/showmasterpiece/core.js +41 -50
- package/dist/showmasterpiece/core.js.map +1 -1
- package/dist/showmasterpiece/core.mjs +41 -50
- package/dist/showmasterpiece/core.mjs.map +1 -1
- package/dist/showmasterpiece/db.js +2 -2
- package/dist/showmasterpiece/db.js.map +1 -1
- package/dist/showmasterpiece/db.mjs +2 -2
- package/dist/showmasterpiece/db.mjs.map +1 -1
- package/dist/showmasterpiece/index.js +40 -45
- package/dist/showmasterpiece/index.js.map +1 -1
- package/dist/showmasterpiece/index.mjs +40 -45
- package/dist/showmasterpiece/index.mjs.map +1 -1
- package/dist/showmasterpiece/logic/index.js +41 -50
- package/dist/showmasterpiece/logic/index.js.map +1 -1
- package/dist/showmasterpiece/logic/index.mjs +41 -50
- package/dist/showmasterpiece/logic/index.mjs.map +1 -1
- package/dist/showmasterpiece/server/index.js +2 -2
- package/dist/showmasterpiece/server/index.js.map +1 -1
- package/dist/showmasterpiece/server/index.mjs +2 -2
- package/dist/showmasterpiece/server/index.mjs.map +1 -1
- package/dist/showmasterpiece/service/client-business/index.d.mts +1 -1
- package/dist/showmasterpiece/service/client-business/index.d.ts +1 -1
- package/dist/showmasterpiece/service/client-business/index.js +45 -62
- package/dist/showmasterpiece/service/client-business/index.js.map +1 -1
- package/dist/showmasterpiece/service/client-business/index.mjs +45 -62
- package/dist/showmasterpiece/service/client-business/index.mjs.map +1 -1
- package/dist/showmasterpiece/service/index.d.mts +2 -2
- package/dist/showmasterpiece/service/index.d.ts +2 -2
- package/dist/showmasterpiece/service/index.js +45 -62
- package/dist/showmasterpiece/service/index.js.map +1 -1
- package/dist/showmasterpiece/service/index.mjs +45 -62
- package/dist/showmasterpiece/service/index.mjs.map +1 -1
- package/dist/showmasterpiece/service/web/index.d.mts +2 -2
- package/dist/showmasterpiece/service/web/index.d.ts +2 -2
- package/dist/showmasterpiece/service/web/index.js +45 -62
- package/dist/showmasterpiece/service/web/index.js.map +1 -1
- package/dist/showmasterpiece/service/web/index.mjs +45 -62
- package/dist/showmasterpiece/service/web/index.mjs.map +1 -1
- package/dist/showmasterpiece/ui/miniapp/index.js +5 -5
- package/dist/showmasterpiece/ui/miniapp/index.js.map +1 -1
- package/dist/showmasterpiece/ui/miniapp/index.mjs +5 -5
- package/dist/showmasterpiece/ui/miniapp/index.mjs.map +1 -1
- package/dist/showmasterpiece/ui/web/index.js +40 -45
- package/dist/showmasterpiece/ui/web/index.js.map +1 -1
- package/dist/showmasterpiece/ui/web/index.mjs +40 -45
- package/dist/showmasterpiece/ui/web/index.mjs.map +1 -1
- package/dist/showmasterpiece/web/index.js +40 -45
- package/dist/showmasterpiece/web/index.js.map +1 -1
- package/dist/showmasterpiece/web/index.mjs +40 -45
- package/dist/showmasterpiece/web/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -7934,46 +7934,46 @@ __export(bookingService_exports, {
|
|
|
7934
7934
|
getBookings: () => getBookings2,
|
|
7935
7935
|
updateBooking: () => updateBooking
|
|
7936
7936
|
});
|
|
7937
|
+
function appendBookingCredentials(path4, credentials) {
|
|
7938
|
+
if (!credentials?.qqNumber?.trim() || !credentials?.phoneNumber?.trim()) {
|
|
7939
|
+
return path4;
|
|
7940
|
+
}
|
|
7941
|
+
const params = new URLSearchParams({
|
|
7942
|
+
qqNumber: credentials.qqNumber.trim(),
|
|
7943
|
+
phoneNumber: credentials.phoneNumber.trim()
|
|
7944
|
+
});
|
|
7945
|
+
return `${path4}?${params.toString()}`;
|
|
7946
|
+
}
|
|
7947
|
+
function bookingCredentialsBody(credentials) {
|
|
7948
|
+
if (!credentials?.qqNumber?.trim() || !credentials?.phoneNumber?.trim()) {
|
|
7949
|
+
return void 0;
|
|
7950
|
+
}
|
|
7951
|
+
return JSON.stringify({
|
|
7952
|
+
qqNumber: credentials.qqNumber.trim(),
|
|
7953
|
+
phoneNumber: credentials.phoneNumber.trim()
|
|
7954
|
+
});
|
|
7955
|
+
}
|
|
7956
|
+
async function parseErrorMessage(response, fallback) {
|
|
7957
|
+
const data = await response.json().catch(() => ({}));
|
|
7958
|
+
if (typeof data?.error === "string" && data.error) return data.error;
|
|
7959
|
+
if (typeof data?.message === "string" && data.message) return data.message;
|
|
7960
|
+
return fallback;
|
|
7961
|
+
}
|
|
7937
7962
|
var BookingService = class {
|
|
7938
|
-
/**
|
|
7939
|
-
* 创建新预订
|
|
7940
|
-
*
|
|
7941
|
-
* @param data 预订数据
|
|
7942
|
-
* @returns 创建的预订信息
|
|
7943
|
-
*/
|
|
7944
7963
|
static async createBooking(data) {
|
|
7945
7964
|
return createBooking(data);
|
|
7946
7965
|
}
|
|
7947
|
-
/**
|
|
7948
|
-
* 获取预订列表
|
|
7949
|
-
*
|
|
7950
|
-
* @param params 查询参数
|
|
7951
|
-
* @returns 预订列表和分页信息
|
|
7952
|
-
*/
|
|
7953
7966
|
static async getBookings(params = {}) {
|
|
7954
7967
|
return getBookings(params);
|
|
7955
7968
|
}
|
|
7956
|
-
|
|
7957
|
-
|
|
7958
|
-
|
|
7959
|
-
* @param id 预订ID
|
|
7960
|
-
* @returns 预订详情
|
|
7961
|
-
*/
|
|
7962
|
-
static async getBooking(id2) {
|
|
7963
|
-
const response = await fetch(`${this.BASE_URL}/${id2}`);
|
|
7969
|
+
static async getBooking(id2, credentials) {
|
|
7970
|
+
const url = appendBookingCredentials(`${this.BASE_URL}/${id2}`, credentials);
|
|
7971
|
+
const response = await fetch(url);
|
|
7964
7972
|
if (!response.ok) {
|
|
7965
|
-
|
|
7966
|
-
throw new Error(error.message || "\u83B7\u53D6\u9884\u8BA2\u8BE6\u60C5\u5931\u8D25");
|
|
7973
|
+
throw new Error(await parseErrorMessage(response, "\u83B7\u53D6\u9884\u8BA2\u8BE6\u60C5\u5931\u8D25"));
|
|
7967
7974
|
}
|
|
7968
7975
|
return response.json();
|
|
7969
7976
|
}
|
|
7970
|
-
/**
|
|
7971
|
-
* 更新预订状态
|
|
7972
|
-
*
|
|
7973
|
-
* @param id 预订ID
|
|
7974
|
-
* @param data 更新数据
|
|
7975
|
-
* @returns 更新后的预订信息
|
|
7976
|
-
*/
|
|
7977
7977
|
static async updateBooking(id2, data) {
|
|
7978
7978
|
const response = await fetch(`${this.BASE_URL}/${id2}`, {
|
|
7979
7979
|
method: "PUT",
|
|
@@ -7983,53 +7983,36 @@ var BookingService = class {
|
|
|
7983
7983
|
body: JSON.stringify(data)
|
|
7984
7984
|
});
|
|
7985
7985
|
if (!response.ok) {
|
|
7986
|
-
|
|
7987
|
-
throw new Error(error.message || "\u66F4\u65B0\u9884\u8BA2\u5931\u8D25");
|
|
7986
|
+
throw new Error(await parseErrorMessage(response, "\u66F4\u65B0\u9884\u8BA2\u5931\u8D25"));
|
|
7988
7987
|
}
|
|
7989
7988
|
return response.json();
|
|
7990
7989
|
}
|
|
7991
7990
|
/**
|
|
7992
|
-
*
|
|
7993
|
-
*
|
|
7994
|
-
* @param id 预订ID
|
|
7991
|
+
* 删除预订(须携带与下单一致的 QQ + 手机号,与 profile-v1 API 约定一致)
|
|
7995
7992
|
*/
|
|
7996
|
-
static async deleteBooking(id2) {
|
|
7997
|
-
const
|
|
7998
|
-
|
|
7993
|
+
static async deleteBooking(id2, credentials) {
|
|
7994
|
+
const url = appendBookingCredentials(`${this.BASE_URL}/${id2}`, credentials);
|
|
7995
|
+
const body = bookingCredentialsBody(credentials);
|
|
7996
|
+
const response = await fetch(url, {
|
|
7997
|
+
method: "DELETE",
|
|
7998
|
+
headers: body ? { "Content-Type": "application/json" } : void 0,
|
|
7999
|
+
body
|
|
7999
8000
|
});
|
|
8000
8001
|
if (!response.ok) {
|
|
8001
|
-
|
|
8002
|
-
throw new Error(error.message || "\u5220\u9664\u9884\u8BA2\u5931\u8D25");
|
|
8002
|
+
throw new Error(await parseErrorMessage(response, "\u5220\u9664\u9884\u8BA2\u5931\u8D25"));
|
|
8003
8003
|
}
|
|
8004
8004
|
}
|
|
8005
|
-
/**
|
|
8006
|
-
* 获取可预订的画集列表
|
|
8007
|
-
*
|
|
8008
|
-
* @returns 画集简略信息列表
|
|
8009
|
-
*/
|
|
8010
8005
|
static async getBookableCollections() {
|
|
8011
8006
|
return getBookableCollections();
|
|
8012
8007
|
}
|
|
8013
8008
|
};
|
|
8014
8009
|
BookingService.BASE_URL = "/api/showmasterpiece/bookings";
|
|
8015
|
-
var createBooking2 = (data) =>
|
|
8016
|
-
|
|
8017
|
-
|
|
8018
|
-
var
|
|
8019
|
-
|
|
8020
|
-
|
|
8021
|
-
var getBooking = (id2) => {
|
|
8022
|
-
return BookingService.getBooking(id2);
|
|
8023
|
-
};
|
|
8024
|
-
var updateBooking = (id2, data) => {
|
|
8025
|
-
return BookingService.updateBooking(id2, data);
|
|
8026
|
-
};
|
|
8027
|
-
var deleteBooking = (id2) => {
|
|
8028
|
-
return BookingService.deleteBooking(id2);
|
|
8029
|
-
};
|
|
8030
|
-
var getBookableCollections2 = () => {
|
|
8031
|
-
return BookingService.getBookableCollections();
|
|
8032
|
-
};
|
|
8010
|
+
var createBooking2 = (data) => BookingService.createBooking(data);
|
|
8011
|
+
var getBookings2 = (params) => BookingService.getBookings(params);
|
|
8012
|
+
var getBooking = (id2, credentials) => BookingService.getBooking(id2, credentials);
|
|
8013
|
+
var updateBooking = (id2, data) => BookingService.updateBooking(id2, data);
|
|
8014
|
+
var deleteBooking = (id2, credentials) => BookingService.deleteBooking(id2, credentials);
|
|
8015
|
+
var getBookableCollections2 = () => BookingService.getBookableCollections();
|
|
8033
8016
|
|
|
8034
8017
|
// src/business/showmasterpiece/logic/hooks/useBooking.ts
|
|
8035
8018
|
function useBooking(_props = {}) {
|
|
@@ -12422,10 +12405,10 @@ var BookingQueryService = class {
|
|
|
12422
12405
|
conditions.push(eq(comicUniverseBookings.collectionId, input.collectionId));
|
|
12423
12406
|
}
|
|
12424
12407
|
if (input.qqNumber) {
|
|
12425
|
-
conditions.push(
|
|
12408
|
+
conditions.push(eq(comicUniverseBookings.qqNumber, input.qqNumber.trim()));
|
|
12426
12409
|
}
|
|
12427
12410
|
if (input.phoneNumber) {
|
|
12428
|
-
conditions.push(
|
|
12411
|
+
conditions.push(eq(comicUniverseBookings.phoneNumber, input.phoneNumber.trim()));
|
|
12429
12412
|
}
|
|
12430
12413
|
if (input.status) {
|
|
12431
12414
|
conditions.push(eq(comicUniverseBookings.status, input.status));
|
|
@@ -19325,7 +19308,7 @@ var CartHistoryPage = ({
|
|
|
19325
19308
|
const handleDeleteBooking = async (bookingId) => {
|
|
19326
19309
|
if (confirm("\u786E\u5B9A\u8981\u5220\u9664\u8FD9\u6761\u9884\u8BA2\u8BB0\u5F55\u5417\uFF1F\u6B64\u64CD\u4F5C\u4E0D\u53EF\u64A4\u9500\u3002")) {
|
|
19327
19310
|
try {
|
|
19328
|
-
await BookingService.deleteBooking(bookingId);
|
|
19311
|
+
await BookingService.deleteBooking(bookingId, { qqNumber, phoneNumber });
|
|
19329
19312
|
console.log("\u9884\u8BA2\u8BB0\u5F55\u5220\u9664\u6210\u529F");
|
|
19330
19313
|
await loadBookings();
|
|
19331
19314
|
} catch (error2) {
|
|
@@ -20387,8 +20370,8 @@ var HistoryMiniappPage = ({ apiBaseUrl = DEFAULT_BASE_URL }) => {
|
|
|
20387
20370
|
return;
|
|
20388
20371
|
}
|
|
20389
20372
|
setPrivacyConsented(true);
|
|
20390
|
-
if (!qqNumber.trim()
|
|
20391
|
-
Taro2.showToast({ title: "\u8BF7\
|
|
20373
|
+
if (!qqNumber.trim() || !phoneNumber.trim()) {
|
|
20374
|
+
Taro2.showToast({ title: "\u8BF7\u540C\u65F6\u586B\u5199QQ\u53F7\u4E0E\u8054\u7CFB\u65B9\u5F0F", icon: "none" });
|
|
20392
20375
|
return;
|
|
20393
20376
|
}
|
|
20394
20377
|
setLoading(true);
|
|
@@ -20397,8 +20380,8 @@ var HistoryMiniappPage = ({ apiBaseUrl = DEFAULT_BASE_URL }) => {
|
|
|
20397
20380
|
try {
|
|
20398
20381
|
const result = await getBookings3(
|
|
20399
20382
|
{
|
|
20400
|
-
qqNumber: qqNumber.trim()
|
|
20401
|
-
phoneNumber: phoneNumber.trim()
|
|
20383
|
+
qqNumber: qqNumber.trim(),
|
|
20384
|
+
phoneNumber: phoneNumber.trim(),
|
|
20402
20385
|
page: 1,
|
|
20403
20386
|
limit: 50
|
|
20404
20387
|
},
|
|
@@ -20427,7 +20410,7 @@ var HistoryMiniappPage = ({ apiBaseUrl = DEFAULT_BASE_URL }) => {
|
|
|
20427
20410
|
completedCount
|
|
20428
20411
|
};
|
|
20429
20412
|
}, [records]);
|
|
20430
|
-
return /* @__PURE__ */ React53__default.createElement(View, { className: "min-h-screen bg-gradient-to-br from-white to-prussian-blue-100 pb-12 text-rich-black" }, /* @__PURE__ */ React53__default.createElement(PageHeader_default, { title: "\u5386\u53F2\u8BB0\u5F55\u67E5\u8BE2", subtitle: "\
|
|
20413
|
+
return /* @__PURE__ */ React53__default.createElement(View, { className: "min-h-screen bg-gradient-to-br from-white to-prussian-blue-100 pb-12 text-rich-black" }, /* @__PURE__ */ React53__default.createElement(PageHeader_default, { title: "\u5386\u53F2\u8BB0\u5F55\u67E5\u8BE2", subtitle: "\u8BF7\u540C\u65F6\u586B\u5199 QQ \u53F7\u4E0E\u8054\u7CFB\u65B9\u5F0F\u67E5\u8BE2\u9884\u8BA2\u8BB0\u5F55" }), /* @__PURE__ */ React53__default.createElement(View, { className: "mx-4 mt-5 rounded-3xl border border-prussian-blue-200 bg-white px-5 py-5 shadow-sm" }, /* @__PURE__ */ React53__default.createElement(
|
|
20431
20414
|
FormInput,
|
|
20432
20415
|
{
|
|
20433
20416
|
label: "QQ\u53F7",
|