@10yun/cv-mobile-ui 0.5.20 → 0.5.21

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.
Files changed (69) hide show
  1. package/package.json +1 -1
  2. package/ui-cv/components/cv-grid-item/cv-grid-item.vue +1 -1
  3. package/uni-ui/lib/uni-badge/uni-badge.vue +150 -1
  4. package/uni-ui/lib/uni-breadcrumb/uni-breadcrumb.vue +37 -1
  5. package/uni-ui/lib/uni-breadcrumb-item/uni-breadcrumb-item.vue +83 -1
  6. package/uni-ui/lib/uni-calendar/uni-calendar-item.vue +122 -1
  7. package/uni-ui/lib/uni-calendar/uni-calendar.vue +366 -1
  8. package/uni-ui/lib/uni-card/uni-card.vue +124 -1
  9. package/uni-ui/lib/uni-col/uni-col.vue +1 -1
  10. package/uni-ui/lib/uni-collapse/uni-collapse.vue +135 -1
  11. package/uni-ui/lib/uni-collapse-item/uni-collapse-item.vue +266 -1
  12. package/uni-ui/lib/uni-combox/uni-combox.vue +1 -1
  13. package/uni-ui/lib/uni-countdown/uni-countdown.vue +239 -1
  14. package/uni-ui/lib/uni-data-checkbox/uni-data-checkbox.vue +487 -1
  15. package/uni-ui/lib/uni-data-picker/uni-data-picker.vue +530 -1
  16. package/uni-ui/lib/uni-data-pickerview/uni-data-picker.js +157 -150
  17. package/uni-ui/lib/uni-data-pickerview/uni-data-pickerview.vue +166 -1
  18. package/uni-ui/lib/uni-data-select/uni-data-select.vue +289 -1
  19. package/uni-ui/lib/uni-datetime-picker/calendar-item.vue +70 -1
  20. package/uni-ui/lib/uni-datetime-picker/calendar.vue +629 -1
  21. package/uni-ui/lib/uni-datetime-picker/time-picker.vue +741 -1
  22. package/uni-ui/lib/uni-datetime-picker/uni-datetime-picker.vue +847 -1
  23. package/uni-ui/lib/uni-drawer/uni-drawer.vue +115 -1
  24. package/uni-ui/lib/uni-easyinput/uni-easyinput.vue +515 -1
  25. package/uni-ui/lib/uni-fab/uni-fab.vue +257 -1
  26. package/uni-ui/lib/uni-fav/uni-fav.vue +123 -1
  27. package/uni-ui/lib/uni-file-picker/uni-file-picker.vue +642 -1
  28. package/uni-ui/lib/uni-file-picker/upload-file.vue +177 -1
  29. package/uni-ui/lib/uni-file-picker/upload-image.vue +176 -1
  30. package/uni-ui/lib/uni-forms/uni-forms.vue +375 -1
  31. package/uni-ui/lib/uni-forms-item/uni-forms-item.vue +429 -1
  32. package/uni-ui/lib/uni-goods-nav/uni-goods-nav.vue +129 -1
  33. package/uni-ui/lib/uni-grid/uni-grid.vue +115 -1
  34. package/uni-ui/lib/uni-grid-item/uni-grid-item.vue +78 -1
  35. package/uni-ui/lib/uni-group/uni-group.vue +85 -1
  36. package/uni-ui/lib/uni-icons/uni-icons.vue +85 -1
  37. package/uni-ui/lib/uni-indexed-list/uni-indexed-list-item.vue +68 -1
  38. package/uni-ui/lib/uni-indexed-list/uni-indexed-list.vue +294 -1
  39. package/uni-ui/lib/uni-list/uni-list.vue +81 -1
  40. package/uni-ui/lib/uni-list-ad/uni-list-ad.vue +77 -1
  41. package/uni-ui/lib/uni-list-chat/uni-list-chat.vue +294 -1
  42. package/uni-ui/lib/uni-list-item/uni-list-item.vue +346 -1
  43. package/uni-ui/lib/uni-load-more/uni-load-more.vue +172 -1
  44. package/uni-ui/lib/uni-nav-bar/uni-nav-bar.vue +205 -1
  45. package/uni-ui/lib/uni-nav-bar/uni-status-bar.vue +18 -1
  46. package/uni-ui/lib/uni-notice-bar/uni-notice-bar.vue +331 -1
  47. package/uni-ui/lib/uni-number-box/uni-number-box.vue +166 -1
  48. package/uni-ui/lib/uni-pagination/uni-pagination.vue +323 -1
  49. package/uni-ui/lib/uni-popup/uni-popup.vue +1 -1
  50. package/uni-ui/lib/uni-popup-dialog/uni-popup-dialog.vue +173 -1
  51. package/uni-ui/lib/uni-popup-message/uni-popup-message.vue +74 -1
  52. package/uni-ui/lib/uni-popup-share/uni-popup-share.vue +106 -1
  53. package/uni-ui/lib/uni-rate/uni-rate.vue +322 -1
  54. package/uni-ui/lib/uni-row/uni-row.vue +1 -1
  55. package/uni-ui/lib/uni-search-bar/uni-search-bar.vue +236 -1
  56. package/uni-ui/lib/uni-section/uni-section.vue +109 -1
  57. package/uni-ui/lib/uni-segmented-control/uni-segmented-control.vue +103 -1
  58. package/uni-ui/lib/uni-status-bar/uni-status-bar.vue +1 -1
  59. package/uni-ui/lib/uni-steps/uni-steps.vue +120 -1
  60. package/uni-ui/lib/uni-swipe-action-item/uni-swipe-action-item.vue +226 -3
  61. package/uni-ui/lib/uni-swiper-dot/uni-swiper-dot.vue +167 -1
  62. package/uni-ui/lib/uni-table/uni-table.vue +297 -1
  63. package/uni-ui/lib/uni-tag/uni-tag.vue +100 -1
  64. package/uni-ui/lib/uni-td/uni-td.vue +78 -1
  65. package/uni-ui/lib/uni-th/filter-dropdown.vue +1 -1
  66. package/uni-ui/lib/uni-th/uni-th.vue +224 -1
  67. package/uni-ui/lib/uni-thead/uni-thead.vue +77 -1
  68. package/uni-ui/lib/uni-tr/table-checkbox.vue +79 -1
  69. package/uni-ui/lib/uni-tr/uni-tr.vue +135 -1
