@10yun/cv-mobile-ui 0.5.51 → 0.5.52

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 (110) hide show
  1. package/build/common_func.js +3 -1
  2. package/build/parse-create.js +17 -8
  3. package/build/parse-pages-pkg.js +10 -4
  4. package/empty-devtools.js +3 -0
  5. package/libs/aes.js +50 -0
  6. package/libs/bledefine/bledefine.js +51 -0
  7. package/libs/bledefine/ios-ble-statuscode.js +97 -0
  8. package/libs/nfc/hexiii-nfc.js +236 -0
  9. package/libs/nfc.js +179 -0
  10. package/libs/sdk/html2canvas.js +8 -0
  11. package/libs/sdk/sdk-h5.js +585 -0
  12. package/{plugins → libs}/storage2.js +0 -5
  13. package/{plugins → libs}/storage3.js +0 -4
  14. package/libs/validators/index.js +438 -0
  15. package/libs/weapp-qrcode.js +1108 -0
  16. package/package.json +2 -3
  17. package/ui-cv/components/cv-dialog-share/tui-share.vue +16 -16
  18. package/ui-fireui/components/{fui-actionsheet/fui-actionsheet.vue → u-action-sheet/u-action-sheet.vue} +21 -21
  19. package/ui-fireui/components/{fui-alert/fui-alert.vue → u-alert/u-alert.vue} +13 -13
  20. package/ui-fireui/components/{fui-badge/fui-badge.vue → u-badge/u-badge.vue} +16 -16
  21. package/ui-fireui/components/{fui-bottom-navigation/fui-bottom-navigation.vue → u-bottom-navigation/u-bottom-navigation.vue} +47 -46
  22. package/ui-fireui/components/{fui-bottom-popup/fui-bottom-popup.vue → u-bottom-popup/u-bottom-popup.vue} +9 -8
  23. package/ui-fireui/components/{fui-bubble-popup/fui-bubble-popup.vue → u-bubble-popup/u-bubble-popup.vue} +19 -15
  24. package/ui-fireui/components/{fui-button/fui-button.vue → u-button/u-button.vue} +69 -69
  25. package/ui-fireui/components/u-button/u-button2.vue +553 -0
  26. package/ui-fireui/components/{fui-calendar/fui-calendar.vue → u-calendar/u-calendar.vue} +78 -78
  27. package/ui-fireui/components/u-calendar/u-calendar2.vue +801 -0
  28. package/ui-fireui/components/{fui-card/fui-card.vue → u-card/u-card.vue} +24 -24
  29. package/ui-fireui/components/{fui-cascade-selection/fui-cascade-selection.vue → u-cascade-selection/u-cascade-selection.vue} +32 -32
  30. package/ui-fireui/components/{fui-circular-progress/fui-circular-progress.vue → u-circular-progress/u-circular-progress.vue} +14 -6
  31. package/ui-fireui/components/{fui-collapse/fui-collapse.vue → u-collapse/u-collapse.vue} +19 -19
  32. package/ui-fireui/components/{fui-countdown/fui-countdown.vue → u-countdown/u-countdown.vue} +28 -28
  33. package/ui-fireui/components/{fui-datetime/fui-datetime.vue → u-datetime/u-datetime.vue} +51 -51
  34. package/ui-fireui/components/{fui-divider/fui-divider.vue → u-divider/u-divider.vue} +6 -6
  35. package/ui-fireui/components/{fui-drawer/fui-drawer.vue → u-drawer/u-drawer.vue} +11 -11
  36. package/ui-fireui/components/{fui-dropdown-list/fui-dropdown-list.vue → u-dropdown-list/u-dropdown-list.vue} +11 -6
  37. package/ui-fireui/components/{fui-fab/fui-fab.vue → u-fab/u-fab.vue} +30 -30
  38. package/ui-fireui/components/{fui-footer/fui-footer.vue → u-footer/u-footer.vue} +19 -15
  39. package/ui-fireui/components/{fui-grid/fui-grid.vue → u-grid/u-grid.vue} +13 -5
  40. package/ui-fireui/components/{fui-grid-item/fui-grid-item.vue → u-grid-item/u-grid-item.vue} +19 -19
  41. package/ui-fireui/components/{fui-icon/fui-icon.vue → u-icon/u-icon.vue} +191 -191
  42. package/ui-fireui/components/{fui-image-cropper/fui-image-cropper.vue → u-image-cropper/u-image-cropper.vue} +44 -44
  43. package/ui-fireui/components/{fui-image-group/fui-image-group.vue → u-image-group/u-image-group.vue} +7 -7
  44. package/ui-fireui/components/{fui-keyboard/fui-keyboard.vue → u-keyboard/u-keyboard.vue} +29 -32
  45. package/ui-fireui/components/{fui-keyboard-input/fui-keyboard-input.vue → u-keyboard-input/u-keyboard-input.vue} +9 -9
  46. package/ui-fireui/components/{fui-list-cell/fui-list-cell.vue → u-list-cell/u-list-cell.vue} +23 -23
  47. package/ui-fireui/components/{fui-list-view/fui-list-view.vue → u-list-view/u-list-view.vue} +11 -11
  48. package/ui-fireui/components/{fui-loading/fui-loading.vue → u-loading/u-loading.vue} +6 -6
  49. package/ui-fireui/components/{fui-loadmore/fui-loadmore.vue → u-loadmore/u-loadmore.vue} +15 -15
  50. package/ui-fireui/components/{fui-modal/fui-modal.vue → u-modal/u-modal.vue} +58 -58
  51. package/ui-fireui/components/{fui-navigation-bar/fui-navigation-bar.vue → u-navigation-bar/u-navigation-bar.vue} +11 -10
  52. package/ui-fireui/components/{fui-no-data/fui-no-data.vue → u-no-data/u-no-data.vue} +11 -11
  53. package/ui-fireui/components/{fui-nomore/fui-nomore.vue → u-nomore/u-nomore.vue} +10 -10
  54. package/ui-fireui/components/{fui-numberbox/fui-numberbox.vue → u-numberbox/u-numberbox.vue} +12 -12
  55. package/ui-fireui/components/{fui-numberbox-border/fui-numberbox-border.vue → u-numberbox-border/u-numberbox-border.vue} +10 -10
  56. package/ui-fireui/components/{fui-picture-cropper/fui-picture-cropper.vue → u-picture-cropper/u-picture-cropper.vue} +42 -42
  57. package/ui-fireui/components/u-picture-cropper/u-picture-cropper.wxs +582 -0
  58. package/ui-fireui/components/{fui-round-progress/fui-round-progress.vue → u-round-progress/u-round-progress.vue} +2 -2
  59. package/ui-fireui/components/{fui-scroll-top/fui-scroll-top.vue → u-scroll-top/u-scroll-top.vue} +21 -21
  60. package/ui-fireui/components/{fui-sharemodel/fui-sharemodel.vue → u-share-model/u-share-model.vue} +24 -24
  61. package/ui-fireui/components/{fui-skeleton/fui-skeleton.vue → u-skeleton/u-skeleton.vue} +22 -22
  62. package/ui-fireui/components/{fui-steps/fui-steps.vue → u-steps/u-steps.vue} +27 -27
  63. package/ui-fireui/components/{fui-sticky/fui-sticky.vue → u-sticky/u-sticky.vue} +4 -4
  64. package/ui-fireui/components/{fui-sticky-wxs/fui-sticky-wxs.vue → u-sticky-wxs/u-sticky-wxs.vue} +7 -7
  65. package/ui-fireui/components/u-sticky-wxs/u-sticky.wxs +46 -0
  66. package/ui-fireui/components/{fui-swipe-action/fui-swipe-action.vue → u-swipe-action/u-swipe-action.vue} +11 -11
  67. package/ui-fireui/components/{fui-tabbar/fui-tabbar.vue → u-tabbar/u-tabbar.vue} +26 -30
  68. package/ui-fireui/components/{fui-tabs/fui-tabs.vue → u-tabs/u-tabs.vue} +17 -17
  69. package/ui-fireui/components/{fui-tabs2/fui-tabs2.vue → u-tabs2/u-tabs2.vue} +17 -17
  70. package/ui-fireui/components/{fui-tag/fui-tag.vue → u-tag/u-tag.vue} +362 -374
  71. package/ui-fireui/components/{fui-time-axis/fui-time-axis.vue → u-time-axis/u-time-axis.vue} +3 -3
  72. package/ui-fireui/components/{fui-timeaxis-item/fui-timeaxis-item.vue → u-timeaxis-item/u-timeaxis-item.vue} +4 -4
  73. package/ui-fireui/components/{fui-tips/fui-tips.vue → u-tips/u-tips.vue} +20 -20
  74. package/ui-fireui/components/{fui-toast/fui-toast.vue → u-toast/u-toast.vue} +13 -13
  75. package/ui-fireui/components/{fui-top-dropdown/fui-top-dropdown.vue → u-top-dropdown/u-top-dropdown.vue} +8 -8
  76. package/ui-fireui/components/{fui-upload/fui-upload.vue → u-upload/u-upload.vue} +30 -30
  77. package/ui-fireui/components/u-upload2/u-upload.vue +464 -0
  78. package/ui-fireui/components/{fui-uploadsamll/fui-uploadsamll.vue → u-uploadsamll/u-uploadsamll.vue} +34 -34
  79. package/ui-fireui/css/thorui.css +589 -0
  80. package/ui-fireui/{fireui.css → index.css} +306 -268
  81. package/ui-fireui/nvue/u-circular-progress/gcanvas/bridge/bridge-weex.js +241 -0
  82. package/ui-fireui/nvue/u-circular-progress/gcanvas/context-2d/FillStyleLinearGradient.js +18 -0
  83. package/ui-fireui/nvue/u-circular-progress/gcanvas/context-2d/FillStylePattern.js +8 -0
  84. package/ui-fireui/nvue/u-circular-progress/gcanvas/context-2d/FillStyleRadialGradient.js +17 -0
  85. package/ui-fireui/nvue/u-circular-progress/gcanvas/context-2d/RenderingContext.js +666 -0
  86. package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/ActiveInfo.js +11 -0
  87. package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/Buffer.js +21 -0
  88. package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/Framebuffer.js +21 -0
  89. package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/GLenum.js +298 -0
  90. package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/GLmethod.js +142 -0
  91. package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/GLtype.js +23 -0
  92. package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/Program.js +21 -0
  93. package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/Renderbuffer.js +21 -0
  94. package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/RenderingContext.js +1191 -0
  95. package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/Shader.js +22 -0
  96. package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/ShaderPrecisionFormat.js +11 -0
  97. package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/Texture.js +22 -0
  98. package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/UniformLocation.js +22 -0
  99. package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/classUtils.js +3 -0
  100. package/ui-fireui/nvue/u-circular-progress/gcanvas/env/canvas.js +74 -0
  101. package/ui-fireui/nvue/u-circular-progress/gcanvas/env/image.js +96 -0
  102. package/ui-fireui/nvue/u-circular-progress/gcanvas/env/tool.js +24 -0
  103. package/ui-fireui/nvue/u-circular-progress/gcanvas/index.js +47 -0
  104. package/ui-fireui/nvue/u-circular-progress/u-circular-progress.nvue +203 -0
  105. package/ui-fireui/nvue/u-icon/icons.js +188 -0
  106. package/ui-fireui/nvue/u-icon/u-icon.vue +78 -0
  107. package/ui-fireui/components/fui-picture-cropper/fui-picture-cropper.wxs +0 -560
  108. package/ui-fireui/components/fui-rate/fui-rate.vue +0 -167
  109. package/ui-fireui/components/fui-sticky-wxs/fui-sticky.wxs +0 -44
  110. /package/ui-fireui/components/{fui-calendar/fui-calendar.js → u-calendar/u-calendar.js} +0 -0
