@pisell/pisellos 2.1.121 → 2.1.123

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.
@@ -426,7 +426,6 @@ var _VenueBookingImpl = class extends import_BaseModule.BaseModule {
426
426
  await this.store.schedule.loadAllSchedule();
427
427
  this.injectScheduleResolverToQuotation();
428
428
  }
429
- this.loadQuotations();
430
429
  await this.refreshItemRuleQuantityLimits();
431
430
  this.store.status = "ready";
432
431
  console.log("[VenueBooking] 初始化完成");
@@ -1158,7 +1157,7 @@ var _VenueBookingImpl = class extends import_BaseModule.BaseModule {
1158
1157
  }
1159
1158
  }
1160
1159
  async submitOrder() {
1161
- var _a;
1160
+ var _a, _b, _c, _d, _e;
1162
1161
  this.logMethodStart("submitOrder");
1163
1162
  try {
1164
1163
  await this.validateBeforeSubmitByItemRule();
@@ -1166,11 +1165,15 @@ var _VenueBookingImpl = class extends import_BaseModule.BaseModule {
1166
1165
  throw new Error("venueBooking解决方案需要 order 模块支持");
1167
1166
  }
1168
1167
  const result = await this.store.order.submitTempOrder({
1169
- cacheId: this.cacheId
1168
+ cacheId: this.cacheId,
1169
+ platform: (_a = this.otherParams) == null ? void 0 : _a.platform,
1170
+ businessCode: (_b = this.otherParams) == null ? void 0 : _b.businessCode,
1171
+ channel: (_c = this.otherParams) == null ? void 0 : _c.channel,
1172
+ type: (_d = this.otherParams) == null ? void 0 : _d.type
1170
1173
  });
1171
1174
  const tempOrder = this.store.order.getTempOrder();
1172
1175
  this.logMethodSuccess("submitOrder", {
1173
- productCount: ((_a = tempOrder == null ? void 0 : tempOrder.products) == null ? void 0 : _a.length) || 0
1176
+ productCount: ((_e = tempOrder == null ? void 0 : tempOrder.products) == null ? void 0 : _e.length) || 0
1174
1177
  });
1175
1178
  return result;
1176
1179
  } catch (error) {
@@ -1561,6 +1564,53 @@ var _VenueBookingImpl = class extends import_BaseModule.BaseModule {
1561
1564
  getOtherParams() {
1562
1565
  return this.otherParams;
1563
1566
  }
1567
+ getUIStateBucketKey() {
1568
+ if (!this.cacheId)
1569
+ return null;
1570
+ return `${_VenueBookingImpl.UI_STATE_KEY_PREFIX}${this.cacheId}`;
1571
+ }
1572
+ readUIStateBucket() {
1573
+ var _a;
1574
+ const key = this.getUIStateBucketKey();
1575
+ if (!key || !((_a = this.window) == null ? void 0 : _a.sessionStorage))
1576
+ return {};
1577
+ try {
1578
+ const raw = this.window.sessionStorage.getItem(key) || "{}";
1579
+ const parsed = JSON.parse(raw);
1580
+ return parsed && typeof parsed === "object" ? parsed : {};
1581
+ } catch {
1582
+ return {};
1583
+ }
1584
+ }
1585
+ writeUIStateBucket(bucket) {
1586
+ var _a;
1587
+ const key = this.getUIStateBucketKey();
1588
+ if (!key || !((_a = this.window) == null ? void 0 : _a.sessionStorage))
1589
+ return;
1590
+ this.window.sessionStorage.setItem(key, JSON.stringify(bucket));
1591
+ }
1592
+ setUIState(key, value) {
1593
+ if (!this.getUIStateBucketKey())
1594
+ return;
1595
+ const bucket = this.readUIStateBucket();
1596
+ bucket[key] = value;
1597
+ this.writeUIStateBucket(bucket);
1598
+ }
1599
+ getUIState(key) {
1600
+ if (!this.getUIStateBucketKey())
1601
+ return void 0;
1602
+ const bucket = this.readUIStateBucket();
1603
+ return bucket[key];
1604
+ }
1605
+ deleteUIState(key) {
1606
+ if (!this.getUIStateBucketKey())
1607
+ return;
1608
+ const bucket = this.readUIStateBucket();
1609
+ if (key in bucket) {
1610
+ delete bucket[key];
1611
+ this.writeUIStateBucket(bucket);
1612
+ }
1613
+ }
1564
1614
  // ─── OpenData 可用性 ───
1565
1615
  async checkOpenDataAvailability() {
1566
1616
  if (!this.store.openData)
@@ -1568,9 +1618,22 @@ var _VenueBookingImpl = class extends import_BaseModule.BaseModule {
1568
1618
  await this.loadOpenDataConfig();
1569
1619
  return this.store.openData.checkAvailability(this.store.schedule);
1570
1620
  }
1621
+ async setOtherParams(params, { cover = false } = {}) {
1622
+ if (cover) {
1623
+ this.otherParams = params;
1624
+ } else {
1625
+ this.otherParams = { ...this.otherParams, ...params };
1626
+ }
1627
+ }
1571
1628
  };
1572
1629
  var VenueBookingImpl = _VenueBookingImpl;
1573
1630
  VenueBookingImpl.OPEN_DATA_CACHE_TTL = 5 * 60 * 1e3;
1631
+ // ─── UI 状态缓存(按 cacheId 分桶,sessionStorage) ───
1632
+ //
1633
+ // 用于物料层持久化 UI 层面的轻量状态(如当前步骤、登录回跳意图等)。
1634
+ // 桶键:pisell.venueBooking.uiState:<cacheId>;内部以 JSON object 形式存储多个字段。
1635
+ // 无 cacheId 时所有方法自动降级为 no-op,上层不用判空。
1636
+ VenueBookingImpl.UI_STATE_KEY_PREFIX = "pisell.venueBooking.uiState:";
1574
1637
  // Annotate the CommonJS export names for ESM import in node:
1575
1638
  0 && (module.exports = {
1576
1639
  VenueBookingImpl,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "2.1.121",
4
+ "version": "2.1.123",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",