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.
Files changed (148) hide show
  1. package/README.md +20 -20
  2. package/es/add-and-take/index.css +1 -1
  3. package/es/add-and-take/index.js +283 -64
  4. package/es/adjust-baoe/index.css +1 -1
  5. package/es/adjust-baoe/index.js +444 -195
  6. package/es/business-card/index.css +1 -1
  7. package/es/business-card/index.js +1 -0
  8. package/es/canvas-poster/index.css +1 -1
  9. package/es/canvas-poster/index.js +1 -0
  10. package/es/index.css +1 -1
  11. package/es/index.js +936 -824
  12. package/es/insure-calculate/index.css +1 -1
  13. package/es/insure-calculate/index.js +438 -265
  14. package/es/person-info/index.css +1 -1
  15. package/es/person-info/index.js +296 -1370
  16. package/es/product-info/index.css +1 -1
  17. package/es/product-info/index.js +644 -548
  18. package/es/share-sheet/index.css +1 -1
  19. package/es/share-sheet/index.js +313 -21
  20. package/es/utils/index.js +530 -429
  21. package/lib/add-and-take/index.css +1 -1
  22. package/lib/add-and-take/index.js +283 -64
  23. package/lib/adjust-baoe/index.css +1 -1
  24. package/lib/adjust-baoe/index.js +441 -194
  25. package/lib/business-card/index.css +1 -1
  26. package/lib/business-card/index.js +1 -0
  27. package/lib/canvas-poster/index.css +1 -1
  28. package/lib/canvas-poster/index.js +1 -0
  29. package/lib/index.css +1 -1
  30. package/lib/index.js +939 -826
  31. package/lib/insure-calculate/index.css +1 -1
  32. package/lib/insure-calculate/index.js +438 -268
  33. package/lib/person-info/index.css +1 -1
  34. package/lib/person-info/index.js +295 -1372
  35. package/lib/product-info/index.css +1 -1
  36. package/lib/product-info/index.js +645 -550
  37. package/lib/share-sheet/index.css +1 -1
  38. package/lib/share-sheet/index.js +313 -25
  39. package/lib/utils/index.js +531 -433
  40. package/package.json +9 -7
  41. package/packages/add-and-take/components/interest-form.less +144 -0
  42. package/packages/add-and-take/components/interest-form.vue +179 -179
  43. package/packages/add-and-take/components/interest-items.less +87 -0
  44. package/packages/add-and-take/components/interest-items.vue +67 -80
  45. package/packages/add-and-take/components/interest-table.less +111 -0
  46. package/packages/add-and-take/components/interest-table.vue +31 -31
  47. package/packages/add-and-take/constant.ts +2 -2
  48. package/packages/add-and-take/demo/index.vue +89 -86
  49. package/packages/add-and-take/handler.ts +52 -57
  50. package/packages/add-and-take/index.less +69 -0
  51. package/packages/add-and-take/index.vue +156 -156
  52. package/packages/add-and-take/readme.md +87 -98
  53. package/packages/adjust-baoe/demo/index.vue +37 -47
  54. package/packages/adjust-baoe/index.less +125 -0
  55. package/packages/adjust-baoe/index.vue +134 -147
  56. package/packages/adjust-baoe/readme.md +35 -45
  57. package/packages/business-card/demo/index.vue +7 -7
  58. package/packages/business-card/index.less +100 -0
  59. package/packages/business-card/index.vue +18 -21
  60. package/packages/business-card/readme.md +46 -53
  61. package/packages/bxs-utils/demo/index.vue +2 -2
  62. package/packages/bxs-utils/index.ts +5 -5
  63. package/packages/bxs-utils/planbook/common.ts +56 -92
  64. package/packages/bxs-utils/planbook/index.ts +4 -4
  65. package/packages/bxs-utils/planbook/insurance.ts +137 -127
  66. package/packages/bxs-utils/planbook/person.ts +143 -147
  67. package/packages/bxs-utils/planbook/product.ts +473 -509
  68. package/packages/bxs-utils/readme.md +94 -84
  69. package/packages/bxs-utils/trade/index.js +1 -1
  70. package/packages/bxs-utils/trade/insureCalculate.js +91 -204
  71. package/packages/canvas-poster/demo/index.vue +9 -13
  72. package/packages/canvas-poster/index.less +5 -0
  73. package/packages/canvas-poster/index.vue +68 -79
  74. package/packages/canvas-poster/readme.md +106 -109
  75. package/packages/index.ts +1 -1
  76. package/packages/insure-calculate/demo/index.vue +20 -20
  77. package/packages/insure-calculate/index.less +366 -0
  78. package/packages/insure-calculate/index.vue +305 -329
  79. package/packages/insure-calculate/readme.md +99 -106
  80. package/packages/person-info/crm-popup.vue +81 -80
  81. package/packages/person-info/demo/index.vue +25 -37
  82. package/packages/person-info/index-inline.less +11 -0
  83. package/packages/person-info/index.vue +53 -83
  84. package/packages/person-info/readme.md +109 -115
  85. package/packages/planbook-input/components/footer.less +54 -0
  86. package/packages/planbook-input/components/footer.vue +8 -64
  87. package/packages/planbook-input/components/handler.js +33 -44
  88. package/packages/planbook-input/components/product-table.less +235 -0
  89. package/packages/planbook-input/components/product-table.vue +114 -108
  90. package/packages/planbook-input/demo/index.vue +3 -3
  91. package/packages/planbook-input/helper.js +852 -465
  92. package/packages/planbook-input/index.less +30 -0
  93. package/packages/planbook-input/index.vue +86 -103
  94. package/packages/planbook-input/readme.md +72 -90
  95. package/packages/product-info/demo/constant.js +1 -1
  96. package/packages/product-info/demo/index.vue +31 -43
  97. package/packages/product-info/index.less +271 -0
  98. package/packages/product-info/index.vue +198 -210
  99. package/packages/product-info/readme.md +72 -75
  100. package/packages/share-sheet/constant.js +4 -4
  101. package/packages/share-sheet/demo/index.vue +10 -10
  102. package/packages/share-sheet/handler.js +14 -14
  103. package/packages/share-sheet/index.less +201 -0
  104. package/packages/share-sheet/index.vue +39 -39
  105. package/packages/share-sheet/readme.md +121 -127
  106. package/src/api/add-and-take.js +45 -0
  107. package/src/api/adjust-baoe.js +16 -0
  108. package/src/api/index.js +6 -0
  109. package/src/api/planbook.js +93 -0
  110. package/src/api/request.js +211 -0
  111. package/src/api/trade.js +56 -0
  112. package/src/api/user.js +18 -0
  113. package/src/components/common/common-age-birthday.less +66 -0
  114. package/src/components/common/common-age-birthday.vue +27 -95
  115. package/src/components/common/common-popup.less +81 -0
  116. package/src/components/common/common-popup.vue +12 -96
  117. package/src/components/common/common-radio.less +75 -0
  118. package/src/components/common/common-radio.vue +13 -91
  119. package/src/components/common/common-select.less +13 -0
  120. package/src/components/common/common-select.vue +21 -38
  121. package/src/components/common/common-title.less +115 -0
  122. package/src/components/common/common-title.vue +24 -24
  123. package/src/js/loading.js +6 -6
  124. package/src/js/md5Token.js +38 -44
  125. package/src/js/utils.js +45 -53
  126. package/src/js/variables.js +47 -25
  127. package/src/style/base.less +18 -0
  128. package/src/style/color.less +40 -0
  129. package/src/style/variables.less +21 -42
  130. package/packages/add-and-take/api.ts +0 -70
  131. package/packages/add-and-take/components/interest-form.css +0 -146
  132. package/packages/add-and-take/components/interest-items.css +0 -87
  133. package/packages/add-and-take/components/interest-table.css +0 -113
  134. package/packages/add-and-take/index.css +0 -70
  135. package/packages/adjust-baoe/index.css +0 -123
  136. package/packages/business-card/index.css +0 -101
  137. package/packages/canvas-poster/index.css +0 -5
  138. package/packages/insure-calculate/index.css +0 -368
  139. package/packages/planbook-input/api.js +0 -29
  140. package/packages/planbook-input/components/product-table.css +0 -236
  141. package/packages/planbook-input/index.css +0 -31
  142. package/packages/product-info/index.css +0 -264
  143. package/packages/share-sheet/index.css +0 -203
  144. package/src/components/common/common-title.css +0 -116
  145. package/src/js/request.js +0 -64
  146. package/src/style/apply.css +0 -25
  147. package/src/style/base.css +0 -36
  148. package/src/style/color.css +0 -74
