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

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 (235) hide show
  1. package/build/parse-pages.js +2 -2
  2. package/package.json +1 -1
  3. package/ui-cv/README.md +3 -0
  4. package/ui-cv/cv-badge/cv-badge.vue +249 -0
  5. package/ui-cv/cv-banner/cv-banner.vue +1 -1
  6. package/ui-cv/cv-banner-card/cv-banner-card.vue +1 -1
  7. package/ui-cv/cv-block/cv-block.vue +1 -1
  8. package/ui-cv/cv-box/cv-box.vue +1 -1
  9. package/ui-cv/cv-calendar/calendar.js +963 -0
  10. package/ui-cv/cv-calendar/cv-calendar-item.vue +198 -0
  11. package/ui-cv/cv-calendar/cv-calendar.vue +508 -0
  12. package/{ui-uni/uni-calendar → ui-cv/cv-calendar}/util.js +0 -0
  13. package/ui-cv/cv-card/cv-card.vue +427 -0
  14. package/ui-cv/cv-cell/cv-cell.vue +1 -1
  15. package/ui-cv/cv-checkbox-group/cv-checkbox-group.vue +227 -0
  16. package/ui-cv/cv-checkbox-opt-base/cv-checkbox-opt-base.vue +57 -0
  17. package/ui-cv/cv-checkbox-opt-tag/cv-checkbox-opt-tag.vue +107 -0
  18. package/ui-cv/cv-code-sms/cv-code-sms.vue +23 -42
  19. package/ui-cv/cv-col/cv-col.vue +2965 -0
  20. package/ui-cv/cv-collapse/cv-collapse.vue +146 -0
  21. package/ui-cv/cv-collapse-item/cv-collapse-item.vue +395 -0
  22. package/ui-cv/cv-combox/cv-combox.vue +250 -0
  23. package/ui-cv/cv-countdown/cv-countdown.vue +245 -0
  24. package/ui-cv/cv-data-checkbox/cv-data-checkbox.vue +841 -0
  25. package/{ui-uni/uni-data-indexed-list → ui-cv/cv-data-indexed-list}/clientdb.js +0 -0
  26. package/ui-cv/cv-data-indexed-list/cv-data-indexed-list-item.vue +154 -0
  27. package/ui-cv/cv-data-indexed-list/cv-data-indexed-list.vue +376 -0
  28. package/ui-cv/cv-data-picker/cv-data-picker.vue +486 -0
  29. package/{ui-uni/uni-data-picker → ui-cv/cv-data-picker}/keypress.js +0 -0
  30. package/{ui-uni/uni-data-pickerview/uni-data-picker.js → ui-cv/cv-data-pickerview/cv-data-picker.js} +0 -0
  31. package/ui-cv/cv-data-pickerview/cv-data-pickerview.vue +304 -0
  32. package/ui-cv/cv-dateformat/cv-dateformat.vue +86 -0
  33. package/{ui-uni/uni-dateformat → ui-cv/cv-dateformat}/date-format.js +0 -0
  34. package/{ui-uni/uni-datetime-picker → ui-cv/cv-datetime-picker}/calendar-item.vue +0 -0
  35. package/{ui-uni/uni-datetime-picker → ui-cv/cv-datetime-picker}/calendar.js +0 -0
  36. package/ui-cv/cv-datetime-picker/calendar.vue +761 -0
  37. package/ui-cv/cv-datetime-picker/cv-datetime-picker.vue +958 -0
  38. package/{ui-uni/uni-datetime-picker → ui-cv/cv-datetime-picker}/keypress.js +0 -0
  39. package/ui-cv/cv-datetime-picker/time-picker.vue +907 -0
  40. package/{ui-uni/uni-datetime-picker → ui-cv/cv-datetime-picker}/util.js +0 -0
  41. package/ui-cv/cv-dialog-bottom/cv-dialog-bottom.vue +1 -1
  42. package/ui-cv/cv-dialog-full/cv-dialog-full.vue +1 -1
  43. package/ui-cv/cv-dialog-loading/cv-dialog-loading.vue +3 -3
  44. package/ui-cv/cv-drawer/cv-drawer.vue +185 -0
  45. package/{ui-uni/uni-drawer → ui-cv/cv-drawer}/keypress.js +14 -14
  46. package/{ui-uni/uni-easyinput → ui-cv/cv-easyinput}/common.js +0 -0
  47. package/ui-cv/cv-easyinput/cv-easyinput.vue +514 -0
  48. package/ui-cv/cv-editor-parse/readme.md +2 -3
  49. package/ui-cv/{cv-editor → cv-editor-quill}/compressImage.vue +0 -0
  50. package/ui-cv/{cv-editor/cv-editor.vue → cv-editor-quill/cv-editor-quill.vue} +3 -23
  51. package/ui-cv/{cv-editor → cv-editor-quill}/editor-icon.css +0 -0
  52. package/ui-cv/{cv-editor → cv-editor-quill}/editor-icon.ttf +0 -0
  53. package/ui-cv/{cv-editor → cv-editor-quill}/index.js +0 -0
  54. package/ui-cv/cv-fab/cv-fab.vue +465 -0
  55. package/{ui-uni/uni-fab/uni-fab.vue.bak → ui-cv/cv-fab/cv-fab.vue.bak} +2 -2
  56. package/ui-cv/cv-fav/cv-fav.vue +150 -0
  57. package/{ui-uni/uni-file-picker → ui-cv/cv-file-picker}/choose-and-upload-file.js +0 -0
  58. package/ui-cv/cv-file-picker/cv-file-picker.vue +619 -0
  59. package/{ui-uni/uni-file-picker → ui-cv/cv-file-picker}/upload-file.vue +0 -0
  60. package/{ui-uni/uni-file-picker → ui-cv/cv-file-picker}/upload-image.vue +0 -0
  61. package/{ui-uni/uni-file-picker → ui-cv/cv-file-picker}/utils.js +0 -0
  62. package/ui-cv/cv-form-base/cv-form-base.vue +470 -0
  63. package/ui-cv/cv-form-base/validate.js +477 -0
  64. package/ui-cv/cv-form-group/cv-form-group.vue +123 -80
  65. package/ui-cv/cv-form-group/cv-form-group2.vue +80 -0
  66. package/ui-cv/cv-form-item/cv-form-item.vue +482 -174
  67. package/ui-cv/cv-form-item/cv-form-item2.vue +215 -0
  68. package/ui-cv/cv-form-merge/cv-form-merge.vue +1 -1
  69. package/ui-cv/cv-geo-local/cv-geo-local.vue +14 -26
  70. package/{ui-uni/uni-goods-nav/uni-goods-nav.vue → ui-cv/cv-goods-nav/cv-goods-nav.vue} +1 -1
  71. package/ui-cv/cv-grid-group/cv-grid-group.vue +148 -0
  72. package/ui-cv/cv-grid-item/cv-grid-item.vue +132 -0
  73. package/ui-cv/cv-icon2/cv-icon2.vue +78 -0
  74. package/ui-cv/cv-icon2/icons.js +132 -0
  75. package/{ui-uni/uni-icons → ui-cv/cv-icon2}/uni.ttf +0 -0
  76. package/ui-cv/cv-icons/cv-icons.vue +1 -1
  77. package/ui-cv/cv-indexed-list/cv-indexed-list-item.vue +154 -0
  78. package/ui-cv/cv-indexed-list/cv-indexed-list.vue +371 -0
  79. package/ui-cv/cv-info/cv-info.vue +5 -20
  80. package/ui-cv/cv-input-btn/cv-input-btn.vue +25 -43
  81. package/ui-cv/cv-input-digit/cv-input-digit.vue +61 -28
  82. package/ui-cv/cv-input-idcard/cv-input-idcard.vue +47 -29
  83. package/ui-cv/cv-input-number/cv-input-number.vue +60 -28
  84. package/ui-cv/cv-input-password/cv-input-password.vue +80 -30
  85. package/ui-cv/cv-input-text/cv-input-text.vue +55 -37
  86. package/ui-cv/cv-link2/cv-link2.vue +130 -0
  87. package/ui-cv/cv-list/cv-list.vue +107 -0
  88. package/ui-cv/cv-list/cv-refresh.vue +65 -0
  89. package/{ui-uni/uni-list → ui-cv/cv-list}/uni-refresh.wxs +0 -0
  90. package/ui-cv/cv-list-ad/cv-list-ad.vue +113 -0
  91. package/{ui-uni/uni-list-chat/uni-list-chat.scss → ui-cv/cv-list-chat/cv-list-chat.scss} +0 -0
  92. package/{ui-uni/uni-list-chat/uni-list-chat.vue → ui-cv/cv-list-chat/cv-list-chat.vue} +0 -0
  93. package/ui-cv/cv-list-item/cv-list-item.vue +449 -0
  94. package/ui-cv/cv-load-more/config.json +9 -9
  95. package/ui-cv/cv-load-more/cv-load-more.vue +34 -5
  96. package/ui-cv/cv-message/cv-message.vue +1 -1
  97. package/ui-cv/cv-nav-bar/cv-nav-bar.vue +256 -0
  98. package/{ui-uni/uni-nav-bar/uni-status-bar.vue → ui-cv/cv-nav-bar/cv-status-bar.vue} +0 -0
  99. package/ui-cv/cv-nav-col/cv-nav-col.vue +1 -1
  100. package/ui-cv/cv-nav-row/cv-nav-row.vue +1 -1
  101. package/ui-cv/cv-notice-bar/cv-notice-bar.vue +453 -0
  102. package/ui-cv/cv-number-box/cv-number-box.vue +223 -0
  103. package/ui-cv/cv-pagination/cv-pagination.vue +397 -0
  104. package/ui-cv/cv-picker-date/cv-picker-date.vue +17 -27
  105. package/ui-cv/cv-picker-datetime/cv-picker-datetime.vue +31 -41
  106. package/ui-cv/cv-picker-datetime5/cv-picker-datetime5.vue +19 -29
  107. package/ui-cv/cv-picker-region/cv-picker-region.vue +23 -33
  108. package/ui-cv/cv-picker-time/cv-picker-time.vue +16 -26
  109. package/ui-cv/cv-picker1/cv-picker1.vue +16 -28
  110. package/ui-cv/cv-picker2/cv-picker2.vue +22 -32
  111. package/ui-cv/cv-picker3/cv-picker3.vue +34 -44
  112. package/ui-cv/cv-popup/cv-popup.vue +429 -0
  113. package/{ui-uni/uni-popup → ui-cv/cv-popup}/keypress.js +0 -0
  114. package/{ui-uni/uni-popup → ui-cv/cv-popup}/popup.js +0 -0
  115. package/{ui-uni/uni-popup-dialog/uni-popup-dialog.vue → ui-cv/cv-popup-dialog/cv-popup-dialog.vue} +0 -0
  116. package/{ui-uni/uni-popup-dialog → ui-cv/cv-popup-dialog}/keypress.js +0 -0
  117. package/ui-cv/cv-popup-message/cv-popup-message.vue +143 -0
  118. package/{ui-uni/uni-popup-share/uni-popup-share.vue → ui-cv/cv-popup-share/cv-popup-share.vue} +0 -0
  119. package/ui-cv/cv-radio-group/cv-radio-group.vue +185 -0
  120. package/ui-cv/cv-radio-opt-base/cv-radio-opt-base.vue +57 -0
  121. package/ui-cv/cv-radio-opt-tag/cv-radio-opt-tag.vue +107 -0
  122. package/ui-cv/cv-rate/cv-rate.vue +13 -17
  123. package/ui-cv/cv-rate/uni-rate.vue +358 -0
  124. package/ui-cv/cv-row/cv-row.vue +157 -0
  125. package/ui-cv/cv-search/cv-search.vue +4 -4
  126. package/ui-cv/cv-search-bar/cv-search-bar.vue +280 -0
  127. package/{ui-uni/uni-section/uni-section.vue → ui-cv/cv-section/cv-section.vue} +0 -0
  128. package/{ui-uni/uni-segmented-control/uni-segmented-control.vue → ui-cv/cv-segmented-control/cv-segmented-control.vue} +0 -0
  129. package/ui-cv/cv-skeleton/cv-skeleton2.vue +5 -5
  130. package/ui-cv/cv-specs/cv-specs.vue +1 -1
  131. package/{ui-uni/uni-status-bar/uni-status-bar.vue → ui-cv/cv-status-bar/cv-status-bar.vue} +0 -0
  132. package/ui-cv/cv-steps/cv-steps.vue +293 -0
  133. package/{ui-uni/uni-swipe-action/uni-swipe-action.vue → ui-cv/cv-swipe-action/cv-swipe-action.vue} +0 -0
  134. package/{ui-uni/uni-swipe-action-item → ui-cv/cv-swipe-action-item}/bindingx.js +0 -0
  135. package/{ui-uni/uni-swipe-action-item/uni-swipe-action-item.vue → ui-cv/cv-swipe-action-item/cv-swipe-action-item.vue} +0 -0
  136. package/{ui-uni/uni-swipe-action-item → ui-cv/cv-swipe-action-item}/index.wxs +0 -0
  137. package/{ui-uni/uni-swipe-action-item → ui-cv/cv-swipe-action-item}/isPC.js +0 -0
  138. package/{ui-uni/uni-swipe-action-item → ui-cv/cv-swipe-action-item}/mpalipay.js +0 -0
  139. package/{ui-uni/uni-swipe-action-item → ui-cv/cv-swipe-action-item}/mpother.js +0 -0
  140. package/{ui-uni/uni-swipe-action-item → ui-cv/cv-swipe-action-item}/mpwxs.js +0 -0
  141. package/ui-cv/cv-swiper-dot/cv-swiper-dot.vue +255 -0
  142. package/ui-cv/cv-switch/cv-switch.vue +5 -9
  143. package/ui-cv/cv-table/cv-table.vue +460 -0
  144. package/ui-cv/cv-tag/cv-tag.vue +276 -0
  145. package/ui-cv/cv-tbody/cv-tbody.vue +28 -0
  146. package/ui-cv/cv-td/cv-td.vue +93 -0
  147. package/{ui-uni/uni-test/uni-test.vue → ui-cv/cv-test/cv-test.vue} +0 -0
  148. package/ui-cv/cv-textarea/cv-textarea.vue +56 -41
  149. package/ui-cv/cv-th/cv-th.vue +270 -0
  150. package/{ui-uni/uni-th → ui-cv/cv-th}/filter-dropdown.vue +0 -0
  151. package/ui-cv/cv-thead/cv-thead.vue +114 -0
  152. package/ui-cv/cv-title/cv-title.vue +168 -0
  153. package/ui-cv/cv-tr/cv-tr.vue +166 -0
  154. package/{ui-uni/uni-tr → ui-cv/cv-tr}/table-checkbox.vue +0 -0
  155. package/{ui-uni/uni-transition → ui-cv/cv-transition}/createAnimation.js +0 -0
  156. package/ui-cv/cv-transition/cv-transition.vue +279 -0
  157. package/ui-cv/cv-upload-avatar/cv-upload-avatar.vue +24 -22
  158. package/ui-cv/cv-upload-img/cv-upload-img.vue +1 -1
  159. package/ui-cv/mixins/mixins-input.js +20 -29
  160. package/ui-cv/mixins/mixins-picker.js +1 -13
  161. package/ui-uni/amap-wx/js/util.js +158 -166
  162. package/ui-uni/product.vue +52 -52
  163. package/ui-uni/u-charts/u-charts.js +1092 -743
  164. package/ui-cv/cv-checkbox/cv-checkbox.vue +0 -140
  165. package/ui-cv/cv-checkbox-tag/cv-checkbox-tag.vue +0 -164
  166. package/ui-cv/cv-nav-group/cv-nav-group.vue +0 -33
  167. package/ui-cv/cv-radio/cv-radio.vue +0 -111
  168. package/ui-cv/cv-radio-sex/cv-radio-sex.vue +0 -80
  169. package/ui-cv/cv-radio-tag/cv-radio-tag.vue +0 -133
  170. package/ui-cv/mixins/mixins-checkbox.js +0 -71
  171. package/ui-cv/mixins/mixins-common.js +0 -53
  172. package/ui-cv/mixins/mixins-radio.js +0 -84
  173. package/ui-uni/page-foot/page-foot.vue +0 -38
  174. package/ui-uni/page-head/page-head.vue +0 -16
  175. package/ui-uni/u-link/u-link.vue +0 -59
  176. package/ui-uni/uni-badge/uni-badge.vue +0 -250
  177. package/ui-uni/uni-calendar/calendar.js +0 -546
  178. package/ui-uni/uni-calendar/uni-calendar-item.vue +0 -171
  179. package/ui-uni/uni-calendar/uni-calendar.vue +0 -504
  180. package/ui-uni/uni-card/uni-card.vue +0 -420
  181. package/ui-uni/uni-col/uni-col.vue +0 -2968
  182. package/ui-uni/uni-collapse/uni-collapse.vue +0 -146
  183. package/ui-uni/uni-collapse-item/uni-collapse-item.vue +0 -378
  184. package/ui-uni/uni-combox/uni-combox.vue +0 -237
  185. package/ui-uni/uni-countdown/uni-countdown.vue +0 -234
  186. package/ui-uni/uni-data-checkbox/uni-data-checkbox.vue +0 -792
  187. package/ui-uni/uni-data-indexed-list/uni-data-indexed-list-item.vue +0 -142
  188. package/ui-uni/uni-data-indexed-list/uni-data-indexed-list.vue +0 -364
  189. package/ui-uni/uni-data-picker/uni-data-picker.vue +0 -468
  190. package/ui-uni/uni-data-pickerview/uni-data-pickerview.vue +0 -298
  191. package/ui-uni/uni-dateformat/uni-dateformat.vue +0 -88
  192. package/ui-uni/uni-datetime-picker/calendar.vue +0 -747
  193. package/ui-uni/uni-datetime-picker/time-picker.vue +0 -899
  194. package/ui-uni/uni-datetime-picker/uni-datetime-picker.vue +0 -874
  195. package/ui-uni/uni-drawer/uni-drawer.vue +0 -178
  196. package/ui-uni/uni-easyinput/uni-easyinput.vue +0 -438
  197. package/ui-uni/uni-fab/uni-fab.vue +0 -443
  198. package/ui-uni/uni-fav/uni-fav.vue +0 -136
  199. package/ui-uni/uni-file-picker/uni-file-picker.vue +0 -614
  200. package/ui-uni/uni-forms/uni-forms.vue +0 -467
  201. package/ui-uni/uni-forms/validate.js +0 -486
  202. package/ui-uni/uni-forms-item/uni-forms-item.vue +0 -500
  203. package/ui-uni/uni-grid/uni-grid.vue +0 -141
  204. package/ui-uni/uni-grid-item/uni-grid-item.vue +0 -123
  205. package/ui-uni/uni-group/uni-group.vue +0 -123
  206. package/ui-uni/uni-icons/icons.js +0 -132
  207. package/ui-uni/uni-icons/uni-icons.vue +0 -72
  208. package/ui-uni/uni-indexed-list/uni-indexed-list-item.vue +0 -142
  209. package/ui-uni/uni-indexed-list/uni-indexed-list.vue +0 -357
  210. package/ui-uni/uni-link/uni-link.vue +0 -117
  211. package/ui-uni/uni-list/uni-list.vue +0 -107
  212. package/ui-uni/uni-list/uni-refresh.vue +0 -65
  213. package/ui-uni/uni-list-ad/uni-list-ad.vue +0 -106
  214. package/ui-uni/uni-list-item/uni-list-item.vue +0 -428
  215. package/ui-uni/uni-load-more/uni-load-more.vue +0 -366
  216. package/ui-uni/uni-nav-bar/uni-nav-bar.vue +0 -244
  217. package/ui-uni/uni-notice-bar/uni-notice-bar.vue +0 -394
  218. package/ui-uni/uni-number-box/uni-number-box.vue +0 -224
  219. package/ui-uni/uni-pagination/uni-pagination.vue +0 -376
  220. package/ui-uni/uni-popup/uni-popup.vue +0 -412
  221. package/ui-uni/uni-popup-message/uni-popup-message.vue +0 -143
  222. package/ui-uni/uni-rate/uni-rate.vue +0 -357
  223. package/ui-uni/uni-row/uni-row.vue +0 -155
  224. package/ui-uni/uni-search-bar/uni-search-bar.vue +0 -262
  225. package/ui-uni/uni-steps/uni-steps.vue +0 -250
  226. package/ui-uni/uni-swiper-dot/uni-swiper-dot.vue +0 -205
  227. package/ui-uni/uni-table/uni-table.vue +0 -455
  228. package/ui-uni/uni-tag/uni-tag.vue +0 -283
  229. package/ui-uni/uni-tbody/uni-tbody.vue +0 -30
  230. package/ui-uni/uni-td/uni-td.vue +0 -88
  231. package/ui-uni/uni-th/uni-th.vue +0 -259
  232. package/ui-uni/uni-thead/uni-thead.vue +0 -114
  233. package/ui-uni/uni-title/uni-title.vue +0 -171
  234. package/ui-uni/uni-tr/uni-tr.vue +0 -156
  235. package/ui-uni/uni-transition/uni-transition.vue +0 -287
