@pisell/pisellos 2.2.150 → 2.2.152

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.
@@ -50,7 +50,15 @@ function formatReason(template, value) {
50
50
  var c = currency === undefined || currency === null ? '' : String(currency);
51
51
  // 注意:必须先替换 value,再替换 currency
52
52
  // 否则 currency 注入的 "$" 会被后续的 /\$\{value\}/ 正则误吞
53
- return template.replace(/\$\{value\}/g, v).replace(/\{value\}/g, v).replace(/\{currency\}/g, c);
53
+ // 使用函数作为替换参数,避免替换串中的 "$" 被 String.prototype.replace
54
+ // 当作特殊序列(如 $$ -> $、$& 等)处理
55
+ return template.replace(/\$\{value\}/g, function () {
56
+ return v;
57
+ }).replace(/\{value\}/g, function () {
58
+ return v;
59
+ }).replace(/\{currency\}/g, function () {
60
+ return c;
61
+ });
54
62
  }
55
63
 
56
64
  /**
@@ -249,6 +257,7 @@ export var WalletPassEvaluator = /*#__PURE__*/function () {
249
257
  var rawText = this.getText(reasonCode);
250
258
  // 金额类型字段:从 otherParams.getData 取货币符号;非金额或取不到则留空
251
259
  var currency = failedField && AMOUNT_FIELDS.has(failedField) ? ((_this$otherParams = this.otherParams) === null || _this$otherParams === void 0 || (_this$otherParams$get = (_this$otherParams2 = _this$otherParams).getData) === null || _this$otherParams$get === void 0 ? void 0 : _this$otherParams$get.call(_this$otherParams2, 'shop_symbol')) || '' : '';
260
+ console.log(currency, 'currency12345');
252
261
  var reason = thresholdValue !== undefined ? formatReason(rawText, thresholdValue, currency) : rawText;
253
262
  results.push({
254
263
  voucher: voucher,
@@ -25,6 +25,15 @@ export declare class ScheduleModule extends BaseModule implements Module, Schedu
25
25
  setOtherProductsIds(ids: number[]): void;
26
26
  getOtherProductsIds(): number[];
27
27
  storeChange(): void;
28
+ /**
29
+ * 传入一个时间, 判断改时间是否在schedule 内
30
+ * @param param0 { date: string, schedule: any } date: 日期, schedule: schedule
31
+ * @returns
32
+ */
33
+ isInScheduleByDate({ date, schedule, }: {
34
+ date: string;
35
+ schedule: any;
36
+ }): boolean;
28
37
  /**
29
38
  * 传入一个时间, 判断改时间是否在schedule 内
30
39
  * @param param0 { date: string, schedule: any } date: 日期, schedule: schedule
@@ -243,6 +243,18 @@ export var ScheduleModule = /*#__PURE__*/function (_BaseModule) {
243
243
  });
244
244
  }
245
245
  }
246
+ /**
247
+ * 传入一个时间, 判断改时间是否在schedule 内
248
+ * @param param0 { date: string, schedule: any } date: 日期, schedule: schedule
249
+ * @returns
250
+ */
251
+ }, {
252
+ key: "isInScheduleByDate",
253
+ value: function isInScheduleByDate(_ref2) {
254
+ var date = _ref2.date,
255
+ schedule = _ref2.schedule;
256
+ return getDateIsInSchedule(date, [schedule]);
257
+ }
246
258
  /**
247
259
  * 传入一个时间, 判断改时间是否在schedule 内
248
260
  * @param param0 { date: string, schedule: any } date: 日期, schedule: schedule
@@ -250,10 +262,10 @@ export var ScheduleModule = /*#__PURE__*/function (_BaseModule) {
250
262
  */
251
263
  }], [{
252
264
  key: "isInScheduleByDate",
253
- value: function isInScheduleByDate(_ref2) {
265
+ value: function isInScheduleByDate(_ref3) {
254
266
  var _schedule$repeat_rule, _schedule$repeat_rule2;
255
- var date = _ref2.date,
256
- schedule = _ref2.schedule;
267
+ var date = _ref3.date,
268
+ schedule = _ref3.schedule;
257
269
  return getDateIsInSchedule(date, [schedule]);
258
270
  if (schedule.start_time && schedule.end_time) {
259
271
  var isBeforeStartTime = dayjs(date).isBefore(dayjs(schedule.start_time));
@@ -115,6 +115,12 @@ declare class Server {
115
115
  * 不影响当前界面展示,适用于切回前台、定时刷新等场景
116
116
  */
117
117
  refreshProductsInBackground(): Promise<void>;
118
+ /**
119
+ * 后台静默刷新订单数据
120
+ * 重新拉取全量 SSE 接口,更新本地数据后触发 onOrdersSyncCompleted
121
+ * 不影响当前界面展示,适用于切回前台、定时刷新等场景
122
+ */
123
+ refreshOrdersInBackground(): Promise<void>;
118
124
  /**
119
125
  * 清空所有server模块的IndexedDB缓存
120
126
  * @returns Promise<void>