@@ -1 +1,173 @@
1
- <template>
2
1
  <view class="uni-popup-dialog">
3
2
  <view class="uni-dialog-title">
4
3
  <text class="uni-dialog-title-text" :class="['uni-popup__' + dialogType]">{{ titleText }}</text>
5
4
  </view>
6
5
  <view v-if="mode === 'base'" class="uni-dialog-content">
7
6
  <slot>
8
7
  <text class="uni-dialog-content-text">{{ content }}</text>
9
8
  </slot>
10
9
  </view>
11
10
  <view v-else class="uni-dialog-content">
12
11
  <slot>
13
12
  <input class="uni-dialog-input" v-model="val" :type="inputType" :placeholder="placeholderText" :focus="focus" />
14
13
  </slot>
15
14
  </view>
16
15
  <view class="uni-dialog-button-group">
17
16
  <view class="uni-dialog-button" @click="closeDialog">
18
17
  <text class="uni-dialog-button-text">{{ closeText }}</text>
19
18
  </view>
20
19
  <view class="uni-dialog-button uni-border-left" @click="onOk">
21
20
  <text class="uni-dialog-button-text uni-button-color">{{ okText }}</text>
22
21
  </view>
23
22
  </view>
24
23
  </view>
25
24
  * PopUp 弹出层-对话框样式
26
25
  * @description 弹出层-对话框样式
27
26
  * @tutorial https://ext.dcloud.net.cn/plugin?id=329
28
27
  * @property {String} value input 模式下的默认值
29
28
  * @property {String} placeholder input 模式下输入提示
30
29
  * @property {String} type = [success|warning|info|error] 主题样式
31
30
  * @value success 成功
32
31
  * @value warning 提示
33
32
  * @value info 消息
34
33
  * @value error 错误
