@pisell/pisellos 0.10.39 → 0.10.41
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/BookingContext/index.js +4 -4
- package/dist/modules/Customer/index.js +4 -2
- package/dist/modules/Customer/types.d.ts +2 -0
- package/dist/modules/Payment/types.d.ts +21 -1
- package/dist/modules/Payment/types.js +2 -0
- package/dist/modules/Payment/walletpass.d.ts +1 -1
- package/dist/modules/Payment/walletpass.js +80 -47
- package/dist/solution/BaseSales/index.d.ts +1 -0
- package/dist/solution/BaseSales/index.js +64 -43
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +1 -2
- package/dist/solution/BookingTicket/index.js +60 -63
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +2 -0
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +266 -150
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +5 -3
- package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +4 -0
- package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.js +8 -4
- package/dist/solution/UnifiedBookingSales/index.d.ts +2 -2
- package/dist/solution/UnifiedBookingSales/index.js +10 -10
- package/lib/model/strategy/adapter/promotion/index.js +46 -1
- package/lib/modules/BookingContext/index.js +3 -3
- package/lib/modules/Customer/index.js +4 -1
- package/lib/modules/Customer/types.d.ts +2 -0
- package/lib/modules/Payment/types.d.ts +21 -1
- package/lib/modules/Payment/types.js +1 -0
- package/lib/modules/Payment/walletpass.d.ts +1 -1
- package/lib/modules/Payment/walletpass.js +29 -9
- package/lib/solution/BaseSales/index.d.ts +1 -0
- package/lib/solution/BaseSales/index.js +18 -3
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +1 -2
- package/lib/solution/BookingTicket/index.js +36 -33
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +2 -0
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +127 -42
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +5 -3
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +4 -0
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +7 -3
- package/lib/solution/UnifiedBookingSales/index.d.ts +2 -2
- package/lib/solution/UnifiedBookingSales/index.js +4 -4
- package/package.json +1 -1
|
@@ -26,7 +26,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
26
26
|
import dayjs from 'dayjs';
|
|
27
27
|
import { BaseModule } from "../BaseModule";
|
|
28
28
|
import { RequestModeENUM } from "../../plugins/request";
|
|
29
|
-
import {
|
|
29
|
+
import { isCustomerUserPlatform } from "../../utils/platform";
|
|
30
30
|
import { BookingContextEvent } from "./types";
|
|
31
31
|
import { formatResourceListAndMap } from "./utils/formatResourceList";
|
|
32
32
|
export * from "./types";
|
|
@@ -158,9 +158,9 @@ export function buildBookingConfigQueryKey() {
|
|
|
158
158
|
}
|
|
159
159
|
function resolveBookingConfigRequest(platform) {
|
|
160
160
|
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
161
|
-
var
|
|
162
|
-
var endpoint =
|
|
163
|
-
var query =
|
|
161
|
+
var isCustomerPlatform = isCustomerUserPlatform(platform);
|
|
162
|
+
var endpoint = isCustomerPlatform ? H5_BOOKING_CONFIG_ENDPOINT : BOOKING_CONFIG_ENDPOINT;
|
|
163
|
+
var query = isCustomerPlatform ? {
|
|
164
164
|
item_type: params.item_type || DEFAULT_BOOKING_CONFIG_PARAMS.item_type
|
|
165
165
|
} : _objectSpread(_objectSpread({}, DEFAULT_BOOKING_CONFIG_PARAMS), params);
|
|
166
166
|
var keys = Object.keys(query).sort();
|
|
@@ -197,7 +197,7 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
197
197
|
url = '/franchisee/customer/select-list';
|
|
198
198
|
}
|
|
199
199
|
_params$skip = params.skip, skip = _params$skip === void 0 ? 1 : _params$skip, _params$num = params.num, num = _params$num === void 0 ? DEFAULT_PAGE_SIZE : _params$num, search = params.search, _otherParams = _objectWithoutProperties(params, _excluded);
|
|
200
|
-
queryParams = _objectSpread(_objectSpread({
|
|
200
|
+
queryParams = _objectSpread(_objectSpread(_objectSpread({
|
|
201
201
|
skip: skip,
|
|
202
202
|
num: num,
|
|
203
203
|
sort_by: SORT_BY,
|
|
@@ -206,7 +206,9 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
206
206
|
search_wallet_pass_flag: 1
|
|
207
207
|
}, search && {
|
|
208
208
|
search: search
|
|
209
|
-
}), _otherParams)
|
|
209
|
+
}), _otherParams), url === '/customer/select-list' ? {
|
|
210
|
+
with_franchisor_data: 1
|
|
211
|
+
} : {});
|
|
210
212
|
_context2.next = 7;
|
|
211
213
|
return this.request.get(url, queryParams, {
|
|
212
214
|
cache: {
|
|
@@ -412,6 +412,8 @@ export interface WalletAssetsBehaviorOptions {
|
|
|
412
412
|
export interface RefreshWalletAssetsOptions {
|
|
413
413
|
/** 商品/金额变化默认保留并重验选择;客户变化由实现层强制清空。 */
|
|
414
414
|
preserveSelection?: boolean;
|
|
415
|
+
/** 客户变化时,仅保留与本次扫码匹配的搜索结果;其他搜索缓存仍会清空。 */
|
|
416
|
+
retainSearchResultCodes?: string[];
|
|
415
417
|
}
|
|
416
418
|
export interface SelectWalletAssetOptions {
|
|
417
419
|
selected: boolean;
|
|
@@ -419,6 +421,8 @@ export interface SelectWalletAssetOptions {
|
|
|
419
421
|
}
|
|
420
422
|
export interface ScanWalletAssetResult {
|
|
421
423
|
type: SearchIdentificationCodeResult['type'];
|
|
424
|
+
/** walletCode 时保留完整 Wallet Detail,供客户解析与客户选择器使用。 */
|
|
425
|
+
data?: WalletDetailSearchData;
|
|
422
426
|
asset?: any;
|
|
423
427
|
selected: boolean;
|
|
424
428
|
state: WalletAssetsState;
|
|
@@ -864,6 +868,8 @@ export interface SearchIdentificationCodeParams extends WalletDeductionRecommend
|
|
|
864
868
|
* 搜索识别码响应数据
|
|
865
869
|
*/
|
|
866
870
|
export interface SearchIdentificationCodeResponse {
|
|
871
|
+
/** 业务是否成功 */
|
|
872
|
+
status?: boolean;
|
|
867
873
|
/** 响应状态码 */
|
|
868
874
|
code?: number;
|
|
869
875
|
/** 响应消息 */
|
|
@@ -871,12 +877,26 @@ export interface SearchIdentificationCodeResponse {
|
|
|
871
877
|
/** 响应数据 */
|
|
872
878
|
data?: SearchIdentificationCodeItem[];
|
|
873
879
|
}
|
|
880
|
+
/** Wallet code 精确搜索返回的 Wallet Detail。 */
|
|
881
|
+
export interface WalletDetailSearchData {
|
|
882
|
+
id?: string | number;
|
|
883
|
+
customer_id?: string | number;
|
|
884
|
+
customer?: Record<string, any> | null;
|
|
885
|
+
is_cross_shop_wallet?: boolean | 0 | 1;
|
|
886
|
+
[key: string]: any;
|
|
887
|
+
}
|
|
888
|
+
export interface WalletDetailSearchResponse {
|
|
889
|
+
status?: boolean;
|
|
890
|
+
code?: number;
|
|
891
|
+
message?: string;
|
|
892
|
+
data?: WalletDetailSearchData | null;
|
|
893
|
+
}
|
|
874
894
|
/**
|
|
875
895
|
* 搜索识别码结果类型
|
|
876
896
|
*/
|
|
877
897
|
export type SearchIdentificationCodeResult = {
|
|
878
898
|
type: 'walletCode';
|
|
879
|
-
data:
|
|
899
|
+
data: WalletDetailSearchData;
|
|
880
900
|
} | {
|
|
881
901
|
type: 'normalCode';
|
|
882
902
|
data: SearchIdentificationCodeItem[];
|
|
@@ -96,7 +96,7 @@ export declare class WalletPassPaymentImpl implements WalletPassPayment {
|
|
|
96
96
|
* 搜索识别码信息
|
|
97
97
|
* 通过识别码搜索相关的钱包通行证信息
|
|
98
98
|
* 基于 WalletDeductionRecommendParams 参数结构
|
|
99
|
-
*
|
|
99
|
+
* 特殊逻辑:WL 或指定 200 格式的 Wallet Code 调用 /wallet/detail/search 接口。
|
|
100
100
|
*/
|
|
101
101
|
searchIdentificationCodeAsync(params: SearchIdentificationCodeParams, config?: {
|
|
102
102
|
noCache?: boolean;
|
|
@@ -933,7 +933,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
|
|
|
933
933
|
* 搜索识别码信息
|
|
934
934
|
* 通过识别码搜索相关的钱包通行证信息
|
|
935
935
|
* 基于 WalletDeductionRecommendParams 参数结构
|
|
936
|
-
*
|
|
936
|
+
* 特殊逻辑:WL 或指定 200 格式的 Wallet Code 调用 /wallet/detail/search 接口。
|
|
937
937
|
*/
|
|
938
938
|
}, {
|
|
939
939
|
key: "searchIdentificationCodeAsync",
|
|
@@ -957,7 +957,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
|
|
|
957
957
|
isWalletCode,
|
|
958
958
|
walletDetailParams,
|
|
959
959
|
_response,
|
|
960
|
-
|
|
960
|
+
walletDetail,
|
|
961
961
|
baseWalletParams,
|
|
962
962
|
searchParams,
|
|
963
963
|
response,
|
|
@@ -981,13 +981,14 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
|
|
|
981
981
|
// 新钱包规则
|
|
982
982
|
isWalletCode = code.startsWith('WL') || code.startsWith('200') && code.length === 10;
|
|
983
983
|
if (!isWalletCode) {
|
|
984
|
-
_context7.next =
|
|
984
|
+
_context7.next = 16;
|
|
985
985
|
break;
|
|
986
986
|
}
|
|
987
987
|
// 钱包识别码直接调用专门接口,不缓存,直接返回
|
|
988
988
|
walletDetailParams = {
|
|
989
989
|
code: code,
|
|
990
990
|
with_customer: 1,
|
|
991
|
+
with_franchisor_data: 1,
|
|
991
992
|
with: ['wallet']
|
|
992
993
|
};
|
|
993
994
|
this.paymentModule.logInfo('[WalletPass] 搜索钱包识别码', {
|
|
@@ -999,17 +1000,23 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
|
|
|
999
1000
|
return this.paymentModule.request.post('/wallet/detail/search', walletDetailParams);
|
|
1000
1001
|
case 10:
|
|
1001
1002
|
_response = _context7.sent;
|
|
1002
|
-
|
|
1003
|
+
walletDetail = _response === null || _response === void 0 ? void 0 : _response.data;
|
|
1004
|
+
if (!((_response === null || _response === void 0 ? void 0 : _response.status) !== true || (_response === null || _response === void 0 ? void 0 : _response.code) !== 200 || !walletDetail || _typeof(walletDetail) !== 'object' || Array.isArray(walletDetail))) {
|
|
1005
|
+
_context7.next = 14;
|
|
1006
|
+
break;
|
|
1007
|
+
}
|
|
1008
|
+
throw new Error((_response === null || _response === void 0 ? void 0 : _response.message) || 'Wallet detail search failed');
|
|
1009
|
+
case 14:
|
|
1003
1010
|
this.paymentModule.logInfo('[WalletPass] 钱包识别码搜索完成', {
|
|
1004
1011
|
code: code,
|
|
1005
|
-
results_count:
|
|
1012
|
+
results_count: 1,
|
|
1006
1013
|
type: 'walletCode'
|
|
1007
1014
|
});
|
|
1008
1015
|
return _context7.abrupt("return", {
|
|
1009
1016
|
type: 'walletCode',
|
|
1010
|
-
data:
|
|
1017
|
+
data: walletDetail
|
|
1011
1018
|
});
|
|
1012
|
-
case
|
|
1019
|
+
case 16:
|
|
1013
1020
|
// 合并钱包参数和搜索参数
|
|
1014
1021
|
baseWalletParams = this.walletParams; // 构建完整的搜索参数,包含钱包扣款推荐的所有参数
|
|
1015
1022
|
searchParams = {
|
|
@@ -1037,20 +1044,20 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
|
|
|
1037
1044
|
if (typeof searchParams.payment_order_id === 'string' && searchParams.payment_order_id.startsWith('LOCAL_')) {
|
|
1038
1045
|
searchParams.payment_order_id = undefined;
|
|
1039
1046
|
}
|
|
1040
|
-
_context7.next =
|
|
1047
|
+
_context7.next = 22;
|
|
1041
1048
|
return this.paymentModule.request.post('/machinecode/prepare/deduction/search', searchParams);
|
|
1042
|
-
case
|
|
1049
|
+
case 22:
|
|
1043
1050
|
response = _context7.sent;
|
|
1044
1051
|
searchResults = (response === null || response === void 0 ? void 0 : response.data) || [];
|
|
1045
1052
|
if (!config.noCache) {
|
|
1046
|
-
_context7.next =
|
|
1053
|
+
_context7.next = 26;
|
|
1047
1054
|
break;
|
|
1048
1055
|
}
|
|
1049
1056
|
return _context7.abrupt("return", {
|
|
1050
1057
|
type: 'normalCode',
|
|
1051
1058
|
data: searchResults
|
|
1052
1059
|
});
|
|
1053
|
-
case
|
|
1060
|
+
case 26:
|
|
1054
1061
|
// 将搜索结果存储到缓存数组中
|
|
1055
1062
|
if (searchResults.length > 0) {
|
|
1056
1063
|
// 避免重复存储相同的识别码
|
|
@@ -1080,8 +1087,8 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
|
|
|
1080
1087
|
type: 'normalCode',
|
|
1081
1088
|
data: searchResults
|
|
1082
1089
|
});
|
|
1083
|
-
case
|
|
1084
|
-
_context7.prev =
|
|
1090
|
+
case 32:
|
|
1091
|
+
_context7.prev = 32;
|
|
1085
1092
|
_context7.t0 = _context7["catch"](1);
|
|
1086
1093
|
this.paymentModule.logError('[WalletPass] 搜索识别码信息失败', _context7.t0, {
|
|
1087
1094
|
code: params.code,
|
|
@@ -1089,11 +1096,11 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
|
|
|
1089
1096
|
order_expect_amount: params.order_expect_amount
|
|
1090
1097
|
});
|
|
1091
1098
|
throw _context7.t0;
|
|
1092
|
-
case
|
|
1099
|
+
case 36:
|
|
1093
1100
|
case "end":
|
|
1094
1101
|
return _context7.stop();
|
|
1095
1102
|
}
|
|
1096
|
-
}, _callee7, this, [[1,
|
|
1103
|
+
}, _callee7, this, [[1, 32]]);
|
|
1097
1104
|
}));
|
|
1098
1105
|
function searchIdentificationCodeAsync(_x8) {
|
|
1099
1106
|
return _searchIdentificationCodeAsync.apply(this, arguments);
|
|
@@ -1119,6 +1126,9 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
|
|
|
1119
1126
|
previousCustomerId,
|
|
1120
1127
|
customerChanged,
|
|
1121
1128
|
preserveSelection,
|
|
1129
|
+
retainedSearchCodeKeys,
|
|
1130
|
+
retainedSearchResults,
|
|
1131
|
+
preserveSearchContext,
|
|
1122
1132
|
committedKeys,
|
|
1123
1133
|
committedItems,
|
|
1124
1134
|
selectedIds,
|
|
@@ -1153,9 +1163,20 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
|
|
|
1153
1163
|
previousCustomerId = this.walletAssetsState.customerId;
|
|
1154
1164
|
customerChanged = String(previousCustomerId !== null && previousCustomerId !== void 0 ? previousCustomerId : '') !== String(nextCustomerId !== null && nextCustomerId !== void 0 ? nextCustomerId : '');
|
|
1155
1165
|
preserveSelection = options.preserveSelection !== false && !customerChanged;
|
|
1166
|
+
retainedSearchCodeKeys = new Set((options.retainSearchResultCodes || []).map(normalizeWalletAssetCode).filter(Boolean));
|
|
1167
|
+
retainedSearchResults = customerChanged && retainedSearchCodeKeys.size > 0 ? this.searchResults.filter(function (item) {
|
|
1168
|
+
return isWalletPaymentAsset(item) && getWalletAssetCodeKeys(item).some(function (code) {
|
|
1169
|
+
return retainedSearchCodeKeys.has(code);
|
|
1170
|
+
});
|
|
1171
|
+
}) : [];
|
|
1156
1172
|
if (customerChanged) {
|
|
1157
1173
|
this.clearSearchResults();
|
|
1174
|
+
if (retainedSearchResults.length > 0) {
|
|
1175
|
+
this.searchResults = mergeWalletAssets(retainedSearchResults);
|
|
1176
|
+
this.queuePendingAutoSelectForAssets(retainedSearchResults);
|
|
1177
|
+
}
|
|
1158
1178
|
}
|
|
1179
|
+
preserveSearchContext = preserveSelection || retainedSearchResults.length > 0;
|
|
1159
1180
|
committedKeys = new Set(this.walletAssetsState.committedIds.map(function (id) {
|
|
1160
1181
|
return String(id);
|
|
1161
1182
|
}));
|
|
@@ -1180,7 +1201,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
|
|
|
1180
1201
|
// 清空购物车时保留扫码资产供后续加购恢复;只有手动 Remove/Clear
|
|
1181
1202
|
// 会取消自动应用资格,商品变化导致的自动失效需要重新进入待选队列。
|
|
1182
1203
|
if ((_businessData$product2 = businessData.products) !== null && _businessData$product2 !== void 0 && _businessData$product2.length) {
|
|
1183
|
-
_context8.next =
|
|
1204
|
+
_context8.next = 27;
|
|
1184
1205
|
break;
|
|
1185
1206
|
}
|
|
1186
1207
|
this.queuePendingAutoSelectForAssets(scanSelectedAssets);
|
|
@@ -1218,7 +1239,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
|
|
|
1218
1239
|
totalSelectedAmount: 0,
|
|
1219
1240
|
error: null
|
|
1220
1241
|
}));
|
|
1221
|
-
case
|
|
1242
|
+
case 27:
|
|
1222
1243
|
this.publishWalletAssetsState({
|
|
1223
1244
|
status: 'loading',
|
|
1224
1245
|
customerId: nextCustomerId,
|
|
@@ -1229,40 +1250,40 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
|
|
|
1229
1250
|
totalSelectedAmount: preserveSelection ? this.walletAssetsState.totalSelectedAmount : 0,
|
|
1230
1251
|
error: null
|
|
1231
1252
|
});
|
|
1232
|
-
_context8.prev =
|
|
1233
|
-
searchedWalletAssetCodes =
|
|
1234
|
-
useAggregateRecalculate =
|
|
1253
|
+
_context8.prev = 28;
|
|
1254
|
+
searchedWalletAssetCodes = preserveSearchContext ? this.getSearchedWalletAssetCodes() : [];
|
|
1255
|
+
useAggregateRecalculate = preserveSearchContext && (selectedIds.length > 0 || searchedWalletAssetCodes.length > 0);
|
|
1235
1256
|
if (!useAggregateRecalculate) {
|
|
1236
|
-
_context8.next =
|
|
1257
|
+
_context8.next = 37;
|
|
1237
1258
|
break;
|
|
1238
1259
|
}
|
|
1239
|
-
_context8.next =
|
|
1260
|
+
_context8.next = 34;
|
|
1240
1261
|
return this.aggregateRecalculateWalletAssetsAsync(businessData, selectedIds);
|
|
1241
|
-
case
|
|
1262
|
+
case 34:
|
|
1242
1263
|
_context8.t0 = _context8.sent;
|
|
1243
|
-
_context8.next =
|
|
1264
|
+
_context8.next = 38;
|
|
1244
1265
|
break;
|
|
1245
|
-
case
|
|
1266
|
+
case 37:
|
|
1246
1267
|
_context8.t0 = null;
|
|
1247
|
-
case
|
|
1268
|
+
case 38:
|
|
1248
1269
|
aggregateResult = _context8.t0;
|
|
1249
1270
|
_context8.t1 = aggregateResult;
|
|
1250
1271
|
if (_context8.t1) {
|
|
1251
|
-
_context8.next =
|
|
1272
|
+
_context8.next = 44;
|
|
1252
1273
|
break;
|
|
1253
1274
|
}
|
|
1254
|
-
_context8.next =
|
|
1275
|
+
_context8.next = 43;
|
|
1255
1276
|
return this.initializeWalletDataFromBusinessAsync(businessData);
|
|
1256
|
-
case
|
|
1277
|
+
case 43:
|
|
1257
1278
|
_context8.t1 = _context8.sent;
|
|
1258
|
-
case
|
|
1279
|
+
case 44:
|
|
1259
1280
|
result = _context8.t1;
|
|
1260
1281
|
if (!(requestSequence !== this.walletAssetsRequestSequence)) {
|
|
1261
|
-
_context8.next =
|
|
1282
|
+
_context8.next = 47;
|
|
1262
1283
|
break;
|
|
1263
1284
|
}
|
|
1264
1285
|
return _context8.abrupt("return", this.getWalletAssetsState());
|
|
1265
|
-
case
|
|
1286
|
+
case 47:
|
|
1266
1287
|
this.walletAssetsCalculationContext = {
|
|
1267
1288
|
orderTotalAmount: Number(businessData.order_wait_pay_amount || 0),
|
|
1268
1289
|
products: result.products || businessData.products || []
|
|
@@ -1283,13 +1304,13 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
|
|
|
1283
1304
|
});
|
|
1284
1305
|
}
|
|
1285
1306
|
}
|
|
1286
|
-
searchedWalletAssets =
|
|
1307
|
+
searchedWalletAssets = preserveSearchContext ? this.syncSearchedWalletAssets([].concat(_toConsumableArray(result.transformList || []), _toConsumableArray(result.noApplicableVoucher || []))) : [];
|
|
1287
1308
|
if (!(requestSequence !== this.walletAssetsRequestSequence)) {
|
|
1288
|
-
_context8.next =
|
|
1309
|
+
_context8.next = 53;
|
|
1289
1310
|
break;
|
|
1290
1311
|
}
|
|
1291
1312
|
return _context8.abrupt("return", this.getWalletAssetsState());
|
|
1292
|
-
case
|
|
1313
|
+
case 53:
|
|
1293
1314
|
recommendedKeys = new Set((result.walletRecommendList || []).map(function (asset) {
|
|
1294
1315
|
return getWalletAssetKey(asset);
|
|
1295
1316
|
}));
|
|
@@ -1335,15 +1356,15 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
|
|
|
1335
1356
|
});
|
|
1336
1357
|
this.queuePendingAutoSelectForAssets(droppedScanSelectedAssets);
|
|
1337
1358
|
return _context8.abrupt("return", nextState);
|
|
1338
|
-
case
|
|
1339
|
-
_context8.prev =
|
|
1340
|
-
_context8.t2 = _context8["catch"](
|
|
1359
|
+
case 68:
|
|
1360
|
+
_context8.prev = 68;
|
|
1361
|
+
_context8.t2 = _context8["catch"](28);
|
|
1341
1362
|
if (!(requestSequence !== this.walletAssetsRequestSequence)) {
|
|
1342
|
-
_context8.next =
|
|
1363
|
+
_context8.next = 72;
|
|
1343
1364
|
break;
|
|
1344
1365
|
}
|
|
1345
1366
|
return _context8.abrupt("return", this.getWalletAssetsState());
|
|
1346
|
-
case
|
|
1367
|
+
case 72:
|
|
1347
1368
|
this.paymentModule.logError('[WalletPass] 刷新共享钱包资产失败,保留刷新前状态', _context8.t2, {
|
|
1348
1369
|
customer_id: businessData.customer_id,
|
|
1349
1370
|
selected_ids: selectedIds,
|
|
@@ -1359,11 +1380,11 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
|
|
|
1359
1380
|
customerId: nextCustomerId,
|
|
1360
1381
|
error: _context8.t2 instanceof Error ? _context8.t2.message : String(_context8.t2)
|
|
1361
1382
|
}));
|
|
1362
|
-
case
|
|
1383
|
+
case 74:
|
|
1363
1384
|
case "end":
|
|
1364
1385
|
return _context8.stop();
|
|
1365
1386
|
}
|
|
1366
|
-
}, _callee8, this, [[
|
|
1387
|
+
}, _callee8, this, [[28, 68]]);
|
|
1367
1388
|
}));
|
|
1368
1389
|
function refreshWalletAssetsFromBusinessAsync(_x9) {
|
|
1369
1390
|
return _refreshWalletAssetsFromBusinessAsync.apply(this, arguments);
|
|
@@ -1541,6 +1562,18 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
|
|
|
1541
1562
|
}));
|
|
1542
1563
|
case 9:
|
|
1543
1564
|
result = _context9.sent;
|
|
1565
|
+
if (!(result.type === 'walletCode')) {
|
|
1566
|
+
_context9.next = 12;
|
|
1567
|
+
break;
|
|
1568
|
+
}
|
|
1569
|
+
return _context9.abrupt("return", {
|
|
1570
|
+
type: 'walletCode',
|
|
1571
|
+
data: result.data,
|
|
1572
|
+
asset: result.data,
|
|
1573
|
+
selected: false,
|
|
1574
|
+
state: this.getWalletAssetsState()
|
|
1575
|
+
});
|
|
1576
|
+
case 12:
|
|
1544
1577
|
paymentAssets = this.formatSearchedWalletPaymentAssets(result.data.filter(isWalletPaymentAsset));
|
|
1545
1578
|
if (paymentAssets.length > 0) {
|
|
1546
1579
|
this.searchResults = mergeWalletAssets(this.searchResults, paymentAssets);
|
|
@@ -1548,17 +1581,17 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
|
|
|
1548
1581
|
asset = paymentAssets.find(function (item) {
|
|
1549
1582
|
return String((item === null || item === void 0 ? void 0 : item.code) || '') === normalizedCode;
|
|
1550
1583
|
}) || paymentAssets[0];
|
|
1551
|
-
if (
|
|
1552
|
-
_context9.next =
|
|
1584
|
+
if (asset) {
|
|
1585
|
+
_context9.next = 17;
|
|
1553
1586
|
break;
|
|
1554
1587
|
}
|
|
1555
1588
|
return _context9.abrupt("return", {
|
|
1556
|
-
type:
|
|
1589
|
+
type: 'normalCode',
|
|
1557
1590
|
asset: asset,
|
|
1558
1591
|
selected: false,
|
|
1559
1592
|
state: this.getWalletAssetsState()
|
|
1560
1593
|
});
|
|
1561
|
-
case
|
|
1594
|
+
case 17:
|
|
1562
1595
|
items = mergeWalletAssets(this.walletAssetsState.items, [asset]);
|
|
1563
1596
|
recalculatedState = this.recalculateWalletAssets(items, this.walletAssetsState.selectedIds, this.walletAssetsState.selectionSources);
|
|
1564
1597
|
assetId = getWalletAssetId(asset);
|
|
@@ -1588,7 +1621,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
|
|
|
1588
1621
|
selected: isSelected,
|
|
1589
1622
|
state: selected
|
|
1590
1623
|
});
|
|
1591
|
-
case
|
|
1624
|
+
case 27:
|
|
1592
1625
|
case "end":
|
|
1593
1626
|
return _context9.stop();
|
|
1594
1627
|
}
|
|
@@ -397,6 +397,7 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
397
397
|
refreshWalletAssets(params?: {
|
|
398
398
|
order_wait_pay_amount?: number;
|
|
399
399
|
preserveSelection?: boolean;
|
|
400
|
+
retainSearchResultCodes?: string[];
|
|
400
401
|
}): Promise<WalletAssetsState>;
|
|
401
402
|
/** 选择或取消单张钱包资产,并立即同步 pending wallet payments。 */
|
|
402
403
|
selectWalletAsset(params: {
|