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/src/js/loading.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { Toast } from 'vant'
|
|
2
|
-
import { IS_CPPOC_HOST } from './variables'
|
|
1
|
+
import { Toast } from 'vant'
|
|
2
|
+
import { IS_CPPOC_HOST } from './variables'
|
|
3
3
|
|
|
4
4
|
export function showLoading() {
|
|
5
5
|
if (IS_CPPOC_HOST) {
|
|
6
6
|
Toast.loading({
|
|
7
7
|
message: '加载中...',
|
|
8
8
|
forbidClick: true
|
|
9
|
-
})
|
|
9
|
+
})
|
|
10
10
|
} else if (window.appBridge && window.appBridge.showLoading) {
|
|
11
|
-
window.appBridge.showLoading()
|
|
11
|
+
window.appBridge.showLoading()
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export function hideLoading() {
|
|
16
16
|
if (IS_CPPOC_HOST) {
|
|
17
|
-
Toast.clear()
|
|
17
|
+
Toast.clear()
|
|
18
18
|
} else if (window.appBridge && window.appBridge.hideLoading) {
|
|
19
|
-
window.appBridge.hideLoading()
|
|
19
|
+
window.appBridge.hideLoading()
|
|
20
20
|
}
|
|
21
21
|
}
|
package/src/js/md5Token.js
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import MD5 from 'md5'
|
|
2
|
-
import CryptoJS from 'crypto-js'
|
|
1
|
+
import MD5 from 'md5'
|
|
2
|
+
import CryptoJS from 'crypto-js'
|
|
3
3
|
|
|
4
4
|
export function createMd5Token(reqData, obj) {
|
|
5
|
-
|
|
5
|
+
var personList = reqData.personData.personOrderList
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
var signInfo = {}
|
|
8
8
|
if (reqData.insuranceTypeId !== null) {
|
|
9
|
-
signInfo.insuranceTypeId = reqData.insuranceTypeId
|
|
9
|
+
signInfo.insuranceTypeId = reqData.insuranceTypeId
|
|
10
10
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
signInfo.insuredAge = insuredInfo.age * 1
|
|
14
|
-
signInfo.insuredSex = insuredInfo.sex * 1
|
|
11
|
+
var insuredInfo = personList.filter(p => p.key === 'insuredInfo')[0]
|
|
12
|
+
var applicantInfo = personList.filter(p => p.key === 'applicantInfo')[0]
|
|
13
|
+
signInfo.insuredAge = insuredInfo.age * 1
|
|
14
|
+
signInfo.insuredSex = insuredInfo.sex * 1
|
|
15
15
|
if (applicantInfo) {
|
|
16
|
-
signInfo.applicantAge = isNaN(applicantInfo.age * 1) ? 0 : applicantInfo.age * 1
|
|
17
|
-
signInfo.applicantSex = isNaN(applicantInfo.sex * 1) ? 0 : applicantInfo.sex * 1
|
|
16
|
+
signInfo.applicantAge = isNaN(applicantInfo.age * 1) ? 0 : applicantInfo.age * 1
|
|
17
|
+
signInfo.applicantSex = isNaN(applicantInfo.sex * 1) ? 0 : applicantInfo.sex * 1
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
var productKeys = []
|
|
21
|
+
var insuranceKeys = []
|
|
22
|
+
var productGroup = reqData.productGroupList.filter(group => group.key === obj.groupDataKey)[0]
|
|
23
|
+
var prodOrderList = productGroup.prodOrderList.slice()
|
|
24
24
|
prodOrderList &&
|
|
25
25
|
prodOrderList.map(prod => {
|
|
26
|
-
productKeys.push(prod.key)
|
|
26
|
+
productKeys.push(prod.key)
|
|
27
27
|
prod.mulInsOrderList.map(ins => {
|
|
28
|
-
insuranceKeys.push(ins.key)
|
|
29
|
-
})
|
|
30
|
-
})
|
|
28
|
+
insuranceKeys.push(ins.key)
|
|
29
|
+
})
|
|
30
|
+
})
|
|
31
31
|
|
|
32
|
-
signInfo.product = ''
|
|
33
|
-
signInfo.insurance = ''
|
|
32
|
+
signInfo.product = ''
|
|
33
|
+
signInfo.insurance = ''
|
|
34
34
|
|
|
35
|
-
productKeys.sort((a, b) => a - b)
|
|
35
|
+
productKeys.sort((a, b) => a - b)
|
|
36
36
|
productKeys.map(ele => {
|
|
37
|
-
signInfo.product += `p=${ele}
|
|
38
|
-
})
|
|
37
|
+
signInfo.product += `p=${ele};`
|
|
38
|
+
})
|
|
39
39
|
|
|
40
|
-
insuranceKeys.sort((a, b) => a - b)
|
|
40
|
+
insuranceKeys.sort((a, b) => a - b)
|
|
41
41
|
insuranceKeys.map(ele => {
|
|
42
|
-
signInfo.insurance += `i=${ele}
|
|
43
|
-
})
|
|
42
|
+
signInfo.insurance += `i=${ele};`
|
|
43
|
+
})
|
|
44
44
|
|
|
45
|
-
signInfo.params = JSON.stringify(reqData)
|
|
45
|
+
signInfo.params = JSON.stringify(reqData)
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
for (
|
|
49
|
-
signInfoTx += `${k}=${signInfo[k]}
|
|
47
|
+
var signInfoTx = ''
|
|
48
|
+
for (var k in signInfo) {
|
|
49
|
+
signInfoTx += `${k}=${signInfo[k]}&`
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
delete signInfo.params
|
|
52
|
+
delete signInfo.params
|
|
53
53
|
|
|
54
54
|
// console.log(signInfoTx)
|
|
55
55
|
// console.log(MD5(signInfoTx))
|
|
@@ -58,19 +58,13 @@ export function createMd5Token(reqData, obj) {
|
|
|
58
58
|
// signMd5: MD5(signInfoTx)
|
|
59
59
|
// }))
|
|
60
60
|
|
|
61
|
+
signInfo.signMd5 = MD5(signInfoTx)
|
|
61
62
|
return (
|
|
62
|
-
CryptoJS.AES.encrypt(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}),
|
|
67
|
-
CryptoJS.enc.Utf8.parse('67u3Dg5fcc06UntP'),
|
|
68
|
-
{
|
|
69
|
-
mode: CryptoJS.mode.ECB,
|
|
70
|
-
padding: CryptoJS.pad.Pkcs7
|
|
71
|
-
}
|
|
72
|
-
).toString() ||
|
|
63
|
+
CryptoJS.AES.encrypt(JSON.stringify(signInfo), CryptoJS.enc.Utf8.parse('67u3Dg5fcc06UntP'), {
|
|
64
|
+
mode: CryptoJS.mode.ECB,
|
|
65
|
+
padding: CryptoJS.pad.Pkcs7
|
|
66
|
+
}).toString() ||
|
|
73
67
|
MD5(signInfoTx) ||
|
|
74
68
|
'20190929'
|
|
75
|
-
)
|
|
69
|
+
)
|
|
76
70
|
}
|
package/src/js/utils.js
CHANGED
|
@@ -1,38 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export * from './variables';
|
|
3
|
-
|
|
4
|
-
// 函数:Obj深度考贝
|
|
5
|
-
// 参数:target为最终返回的对象;origial为需要复制的数据源
|
|
6
|
-
export function deepCopy(obj, hash = new WeakMap()) {
|
|
7
|
-
if (!obj || typeof obj !== 'object') {
|
|
8
|
-
return obj;
|
|
9
|
-
}
|
|
10
|
-
if (hash.has(obj)) {
|
|
11
|
-
return hash.get(obj);
|
|
12
|
-
}
|
|
13
|
-
let newObj;
|
|
14
|
-
let Constructor = obj.constructor;
|
|
15
|
-
switch (Constructor) {
|
|
16
|
-
case RegExp:
|
|
17
|
-
newObj = new Constructor(obj);
|
|
18
|
-
break;
|
|
19
|
-
case Date:
|
|
20
|
-
newObj = new Constructor(obj.getTime());
|
|
21
|
-
break;
|
|
22
|
-
default:
|
|
23
|
-
newObj = new Constructor();
|
|
24
|
-
break;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
hash.set(obj, newObj);
|
|
28
|
-
for (let key in obj) {
|
|
29
|
-
if (obj.hasOwnProperty(key)) {
|
|
30
|
-
newObj[key] = typeof obj[key] === 'object' ? deepCopy(obj[key], hash) : obj[key];
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return newObj;
|
|
35
|
-
}
|
|
1
|
+
import { createMd5Token } from './md5Token'
|
|
36
2
|
|
|
37
3
|
/**转换时间字符串
|
|
38
4
|
* @Author Lizh
|
|
@@ -43,18 +9,18 @@ export function deepCopy(obj, hash = new WeakMap()) {
|
|
|
43
9
|
*/
|
|
44
10
|
export function parseTime(time, cFormat) {
|
|
45
11
|
if (arguments.length === 0) {
|
|
46
|
-
return null
|
|
12
|
+
return null
|
|
47
13
|
}
|
|
48
|
-
const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}'
|
|
49
|
-
let date
|
|
14
|
+
const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}'
|
|
15
|
+
let date
|
|
50
16
|
if (time === null) {
|
|
51
|
-
return
|
|
17
|
+
return
|
|
52
18
|
} else if (typeof time === 'object') {
|
|
53
|
-
date = time
|
|
19
|
+
date = time
|
|
54
20
|
} else {
|
|
55
|
-
if (('' + time).length === 10) time = parseInt(time) * 1000
|
|
21
|
+
if (('' + time).length === 10) time = parseInt(time) * 1000
|
|
56
22
|
|
|
57
|
-
date = new Date(time)
|
|
23
|
+
date = new Date(time)
|
|
58
24
|
}
|
|
59
25
|
const formatObj = {
|
|
60
26
|
y: date.getFullYear(),
|
|
@@ -64,21 +30,47 @@ export function parseTime(time, cFormat) {
|
|
|
64
30
|
i: date.getMinutes(),
|
|
65
31
|
s: date.getSeconds(),
|
|
66
32
|
a: date.getDay()
|
|
67
|
-
}
|
|
33
|
+
}
|
|
68
34
|
const timeStr = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
|
|
69
|
-
let value = formatObj[key]
|
|
35
|
+
let value = formatObj[key]
|
|
70
36
|
if (key === 'a') {
|
|
71
|
-
return ['日', '一', '二', '三', '四', '五', '六'][value]
|
|
37
|
+
return ['日', '一', '二', '三', '四', '五', '六'][value]
|
|
72
38
|
}
|
|
73
39
|
if (result.length > 0 && value < 10) {
|
|
74
|
-
value = '0' + value
|
|
40
|
+
value = '0' + value
|
|
75
41
|
}
|
|
76
|
-
return value || 0
|
|
77
|
-
})
|
|
78
|
-
return timeStr
|
|
42
|
+
return value || 0
|
|
43
|
+
})
|
|
44
|
+
return timeStr
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function getSecurityToken(data, options = {}) {
|
|
48
|
+
return createMd5Token(JSON.parse(data), options)
|
|
79
49
|
}
|
|
80
50
|
|
|
81
|
-
export
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
51
|
+
export async function goBack() {
|
|
52
|
+
// 增加 try catch appBridge避免报错中断返回, 例如在NUOYA中appBridge.getWebBackListSize报错
|
|
53
|
+
try {
|
|
54
|
+
const { nw } = URL_PARAM
|
|
55
|
+
if (isApp && window && window.appBridge) {
|
|
56
|
+
if (window.appBridge.getWebBackListSize) {
|
|
57
|
+
const size = await window.appBridge.getWebBackListSize()
|
|
58
|
+
if (size === 0) {
|
|
59
|
+
window.appBridge.closeView()
|
|
60
|
+
return
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (window.appBridge.checkAppFeature && window.appBridge.checkAppFeature('CLOSE_VIEW') && nw === '1') {
|
|
64
|
+
window.appBridge.closeView()
|
|
65
|
+
return
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (history.length <= 1) {
|
|
69
|
+
window.close()
|
|
70
|
+
} else {
|
|
71
|
+
history.back()
|
|
72
|
+
}
|
|
73
|
+
} catch (e) {
|
|
74
|
+
history.back()
|
|
75
|
+
}
|
|
76
|
+
}
|
package/src/js/variables.js
CHANGED
|
@@ -1,45 +1,67 @@
|
|
|
1
|
-
import QS from 'qs'
|
|
2
|
-
import Jax from '@bxs/jax'
|
|
1
|
+
import QS from 'qs'
|
|
2
|
+
import Jax from '@bxs/jax'
|
|
3
3
|
|
|
4
|
-
const { getStandardOrigin } = Jax.urlUtil
|
|
4
|
+
const { getStandardOrigin } = Jax.urlUtil
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
export const {
|
|
7
|
+
isApp,
|
|
8
|
+
appType,
|
|
9
|
+
appVersion,
|
|
10
|
+
isAndroid,
|
|
11
|
+
isIos,
|
|
12
|
+
isBxsApp,
|
|
13
|
+
isBaoXiaoZhuApp,
|
|
14
|
+
isBrokerApp,
|
|
15
|
+
isYjjApp,
|
|
16
|
+
isToBApp,
|
|
17
|
+
isRongYiBaoApp,
|
|
18
|
+
isWeChat,
|
|
19
|
+
appScheme
|
|
20
|
+
} = Jax.parseUaString()
|
|
21
|
+
|
|
22
|
+
const hostname = (window && window.location && window.location.hostname) || ''
|
|
7
23
|
/** 当前页 host 为 cppoc- 前缀时,请求 loading 使用 Vant Toast,否则走 appBridge */
|
|
8
|
-
export const IS_CPPOC_HOST = hostname.startsWith('cppoc-')
|
|
9
|
-
export const IS_PRODUCT_ENV = hostname.search(/(winbaoxian|ai-baoxiaozhu)\.com/) !== -1
|
|
10
|
-
export const IS_DEVELOP_ENV = hostname.search(/(winbaoxian|ai-baoxiaozhu)\.cn/) !== -1
|
|
11
|
-
export const IS_LOCALHOST_ENV = hostname.search(/localhost|192\.168|127\.0\.0\.1|dev\.winbaoxian\.cn/) !== -1
|
|
12
|
-
export const
|
|
13
|
-
export const
|
|
24
|
+
export const IS_CPPOC_HOST = hostname.startsWith('cppoc-')
|
|
25
|
+
export const IS_PRODUCT_ENV = hostname.search(/(winbaoxian|ai-baoxiaozhu)\.com/) !== -1
|
|
26
|
+
export const IS_DEVELOP_ENV = hostname.search(/(winbaoxian|ai-baoxiaozhu)\.cn/) !== -1
|
|
27
|
+
export const IS_LOCALHOST_ENV = hostname.search(/localhost|192\.168|127\.0\.0\.1|dev\.winbaoxian\.cn/) !== -1
|
|
28
|
+
export const IS_LOCALHOST_IP_ENV = hostname.search(/192\.168/) !== -1
|
|
29
|
+
export const IS_UAT_ENV = hostname.includes(`pbf-uat.`)
|
|
30
|
+
export const IS_ENABLE_DEBUG = !IS_PRODUCT_ENV
|
|
14
31
|
if (IS_ENABLE_DEBUG) {
|
|
15
|
-
console.error(`非线上环境,默认开启调试模式`)
|
|
32
|
+
console.error(`非线上环境,默认开启调试模式`)
|
|
16
33
|
}
|
|
17
34
|
|
|
18
|
-
const topDomain = IS_PRODUCT_ENV ? 'com' : 'cn'
|
|
19
|
-
const secondDomain = hostname.includes('ai-baoxiaozhu') ? 'ai-baoxiaozhu' : 'winbaoxian'
|
|
20
|
-
export const MAIN_DOMAIN = `${secondDomain}.${topDomain}
|
|
35
|
+
const topDomain = IS_PRODUCT_ENV ? 'com' : 'cn'
|
|
36
|
+
const secondDomain = hostname.includes('ai-baoxiaozhu') ? 'ai-baoxiaozhu' : 'winbaoxian'
|
|
37
|
+
export const MAIN_DOMAIN = `${secondDomain}.${topDomain}`
|
|
21
38
|
|
|
22
39
|
export function getFullOrigin(data) {
|
|
23
|
-
|
|
40
|
+
if (IS_LOCALHOST_IP_ENV) {
|
|
41
|
+
return `https://${data}.winbaoxian.cn`
|
|
42
|
+
}
|
|
43
|
+
const _prefixDomain = IS_CPPOC_HOST ? 'cppoc-' : ''
|
|
24
44
|
if (typeof data === 'string') {
|
|
25
|
-
return getStandardOrigin(`${_prefixDomain}${data}`)
|
|
45
|
+
return getStandardOrigin(`${_prefixDomain}${data}`)
|
|
26
46
|
}
|
|
27
47
|
if (typeof data === 'object' && data !== null) {
|
|
28
48
|
return getStandardOrigin({
|
|
29
49
|
subDomain: `${_prefixDomain}${data.subDomain}`,
|
|
30
50
|
domainType: data.domainType
|
|
31
|
-
})
|
|
51
|
+
})
|
|
32
52
|
}
|
|
33
|
-
return ''
|
|
53
|
+
return ''
|
|
34
54
|
}
|
|
35
55
|
|
|
36
|
-
export const APP_HOSTNAME = getFullOrigin('app')
|
|
37
|
-
export const PBF_HOSTNAME = getFullOrigin('pbf')
|
|
38
|
-
export const PLANBOOK_API_HOSTNAME = getFullOrigin(`bxs-planbook-api${IS_UAT_ENV ? '-uat' : ''}`)
|
|
56
|
+
export const APP_HOSTNAME = getFullOrigin('app')
|
|
57
|
+
export const PBF_HOSTNAME = getFullOrigin('pbf')
|
|
58
|
+
export const PLANBOOK_API_HOSTNAME = getFullOrigin(`bxs-planbook-api${IS_UAT_ENV ? '-uat' : ''}`)
|
|
59
|
+
/** 险种试算等 trade 接口(insurance2a-api) */
|
|
60
|
+
export const INSURANCE2A_API_HOSTNAME = `https://insurance2a-api.wyins.net${IS_PRODUCT_ENV ? '' : '.cn'}`
|
|
39
61
|
|
|
40
|
-
export const URL_PARAM = getUrlParams()
|
|
62
|
+
export const URL_PARAM = getUrlParams()
|
|
41
63
|
export function getUrlParams(url) {
|
|
42
|
-
const _url = url || location.search || ''
|
|
43
|
-
const _searchStr = _url.split('?')[1]
|
|
44
|
-
return _searchStr ? QS.parse(_searchStr) : {}
|
|
64
|
+
const _url = url || location.search || ''
|
|
65
|
+
const _searchStr = _url.split('?')[1]
|
|
66
|
+
return _searchStr ? QS.parse(_searchStr) : {}
|
|
45
67
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
|
|
3
|
+
/* 主色 / 品牌 */
|
|
4
|
+
--bxt-primary: #0a64fe;
|
|
5
|
+
--bxt-default: #0a64fe;
|
|
6
|
+
|
|
7
|
+
/* 背景 */
|
|
8
|
+
--bxt-bg-primary: #f2f2f2;
|
|
9
|
+
--bxt-bg-minor: #f8f8f8;
|
|
10
|
+
|
|
11
|
+
/* 功能色 */
|
|
12
|
+
--bxt-feature-primary: #f43030;
|
|
13
|
+
--bxt-feature-minor: #ff5000;
|
|
14
|
+
--bxt-feature-patch: #f90;
|
|
15
|
+
--bxt-feature-assist: #fffeed;
|
|
16
|
+
|
|
17
|
+
/* 文字 */
|
|
18
|
+
--bxt-text-primary: #333;
|
|
19
|
+
--bxt-text-minor: #666;
|
|
20
|
+
--bxt-text-patch: #999;
|
|
21
|
+
--bxt-text-assist: #ccc;
|
|
22
|
+
--bxt-text-disabled: #ccc;
|
|
23
|
+
|
|
24
|
+
/* 线条 */
|
|
25
|
+
--bxt-line-split: #e5e5e5;
|
|
26
|
+
|
|
27
|
+
/* 遮罩 */
|
|
28
|
+
--bxt-overlay-default: rgba(0, 0, 0, 0.5);
|
|
29
|
+
--bxt-overlay-thick: rgba(0, 0, 0, 0.8);
|
|
30
|
+
--bxt-overlay-thin: rgba(0, 0, 0, 0.1);
|
|
31
|
+
|
|
32
|
+
/* type 色板 */
|
|
33
|
+
--bxt-type-default: #999;
|
|
34
|
+
--bxt-type-primary: #0a64fe;
|
|
35
|
+
--bxt-type-success: #d4edda;
|
|
36
|
+
--bxt-type-info: #70acf6;
|
|
37
|
+
--bxt-type-warning: #f90;
|
|
38
|
+
--bxt-type-danger: #f43030;
|
|
39
|
+
--bxt-type-caution: #ff5000;
|
|
40
|
+
}
|
package/src/style/variables.less
CHANGED
|
@@ -1,54 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
@primary-color: #025CEA;
|
|
3
|
-
@minor-color: #F62D32;
|
|
4
|
-
@primary-bg-color: #F7F8FA;
|
|
5
|
-
@minor-bg-color: #f8f8f8;
|
|
6
|
-
@patch-bg-color: #F4F8FF;
|
|
7
|
-
@primary-text-color: #17204D;
|
|
8
|
-
@minor-text-color: #555C80;
|
|
9
|
-
@patch-text-color: #7E849F;
|
|
10
|
-
@assist-text-color: #D0D2DB;
|
|
11
|
-
@primary-border-color: #EBEDF0;
|
|
12
|
-
@primary-section-bg-color: #FFF;
|
|
13
|
-
@nav-bar-height: 46px;
|
|
14
|
-
/** 仅用于团险app,顶部安全区域测试用测试 **/
|
|
15
|
-
// @safe-area-inset-top: 34px;
|
|
16
|
-
|
|
17
|
-
.safeAreaInsetMarginTop {
|
|
18
|
-
margin-top: constant(safe-area-inset-top);
|
|
19
|
-
margin-top: env(safe-area-inset-top);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.safeAreaInsetBottom {
|
|
23
|
-
&::after {
|
|
24
|
-
display: block;
|
|
25
|
-
content: ' ';
|
|
26
|
-
height: constant(safe-area-inset-bottom);
|
|
27
|
-
height: env(safe-area-inset-bottom);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.vertical_center {
|
|
32
|
-
position: absolute;
|
|
33
|
-
top: 50%;
|
|
34
|
-
right: 0;
|
|
35
|
-
transform: translateY(-50%);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.nowrap {
|
|
1
|
+
.bxt-nowrap() {
|
|
39
2
|
display: inline-block;
|
|
3
|
+
width: 100%;
|
|
40
4
|
white-space: nowrap;
|
|
41
|
-
text-overflow: ellipsis;
|
|
42
5
|
overflow: hidden;
|
|
43
|
-
|
|
6
|
+
text-overflow: ellipsis;
|
|
44
7
|
}
|
|
45
8
|
|
|
46
|
-
.
|
|
9
|
+
.bxt-multiline-ellipsis(@number) {
|
|
47
10
|
position: relative;
|
|
48
11
|
overflow: hidden;
|
|
49
12
|
text-overflow: ellipsis;
|
|
50
13
|
display: -moz-box;
|
|
51
14
|
display: -webkit-box;
|
|
15
|
+
|
|
52
16
|
/* autoprefixer: off */
|
|
53
17
|
display: box;
|
|
54
18
|
-moz-line-clamp: @number;
|
|
@@ -56,5 +20,20 @@
|
|
|
56
20
|
line-clamp: @number;
|
|
57
21
|
-moz-box-orient: vertical;
|
|
58
22
|
-webkit-box-orient: vertical;
|
|
59
|
-
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.bxt-vertical-center() {
|
|
26
|
+
position: absolute;
|
|
27
|
+
top: 50%;
|
|
28
|
+
right: 0;
|
|
29
|
+
transform: translateY(-50%);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.bxt-safe-area-inset-bottom() {
|
|
33
|
+
&::after {
|
|
34
|
+
display: block;
|
|
35
|
+
height: constant(safe-area-inset-bottom);
|
|
36
|
+
height: env(safe-area-inset-bottom);
|
|
37
|
+
content: '';
|
|
38
|
+
}
|
|
60
39
|
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { hideLoading, showLoading } from '@src/js/loading.js';
|
|
2
|
-
import { PLANBOOK_API_HOSTNAME } from '@src/js/variables.js';
|
|
3
|
-
|
|
4
|
-
const apiBaseUrl = `${PLANBOOK_API_HOSTNAME}/planBook`
|
|
5
|
-
|
|
6
|
-
export function initInsuranceInterest (reqParams, options : any = {}) {
|
|
7
|
-
const { scene } = options
|
|
8
|
-
const apis = {
|
|
9
|
-
init: `${apiBaseUrl}/interest/init`,
|
|
10
|
-
init4: `${apiBaseUrl}/public/interest/product/init`,
|
|
11
|
-
init5: `${apiBaseUrl}/insurance/compare/draw/init`
|
|
12
|
-
};
|
|
13
|
-
const api = apis[`init${[4, 5].includes(scene)? scene : ''}`];
|
|
14
|
-
|
|
15
|
-
showLoading()
|
|
16
|
-
return fetch(api, {
|
|
17
|
-
method: 'POST',
|
|
18
|
-
credentials: 'include',
|
|
19
|
-
headers: {
|
|
20
|
-
Accept: 'application/json, text/plain, */*',
|
|
21
|
-
'Content-Type': 'application/json;'
|
|
22
|
-
},
|
|
23
|
-
body: JSON.stringify(reqParams)
|
|
24
|
-
})
|
|
25
|
-
.then(response => response.json())
|
|
26
|
-
.then(({ success, data, info }: any) => {
|
|
27
|
-
if (!success || !data) {
|
|
28
|
-
return Promise.reject(info)
|
|
29
|
-
}
|
|
30
|
-
return Promise.resolve(data)
|
|
31
|
-
})
|
|
32
|
-
.finally(() => {
|
|
33
|
-
hideLoading()
|
|
34
|
-
})
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export function getInsuranceInterestDetail (reqParams, options : any = {}) {
|
|
38
|
-
const { scene, isReduceBaof } = options
|
|
39
|
-
const apis = {
|
|
40
|
-
addAndTake: `${apiBaseUrl}/interest/addAndTake/detail`,
|
|
41
|
-
addAndTake4: `${apiBaseUrl}/public/interest/addAndTake/detail`,
|
|
42
|
-
addAndTake5: `${apiBaseUrl}/interest/addAndTake/detail`,
|
|
43
|
-
draw: `${apiBaseUrl}/interest/draw/detail`,
|
|
44
|
-
draw4: `${apiBaseUrl}/public/interest/draw/detail`,
|
|
45
|
-
draw5: `${apiBaseUrl}/insurance/compare/draw/detail`,
|
|
46
|
-
}
|
|
47
|
-
const _type = isReduceBaof ? 'draw' : 'addAndTake'
|
|
48
|
-
const api = apis[`${_type}${[4, 5].includes(scene)? scene : ''}`]
|
|
49
|
-
showLoading()
|
|
50
|
-
return fetch(api, {
|
|
51
|
-
method: 'POST',
|
|
52
|
-
credentials: 'include',
|
|
53
|
-
headers: {
|
|
54
|
-
Accept: 'application/json, text/plain, */*',
|
|
55
|
-
'Content-Type': 'application/json;'
|
|
56
|
-
},
|
|
57
|
-
body: JSON.stringify(reqParams)
|
|
58
|
-
})
|
|
59
|
-
.then(response => response.json())
|
|
60
|
-
.then((res: any) => {
|
|
61
|
-
const { success, data } = res
|
|
62
|
-
if (!success || !data) {
|
|
63
|
-
return Promise.reject(res)
|
|
64
|
-
}
|
|
65
|
-
return Promise.resolve(data)
|
|
66
|
-
})
|
|
67
|
-
.finally(() => {
|
|
68
|
-
hideLoading()
|
|
69
|
-
})
|
|
70
|
-
}
|