35
34
  * @property {String} mode = [base|input] 模式、
36
35
  * @value base 基础对话框
37
36
  * @value input 可输入对话框
38
37
  * @property {String} content 对话框内容
39
38
  * @property {Boolean} beforeClose 是否拦截取消事件
40
39
  * @event {Function} confirm 点击确认按钮触发
41
40
  * @event {Function} close 点击取消按钮触发
42
41
  */
43
42
  name: 'uniPopupDialog',
44
43
  mixins: [popup],
45
44
  emits: ['confirm', 'close'],
46
45
  props: {
47
46
  inputType: {
48
47
  type: String,
49
48
  default: 'text'
50
49
  },
51
50
  value: {
52
51
  type: [String, Number],
53
52
  default: ''
54
53
  },
55
54
  placeholder: {
56
55
  type: [String, Number],
57
56
  default: ''
58
57
  },
59
58
  type: {
60
59
  type: String,
61
60
  default: 'error'
62
61
  },
63
62
  mode: {
64
63
  type: String,
65
64
  default: 'base'
66
65
  },
67
66
  title: {
68
67
  type: String,
69
68
  default: ''
70
69
  },
71
70
  content: {
72
71
  type: String,
73
72
  default: ''
74
73
  },
75
74
  beforeClose: {
76
75
  type: Boolean,
77
76
  default: false
78
77
  },
79
78
  cancelText: {
80
79
  type: String,
81
80
  default: ''
82
81
  },
83
82
  confirmText: {
84
83
  type: String,
85
84
  default: ''
86
85
  }
87
86
  },
88
87
  data() {
89
88
  return {
90
89
  dialogType: 'error',
91
90
  focus: false,
92
91
  val: ''
93
92
  };
94
93
  },
95
94
  computed: {
96
95
  okText() {
97
96
  return this.confirmText || t('uni-popup.ok');
98
97
  },
99
98
  closeText() {
100
99
  return this.cancelText || t('uni-popup.cancel');
101
100
  },
102
101
  placeholderText() {
103
102
  return this.placeholder || t('uni-popup.placeholder');
104
103
  },
105
104
  titleText() {
106
105
  return this.title || t('uni-popup.title');
107
106
  }
108
107
  },
109
108
  watch: {
110
109
  type(val) {
111
110
  this.dialogType = val;
112
111
  },
113
112
  mode(val) {
114
113
  if (val === 'input') {
115
114
  this.dialogType = 'info';
116
115
  }
117
116
  },
118
117
  value(val) {
119
118
  this.val = val;
120
119
  }
121
120
  },
122
121
  created() {
123
122
  // 对话框遮罩不可点击
124
123
  this.popup.disableMask();
125
124
  // this.popup.closeMask()
126
125
  if (this.mode === 'input') {
127
126
  this.dialogType = 'info';
128
127
  this.val = this.value;
129
128
  } else {
130
129
  this.dialogType = this.type;
131
130
  }
132
131
  },
133
132
  mounted() {
134
133
  this.focus = true;
135
134
  },
136
135
  methods: {
137
136
  /**
138
137
  * 点击确认按钮
139
138
  */
140
139
  onOk() {
141
140
  if (this.mode === 'input') {
142
141
  this.$emit('confirm', this.val);
143
142
  } else {
144
143
  this.$emit('confirm');
145
144
  }
146
145
  if (this.beforeClose) return;
147
146
  this.popup.close();
148
147
  },
149
148
  /**
150
149
  * 点击取消按钮
151
150
  */
152
151
  closeDialog() {
153
152
  this.$emit('close');
154
153
  if (this.beforeClose) return;
155
154
  this.popup.close();
156
155
  },
157
156
  close() {
158
157
  this.popup.close();
159
158
  }
160
159
  }