package/lib/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vant/lib/dialog/index.css'), require('vant/lib/dialog'), require('vant/lib/toast/index.css'), require('vant/lib/toast'), require('vant/lib/index.css'), require('vant/lib'), require('vue'), require('lodash'), require('qs'), require('vant/lib/icon/index.css'), require('vant/lib/icon'), require('lodash/cloneDeep'), require('axios'), require('md5'), require('crypto-js'), require('vant/lib/button/index.css'), require('vant/lib/button'), require('vant/lib/radio/index.css'), require('vant/lib/radio'), require('vant/lib/radio-group/index.css'), require('vant/lib/radio-group'), require('vant/lib/popup/index.css'), require('vant/lib/popup')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'vant/lib/dialog/index.css', 'vant/lib/dialog', 'vant/lib/toast/index.css', 'vant/lib/toast', 'vant/lib/index.css', 'vant/lib', 'vue', 'lodash', 'qs', 'vant/lib/icon/index.css', 'vant/lib/icon', 'lodash/cloneDeep', 'axios', 'md5', 'crypto-js', 'vant/lib/button/index.css', 'vant/lib/button', 'vant/lib/radio/index.css', 'vant/lib/radio', 'vant/lib/radio-group/index.css', 'vant/lib/radio-group', 'vant/lib/popup/index.css', 'vant/lib/popup'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.BXT = {}, null, global._Dialog, null, global._Toast, null, global._Vant, global.Vue, global._, global.QS, null, global._Icon, global.cloneDeep, global.axios, global.md5, global.CryptoJS, null, global._Button, null, global._Radio, null, global._RadioGroup, null, global._Popup));
5
- })(this, (function (exports, index_css, _Dialog, index_css$1, _Toast, index_css$2, _Vant, Vue, lodash, QS, index_css$3, _Icon, cloneDeep, axios, MD5, CryptoJS, index_css$4, _Button, index_css$5, _Radio, index_css$6, _RadioGroup, index_css$7, _Popup) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vant/lib/dialog/index.css'), require('vant/lib/dialog'), require('vant/lib/toast/index.css'), require('vant/lib/toast'), require('vant/lib/index.css'), require('vant/lib'), require('vue'), require('lodash'), require('qs'), require('vant/lib/icon/index.css'), require('vant/lib/icon'), require('lodash/cloneDeep'), require('md5'), require('crypto-js'), require('vant/lib/button/index.css'), require('vant/lib/button'), require('vant/lib/radio/index.css'), require('vant/lib/radio'), require('vant/lib/radio-group/index.css'), require('vant/lib/radio-group'), require('vant/lib/popup/index.css'), require('vant/lib/popup')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'vant/lib/dialog/index.css', 'vant/lib/dialog', 'vant/lib/toast/index.css', 'vant/lib/toast', 'vant/lib/index.css', 'vant/lib', 'vue', 'lodash', 'qs', 'vant/lib/icon/index.css', 'vant/lib/icon', 'lodash/cloneDeep', 'md5', 'crypto-js', 'vant/lib/button/index.css', 'vant/lib/button', 'vant/lib/radio/index.css', 'vant/lib/radio', 'vant/lib/radio-group/index.css', 'vant/lib/radio-group', 'vant/lib/popup/index.css', 'vant/lib/popup'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.BXT = {}, null, global._Dialog, null, global._Toast, null, global._Vant, global.Vue, global._, global.QS, null, global._Icon, global.cloneDeep, global.md5, global.CryptoJS, null, global._Button, null, global._Radio, null, global._RadioGroup, null, global._Popup));
5
+ })(this, (function (exports, index_css, _Dialog, index_css$1, _Toast, index_css$2, _Vant, Vue, lodash, QS, index_css$3, _Icon, cloneDeep, MD5, CryptoJS, index_css$4, _Button, index_css$5, _Radio, index_css$6, _RadioGroup, index_css$7, _Popup) { 'use strict';
6
6
 
7
7
  function _typeof$2(o) {
8
8
  "@babel/helpers - typeof";
@@ -8463,12 +8463,27 @@
8463
8463
  var Jax = /*@__PURE__*/getDefaultExportFromCjs(jaxExports);
8464
8464
 
8465
8465
  var getStandardOrigin = Jax.urlUtil.getStandardOrigin;
8466
+ var _Jax$parseUaString = Jax.parseUaString();
8467
+ _Jax$parseUaString.isApp;
8468
+ _Jax$parseUaString.appType;
8469
+ var appVersion = _Jax$parseUaString.appVersion;
8470
+ _Jax$parseUaString.isAndroid;
8471
+ var isIos$2 = _Jax$parseUaString.isIos;
8472
+ _Jax$parseUaString.isBxsApp;
8473
+ _Jax$parseUaString.isBaoXiaoZhuApp;
8474
+ _Jax$parseUaString.isBrokerApp;
8475
+ _Jax$parseUaString.isYjjApp;
8476
+ _Jax$parseUaString.isToBApp;
8477
+ _Jax$parseUaString.isRongYiBaoApp;
8478
+ _Jax$parseUaString.isWeChat;
8479
+ _Jax$parseUaString.appScheme;
8466
8480
  var hostname = window && window.location && window.location.hostname || '';
8467
8481
  /** 当前页 host 为 cppoc- 前缀时,请求 loading 使用 Vant Toast,否则走 appBridge */
8468
8482
  var IS_CPPOC_HOST = hostname.startsWith('cppoc-');
8469
8483
  var IS_PRODUCT_ENV = hostname.search(/(winbaoxian|ai-baoxiaozhu)\.com/) !== -1;
8470
8484
  hostname.search(/(winbaoxian|ai-baoxiaozhu)\.cn/) !== -1;
8471
8485
  var IS_LOCALHOST_ENV = hostname.search(/localhost|192\.168|127\.0\.0\.1|dev\.winbaoxian\.cn/) !== -1;
8486
+ var IS_LOCALHOST_IP_ENV = hostname.search(/192\.168/) !== -1;
8472
8487
  var IS_UAT_ENV = hostname.includes("pbf-uat.");
8473
8488
  var IS_ENABLE_DEBUG = !IS_PRODUCT_ENV;
8474
8489
  if (IS_ENABLE_DEBUG) {
@@ -8476,6 +8491,9 @@
8476
8491
  }
8477
8492
  hostname.includes('ai-baoxiaozhu') ? 'ai-baoxiaozhu' : 'winbaoxian';
8478
8493
  function getFullOrigin(data) {
8494
+ if (IS_LOCALHOST_IP_ENV) {
8495
+ return "https://".concat(data, ".winbaoxian.cn");
8496
+ }
8479
8497
  var _prefixDomain = IS_CPPOC_HOST ? 'cppoc-' : '';
8480
8498
  if (typeof data === 'string') {
8481
8499
  return getStandardOrigin("".concat(_prefixDomain).concat(data));
@@ -8491,6 +8509,8 @@
8491
8509
  var APP_HOSTNAME = getFullOrigin('app');
8492
8510
  getFullOrigin('pbf');
8493
8511
  var PLANBOOK_API_HOSTNAME = getFullOrigin("bxs-planbook-api".concat(IS_UAT_ENV ? '-uat' : ''));
8512
+ /** 险种试算等 trade 接口(insurance2a-api) */
8513
+ var INSURANCE2A_API_HOSTNAME = "https://insurance2a-api.wyins.net".concat(IS_PRODUCT_ENV ? '' : '.cn');
8494
8514
  getUrlParams();
8495
8515
  function getUrlParams(url) {
8496
8516
  var _url = location.search || '';
@@ -8516,37 +8536,253 @@
8516
8536
  }
8517
8537
  }
8518
8538
 
8519
- var apiBaseUrl = "".concat(PLANBOOK_API_HOSTNAME, "/planBook");
8539
+ function ownKeys$5(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; }
8540
+ function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), true).forEach(function (r) { _defineProperty$1(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
8541
+ var options$1 = {
8542
+ baseURL: PLANBOOK_API_HOSTNAME,
8543
+ withCredentials: true,
8544
+ timeout: 10000,
8545
+ headers: {
8546
+ 'X-Requested-With': 'XMLHttpRequest'
8547
+ }
8548
+ };
8549
+ var loadingTimer = null;
8550
+ var showRequestLoading = function showRequestLoading() {
8551
+ if (loadingTimer) {
8552
+ clearTimeout(loadingTimer);
8553
+ }
8554
+ loadingTimer = setTimeout(function () {
8555
+ showLoading();
8556
+ }, 300);
8557
+ };
8558
+ var hideRequestLoading = function hideRequestLoading() {
8559
+ if (loadingTimer) {
8560
+ hideLoading();
8561
+ }
8562
+ if (loadingTimer) {
8563
+ clearTimeout(loadingTimer);
8564
+ }
8565
+ };
8566
+ var normalizeMethod = function normalizeMethod(method) {
8567
+ return (method || 'get').toUpperCase();
8568
+ };
8569
+ var serializeParams = function serializeParams(params) {
8570
+ if (!params) {
8571
+ return '';
8572
+ }
8573
+ var queryParts = [];
8574
+ Object.keys(params).forEach(function (key) {
8575
+ var value = params[key];
8576
+ if (value === undefined || value === null) {
8577
+ return;
8578
+ }
8579
+ if (Array.isArray(value)) {
8580
+ value.forEach(function (item) {
8581
+ queryParts.push("".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(item)));
8582
+ });
8583
+ return;
8584
+ }
8585
+ queryParts.push("".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(value)));
8586
+ });
8587
+ return queryParts.join('&');
8588
+ };
8589
+ var isAbsoluteUrl = function isAbsoluteUrl(url) {
8590
+ return /^https?:\/\//.test(url);
8591
+ };
8592
+ var buildUrl = function buildUrl(baseURL, url, params) {
8593
+ var queryString = serializeParams(params);
8594
+ var requestUrl = isAbsoluteUrl(url) ? url : "".concat(baseURL).concat(url);
8595
+ if (!queryString) {
8596
+ return requestUrl;
8597
+ }
8598
+ return "".concat(requestUrl).concat(requestUrl.includes('?') ? '&' : '?').concat(queryString);
8599
+ };
8600
+ var isPlainObject = function isPlainObject(value) {
8601
+ return Object.prototype.toString.call(value) === '[object Object]';
8602
+ };
8603
+ var buildBody = function buildBody(data, headers) {
8604
+ if (data === undefined || data === null) {
8605
+ return undefined;
8606
+ }
8607
+ if (data instanceof FormData || data instanceof Blob || typeof data === 'string') {
8608
+ return data;
8609
+ }
8610
+ if (isPlainObject(data) || Array.isArray(data)) {
8611
+ if (!headers['Content-Type']) {
8612
+ headers['Content-Type'] = 'application/json';
8613
+ }
8614
+ return JSON.stringify(data);
8615
+ }
8616
+ return data;
8617
+ };
8618
+ var parseResponse = /*#__PURE__*/function () {
8619
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(response) {
8620
+ var contentType, text;
8621
+ return _regeneratorRuntime.wrap(function (_context) {
8622
+ while (1) switch (_context.prev = _context.next) {
8623
+ case 0:
8624
+ contentType = response.headers.get('content-type') || '';
8625
+ if (!contentType.includes('application/json')) {
8626
+ _context.next = 1;
8627
+ break;
8628
+ }
8629
+ return _context.abrupt("return", response.json());
8630
+ case 1:
8631
+ _context.next = 2;
8632
+ return response.text();
8633
+ case 2:
8634
+ text = _context.sent;
8635
+ if (text) {
8636
+ _context.next = 3;
8637
+ break;
8638
+ }
8639
+ return _context.abrupt("return", {});
8640
+ case 3:
8641
+ _context.prev = 3;
8642
+ return _context.abrupt("return", JSON.parse(text));
8643
+ case 4:
8644
+ _context.prev = 4;
8645
+ _context["catch"](3);
8646
+ return _context.abrupt("return", {
8647
+ data: text
8648
+ });
8649
+ case 5:
8650
+ case "end":
8651
+ return _context.stop();
8652
+ }
8653
+ }, _callee, null, [[3, 4]]);
8654
+ }));
8655
+ return function parseResponse(_x) {
8656
+ return _ref.apply(this, arguments);
8657
+ };
8658
+ }();
8659
+ var createTimeoutError = function createTimeoutError(timeout) {
8660
+ var error = new Error("timeout of ".concat(timeout, "ms exceeded"));
8661
+ error.name = 'TimeoutError';
8662
+ return error;
8663
+ };
8664
+ var request = /*#__PURE__*/function () {
8665
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(config) {
8666
+ 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;
8667
+ return _regeneratorRuntime.wrap(function (_context2) {
8668
+ while (1) switch (_context2.prev = _context2.next) {
8669
+ case 0:
8670
+ url = config.url, _config$baseURL = config.baseURL, baseURL = _config$baseURL === void 0 ? options$1.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$1.timeout : _config$timeout, _config$withCredentia = config.withCredentials, withCredentials = _config$withCredentia === void 0 ? options$1.withCredentials : _config$withCredentia, returnFullResponse = config.returnFullResponse;
8671
+ if (!isIgnoreLoading) {
8672
+ showRequestLoading();
8673
+ }
8674
+ requestHeaders = _objectSpread$4(_objectSpread$4({}, options$1.headers), headers);
8675
+ timeoutId = null;
8676
+ _context2.prev = 1;
8677
+ fetchPromise = fetch(buildUrl(baseURL, url, params), {
8678
+ method: normalizeMethod(method),
8679
+ headers: requestHeaders,
8680
+ body: normalizeMethod(method) === 'GET' ? undefined : buildBody(data, requestHeaders),
8681
+ credentials: withCredentials ? 'include' : 'same-origin'
8682
+ });
8683
+ _context2.next = 2;
8684
+ return Promise.race([fetchPromise, new Promise(function (resolve, reject) {
8685
+ timeoutId = setTimeout(function () {
8686
+ reject(createTimeoutError(timeout));
8687
+ }, timeout);
8688
+ })]);
8689
+ case 2:
8690
+ response = _context2.sent;
8691
+ _context2.next = 3;
8692
+ return parseResponse(response);
8693
+ case 3:
8694
+ res = _context2.sent;
8695
+ if (response.ok) {
8696
+ _context2.next = 4;
8697
+ break;
8698
+ }
8699
+ error = new Error("Request failed with status code ".concat(response.status));
8700
+ error.response = {
8701
+ status: response.status,
8702
+ data: res
8703
+ };
8704
+ throw error;
8705
+ case 4:
8706
+ code = res.code;
8707
+ if (!['002012', '002013', '002015'].includes(code)) {
8708
+ _context2.next = 5;
8709
+ break;
8710
+ }
8711
+ messageMap = {
8712
+ m002012: '当前账号因操作频繁被限制,请明天再试。感谢理解',
8713
+ m002013: '您的操作频率较高,已达到今日生成上限。请稍后再试或明天继续使用,感谢您的理解!',
8714
+ m002015: '您今天做了太多计划书了,休息一下,明天再来吧'
8715
+ };
8716
+ message = messageMap["m".concat(code)];
8717
+ if (message) {
8718
+ _Dialog.alert({
8719
+ message: message,
8720
+ confirmButtonText: '知道了',
8721
+ confirmButtonColor: '#0A64FE'
8722
+ });
8723
+ }
8724
+ return _context2.abrupt("return", Promise.reject({
8725
+ code: code,
8726
+ message: message
8727
+ }));
8728
+ case 5:
8729
+ if (!(code === 401 || res.status === 401)) {
8730
+ _context2.next = 6;
8731
+ break;
8732
+ }
8733
+ gotoLogin();
8734
+ return _context2.abrupt("return", Promise.reject('status: 401'));
8735
+ case 6:
8736
+ if (!(res.success && res.data === -1)) {
8737
+ _context2.next = 7;
8738
+ break;
8739
+ }
8740
+ gotoLogin();
8741
+ return _context2.abrupt("return", Promise.reject('login: -1'));
8742
+ case 7:
8743
+ return _context2.abrupt("return", returnFullResponse ? res : res.data);
8744
+ case 8:
8745
+ _context2.prev = 8;
8746
+ _t2 = _context2["catch"](1);
8747
+ if (_t2.response && _t2.response.status == 401) {
8748
+ gotoLogin();
8749
+ }
8750
+ return _context2.abrupt("return", Promise.reject(_t2));
8751
+ case 9:
8752
+ _context2.prev = 9;
8753
+ if (timeoutId) {
8754
+ clearTimeout(timeoutId);
8755
+ }
8756
+ hideRequestLoading();
8757
+ return _context2.finish(9);
8758
+ case 10:
8759
+ case "end":
8760
+ return _context2.stop();
8761
+ }
8762
+ }, _callee2, null, [[1, 8, 9, 10]]);
8763
+ }));
8764
+ return function request(_x2) {
8765
+ return _ref2.apply(this, arguments);
8766
+ };
8767
+ }();
8768
+
8520
8769
  function initInsuranceInterest(reqParams) {
8521
8770
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
8522
8771
  var scene = options.scene;
8523
8772
  var apis = {
8524
- init: "".concat(apiBaseUrl, "/interest/init"),
8525
- init4: "".concat(apiBaseUrl, "/public/interest/product/init"),
8526
- init5: "".concat(apiBaseUrl, "/insurance/compare/draw/init")
8773
+ init: '/planBook/interest/init',
8774
+ init4: '/planBook/public/interest/product/init',
8775
+ init5: '/planBook/insurance/compare/draw/init'
8527
8776
  };
8528
8777
  var api = apis["init".concat([4, 5].includes(scene) ? scene : '')];
8529
- showLoading();
8530
- return fetch(api, {
8531
- method: 'POST',
8532
- credentials: 'include',
8778
+ return request({
8779
+ url: api,
8780
+ method: 'post',
8781
+ data: reqParams,
8533
8782
  headers: {
8534
8783
  Accept: 'application/json, text/plain, */*',
8535
8784
  'Content-Type': 'application/json;'
8536
- },
8537
- body: JSON.stringify(reqParams)
8538
- }).then(function (response) {
8539
- return response.json();
8540
- }).then(function (_ref) {
8541
- var success = _ref.success,
8542
- data = _ref.data,
8543
- info = _ref.info;
8544
- if (!success || !data) {
8545
- return Promise.reject(info);
8546
- }
8547
- return Promise.resolve(data);
8548
- }).finally(function () {
8549
- hideLoading();
8785
+ }
8550
8786
  });
8551
8787
  }
8552
8788
  function getInsuranceInterestDetail(reqParams) {
@@ -8554,35 +8790,23 @@
8554
8790
  var scene = options.scene,
8555
8791
  isReduceBaof = options.isReduceBaof;
8556
8792
  var apis = {
8557
- addAndTake: "".concat(apiBaseUrl, "/interest/addAndTake/detail"),
8558
- addAndTake4: "".concat(apiBaseUrl, "/public/interest/addAndTake/detail"),
8559
- addAndTake5: "".concat(apiBaseUrl, "/interest/addAndTake/detail"),
8560
- draw: "".concat(apiBaseUrl, "/interest/draw/detail"),
8561
- draw4: "".concat(apiBaseUrl, "/public/interest/draw/detail"),
8562
- draw5: "".concat(apiBaseUrl, "/insurance/compare/draw/detail")
8793
+ addAndTake: '/planBook/interest/addAndTake/detail',
8794
+ addAndTake4: '/planBook/public/interest/addAndTake/detail',
8795
+ addAndTake5: '/planBook/interest/addAndTake/detail',
8796
+ draw: '/planBook/interest/draw/detail',
8797
+ draw4: '/planBook/public/interest/draw/detail',
8798
+ draw5: '/planBook/insurance/compare/draw/detail'
8563
8799
  };
8564
- var _type = isReduceBaof ? 'draw' : 'addAndTake';
8565
- var api = apis["".concat(_type).concat([4, 5].includes(scene) ? scene : '')];
8566
- showLoading();
8567
- return fetch(api, {
8568
- method: 'POST',
8569
- credentials: 'include',
8800
+ var type = isReduceBaof ? 'draw' : 'addAndTake';
8801
+ var api = apis["".concat(type).concat([4, 5].includes(scene) ? scene : '')];
8802
+ return request({
8803
+ url: api,
8804
+ method: 'post',
8805
+ data: reqParams,
8570
8806
  headers: {
8571
8807
  Accept: 'application/json, text/plain, */*',
8572
8808
  'Content-Type': 'application/json;'
8573
- },
8574
- body: JSON.stringify(reqParams)
8575
- }).then(function (response) {
8576
- return response.json();
8577
- }).then(function (res) {
8578
- var success = res.success,
8579
- data = res.data;
8580
- if (!success || !data) {
8581
- return Promise.reject(res);
8582
- }
8583
- return Promise.resolve(data);
8584
- }).finally(function () {
8585
- hideLoading();
8809
+ }
8586
8810
  });
8587
8811
  }
8588
8812
 
@@ -8783,45 +9007,6 @@
8783
9007
  return value >= 10000 && !(value % 10000) ? "".concat(value / 10000, "\u4E07") : value;
8784
9008
  }
8785
9009
 
8786
- /**
8787
- * **对象的深拷贝**
8788
- * @ignore
8789
- * @author Lizhao <lz@winbaoxian.com>
8790
- * @date 2022-04-25
8791
- * @param {object} obj - 必传
8792
- * @param {WeakMap} hash - 可不传
8793
- * @returns {object} 拷贝对象
8794
- */
8795
- function deepCopy(obj) {
8796
- var hash = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new WeakMap();
8797
- if (!obj || _typeof$2(obj) !== 'object') {
8798
- return obj;
8799
- }
8800
- if (hash.has(obj)) {
8801
- return hash.get(obj);
8802
- }
8803
- var newObj;
8804
- var Constructor = obj.constructor;
8805
- switch (Constructor) {
8806
- case RegExp:
8807
- newObj = new Constructor(obj);
8808
- break;
8809
- case Date:
8810
- newObj = new Constructor(obj.getTime());
8811
- break;
8812
- default:
8813
- newObj = new Constructor();
8814
- break;
8815
- }
8816
- hash.set(obj, newObj);
8817
- for (var key in obj) {
8818
- if (obj.hasOwnProperty(key)) {
8819
- newObj[key] = _typeof$2(obj[key]) === 'object' ? deepCopy(obj[key], hash) : obj[key];
8820
- }
8821
- }
8822
- return newObj;
8823
- }
8824
-
8825
9010
  /**
8826
9011
  * **根据生日算年龄**
8827
9012
  * @author Lizhao <lz@winbaoxian.com>
@@ -8907,6 +9092,9 @@
8907
9092
  }
8908
9093
  function getExpressionParamMap(personData, product, ins, options) {
8909
9094
  var map = {
9095
+ user: {},
9096
+ executeSource: null,
9097
+ // 执行:init-初始化 import-导入数据 userAction-用户操作 confirm-确认
8910
9098
  planbookId: null,
8911
9099
  // 计划书id
8912
9100
  productId: null,
@@ -8980,12 +9168,18 @@
8980
9168
  }
8981
9169
  }
8982
9170
  if (options) {
9171
+ if (options.user) {
9172
+ map.user = options.user;
9173
+ }
8983
9174
  if (options.planbookId) {
8984
9175
  map.planbookId = options.planbookId;
8985
9176
  }
8986
9177
  if (options.eventTarget) {
8987
9178
  map.t = options.eventTarget;
8988
9179
  }
9180
+ if (options.executeSource) {
9181
+ map.executeSource = options.executeSource;
9182
+ }
8989
9183
  }
8990
9184
  if (ins && ins.customVariableExp) {
8991
9185
  var exp = ins.customVariableExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'map.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'map.$2');
@@ -9111,6 +9305,15 @@
9111
9305
  if (!person || !person.eleOrderList) {
9112
9306
  return;
9113
9307
  }
9308
+
9309
+ // 投保人年龄默认范围调整到「16-99岁」。From hyw
9310
+ if (person.key === 'applicantInfo') {
9311
+ person.eleOrderList.forEach(function (ele) {
9312
+ if (ele.key === 'age') {
9313
+ ele.opts = [16, 99];
9314
+ }
9315
+ });
9316
+ }
9114
9317
  person.createArchive = person.createArchive || false;
9115
9318
  person.cid = person.cid || null;
9116
9319
  if (!person.eleOrderList.find(function (e) {
@@ -9123,7 +9326,7 @@
9123
9326
  placeholder: '请输入姓名',
9124
9327
  componentName: 'cmCommonInput',
9125
9328
  maxlength: 16,
9126
- isHide: false
9329
+ isHide: true
9127
9330
  });
9128
9331
  }
9129
9332
  // 投保人添加元素:投被保人是同一人
@@ -9236,7 +9439,7 @@
9236
9439
  }
9237
9440
  case 'age':
9238
9441
  {
9239
- e.label = '年龄';
9442
+ e.label = '投保时年龄';
9240
9443
  e.componentName = 'cmAgeBirthday';
9241
9444
  e.placeholder = '请选择年龄';
9242
9445
  e.options = [];
@@ -9496,6 +9699,30 @@
9496
9699
  }
9497
9700
  }
9498
9701
 
9702
+ function getPlanbookRecommendData(params) {
9703
+ return request({
9704
+ url: '/planBook/input/calculate/recommend',
9705
+ method: 'post',
9706
+ data: params,
9707
+ headers: {
9708
+ Accept: 'application/json, text/plain, */*',
9709
+ 'Content-Type': 'application/json;'
9710
+ }
9711
+ });
9712
+ }
9713
+ function getPlanbookInsuranceVerifyData(params) {
9714
+ return request({
9715
+ baseURL: APP_HOSTNAME,
9716
+ url: '/planBook/input/insurance/verifyData',
9717
+ method: 'post',
9718
+ data: params,
9719
+ headers: {
9720
+ Accept: 'application/json, text/plain, */*',
9721
+ 'Content-Type': 'application/json;'
9722
+ }
9723
+ });
9724
+ }
9725
+
9499
9726
  function _arrayLikeToArray$1(r, a) {
9500
9727
  (null == a || a > r.length) && (a = r.length);
9501
9728
  for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
@@ -9563,8 +9790,8 @@
9563
9790
  return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray$1(r, e) || _nonIterableRest();
9564
9791
  }
9565
9792
 
