@pisell/pisellos 2.3.56 → 2.3.57
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/core/index.js
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// 导出评估器
|
|
2
|
+
export { PromotionEvaluator } from "./evaluator";
|
|
3
|
+
|
|
4
|
+
// 导出适配器
|
|
5
|
+
export { PromotionAdapter } from "./adapter";
|
|
6
|
+
export { default } from "./adapter";
|
|
7
|
+
|
|
8
|
+
// 导出策略配置示例常量
|
|
9
|
+
export { X_ITEMS_FOR_Y_PRICE_STRATEGY, BUY_X_GET_Y_FREE_STRATEGY, ITEM_REWARD_STRATEGY } from "./examples";
|
|
@@ -4049,7 +4049,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4049
4049
|
key: "scanWalletAsset",
|
|
4050
4050
|
value: (function () {
|
|
4051
4051
|
var _scanWalletAsset = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42(code) {
|
|
4052
|
-
var result;
|
|
4052
|
+
var wallet, businessData, result;
|
|
4053
4053
|
return _regeneratorRuntime().wrap(function _callee42$(_context42) {
|
|
4054
4054
|
while (1) switch (_context42.prev = _context42.next) {
|
|
4055
4055
|
case 0:
|
|
@@ -4059,22 +4059,27 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4059
4059
|
}
|
|
4060
4060
|
throw new Error('payment 模块未初始化');
|
|
4061
4061
|
case 2:
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4062
|
+
wallet = this.store.payment.wallet; // 扫码可能早于后台 Wallet 刷新,搜索参数必须以当前订单为准。
|
|
4063
|
+
businessData = this.buildWalletInitBusinessData();
|
|
4064
|
+
if (businessData) {
|
|
4065
|
+
wallet.generateWalletParams(businessData);
|
|
4066
|
+
}
|
|
4067
|
+
_context42.next = 7;
|
|
4068
|
+
return wallet.scanWalletAssetAsync(code);
|
|
4069
|
+
case 7:
|
|
4065
4070
|
result = _context42.sent;
|
|
4066
4071
|
if (!(result.type === 'normalCode')) {
|
|
4067
|
-
_context42.next =
|
|
4072
|
+
_context42.next = 13;
|
|
4068
4073
|
break;
|
|
4069
4074
|
}
|
|
4070
|
-
_context42.next =
|
|
4075
|
+
_context42.next = 11;
|
|
4071
4076
|
return this.syncSelectedWalletAssets(result.state);
|
|
4072
|
-
case
|
|
4073
|
-
_context42.next =
|
|
4077
|
+
case 11:
|
|
4078
|
+
_context42.next = 13;
|
|
4074
4079
|
return this.publishWalletAssetsState(result.state);
|
|
4075
|
-
case
|
|
4080
|
+
case 13:
|
|
4076
4081
|
return _context42.abrupt("return", result);
|
|
4077
|
-
case
|
|
4082
|
+
case 14:
|
|
4078
4083
|
case "end":
|
|
4079
4084
|
return _context42.stop();
|
|
4080
4085
|
}
|
package/lib/core/index.js
CHANGED
|
@@ -2661,7 +2661,12 @@ var BaseSalesImpl = class extends import_BaseModule.BaseModule {
|
|
|
2661
2661
|
async scanWalletAsset(code) {
|
|
2662
2662
|
if (!this.store.payment)
|
|
2663
2663
|
throw new Error("payment 模块未初始化");
|
|
2664
|
-
const
|
|
2664
|
+
const wallet = this.store.payment.wallet;
|
|
2665
|
+
const businessData = this.buildWalletInitBusinessData();
|
|
2666
|
+
if (businessData) {
|
|
2667
|
+
wallet.generateWalletParams(businessData);
|
|
2668
|
+
}
|
|
2669
|
+
const result = await wallet.scanWalletAssetAsync(code);
|
|
2665
2670
|
if (result.type === "normalCode") {
|
|
2666
2671
|
await this.syncSelectedWalletAssets(result.state);
|
|
2667
2672
|
await this.publishWalletAssetsState(result.state);
|