160
+ <template>
161
+ <view class="uni-popup-dialog">
162
+ <view class="uni-dialog-title">
163
+ <text class="uni-dialog-title-text" :class="['uni-popup__' + dialogType]">{{ titleText }}</text>
164
+ </view>
165
+ <view v-if="mode === 'base'" class="uni-dialog-content">
166
+ <slot>
167
+ <text class="uni-dialog-content-text">{{ content }}</text>
168
+ </slot>
169
+ </view>
170
+ <view v-else class="uni-dialog-content">
171
+ <slot>
172
+ <input class="uni-dialog-input" v-model="val" :type="inputType" :placeholder="placeholderText" :focus="focus" />
173
+ </slot>
174
+ </view>
175
+ <view class="uni-dialog-button-group">
176
+ <view class="uni-dialog-button" @click="closeDialog">
177
+ <text class="uni-dialog-button-text">{{ closeText }}</text>
178
+ </view>
179
+ <view class="uni-dialog-button uni-border-left" @click="onOk">
180
+ <text class="uni-dialog-button-text uni-button-color">{{ okText }}</text>
181
+ </view>
182
+ </view>
183
+ </view>
184
+ </template>
185
+ <script>
186
+ import popup from '../uni-popup/popup.js';
187
+ import { initVueI18n } from '@dcloudio/uni-i18n';
188
+ import messages from '../uni-popup/i18n/index.js';
189
+ const { t } = initVueI18n(messages);
190
+ /**
191
+ * PopUp 弹出层-对话框样式
192
+ * @description 弹出层-对话框样式
193
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=329
194
+ * @property {String} value input 模式下的默认值
195
+ * @property {String} placeholder input 模式下输入提示
196
+ * @property {String} type = [success|warning|info|error] 主题样式
197
+ * @value success 成功
198
+ * @value warning 提示
199
+ * @value info 消息
200
+ * @value error 错误
201
+ * @property {String} mode = [base|input] 模式、
202
+ * @value base 基础对话框
203
+ * @value input 可输入对话框
204
+ * @property {String} content 对话框内容
205
+ * @property {Boolean} beforeClose 是否拦截取消事件
206
+ * @event {Function} confirm 点击确认按钮触发
207
+ * @event {Function} close 点击取消按钮触发
208
+ */
209
+ export default {
210
+ name: 'uniPopupDialog',
211
+ mixins: [popup],
212
+ emits: ['confirm', 'close'],
213
+ props: {
214
+ inputType: {
215
+ type: String,
216
+ default: 'text'
217
+ },
218
+ value: {
219
+ type: [String, Number],
220
+ default: ''
221
+ },
222
+ placeholder: {
223
+ type: [String, Number],
224
+ default: ''
225
+ },
226
+ type: {
227
+ type: String,
228
+ default: 'error'
229
+ },
230
+ mode: {
231
+ type: String,
232
+ default: 'base'
233
+ },
234
+ title: {
235
+ type: String,
236
+ default: ''
237
+ },
238
+ content: {
239
+ type: String,
240
+ default: ''
241
+ },
242
+ beforeClose: {
243
+ type: Boolean,
244
+ default: false
245
+ },
246
+ cancelText: {
247
+ type: String,
248
+ default: ''
249
+ },
250
+ confirmText: {
251
+ type: String,
252
+ default: ''
253
+ }
254
+ },
255
+ data() {
256
+ return {
257
+ dialogType: 'error',
258
+ focus: false,
259
+ val: ''
260
+ };
261
+ },
262
+ computed: {
263
+ okText() {
264
+ return this.confirmText || t('uni-popup.ok');
265
+ },
266
+ closeText() {
267
+ return this.cancelText || t('uni-popup.cancel');
268
+ },
269
+ placeholderText() {
270
+ return this.placeholder || t('uni-popup.placeholder');
271
+ },
272
+ titleText() {
273
+ return this.title || t('uni-popup.title');
274
+ }
275
+ },
276
+ watch: {
277
+ type(val) {
278
+ this.dialogType = val;
279
+ },
280
+ mode(val) {
281
+ if (val === 'input') {
282
+ this.dialogType = 'info';
283
+ }
284
+ },
285
+ value(val) {
286
+ this.val = val;
287
+ }
288
+ },
289
+ created() {
290
+ // 对话框遮罩不可点击
291
+ this.popup.disableMask();
292
+ // this.popup.closeMask()
293
+ if (this.mode === 'input') {
294
+ this.dialogType = 'info';
295
+ this.val = this.value;
296
+ } else {
297
+ this.dialogType = this.type;
298
+ }
299
+ },
300
+ mounted() {
301
+ this.focus = true;
302
+ },
303
+ methods: {
304
+ /**
305
+ * 点击确认按钮
306
+ */
307
+ onOk() {
308
+ if (this.mode === 'input') {
309
+ this.$emit('confirm', this.val);
310
+ } else {
311
+ this.$emit('confirm');
312
+ }
313
+ if (this.beforeClose) return;
314
+ this.popup.close();
315
+ },
316
+ /**
317
+ * 点击取消按钮
318
+ */
319
+ closeDialog() {
320
+ this.$emit('close');
321
+ if (this.beforeClose) return;
322
+ this.popup.close();
323
+ },
324
+ close() {
325
+ this.popup.close();
326
+ }
327
+ }
328
+ };
329
+ </script>
330
+ <style>
331
+ @import 'style.css';
332
+ </style>
@@ -1 +1,74 @@
1
- <template>
2
1
  <view class="uni-popup-message">
