bxs-tools-ui 1.2.9 → 1.2.11

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.
@@ -91,7 +91,7 @@ return /******/ (function(modules) { // webpackBootstrap
91
91
  /******/
92
92
  /******/
93
93
  /******/ // Load entry module and return exports
94
- /******/ return __webpack_require__(__webpack_require__.s = 10);
94
+ /******/ return __webpack_require__(__webpack_require__.s = 7);
95
95
  /******/ })
96
96
  /************************************************************************/
97
97
  /******/ ([
@@ -501,7 +501,7 @@ function getAgeFromBirth(birth, cDate) {
501
501
  "use strict";
502
502
 
503
503
 
504
- var bind = __webpack_require__(20);
504
+ var bind = __webpack_require__(22);
505
505
 
506
506
  /*global toString:true*/
507
507
 
@@ -1115,992 +1115,993 @@ function restrictElementsInInsurance(_a) {
1115
1115
 
1116
1116
 
1117
1117
  /***/ }),
1118
- /* 7 */,
1119
- /* 8 */
1118
+ /* 7 */
1120
1119
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1121
1120
 
1122
1121
  "use strict";
1123
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return initPersonData; });
1124
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return personDataHandler; });
1125
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getInsuredAgeRange; });
1126
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return setPersonAgeOptions; });
1127
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return convertPersonData; });
1128
- /* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
1129
-
1130
- function initPersonData(inputData, verifyData) {
1131
- var personData = inputData.personData;
1132
- if (!personData || !personData.personOrderList) {
1133
- return;
1134
- }
1135
- var personOrderList = personData.personOrderList;
1136
- if (!personOrderList || !personOrderList.length) {
1137
- return;
1138
- }
1139
- personOrderList.forEach(function (person) {
1140
- if (!person || !person.eleOrderList) {
1141
- return;
1142
- }
1143
- person.createArchive = person.createArchive || false;
1144
- if (!person.eleOrderList.find(function (e) { return e.key === 'name'; })) {
1145
- person.eleOrderList.splice(1, 0, {
1146
- key: 'name',
1147
- value: '',
1148
- label: '姓名',
1149
- placeholder: '请输入姓名',
1150
- componentName: 'cmCommonInput',
1151
- maxlength: 16,
1152
- isHide: false
1153
- });
1154
- }
1155
- if (person.key === 'applicantInfo') {
1156
- if (person.eleOrderList.every(function (e) { return e.key !== 'applicantAndInsuredSame'; })) {
1157
- person.eleOrderList.splice(1, 0, {
1158
- key: 'applicantAndInsuredSame',
1159
- value: 0,
1160
- label: '投被保人',
1161
- componentName: 'cmCommonRadio',
1162
- options: [
1163
- { val: 0, desc: '非同一人' },
1164
- { val: 1, desc: '是同一人' }
1165
- ]
1166
- });
1167
- }
1168
- }
1169
- var index = person.eleOrderList.findIndex(function (e) { return e.key === 'age'; });
1170
- if (person.eleOrderList.every(function (e) { return e.key !== 'birthday'; })) {
1171
- person.eleOrderList.splice(index + 1, 0, {
1172
- key: 'birthday',
1173
- value: null,
1174
- label: '生日',
1175
- componentName: null,
1176
- placeholder: '请选择生日',
1177
- minDate: null,
1178
- maxDate: null,
1179
- defaulValue: null
1180
- });
1181
- }
1182
- var ageRange = getInsuredAgeRange(inputData, verifyData);
1183
- if (ageRange) {
1184
- personOrderList.forEach(function (person) {
1185
- if (person.key === 'insuredInfo' && ageRange[person.key + "1"] && ageRange[person.key + "1"].length) {
1186
- person.eleOrderList && person.eleOrderList.forEach(function (ele) {
1187
- if (ele.key === 'age') {
1188
- ele.opts = ageRange[person.key + "1"];
1189
- if (ageRange[person.key + "2"].length && ele.opts &&
1190
- (ele.opts[0] !== ageRange[person.key + "2"][0] || ele.opts[1] !== ageRange[person.key + "2"][1])) {
1191
- ele.optsF = ageRange[person.key + "2"];
1192
- }
1193
- }
1194
- });
1195
- }
1196
- });
1197
- }
1198
- person.eleOrderList.forEach(function (e) {
1199
- switch (e.key) {
1200
- case 'title': {
1201
- e.isDisabled = e.isDisabled || null;
1202
- e.componentName = 'cmCommonTitle';
1203
- switch (person.key) {
1204
- case 'insuredInfo':
1205
- e.isDisabled = true;
1206
- e.label = '被保人信息';
1207
- break;
1208
- case 'applicantInfo':
1209
- e.label = '投保人信息(豁免相关)';
1210
- break;
1211
- case 'spouseInfo':
1212
- e.label = '投保人配偶信息';
1213
- break;
1214
- default:
1215
- e.label = '人员信息';
1216
- break;
1217
- }
1218
- break;
1219
- }
1220
- case 'sex': {
1221
- e.label = '性别';
1222
- e.componentName = 'cmCommonRadio';
1223
- e.options = [
1224
- { val: 1, desc: '男' },
1225
- { val: 2, desc: '女' }
1226
- ];
1227
- if (e.opts && e.opts.length) {
1228
- e.options = e.opts.map(function (o) { return ({
1229
- val: o.val,
1230
- desc: o.desc
1231
- }); });
1232
- }
1233
- if (!e.options.find(function (o) { return o.val === e.value; })) {
1234
- e.value = e.options[0].val;
1235
- }
1236
- e.isDisabled = person.key === 'spouseInfo';
1237
- break;
1238
- }
1239
- case 'age': {
1240
- e.label = '年龄';
1241
- e.componentName = 'cmAgeBirthday';
1242
- e.placeholder = '请选择年龄';
1243
- e.options = [];
1244
- break;
1245
- }
1246
- }
1247
- });
1248
- setPersonAgeOptions(person);
1249
- });
1250
- }
1251
- function personDataHandler(allPersonsData) {
1252
- if (!allPersonsData || !allPersonsData.personOrderList) {
1253
- return allPersonsData;
1254
- }
1255
- allPersonsData.personOrderList.forEach(function (person, i, arr) {
1256
- setPersonAgeOptions(person);
1257
- var insuredData = arr.find(function (p) { return p.key === 'insuredInfo'; });
1258
- var applicantData = arr.find(function (p) { return p.key === 'applicantInfo'; });
1259
- var insuredInfo = convertPersonData(allPersonsData, 'insuredInfo');
1260
- var applicantInfo = convertPersonData(allPersonsData, 'applicantInfo');
1261
- if (person.key === 'insuredInfo' && applicantData && applicantData.eleOrderList) {
1262
- var applicantAge = applicantData.eleOrderList.find(function (e) { return e.key === 'age'; });
1263
- var applicantTitle = applicantData.eleOrderList.find(function (e) { return e.key === 'title'; });
1264
- var applicantSame = applicantData.eleOrderList.find(function (e) { return e.key === 'applicantAndInsuredSame'; });
1265
- if (applicantAge.opts && insuredInfo.age >= applicantAge.opts[0] && insuredInfo.age <= applicantAge.opts[1]) {
1266
- if (applicantTitle) {
1267
- applicantTitle.isDisabled = false;
1268
- }
1269
- if (applicantSame) {
1270
- applicantSame.isDisabled = null;
1271
- applicantSame.isHide = null;
1272
- }
1273
- }
1274
- else {
1275
- if (applicantTitle) {
1276
- applicantTitle.value = true;
1277
- applicantTitle.isDisabled = true;
1278
- }
1279
- if (applicantSame) {
1280
- applicantSame.value = 0;
1281
- applicantSame.isDisabled = true;
1282
- applicantSame.isHide = true;
1283
- }
1284
- }
1285
- }
1286
- if (person.key === 'applicantInfo' && person.eleOrderList) {
1287
- var applicantSame_1 = person.eleOrderList.find(function (e) { return e.key === 'applicantAndInsuredSame'; });
1288
- if (applicantSame_1) {
1289
- person.eleOrderList.forEach(function (ele) {
1290
- if (['title', 'applicantAndInsuredSame'].includes(ele.key)) {
1291
- return;
1292
- }
1293
- if (insuredData.cid !== undefined) {
1294
- person.cid = applicantSame_1.value ? insuredData.cid : undefined;
1295
- }
1296
- if (applicantSame_1.value && insuredData.eleOrderList) {
1297
- var insuredEle = insuredData.eleOrderList.find(function (e) { return e.key === ele.key; });
1298
- if (insuredEle) {
1299
- ele.value = insuredEle.value;
1300
- }
1301
- }
1302
- });
1303
- }
1304
- }
1305
- if (person.key === 'spouseInfo' && person.eleOrderList) {
1306
- person.eleOrderList.forEach(function (ele) {
1307
- if (ele.key === 'title') {
1308
- ele.isDisabled = !applicantInfo.title;
1309
- ele.value = applicantInfo.title ? ele.value : false;
1310
- }
1311
- if (ele.key === 'sex') {
1312
- ele.value = applicantInfo.sex === 1 ? 2 : 1;
1313
- }
1314
- });
1315
- }
1316
- setPersonAgeOptions(person);
1317
- });
1318
- return allPersonsData;
1319
- }
1320
- function getInsuredAgeRange(inputData, verifyData) {
1321
- var ageRange = {
1322
- insuredInfo1: [],
1323
- insuredInfo2: []
1324
- };
1325
- if (!inputData ||
1326
- !inputData.productGroupList ||
1327
- !inputData.personData ||
1328
- !inputData.personData.personOrderList ||
1329
- !verifyData) {
1330
- return ageRange;
1331
- }
1332
- inputData.productGroupList.forEach(function (group) {
1333
- if (!group.prodOrderList) {
1334
- return;
1335
- }
1336
- var hasRequiredProd = group.prodOrderList.some(function (prod, i) { return i < group.defNum && !!prod.required && !prod.isTemp; });
1337
- group.prodOrderList.forEach(function (prod) {
1338
- if (!verifyData[prod.key] || prod.isTemp || !prod.mulInsOrderList) {
1339
- return;
1340
- }
1341
- prod.mulInsOrderList.forEach(function (ins) {
1342
- if (!verifyData[prod.key][ins.key]) {
1343
- if (window.DEBUG_TEMP_CONSOLE_FLAG) {
1344
- console.log(prod.titleName + "-" + prod.key + " -> " + ins.name + "-" + ins.key + ": \u5F53\u524D\u9669\u79CD\u6CA1\u6709\u8D39\u7387\u8868");
1345
- }
1346
- return;
1347
- }
1348
- var hasRequiredIns = prod.mulInsOrderList.some(function (ins) { return !!ins.required; });
1349
- if ((!ins.huomian || ins.huomian === 'beiHuomian') &&
1350
- (!hasRequiredProd || prod.required) &&
1351
- (!hasRequiredIns || ins.required)) {
1352
- verifyData[prod.key][ins.key].forEach(function (condi) {
1353
- var currentAgeRange = ageRange["insuredInfo" + condi.sex];
1354
- ageRange["insuredInfo" + condi.sex] = [
1355
- Math.min(currentAgeRange[0] === undefined ? Infinity : currentAgeRange[0], condi.minAge),
1356
- Math.max(currentAgeRange[1] === undefined ? -Infinity : currentAgeRange[1], condi.maxAge)
1357
- ];
1358
- });
1359
- }
1360
- });
1361
- });
1362
- });
1363
- return ageRange;
1364
- }
1365
- function setPersonAgeOptions(personData) {
1366
- if (!personData || !personData.eleOrderList) {
1367
- return personData;
1368
- }
1369
- var personForm = Object(_common__WEBPACK_IMPORTED_MODULE_0__[/* convertEleOrderListToObj */ "c"])(personData);
1370
- personData.eleOrderList.forEach(function (ele) {
1371
- if (ele.key === 'age') {
1372
- var options = [];
1373
- var opts = (personForm.sex == 2 && ele.optsF && ele.optsF.length ? ele.optsF : ele.opts);
1374
- for (var k = opts[0]; k <= opts[1]; k++) {
1375
- options.push({
1376
- val: k,
1377
- desc: k + "\u5C81"
1378
- });
1379
- }
1380
- var birthday = personData.eleOrderList.find(function (e) { return e.key === 'birthday'; });
1381
- if (options.length && options.every(function (o) { return o.val !== ele.value; })) {
1382
- ele.value = options[0].val;
1383
- if (birthday) {
1384
- birthday.value = null;
1385
- }
1386
- }
1387
- ele.options = options;
1388
- if (birthday) {
1389
- birthday.defaulValue = new Date(new Date().getFullYear() - Number(ele.value), new Date().getMonth(), new Date().getDate());
1390
- birthday.minDate = new Date(new Date().getFullYear() - opts[1] - 1, new Date().getMonth(), new Date().getDate() + 1);
1391
- birthday.maxDate = new Date(new Date().getFullYear() - opts[0], new Date().getMonth(), new Date().getDate());
1392
- }
1393
- }
1394
- });
1395
- return personData;
1396
- }
1397
- function convertPersonData(allPersonsData, type) {
1398
- if (type === void 0) { type = null; }
1399
- var cPersonData = {};
1400
- if (allPersonsData) {
1401
- if (allPersonsData.recipientInfo) {
1402
- cPersonData.recipientInfo = Object(_common__WEBPACK_IMPORTED_MODULE_0__[/* convertEleOrderListToObj */ "c"])(allPersonsData.recipientInfo);
1403
- }
1404
- if (allPersonsData.personOrderList) {
1405
- allPersonsData.personOrderList.forEach(function (person) {
1406
- cPersonData[person.key] = Object(_common__WEBPACK_IMPORTED_MODULE_0__[/* convertEleOrderListToObj */ "c"])(person);
1407
- });
1408
- }
1409
- }
1410
- if (!type) {
1411
- return {
1412
- recipientInfo: cPersonData.recipientInfo,
1413
- personOrderList: allPersonsData.personOrderList && allPersonsData.personOrderList.map(function (p) { return p.key; }).map(function (p) { return cPersonData[p]; })
1414
- };
1415
- }
1416
- if (typeof type === 'string') {
1417
- return cPersonData[type];
1418
- }
1419
- if (type.constructor === Array) {
1420
- var temp = [];
1421
- for (var k in cPersonData) {
1422
- if (type.indexOf(k) !== -1) {
1423
- temp.push(cPersonData[k]);
1424
- }
1425
- }
1426
- return temp;
1122
+ // ESM COMPAT FLAG
1123
+ __webpack_require__.r(__webpack_exports__);
1124
+
1125
+ // EXPORTS
1126
+ __webpack_require__.d(__webpack_exports__, "convertEleOrderListToObj", function() { return /* reexport */ planbook["d" /* convertEleOrderListToObj */]; });
1127
+ __webpack_require__.d(__webpack_exports__, "calcTotalBaof", function() { return /* reexport */ planbook["a" /* calcTotalBaof */]; });
1128
+ __webpack_require__.d(__webpack_exports__, "getHuomianPeriodValue", function() { return /* reexport */ planbook["j" /* getHuomianPeriodValue */]; });
1129
+ __webpack_require__.d(__webpack_exports__, "getNumberFromYear", function() { return /* reexport */ planbook["l" /* getNumberFromYear */]; });
1130
+ __webpack_require__.d(__webpack_exports__, "converUnit10000", function() { return /* reexport */ planbook["c" /* converUnit10000 */]; });
1131
+ __webpack_require__.d(__webpack_exports__, "deepCopy", function() { return /* reexport */ planbook["g" /* deepCopy */]; });
1132
+ __webpack_require__.d(__webpack_exports__, "getAgeFromBirth", function() { return /* reexport */ planbook["h" /* getAgeFromBirth */]; });
1133
+ __webpack_require__.d(__webpack_exports__, "initPersonData", function() { return /* reexport */ planbook["o" /* initPersonData */]; });
1134
+ __webpack_require__.d(__webpack_exports__, "personDataHandler", function() { return /* reexport */ planbook["s" /* personDataHandler */]; });
1135
+ __webpack_require__.d(__webpack_exports__, "getInsuredAgeRange", function() { return /* reexport */ planbook["k" /* getInsuredAgeRange */]; });
1136
+ __webpack_require__.d(__webpack_exports__, "setPersonAgeOptions", function() { return /* reexport */ planbook["y" /* setPersonAgeOptions */]; });
1137
+ __webpack_require__.d(__webpack_exports__, "convertPersonData", function() { return /* reexport */ planbook["e" /* convertPersonData */]; });
1138
+ __webpack_require__.d(__webpack_exports__, "initProductData", function() { return /* reexport */ planbook["p" /* initProductData */]; });
1139
+ __webpack_require__.d(__webpack_exports__, "productDataHandler", function() { return /* reexport */ planbook["t" /* productDataHandler */]; });
1140
+ __webpack_require__.d(__webpack_exports__, "getElementVerifyFromProductVerify", function() { return /* reexport */ planbook["i" /* getElementVerifyFromProductVerify */]; });
1141
+ __webpack_require__.d(__webpack_exports__, "setCommonInfo", function() { return /* reexport */ planbook["w" /* setCommonInfo */]; });
1142
+ __webpack_require__.d(__webpack_exports__, "setGroupInsurance", function() { return /* reexport */ planbook["x" /* setGroupInsurance */]; });
1143
+ __webpack_require__.d(__webpack_exports__, "isHideProduct", function() { return /* reexport */ planbook["r" /* isHideProduct */]; });
1144
+ __webpack_require__.d(__webpack_exports__, "verifyProductRules", function() { return /* reexport */ planbook["z" /* verifyProductRules */]; });
1145
+ __webpack_require__.d(__webpack_exports__, "restrictInsurancesInProduct", function() { return /* reexport */ planbook["v" /* restrictInsurancesInProduct */]; });
1146
+ __webpack_require__.d(__webpack_exports__, "convertProductData", function() { return /* reexport */ planbook["f" /* convertProductData */]; });
1147
+ __webpack_require__.d(__webpack_exports__, "clearAddAndTakeAndAdjustBaoeData", function() { return /* reexport */ planbook["b" /* clearAddAndTakeAndAdjustBaoeData */]; });
1148
+ __webpack_require__.d(__webpack_exports__, "initInsuranceData", function() { return /* reexport */ planbook["n" /* initInsuranceData */]; });
1149
+ __webpack_require__.d(__webpack_exports__, "insuranceDataHandler", function() { return /* reexport */ planbook["q" /* insuranceDataHandler */]; });
1150
+ __webpack_require__.d(__webpack_exports__, "initElementValidateRules", function() { return /* reexport */ planbook["m" /* initElementValidateRules */]; });
1151
+ __webpack_require__.d(__webpack_exports__, "restrictElementsInInsurance", function() { return /* reexport */ planbook["u" /* restrictElementsInInsurance */]; });
1152
+ __webpack_require__.d(__webpack_exports__, "getAddress", function() { return /* reexport */ getAddress; });
1153
+ __webpack_require__.d(__webpack_exports__, "getUuid", function() { return /* reexport */ getUuid; });
1154
+ __webpack_require__.d(__webpack_exports__, "hasPlanParams", function() { return /* reexport */ hasPlanParams; });
1155
+ __webpack_require__.d(__webpack_exports__, "insureCalculate", function() { return /* reexport */ insureCalculate; });
1156
+ __webpack_require__.d(__webpack_exports__, "checkInsureCalculate", function() { return /* reexport */ checkInsureCalculate; });
1157
+ __webpack_require__.d(__webpack_exports__, "checkInsureCalculateIn", function() { return /* reexport */ checkInsureCalculateIn; });
1158
+
1159
+ // EXTERNAL MODULE: ./packages/bxs-utils/planbook/index.ts
1160
+ var planbook = __webpack_require__(12);
1161
+
1162
+ // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/asyncToGenerator.js
1163
+ var asyncToGenerator = __webpack_require__(30);
1164
+ var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
1165
+
1166
+ // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/typeof.js
1167
+ var helpers_typeof = __webpack_require__(11);
1168
+ var typeof_default = /*#__PURE__*/__webpack_require__.n(helpers_typeof);
1169
+
1170
+ // EXTERNAL MODULE: ./node_modules/@babel/runtime/regenerator/index.js
1171
+ var regenerator = __webpack_require__(17);
1172
+ var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
1173
+
1174
+ // EXTERNAL MODULE: ./node_modules/axios/index.js
1175
+ var axios = __webpack_require__(31);
1176
+ var axios_default = /*#__PURE__*/__webpack_require__.n(axios);
1177
+
1178
+ // CONCATENATED MODULE: ./src/js/request.js
1179
+ // import { gotoLogin } from './utils.js'
1180
+
1181
+ var BASE_API = function () {
1182
+ var env = null;
1183
+
1184
+ if (location.hostname.search(/pbf\.winbaoxian\.com/) !== -1) {
1185
+ env = 'https://app.winbaoxian.com';
1186
+ } else if (location.hostname.search(/pbf\.winbaoxian\.cn/) !== -1) {
1187
+ env = 'https://app.winbaoxian.cn';
1188
+ } else if (location.hostname.search(/127\.0\.0\.1|192\.168|localhost/) !== -1) {
1189
+ env = 'https://app.winbaoxian.cn';
1190
+ }
1191
+
1192
+ return env;
1193
+ }(); // 创建axios实例
1194
+
1195
+
1196
+ var service = axios_default.a.create({
1197
+ baseURL: BASE_API,
1198
+ withCredentials: true,
1199
+ timeout: 10000,
1200
+ // 请求超时时间
1201
+ headers: {
1202
+ 'X-Requested-With': 'XMLHttpRequest'
1203
+ }
1204
+ });
1205
+ var loadingTimer = null;
1206
+
1207
+ var loading = function loading(show) {
1208
+ if (window.appBridge && appBridge.showLoading) {
1209
+ if (show) {
1210
+ appBridge.showLoading();
1211
+ } else {
1212
+ appBridge.hideLoading();
1427
1213
  }
1428
- }
1214
+ }
1215
+ }; // request拦截器
1429
1216
 
1430
1217
 
1431
- /***/ }),
1432
- /* 9 */
1433
- /***/ (function(module, exports) {
1218
+ service.interceptors.request.use(function (config) {
1219
+ if (loadingTimer) clearTimeout(loadingTimer);
1220
+ loadingTimer = setTimeout(function () {
1221
+ loading(true);
1222
+ }, 300);
1223
+ return config;
1224
+ }, function (error) {
1225
+ // Do something with request error
1226
+ console.log(error); // for debug
1434
1227
 
1435
- function _typeof(obj) {
1436
- "@babel/helpers - typeof";
1228
+ Promise.reject(error);
1229
+ }); // respone拦截器
1437
1230
 
1438
- return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
1439
- return typeof obj;
1440
- } : function (obj) {
1441
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
1442
- }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
1231
+ service.interceptors.response.use(function (response) {
1232
+ if (loadingTimer) clearTimeout(loadingTimer);
1233
+ loading(false);
1234
+ var res = response.data;
1235
+
1236
+ if (res.code === 401 || res.status === 401) {
1237
+ // gotoLogin()
1238
+ return Promise.reject('login');
1239
+ }
1240
+
1241
+ return res;
1242
+ }, function (error) {
1243
+ if (loadingTimer) clearTimeout(loadingTimer);
1244
+ loading(false);
1245
+
1246
+ if (error.response && error.response.status == 401) {
1247
+ // gotoLogin()
1248
+ return Promise.reject('login');
1249
+ }
1250
+
1251
+ console.log('err' + error); // for debug
1252
+
1253
+ return Promise.reject(error);
1254
+ });
1255
+ /* harmony default export */ var request = (service);
1256
+ // CONCATENATED MODULE: ./packages/bxs-utils/trade/insureCalculate.js
1257
+
1258
+
1259
+
1260
+
1261
+ /**
1262
+ * @Author: watson
1263
+ * @Date: 2020-12-23
1264
+ * @LastEditors: watson
1265
+ * @description: 保费试算
1266
+ * @param {*} params: 必传
1267
+ * @return {*} 试算结果
1268
+ */
1269
+
1270
+
1271
+ var baseURL = function () {
1272
+ var env = null;
1273
+
1274
+ if (location.hostname.search(/pbf\.winbaoxian\.com/) !== -1) {
1275
+ env = 'https://insurance2a-api.wyins.net';
1276
+ } else if (location.hostname.search(/pbf\.winbaoxian\.cn/) !== -1) {
1277
+ env = '//insurance2a-api.wyins.net.cn';
1278
+ } else if (location.hostname.search(/127\.0\.0\.1|192\.168|localhost|0\.0\.0\.0/) !== -1) {
1279
+ env = '//insurance2a-api.wyins.net.cn';
1280
+ }
1281
+
1282
+ return env;
1283
+ }();
1284
+ /**
1285
+ * **获取地址信息**
1286
+ * @ignore
1287
+ * @author watson
1288
+ * @date 2022-04-26
1289
+ * @param {string} fetchUrl api url
1290
+ * @param {object} data 接口传参
1291
+ * @returns {object} addressData
1292
+ */
1293
+
1294
+
1295
+ function getAddress(fetchUrl, data) {
1296
+ return new Promise(function (resolve, reject) {
1297
+ request({
1298
+ baseURL: fetchUrl,
1299
+ url: undefined,
1300
+ method: 'POST',
1301
+ urlParams: undefined,
1302
+ data: data
1303
+ }).then(function (res) {
1304
+ resolve(res);
1305
+ }).catch(function (err) {
1306
+ reject(err);
1307
+ });
1308
+ });
1443
1309
  }
1310
+ /**
1311
+ * **获取用户信息**
1312
+ * @ignore
1313
+ * @author watson
1314
+ * @date 2022-04-26
1315
+ * @param {string} fetchUrl api url
1316
+ * @returns {promise}
1317
+ */
1444
1318
 
1445
- module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
1319
+ function getUuid(fetchUrl) {
1320
+ return new Promise(function (resolve, reject) {
1321
+ request({
1322
+ baseURL: fetchUrl,
1323
+ url: undefined,
1324
+ method: 'GET',
1325
+ urlParams: undefined,
1326
+ data: null
1327
+ }).then(function (res) {
1328
+ resolve(res);
1329
+ }).catch(function (err) {
1330
+ reject(err);
1331
+ });
1332
+ });
1333
+ }
1334
+ /**
1335
+ * **计划书初始化参数**
1336
+ * @ignore
1337
+ * @author watson
1338
+ * @date 2022-04-26
1339
+ * @param {any} planParams 计划书初始化参数
1340
+ * @param {any} planParams.detail_age 被保人生日
1341
+ * @param {any} planParams.detail_sex 被保人性别
1342
+ * @param {any} planParams.detail_relation 投被保人关系
1343
+ * @param {any} planParams.detail_applicant_age 投保人生日
1344
+ * @param {any} planParams.detail_applicant_sex 投保人性别
1345
+ * @returns {boolean} 是否有计划书参数
1346
+ */
1446
1347
 
1447
- /***/ }),
1448
- /* 10 */
1449
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
1348
+ function hasPlanParams(planParams) {
1349
+ var type = false;
1450
1350
 
1451
- "use strict";
1452
- // ESM COMPAT FLAG
1453
- __webpack_require__.r(__webpack_exports__);
1351
+ if (planParams && (planParams.detail_age || planParams.detail_sex || planParams.detail_relation || planParams.detail_applicant_age || planParams.detail_applicant_sex)) {
1352
+ type = true;
1353
+ }
1454
1354
 
1455
- // EXPORTS
1456
- __webpack_require__.d(__webpack_exports__, "convertEleOrderListToObj", function() { return /* reexport */ planbook["d" /* convertEleOrderListToObj */]; });
1457
- __webpack_require__.d(__webpack_exports__, "calcTotalBaof", function() { return /* reexport */ planbook["a" /* calcTotalBaof */]; });
1458
- __webpack_require__.d(__webpack_exports__, "getHuomianPeriodValue", function() { return /* reexport */ planbook["j" /* getHuomianPeriodValue */]; });
1459
- __webpack_require__.d(__webpack_exports__, "getNumberFromYear", function() { return /* reexport */ planbook["l" /* getNumberFromYear */]; });
1460
- __webpack_require__.d(__webpack_exports__, "converUnit10000", function() { return /* reexport */ planbook["c" /* converUnit10000 */]; });
1461
- __webpack_require__.d(__webpack_exports__, "deepCopy", function() { return /* reexport */ planbook["g" /* deepCopy */]; });
1462
- __webpack_require__.d(__webpack_exports__, "getAgeFromBirth", function() { return /* reexport */ planbook["h" /* getAgeFromBirth */]; });
1463
- __webpack_require__.d(__webpack_exports__, "initPersonData", function() { return /* reexport */ planbook["o" /* initPersonData */]; });
1464
- __webpack_require__.d(__webpack_exports__, "personDataHandler", function() { return /* reexport */ planbook["s" /* personDataHandler */]; });
1465
- __webpack_require__.d(__webpack_exports__, "getInsuredAgeRange", function() { return /* reexport */ planbook["k" /* getInsuredAgeRange */]; });
1466
- __webpack_require__.d(__webpack_exports__, "setPersonAgeOptions", function() { return /* reexport */ planbook["y" /* setPersonAgeOptions */]; });
1467
- __webpack_require__.d(__webpack_exports__, "convertPersonData", function() { return /* reexport */ planbook["e" /* convertPersonData */]; });
1468
- __webpack_require__.d(__webpack_exports__, "initProductData", function() { return /* reexport */ planbook["p" /* initProductData */]; });
1469
- __webpack_require__.d(__webpack_exports__, "productDataHandler", function() { return /* reexport */ planbook["t" /* productDataHandler */]; });
1470
- __webpack_require__.d(__webpack_exports__, "getElementVerifyFromProductVerify", function() { return /* reexport */ planbook["i" /* getElementVerifyFromProductVerify */]; });
1471
- __webpack_require__.d(__webpack_exports__, "setCommonInfo", function() { return /* reexport */ planbook["w" /* setCommonInfo */]; });
1472
- __webpack_require__.d(__webpack_exports__, "setGroupInsurance", function() { return /* reexport */ planbook["x" /* setGroupInsurance */]; });
1473
- __webpack_require__.d(__webpack_exports__, "isHideProduct", function() { return /* reexport */ planbook["r" /* isHideProduct */]; });
1474
- __webpack_require__.d(__webpack_exports__, "verifyProductRules", function() { return /* reexport */ planbook["z" /* verifyProductRules */]; });
1475
- __webpack_require__.d(__webpack_exports__, "restrictInsurancesInProduct", function() { return /* reexport */ planbook["v" /* restrictInsurancesInProduct */]; });
1476
- __webpack_require__.d(__webpack_exports__, "convertProductData", function() { return /* reexport */ planbook["f" /* convertProductData */]; });
1477
- __webpack_require__.d(__webpack_exports__, "clearAddAndTakeAndAdjustBaoeData", function() { return /* reexport */ planbook["b" /* clearAddAndTakeAndAdjustBaoeData */]; });
1478
- __webpack_require__.d(__webpack_exports__, "initInsuranceData", function() { return /* reexport */ planbook["n" /* initInsuranceData */]; });
1479
- __webpack_require__.d(__webpack_exports__, "insuranceDataHandler", function() { return /* reexport */ planbook["q" /* insuranceDataHandler */]; });
1480
- __webpack_require__.d(__webpack_exports__, "initElementValidateRules", function() { return /* reexport */ planbook["m" /* initElementValidateRules */]; });
1481
- __webpack_require__.d(__webpack_exports__, "restrictElementsInInsurance", function() { return /* reexport */ planbook["u" /* restrictElementsInInsurance */]; });
1482
- __webpack_require__.d(__webpack_exports__, "getAddress", function() { return /* reexport */ getAddress; });
1483
- __webpack_require__.d(__webpack_exports__, "getUuid", function() { return /* reexport */ getUuid; });
1484
- __webpack_require__.d(__webpack_exports__, "hasPlanParams", function() { return /* reexport */ hasPlanParams; });
1485
- __webpack_require__.d(__webpack_exports__, "insureCalculate", function() { return /* reexport */ insureCalculate; });
1486
- __webpack_require__.d(__webpack_exports__, "checkInsureCalculate", function() { return /* reexport */ checkInsureCalculate; });
1487
- __webpack_require__.d(__webpack_exports__, "checkInsureCalculateIn", function() { return /* reexport */ checkInsureCalculateIn; });
1355
+ return type;
1356
+ }
1357
+ /**
1358
+ * **转换计划书数据**
1359
+ * @ignore
1360
+ * @author watson
1361
+ * @date 2022-04-26
1362
+ * @param {array} widgets 页面渲染数据
1363
+ * @param {object} currentData 试算参数
1364
+ * @param {object} planParams 计划书初始化参数
1365
+ * @returns {void}
1366
+ */
1488
1367
 
