@10yun/cv-mobile-ui 0.4.2 → 0.4.4

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 (168) hide show
  1. package/package.json +1 -1
  2. package/ui-cv/cv-form-item/cv-form-item.vue +1 -1
  3. package/ui-cv/cv-input-password/cv-input-password.vue +2 -2
  4. package/ui-uni/amap-wx/js/util.js +166 -158
  5. package/ui-uni/page-foot/page-foot.vue +38 -0
  6. package/ui-uni/page-head/page-head.vue +16 -0
  7. package/ui-uni/product.vue +52 -52
  8. package/ui-uni/u-charts/u-charts.js +743 -1092
  9. package/ui-uni/u-link/u-link.vue +59 -0
  10. package/ui-uni/uni-badge/uni-badge.vue +250 -0
  11. package/ui-uni/uni-calendar/calendar.js +546 -0
  12. package/ui-uni/uni-calendar/uni-calendar-item.vue +171 -0
  13. package/ui-uni/uni-calendar/uni-calendar.vue +504 -0
  14. package/{ui-cv/cv-calendar → ui-uni/uni-calendar}/util.js +0 -0
  15. package/ui-uni/uni-card/uni-card.vue +420 -0
  16. package/ui-uni/uni-col/uni-col.vue +2968 -0
  17. package/ui-uni/uni-collapse/uni-collapse.vue +146 -0
  18. package/ui-uni/uni-collapse-item/uni-collapse-item.vue +378 -0
  19. package/ui-uni/uni-combox/uni-combox.vue +237 -0
  20. package/ui-uni/uni-countdown/uni-countdown.vue +234 -0
  21. package/ui-uni/uni-data-checkbox/uni-data-checkbox.vue +792 -0
  22. package/{ui-cv/cv-data-indexed-list → ui-uni/uni-data-indexed-list}/clientdb.js +0 -0
  23. package/ui-uni/uni-data-indexed-list/uni-data-indexed-list-item.vue +142 -0
  24. package/ui-uni/uni-data-indexed-list/uni-data-indexed-list.vue +364 -0
  25. package/{ui-cv/cv-data-picker → ui-uni/uni-data-picker}/keypress.js +0 -0
  26. package/ui-uni/uni-data-picker/uni-data-picker.vue +468 -0
  27. package/{ui-cv/cv-data-pickerview/cv-data-picker.js → ui-uni/uni-data-pickerview/uni-data-picker.js} +0 -0
  28. package/ui-uni/uni-data-pickerview/uni-data-pickerview.vue +298 -0
  29. package/{ui-cv/cv-dateformat → ui-uni/uni-dateformat}/date-format.js +0 -0
  30. package/ui-uni/uni-dateformat/uni-dateformat.vue +88 -0
  31. package/{ui-cv/cv-datetime-picker → ui-uni/uni-datetime-picker}/calendar-item.vue +0 -0
  32. package/{ui-cv/cv-datetime-picker → ui-uni/uni-datetime-picker}/calendar.js +0 -0
  33. package/ui-uni/uni-datetime-picker/calendar.vue +747 -0
  34. package/{ui-cv/cv-datetime-picker → ui-uni/uni-datetime-picker}/keypress.js +0 -0
  35. package/ui-uni/uni-datetime-picker/time-picker.vue +899 -0
  36. package/ui-uni/uni-datetime-picker/uni-datetime-picker.vue +874 -0
  37. package/{ui-cv/cv-datetime-picker → ui-uni/uni-datetime-picker}/util.js +0 -0
  38. package/ui-uni/uni-drawer/keypress.js +45 -0
  39. package/ui-uni/uni-drawer/uni-drawer.vue +178 -0
  40. package/{ui-cv/cv-easyinput → ui-uni/uni-easyinput}/common.js +0 -0
  41. package/ui-uni/uni-easyinput/uni-easyinput.vue +438 -0
  42. package/ui-uni/uni-fab/uni-fab.vue +443 -0
  43. package/{ui-cv/cv-fab/cv-fab.vue.bak → ui-uni/uni-fab/uni-fab.vue.bak} +2 -2
  44. package/ui-uni/uni-fav/uni-fav.vue +136 -0
  45. package/{ui-cv/cv-file-picker → ui-uni/uni-file-picker}/choose-and-upload-file.js +0 -0
  46. package/ui-uni/uni-file-picker/uni-file-picker.vue +614 -0
  47. package/{ui-cv/cv-file-picker → ui-uni/uni-file-picker}/upload-file.vue +0 -0
  48. package/{ui-cv/cv-file-picker → ui-uni/uni-file-picker}/upload-image.vue +0 -0
  49. package/{ui-cv/cv-file-picker → ui-uni/uni-file-picker}/utils.js +0 -0
  50. package/ui-uni/uni-forms/uni-forms.vue +467 -0
  51. package/ui-uni/uni-forms/validate.js +486 -0
  52. package/ui-uni/uni-forms-item/uni-forms-item.vue +500 -0
  53. package/{ui-cv/cv-goods-nav/cv-goods-nav.vue → ui-uni/uni-goods-nav/uni-goods-nav.vue} +1 -1
  54. package/ui-uni/uni-grid/uni-grid.vue +141 -0
  55. package/ui-uni/uni-grid-item/uni-grid-item.vue +123 -0
  56. package/ui-uni/uni-group/uni-group.vue +123 -0
  57. package/ui-uni/uni-icons/icons.js +132 -0
  58. package/ui-uni/uni-icons/uni-icons.vue +72 -0
  59. package/{ui-cv/cv-icon2 → ui-uni/uni-icons}/uni.ttf +0 -0
  60. package/ui-uni/uni-indexed-list/uni-indexed-list-item.vue +142 -0
  61. package/ui-uni/uni-indexed-list/uni-indexed-list.vue +357 -0
  62. package/ui-uni/uni-link/uni-link.vue +117 -0
  63. package/ui-uni/uni-list/uni-list.vue +107 -0
  64. package/ui-uni/uni-list/uni-refresh.vue +65 -0
  65. package/{ui-cv/cv-list → ui-uni/uni-list}/uni-refresh.wxs +0 -0
  66. package/ui-uni/uni-list-ad/uni-list-ad.vue +106 -0
  67. package/{ui-cv/cv-list-chat/cv-list-chat.scss → ui-uni/uni-list-chat/uni-list-chat.scss} +0 -0
  68. package/{ui-cv/cv-list-chat/cv-list-chat.vue → ui-uni/uni-list-chat/uni-list-chat.vue} +0 -0
  69. package/ui-uni/uni-list-item/uni-list-item.vue +428 -0
  70. package/ui-uni/uni-load-more/uni-load-more.vue +366 -0
  71. package/ui-uni/uni-nav-bar/uni-nav-bar.vue +244 -0
  72. package/{ui-cv/cv-nav-bar/cv-status-bar.vue → ui-uni/uni-nav-bar/uni-status-bar.vue} +0 -0
  73. package/ui-uni/uni-notice-bar/uni-notice-bar.vue +394 -0
  74. package/ui-uni/uni-number-box/uni-number-box.vue +224 -0
  75. package/ui-uni/uni-pagination/uni-pagination.vue +376 -0
  76. package/{ui-cv/cv-popup → ui-uni/uni-popup}/keypress.js +0 -0
  77. package/{ui-cv/cv-popup → ui-uni/uni-popup}/popup.js +0 -0
  78. package/ui-uni/uni-popup/uni-popup.vue +412 -0
  79. package/{ui-cv/cv-popup-dialog → ui-uni/uni-popup-dialog}/keypress.js +0 -0
  80. package/{ui-cv/cv-popup-dialog/cv-popup-dialog.vue → ui-uni/uni-popup-dialog/uni-popup-dialog.vue} +0 -0
  81. package/ui-uni/uni-popup-message/uni-popup-message.vue +143 -0
  82. package/{ui-cv/cv-popup-share/cv-popup-share.vue → ui-uni/uni-popup-share/uni-popup-share.vue} +0 -0
  83. package/ui-uni/uni-rate/uni-rate.vue +357 -0
  84. package/ui-uni/uni-row/uni-row.vue +155 -0
  85. package/ui-uni/uni-search-bar/uni-search-bar.vue +262 -0
  86. package/{ui-cv/cv-section/cv-section.vue → ui-uni/uni-section/uni-section.vue} +0 -0
  87. package/{ui-cv/cv-segmented-control/cv-segmented-control.vue → ui-uni/uni-segmented-control/uni-segmented-control.vue} +0 -0
  88. package/{ui-cv/cv-status-bar/cv-status-bar.vue → ui-uni/uni-status-bar/uni-status-bar.vue} +0 -0
  89. package/ui-uni/uni-steps/uni-steps.vue +250 -0
  90. package/{ui-cv/cv-swipe-action/cv-swipe-action.vue → ui-uni/uni-swipe-action/uni-swipe-action.vue} +0 -0
  91. package/{ui-cv/cv-swipe-action-item → ui-uni/uni-swipe-action-item}/bindingx.js +0 -0
  92. package/{ui-cv/cv-swipe-action-item → ui-uni/uni-swipe-action-item}/index.wxs +0 -0
  93. package/{ui-cv/cv-swipe-action-item → ui-uni/uni-swipe-action-item}/isPC.js +0 -0
  94. package/{ui-cv/cv-swipe-action-item → ui-uni/uni-swipe-action-item}/mpalipay.js +0 -0
  95. package/{ui-cv/cv-swipe-action-item → ui-uni/uni-swipe-action-item}/mpother.js +0 -0
  96. package/{ui-cv/cv-swipe-action-item → ui-uni/uni-swipe-action-item}/mpwxs.js +0 -0
  97. package/{ui-cv/cv-swipe-action-item/cv-swipe-action-item.vue → ui-uni/uni-swipe-action-item/uni-swipe-action-item.vue} +0 -0
  98. package/ui-uni/uni-swiper-dot/uni-swiper-dot.vue +205 -0
  99. package/ui-uni/uni-table/uni-table.vue +455 -0
  100. package/ui-uni/uni-tag/uni-tag.vue +283 -0
  101. package/ui-uni/uni-tbody/uni-tbody.vue +30 -0
  102. package/ui-uni/uni-td/uni-td.vue +88 -0
  103. package/{ui-cv/cv-test/cv-test.vue → ui-uni/uni-test/uni-test.vue} +0 -0
  104. package/{ui-cv/cv-th → ui-uni/uni-th}/filter-dropdown.vue +0 -0
  105. package/ui-uni/uni-th/uni-th.vue +259 -0
  106. package/ui-uni/uni-thead/uni-thead.vue +114 -0
  107. package/ui-uni/uni-title/uni-title.vue +171 -0
  108. package/{ui-cv/cv-tr → ui-uni/uni-tr}/table-checkbox.vue +0 -0
  109. package/ui-uni/uni-tr/uni-tr.vue +156 -0
  110. package/{ui-cv/cv-transition → ui-uni/uni-transition}/createAnimation.js +0 -0
  111. package/ui-uni/uni-transition/uni-transition.vue +287 -0
  112. package/ui-cv/cv-badge/cv-badge.vue +0 -249
  113. package/ui-cv/cv-calendar/calendar.js +0 -963
  114. package/ui-cv/cv-calendar/cv-calendar-item.vue +0 -198
  115. package/ui-cv/cv-calendar/cv-calendar.vue +0 -508
  116. package/ui-cv/cv-card/cv-card.vue +0 -427
  117. package/ui-cv/cv-col/cv-col.vue +0 -2965
  118. package/ui-cv/cv-collapse/cv-collapse.vue +0 -146
  119. package/ui-cv/cv-collapse-item/cv-collapse-item.vue +0 -395
  120. package/ui-cv/cv-combox/cv-combox.vue +0 -250
  121. package/ui-cv/cv-countdown/cv-countdown.vue +0 -245
  122. package/ui-cv/cv-data-checkbox/cv-data-checkbox.vue +0 -841
  123. package/ui-cv/cv-data-indexed-list/cv-data-indexed-list-item.vue +0 -154
  124. package/ui-cv/cv-data-indexed-list/cv-data-indexed-list.vue +0 -376
  125. package/ui-cv/cv-data-picker/cv-data-picker.vue +0 -486
  126. package/ui-cv/cv-data-pickerview/cv-data-pickerview.vue +0 -304
  127. package/ui-cv/cv-dateformat/cv-dateformat.vue +0 -86
  128. package/ui-cv/cv-datetime-picker/calendar.vue +0 -761
  129. package/ui-cv/cv-datetime-picker/cv-datetime-picker.vue +0 -958
  130. package/ui-cv/cv-datetime-picker/time-picker.vue +0 -907
  131. package/ui-cv/cv-drawer/cv-drawer.vue +0 -185
  132. package/ui-cv/cv-drawer/keypress.js +0 -45
  133. package/ui-cv/cv-easyinput/cv-easyinput.vue +0 -514
  134. package/ui-cv/cv-fab/cv-fab.vue +0 -465
  135. package/ui-cv/cv-fav/cv-fav.vue +0 -150
  136. package/ui-cv/cv-file-picker/cv-file-picker.vue +0 -619
  137. package/ui-cv/cv-form-base/cv-form-base.vue +0 -470
  138. package/ui-cv/cv-form-base/validate.js +0 -477
  139. package/ui-cv/cv-grid-group/cv-grid-group.vue +0 -148
  140. package/ui-cv/cv-grid-item/cv-grid-item.vue +0 -132
  141. package/ui-cv/cv-icon2/cv-icon2.vue +0 -78
  142. package/ui-cv/cv-icon2/icons.js +0 -132
  143. package/ui-cv/cv-indexed-list/cv-indexed-list-item.vue +0 -154
  144. package/ui-cv/cv-indexed-list/cv-indexed-list.vue +0 -371
  145. package/ui-cv/cv-link2/cv-link2.vue +0 -130
  146. package/ui-cv/cv-list/cv-list.vue +0 -107
  147. package/ui-cv/cv-list/cv-refresh.vue +0 -65
  148. package/ui-cv/cv-list-ad/cv-list-ad.vue +0 -113
  149. package/ui-cv/cv-list-item/cv-list-item.vue +0 -449
  150. package/ui-cv/cv-nav-bar/cv-nav-bar.vue +0 -256
  151. package/ui-cv/cv-notice-bar/cv-notice-bar.vue +0 -453
  152. package/ui-cv/cv-number-box/cv-number-box.vue +0 -223
  153. package/ui-cv/cv-pagination/cv-pagination.vue +0 -397
  154. package/ui-cv/cv-popup/cv-popup.vue +0 -429
  155. package/ui-cv/cv-popup-message/cv-popup-message.vue +0 -143
  156. package/ui-cv/cv-row/cv-row.vue +0 -157
  157. package/ui-cv/cv-search-bar/cv-search-bar.vue +0 -280
  158. package/ui-cv/cv-steps/cv-steps.vue +0 -293
  159. package/ui-cv/cv-swiper-dot/cv-swiper-dot.vue +0 -255
  160. package/ui-cv/cv-table/cv-table.vue +0 -460
  161. package/ui-cv/cv-tag/cv-tag.vue +0 -276
  162. package/ui-cv/cv-tbody/cv-tbody.vue +0 -28
  163. package/ui-cv/cv-td/cv-td.vue +0 -93
  164. package/ui-cv/cv-th/cv-th.vue +0 -270
  165. package/ui-cv/cv-thead/cv-thead.vue +0 -114
  166. package/ui-cv/cv-title/cv-title.vue +0 -168
  167. package/ui-cv/cv-tr/cv-tr.vue +0 -166
  168. package/ui-cv/cv-transition/cv-transition.vue +0 -279