3
2
  <view class="uni-popup-message__box fixforpc-width" :class="'uni-popup__' + type">
4
3
  <slot>
5
4
  <text class="uni-popup-message-text" :class="'uni-popup__' + type + '-text'">{{ message }}</text>
6
5
  </slot>
7
6
  </view>
8
7
  </view>
9
8
  * PopUp 弹出层-消息提示
10
9
  * @description 弹出层-消息提示
11
10
  * @tutorial https://ext.dcloud.net.cn/plugin?id=329
12
11
  * @property {String} type = [success|warning|info|error] 主题样式
13
12
  * @value success 成功
14
13
  * @value warning 提示
15
14
  * @value info 消息
16
15
  * @value error 错误
17
16
  * @property {String} message 消息提示文字
18
17
  * @property {String} duration 显示时间,设置为 0 则不会自动关闭
19
18
  */
20
19
  name: 'uniPopupMessage',
21
20
  mixins: [popup],
22
21
  props: {
23
22
  /**
24
23
  * 主题 success/warning/info/error 默认 success
25
24
  */
26
25
  type: {
27
26
  type: String,
28
27
  default: 'success'
29
28
  },
30
29
  /**
31
30
  * 消息文字
32
31
  */
33
32
  message: {
34
33
  type: String,
35
34
  default: ''
36
35
  },
37
36
  /**
38
37
  * 显示时间,设置为 0 则不会自动关闭
39
38
  */
40
39
  duration: {
41
40
  type: Number,
42
41
  default: 3000
43
42
  },
44
43
  maskShow: {
45
44
  type: Boolean,
46
45
  default: false
47
46
  }
48
47
  },
49
48
  data() {
50
49
  return {};
51
50
  },
52
51
  created() {
53
52
  this.popup.maskShow = this.maskShow;
54
53
  this.popup.messageChild = this;
55
54
  },
56
55
  methods: {
57
56
  timerClose() {
58
57
  if (this.duration === 0) return;
59
58
  clearTimeout(this.timer);
60
59
  this.timer = setTimeout(() => {
61
60
  this.popup.close();
62
61
  }, this.duration);
63
62
  }
64
63
  }