1489
- // EXTERNAL MODULE: ./packages/bxs-utils/planbook/index.ts
1490
- var planbook = __webpack_require__(11);
1368
+ function translatePlanData(widgets, currentData, planParams) {
1369
+ widgets.forEach(function (item) {
1370
+ var current; // 增加current字段,保存current_data的数据
1491
1371
 
1492
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/asyncToGenerator.js
1493
- var asyncToGenerator = __webpack_require__(28);
1494
- var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
1372
+ if (item.duty) {
1373
+ current = currentData.find(function (it) {
1374
+ return it.k === item.key && it.risk === item.riskCode && item.duty === it.d;
1375
+ });
1376
+ } else {
1377
+ current = currentData.find(function (it) {
1378
+ return it.k === item.key && it.risk === item.riskCode;
1379
+ });
1380
+ }
1495
1381
 
1496
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/typeof.js
1497
- var helpers_typeof = __webpack_require__(9);
1498
- var typeof_default = /*#__PURE__*/__webpack_require__.n(helpers_typeof);
1382
+ if (planParams) {
1383
+ // 被保人生日 / 年龄
1384
+ if (planParams.detail_age && item.key === 'detail_age') {
1385
+ if (/-/.test(planParams.detail_age)) {
1386
+ // 被保人生日
1387
+ item.type = 'v-text';
1388
+ item.name = planParams.detail_age;
1389
+ current.v = planParams.detail_age;
1390
+ } else if (/岁/.test(planParams.detail_age)) {
1391
+ // 被保人年龄
1392
+ item.type = 'v-text';
1393
+ item.name = planParams.detail_age;
1394
+ item.label = item.label + '(年龄)';
1395
+ current.v = planParams.detail_age.replace('周', '').replace('岁', '').replace('Y', '') + 'Y';
1396
+ }
1397
+ } // 被保人性别
1499
1398
 
1500
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/regenerator/index.js
1501
- var regenerator = __webpack_require__(15);
1502
- var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
1503
1399
 
1504
- // EXTERNAL MODULE: ./node_modules/axios/index.js
1505
- var axios = __webpack_require__(29);
1506
- var axios_default = /*#__PURE__*/__webpack_require__.n(axios);
1400
+ if (planParams.detail_sex && item.key === 'detail_sex') {
1401
+ item.type = 'v-text';
1402
+ item.name = planParams.detail_sex === '1' ? '男' : '女';
1403
+ current.v = planParams.detail_sex;
1404
+ } // 投被保人关系
1405
+ // 初始化
1406
+ // if (
1407
+ // item.key === 'detail_relation' &&
1408
+ // planParams.detail_sex &&
1409
+ // planParams.detail_applicant_sex &&
1410
+ // String(planParams.detail_sex) ===
1411
+ // String(planParams.detail_applicant_sex)
1412
+ // ) {
1413
+ // let otemp = [];
1414
+ // item.opts[item.key].forEach(i => {
1415
+ // if (
1416
+ // String(planParams.detail_sex) === '1' &&
1417
+ // String(planParams.detail_applicant_sex) === '1'
1418
+ // ) {
1419
+ // // 投被保人 - 男 1
1420
+ // if (['1', '14', '16', '18'].includes(String(i.value))) {
1421
+ // otemp.push(i);
1422
+ // }
1423
+ // } else if (
1424
+ // String(planParams.detail_sex) === '2' &&
1425
+ // String(planParams.detail_applicant_sex) === '2'
1426
+ // ) {
1427
+ // // 投被保人 - 女 2
1428
+ // if (['1', '15', '17', '19'].includes(String(i.value))) {
1429
+ // otemp.push(i);
1430
+ // }
1431
+ // }
1432
+ // });
1433
+ // item.opts[item.key] = otemp;
1434
+ // console.log('otemp', otemp);
1435
+ // }
1507
1436
 
1508
- // CONCATENATED MODULE: ./src/js/request.js
1509
- // import { gotoLogin } from './utils.js'
1510
1437
 
1511
- var BASE_API = function () {
1512
- var env = null;
1438
+ if (planParams.detail_relation && item.key === 'detail_relation') {
1439
+ // 条件检索
1440
+ if (planParams.detail_relation === '-1' || planParams.detail_relation === -1) {
1441
+ // 非本人
1442
+ var temp = [];
1443
+ item.opts[item.key].forEach(function (i) {
1444
+ if (String(i.value) != '1') {
1445
+ temp.push(i);
1446
+ }
1447
+ });
1448
+ item.name = temp[0] && temp[0].name ? temp[0].name : '';
1449
+ item.opts[item.key] = temp;
1450
+ } else if (planParams.detail_relation) {
1451
+ // 指定人 - 本人 其他人
1452
+ item.type = 'v-text';
1453
+ current.v = planParams.detail_relation;
1454
+ var _temp = [];
1455
+ item.opts[item.key].forEach(function (i) {
1456
+ if (String(i.value) === String(planParams.detail_relation)) {
1457
+ _temp.push(i);
1513
1458
 
1514
- if (location.hostname.search(/pbf\.winbaoxian\.com/) !== -1) {
1515
- env = 'https://app.winbaoxian.com';
1516
- } else if (location.hostname.search(/pbf\.winbaoxian\.cn/) !== -1) {
1517
- env = 'https://app.winbaoxian.cn';
1518
- } else if (location.hostname.search(/127\.0\.0\.1|192\.168|localhost/) !== -1) {
1519
- env = 'https://app.winbaoxian.cn';
1520
- }
1459
+ item.name = i.name;
1460
+ }
1461
+ });
1462
+ item.opts[item.key] = _temp;
1463
+ }
1464
+ } // 投保人出生日期
1521
1465
 
1522
- return env;
1523
- }(); // 创建axios实例
1524
1466
 
1467
+ if (planParams.detail_applicant_age && item.key === 'detail_applicant_age') {
1468
+ if (/-/.test(planParams.detail_applicant_age)) {
1469
+ // 被保人生日
1470
+ item.type = 'v-text';
1471
+ item.name = planParams.detail_applicant_age;
1472
+ current.v = planParams.detail_applicant_age;
1473
+ } else if (/岁/.test(planParams.detail_applicant_age)) {
1474
+ // 被保人年龄
1475
+ item.type = 'v-text';
1476
+ item.name = planParams.detail_applicant_age;
1477
+ item.label = item.label + '(年龄)';
1478
+ current.v = planParams.detail_applicant_age.replace('周', '').replace('岁', '').replace('Y', '') + 'Y';
1479
+ }
1480
+ } // 投保人性别
1525
1481
 
1526
- var service = axios_default.a.create({
1527
- baseURL: BASE_API,
1528
- withCredentials: true,
1529
- timeout: 10000,
1530
- // 请求超时时间
1531
- headers: {
1532
- 'X-Requested-With': 'XMLHttpRequest'
1533
- }
1534
- });
1535
- var loadingTimer = null;
1536
1482
 
1537
- var loading = function loading(show) {
1538
- if (window.appBridge && appBridge.showLoading) {
1539
- if (show) {
1540
- appBridge.showLoading();
1541
- } else {
1542
- appBridge.hideLoading();
1483
+ if (planParams.detail_applicant_sex && item.key === 'detail_applicant_sex') {
1484
+ item.type = 'v-text';
1485
+ item.name = planParams.detail_applicant_sex === '1' ? '男' : '女';
1486
+ current.v = planParams.detail_applicant_sex;
1487
+ }
1543
1488
  }
1544
- }
1545
- }; // request拦截器
1546
-
1547
-
1548
- service.interceptors.request.use(function (config) {
1549
- if (loadingTimer) clearTimeout(loadingTimer);
1550
- loadingTimer = setTimeout(function () {
1551
- loading(true);
1552
- }, 300);
1553
- return config;
1554
- }, function (error) {
1555
- // Do something with request error
1556
- console.log(error); // for debug
1557
-
1558
- Promise.reject(error);
1559
- }); // respone拦截器
1489
+ });
1490
+ }
1491
+ /**
1492
+ * **试算参数转化**
1493
+ * @ignore
1494
+ * @author watson
1495
+ * @date 2022-04-26
1496
+ * @param {object} currentData
1497
+ * @param {object} planParams
1498
+ * @returns {object}
1499
+ */
1560
1500
 
1561
- service.interceptors.response.use(function (response) {
1562
- if (loadingTimer) clearTimeout(loadingTimer);
1563
- loading(false);
1564
- var res = response.data;
1565
1501
 
1566
- if (res.code === 401 || res.status === 401) {
1567
- // gotoLogin()
1568
- return Promise.reject('login');
1569
- }
1502
+ function tranlateCurrentData(currentData, planParams) {
1503
+ var currentDataCopy = JSON.parse(JSON.stringify(currentData));
1504
+ currentDataCopy.forEach(function (item) {
1505
+ var current = item;
1570
1506
 
1571
- return res;
1572
- }, function (error) {
1573
- if (loadingTimer) clearTimeout(loadingTimer);
1574
- loading(false);
1507
+ if (planParams) {
1508
+ if (planParams.detail_age && item.k === 'detail_age') {
1509
+ if (/-/.test(planParams.detail_age)) {
1510
+ // 被保人生日
1511
+ current.v = planParams.detail_age;
1512
+ } else if (/岁/.test(planParams.detail_age)) {
1513
+ // 被保人年龄
1514
+ current.v = planParams.detail_age.replace('周', '').replace('岁', '').replace('Y', '') + 'Y';
1515
+ }
1516
+ } // 被保人性别
1575
1517
 
1576
- if (error.response && error.response.status == 401) {
1577
- // gotoLogin()
1578
- return Promise.reject('login');
1579
- }
1580
1518
 
1581
- console.log('err' + error); // for debug
1519
+ if (planParams.detail_sex && item.k === 'detail_sex') {
1520
+ current.v = planParams.detail_sex;
1521
+ } // 投被保人关系
1582
1522
 
1583
- return Promise.reject(error);
1584
- });
1585
- /* harmony default export */ var request = (service);
1586
- // CONCATENATED MODULE: ./packages/bxs-utils/trade/insureCalculate.js
1523
+
1524
+ if (planParams.detail_relation && item.k === 'detail_relation') {
1525
+ if (planParams.detail_relation != -1 || planParams.detail_relation != '-1') {
1526
+ current.v = planParams.detail_relation;
1527
+ }
1528
+ } // 投保人出生日期
1587
1529
 
1588
1530
 
1531
+ if (planParams.detail_applicant_age && item.k === 'detail_applicant_age') {
1532
+ if (/-/.test(planParams.detail_applicant_age)) {
1533
+ // 被保人生日
1534
+ current.v = planParams.detail_applicant_age;
1535
+ } else if (/岁/.test(planParams.detail_applicant_age)) {
1536
+ // 被保人年龄
1537
+ current.v = planParams.detail_applicant_age.replace('周', '').replace('岁', '').replace('Y', '') + 'Y';
1538
+ }
1539
+ } // 投保人性别
1589
1540
 
1590
1541
 
1542
+ if (planParams.detail_applicant_sex && item.k === 'detail_applicant_sex') {
1543
+ current.v = planParams.detail_applicant_sex;
1544
+ }
1545
+ }
1546
+ });
1547
+ return currentDataCopy;
1548
+ }
1591
1549
  /**
1592
- * @Author: watson
1593
- * @Date: 2020-12-23
1594
- * @LastEditors: watson
1595
- * @description: 保费试算
1596
- * @param {*} params: 必传
1597
- * @return {*} 试算结果
1550
+ * 险种计算
1551
+ * @author watson
1552
+ * @date 2022-04-26
1553
+ * @param {object} urlParams 接口URL上面的参数,c端必传uuid
1554
+ * @param {object} postParams 试算用的参数,product_id, current_data 和 scenario: 'h5Widget'
1555
+ * @param {object} planParams 计划书初始化参数
1556
+ * @returns {promise} 试算结果
1598
1557
  */
1599
1558
 
1600
1559
 
1601
- var baseURL = function () {
1602
- var env = null;
1560
+ function insureCalculate(urlParams, postParams, planParams) {
1561
+ if (!postParams || typeof_default()(postParams) !== 'object' || !postParams.product_id) {
1562
+ return postParams;
1563
+ }
1603
1564
 
1604
- if (location.hostname.search(/pbf\.winbaoxian\.com/) !== -1) {
1605
- env = 'https://insurance2a-api.wyins.net';
1606
- } else if (location.hostname.search(/pbf\.winbaoxian\.cn/) !== -1) {
1607
- env = '//insurance2a-api.wyins.net.cn';
1608
- } else if (location.hostname.search(/127\.0\.0\.1|192\.168|localhost|0\.0\.0\.0/) !== -1) {
1609
- env = '//insurance2a-api.wyins.net.cn';
1565
+ if (postParams && !postParams.scenario) {
1566
+ postParams.scenario = 'h5Widget';
1610
1567
  }
1611
1568
 
1612
- return env;
1613
- }();
1614
- /**
1615
- * **获取地址信息**
1616
- * @ignore
1617
- * @author watson
1618
- * @date 2022-04-26
1619
- * @param {string} fetchUrl api url
1620
- * @param {object} data 接口传参
1621
- * @returns {object} addressData
1622
- */
1569
+ var url = '/api/product/data/calculate';
1623
1570
 
1571
+ if (urlParams && urlParams.uuid) {
1572
+ url += "?userUuid=".concat(urlParams.uuid);
1573
+ } else if (urlParams && urlParams.openId) {
1574
+ url += "?userUuid=".concat(urlParams.openId);
1575
+ }
1576
+
1577
+ if (urlParams && urlParams.appid) {
1578
+ if (url.indexOf('?') > -1) {
1579
+ url += "&appId=".concat(urlParams.appid);
1580
+ } else {
1581
+ url += "?appId=".concat(urlParams.appid);
1582
+ }
1583
+ }
1584
+
1585
+ if (hasPlanParams(planParams) && postParams.current_data) {
1586
+ postParams.current_data = tranlateCurrentData(postParams.current_data, planParams);
1587
+ }
1624
1588
 
1625
- function getAddress(fetchUrl, data) {
1626
1589
  return new Promise(function (resolve, reject) {
1627
1590
  request({
1628
- baseURL: fetchUrl,
1629
- url: undefined,
1591
+ baseURL: baseURL,
1592
+ url: url,
1630
1593
  method: 'POST',
1631
- urlParams: undefined,
1632
- data: data
1594
+ urlParams: urlParams,
1595
+ data: postParams
1633
1596
  }).then(function (res) {
1634
- resolve(res);
1597
+ if (res.code === 200) {
1598
+ var data = JSON.parse(JSON.stringify(res.data));
1599
+
1600
+ if (hasPlanParams(planParams)) {
1601
+ var widgets = data.widgets;
1602
+ var currentData = data.current_data;
1603
+ translatePlanData(widgets, currentData, planParams);
1604
+ }
1605
+
1606
+ var cData = {
1607
+ widgets: data.widgets,
1608
+ total_premium: data.total_premium,
1609
+ terms: data.terms,
1610
+ product_id: data.product_id,
1611
+ current_data: data.current_data,
1612
+ risk_premiums: data.risk_premiums
1613
+ };
1614
+ resolve({
1615
+ code: 200,
1616
+ data: cData
1617
+ });
1618
+ } else {
1619
+ reject(res);
1620
+ }
1635
1621
  }).catch(function (err) {
1636
1622
  reject(err);
1637
1623
  });
1638
1624
  });
1639
1625
  }
1640
1626
  /**
1641
- * **获取用户信息**
1627
+ * **检查险种计算**
1628
+ * @author watson
1629
+ * @date 2022-04-26
1630
+ * @param {object} urlParams 接口URL上面的参数,c端必传uuid
1631
+ * @param {object} postParams 试算用的参数,product_id, current_data 和 scenario: 'h5Widget'
1632
+ * @param {object} planParams 计划书初始化参数
1633
+ * @returns {promise} 试算结果
1634
+ */
1635
+
1636
+ function checkInsureCalculate(_x, _x2, _x3) {
1637
+ return _checkInsureCalculate.apply(this, arguments);
1638
+ }
1639
+ /**
1640
+ * 描述
1642
1641
  * @ignore
1643
1642
  * @author watson
1644
1643
  * @date 2022-04-26
1645
- * @param {string} fetchUrl api url
1644
+ * @param {object} urlParams
1645
+ * @param {object} postParams
1646
+ * @param {object} planParams
1646
1647
  * @returns {promise}
1647
1648
  */
1648
1649
 
1649
- function getUuid(fetchUrl) {
1650
+ function _checkInsureCalculate() {
1651
+ _checkInsureCalculate = asyncToGenerator_default()( /*#__PURE__*/regenerator_default.a.mark(function _callee(urlParams, postParams, planParams) {
1652
+ var res, data;
1653
+ return regenerator_default.a.wrap(function _callee$(_context) {
1654
+ while (1) {
1655
+ switch (_context.prev = _context.next) {
1656
+ case 0:
1657
+ _context.next = 2;
1658
+ return checkInsureCalculateIn(urlParams, postParams, planParams);
1659
+
1660
+ case 2:
1661
+ res = _context.sent;
1662
+
1663
+ if (!(postParams && !postParams.current_data)) {
1664
+ _context.next = 15;
1665
+ break;
1666
+ }
1667
+
1668
+ data = JSON.parse(JSON.stringify(res.data));
1669
+ postParams.current_data = data.current_data; // 重新试算
1670
+
1671
+ _context.prev = 6;
1672
+ _context.next = 9;
1673
+ return checkInsureCalculateIn(urlParams, postParams, planParams);
1674
+
1675
+ case 9:
1676
+ res = _context.sent;
1677
+ _context.next = 15;
1678
+ break;
1679
+
1680
+ case 12:
1681
+ _context.prev = 12;
1682
+ _context.t0 = _context["catch"](6);
1683
+ res = _context.t0;
1684
+
1685
+ case 15:
1686
+ if (!(res && res.code === 200)) {
1687
+ _context.next = 19;
1688
+ break;
1689
+ }
1690
+
1691
+ return _context.abrupt("return", res);
1692
+
1693
+ case 19:
1694
+ return _context.abrupt("return", Promise.reject(res));
1695
+
1696
+ case 20:
1697
+ case "end":
1698
+ return _context.stop();
1699
+ }
1700
+ }
1701
+ }, _callee, null, [[6, 12]]);
1702
+ }));
1703
+ return _checkInsureCalculate.apply(this, arguments);
1704
+ }
1705
+
1706
+ function checkInsureCalculateIn(urlParams, postParams, planParams) {
1707
+ if (!postParams || typeof_default()(postParams) !== 'object' || !postParams.product_id) {
1708
+ return Promise.reject({
1709
+ code: 400,
1710
+ msg: 'postParams参数非法'
1711
+ });
1712
+ }
1713
+
1714
+ if (postParams && !postParams.scenario) {
1715
+ postParams.scenario = 'h5Widget';
1716
+ }
1717
+
1718
+ var url = '/api/product/data/calculate';
1719
+
1720
+ if (urlParams && urlParams.uuid) {
1721
+ url += "?userUuid=".concat(urlParams.uuid);
1722
+ } else if (urlParams && urlParams.openId) {
1723
+ url += "?userUuid=".concat(urlParams.openId);
1724
+ }
1725
+
1726
+ if (urlParams && urlParams.appid) {
1727
+ if (url.indexOf('?') > -1) {
1728
+ url += "&appId=".concat(urlParams.appid);
1729
+ } else {
1730
+ url += "?appId=".concat(urlParams.appid);
1731
+ }
1732
+ }
1733
+
1734
+ if (hasPlanParams(planParams) && postParams.current_data) {
1735
+ postParams.current_data = tranlateCurrentData(postParams.current_data, planParams);
1736
+ }
1737
+
1650
1738
  return new Promise(function (resolve, reject) {
1651
1739
  request({
1652
- baseURL: fetchUrl,
1653
- url: undefined,
1654
- method: 'GET',
1655
- urlParams: undefined,
1656
- data: null
1740
+ baseURL: baseURL,
1741
+ url: url,
1742
+ method: 'POST',
1743
+ urlParams: urlParams,
1744
+ data: postParams
1657
1745
  }).then(function (res) {
1658
- resolve(res);
1746
+ if (res.code === 200) {
1747
+ // if (postParams && !postParams.current_data) {
1748
+ // let data = JSON.parse(JSON.stringify(res.data));
1749
+ // postParams.current_data = data.current_data
1750
+ // // 重新试算
1751
+ // checkInsureCalculate(urlParams, postParams, planParams)
1752
+ // }
1753
+ resolve({
1754
+ code: 200,
1755
+ data: res.data
1756
+ });
1757
+ } else {
1758
+ reject(res);
1759
+ }
1659
1760
  }).catch(function (err) {
1660
1761
  reject(err);
1661
1762
  });
1662
1763
  });
1663
1764
  }
1664
- /**
1665
- * **计划书初始化参数**
1666
- * @ignore
1667
- * @author watson
1668
- * @date 2022-04-26
1669
- * @param {any} planParams 计划书初始化参数
1670
- * @param {any} planParams.detail_age 被保人生日
1671
- * @param {any} planParams.detail_sex 被保人性别
1672
- * @param {any} planParams.detail_relation 投被保人关系
1673
- * @param {any} planParams.detail_applicant_age 投保人生日
1674
- * @param {any} planParams.detail_applicant_sex 投保人性别
1675
- * @returns {boolean} 是否有计划书参数
1676
- */
1677
-
1678
- function hasPlanParams(planParams) {
1679
- var type = false;
1680
-
1681
- if (planParams && (planParams.detail_age || planParams.detail_sex || planParams.detail_relation || planParams.detail_applicant_age || planParams.detail_applicant_sex)) {
1682
- type = true;
1683
- }
1684
-
1685
- return type;
1686
- }
1687
- /**
1688
- * **转换计划书数据**
1689
- * @ignore
1690
- * @author watson
1691
- * @date 2022-04-26
1692
- * @param {array} widgets 页面渲染数据
1693
- * @param {object} currentData 试算参数
1694
- * @param {object} planParams 计划书初始化参数
1695
- * @returns {void}
1696
- */
1765
+ // CONCATENATED MODULE: ./packages/bxs-utils/trade/index.js
1697
1766
 
1698
- function translatePlanData(widgets, currentData, planParams) {
1699
- widgets.forEach(function (item) {
1700
- var current; // 增加current字段,保存current_data的数据
1767
+ // CONCATENATED MODULE: ./packages/bxs-utils/index.ts
1701
1768
 
1702
- if (item.duty) {
1703
- current = currentData.find(function (it) {
1704
- return it.k === item.key && it.risk === item.riskCode && item.duty === it.d;
1705
- });
1706
- } else {
1707
- current = currentData.find(function (it) {
1708
- return it.k === item.key && it.risk === item.riskCode;
1709
- });
1710
- }
1711
1769
 
1712
- if (planParams) {
1713
- // 被保人生日 / 年龄
1714
- if (planParams.detail_age && item.key === 'detail_age') {
1715
- if (/-/.test(planParams.detail_age)) {
1716
- // 被保人生日
1717
- item.type = 'v-text';
1718
- item.name = planParams.detail_age;
1719
- current.v = planParams.detail_age;
1720
- } else if (/岁/.test(planParams.detail_age)) {
1721
- // 被保人年龄
1722
- item.type = 'v-text';
1723
- item.name = planParams.detail_age;
1724
- item.label = item.label + '(年龄)';
1725
- current.v = planParams.detail_age.replace('周', '').replace('岁', '').replace('Y', '') + 'Y';
1726
- }
1727
- } // 被保人性别
1728
1770
 
1729
1771
 
1730
- if (planParams.detail_sex && item.key === 'detail_sex') {
1731
- item.type = 'v-text';
1732
- item.name = planParams.detail_sex === '1' ? '男' : '女';
1733
- current.v = planParams.detail_sex;
1734
- } // 投被保人关系
1735
- // 初始化
1736
- // if (
1737
- // item.key === 'detail_relation' &&
1738
- // planParams.detail_sex &&
1739
- // planParams.detail_applicant_sex &&
1740
- // String(planParams.detail_sex) ===
1741
- // String(planParams.detail_applicant_sex)
1742
- // ) {
1743
- // let otemp = [];
1744
- // item.opts[item.key].forEach(i => {
1745
- // if (
1746
- // String(planParams.detail_sex) === '1' &&
1747
- // String(planParams.detail_applicant_sex) === '1'
1748
- // ) {
1749
- // // 投被保人 - 男 1
1750
- // if (['1', '14', '16', '18'].includes(String(i.value))) {
1751
- // otemp.push(i);
1752
- // }
1753
- // } else if (
1754
- // String(planParams.detail_sex) === '2' &&
1755
- // String(planParams.detail_applicant_sex) === '2'
1756
- // ) {
1757
- // // 投被保人 - 女 2
1758
- // if (['1', '15', '17', '19'].includes(String(i.value))) {
1759
- // otemp.push(i);
1760
- // }
1761
- // }
1762
- // });
1763
- // item.opts[item.key] = otemp;
1764
- // console.log('otemp', otemp);
1765
- // }
1772
+ /***/ }),
1773
+ /* 8 */,
1774
+ /* 9 */
1775
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
1766
1776
 
1777
+ "use strict";
1778
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return initPersonData; });
1779
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return personDataHandler; });
1780
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getInsuredAgeRange; });
1781
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return setPersonAgeOptions; });
1782
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return convertPersonData; });
1783
+ /* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
1767
1784
 
1768
- if (planParams.detail_relation && item.key === 'detail_relation') {
1769
- // 条件检索
1770
- if (planParams.detail_relation === '-1' || planParams.detail_relation === -1) {
1771
- // 非本人
1772
- var temp = [];
1773
- item.opts[item.key].forEach(function (i) {
1774
- if (String(i.value) != '1') {
1775
- temp.push(i);
1785
+ function initPersonData(inputData, verifyData) {
1786
+ var personData = inputData.personData;
1787
+ if (!personData || !personData.personOrderList) {
1788
+ return;
1789
+ }
1790
+ var personOrderList = personData.personOrderList;
1791
+ if (!personOrderList || !personOrderList.length) {
1792
+ return;
1793
+ }
1794
+ personOrderList.forEach(function (person) {
1795
+ if (!person || !person.eleOrderList) {
1796
+ return;
1797
+ }
1798
+ person.createArchive = person.createArchive || false;
1799
+ if (!person.eleOrderList.find(function (e) { return e.key === 'name'; })) {
1800
+ person.eleOrderList.splice(1, 0, {
1801
+ key: 'name',
1802
+ value: '',
1803
+ label: '姓名',
1804
+ placeholder: '请输入姓名',
1805
+ componentName: 'cmCommonInput',
1806
+ maxlength: 16,
1807
+ isHide: false
1808
+ });
1809
+ }
1810
+ if (person.key === 'applicantInfo') {
1811
+ if (person.eleOrderList.every(function (e) { return e.key !== 'applicantAndInsuredSame'; })) {
1812
+ person.eleOrderList.splice(1, 0, {
1813
+ key: 'applicantAndInsuredSame',
1814
+ value: 0,
1815
+ label: '投被保人',
1816
+ componentName: 'cmCommonRadio',
1817
+ options: [
1818
+ { val: 0, desc: '非同一人' },
1819
+ { val: 1, desc: '是同一人' }
1820
+ ]
1821
+ });
1822
+ }
1823
+ }
1824
+ var index = person.eleOrderList.findIndex(function (e) { return e.key === 'age'; });
1825
+ if (person.eleOrderList.every(function (e) { return e.key !== 'birthday'; })) {
1826
+ person.eleOrderList.splice(index + 1, 0, {
1827
+ key: 'birthday',
1828
+ value: null,
1829
+ label: '生日',
1830
+ componentName: null,
1831
+ placeholder: '请选择生日',
1832
+ minDate: null,
1833
+ maxDate: null,
1834
+ defaulValue: null
1835
+ });
1836
+ }
1837
+ var ageRange = getInsuredAgeRange(inputData, verifyData);
1838
+ if (ageRange) {
1839
+ personOrderList.forEach(function (person) {
1840
+ if (person.key === 'insuredInfo' && ageRange[person.key + "1"] && ageRange[person.key + "1"].length) {
1841
+ person.eleOrderList && person.eleOrderList.forEach(function (ele) {
1842
+ if (ele.key === 'age') {
1843
+ ele.opts = ageRange[person.key + "1"];
1844
+ if (ageRange[person.key + "2"].length && ele.opts &&
1845
+ (ele.opts[0] !== ageRange[person.key + "2"][0] || ele.opts[1] !== ageRange[person.key + "2"][1])) {
1846
+ ele.optsF = ageRange[person.key + "2"];
1847
+ }
1848
+ }
1849
+ });
1850
+ }
1851
+ });
1852
+ }
1853
+ person.eleOrderList.forEach(function (e) {
1854
+ switch (e.key) {
1855
+ case 'title': {
1856
+ e.isDisabled = e.isDisabled || null;
1857
+ e.componentName = 'cmCommonTitle';
1858
+ switch (person.key) {
1859
+ case 'insuredInfo':
1860
+ e.isDisabled = true;
1861
+ e.label = '被保人信息';
1862
+ break;
1863
+ case 'applicantInfo':
1864
+ e.label = '投保人信息(豁免相关)';
1865
+ break;
1866
+ case 'spouseInfo':
1867
+ e.label = '投保人配偶信息';
1868
+ break;
1869
+ default:
1870
+ e.label = '人员信息';
1871
+ break;
1872
+ }
1873
+ break;
1874
+ }
1875
+ case 'sex': {
1876
+ e.label = '性别';
1877
+ e.componentName = 'cmCommonRadio';
1878
+ e.options = [
1879
+ { val: 1, desc: '男' },
1880
+ { val: 2, desc: '女' }
1881
+ ];
1882
+ if (e.opts && e.opts.length) {
1883
+ e.options = e.opts.map(function (o) { return ({
1884
+ val: o.val,
1885
+ desc: o.desc
1886
+ }); });
1887
+ }
1888
+ if (!e.options.find(function (o) { return o.val === e.value; })) {
1889
+ e.value = e.options[0].val;
1890
+ }
1891
+ e.isDisabled = person.key === 'spouseInfo';
1892
+ break;
1893
+ }
1894
+ case 'age': {
1895
+ e.label = '年龄';
1896
+ e.componentName = 'cmAgeBirthday';
1897
+ e.placeholder = '请选择年龄';
1898
+ e.options = [];
1899
+ break;
1900
+ }
1901
+ }
1902
+ });
1903
+ setPersonAgeOptions(person);
1904
+ });
1905
+ }
1906
+ function personDataHandler(allPersonsData) {
1907
+ if (!allPersonsData || !allPersonsData.personOrderList) {
1908
+ return allPersonsData;
1909
+ }
1910
+ allPersonsData.personOrderList.forEach(function (person, i, arr) {
1911
+ setPersonAgeOptions(person);
1912
+ var insuredData = arr.find(function (p) { return p.key === 'insuredInfo'; });
1913
+ var applicantData = arr.find(function (p) { return p.key === 'applicantInfo'; });
1914
+ var insuredInfo = convertPersonData(allPersonsData, 'insuredInfo');
1915
+ var applicantInfo = convertPersonData(allPersonsData, 'applicantInfo');
1916
+ if (person.key === 'insuredInfo' && applicantData && applicantData.eleOrderList) {
1917
+ var applicantAge = applicantData.eleOrderList.find(function (e) { return e.key === 'age'; });
1918
+ var applicantTitle = applicantData.eleOrderList.find(function (e) { return e.key === 'title'; });
1919
+ var applicantSame = applicantData.eleOrderList.find(function (e) { return e.key === 'applicantAndInsuredSame'; });
1920
+ if (applicantAge.opts && insuredInfo.age >= applicantAge.opts[0] && insuredInfo.age <= applicantAge.opts[1]) {
1921
+ if (applicantTitle) {
1922
+ applicantTitle.isDisabled = false;
1923
+ }
1924
+ if (applicantSame) {
1925
+ applicantSame.isDisabled = null;
1926
+ applicantSame.isHide = null;
1927
+ }
1776
1928
  }
1777
- });
1778
- item.name = temp[0] && temp[0].name ? temp[0].name : '';
1779
- item.opts[item.key] = temp;
1780
- } else if (planParams.detail_relation) {
1781
- // 指定人 - 本人 其他人
1782
- item.type = 'v-text';
1783
- current.v = planParams.detail_relation;
1784
- var _temp = [];
1785
- item.opts[item.key].forEach(function (i) {
1786
- if (String(i.value) === String(planParams.detail_relation)) {
1787
- _temp.push(i);
1788
-
1789
- item.name = i.name;
1929
+ else {
1930
+ if (applicantTitle) {
1931
+ applicantTitle.value = true;
1932
+ applicantTitle.isDisabled = true;
1933
+ }
1934
+ if (applicantSame) {
1935
+ applicantSame.value = 0;
1936
+ applicantSame.isDisabled = true;
1937
+ applicantSame.isHide = true;
1938
+ }
1790
1939
  }
1791
- });
1792
- item.opts[item.key] = _temp;
1793
- }
1794
- } // 投保人出生日期
1795
-
1796
-
1797
- if (planParams.detail_applicant_age && item.key === 'detail_applicant_age') {
1798
- if (/-/.test(planParams.detail_applicant_age)) {
1799
- // 被保人生日
1800
- item.type = 'v-text';
1801
- item.name = planParams.detail_applicant_age;
1802
- current.v = planParams.detail_applicant_age;
1803
- } else if (/岁/.test(planParams.detail_applicant_age)) {
1804
- // 被保人年龄
1805
- item.type = 'v-text';
1806
- item.name = planParams.detail_applicant_age;
1807
- item.label = item.label + '(年龄)';
1808
- current.v = planParams.detail_applicant_age.replace('周', '').replace('岁', '').replace('Y', '') + 'Y';
1809
- }
1810
- } // 投保人性别
1811
-
1812
-
1813
- if (planParams.detail_applicant_sex && item.key === 'detail_applicant_sex') {
1814
- item.type = 'v-text';
1815
- item.name = planParams.detail_applicant_sex === '1' ? '男' : '女';
1816
- current.v = planParams.detail_applicant_sex;
1817
- }
1818
- }
1819
- });
1820
- }
1821
- /**
1822
- * **试算参数转化**
1823
- * @ignore
1824
- * @author watson
1825
- * @date 2022-04-26
1826
- * @param {object} currentData
1827
- * @param {object} planParams
1828
- * @returns {object}
1829
- */
1830
-
1831
-
1832
- function tranlateCurrentData(currentData, planParams) {
1833
- var currentDataCopy = JSON.parse(JSON.stringify(currentData));
1834
- currentDataCopy.forEach(function (item) {
1835
- var current = item;
1836
-
1837
- if (planParams) {
1838
- if (planParams.detail_age && item.k === 'detail_age') {
1839
- if (/-/.test(planParams.detail_age)) {
1840
- // 被保人生日
1841
- current.v = planParams.detail_age;
1842
- } else if (/岁/.test(planParams.detail_age)) {
1843
- // 被保人年龄
1844
- current.v = planParams.detail_age.replace('周', '').replace('岁', '').replace('Y', '') + 'Y';
1845
1940
  }
1846
- } // 被保人性别
1847
-
1848
-
1849
- if (planParams.detail_sex && item.k === 'detail_sex') {
1850
- current.v = planParams.detail_sex;
1851
- } // 投被保人关系
1852
-
1853
-
1854
- if (planParams.detail_relation && item.k === 'detail_relation') {
1855
- if (planParams.detail_relation != -1 || planParams.detail_relation != '-1') {
1856
- current.v = planParams.detail_relation;
1941
+ if (person.key === 'applicantInfo' && person.eleOrderList) {
1942
+ var applicantSame_1 = person.eleOrderList.find(function (e) { return e.key === 'applicantAndInsuredSame'; });
1943
+ if (applicantSame_1) {
1944
+ person.eleOrderList.forEach(function (ele) {
1945
+ if (['title', 'applicantAndInsuredSame'].includes(ele.key)) {
1946
+ return;
1947
+ }
1948
+ if (insuredData.cid !== undefined) {
1949
+ person.cid = applicantSame_1.value ? insuredData.cid : undefined;
1950
+ }
1951
+ if (applicantSame_1.value && insuredData.eleOrderList) {
1952
+ var insuredEle = insuredData.eleOrderList.find(function (e) { return e.key === ele.key; });
1953
+ if (insuredEle) {
1954
+ ele.value = insuredEle.value;
1955
+ }
1956
+ }
1957
+ });
1958
+ }
1857
1959
  }
1858
- } // 投保人出生日期
1859
-
1860
-
1861
- if (planParams.detail_applicant_age && item.k === 'detail_applicant_age') {
1862
- if (/-/.test(planParams.detail_applicant_age)) {
1863
- // 被保人生日
1864
- current.v = planParams.detail_applicant_age;
1865
- } else if (/岁/.test(planParams.detail_applicant_age)) {
1866
- // 被保人年龄
1867
- current.v = planParams.detail_applicant_age.replace('周', '').replace('岁', '').replace('Y', '') + 'Y';
1960
+ if (person.key === 'spouseInfo' && person.eleOrderList) {
1961
+ person.eleOrderList.forEach(function (ele) {
1962
+ if (ele.key === 'title') {
1963
+ ele.isDisabled = !applicantInfo.title;
1964
+ ele.value = applicantInfo.title ? ele.value : false;
1965
+ }
1966
+ if (ele.key === 'sex') {
1967
+ ele.value = applicantInfo.sex === 1 ? 2 : 1;
1968
+ }
1969
+ });
1868
1970
  }
1869
- } // 投保人性别
1870
-
1871
-
1872
- if (planParams.detail_applicant_sex && item.k === 'detail_applicant_sex') {
1873
- current.v = planParams.detail_applicant_sex;
1874
- }
1971
+ setPersonAgeOptions(person);
1972
+ });
1973
+ return allPersonsData;
1974
+ }
1975
+ function getInsuredAgeRange(inputData, verifyData) {
1976
+ var ageRange = {
1977
+ insuredInfo1: [],
1978
+ insuredInfo2: []
1979
+ };
1980
+ if (!inputData ||
1981
+ !inputData.productGroupList ||
1982
+ !inputData.personData ||
1983
+ !inputData.personData.personOrderList ||
1984
+ !verifyData) {
1985
+ return ageRange;
1875
1986
  }
1876
- });
1877
- return currentDataCopy;
1987
+ inputData.productGroupList.forEach(function (group) {
1988
+ if (!group.prodOrderList) {
1989
+ return;
1990
+ }
1991
+ var hasRequiredProd = group.prodOrderList.some(function (prod, i) { return i < group.defNum && !!prod.required && !prod.isTemp; });
1992
+ group.prodOrderList.forEach(function (prod) {
1993
+ if (!verifyData[prod.key] || prod.isTemp || !prod.mulInsOrderList) {
1994
+ return;
1995
+ }
1996
+ prod.mulInsOrderList.forEach(function (ins) {
1997
+ if (!verifyData[prod.key][ins.key]) {
1998
+ if (window.DEBUG_TEMP_CONSOLE_FLAG) {
1999
+ console.log(prod.titleName + "-" + prod.key + " -> " + ins.name + "-" + ins.key + ": \u5F53\u524D\u9669\u79CD\u6CA1\u6709\u8D39\u7387\u8868");
2000
+ }
2001
+ return;
2002
+ }
2003
+ var hasRequiredIns = prod.mulInsOrderList.some(function (ins) { return !!ins.required; });
2004
+ if ((!ins.huomian || ins.huomian === 'beiHuomian') &&
2005
+ (!hasRequiredProd || prod.required) &&
2006
+ (!hasRequiredIns || ins.required)) {
2007
+ verifyData[prod.key][ins.key].forEach(function (condi) {
2008
+ var currentAgeRange = ageRange["insuredInfo" + condi.sex];
2009
+ ageRange["insuredInfo" + condi.sex] = [
2010
+ Math.min(currentAgeRange[0] === undefined ? Infinity : currentAgeRange[0], condi.minAge),
2011
+ Math.max(currentAgeRange[1] === undefined ? -Infinity : currentAgeRange[1], condi.maxAge)
2012
+ ];
2013
+ });
2014
+ }
2015
+ });
2016
+ });
2017
+ });
2018
+ return ageRange;
1878
2019
  }
1879
- /**
1880
- * 险种计算
1881
- * @author watson
1882
- * @date 2022-04-26
1883
- * @param {object} urlParams 接口URL上面的参数,c端必传uuid
1884
- * @param {object} postParams 试算用的参数,product_id, current_data 和 scenario: 'h5Widget'
1885
- * @param {object} planParams 计划书初始化参数
1886
- * @returns {promise} 试算结果
1887
- */
1888
-
1889
-
1890
- function insureCalculate(urlParams, postParams, planParams) {
1891
- if (!postParams || typeof_default()(postParams) !== 'object' || !postParams.product_id) {
1892
- return postParams;
1893
- }
1894
-
1895
- if (postParams && !postParams.scenario) {
1896
- postParams.scenario = 'h5Widget';
1897
- }
1898
-
1899
- var url = '/api/product/data/calculate';
1900
-
1901
- if (urlParams && urlParams.uuid) {
1902
- url += "?userUuid=".concat(urlParams.uuid);
1903
- } else if (urlParams && urlParams.openId) {
1904
- url += "?userUuid=".concat(urlParams.openId);
1905
- }
1906
-
1907
- if (urlParams && urlParams.appid) {
1908
- if (url.indexOf('?') > -1) {
1909
- url += "&appId=".concat(urlParams.appid);
1910
- } else {
1911
- url += "?appId=".concat(urlParams.appid);
2020
+ function setPersonAgeOptions(personData) {
2021
+ if (!personData || !personData.eleOrderList) {
2022
+ return personData;
1912
2023
  }
1913
- }
1914
-
1915
- if (hasPlanParams(planParams) && postParams.current_data) {
1916
- postParams.current_data = tranlateCurrentData(postParams.current_data, planParams);
1917
- }
1918
-
1919
- return new Promise(function (resolve, reject) {
1920
- request({
1921
- baseURL: baseURL,
1922
- url: url,
1923
- method: 'POST',
1924
- urlParams: urlParams,
1925
- data: postParams
1926
- }).then(function (res) {
1927
- if (res.code === 200) {
1928
- var data = JSON.parse(JSON.stringify(res.data));
1929
-
1930
- if (hasPlanParams(planParams)) {
1931
- var widgets = data.widgets;
1932
- var currentData = data.current_data;
1933
- translatePlanData(widgets, currentData, planParams);
2024
+ var personForm = Object(_common__WEBPACK_IMPORTED_MODULE_0__[/* convertEleOrderListToObj */ "c"])(personData);
2025
+ personData.eleOrderList.forEach(function (ele) {
2026
+ if (ele.key === 'age') {
2027
+ var options = [];
2028
+ var opts = (personForm.sex == 2 && ele.optsF && ele.optsF.length ? ele.optsF : ele.opts);
2029
+ for (var k = opts[0]; k <= opts[1]; k++) {
2030
+ options.push({
2031
+ val: k,
2032
+ desc: k + "\u5C81"
2033
+ });
2034
+ }
2035
+ var birthday = personData.eleOrderList.find(function (e) { return e.key === 'birthday'; });
2036
+ if (options.length && options.every(function (o) { return o.val !== ele.value; })) {
2037
+ ele.value = options[0].val;
2038
+ if (birthday) {
2039
+ birthday.value = null;
2040
+ }
2041
+ }
2042
+ ele.options = options;
2043
+ if (birthday) {
2044
+ birthday.defaulValue = new Date(new Date().getFullYear() - Number(ele.value), new Date().getMonth(), new Date().getDate());
2045
+ birthday.minDate = new Date(new Date().getFullYear() - opts[1] - 1, new Date().getMonth(), new Date().getDate() + 1);
2046
+ birthday.maxDate = new Date(new Date().getFullYear() - opts[0], new Date().getMonth(), new Date().getDate());
2047
+ }
1934
2048
  }
1935
-
1936
- var cData = {
1937
- widgets: data.widgets,
1938
- total_premium: data.total_premium,
1939
- terms: data.terms,
1940
- product_id: data.product_id,
1941
- current_data: data.current_data,
1942
- risk_premiums: data.risk_premiums
1943
- };
1944
- resolve({
1945
- code: 200,
1946
- data: cData
1947
- });
1948
- } else {
1949
- reject(res);
1950
- }
1951
- }).catch(function (err) {
1952
- reject(err);
1953
2049
  });
1954
- });
1955
- }
1956
- /**
1957
- * **检查险种计算**
1958
- * @author watson
1959
- * @date 2022-04-26
1960
- * @param {object} urlParams 接口URL上面的参数,c端必传uuid
1961
- * @param {object} postParams 试算用的参数,product_id, current_data 和 scenario: 'h5Widget'
1962
- * @param {object} planParams 计划书初始化参数
1963
- * @returns {promise} 试算结果
1964
- */
1965
-
1966
- function checkInsureCalculate(_x, _x2, _x3) {
1967
- return _checkInsureCalculate.apply(this, arguments);
2050
+ return personData;
1968
2051
  }
1969
- /**
1970
- * 描述
1971
- * @ignore
1972
- * @author watson
1973
- * @date 2022-04-26
1974
- * @param {object} urlParams
1975
- * @param {object} postParams
1976
- * @param {object} planParams
1977
- * @returns {promise}
1978
- */
1979
-
1980
- function _checkInsureCalculate() {
1981
- _checkInsureCalculate = asyncToGenerator_default()( /*#__PURE__*/regenerator_default.a.mark(function _callee(urlParams, postParams, planParams) {
1982
- var res, data;
1983
- return regenerator_default.a.wrap(function _callee$(_context) {
1984
- while (1) {
1985
- switch (_context.prev = _context.next) {
1986
- case 0:
1987
- _context.next = 2;
1988
- return checkInsureCalculateIn(urlParams, postParams, planParams);
1989
-
1990
- case 2:
1991
- res = _context.sent;
1992
-
1993
- if (!(postParams && !postParams.current_data)) {
1994
- _context.next = 15;
1995
- break;
1996
- }
1997
-
1998
- data = JSON.parse(JSON.stringify(res.data));
1999
- postParams.current_data = data.current_data; // 重新试算
2000
-
2001
- _context.prev = 6;
2002
- _context.next = 9;
2003
- return checkInsureCalculateIn(urlParams, postParams, planParams);
2004
-
2005
- case 9:
2006
- res = _context.sent;
2007
- _context.next = 15;
2008
- break;
2009
-
2010
- case 12:
2011
- _context.prev = 12;
2012
- _context.t0 = _context["catch"](6);
2013
- res = _context.t0;
2014
-
2015
- case 15:
2016
- if (!(res && res.code === 200)) {
2017
- _context.next = 19;
2018
- break;
2052
+ function convertPersonData(allPersonsData, type) {
2053
+ if (type === void 0) { type = null; }
2054
+ var cPersonData = {};
2055
+ if (allPersonsData) {
2056
+ if (allPersonsData.recipientInfo) {
2057
+ cPersonData.recipientInfo = Object(_common__WEBPACK_IMPORTED_MODULE_0__[/* convertEleOrderListToObj */ "c"])(allPersonsData.recipientInfo);
2058
+ }
2059
+ if (allPersonsData.personOrderList) {
2060
+ allPersonsData.personOrderList.forEach(function (person) {
2061
+ cPersonData[person.key] = Object(_common__WEBPACK_IMPORTED_MODULE_0__[/* convertEleOrderListToObj */ "c"])(person);
2062
+ });
2063
+ }
2064
+ }
2065
+ if (!type) {
2066
+ return {
2067
+ recipientInfo: cPersonData.recipientInfo,
2068
+ personOrderList: allPersonsData.personOrderList && allPersonsData.personOrderList.map(function (p) { return p.key; }).map(function (p) { return cPersonData[p]; })
2069
+ };
2070
+ }
2071
+ if (typeof type === 'string') {
2072
+ return cPersonData[type];
2073
+ }
2074
+ if (type.constructor === Array) {
2075
+ var temp = [];
2076
+ for (var k in cPersonData) {
2077
+ if (type.indexOf(k) !== -1) {
2078
+ temp.push(cPersonData[k]);
2019
2079
  }
2020
-
2021
- return _context.abrupt("return", res);
2022
-
2023
- case 19:
2024
- return _context.abrupt("return", Promise.reject(res));
2025
-
2026
- case 20:
2027
- case "end":
2028
- return _context.stop();
2029
2080
  }
2030
- }
2031
- }, _callee, null, [[6, 12]]);
2032
- }));
2033
- return _checkInsureCalculate.apply(this, arguments);
2081
+ return temp;
2082
+ }
2034
2083
  }
2035
2084
 
2036
- function checkInsureCalculateIn(urlParams, postParams, planParams) {
2037
- if (!postParams || typeof_default()(postParams) !== 'object' || !postParams.product_id) {
2038
- return Promise.reject({
2039
- code: 400,
2040
- msg: 'postParams参数非法'
2041
- });
2042
- }
2043
-
2044
- if (postParams && !postParams.scenario) {
2045
- postParams.scenario = 'h5Widget';
2046
- }
2047
-
2048
- var url = '/api/product/data/calculate';
2049
-
2050
- if (urlParams && urlParams.uuid) {
2051
- url += "?userUuid=".concat(urlParams.uuid);
2052
- } else if (urlParams && urlParams.openId) {
2053
- url += "?userUuid=".concat(urlParams.openId);
2054
- }
2055
2085
 
2056
- if (urlParams && urlParams.appid) {
2057
- if (url.indexOf('?') > -1) {
2058
- url += "&appId=".concat(urlParams.appid);
2059
- } else {
2060
- url += "?appId=".concat(urlParams.appid);
2061
- }
2062
- }
2086
+ /***/ }),
2087
+ /* 10 */,
2088
+ /* 11 */
2089
+ /***/ (function(module, exports) {
2063
2090
 
2064
- if (hasPlanParams(planParams) && postParams.current_data) {
2065
- postParams.current_data = tranlateCurrentData(postParams.current_data, planParams);
2066
- }
2091
+ function _typeof(obj) {
2092
+ "@babel/helpers - typeof";
2067
2093
 
2068
- return new Promise(function (resolve, reject) {
2069
- request({
2070
- baseURL: baseURL,
2071
- url: url,
2072
- method: 'POST',
2073
- urlParams: urlParams,
2074
- data: postParams
2075
- }).then(function (res) {
2076
- if (res.code === 200) {
2077
- // if (postParams && !postParams.current_data) {
2078
- // let data = JSON.parse(JSON.stringify(res.data));
2079
- // postParams.current_data = data.current_data
2080
- // // 重新试算
2081
- // checkInsureCalculate(urlParams, postParams, planParams)
2082
- // }
2083
- resolve({
2084
- code: 200,
2085
- data: res.data
2086
- });
2087
- } else {
2088
- reject(res);
2089
- }
2090
- }).catch(function (err) {
2091
- reject(err);
2092
- });
2093
- });
2094
+ return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
2095
+ return typeof obj;
2096
+ } : function (obj) {
2097
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
2098
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
2094
2099
  }
2095
- // CONCATENATED MODULE: ./packages/bxs-utils/trade/index.js
2096
-
2097
- // CONCATENATED MODULE: ./packages/bxs-utils/index.ts
2098
-
2099
-
2100
2100
 
2101
+ module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
2101
2102
 
2102
2103
  /***/ }),
2103
- /* 11 */
2104
+ /* 12 */
2104
2105
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2105
2106
 
2106
2107
  "use strict";
@@ -2119,7 +2120,7 @@ function checkInsureCalculateIn(urlParams, postParams, planParams) {
2119
2120
 
2120
2121
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "l", function() { return _common__WEBPACK_IMPORTED_MODULE_0__["g"]; });
2121
2122
 
2122
- /* harmony import */ var _person__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8);
2123
+ /* harmony import */ var _person__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9);
2123
2124
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "e", function() { return _person__WEBPACK_IMPORTED_MODULE_1__["a"]; });
2124
2125
 
2125
2126
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "k", function() { return _person__WEBPACK_IMPORTED_MODULE_1__["b"]; });
@@ -2130,7 +2131,7 @@ function checkInsureCalculateIn(urlParams, postParams, planParams) {
2130
2131
 
2131
2132
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "y", function() { return _person__WEBPACK_IMPORTED_MODULE_1__["e"]; });
2132
2133
 
2133
- /* harmony import */ var _product__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13);
2134
+ /* harmony import */ var _product__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(14);
2134
2135
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "b", function() { return _product__WEBPACK_IMPORTED_MODULE_2__["a"]; });
2135
2136
 
2136
2137
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "f", function() { return _product__WEBPACK_IMPORTED_MODULE_2__["b"]; });
@@ -2170,8 +2171,8 @@ if (document && document.cookie && document.cookie.match('LIZHAO_DEBUG_CONSOLE_F
2170
2171
 
2171
2172
 
2172
2173
  /***/ }),
2173
- /* 12 */,
2174
- /* 13 */
2174
+ /* 13 */,
2175
+ /* 14 */
2175
2176
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2176
2177
 
2177
2178
  "use strict";
@@ -2187,7 +2188,7 @@ if (document && document.cookie && document.cookie.match('LIZHAO_DEBUG_CONSOLE_F
2187
2188
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return clearAddAndTakeAndAdjustBaoeData; });
2188
2189
  /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
2189
2190
  /* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);
2190
- /* harmony import */ var _person__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8);
2191
+ /* harmony import */ var _person__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9);
2191
2192
  /* harmony import */ var _insurance__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6);
