bxs-tools-ui 3.2.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -20
- package/es/add-and-take/index.css +1 -1
- package/es/add-and-take/index.js +283 -64
- package/es/adjust-baoe/index.css +1 -1
- package/es/adjust-baoe/index.js +444 -195
- package/es/business-card/index.css +1 -1
- package/es/business-card/index.js +1 -0
- package/es/canvas-poster/index.css +1 -1
- package/es/canvas-poster/index.js +1 -0
- package/es/index.css +1 -1
- package/es/index.js +936 -824
- package/es/insure-calculate/index.css +1 -1
- package/es/insure-calculate/index.js +438 -265
- package/es/person-info/index.css +1 -1
- package/es/person-info/index.js +296 -1370
- package/es/product-info/index.css +1 -1
- package/es/product-info/index.js +644 -548
- package/es/share-sheet/index.css +1 -1
- package/es/share-sheet/index.js +313 -21
- package/es/utils/index.js +530 -429
- package/lib/add-and-take/index.css +1 -1
- package/lib/add-and-take/index.js +283 -64
- package/lib/adjust-baoe/index.css +1 -1
- package/lib/adjust-baoe/index.js +441 -194
- package/lib/business-card/index.css +1 -1
- package/lib/business-card/index.js +1 -0
- package/lib/canvas-poster/index.css +1 -1
- package/lib/canvas-poster/index.js +1 -0
- package/lib/index.css +1 -1
- package/lib/index.js +939 -826
- package/lib/insure-calculate/index.css +1 -1
- package/lib/insure-calculate/index.js +438 -268
- package/lib/person-info/index.css +1 -1
- package/lib/person-info/index.js +295 -1372
- package/lib/product-info/index.css +1 -1
- package/lib/product-info/index.js +645 -550
- package/lib/share-sheet/index.css +1 -1
- package/lib/share-sheet/index.js +313 -25
- package/lib/utils/index.js +531 -433
- package/package.json +9 -7
- package/packages/add-and-take/components/interest-form.less +144 -0
- package/packages/add-and-take/components/interest-form.vue +179 -179
- package/packages/add-and-take/components/interest-items.less +87 -0
- package/packages/add-and-take/components/interest-items.vue +67 -80
- package/packages/add-and-take/components/interest-table.less +111 -0
- package/packages/add-and-take/components/interest-table.vue +31 -31
- package/packages/add-and-take/constant.ts +2 -2
- package/packages/add-and-take/demo/index.vue +89 -86
- package/packages/add-and-take/handler.ts +52 -57
- package/packages/add-and-take/index.less +69 -0
- package/packages/add-and-take/index.vue +156 -156
- package/packages/add-and-take/readme.md +87 -98
- package/packages/adjust-baoe/demo/index.vue +37 -47
- package/packages/adjust-baoe/index.less +125 -0
- package/packages/adjust-baoe/index.vue +134 -147
- package/packages/adjust-baoe/readme.md +35 -45
- package/packages/business-card/demo/index.vue +7 -7
- package/packages/business-card/index.less +100 -0
- package/packages/business-card/index.vue +18 -21
- package/packages/business-card/readme.md +46 -53
- package/packages/bxs-utils/demo/index.vue +2 -2
- package/packages/bxs-utils/index.ts +5 -5
- package/packages/bxs-utils/planbook/common.ts +56 -92
- package/packages/bxs-utils/planbook/index.ts +4 -4
- package/packages/bxs-utils/planbook/insurance.ts +137 -127
- package/packages/bxs-utils/planbook/person.ts +143 -147
- package/packages/bxs-utils/planbook/product.ts +473 -509
- package/packages/bxs-utils/readme.md +94 -84
- package/packages/bxs-utils/trade/index.js +1 -1
- package/packages/bxs-utils/trade/insureCalculate.js +91 -204
- package/packages/canvas-poster/demo/index.vue +9 -13
- package/packages/canvas-poster/index.less +5 -0
- package/packages/canvas-poster/index.vue +68 -79
- package/packages/canvas-poster/readme.md +106 -109
- package/packages/index.ts +1 -1
- package/packages/insure-calculate/demo/index.vue +20 -20
- package/packages/insure-calculate/index.less +366 -0
- package/packages/insure-calculate/index.vue +305 -329
- package/packages/insure-calculate/readme.md +99 -106
- package/packages/person-info/crm-popup.vue +81 -80
- package/packages/person-info/demo/index.vue +25 -37
- package/packages/person-info/index-inline.less +11 -0
- package/packages/person-info/index.vue +53 -83
- package/packages/person-info/readme.md +109 -115
- package/packages/planbook-input/components/footer.less +54 -0
- package/packages/planbook-input/components/footer.vue +8 -64
- package/packages/planbook-input/components/handler.js +33 -44
- package/packages/planbook-input/components/product-table.less +235 -0
- package/packages/planbook-input/components/product-table.vue +114 -108
- package/packages/planbook-input/demo/index.vue +3 -3
- package/packages/planbook-input/helper.js +852 -465
- package/packages/planbook-input/index.less +30 -0
- package/packages/planbook-input/index.vue +86 -103
- package/packages/planbook-input/readme.md +72 -90
- package/packages/product-info/demo/constant.js +1 -1
- package/packages/product-info/demo/index.vue +31 -43
- package/packages/product-info/index.less +271 -0
- package/packages/product-info/index.vue +198 -210
- package/packages/product-info/readme.md +72 -75
- package/packages/share-sheet/constant.js +4 -4
- package/packages/share-sheet/demo/index.vue +10 -10
- package/packages/share-sheet/handler.js +14 -14
- package/packages/share-sheet/index.less +201 -0
- package/packages/share-sheet/index.vue +39 -39
- package/packages/share-sheet/readme.md +121 -127
- package/src/api/add-and-take.js +45 -0
- package/src/api/adjust-baoe.js +16 -0
- package/src/api/index.js +6 -0
- package/src/api/planbook.js +93 -0
- package/src/api/request.js +211 -0
- package/src/api/trade.js +56 -0
- package/src/api/user.js +18 -0
- package/src/components/common/common-age-birthday.less +66 -0
- package/src/components/common/common-age-birthday.vue +27 -95
- package/src/components/common/common-popup.less +81 -0
- package/src/components/common/common-popup.vue +12 -96
- package/src/components/common/common-radio.less +75 -0
- package/src/components/common/common-radio.vue +13 -91
- package/src/components/common/common-select.less +13 -0
- package/src/components/common/common-select.vue +21 -38
- package/src/components/common/common-title.less +115 -0
- package/src/components/common/common-title.vue +24 -24
- package/src/js/loading.js +6 -6
- package/src/js/md5Token.js +38 -44
- package/src/js/utils.js +45 -53
- package/src/js/variables.js +47 -25
- package/src/style/base.less +18 -0
- package/src/style/color.less +40 -0
- package/src/style/variables.less +21 -42
- package/packages/add-and-take/api.ts +0 -70
- package/packages/add-and-take/components/interest-form.css +0 -146
- package/packages/add-and-take/components/interest-items.css +0 -87
- package/packages/add-and-take/components/interest-table.css +0 -113
- package/packages/add-and-take/index.css +0 -70
- package/packages/adjust-baoe/index.css +0 -123
- package/packages/business-card/index.css +0 -101
- package/packages/canvas-poster/index.css +0 -5
- package/packages/insure-calculate/index.css +0 -368
- package/packages/planbook-input/api.js +0 -29
- package/packages/planbook-input/components/product-table.css +0 -236
- package/packages/planbook-input/index.css +0 -31
- package/packages/product-info/index.css +0 -264
- package/packages/share-sheet/index.css +0 -203
- package/src/components/common/common-title.css +0 -116
- package/src/js/request.js +0 -64
- package/src/style/apply.css +0 -25
- package/src/style/base.css +0 -36
- package/src/style/color.css +0 -74
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
.bxt-share-sheet{background-color:transparent;color:#333}.bxt-share-sheet .bxt-share-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;-moz-box-orient:vertical;-moz-box-direction:normal;-webkit-box-pack:end;-moz-box-pack:end;-ms-flex-pack:end;bottom:0;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;height:100%;-webkit-justify-content:flex-end;justify-content:flex-end;left:0;overflow:hidden;position:absolute;width:100%}.bxt-share-sheet .bxt-share-image{padding:30px 40px}.bxt-share-sheet .bxt-share-image img{width:100%}.bxt-share-sheet .bxt-share-content{background:#fff}.bxt-share-sheet .bxt-expire{padding:15px 15px 15px 21px}.bxt-share-sheet .bxt-expire .bxt-title{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.bxt-share-sheet .bxt-expire .bxt-title .bxt-tx{font-size:14px;font-weight:700;font-weight:500;line-height:17px}.bxt-share-sheet .bxt-expire .bxt-title .bxt-description{color:#666;font-size:13px;line-height:16px;margin-left:18px}.bxt-share-sheet .bxt-expire .bxt-title .bxt-description .van-icon{color:#b5b5b5;font-size:15px;vertical-align:middle}.bxt-share-sheet .bxt-expire .bxt-title .bxt-description span{margin-left:3px;vertical-align:middle}.bxt-share-sheet .bxt-expire .van-radio-group{margin-top:6px}.bxt-share-sheet .bxt-expire .van-radio-group .van-radio{-webkit-box-flex:0;-moz-box-flex:0;-webkit-flex:0 0 32%;-ms-flex:0 0 32%;flex:0 0 32%;margin-right:0;margin-top:12px}.bxt-share-sheet .bxt-expire .van-radio-group .van-radio .van-radio__icon{color:var(--bxt-primary);font-size:15px;line-height:20px;vertical-align:middle}.bxt-share-sheet .bxt-expire .van-radio-group .van-radio .van-radio__label{margin-left:6px;vertical-align:middle}.bxt-share-sheet .bxt-explain{color:#666;font-size:13px;line-height:19px}.bxt-share-sheet .bxt-explain-title{padding:15px 21px}.bxt-share-sheet .bxt-explain-text{padding:12px 15px}.bxt-share-sheet .bxt-explain-text .bxt-explain-text-content{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden;text-overflow:ellipsis;width:100%}.bxt-share-sheet .bxt-explain-text--copy{padding:12px 15px}.bxt-share-sheet .bxt-explain-text--copy .bxt-explain-text-wrapper{background:#f5f5f5;border-radius:6px;padding:12px 15px}.bxt-share-sheet .bxt-share .bxt-share-wrapper{-webkit-box-pack:start;-moz-box-pack:start;-ms-flex-pack:start;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-justify-content:flex-start;justify-content:flex-start;overflow:auto;padding:20px 15px}.bxt-share-sheet .bxt-share .bxt-share-wrapper::-webkit-scrollbar{display:none}.bxt-share-sheet .bxt-share .bxt-share-wrapper figure{-webkit-box-flex:0;-moz-box-flex:0;-webkit-box-orient:vertical;-webkit-box-direction:normal;-moz-box-orient:vertical;-moz-box-direction:normal;-webkit-flex:0 0 25%;-ms-flex:0 0 25%;flex:0 0 25%;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column}.bxt-share-sheet .bxt-share .bxt-share-wrapper figure,.bxt-share-sheet .bxt-share .bxt-share-wrapper figure .bxt-empty-image{-webkit-box-pack:center;-moz-box-pack:center;-ms-flex-pack:center;-webkit-box-align:center;-moz-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-justify-content:center;justify-content:center}.bxt-share-sheet .bxt-share .bxt-share-wrapper figure .bxt-empty-image{background:#f3f7f9;border-radius:50px;height:50px;overflow:hidden;width:50px}.bxt-share-sheet .bxt-share .bxt-share-wrapper figure .bxt-empty-image img{display:block;margin:0 auto;width:100%}.bxt-share-sheet .bxt-share .bxt-share-wrapper figure figcaption{color:#666;font-size:12px;height:15px;line-height:15px;margin-top:5px;overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap;width:100%}.bxt-share-sheet .bxt-share .bxt-share-wrapper.more figure{-webkit-box-flex:0;-moz-box-flex:0;-webkit-flex:0 0 23%;-ms-flex:0 0 23%;flex:0 0 23%}.bxt-share-sheet .bxt-fooer{font-size:15px;line-height:18px;padding:16px 15px;text-align:center}.bxt-share-sheet .bxt-fooer:after{content:"";display:block;height:constant(safe-area-inset-bottom);height:env(safe-area-inset-bottom)}.bxt-share-sheet .bxt-bottom-border{overflow:hidden;position:relative}.bxt-share-sheet .bxt-bottom-border:before{border-bottom:1px solid #e5e5e5;bottom:0;content:"";left:15px;position:absolute;-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:left center;transform-origin:left center;width:200%}
|
package/lib/share-sheet/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, 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'), require('lodash'), require('qs')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', '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', 'lodash', 'qs'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.BXT = {}, null, global._Button, null, global._Radio, null, global._RadioGroup, null, global._Popup, global._, global.QS));
|
|
5
|
-
})(this, (function (exports, index_css, _Button, index_css$1, _Radio, index_css$2, _RadioGroup, index_css$3, _Popup, lodash, QS) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, 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'), require('lodash'), require('qs'), require('vant/lib/dialog/index.css'), require('vant/lib/dialog'), require('vant/lib/toast/index.css'), require('vant/lib/toast')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', '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', 'lodash', 'qs', 'vant/lib/dialog/index.css', 'vant/lib/dialog', 'vant/lib/toast/index.css', 'vant/lib/toast'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.BXT = {}, null, global._Button, null, global._Radio, null, global._RadioGroup, null, global._Popup, global._, global.QS, null, global._Dialog, null, global._Toast));
|
|
5
|
+
})(this, (function (exports, index_css, _Button, index_css$1, _Radio, index_css$2, _RadioGroup, index_css$3, _Popup, lodash, QS, index_css$4, _Dialog, index_css$5, _Toast) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _typeof$1(o) {
|
|
8
8
|
"@babel/helpers - typeof";
|
|
@@ -71,6 +71,32 @@
|
|
|
71
71
|
return text;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
75
|
+
try {
|
|
76
|
+
var i = n[a](c),
|
|
77
|
+
u = i.value;
|
|
78
|
+
} catch (n) {
|
|
79
|
+
return void e(n);
|
|
80
|
+
}
|
|
81
|
+
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
82
|
+
}
|
|
83
|
+
function _asyncToGenerator(n) {
|
|
84
|
+
return function () {
|
|
85
|
+
var t = this,
|
|
86
|
+
e = arguments;
|
|
87
|
+
return new Promise(function (r, o) {
|
|
88
|
+
var a = n.apply(t, e);
|
|
89
|
+
function _next(n) {
|
|
90
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
91
|
+
}
|
|
92
|
+
function _throw(n) {
|
|
93
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
94
|
+
}
|
|
95
|
+
_next(void 0);
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
74
100
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
75
101
|
|
|
76
102
|
function getDefaultExportFromCjs (x) {
|
|
@@ -498,7 +524,8 @@
|
|
|
498
524
|
return regenerator;
|
|
499
525
|
}
|
|
500
526
|
|
|
501
|
-
requireRegenerator();
|
|
527
|
+
var regeneratorExports = requireRegenerator();
|
|
528
|
+
var _regeneratorRuntime = /*@__PURE__*/getDefaultExportFromCjs(regeneratorExports);
|
|
502
529
|
|
|
503
530
|
var jax$1 = {exports: {}};
|
|
504
531
|
|
|
@@ -8468,12 +8495,27 @@
|
|
|
8468
8495
|
var Jax = /*@__PURE__*/getDefaultExportFromCjs(jaxExports);
|
|
8469
8496
|
|
|
8470
8497
|
var getStandardOrigin = Jax.urlUtil.getStandardOrigin;
|
|
8498
|
+
var _Jax$parseUaString = Jax.parseUaString();
|
|
8499
|
+
_Jax$parseUaString.isApp;
|
|
8500
|
+
_Jax$parseUaString.appType;
|
|
8501
|
+
_Jax$parseUaString.appVersion;
|
|
8502
|
+
_Jax$parseUaString.isAndroid;
|
|
8503
|
+
_Jax$parseUaString.isIos;
|
|
8504
|
+
_Jax$parseUaString.isBxsApp;
|
|
8505
|
+
_Jax$parseUaString.isBaoXiaoZhuApp;
|
|
8506
|
+
_Jax$parseUaString.isBrokerApp;
|
|
8507
|
+
_Jax$parseUaString.isYjjApp;
|
|
8508
|
+
_Jax$parseUaString.isToBApp;
|
|
8509
|
+
_Jax$parseUaString.isRongYiBaoApp;
|
|
8510
|
+
_Jax$parseUaString.isWeChat;
|
|
8511
|
+
_Jax$parseUaString.appScheme;
|
|
8471
8512
|
var hostname = window && window.location && window.location.hostname || '';
|
|
8472
8513
|
/** 当前页 host 为 cppoc- 前缀时,请求 loading 使用 Vant Toast,否则走 appBridge */
|
|
8473
8514
|
var IS_CPPOC_HOST = hostname.startsWith('cppoc-');
|
|
8474
8515
|
var IS_PRODUCT_ENV = hostname.search(/(winbaoxian|ai-baoxiaozhu)\.com/) !== -1;
|
|
8475
8516
|
hostname.search(/(winbaoxian|ai-baoxiaozhu)\.cn/) !== -1;
|
|
8476
8517
|
hostname.search(/localhost|192\.168|127\.0\.0\.1|dev\.winbaoxian\.cn/) !== -1;
|
|
8518
|
+
var IS_LOCALHOST_IP_ENV = hostname.search(/192\.168/) !== -1;
|
|
8477
8519
|
var IS_UAT_ENV = hostname.includes("pbf-uat.");
|
|
8478
8520
|
var IS_ENABLE_DEBUG = !IS_PRODUCT_ENV;
|
|
8479
8521
|
if (IS_ENABLE_DEBUG) {
|
|
@@ -8481,6 +8523,9 @@
|
|
|
8481
8523
|
}
|
|
8482
8524
|
hostname.includes('ai-baoxiaozhu') ? 'ai-baoxiaozhu' : 'winbaoxian';
|
|
8483
8525
|
function getFullOrigin(data) {
|
|
8526
|
+
if (IS_LOCALHOST_IP_ENV) {
|
|
8527
|
+
return "https://".concat(data, ".winbaoxian.cn");
|
|
8528
|
+
}
|
|
8484
8529
|
var _prefixDomain = IS_CPPOC_HOST ? 'cppoc-' : '';
|
|
8485
8530
|
if (typeof data === 'string') {
|
|
8486
8531
|
return getStandardOrigin("".concat(_prefixDomain).concat(data));
|
|
@@ -8495,7 +8540,7 @@
|
|
|
8495
8540
|
}
|
|
8496
8541
|
var APP_HOSTNAME = getFullOrigin('app');
|
|
8497
8542
|
getFullOrigin('pbf');
|
|
8498
|
-
getFullOrigin("bxs-planbook-api".concat(IS_UAT_ENV ? '-uat' : ''));
|
|
8543
|
+
var PLANBOOK_API_HOSTNAME = getFullOrigin("bxs-planbook-api".concat(IS_UAT_ENV ? '-uat' : ''));
|
|
8499
8544
|
getUrlParams();
|
|
8500
8545
|
function getUrlParams(url) {
|
|
8501
8546
|
var _url = location.search || '';
|
|
@@ -8503,6 +8548,267 @@
|
|
|
8503
8548
|
return _searchStr ? QS.parse(_searchStr) : {};
|
|
8504
8549
|
}
|
|
8505
8550
|
|
|
8551
|
+
function showLoading() {
|
|
8552
|
+
if (IS_CPPOC_HOST) {
|
|
8553
|
+
_Toast.loading({
|
|
8554
|
+
message: '加载中...',
|
|
8555
|
+
forbidClick: true
|
|
8556
|
+
});
|
|
8557
|
+
} else if (window.appBridge && window.appBridge.showLoading) {
|
|
8558
|
+
window.appBridge.showLoading();
|
|
8559
|
+
}
|
|
8560
|
+
}
|
|
8561
|
+
function hideLoading() {
|
|
8562
|
+
if (IS_CPPOC_HOST) {
|
|
8563
|
+
_Toast.clear();
|
|
8564
|
+
} else if (window.appBridge && window.appBridge.hideLoading) {
|
|
8565
|
+
window.appBridge.hideLoading();
|
|
8566
|
+
}
|
|
8567
|
+
}
|
|
8568
|
+
|
|
8569
|
+
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; }
|
|
8570
|
+
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(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; }
|
|
8571
|
+
var options = {
|
|
8572
|
+
baseURL: PLANBOOK_API_HOSTNAME,
|
|
8573
|
+
withCredentials: true,
|
|
8574
|
+
timeout: 10000,
|
|
8575
|
+
headers: {
|
|
8576
|
+
'X-Requested-With': 'XMLHttpRequest'
|
|
8577
|
+
}
|
|
8578
|
+
};
|
|
8579
|
+
var loadingTimer = null;
|
|
8580
|
+
var showRequestLoading = function showRequestLoading() {
|
|
8581
|
+
if (loadingTimer) {
|
|
8582
|
+
clearTimeout(loadingTimer);
|
|
8583
|
+
}
|
|
8584
|
+
loadingTimer = setTimeout(function () {
|
|
8585
|
+
showLoading();
|
|
8586
|
+
}, 300);
|
|
8587
|
+
};
|
|
8588
|
+
var hideRequestLoading = function hideRequestLoading() {
|
|
8589
|
+
if (loadingTimer) {
|
|
8590
|
+
hideLoading();
|
|
8591
|
+
}
|
|
8592
|
+
if (loadingTimer) {
|
|
8593
|
+
clearTimeout(loadingTimer);
|
|
8594
|
+
}
|
|
8595
|
+
};
|
|
8596
|
+
var normalizeMethod = function normalizeMethod(method) {
|
|
8597
|
+
return (method || 'get').toUpperCase();
|
|
8598
|
+
};
|
|
8599
|
+
var serializeParams = function serializeParams(params) {
|
|
8600
|
+
if (!params) {
|
|
8601
|
+
return '';
|
|
8602
|
+
}
|
|
8603
|
+
var queryParts = [];
|
|
8604
|
+
Object.keys(params).forEach(function (key) {
|
|
8605
|
+
var value = params[key];
|
|
8606
|
+
if (value === undefined || value === null) {
|
|
8607
|
+
return;
|
|
8608
|
+
}
|
|
8609
|
+
if (Array.isArray(value)) {
|
|
8610
|
+
value.forEach(function (item) {
|
|
8611
|
+
queryParts.push("".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(item)));
|
|
8612
|
+
});
|
|
8613
|
+
return;
|
|
8614
|
+
}
|
|
8615
|
+
queryParts.push("".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(value)));
|
|
8616
|
+
});
|
|
8617
|
+
return queryParts.join('&');
|
|
8618
|
+
};
|
|
8619
|
+
var isAbsoluteUrl = function isAbsoluteUrl(url) {
|
|
8620
|
+
return /^https?:\/\//.test(url);
|
|
8621
|
+
};
|
|
8622
|
+
var buildUrl = function buildUrl(baseURL, url, params) {
|
|
8623
|
+
var queryString = serializeParams(params);
|
|
8624
|
+
var requestUrl = isAbsoluteUrl(url) ? url : "".concat(baseURL).concat(url);
|
|
8625
|
+
if (!queryString) {
|
|
8626
|
+
return requestUrl;
|
|
8627
|
+
}
|
|
8628
|
+
return "".concat(requestUrl).concat(requestUrl.includes('?') ? '&' : '?').concat(queryString);
|
|
8629
|
+
};
|
|
8630
|
+
var isPlainObject = function isPlainObject(value) {
|
|
8631
|
+
return Object.prototype.toString.call(value) === '[object Object]';
|
|
8632
|
+
};
|
|
8633
|
+
var buildBody = function buildBody(data, headers) {
|
|
8634
|
+
if (data === undefined || data === null) {
|
|
8635
|
+
return undefined;
|
|
8636
|
+
}
|
|
8637
|
+
if (data instanceof FormData || data instanceof Blob || typeof data === 'string') {
|
|
8638
|
+
return data;
|
|
8639
|
+
}
|
|
8640
|
+
if (isPlainObject(data) || Array.isArray(data)) {
|
|
8641
|
+
if (!headers['Content-Type']) {
|
|
8642
|
+
headers['Content-Type'] = 'application/json';
|
|
8643
|
+
}
|
|
8644
|
+
return JSON.stringify(data);
|
|
8645
|
+
}
|
|
8646
|
+
return data;
|
|
8647
|
+
};
|
|
8648
|
+
var parseResponse = /*#__PURE__*/function () {
|
|
8649
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(response) {
|
|
8650
|
+
var contentType, text;
|
|
8651
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
8652
|
+
while (1) switch (_context.prev = _context.next) {
|
|
8653
|
+
case 0:
|
|
8654
|
+
contentType = response.headers.get('content-type') || '';
|
|
8655
|
+
if (!contentType.includes('application/json')) {
|
|
8656
|
+
_context.next = 1;
|
|
8657
|
+
break;
|
|
8658
|
+
}
|
|
8659
|
+
return _context.abrupt("return", response.json());
|
|
8660
|
+
case 1:
|
|
8661
|
+
_context.next = 2;
|
|
8662
|
+
return response.text();
|
|
8663
|
+
case 2:
|
|
8664
|
+
text = _context.sent;
|
|
8665
|
+
if (text) {
|
|
8666
|
+
_context.next = 3;
|
|
8667
|
+
break;
|
|
8668
|
+
}
|
|
8669
|
+
return _context.abrupt("return", {});
|
|
8670
|
+
case 3:
|
|
8671
|
+
_context.prev = 3;
|
|
8672
|
+
return _context.abrupt("return", JSON.parse(text));
|
|
8673
|
+
case 4:
|
|
8674
|
+
_context.prev = 4;
|
|
8675
|
+
_context["catch"](3);
|
|
8676
|
+
return _context.abrupt("return", {
|
|
8677
|
+
data: text
|
|
8678
|
+
});
|
|
8679
|
+
case 5:
|
|
8680
|
+
case "end":
|
|
8681
|
+
return _context.stop();
|
|
8682
|
+
}
|
|
8683
|
+
}, _callee, null, [[3, 4]]);
|
|
8684
|
+
}));
|
|
8685
|
+
return function parseResponse(_x) {
|
|
8686
|
+
return _ref.apply(this, arguments);
|
|
8687
|
+
};
|
|
8688
|
+
}();
|
|
8689
|
+
var createTimeoutError = function createTimeoutError(timeout) {
|
|
8690
|
+
var error = new Error("timeout of ".concat(timeout, "ms exceeded"));
|
|
8691
|
+
error.name = 'TimeoutError';
|
|
8692
|
+
return error;
|
|
8693
|
+
};
|
|
8694
|
+
var request = /*#__PURE__*/function () {
|
|
8695
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(config) {
|
|
8696
|
+
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;
|
|
8697
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
8698
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
8699
|
+
case 0:
|
|
8700
|
+
url = config.url, _config$baseURL = config.baseURL, baseURL = _config$baseURL === void 0 ? options.baseURL : _config$baseURL, _config$method = config.method, method = _config$method === void 0 ? 'get' : _config$method, params = config.params, data = config.data, _config$headers = config.headers, headers = _config$headers === void 0 ? {} : _config$headers, isIgnoreLoading = config.isIgnoreLoading, _config$timeout = config.timeout, timeout = _config$timeout === void 0 ? options.timeout : _config$timeout, _config$withCredentia = config.withCredentials, withCredentials = _config$withCredentia === void 0 ? options.withCredentials : _config$withCredentia, returnFullResponse = config.returnFullResponse;
|
|
8701
|
+
if (!isIgnoreLoading) {
|
|
8702
|
+
showRequestLoading();
|
|
8703
|
+
}
|
|
8704
|
+
requestHeaders = _objectSpread(_objectSpread({}, options.headers), headers);
|
|
8705
|
+
timeoutId = null;
|
|
8706
|
+
_context2.prev = 1;
|
|
8707
|
+
fetchPromise = fetch(buildUrl(baseURL, url, params), {
|
|
8708
|
+
method: normalizeMethod(method),
|
|
8709
|
+
headers: requestHeaders,
|
|
8710
|
+
body: normalizeMethod(method) === 'GET' ? undefined : buildBody(data, requestHeaders),
|
|
8711
|
+
credentials: withCredentials ? 'include' : 'same-origin'
|
|
8712
|
+
});
|
|
8713
|
+
_context2.next = 2;
|
|
8714
|
+
return Promise.race([fetchPromise, new Promise(function (resolve, reject) {
|
|
8715
|
+
timeoutId = setTimeout(function () {
|
|
8716
|
+
reject(createTimeoutError(timeout));
|
|
8717
|
+
}, timeout);
|
|
8718
|
+
})]);
|
|
8719
|
+
case 2:
|
|
8720
|
+
response = _context2.sent;
|
|
8721
|
+
_context2.next = 3;
|
|
8722
|
+
return parseResponse(response);
|
|
8723
|
+
case 3:
|
|
8724
|
+
res = _context2.sent;
|
|
8725
|
+
if (response.ok) {
|
|
8726
|
+
_context2.next = 4;
|
|
8727
|
+
break;
|
|
8728
|
+
}
|
|
8729
|
+
error = new Error("Request failed with status code ".concat(response.status));
|
|
8730
|
+
error.response = {
|
|
8731
|
+
status: response.status,
|
|
8732
|
+
data: res
|
|
8733
|
+
};
|
|
8734
|
+
throw error;
|
|
8735
|
+
case 4:
|
|
8736
|
+
code = res.code;
|
|
8737
|
+
if (!['002012', '002013', '002015'].includes(code)) {
|
|
8738
|
+
_context2.next = 5;
|
|
8739
|
+
break;
|
|
8740
|
+
}
|
|
8741
|
+
messageMap = {
|
|
8742
|
+
m002012: '当前账号因操作频繁被限制,请明天再试。感谢理解',
|
|
8743
|
+
m002013: '您的操作频率较高,已达到今日生成上限。请稍后再试或明天继续使用,感谢您的理解!',
|
|
8744
|
+
m002015: '您今天做了太多计划书了,休息一下,明天再来吧'
|
|
8745
|
+
};
|
|
8746
|
+
message = messageMap["m".concat(code)];
|
|
8747
|
+
if (message) {
|
|
8748
|
+
_Dialog.alert({
|
|
8749
|
+
message: message,
|
|
8750
|
+
confirmButtonText: '知道了',
|
|
8751
|
+
confirmButtonColor: '#0A64FE'
|
|
8752
|
+
});
|
|
8753
|
+
}
|
|
8754
|
+
return _context2.abrupt("return", Promise.reject({
|
|
8755
|
+
code: code,
|
|
8756
|
+
message: message
|
|
8757
|
+
}));
|
|
8758
|
+
case 5:
|
|
8759
|
+
if (!(code === 401 || res.status === 401)) {
|
|
8760
|
+
_context2.next = 6;
|
|
8761
|
+
break;
|
|
8762
|
+
}
|
|
8763
|
+
gotoLogin();
|
|
8764
|
+
return _context2.abrupt("return", Promise.reject('status: 401'));
|
|
8765
|
+
case 6:
|
|
8766
|
+
if (!(res.success && res.data === -1)) {
|
|
8767
|
+
_context2.next = 7;
|
|
8768
|
+
break;
|
|
8769
|
+
}
|
|
8770
|
+
gotoLogin();
|
|
8771
|
+
return _context2.abrupt("return", Promise.reject('login: -1'));
|
|
8772
|
+
case 7:
|
|
8773
|
+
return _context2.abrupt("return", returnFullResponse ? res : res.data);
|
|
8774
|
+
case 8:
|
|
8775
|
+
_context2.prev = 8;
|
|
8776
|
+
_t2 = _context2["catch"](1);
|
|
8777
|
+
if (_t2.response && _t2.response.status == 401) {
|
|
8778
|
+
gotoLogin();
|
|
8779
|
+
}
|
|
8780
|
+
return _context2.abrupt("return", Promise.reject(_t2));
|
|
8781
|
+
case 9:
|
|
8782
|
+
_context2.prev = 9;
|
|
8783
|
+
if (timeoutId) {
|
|
8784
|
+
clearTimeout(timeoutId);
|
|
8785
|
+
}
|
|
8786
|
+
hideRequestLoading();
|
|
8787
|
+
return _context2.finish(9);
|
|
8788
|
+
case 10:
|
|
8789
|
+
case "end":
|
|
8790
|
+
return _context2.stop();
|
|
8791
|
+
}
|
|
8792
|
+
}, _callee2, null, [[1, 8, 9, 10]]);
|
|
8793
|
+
}));
|
|
8794
|
+
return function request(_x2) {
|
|
8795
|
+
return _ref2.apply(this, arguments);
|
|
8796
|
+
};
|
|
8797
|
+
}();
|
|
8798
|
+
|
|
8799
|
+
function getPlanbookInsuranceVerifyData(params) {
|
|
8800
|
+
return request({
|
|
8801
|
+
baseURL: APP_HOSTNAME,
|
|
8802
|
+
url: '/planBook/input/insurance/verifyData',
|
|
8803
|
+
method: 'post',
|
|
8804
|
+
data: params,
|
|
8805
|
+
headers: {
|
|
8806
|
+
Accept: 'application/json, text/plain, */*',
|
|
8807
|
+
'Content-Type': 'application/json;'
|
|
8808
|
+
}
|
|
8809
|
+
});
|
|
8810
|
+
}
|
|
8811
|
+
|
|
8506
8812
|
/**
|
|
8507
8813
|
* **多被保人,获取并缓存多个险种信息的费率信息**
|
|
8508
8814
|
* @ignore
|
|
@@ -8512,25 +8818,7 @@
|
|
|
8512
8818
|
* @returns {Promise<any>} 产品下所有险种的费率
|
|
8513
8819
|
*/
|
|
8514
8820
|
lodash.memoize(function (params) {
|
|
8515
|
-
|
|
8516
|
-
return fetch(url, {
|
|
8517
|
-
method: 'POST',
|
|
8518
|
-
credentials: 'include',
|
|
8519
|
-
headers: {
|
|
8520
|
-
Accept: 'application/json, text/plain, */*',
|
|
8521
|
-
'Content-Type': 'application/json;'
|
|
8522
|
-
},
|
|
8523
|
-
body: JSON.stringify(params)
|
|
8524
|
-
}).then(function (response) {
|
|
8525
|
-
return response.json();
|
|
8526
|
-
}).then(function (_ref) {
|
|
8527
|
-
var success = _ref.success,
|
|
8528
|
-
data = _ref.data;
|
|
8529
|
-
if (!success || !data) {
|
|
8530
|
-
return Promise.reject();
|
|
8531
|
-
}
|
|
8532
|
-
return Promise.resolve(data);
|
|
8533
|
-
}).catch(function () {});
|
|
8821
|
+
return getPlanbookInsuranceVerifyData(params).catch(function () {});
|
|
8534
8822
|
}, function (params) {
|
|
8535
8823
|
return QS.stringify(params);
|
|
8536
8824
|
});
|