64
+ <template>
65
+ <view class="uni-popup-message">
66
+ <view class="uni-popup-message__box fixforpc-width" :class="'uni-popup__' + type">
67
+ <slot>
68
+ <text class="uni-popup-message-text" :class="'uni-popup__' + type + '-text'">{{ message }}</text>
69
+ </slot>
70
+ </view>
71
+ </view>
72
+ </template>
73
+ <script>
74
+ import popup from '../uni-popup/popup.js';
75
+ /**
76
+ * PopUp 弹出层-消息提示
77
+ * @description 弹出层-消息提示
78
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=329
79
+ * @property {String} type = [success|warning|info|error] 主题样式
80
+ * @value success 成功
81
+ * @value warning 提示
82
+ * @value info 消息
83
+ * @value error 错误
84
+ * @property {String} message 消息提示文字
85
+ * @property {String} duration 显示时间,设置为 0 则不会自动关闭
86
+ */
87
+ export default {
88
+ name: 'uniPopupMessage',
89
+ mixins: [popup],
90
+ props: {
91
+ /**
92
+ * 主题 success/warning/info/error 默认 success
93
+ */
94
+ type: {
95
+ type: String,
96
+ default: 'success'
97
+ },
98
+ /**
99
+ * 消息文字
100
+ */
101
+ message: {
102
+ type: String,
103
+ default: ''
104
+ },
105
+ /**
106
+ * 显示时间,设置为 0 则不会自动关闭
107
+ */
108
+ duration: {
109
+ type: Number,
110
+ default: 3000
111
+ },
112
+ maskShow: {
113
+ type: Boolean,
114
+ default: false
115
+ }
116
+ },
117
+ data() {
118
+ return {};
119
+ },
120
+ created() {
121
+ this.popup.maskShow = this.maskShow;
122
+ this.popup.messageChild = this;
123
+ },
124
+ methods: {
125
+ timerClose() {
126
+ if (this.duration === 0) return;
127
+ clearTimeout(this.timer);
128
+ this.timer = setTimeout(() => {
129
+ this.popup.close();
130
+ }, this.duration);
131
+ }
132
+ }
133
+ };
134
+ </script>
135
+ <style>
136
+ @import 'style.css';
137
+ </style>
@@ -1 +1,106 @@
1
- <template>
2
1
  <view class="uni-popup-share">
3
2
  <view class="uni-share-title">
4
3
  <text class="uni-share-title-text">{{ shareTitleText }}</text>
5
4
  </view>
6
5
  <view class="uni-share-content">
7
6
  <view class="uni-share-content-box">
8
7
  <view class="uni-share-content-item" v-for="(item, index) in bottomData" :key="index" @click.stop="select(item, index)">
9
8
  <image class="uni-share-image" :src="item.icon" mode="aspectFill"></image>
10
9
  <text class="uni-share-text">{{ item.text }}</text>
11
10
  </view>
12
11
  </view>
13
12
  </view>
14
13
  <view class="uni-share-button-box">
15
14
  <button class="uni-share-button" @click="close">{{ cancelText }}</button>
16
15
  </view>
17
16
  </view>
18
17
  name: 'UniPopupShare',
19
18
  mixins: [popup],
20
19
  emits: ['select'],
21
20
  props: {
22
21
  title: {
23
22
  type: String,
24
23
  default: ''
25
24
  },
26
25
  beforeClose: {
27
26
  type: Boolean,
28
27
  default: false
29
28
  }
30
29
  },
31
30
  data() {
32
31
  return {
33
32
  bottomData: [
34
33
  {
35
34
  text: '微信',
36
35
  icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/c2b17470-50be-11eb-b680-7980c8a877b8.png',
37
36
  name: 'wx'
38
37
  },
39
38
  {
40
39
  text: '支付宝',
41
40
  icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/d684ae40-50be-11eb-8ff1-d5dcf8779628.png',
42
41
  name: 'wx'
43
42
  },
44
43
  {
45
44
  text: 'QQ',
46
45
  icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/e7a79520-50be-11eb-b997-9918a5dda011.png',
47
46
  name: 'qq'
48
47
  },
49
48
  {
50
49
  text: '新浪',
51
50
  icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/0dacdbe0-50bf-11eb-8ff1-d5dcf8779628.png',
52
51
  name: 'sina'
53
52
  }
54
53
  // {
55
54
  // text: '百度',
56
55
  // icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/1ec6e920-50bf-11eb-8a36-ebb87efcf8c0.png',
57
56
  // name: 'copy'
58
57
  // },
59
58
  // {
60
59
  // text: '其他',
61
60
  // icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/2e0fdfe0-50bf-11eb-b997-9918a5dda011.png',
62
61
  // name: 'more'
63
62
  // }
64
63
  ]
65
64
  };
66
65
  },
67
66
  created() {},