9566
- function ownKeys$5(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; }
9567
- function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), true).forEach(function (r) { _defineProperty$1(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
9793
+ function ownKeys$4(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; }
9794
+ function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), true).forEach(function (r) { _defineProperty$1(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
9568
9795
 
9569
9796
  /**
9570
9797
  * **初始化险种数据**
@@ -9642,7 +9869,7 @@
9642
9869
  }
9643
9870
  if (e.opts && e.opts.length) {
9644
9871
  e.opts = e.opts.map(function (o) {
9645
- return _objectSpread$4(_objectSpread$4({}, o), {}, {
9872
+ return _objectSpread$3(_objectSpread$3({}, o), {}, {
9646
9873
  desc: o.desc || o.val,
9647
9874
  isHide: o.isHide || null,
9648
9875
  isDisabled: o.isDisabled || null,
@@ -9650,6 +9877,26 @@
9650
9877
  });
9651
9878
  });
9652
9879
  }
9880
+ if (e.componentName === 'cmCommonInput') {
9881
+ // 输入框,默认打开普通键盘。From hyw
9882
+ if (!e.inputType) {
9883
+ e.inputType = 'text';
9884
+ }
9885
+ if (['baoe', 'baof', 'payModePremium', 'num'].includes(e.key)) {
9886
+ // 输入框,默认2位小数。From hyw
9887
+ if (!e.regExp) {
9888
+ e.regExp = '/^\\d{1,9}(\\.\\d{1,2})?$/';
9889
+ e.regExpMessage = '请输入最多9位整数和最多2位小数';
9890
+ e.maxlength = 12;
9891
+ e.inputType = 'decimal';
9892
+ }
9893
+ // 输入框,整数值,使用数字键盘。From hyw
9894
+ if (e.regExp === '/^\\d{1,}$/') {
9895
+ e.maxlength = 9;
9896
+ e.inputType = 'tel';
9897
+ }
9898
+ }
9899
+ }
9653
9900
  });
9654
9901
  }
9655
9902
 
@@ -9872,7 +10119,7 @@
9872
10119
  var insuranceInfo = convertEleOrderListToObj(insData);
9873
10120
  var insVerifyData;
9874
10121
  if (insuredInfo) {
9875
- insVerifyData = _objectSpread$4({
10122
+ insVerifyData = _objectSpread$3({
9876
10123
  sex: insuredInfo.sex,
9877
10124
  age: insuredInfo.age
9878
10125
  }, insuranceInfo);
@@ -9930,8 +10177,8 @@
9930
10177
  return errorMsg;
9931
10178
  }
9932
10179
 
9933
- function ownKeys$4(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; }
9934
- function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), true).forEach(function (r) { _defineProperty$1(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
10180
+ function ownKeys$3(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; }
10181
+ function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), true).forEach(function (r) { _defineProperty$1(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
9935
10182
 
9936
10183
  /**
9937
10184
  * **初始化产品数据(单个)**
@@ -9958,6 +10205,7 @@
9958
10205
  prodData.mulInsOrderList.forEach(function (ins) {
9959
10206
  initInsuranceData(ins);
9960
10207
  });
10208
+ setCommonInfo(prodData);
9961
10209
  return prodData;
9962
10210
  }
9963
10211
 
@@ -9991,36 +10239,22 @@
9991
10239
  */
9992
10240
  function _productDataHandler() {
9993
10241
  _productDataHandler = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(prodData, prodVerifyData, personData, parmas) {
9994
- var productVerifyData, _parmas$eventTarget, insuranceKey, elementKey, groupInsurance, groupInsuranceIdEle, subInsurances, hasProduct, hasVerifyData, hasPersonData, personOrderList, _prodData$mulInsOrder3;
10242
+ var _ref4, eventTarget, productVerifyData, insuranceKey, elementKey, groupInsurance, groupInsuranceIdEle, subInsurances, hasProduct, hasVerifyData, hasPersonData, personOrderList, _prodData$mulInsOrder3;
9995
10243
  return _regeneratorRuntime.wrap(function (_context) {
9996
10244
  while (1) switch (_context.prev = _context.next) {
9997
10245
  case 0:
9998
- if (prodData) {
9999
- _context.next = 1;
10246
+ if (!prodData) {
10247
+ _context.next = 2;
10000
10248
  break;
10001
10249
  }
10002
- return _context.abrupt("return", prodData);
10250
+ _ref4 = parmas || {}, eventTarget = _ref4.eventTarget;
10251
+ _context.next = 1;
10252
+ return getSingleInsurancesVerifyData(prodVerifyData, prodData, personData, parmas).catch(function () {});
10003
10253
  case 1:
10004
- productVerifyData = null;
10005
- if (prodData.multipleInsured) {
10006
- multipleInsuredHandler(personData);
10007
- }
10008
- if (!(prodData.feeValidateMode === 'single' || prodVerifyData && prodVerifyData.feeValidateMode === 'single')) {
10009
- _context.next = 3;
10010
- break;
10011
- }
10012
- _context.next = 2;
10013
- return getSingleInsurancesVerifyData(prodData, personData, parmas).catch(function () {});
10014
- case 2:
10015
10254
  productVerifyData = _context.sent;
10016
- _context.next = 4;
10017
- break;
10018
- case 3:
10019
- productVerifyData = prodVerifyData;
10020
- case 4:
10021
10255
  // 组合险种特殊处理:当用户点击组合险种的子险种选项时,将其他子险种的标题设置为未选中状态
10022
- if (parmas && parmas.eventTarget) {
10023
- _parmas$eventTarget = parmas.eventTarget, insuranceKey = _parmas$eventTarget.insuranceKey, elementKey = _parmas$eventTarget.elementKey;
10256
+ if (eventTarget) {
10257
+ insuranceKey = eventTarget.insuranceKey, elementKey = eventTarget.elementKey;
10024
10258
  if (insuranceKey && elementKey === 'insuranceId') {
10025
10259
  groupInsurance = (prodData.mulInsOrderList || []).find(function (ins) {
10026
10260
  return ins.key === insuranceKey;
@@ -10049,7 +10283,6 @@
10049
10283
  personOrderList = convertPersonData(personData, personData.personOrderList.map(function (p) {
10050
10284
  return p.key;
10051
10285
  }));
10052
- setCommonInfo(prodData);
10053
10286
  (_prodData$mulInsOrder3 = prodData.mulInsOrderList) === null || _prodData$mulInsOrder3 === void 0 || _prodData$mulInsOrder3.forEach(function (ins, ii, insList) {
10054
10287
  var _ins$eleOrderList;
10055
10288
  insuranceDataHandler(ins, prodData);
@@ -10283,8 +10516,9 @@
10283
10516
  }
10284
10517
  setGroupInsurance(prodData);
10285
10518
  isHideProduct(prodData, productVerifyData, personOrderList);
10519
+ case 2:
10286
10520
  return _context.abrupt("return", prodData);
10287
- case 5:
10521
+ case 3:
10288
10522
  case "end":
10289
10523
  return _context.stop();
10290
10524
  }
@@ -10292,32 +10526,34 @@
10292
10526
  }));
10293
10527
  return _productDataHandler.apply(this, arguments);
10294
10528
  }
10295
- function multipleInsuredHandler(personData) {
10296
- var personOrderList = personData.personOrderList;
10297
- if (!(personOrderList && personOrderList.length)) {
10298
- return null;
10299
- }
10300
- var insured2Info = personOrderList.find(function (p) {
10301
- return p.key === 'insured2Info';
10302
- });
10303
- if (!insured2Info) {
10304
- var insuredInfo = personOrderList.find(function (p) {
10305
- return p.key === 'insuredInfo';
10306
- });
10307
- var insuredIndex = personOrderList.findIndex(function (p) {
10308
- return p.key === 'insuredInfo';
10529
+ function multipleInsuredHandler(prodData, personData) {
10530
+ if (prodData && prodData.multipleInsured) {
10531
+ var personOrderList = personData.personOrderList;
10532
+ if (!(personOrderList && personOrderList.length)) {
10533
+ return null;
10534
+ }
10535
+ var insured2Info = personOrderList.find(function (p) {
10536
+ return p.key === 'insured2Info';
10309
10537
  });
10310
- if (insuredIndex >= 0) {
10311
- var person = lodash.cloneDeep(insuredInfo);
10312
- person.key = 'insured2Info';
10313
- person.eleOrderList.forEach(function (e) {
10314
- if (e.key === 'title') {
10315
- e.isDisabled = false;
10316
- e.value = true;
10317
- e.label = '第二被保人信息';
10318
- }
10538
+ if (!insured2Info) {
10539
+ var insuredInfo = personOrderList.find(function (p) {
10540
+ return p.key === 'insuredInfo';
10541
+ });
10542
+ var insuredIndex = personOrderList.findIndex(function (p) {
10543
+ return p.key === 'insuredInfo';
10319
10544
  });
10320
- personOrderList.splice(insuredIndex + 1, 0, person);
10545
+ if (insuredIndex >= 0) {
10546
+ var person = lodash.cloneDeep(insuredInfo);
10547
+ person.key = 'insured2Info';
10548
+ person.eleOrderList.forEach(function (e) {
10549
+ if (e.key === 'title') {
10550
+ e.isDisabled = false;
10551
+ e.value = true;
10552
+ e.label = '第二被保人信息';
10553
+ }
10554
+ });
10555
+ personOrderList.splice(insuredIndex + 1, 0, person);
10556
+ }
10321
10557
  }
10322
10558
  }
10323
10559
  return personData;
@@ -10332,63 +10568,67 @@
10332
10568
  * @param {IPbPersons} personData 必传。人员信息,包括被保人、投保人、投保人配偶
10333
10569
  * @returns 请求函数的 Promise
10334
10570
  */
10335
- function getSingleInsurancesVerifyData(prodData, personData) {
10336
- var _prodData$mulInsOrder, _prodData$mulInsOrder2;
10337
- var parmas = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
10338
- var personOrderList = personData.personOrderList;
10339
- if (!(personOrderList && personOrderList.length)) {
10340
- return null;
10341
- }
10342
- var pbId = prodData.isTemp || prodData.policyType === 'single_insurance' ? null : parmas.planbookId;
10343
- var productId = prodData.policyType === 'single_insurance' ? null : prodData.key;
10344
- // 险种对比,prodData 没有 feeValidateMode 字段。因此需要特殊处理。
10345
- // 险种对比,以险种为维度,其 prodData.key 就是险种id,不能当成正常产品id。因此需要特殊处理。
10346
- if (prodData.feeValidateMode !== 'single') {
10347
- productId = null;
10348
- }
10349
- var insuredList = personOrderList.filter(function (p) {
10350
- return ['insuredInfo', 'insured2Info'].includes(p.key);
10351
- }).filter(function (p) {
10352
- var _p$eleOrderList;
10353
- var title = (_p$eleOrderList = p.eleOrderList) === null || _p$eleOrderList === void 0 ? void 0 : _p$eleOrderList.find(function (e) {
10354
- return e.key === 'title';
10571
+ function getSingleInsurancesVerifyData(verifyData, prodData, personData) {
10572
+ var parmas = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
10573
+ var isSingleFeeValidateMode = prodData && prodData.feeValidateMode === 'single' || verifyData && verifyData.feeValidateMode === 'single';
10574
+ if (isSingleFeeValidateMode) {
10575
+ var _prodData$mulInsOrder, _prodData$mulInsOrder2;
10576
+ var personOrderList = personData.personOrderList;
10577
+ if (!(personOrderList && personOrderList.length)) {
10578
+ return null;
10579
+ }
10580
+ var pbId = prodData.isTemp || prodData.policyType === 'single_insurance' ? null : parmas.planbookId;
10581
+ var productId = prodData.policyType === 'single_insurance' ? null : prodData.key;
10582
+ // 险种对比,prodData 没有 feeValidateMode 字段。因此需要特殊处理。
10583
+ // 险种对比,以险种为维度,其 prodData.key 就是险种id,不能当成正常产品id。因此需要特殊处理。
10584
+ if (prodData.feeValidateMode !== 'single') {
10585
+ productId = null;
10586
+ }
10587
+ var insuredList = personOrderList.filter(function (p) {
10588
+ return ['insuredInfo', 'insured2Info'].includes(p.key);
10589
+ }).filter(function (p) {
10590
+ var _p$eleOrderList;
10591
+ var title = (_p$eleOrderList = p.eleOrderList) === null || _p$eleOrderList === void 0 ? void 0 : _p$eleOrderList.find(function (e) {
10592
+ return e.key === 'title';
10593
+ });
10594
+ return title && title.value || p.title;
10595
+ }).map(function (p) {
10596
+ var person = convertEleOrderListToObj(p);
10597
+ return {
10598
+ key: person.key,
10599
+ sex: person.sex,
10600
+ age: person.age
10601
+ };
10602
+ });
10603
+ var applicant = null;
10604
+ var applicantItem = personData.personOrderList.find(function (p) {
10605
+ return p.key === 'applicantInfo';
10606
+ });
10607
+ if (applicantItem) {
10608
+ var person = convertEleOrderListToObj(applicantItem);
10609
+ applicant = {
10610
+ key: person.key,
10611
+ sex: person.sex,
10612
+ age: person.age
10613
+ };
10614
+ }
10615
+ var insuranceIdList = prodData === null || prodData === void 0 || (_prodData$mulInsOrder = prodData.mulInsOrderList) === null || _prodData$mulInsOrder === void 0 ? void 0 : _prodData$mulInsOrder.map(function (ins) {
10616
+ return ins.key;
10617
+ }).filter(function (k) {
10618
+ return !['common'].includes(k);
10619
+ });
10620
+ prodData === null || prodData === void 0 || (_prodData$mulInsOrder2 = prodData.mulInsOrderList) === null || _prodData$mulInsOrder2 === void 0 || _prodData$mulInsOrder2.reduce(function (list, ins) {
10621
+ return ins.key === 'common' || ins.isGroup ? list : list.concat(ins.key);
10622
+ }, []);
10623
+ return getAndCacheInsurancesVerifyData({
10624
+ pbId: pbId,
10625
+ productId: productId,
10626
+ insuredList: insuredList,
10627
+ applicant: applicant,
10628
+ insuranceIdList: insuranceIdList
10355
10629
  });
10356
- return title && title.value || p.title;
10357
- }).map(function (p) {
10358
- var person = convertEleOrderListToObj(p);
10359
- return {
10360
- key: person.key,
10361
- sex: person.sex,
10362
- age: person.age
10363
- };
10364
- });
10365
- var applicant = null;
10366
- var applicantItem = personData.personOrderList.find(function (p) {
10367
- return p.key === 'applicantInfo';
10368
- });
10369
- if (applicantItem) {
10370
- var person = convertEleOrderListToObj(applicantItem);
10371
- applicant = {
10372
- key: person.key,
10373
- sex: person.sex,
10374
- age: person.age
10375
- };
10376
10630
  }
10377
- var insuranceIdList = prodData === null || prodData === void 0 || (_prodData$mulInsOrder = prodData.mulInsOrderList) === null || _prodData$mulInsOrder === void 0 ? void 0 : _prodData$mulInsOrder.map(function (ins) {
10378
- return ins.key;
10379
- }).filter(function (k) {
10380
- return !['common'].includes(k);
10381
- });
10382
- prodData === null || prodData === void 0 || (_prodData$mulInsOrder2 = prodData.mulInsOrderList) === null || _prodData$mulInsOrder2 === void 0 || _prodData$mulInsOrder2.reduce(function (list, ins) {
10383
- return ins.key === 'common' || ins.isGroup ? list : list.concat(ins.key);
10384
- }, []);
10385
- return getAndCacheInsurancesVerifyData({
10386
- pbId: pbId,
10387
- productId: productId,
10388
- insuredList: insuredList,
10389
- applicant: applicant,
10390
- insuranceIdList: insuranceIdList
10391
- });
10631
+ return Promise.resolve(verifyData);
10392
10632
  }
10393
10633
 
10394
10634
  /**
@@ -10400,25 +10640,7 @@
10400
10640
  * @returns {Promise<any>} 产品下所有险种的费率
10401
10641
  */
10402
10642
  var getAndCacheInsurancesVerifyData = lodash.memoize(function (params) {
10403
- var url = "".concat(APP_HOSTNAME, "/planBook/input/insurance/verifyData");
10404
- return fetch(url, {
10405
- method: 'POST',
10406
- credentials: 'include',
10407
- headers: {
10408
- Accept: 'application/json, text/plain, */*',
10409
- 'Content-Type': 'application/json;'
10410
- },
10411
- body: JSON.stringify(params)
10412
- }).then(function (response) {
10413
- return response.json();
10414
- }).then(function (_ref) {
10415
- var success = _ref.success,
10416
- data = _ref.data;
10417
- if (!success || !data) {
10418
- return Promise.reject();
10419
- }
10420
- return Promise.resolve(data);
10421
- }).catch(function () {});
10643
+ return getPlanbookInsuranceVerifyData(params).catch(function () {});
10422
10644
  }, function (params) {
10423
10645
  return QS.stringify(params);
10424
10646
  });
@@ -10429,10 +10651,10 @@
10429
10651
  var insuranceInfo = {};
10430
10652
  insurances.forEach(function (ins) {
10431
10653
  if (['common', option.insuranceKey].includes(ins.key)) {
10432
- insuranceInfo = _objectSpread$3(_objectSpread$3({}, insuranceInfo), convertEleOrderListToObj(ins));
10654
+ insuranceInfo = _objectSpread$2(_objectSpread$2({}, insuranceInfo), convertEleOrderListToObj(ins));
10433
10655
  }
10434
10656
  });
10435
- insuranceInfo = _objectSpread$3(_objectSpread$3({}, insuranceInfo), option);
10657
+ insuranceInfo = _objectSpread$2(_objectSpread$2({}, insuranceInfo), option);
10436
10658
  var temp = verify;
10437
10659
  var hasElementKey = verify.key === option.elementKey;
10438
10660
  while (temp && temp.key && temp.key !== option.elementKey) {
@@ -10623,7 +10845,7 @@
10623
10845
  }
10624
10846
  }
10625
10847
  }
10626
- var index = mulInsOrderList.findLastIndex(function (ins) {
10848
+ var index = lodash.findLastIndex(mulInsOrderList, function (ins) {
10627
10849
  return ins.groupKey === k;
10628
10850
  });
10629
10851
  if (index >= 0) {
@@ -10645,21 +10867,21 @@
10645
10867
  * @author Lizhao <lz@winbaoxian.com>
10646
10868
  * @date 2022-04-26
10647
10869
  * @param {IPbProduct} prodData 必传。产品数据(单个)
10648
- * @param {object} productVerifyData 必传。产品限制条件(单个)
10870
+ * @param {object} prodVerifyData 必传。产品限制条件(单个)
10649
10871
  * @param {IPbPerson} personOrderList 必传。转换后的人员信息,包括被保人、投保人、投保人配偶
10650
10872
  * @returns {object} 产品数据(单个)
10651
10873
  */
10652
- function isHideProduct(prodData, productVerifyData, personOrderList) {
10874
+ function isHideProduct(prodData, prodVerifyData, personOrderList) {
10653
10875
  var ageRangeProd = {};
10654
- if (prodData && productVerifyData && Object.keys(productVerifyData).length && personOrderList) {
10876
+ if (prodData && prodVerifyData && Object.keys(prodVerifyData).length && personOrderList) {
10655
10877
  if (prodData.mulInsOrderList) {
10656
10878
  // 产品中是否有必选险种且有费率
10657
10879
  var hasRequiredIns = prodData.mulInsOrderList.some(function (ins) {
10658
- return !!ins.required && productVerifyData[ins.key];
10880
+ return !!ins.required && prodVerifyData[ins.key];
10659
10881
  });
10660
10882
  prodData.mulInsOrderList.forEach(function (ins) {
10661
10883
  // 当前险种的限制条件
10662
- var insuranceVerifyData = productVerifyData[ins.key];
10884
+ var insuranceVerifyData = prodVerifyData[ins.key];
10663
10885
  if (insuranceVerifyData) {
10664
10886
  // 产品年龄范围取各险种最大范围
10665
10887
  if ((!ins.huomian || ins.huomian == 'beiHuomian') && (!hasRequiredIns || hasRequiredIns && ins.required)) {
@@ -10671,11 +10893,11 @@
10671
10893
  }
10672
10894
  });
10673
10895
  }
10674
- var _ref2 = personOrderList.find(function (p) {
10896
+ var _ref = personOrderList.find(function (p) {
10675
10897
  return p.key === 'insuredInfo';
10676
10898
  }),
10677
- sex = _ref2.sex,
10678
- age = _ref2.age;
10899
+ sex = _ref.sex,
10900
+ age = _ref.age;
10679
10901
  if (ageRangeProd[sex] && age >= ageRangeProd[sex][0] && age <= ageRangeProd[sex][1]) {
10680
10902
  prodData.hide = false;
10681
10903
  } else {
@@ -10701,11 +10923,11 @@
10701
10923
  * @param {IInsElement} params.eleData 可不传。元素数据,当前交互的元素(如:用户修改了该险种的交费期间)
10702
10924
  * @returns {string} 校验结果。空表示校验通过
10703
10925
  */
10704
- function verifyProductRules(_ref3) {
10705
- var personData = _ref3.personData,
10706
- productData = _ref3.productData,
10707
- insData = _ref3.insData,
10708
- eleData = _ref3.eleData;
10926
+ function verifyProductRules(_ref2) {
10927
+ var personData = _ref2.personData,
10928
+ productData = _ref2.productData,
10929
+ insData = _ref2.insData,
10930
+ eleData = _ref2.eleData;
10709
10931
  var errorMsg = '';
10710
10932
  var personOrderList = convertPersonData(personData, personData.personOrderList.map(function (p) {
10711
10933
  return p.key;
@@ -10751,11 +10973,11 @@
10751
10973
  * @param {eleData} params.eleData 可不传。元素数据,当前交互的元素(如:用户修改了该险种的交费期间)
10752
10974
  * @returns {string} 校验结果。空表示校验通过
10753
10975
  */
10754
- function restrictInsurancesInProduct(_ref4) {
10755
- var personOrderList = _ref4.personOrderList,
10756
- productData = _ref4.productData,
10757
- insData = _ref4.insData,
10758
- eleData = _ref4.eleData;
10976
+ function restrictInsurancesInProduct(_ref3) {
10977
+ var personOrderList = _ref3.personOrderList,
10978
+ productData = _ref3.productData,
10979
+ insData = _ref3.insData,
10980
+ eleData = _ref3.eleData;
10759
10981
  var errorMsg = '';
10760
10982
  var restrictList = productData.restrictList;
10761
10983
  if (restrictList && restrictList.length) {
@@ -10764,16 +10986,16 @@
10764
10986
  return p.key === 'insuredInfo';
10765
10987
  });
10766
10988
  var productInfo = convertProductData(productData);
10767
- var prodVerifyData = {
10989
+ var evalVerifyMap = {
10768
10990
  age: insuredInfo.age,
10769
10991
  sex: insuredInfo.sex,
10770
10992
  common: productInfo.common
10771
10993
  };
10772
10994
  productInfo.mulInsOrderList.forEach(function (ins) {
10773
- prodVerifyData['i' + ins.key] = ins;
10995
+ evalVerifyMap['i' + ins.key] = ins;
10774
10996
  });
10775
- restrict.rCondition = restrict.rCondition.replace(/(%)(\d+)(\.*\w*)(%)/g, 'prodVerifyData.i$2$3');
10776
- restrict.rCondition = restrict.rCondition.replace(/(%)(\w*\.*\w*)(%)/g, 'prodVerifyData.$2');
10997
+ restrict.rCondition = restrict.rCondition.replace(/(%)(\d+)(\.*\w*)(%)/g, 'evalVerifyMap.i$2$3');
10998
+ restrict.rCondition = restrict.rCondition.replace(/(%)(\w*\.*\w*)(%)/g, 'evalVerifyMap.$2');
10777
10999
  var curIns = productData.mulInsOrderList.find(function (ins) {
10778
11000
  return ins.key === restrict.rInsKey;
10779
11001
  });
@@ -10823,8 +11045,8 @@
10823
11045
  var rangeSelect = eval(restrict.rCondition);
10824
11046
  if (rangeSelect !== undefined && rangeSelect !== null) {
10825
11047
  curEle.opts.forEach(function (opt) {
10826
- var optNum = getNumberFromYear(opt.val, prodVerifyData.age);
10827
- var rangeSelectNum = rangeSelect.constructor === Array ? [rangeSelect[0] && getNumberFromYear(rangeSelect[0], prodVerifyData.age), rangeSelect[1] && getNumberFromYear(rangeSelect[1], prodVerifyData.age)] : getNumberFromYear(rangeSelect, prodVerifyData.age);
11048
+ var optNum = getNumberFromYear(opt.val, evalVerifyMap.age);
11049
+ var rangeSelectNum = rangeSelect.constructor === Array ? [rangeSelect[0] && getNumberFromYear(rangeSelect[0], evalVerifyMap.age), rangeSelect[1] && getNumberFromYear(rangeSelect[1], evalVerifyMap.age)] : getNumberFromYear(rangeSelect, evalVerifyMap.age);
10828
11050
  if (rangeSelect) {
10829
11051
  if (rangeSelect.constructor === Array) {
10830
11052
  opt.isHide = rangeSelect[0] && optNum < rangeSelectNum[0] || rangeSelect[1] && optNum > rangeSelectNum[1];
@@ -10851,7 +11073,7 @@
10851
11073
  case 3:
10852
11074
  {
10853
11075
  // 全局校验、或者点击的是约束元素、或者点击的是目标元素时,触发校验
10854
- if (!insData && !eleData || restrict.rInsKey === insData.key && restrict.rEleKey === eleData.key || restrict.rCondition.search("prodVerifyData.i".concat(insData.key, ".").concat(eleData.key)) !== -1) {
11076
+ if (!insData && !eleData || restrict.rInsKey === insData.key && restrict.rEleKey === eleData.key || restrict.rCondition.search("evalVerifyMap.i".concat(insData.key, ".").concat(eleData.key)) !== -1) {
10855
11077
  var rangeVal = eval(restrict.rCondition);
10856
11078
  if (rangeVal !== undefined && rangeVal !== null) {
10857
11079
  if (rangeVal.constructor === Array) {
@@ -10894,7 +11116,7 @@
10894
11116
  if (!prodData.mulInsOrderList) {
10895
11117
  return prodData;
10896
11118
  }
10897
- var productData = _objectSpread$3(_objectSpread$3({}, prodData), {}, {
11119
+ var productData = _objectSpread$2(_objectSpread$2({}, prodData), {}, {
10898
11120
  common: {},
10899
11121
  mulInsOrderList: []
10900
11122
  });
@@ -10920,7 +11142,7 @@
10920
11142
  checkedInsData[ele.key] = insuranceData[ele.key];
10921
11143
  }
10922
11144
  });
10923
- productData.mulInsOrderList.push(deepCopy(checkedInsData));
11145
+ productData.mulInsOrderList.push(lodash.cloneDeep(checkedInsData));
10924
11146
  }
10925
11147
  });
10926
11148
  return;
@@ -10939,32 +11161,28 @@
10939
11161
  * @returns {IPbProduct} 产品数据
10940
11162
  */
10941
11163
  function clearAddAndTakeAndAdjustBaoeData(productData) {
10942
- if (!productData) {
10943
- return productData;
10944
- }
10945
- if (!productData.mulInsOrderList) {
10946
- return productData;
10947
- }
10948
- productData.adjustBaoeData = null;
10949
- productData.mulInsOrderList.forEach(function (ins) {
10950
- if (ins.accountData && ins.accountData.addAndTakeData) {
10951
- ins.accountData.addAndTakeData.forEach(function (aat) {
10952
- aat.adjustData = [];
10953
- });
10954
- }
10955
- if (ins.reduceBaof) {
10956
- if (ins.reduceBaofData) {
10957
- ins.reduceBaofData.addAndTakeData.forEach(function (aat) {
11164
+ if (productData && Array.isArray(productData.mulInsOrderList)) {
11165
+ productData.adjustBaoeData = null;
11166
+ productData.mulInsOrderList.forEach(function (ins) {
11167
+ if (ins.accountData && ins.accountData.addAndTakeData) {
11168
+ ins.accountData.addAndTakeData.forEach(function (aat) {
10958
11169
  aat.adjustData = [];
10959
11170
  });
10960
11171
  }
10961
- if (ins.duplicateReduceBaofData) {
10962
- ins.duplicateReduceBaofData.addAndTakeData.forEach(function (aat) {
10963
- aat.adjustData = [];
10964
- });
11172
+ if (ins.reduceBaof) {
11173
+ if (ins.reduceBaofData) {
11174
+ ins.reduceBaofData.addAndTakeData.forEach(function (aat) {
11175
+ aat.adjustData = [];
11176
+ });
11177
+ }
11178
+ if (ins.duplicateReduceBaofData) {
11179
+ ins.duplicateReduceBaofData.addAndTakeData.forEach(function (aat) {
11180
+ aat.adjustData = [];
11181
+ });
11182
+ }
10965
11183
  }
10966
- }
10967
- });
11184
+ });
11185
+ }
10968
11186
  return productData;
10969
11187
  }
10970
11188
 
@@ -10977,7 +11195,6 @@
10977
11195
  convertEleOrderListToObj: convertEleOrderListToObj,
10978
11196
  convertPersonData: convertPersonData,
10979
11197
  convertProductData: convertProductData,
10980
- deepCopy: deepCopy,
10981
11198
  enableLizhaoDebug: enableLizhaoDebug,
10982
11199
  executeElementRule: executeElementRule,
10983
11200
  formatNumberToThousand: formatNumberToThousand,
@@ -10993,6 +11210,7 @@
10993
11210
  initProductData: initProductData,
10994
11211
  insuranceDataHandler: insuranceDataHandler,
10995
11212
  isHideProduct: isHideProduct,
11213
+ multipleInsuredHandler: multipleInsuredHandler,
10996
11214
  personDataHandler: personDataHandler,
10997
11215
  productDataHandler: productDataHandler,
10998
11216
  restrictElementsInInsurance: restrictElementsInInsurance,
@@ -11121,6 +11339,7 @@
11121
11339
 
11122
11340
  /* script */
11123
11341
  var __vue_script__$S = script$P;
11342
+
11124
11343
  /* template */
11125
11344
  var __vue_render__$S = function __vue_render__() {
11126
11345
  var _vm = this;
@@ -12419,6 +12638,7 @@
12419
12638
 
12420
12639
  /* script */
12421
12640
  var __vue_script__$Q = script$N;
12641
+
12422
12642
  /* template */
12423
12643
  var __vue_render__$Q = function __vue_render__() {
12424
12644
  var _vm = this;
@@ -13736,9 +13956,24 @@
13736
13956
  });
13737
13957
  }
13738
13958
 
13959
+ function validateAdjustBaoe(params) {
13960
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
13961
+ return request({
13962
+ url: "/planBook/".concat(options.publicPbUuid ? 'public' : 'V2', "/validateAccount/-1/low"),
13963
+ method: 'post',
13964
+ data: QS.stringify({
13965
+ jd: JSON.stringify(params)
13966
+ }),
13967
+ headers: {
13968
+ Accept: 'application/json, text/plain, */*',
13969
+ 'Content-Type': 'application/x-www-form-urlencoded'
13970
+ }
13971
+ });
13972
+ }
13973
+
13739
13974
  var _dec$7, _dec2$7, _dec3$7, _dec4$6, _dec5$5, _dec6$5, _class$7, _class2$7, _descriptor$7, _descriptor2$7, _descriptor3$6, _descriptor4$4;
13740
- function ownKeys$3(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; }
13741
- function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), true).forEach(function (r) { _defineProperty$1(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
13975
+ 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; }
13976
+ function _objectSpread$1(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; }
13742
13977
  function _callSuper$7(t, o, e) { return o = _getPrototypeOf$1(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$8() ? Reflect.construct(o, e || [], _getPrototypeOf$1(t).constructor) : o.apply(t, e)); }
13743
13978
  function _isNativeReflectConstruct$8() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$8 = function _isNativeReflectConstruct() { return !!t; })(); }
13744
13979
  Vue.use(_Toast);
@@ -13822,7 +14057,7 @@
13822
14057
  if (!(productData && productData.mulInsOrderList && productData.mulInsOrderList.length)) {
13823
14058
  return null;
13824
14059
  }
13825
- var options = [_objectSpread$2({
14060
+ var options = [_objectSpread$1({
13826
14061
  year: '年度',
13827
14062
  age: '年龄'
13828
14063
  }, adjustBaoeInsTitles)];
@@ -13842,7 +14077,7 @@
13842
14077
  }
13843
14078
  }
13844
14079
  }
13845
- options.push(_objectSpread$2(_objectSpread$2({}, adjustRecord || defaultAdjustRecord), {}, {
14080
+ options.push(_objectSpread$1(_objectSpread$1({}, adjustRecord || defaultAdjustRecord), {}, {
13846
14081
  year: options.length,
13847
14082
  age: k
13848
14083
  }));
@@ -13951,44 +14186,27 @@
13951
14186
  delete ins[ele];
13952
14187
  });
13953
14188
  });
13954
- var url = "".concat(PLANBOOK_API_HOSTNAME, "/planBook/").concat(params.publicPbUuid ? 'public' : 'V2', "/validateAccount/-1/low");
13955
- return fetch(url, {
13956
- method: 'POST',
13957
- credentials: 'include',
13958
- headers: {
13959
- Accept: 'application/json, text/plain, */*',
13960
- 'Content-Type': 'application/x-www-form-urlencoded'
14189
+ return validateAdjustBaoe({
14190
+ insuranceTypeId: params.planbookId * 1,
14191
+ publicPbUuid: params.publicPbUuid,
14192
+ personData: {
14193
+ personOrderList: convertPersonData(personData, personData.personOrderList.map(function (p) {
14194
+ return p.key;
14195
+ }))
13961
14196
  },
13962
- body: QS.stringify({
13963
- jd: JSON.stringify({
13964
- insuranceTypeId: params.planbookId * 1,
13965
- publicPbUuid: params.publicPbUuid,
13966
- personData: {
13967
- personOrderList: convertPersonData(personData, personData.personOrderList.map(function (p) {
13968
- return p.key;
13969
- }))
13970
- },
13971
- productGroupList: [{
13972
- key: params.groupKey,
13973
- prodOrderList: [_objectSpread$2(_objectSpread$2({}, cloneProductData), {}, {
13974
- adjustBaoeData: this.adjustBaoeData
13975
- })]
13976
- }]
13977
- })
13978
- })
13979
- }).then(function (response) {
13980
- return response.json();
13981
- }).then(function (_ref) {
13982
- var success = _ref.success,
13983
- data = _ref.data,
13984
- info = _ref.info;
13985
- if (!success || !data || data === -1) {
13986
- _this5.adjustBaoeData = cloneAdjustBaoeData;
13987
- _this5.$toast(info);
13988
- return Promise.reject();
13989
- }
13990
- return Promise.resolve(data);
14197
+ productGroupList: [{
14198
+ key: params.groupKey,
14199
+ prodOrderList: [_objectSpread$1(_objectSpread$1({}, cloneProductData), {}, {
14200
+ adjustBaoeData: this.adjustBaoeData
14201
+ })]
14202
+ }]
14203
+ }, {
14204
+ publicPbUuid: params.publicPbUuid
13991
14205
  }).catch(function (err) {
14206
+ _this5.adjustBaoeData = cloneAdjustBaoeData;
14207
+ if (err) {
14208
+ _this5.$toast(err);
14209
+ }
13992
14210
  console.log(err);
13993
14211
  });
13994
14212
  }
@@ -14036,7 +14254,7 @@
14036
14254
  if (index === 0) {
14037
14255
  return;
14038
14256
  }
14039
- var temp = _objectSpread$2({}, item);
14257
+ var temp = _objectSpread$1({}, item);
14040
14258
  delete temp.year;
14041
14259
  for (var k in temp) {
14042
14260
  if (!['age'].includes(k)) {
@@ -14382,6 +14600,7 @@
14382
14600
 
14383
14601
  /* script */
14384
14602
  var __vue_script__$M = BusinessCard;
14603
+
14385
14604
  /* template */
14386
14605
  var __vue_render__$M = function __vue_render__() {
14387
14606
  var _vm = this;
@@ -14663,6 +14882,7 @@
14663
14882
 
14664
14883
  /* script */
14665
14884
  var __vue_script__$L = CanvasPoster;
14885
+
14666
14886
  /* template */
14667
14887
  var __vue_render__$L = function __vue_render__() {
14668
14888
  var _vm = this;
@@ -14699,6 +14919,71 @@
14699
14919
  staticRenderFns: __vue_staticRenderFns__$L
14700
14920
  }, __vue_inject_styles__$L, __vue_script__$L);
14701
14921
 
14922
+ function createMd5Token(reqData, obj) {
14923
+ var personList = reqData.personData.personOrderList;
14924
+ var signInfo = {};
14925
+ if (reqData.insuranceTypeId !== null) {
14926
+ signInfo.insuranceTypeId = reqData.insuranceTypeId;
14927
+ }
14928
+ var insuredInfo = personList.filter(function (p) {
14929
+ return p.key === 'insuredInfo';
14930
+ })[0];
14931
+ var applicantInfo = personList.filter(function (p) {
14932
+ return p.key === 'applicantInfo';
14933
+ })[0];
14934
+ signInfo.insuredAge = insuredInfo.age * 1;
14935
+ signInfo.insuredSex = insuredInfo.sex * 1;
14936
+ if (applicantInfo) {
14937
+ signInfo.applicantAge = isNaN(applicantInfo.age * 1) ? 0 : applicantInfo.age * 1;
14938
+ signInfo.applicantSex = isNaN(applicantInfo.sex * 1) ? 0 : applicantInfo.sex * 1;
14939
+ }
14940
+ var productKeys = [];
14941
+ var insuranceKeys = [];
14942
+ var productGroup = reqData.productGroupList.filter(function (group) {
14943
+ return group.key === obj.groupDataKey;
14944
+ })[0];
14945
+ var prodOrderList = productGroup.prodOrderList.slice();
14946
+ prodOrderList && prodOrderList.map(function (prod) {
14947
+ productKeys.push(prod.key);
14948
+ prod.mulInsOrderList.map(function (ins) {
14949
+ insuranceKeys.push(ins.key);
14950
+ });
14951
+ });
14952
+ signInfo.product = '';
14953
+ signInfo.insurance = '';
14954
+ productKeys.sort(function (a, b) {
14955
+ return a - b;
14956
+ });
14957
+ productKeys.map(function (ele) {
14958
+ signInfo.product += "p=".concat(ele, ";");
14959
+ });
14960
+ insuranceKeys.sort(function (a, b) {
14961
+ return a - b;
14962
+ });
14963
+ insuranceKeys.map(function (ele) {
14964
+ signInfo.insurance += "i=".concat(ele, ";");
14965
+ });
14966
+ signInfo.params = JSON.stringify(reqData);
14967
+ var signInfoTx = '';
14968
+ for (var k in signInfo) {
14969
+ signInfoTx += "".concat(k, "=").concat(signInfo[k], "&");
14970
+ }
14971
+ delete signInfo.params;
14972
+
14973
+ // console.log(signInfoTx)
14974
+ // console.log(MD5(signInfoTx))
14975
+ // console.log(JSON.stringify({
14976
+ // ...signInfo,
14977
+ // signMd5: MD5(signInfoTx)
14978
+ // }))
14979
+
14980
+ signInfo.signMd5 = MD5(signInfoTx);
14981
+ return CryptoJS.AES.encrypt(JSON.stringify(signInfo), CryptoJS.enc.Utf8.parse('67u3Dg5fcc06UntP'), {
14982
+ mode: CryptoJS.mode.ECB,
14983
+ padding: CryptoJS.pad.Pkcs7
14984
+ }).toString() || MD5(signInfoTx) || '20190929';
14985
+ }
14986
+
14702
14987
  /**转换时间字符串
14703
14988
  * @Author Lizh
14704
14989
  * @DateTime 2020-04-16
@@ -14741,6 +15026,73 @@
14741
15026
  });
14742
15027
  return timeStr;
14743
15028
  }
15029
+ function getSecurityToken(data) {
15030
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
15031
+ return createMd5Token(JSON.parse(data), options);
15032
+ }
15033
+
15034
+ function getCommonCurrentUser(params) {
15035
+ return request({
15036
+ url: '/planBook/common/currentUser',
15037
+ method: 'get',
15038
+ params: params,
15039
+ isIgnoreLoading: false
15040
+ });
15041
+ }
15042
+
15043
+ /**
15044
+ * C 端地区码(POST `…/api/product/data/getAreaCode`)
15045
+ * @param {object} data 如 `{ pageType, productId }`
15046
+ * @param {string} [userUuid] 有则拼到 query(与原先 `getApiUrl(getAreaCodeApi)` 行为一致)
15047
+ */
15048
+ function getAddress(data, userUuid) {
15049
+ var url = "".concat(INSURANCE2A_API_HOSTNAME, "/api/product/data/getAreaCode");
15050
+ if (userUuid && url.indexOf('userUuid') === -1) {
15051
+ if (url.indexOf('?') === -1) {
15052
+ url += "?userUuid=".concat(encodeURIComponent(userUuid));
15053
+ } else {
15054
+ url += "&userUuid=".concat(encodeURIComponent(userUuid));
15055
+ }
15056
+ }
15057
+ return request({
15058
+ url: url,
15059
+ method: 'post',
15060
+ data: data,
15061
+ headers: {
15062
+ Accept: 'application/json, text/plain, */*',
15063
+ 'Content-Type': 'application/json'
15064
+ },
15065
+ isIgnoreLoading: false,
15066
+ returnFullResponse: true
15067
+ });
15068
+ }
15069
+
15070
+ /**
15071
+ * 险种保费试算 `/api/product/data/calculate`
15072
+ */
15073
+ function postProductDataCalculate(urlParams, postParams) {
15074
+ var path = '/api/product/data/calculate';
15075
+ if (urlParams && urlParams.uuid) {
15076
+ path += "?userUuid=".concat(encodeURIComponent(urlParams.uuid));
15077
+ } else if (urlParams && urlParams.openId) {
15078
+ path += "?userUuid=".concat(encodeURIComponent(urlParams.openId));
15079
+ }
15080
+ if (urlParams && urlParams.appid) {
15081
+ path += path.includes('?') ? "&appId=".concat(encodeURIComponent(urlParams.appid)) : "?appId=".concat(encodeURIComponent(urlParams.appid));
15082
+ }
15083
+ return request({
15084
+ baseURL: INSURANCE2A_API_HOSTNAME,
15085
+ url: path,
15086
+ method: 'post',
15087
+ data: postParams,
15088
+ headers: {
15089
+ Accept: 'application/json, text/plain, */*',
15090
+ 'Content-Type': 'application/json'
15091
+ },
15092
+ isIgnoreLoading: false,
15093
+ returnFullResponse: true
15094
+ });
15095
+ }
14744
15096
 
14745
15097
  /*!
14746
15098
  * better-normal-scroll v1.15.2
@@ -19751,7 +20103,7 @@
19751
20103
  Schema.messages = messages;
19752
20104
  Schema.validators = validators;
19753
20105
 
19754
- /*! bxs-vue-ui v4.2.1 */
20106
+ /*! bxs-vue-ui v4.2.4 */
19755
20107
 
19756
20108
  var fails = function (exec) {
19757
20109
  try {
@@ -19935,9 +20287,9 @@
19935
20287
  return functionToString.call(it);
19936
20288
  });
19937
20289
 
19938
- var WeakMap$1 = global_1.WeakMap;
20290
+ var WeakMap = global_1.WeakMap;
19939
20291
 
19940
- var nativeWeakMap = typeof WeakMap$1 === 'function' && /native code/.test(inspectSource(WeakMap$1));
20292
+ var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
19941
20293
 
19942
20294
  var hasOwnProperty = {}.hasOwnProperty;
19943
20295
 
@@ -19960,7 +20312,7 @@
19960
20312
 
19961
20313
  var hiddenKeys = {};
19962
20314
 
19963
- var WeakMap$1$1 = global_1.WeakMap;
20315
+ var WeakMap$1 = global_1.WeakMap;
19964
20316
  var set, get, has$1;
19965
20317
 
19966
20318
  var enforce = function (it) {
@@ -19977,7 +20329,7 @@
19977
20329
  };
19978
20330
 
19979
20331
  if (nativeWeakMap) {
19980
- var store$1 = new WeakMap$1$1();
20332
+ var store$1 = new WeakMap$1();
19981
20333
  var wmget = store$1.get;
19982
20334
  var wmhas = store$1.has;
19983
20335
  var wmset = store$1.set;
@@ -21832,14 +22184,14 @@
21832
22184
  };
21833
22185
 
21834
22186
  // all object keys, includes non-enumerable and symbols
21835
- var ownKeys$2 = getBuiltIn$1('Reflect', 'ownKeys') || function ownKeys(it) {
22187
+ var ownKeys$1 = getBuiltIn$1('Reflect', 'ownKeys') || function ownKeys(it) {
21836
22188
  var keys = objectGetOwnPropertyNames.f(anObject$1(it));
21837
22189
  var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
21838
22190
  return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
21839
22191
  };
21840
22192
 
21841
22193
  var copyConstructorProperties = function (target, source) {
21842
- var keys = ownKeys$2(source);
22194
+ var keys = ownKeys$1(source);
21843
22195
  var defineProperty = objectDefineProperty$1.f;
21844
22196
  var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor$1.f;
21845
22197
  for (var i = 0; i < keys.length; i++) {
@@ -39092,12 +39444,21 @@
39092
39444
  FAILED: '上传失败'
39093
39445
  }; // 本地开发环境上传代理
39094
39446
 
39095
- var PROXY_URL = 'http://192.168.180.194:9673/oss/upload';
39447
+ var PROXY_URL = 'http://192.168.180.194:9673/oss/upload'; // 科技侧 OSS 鉴权(含 cppoc POC 环境:在 hostname 加 cppoc- 前缀)
39448
+
39449
+ var OSS_TECH_AUTH = {
39450
+ authUrlTest: 'https://management.winbaoxian.cn/oss/getAuthInfo',
39451
+ authUrlProd: 'https://management.winbaoxian.com/oss/getAuthInfo'
39452
+ };
39453
+ var OSS_TECH_AUTH_CPPOC = {
39454
+ authUrlTest: 'https://cppoc-management.zytst.cn/oss/getAuthInfo',
39455
+ authUrlProd: 'https://cppoc-management.zytst.com/oss/getAuthInfo'
39456
+ };
39096
39457
  var OSS_INFO_LIST = [{
39097
39458
  type: 1,
39098
39459
  // 微易科技
39099
- authUrlTest: 'https://test.winbaoxian.com/management/oss/getAuthInfo',
39100
- authUrlProd: 'https://management.winbaoxian.com/oss/getAuthInfo'
39460
+ authUrlTest: OSS_TECH_AUTH.authUrlTest,
39461
+ authUrlProd: OSS_TECH_AUTH.authUrlProd
39101
39462
  }, {
39102
39463
  type: 2,
39103
39464
  // 微易保险经纪
@@ -40070,22 +40431,29 @@
40070
40431
  }) || {};
40071
40432
  },
40072
40433
  authUrl: function authUrl() {
40434
+ var _context;
40435
+
40073
40436
  var hostName = window.location.hostname;
40437
+ var isProd = /^.*\.com$/.test(hostName) && hostName !== 'test.winbaoxian.com' || /^.*\.net$/.test(hostName); // 访问域名含 cppoc 时统一走科技侧鉴权(带 cppoc- 前缀),与 ossType 无关
40074
40438
 
40075
- if (/^.*\.com$/.test(hostName) && hostName !== 'test.winbaoxian.com' || /^.*\.net$/.test(hostName)) {
40439
+ if (indexOf$4(_context = window.location.href).call(_context, 'cppoc') > -1) {
40440
+ return isProd ? OSS_TECH_AUTH_CPPOC.authUrlProd : OSS_TECH_AUTH_CPPOC.authUrlTest;
40441
+ }
40442
+
40443
+ if (isProd) {
40076
40444
  return this.ossInfo.authUrlProd;
40077
40445
  }
40078
40446
 
40079
40447
  return this.ossInfo.authUrlTest;
40080
40448
  },
40081
40449
  message: function message() {
40082
- var _context;
40450
+ var _context2;
40083
40451
 
40084
40452
  if (this.errorMessage) {
40085
40453
  return this.errorMessage;
40086
40454
  }
40087
40455
 
40088
- var failedImages = filter$2(_context = this.images).call(_context, function (item) {
40456
+ var failedImages = filter$2(_context2 = this.images).call(_context2, function (item) {
40089
40457
  return item.status === TASK_STATUS.FAILED;
40090
40458
  });
40091
40459
 
@@ -40473,9 +40841,9 @@
40473
40841
 
40474
40842
  this.addTasks(files);
40475
40843
  this.getAuthInfo().then(function (authInfo) {
40476
- var _context2;
40844
+ var _context3;
40477
40845
 
40478
- forEach$2(_context2 = _this6.tasks).call(_context2, function (task) {
40846
+ forEach$2(_context3 = _this6.tasks).call(_context3, function (task) {
40479
40847
  if (task.status === TASK_STATUS.READY) {
40480
40848
  _this6.taskStart(task);
40481
40849
 
@@ -40546,7 +40914,7 @@
40546
40914
  task.host = authInfo.host;
40547
40915
  var file = this.handleFile ? task.newFile : this.getBlobByDataURI(task);
40548
40916
  this.getSuffix(task.file.name, file).then(function (suffix) {
40549
- var _context3;
40917
+ var _context4;
40550
40918
 
40551
40919
  var key = "" + authInfo.dir + new Date().getTime() + "_" + _this8.randomString(15) + suffix;
40552
40920
  var formData = new FormData();
@@ -40555,7 +40923,7 @@
40555
40923
  formData.append('policy', authInfo.policy);
40556
40924
  formData.append('OSSAccessKeyId', authInfo.accessid);
40557
40925
  formData.append('key', key);
40558
- var protocol = indexOf$4(_context3 = authInfo.cdnMediaHost).call(_context3, '//') === 0 ? 'https:' : '';
40926
+ var protocol = indexOf$4(_context4 = authInfo.cdnMediaHost).call(_context4, '//') === 0 ? 'https:' : '';
40559
40927
  task.imageUrl = protocol + authInfo.cdnMediaHost + key;
40560
40928
  formData.append('file', file);
40561
40929
  task.formData = formData;
@@ -40722,9 +41090,9 @@
40722
41090
  image.content = null;
40723
41091
  this.$set(this.images, index, image);
40724
41092
  } else {
40725
- var _context4;
41093
+ var _context5;
40726
41094
 
40727
- splice$2(_context4 = this.images).call(_context4, index, 1);
41095
+ splice$2(_context5 = this.images).call(_context5, index, 1);
40728
41096
  }
40729
41097
 
40730
41098
  this.$emit('delete', {
@@ -43140,110 +43508,6 @@
43140
43508
  install$1$1(window.Vue);
43141
43509
  }
43142
43510
 
43143
- // 创建axios实例
43144
- var service = axios.create({
43145
- baseURL: APP_HOSTNAME,
43146
- withCredentials: true,
43147
- timeout: 10000,
43148
- // 请求超时时间
43149
- headers: {
43150
- 'X-Requested-With': 'XMLHttpRequest'
43151
- }
43152
- });
43153
- var loadingTimer = null;
43154
- var loading = function loading(show) {
43155
- if (show) {
43156
- showLoading();
43157
- } else {
43158
- hideLoading();
43159
- }
43160
- };
43161
-
43162
- // request拦截器
43163
- service.interceptors.request.use(function (config) {
43164
- if (loadingTimer) clearTimeout(loadingTimer);
43165
- loadingTimer = setTimeout(function () {
43166
- loading(true);
43167
- }, 300);
43168
- return config;
43169
- }, function (error) {
43170
- // Do something with request error
43171
- console.log(error); // for debug
43172
- Promise.reject(error);
43173
- });
43174
-
43175
- // respone拦截器
43176
- service.interceptors.response.use(function (response) {
43177
- if (loadingTimer) clearTimeout(loadingTimer);
43178
- loading(false);
43179
- var res = response.data;
43180
- if (res.code === 401 || res.status === 401) {
43181
- // gotoLogin()
43182
- return Promise.reject('login');
43183
- }
43184
- return res;
43185
- }, function (error) {
43186
- if (loadingTimer) clearTimeout(loadingTimer);
43187
- loading(false);
43188
- if (error.response && error.response.status == 401) {
43189
- // gotoLogin()
43190
- return Promise.reject('login');
43191
- }
43192
- console.log('err' + error); // for debug
43193
- return Promise.reject(error);
43194
- });
43195
-
43196
- var baseURL = "https://insurance2a-api.wyins.net".concat(IS_PRODUCT_ENV ? '' : '.cn');
43197
-
43198
- /**
43199
- * **获取地址信息**
43200
- * @ignore
43201
- * @author watson
43202
- * @date 2022-04-26
43203
- * @param {string} fetchUrl api url
43204
- * @param {object} data 接口传参
43205
- * @returns {object} addressData
43206
- */
43207
- function getAddress(fetchUrl, data) {
43208
- return new Promise(function (resolve, reject) {
43209
- service({
43210
- baseURL: fetchUrl,
43211
- url: undefined,
43212
- method: 'POST',
43213
- urlParams: undefined,
43214
- data: data
43215
- }).then(function (res) {
43216
- resolve(res);
43217
- }).catch(function (err) {
43218
- reject(err);
43219
- });
43220
- });
43221
- }
43222
-
43223
- /**
43224
- * **获取用户信息**
43225
- * @ignore
43226
- * @author watson
43227
- * @date 2022-04-26
43228
- * @param {string} fetchUrl api url
43229
- * @returns {promise}
43230
- */
43231
- function getUuid(fetchUrl) {
43232
- return new Promise(function (resolve, reject) {
43233
- service({
43234
- baseURL: fetchUrl,
43235
- url: undefined,
43236
- method: 'GET',
43237
- urlParams: undefined,
43238
- data: null
43239
- }).then(function (res) {
43240
- resolve(res);
43241
- }).catch(function (err) {
43242
- reject(err);
43243
- });
43244
- });
43245
- }
43246
-
43247
43511
  /**
43248
43512
  * **计划书初始化参数**
43249
43513
  * @ignore
@@ -43461,55 +43725,31 @@
43461
43725
  if (postParams && !postParams.scenario) {
43462
43726
  postParams.scenario = 'h5Widget';
43463
43727
  }
43464
- var url = '/api/product/data/calculate';
43465
- if (urlParams && urlParams.uuid) {
43466
- url += "?userUuid=".concat(urlParams.uuid);
43467
- } else if (urlParams && urlParams.openId) {
43468
- url += "?userUuid=".concat(urlParams.openId);
43469
- }
43470
- if (urlParams && urlParams.appid) {
43471
- if (url.indexOf('?') > -1) {
43472
- url += "&appId=".concat(urlParams.appid);
43473
- } else {
43474
- url += "?appId=".concat(urlParams.appid);
43475
- }
43476
- }
43477
43728
  if (hasPlanParams(planParams) && postParams.current_data) {
43478
43729
  postParams.current_data = tranlateCurrentData(postParams.current_data, planParams);
43479
43730
  }
43480
- return new Promise(function (resolve, reject) {
43481
- service({
43482
- baseURL: baseURL,
43483
- url: url,
43484
- method: 'POST',
43485
- urlParams: urlParams,
43486
- data: postParams
43487
- }).then(function (res) {
43488
- if (res.code === 200) {
43489
- var data = JSON.parse(JSON.stringify(res.data));
43490
- if (hasPlanParams(planParams)) {
43491
- var widgets = data.widgets;
43492
- var currentData = data.current_data;
43493
- translatePlanData(widgets, currentData, planParams);
43494
- }
43495
- var cData = {
43496
- widgets: data.widgets,
43497
- total_premium: data.total_premium,
43498
- terms: data.terms,
43499
- product_id: data.product_id,
43500
- current_data: data.current_data,
43501
- risk_premiums: data.risk_premiums
43502
- };
43503
- resolve({
43504
- code: 200,
43505
- data: cData
43506
- });
43507
- } else {
43508
- reject(res);
43509
- }
43510
- }).catch(function (err) {
43511
- reject(err);
43512
- });
43731
+ return postProductDataCalculate(urlParams, postParams).then(function (res) {
43732
+ if (res.code === 200) {
43733
+ var data = JSON.parse(JSON.stringify(res.data));
43734
+ if (hasPlanParams(planParams)) {
43735
+ var widgets = data.widgets;
43736
+ var currentData = data.current_data;
43737
+ translatePlanData(widgets, currentData, planParams);
43738
+ }
43739
+ var cData = {
43740
+ widgets: data.widgets,
43741
+ total_premium: data.total_premium,
43742
+ terms: data.terms,
43743
+ product_id: data.product_id,
43744
+ current_data: data.current_data,
43745
+ risk_premiums: data.risk_premiums
43746
+ };
43747
+ return {
43748
+ code: 200,
43749
+ data: cData
43750
+ };
43751
+ }
43752
+ return Promise.reject(res);
43513
43753
  });
43514
43754
  }
43515
43755
 
@@ -43590,47 +43830,17 @@
43590
43830
  if (postParams && !postParams.scenario) {
43591
43831
  postParams.scenario = 'h5Widget';
43592
43832
  }
43593
- var url = '/api/product/data/calculate';
43594
- if (urlParams && urlParams.uuid) {
43595
- url += "?userUuid=".concat(urlParams.uuid);
43596
- } else if (urlParams && urlParams.openId) {
43597
- url += "?userUuid=".concat(urlParams.openId);
43598
- }
43599
- if (urlParams && urlParams.appid) {
43600
- if (url.indexOf('?') > -1) {
43601
- url += "&appId=".concat(urlParams.appid);
43602
- } else {
43603
- url += "?appId=".concat(urlParams.appid);
43604
- }
43605
- }
43606
43833
  if (hasPlanParams(planParams) && postParams.current_data) {
43607
43834
  postParams.current_data = tranlateCurrentData(postParams.current_data, planParams);
43608
43835
  }
43609
- return new Promise(function (resolve, reject) {
43610
- service({
43611
- baseURL: baseURL,
43612
- url: url,
43613
- method: 'POST',
43614
- urlParams: urlParams,
43615
- data: postParams
43616
- }).then(function (res) {
43617
- if (res.code === 200) {
43618
- // if (postParams && !postParams.current_data) {
43619
- // let data = JSON.parse(JSON.stringify(res.data));
43620
- // postParams.current_data = data.current_data
43621
- // // 重新试算
43622
- // checkInsureCalculate(urlParams, postParams, planParams)
43623
- // }
43624
- resolve({
43625
- code: 200,
43626
- data: res.data
43627
- });
43628
- } else {
43629
- reject(res);
43630
- }
43631
- }).catch(function (err) {
43632
- reject(err);
43633
- });
43836
+ return postProductDataCalculate(urlParams, postParams).then(function (res) {
43837
+ if (res.code === 200) {
43838
+ return {
43839
+ code: 200,
43840
+ data: res.data
43841
+ };
43842
+ }
43843
+ return Promise.reject(res);
43634
43844
  });
43635
43845
  }
43636
43846
 
@@ -43638,8 +43848,6 @@
43638
43848
  __proto__: null,
43639
43849
  checkInsureCalculate: checkInsureCalculate,
43640
43850
  checkInsureCalculateIn: checkInsureCalculateIn,
43641
- getAddress: getAddress,
43642
- getUuid: getUuid,
43643
43851
  hasPlanParams: hasPlanParams,
43644
43852
  insureCalculate: insureCalculate
43645
43853
  });
@@ -43649,9 +43857,9 @@
43649
43857
  trade: trade
43650
43858
  };
43651
43859
 
43652
- var _dec$4, _dec2$4, _dec3$4, _dec4$4, _dec5$4, _dec6$4, _dec7$2, _dec8$1, _dec9$1, _dec0$1, _dec1$1, _dec10$1, _dec11, _class$4, _class2$4, _descriptor$4, _descriptor2$4, _descriptor3$4, _descriptor4$3, _descriptor5$3, _descriptor6$2, _descriptor7$1, _descriptor8$1, _descriptor9$1, _descriptor0$1, _descriptor1, _descriptor10;
43653
- 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; }
43654
- 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; }
43860
+ var _dec$4, _dec2$4, _dec3$4, _dec4$4, _dec5$4, _dec6$4, _dec7$3, _dec8$2, _dec9$1, _dec0$1, _dec1$1, _dec10$1, _dec11, _class$4, _class2$4, _descriptor$4, _descriptor2$4, _descriptor3$4, _descriptor4$3, _descriptor5$3, _descriptor6$3, _descriptor7$2, _descriptor8$1, _descriptor9$1, _descriptor0$1, _descriptor1, _descriptor10;
43861
+ 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; }
43862
+ 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; }
43655
43863
  function _callSuper$4(t, o, e) { return o = _getPrototypeOf$1(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$4() ? Reflect.construct(o, e || [], _getPrototypeOf$1(t).constructor) : o.apply(t, e)); }
43656
43864
  function _isNativeReflectConstruct$4() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$4 = function _isNativeReflectConstruct() { return !!t; })(); }
43657
43865
  Vue.use(_Toast);
@@ -43708,9 +43916,9 @@
43708
43916
  }
43709
43917
  }), _dec6$4 = Prop({
43710
43918
  default: 10
43711
- }), _dec7$2 = Prop({
43919
+ }), _dec7$3 = Prop({
43712
43920
  default: undefined
43713
- }), _dec8$1 = Prop({
43921
+ }), _dec8$2 = Prop({
43714
43922
  default: undefined
43715
43923
  }), _dec9$1 = Prop({
43716
43924
  default: undefined
@@ -43732,9 +43940,6 @@
43732
43940
  args[_key] = arguments[_key];
43733
43941
  }
43734
43942
  _this = _callSuper$4(this, InsureCalculate, [].concat(args));
43735
- _defineProperty$1(_this, "getCalculateApi", '');
43736
- _defineProperty$1(_this, "getAreaCodeApi", '');
43737
- _defineProperty$1(_this, "getUuidApi", '');
43738
43943
  _defineProperty$1(_this, "widgets", []);
43739
43944
  _defineProperty$1(_this, "originData", {});
43740
43945
  _defineProperty$1(_this, "hasCalculateData", false);
@@ -43767,9 +43972,9 @@
43767
43972
  // 是否本地缓存
43768
43973
  _initializerDefineProperty(_this, "lsTime", _descriptor5$3, _this);
43769
43974
  // 产品ID
43770
- _initializerDefineProperty(_this, "productId", _descriptor6$2, _this);
43975
+ _initializerDefineProperty(_this, "productId", _descriptor6$3, _this);
43771
43976
  // 当前用户userUuid
43772
- _initializerDefineProperty(_this, "uuid", _descriptor7$1, _this);
43977
+ _initializerDefineProperty(_this, "uuid", _descriptor7$2, _this);
43773
43978
  // 当前环境
43774
43979
  _initializerDefineProperty(_this, "isDev", _descriptor8$1, _this);
43775
43980
  // 计划书给的默认参数
@@ -43804,7 +44009,7 @@
43804
44009
  }
43805
44010
  _context.prev = 1;
43806
44011
  _context.next = 2;
43807
- return getUuid(vm.getUuidApi);
44012
+ return getCommonCurrentUser();
43808
44013
  case 2:
43809
44014
  userInfo = _context.sent;
43810
44015
  if (userInfo && userInfo.data && userInfo.data.uuid) {
@@ -43972,7 +44177,7 @@
43972
44177
  key: "showAddress",
43973
44178
  value: function () {
43974
44179
  var _showAddress = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(item) {
43975
- var vm, url, data, addressData, _t2;
44180
+ var vm, data, addressData, _t2;
43976
44181
  return _regeneratorRuntime.wrap(function (_context2) {
43977
44182
  while (1) switch (_context2.prev = _context2.next) {
43978
44183
  case 0:
@@ -43982,13 +44187,12 @@
43982
44187
  vm.returnClassify = item.values ? JSON.parse(item.values) : [];
43983
44188
  _context2.prev = 1;
43984
44189
  // 获取地址信息
43985
- url = vm.getApiUrl(vm.getAreaCodeApi);
43986
44190
  data = {
43987
44191
  pageType: 'detail',
43988
44192
  productId: String(vm.productId)
43989
44193
  };
43990
44194
  _context2.next = 2;
43991
- return getAddress(url, data);
44195
+ return getAddress(data, vm.getU());
43992
44196
  case 2:
43993
44197
  addressData = _context2.sent;
43994
44198
  if (addressData && addressData.code === 200) {
@@ -44414,7 +44618,7 @@
44414
44618
  vm.getArea(item.children, tempDes, res);
44415
44619
  } else {
44416
44620
  var _tempDes = "".concat(des).concat(item.areaName);
44417
- res.push(_objectSpread$1(_objectSpread$1({}, item), {}, {
44621
+ res.push(_objectSpread(_objectSpread({}, item), {}, {
44418
44622
  des: _tempDes
44419
44623
  }));
44420
44624
  }
@@ -44546,19 +44750,6 @@
44546
44750
  value: function getU() {
44547
44751
  return this.uuid || this.uuidFromApi;
44548
44752
  }
44549
- }, {
44550
- key: "getApiUrl",
44551
- value: function getApiUrl(url) {
44552
- var u = url;
44553
- if (this.getU() && u.indexOf('userUuid') === -1) {
44554
- if (u.indexOf('?') === -1) {
44555
- u += "?userUuid=".concat(this.getU());
44556
- } else {
44557
- u += "&userUuid=".concat(this.getU());
44558
- }
44559
- }
44560
- return u;
44561
- }
44562
44753
  }, {
44563
44754
  key: "setIsDevelop",
44564
44755
  value: function setIsDevelop() {
@@ -44570,15 +44761,6 @@
44570
44761
  if (this.isDev === true || this.isDev === false) {
44571
44762
  this.isDevelop = this.isDev;
44572
44763
  }
44573
- if (this.isDevelop) {
44574
- this.getCalculateApi = 'https://insurance2a-api.wyins.net.cn/api/product/data/calculate';
44575
- this.getAreaCodeApi = 'https://insurance2a-api.wyins.net.cn/api/product/data/getAreaCode';
44576
- this.getUuidApi = "".concat(PLANBOOK_API_HOSTNAME, "/planBook/common/currentUser");
44577
- } else {
44578
- this.getCalculateApi = 'https://insurance2a-api.wyins.net/api/product/data/calculate';
44579
- this.getAreaCodeApi = 'https://insurance2a-api.wyins.net/api/product/data/getAreaCode';
44580
- this.getUuidApi = "".concat(PLANBOOK_API_HOSTNAME, "/planBook/common/currentUser");
44581
- }
44582
44764
  }
44583
44765
  }]);
44584
44766
  }(Vue), _descriptor$4 = _applyDecoratedDescriptor(_class2$4.prototype, "showHeader", [_dec2$4], {
@@ -44606,12 +44788,12 @@
44606
44788
  enumerable: true,
44607
44789
  writable: true,
44608
44790
  initializer: null
44609
- }), _descriptor6$2 = _applyDecoratedDescriptor(_class2$4.prototype, "productId", [_dec7$2], {
44791
+ }), _descriptor6$3 = _applyDecoratedDescriptor(_class2$4.prototype, "productId", [_dec7$3], {
44610
44792
  configurable: true,
44611
44793
  enumerable: true,
44612
44794
  writable: true,
44613
44795
  initializer: null
44614
- }), _descriptor7$1 = _applyDecoratedDescriptor(_class2$4.prototype, "uuid", [_dec8$1], {
44796
+ }), _descriptor7$2 = _applyDecoratedDescriptor(_class2$4.prototype, "uuid", [_dec8$2], {
44615
44797
  configurable: true,
44616
44798
  enumerable: true,
44617
44799
  writable: true,
@@ -45039,7 +45221,7 @@
45039
45221
  staticRenderFns: __vue_staticRenderFns__$8
45040
45222
  }, __vue_inject_styles__$8, __vue_script__$8);
45041
45223
 
45042
- var _dec$3, _dec2$3, _dec3$3, _dec4$3, _dec5$3, _dec6$3, _dec7$1, _dec8, _dec9, _dec0, _dec1, _dec10, _class$3, _class2$3, _descriptor$3, _descriptor2$3, _descriptor3$3, _descriptor4$2, _descriptor5$2, _descriptor6$1, _descriptor7, _descriptor8, _descriptor9, _descriptor0;
45224
+ var _dec$3, _dec2$3, _dec3$3, _dec4$3, _dec5$3, _dec6$3, _dec7$2, _dec8$1, _dec9, _dec0, _dec1, _dec10, _class$3, _class2$3, _descriptor$3, _descriptor2$3, _descriptor3$3, _descriptor4$2, _descriptor5$2, _descriptor6$2, _descriptor7$1, _descriptor8, _descriptor9, _descriptor0;
45043
45225
  function _callSuper$3(t, o, e) { return o = _getPrototypeOf$1(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$3() ? Reflect.construct(o, e || [], _getPrototypeOf$1(t).constructor) : o.apply(t, e)); }
45044
45226
  function _isNativeReflectConstruct$3() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$3 = function _isNativeReflectConstruct() { return !!t; })(); }
45045
45227
  var BxtTitleItem = (_dec$3 = Component({
@@ -45054,9 +45236,9 @@
45054
45236
  default: ''
45055
45237
  }), _dec6$3 = Prop({
45056
45238
  default: ''
45057
- }), _dec7$1 = Prop({
45239
+ }), _dec7$2 = Prop({
45058
45240
  default: ''
45059
- }), _dec8 = Prop({
45241
+ }), _dec8$1 = Prop({
45060
45242
  default: ''
45061
45243
  }), _dec9 = Prop({
45062
45244
  default: ''
@@ -45081,8 +45263,8 @@
45081
45263
  _initializerDefineProperty(_this, "isShowCrmPerson", _descriptor3$3, _this);
45082
45264
  _initializerDefineProperty(_this, "label", _descriptor4$2, _this);
45083
45265
  _initializerDefineProperty(_this, "code", _descriptor5$2, _this);
45084
- _initializerDefineProperty(_this, "huomianTag", _descriptor6$1, _this);
45085
- _initializerDefineProperty(_this, "statusTag", _descriptor7, _this);
45266
+ _initializerDefineProperty(_this, "huomianTag", _descriptor6$2, _this);
45267
+ _initializerDefineProperty(_this, "statusTag", _descriptor7$1, _this);
45086
45268
  _initializerDefineProperty(_this, "huomianTips", _descriptor8, _this);
45087
45269
  _initializerDefineProperty(_this, "disabled", _descriptor9, _this);
45088
45270
  _initializerDefineProperty(_this, "dataStatId", _descriptor0, _this);
@@ -45144,12 +45326,12 @@
45144
45326
  enumerable: true,
45145
45327
  writable: true,
45146
45328
  initializer: null
45147
- }), _descriptor6$1 = _applyDecoratedDescriptor(_class2$3.prototype, "huomianTag", [_dec7$1], {
45329
+ }), _descriptor6$2 = _applyDecoratedDescriptor(_class2$3.prototype, "huomianTag", [_dec7$2], {
45148
45330
  configurable: true,
45149
45331
  enumerable: true,
45150
45332
  writable: true,
45151
45333
  initializer: null
45152
- }), _descriptor7 = _applyDecoratedDescriptor(_class2$3.prototype, "statusTag", [_dec8], {
45334
+ }), _descriptor7$1 = _applyDecoratedDescriptor(_class2$3.prototype, "statusTag", [_dec8$1], {
45153
45335
  configurable: true,
45154
45336
  enumerable: true,
45155
45337
  writable: true,
@@ -45255,29 +45437,6 @@
45255
45437
  staticRenderFns: __vue_staticRenderFns__$7
45256
45438
  }, __vue_inject_styles__$7, __vue_script__$7);
45257
45439
 
45258
- //
45259
- //
45260
- //
45261
- //
45262
- //
45263
- //
45264
- //
45265
- //
45266
- //
45267
- //
45268
- //
45269
- //
45270
- //
45271
- //
45272
- //
45273
- //
45274
- //
45275
- //
45276
- //
45277
- //
45278
- //
45279
- //
45280
-
45281
45440
  function initPickerConfig() {
45282
45441
  return {
45283
45442
  visible: false,
@@ -45386,6 +45545,7 @@
45386
45545
 
45387
45546
  /* script */
45388
45547
  var __vue_script__$6 = script$3;
45548
+
45389
45549
  /* template */
45390
45550
  var __vue_render__$6 = function __vue_render__() {
45391
45551
  var _vm = this;
@@ -45557,6 +45717,7 @@
45557
45717
 
45558
45718
  /* script */
45559
45719
  var __vue_script__$5 = script$2;
45720
+
45560
45721
  /* template */
45561
45722
  var __vue_render__$5 = function __vue_render__() {
45562
45723
  var _vm = this;
@@ -45742,6 +45903,7 @@
45742
45903
 
45743
45904
  /* script */
45744
45905
  var __vue_script__$4 = script$1;
45906
+
45745
45907
  /* template */
45746
45908
  var __vue_render__$4 = function __vue_render__() {
45747
45909
  var _vm = this;
@@ -45832,7 +45994,7 @@
45832
45994
  _this = _callSuper$2(this, BxtCrmPersonPop, [].concat(args));
45833
45995
  _defineProperty$1(_this, "title", '');
45834
45996
  _defineProperty$1(_this, "currentValue", false);
45835
- _defineProperty$1(_this, "currentPersonData", deepCopy(_this.personData));
45997
+ _defineProperty$1(_this, "currentPersonData", lodash.cloneDeep(_this.personData));
45836
45998
  _defineProperty$1(_this, "canImportCrm", !!(window.appBridge && window.appBridge.checkAppFeature('CRM_IMPORT')));
45837
45999
  _initializerDefineProperty(_this, "value", _descriptor$2, _this);
45838
46000
  _initializerDefineProperty(_this, "personData", _descriptor2$2, _this);
@@ -45931,7 +46093,7 @@
45931
46093
  key: "setCrmPersonData",
45932
46094
  value: function setCrmPersonData(info) {
45933
46095
  var self = this;
45934
- var copyPersonData = deepCopy(self.currentPersonData);
46096
+ var copyPersonData = lodash.cloneDeep(self.currentPersonData);
45935
46097
  var isImportSuccess = true;
45936
46098
  copyPersonData.cid = info.cid;
45937
46099
  copyPersonData.eleOrderList.map(function (ele) {
@@ -46196,7 +46358,7 @@
46196
46358
  staticRenderFns: __vue_staticRenderFns__$3
46197
46359
  }, __vue_inject_styles__$3, __vue_script__$3);
46198
46360
 
46199
- var _dec$1, _dec2$1, _dec3$1, _dec4$1, _dec5$1, _dec6$1, _class$1, _class2$1, _descriptor$1, _descriptor2$1, _descriptor3$1, _descriptor4$1, _descriptor5$1;
46361
+ var _dec$1, _dec2$1, _dec3$1, _dec4$1, _dec5$1, _dec6$1, _dec7$1, _class$1, _class2$1, _descriptor$1, _descriptor2$1, _descriptor3$1, _descriptor4$1, _descriptor5$1, _descriptor6$1;
46200
46362
  function _callSuper$1(t, o, e) { return o = _getPrototypeOf$1(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$1() ? Reflect.construct(o, e || [], _getPrototypeOf$1(t).constructor) : o.apply(t, e)); }
46201
46363
  function _isNativeReflectConstruct$1() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$1 = function _isNativeReflectConstruct() { return !!t; })(); }
46202
46364
  var BxtPersonInfo = (_dec$1 = Component({
@@ -46225,6 +46387,10 @@
46225
46387
  return {};
46226
46388
  }
46227
46389
  }), _dec6$1 = Prop({
46390
+ default: function _default() {
46391
+ return {};
46392
+ }
46393
+ }), _dec7$1 = Prop({
46228
46394
  default: false
46229
46395
  }), _dec$1(_class$1 = (_class2$1 = /*#__PURE__*/function (_Vue) {
46230
46396
  function BxtPersonInfo() {
@@ -46235,11 +46401,12 @@
46235
46401
  }
46236
46402
  _this = _callSuper$1(this, BxtPersonInfo, [].concat(args));
46237
46403
  _defineProperty$1(_this, "isShowCrmPersonPop", false);
46238
- _initializerDefineProperty(_this, "inputData", _descriptor$1, _this);
46239
- _initializerDefineProperty(_this, "verifyData", _descriptor2$1, _this);
46240
- _initializerDefineProperty(_this, "personData", _descriptor3$1, _this);
46241
- _initializerDefineProperty(_this, "params", _descriptor4$1, _this);
46242
- _initializerDefineProperty(_this, "isShowCrmPerson", _descriptor5$1, _this);
46404
+ _initializerDefineProperty(_this, "user", _descriptor$1, _this);
46405
+ _initializerDefineProperty(_this, "inputData", _descriptor2$1, _this);
46406
+ _initializerDefineProperty(_this, "verifyData", _descriptor3$1, _this);
46407
+ _initializerDefineProperty(_this, "personData", _descriptor4$1, _this);
46408
+ _initializerDefineProperty(_this, "params", _descriptor5$1, _this);
46409
+ _initializerDefineProperty(_this, "isShowCrmPerson", _descriptor6$1, _this);
46243
46410
  return _this;
46244
46411
  }
46245
46412
  _inherits(BxtPersonInfo, _Vue);
@@ -46295,18 +46462,13 @@
46295
46462
  var ele,
46296
46463
  inputData,
46297
46464
  personData,
46298
- verifyData,
46299
- params,
46300
46465
  allPersonsData,
46301
- productGroupList,
46302
- eventTarget,
46303
- promises,
46304
46466
  _args = arguments;
46305
46467
  return _regeneratorRuntime.wrap(function (_context) {
46306
46468
  while (1) switch (_context.prev = _context.next) {
46307
46469
  case 0:
46308
46470
  ele = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
46309
- inputData = this.inputData, personData = this.personData, verifyData = this.verifyData, params = this.params;
46471
+ inputData = this.inputData, personData = this.personData;
46310
46472
  if (inputData) {
46311
46473
  _context.next = 1;
46312
46474
  break;
@@ -46314,41 +46476,19 @@
46314
46476
  return _context.abrupt("return");
46315
46477
  case 1:
46316
46478
  allPersonsData = inputData.personData;
46317
- productGroupList = inputData.productGroupList || [];
46318
- eventTarget = {
46319
- personKey: personData.key,
46320
- elementKey: ele.key
46321
- };
46322
- if (!allPersonsData) {
46323
- _context.next = 2;
46324
- break;
46325
- }
46326
- personDataHandler(allPersonsData);
46327
- if (personData.key === 'applicantInfo') {
46328
- if (ele.key === 'applicantAndInsuredSame' && !ele.value) {
46329
- personData.cid = null;
46479
+ if (allPersonsData) {
46480
+ personDataHandler(allPersonsData);
46481
+ if (personData.key === 'applicantInfo') {
46482
+ if (ele.key === 'applicantAndInsuredSame' && !ele.value) {
46483
+ personData.cid = null;
46484
+ }
46330
46485
  }
46331
46486
  }
46332
- promises = [];
46333
- productGroupList.filter(function (g) {
46334
- return g.prodOrderList;
46335
- }).forEach(function (g) {
46336
- g.prodOrderList.map(function (p) {
46337
- clearAddAndTakeAndAdjustBaoeData(p);
46338
- promises.push(productDataHandler(p, lodash.get(verifyData, "[".concat(p.key, "]")), allPersonsData, {
46339
- planbookId: lodash.get(params, 'planbookId'),
46340
- eventTarget: eventTarget
46341
- }));
46342
- });
46343
- });
46344
- _context.next = 2;
46345
- return Promise.all(promises);
46346
- case 2:
46347
46487
  if (personData.key && ele.key && !['age'].includes(ele.key)) {
46348
46488
  window.WeiyiStatSDK && window.WeiyiStatSDK.submit("".concat(personData.key, "_").concat(ele.key));
46349
46489
  }
46350
46490
  this.$emit('change', personData, ele);
46351
- case 3:
46491
+ case 2:
46352
46492
  case "end":
46353
46493
  return _context.stop();
46354
46494
  }
@@ -46390,27 +46530,32 @@
46390
46530
  return false;
46391
46531
  }
46392
46532
  }]);
46393
- }(Vue), _descriptor$1 = _applyDecoratedDescriptor(_class2$1.prototype, "inputData", [_dec2$1], {
46533
+ }(Vue), _descriptor$1 = _applyDecoratedDescriptor(_class2$1.prototype, "user", [_dec2$1], {
46534
+ configurable: true,
46535
+ enumerable: true,
46536
+ writable: true,
46537
+ initializer: null
46538
+ }), _descriptor2$1 = _applyDecoratedDescriptor(_class2$1.prototype, "inputData", [_dec3$1], {
46394
46539
  configurable: true,
46395
46540
  enumerable: true,
46396
46541
  writable: true,
46397
46542
  initializer: null
46398
- }), _descriptor2$1 = _applyDecoratedDescriptor(_class2$1.prototype, "verifyData", [_dec3$1], {
46543
+ }), _descriptor3$1 = _applyDecoratedDescriptor(_class2$1.prototype, "verifyData", [_dec4$1], {
46399
46544
  configurable: true,
46400
46545
  enumerable: true,
46401
46546
  writable: true,
46402
46547
  initializer: null
46403
- }), _descriptor3$1 = _applyDecoratedDescriptor(_class2$1.prototype, "personData", [_dec4$1], {
46548
+ }), _descriptor4$1 = _applyDecoratedDescriptor(_class2$1.prototype, "personData", [_dec5$1], {
46404
46549
  configurable: true,
46405
46550
  enumerable: true,
46406
46551
  writable: true,
46407
46552
  initializer: null
46408
- }), _descriptor4$1 = _applyDecoratedDescriptor(_class2$1.prototype, "params", [_dec5$1], {
46553
+ }), _descriptor5$1 = _applyDecoratedDescriptor(_class2$1.prototype, "params", [_dec6$1], {
46409
46554
  configurable: true,
46410
46555
  enumerable: true,
46411
46556
  writable: true,
46412
46557
  initializer: null
46413
- }), _descriptor5$1 = _applyDecoratedDescriptor(_class2$1.prototype, "isShowCrmPerson", [_dec6$1], {
46558
+ }), _descriptor6$1 = _applyDecoratedDescriptor(_class2$1.prototype, "isShowCrmPerson", [_dec7$1], {
46414
46559
  configurable: true,
46415
46560
  enumerable: true,
46416
46561
  writable: true,
@@ -46419,6 +46564,7 @@
46419
46564
 
46420
46565
  /* script */
46421
46566
  var __vue_script__$2 = BxtPersonInfo;
46567
+
46422
46568
  /* template */
46423
46569
  var __vue_render__$2 = function __vue_render__() {
46424
46570
  var _vm = this;
@@ -46656,140 +46802,110 @@
46656
46802
  staticRenderFns: __vue_staticRenderFns__$2
46657
46803
  }, __vue_inject_styles__$2, __vue_script__$2);
46658
46804
 
46659
- 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; }
46660
- 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; }
46661
- function createMd5Token(reqData, obj) {
46662
- var personList = reqData.personData.personOrderList;
46663
- var signInfo = {};
46664
- if (reqData.insuranceTypeId !== null) {
46665
- signInfo.insuranceTypeId = reqData.insuranceTypeId;
46666
- }
46667
- var insuredInfo = personList.find(function (p) {
46668
- return p.key === 'insuredInfo';
46669
- });
46670
- var applicantInfo = personList.find(function (p) {
46671
- return p.key === 'applicantInfo';
46672
- });
46673
- signInfo.insuredAge = insuredInfo.age * 1;
46674
- signInfo.insuredSex = insuredInfo.sex * 1;
46675
- if (applicantInfo) {
46676
- signInfo.applicantAge = isNaN(applicantInfo.age * 1) ? 0 : applicantInfo.age * 1;
46677
- signInfo.applicantSex = isNaN(applicantInfo.sex * 1) ? 0 : applicantInfo.sex * 1;
46678
- }
46679
- var productKeys = [];
46680
- var insuranceKeys = [];
46681
- var productGroup = reqData.productGroupList.filter(function (group) {
46682
- return group.key === obj.groupDataKey;
46683
- })[0];
46684
- var prodOrderList = productGroup.prodOrderList.slice();
46685
- prodOrderList && prodOrderList.map(function (prod) {
46686
- productKeys.push(prod.key);
46687
- prod.mulInsOrderList.map(function (ins) {
46688
- insuranceKeys.push(ins.key);
46689
- });
46690
- });
46691
- signInfo.product = '';
46692
- signInfo.insurance = '';
46693
- productKeys.sort(function (a, b) {
46694
- return a - b;
46695
- });
46696
- productKeys.map(function (ele) {
46697
- signInfo.product += "p=".concat(ele, ";");
46698
- });
46699
- insuranceKeys.sort(function (a, b) {
46700
- return a - b;
46701
- });
46702
- insuranceKeys.map(function (ele) {
46703
- signInfo.insurance += "i=".concat(ele, ";");
46704
- });
46705
- signInfo.params = JSON.stringify(reqData);
46706
- var signInfoTx = '';
46707
- for (var k in signInfo) {
46708
- signInfoTx += "".concat(k, "=").concat(signInfo[k], "&");
46709
- }
46710
- delete signInfo.params;
46711
-
46712
- // console.log(signInfoTx)
46713
- // console.log(MD5(signInfoTx))
46714
- // console.log(JSON.stringify({
46715
- // ...signInfo,
46716
- // signMd5: MD5(signInfoTx)
46717
- // }))
46718
-
46719
- return CryptoJS.AES.encrypt(JSON.stringify(_objectSpread(_objectSpread({}, signInfo), {}, {
46720
- signMd5: MD5(signInfoTx)
46721
- })), CryptoJS.enc.Utf8.parse('67u3Dg5fcc06UntP'), {
46722
- mode: CryptoJS.mode.ECB,
46723
- padding: CryptoJS.pad.Pkcs7
46724
- }).toString() || MD5(signInfoTx) || '20190929';
46805
+ function createdProductDataToCalc(_x2) {
46806
+ return _createdProductDataToCalc.apply(this, arguments);
46725
46807
  }
46726
-
46727
- function createdProductDataToCalc(inputData) {
46728
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
46729
- if (inputData && inputData.personData && inputData.productGroupList && inputData.productGroupList.length) {
46730
- var productData = getProductFromInputData(inputData, {
46731
- groupKey: options.groupKey,
46732
- productKey: options.productKey
46733
- });
46734
- var tempProductForm = convertProductData(productData);
46735
- // 过滤一些不必要的数据
46736
- var productForm = {};
46737
- for (var k in tempProductForm) {
46738
- if (!['hadChoice', 'hide', 'totalBaof', 'insShowArr', 'autoImport'].includes(k)) {
46739
- productForm[k] = tempProductForm[k];
46740
- }
46741
- }
46742
- if (productForm.mulInsOrderList) {
46743
- productForm.mulInsOrderList = productForm.mulInsOrderList.map(function (ins) {
46744
- var tempIns = {};
46745
- for (var _k2 in ins) {
46746
- if (!['isFollowing', 'pPeriodDesc', 'baoeDesc', 'baofDesc', 'iDurationDesc', 'accountData', 'reduceBaofData', 'duplicateReduceBaofData', 'isCheckbox', 'groupKey', 'groupName', 'customVariableExp', 'calcResultExp', 'revalidateFlag'].includes(_k2)) {
46747
- tempIns[_k2] = ins[_k2];
46808
+ function _createdProductDataToCalc() {
46809
+ _createdProductDataToCalc = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(inputData) {
46810
+ var options,
46811
+ productData,
46812
+ tempProductForm,
46813
+ productForm,
46814
+ k,
46815
+ errorMsg,
46816
+ reqData,
46817
+ reqDataStr,
46818
+ signature,
46819
+ _args2 = arguments;
46820
+ return _regeneratorRuntime.wrap(function (_context2) {
46821
+ while (1) switch (_context2.prev = _context2.next) {
46822
+ case 0:
46823
+ options = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : {};
46824
+ if (!(inputData && inputData.personData && inputData.productGroupList && inputData.productGroupList.length)) {
46825
+ _context2.next = 5;
46826
+ break;
46827
+ }
46828
+ productData = getProductFromInputData(inputData, {
46829
+ groupKey: options.groupKey,
46830
+ productKey: options.productKey
46831
+ });
46832
+ tempProductForm = convertProductData(productData); // 过滤一些不必要的数据
46833
+ productForm = {};
46834
+ for (k in tempProductForm) {
46835
+ if (!['hadChoice', 'hide', 'totalBaof', 'insShowArr', 'autoImport', 'restrictList', 'resultImport', 'adjustBaoeData'].includes(k)) {
46836
+ productForm[k] = tempProductForm[k];
46837
+ }
46838
+ }
46839
+ if (productForm.mulInsOrderList) {
46840
+ productForm.mulInsOrderList = productForm.mulInsOrderList.map(function (ins) {
46841
+ var tempIns = {};
46842
+ for (var _k2 in ins) {
46843
+ if (!['isFollowing', 'pPeriodDesc', 'baoeDesc', 'baofDesc', 'iDurationDesc', 'payModeDesc', 'payModePremiumDesc', 'accountData', 'reduceBaofData', 'duplicateReduceBaofData', 'isCheckbox', 'groupKey', 'groupName', 'shmInsData', 'totalBaof', 'customVariableExp',
46844
+ // 'calcResultExp', // 不能删除,后面有依赖
46845
+ 'revalidateFlag'].includes(_k2)) {
46846
+ tempIns[_k2] = ins[_k2];
46847
+ }
46848
+ }
46849
+ return tempIns;
46850
+ });
46748
46851
  }
46749
- }
46750
- return tempIns;
46751
- });
46752
- }
46753
-
46754
- // 产品是否有选中的险种
46755
- if (productForm && productForm.mulInsOrderList && productForm.mulInsOrderList.length) {
46756
- var errorMsg = verifyProductRules({
46757
- personData: inputData.personData,
46758
- productData: productData
46759
- });
46760
46852
 
46761
- // 清除产品中的一些不必要的险种数据
46762
- productForm.mulInsOrderList.forEach(function (ins) {
46763
- if (ins.shmInsData) {
46764
- delete ins.shmInsData;
46765
- }
46766
- });
46767
- var reqData = {
46768
- publicPbUuid: options.publicPbUuid || null,
46769
- insuranceTypeId: options.planbookId ? options.planbookId * 1 : null,
46770
- personData: {
46771
- personOrderList: convertPersonData(inputData.personData, inputData.personData.personOrderList.map(function (p) {
46772
- return p.key;
46773
- }))
46774
- },
46775
- productGroupList: [{
46776
- key: options.groupKey,
46777
- prodOrderList: [productForm] //转换后的产品数据
46778
- }]
46779
- };
46780
- return Promise.resolve({
46781
- errorMsg: errorMsg,
46782
- jd: JSON.stringify(reqData),
46783
- signature: createMd5Token(reqData, {
46784
- groupDataKey: options.groupKey
46785
- })
46786
- });
46787
- } else {
46788
- return Promise.reject('请选择险种');
46789
- }
46790
- } else {
46791
- return Promise.reject('请填写投保数据');
46792
- }
46853
+ // 产品是否有选中的险种
46854
+ if (!(productForm && productForm.policyType === 'online_trade')) {
46855
+ _context2.next = 1;
46856
+ break;
46857
+ }
46858
+ return _context2.abrupt("return", Promise.resolve({}));
46859
+ case 1:
46860
+ if (!(productForm && productForm.mulInsOrderList && productForm.mulInsOrderList.length)) {
46861
+ _context2.next = 3;
46862
+ break;
46863
+ }
46864
+ errorMsg = verifyProductRules({
46865
+ personData: inputData.personData,
46866
+ productData: productData
46867
+ });
46868
+ reqData = {
46869
+ publicPbUuid: options.publicPbUuid || null,
46870
+ insuranceTypeId: options.planbookId ? options.planbookId * 1 : null,
46871
+ personData: {
46872
+ personOrderList: convertPersonData(inputData.personData, inputData.personData.personOrderList.map(function (p) {
46873
+ return p.key;
46874
+ }))
46875
+ },
46876
+ productGroupList: [{
46877
+ key: options.groupKey,
46878
+ prodOrderList: [productForm] //转换后的产品数据
46879
+ }]
46880
+ };
46881
+ reqDataStr = JSON.stringify(reqData);
46882
+ _context2.next = 2;
46883
+ return getSecurityToken(reqDataStr, {
46884
+ groupDataKey: options.groupKey
46885
+ });
46886
+ case 2:
46887
+ signature = _context2.sent;
46888
+ return _context2.abrupt("return", Promise.resolve({
46889
+ errorMsg: errorMsg,
46890
+ jd: reqDataStr,
46891
+ signature: signature,
46892
+ clientVersion: appVersion,
46893
+ isIos: isIos$2
46894
+ }));
46895
+ case 3:
46896
+ return _context2.abrupt("return", Promise.reject('请选择险种'));
46897
+ case 4:
46898
+ _context2.next = 6;
46899
+ break;
46900
+ case 5:
46901
+ return _context2.abrupt("return", Promise.reject('请填写投保数据'));
46902
+ case 6:
46903
+ case "end":
46904
+ return _context2.stop();
46905
+ }
46906
+ }, _callee2);
46907
+ }));
46908
+ return _createdProductDataToCalc.apply(this, arguments);
46793
46909
  }
46794
46910
  function getProductFromInputData(inputData) {
46795
46911
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -46805,7 +46921,7 @@
46805
46921
  return product;
46806
46922
  }
46807
46923
 
46808
- var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6;
46924
+ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7;
46809
46925
  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; } } }; }
46810
46926
  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; } }
46811
46927
  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; }
@@ -46828,12 +46944,16 @@
46828
46944
  return {};
46829
46945
  }
46830
46946
  }), _dec4 = Prop({
46831
- default: null
46947
+ default: function _default() {
46948
+ return {};
46949
+ }
46832
46950
  }), _dec5 = Prop({
46833
46951
  default: null
46834
46952
  }), _dec6 = Prop({
46835
- default: true
46953
+ default: null
46836
46954
  }), _dec7 = Prop({
46955
+ default: true
46956
+ }), _dec8 = Prop({
46837
46957
  default: function _default() {
46838
46958
  return {};
46839
46959
  }
@@ -46850,12 +46970,13 @@
46850
46970
  _defineProperty$1(_this, "recommendValues", {});
46851
46971
  _defineProperty$1(_this, "recommendValuesCache", {});
46852
46972
  _defineProperty$1(_this, "isShowCustomValueTips", true);
46853
- _initializerDefineProperty(_this, "inputData", _descriptor, _this);
46854
- _initializerDefineProperty(_this, "verifyData", _descriptor2, _this);
46855
- _initializerDefineProperty(_this, "groupKey", _descriptor3, _this);
46856
- _initializerDefineProperty(_this, "productKey", _descriptor4, _this);
46857
- _initializerDefineProperty(_this, "showRecommendValue", _descriptor5, _this);
46858
- _initializerDefineProperty(_this, "params", _descriptor6, _this);
46973
+ _initializerDefineProperty(_this, "user", _descriptor, _this);
46974
+ _initializerDefineProperty(_this, "inputData", _descriptor2, _this);
46975
+ _initializerDefineProperty(_this, "verifyData", _descriptor3, _this);
46976
+ _initializerDefineProperty(_this, "groupKey", _descriptor4, _this);
46977
+ _initializerDefineProperty(_this, "productKey", _descriptor5, _this);
46978
+ _initializerDefineProperty(_this, "showRecommendValue", _descriptor6, _this);
46979
+ _initializerDefineProperty(_this, "params", _descriptor7, _this);
46859
46980
  return _this;
46860
46981
  }
46861
46982
  _inherits(BxtProductInfo, _Vue);
@@ -46999,11 +47120,11 @@
46999
47120
  value: function () {
47000
47121
  var _changeProduct = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(productData, options) {
47001
47122
  var _this5 = this;
47002
- var $listeners, inputData, verifyData, personData, groupKey, productKey, params, type, insData, eleData, planbookId, publicPbUuid, productVerifyData, eventTarget, errorMsg;
47123
+ var $listeners, user, inputData, verifyData, personData, groupKey, productKey, params, type, insData, eleData, planbookId, publicPbUuid, productVerifyData, eventTarget, errorMsg;
47003
47124
  return _regeneratorRuntime.wrap(function (_context4) {
47004
47125
  while (1) switch (_context4.prev = _context4.next) {
47005
47126
  case 0:
47006
- $listeners = this.$listeners, inputData = this.inputData, verifyData = this.verifyData, personData = this.personData, groupKey = this.groupKey, productKey = this.productKey, params = this.params;
47127
+ $listeners = this.$listeners, user = this.user, inputData = this.inputData, verifyData = this.verifyData, personData = this.personData, groupKey = this.groupKey, productKey = this.productKey, params = this.params;
47007
47128
  type = options.type, insData = options.insData, eleData = options.eleData;
47008
47129
  planbookId = lodash.get(params, 'planbookId');
47009
47130
  publicPbUuid = lodash.get(params, 'publicPbUuid');
@@ -47013,12 +47134,14 @@
47013
47134
  insuranceCode: lodash.get(insData, 'code') || null,
47014
47135
  elementKey: lodash.get(eleData, 'key') || null
47015
47136
  };
47016
- if (type === 'change') {
47017
- clearAddAndTakeAndAdjustBaoeData(productData);
47137
+ if (productData.multipleInsured) {
47138
+ multipleInsuredHandler(productData, personData);
47018
47139
  }
47019
47140
  _context4.next = 1;
47020
47141
  return productDataHandler(productData, productVerifyData, personData, {
47142
+ user: user,
47021
47143
  planbookId: planbookId,
47144
+ executeSource: 'userAction',
47022
47145
  eventTarget: eventTarget
47023
47146
  });
47024
47147
  case 1:
@@ -47053,10 +47176,12 @@
47053
47176
  _context3.next = 1;
47054
47177
  return new Promise(function (resolve, reject) {
47055
47178
  _this5.$emit('reCalculate', inputData, {
47179
+ user: user,
47056
47180
  planbookId: planbookId,
47057
47181
  publicPbUuid: publicPbUuid,
47058
47182
  groupKey: groupKey,
47059
47183
  productKey: productKey,
47184
+ executeSource: 'userAction',
47060
47185
  isIgnoreError: true,
47061
47186
  eventTarget: eventTarget
47062
47187
  }, resolve, reject);
@@ -47066,7 +47191,9 @@
47066
47191
  case 1:
47067
47192
  _context3.next = 2;
47068
47193
  return productDataHandler(productData, productVerifyData, personData, {
47194
+ user: user,
47069
47195
  planbookId: planbookId,
47196
+ executeSource: 'userAction',
47070
47197
  eventTarget: eventTarget
47071
47198
  });
47072
47199
  case 2:
@@ -47274,7 +47401,7 @@
47274
47401
  }, {
47275
47402
  key: "getRecommendValues",
47276
47403
  value: function getRecommendValues(ins, ele) {
47277
- if (!['baoe', 'baof'].includes(ele.key)) {
47404
+ if (!['baoe', 'baof'].includes(ele.key) || ele.isDisabled) {
47278
47405
  return null;
47279
47406
  }
47280
47407
  var insurance = convertEleOrderListToObj(ins);
@@ -47284,7 +47411,7 @@
47284
47411
  key: "requiestRecommendValues",
47285
47412
  value: function () {
47286
47413
  var _requiestRecommendValues = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
47287
- var self, showRecommendValue, recommendValuesCache, inputData, groupData, productData, url, calcData, reqParams, calcInputData, calcProductData;
47414
+ var self, showRecommendValue, recommendValuesCache, inputData, groupData, productData, requestDataToCalc, reqParams, inputDataToCalc, mulInsOrderList;
47288
47415
  return _regeneratorRuntime.wrap(function (_context6) {
47289
47416
  while (1) switch (_context6.prev = _context6.next) {
47290
47417
  case 0:
@@ -47296,26 +47423,23 @@
47296
47423
  }
47297
47424
  return _context6.abrupt("return");
47298
47425
  case 1:
47299
- url = "".concat(PLANBOOK_API_HOSTNAME, "/planBook/input/calculate/recommend");
47300
47426
  _context6.next = 2;
47301
47427
  return createdProductDataToCalc(inputData, {
47302
47428
  groupKey: groupData.key,
47303
47429
  productKey: productData.key
47304
47430
  }).catch(function () {});
47305
47431
  case 2:
47306
- calcData = _context6.sent;
47432
+ requestDataToCalc = _context6.sent;
47307
47433
  reqParams = [];
47308
- calcInputData = calcData && JSON.parse(calcData.jd);
47309
- calcProductData = calcInputData && calcInputData.productGroupList[0].prodOrderList[0];
47310
- if (calcProductData && calcProductData.mulInsOrderList) {
47311
- calcProductData.mulInsOrderList.forEach(function (ins) {
47312
- reqParams.push({
47313
- insuranceId: ins.key,
47314
- period: ins.pPeriod,
47315
- calMethod: ins.calMethod || ins.feeType || ins.feeBaseType
47316
- });
47434
+ inputDataToCalc = requestDataToCalc && JSON.parse(requestDataToCalc.jd);
47435
+ mulInsOrderList = lodash.get(inputDataToCalc, 'productGroupList[0].prodOrderList[0].mulInsOrderList') || [];
47436
+ mulInsOrderList.forEach(function (ins) {
47437
+ reqParams.push({
47438
+ insuranceId: ins.key,
47439
+ period: ins.pPeriod,
47440
+ calMethod: ins.calMethod || ins.feeType || ins.feeBaseType
47317
47441
  });
47318
- }
47442
+ });
47319
47443
  if (!recommendValuesCache[JSON.stringify(reqParams)]) {
47320
47444
  _context6.next = 3;
47321
47445
  break;
@@ -47323,30 +47447,13 @@
47323
47447
  self.recommendValues = recommendValuesCache[JSON.stringify(reqParams)];
47324
47448
  return _context6.abrupt("return");
47325
47449
  case 3:
47326
- return _context6.abrupt("return", fetch(url, {
47327
- method: 'POST',
47328
- credentials: 'include',
47329
- headers: {
47330
- Accept: 'application/json, text/plain, */*',
47331
- 'Content-Type': 'application/json;'
47332
- },
47333
- body: JSON.stringify(reqParams)
47334
- }).then(function (response) {
47335
- return response.json();
47336
- }).then(function (_ref4) {
47337
- var success = _ref4.success,
47338
- data = _ref4.data,
47339
- info = _ref4.info;
47340
- if (!success || !data) {
47341
- self.$toast(info);
47342
- return Promise.reject();
47343
- }
47450
+ return _context6.abrupt("return", getPlanbookRecommendData(reqParams).then(function (data) {
47344
47451
  var recommendValues = data.reduce(function (obj, ele) {
47345
47452
  return Object.assign(obj, _defineProperty$1({}, ele.insuranceId, ele.valueList));
47346
47453
  }, {});
47347
47454
 
47348
47455
  // 推荐金额,根据最小值和最大值进行过滤。From hyw
47349
- var mulInsOrderList = productData && productData.mulInsOrderList ? productData.mulInsOrderList : [];
47456
+ var mulInsOrderList = lodash.get(productData, 'mulInsOrderList') || [];
47350
47457
  mulInsOrderList.filter(function (ins) {
47351
47458
  return ins.eleOrderList && ins.eleOrderList.length;
47352
47459
  }).filter(function (ins) {
@@ -47372,8 +47479,9 @@
47372
47479
  });
47373
47480
  self.recommendValues = recommendValues;
47374
47481
  recommendValuesCache[JSON.stringify(reqParams)] = recommendValues;
47375
- }).catch(function (error) {
47376
- console.log(error);
47482
+ }).catch(function (info) {
47483
+ self.$toast(info);
47484
+ console.log(info);
47377
47485
  }));
47378
47486
  case 4:
47379
47487
  case "end":
@@ -47466,32 +47574,37 @@
47466
47574
  });
47467
47575
  }
47468
47576
  }]);
47469
- }(Vue), _descriptor = _applyDecoratedDescriptor(_class2.prototype, "inputData", [_dec2], {
47577
+ }(Vue), _descriptor = _applyDecoratedDescriptor(_class2.prototype, "user", [_dec2], {
47578
+ configurable: true,
47579
+ enumerable: true,
47580
+ writable: true,
47581
+ initializer: null
47582
+ }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "inputData", [_dec3], {
47470
47583
  configurable: true,
47471
47584
  enumerable: true,
47472
47585
  writable: true,
47473
47586
  initializer: null
47474
- }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "verifyData", [_dec3], {
47587
+ }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "verifyData", [_dec4], {
47475
47588
  configurable: true,
47476
47589
  enumerable: true,
47477
47590
  writable: true,
47478
47591
  initializer: null
47479
- }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "groupKey", [_dec4], {
47592
+ }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "groupKey", [_dec5], {
47480
47593
  configurable: true,
47481
47594
  enumerable: true,
47482
47595
  writable: true,
47483
47596
  initializer: null
47484
- }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "productKey", [_dec5], {
47597
+ }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "productKey", [_dec6], {
47485
47598
  configurable: true,
47486
47599
  enumerable: true,
47487
47600
  writable: true,
47488
47601
  initializer: null
47489
- }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "showRecommendValue", [_dec6], {
47602
+ }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "showRecommendValue", [_dec7], {
47490
47603
  configurable: true,
47491
47604
  enumerable: true,
47492
47605
  writable: true,
47493
47606
  initializer: null
47494
- }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "params", [_dec7], {
47607
+ }), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "params", [_dec8], {
47495
47608
  configurable: true,
47496
47609
  enumerable: true,
47497
47610
  writable: true,
@@ -48332,7 +48445,7 @@
48332
48445
  install(window.Vue);
48333
48446
  }
48334
48447
  var index = {
48335
- version: '3.2.0',
48448
+ version: '3.3.0',
48336
48449
  install: install
48337
48450
  };
48338
48451