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