68
67
  computed: {
69
68
  cancelText() {
70
69
  return t('uni-popup.cancel');
71
70
  },
72
71
  shareTitleText() {
73
72
  return this.title || t('uni-popup.shareTitle');
74
73
  }
75
74
  },
76
75
  methods: {
77
76
  /**
78
77
  * 选择内容
79
78
  */
80
79
  select(item, index) {
81
80
  this.$emit('select', {
82
81
  item,
83
82
  index
84
83
  });
85
84
  this.close();
86
85
  },
87
86
  /**
88
87
  * 关闭窗口
89
88
  */
90
89
  close() {
91
90
  if (this.beforeClose) return;
92
91
  this.popup.close();
93
92
  }
94
93
  }
94
+ <template>
95
+ <view class="uni-popup-share">
96
+ <view class="uni-share-title">
97
+ <text class="uni-share-title-text">{{ shareTitleText }}</text>
98
+ </view>
99
+ <view class="uni-share-content">
100
+ <view class="uni-share-content-box">
101
+ <view class="uni-share-content-item" v-for="(item, index) in bottomData" :key="index" @click.stop="select(item, index)">
102
+ <image class="uni-share-image" :src="item.icon" mode="aspectFill"></image>
103
+ <text class="uni-share-text">{{ item.text }}</text>
104
+ </view>
105
+ </view>
106
+ </view>
107
+ <view class="uni-share-button-box">
108
+ <button class="uni-share-button" @click="close">{{ cancelText }}</button>
109
+ </view>
110
+ </view>
111
+ </template>
112
+ <script>
113
+ import popup from '../uni-popup/popup.js';
114
+ import { initVueI18n } from '@dcloudio/uni-i18n';
115
+ import messages from '../uni-popup/i18n/index.js';
116
+ const { t } = initVueI18n(messages);
117
+ export default {
118
+ name: 'UniPopupShare',
119
+ mixins: [popup],
120
+ emits: ['select'],
121
+ props: {
122
+ title: {
123
+ type: String,
124
+ default: ''
125
+ },
126
+ beforeClose: {
127
+ type: Boolean,
128
+ default: false
129
+ }
130
+ },
131
+ data() {
132
+ return {
133
+ bottomData: [
134
+ {
135
+ text: '微信',
136
+ icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/c2b17470-50be-11eb-b680-7980c8a877b8.png',
137
+ name: 'wx'
138
+ },
139
+ {
140
+ text: '支付宝',
141
+ icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/d684ae40-50be-11eb-8ff1-d5dcf8779628.png',
142
+ name: 'wx'
143
+ },
144
+ {
145
+ text: 'QQ',
146
+ icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/e7a79520-50be-11eb-b997-9918a5dda011.png',
147
+ name: 'qq'
148
+ },
149
+ {
150
+ text: '新浪',
151
+ icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/0dacdbe0-50bf-11eb-8ff1-d5dcf8779628.png',
152
+ name: 'sina'
153
+ }
154
+ // {
155
+ // text: '百度',
156
+ // icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/1ec6e920-50bf-11eb-8a36-ebb87efcf8c0.png',
157
+ // name: 'copy'
158
+ // },
159
+ // {
160
+ // text: '其他',
161
+ // icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/2e0fdfe0-50bf-11eb-b997-9918a5dda011.png',
162
+ // name: 'more'
163
+ // }
164
+ ]
165
+ };
166
+ },
167
+ created() {},
168
+ computed: {
169
+ cancelText() {
170
+ return t('uni-popup.cancel');
171
+ },
172
+ shareTitleText() {
173
+ return this.title || t('uni-popup.shareTitle');
174
+ }
175
+ },
176
+ methods: {
177
+ /**
178
+ * 选择内容
179
+ */
180
+ select(item, index) {
181
+ this.$emit('select', {
182
+ item,
183
+ index
184
+ });
185
+ this.close();
186
+ },
187
+ /**
188
+ * 关闭窗口
189
+ */
190
+ close() {
191
+ if (this.beforeClose) return;
192
+ this.popup.close();
193
+ }
194
+ }
195
+ };
196
+ </script>
197
+ <style>
198
+ @import 'style.css';
199
+ </style>