@kengic/uni 0.3.2-beta.8 → 0.3.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 (194) hide show
  1. package/dist/api/WMS/Controllers/LoginController/Logout.ts +28 -0
  2. package/dist/api/WMS/Controllers/LoginController/index.ts +1 -0
  3. package/dist/api/WMS/Controllers/WhController/ListVO.ts +89 -0
  4. package/dist/api/WMS/Controllers/WhController/index.ts +1 -0
  5. package/dist/api/WMS/Controllers/index.ts +2 -0
  6. package/dist/api/WMS/index.ts +2 -0
  7. package/dist/api/WMS/models.ts +189 -0
  8. package/dist/api/api.ts +1 -0
  9. package/dist/api/def.ts +1 -0
  10. package/dist/api/index.ts +2 -0
  11. package/dist/const/index.ts +11 -0
  12. package/dist/index.css +1 -0
  13. package/dist/kengic-uni.js +1 -5
  14. package/dist/service/http-client.ts +205 -0
  15. package/dist/service/index.ts +1 -0
  16. package/dist/src/index.d.ts +0 -1
  17. package/dist/store/app.store.ts +62 -0
  18. package/dist/uni/index.ts +1 -0
  19. package/dist/uni/uni-ui/index.ts +62 -0
  20. package/dist/uni/uni-ui/uni-breadcrumb/uni-breadcrumb.vue +41 -0
  21. package/dist/uni/uni-ui/uni-breadcrumb-item/uni-breadcrumb-item.vue +125 -0
  22. package/dist/uni/uni-ui/uni-calendar/uni-calendar.vue +565 -0
  23. package/dist/{uni-ui → uni/uni-ui}/uni-col/uni-col.vue +1 -1
  24. package/dist/{uni-ui → uni/uni-ui}/uni-data-checkbox/uni-data-checkbox.vue +2 -2
  25. package/dist/{uni-ui → uni/uni-ui}/uni-data-select/uni-data-select.vue +1 -1
  26. package/dist/uni/uni-ui/uni-popup/i18n/en.json +7 -0
  27. package/dist/uni/uni-ui/uni-popup/i18n/index.js +9 -0
  28. package/dist/uni/uni-ui/uni-popup/i18n/zh-Hans.json +7 -0
  29. package/dist/uni/uni-ui/uni-popup/i18n/zh-Hant.json +7 -0
  30. package/dist/uni/uni-ui/uni-popup/keypress.js +45 -0
  31. package/dist/uni/uni-ui/uni-popup/popup.js +23 -0
  32. package/dist/uni/uni-ui/uni-popup/uni-popup.vue +464 -0
  33. package/dist/{uni-ui → uni/uni-ui}/uni-row/uni-row.vue +2 -2
  34. package/dist/uni/uni-ui/uni-scss/index.scss +1 -0
  35. package/dist/uni/uni-ui/uni-scss/styles/index.scss +7 -0
  36. package/dist/{uni-ui → uni/uni-ui}/uni-scss/styles/setting/_variables.scss +1 -1
  37. package/dist/{uni-ui → uni/uni-ui}/uni-scss/variables.scss +1 -1
  38. package/dist/{uni-ui → uni/uni-ui}/uni-swipe-action-item/uni-swipe-action-item.vue +1 -1
  39. package/dist/{uni-ui → uni/uni-ui}/uni-transition/uni-transition.vue +1 -1
  40. package/package.json +67 -14
  41. package/dist/src/consts/i18n/en.d.ts +0 -45
  42. package/dist/src/consts/i18n/index.d.ts +0 -90
  43. package/dist/src/consts/i18n/zh_CN.d.ts +0 -45
  44. package/dist/src/consts/index.d.ts +0 -1
  45. package/dist/src/helpers/tsx.helper.d.ts +0 -13
  46. package/dist/src/utils/index.d.ts +0 -1
  47. package/dist/src/utils/kg.util.d.ts +0 -5
  48. package/dist/uni-ui/index.ts +0 -11
  49. package/dist/uni-ui/uni-breadcrumb/uni-breadcrumb.vue +0 -41
  50. package/dist/uni-ui/uni-breadcrumb-item/uni-breadcrumb-item.vue +0 -121
  51. package/dist/uni-ui/uni-calendar/uni-calendar.vue +0 -566
  52. package/dist/uni-ui/uni-popup/i18n/en.json +0 -7
  53. package/dist/uni-ui/uni-popup/i18n/zh-Hans.json +0 -7
  54. package/dist/uni-ui/uni-popup/i18n/zh-Hant.json +0 -7
  55. package/dist/uni-ui/uni-popup/keypress.js +0 -45
  56. package/dist/uni-ui/uni-popup/popup.js +0 -26
  57. package/dist/uni-ui/uni-popup/uni-popup.vue +0 -473
  58. package/dist/uni-ui/uni-scss/index.scss +0 -1
  59. package/dist/uni-ui/uni-scss/styles/index.scss +0 -7
  60. package/dist/uni-ui/uni-search-bar/i18n/index.js +0 -8
  61. /package/dist/{uni-ui → uni/uni-ui}/uni-badge/uni-badge.vue +0 -0
  62. /package/dist/{uni-ui → uni/uni-ui}/uni-calendar/calendar.js +0 -0
  63. /package/dist/{uni-ui → uni/uni-ui}/uni-calendar/i18n/en.json +0 -0
  64. /package/dist/{uni-ui → uni/uni-ui}/uni-calendar/i18n/index.js +0 -0
  65. /package/dist/{uni-ui → uni/uni-ui}/uni-calendar/i18n/zh-Hans.json +0 -0
  66. /package/dist/{uni-ui → uni/uni-ui}/uni-calendar/i18n/zh-Hant.json +0 -0
  67. /package/dist/{uni-ui → uni/uni-ui}/uni-calendar/uni-calendar-item.vue +0 -0
  68. /package/dist/{uni-ui → uni/uni-ui}/uni-calendar/util.js +0 -0
  69. /package/dist/{uni-ui → uni/uni-ui}/uni-card/uni-card.vue +0 -0
  70. /package/dist/{uni-ui → uni/uni-ui}/uni-collapse/uni-collapse.vue +0 -0
  71. /package/dist/{uni-ui → uni/uni-ui}/uni-collapse-item/uni-collapse-item.vue +0 -0
  72. /package/dist/{uni-ui → uni/uni-ui}/uni-combox/uni-combox.vue +0 -0
  73. /package/dist/{uni-ui → uni/uni-ui}/uni-countdown/i18n/en.json +0 -0
  74. /package/dist/{uni-ui → uni/uni-ui}/uni-countdown/i18n/index.js +0 -0
  75. /package/dist/{uni-ui → uni/uni-ui}/uni-countdown/i18n/zh-Hans.json +0 -0
  76. /package/dist/{uni-ui → uni/uni-ui}/uni-countdown/i18n/zh-Hant.json +0 -0
  77. /package/dist/{uni-ui → uni/uni-ui}/uni-countdown/uni-countdown.vue +0 -0
  78. /package/dist/{uni-ui → uni/uni-ui}/uni-data-picker/keypress.js +0 -0
  79. /package/dist/{uni-ui → uni/uni-ui}/uni-data-picker/uni-data-picker.vue +0 -0
  80. /package/dist/{uni-ui → uni/uni-ui}/uni-data-pickerview/uni-data-picker.js +0 -0
  81. /package/dist/{uni-ui → uni/uni-ui}/uni-data-pickerview/uni-data-pickerview.vue +0 -0
  82. /package/dist/{uni-ui → uni/uni-ui}/uni-dateformat/date-format.js +0 -0
  83. /package/dist/{uni-ui → uni/uni-ui}/uni-dateformat/uni-dateformat.vue +0 -0
  84. /package/dist/{uni-ui → uni/uni-ui}/uni-datetime-picker/calendar-item.vue +0 -0
  85. /package/dist/{uni-ui → uni/uni-ui}/uni-datetime-picker/calendar.vue +0 -0
  86. /package/dist/{uni-ui → uni/uni-ui}/uni-datetime-picker/i18n/en.json +0 -0
  87. /package/dist/{uni-ui → uni/uni-ui}/uni-datetime-picker/i18n/index.js +0 -0
  88. /package/dist/{uni-ui → uni/uni-ui}/uni-datetime-picker/i18n/zh-Hans.json +0 -0
  89. /package/dist/{uni-ui → uni/uni-ui}/uni-datetime-picker/i18n/zh-Hant.json +0 -0
  90. /package/dist/{uni-ui → uni/uni-ui}/uni-datetime-picker/time-picker.vue +0 -0
  91. /package/dist/{uni-ui → uni/uni-ui}/uni-datetime-picker/uni-datetime-picker.vue +0 -0
  92. /package/dist/{uni-ui → uni/uni-ui}/uni-datetime-picker/util.js +0 -0
  93. /package/dist/{uni-ui → uni/uni-ui}/uni-drawer/keypress.js +0 -0
  94. /package/dist/{uni-ui → uni/uni-ui}/uni-drawer/uni-drawer.vue +0 -0
  95. /package/dist/{uni-ui → uni/uni-ui}/uni-easyinput/common.js +0 -0
  96. /package/dist/{uni-ui → uni/uni-ui}/uni-easyinput/uni-easyinput.vue +0 -0
  97. /package/dist/{uni-ui → uni/uni-ui}/uni-fab/uni-fab.vue +0 -0
  98. /package/dist/{uni-ui → uni/uni-ui}/uni-fav/i18n/en.json +0 -0
  99. /package/dist/{uni-ui → uni/uni-ui}/uni-fav/i18n/index.js +0 -0
  100. /package/dist/{uni-ui → uni/uni-ui}/uni-fav/i18n/zh-Hans.json +0 -0
  101. /package/dist/{uni-ui → uni/uni-ui}/uni-fav/i18n/zh-Hant.json +0 -0
  102. /package/dist/{uni-ui → uni/uni-ui}/uni-fav/uni-fav.vue +0 -0
  103. /package/dist/{uni-ui → uni/uni-ui}/uni-file-picker/choose-and-upload-file.js +0 -0
  104. /package/dist/{uni-ui → uni/uni-ui}/uni-file-picker/uni-file-picker.vue +0 -0
  105. /package/dist/{uni-ui → uni/uni-ui}/uni-file-picker/upload-file.vue +0 -0
  106. /package/dist/{uni-ui → uni/uni-ui}/uni-file-picker/upload-image.vue +0 -0
  107. /package/dist/{uni-ui → uni/uni-ui}/uni-file-picker/utils.js +0 -0
  108. /package/dist/{uni-ui → uni/uni-ui}/uni-forms/uni-forms.vue +0 -0
  109. /package/dist/{uni-ui → uni/uni-ui}/uni-forms/utils.js +0 -0
  110. /package/dist/{uni-ui → uni/uni-ui}/uni-forms/validate.js +0 -0
  111. /package/dist/{uni-ui → uni/uni-ui}/uni-forms-item/uni-forms-item.vue +0 -0
  112. /package/dist/{uni-ui → uni/uni-ui}/uni-goods-nav/i18n/en.json +0 -0
  113. /package/dist/{uni-ui → uni/uni-ui}/uni-goods-nav/i18n/index.js +0 -0
  114. /package/dist/{uni-ui → uni/uni-ui}/uni-goods-nav/i18n/zh-Hans.json +0 -0
  115. /package/dist/{uni-ui → uni/uni-ui}/uni-goods-nav/i18n/zh-Hant.json +0 -0
  116. /package/dist/{uni-ui → uni/uni-ui}/uni-goods-nav/uni-goods-nav.vue +0 -0
  117. /package/dist/{uni-ui → uni/uni-ui}/uni-grid/uni-grid.vue +0 -0
  118. /package/dist/{uni-ui → uni/uni-ui}/uni-grid-item/uni-grid-item.vue +0 -0
  119. /package/dist/{uni-ui → uni/uni-ui}/uni-group/uni-group.vue +0 -0
  120. /package/dist/{uni-ui → uni/uni-ui}/uni-icons/icons.js +0 -0
  121. /package/dist/{uni-ui → uni/uni-ui}/uni-icons/uni-icons.vue +0 -0
  122. /package/dist/{uni-ui → uni/uni-ui}/uni-icons/uniicons.css +0 -0
  123. /package/dist/{uni-ui → uni/uni-ui}/uni-icons/uniicons.ttf +0 -0
  124. /package/dist/{uni-ui → uni/uni-ui}/uni-indexed-list/uni-indexed-list-item.vue +0 -0
  125. /package/dist/{uni-ui → uni/uni-ui}/uni-indexed-list/uni-indexed-list.vue +0 -0
  126. /package/dist/{uni-ui → uni/uni-ui}/uni-link/uni-link.vue +0 -0
  127. /package/dist/{uni-ui → uni/uni-ui}/uni-list/uni-list.vue +0 -0
  128. /package/dist/{uni-ui → uni/uni-ui}/uni-list/uni-refresh.vue +0 -0
  129. /package/dist/{uni-ui → uni/uni-ui}/uni-list/uni-refresh.wxs +0 -0
  130. /package/dist/{uni-ui → uni/uni-ui}/uni-list-ad/uni-list-ad.vue +0 -0
  131. /package/dist/{uni-ui → uni/uni-ui}/uni-list-chat/uni-list-chat.scss +0 -0
  132. /package/dist/{uni-ui → uni/uni-ui}/uni-list-chat/uni-list-chat.vue +0 -0
  133. /package/dist/{uni-ui → uni/uni-ui}/uni-list-item/uni-list-item.vue +0 -0
  134. /package/dist/{uni-ui → uni/uni-ui}/uni-load-more/i18n/en.json +0 -0
  135. /package/dist/{uni-ui → uni/uni-ui}/uni-load-more/i18n/index.js +0 -0
  136. /package/dist/{uni-ui → uni/uni-ui}/uni-load-more/i18n/zh-Hans.json +0 -0
  137. /package/dist/{uni-ui → uni/uni-ui}/uni-load-more/i18n/zh-Hant.json +0 -0
  138. /package/dist/{uni-ui → uni/uni-ui}/uni-load-more/uni-load-more.vue +0 -0
  139. /package/dist/{uni-ui → uni/uni-ui}/uni-nav-bar/uni-nav-bar.vue +0 -0
  140. /package/dist/{uni-ui → uni/uni-ui}/uni-nav-bar/uni-status-bar.vue +0 -0
  141. /package/dist/{uni-ui → uni/uni-ui}/uni-notice-bar/uni-notice-bar.vue +0 -0
  142. /package/dist/{uni-ui → uni/uni-ui}/uni-number-box/uni-number-box.vue +0 -0
  143. /package/dist/{uni-ui → uni/uni-ui}/uni-pagination/i18n/en.json +0 -0
  144. /package/dist/{uni-ui → uni/uni-ui}/uni-pagination/i18n/es.json +0 -0
  145. /package/dist/{uni-ui → uni/uni-ui}/uni-pagination/i18n/fr.json +0 -0
  146. /package/dist/{uni-ui → uni/uni-ui}/uni-pagination/i18n/index.js +0 -0
  147. /package/dist/{uni-ui → uni/uni-ui}/uni-pagination/i18n/zh-Hans.json +0 -0
  148. /package/dist/{uni-ui → uni/uni-ui}/uni-pagination/i18n/zh-Hant.json +0 -0
  149. /package/dist/{uni-ui → uni/uni-ui}/uni-pagination/uni-pagination.vue +0 -0
  150. /package/dist/{uni-ui → uni/uni-ui}/uni-popup-dialog/keypress.js +0 -0
  151. /package/dist/{uni-ui → uni/uni-ui}/uni-popup-dialog/uni-popup-dialog.vue +0 -0
  152. /package/dist/{uni-ui → uni/uni-ui}/uni-popup-message/uni-popup-message.vue +0 -0
  153. /package/dist/{uni-ui → uni/uni-ui}/uni-popup-share/uni-popup-share.vue +0 -0
  154. /package/dist/{uni-ui → uni/uni-ui}/uni-rate/uni-rate.vue +0 -0
  155. /package/dist/{uni-ui → uni/uni-ui}/uni-scss/changelog.md +0 -0
  156. /package/dist/{uni-ui → uni/uni-ui}/uni-scss/package.json +0 -0
  157. /package/dist/{uni-ui → uni/uni-ui}/uni-scss/readme.md +0 -0
  158. /package/dist/{uni-ui → uni/uni-ui}/uni-scss/styles/setting/_border.scss +0 -0
  159. /package/dist/{uni-ui → uni/uni-ui}/uni-scss/styles/setting/_color.scss +0 -0
  160. /package/dist/{uni-ui → uni/uni-ui}/uni-scss/styles/setting/_radius.scss +0 -0
  161. /package/dist/{uni-ui → uni/uni-ui}/uni-scss/styles/setting/_space.scss +0 -0
  162. /package/dist/{uni-ui → uni/uni-ui}/uni-scss/styles/setting/_styles.scss +0 -0
  163. /package/dist/{uni-ui → uni/uni-ui}/uni-scss/styles/setting/_text.scss +0 -0
  164. /package/dist/{uni-ui → uni/uni-ui}/uni-scss/styles/tools/functions.scss +0 -0
  165. /package/dist/{uni-ui → uni/uni-ui}/uni-scss/theme.scss +0 -0
  166. /package/dist/{uni-ui → uni/uni-ui}/uni-search-bar/i18n/en.json +0 -0
  167. /package/dist/{uni-ui/uni-popup → uni/uni-ui/uni-search-bar}/i18n/index.js +0 -0
  168. /package/dist/{uni-ui → uni/uni-ui}/uni-search-bar/i18n/zh-Hans.json +0 -0
  169. /package/dist/{uni-ui → uni/uni-ui}/uni-search-bar/i18n/zh-Hant.json +0 -0
  170. /package/dist/{uni-ui → uni/uni-ui}/uni-search-bar/uni-search-bar.vue +0 -0
  171. /package/dist/{uni-ui → uni/uni-ui}/uni-section/uni-section.vue +0 -0
  172. /package/dist/{uni-ui → uni/uni-ui}/uni-segmented-control/uni-segmented-control.vue +0 -0
  173. /package/dist/{uni-ui → uni/uni-ui}/uni-steps/uni-steps.vue +0 -0
  174. /package/dist/{uni-ui → uni/uni-ui}/uni-swipe-action/uni-swipe-action.vue +0 -0
  175. /package/dist/{uni-ui → uni/uni-ui}/uni-swipe-action-item/bindingx.js +0 -0
  176. /package/dist/{uni-ui → uni/uni-ui}/uni-swipe-action-item/isPC.js +0 -0
  177. /package/dist/{uni-ui → uni/uni-ui}/uni-swipe-action-item/mpalipay.js +0 -0
  178. /package/dist/{uni-ui → uni/uni-ui}/uni-swipe-action-item/mpother.js +0 -0
  179. /package/dist/{uni-ui → uni/uni-ui}/uni-swipe-action-item/mpwxs.js +0 -0
  180. /package/dist/{uni-ui → uni/uni-ui}/uni-swipe-action-item/render.js +0 -0
  181. /package/dist/{uni-ui → uni/uni-ui}/uni-swipe-action-item/wx.wxs +0 -0
  182. /package/dist/{uni-ui → uni/uni-ui}/uni-swiper-dot/uni-swiper-dot.vue +0 -0
  183. /package/dist/{uni-ui → uni/uni-ui}/uni-table/uni-table.vue +0 -0
  184. /package/dist/{uni-ui → uni/uni-ui}/uni-tag/uni-tag.vue +0 -0
  185. /package/dist/{uni-ui → uni/uni-ui}/uni-tbody/uni-tbody.vue +0 -0
  186. /package/dist/{uni-ui → uni/uni-ui}/uni-td/uni-td.vue +0 -0
  187. /package/dist/{uni-ui → uni/uni-ui}/uni-th/filter-dropdown.vue +0 -0
  188. /package/dist/{uni-ui → uni/uni-ui}/uni-th/uni-th.vue +0 -0
  189. /package/dist/{uni-ui → uni/uni-ui}/uni-thead/uni-thead.vue +0 -0
  190. /package/dist/{uni-ui → uni/uni-ui}/uni-title/uni-title.vue +0 -0
  191. /package/dist/{uni-ui → uni/uni-ui}/uni-tooltip/uni-tooltip.vue +0 -0
  192. /package/dist/{uni-ui → uni/uni-ui}/uni-tr/table-checkbox.vue +0 -0
  193. /package/dist/{uni-ui → uni/uni-ui}/uni-tr/uni-tr.vue +0 -0
  194. /package/dist/{uni-ui → uni/uni-ui}/uni-transition/createAnimation.js +0 -0
