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
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
计划书投保页的产品组件,基于服务端下发的 `mulInsOrderList` 动态渲染各险种的表单元素,支持元素值修改、险种联动逻辑处理与表单校验。
|
|
4
4
|
|
|
5
5
|
> 数据来源:访问[计划书初始化 API](http://app.winbaoxian.cn/planBook/V2/getInitData?insuranceTypeId=6128) 查看示例数据,或参考 `demo/constant.js`。
|
|
6
|
+
>
|
|
6
7
|
> - `inputData`:`data → initData → inputData`
|
|
7
8
|
> - `verifyData`:`data → verifyData`
|
|
8
9
|
> - `groupKey`:`inputData → productGroupList → key`
|
|
@@ -39,33 +40,33 @@ export default {
|
|
|
39
40
|
</template>
|
|
40
41
|
|
|
41
42
|
<script>
|
|
42
|
-
import { ProductInfo } from 'bxs-tools-ui';
|
|
43
|
-
|
|
44
|
-
export default {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
43
|
+
import { ProductInfo } from 'bxs-tools-ui';
|
|
44
|
+
|
|
45
|
+
export default {
|
|
46
|
+
components: { ProductInfo },
|
|
47
|
+
methods: {
|
|
48
|
+
cgProduct(product, options, inst) {
|
|
49
|
+
if (options.type === 'change' && options.errorMsg) {
|
|
50
|
+
this.$nextTick(() => {
|
|
51
|
+
this.$toast(options.errorMsg);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
openCrmPersonPopup() {
|
|
56
|
+
// 打开人员信息修改浮层(含 CRM 导入功能)
|
|
57
|
+
},
|
|
58
|
+
validate() {
|
|
59
|
+
this.$refs.productInfo
|
|
60
|
+
.validate()
|
|
61
|
+
.then(valid => {
|
|
62
|
+
// 校验通过
|
|
63
|
+
})
|
|
64
|
+
.catch(err => {
|
|
65
|
+
console.log(err);
|
|
66
|
+
});
|
|
52
67
|
}
|
|
53
|
-
},
|
|
54
|
-
openCrmPersonPopup() {
|
|
55
|
-
// 打开人员信息修改浮层(含 CRM 导入功能)
|
|
56
|
-
},
|
|
57
|
-
validate() {
|
|
58
|
-
this.$refs.productInfo
|
|
59
|
-
.validate()
|
|
60
|
-
.then(valid => {
|
|
61
|
-
// 校验通过
|
|
62
|
-
})
|
|
63
|
-
.catch(err => {
|
|
64
|
-
console.log(err);
|
|
65
|
-
});
|
|
66
68
|
}
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
+
};
|
|
69
70
|
</script>
|
|
70
71
|
```
|
|
71
72
|
|
|
@@ -73,75 +74,71 @@ export default {
|
|
|
73
74
|
|
|
74
75
|
### Attributes
|
|
75
76
|
|
|
76
|
-
| 参数
|
|
77
|
-
|
|
|
78
|
-
| `input-data`
|
|
79
|
-
| `group-key`
|
|
80
|
-
| `product-key`
|
|
81
|
-
| `verify-data`
|
|
82
|
-
| `show-recommend-value` | 可选,是否展示保额/保费推荐值
|
|
83
|
-
| `params`
|
|
84
|
-
|
|
77
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
78
|
+
| ---------------------- | -------------------------------------------------- | --------------- | ------ |
|
|
79
|
+
| `input-data` | 必传,计划书初始化数据 | Object | `{}` |
|
|
80
|
+
| `group-key` | 必传,产品组的 key | Number / String | `null` |
|
|
81
|
+
| `product-key` | 必传,产品的 key | Number / String | `null` |
|
|
82
|
+
| `verify-data` | 可选,计划书限制条件;不传则不执行产品逻辑处理函数 | Object | `{}` |
|
|
83
|
+
| `show-recommend-value` | 可选,是否展示保额/保费推荐值 | Boolean | `true` |
|
|
84
|
+
| `params` | 可选,其他参数,见 Params 对象 | Object | `{}` |
|
|
85
85
|
|
|
86
86
|
#### Params 对象
|
|
87
87
|
|
|
88
|
-
| 参数
|
|
89
|
-
|
|
|
90
|
-
| `planbookId`
|
|
91
|
-
| `publicPbUuid`
|
|
92
|
-
| `allowCustomResult`
|
|
93
|
-
| `insuranceSaleStatus` | 险种停售状态映射:`{ [insuranceKey]: number }`;值为 `2` 时展示「停」标签 | Object
|
|
94
|
-
|
|
88
|
+
| 参数 | 说明 | 类型 |
|
|
89
|
+
| --------------------- | ------------------------------------------------------------------------- | ------- |
|
|
90
|
+
| `planbookId` | 计划书 ID,用于产品联动逻辑 | Number |
|
|
91
|
+
| `publicPbUuid` | 公开计划书 uuid,传入后使用 public 接口重算 | String |
|
|
92
|
+
| `allowCustomResult` | 是否显示「自定义保费/保额」开关 | Boolean |
|
|
93
|
+
| `insuranceSaleStatus` | 险种停售状态映射:`{ [insuranceKey]: number }`;值为 `2` 时展示「停」标签 | Object |
|
|
95
94
|
|
|
96
95
|
#### ProductData 对象(inputData 中的产品结构)
|
|
97
96
|
|
|
98
|
-
| 参数
|
|
99
|
-
|
|
|
100
|
-
| `key`
|
|
101
|
-
| `mulInsOrderList` | 必传,险种列表,见 MulInsOrderList 数组 | Array
|
|
102
|
-
|
|
97
|
+
| 参数 | 说明 | 类型 |
|
|
98
|
+
| ----------------- | --------------------------------------- | ------ |
|
|
99
|
+
| `key` | 必传,产品 ID | Number |
|
|
100
|
+
| `mulInsOrderList` | 必传,险种列表,见 MulInsOrderList 数组 | Array |
|
|
103
101
|
|
|
104
102
|
#### MulInsOrderList 数组(单项)
|
|
105
103
|
|
|
106
|
-
| 参数
|
|
107
|
-
|
|
|
108
|
-
| `key`
|
|
109
|
-
| `eleOrderList` | 必传,险种内元素列表,见 EleOrderList 数组 | Array
|
|
110
|
-
| `code`
|
|
111
|
-
| `isFollowing`
|
|
112
|
-
|
|
104
|
+
| 参数 | 说明 | 类型 |
|
|
105
|
+
| -------------- | ------------------------------------------ | ------- |
|
|
106
|
+
| `key` | 必传,险种 ID | Number |
|
|
107
|
+
| `eleOrderList` | 必传,险种内元素列表,见 EleOrderList 数组 | Array |
|
|
108
|
+
| `code` | 险种 code | String |
|
|
109
|
+
| `isFollowing` | 是否去除与上一险种之间的间距 | Boolean |
|
|
113
110
|
|
|
114
111
|
#### EleOrderList 数组(单项)
|
|
115
112
|
|
|
116
|
-
| 参数
|
|
117
|
-
|
|
|
118
|
-
| `key`
|
|
119
|
-
| `value`
|
|
120
|
-
| `componentName`
|
|
121
|
-
| `labelName`
|
|
122
|
-
| `isDisabled`
|
|
123
|
-
| `isHide`
|
|
124
|
-
| `isIgnoreValidate` | 必传,是否忽略校验
|
|
125
|
-
| `common`
|
|
126
|
-
| `opts`
|
|
127
|
-
| `rules`
|
|
128
|
-
| `restrictions`
|
|
129
|
-
| `placeholder`
|
|
113
|
+
| 参数 | 说明 | 类型 |
|
|
114
|
+
| ------------------ | ----------------------------------------------------------------------------------------------------------------- | --------------- |
|
|
115
|
+
| `key` | 必传,元素 ID | String |
|
|
116
|
+
| `value` | 必传,元素当前值 | String / Number |
|
|
117
|
+
| `componentName` | 必传,对应渲染组件(`cmCommonTitle` / `cmCommonInput` / `cmCommonRadioBtn` / `cmCommonRadio` / `cmCommonSelect`) | String |
|
|
118
|
+
| `labelName` | 必传,元素名称 | String |
|
|
119
|
+
| `isDisabled` | 必传,是否不可修改 | Boolean |
|
|
120
|
+
| `isHide` | 必传,是否隐藏 | Boolean |
|
|
121
|
+
| `isIgnoreValidate` | 必传,是否忽略校验 | Boolean |
|
|
122
|
+
| `common` | 是否为通用元素 | Boolean |
|
|
123
|
+
| `opts` | 选项列表(`cmCommonRadioBtn` / `cmCommonRadio` / `cmCommonSelect` 适用) | Array |
|
|
124
|
+
| `rules` | 校验规则,基于 [async-validator](https://github.com/yiminghe/async-validator#type) | Array |
|
|
125
|
+
| `restrictions` | 当前元素的限制条件 | Array |
|
|
126
|
+
| `placeholder` | 占位符(`cmCommonInput` 适用) | String |
|
|
130
127
|
|
|
131
128
|
---
|
|
132
129
|
|
|
133
130
|
### Methods
|
|
134
131
|
|
|
135
|
-
| 方法名
|
|
136
|
-
|
|
|
137
|
-
| `validate` | 表单校验,通过 `$refs` 调用,返回 Promise | —
|
|
132
|
+
| 方法名 | 说明 | 参数 |
|
|
133
|
+
| ---------- | ----------------------------------------- | ---- |
|
|
134
|
+
| `validate` | 表单校验,通过 `$refs` 调用,返回 Promise | — |
|
|
138
135
|
|
|
139
136
|
---
|
|
140
137
|
|
|
141
138
|
### Events
|
|
142
139
|
|
|
143
|
-
| 事件名
|
|
144
|
-
|
|
|
145
|
-
| `change`
|
|
146
|
-
| `openCrmPerson` | 点击豁免险标题提示信息时触发,用于打开人员信息修改浮层(含 CRM 导入功能);不传该监听则豁免险中不显示相关提示 | —
|
|
147
|
-
| `reCalculate`
|
|
140
|
+
| 事件名 | 说明 | 回调参数 |
|
|
141
|
+
| --------------- | ------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
142
|
+
| `change` | 产品信息改变时触发 | `Function(product, options, inst)`;初始化时 `options` 为 `{ errorMsg }`;字段变更时 `options` 含 `{ type: 'change', insData: 险种, eleData: 元素, errorMsg }`;`inst` 为当前 Vue 实例 |
|
|
143
|
+
| `openCrmPerson` | 点击豁免险标题提示信息时触发,用于打开人员信息修改浮层(含 CRM 导入功能);不传该监听则豁免险中不显示相关提示 | — |
|
|
144
|
+
| `reCalculate` | 险种存在 `revalidateFlag` 且外部监听了该事件时触发,用于外部执行重算并回调通知组件 | `Function(inputData, params, resolve, reject)` |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const oneDayMillisecond = 24 * 3600 * 1000
|
|
1
|
+
const oneDayMillisecond = 24 * 3600 * 1000
|
|
2
2
|
|
|
3
3
|
export const EXPIRE_ENUM = [
|
|
4
4
|
{ value: 'NEVER', name: '永久有效', millisecond: 100 * 365 * oneDayMillisecond },
|
|
@@ -7,7 +7,7 @@ export const EXPIRE_ENUM = [
|
|
|
7
7
|
{ value: '7d', name: '7天有效', millisecond: 7 * oneDayMillisecond },
|
|
8
8
|
{ value: '15d', name: '15天有效', millisecond: 15 * oneDayMillisecond },
|
|
9
9
|
{ value: '30d', name: '30天有效', millisecond: 30 * oneDayMillisecond }
|
|
10
|
-
]
|
|
10
|
+
]
|
|
11
11
|
|
|
12
12
|
export const ACTION_ENUM = [
|
|
13
13
|
{
|
|
@@ -105,6 +105,6 @@ export const ACTION_ENUM = [
|
|
|
105
105
|
actionName: '反馈',
|
|
106
106
|
actionIcon: 'https://media.winbaoxian.com/assets-uploader/base_ss_common_widget_feedback%402x(1)-1774409691136.png'
|
|
107
107
|
}
|
|
108
|
-
]
|
|
108
|
+
]
|
|
109
109
|
|
|
110
|
-
export const SHARE_ENUM = ['wechat_friends', 'wechat_timeline', 'qq_friends', 'shareMiniProgram', 'system_share']
|
|
110
|
+
export const SHARE_ENUM = ['wechat_friends', 'wechat_timeline', 'qq_friends', 'shareMiniProgram', 'system_share']
|
|
@@ -20,17 +20,17 @@
|
|
|
20
20
|
</div>
|
|
21
21
|
</template>
|
|
22
22
|
<script lang="ts">
|
|
23
|
-
import vconsole from 'vconsole'
|
|
24
|
-
import { Toast, Button } from 'vant'
|
|
25
|
-
import ShareSheet from '../index.vue'
|
|
26
|
-
new vconsole()
|
|
23
|
+
import vconsole from 'vconsole'
|
|
24
|
+
import { Toast, Button } from 'vant'
|
|
25
|
+
import ShareSheet from '../index.vue'
|
|
26
|
+
new vconsole()
|
|
27
27
|
|
|
28
28
|
const shareInfo = () => ({
|
|
29
29
|
title: '分享面板', // 分享标题、type=2时表示视频标题
|
|
30
30
|
content: '分享内容的详细描述', // 分享内容的详细描述、type=2时表示视频描述
|
|
31
31
|
imgUrl: 'https://img.winbaoxian.com/static/app-zx-rule-pdf/allrule/20250325182134792.png',
|
|
32
32
|
shareUrl: location.href // 要分享的链接(一般为当前页面)、type=2时表示视频 url
|
|
33
|
-
})
|
|
33
|
+
})
|
|
34
34
|
export default {
|
|
35
35
|
components: {
|
|
36
36
|
[Button.name]: Button,
|
|
@@ -113,19 +113,19 @@ export default {
|
|
|
113
113
|
action: 'h5_feedback'
|
|
114
114
|
}
|
|
115
115
|
]
|
|
116
|
-
}
|
|
116
|
+
}
|
|
117
117
|
},
|
|
118
118
|
created() {},
|
|
119
119
|
methods: {
|
|
120
120
|
onExpire(o) {
|
|
121
|
-
console.log(o)
|
|
121
|
+
console.log(o)
|
|
122
122
|
},
|
|
123
123
|
onAction(item) {
|
|
124
124
|
if (item.customActionHandler) {
|
|
125
|
-
Toast('自定义行为')
|
|
125
|
+
Toast('自定义行为')
|
|
126
126
|
}
|
|
127
|
-
console.log(item)
|
|
127
|
+
console.log(item)
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
}
|
|
130
|
+
}
|
|
131
131
|
</script>
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { cloneDeep } from 'lodash'
|
|
2
|
-
import { EXPIRE_ENUM, SHARE_ENUM } from './constant'
|
|
1
|
+
import { cloneDeep } from 'lodash'
|
|
2
|
+
import { EXPIRE_ENUM, SHARE_ENUM } from './constant'
|
|
3
3
|
|
|
4
4
|
export function getExpireTimestamp(value) {
|
|
5
|
-
const expireItem = EXPIRE_ENUM.filter(e => !['NEVER'].includes(e.value)).find(e => e.value === value)
|
|
6
|
-
const expireTimestamp = expireItem ? new Date().getTime() + expireItem.millisecond : null
|
|
7
|
-
return expireTimestamp
|
|
5
|
+
const expireItem = EXPIRE_ENUM.filter(e => !['NEVER'].includes(e.value)).find(e => e.value === value)
|
|
6
|
+
const expireTimestamp = expireItem ? new Date().getTime() + expireItem.millisecond : null
|
|
7
|
+
return expireTimestamp
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export function shareHandler(item, expireValue) {
|
|
11
|
-
const shareItem = SHARE_ENUM.find(a => a === item.action)
|
|
12
|
-
const newItem = cloneDeep(item)
|
|
11
|
+
const shareItem = SHARE_ENUM.find(a => a === item.action)
|
|
12
|
+
const newItem = cloneDeep(item)
|
|
13
13
|
if (expireValue) {
|
|
14
|
-
newItem.expireTimestamp = getExpireTimestamp(expireValue)
|
|
14
|
+
newItem.expireTimestamp = getExpireTimestamp(expireValue)
|
|
15
15
|
}
|
|
16
16
|
if (newItem.expireTimestamp && newItem.shareUrl) {
|
|
17
|
-
newItem.shareUrl = newItem.shareUrl + (newItem.shareUrl.includes('?') ? '&' : '?') + 'wy_expire=' + newItem.expireTimestamp
|
|
17
|
+
newItem.shareUrl = newItem.shareUrl + (newItem.shareUrl.includes('?') ? '&' : '?') + 'wy_expire=' + newItem.expireTimestamp
|
|
18
18
|
}
|
|
19
19
|
if (shareItem) {
|
|
20
20
|
if (newItem.customActionHandler) {
|
|
21
|
-
newItem.customActionHandler(newItem)
|
|
21
|
+
newItem.customActionHandler(newItem)
|
|
22
22
|
} else {
|
|
23
23
|
if (newItem.action === 'shareMiniProgram') {
|
|
24
24
|
// https://docs.winbaoxian.cn/lib-app-webview-bridge1/#/api?id=%e8%b7%b3%e8%bd%ac-%e5%be%ae%e4%bf%a1%e5%b0%8f%e7%a8%8b%e5%ba%8f-gotonativeview-shareminiprogram
|
|
@@ -33,7 +33,7 @@ export function shareHandler(item, expireValue) {
|
|
|
33
33
|
description: newItem.description, // 小程序消息desc
|
|
34
34
|
imageUrl: newItem.imageUrl // 小程序消息封面图片,小于128k
|
|
35
35
|
}
|
|
36
|
-
})
|
|
36
|
+
})
|
|
37
37
|
}
|
|
38
38
|
} else {
|
|
39
39
|
// https://docs.winbaoxian.cn/#/api?id=%e5%88%86%e4%ba%ab%e5%8a%9f%e8%83%bd-app_share
|
|
@@ -47,13 +47,13 @@ export function shareHandler(item, expireValue) {
|
|
|
47
47
|
introduction: newItem.introduction, // 分享弹框的头部文案
|
|
48
48
|
shareChannel: [newItem.action], // qq_friends wechat_timeline wechat_friends system_share(保险师6.6.0开始支持);
|
|
49
49
|
type: newItem.type // 【3.11.0 支持】type=2代表分享的是视频、type=2时, 所需参数有: title、content、shareUrl、imgUrl【优先级低于小程序分享】
|
|
50
|
-
})
|
|
50
|
+
})
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
if (!shareItem && !newItem.customActionHandler) {
|
|
56
|
-
console.error('未定义分享行为:', newItem.action)
|
|
56
|
+
console.error('未定义分享行为:', newItem.action)
|
|
57
57
|
}
|
|
58
|
-
return newItem
|
|
58
|
+
return newItem
|
|
59
59
|
}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
@import (reference) 'variables.less';
|
|
2
|
+
|
|
3
|
+
.bxt-share-sheet {
|
|
4
|
+
color: #333;
|
|
5
|
+
background-color: transparent;
|
|
6
|
+
|
|
7
|
+
& .bxt-share-container {
|
|
8
|
+
position: absolute;
|
|
9
|
+
left: 0;
|
|
10
|
+
bottom: 0;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
justify-content: flex-end;
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 100%;
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
& .bxt-share-image {
|
|
20
|
+
padding: 30px 40px;
|
|
21
|
+
|
|
22
|
+
& img {
|
|
23
|
+
width: 100%;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
& .bxt-share-content {
|
|
28
|
+
background: white;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
& .bxt-expire {
|
|
32
|
+
padding: 15px 15px 15px 21px;
|
|
33
|
+
|
|
34
|
+
& .bxt-title {
|
|
35
|
+
display: flex;
|
|
36
|
+
|
|
37
|
+
& .bxt-tx {
|
|
38
|
+
font-size: 14px;
|
|
39
|
+
font-weight: bold;
|
|
40
|
+
font-weight: 500;
|
|
41
|
+
line-height: 17px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
& .bxt-description {
|
|
45
|
+
margin-left: 18px;
|
|
46
|
+
font-size: 13px;
|
|
47
|
+
line-height: 16px;
|
|
48
|
+
color: #666;
|
|
49
|
+
|
|
50
|
+
& .van-icon {
|
|
51
|
+
font-size: 15px;
|
|
52
|
+
color: #b5b5b5;
|
|
53
|
+
vertical-align: middle;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
& span {
|
|
57
|
+
margin-left: 3px;
|
|
58
|
+
vertical-align: middle;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
& .van-radio-group {
|
|
64
|
+
margin-top: 6px;
|
|
65
|
+
|
|
66
|
+
& .van-radio {
|
|
67
|
+
flex: 0 0 32%;
|
|
68
|
+
margin-top: 12px;
|
|
69
|
+
margin-right: 0;
|
|
70
|
+
|
|
71
|
+
& .van-radio__icon {
|
|
72
|
+
font-size: 15px;
|
|
73
|
+
line-height: 20px;
|
|
74
|
+
color: var(--bxt-primary);
|
|
75
|
+
vertical-align: middle;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
& .van-radio__label {
|
|
79
|
+
margin-left: 6px;
|
|
80
|
+
vertical-align: middle;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
& .bxt-explain {
|
|
87
|
+
font-size: 13px;
|
|
88
|
+
line-height: 19px;
|
|
89
|
+
color: #666;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
& .bxt-explain-title {
|
|
94
|
+
padding: 15px 21px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
& .bxt-explain-text {
|
|
98
|
+
padding: 12px 15px;
|
|
99
|
+
|
|
100
|
+
& .bxt-explain-text-content {
|
|
101
|
+
width: 100%;
|
|
102
|
+
display: -webkit-box;
|
|
103
|
+
-webkit-line-clamp: 3;
|
|
104
|
+
-webkit-box-orient: vertical;
|
|
105
|
+
overflow: hidden;
|
|
106
|
+
text-overflow: ellipsis;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
& .bxt-explain-text--copy {
|
|
111
|
+
padding: 12px 15px;
|
|
112
|
+
|
|
113
|
+
& .bxt-explain-text-wrapper {
|
|
114
|
+
padding: 12px 15px;
|
|
115
|
+
background: #f5f5f5;
|
|
116
|
+
border-radius: 6px;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
& .bxt-share {
|
|
121
|
+
& .bxt-share-wrapper {
|
|
122
|
+
display: flex;
|
|
123
|
+
justify-content: flex-start;
|
|
124
|
+
padding: 20px 15px;
|
|
125
|
+
overflow: auto;
|
|
126
|
+
|
|
127
|
+
&::-webkit-scrollbar {
|
|
128
|
+
display: none;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
& figure {
|
|
132
|
+
flex: 0 0 25%;
|
|
133
|
+
display: flex;
|
|
134
|
+
flex-direction: column;
|
|
135
|
+
justify-content: center;
|
|
136
|
+
align-items: center;
|
|
137
|
+
|
|
138
|
+
& .bxt-empty-image {
|
|
139
|
+
display: flex;
|
|
140
|
+
align-items: center;
|
|
141
|
+
justify-content: center;
|
|
142
|
+
width: 50px;
|
|
143
|
+
height: 50px;
|
|
144
|
+
background: #f3f7f9;
|
|
145
|
+
border-radius: 50px;
|
|
146
|
+
overflow: hidden;
|
|
147
|
+
|
|
148
|
+
& img {
|
|
149
|
+
display: block;
|
|
150
|
+
width: 100%;
|
|
151
|
+
margin: 0 auto;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
& figcaption {
|
|
156
|
+
width: 100%;
|
|
157
|
+
height: 15px;
|
|
158
|
+
margin-top: 5px;
|
|
159
|
+
font-size: 12px;
|
|
160
|
+
line-height: 15px;
|
|
161
|
+
white-space: nowrap;
|
|
162
|
+
color: #666;
|
|
163
|
+
text-align: center;
|
|
164
|
+
overflow: hidden;
|
|
165
|
+
text-overflow: ellipsis;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
& .bxt-share-wrapper.more {
|
|
171
|
+
& figure {
|
|
172
|
+
flex: 0 0 23%;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
& .bxt-fooer {
|
|
178
|
+
.bxt-safe-area-inset-bottom();
|
|
179
|
+
|
|
180
|
+
padding: 16px 15px;
|
|
181
|
+
font-size: 15px;
|
|
182
|
+
line-height: 18px;
|
|
183
|
+
text-align: center;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
& .bxt-bottom-border {
|
|
187
|
+
position: relative;
|
|
188
|
+
overflow: hidden;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
& .bxt-bottom-border::before {
|
|
192
|
+
position: absolute;
|
|
193
|
+
bottom: 0;
|
|
194
|
+
left: 15px;
|
|
195
|
+
width: 200%;
|
|
196
|
+
border-bottom: 1px solid #e5e5e5;
|
|
197
|
+
content: '';
|
|
198
|
+
transform: scale(0.5);
|
|
199
|
+
transform-origin: left center;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
@@ -65,12 +65,12 @@
|
|
|
65
65
|
</van-popup>
|
|
66
66
|
</template>
|
|
67
67
|
<script>
|
|
68
|
-
import { Popup, RadioGroup, Radio, Button } from 'vant'
|
|
69
|
-
import { get as _get, cloneDeep } from 'lodash'
|
|
70
|
-
import { textOverflowEllipsis } from 'packages/bxs-utils/planbook/index.ts'
|
|
71
|
-
import { EXPIRE_ENUM, ACTION_ENUM } from './constant'
|
|
72
|
-
import { getExpireTimestamp, shareHandler } from './handler'
|
|
73
|
-
import './index.
|
|
68
|
+
import { Popup, RadioGroup, Radio, Button } from 'vant'
|
|
69
|
+
import { get as _get, cloneDeep } from 'lodash'
|
|
70
|
+
import { textOverflowEllipsis } from 'packages/bxs-utils/planbook/index.ts'
|
|
71
|
+
import { EXPIRE_ENUM, ACTION_ENUM } from './constant'
|
|
72
|
+
import { getExpireTimestamp, shareHandler } from './handler'
|
|
73
|
+
import './index.less'
|
|
74
74
|
|
|
75
75
|
export default {
|
|
76
76
|
components: {
|
|
@@ -91,52 +91,52 @@ export default {
|
|
|
91
91
|
data() {
|
|
92
92
|
return {
|
|
93
93
|
expireValue: _get(this, 'expireData.value') || null
|
|
94
|
-
}
|
|
94
|
+
}
|
|
95
95
|
},
|
|
96
96
|
computed: {
|
|
97
97
|
visible: {
|
|
98
98
|
get() {
|
|
99
|
-
return this.value
|
|
99
|
+
return this.value
|
|
100
100
|
},
|
|
101
101
|
set(v) {
|
|
102
|
-
this.$emit('input', v)
|
|
102
|
+
this.$emit('input', v)
|
|
103
103
|
}
|
|
104
104
|
},
|
|
105
105
|
expireOptions() {
|
|
106
|
-
let options = cloneDeep(EXPIRE_ENUM)
|
|
106
|
+
let options = cloneDeep(EXPIRE_ENUM)
|
|
107
107
|
if (Array.isArray(_get(this, 'expireData.options'))) {
|
|
108
|
-
options = _get(this, 'expireData.options')
|
|
108
|
+
options = _get(this, 'expireData.options')
|
|
109
109
|
}
|
|
110
|
-
return options
|
|
110
|
+
return options
|
|
111
111
|
},
|
|
112
112
|
shareOptions() {
|
|
113
|
-
let options = []
|
|
113
|
+
let options = []
|
|
114
114
|
if (Array.isArray(this.shareActions)) {
|
|
115
115
|
options = this.shareActions.map(e => {
|
|
116
|
-
const defaultInfo = ACTION_ENUM.find(o => o.action === e.action)
|
|
117
|
-
e.actionName = e.actionName || _get(defaultInfo, 'actionName') || ''
|
|
118
|
-
e.actionIcon = e.actionIcon || _get(defaultInfo, 'actionIcon') || ''
|
|
119
|
-
return e
|
|
120
|
-
})
|
|
116
|
+
const defaultInfo = ACTION_ENUM.find(o => o.action === e.action)
|
|
117
|
+
e.actionName = e.actionName || _get(defaultInfo, 'actionName') || ''
|
|
118
|
+
e.actionIcon = e.actionIcon || _get(defaultInfo, 'actionIcon') || ''
|
|
119
|
+
return e
|
|
120
|
+
})
|
|
121
121
|
}
|
|
122
|
-
return options
|
|
122
|
+
return options
|
|
123
123
|
},
|
|
124
124
|
actionOptions() {
|
|
125
|
-
let options = []
|
|
125
|
+
let options = []
|
|
126
126
|
if (Array.isArray(this.featureActions)) {
|
|
127
127
|
options = this.featureActions.map(e => {
|
|
128
|
-
const defaultInfo = ACTION_ENUM.find(o => o.action === e.action)
|
|
129
|
-
e.actionName = e.actionName || _get(defaultInfo, 'actionName') || ''
|
|
130
|
-
e.actionIcon = e.actionIcon || _get(defaultInfo, 'actionIcon') || ''
|
|
131
|
-
return e
|
|
132
|
-
})
|
|
128
|
+
const defaultInfo = ACTION_ENUM.find(o => o.action === e.action)
|
|
129
|
+
e.actionName = e.actionName || _get(defaultInfo, 'actionName') || ''
|
|
130
|
+
e.actionIcon = e.actionIcon || _get(defaultInfo, 'actionIcon') || ''
|
|
131
|
+
return e
|
|
132
|
+
})
|
|
133
133
|
}
|
|
134
|
-
return options
|
|
134
|
+
return options
|
|
135
135
|
}
|
|
136
136
|
},
|
|
137
137
|
created() {
|
|
138
138
|
if (this.explainData) {
|
|
139
|
-
this.onClickCopy(this.explainData)
|
|
139
|
+
this.onClickCopy(this.explainData)
|
|
140
140
|
}
|
|
141
141
|
},
|
|
142
142
|
mounted() {},
|
|
@@ -144,35 +144,35 @@ export default {
|
|
|
144
144
|
textOverflowEllipsis,
|
|
145
145
|
onClickOverlay() {
|
|
146
146
|
if (this.closeOnClickOverlay) {
|
|
147
|
-
this.visible = false
|
|
147
|
+
this.visible = false
|
|
148
148
|
}
|
|
149
149
|
},
|
|
150
150
|
onClickAfterExpire() {
|
|
151
|
-
const url = _get(this, 'expireData.urlAfterExpire')
|
|
151
|
+
const url = _get(this, 'expireData.urlAfterExpire')
|
|
152
152
|
if (url) {
|
|
153
|
-
location.href = url
|
|
153
|
+
location.href = url
|
|
154
154
|
}
|
|
155
155
|
},
|
|
156
156
|
onClickExpire(o) {
|
|
157
|
-
this.$emit('expire', o)
|
|
157
|
+
this.$emit('expire', o)
|
|
158
158
|
},
|
|
159
159
|
onClickCopy(item) {
|
|
160
160
|
if (item.text && item.copy) {
|
|
161
|
-
appBridge.copyString(item.text)
|
|
161
|
+
appBridge.copyString(item.text)
|
|
162
162
|
}
|
|
163
163
|
},
|
|
164
164
|
onClickShare(item) {
|
|
165
|
-
const newItem = shareHandler(item, this.expireValue)
|
|
166
|
-
this.$emit('action', newItem)
|
|
165
|
+
const newItem = shareHandler(item, this.expireValue)
|
|
166
|
+
this.$emit('action', newItem)
|
|
167
167
|
},
|
|
168
168
|
onClickAction(item) {
|
|
169
|
-
const newItem = cloneDeep(item)
|
|
170
|
-
const expireTimestamp = getExpireTimestamp(this.expireValue)
|
|
169
|
+
const newItem = cloneDeep(item)
|
|
170
|
+
const expireTimestamp = getExpireTimestamp(this.expireValue)
|
|
171
171
|
if (expireTimestamp) {
|
|
172
|
-
newItem.expireTimestamp = expireTimestamp
|
|
172
|
+
newItem.expireTimestamp = expireTimestamp
|
|
173
173
|
}
|
|
174
|
-
this.$emit('action', newItem)
|
|
174
|
+
this.$emit('action', newItem)
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
|
-
}
|
|
177
|
+
}
|
|
178
178
|
</script>
|