bxs-tools-ui 3.1.2 → 3.1.3

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/lib/index.js CHANGED
@@ -47856,11 +47856,6 @@
47856
47856
  });
47857
47857
  }
47858
47858
  return options;
47859
- },
47860
- actionTypeLength: function actionTypeLength() {
47861
- return [this.shareOptions, this.actionOptions].filter(function (e) {
47862
- return e.length;
47863
- }).length;
47864
47859
  }
47865
47860
  },
47866
47861
  created: function created() {
@@ -48015,7 +48010,7 @@
48015
48010
  staticClass: "bxt-share bxt-bottom-border"
48016
48011
  }, [_c('div', {
48017
48012
  staticClass: "bxt-share-wrapper",
48018
- class: [_vm.shareOptions.length > 4 || _vm.actionTypeLength > 1 ? 'more' : '']
48013
+ class: [_vm.shareOptions.length > 4 ? 'more' : '']
48019
48014
  }, _vm._l(_vm.shareOptions, function (o) {
48020
48015
  return _c('figure', {
48021
48016
  key: o.action,
@@ -48036,7 +48031,7 @@
48036
48031
  staticClass: "bxt-share bxt-bottom-border"
48037
48032
  }, [_c('div', {
48038
48033
  staticClass: "bxt-share-wrapper",
48039
- class: [_vm.actionOptions.length > 4 || _vm.actionTypeLength > 1 ? 'more' : '']
48034
+ class: [_vm.actionOptions.length > 4 ? 'more' : '']
48040
48035
  }, _vm._l(_vm.actionOptions, function (o) {
48041
48036
  return _c('figure', {
48042
48037
  key: o.action,
@@ -48109,7 +48104,7 @@
48109
48104
  install(window.Vue);
48110
48105
  }
48111
48106
  var index = {
48112
- version: '3.1.2',
48107
+ version: '3.1.3',
48113
48108
  install: install
48114
48109
  };
48115
48110
 
@@ -1 +1 @@
1
- *{margin:0;padding:0}body{color:#333}dl,ul{list-style:none}img{max-width:100%}a{color:#333;display:block;text-decoration:none}em{font-style:normal}article,aside,footer,header,nav,section{display:block}.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:#0a64fe;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:center;-moz-box-pack:center;-ms-flex-pack:center;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-justify-content:center;justify-content:center;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{-webkit-box-pack:start;-moz-box-pack:start;-ms-flex-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start}.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:after{content:"";display:block;height:constant(safe-area-inset-bottom);height:env(safe-area-inset-bottom)}.bxt-share-sheet .bxt-fooer{font-size:15px;line-height:18px;padding:16px 15px;text-align:center}.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%}
1
+ *{margin:0;padding:0}body{color:#333}dl,ul{list-style:none}img{max-width:100%}a{color:#333;display:block;text-decoration:none}em{font-style:normal}article,aside,footer,header,nav,section{display:block}.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:#0a64fe;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:after{content:"";display:block;height:constant(safe-area-inset-bottom);height:env(safe-area-inset-bottom)}.bxt-share-sheet .bxt-fooer{font-size:15px;line-height:18px;padding:16px 15px;text-align:center}.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%}
@@ -8762,11 +8762,6 @@
8762
8762
  });
8763
8763
  }
8764
8764
  return options;
8765
- },
8766
- actionTypeLength: function actionTypeLength() {
8767
- return [this.shareOptions, this.actionOptions].filter(function (e) {
8768
- return e.length;
8769
- }).length;
8770
8765
  }
8771
8766
  },
8772
8767
  created: function created() {
@@ -8933,7 +8928,7 @@
8933
8928
  staticClass: "bxt-share bxt-bottom-border"
8934
8929
  }, [_c('div', {
8935
8930
  staticClass: "bxt-share-wrapper",
8936
- class: [_vm.shareOptions.length > 4 || _vm.actionTypeLength > 1 ? 'more' : '']
8931
+ class: [_vm.shareOptions.length > 4 ? 'more' : '']
8937
8932
  }, _vm._l(_vm.shareOptions, function (o) {
8938
8933
  return _c('figure', {
8939
8934
  key: o.action,
@@ -8954,7 +8949,7 @@
8954
8949
  staticClass: "bxt-share bxt-bottom-border"
8955
8950
  }, [_c('div', {
8956
8951
  staticClass: "bxt-share-wrapper",
8957
- class: [_vm.actionOptions.length > 4 || _vm.actionTypeLength > 1 ? 'more' : '']
8952
+ class: [_vm.actionOptions.length > 4 ? 'more' : '']
8958
8953
  }, _vm._l(_vm.actionOptions, function (o) {
8959
8954
  return _c('figure', {
8960
8955
  key: o.action,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bxs-tools-ui",
3
- "version": "3.1.2",
3
+ "version": "3.1.3",
4
4
  "description": "微易前端业务组件",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
package/packages/index.ts CHANGED
@@ -50,6 +50,6 @@ export {
50
50
  }
51
51
 
52
52
  export default {
53
- version: '3.1.2',
53
+ version: '3.1.3',
54
54
  install
55
55
  }
@@ -122,7 +122,7 @@
122
122
  & .bxt-share {
123
123
  & .bxt-share-wrapper {
124
124
  display: flex;
125
- justify-content: center;
125
+ justify-content: flex-start;
126
126
  padding: 20px 15px;
127
127
  overflow: auto;
128
128
 
@@ -170,8 +170,6 @@
170
170
  }
171
171
 
172
172
  & .bxt-share-wrapper.more {
173
- justify-content: flex-start;
174
-
175
173
  & figure {
176
174
  flex: 0 0 23%;
177
175
  }
@@ -36,7 +36,7 @@
36
36
  </section>
37
37
  <slot name="header"></slot>
38
38
  <section v-if="shareOptions.length" class="bxt-share bxt-bottom-border">
39
- <div class="bxt-share-wrapper" :class="[shareOptions.length > 4 || actionTypeLength > 1 ? 'more' : '']">
39
+ <div class="bxt-share-wrapper" :class="[shareOptions.length > 4 ? 'more' : '']">
40
40
  <figure v-for="o in shareOptions" :key="o.action" @click="onClickShare(o)">
41
41
  <div class="bxt-empty-image">
42
42
  <img v-if="o.actionIcon" :src="o.actionIcon" alt="icon" />
@@ -46,7 +46,7 @@
46
46
  </div>
47
47
  </section>
48
48
  <section v-if="actionOptions.length" class="bxt-share bxt-bottom-border">
49
- <div class="bxt-share-wrapper" :class="[actionOptions.length > 4 || actionTypeLength > 1 ? 'more' : '']">
49
+ <div class="bxt-share-wrapper" :class="[actionOptions.length > 4 ? 'more' : '']">
50
50
  <figure v-for="o in actionOptions" :key="o.action" @click="onClickAction(o)">
51
51
  <div class="bxt-empty-image">
52
52
  <img v-if="o.actionIcon" :src="o.actionIcon" alt="icon" />
@@ -132,9 +132,6 @@ export default {
132
132
  });
133
133
  }
134
134
  return options;
135
- },
136
- actionTypeLength() {
137
- return [this.shareOptions, this.actionOptions].filter(e => e.length).length;
138
135
  }
139
136
  },
140
137
  created() {
@@ -1,27 +1,34 @@
1
1
  ## 分享面板(ShareSheet)
2
- 通过底部弹窗提供分享渠道/功能入口,并支持分享有效期、分享后提示与复制文案。
3
-
4
- **内容**:
5
- - introduceImage:顶部说明图(可选)
6
- - expireData:分享有效期(可选)
7
- - explainData:分享说明(可选)
8
- - shareActions:分享渠道入口(可选)
9
- - featureActions:功能入口(可选)
10
- - 底部取消按钮:关闭弹窗
11
2
 
3
+ 通过底部全屏弹窗(`van-popup`,挂载到 `body`,底部安全区)提供分享渠道/功能入口,并支持分享说明、分享有效期与复制文案。
4
+
5
+ **自上而下展示顺序**:
6
+
7
+ 1. `introduceImage`:顶部说明图(可选)
8
+ 2. `explainData`:分享说明标题与正文(可选)
9
+ 3. `expireData`:分享有效期(可选)
10
+ 4. `header` 插槽:自定义内容(可选)
11
+ 5. `shareActions`:分享渠道入口(可选)
12
+ 6. `featureActions`:功能入口(可选)
13
+ 7. 底部「取消」:关闭弹窗
14
+
15
+ ---
12
16
 
13
17
  ### 模块引用(import)
18
+
14
19
  ```javascript
15
20
  import { ShareSheet } from 'bxs-tools-ui';
16
21
  export default {
17
22
  components: {
18
23
  ShareSheet
19
24
  }
20
- }
21
- ```
25
+ };
26
+ ```
22
27
 
28
+ ---
23
29
 
24
30
  ### 示例(example)
31
+
25
32
  ```html
26
33
  <template>
27
34
  <ShareSheet
@@ -55,6 +62,7 @@ export default {
55
62
  urlAfterExpire: 'https://pbf.winbaoxian.cn/planBook/projectGroup/feedback/index.html'
56
63
  },
57
64
  explainData: {
65
+ title: '分享说明',
58
66
  text: '分享后推广费及奖励将不可见,请放心分享,用户投保成功,推广费及奖励可拿。',
59
67
  copy: true
60
68
  },
@@ -96,7 +104,9 @@ export default {
96
104
  };
97
105
  },
98
106
  methods: {
99
- onExpire(o) { console.log(o); },
107
+ onExpire(o) {
108
+ console.log(o);
109
+ },
100
110
  onAction(item) {
101
111
  if (item.customActionHandler) {
102
112
  // 自定义行为(由调用方处理)
@@ -107,66 +117,85 @@ export default {
107
117
  };
108
118
  </script>
109
119
  ```
110
-
120
+
121
+ ---
122
+
111
123
  ### Attributes
112
- | 参数| 说明 | 类型 | 默认值 |
124
+
125
+ 根级 props 控制弹窗与各区块是否出现;对象/数组的字段见下方分表。
126
+
127
+
128
+ #### 根级 props
129
+
130
+ | 参数 | 类型 | 默认值 | 说明 |
113
131
  | --- | --- | --- | --- |
114
- | value / v-model | 控制弹窗显示/隐藏 | Boolean | false |
115
- | closeOnClickOverlay | 是否点击外层区域关闭 | Boolean | false |
116
- | introduceImage | 顶部说明图地址 | String | '' |
117
- | expireData | 分享有效期配置(是否展示由该对象是否存在决定) | Object | {} |
118
- | explainData | 分享后说明配置(仅当 `explainData.text` 存在时展示) | Object | {} |
119
- | shareActions | 分享渠道入口列表 | Array | [] |
120
- | featureActions | 功能入口列表 | Array | [] |
121
-
122
- #### expireData 对象
123
- | 参数| 说明 | 类型 | 默认值 |
132
+ | `value` / `v-model` | Boolean | `false` | 弹窗显示/隐藏 |
133
+ | `closeOnClickOverlay` | Boolean | `false` | 是否允许通过点击遮罩层关闭(不包括说明图与内容区) |
134
+ | `introduceImage` | String | — | 顶部说明图地址 |
135
+ | `expireData` | Object | — | 传入则展示「分享有效期」模块 |
136
+ | `explainData` | Object | — | `title` 或 `text` 有值则展示说明区 |
137
+ | `shareActions` | Array | `[]` | 分享渠道入口列表 |
138
+ | `featureActions` | Array | `[]` | 功能入口列表 |
139
+
140
+
141
+ #### expireData
142
+
143
+ | 参数 | 类型 | 默认值 | 说明 |
124
144
  | --- | --- | --- | --- |
125
- | value | 默认/当前选中的有效期值(用于计算 `expireTimestamp` 并在分享链接上追加 `wy_expire`) | String | - |
126
- | options | 可选,覆盖有效期单选项列表(仅用于展示;`value` 仍建议使用组件内枚举值以便计算 `expireTimestamp`) | Array | - |
127
- | urlAfterExpire | 点击“链接失效后客户看到什么?”的跳转地址 | String | - |
145
+ | `value` | String | — | 当前选中的有效期;参与 `expireTimestamp` 与 `shareUrl` 上的 `wy_expire`;`NEVER` 不生成时间戳 |
146
+ | `options` | Array | 有 | 可选,数组元素的 key,建议使用:NEVER、24h、72h、7d、15d、30d |
147
+ | `urlAfterExpire` | String | — | 「链接失效后客户看到什么?」的跳转地址 |
148
+
128
149
 
129
- 说明:组件内有效期枚举由 `constant.js` 定义,`value` 建议使用下列任意值:`NEVER`、`24h`、`72h`、`7d`、`15d`、`30d`。
150
+ #### explainData
130
151
 
131
- #### explainData 对象
132
- | 参数| 说明 | 类型 | 默认值 |
152
+ | 参数 | 类型 | 默认值 | 说明 |
133
153
  | --- | --- | --- | --- |
134
- | text | 分享后说明文案 | String | - |
135
- | copy | 点击文案时是否复制 `text`(会调用 `appBridge.copyString`) | Boolean | false |
154
+ | `title` | String | — | 说明区标题(带下边框样式) |
155
+ | `text` | String | — | 说明正文 |
156
+ | `copy` | Boolean | — | 为 `true` 且有 `text` 时,点击正文调用 `appBridge.copyString(text)` |
157
+
158
+
159
+ #### shareActions(单项)
136
160
 
137
- #### shareActions 数组(shareAction 对象)
138
- 每一项至少需要 `action` 字段。点击分享项后会触发 `action` 事件;并且会尝试调用原生 `appBridge.share` / `appBridge.gotoNativeView`(或调用自定义 `customActionHandler`)。
161
+ 若 `action` 属于 `SHARE_ENUM` 且未提供 `customActionHandler`,会尝试调用 `appBridge.share` 或 `appBridge.gotoNativeView`(小程序)。
139
162
 
140
- | 参数| 说明 | 类型 | 默认值 |
163
+ | 参数 | 类型 | 默认值 | 说明 |
141
164
  | --- | --- | --- | --- |
142
- | action | 分享渠道类型;组件从 `ACTION_ENUM` 读取对应的默认 `actionName`/`actionIcon`,并由 `SHARE_ENUM` 决定是否触发原生分享能力 | String | - |
143
- | actionName | 覆盖展示文案(可选) | String | - |
144
- | actionIcon | 覆盖展示图标(可选) | String | - |
145
- | customActionHandler | 自定义分享处理函数:存在时将调用 `customActionHandler(newItem)`,并跳过默认原生分享逻辑 | Function | - |
165
+ | `action` | String | — | 必传,渠道类型;默认文案/图标来自 `ACTION_ENUM`;是否走内置原生分享由 `SHARE_ENUM` 决定 |
166
+ | `actionName` | String | — | 可选,覆盖展示文案 |
167
+ | `actionIcon` | String | — | 可选,覆盖展示图标 |
168
+ | `customActionHandler` | Function | — | 存在时执行 `customActionHandler(newItem)`,并跳过内置原生分享 |
169
+
170
+ **SHARE_ENUM**(内置原生分享):
171
+ * `wechat_friends`
172
+ * `wechat_timeline`
173
+ * `qq_friends`
174
+ * `shareMiniProgram`
175
+ * `system_share`。
176
+
177
+
178
+ **透传字段**(按渠道自行传入,组件透传给原生):
146
179
 
147
- 触发原生分享(`SHARE_ENUM`)的 action 值:`wechat_friends`、`wechat_timeline`、`qq_friends`、`shareMiniProgram`、`system_share`。不在此列表中的 action 仅触发 `action` 事件,不会调用原生能力(除非提供 `customActionHandler`)。
180
+ - 非小程序:`title`、`content`、`imgUrl`、`shareUrl`;可选 `introduction`、`imageData`、`type`
181
+ - 小程序:`webPageUrl`、`userName`、`path`、`title`、`description`、`imageUrl`
148
182
 
149
- 分享数据字段(由调用方按 action 自行提供;组件内部透传给原生能力):
150
- - 非 `shareMiniProgram`:常用字段包括 `title`、`content`、`imgUrl`、`shareUrl`(组件内部会额外读取 `introduction`、`imageData`、`type`,若你们业务需要可一并传入)
151
- - `shareMiniProgram`:常用字段包括 `webPageUrl`、`userName`、`path`、`title`、`description`、`imageUrl`
183
+ **链接过期**:当能算出 `expireTimestamp` 且该项有 `shareUrl` 时,会追加 `wy_expire=<expireTimestamp>`。
152
184
 
153
- 有效期追加逻辑:
154
- - 当选择了有效期会计算出 `expireTimestamp`,并且该分享项存在 `shareUrl` 时,会在 `shareUrl` 上追加查询参数:`wy_expire=<expireTimestamp>`。
155
185
 
156
- #### featureActions 数组(featureAction 对象)
157
- 每一项至少需要 `action` 字段。点击后触发 `action` 事件;组件本身不会在这里直接调用原生分享能力,仅会在满足有效期时给事件回参补充 `expireTimestamp`(若命中组件内枚举可计算)。
186
+ #### featureActions(单项)
158
187
 
159
- | 参数| 说明 | 类型 | 默认值 |
188
+ | 参数 | 类型 | 默认值 | 说明 |
160
189
  | --- | --- | --- | --- |
161
- | action | 功能类型;组件从 `ACTION_ENUM` 读取对应的默认 `actionName`/`actionIcon` | String | - |
162
- | actionName | 覆盖展示文案(可选) | String | - |
163
- | actionIcon | 覆盖展示图标(可选) | String | - |
164
- | customActionHandler | 可选字段:组件只会原样透传;是否调用由调用方在 `@action` 里自行处理 | Function | - |
190
+ | `action` | String | — | 功能类型;默认文案/图标来自 `ACTION_ENUM` |
191
+ | `actionName` | String | — | 可选,覆盖展示文案 |
192
+ | `actionIcon` | String | — | 可选,覆盖展示图标 |
193
+ | `customActionHandler` | Function | — | 可选,原样透传;是否在业务里调用由 `@action` 自行处理 |
165
194
 
166
- #### 内置 action 枚举(ACTION_ENUM)
167
- `ACTION_ENUM` 仅提供默认的 `actionName` 和 `actionIcon`。未在枚举中定义的 `action` 值也可正常传入,仅需自行提供 `actionName`/`actionIcon`。
168
195
 
169
- | action | 默认文案 |
196
+ #### 内置 action 文案(ACTION_ENUM)
197
+
198
+ | `action` | 默认文案 |
170
199
  | --- | --- |
171
200
  | `wechat_friends` | 微信好友 |
172
201
  | `wechat_timeline` | 朋友圈 |
@@ -188,15 +217,24 @@ export default {
188
217
  | `h5_cancel_frequently_used` | 取消常用 |
189
218
  | `h5_feedback` | 反馈 |
190
219
 
220
+ ---
221
+
191
222
  ### Methods
192
- 无内置方法(当前组件仅通过属性/事件交互)。
223
+
224
+ -
225
+
226
+ ---
193
227
 
194
228
  ### Events
195
- | 方法名 | 说明 | 参数 | 备注 |
229
+
230
+ | 事件名 | 说明 | 参数 | 备注 |
196
231
  | --- | --- | --- | --- |
197
- | input | `v-model` 对应的值更新 | Boolean | 通过组件内部 `visible` 的 setter 触发 |
198
- | expire | 切换有效期单选项时触发 | Object | 单选项对象(包含 `value`/`name`/`millisecond`) |
199
- | action | 点击分享/功能入口时触发 | Object | shareActions:为 `shareHandler` 处理后的结果;featureActions:为克隆后的结果并可能附加 `expireTimestamp` |
232
+ | `input` | `v-model` 同步 | Boolean | 弹窗显隐变化时触发 |
233
+ | `expire` | 切换有效期单选项 | Object | 含 `value`、`name`、`millisecond` 等 |
234
+ | `action` | 点击分享或功能入口 | Object | 分享项:经 `shareHandler` 处理;功能项:深拷贝,可能含 `expireTimestamp` |
235
+
236
+ ---
200
237
 
201
238
  ### Slot
202
- - `header`:顶部内容插槽(会插在有效期/说明区域之后、分享列表之前)
239
+
240
+ - `header`:位于**有效期模块之后**、**分享渠道列表之前**。