@@ -0,0 +1,565 @@
1
+ <template>
2
+ <view class="uni-calendar">
3
+ <view v-if="!insert && show" class="uni-calendar__mask" :class="{ 'uni-calendar--mask-show': aniMaskShow }" @click="clean"></view>
4
+ <view v-if="insert || show" class="uni-calendar__content" :class="{ 'uni-calendar--fixed': !insert, 'uni-calendar--ani-show': aniMaskShow }">
5
+ <view v-if="!insert" class="uni-calendar__header uni-calendar--fixed-top">
6
+ <view class="uni-calendar__header-btn-box" @click="close">
7
+ <text class="uni-calendar__header-text uni-calendar--fixed-width">{{ cancelText }}</text>
8
+ </view>
9
+ <view class="uni-calendar__header-btn-box" @click="confirm">
10
+ <text class="uni-calendar__header-text uni-calendar--fixed-width">{{ okText }}</text>
11
+ </view>
12
+ </view>
13
+ <view class="uni-calendar__header">
14
+ <view class="uni-calendar__header-btn-box" @click.stop="pre">
15
+ <view class="uni-calendar__header-btn uni-calendar--left"></view>
16
+ </view>
17
+ <picker mode="date" :value="date" fields="month" @change="bindDateChange">
18
+ <text class="uni-calendar__header-text">{{ (nowDate.year || '') + ' / ' + (nowDate.month || '') }} </text>
19
+ </picker>
20
+ <view class="uni-calendar__header-btn-box" @click.stop="next">
21
+ <view class="uni-calendar__header-btn uni-calendar--right"></view>
22
+ </view>
23
+ <text class="uni-calendar__backtoday" @click="backToday">{{ todayText }}</text>
24
+ </view>
25
+ <view class="uni-calendar__box">
26
+ <view v-if="showMonth" class="uni-calendar__box-bg">
27
+ <text class="uni-calendar__box-bg-text">{{ nowDate.month }}</text>
28
+ </view>
29
+ <view class="uni-calendar__weeks">
30
+ <view class="uni-calendar__weeks-day">
31
+ <text class="uni-calendar__weeks-day-text">{{ SUNText }}</text>
32
+ </view>
33
+ <view class="uni-calendar__weeks-day">
34
+ <text class="uni-calendar__weeks-day-text">{{ monText }}</text>
35
+ </view>
36
+ <view class="uni-calendar__weeks-day">
37
+ <text class="uni-calendar__weeks-day-text">{{ TUEText }}</text>
38
+ </view>
39
+ <view class="uni-calendar__weeks-day">
40
+ <text class="uni-calendar__weeks-day-text">{{ WEDText }}</text>
41
+ </view>
42
+ <view class="uni-calendar__weeks-day">
43
+ <text class="uni-calendar__weeks-day-text">{{ THUText }}</text>
44
+ </view>
45
+ <view class="uni-calendar__weeks-day">
46
+ <text class="uni-calendar__weeks-day-text">{{ FRIText }}</text>
47
+ </view>
48
+ <view class="uni-calendar__weeks-day">
49
+ <text class="uni-calendar__weeks-day-text">{{ SATText }}</text>
50
+ </view>
51
+ </view>
52
+ <view class="uni-calendar__weeks" v-for="(item, weekIndex) in weeks" :key="weekIndex">
53
+ <view class="uni-calendar__weeks-item" v-for="(weeks, weeksIndex) in item" :key="weeksIndex">
54
+ <calendar-item
55
+ class="uni-calendar-item--hook"
56
+ :weeks="weeks"
57
+ :calendar="calendar"
58
+ :selected="selected"
59
+ :lunar="lunar"
60
+ @change="choiceDate"
61
+ ></calendar-item>
62
+ </view>
63
+ </view>
64
+ </view>
65
+ </view>
66
+ </view>
67
+ </template>
68
+
69
+ <script>
70
+ import Calendar from './util.js';
71
+ import CalendarItem from './uni-calendar-item.vue';
72
+
73
+ import { initVueI18n } from '@dcloudio/uni-i18n';
74
+ import i18nMessages from './i18n';
75
+
76
+ const { t } = initVueI18n(i18nMessages);
77
+
78
+ /**
79
+ * Calendar 日历
80
+ * @description 日历组件可以查看日期,选择任意范围内的日期,打点操作。常用场景如:酒店日期预订、火车机票选择购买日期、上下班打卡等
81
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=56
82
+ * @property {String} date 自定义当前时间,默认为今天
83
+ * @property {Boolean} lunar 显示农历
84
+ * @property {String} startDate 日期选择范围-开始日期
85
+ * @property {String} endDate 日期选择范围-结束日期
86
+ * @property {Boolean} range 范围选择
87
+ * @property {Boolean} insert = [true|false] 插入模式,默认为false
88
+ * @value true 弹窗模式
89
+ * @value false 插入模式
90
+ * @property {Boolean} clearDate = [true|false] 弹窗模式是否清空上次选择内容
91
+ * @property {Array} selected 打点,期待格式[{date: '2019-06-27', info: '签到', data: { custom: '自定义信息', name: '自定义消息头',xxx:xxx... }}]
92
+ * @property {Boolean} showMonth 是否选择月份为背景
93
+ * @event {Function} change 日期改变,`insert :ture` 时生效
94
+ * @event {Function} confirm 确认选择`insert :false` 时生效
95
+ * @event {Function} monthSwitch 切换月份时触发
96
+ * @example <uni-calendar :insert="true":lunar="true" :start-date="'2019-3-2'":end-date="'2019-5-20'"@change="change" />
97
+ */
98
+ export default {
99
+ name: 'UniCalendar',
100
+ components: {
101
+ CalendarItem,
102
+ },
103
+ emits: ['close', 'confirm', 'change', 'monthSwitch'],
104
+ props: {
105
+ date: {
106
+ type: String,
107
+ default: '',
108
+ },
109
+ selected: {
110
+ type: Array,
111
+ default() {
112
+ return [];
113
+ },
114
+ },
115
+ lunar: {
116
+ type: Boolean,
117
+ default: false,
118
+ },
119
+ startDate: {
120
+ type: String,
121
+ default: '',
122
+ },
123
+ endDate: {
124
+ type: String,
125
+ default: '',
126
+ },
127
+ range: {
128
+ type: Boolean,
129
+ default: false,
130
+ },
131
+ insert: {
132
+ type: Boolean,
133
+ default: true,
134
+ },
135
+ showMonth: {
136
+ type: Boolean,
137
+ default: true,
138
+ },
139
+ clearDate: {
140
+ type: Boolean,
141
+ default: true,
142
+ },
143
+ },
144
+ data() {
145
+ return {
146
+ show: false,
147
+ weeks: [],
148
+ calendar: {},
149
+ nowDate: '',
150
+ aniMaskShow: false,
151
+ };
152
+ },
153
+ computed: {
154
+ /**
155
+ * for i18n
156
+ */
157
+
158
+ okText() {
159
+ return t('uni-calender.ok');
160
+ },
161
+ cancelText() {
162
+ return t('uni-calender.cancel');
163
+ },
164
+ todayText() {
165
+ return t('uni-calender.today');
166
+ },
167
+ monText() {
168
+ return t('uni-calender.MON');
169
+ },
170
+ TUEText() {
171
+ return t('uni-calender.TUE');
172
+ },
173
+ WEDText() {
174
+ return t('uni-calender.WED');
175
+ },
176
+ THUText() {
177
+ return t('uni-calender.THU');
178
+ },
179
+ FRIText() {
180
+ return t('uni-calender.FRI');
181
+ },
182
+ SATText() {
183
+ return t('uni-calender.SAT');
184
+ },
185
+ SUNText() {
186
+ return t('uni-calender.SUN');
187
+ },
188
+ },
189
+ watch: {
190
+ date(newVal) {
191
+ // this.cale.setDate(newVal)
192
+ this.init(newVal);
193
+ },
194
+ startDate(val) {
195
+ this.cale.resetSatrtDate(val);
196
+ this.cale.setDate(this.nowDate.fullDate);
197
+ this.weeks = this.cale.weeks;
198
+ },
199
+ endDate(val) {
200
+ this.cale.resetEndDate(val);
201
+ this.cale.setDate(this.nowDate.fullDate);
202
+ this.weeks = this.cale.weeks;
203
+ },
204
+ selected(newVal) {
205
+ this.cale.setSelectInfo(this.nowDate.fullDate, newVal);
206
+ this.weeks = this.cale.weeks;
207
+ },
208
+ },
209
+ created() {
210
+ this.cale = new Calendar({
211
+ selected: this.selected,
212
+ startDate: this.startDate,
213
+ endDate: this.endDate,
214
+ range: this.range,
215
+ });
216
+ this.init(this.date);
217
+ },
218
+ methods: {
219
+ // 取消穿透
220
+ clean() {},
221
+ bindDateChange(e) {
222
+ const value = e.detail.value + '-1';
223
+ this.setDate(value);
224
+
225
+ const { year, month } = this.cale.getDate(value);
226
+ this.$emit('monthSwitch', {
227
+ year,
228
+ month,
229
+ });
230
+ },
231
+ /**
232
+ * 初始化日期显示
233
+ * @param {Object} date
234
+ */
235
+ init(date) {
236
+ this.cale.setDate(date);
237
+ this.weeks = this.cale.weeks;
238
+ this.nowDate = this.calendar = this.cale.getInfo(date);
239
+ },
240
+ /**
241
+ * 打开日历弹窗
242
+ */
243
+ open() {
244
+ // 弹窗模式并且清理数据
245
+ if (this.clearDate && !this.insert) {
246
+ this.cale.cleanMultipleStatus();
247
+ // this.cale.setDate(this.date)
248
+ this.init(this.date);
249
+ }
250
+ this.show = true;
251
+ this.$nextTick(() => {
252
+ setTimeout(() => {
253
+ this.aniMaskShow = true;
254
+ }, 50);
255
+ });
256
+ },
257
+ /**
258
+ * 关闭日历弹窗
259
+ */
260
+ close() {
261
+ this.aniMaskShow = false;
262
+ this.$nextTick(() => {
263
+ setTimeout(() => {
264
+ this.show = false;
265
+ this.$emit('close');
266
+ }, 300);
267
+ });
268
+ },
269
+ /**
270
+ * 确认按钮
271
+ */
272
+ confirm() {
273
+ this.setEmit('confirm');
274
+ this.close();
275
+ },
276
+ /**
277
+ * 变化触发
278
+ */
279
+ change() {
280
+ if (!this.insert) return;
281
+ this.setEmit('change');
282
+ },
283
+ /**
284
+ * 选择月份触发
285
+ */
286
+ monthSwitch() {
287
+ let { year, month } = this.nowDate;
288
+ this.$emit('monthSwitch', {
289
+ year,
290
+ month: Number(month),
291
+ });
292
+ },
293
+ /**
294
+ * 派发事件
295
+ * @param {Object} name
296
+ */
297
+ setEmit(name) {
298
+ let { year, month, date, fullDate, lunar, extraInfo } = this.calendar;
299
+ this.$emit(name, {
300
+ range: this.cale.multipleStatus,
301
+ year,
302
+ month,
303
+ date,
304
+ fulldate: fullDate,
305
+ lunar,
306
+ extraInfo: extraInfo || {},
307
+ });
308
+ },
309
+ /**
310
+ * 选择天触发
311
+ * @param {Object} weeks
312
+ */
313
+ choiceDate(weeks) {
314
+ if (weeks.disable) return;
315
+ this.calendar = weeks;
316
+ // 设置多选
317
+ this.cale.setMultiple(this.calendar.fullDate);
318
+ this.weeks = this.cale.weeks;
319
+ this.change();
320
+ },
321
+ /**
322
+ * 回到今天
323
+ */
324
+ backToday() {
325
+ const nowYearMonth = `${this.nowDate.year}-${this.nowDate.month}`;
326
+ const date = this.cale.getDate(new Date());
327
+ const todayYearMonth = `${date.year}-${date.month}`;
328
+
329
+ if (nowYearMonth !== todayYearMonth) {
330
+ this.monthSwitch();
331
+ }
332
+
333
+ this.init(date.fullDate);
334
+ this.change();
335
+ },
336
+ /**
337
+ * 上个月
338
+ */
339
+ pre() {
340
+ const preDate = this.cale.getDate(this.nowDate.fullDate, -1, 'month').fullDate;
341
+ this.setDate(preDate);
342
+ this.monthSwitch();
343
+ },
344
+ /**
345
+ * 下个月
346
+ */
347
+ next() {
348
+ const nextDate = this.cale.getDate(this.nowDate.fullDate, +1, 'month').fullDate;
349
+ this.setDate(nextDate);
350
+ this.monthSwitch();
351
+ },
352
+ /**
353
+ * 设置日期
354
+ * @param {Object} date
355
+ */
356
+ setDate(date) {
357
+ this.cale.setDate(date);
358
+ this.weeks = this.cale.weeks;
359
+ this.nowDate = this.cale.getInfo(date);
360
+ },
361
+ },
362
+ };
363
+ </script>
364
+
365
+ <style lang="scss" scoped>
366
+ $uni-bg-color-mask: rgba(
367
+ $color: #000000,
368
+ $alpha: 0.4,
369
+ );
370
+ $uni-border-color: #ededed;
371
+ $uni-text-color: #333;
372
+ $uni-bg-color-hover: #f1f1f1;
373
+ $uni-font-size-base: 14px;
374
+ $uni-text-color-placeholder: #808080;
375
+ $uni-color-subtitle: #555555;
376
+ $uni-text-color-grey: #999;
377
+ .uni-calendar {
378
+ /* #ifndef APP-NVUE */
379
+ display: flex;
380
+ /* #endif */
381
+ flex-direction: column;
382
+ }
383
+
384
+ .uni-calendar__mask {
385
+ position: fixed;
386
+ bottom: 0;
387
+ top: 0;
388
+ left: 0;
389
+ right: 0;
390
+ background-color: $uni-bg-color-mask;
391
+ transition-property: opacity;
392
+ transition-duration: 0.3s;
393
+ opacity: 0;
394
+ /* #ifndef APP-NVUE */
395
+ z-index: 99;
396
+ /* #endif */
397
+ }
398
+
399
+ .uni-calendar--mask-show {
400
+ opacity: 1;
401
+ }
402
+
403
+ .uni-calendar--fixed {
404
+ position: fixed;
405
+ /* #ifdef APP-NVUE */
406
+ bottom: 0;
407
+ /* #endif */
408
+ left: 0;
409
+ right: 0;
410
+ transition-property: transform;
411
+ transition-duration: 0.3s;
412
+ transform: translateY(460px);
413
+ /* #ifndef APP-NVUE */
414
+ bottom: calc(var(--window-bottom));
415
+ z-index: 99;
416
+ /* #endif */
417
+ }
418
+
419
+ .uni-calendar--ani-show {
420
+ transform: translateY(0);
421
+ }
422
+
423
+ .uni-calendar__content {
424
+ background-color: #fff;
425
+ }
426
+
427
+ .uni-calendar__header {
428
+ position: relative;
429
+ /* #ifndef APP-NVUE */
430
+ display: flex;
431
+ /* #endif */
432
+ flex-direction: row;
433
+ justify-content: center;
434
+ align-items: center;
435
+ height: 50px;
436
+ border-bottom-color: $uni-border-color;
437
+ border-bottom-style: solid;
438
+ border-bottom-width: 1px;
439
+ }
440
+
441
+ .uni-calendar--fixed-top {
442
+ /* #ifndef APP-NVUE */
443
+ display: flex;
444
+ /* #endif */
445
+ flex-direction: row;
446
+ justify-content: space-between;
447
+ border-top-color: $uni-border-color;
448
+ border-top-style: solid;
449
+ border-top-width: 1px;
450
+ }
451
+
452
+ .uni-calendar--fixed-width {
453
+ width: 50px;
454
+ }
455
+
456
+ .uni-calendar__backtoday {
457
+ position: absolute;
458
+ right: 0;
459
+ top: 25 rpx;
460
+ padding: 0 5px;
461
+ padding-left: 10px;
462
+ height: 25px;
463
+ line-height: 25px;
464
+ font-size: 12px;
465
+ border-top-left-radius: 25px;
466
+ border-bottom-left-radius: 25px;
467
+ color: $uni-text-color;
468
+ background-color: $uni-bg-color-hover;
469
+ }
470
+
471
+ .uni-calendar__header-text {
472
+ text-align: center;
473
+ width: 100px;
474
+ font-size: $uni-font-size-base;
475
+ color: $uni-text-color;
476
+ }
477
+
478
+ .uni-calendar__header-btn-box {
479
+ /* #ifndef APP-NVUE */
480
+ display: flex;
481
+ /* #endif */
482
+ flex-direction: row;
483
+ align-items: center;
484
+ justify-content: center;
485
+ width: 50px;
486
+ height: 50px;
487
+ }
488
+
489
+ .uni-calendar__header-btn {
490
+ width: 10px;
491
+ height: 10px;
492
+ border-left-color: $uni-text-color-placeholder;
493
+ border-left-style: solid;
494
+ border-left-width: 2px;
495
+ border-top-color: $uni-color-subtitle;
496
+ border-top-style: solid;
497
+ border-top-width: 2px;
498
+ }
499
+
500
+ .uni-calendar--left {
501
+ transform: rotate(-45deg);
502
+ }
503
+
504
+ .uni-calendar--right {
505
+ transform: rotate(135deg);
506
+ }
507
+
508
+ .uni-calendar__weeks {
509
+ position: relative;
510
+ /* #ifndef APP-NVUE */
511
+ display: flex;
512
+ /* #endif */
513
+ flex-direction: row;
514
+ }
515
+
516
+ .uni-calendar__weeks-item {
517
+ flex: 1;
518
+ }
519
+
520
+ .uni-calendar__weeks-day {
521
+ flex: 1;
522
+ /* #ifndef APP-NVUE */
523
+ display: flex;
524
+ /* #endif */
525
+ flex-direction: column;
526
+ justify-content: center;
527
+ align-items: center;
528
+ height: 45px;
529
+ border-bottom-color: #f5f5f5;
530
+ border-bottom-style: solid;
531
+ border-bottom-width: 1px;
532
+ }
533
+
534
+ .uni-calendar__weeks-day-text {
535
+ font-size: 14px;
536
+ }
537
+
538
+ .uni-calendar__box {
539
+ position: relative;
540
+ }
541
+
542
+ .uni-calendar__box-bg {
543
+ /* #ifndef APP-NVUE */
544
+ display: flex;
545
+ /* #endif */
546
+ justify-content: center;
547
+ align-items: center;
548
+ position: absolute;
549
+ top: 0;
550
+ left: 0;
551
+ right: 0;
552
+ bottom: 0;
553
+ }
554
+
555
+ .uni-calendar__box-bg-text {
556
+ font-size: 200px;
557
+ font-weight: bold;
558
+ color: $uni-text-color-grey;
559
+ opacity: 0.1;
560
+ text-align: center;
561
+ /* #ifndef APP-NVUE */
562
+ line-height: 1;
563
+ /* #endif */
564
+ }
565
+ </style>
@@ -93,7 +93,7 @@
93
93
  // 字节小程序中,在computed中读取$parent为undefined
