@pisell/pisellos 3.0.5 → 3.0.6
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/modules/Account/index.d.ts +2 -6
- package/dist/modules/Account/index.js +21 -103
- package/dist/modules/Account/types.d.ts +12 -1
- package/dist/modules/AccountList/index.d.ts +20 -1
- package/dist/modules/AccountList/index.js +243 -75
- package/dist/modules/AccountList/types.d.ts +33 -1
- package/dist/modules/AccountList/types.js +8 -0
- package/dist/modules/AccountList/utils.d.ts +9 -0
- package/dist/modules/AccountList/utils.js +25 -0
- package/dist/modules/BaseModule.d.ts +2 -2
- package/dist/modules/BaseModule.js +1 -1
- package/dist/modules/Cart/index.d.ts +8 -5
- package/dist/modules/Cart/index.js +101 -25
- package/dist/modules/Cart/types.d.ts +82 -5
- package/dist/modules/Cart/types.js +22 -0
- package/dist/modules/Cart/utils.d.ts +106 -13
- package/dist/modules/Cart/utils.js +289 -76
- package/dist/modules/Date/index.d.ts +6 -6
- package/dist/modules/Date/index.js +41 -58
- package/dist/modules/Date/types.d.ts +22 -6
- package/dist/modules/Date/utils.d.ts +4 -3
- package/dist/modules/Date/utils.js +81 -30
- package/dist/modules/Discount/index.d.ts +4 -4
- package/dist/modules/Discount/index.js +11 -11
- package/dist/modules/Order/index.d.ts +11 -5
- package/dist/modules/Order/index.js +47 -18
- package/dist/modules/Order/types.d.ts +10 -3
- package/dist/modules/Order/utils.d.ts +10 -0
- package/dist/modules/Order/utils.js +15 -0
- package/dist/modules/Product/index.d.ts +14 -1
- package/dist/modules/Product/index.js +35 -0
- package/dist/modules/Product/types.d.ts +27 -3
- package/dist/modules/ProductList/index.js +11 -5
- package/dist/modules/Resource/types.d.ts +1 -0
- package/dist/modules/Resource/utils.js +1 -1
- package/dist/modules/Rules/index.d.ts +3 -3
- package/dist/modules/Rules/index.js +121 -53
- package/dist/modules/Rules/types.d.ts +5 -1
- package/dist/modules/Schedule/index.d.ts +18 -0
- package/dist/modules/Schedule/index.js +111 -0
- package/dist/modules/Schedule/type.d.ts +157 -0
- package/dist/modules/Schedule/type.js +1 -0
- package/dist/modules/Schedule/types.d.ts +182 -0
- package/dist/modules/Schedule/types.js +1 -0
- package/dist/modules/Schedule/utils.d.ts +67 -0
- package/dist/modules/Schedule/utils.js +729 -0
- package/dist/modules/Step/index.d.ts +14 -3
- package/dist/modules/Step/index.js +54 -2
- package/dist/modules/Summary/index.d.ts +12 -5
- package/dist/modules/Summary/index.js +33 -7
- package/dist/modules/Summary/types.d.ts +23 -2
- package/dist/modules/Summary/utils.d.ts +14 -4
- package/dist/modules/Summary/utils.js +46 -4
- package/dist/modules/index.d.ts +10 -0
- package/dist/modules/index.js +11 -1
- package/dist/plugins/index.d.ts +3 -3
- package/dist/plugins/request.d.ts +3 -3
- package/dist/plugins/request.js +30 -30
- package/dist/plugins/shopStore.d.ts +1 -1
- package/dist/solution/BookingByStep/index.d.ts +97 -24
- package/dist/solution/BookingByStep/index.js +1024 -322
- package/dist/solution/BookingByStep/types.d.ts +3 -10
- package/dist/solution/BookingByStep/types.js +11 -15
- package/dist/solution/BookingByStep/utils/products.d.ts +1 -1
- package/dist/solution/BookingByStep/utils/products.js +3 -0
- package/dist/solution/BookingByStep/utils/resources.d.ts +60 -6
- package/dist/solution/BookingByStep/utils/resources.js +293 -52
- package/dist/solution/ShopDiscount/index.d.ts +4 -4
- package/dist/solution/ShopDiscount/index.js +16 -16
- package/dist/solution/ShopDiscount/types.d.ts +2 -2
- package/dist/solution/ShopDiscount/utils.js +1 -1
- package/lib/core/index.js +7 -2
- package/lib/modules/Account/index.d.ts +2 -6
- package/lib/modules/Account/index.js +15 -30
- package/lib/modules/Account/types.d.ts +12 -1
- package/lib/modules/AccountList/index.d.ts +20 -1
- package/lib/modules/AccountList/index.js +122 -13
- package/lib/modules/AccountList/types.d.ts +33 -1
- package/lib/modules/AccountList/utils.d.ts +9 -0
- package/lib/modules/AccountList/utils.js +39 -0
- package/lib/modules/BaseModule.d.ts +2 -2
- package/lib/modules/BaseModule.js +14 -3
- package/lib/modules/Cart/index.d.ts +8 -5
- package/lib/modules/Cart/index.js +81 -8
- package/lib/modules/Cart/types.d.ts +82 -5
- package/lib/modules/Cart/types.js +20 -2
- package/lib/modules/Cart/utils.d.ts +106 -13
- package/lib/modules/Cart/utils.js +188 -45
- package/lib/modules/Date/index.d.ts +6 -6
- package/lib/modules/Date/index.js +13 -28
- package/lib/modules/Date/types.d.ts +22 -6
- package/lib/modules/Date/utils.d.ts +4 -3
- package/lib/modules/Date/utils.js +47 -13
- package/lib/modules/Discount/index.d.ts +4 -4
- package/lib/modules/Discount/index.js +9 -2
- package/lib/modules/Guests/index.js +4 -1
- package/lib/modules/Order/index.d.ts +11 -5
- package/lib/modules/Order/index.js +24 -3
- package/lib/modules/Order/types.d.ts +10 -3
- package/lib/modules/Order/utils.d.ts +10 -0
- package/lib/modules/Order/utils.js +45 -0
- package/lib/modules/Payment/index.js +1 -6
- package/lib/modules/Product/index.d.ts +14 -1
- package/lib/modules/Product/index.js +19 -0
- package/lib/modules/Product/types.d.ts +27 -3
- package/lib/modules/ProductList/index.js +21 -7
- package/lib/modules/Resource/index.js +4 -1
- package/lib/modules/Resource/types.d.ts +1 -0
- package/lib/modules/Resource/utils.js +7 -4
- package/lib/modules/Rules/index.d.ts +3 -3
- package/lib/modules/Rules/index.js +118 -43
- package/lib/modules/Rules/types.d.ts +5 -1
- package/lib/modules/Schedule/index.d.ts +18 -0
- package/lib/modules/Schedule/index.js +81 -0
- package/lib/modules/Schedule/type.d.ts +157 -0
- package/lib/modules/Schedule/type.js +17 -0
- package/lib/modules/Schedule/types.d.ts +182 -0
- package/lib/modules/Schedule/types.js +17 -0
- package/lib/modules/Schedule/utils.d.ts +67 -0
- package/lib/modules/Schedule/utils.js +600 -0
- package/lib/modules/Step/index.d.ts +14 -3
- package/lib/modules/Step/index.js +38 -1
- package/lib/modules/Summary/index.d.ts +12 -5
- package/lib/modules/Summary/index.js +15 -1
- package/lib/modules/Summary/types.d.ts +23 -2
- package/lib/modules/Summary/utils.d.ts +14 -4
- package/lib/modules/Summary/utils.js +30 -1
- package/lib/modules/index.d.ts +10 -0
- package/lib/modules/index.js +21 -1
- package/lib/plugins/index.d.ts +3 -3
- package/lib/plugins/request.d.ts +3 -3
- package/lib/plugins/request.js +48 -11
- package/lib/plugins/shopStore.d.ts +1 -1
- package/lib/solution/BookingByStep/index.d.ts +97 -24
- package/lib/solution/BookingByStep/index.js +693 -145
- package/lib/solution/BookingByStep/types.d.ts +3 -10
- package/lib/solution/BookingByStep/types.js +37 -14
- package/lib/solution/BookingByStep/utils/products.d.ts +1 -1
- package/lib/solution/BookingByStep/utils/products.js +3 -0
- package/lib/solution/BookingByStep/utils/resources.d.ts +60 -6
- package/lib/solution/BookingByStep/utils/resources.js +286 -54
- package/lib/solution/BuyTickets/index.js +34 -20
- package/lib/solution/ShopDiscount/index.d.ts +4 -4
- package/lib/solution/ShopDiscount/index.js +10 -2
- package/lib/solution/ShopDiscount/types.d.ts +2 -2
- package/package.json +4 -2
|
@@ -53,22 +53,21 @@ var BuyTicketsImpl = class extends import_BaseModule.BaseModule {
|
|
|
53
53
|
}
|
|
54
54
|
// 通过 ids 获取产品,在当前解决方案下,获取到的就是主商品
|
|
55
55
|
async loadProductsByIds(ids) {
|
|
56
|
-
const productsData = await this.request.post(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
skip: 1
|
|
66
|
-
}
|
|
67
|
-
);
|
|
56
|
+
const productsData = await this.request.post("/product/query", {
|
|
57
|
+
ids,
|
|
58
|
+
open_quotation: 1,
|
|
59
|
+
open_bundle: 1,
|
|
60
|
+
with: ["bundleGroup.bundleItem"],
|
|
61
|
+
status: "published",
|
|
62
|
+
num: 10,
|
|
63
|
+
skip: 1
|
|
64
|
+
});
|
|
68
65
|
const mainProducts = new import_modules.ProductList(`product-kiosk-main-list`);
|
|
69
|
-
this.core.registerModule(mainProducts, {
|
|
70
|
-
|
|
71
|
-
|
|
66
|
+
this.core.registerModule(mainProducts, {
|
|
67
|
+
initialState: {
|
|
68
|
+
list: productsData.data.list
|
|
69
|
+
}
|
|
70
|
+
});
|
|
72
71
|
this.store.mainProducts = mainProducts;
|
|
73
72
|
await this.core.effects.emit(import_types.BuyTicketsHooks.onMainProductsLoaded, {});
|
|
74
73
|
}
|
|
@@ -84,7 +83,10 @@ var BuyTicketsImpl = class extends import_BaseModule.BaseModule {
|
|
|
84
83
|
var _a;
|
|
85
84
|
const mainData = await this.store.mainProducts.getProducts() || [];
|
|
86
85
|
const otherData = await ((_a = this.store.otherProducts) == null ? void 0 : _a.getProducts()) || [];
|
|
87
|
-
await this.core.effects.emit(import_types.BuyTicketsHooks.OnGetProducts, [
|
|
86
|
+
await this.core.effects.emit(import_types.BuyTicketsHooks.OnGetProducts, [
|
|
87
|
+
...mainData,
|
|
88
|
+
...otherData
|
|
89
|
+
]);
|
|
88
90
|
return [...mainData, ...otherData];
|
|
89
91
|
}
|
|
90
92
|
// 根据 id 获取商品详情,他会尝试先去主列表里找,找不到再去子列表,还找不到就报错
|
|
@@ -100,19 +102,31 @@ var BuyTicketsImpl = class extends import_BaseModule.BaseModule {
|
|
|
100
102
|
}
|
|
101
103
|
// 商品列表页提交
|
|
102
104
|
async listSubmit(data) {
|
|
103
|
-
const res = await this.core.effects.emit(import_types.BuyTicketsHooks.onListSubmit, {
|
|
105
|
+
const res = await this.core.effects.emit(import_types.BuyTicketsHooks.onListSubmit, {
|
|
106
|
+
...data,
|
|
107
|
+
products: this.getProducts()
|
|
108
|
+
});
|
|
104
109
|
if (res.status === false)
|
|
105
110
|
return res;
|
|
106
|
-
this.window.localStorage.setItem(
|
|
111
|
+
this.window.localStorage.setItem(
|
|
112
|
+
"buyTickets:listSubmit",
|
|
113
|
+
JSON.stringify({ ...data, products: this.getProducts() })
|
|
114
|
+
);
|
|
107
115
|
console.log("listSubmit 应该走逻辑层的 API 发请求了");
|
|
108
116
|
}
|
|
109
117
|
// 购物车提交
|
|
110
118
|
async cartSubmit(data) {
|
|
111
|
-
await this.core.effects.emit(import_types.BuyTicketsHooks.onCartSubmit, {
|
|
119
|
+
await this.core.effects.emit(import_types.BuyTicketsHooks.onCartSubmit, {
|
|
120
|
+
...data,
|
|
121
|
+
products: this.getProducts()
|
|
122
|
+
});
|
|
112
123
|
}
|
|
113
124
|
// 结算提交
|
|
114
125
|
async checkoutSubmit(data) {
|
|
115
|
-
await this.core.effects.emit(import_types.BuyTicketsHooks.onCheckoutSubmit, {
|
|
126
|
+
await this.core.effects.emit(import_types.BuyTicketsHooks.onCheckoutSubmit, {
|
|
127
|
+
...data,
|
|
128
|
+
products: this.getProducts()
|
|
129
|
+
});
|
|
116
130
|
}
|
|
117
131
|
};
|
|
118
132
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Module, PisellCore } from
|
|
2
|
-
import { BaseModule } from
|
|
3
|
-
import { Customer } from
|
|
4
|
-
import { Discount } from
|
|
1
|
+
import { Module, PisellCore } from '../../types';
|
|
2
|
+
import { BaseModule } from '../../modules/BaseModule';
|
|
3
|
+
import { Customer } from './types';
|
|
4
|
+
import { Discount } from '../../modules/Discount/types';
|
|
5
5
|
export declare class ShopDiscountImpl extends BaseModule implements Module {
|
|
6
6
|
protected defaultName: string;
|
|
7
7
|
protected defaultVersion: string;
|
|
@@ -288,7 +288,13 @@ var ShopDiscountImpl = class extends import_BaseModule.BaseModule {
|
|
|
288
288
|
});
|
|
289
289
|
}
|
|
290
290
|
});
|
|
291
|
-
const newDiscountList = (0, import_utils.uniqueById)(
|
|
291
|
+
const newDiscountList = (0, import_utils.uniqueById)(
|
|
292
|
+
[
|
|
293
|
+
...editModeDiscountList,
|
|
294
|
+
...discountList.filter((item) => !item.isDisabled)
|
|
295
|
+
],
|
|
296
|
+
"product_id"
|
|
297
|
+
);
|
|
292
298
|
(_a = this.store.discount) == null ? void 0 : _a.setDiscountList(newDiscountList);
|
|
293
299
|
this.emitDiscountListChange(newDiscountList);
|
|
294
300
|
return newDiscountList;
|
|
@@ -322,7 +328,9 @@ var ShopDiscountImpl = class extends import_BaseModule.BaseModule {
|
|
|
322
328
|
action: "create",
|
|
323
329
|
with_good_pass: 1
|
|
324
330
|
}));
|
|
325
|
-
const scanDiscount = (_c = this.getDiscountList()) == null ? void 0 : _c.filter(
|
|
331
|
+
const scanDiscount = (_c = this.getDiscountList()) == null ? void 0 : _c.filter(
|
|
332
|
+
(item) => item.isScan
|
|
333
|
+
);
|
|
326
334
|
const newDiscountList = [...scanDiscount, ...goodPassList || []];
|
|
327
335
|
this.setDiscountList(newDiscountList || []);
|
|
328
336
|
if ((_d = this.store.productList) == null ? void 0 : _d.length) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DiscountModule } from
|
|
2
|
-
import { RulesModule } from
|
|
1
|
+
import { DiscountModule } from '../../modules/Discount';
|
|
2
|
+
import { RulesModule } from '../../modules/Rules';
|
|
3
3
|
export declare enum ShopDiscountHooks {
|
|
4
4
|
onInited = "shopDiscount:onInited",
|
|
5
5
|
onDestroy = "shopDiscount:onDestroy",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"private": false,
|
|
3
3
|
"name": "@pisell/pisellos",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.6",
|
|
5
5
|
"description": "一个可扩展的前端模块化SDK框架,支持插件系统",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"dev": "father dev --watch",
|
|
15
15
|
"test": "vitest",
|
|
16
16
|
"lint": "eslint src --ext .ts",
|
|
17
|
+
"format": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md}\"",
|
|
17
18
|
"changeset": "changeset",
|
|
18
19
|
"version": "changeset version",
|
|
19
20
|
"release": "changeset publish --registry=https://registry.npmjs.com/ && npm run sync && git push",
|
|
@@ -54,6 +55,7 @@
|
|
|
54
55
|
"axios": "1.7.2",
|
|
55
56
|
"eslint": "^8.37.0",
|
|
56
57
|
"father": "^4.1.0",
|
|
58
|
+
"prettier": "^3.5.3",
|
|
57
59
|
"ts-node": "^10.9.1",
|
|
58
60
|
"typedoc": "^0.28.2",
|
|
59
61
|
"typescript": "^5.0.3",
|
|
@@ -65,4 +67,4 @@
|
|
|
65
67
|
"publishConfig": {
|
|
66
68
|
"access": "public"
|
|
67
69
|
}
|
|
68
|
-
}
|
|
70
|
+
}
|