bxs-tools-ui 3.2.0 → 3.3.0
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/README.md +20 -20
- package/es/add-and-take/index.css +1 -1
- package/es/add-and-take/index.js +283 -64
- package/es/adjust-baoe/index.css +1 -1
- package/es/adjust-baoe/index.js +444 -195
- package/es/business-card/index.css +1 -1
- package/es/business-card/index.js +1 -0
- package/es/canvas-poster/index.css +1 -1
- package/es/canvas-poster/index.js +1 -0
- package/es/index.css +1 -1
- package/es/index.js +936 -824
- package/es/insure-calculate/index.css +1 -1
- package/es/insure-calculate/index.js +438 -265
- package/es/person-info/index.css +1 -1
- package/es/person-info/index.js +296 -1370
- package/es/product-info/index.css +1 -1
- package/es/product-info/index.js +644 -548
- package/es/share-sheet/index.css +1 -1
- package/es/share-sheet/index.js +313 -21
- package/es/utils/index.js +530 -429
- package/lib/add-and-take/index.css +1 -1
- package/lib/add-and-take/index.js +283 -64
- package/lib/adjust-baoe/index.css +1 -1
- package/lib/adjust-baoe/index.js +441 -194
- package/lib/business-card/index.css +1 -1
- package/lib/business-card/index.js +1 -0
- package/lib/canvas-poster/index.css +1 -1
- package/lib/canvas-poster/index.js +1 -0
- package/lib/index.css +1 -1
- package/lib/index.js +939 -826
- package/lib/insure-calculate/index.css +1 -1
- package/lib/insure-calculate/index.js +438 -268
- package/lib/person-info/index.css +1 -1
- package/lib/person-info/index.js +295 -1372
- package/lib/product-info/index.css +1 -1
- package/lib/product-info/index.js +645 -550
- package/lib/share-sheet/index.css +1 -1
- package/lib/share-sheet/index.js +313 -25
- package/lib/utils/index.js +531 -433
- package/package.json +9 -7
- package/packages/add-and-take/components/interest-form.less +144 -0
- package/packages/add-and-take/components/interest-form.vue +179 -179
- package/packages/add-and-take/components/interest-items.less +87 -0
- package/packages/add-and-take/components/interest-items.vue +67 -80
- package/packages/add-and-take/components/interest-table.less +111 -0
- package/packages/add-and-take/components/interest-table.vue +31 -31
- package/packages/add-and-take/constant.ts +2 -2
- package/packages/add-and-take/demo/index.vue +89 -86
- package/packages/add-and-take/handler.ts +52 -57
- package/packages/add-and-take/index.less +69 -0
- package/packages/add-and-take/index.vue +156 -156
- package/packages/add-and-take/readme.md +87 -98
- package/packages/adjust-baoe/demo/index.vue +37 -47
- package/packages/adjust-baoe/index.less +125 -0
- package/packages/adjust-baoe/index.vue +134 -147
- package/packages/adjust-baoe/readme.md +35 -45
- package/packages/business-card/demo/index.vue +7 -7
- package/packages/business-card/index.less +100 -0
- package/packages/business-card/index.vue +18 -21
- package/packages/business-card/readme.md +46 -53
- package/packages/bxs-utils/demo/index.vue +2 -2
- package/packages/bxs-utils/index.ts +5 -5
- package/packages/bxs-utils/planbook/common.ts +56 -92
- package/packages/bxs-utils/planbook/index.ts +4 -4
- package/packages/bxs-utils/planbook/insurance.ts +137 -127
- package/packages/bxs-utils/planbook/person.ts +143 -147
- package/packages/bxs-utils/planbook/product.ts +473 -509
- package/packages/bxs-utils/readme.md +94 -84
- package/packages/bxs-utils/trade/index.js +1 -1
- package/packages/bxs-utils/trade/insureCalculate.js +91 -204
- package/packages/canvas-poster/demo/index.vue +9 -13
- package/packages/canvas-poster/index.less +5 -0
- package/packages/canvas-poster/index.vue +68 -79
- package/packages/canvas-poster/readme.md +106 -109
- package/packages/index.ts +1 -1
- package/packages/insure-calculate/demo/index.vue +20 -20
- package/packages/insure-calculate/index.less +366 -0
- package/packages/insure-calculate/index.vue +305 -329
- package/packages/insure-calculate/readme.md +99 -106
- package/packages/person-info/crm-popup.vue +81 -80
- package/packages/person-info/demo/index.vue +25 -37
- package/packages/person-info/index-inline.less +11 -0
- package/packages/person-info/index.vue +53 -83
- package/packages/person-info/readme.md +109 -115
- package/packages/planbook-input/components/footer.less +54 -0
- package/packages/planbook-input/components/footer.vue +8 -64
- package/packages/planbook-input/components/handler.js +33 -44
- package/packages/planbook-input/components/product-table.less +235 -0
- package/packages/planbook-input/components/product-table.vue +114 -108
- package/packages/planbook-input/demo/index.vue +3 -3
- package/packages/planbook-input/helper.js +852 -465
- package/packages/planbook-input/index.less +30 -0
- package/packages/planbook-input/index.vue +86 -103
- package/packages/planbook-input/readme.md +72 -90
- package/packages/product-info/demo/constant.js +1 -1
- package/packages/product-info/demo/index.vue +31 -43
- package/packages/product-info/index.less +271 -0
- package/packages/product-info/index.vue +198 -210
- package/packages/product-info/readme.md +72 -75
- package/packages/share-sheet/constant.js +4 -4
- package/packages/share-sheet/demo/index.vue +10 -10
- package/packages/share-sheet/handler.js +14 -14
- package/packages/share-sheet/index.less +201 -0
- package/packages/share-sheet/index.vue +39 -39
- package/packages/share-sheet/readme.md +121 -127
- package/src/api/add-and-take.js +45 -0
- package/src/api/adjust-baoe.js +16 -0
- package/src/api/index.js +6 -0
- package/src/api/planbook.js +93 -0
- package/src/api/request.js +211 -0
- package/src/api/trade.js +56 -0
- package/src/api/user.js +18 -0
- package/src/components/common/common-age-birthday.less +66 -0
- package/src/components/common/common-age-birthday.vue +27 -95
- package/src/components/common/common-popup.less +81 -0
- package/src/components/common/common-popup.vue +12 -96
- package/src/components/common/common-radio.less +75 -0
- package/src/components/common/common-radio.vue +13 -91
- package/src/components/common/common-select.less +13 -0
- package/src/components/common/common-select.vue +21 -38
- package/src/components/common/common-title.less +115 -0
- package/src/components/common/common-title.vue +24 -24
- package/src/js/loading.js +6 -6
- package/src/js/md5Token.js +38 -44
- package/src/js/utils.js +45 -53
- package/src/js/variables.js +47 -25
- package/src/style/base.less +18 -0
- package/src/style/color.less +40 -0
- package/src/style/variables.less +21 -42
- package/packages/add-and-take/api.ts +0 -70
- package/packages/add-and-take/components/interest-form.css +0 -146
- package/packages/add-and-take/components/interest-items.css +0 -87
- package/packages/add-and-take/components/interest-table.css +0 -113
- package/packages/add-and-take/index.css +0 -70
- package/packages/adjust-baoe/index.css +0 -123
- package/packages/business-card/index.css +0 -101
- package/packages/canvas-poster/index.css +0 -5
- package/packages/insure-calculate/index.css +0 -368
- package/packages/planbook-input/api.js +0 -29
- package/packages/planbook-input/components/product-table.css +0 -236
- package/packages/planbook-input/index.css +0 -31
- package/packages/product-info/index.css +0 -264
- package/packages/share-sheet/index.css +0 -203
- package/src/components/common/common-title.css +0 -116
- package/src/js/request.js +0 -64
- package/src/style/apply.css +0 -25
- package/src/style/base.css +0 -36
- package/src/style/color.css +0 -74
package/es/product-info/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import Vue from 'vue';
|
|
2
|
-
import { memoize, cloneDeep, get } from 'lodash';
|
|
2
|
+
import { memoize, cloneDeep, findLastIndex, get } from 'lodash';
|
|
3
3
|
import QS from 'qs';
|
|
4
|
-
import
|
|
4
|
+
import 'vant/lib/dialog/index.css';
|
|
5
|
+
import _Dialog from 'vant/lib/dialog';
|
|
5
6
|
import 'vant/lib/toast/index.css';
|
|
6
7
|
import _Toast from 'vant/lib/toast';
|
|
7
8
|
import MD5 from 'md5';
|
|
@@ -8914,12 +8915,27 @@ var jaxExports = requireJax();
|
|
|
8914
8915
|
const Jax = /*@__PURE__*/getDefaultExportFromCjs(jaxExports);
|
|
8915
8916
|
|
|
8916
8917
|
var getStandardOrigin = Jax.urlUtil.getStandardOrigin;
|
|
8918
|
+
var _Jax$parseUaString = Jax.parseUaString();
|
|
8919
|
+
_Jax$parseUaString.isApp;
|
|
8920
|
+
_Jax$parseUaString.appType;
|
|
8921
|
+
var appVersion = _Jax$parseUaString.appVersion;
|
|
8922
|
+
_Jax$parseUaString.isAndroid;
|
|
8923
|
+
var isIos = _Jax$parseUaString.isIos;
|
|
8924
|
+
_Jax$parseUaString.isBxsApp;
|
|
8925
|
+
_Jax$parseUaString.isBaoXiaoZhuApp;
|
|
8926
|
+
_Jax$parseUaString.isBrokerApp;
|
|
8927
|
+
_Jax$parseUaString.isYjjApp;
|
|
8928
|
+
_Jax$parseUaString.isToBApp;
|
|
8929
|
+
_Jax$parseUaString.isRongYiBaoApp;
|
|
8930
|
+
_Jax$parseUaString.isWeChat;
|
|
8931
|
+
_Jax$parseUaString.appScheme;
|
|
8917
8932
|
var hostname = window && window.location && window.location.hostname || '';
|
|
8918
8933
|
/** 当前页 host 为 cppoc- 前缀时,请求 loading 使用 Vant Toast,否则走 appBridge */
|
|
8919
8934
|
var IS_CPPOC_HOST = hostname.startsWith('cppoc-');
|
|
8920
8935
|
var IS_PRODUCT_ENV = hostname.search(/(winbaoxian|ai-baoxiaozhu)\.com/) !== -1;
|
|
8921
8936
|
hostname.search(/(winbaoxian|ai-baoxiaozhu)\.cn/) !== -1;
|
|
8922
8937
|
hostname.search(/localhost|192\.168|127\.0\.0\.1|dev\.winbaoxian\.cn/) !== -1;
|
|
8938
|
+
var IS_LOCALHOST_IP_ENV = hostname.search(/192\.168/) !== -1;
|
|
8923
8939
|
var IS_UAT_ENV = hostname.includes("pbf-uat.");
|
|
8924
8940
|
var IS_ENABLE_DEBUG = !IS_PRODUCT_ENV;
|
|
8925
8941
|
if (IS_ENABLE_DEBUG) {
|
|
@@ -8927,6 +8943,9 @@ if (IS_ENABLE_DEBUG) {
|
|
|
8927
8943
|
}
|
|
8928
8944
|
hostname.includes('ai-baoxiaozhu') ? 'ai-baoxiaozhu' : 'winbaoxian';
|
|
8929
8945
|
function getFullOrigin(data) {
|
|
8946
|
+
if (IS_LOCALHOST_IP_ENV) {
|
|
8947
|
+
return "https://".concat(data, ".winbaoxian.cn");
|
|
8948
|
+
}
|
|
8930
8949
|
var _prefixDomain = IS_CPPOC_HOST ? 'cppoc-' : '';
|
|
8931
8950
|
if (typeof data === 'string') {
|
|
8932
8951
|
return getStandardOrigin("".concat(_prefixDomain).concat(data));
|
|
@@ -8949,6 +8968,278 @@ function getUrlParams(url) {
|
|
|
8949
8968
|
return _searchStr ? QS.parse(_searchStr) : {};
|
|
8950
8969
|
}
|
|
8951
8970
|
|
|
8971
|
+
function showLoading() {
|
|
8972
|
+
if (IS_CPPOC_HOST) {
|
|
8973
|
+
_Toast.loading({
|
|
8974
|
+
message: '加载中...',
|
|
8975
|
+
forbidClick: true
|
|
8976
|
+
});
|
|
8977
|
+
} else if (window.appBridge && window.appBridge.showLoading) {
|
|
8978
|
+
window.appBridge.showLoading();
|
|
8979
|
+
}
|
|
8980
|
+
}
|
|
8981
|
+
function hideLoading() {
|
|
8982
|
+
if (IS_CPPOC_HOST) {
|
|
8983
|
+
_Toast.clear();
|
|
8984
|
+
} else if (window.appBridge && window.appBridge.hideLoading) {
|
|
8985
|
+
window.appBridge.hideLoading();
|
|
8986
|
+
}
|
|
8987
|
+
}
|
|
8988
|
+
|
|
8989
|
+
function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8990
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), true).forEach(function (r) { _defineProperty$1(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8991
|
+
var options = {
|
|
8992
|
+
baseURL: PLANBOOK_API_HOSTNAME,
|
|
8993
|
+
withCredentials: true,
|
|
8994
|
+
timeout: 10000,
|
|
8995
|
+
headers: {
|
|
8996
|
+
'X-Requested-With': 'XMLHttpRequest'
|
|
8997
|
+
}
|
|
8998
|
+
};
|
|
8999
|
+
var loadingTimer = null;
|
|
9000
|
+
var showRequestLoading = function showRequestLoading() {
|
|
9001
|
+
if (loadingTimer) {
|
|
9002
|
+
clearTimeout(loadingTimer);
|
|
9003
|
+
}
|
|
9004
|
+
loadingTimer = setTimeout(function () {
|
|
9005
|
+
showLoading();
|
|
9006
|
+
}, 300);
|
|
9007
|
+
};
|
|
9008
|
+
var hideRequestLoading = function hideRequestLoading() {
|
|
9009
|
+
if (loadingTimer) {
|
|
9010
|
+
hideLoading();
|
|
9011
|
+
}
|
|
9012
|
+
if (loadingTimer) {
|
|
9013
|
+
clearTimeout(loadingTimer);
|
|
9014
|
+
}
|
|
9015
|
+
};
|
|
9016
|
+
var normalizeMethod = function normalizeMethod(method) {
|
|
9017
|
+
return (method || 'get').toUpperCase();
|
|
9018
|
+
};
|
|
9019
|
+
var serializeParams = function serializeParams(params) {
|
|
9020
|
+
if (!params) {
|
|
9021
|
+
return '';
|
|
9022
|
+
}
|
|
9023
|
+
var queryParts = [];
|
|
9024
|
+
Object.keys(params).forEach(function (key) {
|
|
9025
|
+
var value = params[key];
|
|
9026
|
+
if (value === undefined || value === null) {
|
|
9027
|
+
return;
|
|
9028
|
+
}
|
|
9029
|
+
if (Array.isArray(value)) {
|
|
9030
|
+
value.forEach(function (item) {
|
|
9031
|
+
queryParts.push("".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(item)));
|
|
9032
|
+
});
|
|
9033
|
+
return;
|
|
9034
|
+
}
|
|
9035
|
+
queryParts.push("".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(value)));
|
|
9036
|
+
});
|
|
9037
|
+
return queryParts.join('&');
|
|
9038
|
+
};
|
|
9039
|
+
var isAbsoluteUrl = function isAbsoluteUrl(url) {
|
|
9040
|
+
return /^https?:\/\//.test(url);
|
|
9041
|
+
};
|
|
9042
|
+
var buildUrl = function buildUrl(baseURL, url, params) {
|
|
9043
|
+
var queryString = serializeParams(params);
|
|
9044
|
+
var requestUrl = isAbsoluteUrl(url) ? url : "".concat(baseURL).concat(url);
|
|
9045
|
+
if (!queryString) {
|
|
9046
|
+
return requestUrl;
|
|
9047
|
+
}
|
|
9048
|
+
return "".concat(requestUrl).concat(requestUrl.includes('?') ? '&' : '?').concat(queryString);
|
|
9049
|
+
};
|
|
9050
|
+
var isPlainObject = function isPlainObject(value) {
|
|
9051
|
+
return Object.prototype.toString.call(value) === '[object Object]';
|
|
9052
|
+
};
|
|
9053
|
+
var buildBody = function buildBody(data, headers) {
|
|
9054
|
+
if (data === undefined || data === null) {
|
|
9055
|
+
return undefined;
|
|
9056
|
+
}
|
|
9057
|
+
if (data instanceof FormData || data instanceof Blob || typeof data === 'string') {
|
|
9058
|
+
return data;
|
|
9059
|
+
}
|
|
9060
|
+
if (isPlainObject(data) || Array.isArray(data)) {
|
|
9061
|
+
if (!headers['Content-Type']) {
|
|
9062
|
+
headers['Content-Type'] = 'application/json';
|
|
9063
|
+
}
|
|
9064
|
+
return JSON.stringify(data);
|
|
9065
|
+
}
|
|
9066
|
+
return data;
|
|
9067
|
+
};
|
|
9068
|
+
var parseResponse = /*#__PURE__*/function () {
|
|
9069
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(response) {
|
|
9070
|
+
var contentType, text;
|
|
9071
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
9072
|
+
while (1) switch (_context.prev = _context.next) {
|
|
9073
|
+
case 0:
|
|
9074
|
+
contentType = response.headers.get('content-type') || '';
|
|
9075
|
+
if (!contentType.includes('application/json')) {
|
|
9076
|
+
_context.next = 1;
|
|
9077
|
+
break;
|
|
9078
|
+
}
|
|
9079
|
+
return _context.abrupt("return", response.json());
|
|
9080
|
+
case 1:
|
|
9081
|
+
_context.next = 2;
|
|
9082
|
+
return response.text();
|
|
9083
|
+
case 2:
|
|
9084
|
+
text = _context.sent;
|
|
9085
|
+
if (text) {
|
|
9086
|
+
_context.next = 3;
|
|
9087
|
+
break;
|
|
9088
|
+
}
|
|
9089
|
+
return _context.abrupt("return", {});
|
|
9090
|
+
case 3:
|
|
9091
|
+
_context.prev = 3;
|
|
9092
|
+
return _context.abrupt("return", JSON.parse(text));
|
|
9093
|
+
case 4:
|
|
9094
|
+
_context.prev = 4;
|
|
9095
|
+
_context["catch"](3);
|
|
9096
|
+
return _context.abrupt("return", {
|
|
9097
|
+
data: text
|
|
9098
|
+
});
|
|
9099
|
+
case 5:
|
|
9100
|
+
case "end":
|
|
9101
|
+
return _context.stop();
|
|
9102
|
+
}
|
|
9103
|
+
}, _callee, null, [[3, 4]]);
|
|
9104
|
+
}));
|
|
9105
|
+
return function parseResponse(_x) {
|
|
9106
|
+
return _ref.apply(this, arguments);
|
|
9107
|
+
};
|
|
9108
|
+
}();
|
|
9109
|
+
var createTimeoutError = function createTimeoutError(timeout) {
|
|
9110
|
+
var error = new Error("timeout of ".concat(timeout, "ms exceeded"));
|
|
9111
|
+
error.name = 'TimeoutError';
|
|
9112
|
+
return error;
|
|
9113
|
+
};
|
|
9114
|
+
var request = /*#__PURE__*/function () {
|
|
9115
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(config) {
|
|
9116
|
+
var url, _config$baseURL, baseURL, _config$method, method, params, data, _config$headers, headers, isIgnoreLoading, _config$timeout, timeout, _config$withCredentia, withCredentials, returnFullResponse, requestHeaders, timeoutId, fetchPromise, response, res, error, code, messageMap, message, _t2;
|
|
9117
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
9118
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
9119
|
+
case 0:
|
|
9120
|
+
url = config.url, _config$baseURL = config.baseURL, baseURL = _config$baseURL === void 0 ? options.baseURL : _config$baseURL, _config$method = config.method, method = _config$method === void 0 ? 'get' : _config$method, params = config.params, data = config.data, _config$headers = config.headers, headers = _config$headers === void 0 ? {} : _config$headers, isIgnoreLoading = config.isIgnoreLoading, _config$timeout = config.timeout, timeout = _config$timeout === void 0 ? options.timeout : _config$timeout, _config$withCredentia = config.withCredentials, withCredentials = _config$withCredentia === void 0 ? options.withCredentials : _config$withCredentia, returnFullResponse = config.returnFullResponse;
|
|
9121
|
+
if (!isIgnoreLoading) {
|
|
9122
|
+
showRequestLoading();
|
|
9123
|
+
}
|
|
9124
|
+
requestHeaders = _objectSpread$2(_objectSpread$2({}, options.headers), headers);
|
|
9125
|
+
timeoutId = null;
|
|
9126
|
+
_context2.prev = 1;
|
|
9127
|
+
fetchPromise = fetch(buildUrl(baseURL, url, params), {
|
|
9128
|
+
method: normalizeMethod(method),
|
|
9129
|
+
headers: requestHeaders,
|
|
9130
|
+
body: normalizeMethod(method) === 'GET' ? undefined : buildBody(data, requestHeaders),
|
|
9131
|
+
credentials: withCredentials ? 'include' : 'same-origin'
|
|
9132
|
+
});
|
|
9133
|
+
_context2.next = 2;
|
|
9134
|
+
return Promise.race([fetchPromise, new Promise(function (resolve, reject) {
|
|
9135
|
+
timeoutId = setTimeout(function () {
|
|
9136
|
+
reject(createTimeoutError(timeout));
|
|
9137
|
+
}, timeout);
|
|
9138
|
+
})]);
|
|
9139
|
+
case 2:
|
|
9140
|
+
response = _context2.sent;
|
|
9141
|
+
_context2.next = 3;
|
|
9142
|
+
return parseResponse(response);
|
|
9143
|
+
case 3:
|
|
9144
|
+
res = _context2.sent;
|
|
9145
|
+
if (response.ok) {
|
|
9146
|
+
_context2.next = 4;
|
|
9147
|
+
break;
|
|
9148
|
+
}
|
|
9149
|
+
error = new Error("Request failed with status code ".concat(response.status));
|
|
9150
|
+
error.response = {
|
|
9151
|
+
status: response.status,
|
|
9152
|
+
data: res
|
|
9153
|
+
};
|
|
9154
|
+
throw error;
|
|
9155
|
+
case 4:
|
|
9156
|
+
code = res.code;
|
|
9157
|
+
if (!['002012', '002013', '002015'].includes(code)) {
|
|
9158
|
+
_context2.next = 5;
|
|
9159
|
+
break;
|
|
9160
|
+
}
|
|
9161
|
+
messageMap = {
|
|
9162
|
+
m002012: '当前账号因操作频繁被限制,请明天再试。感谢理解',
|
|
9163
|
+
m002013: '您的操作频率较高,已达到今日生成上限。请稍后再试或明天继续使用,感谢您的理解!',
|
|
9164
|
+
m002015: '您今天做了太多计划书了,休息一下,明天再来吧'
|
|
9165
|
+
};
|
|
9166
|
+
message = messageMap["m".concat(code)];
|
|
9167
|
+
if (message) {
|
|
9168
|
+
_Dialog.alert({
|
|
9169
|
+
message: message,
|
|
9170
|
+
confirmButtonText: '知道了',
|
|
9171
|
+
confirmButtonColor: '#0A64FE'
|
|
9172
|
+
});
|
|
9173
|
+
}
|
|
9174
|
+
return _context2.abrupt("return", Promise.reject({
|
|
9175
|
+
code: code,
|
|
9176
|
+
message: message
|
|
9177
|
+
}));
|
|
9178
|
+
case 5:
|
|
9179
|
+
if (!(code === 401 || res.status === 401)) {
|
|
9180
|
+
_context2.next = 6;
|
|
9181
|
+
break;
|
|
9182
|
+
}
|
|
9183
|
+
gotoLogin();
|
|
9184
|
+
return _context2.abrupt("return", Promise.reject('status: 401'));
|
|
9185
|
+
case 6:
|
|
9186
|
+
if (!(res.success && res.data === -1)) {
|
|
9187
|
+
_context2.next = 7;
|
|
9188
|
+
break;
|
|
9189
|
+
}
|
|
9190
|
+
gotoLogin();
|
|
9191
|
+
return _context2.abrupt("return", Promise.reject('login: -1'));
|
|
9192
|
+
case 7:
|
|
9193
|
+
return _context2.abrupt("return", returnFullResponse ? res : res.data);
|
|
9194
|
+
case 8:
|
|
9195
|
+
_context2.prev = 8;
|
|
9196
|
+
_t2 = _context2["catch"](1);
|
|
9197
|
+
if (_t2.response && _t2.response.status == 401) {
|
|
9198
|
+
gotoLogin();
|
|
9199
|
+
}
|
|
9200
|
+
return _context2.abrupt("return", Promise.reject(_t2));
|
|
9201
|
+
case 9:
|
|
9202
|
+
_context2.prev = 9;
|
|
9203
|
+
if (timeoutId) {
|
|
9204
|
+
clearTimeout(timeoutId);
|
|
9205
|
+
}
|
|
9206
|
+
hideRequestLoading();
|
|
9207
|
+
return _context2.finish(9);
|
|
9208
|
+
case 10:
|
|
9209
|
+
case "end":
|
|
9210
|
+
return _context2.stop();
|
|
9211
|
+
}
|
|
9212
|
+
}, _callee2, null, [[1, 8, 9, 10]]);
|
|
9213
|
+
}));
|
|
9214
|
+
return function request(_x2) {
|
|
9215
|
+
return _ref2.apply(this, arguments);
|
|
9216
|
+
};
|
|
9217
|
+
}();
|
|
9218
|
+
|
|
9219
|
+
function getPlanbookRecommendData(params) {
|
|
9220
|
+
return request({
|
|
9221
|
+
url: '/planBook/input/calculate/recommend',
|
|
9222
|
+
method: 'post',
|
|
9223
|
+
data: params,
|
|
9224
|
+
headers: {
|
|
9225
|
+
Accept: 'application/json, text/plain, */*',
|
|
9226
|
+
'Content-Type': 'application/json;'
|
|
9227
|
+
}
|
|
9228
|
+
});
|
|
9229
|
+
}
|
|
9230
|
+
function getPlanbookInsuranceVerifyData(params) {
|
|
9231
|
+
return request({
|
|
9232
|
+
baseURL: APP_HOSTNAME,
|
|
9233
|
+
url: '/planBook/input/insurance/verifyData',
|
|
9234
|
+
method: 'post',
|
|
9235
|
+
data: params,
|
|
9236
|
+
headers: {
|
|
9237
|
+
Accept: 'application/json, text/plain, */*',
|
|
9238
|
+
'Content-Type': 'application/json;'
|
|
9239
|
+
}
|
|
9240
|
+
});
|
|
9241
|
+
}
|
|
9242
|
+
|
|
8952
9243
|
var enableLizhaoDebug = document && document.cookie && document.cookie.match('ENABLE_LIZHAO_DEBUG=1');
|
|
8953
9244
|
function consoleLogWhenEnable() {
|
|
8954
9245
|
if (enableLizhaoDebug) {
|
|
@@ -9092,45 +9383,6 @@ function converUnit10000(value) {
|
|
|
9092
9383
|
return value >= 10000 && !(value % 10000) ? "".concat(value / 10000, "\u4E07") : value;
|
|
9093
9384
|
}
|
|
9094
9385
|
|
|
9095
|
-
/**
|
|
9096
|
-
* **对象的深拷贝**
|
|
9097
|
-
* @ignore
|
|
9098
|
-
* @author Lizhao <lz@winbaoxian.com>
|
|
9099
|
-
* @date 2022-04-25
|
|
9100
|
-
* @param {object} obj - 必传
|
|
9101
|
-
* @param {WeakMap} hash - 可不传
|
|
9102
|
-
* @returns {object} 拷贝对象
|
|
9103
|
-
*/
|
|
9104
|
-
function deepCopy(obj) {
|
|
9105
|
-
var hash = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new WeakMap();
|
|
9106
|
-
if (!obj || _typeof$2(obj) !== 'object') {
|
|
9107
|
-
return obj;
|
|
9108
|
-
}
|
|
9109
|
-
if (hash.has(obj)) {
|
|
9110
|
-
return hash.get(obj);
|
|
9111
|
-
}
|
|
9112
|
-
var newObj;
|
|
9113
|
-
var Constructor = obj.constructor;
|
|
9114
|
-
switch (Constructor) {
|
|
9115
|
-
case RegExp:
|
|
9116
|
-
newObj = new Constructor(obj);
|
|
9117
|
-
break;
|
|
9118
|
-
case Date:
|
|
9119
|
-
newObj = new Constructor(obj.getTime());
|
|
9120
|
-
break;
|
|
9121
|
-
default:
|
|
9122
|
-
newObj = new Constructor();
|
|
9123
|
-
break;
|
|
9124
|
-
}
|
|
9125
|
-
hash.set(obj, newObj);
|
|
9126
|
-
for (var key in obj) {
|
|
9127
|
-
if (obj.hasOwnProperty(key)) {
|
|
9128
|
-
newObj[key] = _typeof$2(obj[key]) === 'object' ? deepCopy(obj[key], hash) : obj[key];
|
|
9129
|
-
}
|
|
9130
|
-
}
|
|
9131
|
-
return newObj;
|
|
9132
|
-
}
|
|
9133
|
-
|
|
9134
9386
|
/**
|
|
9135
9387
|
* **根据生日算年龄**
|
|
9136
9388
|
* @author Lizhao <lz@winbaoxian.com>
|
|
@@ -9159,6 +9411,9 @@ function getAgeFromBirth(birth, cDate) {
|
|
|
9159
9411
|
}
|
|
9160
9412
|
function getExpressionParamMap(personData, product, ins, options) {
|
|
9161
9413
|
var map = {
|
|
9414
|
+
user: {},
|
|
9415
|
+
executeSource: null,
|
|
9416
|
+
// 执行:init-初始化 import-导入数据 userAction-用户操作 confirm-确认
|
|
9162
9417
|
planbookId: null,
|
|
9163
9418
|
// 计划书id
|
|
9164
9419
|
productId: null,
|
|
@@ -9232,12 +9487,18 @@ function getExpressionParamMap(personData, product, ins, options) {
|
|
|
9232
9487
|
}
|
|
9233
9488
|
}
|
|
9234
9489
|
if (options) {
|
|
9490
|
+
if (options.user) {
|
|
9491
|
+
map.user = options.user;
|
|
9492
|
+
}
|
|
9235
9493
|
if (options.planbookId) {
|
|
9236
9494
|
map.planbookId = options.planbookId;
|
|
9237
9495
|
}
|
|
9238
9496
|
if (options.eventTarget) {
|
|
9239
9497
|
map.t = options.eventTarget;
|
|
9240
9498
|
}
|
|
9499
|
+
if (options.executeSource) {
|
|
9500
|
+
map.executeSource = options.executeSource;
|
|
9501
|
+
}
|
|
9241
9502
|
}
|
|
9242
9503
|
if (ins && ins.customVariableExp) {
|
|
9243
9504
|
var exp = ins.customVariableExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'map.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'map.$2');
|
|
@@ -9408,8 +9669,8 @@ function _toConsumableArray(r) {
|
|
|
9408
9669
|
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray$1(r) || _nonIterableSpread();
|
|
9409
9670
|
}
|
|
9410
9671
|
|
|
9411
|
-
function ownKeys$
|
|
9412
|
-
function _objectSpread$
|
|
9672
|
+
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9673
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) { _defineProperty$1(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9413
9674
|
|
|
9414
9675
|
/**
|
|
9415
9676
|
* **处理险种数据**
|
|
@@ -9630,7 +9891,7 @@ function restrictElementsInInsurance(_ref4) {
|
|
|
9630
9891
|
var insuranceInfo = convertEleOrderListToObj(insData);
|
|
9631
9892
|
var insVerifyData;
|
|
9632
9893
|
if (insuredInfo) {
|
|
9633
|
-
insVerifyData = _objectSpread$
|
|
9894
|
+
insVerifyData = _objectSpread$1({
|
|
9634
9895
|
sex: insuredInfo.sex,
|
|
9635
9896
|
age: insuredInfo.age
|
|
9636
9897
|
}, insuranceInfo);
|
|
@@ -9688,8 +9949,8 @@ function restrictElementsInInsurance(_ref4) {
|
|
|
9688
9949
|
return errorMsg;
|
|
9689
9950
|
}
|
|
9690
9951
|
|
|
9691
|
-
function ownKeys
|
|
9692
|
-
function _objectSpread
|
|
9952
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9953
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty$1(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9693
9954
|
|
|
9694
9955
|
/**
|
|
9695
9956
|
* **处理产品数据(单个)**
|
|
@@ -9721,36 +9982,22 @@ function productDataHandler(_x, _x2, _x3, _x4) {
|
|
|
9721
9982
|
*/
|
|
9722
9983
|
function _productDataHandler() {
|
|
9723
9984
|
_productDataHandler = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(prodData, prodVerifyData, personData, parmas) {
|
|
9724
|
-
var
|
|
9985
|
+
var _ref4, eventTarget, productVerifyData, insuranceKey, elementKey, groupInsurance, groupInsuranceIdEle, subInsurances, hasProduct, hasVerifyData, hasPersonData, personOrderList, _prodData$mulInsOrder3;
|
|
9725
9986
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
9726
9987
|
while (1) switch (_context.prev = _context.next) {
|
|
9727
9988
|
case 0:
|
|
9728
|
-
if (prodData) {
|
|
9729
|
-
_context.next =
|
|
9989
|
+
if (!prodData) {
|
|
9990
|
+
_context.next = 2;
|
|
9730
9991
|
break;
|
|
9731
9992
|
}
|
|
9732
|
-
|
|
9993
|
+
_ref4 = parmas || {}, eventTarget = _ref4.eventTarget;
|
|
9994
|
+
_context.next = 1;
|
|
9995
|
+
return getSingleInsurancesVerifyData(prodVerifyData, prodData, personData, parmas).catch(function () {});
|
|
9733
9996
|
case 1:
|
|
9734
|
-
productVerifyData = null;
|
|
9735
|
-
if (prodData.multipleInsured) {
|
|
9736
|
-
multipleInsuredHandler(personData);
|
|
9737
|
-
}
|
|
9738
|
-
if (!(prodData.feeValidateMode === 'single' || prodVerifyData && prodVerifyData.feeValidateMode === 'single')) {
|
|
9739
|
-
_context.next = 3;
|
|
9740
|
-
break;
|
|
9741
|
-
}
|
|
9742
|
-
_context.next = 2;
|
|
9743
|
-
return getSingleInsurancesVerifyData(prodData, personData, parmas).catch(function () {});
|
|
9744
|
-
case 2:
|
|
9745
9997
|
productVerifyData = _context.sent;
|
|
9746
|
-
_context.next = 4;
|
|
9747
|
-
break;
|
|
9748
|
-
case 3:
|
|
9749
|
-
productVerifyData = prodVerifyData;
|
|
9750
|
-
case 4:
|
|
9751
9998
|
// 组合险种特殊处理:当用户点击组合险种的子险种选项时,将其他子险种的标题设置为未选中状态
|
|
9752
|
-
if (
|
|
9753
|
-
|
|
9999
|
+
if (eventTarget) {
|
|
10000
|
+
insuranceKey = eventTarget.insuranceKey, elementKey = eventTarget.elementKey;
|
|
9754
10001
|
if (insuranceKey && elementKey === 'insuranceId') {
|
|
9755
10002
|
groupInsurance = (prodData.mulInsOrderList || []).find(function (ins) {
|
|
9756
10003
|
return ins.key === insuranceKey;
|
|
@@ -9779,7 +10026,6 @@ function _productDataHandler() {
|
|
|
9779
10026
|
personOrderList = convertPersonData(personData, personData.personOrderList.map(function (p) {
|
|
9780
10027
|
return p.key;
|
|
9781
10028
|
}));
|
|
9782
|
-
setCommonInfo(prodData);
|
|
9783
10029
|
(_prodData$mulInsOrder3 = prodData.mulInsOrderList) === null || _prodData$mulInsOrder3 === void 0 || _prodData$mulInsOrder3.forEach(function (ins, ii, insList) {
|
|
9784
10030
|
var _ins$eleOrderList;
|
|
9785
10031
|
insuranceDataHandler(ins, prodData);
|
|
@@ -10013,8 +10259,9 @@ function _productDataHandler() {
|
|
|
10013
10259
|
}
|
|
10014
10260
|
setGroupInsurance(prodData);
|
|
10015
10261
|
isHideProduct(prodData, productVerifyData, personOrderList);
|
|
10262
|
+
case 2:
|
|
10016
10263
|
return _context.abrupt("return", prodData);
|
|
10017
|
-
case
|
|
10264
|
+
case 3:
|
|
10018
10265
|
case "end":
|
|
10019
10266
|
return _context.stop();
|
|
10020
10267
|
}
|
|
@@ -10022,32 +10269,34 @@ function _productDataHandler() {
|
|
|
10022
10269
|
}));
|
|
10023
10270
|
return _productDataHandler.apply(this, arguments);
|
|
10024
10271
|
}
|
|
10025
|
-
function multipleInsuredHandler(personData) {
|
|
10026
|
-
|
|
10027
|
-
|
|
10028
|
-
|
|
10029
|
-
|
|
10030
|
-
|
|
10031
|
-
|
|
10032
|
-
|
|
10033
|
-
if (!insured2Info) {
|
|
10034
|
-
var insuredInfo = personOrderList.find(function (p) {
|
|
10035
|
-
return p.key === 'insuredInfo';
|
|
10036
|
-
});
|
|
10037
|
-
var insuredIndex = personOrderList.findIndex(function (p) {
|
|
10038
|
-
return p.key === 'insuredInfo';
|
|
10272
|
+
function multipleInsuredHandler(prodData, personData) {
|
|
10273
|
+
if (prodData && prodData.multipleInsured) {
|
|
10274
|
+
var personOrderList = personData.personOrderList;
|
|
10275
|
+
if (!(personOrderList && personOrderList.length)) {
|
|
10276
|
+
return null;
|
|
10277
|
+
}
|
|
10278
|
+
var insured2Info = personOrderList.find(function (p) {
|
|
10279
|
+
return p.key === 'insured2Info';
|
|
10039
10280
|
});
|
|
10040
|
-
if (
|
|
10041
|
-
var
|
|
10042
|
-
|
|
10043
|
-
person.eleOrderList.forEach(function (e) {
|
|
10044
|
-
if (e.key === 'title') {
|
|
10045
|
-
e.isDisabled = false;
|
|
10046
|
-
e.value = true;
|
|
10047
|
-
e.label = '第二被保人信息';
|
|
10048
|
-
}
|
|
10281
|
+
if (!insured2Info) {
|
|
10282
|
+
var insuredInfo = personOrderList.find(function (p) {
|
|
10283
|
+
return p.key === 'insuredInfo';
|
|
10049
10284
|
});
|
|
10050
|
-
personOrderList.
|
|
10285
|
+
var insuredIndex = personOrderList.findIndex(function (p) {
|
|
10286
|
+
return p.key === 'insuredInfo';
|
|
10287
|
+
});
|
|
10288
|
+
if (insuredIndex >= 0) {
|
|
10289
|
+
var person = cloneDeep(insuredInfo);
|
|
10290
|
+
person.key = 'insured2Info';
|
|
10291
|
+
person.eleOrderList.forEach(function (e) {
|
|
10292
|
+
if (e.key === 'title') {
|
|
10293
|
+
e.isDisabled = false;
|
|
10294
|
+
e.value = true;
|
|
10295
|
+
e.label = '第二被保人信息';
|
|
10296
|
+
}
|
|
10297
|
+
});
|
|
10298
|
+
personOrderList.splice(insuredIndex + 1, 0, person);
|
|
10299
|
+
}
|
|
10051
10300
|
}
|
|
10052
10301
|
}
|
|
10053
10302
|
return personData;
|
|
@@ -10062,63 +10311,67 @@ function multipleInsuredHandler(personData) {
|
|
|
10062
10311
|
* @param {IPbPersons} personData 必传。人员信息,包括被保人、投保人、投保人配偶
|
|
10063
10312
|
* @returns 请求函数的 Promise
|
|
10064
10313
|
*/
|
|
10065
|
-
function getSingleInsurancesVerifyData(prodData, personData) {
|
|
10066
|
-
var
|
|
10067
|
-
var
|
|
10068
|
-
|
|
10069
|
-
|
|
10070
|
-
|
|
10071
|
-
|
|
10072
|
-
|
|
10073
|
-
|
|
10074
|
-
|
|
10075
|
-
|
|
10076
|
-
|
|
10077
|
-
|
|
10078
|
-
|
|
10079
|
-
|
|
10080
|
-
|
|
10081
|
-
|
|
10082
|
-
|
|
10083
|
-
|
|
10084
|
-
|
|
10314
|
+
function getSingleInsurancesVerifyData(verifyData, prodData, personData) {
|
|
10315
|
+
var parmas = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
10316
|
+
var isSingleFeeValidateMode = prodData && prodData.feeValidateMode === 'single' || verifyData && verifyData.feeValidateMode === 'single';
|
|
10317
|
+
if (isSingleFeeValidateMode) {
|
|
10318
|
+
var _prodData$mulInsOrder, _prodData$mulInsOrder2;
|
|
10319
|
+
var personOrderList = personData.personOrderList;
|
|
10320
|
+
if (!(personOrderList && personOrderList.length)) {
|
|
10321
|
+
return null;
|
|
10322
|
+
}
|
|
10323
|
+
var pbId = prodData.isTemp || prodData.policyType === 'single_insurance' ? null : parmas.planbookId;
|
|
10324
|
+
var productId = prodData.policyType === 'single_insurance' ? null : prodData.key;
|
|
10325
|
+
// 险种对比,prodData 没有 feeValidateMode 字段。因此需要特殊处理。
|
|
10326
|
+
// 险种对比,以险种为维度,其 prodData.key 就是险种id,不能当成正常产品id。因此需要特殊处理。
|
|
10327
|
+
if (prodData.feeValidateMode !== 'single') {
|
|
10328
|
+
productId = null;
|
|
10329
|
+
}
|
|
10330
|
+
var insuredList = personOrderList.filter(function (p) {
|
|
10331
|
+
return ['insuredInfo', 'insured2Info'].includes(p.key);
|
|
10332
|
+
}).filter(function (p) {
|
|
10333
|
+
var _p$eleOrderList;
|
|
10334
|
+
var title = (_p$eleOrderList = p.eleOrderList) === null || _p$eleOrderList === void 0 ? void 0 : _p$eleOrderList.find(function (e) {
|
|
10335
|
+
return e.key === 'title';
|
|
10336
|
+
});
|
|
10337
|
+
return title && title.value || p.title;
|
|
10338
|
+
}).map(function (p) {
|
|
10339
|
+
var person = convertEleOrderListToObj(p);
|
|
10340
|
+
return {
|
|
10341
|
+
key: person.key,
|
|
10342
|
+
sex: person.sex,
|
|
10343
|
+
age: person.age
|
|
10344
|
+
};
|
|
10345
|
+
});
|
|
10346
|
+
var applicant = null;
|
|
10347
|
+
var applicantItem = personData.personOrderList.find(function (p) {
|
|
10348
|
+
return p.key === 'applicantInfo';
|
|
10349
|
+
});
|
|
10350
|
+
if (applicantItem) {
|
|
10351
|
+
var person = convertEleOrderListToObj(applicantItem);
|
|
10352
|
+
applicant = {
|
|
10353
|
+
key: person.key,
|
|
10354
|
+
sex: person.sex,
|
|
10355
|
+
age: person.age
|
|
10356
|
+
};
|
|
10357
|
+
}
|
|
10358
|
+
var insuranceIdList = prodData === null || prodData === void 0 || (_prodData$mulInsOrder = prodData.mulInsOrderList) === null || _prodData$mulInsOrder === void 0 ? void 0 : _prodData$mulInsOrder.map(function (ins) {
|
|
10359
|
+
return ins.key;
|
|
10360
|
+
}).filter(function (k) {
|
|
10361
|
+
return !['common'].includes(k);
|
|
10362
|
+
});
|
|
10363
|
+
prodData === null || prodData === void 0 || (_prodData$mulInsOrder2 = prodData.mulInsOrderList) === null || _prodData$mulInsOrder2 === void 0 || _prodData$mulInsOrder2.reduce(function (list, ins) {
|
|
10364
|
+
return ins.key === 'common' || ins.isGroup ? list : list.concat(ins.key);
|
|
10365
|
+
}, []);
|
|
10366
|
+
return getAndCacheInsurancesVerifyData({
|
|
10367
|
+
pbId: pbId,
|
|
10368
|
+
productId: productId,
|
|
10369
|
+
insuredList: insuredList,
|
|
10370
|
+
applicant: applicant,
|
|
10371
|
+
insuranceIdList: insuranceIdList
|
|
10085
10372
|
});
|
|
10086
|
-
return title && title.value || p.title;
|
|
10087
|
-
}).map(function (p) {
|
|
10088
|
-
var person = convertEleOrderListToObj(p);
|
|
10089
|
-
return {
|
|
10090
|
-
key: person.key,
|
|
10091
|
-
sex: person.sex,
|
|
10092
|
-
age: person.age
|
|
10093
|
-
};
|
|
10094
|
-
});
|
|
10095
|
-
var applicant = null;
|
|
10096
|
-
var applicantItem = personData.personOrderList.find(function (p) {
|
|
10097
|
-
return p.key === 'applicantInfo';
|
|
10098
|
-
});
|
|
10099
|
-
if (applicantItem) {
|
|
10100
|
-
var person = convertEleOrderListToObj(applicantItem);
|
|
10101
|
-
applicant = {
|
|
10102
|
-
key: person.key,
|
|
10103
|
-
sex: person.sex,
|
|
10104
|
-
age: person.age
|
|
10105
|
-
};
|
|
10106
10373
|
}
|
|
10107
|
-
|
|
10108
|
-
return ins.key;
|
|
10109
|
-
}).filter(function (k) {
|
|
10110
|
-
return !['common'].includes(k);
|
|
10111
|
-
});
|
|
10112
|
-
prodData === null || prodData === void 0 || (_prodData$mulInsOrder2 = prodData.mulInsOrderList) === null || _prodData$mulInsOrder2 === void 0 || _prodData$mulInsOrder2.reduce(function (list, ins) {
|
|
10113
|
-
return ins.key === 'common' || ins.isGroup ? list : list.concat(ins.key);
|
|
10114
|
-
}, []);
|
|
10115
|
-
return getAndCacheInsurancesVerifyData({
|
|
10116
|
-
pbId: pbId,
|
|
10117
|
-
productId: productId,
|
|
10118
|
-
insuredList: insuredList,
|
|
10119
|
-
applicant: applicant,
|
|
10120
|
-
insuranceIdList: insuranceIdList
|
|
10121
|
-
});
|
|
10374
|
+
return Promise.resolve(verifyData);
|
|
10122
10375
|
}
|
|
10123
10376
|
|
|
10124
10377
|
/**
|
|
@@ -10130,25 +10383,7 @@ function getSingleInsurancesVerifyData(prodData, personData) {
|
|
|
10130
10383
|
* @returns {Promise<any>} 产品下所有险种的费率
|
|
10131
10384
|
*/
|
|
10132
10385
|
var getAndCacheInsurancesVerifyData = memoize(function (params) {
|
|
10133
|
-
|
|
10134
|
-
return fetch(url, {
|
|
10135
|
-
method: 'POST',
|
|
10136
|
-
credentials: 'include',
|
|
10137
|
-
headers: {
|
|
10138
|
-
Accept: 'application/json, text/plain, */*',
|
|
10139
|
-
'Content-Type': 'application/json;'
|
|
10140
|
-
},
|
|
10141
|
-
body: JSON.stringify(params)
|
|
10142
|
-
}).then(function (response) {
|
|
10143
|
-
return response.json();
|
|
10144
|
-
}).then(function (_ref) {
|
|
10145
|
-
var success = _ref.success,
|
|
10146
|
-
data = _ref.data;
|
|
10147
|
-
if (!success || !data) {
|
|
10148
|
-
return Promise.reject();
|
|
10149
|
-
}
|
|
10150
|
-
return Promise.resolve(data);
|
|
10151
|
-
}).catch(function () {});
|
|
10386
|
+
return getPlanbookInsuranceVerifyData(params).catch(function () {});
|
|
10152
10387
|
}, function (params) {
|
|
10153
10388
|
return QS.stringify(params);
|
|
10154
10389
|
});
|
|
@@ -10159,10 +10394,10 @@ function getElementVerifyFromProductVerify(verify, insurances, option) {
|
|
|
10159
10394
|
var insuranceInfo = {};
|
|
10160
10395
|
insurances.forEach(function (ins) {
|
|
10161
10396
|
if (['common', option.insuranceKey].includes(ins.key)) {
|
|
10162
|
-
insuranceInfo = _objectSpread
|
|
10397
|
+
insuranceInfo = _objectSpread(_objectSpread({}, insuranceInfo), convertEleOrderListToObj(ins));
|
|
10163
10398
|
}
|
|
10164
10399
|
});
|
|
10165
|
-
insuranceInfo = _objectSpread
|
|
10400
|
+
insuranceInfo = _objectSpread(_objectSpread({}, insuranceInfo), option);
|
|
10166
10401
|
var temp = verify;
|
|
10167
10402
|
var hasElementKey = verify.key === option.elementKey;
|
|
10168
10403
|
while (temp && temp.key && temp.key !== option.elementKey) {
|
|
@@ -10182,53 +10417,6 @@ function getElementVerifyFromProductVerify(verify, insurances, option) {
|
|
|
10182
10417
|
return temp ? [temp] : null;
|
|
10183
10418
|
}
|
|
10184
10419
|
|
|
10185
|
-
/**
|
|
10186
|
-
* **提取产品中的通用信息**
|
|
10187
|
-
* - 将产品下所有险种中 [common: true] 的元素,提取到一个新险种下(险种[key: common]),并作为产品的第一个险种。
|
|
10188
|
-
* @ignore
|
|
10189
|
-
* @author Lizhao <lz@winbaoxian.com>
|
|
10190
|
-
* @date 2022-04-26
|
|
10191
|
-
* @param {IPbProduct} prodData 必传。产品数据(单个)
|
|
10192
|
-
* @returns {IPbProduct} 产品数据(单个)
|
|
10193
|
-
*/
|
|
10194
|
-
function setCommonInfo(prodData) {
|
|
10195
|
-
if (!prodData || !prodData.mulInsOrderList) {
|
|
10196
|
-
return prodData;
|
|
10197
|
-
}
|
|
10198
|
-
var common = {
|
|
10199
|
-
key: 'common',
|
|
10200
|
-
eleOrderList: []
|
|
10201
|
-
};
|
|
10202
|
-
prodData.mulInsOrderList.forEach(function (ins) {
|
|
10203
|
-
if (!ins.eleOrderList) {
|
|
10204
|
-
return;
|
|
10205
|
-
}
|
|
10206
|
-
ins.eleOrderList.forEach(function (ele) {
|
|
10207
|
-
if (ele.common && common.eleOrderList.every(function (e) {
|
|
10208
|
-
return e.key !== ele.key;
|
|
10209
|
-
})) {
|
|
10210
|
-
common.eleOrderList.push(ele);
|
|
10211
|
-
}
|
|
10212
|
-
});
|
|
10213
|
-
ins.eleOrderList = ins.eleOrderList.filter(function (ele) {
|
|
10214
|
-
return !ele.common;
|
|
10215
|
-
});
|
|
10216
|
-
});
|
|
10217
|
-
// 把通用信息当作一个险种,做为产品险种列表的第一个险种
|
|
10218
|
-
if (!common.eleOrderList.length) {
|
|
10219
|
-
return prodData;
|
|
10220
|
-
}
|
|
10221
|
-
prodData.mulInsOrderList = prodData.mulInsOrderList.filter(function (ins) {
|
|
10222
|
-
return ins.key !== 'common';
|
|
10223
|
-
});
|
|
10224
|
-
prodData.mulInsOrderList.unshift(common);
|
|
10225
|
-
// 通用信息,与跟随其后的险种不留间距
|
|
10226
|
-
if (prodData.mulInsOrderList[1]) {
|
|
10227
|
-
prodData.mulInsOrderList[1].isFollowing = true;
|
|
10228
|
-
}
|
|
10229
|
-
return prodData;
|
|
10230
|
-
}
|
|
10231
|
-
|
|
10232
10420
|
/**
|
|
10233
10421
|
* **创建或更新组合险**
|
|
10234
10422
|
* - 组合险是虚拟的险种,是为了解决特殊场景:多个险种,只能同时选中一个。
|
|
@@ -10353,7 +10541,7 @@ function setGroupInsurance(prodData) {
|
|
|
10353
10541
|
}
|
|
10354
10542
|
}
|
|
10355
10543
|
}
|
|
10356
|
-
var index =
|
|
10544
|
+
var index = findLastIndex(mulInsOrderList, function (ins) {
|
|
10357
10545
|
return ins.groupKey === k;
|
|
10358
10546
|
});
|
|
10359
10547
|
if (index >= 0) {
|
|
@@ -10375,21 +10563,21 @@ function setGroupInsurance(prodData) {
|
|
|
10375
10563
|
* @author Lizhao <lz@winbaoxian.com>
|
|
10376
10564
|
* @date 2022-04-26
|
|
10377
10565
|
* @param {IPbProduct} prodData 必传。产品数据(单个)
|
|
10378
|
-
* @param {object}
|
|
10566
|
+
* @param {object} prodVerifyData 必传。产品限制条件(单个)
|
|
10379
10567
|
* @param {IPbPerson} personOrderList 必传。转换后的人员信息,包括被保人、投保人、投保人配偶
|
|
10380
10568
|
* @returns {object} 产品数据(单个)
|
|
10381
10569
|
*/
|
|
10382
|
-
function isHideProduct(prodData,
|
|
10570
|
+
function isHideProduct(prodData, prodVerifyData, personOrderList) {
|
|
10383
10571
|
var ageRangeProd = {};
|
|
10384
|
-
if (prodData &&
|
|
10572
|
+
if (prodData && prodVerifyData && Object.keys(prodVerifyData).length && personOrderList) {
|
|
10385
10573
|
if (prodData.mulInsOrderList) {
|
|
10386
10574
|
// 产品中是否有必选险种且有费率
|
|
10387
10575
|
var hasRequiredIns = prodData.mulInsOrderList.some(function (ins) {
|
|
10388
|
-
return !!ins.required &&
|
|
10576
|
+
return !!ins.required && prodVerifyData[ins.key];
|
|
10389
10577
|
});
|
|
10390
10578
|
prodData.mulInsOrderList.forEach(function (ins) {
|
|
10391
10579
|
// 当前险种的限制条件
|
|
10392
|
-
var insuranceVerifyData =
|
|
10580
|
+
var insuranceVerifyData = prodVerifyData[ins.key];
|
|
10393
10581
|
if (insuranceVerifyData) {
|
|
10394
10582
|
// 产品年龄范围取各险种最大范围
|
|
10395
10583
|
if ((!ins.huomian || ins.huomian == 'beiHuomian') && (!hasRequiredIns || hasRequiredIns && ins.required)) {
|
|
@@ -10401,11 +10589,11 @@ function isHideProduct(prodData, productVerifyData, personOrderList) {
|
|
|
10401
10589
|
}
|
|
10402
10590
|
});
|
|
10403
10591
|
}
|
|
10404
|
-
var
|
|
10592
|
+
var _ref = personOrderList.find(function (p) {
|
|
10405
10593
|
return p.key === 'insuredInfo';
|
|
10406
10594
|
}),
|
|
10407
|
-
sex =
|
|
10408
|
-
age =
|
|
10595
|
+
sex = _ref.sex,
|
|
10596
|
+
age = _ref.age;
|
|
10409
10597
|
if (ageRangeProd[sex] && age >= ageRangeProd[sex][0] && age <= ageRangeProd[sex][1]) {
|
|
10410
10598
|
prodData.hide = false;
|
|
10411
10599
|
} else {
|
|
@@ -10431,11 +10619,11 @@ function isHideProduct(prodData, productVerifyData, personOrderList) {
|
|
|
10431
10619
|
* @param {IInsElement} params.eleData 可不传。元素数据,当前交互的元素(如:用户修改了该险种的交费期间)
|
|
10432
10620
|
* @returns {string} 校验结果。空表示校验通过
|
|
10433
10621
|
*/
|
|
10434
|
-
function verifyProductRules(
|
|
10435
|
-
var personData =
|
|
10436
|
-
productData =
|
|
10437
|
-
insData =
|
|
10438
|
-
eleData =
|
|
10622
|
+
function verifyProductRules(_ref2) {
|
|
10623
|
+
var personData = _ref2.personData,
|
|
10624
|
+
productData = _ref2.productData,
|
|
10625
|
+
insData = _ref2.insData,
|
|
10626
|
+
eleData = _ref2.eleData;
|
|
10439
10627
|
var errorMsg = '';
|
|
10440
10628
|
var personOrderList = convertPersonData(personData, personData.personOrderList.map(function (p) {
|
|
10441
10629
|
return p.key;
|
|
@@ -10481,11 +10669,11 @@ function verifyProductRules(_ref3) {
|
|
|
10481
10669
|
* @param {eleData} params.eleData 可不传。元素数据,当前交互的元素(如:用户修改了该险种的交费期间)
|
|
10482
10670
|
* @returns {string} 校验结果。空表示校验通过
|
|
10483
10671
|
*/
|
|
10484
|
-
function restrictInsurancesInProduct(
|
|
10485
|
-
var personOrderList =
|
|
10486
|
-
productData =
|
|
10487
|
-
insData =
|
|
10488
|
-
eleData =
|
|
10672
|
+
function restrictInsurancesInProduct(_ref3) {
|
|
10673
|
+
var personOrderList = _ref3.personOrderList,
|
|
10674
|
+
productData = _ref3.productData,
|
|
10675
|
+
insData = _ref3.insData,
|
|
10676
|
+
eleData = _ref3.eleData;
|
|
10489
10677
|
var errorMsg = '';
|
|
10490
10678
|
var restrictList = productData.restrictList;
|
|
10491
10679
|
if (restrictList && restrictList.length) {
|
|
@@ -10494,16 +10682,16 @@ function restrictInsurancesInProduct(_ref4) {
|
|
|
10494
10682
|
return p.key === 'insuredInfo';
|
|
10495
10683
|
});
|
|
10496
10684
|
var productInfo = convertProductData(productData);
|
|
10497
|
-
var
|
|
10685
|
+
var evalVerifyMap = {
|
|
10498
10686
|
age: insuredInfo.age,
|
|
10499
10687
|
sex: insuredInfo.sex,
|
|
10500
10688
|
common: productInfo.common
|
|
10501
10689
|
};
|
|
10502
10690
|
productInfo.mulInsOrderList.forEach(function (ins) {
|
|
10503
|
-
|
|
10691
|
+
evalVerifyMap['i' + ins.key] = ins;
|
|
10504
10692
|
});
|
|
10505
|
-
restrict.rCondition = restrict.rCondition.replace(/(%)(\d+)(\.*\w*)(%)/g, '
|
|
10506
|
-
restrict.rCondition = restrict.rCondition.replace(/(%)(\w*\.*\w*)(%)/g, '
|
|
10693
|
+
restrict.rCondition = restrict.rCondition.replace(/(%)(\d+)(\.*\w*)(%)/g, 'evalVerifyMap.i$2$3');
|
|
10694
|
+
restrict.rCondition = restrict.rCondition.replace(/(%)(\w*\.*\w*)(%)/g, 'evalVerifyMap.$2');
|
|
10507
10695
|
var curIns = productData.mulInsOrderList.find(function (ins) {
|
|
10508
10696
|
return ins.key === restrict.rInsKey;
|
|
10509
10697
|
});
|
|
@@ -10553,8 +10741,8 @@ function restrictInsurancesInProduct(_ref4) {
|
|
|
10553
10741
|
var rangeSelect = eval(restrict.rCondition);
|
|
10554
10742
|
if (rangeSelect !== undefined && rangeSelect !== null) {
|
|
10555
10743
|
curEle.opts.forEach(function (opt) {
|
|
10556
|
-
var optNum = getNumberFromYear(opt.val,
|
|
10557
|
-
var rangeSelectNum = rangeSelect.constructor === Array ? [rangeSelect[0] && getNumberFromYear(rangeSelect[0],
|
|
10744
|
+
var optNum = getNumberFromYear(opt.val, evalVerifyMap.age);
|
|
10745
|
+
var rangeSelectNum = rangeSelect.constructor === Array ? [rangeSelect[0] && getNumberFromYear(rangeSelect[0], evalVerifyMap.age), rangeSelect[1] && getNumberFromYear(rangeSelect[1], evalVerifyMap.age)] : getNumberFromYear(rangeSelect, evalVerifyMap.age);
|
|
10558
10746
|
if (rangeSelect) {
|
|
10559
10747
|
if (rangeSelect.constructor === Array) {
|
|
10560
10748
|
opt.isHide = rangeSelect[0] && optNum < rangeSelectNum[0] || rangeSelect[1] && optNum > rangeSelectNum[1];
|
|
@@ -10581,7 +10769,7 @@ function restrictInsurancesInProduct(_ref4) {
|
|
|
10581
10769
|
case 3:
|
|
10582
10770
|
{
|
|
10583
10771
|
// 全局校验、或者点击的是约束元素、或者点击的是目标元素时,触发校验
|
|
10584
|
-
if (!insData && !eleData || restrict.rInsKey === insData.key && restrict.rEleKey === eleData.key || restrict.rCondition.search("
|
|
10772
|
+
if (!insData && !eleData || restrict.rInsKey === insData.key && restrict.rEleKey === eleData.key || restrict.rCondition.search("evalVerifyMap.i".concat(insData.key, ".").concat(eleData.key)) !== -1) {
|
|
10585
10773
|
var rangeVal = eval(restrict.rCondition);
|
|
10586
10774
|
if (rangeVal !== undefined && rangeVal !== null) {
|
|
10587
10775
|
if (rangeVal.constructor === Array) {
|
|
@@ -10624,7 +10812,7 @@ function convertProductData(prodData) {
|
|
|
10624
10812
|
if (!prodData.mulInsOrderList) {
|
|
10625
10813
|
return prodData;
|
|
10626
10814
|
}
|
|
10627
|
-
var productData = _objectSpread
|
|
10815
|
+
var productData = _objectSpread(_objectSpread({}, prodData), {}, {
|
|
10628
10816
|
common: {},
|
|
10629
10817
|
mulInsOrderList: []
|
|
10630
10818
|
});
|
|
@@ -10650,7 +10838,7 @@ function convertProductData(prodData) {
|
|
|
10650
10838
|
checkedInsData[ele.key] = insuranceData[ele.key];
|
|
10651
10839
|
}
|
|
10652
10840
|
});
|
|
10653
|
-
productData.mulInsOrderList.push(
|
|
10841
|
+
productData.mulInsOrderList.push(cloneDeep(checkedInsData));
|
|
10654
10842
|
}
|
|
10655
10843
|
});
|
|
10656
10844
|
return;
|
|
@@ -10661,128 +10849,18 @@ function convertProductData(prodData) {
|
|
|
10661
10849
|
return productData;
|
|
10662
10850
|
}
|
|
10663
10851
|
|
|
10664
|
-
/**
|
|
10665
|
-
* **清空追加领取、减保领取、调整保额数据**
|
|
10666
|
-
* @author Lizhao <lz@winbaoxian.com>
|
|
10667
|
-
* @date 2022-04-26
|
|
10668
|
-
* @param {IPbProduct} productData 产品数据
|
|
10669
|
-
* @returns {IPbProduct} 产品数据
|
|
10670
|
-
*/
|
|
10671
|
-
function clearAddAndTakeAndAdjustBaoeData(productData) {
|
|
10672
|
-
if (!productData) {
|
|
10673
|
-
return productData;
|
|
10674
|
-
}
|
|
10675
|
-
if (!productData.mulInsOrderList) {
|
|
10676
|
-
return productData;
|
|
10677
|
-
}
|
|
10678
|
-
productData.adjustBaoeData = null;
|
|
10679
|
-
productData.mulInsOrderList.forEach(function (ins) {
|
|
10680
|
-
if (ins.accountData && ins.accountData.addAndTakeData) {
|
|
10681
|
-
ins.accountData.addAndTakeData.forEach(function (aat) {
|
|
10682
|
-
aat.adjustData = [];
|
|
10683
|
-
});
|
|
10684
|
-
}
|
|
10685
|
-
if (ins.reduceBaof) {
|
|
10686
|
-
if (ins.reduceBaofData) {
|
|
10687
|
-
ins.reduceBaofData.addAndTakeData.forEach(function (aat) {
|
|
10688
|
-
aat.adjustData = [];
|
|
10689
|
-
});
|
|
10690
|
-
}
|
|
10691
|
-
if (ins.duplicateReduceBaofData) {
|
|
10692
|
-
ins.duplicateReduceBaofData.addAndTakeData.forEach(function (aat) {
|
|
10693
|
-
aat.adjustData = [];
|
|
10694
|
-
});
|
|
10695
|
-
}
|
|
10696
|
-
}
|
|
10697
|
-
});
|
|
10698
|
-
return productData;
|
|
10699
|
-
}
|
|
10700
|
-
|
|
10701
|
-
function showLoading() {
|
|
10702
|
-
if (IS_CPPOC_HOST) {
|
|
10703
|
-
_Toast.loading({
|
|
10704
|
-
message: '加载中...',
|
|
10705
|
-
forbidClick: true
|
|
10706
|
-
});
|
|
10707
|
-
} else if (window.appBridge && window.appBridge.showLoading) {
|
|
10708
|
-
window.appBridge.showLoading();
|
|
10709
|
-
}
|
|
10710
|
-
}
|
|
10711
|
-
function hideLoading() {
|
|
10712
|
-
if (IS_CPPOC_HOST) {
|
|
10713
|
-
_Toast.clear();
|
|
10714
|
-
} else if (window.appBridge && window.appBridge.hideLoading) {
|
|
10715
|
-
window.appBridge.hideLoading();
|
|
10716
|
-
}
|
|
10717
|
-
}
|
|
10718
|
-
|
|
10719
|
-
// 创建axios实例
|
|
10720
|
-
var service = axios.create({
|
|
10721
|
-
baseURL: APP_HOSTNAME,
|
|
10722
|
-
withCredentials: true,
|
|
10723
|
-
timeout: 10000,
|
|
10724
|
-
// 请求超时时间
|
|
10725
|
-
headers: {
|
|
10726
|
-
'X-Requested-With': 'XMLHttpRequest'
|
|
10727
|
-
}
|
|
10728
|
-
});
|
|
10729
|
-
var loadingTimer = null;
|
|
10730
|
-
var loading = function loading(show) {
|
|
10731
|
-
if (show) {
|
|
10732
|
-
showLoading();
|
|
10733
|
-
} else {
|
|
10734
|
-
hideLoading();
|
|
10735
|
-
}
|
|
10736
|
-
};
|
|
10737
|
-
|
|
10738
|
-
// request拦截器
|
|
10739
|
-
service.interceptors.request.use(function (config) {
|
|
10740
|
-
if (loadingTimer) clearTimeout(loadingTimer);
|
|
10741
|
-
loadingTimer = setTimeout(function () {
|
|
10742
|
-
loading(true);
|
|
10743
|
-
}, 300);
|
|
10744
|
-
return config;
|
|
10745
|
-
}, function (error) {
|
|
10746
|
-
// Do something with request error
|
|
10747
|
-
console.log(error); // for debug
|
|
10748
|
-
Promise.reject(error);
|
|
10749
|
-
});
|
|
10750
|
-
|
|
10751
|
-
// respone拦截器
|
|
10752
|
-
service.interceptors.response.use(function (response) {
|
|
10753
|
-
if (loadingTimer) clearTimeout(loadingTimer);
|
|
10754
|
-
loading(false);
|
|
10755
|
-
var res = response.data;
|
|
10756
|
-
if (res.code === 401 || res.status === 401) {
|
|
10757
|
-
// gotoLogin()
|
|
10758
|
-
return Promise.reject('login');
|
|
10759
|
-
}
|
|
10760
|
-
return res;
|
|
10761
|
-
}, function (error) {
|
|
10762
|
-
if (loadingTimer) clearTimeout(loadingTimer);
|
|
10763
|
-
loading(false);
|
|
10764
|
-
if (error.response && error.response.status == 401) {
|
|
10765
|
-
// gotoLogin()
|
|
10766
|
-
return Promise.reject('login');
|
|
10767
|
-
}
|
|
10768
|
-
console.log('err' + error); // for debug
|
|
10769
|
-
return Promise.reject(error);
|
|
10770
|
-
});
|
|
10771
|
-
|
|
10772
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10773
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty$1(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10774
10852
|
function createMd5Token(reqData, obj) {
|
|
10775
10853
|
var personList = reqData.personData.personOrderList;
|
|
10776
10854
|
var signInfo = {};
|
|
10777
10855
|
if (reqData.insuranceTypeId !== null) {
|
|
10778
10856
|
signInfo.insuranceTypeId = reqData.insuranceTypeId;
|
|
10779
10857
|
}
|
|
10780
|
-
var insuredInfo = personList.
|
|
10858
|
+
var insuredInfo = personList.filter(function (p) {
|
|
10781
10859
|
return p.key === 'insuredInfo';
|
|
10782
|
-
});
|
|
10783
|
-
var applicantInfo = personList.
|
|
10860
|
+
})[0];
|
|
10861
|
+
var applicantInfo = personList.filter(function (p) {
|
|
10784
10862
|
return p.key === 'applicantInfo';
|
|
10785
|
-
});
|
|
10863
|
+
})[0];
|
|
10786
10864
|
signInfo.insuredAge = insuredInfo.age * 1;
|
|
10787
10865
|
signInfo.insuredSex = insuredInfo.sex * 1;
|
|
10788
10866
|
if (applicantInfo) {
|
|
@@ -10829,80 +10907,164 @@ function createMd5Token(reqData, obj) {
|
|
|
10829
10907
|
// signMd5: MD5(signInfoTx)
|
|
10830
10908
|
// }))
|
|
10831
10909
|
|
|
10832
|
-
|
|
10833
|
-
|
|
10834
|
-
})), CryptoJS.enc.Utf8.parse('67u3Dg5fcc06UntP'), {
|
|
10910
|
+
signInfo.signMd5 = MD5(signInfoTx);
|
|
10911
|
+
return CryptoJS.AES.encrypt(JSON.stringify(signInfo), CryptoJS.enc.Utf8.parse('67u3Dg5fcc06UntP'), {
|
|
10835
10912
|
mode: CryptoJS.mode.ECB,
|
|
10836
10913
|
padding: CryptoJS.pad.Pkcs7
|
|
10837
10914
|
}).toString() || MD5(signInfoTx) || '20190929';
|
|
10838
10915
|
}
|
|
10839
10916
|
|
|
10840
|
-
|
|
10841
|
-
|
|
10842
|
-
|
|
10843
|
-
|
|
10844
|
-
|
|
10845
|
-
|
|
10846
|
-
|
|
10847
|
-
|
|
10848
|
-
|
|
10849
|
-
|
|
10850
|
-
|
|
10851
|
-
|
|
10852
|
-
|
|
10853
|
-
|
|
10917
|
+
/**转换时间字符串
|
|
10918
|
+
* @Author Lizh
|
|
10919
|
+
* @DateTime 2020-04-16
|
|
10920
|
+
* @param {[type]} time [description]
|
|
10921
|
+
* @param {[type]} cFormat [description]
|
|
10922
|
+
* @return {[type]} [description]
|
|
10923
|
+
*/
|
|
10924
|
+
function parseTime(time, cFormat) {
|
|
10925
|
+
if (arguments.length === 0) {
|
|
10926
|
+
return null;
|
|
10927
|
+
}
|
|
10928
|
+
var format = cFormat;
|
|
10929
|
+
var date;
|
|
10930
|
+
if (time === null) {
|
|
10931
|
+
return;
|
|
10932
|
+
} else if (_typeof$2(time) === 'object') {
|
|
10933
|
+
date = time;
|
|
10934
|
+
} else {
|
|
10935
|
+
if (('' + time).length === 10) time = parseInt(time) * 1000;
|
|
10936
|
+
date = new Date(time);
|
|
10937
|
+
}
|
|
10938
|
+
var formatObj = {
|
|
10939
|
+
y: date.getFullYear(),
|
|
10940
|
+
m: date.getMonth() + 1,
|
|
10941
|
+
d: date.getDate(),
|
|
10942
|
+
h: date.getHours(),
|
|
10943
|
+
i: date.getMinutes(),
|
|
10944
|
+
s: date.getSeconds(),
|
|
10945
|
+
a: date.getDay()
|
|
10946
|
+
};
|
|
10947
|
+
var timeStr = format.replace(/{(y|m|d|h|i|s|a)+}/g, function (result, key) {
|
|
10948
|
+
var value = formatObj[key];
|
|
10949
|
+
if (key === 'a') {
|
|
10950
|
+
return ['日', '一', '二', '三', '四', '五', '六'][value];
|
|
10854
10951
|
}
|
|
10855
|
-
if (
|
|
10856
|
-
|
|
10857
|
-
var tempIns = {};
|
|
10858
|
-
for (var _k2 in ins) {
|
|
10859
|
-
if (!['isFollowing', 'pPeriodDesc', 'baoeDesc', 'baofDesc', 'iDurationDesc', 'accountData', 'reduceBaofData', 'duplicateReduceBaofData', 'isCheckbox', 'groupKey', 'groupName', 'customVariableExp', 'calcResultExp', 'revalidateFlag'].includes(_k2)) {
|
|
10860
|
-
tempIns[_k2] = ins[_k2];
|
|
10861
|
-
}
|
|
10862
|
-
}
|
|
10863
|
-
return tempIns;
|
|
10864
|
-
});
|
|
10952
|
+
if (result.length > 0 && value < 10) {
|
|
10953
|
+
value = '0' + value;
|
|
10865
10954
|
}
|
|
10955
|
+
return value || 0;
|
|
10956
|
+
});
|
|
10957
|
+
return timeStr;
|
|
10958
|
+
}
|
|
10959
|
+
function getSecurityToken(data) {
|
|
10960
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
10961
|
+
return createMd5Token(JSON.parse(data), options);
|
|
10962
|
+
}
|
|
10866
10963
|
|
|
10867
|
-
|
|
10868
|
-
|
|
10869
|
-
|
|
10870
|
-
|
|
10871
|
-
|
|
10872
|
-
|
|
10964
|
+
function createdProductDataToCalc(_x2) {
|
|
10965
|
+
return _createdProductDataToCalc.apply(this, arguments);
|
|
10966
|
+
}
|
|
10967
|
+
function _createdProductDataToCalc() {
|
|
10968
|
+
_createdProductDataToCalc = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(inputData) {
|
|
10969
|
+
var options,
|
|
10970
|
+
productData,
|
|
10971
|
+
tempProductForm,
|
|
10972
|
+
productForm,
|
|
10973
|
+
k,
|
|
10974
|
+
errorMsg,
|
|
10975
|
+
reqData,
|
|
10976
|
+
reqDataStr,
|
|
10977
|
+
signature,
|
|
10978
|
+
_args2 = arguments;
|
|
10979
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
10980
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
10981
|
+
case 0:
|
|
10982
|
+
options = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : {};
|
|
10983
|
+
if (!(inputData && inputData.personData && inputData.productGroupList && inputData.productGroupList.length)) {
|
|
10984
|
+
_context2.next = 5;
|
|
10985
|
+
break;
|
|
10986
|
+
}
|
|
10987
|
+
productData = getProductFromInputData(inputData, {
|
|
10988
|
+
groupKey: options.groupKey,
|
|
10989
|
+
productKey: options.productKey
|
|
10990
|
+
});
|
|
10991
|
+
tempProductForm = convertProductData(productData); // 过滤一些不必要的数据
|
|
10992
|
+
productForm = {};
|
|
10993
|
+
for (k in tempProductForm) {
|
|
10994
|
+
if (!['hadChoice', 'hide', 'totalBaof', 'insShowArr', 'autoImport', 'restrictList', 'resultImport', 'adjustBaoeData'].includes(k)) {
|
|
10995
|
+
productForm[k] = tempProductForm[k];
|
|
10996
|
+
}
|
|
10997
|
+
}
|
|
10998
|
+
if (productForm.mulInsOrderList) {
|
|
10999
|
+
productForm.mulInsOrderList = productForm.mulInsOrderList.map(function (ins) {
|
|
11000
|
+
var tempIns = {};
|
|
11001
|
+
for (var _k2 in ins) {
|
|
11002
|
+
if (!['isFollowing', 'pPeriodDesc', 'baoeDesc', 'baofDesc', 'iDurationDesc', 'payModeDesc', 'payModePremiumDesc', 'accountData', 'reduceBaofData', 'duplicateReduceBaofData', 'isCheckbox', 'groupKey', 'groupName', 'shmInsData', 'totalBaof', 'customVariableExp',
|
|
11003
|
+
// 'calcResultExp', // 不能删除,后面有依赖
|
|
11004
|
+
'revalidateFlag'].includes(_k2)) {
|
|
11005
|
+
tempIns[_k2] = ins[_k2];
|
|
11006
|
+
}
|
|
11007
|
+
}
|
|
11008
|
+
return tempIns;
|
|
11009
|
+
});
|
|
11010
|
+
}
|
|
10873
11011
|
|
|
10874
|
-
|
|
10875
|
-
|
|
10876
|
-
|
|
10877
|
-
|
|
10878
|
-
|
|
10879
|
-
|
|
10880
|
-
|
|
10881
|
-
|
|
10882
|
-
|
|
10883
|
-
|
|
10884
|
-
|
|
10885
|
-
|
|
10886
|
-
|
|
10887
|
-
|
|
10888
|
-
|
|
10889
|
-
|
|
10890
|
-
|
|
10891
|
-
|
|
10892
|
-
|
|
10893
|
-
|
|
10894
|
-
|
|
10895
|
-
|
|
10896
|
-
|
|
10897
|
-
|
|
10898
|
-
|
|
10899
|
-
|
|
10900
|
-
|
|
10901
|
-
|
|
10902
|
-
|
|
10903
|
-
|
|
10904
|
-
|
|
10905
|
-
|
|
11012
|
+
// 产品是否有选中的险种
|
|
11013
|
+
if (!(productForm && productForm.policyType === 'online_trade')) {
|
|
11014
|
+
_context2.next = 1;
|
|
11015
|
+
break;
|
|
11016
|
+
}
|
|
11017
|
+
return _context2.abrupt("return", Promise.resolve({}));
|
|
11018
|
+
case 1:
|
|
11019
|
+
if (!(productForm && productForm.mulInsOrderList && productForm.mulInsOrderList.length)) {
|
|
11020
|
+
_context2.next = 3;
|
|
11021
|
+
break;
|
|
11022
|
+
}
|
|
11023
|
+
errorMsg = verifyProductRules({
|
|
11024
|
+
personData: inputData.personData,
|
|
11025
|
+
productData: productData
|
|
11026
|
+
});
|
|
11027
|
+
reqData = {
|
|
11028
|
+
publicPbUuid: options.publicPbUuid || null,
|
|
11029
|
+
insuranceTypeId: options.planbookId ? options.planbookId * 1 : null,
|
|
11030
|
+
personData: {
|
|
11031
|
+
personOrderList: convertPersonData(inputData.personData, inputData.personData.personOrderList.map(function (p) {
|
|
11032
|
+
return p.key;
|
|
11033
|
+
}))
|
|
11034
|
+
},
|
|
11035
|
+
productGroupList: [{
|
|
11036
|
+
key: options.groupKey,
|
|
11037
|
+
prodOrderList: [productForm] //转换后的产品数据
|
|
11038
|
+
}]
|
|
11039
|
+
};
|
|
11040
|
+
reqDataStr = JSON.stringify(reqData);
|
|
11041
|
+
_context2.next = 2;
|
|
11042
|
+
return getSecurityToken(reqDataStr, {
|
|
11043
|
+
groupDataKey: options.groupKey
|
|
11044
|
+
});
|
|
11045
|
+
case 2:
|
|
11046
|
+
signature = _context2.sent;
|
|
11047
|
+
return _context2.abrupt("return", Promise.resolve({
|
|
11048
|
+
errorMsg: errorMsg,
|
|
11049
|
+
jd: reqDataStr,
|
|
11050
|
+
signature: signature,
|
|
11051
|
+
clientVersion: appVersion,
|
|
11052
|
+
isIos: isIos
|
|
11053
|
+
}));
|
|
11054
|
+
case 3:
|
|
11055
|
+
return _context2.abrupt("return", Promise.reject('请选择险种'));
|
|
11056
|
+
case 4:
|
|
11057
|
+
_context2.next = 6;
|
|
11058
|
+
break;
|
|
11059
|
+
case 5:
|
|
11060
|
+
return _context2.abrupt("return", Promise.reject('请填写投保数据'));
|
|
11061
|
+
case 6:
|
|
11062
|
+
case "end":
|
|
11063
|
+
return _context2.stop();
|
|
11064
|
+
}
|
|
11065
|
+
}, _callee2);
|
|
11066
|
+
}));
|
|
11067
|
+
return _createdProductDataToCalc.apply(this, arguments);
|
|
10906
11068
|
}
|
|
10907
11069
|
function getProductFromInputData(inputData) {
|
|
10908
11070
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
@@ -10918,7 +11080,7 @@ function getProductFromInputData(inputData) {
|
|
|
10918
11080
|
return product;
|
|
10919
11081
|
}
|
|
10920
11082
|
|
|
10921
|
-
var _dec$1, _dec2$1, _dec3$1, _dec4$1, _dec5$1, _dec6$1, _dec7$1, _dec8, _dec9, _dec0, _dec1, _dec10, _class$1, _class2$1, _descriptor$1, _descriptor2$1, _descriptor3$1, _descriptor4$1, _descriptor5$1, _descriptor6$1, _descriptor7, _descriptor8, _descriptor9, _descriptor0;
|
|
11083
|
+
var _dec$1, _dec2$1, _dec3$1, _dec4$1, _dec5$1, _dec6$1, _dec7$1, _dec8$1, _dec9, _dec0, _dec1, _dec10, _class$1, _class2$1, _descriptor$1, _descriptor2$1, _descriptor3$1, _descriptor4$1, _descriptor5$1, _descriptor6$1, _descriptor7$1, _descriptor8, _descriptor9, _descriptor0;
|
|
10922
11084
|
function _callSuper$1(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$1() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
10923
11085
|
function _isNativeReflectConstruct$1() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$1 = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10924
11086
|
var BxtTitleItem = (_dec$1 = Component({
|
|
@@ -10935,7 +11097,7 @@ var BxtTitleItem = (_dec$1 = Component({
|
|
|
10935
11097
|
default: ''
|
|
10936
11098
|
}), _dec7$1 = Prop({
|
|
10937
11099
|
default: ''
|
|
10938
|
-
}), _dec8 = Prop({
|
|
11100
|
+
}), _dec8$1 = Prop({
|
|
10939
11101
|
default: ''
|
|
10940
11102
|
}), _dec9 = Prop({
|
|
10941
11103
|
default: ''
|
|
@@ -10961,7 +11123,7 @@ var BxtTitleItem = (_dec$1 = Component({
|
|
|
10961
11123
|
_initializerDefineProperty(_this, "label", _descriptor4$1, _this);
|
|
10962
11124
|
_initializerDefineProperty(_this, "code", _descriptor5$1, _this);
|
|
10963
11125
|
_initializerDefineProperty(_this, "huomianTag", _descriptor6$1, _this);
|
|
10964
|
-
_initializerDefineProperty(_this, "statusTag", _descriptor7, _this);
|
|
11126
|
+
_initializerDefineProperty(_this, "statusTag", _descriptor7$1, _this);
|
|
10965
11127
|
_initializerDefineProperty(_this, "huomianTips", _descriptor8, _this);
|
|
10966
11128
|
_initializerDefineProperty(_this, "disabled", _descriptor9, _this);
|
|
10967
11129
|
_initializerDefineProperty(_this, "dataStatId", _descriptor0, _this);
|
|
@@ -11028,7 +11190,7 @@ var BxtTitleItem = (_dec$1 = Component({
|
|
|
11028
11190
|
enumerable: true,
|
|
11029
11191
|
writable: true,
|
|
11030
11192
|
initializer: null
|
|
11031
|
-
}), _descriptor7 = _applyDecoratedDescriptor(_class2$1.prototype, "statusTag", [_dec8], {
|
|
11193
|
+
}), _descriptor7$1 = _applyDecoratedDescriptor(_class2$1.prototype, "statusTag", [_dec8$1], {
|
|
11032
11194
|
configurable: true,
|
|
11033
11195
|
enumerable: true,
|
|
11034
11196
|
writable: true,
|
|
@@ -11251,6 +11413,7 @@ const script$2 = {
|
|
|
11251
11413
|
|
|
11252
11414
|
/* script */
|
|
11253
11415
|
var __vue_script__$3 = script$2;
|
|
11416
|
+
|
|
11254
11417
|
/* template */
|
|
11255
11418
|
var __vue_render__$3 = function __vue_render__() {
|
|
11256
11419
|
var _vm = this;
|
|
@@ -11329,29 +11492,6 @@ var __vue_component__$3 = /*#__PURE__*/normalizeComponent({
|
|
|
11329
11492
|
staticRenderFns: __vue_staticRenderFns__$3
|
|
11330
11493
|
}, __vue_inject_styles__$3, __vue_script__$3);
|
|
11331
11494
|
|
|
11332
|
-
//
|
|
11333
|
-
//
|
|
11334
|
-
//
|
|
11335
|
-
//
|
|
11336
|
-
//
|
|
11337
|
-
//
|
|
11338
|
-
//
|
|
11339
|
-
//
|
|
11340
|
-
//
|
|
11341
|
-
//
|
|
11342
|
-
//
|
|
11343
|
-
//
|
|
11344
|
-
//
|
|
11345
|
-
//
|
|
11346
|
-
//
|
|
11347
|
-
//
|
|
11348
|
-
//
|
|
11349
|
-
//
|
|
11350
|
-
//
|
|
11351
|
-
//
|
|
11352
|
-
//
|
|
11353
|
-
//
|
|
11354
|
-
|
|
11355
11495
|
function initPickerConfig() {
|
|
11356
11496
|
return {
|
|
11357
11497
|
visible: false,
|
|
@@ -11460,6 +11600,7 @@ const script$1 = {
|
|
|
11460
11600
|
|
|
11461
11601
|
/* script */
|
|
11462
11602
|
var __vue_script__$2 = script$1;
|
|
11603
|
+
|
|
11463
11604
|
/* template */
|
|
11464
11605
|
var __vue_render__$2 = function __vue_render__() {
|
|
11465
11606
|
var _vm = this;
|
|
@@ -11528,49 +11669,6 @@ var __vue_component__$2 = /*#__PURE__*/normalizeComponent({
|
|
|
11528
11669
|
staticRenderFns: __vue_staticRenderFns__$2
|
|
11529
11670
|
}, __vue_inject_styles__$2, __vue_script__$2);
|
|
11530
11671
|
|
|
11531
|
-
/**转换时间字符串
|
|
11532
|
-
* @Author Lizh
|
|
11533
|
-
* @DateTime 2020-04-16
|
|
11534
|
-
* @param {[type]} time [description]
|
|
11535
|
-
* @param {[type]} cFormat [description]
|
|
11536
|
-
* @return {[type]} [description]
|
|
11537
|
-
*/
|
|
11538
|
-
function parseTime(time, cFormat) {
|
|
11539
|
-
if (arguments.length === 0) {
|
|
11540
|
-
return null;
|
|
11541
|
-
}
|
|
11542
|
-
var format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}';
|
|
11543
|
-
var date;
|
|
11544
|
-
if (time === null) {
|
|
11545
|
-
return;
|
|
11546
|
-
} else if (_typeof$2(time) === 'object') {
|
|
11547
|
-
date = time;
|
|
11548
|
-
} else {
|
|
11549
|
-
if (('' + time).length === 10) time = parseInt(time) * 1000;
|
|
11550
|
-
date = new Date(time);
|
|
11551
|
-
}
|
|
11552
|
-
var formatObj = {
|
|
11553
|
-
y: date.getFullYear(),
|
|
11554
|
-
m: date.getMonth() + 1,
|
|
11555
|
-
d: date.getDate(),
|
|
11556
|
-
h: date.getHours(),
|
|
11557
|
-
i: date.getMinutes(),
|
|
11558
|
-
s: date.getSeconds(),
|
|
11559
|
-
a: date.getDay()
|
|
11560
|
-
};
|
|
11561
|
-
var timeStr = format.replace(/{(y|m|d|h|i|s|a)+}/g, function (result, key) {
|
|
11562
|
-
var value = formatObj[key];
|
|
11563
|
-
if (key === 'a') {
|
|
11564
|
-
return ['日', '一', '二', '三', '四', '五', '六'][value];
|
|
11565
|
-
}
|
|
11566
|
-
if (result.length > 0 && value < 10) {
|
|
11567
|
-
value = '0' + value;
|
|
11568
|
-
}
|
|
11569
|
-
return value || 0;
|
|
11570
|
-
});
|
|
11571
|
-
return timeStr;
|
|
11572
|
-
}
|
|
11573
|
-
|
|
11574
11672
|
const script = {
|
|
11575
11673
|
components: {
|
|
11576
11674
|
CommonSelect: __vue_component__$2
|
|
@@ -11674,6 +11772,7 @@ const script = {
|
|
|
11674
11772
|
|
|
11675
11773
|
/* script */
|
|
11676
11774
|
var __vue_script__$1 = script;
|
|
11775
|
+
|
|
11677
11776
|
/* template */
|
|
11678
11777
|
var __vue_render__$1 = function __vue_render__() {
|
|
11679
11778
|
var _vm = this;
|
|
@@ -11770,7 +11869,7 @@ var __vue_component__$1 = /*#__PURE__*/normalizeComponent({
|
|
|
11770
11869
|
staticRenderFns: __vue_staticRenderFns__$1
|
|
11771
11870
|
}, __vue_inject_styles__$1, __vue_script__$1);
|
|
11772
11871
|
|
|
11773
|
-
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6;
|
|
11872
|
+
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7;
|
|
11774
11873
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: true } : { done: false, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = true, u = false; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = true, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
11775
11874
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
11776
11875
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
@@ -11793,12 +11892,16 @@ var BxtProductInfo = (_dec = Component({
|
|
|
11793
11892
|
return {};
|
|
11794
11893
|
}
|
|
11795
11894
|
}), _dec4 = Prop({
|
|
11796
|
-
default:
|
|
11895
|
+
default: function _default() {
|
|
11896
|
+
return {};
|
|
11897
|
+
}
|
|
11797
11898
|
}), _dec5 = Prop({
|
|
11798
11899
|
default: null
|
|
11799
11900
|
}), _dec6 = Prop({
|
|
11800
|
-
default:
|
|
11901
|
+
default: null
|
|
11801
11902
|
}), _dec7 = Prop({
|
|
11903
|
+
default: true
|
|
11904
|
+
}), _dec8 = Prop({
|
|
11802
11905
|
default: function _default() {
|
|
11803
11906
|
return {};
|
|
11804
11907
|
}
|
|
@@ -11815,12 +11918,13 @@ var BxtProductInfo = (_dec = Component({
|
|
|
11815
11918
|
_defineProperty$1(_this, "recommendValues", {});
|
|
11816
11919
|
_defineProperty$1(_this, "recommendValuesCache", {});
|
|
11817
11920
|
_defineProperty$1(_this, "isShowCustomValueTips", true);
|
|
11818
|
-
_initializerDefineProperty(_this, "
|
|
11819
|
-
_initializerDefineProperty(_this, "
|
|
11820
|
-
_initializerDefineProperty(_this, "
|
|
11821
|
-
_initializerDefineProperty(_this, "
|
|
11822
|
-
_initializerDefineProperty(_this, "
|
|
11823
|
-
_initializerDefineProperty(_this, "
|
|
11921
|
+
_initializerDefineProperty(_this, "user", _descriptor, _this);
|
|
11922
|
+
_initializerDefineProperty(_this, "inputData", _descriptor2, _this);
|
|
11923
|
+
_initializerDefineProperty(_this, "verifyData", _descriptor3, _this);
|
|
11924
|
+
_initializerDefineProperty(_this, "groupKey", _descriptor4, _this);
|
|
11925
|
+
_initializerDefineProperty(_this, "productKey", _descriptor5, _this);
|
|
11926
|
+
_initializerDefineProperty(_this, "showRecommendValue", _descriptor6, _this);
|
|
11927
|
+
_initializerDefineProperty(_this, "params", _descriptor7, _this);
|
|
11824
11928
|
return _this;
|
|
11825
11929
|
}
|
|
11826
11930
|
_inherits(BxtProductInfo, _Vue);
|
|
@@ -11964,11 +12068,11 @@ var BxtProductInfo = (_dec = Component({
|
|
|
11964
12068
|
value: function () {
|
|
11965
12069
|
var _changeProduct = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(productData, options) {
|
|
11966
12070
|
var _this5 = this;
|
|
11967
|
-
var $listeners, inputData, verifyData, personData, groupKey, productKey, params, type, insData, eleData, planbookId, publicPbUuid, productVerifyData, eventTarget, errorMsg;
|
|
12071
|
+
var $listeners, user, inputData, verifyData, personData, groupKey, productKey, params, type, insData, eleData, planbookId, publicPbUuid, productVerifyData, eventTarget, errorMsg;
|
|
11968
12072
|
return _regeneratorRuntime.wrap(function (_context4) {
|
|
11969
12073
|
while (1) switch (_context4.prev = _context4.next) {
|
|
11970
12074
|
case 0:
|
|
11971
|
-
$listeners = this.$listeners, inputData = this.inputData, verifyData = this.verifyData, personData = this.personData, groupKey = this.groupKey, productKey = this.productKey, params = this.params;
|
|
12075
|
+
$listeners = this.$listeners, user = this.user, inputData = this.inputData, verifyData = this.verifyData, personData = this.personData, groupKey = this.groupKey, productKey = this.productKey, params = this.params;
|
|
11972
12076
|
type = options.type, insData = options.insData, eleData = options.eleData;
|
|
11973
12077
|
planbookId = get(params, 'planbookId');
|
|
11974
12078
|
publicPbUuid = get(params, 'publicPbUuid');
|
|
@@ -11978,12 +12082,14 @@ var BxtProductInfo = (_dec = Component({
|
|
|
11978
12082
|
insuranceCode: get(insData, 'code') || null,
|
|
11979
12083
|
elementKey: get(eleData, 'key') || null
|
|
11980
12084
|
};
|
|
11981
|
-
if (
|
|
11982
|
-
|
|
12085
|
+
if (productData.multipleInsured) {
|
|
12086
|
+
multipleInsuredHandler(productData, personData);
|
|
11983
12087
|
}
|
|
11984
12088
|
_context4.next = 1;
|
|
11985
12089
|
return productDataHandler(productData, productVerifyData, personData, {
|
|
12090
|
+
user: user,
|
|
11986
12091
|
planbookId: planbookId,
|
|
12092
|
+
executeSource: 'userAction',
|
|
11987
12093
|
eventTarget: eventTarget
|
|
11988
12094
|
});
|
|
11989
12095
|
case 1:
|
|
@@ -12018,10 +12124,12 @@ var BxtProductInfo = (_dec = Component({
|
|
|
12018
12124
|
_context3.next = 1;
|
|
12019
12125
|
return new Promise(function (resolve, reject) {
|
|
12020
12126
|
_this5.$emit('reCalculate', inputData, {
|
|
12127
|
+
user: user,
|
|
12021
12128
|
planbookId: planbookId,
|
|
12022
12129
|
publicPbUuid: publicPbUuid,
|
|
12023
12130
|
groupKey: groupKey,
|
|
12024
12131
|
productKey: productKey,
|
|
12132
|
+
executeSource: 'userAction',
|
|
12025
12133
|
isIgnoreError: true,
|
|
12026
12134
|
eventTarget: eventTarget
|
|
12027
12135
|
}, resolve, reject);
|
|
@@ -12031,7 +12139,9 @@ var BxtProductInfo = (_dec = Component({
|
|
|
12031
12139
|
case 1:
|
|
12032
12140
|
_context3.next = 2;
|
|
12033
12141
|
return productDataHandler(productData, productVerifyData, personData, {
|
|
12142
|
+
user: user,
|
|
12034
12143
|
planbookId: planbookId,
|
|
12144
|
+
executeSource: 'userAction',
|
|
12035
12145
|
eventTarget: eventTarget
|
|
12036
12146
|
});
|
|
12037
12147
|
case 2:
|
|
@@ -12239,7 +12349,7 @@ var BxtProductInfo = (_dec = Component({
|
|
|
12239
12349
|
}, {
|
|
12240
12350
|
key: "getRecommendValues",
|
|
12241
12351
|
value: function getRecommendValues(ins, ele) {
|
|
12242
|
-
if (!['baoe', 'baof'].includes(ele.key)) {
|
|
12352
|
+
if (!['baoe', 'baof'].includes(ele.key) || ele.isDisabled) {
|
|
12243
12353
|
return null;
|
|
12244
12354
|
}
|
|
12245
12355
|
var insurance = convertEleOrderListToObj(ins);
|
|
@@ -12249,7 +12359,7 @@ var BxtProductInfo = (_dec = Component({
|
|
|
12249
12359
|
key: "requiestRecommendValues",
|
|
12250
12360
|
value: function () {
|
|
12251
12361
|
var _requiestRecommendValues = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
12252
|
-
var self, showRecommendValue, recommendValuesCache, inputData, groupData, productData,
|
|
12362
|
+
var self, showRecommendValue, recommendValuesCache, inputData, groupData, productData, requestDataToCalc, reqParams, inputDataToCalc, mulInsOrderList;
|
|
12253
12363
|
return _regeneratorRuntime.wrap(function (_context6) {
|
|
12254
12364
|
while (1) switch (_context6.prev = _context6.next) {
|
|
12255
12365
|
case 0:
|
|
@@ -12261,26 +12371,23 @@ var BxtProductInfo = (_dec = Component({
|
|
|
12261
12371
|
}
|
|
12262
12372
|
return _context6.abrupt("return");
|
|
12263
12373
|
case 1:
|
|
12264
|
-
url = "".concat(PLANBOOK_API_HOSTNAME, "/planBook/input/calculate/recommend");
|
|
12265
12374
|
_context6.next = 2;
|
|
12266
12375
|
return createdProductDataToCalc(inputData, {
|
|
12267
12376
|
groupKey: groupData.key,
|
|
12268
12377
|
productKey: productData.key
|
|
12269
12378
|
}).catch(function () {});
|
|
12270
12379
|
case 2:
|
|
12271
|
-
|
|
12380
|
+
requestDataToCalc = _context6.sent;
|
|
12272
12381
|
reqParams = [];
|
|
12273
|
-
|
|
12274
|
-
|
|
12275
|
-
|
|
12276
|
-
|
|
12277
|
-
|
|
12278
|
-
|
|
12279
|
-
|
|
12280
|
-
calMethod: ins.calMethod || ins.feeType || ins.feeBaseType
|
|
12281
|
-
});
|
|
12382
|
+
inputDataToCalc = requestDataToCalc && JSON.parse(requestDataToCalc.jd);
|
|
12383
|
+
mulInsOrderList = get(inputDataToCalc, 'productGroupList[0].prodOrderList[0].mulInsOrderList') || [];
|
|
12384
|
+
mulInsOrderList.forEach(function (ins) {
|
|
12385
|
+
reqParams.push({
|
|
12386
|
+
insuranceId: ins.key,
|
|
12387
|
+
period: ins.pPeriod,
|
|
12388
|
+
calMethod: ins.calMethod || ins.feeType || ins.feeBaseType
|
|
12282
12389
|
});
|
|
12283
|
-
}
|
|
12390
|
+
});
|
|
12284
12391
|
if (!recommendValuesCache[JSON.stringify(reqParams)]) {
|
|
12285
12392
|
_context6.next = 3;
|
|
12286
12393
|
break;
|
|
@@ -12288,30 +12395,13 @@ var BxtProductInfo = (_dec = Component({
|
|
|
12288
12395
|
self.recommendValues = recommendValuesCache[JSON.stringify(reqParams)];
|
|
12289
12396
|
return _context6.abrupt("return");
|
|
12290
12397
|
case 3:
|
|
12291
|
-
return _context6.abrupt("return",
|
|
12292
|
-
method: 'POST',
|
|
12293
|
-
credentials: 'include',
|
|
12294
|
-
headers: {
|
|
12295
|
-
Accept: 'application/json, text/plain, */*',
|
|
12296
|
-
'Content-Type': 'application/json;'
|
|
12297
|
-
},
|
|
12298
|
-
body: JSON.stringify(reqParams)
|
|
12299
|
-
}).then(function (response) {
|
|
12300
|
-
return response.json();
|
|
12301
|
-
}).then(function (_ref4) {
|
|
12302
|
-
var success = _ref4.success,
|
|
12303
|
-
data = _ref4.data,
|
|
12304
|
-
info = _ref4.info;
|
|
12305
|
-
if (!success || !data) {
|
|
12306
|
-
self.$toast(info);
|
|
12307
|
-
return Promise.reject();
|
|
12308
|
-
}
|
|
12398
|
+
return _context6.abrupt("return", getPlanbookRecommendData(reqParams).then(function (data) {
|
|
12309
12399
|
var recommendValues = data.reduce(function (obj, ele) {
|
|
12310
12400
|
return Object.assign(obj, _defineProperty$1({}, ele.insuranceId, ele.valueList));
|
|
12311
12401
|
}, {});
|
|
12312
12402
|
|
|
12313
12403
|
// 推荐金额,根据最小值和最大值进行过滤。From hyw
|
|
12314
|
-
var mulInsOrderList = productData
|
|
12404
|
+
var mulInsOrderList = get(productData, 'mulInsOrderList') || [];
|
|
12315
12405
|
mulInsOrderList.filter(function (ins) {
|
|
12316
12406
|
return ins.eleOrderList && ins.eleOrderList.length;
|
|
12317
12407
|
}).filter(function (ins) {
|
|
@@ -12337,8 +12427,9 @@ var BxtProductInfo = (_dec = Component({
|
|
|
12337
12427
|
});
|
|
12338
12428
|
self.recommendValues = recommendValues;
|
|
12339
12429
|
recommendValuesCache[JSON.stringify(reqParams)] = recommendValues;
|
|
12340
|
-
}).catch(function (
|
|
12341
|
-
|
|
12430
|
+
}).catch(function (info) {
|
|
12431
|
+
self.$toast(info);
|
|
12432
|
+
console.log(info);
|
|
12342
12433
|
}));
|
|
12343
12434
|
case 4:
|
|
12344
12435
|
case "end":
|
|
@@ -12431,32 +12522,37 @@ var BxtProductInfo = (_dec = Component({
|
|
|
12431
12522
|
});
|
|
12432
12523
|
}
|
|
12433
12524
|
}]);
|
|
12434
|
-
}(Vue), _descriptor = _applyDecoratedDescriptor(_class2.prototype, "
|
|
12525
|
+
}(Vue), _descriptor = _applyDecoratedDescriptor(_class2.prototype, "user", [_dec2], {
|
|
12526
|
+
configurable: true,
|
|
12527
|
+
enumerable: true,
|
|
12528
|
+
writable: true,
|
|
12529
|
+
initializer: null
|
|
12530
|
+
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "inputData", [_dec3], {
|
|
12435
12531
|
configurable: true,
|
|
12436
12532
|
enumerable: true,
|
|
12437
12533
|
writable: true,
|
|
12438
12534
|
initializer: null
|
|
12439
|
-
}),
|
|
12535
|
+
}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "verifyData", [_dec4], {
|
|
12440
12536
|
configurable: true,
|
|
12441
12537
|
enumerable: true,
|
|
12442
12538
|
writable: true,
|
|
12443
12539
|
initializer: null
|
|
12444
|
-
}),
|
|
12540
|
+
}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "groupKey", [_dec5], {
|
|
12445
12541
|
configurable: true,
|
|
12446
12542
|
enumerable: true,
|
|
12447
12543
|
writable: true,
|
|
12448
12544
|
initializer: null
|
|
12449
|
-
}),
|
|
12545
|
+
}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "productKey", [_dec6], {
|
|
12450
12546
|
configurable: true,
|
|
12451
12547
|
enumerable: true,
|
|
12452
12548
|
writable: true,
|
|
12453
12549
|
initializer: null
|
|
12454
|
-
}),
|
|
12550
|
+
}), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "showRecommendValue", [_dec7], {
|
|
12455
12551
|
configurable: true,
|
|
12456
12552
|
enumerable: true,
|
|
12457
12553
|
writable: true,
|
|
12458
12554
|
initializer: null
|
|
12459
|
-
}),
|
|
12555
|
+
}), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "params", [_dec8], {
|
|
12460
12556
|
configurable: true,
|
|
12461
12557
|
enumerable: true,
|
|
12462
12558
|
writable: true,
|