bxs-tools-ui 3.0.8-1 → 3.0.8
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/es/index.js +1 -1
- package/es/share-sheet/index.css +1 -0
- package/es/share-sheet/index.js +428 -0
- package/lib/index.js +1 -1
- package/lib/share-sheet/index.css +1 -0
- package/lib/share-sheet/index.js +426 -0
- package/package.json +1 -1
- package/packages/index.ts +1 -1
package/es/index.js
CHANGED
|
@@ -39638,7 +39638,7 @@ if (typeof window !== 'undefined' && window.Vue) {
|
|
|
39638
39638
|
install(window.Vue);
|
|
39639
39639
|
}
|
|
39640
39640
|
const index = {
|
|
39641
|
-
version: '3.0.8
|
|
39641
|
+
version: '3.0.8',
|
|
39642
39642
|
install: install
|
|
39643
39643
|
};
|
|
39644
39644
|
|
|
@@ -0,0 +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;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;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;padding:15px 21px}.bxt-share-sheet .bxt-explain.copy{padding:12px 15px}.bxt-share-sheet .bxt-explain.copy .bxt-explain-text{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-flex:0 0 25%;-ms-flex:0 0 25%;flex:0 0 25%}.bxt-share-sheet .bxt-share .bxt-share-wrapper figure .bxt-empty-image{-webkit-box-align:center;-moz-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-moz-box-pack:center;-ms-flex-pack:center;-webkit-align-items:center;align-items:center;background:#f3f7f9;border-radius:50px;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;height:50px;-webkit-justify-content:center;justify-content:center;overflow:hidden;width:50px}.bxt-share-sheet .bxt-share .bxt-share-wrapper figure .bxt-empty-image img{display:block;width:100%}.bxt-share-sheet .bxt-share .bxt-share-wrapper figure figcaption{color:#666;font-size:12px;line-height:15px;margin-top:5px;text-align:center}.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:0;margin-left:15px;margin-right:auto;position:absolute;width:100%}
|
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
import 'vant/lib/button/index.css';
|
|
2
|
+
import _Button from 'vant/lib/button';
|
|
3
|
+
import 'vant/lib/radio/index.css';
|
|
4
|
+
import _Radio from 'vant/lib/radio';
|
|
5
|
+
import 'vant/lib/radio-group/index.css';
|
|
6
|
+
import _RadioGroup from 'vant/lib/radio-group';
|
|
7
|
+
import 'vant/lib/popup/index.css';
|
|
8
|
+
import _Popup from 'vant/lib/popup';
|
|
9
|
+
import { get, cloneDeep } from 'lodash';
|
|
10
|
+
|
|
11
|
+
function _typeof(o) {
|
|
12
|
+
"@babel/helpers - typeof";
|
|
13
|
+
|
|
14
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
15
|
+
return typeof o;
|
|
16
|
+
} : function (o) {
|
|
17
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
18
|
+
}, _typeof(o);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function toPrimitive(t, r) {
|
|
22
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
23
|
+
var e = t[Symbol.toPrimitive];
|
|
24
|
+
if (void 0 !== e) {
|
|
25
|
+
var i = e.call(t, r);
|
|
26
|
+
if ("object" != _typeof(i)) return i;
|
|
27
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
28
|
+
}
|
|
29
|
+
return ("string" === r ? String : Number)(t);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function toPropertyKey(t) {
|
|
33
|
+
var i = toPrimitive(t, "string");
|
|
34
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function _defineProperty(e, r, t) {
|
|
38
|
+
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
39
|
+
value: t,
|
|
40
|
+
enumerable: true,
|
|
41
|
+
configurable: true,
|
|
42
|
+
writable: true
|
|
43
|
+
}) : e[r] = t, e;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
var oneDayMillisecond = 24 * 3600 * 1000;
|
|
47
|
+
var EXPIRE_ENUM = [{
|
|
48
|
+
value: 'NEVER',
|
|
49
|
+
name: '永久有效',
|
|
50
|
+
millisecond: 100 * 365 * oneDayMillisecond
|
|
51
|
+
}, {
|
|
52
|
+
value: '24h',
|
|
53
|
+
name: '24小时有效',
|
|
54
|
+
millisecond: oneDayMillisecond
|
|
55
|
+
}, {
|
|
56
|
+
value: '72h',
|
|
57
|
+
name: '72小时有效',
|
|
58
|
+
millisecond: 3 * oneDayMillisecond
|
|
59
|
+
}, {
|
|
60
|
+
value: '7d',
|
|
61
|
+
name: '7天有效',
|
|
62
|
+
millisecond: 7 * oneDayMillisecond
|
|
63
|
+
}, {
|
|
64
|
+
value: '15d',
|
|
65
|
+
name: '15天有效',
|
|
66
|
+
millisecond: 15 * oneDayMillisecond
|
|
67
|
+
}, {
|
|
68
|
+
value: '30d',
|
|
69
|
+
name: '30天有效',
|
|
70
|
+
millisecond: 30 * oneDayMillisecond
|
|
71
|
+
}];
|
|
72
|
+
var SHARE_ENUM = [{
|
|
73
|
+
action: 'wechat_friends',
|
|
74
|
+
actionName: '微信好友',
|
|
75
|
+
actionIcon: 'https://media.winbaoxian.com/assets-uploader/base_ss_share_widget_wechat%402x-1774342740104.png'
|
|
76
|
+
}, {
|
|
77
|
+
action: 'wechat_timeline',
|
|
78
|
+
actionName: '朋友圈',
|
|
79
|
+
actionIcon: 'https://media.winbaoxian.com/assets-uploader/base_ss_share_widget_friend_circle%402x-1774343672850.png'
|
|
80
|
+
}, {
|
|
81
|
+
action: 'qq_friends',
|
|
82
|
+
actionName: 'QQ',
|
|
83
|
+
actionIcon: 'https://media.winbaoxian.com/assets-uploader/base_ss_share_widget_qq%402x-1774344790639.png'
|
|
84
|
+
}, {
|
|
85
|
+
action: 'miniProgramData',
|
|
86
|
+
actionName: '小程序',
|
|
87
|
+
actionIcon: 'https://media.winbaoxian.com/assets-uploader/base_ss_share_widget_mini_program_data%402x-1774344809770.png'
|
|
88
|
+
}, {
|
|
89
|
+
action: 'ding_talk',
|
|
90
|
+
actionName: '钉钉',
|
|
91
|
+
actionIcon: 'https://media.winbaoxian.com/assets-uploader/base_ss_share_widget_ding_talk%402x-1774344828781.png'
|
|
92
|
+
}, {
|
|
93
|
+
action: 'system_share',
|
|
94
|
+
actionName: '系统分享',
|
|
95
|
+
actionIcon: 'https://media.winbaoxian.com/assets-uploader/base_ss_share_widget_system_share%402x-1774344871114.png'
|
|
96
|
+
}];
|
|
97
|
+
var ACTION_ENUM = [{
|
|
98
|
+
action: 'collect',
|
|
99
|
+
actionName: '收藏',
|
|
100
|
+
actionIcon: 'https://media.winbaoxian.com/assets-uploader/base_ss_common_widget_collect%402x-1774346843924.png'
|
|
101
|
+
}, {
|
|
102
|
+
action: 'collectCancel',
|
|
103
|
+
actionName: '取消收藏',
|
|
104
|
+
actionIcon: 'https://media.winbaoxian.com/assets-uploader/base_ss_common_widget_un_collect%402x-1774346970606.png'
|
|
105
|
+
}, {
|
|
106
|
+
action: 'report',
|
|
107
|
+
actionName: '举报',
|
|
108
|
+
actionIcon: 'https://media.winbaoxian.com/assets-uploader/base_ss_common_widget_report%402x-1774347070199.png'
|
|
109
|
+
}, {
|
|
110
|
+
action: 'delete',
|
|
111
|
+
actionName: '删除',
|
|
112
|
+
actionIcon: 'https://media.winbaoxian.com/assets-uploader/base_ss_common_widget_delete%402x-1774347034108.png'
|
|
113
|
+
}, {
|
|
114
|
+
action: 'claim',
|
|
115
|
+
actionName: '理赔',
|
|
116
|
+
actionIcon: 'https://media.winbaoxian.com/assets-uploader/base_ss_common_widget_claim%402x-1774347019973.png'
|
|
117
|
+
}, {
|
|
118
|
+
action: 'qr_scan',
|
|
119
|
+
actionName: '扫一扫',
|
|
120
|
+
actionIcon: 'https://media.winbaoxian.com/assets-uploader/base_ss_common_widget_qr_scan%402x-1774346940066.png'
|
|
121
|
+
}, {
|
|
122
|
+
action: 'text_zoom',
|
|
123
|
+
actionName: '文字缩放',
|
|
124
|
+
actionIcon: 'https://media.winbaoxian.com/assets-uploader/base_ss_common_widget_text_zoom%402x-1774346957305.png'
|
|
125
|
+
}, {
|
|
126
|
+
action: 'h5_mark_frequently_used',
|
|
127
|
+
actionName: '设为常用',
|
|
128
|
+
actionIcon: 'https://media.winbaoxian.com/assets-uploader/base_ss_common_widget_mark_frequently_used%402x-1774346894696.png'
|
|
129
|
+
}, {
|
|
130
|
+
action: 'h5_cancel_frequently_used',
|
|
131
|
+
actionName: '取消常用',
|
|
132
|
+
actionIcon: 'https://media.winbaoxian.com/assets-uploader/base_ss_common_widget_cancel_frequently_used%402x-1774347234796.png'
|
|
133
|
+
}, {
|
|
134
|
+
action: 'h5_feedback',
|
|
135
|
+
actionName: '反馈',
|
|
136
|
+
actionIcon: 'https://media.winbaoxian.com/assets-uploader/base_ss_common_widget_feedback%402x(1)-1774409691136.png'
|
|
137
|
+
}];
|
|
138
|
+
|
|
139
|
+
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; }
|
|
140
|
+
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; }
|
|
141
|
+
const script = {
|
|
142
|
+
components: _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, _Popup.name, _Popup), _RadioGroup.name, _RadioGroup), _Radio.name, _Radio), _Button.name, _Button),
|
|
143
|
+
props: {
|
|
144
|
+
value: Boolean,
|
|
145
|
+
introduceImage: String,
|
|
146
|
+
expireData: Object,
|
|
147
|
+
explainData: Object,
|
|
148
|
+
shareItemInfo: Array,
|
|
149
|
+
actionItemInfo: Array
|
|
150
|
+
},
|
|
151
|
+
data: function data() {
|
|
152
|
+
return {
|
|
153
|
+
expireValue: get(this, 'expireData.value') || null
|
|
154
|
+
};
|
|
155
|
+
},
|
|
156
|
+
computed: {
|
|
157
|
+
visible: {
|
|
158
|
+
get: function get() {
|
|
159
|
+
return this.value;
|
|
160
|
+
},
|
|
161
|
+
set: function set(v) {
|
|
162
|
+
this.$emit('input', v);
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
expireOptions: function expireOptions() {
|
|
166
|
+
var options = cloneDeep(EXPIRE_ENUM);
|
|
167
|
+
if (Array.isArray(get(this, 'expireData.options'))) {
|
|
168
|
+
options = get(this, 'expireData.options');
|
|
169
|
+
}
|
|
170
|
+
return options;
|
|
171
|
+
},
|
|
172
|
+
shareOptions: function shareOptions() {
|
|
173
|
+
var options = [];
|
|
174
|
+
if (Array.isArray(this.shareItemInfo)) {
|
|
175
|
+
options = this.shareItemInfo.map(function (e) {
|
|
176
|
+
var defaultInfo = SHARE_ENUM.find(function (o) {
|
|
177
|
+
return o.action === e.action;
|
|
178
|
+
});
|
|
179
|
+
e.actionName = e.actionName || defaultInfo.actionName;
|
|
180
|
+
e.actionIcon = e.actionIcon || defaultInfo.actionIcon;
|
|
181
|
+
return e;
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
return options;
|
|
185
|
+
},
|
|
186
|
+
actionOptions: function actionOptions() {
|
|
187
|
+
var options = [];
|
|
188
|
+
if (Array.isArray(this.actionItemInfo)) {
|
|
189
|
+
options = this.actionItemInfo.map(function (e) {
|
|
190
|
+
var defaultInfo = ACTION_ENUM.find(function (o) {
|
|
191
|
+
return o.action === e.action;
|
|
192
|
+
});
|
|
193
|
+
e.actionName = e.actionName || defaultInfo.actionName;
|
|
194
|
+
e.actionIcon = e.actionIcon || defaultInfo.actionIcon;
|
|
195
|
+
return e;
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
return options;
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
created: function created() {},
|
|
202
|
+
mounted: function mounted() {},
|
|
203
|
+
methods: {
|
|
204
|
+
onClickAfterExpire: function onClickAfterExpire() {
|
|
205
|
+
var url = get(this, 'expireData.urlAfterExpire');
|
|
206
|
+
if (url) {
|
|
207
|
+
location.href = url;
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
onClickExpire: function onClickExpire(o) {
|
|
211
|
+
this.$emit('expire', _objectSpread(_objectSpread({}, o), {}, {
|
|
212
|
+
timestamp: new Date().getTime() + o.millisecond
|
|
213
|
+
}));
|
|
214
|
+
},
|
|
215
|
+
onClickExplain: function onClickExplain(item) {
|
|
216
|
+
if (item.copy) {
|
|
217
|
+
appBridge.copyString(item.text);
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
onClickShare: function onClickShare(item) {
|
|
221
|
+
var expireValue = this.expireValue;
|
|
222
|
+
var expireItem = EXPIRE_ENUM.filter(function (e) {
|
|
223
|
+
return ['NEVER'].includes(e.value);
|
|
224
|
+
}).find(function (e) {
|
|
225
|
+
return e.value === expireValue;
|
|
226
|
+
});
|
|
227
|
+
var expireTimestamp = expireItem ? new Date().getTime() + expireItem.millisecond : null;
|
|
228
|
+
if (item.customActionHandler) {
|
|
229
|
+
item.customActionHandler(_objectSpread(_objectSpread({}, item), {}, {
|
|
230
|
+
expireTimestamp: expireTimestamp
|
|
231
|
+
}));
|
|
232
|
+
} else {
|
|
233
|
+
if (window.appBridge && appBridge.checkAppFeature('APP_SHARE')) {
|
|
234
|
+
var shareUrl = item.shareUrl;
|
|
235
|
+
if (expireTimestamp && shareUrl) {
|
|
236
|
+
shareUrl = shareUrl + (shareUrl.includes('?') ? '&' : '?') + 'wy_expire=' + expireTimestamp;
|
|
237
|
+
}
|
|
238
|
+
// https://docs.winbaoxian.cn/#/api?id=%e5%88%86%e4%ba%ab%e5%8a%9f%e8%83%bd-app_share
|
|
239
|
+
appBridge.share({
|
|
240
|
+
title: item.title,
|
|
241
|
+
// 分享标题、type=2时表示视频标题
|
|
242
|
+
content: item.content,
|
|
243
|
+
// 分享内容的详细描述、type=2时表示视频描述
|
|
244
|
+
imgUrl: item.imgUrl,
|
|
245
|
+
// 图片地址、type=2时表示视频缩略图
|
|
246
|
+
shareUrl: shareUrl,
|
|
247
|
+
// 要分享的链接(一般为当前页面)、type=2时表示视频 url
|
|
248
|
+
imageData: item.imageData,
|
|
249
|
+
introduction: item.introduction,
|
|
250
|
+
// 分享弹框的头部文案
|
|
251
|
+
shareChannel: [item.action],
|
|
252
|
+
// qq_friends wechat_timeline wechat_friends system_share(保险师6.6.0开始支持);
|
|
253
|
+
miniProgramData: item.miniProgramData,
|
|
254
|
+
type: item.type // 【3.11.0 支持】type=2代表分享的是视频、type=2时, 所需参数有: title、content、shareUrl、imgUrl【优先级低于小程序分享】
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
this.$emit('action', item);
|
|
259
|
+
},
|
|
260
|
+
onClickAction: function onClickAction(item) {
|
|
261
|
+
this.$emit('action', item);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
|
|
267
|
+
// Vue.extend constructor export interop.
|
|
268
|
+
const options = typeof script === 'function' ? script.options : script;
|
|
269
|
+
// render functions
|
|
270
|
+
if (template && template.render) {
|
|
271
|
+
options.render = template.render;
|
|
272
|
+
options.staticRenderFns = template.staticRenderFns;
|
|
273
|
+
options._compiled = true;
|
|
274
|
+
}
|
|
275
|
+
return script;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/* script */
|
|
279
|
+
var __vue_script__ = script;
|
|
280
|
+
|
|
281
|
+
/* template */
|
|
282
|
+
var __vue_render__ = function __vue_render__() {
|
|
283
|
+
var _vm = this;
|
|
284
|
+
var _h = _vm.$createElement;
|
|
285
|
+
var _c = _vm._self._c || _h;
|
|
286
|
+
return _c('van-popup', {
|
|
287
|
+
staticClass: "bxt-share-sheet",
|
|
288
|
+
staticStyle: {
|
|
289
|
+
"height": "100vh"
|
|
290
|
+
},
|
|
291
|
+
attrs: {
|
|
292
|
+
"position": "bottom"
|
|
293
|
+
},
|
|
294
|
+
model: {
|
|
295
|
+
value: _vm.visible,
|
|
296
|
+
callback: function callback($$v) {
|
|
297
|
+
_vm.visible = $$v;
|
|
298
|
+
},
|
|
299
|
+
expression: "visible"
|
|
300
|
+
}
|
|
301
|
+
}, [_c('article', {
|
|
302
|
+
staticClass: "bxt-share-container"
|
|
303
|
+
}, [_vm.introduceImage ? _c('section', {
|
|
304
|
+
staticClass: "bxt-share-image"
|
|
305
|
+
}, [_c('img', {
|
|
306
|
+
attrs: {
|
|
307
|
+
"src": _vm.introduceImage,
|
|
308
|
+
"alt": "introduce"
|
|
309
|
+
}
|
|
310
|
+
})]) : _vm._e(), _c('section', {
|
|
311
|
+
staticClass: "bxt-share-content"
|
|
312
|
+
}, [_vm.expireData ? _c('section', {
|
|
313
|
+
staticClass: "bxt-expire bxt-bottom-border"
|
|
314
|
+
}, [_c('div', {
|
|
315
|
+
staticClass: "bxt-title"
|
|
316
|
+
}, [_c('div', {
|
|
317
|
+
staticClass: "bxt-tx"
|
|
318
|
+
}, [_vm._v("分享有效期")]), _c('div', {
|
|
319
|
+
staticClass: "bxt-description",
|
|
320
|
+
on: {
|
|
321
|
+
"click": _vm.onClickAfterExpire
|
|
322
|
+
}
|
|
323
|
+
}, [_c('van-icon', {
|
|
324
|
+
attrs: {
|
|
325
|
+
"name": "question-o"
|
|
326
|
+
}
|
|
327
|
+
}), _c('span', [_vm._v("链接失效后客户看到什么?")])], 1)]), _c('van-radio-group', {
|
|
328
|
+
attrs: {
|
|
329
|
+
"direction": "horizontal"
|
|
330
|
+
},
|
|
331
|
+
model: {
|
|
332
|
+
value: _vm.expireValue,
|
|
333
|
+
callback: function callback($$v) {
|
|
334
|
+
_vm.expireValue = $$v;
|
|
335
|
+
},
|
|
336
|
+
expression: "expireValue"
|
|
337
|
+
}
|
|
338
|
+
}, _vm._l(_vm.expireOptions, function (o) {
|
|
339
|
+
return _c('van-radio', {
|
|
340
|
+
key: o.value,
|
|
341
|
+
attrs: {
|
|
342
|
+
"name": o.value
|
|
343
|
+
},
|
|
344
|
+
on: {
|
|
345
|
+
"click": function click($event) {
|
|
346
|
+
return _vm.onClickExpire(o);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}, [_vm._v(_vm._s(o.name))]);
|
|
350
|
+
}), 1)], 1) : _vm._e(), _vm.explainData && _vm.explainData.text ? _c('section', {
|
|
351
|
+
staticClass: "bxt-explain bxt-bottom-border",
|
|
352
|
+
class: [_vm.explainData.copy ? 'copy' : '']
|
|
353
|
+
}, [_c('div', {
|
|
354
|
+
staticClass: "bxt-explain-text",
|
|
355
|
+
on: {
|
|
356
|
+
"click": function click($event) {
|
|
357
|
+
return _vm.onClickExplain(_vm.explainData);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}, [_vm._v("\n " + _vm._s(_vm.explainData.text) + "\n ")])]) : _vm._e(), _vm.shareOptions.length ? _c('section', {
|
|
361
|
+
staticClass: "bxt-share bxt-bottom-border"
|
|
362
|
+
}, [_c('div', {
|
|
363
|
+
staticClass: "bxt-share-wrapper",
|
|
364
|
+
class: [_vm.shareOptions.length > 4 ? 'more' : '']
|
|
365
|
+
}, _vm._l(_vm.shareOptions, function (o) {
|
|
366
|
+
return _c('figure', {
|
|
367
|
+
key: o.action,
|
|
368
|
+
on: {
|
|
369
|
+
"click": function click($event) {
|
|
370
|
+
return _vm.onClickShare(o);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}, [_c('div', {
|
|
374
|
+
staticClass: "bxt-empty-image"
|
|
375
|
+
}, [o.actionIcon ? _c('img', {
|
|
376
|
+
attrs: {
|
|
377
|
+
"src": o.actionIcon,
|
|
378
|
+
"alt": "icon"
|
|
379
|
+
}
|
|
380
|
+
}) : _vm._e()]), _c('figcaption', [_vm._v(_vm._s(o.actionName))])]);
|
|
381
|
+
}), 0)]) : _vm._e(), _vm.actionOptions.length ? _c('section', {
|
|
382
|
+
staticClass: "bxt-share bxt-bottom-border"
|
|
383
|
+
}, [_c('div', {
|
|
384
|
+
staticClass: "bxt-share-wrapper",
|
|
385
|
+
class: [_vm.actionOptions.length > 4 ? 'more' : '']
|
|
386
|
+
}, _vm._l(_vm.actionOptions, function (o) {
|
|
387
|
+
return _c('figure', {
|
|
388
|
+
key: o.action,
|
|
389
|
+
on: {
|
|
390
|
+
"click": function click($event) {
|
|
391
|
+
return _vm.onClickAction(o);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
}, [_c('div', {
|
|
395
|
+
staticClass: "bxt-empty-image"
|
|
396
|
+
}, [o.actionIcon ? _c('img', {
|
|
397
|
+
attrs: {
|
|
398
|
+
"src": o.actionIcon,
|
|
399
|
+
"alt": "icon"
|
|
400
|
+
}
|
|
401
|
+
}) : _vm._e()]), _c('figcaption', [_vm._v(_vm._s(o.actionName))])]);
|
|
402
|
+
}), 0)]) : _vm._e(), _c('footer', {
|
|
403
|
+
staticClass: "bxt-fooer"
|
|
404
|
+
}, [_c('div', {
|
|
405
|
+
staticClass: "bxt-cancle-button",
|
|
406
|
+
on: {
|
|
407
|
+
"click": function click($event) {
|
|
408
|
+
_vm.visible = false;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}, [_vm._v("\n 取消\n ")])])])])]);
|
|
412
|
+
};
|
|
413
|
+
var __vue_staticRenderFns__ = [];
|
|
414
|
+
|
|
415
|
+
/* style */
|
|
416
|
+
var __vue_inject_styles__ = undefined;
|
|
417
|
+
/* style inject */
|
|
418
|
+
|
|
419
|
+
/* style inject SSR */
|
|
420
|
+
|
|
421
|
+
/* style inject shadow dom */
|
|
422
|
+
|
|
423
|
+
var __vue_component__ = /*#__PURE__*/normalizeComponent({
|
|
424
|
+
render: __vue_render__,
|
|
425
|
+
staticRenderFns: __vue_staticRenderFns__
|
|
426
|
+
}, __vue_inject_styles__, __vue_script__);
|
|
427
|
+
|
|
428
|
+
export { __vue_component__ as default };
|
package/lib/index.js
CHANGED
|
@@ -39628,7 +39628,7 @@
|
|
|
39628
39628
|
install(window.Vue);
|
|
39629
39629
|
}
|
|
39630
39630
|
var index = {
|
|
39631
|
-
version: '3.0.8
|
|
39631
|
+
version: '3.0.8',
|
|
39632
39632
|
install: install
|
|
39633
39633
|
};
|
|
39634
39634
|
|
|
@@ -0,0 +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;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;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;padding:15px 21px}.bxt-share-sheet .bxt-explain.copy{padding:12px 15px}.bxt-share-sheet .bxt-explain.copy .bxt-explain-text{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-flex:0 0 25%;-ms-flex:0 0 25%;flex:0 0 25%}.bxt-share-sheet .bxt-share .bxt-share-wrapper figure .bxt-empty-image{-webkit-box-align:center;-moz-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-moz-box-pack:center;-ms-flex-pack:center;-webkit-align-items:center;align-items:center;background:#f3f7f9;border-radius:50px;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;height:50px;-webkit-justify-content:center;justify-content:center;overflow:hidden;width:50px}.bxt-share-sheet .bxt-share .bxt-share-wrapper figure .bxt-empty-image img{display:block;width:100%}.bxt-share-sheet .bxt-share .bxt-share-wrapper figure figcaption{color:#666;font-size:12px;line-height:15px;margin-top:5px;text-align:center}.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:0;margin-left:15px;margin-right:auto;position:absolute;width:100%}
|
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('vant/lib/button/index.css'), require('vant/lib/button'), require('vant/lib/radio/index.css'), require('vant/lib/radio'), require('vant/lib/radio-group/index.css'), require('vant/lib/radio-group'), require('vant/lib/popup/index.css'), require('vant/lib/popup'), require('lodash')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['vant/lib/button/index.css', 'vant/lib/button', 'vant/lib/radio/index.css', 'vant/lib/radio', 'vant/lib/radio-group/index.css', 'vant/lib/radio-group', 'vant/lib/popup/index.css', 'vant/lib/popup', 'lodash'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.BXT = factory(null, global._Button, null, global._Radio, null, global._RadioGroup, null, global._Popup, global.lodash));
|
|
5
|
+
})(this, (function (index_css, _Button, index_css$1, _Radio, index_css$2, _RadioGroup, index_css$3, _Popup, lodash) { 'use strict';
|
|
6
|
+
|
|
7
|
+
function _typeof(o) {
|
|
8
|
+
"@babel/helpers - typeof";
|
|
9
|
+
|
|
10
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
11
|
+
return typeof o;
|
|
12
|
+
} : function (o) {
|
|
13
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
14
|
+
}, _typeof(o);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function toPrimitive(t, r) {
|
|
18
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
19
|
+
var e = t[Symbol.toPrimitive];
|
|
20
|
+
if (void 0 !== e) {
|
|
21
|
+
var i = e.call(t, r);
|
|
22
|
+
if ("object" != _typeof(i)) return i;
|
|
23
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
24
|
+
}
|
|
25
|
+
return ("string" === r ? String : Number)(t);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function toPropertyKey(t) {
|
|
29
|
+
var i = toPrimitive(t, "string");
|
|
30
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function _defineProperty(e, r, t) {
|
|
34
|
+
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
35
|
+
value: t,
|
|
36
|
+
enumerable: true,
|
|
37
|
+
configurable: true,
|
|
38
|
+
writable: true
|
|
39
|
+
}) : e[r] = t, e;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
var oneDayMillisecond = 24 * 3600 * 1000;
|
|
43
|
+
var EXPIRE_ENUM = [{
|
|
44
|
+
value: 'NEVER',
|
|
45
|
+
name: '永久有效',
|
|
46
|
+
millisecond: 100 * 365 * oneDayMillisecond
|
|
47
|
+
}, {
|
|
48
|
+
value: '24h',
|
|
49
|
+
name: '24小时有效',
|
|
50
|
+
millisecond: oneDayMillisecond
|
|
51
|
+
}, {
|
|
52
|
+
value: '72h',
|
|
53
|
+
name: '72小时有效',
|
|
54
|
+
millisecond: 3 * oneDayMillisecond
|
|
55
|
+
}, {
|
|
56
|
+
value: '7d',
|
|
57
|
+
name: '7天有效',
|
|
58
|
+
millisecond: 7 * oneDayMillisecond
|
|
59
|
+
}, {
|
|
60
|
+
value: '15d',
|
|
61
|
+
name: '15天有效',
|
|
62
|
+
millisecond: 15 * oneDayMillisecond
|
|
63
|
+
}, {
|
|
64
|
+
value: '30d',
|
|
65
|
+
name: '30天有效',
|
|
66
|
+
millisecond: 30 * oneDayMillisecond
|
|
67
|
+
}];
|
|
68
|
+
var SHARE_ENUM = [{
|
|
69
|
+
action: 'wechat_friends',
|
|
70
|
+
actionName: '微信好友',
|
|
71
|
+
actionIcon: 'https://media.winbaoxian.com/assets-uploader/base_ss_share_widget_wechat%402x-1774342740104.png'
|
|
72
|
+
}, {
|
|
73
|
+
action: 'wechat_timeline',
|
|
74
|
+
actionName: '朋友圈',
|
|
75
|
+
actionIcon: 'https://media.winbaoxian.com/assets-uploader/base_ss_share_widget_friend_circle%402x-1774343672850.png'
|
|
76
|
+
}, {
|
|
77
|
+
action: 'qq_friends',
|
|
78
|
+
actionName: 'QQ',
|
|
79
|
+
actionIcon: 'https://media.winbaoxian.com/assets-uploader/base_ss_share_widget_qq%402x-1774344790639.png'
|
|
80
|
+
}, {
|
|
81
|
+
action: 'miniProgramData',
|
|
82
|
+
actionName: '小程序',
|
|
83
|
+
actionIcon: 'https://media.winbaoxian.com/assets-uploader/base_ss_share_widget_mini_program_data%402x-1774344809770.png'
|
|
84
|
+
}, {
|
|
85
|
+
action: 'ding_talk',
|
|
86
|
+
actionName: '钉钉',
|
|
87
|
+
actionIcon: 'https://media.winbaoxian.com/assets-uploader/base_ss_share_widget_ding_talk%402x-1774344828781.png'
|
|
88
|
+
}, {
|
|
89
|
+
action: 'system_share',
|
|
90
|
+
actionName: '系统分享',
|
|
91
|
+
actionIcon: 'https://media.winbaoxian.com/assets-uploader/base_ss_share_widget_system_share%402x-1774344871114.png'
|
|
92
|
+
}];
|
|
93
|
+
var ACTION_ENUM = [{
|
|
94
|
+
action: 'collect',
|
|
95
|
+
actionName: '收藏',
|
|
96
|
+
actionIcon: 'https://media.winbaoxian.com/assets-uploader/base_ss_common_widget_collect%402x-1774346843924.png'
|
|
97
|
+
}, {
|
|
98
|
+
action: 'collectCancel',
|
|
99
|
+
actionName: '取消收藏',
|
|
100
|
+
actionIcon: 'https://media.winbaoxian.com/assets-uploader/base_ss_common_widget_un_collect%402x-1774346970606.png'
|
|
101
|
+
}, {
|
|
102
|
+
action: 'report',
|
|
103
|
+
actionName: '举报',
|
|
104
|
+
actionIcon: 'https://media.winbaoxian.com/assets-uploader/base_ss_common_widget_report%402x-1774347070199.png'
|
|
105
|
+
}, {
|
|
106
|
+
action: 'delete',
|
|
107
|
+
actionName: '删除',
|
|
108
|
+
actionIcon: 'https://media.winbaoxian.com/assets-uploader/base_ss_common_widget_delete%402x-1774347034108.png'
|
|
109
|
+
}, {
|
|
110
|
+
action: 'claim',
|
|
111
|
+
actionName: '理赔',
|
|
112
|
+
actionIcon: 'https://media.winbaoxian.com/assets-uploader/base_ss_common_widget_claim%402x-1774347019973.png'
|
|
113
|
+
}, {
|
|
114
|
+
action: 'qr_scan',
|
|
115
|
+
actionName: '扫一扫',
|
|
116
|
+
actionIcon: 'https://media.winbaoxian.com/assets-uploader/base_ss_common_widget_qr_scan%402x-1774346940066.png'
|
|
117
|
+
}, {
|
|
118
|
+
action: 'text_zoom',
|
|
119
|
+
actionName: '文字缩放',
|
|
120
|
+
actionIcon: 'https://media.winbaoxian.com/assets-uploader/base_ss_common_widget_text_zoom%402x-1774346957305.png'
|
|
121
|
+
}, {
|
|
122
|
+
action: 'h5_mark_frequently_used',
|
|
123
|
+
actionName: '设为常用',
|
|
124
|
+
actionIcon: 'https://media.winbaoxian.com/assets-uploader/base_ss_common_widget_mark_frequently_used%402x-1774346894696.png'
|
|
125
|
+
}, {
|
|
126
|
+
action: 'h5_cancel_frequently_used',
|
|
127
|
+
actionName: '取消常用',
|
|
128
|
+
actionIcon: 'https://media.winbaoxian.com/assets-uploader/base_ss_common_widget_cancel_frequently_used%402x-1774347234796.png'
|
|
129
|
+
}, {
|
|
130
|
+
action: 'h5_feedback',
|
|
131
|
+
actionName: '反馈',
|
|
132
|
+
actionIcon: 'https://media.winbaoxian.com/assets-uploader/base_ss_common_widget_feedback%402x(1)-1774409691136.png'
|
|
133
|
+
}];
|
|
134
|
+
|
|
135
|
+
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; }
|
|
136
|
+
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; }
|
|
137
|
+
var script = {
|
|
138
|
+
components: _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, _Popup.name, _Popup), _RadioGroup.name, _RadioGroup), _Radio.name, _Radio), _Button.name, _Button),
|
|
139
|
+
props: {
|
|
140
|
+
value: Boolean,
|
|
141
|
+
introduceImage: String,
|
|
142
|
+
expireData: Object,
|
|
143
|
+
explainData: Object,
|
|
144
|
+
shareItemInfo: Array,
|
|
145
|
+
actionItemInfo: Array
|
|
146
|
+
},
|
|
147
|
+
data: function data() {
|
|
148
|
+
return {
|
|
149
|
+
expireValue: lodash.get(this, 'expireData.value') || null
|
|
150
|
+
};
|
|
151
|
+
},
|
|
152
|
+
computed: {
|
|
153
|
+
visible: {
|
|
154
|
+
get: function get() {
|
|
155
|
+
return this.value;
|
|
156
|
+
},
|
|
157
|
+
set: function set(v) {
|
|
158
|
+
this.$emit('input', v);
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
expireOptions: function expireOptions() {
|
|
162
|
+
var options = lodash.cloneDeep(EXPIRE_ENUM);
|
|
163
|
+
if (Array.isArray(lodash.get(this, 'expireData.options'))) {
|
|
164
|
+
options = lodash.get(this, 'expireData.options');
|
|
165
|
+
}
|
|
166
|
+
return options;
|
|
167
|
+
},
|
|
168
|
+
shareOptions: function shareOptions() {
|
|
169
|
+
var options = [];
|
|
170
|
+
if (Array.isArray(this.shareItemInfo)) {
|
|
171
|
+
options = this.shareItemInfo.map(function (e) {
|
|
172
|
+
var defaultInfo = SHARE_ENUM.find(function (o) {
|
|
173
|
+
return o.action === e.action;
|
|
174
|
+
});
|
|
175
|
+
e.actionName = e.actionName || defaultInfo.actionName;
|
|
176
|
+
e.actionIcon = e.actionIcon || defaultInfo.actionIcon;
|
|
177
|
+
return e;
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
return options;
|
|
181
|
+
},
|
|
182
|
+
actionOptions: function actionOptions() {
|
|
183
|
+
var options = [];
|
|
184
|
+
if (Array.isArray(this.actionItemInfo)) {
|
|
185
|
+
options = this.actionItemInfo.map(function (e) {
|
|
186
|
+
var defaultInfo = ACTION_ENUM.find(function (o) {
|
|
187
|
+
return o.action === e.action;
|
|
188
|
+
});
|
|
189
|
+
e.actionName = e.actionName || defaultInfo.actionName;
|
|
190
|
+
e.actionIcon = e.actionIcon || defaultInfo.actionIcon;
|
|
191
|
+
return e;
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
return options;
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
created: function created() {},
|
|
198
|
+
mounted: function mounted() {},
|
|
199
|
+
methods: {
|
|
200
|
+
onClickAfterExpire: function onClickAfterExpire() {
|
|
201
|
+
var url = lodash.get(this, 'expireData.urlAfterExpire');
|
|
202
|
+
if (url) {
|
|
203
|
+
location.href = url;
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
onClickExpire: function onClickExpire(o) {
|
|
207
|
+
this.$emit('expire', _objectSpread(_objectSpread({}, o), {}, {
|
|
208
|
+
timestamp: new Date().getTime() + o.millisecond
|
|
209
|
+
}));
|
|
210
|
+
},
|
|
211
|
+
onClickExplain: function onClickExplain(item) {
|
|
212
|
+
if (item.copy) {
|
|
213
|
+
appBridge.copyString(item.text);
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
onClickShare: function onClickShare(item) {
|
|
217
|
+
var expireValue = this.expireValue;
|
|
218
|
+
var expireItem = EXPIRE_ENUM.filter(function (e) {
|
|
219
|
+
return ['NEVER'].includes(e.value);
|
|
220
|
+
}).find(function (e) {
|
|
221
|
+
return e.value === expireValue;
|
|
222
|
+
});
|
|
223
|
+
var expireTimestamp = expireItem ? new Date().getTime() + expireItem.millisecond : null;
|
|
224
|
+
if (item.customActionHandler) {
|
|
225
|
+
item.customActionHandler(_objectSpread(_objectSpread({}, item), {}, {
|
|
226
|
+
expireTimestamp: expireTimestamp
|
|
227
|
+
}));
|
|
228
|
+
} else {
|
|
229
|
+
if (window.appBridge && appBridge.checkAppFeature('APP_SHARE')) {
|
|
230
|
+
var shareUrl = item.shareUrl;
|
|
231
|
+
if (expireTimestamp && shareUrl) {
|
|
232
|
+
shareUrl = shareUrl + (shareUrl.includes('?') ? '&' : '?') + 'wy_expire=' + expireTimestamp;
|
|
233
|
+
}
|
|
234
|
+
// https://docs.winbaoxian.cn/#/api?id=%e5%88%86%e4%ba%ab%e5%8a%9f%e8%83%bd-app_share
|
|
235
|
+
appBridge.share({
|
|
236
|
+
title: item.title,
|
|
237
|
+
// 分享标题、type=2时表示视频标题
|
|
238
|
+
content: item.content,
|
|
239
|
+
// 分享内容的详细描述、type=2时表示视频描述
|
|
240
|
+
imgUrl: item.imgUrl,
|
|
241
|
+
// 图片地址、type=2时表示视频缩略图
|
|
242
|
+
shareUrl: shareUrl,
|
|
243
|
+
// 要分享的链接(一般为当前页面)、type=2时表示视频 url
|
|
244
|
+
imageData: item.imageData,
|
|
245
|
+
introduction: item.introduction,
|
|
246
|
+
// 分享弹框的头部文案
|
|
247
|
+
shareChannel: [item.action],
|
|
248
|
+
// qq_friends wechat_timeline wechat_friends system_share(保险师6.6.0开始支持);
|
|
249
|
+
miniProgramData: item.miniProgramData,
|
|
250
|
+
type: item.type // 【3.11.0 支持】type=2代表分享的是视频、type=2时, 所需参数有: title、content、shareUrl、imgUrl【优先级低于小程序分享】
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
this.$emit('action', item);
|
|
255
|
+
},
|
|
256
|
+
onClickAction: function onClickAction(item) {
|
|
257
|
+
this.$emit('action', item);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
|
|
263
|
+
// Vue.extend constructor export interop.
|
|
264
|
+
const options = typeof script === 'function' ? script.options : script;
|
|
265
|
+
// render functions
|
|
266
|
+
if (template && template.render) {
|
|
267
|
+
options.render = template.render;
|
|
268
|
+
options.staticRenderFns = template.staticRenderFns;
|
|
269
|
+
options._compiled = true;
|
|
270
|
+
}
|
|
271
|
+
return script;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/* script */
|
|
275
|
+
var __vue_script__ = script;
|
|
276
|
+
|
|
277
|
+
/* template */
|
|
278
|
+
var __vue_render__ = function __vue_render__() {
|
|
279
|
+
var _vm = this;
|
|
280
|
+
var _h = _vm.$createElement;
|
|
281
|
+
var _c = _vm._self._c || _h;
|
|
282
|
+
return _c('van-popup', {
|
|
283
|
+
staticClass: "bxt-share-sheet",
|
|
284
|
+
staticStyle: {
|
|
285
|
+
"height": "100vh"
|
|
286
|
+
},
|
|
287
|
+
attrs: {
|
|
288
|
+
"position": "bottom"
|
|
289
|
+
},
|
|
290
|
+
model: {
|
|
291
|
+
value: _vm.visible,
|
|
292
|
+
callback: function callback($$v) {
|
|
293
|
+
_vm.visible = $$v;
|
|
294
|
+
},
|
|
295
|
+
expression: "visible"
|
|
296
|
+
}
|
|
297
|
+
}, [_c('article', {
|
|
298
|
+
staticClass: "bxt-share-container"
|
|
299
|
+
}, [_vm.introduceImage ? _c('section', {
|
|
300
|
+
staticClass: "bxt-share-image"
|
|
301
|
+
}, [_c('img', {
|
|
302
|
+
attrs: {
|
|
303
|
+
"src": _vm.introduceImage,
|
|
304
|
+
"alt": "introduce"
|
|
305
|
+
}
|
|
306
|
+
})]) : _vm._e(), _c('section', {
|
|
307
|
+
staticClass: "bxt-share-content"
|
|
308
|
+
}, [_vm.expireData ? _c('section', {
|
|
309
|
+
staticClass: "bxt-expire bxt-bottom-border"
|
|
310
|
+
}, [_c('div', {
|
|
311
|
+
staticClass: "bxt-title"
|
|
312
|
+
}, [_c('div', {
|
|
313
|
+
staticClass: "bxt-tx"
|
|
314
|
+
}, [_vm._v("分享有效期")]), _c('div', {
|
|
315
|
+
staticClass: "bxt-description",
|
|
316
|
+
on: {
|
|
317
|
+
"click": _vm.onClickAfterExpire
|
|
318
|
+
}
|
|
319
|
+
}, [_c('van-icon', {
|
|
320
|
+
attrs: {
|
|
321
|
+
"name": "question-o"
|
|
322
|
+
}
|
|
323
|
+
}), _c('span', [_vm._v("链接失效后客户看到什么?")])], 1)]), _c('van-radio-group', {
|
|
324
|
+
attrs: {
|
|
325
|
+
"direction": "horizontal"
|
|
326
|
+
},
|
|
327
|
+
model: {
|
|
328
|
+
value: _vm.expireValue,
|
|
329
|
+
callback: function callback($$v) {
|
|
330
|
+
_vm.expireValue = $$v;
|
|
331
|
+
},
|
|
332
|
+
expression: "expireValue"
|
|
333
|
+
}
|
|
334
|
+
}, _vm._l(_vm.expireOptions, function (o) {
|
|
335
|
+
return _c('van-radio', {
|
|
336
|
+
key: o.value,
|
|
337
|
+
attrs: {
|
|
338
|
+
"name": o.value
|
|
339
|
+
},
|
|
340
|
+
on: {
|
|
341
|
+
"click": function click($event) {
|
|
342
|
+
return _vm.onClickExpire(o);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}, [_vm._v(_vm._s(o.name))]);
|
|
346
|
+
}), 1)], 1) : _vm._e(), _vm.explainData && _vm.explainData.text ? _c('section', {
|
|
347
|
+
staticClass: "bxt-explain bxt-bottom-border",
|
|
348
|
+
class: [_vm.explainData.copy ? 'copy' : '']
|
|
349
|
+
}, [_c('div', {
|
|
350
|
+
staticClass: "bxt-explain-text",
|
|
351
|
+
on: {
|
|
352
|
+
"click": function click($event) {
|
|
353
|
+
return _vm.onClickExplain(_vm.explainData);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}, [_vm._v("\n " + _vm._s(_vm.explainData.text) + "\n ")])]) : _vm._e(), _vm.shareOptions.length ? _c('section', {
|
|
357
|
+
staticClass: "bxt-share bxt-bottom-border"
|
|
358
|
+
}, [_c('div', {
|
|
359
|
+
staticClass: "bxt-share-wrapper",
|
|
360
|
+
class: [_vm.shareOptions.length > 4 ? 'more' : '']
|
|
361
|
+
}, _vm._l(_vm.shareOptions, function (o) {
|
|
362
|
+
return _c('figure', {
|
|
363
|
+
key: o.action,
|
|
364
|
+
on: {
|
|
365
|
+
"click": function click($event) {
|
|
366
|
+
return _vm.onClickShare(o);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}, [_c('div', {
|
|
370
|
+
staticClass: "bxt-empty-image"
|
|
371
|
+
}, [o.actionIcon ? _c('img', {
|
|
372
|
+
attrs: {
|
|
373
|
+
"src": o.actionIcon,
|
|
374
|
+
"alt": "icon"
|
|
375
|
+
}
|
|
376
|
+
}) : _vm._e()]), _c('figcaption', [_vm._v(_vm._s(o.actionName))])]);
|
|
377
|
+
}), 0)]) : _vm._e(), _vm.actionOptions.length ? _c('section', {
|
|
378
|
+
staticClass: "bxt-share bxt-bottom-border"
|
|
379
|
+
}, [_c('div', {
|
|
380
|
+
staticClass: "bxt-share-wrapper",
|
|
381
|
+
class: [_vm.actionOptions.length > 4 ? 'more' : '']
|
|
382
|
+
}, _vm._l(_vm.actionOptions, function (o) {
|
|
383
|
+
return _c('figure', {
|
|
384
|
+
key: o.action,
|
|
385
|
+
on: {
|
|
386
|
+
"click": function click($event) {
|
|
387
|
+
return _vm.onClickAction(o);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}, [_c('div', {
|
|
391
|
+
staticClass: "bxt-empty-image"
|
|
392
|
+
}, [o.actionIcon ? _c('img', {
|
|
393
|
+
attrs: {
|
|
394
|
+
"src": o.actionIcon,
|
|
395
|
+
"alt": "icon"
|
|
396
|
+
}
|
|
397
|
+
}) : _vm._e()]), _c('figcaption', [_vm._v(_vm._s(o.actionName))])]);
|
|
398
|
+
}), 0)]) : _vm._e(), _c('footer', {
|
|
399
|
+
staticClass: "bxt-fooer"
|
|
400
|
+
}, [_c('div', {
|
|
401
|
+
staticClass: "bxt-cancle-button",
|
|
402
|
+
on: {
|
|
403
|
+
"click": function click($event) {
|
|
404
|
+
_vm.visible = false;
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
}, [_vm._v("\n 取消\n ")])])])])]);
|
|
408
|
+
};
|
|
409
|
+
var __vue_staticRenderFns__ = [];
|
|
410
|
+
|
|
411
|
+
/* style */
|
|
412
|
+
var __vue_inject_styles__ = undefined;
|
|
413
|
+
/* style inject */
|
|
414
|
+
|
|
415
|
+
/* style inject SSR */
|
|
416
|
+
|
|
417
|
+
/* style inject shadow dom */
|
|
418
|
+
|
|
419
|
+
var __vue_component__ = /*#__PURE__*/normalizeComponent({
|
|
420
|
+
render: __vue_render__,
|
|
421
|
+
staticRenderFns: __vue_staticRenderFns__
|
|
422
|
+
}, __vue_inject_styles__, __vue_script__);
|
|
423
|
+
|
|
424
|
+
return __vue_component__;
|
|
425
|
+
|
|
426
|
+
}));
|
package/package.json
CHANGED