2192
2193
 
2193
2194
 
@@ -2817,13 +2818,14 @@ function clearAddAndTakeAndAdjustBaoeData(productData) {
2817
2818
 
2818
2819
 
2819
2820
  /***/ }),
2820
- /* 14 */,
2821
- /* 15 */
2821
+ /* 15 */,
2822
+ /* 16 */,
2823
+ /* 17 */
2822
2824
  /***/ (function(module, exports, __webpack_require__) {
2823
2825
 
2824
2826
  // TODO(Babel 8): Remove this file.
2825
2827
 
2826
- var runtime = __webpack_require__(52)();
2828
+ var runtime = __webpack_require__(55)();
2827
2829
  module.exports = runtime;
2828
2830
 
2829
2831
  // Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
@@ -2839,11 +2841,11 @@ try {
2839
2841
 
2840
2842
 
2841
2843
  /***/ }),
2842
- /* 16 */,
2843
- /* 17 */,
2844
2844
  /* 18 */,
2845
2845
  /* 19 */,
2846
- /* 20 */
2846
+ /* 20 */,
2847
+ /* 21 */,
2848
+ /* 22 */
2847
2849
  /***/ (function(module, exports, __webpack_require__) {
2848
2850
 
2849
2851
  "use strict";
@@ -2861,7 +2863,7 @@ module.exports = function bind(fn, thisArg) {
2861
2863
 
2862
2864
 
2863
2865
  /***/ }),
2864
- /* 21 */
2866
+ /* 23 */
2865
2867
  /***/ (function(module, exports, __webpack_require__) {
2866
2868
 
2867
2869
  "use strict";
@@ -2938,7 +2940,7 @@ module.exports = function buildURL(url, params, paramsSerializer) {
2938
2940
 
2939
2941
 
2940
2942
  /***/ }),
2941
- /* 22 */
2943
+ /* 24 */
2942
2944
  /***/ (function(module, exports, __webpack_require__) {
2943
2945
 
2944
2946
  "use strict";
@@ -2950,14 +2952,14 @@ module.exports = function isCancel(value) {
2950
2952
 
2951
2953
 
2952
2954
  /***/ }),
2953
- /* 23 */
2955
+ /* 25 */
2954
2956
  /***/ (function(module, exports, __webpack_require__) {
2955
2957
 
2956
2958
  "use strict";
2957
2959
  /* WEBPACK VAR INJECTION */(function(process) {
2958
2960
 
2959
2961
  var utils = __webpack_require__(5);
2960
- var normalizeHeaderName = __webpack_require__(59);
2962
+ var normalizeHeaderName = __webpack_require__(62);
2961
2963
 
2962
2964
  var DEFAULT_CONTENT_TYPE = {
2963
2965
  'Content-Type': 'application/x-www-form-urlencoded'
@@ -2973,10 +2975,10 @@ function getDefaultAdapter() {
2973
2975
  var adapter;
2974
2976
  if (typeof XMLHttpRequest !== 'undefined') {
2975
2977
  // For browsers use XHR adapter
2976
- adapter = __webpack_require__(24);
2978
+ adapter = __webpack_require__(26);
2977
2979
  } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
2978
2980
  // For node use HTTP adapter
2979
- adapter = __webpack_require__(24);
2981
+ adapter = __webpack_require__(26);
2980
2982
  }
2981
2983
  return adapter;
2982
2984
  }
@@ -3053,23 +3055,23 @@ utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
3053
3055
 
3054
3056
  module.exports = defaults;
3055
3057
 
3056
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(58)))
3058
+ /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(61)))
3057
3059
 
3058
3060
  /***/ }),
3059
- /* 24 */
3061
+ /* 26 */
3060
3062
  /***/ (function(module, exports, __webpack_require__) {
3061
3063
 
3062
3064
  "use strict";
3063
3065
 
3064
3066
 
3065
3067
  var utils = __webpack_require__(5);
3066
- var settle = __webpack_require__(60);
3067
- var cookies = __webpack_require__(62);
3068
- var buildURL = __webpack_require__(21);
3069
- var buildFullPath = __webpack_require__(63);
3070
- var parseHeaders = __webpack_require__(66);
3071
- var isURLSameOrigin = __webpack_require__(67);
3072
- var createError = __webpack_require__(25);
3068
+ var settle = __webpack_require__(63);
3069
+ var cookies = __webpack_require__(65);
3070
+ var buildURL = __webpack_require__(23);
3071
+ var buildFullPath = __webpack_require__(66);
3072
+ var parseHeaders = __webpack_require__(69);
3073
+ var isURLSameOrigin = __webpack_require__(70);
3074
+ var createError = __webpack_require__(27);
3073
3075
 
3074
3076
  module.exports = function xhrAdapter(config) {
3075
3077
  return new Promise(function dispatchXhrRequest(resolve, reject) {
@@ -3249,13 +3251,13 @@ module.exports = function xhrAdapter(config) {
3249
3251
 
3250
3252
 
3251
3253
  /***/ }),
3252
- /* 25 */
3254
+ /* 27 */
3253
3255
  /***/ (function(module, exports, __webpack_require__) {
3254
3256
 
3255
3257
  "use strict";
3256
3258
 
3257
3259
 
3258
- var enhanceError = __webpack_require__(61);
3260
+ var enhanceError = __webpack_require__(64);
3259
3261
 
3260
3262
  /**
3261
3263
  * Create an Error with the specified message, config, error code, request and response.
@@ -3274,7 +3276,7 @@ module.exports = function createError(message, config, code, request, response)
3274
3276
 
3275
3277
 
3276
3278
  /***/ }),
3277
- /* 26 */
3279
+ /* 28 */
3278
3280
  /***/ (function(module, exports, __webpack_require__) {
3279
3281
 
3280
3282
  "use strict";
@@ -3368,7 +3370,7 @@ module.exports = function mergeConfig(config1, config2) {
3368
3370
 
3369
3371
 
3370
3372
  /***/ }),
3371
- /* 27 */
3373
+ /* 29 */
3372
3374
  /***/ (function(module, exports, __webpack_require__) {
3373
3375
 
3374
3376
  "use strict";
@@ -3394,7 +3396,7 @@ module.exports = Cancel;
3394
3396
 
3395
3397
 
3396
3398
  /***/ }),
3397
- /* 28 */
3399
+ /* 30 */
3398
3400
  /***/ (function(module, exports) {
3399
3401
 
3400
3402
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
@@ -3436,14 +3438,12 @@ function _asyncToGenerator(fn) {
3436
3438
  module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
3437
3439
 
3438
3440
  /***/ }),
3439
- /* 29 */
3441
+ /* 31 */
3440
3442
  /***/ (function(module, exports, __webpack_require__) {
3441
3443
 
3442
- module.exports = __webpack_require__(53);
3444
+ module.exports = __webpack_require__(56);
3443
3445
 
3444
3446
  /***/ }),
3445
- /* 30 */,
3446
- /* 31 */,
3447
3447
  /* 32 */,
3448
3448
  /* 33 */,
3449
3449
  /* 34 */,
@@ -3464,10 +3464,13 @@ module.exports = __webpack_require__(53);
3464
3464
  /* 49 */,
3465
3465
  /* 50 */,
3466
3466
  /* 51 */,
3467
- /* 52 */
3467
+ /* 52 */,
3468
+ /* 53 */,
3469
+ /* 54 */,
3470
+ /* 55 */
3468
3471
  /***/ (function(module, exports, __webpack_require__) {
3469
3472
 
3470
- var _typeof = __webpack_require__(9)["default"];
3473
+ var _typeof = __webpack_require__(11)["default"];
3471
3474
 
3472
3475
  function _regeneratorRuntime() {
3473
3476
  "use strict";
@@ -3823,17 +3826,17 @@ function _regeneratorRuntime() {
3823
3826
  module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
3824
3827
 
3825
3828
  /***/ }),
3826
- /* 53 */
3829
+ /* 56 */
3827
3830
  /***/ (function(module, exports, __webpack_require__) {
3828
3831
 
3829
3832
  "use strict";
3830
3833
 
3831
3834
 
3832
3835
  var utils = __webpack_require__(5);
3833
- var bind = __webpack_require__(20);
3834
- var Axios = __webpack_require__(54);
3835
- var mergeConfig = __webpack_require__(26);
3836
- var defaults = __webpack_require__(23);
3836
+ var bind = __webpack_require__(22);
3837
+ var Axios = __webpack_require__(57);
3838
+ var mergeConfig = __webpack_require__(28);
3839
+ var defaults = __webpack_require__(25);
3837
3840
 
3838
3841
  /**
3839
3842
  * Create an instance of Axios
@@ -3866,15 +3869,15 @@ axios.create = function create(instanceConfig) {
3866
3869
  };
3867
3870
 
3868
3871
  // Expose Cancel & CancelToken
3869
- axios.Cancel = __webpack_require__(27);
3870
- axios.CancelToken = __webpack_require__(68);
3871
- axios.isCancel = __webpack_require__(22);
3872
+ axios.Cancel = __webpack_require__(29);
3873
+ axios.CancelToken = __webpack_require__(71);
3874
+ axios.isCancel = __webpack_require__(24);
3872
3875
 
3873
3876
  // Expose all/spread
3874
3877
  axios.all = function all(promises) {
3875
3878
  return Promise.all(promises);
3876
3879
  };
3877
- axios.spread = __webpack_require__(69);
3880
+ axios.spread = __webpack_require__(72);
3878
3881
 
3879
3882
  module.exports = axios;
3880
3883
 
@@ -3883,17 +3886,17 @@ module.exports.default = axios;
3883
3886
 
3884
3887
 
3885
3888
  /***/ }),
3886
- /* 54 */
3889
+ /* 57 */
3887
3890
  /***/ (function(module, exports, __webpack_require__) {
3888
3891
 
3889
3892
  "use strict";
3890
3893
 
3891
3894
 
3892
3895
  var utils = __webpack_require__(5);
3893
- var buildURL = __webpack_require__(21);
3894
- var InterceptorManager = __webpack_require__(55);
3895
- var dispatchRequest = __webpack_require__(56);
3896
- var mergeConfig = __webpack_require__(26);
3896
+ var buildURL = __webpack_require__(23);
3897
+ var InterceptorManager = __webpack_require__(58);
3898
+ var dispatchRequest = __webpack_require__(59);
3899
+ var mergeConfig = __webpack_require__(28);
3897
3900
 
3898
3901
  /**
3899
3902
  * Create a new instance of Axios
@@ -3984,7 +3987,7 @@ module.exports = Axios;
3984
3987
 
3985
3988
 
3986
3989
  /***/ }),
3987
- /* 55 */
3990
+ /* 58 */
3988
3991
  /***/ (function(module, exports, __webpack_require__) {
3989
3992
 
3990
3993
  "use strict";
@@ -4043,16 +4046,16 @@ module.exports = InterceptorManager;
4043
4046
 
4044
4047
 
4045
4048
  /***/ }),
4046
- /* 56 */
4049
+ /* 59 */
4047
4050
  /***/ (function(module, exports, __webpack_require__) {
4048
4051
 
4049
4052
  "use strict";
4050
4053
 
4051
4054
 
4052
4055
  var utils = __webpack_require__(5);
4053
- var transformData = __webpack_require__(57);
4054
- var isCancel = __webpack_require__(22);
4055
- var defaults = __webpack_require__(23);
4056
+ var transformData = __webpack_require__(60);
4057
+ var isCancel = __webpack_require__(24);
4058
+ var defaults = __webpack_require__(25);
4056
4059
 
4057
4060
  /**
4058
4061
  * Throws a `Cancel` if cancellation has been requested.
@@ -4129,7 +4132,7 @@ module.exports = function dispatchRequest(config) {
4129
4132
 
4130
4133
 
4131
4134
  /***/ }),
4132
- /* 57 */
4135
+ /* 60 */
4133
4136
  /***/ (function(module, exports, __webpack_require__) {
4134
4137
 
4135
4138
  "use strict";
@@ -4156,7 +4159,7 @@ module.exports = function transformData(data, headers, fns) {
4156
4159
 
4157
4160
 
4158
4161
  /***/ }),
4159
- /* 58 */
4162
+ /* 61 */
4160
4163
  /***/ (function(module, exports) {
4161
4164
 
4162
4165
  // shim for using process in browser
@@ -4346,7 +4349,7 @@ process.umask = function() { return 0; };
4346
4349
 
4347
4350
 
4348
4351
  /***/ }),
4349
- /* 59 */
4352
+ /* 62 */
4350
4353
  /***/ (function(module, exports, __webpack_require__) {
4351
4354
 
4352
4355
  "use strict";
@@ -4365,13 +4368,13 @@ module.exports = function normalizeHeaderName(headers, normalizedName) {
4365
4368
 
4366
4369
 
4367
4370
  /***/ }),
4368
- /* 60 */
4371
+ /* 63 */
4369
4372
  /***/ (function(module, exports, __webpack_require__) {
4370
4373
 
4371
4374
  "use strict";
4372
4375
 
4373
4376
 
4374
- var createError = __webpack_require__(25);
4377
+ var createError = __webpack_require__(27);
4375
4378
 
4376
4379
  /**
4377
4380
  * Resolve or reject a Promise based on response status.
@@ -4397,7 +4400,7 @@ module.exports = function settle(resolve, reject, response) {
4397
4400
 
4398
4401
 
4399
4402
  /***/ }),
4400
- /* 61 */
4403
+ /* 64 */
4401
4404
  /***/ (function(module, exports, __webpack_require__) {
4402
4405
 
4403
4406
  "use strict";
@@ -4446,7 +4449,7 @@ module.exports = function enhanceError(error, config, code, request, response) {
4446
4449
 
4447
4450
 
4448
4451
  /***/ }),
4449
- /* 62 */
4452
+ /* 65 */
4450
4453
  /***/ (function(module, exports, __webpack_require__) {
4451
4454
 
4452
4455
  "use strict";
@@ -4506,14 +4509,14 @@ module.exports = (
4506
4509
 
4507
4510
 
4508
4511
  /***/ }),
4509
- /* 63 */
4512
+ /* 66 */
4510
4513
  /***/ (function(module, exports, __webpack_require__) {
4511
4514
 
4512
4515
  "use strict";
4513
4516
 
4514
4517
 
4515
- var isAbsoluteURL = __webpack_require__(64);
4516
- var combineURLs = __webpack_require__(65);
4518
+ var isAbsoluteURL = __webpack_require__(67);
4519
+ var combineURLs = __webpack_require__(68);
4517
4520
 
4518
4521
  /**
4519
4522
  * Creates a new URL by combining the baseURL with the requestedURL,
@@ -4533,7 +4536,7 @@ module.exports = function buildFullPath(baseURL, requestedURL) {
4533
4536
 
4534
4537
 
4535
4538
  /***/ }),
4536
- /* 64 */
4539
+ /* 67 */
4537
4540
  /***/ (function(module, exports, __webpack_require__) {
4538
4541
 
4539
4542
  "use strict";
@@ -4554,7 +4557,7 @@ module.exports = function isAbsoluteURL(url) {
4554
4557
 
4555
4558
 
4556
4559
  /***/ }),
4557
- /* 65 */
4560
+ /* 68 */
4558
4561
  /***/ (function(module, exports, __webpack_require__) {
4559
4562
 
4560
4563
  "use strict";
@@ -4575,7 +4578,7 @@ module.exports = function combineURLs(baseURL, relativeURL) {
4575
4578
 
4576
4579
 
4577
4580
  /***/ }),
4578
- /* 66 */
4581
+ /* 69 */
4579
4582
  /***/ (function(module, exports, __webpack_require__) {
4580
4583
 
4581
4584
  "use strict";
@@ -4635,7 +4638,7 @@ module.exports = function parseHeaders(headers) {
4635
4638
 
4636
4639
 
4637
4640
  /***/ }),
4638
- /* 67 */
4641
+ /* 70 */
4639
4642
  /***/ (function(module, exports, __webpack_require__) {
4640
4643
 
4641
4644
  "use strict";
@@ -4710,13 +4713,13 @@ module.exports = (
4710
4713
 
4711
4714
 
4712
4715
  /***/ }),
4713
- /* 68 */
4716
+ /* 71 */
4714
4717
  /***/ (function(module, exports, __webpack_require__) {
4715
4718
 
4716
4719
  "use strict";
4717
4720
 
4718
4721
 
4719
- var Cancel = __webpack_require__(27);
4722
+ var Cancel = __webpack_require__(29);
4720
4723
 
4721
4724
  /**
4722
4725
  * A `CancelToken` is an object that can be used to request cancellation of an operation.
@@ -4774,7 +4777,7 @@ module.exports = CancelToken;
4774
4777
 
4775
4778
 
4776
4779
  /***/ }),
4777
- /* 69 */
4780
+ /* 72 */
4778
4781
  /***/ (function(module, exports, __webpack_require__) {
4779
4782
 
4780
4783
  "use strict";