@@ -0,0 +1,357 @@
1
+ <template>
2
+ <view class="uni-indexed-list" ref="list" id="list">
3
+ <!-- #ifdef APP-NVUE -->
4
+ <list class="uni-indexed-list__scroll" scrollable="true" show-scrollbar="false">
5
+ <cell v-for="(list, idx) in lists" :key="idx" :ref="'uni-indexed-list-' + idx">
6
+ <!-- #endif -->
7
+ <!-- #ifndef APP-NVUE -->
8
+ <scroll-view :scroll-into-view="scrollViewId" class="uni-indexed-list__scroll" scroll-y>
9
+ <view v-for="(list, idx) in lists" :key="idx" :id="'uni-indexed-list-' + idx">
10
+ <!-- #endif -->
11
+ <indexed-list-item :list="list" :loaded="loaded" :idx="idx" :showSelect="showSelect" @itemClick="onClick"></indexed-list-item>
12
+ <!-- #ifndef APP-NVUE -->
13
+ </view>
14
+ </scroll-view>
15
+ <!-- #endif -->
16
+ <!-- #ifdef APP-NVUE -->
17
+ </cell>
18
+ </list>
19
+ <!-- #endif -->
20
+ <view class="uni-indexed-list__menu" :class="touchmove ? 'uni-indexed-list__menu--active' : ''" @touchstart="touchStart" @touchmove.stop.prevent="touchMove" @touchend="touchEnd" @mousedown.stop="mousedown" @mousemove.stop.prevent="mousemove" @mouseleave.stop="mouseleave">
21
+ <view v-for="(list, key) in lists" :key="key" class="uni-indexed-list__menu-item">
22
+ <text class="uni-indexed-list__menu-text" :class="touchmoveIndex == key ? 'uni-indexed-list__menu-text--active' : ''">{{ list.key }}</text>
23
+ </view>
24
+ </view>
25
+ <view v-if="touchmove" class="uni-indexed-list__alert-wrapper">
26
+ <text class="uni-indexed-list__alert">{{ lists[touchmoveIndex].key }}</text>
27
+ </view>
28
+ </view>
29
+ </template>
30
+ <script>
31
+ import indexedListItem from './uni-indexed-list-item.vue'
32
+ // #ifdef APP-NVUE
33
+ const dom = weex.requireModule('dom');
34
+ // #endif
35
+ // #ifdef APP-PLUS
36
+ function throttle(func, delay) {
37
+ var prev = Date.now();
38
+ return function() {
39
+ var context = this;
40
+ var args = arguments;
41
+ var now = Date.now();
42
+ if (now - prev >= delay) {
43
+ func.apply(context, args);
44
+ prev = Date.now();
45
+ }
46
+ }
47
+ }
48
+
49
+ function touchMove(e) {
50
+ let pageY = e.touches[0].pageY
51
+ let index = Math.floor((pageY - this.winOffsetY) / this.itemHeight)
52
+ if (this.touchmoveIndex === index) {
53
+ return false
54
+ }
55
+ let item = this.lists[index]
56
+ if (item) {
57
+ // #ifndef APP-NVUE
58
+ this.scrollViewId = 'uni-indexed-list-' + index
59
+ this.touchmoveIndex = index
60
+ // #endif
61
+ // #ifdef APP-NVUE
62
+ dom.scrollToElement(this.$refs['uni-indexed-list-' + index][0], {
63
+ animated: false
64
+ })
65
+ this.touchmoveIndex = index
66
+ // #endif
67
+ }
68
+ }
69
+ const throttleTouchMove = throttle(touchMove, 40)
70
+ // #endif
71
+
72
+ /**
73
+ * IndexedList 索引列表
74
+ * @description 用于展示索引列表
75
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=375
76
+ * @property {Boolean} showSelect = [true|false] 展示模式
77
+ * @value true 展示模式
78
+ * @value false 选择模式
79
+ * @property {Object} options 索引列表需要的数据对象
80
+ * @event {Function} click 点击列表事件 ,返回当前选择项的事件对象
81
+ * @example <uni-indexed-list options="" showSelect="false" @click=""></uni-indexed-list>
82
+ */
83
+ export default {
84
+ name: 'UniIndexedList',
85
+ components: {
86
+ indexedListItem
87
+ },
88
+ emits: ['click'],
89
+ props: {
90
+ options: {
91
+ type: Array,
92
+ default () {
93
+ return []
94
+ }
95
+ },
96
+ showSelect: {
97
+ type: Boolean,
98
+ default: false
99
+ }
100
+ },
101
+ data() {
102
+ return {
103
+ lists: [],
104
+ winHeight: 0,
105
+ itemHeight: 0,
106
+ winOffsetY: 0,
107
+ touchmove: false,
108
+ touchmoveIndex: -1,
109
+ scrollViewId: '',
110
+ touchmovable: true,
111
+ loaded: false,
112
+ isPC: false
113
+ }
114
+ },
115
+ watch: {
116
+ options: {
117
+ handler: function() {
118
+ this.setList()
119
+ },
120
+ deep: true
121
+ }
122
+ },
123
+ mounted() {
124
+ // #ifdef H5
125
+ this.isPC = this.IsPC()
126
+ // #endif
127
+ setTimeout(() => {
128
+ this.setList()
129
+ }, 50)
130
+ setTimeout(() => {
131
+ this.loaded = true
132
+ }, 300);
133
+ },
134
+ methods: {
135
+ setList() {
136
+ let index = 0;
137
+ this.lists = []
138
+ this.options.forEach((value, index) => {
139
+ if (value.data.length === 0) {
140
+ return
141
+ }
142
+ let indexBefore = index
143
+ let items = value.data.map(item => {
144
+ let obj = {}
145
+ obj['key'] = value.letter
146
+ obj['name'] = item
147
+ obj['itemIndex'] = index
148
+ index++
149
+ obj.checked = item.checked ? item.checked : false
150
+ return obj
151
+ })
152
+ this.lists.push({
153
+ title: value.letter,
154
+ key: value.letter,
155
+ items: items,
156
+ itemIndex: indexBefore
157
+ })
158
+ })
159
+ // #ifndef APP-NVUE
160
+ uni.createSelectorQuery()
161
+ .in(this)
162
+ .select('#list')
163
+ .boundingClientRect()
164
+ .exec(ret => {
165
+ this.winOffsetY = ret[0].top
166
+ this.winHeight = ret[0].height
167
+ this.itemHeight = this.winHeight / this.lists.length
168
+ })
169
+ // #endif
170
+ // #ifdef APP-NVUE
171
+ dom.getComponentRect(this.$refs['list'], (res) => {
172
+ this.winOffsetY = res.size.top
173
+ this.winHeight = res.size.height
174
+ this.itemHeight = this.winHeight / this.lists.length
175
+ })
176
+ // #endif
177
+ },
178
+ touchStart(e) {
179
+ this.touchmove = true
180
+ let pageY = this.isPC ? e.pageY : e.touches[0].pageY
181
+ let index = Math.floor((pageY - this.winOffsetY) / this.itemHeight)
182
+ let item = this.lists[index]
183
+ if (item) {
184
+ this.scrollViewId = 'uni-indexed-list-' + index
185
+ this.touchmoveIndex = index
186
+ // #ifdef APP-NVUE
187
+ dom.scrollToElement(this.$refs['uni-indexed-list-' + index][0], {
188
+ animated: false
189
+ })
190
+ // #endif
191
+ }
192
+ },
193
+ touchMove(e) {
194
+ // #ifndef APP-PLUS
195
+ let pageY = this.isPC ? e.pageY : e.touches[0].pageY
196
+ let index = Math.floor((pageY - this.winOffsetY) / this.itemHeight)
197
+ if (this.touchmoveIndex === index) {
198
+ return false
199
+ }
200
+ let item = this.lists[index]
201
+ if (item) {
202
+ this.scrollViewId = 'uni-indexed-list-' + index
203
+ this.touchmoveIndex = index
204
+ }
205
+ // #endif
206
+ // #ifdef APP-PLUS
207
+ throttleTouchMove.call(this, e)
208
+ // #endif
209
+ },
210
+ touchEnd() {
211
+ this.touchmove = false
212
+ this.touchmoveIndex = -1
213
+ },
214
+
215
+ /**
216
+ * 兼容 PC @tian
217
+ */
218
+
219
+ mousedown(e) {
220
+ if (!this.isPC) return
221
+ this.touchStart(e)
222
+ },
223
+ mousemove(e) {
224
+ if (!this.isPC) return
225
+ this.touchMove(e)
226
+ },
227
+ mouseleave(e) {
228
+ if (!this.isPC) return
229
+ this.touchEnd(e)
230
+ },
231
+
232
+ // #ifdef H5
233
+ IsPC() {
234
+ var userAgentInfo = navigator.userAgent;
235
+ var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
236
+ var flag = true;
237
+ for (let v = 0; v < Agents.length - 1; v++) {
238
+ if (userAgentInfo.indexOf(Agents[v]) > 0) {
239
+ flag = false;
240
+ break;
241
+ }
242
+ }
243
+ return flag;
244
+ },
245
+ // #endif
246
+
247
+
248
+ onClick(e) {
249
+ let {
250
+ idx,
251
+ index
252
+ } = e
253
+ let obj = {}
254
+ for (let key in this.lists[idx].items[index]) {
255
+ obj[key] = this.lists[idx].items[index][key]
256
+ }
257
+ let select = []
258
+ if (this.showSelect) {
259
+ this.lists[idx].items[index].checked = !this.lists[idx].items[index].checked
260
+ this.lists.forEach((value, idx) => {
261
+ value.items.forEach((item, index) => {
262
+ if (item.checked) {
263
+ let obj = {}
264
+ for (let key in this.lists[idx].items[index]) {
265
+ obj[key] = this.lists[idx].items[index][key]
266
+ }
267
+ select.push(obj)
268
+ }
269
+ })
270
+ })
271
+ }
272
+ this.$emit('click', {
273
+ item: obj,
274
+ select: select
275
+ })
276
+ }
277
+ }
278
+ }
279
+ </script>
280
+ <style scoped>
281
+ .uni-indexed-list {
282
+ position: absolute;
283
+ left: 0;
284
+ top: 0;
285
+ right: 0;
286
+ bottom: 0;
287
+ /* #ifndef APP-NVUE */
288
+ display: flex;
289
+ /* #endif */
290
+ flex-direction: row;
291
+ }
292
+
293
+ .uni-indexed-list__scroll {
294
+ flex: 1;
295
+ }
296
+
297
+ .uni-indexed-list__menu {
298
+ width: 24px;
299
+ background-color: lightgrey;
300
+ /* #ifndef APP-NVUE */
301
+ display: flex;
302
+ /* #endif */
303
+ flex-direction: column;
304
+ }
305
+
306
+ .uni-indexed-list__menu-item {
307
+ /* #ifndef APP-NVUE */
308
+ display: flex;
309
+ /* #endif */
310
+ flex: 1;
311
+ align-items: center;
312
+ justify-content: center;
313
+ /* #ifdef H5 */
314
+ cursor: pointer;
315
+ /* #endif */
316
+ }
317
+
318
+ .uni-indexed-list__menu-text {
319
+ line-height: 20px;
320
+ font-size: 12px;
321
+ text-align: center;
322
+ color: #aaa;
323
+ }
324
+
325
+ .uni-indexed-list__menu--active {
326
+ background-color: #c8c8c8;
327
+ }
328
+
329
+ .uni-indexed-list__menu-text--active {
330
+ color: #007aff;
331
+ }
332
+
333
+ .uni-indexed-list__alert-wrapper {
334
+ position: absolute;
335
+ left: 0;
336
+ top: 0;
337
+ right: 0;
338
+ bottom: 0;
339
+ /* #ifndef APP-NVUE */
340
+ display: flex;
341
+ /* #endif */
342
+ flex-direction: row;
343
+ align-items: center;
344
+ justify-content: center;
345
+ }
346
+
347
+ .uni-indexed-list__alert {
348
+ width: 80px;
349
+ height: 80px;
350
+ border-radius: 80px;
351
+ text-align: center;
352
+ line-height: 80px;
353
+ font-size: 35px;
354
+ color: #fff;
355
+ background-color: rgba(0, 0, 0, 0.5);
356
+ }
357
+ </style>
@@ -0,0 +1,117 @@
1
+ <template>
2
+ <a v-if="isShowA" class="uni-link" :href="href" :class="{'uni-link--withline':showUnderLine===true||showUnderLine==='true'}" :style="{color,fontSize:fontSize+'px'}" :download="download">
3
+ <slot>{{text}}</slot>
4
+ </a>
5
+ <text v-else class="uni-link" :class="{'uni-link--withline':showUnderLine===true||showUnderLine==='true'}" :style="{color,fontSize:fontSize+'px'}" @click="openURL">
6
+ <slot>{{text}}</slot>
7
+ </text>
8
+ </template>
9
+
10
+ <script>
11
+ /**
12
+ * Link 外部网页超链接组件
13
+ * @description uni-link是一个外部网页超链接组件,在小程序内复制url,在app内打开外部浏览器,在h5端打开新网页
14
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=1182
15
+ * @property {String} href 点击后打开的外部网页url
16
+ * @property {String} text 显示的文字
17
+ * @property {String} downlaod H5平台下载文件名
18
+ * @property {Boolean} showUnderLine 是否显示下划线
19
+ * @property {String} copyTips 在小程序端复制链接时显示的提示语
20
+ * @property {String} color 链接文字颜色
21
+ * @property {String} fontSize 链接文字大小
22
+ * @example * <uni-link href="https://ext.dcloud.net.cn" text="https://ext.dcloud.net.cn"></uni-link>
23
+ */
24
+ export default {
25
+ name: 'uniLink',
26
+ props: {
27
+ href: {
28
+ type: String,
29
+ default: ''
30
+ },
31
+ text: {
32
+ type: String,
33
+ default: ''
34
+ },
35
+ download: {
36
+ type: String,
37
+ default: ''
38
+ },
39
+ showUnderLine: {
40
+ type: [Boolean, String],
41
+ default: true
42
+ },
43
+ copyTips: {
44
+ type: String,
45
+ default: '已自动复制网址,请在手机浏览器里粘贴该网址'
46
+ },
47
+ color: {
48
+ type: String,
49
+ default: '#999999'
50
+ },
51
+ fontSize: {
52
+ type: [Number, String],
53
+ default: 14
54
+ }
55
+ },
56
+ computed: {
57
+ isShowA() {
58
+ // #ifdef H5
59
+ this._isH5 = true;
60
+ // #endif
61
+ if ((this.isMail() || this.isTel()) && this._isH5 === true) {
62
+ return true;
63
+ }
64
+ return false;
65
+ }
66
+ },
67
+ created() {
68
+ this._isH5 = null;
69
+ },
70
+ methods: {
71
+ isMail() {
72
+ return this.href.startsWith('mailto:');
73
+ },
74
+ isTel() {
75
+ return this.href.startsWith('tel:');
76
+ },
77
+ openURL() {
78
+ // #ifdef APP-PLUS
79
+ if (this.isTel()) {
80
+ this.makePhoneCall(this.href.replace('tel:', ''));
81
+ } else {
82
+ plus.runtime.openURL(this.href);
83
+ }
84
+ // #endif
85
+ // #ifdef H5
86
+ window.open(this.href)
87
+ // #endif
88
+ // #ifdef MP
89
+ uni.setClipboardData({
90
+ data: this.href
91
+ });
92
+ uni.showModal({
93
+ content: this.copyTips,
94
+ showCancel: false
95
+ });
96
+ // #endif
97
+ },
98
+ makePhoneCall(phoneNumber) {
99
+ uni.makePhoneCall({
100
+ phoneNumber
101
+ })
102
+ }
103
+ }
104
+ }
105
+ </script>
106
+
107
+ <style scoped>
108
+ /* #ifndef APP-NVUE */
109
+ .uni-link {
110
+ cursor: pointer;
111
+ }
112
+
113
+ /* #endif */
114
+ .uni-link--withline {
115
+ text-decoration: underline;
116
+ }
117
+ </style>
@@ -0,0 +1,107 @@
1
+ <template>
2
+ <!-- #ifndef APP-NVUE -->
3
+ <view class="uni-list uni-border-top-bottom">
4
+ <view v-if="border" class="uni-list--border-top"></view>
5
+ <slot />
6
+ <view v-if="border" class="uni-list--border-bottom"></view>
7
+ </view>
8
+ <!-- #endif -->
9
+ <!-- #ifdef APP-NVUE -->
10
+ <list class="uni-list" :class="{ 'uni-list--border': border }" :enableBackToTop="enableBackToTop" loadmoreoffset="15">
11
+ <slot />
12
+ </list>
13
+ <!-- #endif -->
14
+ </template>
15
+
16
+ <script>
17
+ /**
18
+ * List 列表
19
+ * @description 列表组件
20
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=24
21
+ * @property {String} border = [true|false] 标题
22
+ */
23
+ export default {
24
+ name: 'uniList',
25
+ 'mp-weixin': {
26
+ options: {
27
+ multipleSlots: false
28
+ }
29
+ },
30
+ props: {
31
+ enableBackToTop: {
32
+ type: [Boolean, String],
33
+ default: false
34
+ },
35
+ scrollY: {
36
+ type: [Boolean, String],
37
+ default: false
38
+ },
39
+ border: {
40
+ type: Boolean,
41
+ default: true
42
+ }
43
+ },
44
+ // provide() {
45
+ // return {
46
+ // list: this
47
+ // };
48
+ // },
49
+ created() {
50
+ this.firstChildAppend = false;
51
+ },
52
+ methods: {
53
+ loadMore(e) {
54
+ this.$emit('scrolltolower');
55
+ }
56
+ }
57
+ };
58
+ </script>
59
+ <style scoped>
60
+ .uni-list {
61
+ /* #ifndef APP-NVUE */
62
+ display: flex;
63
+ /* #endif */
64
+ background-color: #ffffff;
65
+ position: relative;
66
+ flex-direction: column;
67
+ }
68
+
69
+ .uni-list--border {
70
+ position: relative;
71
+ /* #ifdef APP-NVUE */
72
+ border-top-color: #e5e5e5;
73
+ border-top-style: solid;
74
+ border-top-width: 0.5px;
75
+ border-bottom-color: #e5e5e5;
76
+ border-bottom-style: solid;
77
+ border-bottom-width: 0.5px;
78
+ /* #endif */
79
+ z-index: -1;
80
+ }
81
+
82
+ /* #ifndef APP-NVUE */
83
+ .uni-list--border-top {
84
+ position: absolute;
85
+ top: 0;
86
+ right: 0;
87
+ left: 0;
88
+ height: 1px;
89
+ -webkit-transform: scaleY(0.5);
90
+ transform: scaleY(0.5);
91
+ background-color: #e5e5e5;
92
+ z-index: 1;
93
+ }
94
+
95
+ .uni-list--border-bottom {
96
+ position: absolute;
97
+ bottom: 0;
98
+ right: 0;
99
+ left: 0;
100
+ height: 1px;
101
+ -webkit-transform: scaleY(0.5);
102
+ transform: scaleY(0.5);
103
+ background-color: #e5e5e5;
104
+ }
105
+
106
+ /* #endif */
107
+ </style>
@@ -0,0 +1,65 @@
1
+ <template>
2
+ <!-- #ifdef APP-NVUE -->
3
+ <refresh :display="display" @refresh="onrefresh" @pullingdown="onpullingdown">
4
+ <slot />
5
+ </refresh>
6
+ <!-- #endif -->
7
+ <!-- #ifndef APP-NVUE -->
8
+ <view ref="uni-refresh" class="uni-refresh" v-show="isShow">
9
+ <slot />
10
+ </view>
11
+ <!-- #endif -->
12
+ </template>
13
+
14
+ <script>
15
+ export default {
16
+ name: 'UniRefresh',
17
+ props: {
18
+ display: {
19
+ type: [String],
20
+ default: "hide"
21
+ }
22
+ },
23
+ data() {
24
+ return {
25
+ pulling: false
26
+ }
27
+ },
28
+ computed: {
29
+ isShow() {
30
+ if (this.display === "show" || this.pulling === true) {
31
+ return true;
32
+ }
33
+ return false;
34
+ }
35
+ },
36
+ created() {},
37
+ methods: {
38
+ onchange(value) {
39
+ this.pulling = value;
40
+ },
41
+ onrefresh(e) {
42
+ this.$emit("refresh", e);
43
+ },
44
+ onpullingdown(e) {
45
+ // #ifdef APP-NVUE
46
+ this.$emit("pullingdown", e);
47
+ // #endif
48
+ // #ifndef APP-NVUE
49
+ var detail = {
50
+ viewHeight: 90,
51
+ pullingDistance: e.height
52
+ }
53
+ this.$emit("pullingdown", detail);
54
+ // #endif
55
+ }
56
+ }
57
+ }
58
+ </script>
59
+
60
+ <style scoped>
61
+ .uni-refresh {
62
+ height: 0;
63
+ overflow: hidden;
64
+ }
65
+ </style>