@@ -0,0 +1,801 @@
1
+ <template>
2
+ <view>
3
+ <view :class="{ 'up-bottom-popup': isFixed, 'up-popup-show': isShow && isFixed }">
4
+ <view class="up-calendar-header" :class="{ 'up-calendar-radius': radius }" @touchmove.stop.prevent="stop" v-if="isFixed">
5
+ <view>日期选择</view>
6
+ <view class="up-iconfont up-font-close" hover-class="up-opacity" :hover-stay-time="150" @tap="hide"></view>
7
+ </view>
8
+
9
+ <view class="up-date-box">
10
+ <view
11
+ class="up-iconfont up-font-arrowleft"
12
+ :style="{ color: yearArrowColor }"
13
+ hover-class="up-opacity"
14
+ :hover-stay-time="150"
15
+ v-if="arrowType == 1"
16
+ @tap="changeYear(0)"
17
+ ></view>
18
+ <view
19
+ class="up-iconfont up-font-arrowleft"
20
+ :style="{ color: monthArrowColor }"
21
+ hover-class="up-opacity"
22
+ :hover-stay-time="150"
23
+ @tap="changeMonth(0)"
24
+ ></view>
25
+ <view class="up-date_time">{{ showTitle }}</view>
26
+ <view
27
+ class="up-iconfont up-font-arrowright"
28
+ :style="{ color: monthArrowColor }"
29
+ hover-class="up-opacity"
30
+ :hover-stay-time="150"
31
+ @tap="changeMonth(1)"
32
+ ></view>
33
+ <view
34
+ class="up-iconfont up-font-arrowright"
35
+ :style="{ color: yearArrowColor }"
36
+ hover-class="up-opacity"
37
+ :hover-stay-time="150"
38
+ v-if="arrowType == 1"
39
+ @tap="changeYear(1)"
40
+ ></view>
41
+ </view>
42
+ <view class="up-date-header">
43
+ <view class="up-date">日</view>
44
+ <view class="up-date">一</view>
45
+ <view class="up-date">二</view>
46
+ <view class="up-date">三</view>
47
+ <view class="up-date">四</view>
48
+ <view class="up-date">五</view>
49
+ <view class="up-date">六</view>
50
+ </view>
51
+ <view
52
+ class="up-date-content"
53
+ :class="{ 'up-flex-start': isFixed && fixedHeight }"
54
+ :style="{ height: isFixed && fixedHeight ? dateHeight * 6 + 'px' : 'auto' }"
55
+ >
56
+ <block v-for="(item, index) in weekdayArr" :key="index">
57
+ <view class="up-date"></view>
58
+ </block>
59
+ <view
60
+ class="up-date"
61
+ :class="{
62
+ 'up-date-pd_0': isFixed && fixedHeight,
63
+ 'up-opacity': openDisAbled(year, month, index + 1),
64
+ 'up-start-date': (type == 2 && startDate == `${year}-${month}-${index + 1}`) || type == 1,
65
+ 'up-end-date': (type == 2 && endDate == `${year}-${month}-${index + 1}`) || type == 1
66
+ }"
67
+ :style="{
68
+ backgroundColor: isFixed ? getColor(index, 1) : 'transparent',
69
+ height: isFixed && fixedHeight ? dateHeight + 'px' : 'auto'
70
+ }"
71
+ v-for="(item, index) in daysArr"
72
+ :key="index"
73
+ @tap="dateClick(index)"
74
+ >
75
+ <view
76
+ class="up-date-text"
77
+ :style="{ color: isFixed ? getColor(index, 2) : getStatusData(3, index), backgroundColor: getStatusData(2, index) }"
78
+ >
79
+ <view v-if="isFixed || !getStatusData(4, index)">{{ index + 1 }}</view>
80
+ <view class="up-custom-desc">
81
+ {{ getStatusData(1, index) }}
82
+ </view>
83
+ <text class="up-iconfont up-font-check" v-if="getStatusData(4, index)"></text>
84
+ </view>
85
+ <view
86
+ class="up-date-desc"
87
+ :style="{ color: activeColor }"
88
+ v-if="type == 2 && startDate == `${year}-${month}-${index + 1}` && startDate != endDate"
89
+ >
90
+ {{ startText }}
91
+ </view>
92
+ <view
93
+ class="up-date-desc"
94
+ :style="{ color: activeColor }"
95
+ v-if="type == 2 && endDate == `${year}-${month}-${index + 1}`"
96
+ >
97
+ {{ endText }}
98
+ </view>
99
+ </view>
100
+ <view class="up-bg-month">{{ month }}</view>
101
+ </view>
102
+
103
+ <view class="up-calendar-op" v-if="isFixed" @touchmove.stop.prevent="stop">
104
+ <view class="up-calendar-result">
105
+ <text>{{ type == 1 ? activeDate : startDate }}</text>
106
+ <text v-if="endDate">至{{ endDate }}</text>
107
+ </view>
108
+ <view class="up-calendar-btn_box">
109
+ <up-button :type="btnType" height="72rpx" shape="circle" :size="28" @click="btnFix(false)">确定</up-button>
110
+ </view>
111
+ </view>
112
+ </view>
113
+
114
+ <view
115
+ class="up-popup-mask"
116
+ :class="[isShow ? 'up-mask-show' : '']"
117
+ @touchmove.stop.prevent="stop"
118
+ v-if="isFixed"
119
+ @tap="hide"
120
+ ></view>
121
+ </view>
122
+ </template>
123
+ <script>
124
+ //easycom组件模式 无需手动引入
125
+ // import tuiButton from "../up-button/up-button"
126
+ export default {
127
+ name: 'fuiCalendar',
128
+ // components:{
129
+ // tuiButton
130
+ // },
131
+ props: {
132
+ //1-切换月份和年份 2-切换月份
133
+ arrowType: {
134
+ type: [Number, String],
135
+ default: 1
136
+ },
137
+ //1-单个日期选择 2-开始日期+结束日期选择
138
+ type: {
139
+ type: Number,
140
+ default: 1
141
+ },
142
+ //可切换最大年份
143
+ maxYear: {
144
+ type: Number,
145
+ default: 2030
146
+ },
147
+ //可切换最小年份
148
+ minYear: {
149
+ type: Number,
150
+ default: 1920
151
+ },
152
+ //最小可选日期(不在范围内日期禁用不可选)
153
+ minDate: {
154
+ type: String,
155
+ default: '1920-01-01'
156
+ },
157
+ /**
158
+ * 最大可选日期
159
+ * 默认最大值为今天,之后的日期不可选
160
+ * 2030-12-31
161
+ * */
162
+ maxDate: {
163
+ type: String,
164
+ default: ''
165
+ },
166
+ //显示圆角
167
+ radius: {
168
+ type: Boolean,
169
+ default: true
170
+ },
171
+ //状态 数据顺序与当月天数一致,index=>day
172
+ /**
173
+ * [{
174
+ * text:"", 描述:2字以内
175
+ * value:"",状态值
176
+ * bgColor:"",背景色
177
+ * color:"" 文字颜色,
178
+ * check:false //是否显示对勾
179
+ *
180
+ }]
181
+ *
182
+ * **/
183
+ status: {
184
+ type: Array,
185
+ default() {
186
+ return [];
187
+ }
188
+ },
189
+ //月份切换箭头颜色
190
+ monthArrowColor: {
191
+ type: String,
192
+ default: '#999'
193
+ },
194
+ //年份切换箭头颜色
195
+ yearArrowColor: {
196
+ type: String,
197
+ default: '#bcbcbc'
198
+ },
199
+ //默认日期字体颜色
200
+ color: {
201
+ type: String,
202
+ default: '#333'
203
+ },
204
+ //选中|起始结束日期背景色
205
+ activeBgColor: {
206
+ type: String,
207
+ default: '#5677fc'
208
+ },
209
+ //选中|起始结束日期字体颜色
210
+ activeColor: {
211
+ type: String,
212
+ default: '#fff'
213
+ },
214
+ //范围内日期背景色
215
+ rangeBgColor: {
216
+ type: String,
217
+ default: 'rgba(86,119,252,0.1)'
218
+ },
219
+ //范围内日期字体颜色
220
+ rangeColor: {
221
+ type: String,
222
+ default: '#5677fc'
223
+ },
224
+ //type=2时生效,起始日期自定义文案
225
+ startText: {
226
+ type: String,
227
+ default: '开始'
228
+ },
229
+ //type=2时生效,结束日期自定义文案
230
+ endText: {
231
+ type: String,
232
+ default: '结束'
233
+ },
234
+ //按钮样式类型
235
+ btnType: {
236
+ type: String,
237
+ default: 'primary'
238
+ },
239
+ isFixed: {
240
+ type: Boolean,
241
+ default: false
242
+ },
243
+ //当前选中日期带选中效果
244
+ isActiveCurrent: {
245
+ type: Boolean,
246
+ default: true
247
+ },
248
+ //切换年月是否触发事件 type=1时生效
249
+ isChange: {
250
+ type: Boolean,
251
+ default: false
252
+ }
253
+ },
254
+ data() {
255
+ return {
256
+ isShow: false,
257
+ weekday: 1, // 星期几,值为1-7
258
+ weekdayArr: [],
259
+ days: 0, //当前月有多少天
260
+ daysArr: [],
261
+ showTitle: '',
262
+ year: 2020,
263
+ month: 0,
264
+ day: 0,
265
+ startYear: 0,
266
+ startMonth: 0,
267
+ startDay: 0,
268
+ endYear: 0,
269
+ endMonth: 0,
270
+ endDay: 0,
271
+ today: '',
272
+ activeDate: '',
273
+ startDate: '',
274
+ endDate: '',
275
+ isStart: true,
276
+ min: null,
277
+ max: null
278
+ };
279
+ },
280
+ computed: {
281
+ dataChange() {
282
+ return `${this.type}-${this.minDate}-${this.maxDate}`;
283
+ }
284
+ },
285
+ watch: {
286
+ dataChange(val) {
287
+ this.init();
288
+ }
289
+ },
290
+ created() {
291
+ this.init();
292
+ },
293
+ methods: {
294
+ getColor(index, type) {
295
+ let color = type == 1 ? '' : this.color;
296
+ let day = index + 1;
297
+ let date = `${this.year}-${this.month}-${day}`;
298
+ let timestamp = new Date(date.replace(/\-/g, '/')).getTime();
299
+ let start = this.startDate.replace(/\-/g, '/');
300
+ let end = this.endDate.replace(/\-/g, '/');
301
+ if ((this.isActiveCurrent && this.activeDate == date) || this.startDate == date || this.endDate == date) {
302
+ color = type == 1 ? this.activeBgColor : this.activeColor;
303
+ } else if (this.endDate && timestamp > new Date(start).getTime() && timestamp < new Date(end).getTime()) {
304
+ color = type == 1 ? this.rangeBgColor : this.rangeColor;
305
+ }
306
+ return color;
307
+ },
308
+ //获取状态数据
309
+ getStatusData(type, index) {
310
+ //1-描述text,2-bgColor背景色,3-color文字颜色 4-check 是否显示对勾
311
+ let val = ['', 'transparent', '#333', ''][type - 1];
312
+ if (!this.isFixed && this.status && this.status.length > 0) {
313
+ let item = this.status[index];
314
+ if (item) {
315
+ switch (type) {
316
+ case 1:
317
+ val = item.text;
318
+ break;
319
+ case 2:
320
+ val = item.bgColor;
321
+ break;
322
+ case 3:
323
+ val = item.color;
324
+ break;
325
+ case 4:
326
+ val = item.check;
327
+ break;
328
+ default:
329
+ break;
330
+ }
331
+ }
332
+ }
333
+ return val;
334
+ },
335
+ init() {
336
+ let now = new Date();
337
+ this.year = now.getFullYear();
338
+ this.month = now.getMonth() + 1;
339
+ this.day = now.getDate();
340
+ this.today = `${now.getFullYear()}-${now.getMonth() + 1}-${now.getDate()}`;
341
+ this.activeDate = this.today;
342
+ this.min = this.initDate(this.minDate);
343
+ this.max = this.initDate(this.maxDate || this.today);
344
+ this.startDate = '';
345
+ this.startYear = 0;
346
+ this.startMonth = 0;
347
+ this.startDay = 0;
348
+ this.endYear = 0;
349
+ this.endMonth = 0;
350
+ this.endDay = 0;
351
+ this.endDate = '';
352
+ this.isStart = true;
353
+ this.changeData();
354
+ },
355
+ //日期处理
356
+ initDate(date) {
357
+ let fdate = date.split('-');
358
+ return {
359
+ year: Number(fdate[0] || 1920),
360
+ month: Number(fdate[1] || 1),
361
+ day: Number(fdate[2] || 1)
362
+ };
363
+ },
364
+ openDisAbled(year, month, day) {
365
+ let bool = true;
366
+ let date = `${year}/${month}/${day}`;
367
+ // let today = this.today.replace(/\-/g, '/');
368
+ let min = `${this.min.year}/${this.min.month}/${this.min.day}`;
369
+ let max = `${this.max.year}/${this.max.month}/${this.max.day}`;
370
+ let timestamp = new Date(date).getTime();
371
+ if (timestamp >= new Date(min).getTime() && timestamp <= new Date(max).getTime()) {
372
+ bool = false;
373
+ }
374
+ return bool;
375
+ },
376
+ generateArray(start, end) {
377
+ return Array.from(new Array(end + 1).keys()).slice(start);
378
+ },
379
+ formatNum(num) {
380
+ return num < 10 ? '0' + num : num + '';
381
+ },
382
+ stop() {
383
+ return !this.isFixed;
384
+ },
385
+ //一个月有多少天
386
+ getMonthDay(year, month) {
387
+ let days = new Date(year, month, 0).getDate();
388
+ return days;
389
+ },
390
+ getWeekday(year, month) {
391
+ let date = new Date(`${year}/${month}/01 00:00:00`);
392
+ return date.getDay();
393
+ },
394
+ checkRange(year) {
395
+ let overstep = false;
396
+ if (year < this.minYear || year > this.maxYear) {
397
+ uni.showToast({
398
+ title: '日期超出范围啦~',
399
+ icon: 'none'
400
+ });
401
+ overstep = true;
402
+ }
403
+ return overstep;
404
+ },
405
+ changeMonth(isAdd) {
406
+ if (isAdd) {
407
+ let month = this.month + 1;
408
+ let year = month > 12 ? this.year + 1 : this.year;
409
+ if (!this.checkRange(year)) {
410
+ this.month = month > 12 ? 1 : month;
411
+ this.year = year;
412
+ this.changeData();
413
+ }
414
+ } else {
415
+ let month = this.month - 1;
416
+ let year = month < 1 ? this.year - 1 : this.year;
417
+ if (!this.checkRange(year)) {
418
+ this.month = month < 1 ? 12 : month;
419
+ this.year = year;
420
+ this.changeData();
421
+ }
422
+ }
423
+ },
424
+ changeYear(isAdd) {
425
+ let year = isAdd ? this.year + 1 : this.year - 1;
426
+ if (!this.checkRange(year)) {
427
+ this.year = year;
428
+ this.changeData();
429
+ }
430
+ },
431
+ changeData() {
432
+ this.days = this.getMonthDay(this.year, this.month);
433
+ this.daysArr = this.generateArray(1, this.days);
434
+ this.weekday = this.getWeekday(this.year, this.month);
435
+ this.weekdayArr = this.generateArray(1, this.weekday);
436
+ this.showTitle = `${this.year}年${this.month}月`;
437
+ if (this.isChange && this.type == 1) {
438
+ this.btnFix(true);
439
+ }
440
+ },
441
+ dateClick(day) {
442
+ day += 1;
443
+ if (!this.openDisAbled(this.year, this.month, day)) {
444
+ this.day = day;
445
+ let date = `${this.year}-${this.month}-${day}`;
446
+ if (this.type == 1) {
447
+ this.activeDate = date;
448
+ } else {
449
+ let compare = new Date(date.replace(/\-/g, '/')).getTime() < new Date(this.startDate.replace(/\-/g, '/')).getTime();
450
+ if (this.isStart || compare) {
451
+ this.startDate = date;
452
+ this.startYear = this.year;
453
+ this.startMonth = this.month;
454
+ this.startDay = this.day;
455
+ this.endYear = 0;
456
+ this.endMonth = 0;
457
+ this.endDay = 0;
458
+ this.endDate = '';
459
+ this.activeDate = '';
460
+ this.isStart = false;
461
+ } else {
462
+ this.endDate = date;
463
+ this.endYear = this.year;
464
+ this.endMonth = this.month;
465
+ this.endDay = this.day;
466
+ this.isStart = true;
467
+ }
468
+ }
469
+ if (!this.isFixed) {
470
+ this.btnFix();
471
+ }
472
+ }
473
+ },
474
+ show() {
475
+ this.isShow = true;
476
+ },
477
+ hide() {
478
+ this.isShow = false;
479
+ },
480
+ getWeekText(date) {
481
+ date = new Date(`${date.replace(/\-/g, '/')} 00:00:00`);
482
+ let week = date.getDay();
483
+ return '星期' + ['日', '一', '二', '三', '四', '五', '六'][week];
484
+ },
485
+ btnFix(show) {
486
+ if (!show) {
487
+ this.hide();
488
+ }
489
+ if (this.type == 1) {
490
+ let arr = this.activeDate.split('-');
491
+ let year = this.isChange ? this.year : Number(arr[0]);
492
+ let month = this.isChange ? this.month : Number(arr[1]);
493
+ let day = this.isChange ? this.day : Number(arr[2]);
494
+ //当前月有多少天
495
+ let days = this.getMonthDay(year, month);
496
+ let result = `${year}-${this.formatNum(month)}-${this.formatNum(day)}`;
497
+ let weekText = this.getWeekText(result);
498
+ let isToday = false;
499
+ if (`${year}-${month}-${day}` == this.today) {
500
+ //今天
501
+ isToday = true;
502
+ }
503
+ this.$emit('change', {
504
+ year: year,
505
+ month: month,
506
+ day: day,
507
+ days: days,
508
+ result: result,
509
+ week: weekText,
510
+ isToday: isToday,
511
+ switch: show //是否是切换年月操作
512
+ });
513
+ } else {
514
+ if (!this.startDate || !this.endDate) return;
515
+ let startMonth = this.formatNum(this.startMonth);
516
+ let startDay = this.formatNum(this.startDay);
517
+ let startDate = `${this.startYear}-${startMonth}-${startDay}`;
518
+ let startWeek = this.getWeekText(startDate);
519
+
520
+ let endMonth = this.formatNum(this.endMonth);
521
+ let endDay = this.formatNum(this.endDay);
522
+ let endDate = `${this.endYear}-${endMonth}-${endDay}`;
523
+ let endWeek = this.getWeekText(endDate);
524
+ this.$emit('change', {
525
+ startYear: this.startYear,
526
+ startMonth: this.startMonth,
527
+ startDay: this.startDay,
528
+ startDate: startDate,
529
+ startWeek: startWeek,
530
+ endYear: this.endYear,
531
+ endMonth: this.endMonth,
532
+ endDay: this.endDay,
533
+ endDate: endDate,
534
+ endWeek: endWeek
535
+ });
536
+ }
537
+ }
538
+ }
539
+ };
540
+ </script>
541
+
542
+ <style scoped>
543
+ @font-face {
544
+ font-family: 'tuiDateFont';
545
+ src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAVgAA0AAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAFRAAAABoAAAAci0/w50dERUYAAAUkAAAAHgAAAB4AKQANT1MvMgAAAaAAAABDAAAAVjxuSNNjbWFwAAAB+AAAAEoAAAFS5iPQt2dhc3AAAAUcAAAACAAAAAj//wADZ2x5ZgAAAlQAAAFHAAABvPf29TBoZWFkAAABMAAAADAAAAA2GMsN3WhoZWEAAAFgAAAAHQAAACQHjAOFaG10eAAAAeQAAAATAAAAFgzQAPJsb2NhAAACRAAAABAAAAAQAOoBSG1heHAAAAGAAAAAHgAAACABEwA3bmFtZQAAA5wAAAFJAAACiCnmEVVwb3N0AAAE6AAAADQAAABLUwjqHHjaY2BkYGAAYp5Gj5/x/DZfGbhZGEDg1tUn7+F00P/LzOuY9YFcDgYmkCgAa0gNlHjaY2BkYGBu+N/AEMPCAALM6xgYGVABCwBT4AMaAAAAeNpjYGRgYGBn0GZgYgABEMkFhAwM/8F8BgANaAFLAAB42mNgZGFgnMDAysDA1Ml0hoGBoR9CM75mMGLkAIoysDIzYAUBaa4pDA7PGJ49ZG7438AQw9zA0AAUZgTJAQDrcAy8AHjaY2GAABYIDgLCBQx1AAcEAc8AeNpjYGBgZoBgGQZGBhDwAfIYwXwWBgMgzQGETAwMzxifcTx7+P8/kMUAYUkxS/6VVIXqAgNGNgY4lxGoB6QPBTAyDHsAADDkDYkAAAAAAAAAAAAAADQAagC2AN542m2QsU7DMBCG/Tt1bNPUiUnkSgiVtqKpxJAgVLVbeAa6MaK+B4JXgJWBjY21UtW5gpkdMTFX7dzApaJLhXU6n8+n//ttxtn458N79XJWZ8eMxS00C4wy9A1EP8PQncAlIQzS4WgsVtPpSmwzV3OFRqLetH5TSQMK939X61ptPZ2p2EAttNMLBRMrtschQblDeS34aY50cIkCzg/B2Y5C+VpyQxhFkRgu515O8jvU5mmPM2O0wJ5Z27vhX+yMsV437WvCdTM+GI40MgwKfuGammC0uURqeqFMfe9cxaJclkt5GMaB1hIR1VobOgpEiKq+sLZcIrJWhO3/Jw7qWlYj1Jf21FaCtmd5bevrlk28O/7A4spXTl4KTh9MTlqQ8PESBRstReic+sRj0Dni9fIqmNS/pXNWCvWOeYBmx5S9Bsn9Ah+5WtAAeNp9kD1OAzEQhZ/zByQSQiCoXVEA2vyUKRMp9Ailo0g23pBo1155nUg5AS0VB6DlGByAGyDRcgpelkmTImvt6PObmeexAZzjGwr/3yXuhBWO8ShcwREy4Sr1F+Ea+V24jhY+hRvUf4SbuFUD4RYu1BsdVO2Eu5vSbcsKZxgIV3CKJ+Eq9ZVwjfwqXMcVPoQb1L+EmxjjV7iFa2WpDOFhMEFgnEFjig3jAjEcLJIyBtahOfRmEsxMTzd6ETubOBso71dilwMeaDnngCntPbdmvkon/mDLgdSYbh4FS7YpjS4idCgbXyyc1d2oc7D9nu22tNi/a4E1x+xRDWzU/D3bM9JIbAyvkJI18jK3pBJTj2hrrPG7ZynW814IiU68y/SIx5o0dTr3bmniwOLn8owcfbS5kj33qBw+Y1kIeb/dTsQgil2GP5PYcRkAAAB42mNgYoAALjDJyIAO2MGiTIxMjMyMLIys7GmJeRmlmWZQ2pQ5OSORLaU0Mz2/FACDfwlbAAAAAf//AAIAAQAAAAwAAAAWAAAAAgABAAMABgABAAQAAAACAAAAAHjaY2BgYGQAgqtL1DlA9K2rT97DaABNlwiuAAA=)
546
+ format('woff');
547
+ font-weight: normal;
548
+ font-style: normal;
549
+ }
550
+
551
+ .up-iconfont {
552
+ font-family: 'tuiDateFont' !important;
553
+ font-size: 36rpx;
554
+ font-style: normal;
555
+ -webkit-font-smoothing: antialiased;
556
+ -moz-osx-font-smoothing: grayscale;
557
+ }
558
+
559
+ .up-font-close:before {
560
+ content: '\e608';
561
+ }
562
+
563
+ .up-font-check:before {
564
+ content: '\e6e1';
565
+ }
566
+
567
+ .up-font-arrowright:before {
568
+ content: '\e600';
569
+ }
570
+
571
+ .up-font-arrowleft:before {
572
+ content: '\e601';
573
+ }
574
+
575
+ .up-date-box {
576
+ width: 100%;
577
+ display: flex;
578
+ align-items: center;
579
+ justify-content: center;
580
+ padding: 20rpx 0 30rpx;
581
+ background-color: #fff;
582
+ }
583
+
584
+ .up-calendar-radius {
585
+ border-top-left-radius: 20rpx;
586
+ border-top-right-radius: 20rpx;
587
+ overflow: hidden;
588
+ }
589
+
590
+ .up-date_time {
591
+ padding: 0 16rpx;
592
+ color: #333;
593
+ font-size: 32rpx;
594
+ line-height: 32rpx;
595
+ font-weight: bold;
596
+ }
597
+
598
+ .up-font-arrowleft {
599
+ margin-right: 32rpx;
600
+ }
601
+
602
+ .up-font-arrowright {
603
+ margin-left: 32rpx;
604
+ }
605
+
606
+ .up-date-header {
607
+ width: 100%;
608
+ display: flex;
609
+ align-items: center;
610
+ background-color: #fff;
611
+ font-size: 24rpx;
612
+ line-height: 24rpx;
613
+ color: #555;
614
+ box-shadow: 0 15rpx 20rpx -15rpx #efefef;
615
+ position: relative;
616
+ z-index: 2;
617
+ }
618
+
619
+ .up-date-content {
620
+ width: 100%;
621
+ display: flex;
622
+ flex-wrap: wrap;
623
+ padding: 12rpx 0;
624
+ box-sizing: border-box;
625
+ background-color: #fff;
626
+ position: relative;
627
+ }
628
+
629
+ .up-bg-month {
630
+ position: absolute;
631
+ font-size: 260rpx;
632
+ line-height: 260rpx;
633
+ left: 50%;
634
+ top: 50%;
635
+ transform: translate(-50%, -50%);
636
+ color: #f5f5f7;
637
+ z-index: 1;
638
+ }
639
+
640
+ .up-date {
641
+ width: 14.2857%;
642
+ display: flex;
643
+ align-items: center;
644
+ justify-content: center;
645
+ padding: 12rpx 0;
646
+ overflow: hidden;
647
+ position: relative;
648
+ z-index: 2;
649
+ }
650
+
651
+ .up-start-date {
652
+ border-top-left-radius: 8rpx;
653
+ border-bottom-left-radius: 8rpx;
654
+ }
655
+
656
+ .up-end-date {
657
+ border-top-right-radius: 8rpx;
658
+ border-bottom-right-radius: 8rpx;
659
+ }
660
+
661
+ .up-date-text {
662
+ width: 80rpx;
663
+ height: 80rpx;
664
+ display: flex;
665
+ align-items: center;
666
+ justify-content: center;
667
+ flex-direction: column;
668
+ font-size: 32rpx;
669
+ position: relative;
670
+ border-radius: 50%;
671
+ }
672
+
673
+ .up-btn-calendar {
674
+ padding: 16rpx;
675
+ box-sizing: border-box;
676
+ text-align: center;
677
+ text-decoration: none;
678
+ }
679
+
680
+ .up-opacity {
681
+ opacity: 0.5;
682
+ }
683
+
684
+ .up-bottom-popup {
685
+ width: 100%;
686
+ position: fixed;
687
+ left: 0;
688
+ right: 0;
689
+ bottom: 0;
690
+ z-index: 9999;
691
+ visibility: hidden;
692
+ transform: translate3d(0, 100%, 0);
693
+ transform-origin: center;
694
+ transition: all 0.3s ease-in-out;
695
+ min-height: 20rpx;
696
+ }
697
+
698
+ .up-popup-show {
699
+ transform: translate3d(0, 0, 0);
700
+ visibility: visible;
701
+ }
702
+
703
+ .up-popup-mask {
704
+ position: fixed;
705
+ top: 0;
706
+ left: 0;
707
+ right: 0;
708
+ bottom: 0;
709
+ background: rgba(0, 0, 0, 0.6);
710
+ z-index: 9996;
711
+ transition: all 0.3s ease-in-out;
712
+ opacity: 0;
713
+ visibility: hidden;
714
+ }
715
+
716
+ .up-mask-show {
717
+ opacity: 1;
718
+ visibility: visible;
719
+ }
720
+
721
+ .up-calendar-header {
722
+ width: 100%;
723
+ height: 80rpx;
724
+ padding: 0 40rpx;
725
+ display: flex;
726
+ justify-content: center;
727
+ align-items: center;
728
+ box-sizing: border-box;
729
+ font-size: 30rpx;
730
+ background-color: #fff;
731
+ color: #555;
732
+ position: relative;
733
+ }
734
+
735
+ .up-font-close {
736
+ position: absolute;
737
+ right: 30rpx;
738
+ top: 50%;
739
+ transform: translateY(-50%);
740
+ color: #999;
741
+ }
742
+
743
+ .up-btn-calendar {
744
+ padding: 16rpx;
745
+ box-sizing: border-box;
746
+ text-align: center;
747
+ text-decoration: none;
748
+ }
749
+
750
+ .up-font-check {
751
+ color: #fff;
752
+ font-size: 54rpx;
753
+ line-height: 54rpx;
754
+ }
755
+
756
+ .up-custom-desc {
757
+ width: 100%;
758
+ font-size: 24rpx;
759
+ line-height: 24rpx;
760
+ transform: scale(0.75);
761
+ transform-origin: center center;
762
+ position: absolute;
763
+ left: 0;
764
+ text-align: center;
765
+ bottom: 2rpx;
766
+ }
767
+
768
+ .up-date-desc {
769
+ width: 100%;
770
+ font-size: 24rpx;
771
+ line-height: 24rpx;
772
+ position: absolute;
773
+ left: 0;
774
+ transform: scale(0.8);
775
+ transform-origin: center center;
776
+ text-align: center;
777
+ bottom: 8rpx;
778
+ z-index: 2;
779
+ }
780
+
781
+ .up-calendar-op {
782
+ width: 100%;
783
+ display: flex;
784
+ align-items: center;
785
+ justify-content: center;
786
+ flex-direction: column;
787
+ background-color: #fff;
788
+ padding: 0 42rpx 30rpx;
789
+ box-sizing: border-box;
790
+ font-size: 24rpx;
791
+ color: #666;
792
+ }
793
+
794
+ .up-calendar-result {
795
+ height: 48rpx;
796
+ }
797
+
798
+ .up-calendar-btn_box {
799
+ width: 100%;
800
+ }
801
+ </style>