@@ -0,0 +1,427 @@
1
+ <template>
2
+ <view
3
+ class="uni-card uni-border"
4
+ :class="{
5
+ 'uni-card--full': isFull === true || isFull === 'true',
6
+ 'uni-card--shadow': isShadow === true || isShadow === 'true'
7
+ }"
8
+ >
9
+ <!-- 基础 -->
10
+ <view v-if="mode === 'basic' && title" @click.stop="onClick" class="uni-card__head-padding">
11
+ <view class="uni-card__header uni-border-bottom">
12
+ <slot name="header">
13
+ <view v-if="thumbnail" class="uni-card__header-extra-img-view">
14
+ <image :src="thumbnail" class="uni-card__header-extra-img" />
15
+ </view>
16
+ <text class="uni-card__header-title-text">{{ title }}</text>
17
+ <text v-if="extra" class="uni-card__header-extra-text">{{ extra }}</text>
18
+ </slot>
19
+ </view>
20
+ </view>
21
+ <!-- 标题 -->
22
+ <view v-if="mode === 'title'" @click.stop="onClick" class="uni-card__head-padding">
23
+ <view class="uni-card__title uni-border-bottom">
24
+ <slot name="header">
25
+ <view class="uni-card__title-box">
26
+ <view v-if="thumbnail" class="uni-card__title-header">
27
+ <image class="uni-card__title-header-image" :src="thumbnail" mode="scaleToFill" />
28
+ </view>
29
+ <view class="uni-card__title-content">
30
+ <text class="uni-card__title-content-title uni-ellipsis">{{ title }}</text>
31
+ <text class="uni-card__title-content-extra uni-ellipsis">{{ subTitle }}</text>
32
+ </view>
33
+ </view>
34
+ <view v-if="extra">
35
+ <text class="uni-card__header-extra-text">{{ extra }}</text>
36
+ </view>
37
+ </slot>
38
+ </view>
39
+ </view>
40
+ <!-- 图文 -->
41
+ <view v-if="mode === 'style'" class="uni-card__thumbnailimage" @click.stop="onClick">
42
+ <view class="uni-card__thumbnailimage-box">
43
+ <image v-if="thumbnail" class="uni-card__thumbnailimage-image" :src="thumbnail" mode="aspectFill" />
44
+ <cv-icon2 v-if="!thumbnail" type="image" size="30" color="#999" />
45
+ </view>
46
+ <view v-if="title" class="uni-card__thumbnailimage-title">
47
+ <text class="uni-card__thumbnailimage-title-text">{{ title }}</text>
48
+ </view>
49
+ </view>
50
+ <!-- 内容 -->
51
+ <view class="uni-card__content uni-card__content--pd" @click.stop="onClick">
52
+ <view v-if="mode === 'style' && extra" class="">
53
+ <text class="uni-card__content-extra">{{ extra }}</text>
54
+ </view>
55
+ <slot />
56
+ </view>
57
+ <!-- 底部 -->
58
+ <view v-if="note" class="uni-card__footer uni-border-top">
59
+ <slot name="footer">
60
+ <text class="uni-card__footer-text">{{ note }}</text>
61
+ </slot>
62
+ </view>
63
+ </view>
64
+ </template>
65
+
66
+ <script>
67
+ /**
68
+ * Card 卡片
69
+ * @description 卡片视图组件
70
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=22
71
+ * @property {String} title 标题文字
72
+ * @property {String} subTitle 副标题(仅仅mode=title下生效)
73
+ * @property {String} extra 标题额外信息
74
+ * @property {String} note 底部信息
75
+ * @property {String} thumbnail 标题左侧缩略图
76
+ * @property {String} mode = [basic|style|title] 卡片模式
77
+ * @value basic 基础卡片
78
+ * @value style 图文卡片
79
+ * @value title 标题卡片
80
+ * @property {Boolean} isFull = [true | false] 卡片内容是否通栏,为 true 时将去除padding值
81
+ * @property {Boolean} isShadow = [true | false] 卡片内容是否开启阴影
82
+ * @event {Function} click 点击 Card 触发事件
83
+ * @example <cv-card title="标题文字" thumbnail="xxx.jpg" extra="额外信息" note="Tips">内容主体,可自定义内容及样式</cv-card>
84
+ */
85
+ export default {
86
+ name: 'cvCard',
87
+ emits: ['click'],
88
+ props: {
89
+ title: {
90
+ type: String,
91
+ default: ''
92
+ },
93
+ subTitle: {
94
+ type: String,
95
+ default: ''
96
+ },
97
+ extra: {
98
+ type: String,
99
+ default: ''
100
+ },
101
+ note: {
102
+ type: String,
103
+ default: ''
104
+ },
105
+ thumbnail: {
106
+ type: String,
107
+ default: ''
108
+ },
109
+ mode: {
110
+ type: String,
111
+ default: 'basic'
112
+ },
113
+ isFull: {
114
+ // 内容区域是否通栏
115
+ type: Boolean,
116
+ default: false
117
+ },
118
+ isShadow: {
119
+ // 是否开启阴影
120
+ type: [Boolean, String],
121
+ default: false
122
+ }
123
+ },
124
+ methods: {
125
+ onClick() {
126
+ this.$emit('click');
127
+ }
128
+ }
129
+ };
130
+ </script>
131
+
132
+ <style scoped>
133
+ .uni-card {
134
+ /* #ifndef APP-NVUE */
135
+ display: flex;
136
+ flex: 1;
137
+ box-shadow: 0 0 0 rgba(0, 0, 0, 0);
138
+ /* #endif */
139
+ margin: 12px 15px;
140
+ background-color: #ffffff;
141
+ position: relative;
142
+ flex-direction: column;
143
+ border-radius: 5px;
144
+ overflow: hidden;
145
+ /* #ifdef H5 */
146
+ cursor: pointer;
147
+ /* #endif */
148
+ }
149
+
150
+ .uni-border {
151
+ position: relative;
152
+ /* #ifdef APP-NVUE */
153
+ border-color: #e5e5e5;
154
+ border-style: solid;
155
+ border-width: 0.5px;
156
+ /* #endif */
157
+ z-index: 1;
158
+ }
159
+
160
+ /* #ifndef APP-NVUE */
161
+ .uni-border:after {
162
+ content: '';
163
+ position: absolute;
164
+ bottom: 0;
165
+ left: 0;
166
+ top: 0;
167
+ right: 0;
168
+ border: 1px solid #e5e5e5;
169
+ border-radius: 10px;
170
+ box-sizing: border-box;
171
+ width: 200%;
172
+ height: 200%;
173
+ transform: scale(0.5);
174
+ transform-origin: left top;
175
+ z-index: -1;
176
+ }
177
+
178
+ /* #endif */
179
+ .uni-border-bottom {
180
+ position: relative;
181
+ /* #ifdef APP-NVUE */
182
+ border-bottom-color: #e5e5e5;
183
+ border-bottom-style: solid;
184
+ border-bottom-width: 0.5px;
185
+ /* #endif */
186
+ z-index: 1;
187
+ }
188
+
189
+ /* #ifndef APP-NVUE */
190
+ .uni-border-bottom:after {
191
+ content: '';
192
+ position: absolute;
193
+ bottom: 0;
194
+ left: 0;
195
+ top: 0;
196
+ right: 0;
197
+ border-bottom: 1px solid #e5e5e5;
198
+ box-sizing: border-box;
199
+ width: 200%;
200
+ height: 200%;
201
+ transform: scale(0.5);
202
+ transform-origin: left top;
203
+ z-index: -1;
204
+ }
205
+
206
+ /* #endif */
207
+ .uni-border-top {
208
+ position: relative;
209
+ /* #ifdef APP-NVUE */
210
+ border-top-color: #e5e5e5;
211
+ border-top-style: solid;
212
+ border-top-width: 0.5px;
213
+ /* #endif */
214
+ z-index: 1;
215
+ }
216
+
217
+ /* #ifndef APP-NVUE */
218
+ .uni-border-top:after {
219
+ content: '';
220
+ position: absolute;
221
+ bottom: 0;
222
+ left: 0;
223
+ top: 0;
224
+ right: 0;
225
+ border-top: 1px solid #e5e5e5;
226
+ box-sizing: border-box;
227
+ width: 200%;
228
+ height: 200%;
229
+ transform: scale(0.5);
230
+ transform-origin: left top;
231
+ z-index: -1;
232
+ }
233
+
234
+ /* #endif */
235
+ .uni-card__thumbnailimage {
236
+ position: relative;
237
+ /* #ifndef APP-NVUE */
238
+ /* #endif */
239
+ flex-direction: column;
240
+ justify-content: center;
241
+ height: 150px;
242
+ background-color: #f1f1f1;
243
+ overflow: hidden;
244
+ }
245
+
246
+ .uni-card__thumbnailimage-box {
247
+ /* #ifndef APP-NVUE */
248
+ display: flex;
249
+ /* #endif */
250
+ flex: 1;
251
+ height: 150px;
252
+ flex-direction: row;
253
+ justify-content: center;
254
+ align-items: center;
255
+ overflow: hidden;
256
+ }
257
+
258
+ .uni-card__thumbnailimage-image {
259
+ flex: 1;
260
+ }
261
+
262
+ .uni-card__thumbnailimage-title {
263
+ /* #ifndef APP-NVUE */
264
+ display: flex;
265
+ /* #endif */
266
+ position: absolute;
267
+ bottom: 0;
268
+ left: 0;
269
+ right: 0;
270
+ flex-direction: row;
271
+ padding: 8px 12px;
272
+ background-color: rgba(0, 0, 0, 0.4);
273
+ }
274
+
275
+ .uni-card__thumbnailimage-title-text {
276
+ flex: 1;
277
+ font-size: 14px;
278
+ color: #fff;
279
+ }
280
+
281
+ .uni-card__title {
282
+ /* #ifndef APP-NVUE */
283
+ display: flex;
284
+ /* #endif */
285
+ flex-direction: row;
286
+ align-items: center;
287
+ padding: 10px;
288
+ }
289
+
290
+ .uni-card__title-box {
291
+ /* #ifndef APP-NVUE */
292
+ display: flex;
293
+ /* #endif */
294
+ flex: 1;
295
+ flex-direction: row;
296
+ align-items: center;
297
+ overflow: hidden;
298
+ }
299
+
300
+ .uni-card__title-header {
301
+ width: 40px;
302
+ height: 40px;
303
+ overflow: hidden;
304
+ border-radius: 5px;
305
+ padding-right: 10px;
306
+ }
307
+
308
+ .uni-card__title-header-image {
309
+ width: 40px;
310
+ height: 40px;
311
+ }
312
+
313
+ .uni-card__title-content {
314
+ /* #ifndef APP-NVUE */
315
+ display: flex;
316
+ /* #endif */
317
+ flex-direction: column;
318
+ justify-content: center;
319
+ flex: 1;
320
+ height: 40px;
321
+ overflow: hidden;
322
+ }
323
+
324
+ .uni-card__title-content-title {
325
+ font-size: 14px;
326
+ line-height: 22px;
327
+ }
328
+
329
+ .uni-card__title-content-extra {
330
+ font-size: 12px;
331
+ line-height: 27px;
332
+ color: #999;
333
+ }
334
+
335
+ .uni-card__header {
336
+ /* #ifndef APP-NVUE */
337
+ display: flex;
338
+ /* #endif */
339
+ position: relative;
340
+ flex-direction: row;
341
+ padding: 12px;
342
+ align-items: center;
343
+ }
344
+
345
+ .uni-card__header-title {
346
+ /* #ifndef APP-NVUE */
347
+ display: flex;
348
+ /* #endif */
349
+ flex-direction: row;
350
+ margin-right: 8px;
351
+ justify-content: flex-start;
352
+ align-items: center;
353
+ }
354
+
355
+ .uni-card__header-title-text {
356
+ font-size: 16px;
357
+ flex: 1;
358
+ color: #333;
359
+ }
360
+
361
+ .uni-card__header-extra-img {
362
+ height: 20px;
363
+ width: 20px;
364
+ margin-right: 8px;
365
+ }
366
+
367
+ .uni-card__header-extra-text {
368
+ flex: 1;
369
+ margin-left: 8px;
370
+ font-size: 12px;
371
+ text-align: right;
372
+ color: #999;
373
+ }
374
+
375
+ .uni-card__content {
376
+ color: #333;
377
+ }
378
+
379
+ .uni-card__content--pd {
380
+ padding: 12px;
381
+ }
382
+
383
+ .uni-card__content-extra {
384
+ font-size: 14px;
385
+ padding-bottom: 10px;
386
+ color: #999;
387
+ }
388
+
389
+ .uni-card__footer {
390
+ justify-content: space-between;
391
+ padding: 12px;
392
+ }
393
+
394
+ .uni-card__footer-text {
395
+ color: #999;
396
+ font-size: 12px;
397
+ }
398
+
399
+ .uni-card--shadow {
400
+ position: relative;
401
+ /* #ifndef APP-NVUE */
402
+ box-shadow: 0px 0px 5px 1px rgba(0, 0, 0, 0.1);
403
+ /* #endif */
404
+ }
405
+
406
+ .uni-card--full {
407
+ margin: 0;
408
+ border-radius: 0;
409
+ }
410
+
411
+ /* #ifndef APP-NVUE */
412
+ .uni-card--full:after {
413
+ border-radius: 0;
414
+ }
415
+
416
+ /* #endif */
417
+ .uni-ellipsis {
418
+ /* #ifndef APP-NVUE */
419
+ overflow: hidden;
420
+ white-space: nowrap;
421
+ text-overflow: ellipsis;
422
+ /* #endif */
423
+ /* #ifdef APP-NVUE */
424
+ lines: 1;
425
+ /* #endif */
426
+ }
427
+ </style>
@@ -96,7 +96,7 @@ export default {
96
96
  data() {
97
97
  return {};
98
98
  },
99
- created: function () {
99
+ created() {
100
100
  // console.log(this.$slots);
101
101
  },
102
102
  methods: {
@@ -0,0 +1,227 @@
1
+ <template>
2
+ <view class="cv-checkbox-group-wrap">
3
+ <checkbox-group @change="checkboxChange" class="cv-radio-group__box">
4
+ <slot>
5
+ <cv-checkbox-opt-base
6
+ v-if="type == 'base'"
7
+ v-for="item in items"
8
+ :key="item.value"
9
+ :value="item.value"
10
+ :checked="item.checked"
11
+ >
12
+ {{ item.text }}
13
+ </cv-checkbox-opt-base>
14
+ <cv-checkbox-opt-tag
15
+ v-if="type == 'tag'"
16
+ v-for="item in items"
17
+ :key="item.value"
18
+ :value="item.value"
19
+ :checked="item.checked"
20
+ >
21
+ {{ item.text }}
22
+ </cv-checkbox-opt-tag>
23
+ <!-- <label class="cv-checkbox-group__label" v-for="item in items" :value="value" :key="item.value">
24
+ <view class="">
25
+ <checkbox :value="item.value" :checked="item.checked" style="transform: scale(0.7)" />
26
+ </view>
27
+ <view>{{ item.text }}</view>
28
+ </label> -->
29
+ </slot>
30
+ </checkbox-group>
31
+ </view>
32
+ </template>
33
+ <script>
34
+ import cvCheckboxOptBase from '../cv-checkbox-opt-base/cv-checkbox-opt-base.vue';
35
+ import cvCheckboxOptTag from '../cv-checkbox-opt-tag/cv-checkbox-opt-tag.vue';
36
+ export default {
37
+ name: 'cvCheckboxGroup',
38
+ components: {
39
+ cvCheckboxOptBase,
40
+ cvCheckboxOptTag
41
+ },
42
+ inject: {},
43
+ props: {
44
+ type: {
45
+ type: String,
46
+ default: 'base'
47
+ },
48
+ //默认输入框内容
49
+ value: {
50
+ type: [Array, String, Number],
51
+ default: []
52
+ },
53
+ dataType: {
54
+ type: String,
55
+ default: 'value'
56
+ },
57
+ //选项数组
58
+ dataLists: {
59
+ type: [Array, String],
60
+ default: () => {
61
+ return [];
62
+ }
63
+ },
64
+ //选项数组的网络请求地址,用于获取dataLists但优先级高于dataLists
65
+ dataUrl: {
66
+ type: String,
67
+ default: ''
68
+ },
69
+ //数据类型value的名称
70
+ dataValue: {
71
+ type: String,
72
+ default: 'value'
73
+ },
74
+ //数据类型text的名称
75
+ dataText: {
76
+ type: String,
77
+ default: 'text'
78
+ },
79
+ dataChecked: {
80
+ type: String,
81
+ default: 'checked'
82
+ },
83
+ maxNumber: {
84
+ type: [Number, String],
85
+ default: 0
86
+ }
87
+ },
88
+ data() {
89
+ return {
90
+ localVal: [],
91
+ items: []
92
+ };
93
+ },
94
+ watch: {
95
+ value(newVal) {
96
+ this._doValueType(newVal);
97
+ }
98
+ },
99
+ created() {
100
+ this._doValueType(this.value);
101
+ if (this.maxNumber > 0) {
102
+ this.message = '最多只能选择' + this.maxNumber + '个';
103
+ }
104
+ this.items = this.itemsSortOut();
105
+ },
106
+ methods: {
107
+ // 处理传递的内容问题,全部转成数组
108
+ _doValueType(oldVal) {
109
+ let newVal = [];
110
+ if (Object.prototype.toString.call(oldVal) == '[object String]') {
111
+ if (oldVal != '') {
112
+ newVal.push(oldVal);
113
+ }
114
+ } else if (Object.prototype.toString.call(oldVal) == '[object Array]') {
115
+ if (oldVal.length > 0) {
116
+ newVal = oldVal;
117
+ }
118
+ }
119
+ this.localVal = newVal;
120
+ console.log(this.localVal);
121
+ },
122
+ itemsSortOut() {
123
+ let original = [];
124
+ if (this.dataUrl) {
125
+ //网络请求
126
+ } else {
127
+ original = this.dataLists;
128
+ }
129
+ if (typeof original == 'string') {
130
+ original = JSON.parse(original);
131
+ }
132
+
133
+ //整理数据
134
+ let items = [];
135
+ let dataValue = this.dataValue ? this.dataValue : 'value';
136
+ let dataText = this.dataText ? this.dataText : 'text';
137
+ let dataChecked = this.dataChecked ? this.dataChecked : 'checked';
138
+ let i = 0;
139
+ for (i in original) {
140
+ let data = original[i];
141
+ let checked = false;
142
+ let text = data[dataText];
143
+ let value = data[dataValue];
144
+ if (typeof value == 'number') {
145
+ value = value.toString();
146
+ }
147
+ if (data[dataChecked] == true) {
148
+ checked = true;
149
+ }
150
+ let localVal = this.localVal || [];
151
+ // let tempLocalVal = localVal.split(',');
152
+ //写入已选选项
153
+ for (const ii in localVal) {
154
+ if (this.dataType == 'text') {
155
+ if (localVal[ii] == text) {
156
+ checked = true;
157
+ }
158
+ } else {
159
+ if (localVal[ii] == value) {
160
+ checked = true;
161
+ }
162
+ }
163
+ }
164
+ items.push({
165
+ value: value,
166
+ text: text,
167
+ checked: checked
168
+ });
169
+ }
170
+ return items;
171
+ },
172
+ checkboxChange(e) {
173
+ let items = this.items;
174
+ let values = e.detail.value;
175
+ this.$emit('input', values);
176
+ console.log(values);
177
+ for (var i = 0, lenI = items.length; i < lenI; ++i) {
178
+ const item = items[i];
179
+ if (values.includes(item.value)) {
180
+ this.$set(item, 'checked', true);
181
+ } else {
182
+ this.$set(item, 'checked', false);
183
+ }
184
+ }
185
+ // console.log(items);
186
+
187
+ let localVal = [];
188
+ for (let i in items) {
189
+ if (items[i].checked) {
190
+ if (this.dataType == 'text') {
191
+ localVal.push(items[i].text);
192
+ } else {
193
+ localVal.push(items[i].value);
194
+ }
195
+ }
196
+ }
197
+ if (this.maxNumber !== 0 && localVal.length > this.maxNumber) {
198
+ this.messageDisplay = true;
199
+ } else {
200
+ this.messageDisplay = false;
201
+ }
202
+ // this.localVal = localVal;
203
+ // // this.$emit('input', this.localVal.join(','));
204
+ // this.$emit('input', this.localVal);
205
+ }
206
+ }
207
+ };
208
+ </script>
209
+
210
+ <style>
211
+ .cv-checkbox-group-wrap {
212
+ min-height: 35px;
213
+ }
214
+ .cv-checkbox-group__box {
215
+ display: flex;
216
+ flex-direction: row;
217
+ flex-wrap: wrap;
218
+ align-items: stretch;
219
+ align-content: flex-start;
220
+ }
221
+ .cv-checkbox-group__label {
222
+ height: 35px;
223
+ line-height: 35px;
224
+ display: flex;
225
+ margin-right: 10px;
226
+ }
227
+ </style>
@@ -0,0 +1,57 @@
1
+ <template>
2
+ <view class="cv-checkbox-opt-base">
3
+ <label class="cv-checkbox-opt__label">
4
+ <checkbox :value="localVal" :checked="checked" style="transform: scale(0.7)" />
5
+ <view>
6
+ <slot>{{ label }}</slot>
7
+ </view>
8
+ </label>
9
+ </view>
10
+ </template>
11
+ <script>
12
+ export default {
13
+ name: 'cvCheckboxOptBase',
14
+ props: {
15
+ label: {
16
+ type: [String, Number],
17
+ default: ''
18
+ },
19
+ value: {
20
+ type: [String, Number],
21
+ default: ''
22
+ },
23
+ checked: {
24
+ type: Boolean,
25
+ default: false
26
+ }
27
+ },
28
+ data() {
29
+ return {
30
+ localVal: ''
31
+ };
32
+ },
33
+ watch: {
34
+ value(newVal) {
35
+ this.localVal = String(newVal);
36
+ }
37
+ },
38
+ created() {
39
+ this.localVal = String(this.value);
40
+ },
41
+ methods: {}
42
+ };
43
+ </script>
44
+ <style>
45
+ .cv-checkbox-opt-base {
46
+ display: inline-flex;
47
+ min-height: 25px;
48
+ }
49
+ .cv-checkbox-opt__label {
50
+ margin: 5px 0;
51
+ height: 25px;
52
+ line-height: 25px;
53
+ float: left;
54
+ display: flex;
55
+ margin-right: 10px;
56
+ }
57
+ </style>