94
94
  let parent = this.$parent;
95
95
 
96
- while (parent && parent.$options.componentName !== 'uniRow') {
96
+ while (parent && parent.$options.componentName !== 'UniRow') {
97
97
  parent = parent.$parent;
98
98
  }
99
99
 
@@ -66,7 +66,7 @@
66
66
  */
67
67
 
68
68
  export default {
69
- name: 'uniDataChecklist',
69
+ name: 'UniDataCheckbox',
70
70
  mixins: [uniCloud.mixinDatacom || {}],
71
71
  emits:['input','update:modelValue','change'],
72
72
  props: {
@@ -405,7 +405,7 @@
405
405
  let selectedColor = this.selectedColor?this.selectedColor:'#2979ff'
406
406
  styles['background-color'] = item.selected?selectedColor:'#fff'
407
407
  styles['border-color'] = item.selected?selectedColor:'#DCDFE6'
408
-
408
+
409
409
  if(!item.selected && item.disabled){
410
410
  styles['background-color'] = '#F2F6FC'
411
411
  styles['border-color'] = item.selected?selectedColor:'#DCDFE6'
@@ -47,7 +47,7 @@
47
47
  */
48
48
 
49
49
  export default {
50
- name: "uni-data-select",
50
+ name: "UniDataSelect",
51
51
  mixins: [uniCloud.mixinDatacom || {}],
52
52
  props: {
53
53
  localdata: {
@@ -0,0 +1,7 @@
1
+ {
2
+ "uni-popup.cancel": "cancel",
3
+ "uni-popup.ok": "ok",
4
+ "uni-popup.placeholder": "pleace enter",
5
+ "uni-popup.title": "Hint",
6
+ "uni-popup.shareTitle": "Share to"
7
+ }
@@ -0,0 +1,9 @@
1
+ import en from './en.json';
2
+ import zhHans from './zh-Hans.json';
3
+ import zhHant from './zh-Hant.json';
4
+
5
+ export default {
6
+ en,
7
+ 'zh-Hans': zhHans,
8
+ 'zh-Hant': zhHant,
9
+ };
@@ -0,0 +1,7 @@
1
+ {
2
+ "uni-popup.cancel": "取消",
3
+ "uni-popup.ok": "确定",
4
+ "uni-popup.placeholder": "请输入",
5
+ "uni-popup.title": "提示",
6
+ "uni-popup.shareTitle": "分享到"
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "uni-popup.cancel": "取消",
3
+ "uni-popup.ok": "確定",
4
+ "uni-popup.placeholder": "請輸入",
5
+ "uni-popup.title": "提示",
6
+ "uni-popup.shareTitle": "分享到"
7
+ }
@@ -0,0 +1,45 @@
1
+ // #ifdef H5
2
+ export default {
3
+ name: 'Keypress',
4
+ props: {
5
+ disable: {
6
+ type: Boolean,
7
+ default: false,
8
+ },
9
+ },
10
+ mounted() {
11
+ const keyNames = {
12
+ esc: ['Esc', 'Escape'],
13
+ tab: 'Tab',
14
+ enter: 'Enter',
15
+ space: [' ', 'Spacebar'],
16
+ up: ['Up', 'ArrowUp'],
17
+ left: ['Left', 'ArrowLeft'],
18
+ right: ['Right', 'ArrowRight'],
19
+ down: ['Down', 'ArrowDown'],
20
+ delete: ['Backspace', 'Delete', 'Del'],
21
+ };
22
+ const listener = ($event) => {
23
+ if (this.disable) {
24
+ return;
25
+ }
26
+ const keyName = Object.keys(keyNames).find((key) => {
27
+ const keyName = $event.key;
28
+ const value = keyNames[key];
29
+ return value === keyName || (Array.isArray(value) && value.includes(keyName));
30
+ });
31
+ if (keyName) {
32
+ // 避免和其他按键事件冲突
33
+ setTimeout(() => {
34
+ this.$emit(keyName, {});
35
+ }, 0);
36
+ }
37
+ };
38
+ document.addEventListener('keyup', listener);
39
+ // this.$once('hook:beforeDestroy', () => {
40
+ // document.removeEventListener('keyup', listener)
41
+ // })
42
+ },
43
+ render: () => {},
44
+ };
45
+ // #endif