소스 검색

uniui升级

seimin 11 달 전
부모
커밋
c538badf82
100개의 변경된 파일4689개의 추가작업 그리고 1413개의 파일을 삭제
  1. 2 0
      uni_modules/uni-calendar/changelog.md
  2. 2 1
      uni_modules/uni-calendar/components/uni-calendar/uni-calendar.vue
  3. 1 1
      uni_modules/uni-calendar/package.json
  4. 1 3
      uni_modules/uni-card/components/uni-card/uni-card.vue
  5. 2 0
      uni_modules/uni-collapse/changelog.md
  6. 1 1
      uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.vue
  7. 4 7
      uni_modules/uni-collapse/package.json
  8. 10 29
      uni_modules/uni-combox/components/uni-combox/uni-combox.vue
  9. 2 0
      uni_modules/uni-countdown/changelog.md
  10. 26 12
      uni_modules/uni-countdown/components/uni-countdown/uni-countdown.vue
  11. 4 7
      uni_modules/uni-countdown/package.json
  12. 4 0
      uni_modules/uni-data-checkbox/changelog.md
  13. 76 48
      uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue
  14. 1 1
      uni_modules/uni-data-checkbox/package.json
  15. 2 0
      uni_modules/uni-data-picker/changelog.md
  16. 380 0
      uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.uvue
  17. 1 0
      uni_modules/uni-data-picker/components/uni-data-pickerview/loading.uts
  18. 693 0
      uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-picker.uts
  19. 76 0
      uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.css
  20. 69 0
      uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.uvue
  21. 4 3
      uni_modules/uni-data-picker/package.json
  22. 1 1
      uni_modules/uni-data-picker/readme.md
  23. 4 0
      uni_modules/uni-data-select/changelog.md
  24. 77 32
      uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue
  25. 3 2
      uni_modules/uni-data-select/package.json
  26. 30 3
      uni_modules/uni-datetime-picker/changelog.md
  27. 91 72
      uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue
  28. 22 16
      uni_modules/uni-datetime-picker/components/uni-datetime-picker/time-picker.vue
  29. 226 195
      uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue
  30. 101 83
      uni_modules/uni-datetime-picker/components/uni-datetime-picker/util.js
  31. 3 2
      uni_modules/uni-datetime-picker/package.json
  32. 1 1
      uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue
  33. 16 0
      uni_modules/uni-easyinput/changelog.md
  34. 0 2
      uni_modules/uni-easyinput/components/uni-easyinput/common.js
  35. 645 609
      uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue
  36. 3 2
      uni_modules/uni-easyinput/package.json
  37. 8 0
      uni_modules/uni-file-picker/changelog.md
  38. 67 4
      uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js
  39. 12 1
      uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue
  40. 1 0
      uni_modules/uni-file-picker/components/uni-file-picker/utils.js
  41. 1 1
      uni_modules/uni-file-picker/package.json
  42. 2 0
      uni_modules/uni-forms/changelog.md
  43. 5 5
      uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue
  44. 1 1
      uni_modules/uni-forms/components/uni-forms/uni-forms.vue
  45. 1 1
      uni_modules/uni-forms/package.json
  46. 1 1
      uni_modules/uni-grid/components/uni-grid-item/uni-grid-item.vue
  47. 1 1
      uni_modules/uni-grid/components/uni-grid/uni-grid.vue
  48. 18 0
      uni_modules/uni-icons/changelog.md
  49. 91 0
      uni_modules/uni-icons/components/uni-icons/uni-icons.uvue
  50. 31 17
      uni_modules/uni-icons/components/uni-icons/uni-icons.vue
  51. 32 31
      uni_modules/uni-icons/components/uni-icons/uniicons.css
  52. BIN
      uni_modules/uni-icons/components/uni-icons/uniicons.ttf
  53. 664 0
      uni_modules/uni-icons/components/uni-icons/uniicons_file.ts
  54. 649 0
      uni_modules/uni-icons/components/uni-icons/uniicons_file_vue.js
  55. 14 12
      uni_modules/uni-icons/package.json
  56. 1 1
      uni_modules/uni-indexed-list/components/uni-indexed-list/uni-indexed-list-item.vue
  57. 2 2
      uni_modules/uni-indexed-list/components/uni-indexed-list/uni-indexed-list.vue
  58. 2 0
      uni_modules/uni-notice-bar/changelog.md
  59. 5 0
      uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar.vue
  60. 1 1
      uni_modules/uni-notice-bar/package.json
  61. 14 0
      uni_modules/uni-number-box/changelog.md
  62. 22 11
      uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue
  63. 6 8
      uni_modules/uni-number-box/package.json
  64. 16 0
      uni_modules/uni-popup/changelog.md
  65. 62 21
      uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue
  66. 1 1
      uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue
  67. 90 0
      uni_modules/uni-popup/components/uni-popup/uni-popup.uvue
  68. 38 8
      uni_modules/uni-popup/components/uni-popup/uni-popup.vue
  69. 3 2
      uni_modules/uni-popup/package.json
  70. 25 29
      uni_modules/uni-rate/components/uni-rate/uni-rate.vue
  71. 1 1
      uni_modules/uni-row/components/uni-col/uni-col.vue
  72. 1 1
      uni_modules/uni-row/components/uni-row/uni-row.vue
  73. 14 0
      uni_modules/uni-search-bar/changelog.md
  74. 1 1
      uni_modules/uni-search-bar/components/uni-search-bar/i18n/zh-Hans.json
  75. 1 1
      uni_modules/uni-search-bar/components/uni-search-bar/i18n/zh-Hant.json
  76. 18 7
      uni_modules/uni-search-bar/components/uni-search-bar/uni-search-bar.vue
  77. 6 8
      uni_modules/uni-search-bar/package.json
  78. 6 0
      uni_modules/uni-segmented-control/changelog.md
  79. 15 14
      uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.vue
  80. 6 8
      uni_modules/uni-segmented-control/package.json
  81. 2 0
      uni_modules/uni-steps/changelog.md
  82. 20 9
      uni_modules/uni-steps/components/uni-steps/uni-steps.vue
  83. 6 8
      uni_modules/uni-steps/package.json
  84. 4 0
      uni_modules/uni-swipe-action/changelog.md
  85. 15 14
      uni_modules/uni-swipe-action/components/uni-swipe-action-item/uni-swipe-action-item.vue
  86. 5 8
      uni_modules/uni-swipe-action/package.json
  87. 1 1
      uni_modules/uni-swiper-dot/components/uni-swiper-dot/uni-swiper-dot.vue
  88. 2 0
      uni_modules/uni-table/changelog.md
  89. 5 1
      uni_modules/uni-table/components/uni-tr/uni-tr.vue
  90. 1 1
      uni_modules/uni-table/package.json
  91. 2 0
      uni_modules/uni-tag/changelog.md
  92. 7 7
      uni_modules/uni-tag/components/uni-tag/uni-tag.vue
  93. 4 7
      uni_modules/uni-tag/package.json
  94. 6 0
      uni_modules/uni-tooltip/changelog.md
  95. 45 5
      uni_modules/uni-tooltip/components/uni-tooltip/uni-tooltip.vue
  96. 7 9
      uni_modules/uni-tooltip/package.json
  97. 4 0
      uni_modules/uni-transition/changelog.md
  98. 7 2
      uni_modules/uni-transition/components/uni-transition/uni-transition.vue
  99. 6 8
      uni_modules/uni-transition/package.json
  100. 0 0
      uni_modules/uni-ui/changelog.md

+ 2 - 0
uni_modules/uni-calendar/changelog.md

@@ -1,3 +1,5 @@
1
+## 1.4.11(2024-01-10)
2
+- 修复 回到今天时,月份显示不一致问题
1 3
 ## 1.4.10(2023-04-10)
2 4
 - 修复 某些情况 monthSwitch 未触发的Bug
3 5
 ## 1.4.9(2023-02-02)

+ 2 - 1
uni_modules/uni-calendar/components/uni-calendar/uni-calendar.vue

@@ -328,11 +328,12 @@
328 328
 				const date = this.cale.getDate(new Date())
329 329
         const todayYearMonth = `${date.year}-${date.month}`
330 330
 
331
+				this.init(date.fullDate)
332
+
331 333
         if(nowYearMonth !== todayYearMonth) {
332 334
           this.monthSwitch()
333 335
         }
334 336
 
335
-				this.init(date.fullDate)
336 337
 				this.change()
337 338
 			},
338 339
 			/**

+ 1 - 1
uni_modules/uni-calendar/package.json

@@ -1,7 +1,7 @@
1 1
 {
2 2
   "id": "uni-calendar",
3 3
   "displayName": "uni-calendar 日历",
4
-  "version": "1.4.10",
4
+  "version": "1.4.11",
5 5
   "description": "日历组件",
6 6
   "keywords": [
7 7
     "uni-ui",

+ 1 - 3
uni_modules/uni-card/components/uni-card/uni-card.vue

@@ -21,9 +21,7 @@
21 21
 					</view>
22 22
 				</view>
23 23
 				<view class="uni-card__header-extra" @click="onClick('extra')">
24
-					<slot name="extra">
25
-						<text class="uni-card__header-extra-text">{{ extra }}</text>
26
-					</slot>
24
+					<text class="uni-card__header-extra-text">{{ extra }}</text>
27 25
 				</view>
28 26
 			</view>
29 27
 		</slot>

+ 2 - 0
uni_modules/uni-collapse/changelog.md

@@ -1,3 +1,5 @@
1
+## 1.4.4(2024-03-20)
2
+- 修复 titleBorder类型修正
1 3
 ## 1.4.3(2022-01-25)
2 4
 - 修复 初始化的时候 ,open 属性失效的bug
3 5
 ## 1.4.2(2022-01-21)

+ 1 - 1
uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.vue

@@ -40,7 +40,7 @@
40 40
 	 * @property {String} name 唯一标志符
41 41
 	 * @property {Boolean} open = [true|false] 是否展开组件
42 42
 	 * @property {Boolean} titleBorder = [true|false] 是否显示标题分隔线
43
-	 * @property {Boolean} border = [true|false] 是否显示分隔线
43
+	 * @property {String} border = ['auto'|'show'|'none'] 是否显示分隔线
44 44
 	 * @property {Boolean} disabled = [true|false] 是否展开面板
45 45
 	 * @property {Boolean} showAnimation = [true|false] 开启动画
46 46
 	 * @property {Boolean} showArrow = [true|false] 是否显示右侧箭头

+ 4 - 7
uni_modules/uni-collapse/package.json

@@ -1,7 +1,7 @@
1 1
 {
2 2
   "id": "uni-collapse",
3 3
   "displayName": "uni-collapse 折叠面板",
4
-  "version": "1.4.3",
4
+  "version": "1.4.4",
5 5
   "description": "Collapse 组件,可以折叠 / 展开的内容区域。",
6 6
   "keywords": [
7 7
     "uni-ui",
@@ -16,11 +16,7 @@
16 16
   "directories": {
17 17
     "example": "../../temps/example_temps"
18 18
   },
19
-  "dcloudext": {
20
-    "category": [
21
-      "前端组件",
22
-      "通用组件"
23
-    ],
19
+"dcloudext": {
24 20
     "sale": {
25 21
       "regular": {
26 22
         "price": "0.00"
@@ -37,7 +33,8 @@
37 33
       "data": "无",
38 34
       "permissions": "无"
39 35
     },
40
-    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
36
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
37
+    "type": "component-vue"
41 38
   },
42 39
   "uni_modules": {
43 40
     "dependencies": [

+ 10 - 29
uni_modules/uni-combox/components/uni-combox/uni-combox.vue

@@ -4,24 +4,24 @@
4 4
 			<text>{{label}}</text>
5 5
 		</view>
6 6
 		<view class="uni-combox__input-box">
7
-			<input class="uni-combox__input" type="text" :placeholder="placeholder"
8
-				placeholder-class="uni-combox__input-plac" v-model="inputVal" @input="onInput" @focus="onFocus" @blur="onBlur" />
7
+			<input class="uni-combox__input" type="text" :placeholder="placeholder" 
8
+			placeholder-class="uni-combox__input-plac" v-model="inputVal" @input="onInput" @focus="onFocus" 
9
+@blur="onBlur" />
9 10
 			<uni-icons :type="showSelector? 'top' : 'bottom'" size="14" color="#999" @click="toggleSelector">
10 11
 			</uni-icons>
11 12
 		</view>
12 13
 		<view class="uni-combox__selector" v-if="showSelector">
13 14
 			<view class="uni-popper__arrow"></view>
14
-			<scroll-view scroll-y="true" class="uni-combox__selector-scroll" @scroll="onScroll">
15
+			<scroll-view scroll-y="true" class="uni-combox__selector-scroll">
15 16
 				<view class="uni-combox__selector-empty" v-if="filterCandidatesLength === 0">
16 17
 					<text>{{emptyTips}}</text>
17 18
 				</view>
18
-				<view class="uni-combox__selector-item" v-for="(item,index) in filterCandidates" :key="index" @click="onSelectorClick(index)">
19
+				<view class="uni-combox__selector-item" v-for="(item,index) in filterCandidates" :key="index" 
20
+				@click="onSelectorClick(index)">
19 21
 					<text>{{item}}</text>
20 22
 				</view>
21 23
 			</scroll-view>
22 24
 		</view>
23
-		<!-- 新增蒙层,点击蒙层时关闭选项显示 -->
24
-		<view class="uni-combox__mask" v-show="showSelector" @click="showSelector = false"></view>
25 25
 	</view>
26 26
 </template>
27 27
 
@@ -83,8 +83,7 @@
83 83
 		data() {
84 84
 			return {
85 85
 				showSelector: false,
86
-				inputVal: '',
87
-				blurTimer:null,
86
+				inputVal: ''
88 87
 			}
89 88
 		},
90 89
 		computed: {
@@ -95,9 +94,6 @@
95 94
 				return `width: ${this.labelWidth}`
96 95
 			},
97 96
 			filterCandidates() {
98
-				if (this.inputVal !== 0 && !this.inputVal) {
99
-					return this.candidates
100
-				}
101 97
 				return this.candidates.filter((item) => {
102 98
 					return item.toString().indexOf(this.inputVal) > -1
103 99
 				})
@@ -132,16 +128,10 @@
132 128
 				this.showSelector = true
133 129
 			},
134 130
 			onBlur() {
135
-				this.blurTimer = setTimeout(() => {
131
+				setTimeout(() => {
136 132
 					this.showSelector = false
137 133
 				}, 153)
138 134
 			},
139
-			onScroll(){ // 滚动时将blur的定时器关掉
140
-				if(this.blurTimer) {
141
-					clearTimeout(this.blurTimer)
142
-					this.blurTimer = null
143
-				}
144
-			},
145 135
 			onSelectorClick(index) {
146 136
 				this.inputVal = this.filterCandidates[index]
147 137
 				this.showSelector = false
@@ -158,7 +148,7 @@
158 148
 	}
159 149
 </script>
160 150
 
161
-<style lang="scss">
151
+<style lang="scss" scoped>
162 152
 	.uni-combox {
163 153
 		font-size: 14px;
164 154
 		border: 1px solid #DCDFE6;
@@ -215,7 +205,7 @@
215 205
 		border: 1px solid #EBEEF5;
216 206
 		border-radius: 6px;
217 207
 		box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
218
-		z-index: 3;
208
+		z-index: 2;
219 209
 		padding: 4px 0;
220 210
 	}
221 211
 
@@ -282,13 +272,4 @@
282 272
 	.uni-combox__no-border {
283 273
 		border: none;
284 274
 	}
285
-
286
-	.uni-combox__mask {
287
-		width:100%;
288
-		height:100%;
289
-		position: fixed;
290
-		top: 0;
291
-		left: 0;
292
-    z-index: 1;
293
-	}
294 275
 </style>

+ 2 - 0
uni_modules/uni-countdown/changelog.md

@@ -1,3 +1,5 @@
1
+## 1.2.3(2024-02-20)
2
+- 新增 支持控制小时,分钟的显隐:showHour showMinute
1 3
 ## 1.2.2(2022-01-19)
2 4
 - 修复 在微信小程序中样式不生效的bug
3 5
 ## 1.2.1(2022-01-18)

+ 26 - 12
uni_modules/uni-countdown/components/uni-countdown/uni-countdown.vue

@@ -2,10 +2,10 @@
2 2
 	<view class="uni-countdown">
3 3
 		<text v-if="showDay" :style="[timeStyle]" class="uni-countdown__number">{{ d }}</text>
4 4
 		<text v-if="showDay" :style="[splitorStyle]" class="uni-countdown__splitor">{{dayText}}</text>
5
-		<text :style="[timeStyle]" class="uni-countdown__number">{{ h }}</text>
6
-		<text :style="[splitorStyle]" class="uni-countdown__splitor">{{ showColon ? ':' : hourText }}</text>
7
-		<text :style="[timeStyle]" class="uni-countdown__number">{{ i }}</text>
8
-		<text :style="[splitorStyle]" class="uni-countdown__splitor">{{ showColon ? ':' : minuteText }}</text>
5
+		<text v-if="showHour" :style="[timeStyle]" class="uni-countdown__number">{{ h }}</text>
6
+		<text v-if="showHour" :style="[splitorStyle]" class="uni-countdown__splitor">{{ showColon ? ':' : hourText }}</text>
7
+		<text v-if="showMinute" :style="[timeStyle]" class="uni-countdown__number">{{ i }}</text>
8
+		<text v-if="showMinute" :style="[splitorStyle]" class="uni-countdown__splitor">{{ showColon ? ':' : minuteText }}</text>
9 9
 		<text :style="[timeStyle]" class="uni-countdown__number">{{ s }}</text>
10 10
 		<text v-if="!showColon" :style="[splitorStyle]" class="uni-countdown__splitor">{{secondText}}</text>
11 11
 	</view>
@@ -30,6 +30,8 @@
30 30
 	 * @property {Number} second 秒
31 31
 	 * @property {Number} timestamp 时间戳
32 32
 	 * @property {Boolean} showDay = [true|false] 是否显示天数
33
+	 * @property {Boolean} showHour = [true|false] 是否显示小时
34
+	 * @property {Boolean} showMinute = [true|false] 是否显示分钟
33 35
 	 * @property {Boolean} show-colon = [true|false] 是否以冒号为分隔符
34 36
 	 * @property {String} splitorColor 分割符号颜色
35 37
 	 * @event {Function} timeup 倒计时时间到触发事件
@@ -43,6 +45,14 @@
43 45
 				type: Boolean,
44 46
 				default: true
45 47
 			},
48
+			showHour: {
49
+				type: Boolean,
50
+				default: true
51
+			},
52
+			showMinute: {
53
+				type: Boolean,
54
+				default: true
55
+			},
46 56
 			showColon: {
47 57
 				type: Boolean,
48 58
 				default: true
@@ -86,10 +96,6 @@
86 96
 			timestamp: {
87 97
 				type: Number,
88 98
 				default: 0
89
-			},
90
-      zeroPad: {
91
-				type: Boolean,
92
-				default: true
93 99
 			}
94 100
 		},
95 101
 		data() {
@@ -203,10 +209,18 @@
203 209
 				} else {
204 210
 					this.timeUp()
205 211
 				}
206
-        day = (day < 10 && this.zeroPad) ? `0${day}` : day
207
-				hour = (hour < 10 && this.zeroPad) ? `0${hour}` : hour
208
-				minute = (minute < 10 && this.zeroPad) ? `0${minute}` : minute
209
-				second = (second < 10 && this.zeroPad) ? `0${second}` : second
212
+				if (day < 10) {
213
+					day = '0' + day
214
+				}
215
+				if (hour < 10) {
216
+					hour = '0' + hour
217
+				}
218
+				if (minute < 10) {
219
+					minute = '0' + minute
220
+				}
221
+				if (second < 10) {
222
+					second = '0' + second
223
+				}
210 224
 				this.d = day
211 225
 				this.h = hour
212 226
 				this.i = minute

+ 4 - 7
uni_modules/uni-countdown/package.json

@@ -1,7 +1,7 @@
1 1
 {
2 2
   "id": "uni-countdown",
3 3
   "displayName": "uni-countdown 倒计时",
4
-  "version": "1.2.2",
4
+  "version": "1.2.3",
5 5
   "description": "CountDown 倒计时组件",
6 6
   "keywords": [
7 7
     "uni-ui",
@@ -16,11 +16,7 @@
16 16
   "directories": {
17 17
     "example": "../../temps/example_temps"
18 18
   },
19
-  "dcloudext": {
20
-    "category": [
21
-      "前端组件",
22
-      "通用组件"
23
-    ],
19
+"dcloudext": {
24 20
     "sale": {
25 21
       "regular": {
26 22
         "price": "0.00"
@@ -37,7 +33,8 @@
37 33
       "data": "无",
38 34
       "permissions": "无"
39 35
     },
40
-    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
36
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
37
+    "type": "component-vue"
41 38
   },
42 39
   "uni_modules": {
43 40
     "dependencies": ["uni-scss"],

+ 4 - 0
uni_modules/uni-data-checkbox/changelog.md

@@ -1,3 +1,7 @@
1
+## 1.0.5(2024-03-20)
2
+- 修复 单选模式下选中样式不生效的bug
3
+## 1.0.4(2024-01-27)
4
+- 修复 修复错别字chagne为change
1 5
 ## 1.0.3(2022-09-16)
2 6
 - 可以使用 uni-scss 控制主题色
3 7
 ## 1.0.2(2022-06-30)

+ 76 - 48
uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue

@@ -2,16 +2,21 @@
2 2
 	<view class="uni-data-checklist" :style="{'margin-top':isTop+'px'}">
3 3
 		<template v-if="!isLocal">
4 4
 			<view class="uni-data-loading">
5
-				<uni-load-more v-if="!mixinDatacomErrorMessage" status="loading" iconType="snow" :iconSize="18" :content-text="contentText"></uni-load-more>
5
+				<uni-load-more v-if="!mixinDatacomErrorMessage" status="loading" iconType="snow" :iconSize="18"
6
+					:content-text="contentText"></uni-load-more>
6 7
 				<text v-else>{{mixinDatacomErrorMessage}}</text>
7 8
 			</view>
8 9
 		</template>
9 10
 		<template v-else>
10
-			<checkbox-group v-if="multiple" class="checklist-group" :class="{'is-list':mode==='list' || wrap}" @change="chagne">
11
-				<label class="checklist-box" :class="['is--'+mode,item.selected?'is-checked':'',(disabled || !!item.disabled)?'is-disable':'',index!==0&&mode==='list'?'is-list-border':'']"
12
-				 :style="item.styleBackgroud" v-for="(item,index) in dataList" :key="index">
13
-					<checkbox class="hidden" hidden :disabled="disabled || !!item.disabled" :value="item[map.value]+''" :checked="item.selected" />
14
-					<view v-if="(mode !=='tag' && mode !== 'list') || ( mode === 'list' && icon === 'left')" class="checkbox__inner"  :style="item.styleIcon">
11
+			<checkbox-group v-if="multiple" class="checklist-group" :class="{'is-list':mode==='list' || wrap}"
12
+				@change="change">
13
+				<label class="checklist-box"
14
+					:class="['is--'+mode,item.selected?'is-checked':'',(disabled || !!item.disabled)?'is-disable':'',index!==0&&mode==='list'?'is-list-border':'']"
15
+					:style="item.styleBackgroud" v-for="(item,index) in dataList" :key="index">
16
+					<checkbox class="hidden" hidden :disabled="disabled || !!item.disabled" :value="item[map.value]+''"
17
+						:checked="item.selected" />
18
+					<view v-if="(mode !=='tag' && mode !== 'list') || ( mode === 'list' && icon === 'left')"
19
+						class="checkbox__inner" :style="item.styleIcon">
15 20
 						<view class="checkbox__inner-icon"></view>
16 21
 					</view>
17 22
 					<view class="checklist-content" :class="{'list-content':mode === 'list' && icon ==='left'}">
@@ -20,13 +25,14 @@
20 25
 					</view>
21 26
 				</label>
22 27
 			</checkbox-group>
23
-			<radio-group v-else class="checklist-group" :class="{'is-list':mode==='list','is-wrap':wrap}" @change="chagne">
24
-				<!-- -->
25
-				<label class="checklist-box" :class="['is--'+mode,item.selected?'is-checked':'',(disabled || !!item.disabled)?'is-disable':'',index!==0&&mode==='list'?'is-list-border':'']"
26
-				 :style="item.styleBackgroud" v-for="(item,index) in dataList" :key="index">
27
-					<radio class="hidden" hidden :disabled="disabled || item.disabled" :value="item[map.value]+''" :checked="item.selected" />
28
+			<radio-group v-else class="checklist-group" :class="{'is-list':mode==='list','is-wrap':wrap}" @change="change">
29
+				<label class="checklist-box"
30
+					:class="['is--'+mode,item.selected?'is-checked':'',(disabled || !!item.disabled)?'is-disable':'',index!==0&&mode==='list'?'is-list-border':'']"
31
+					:style="item.styleBackgroud" v-for="(item,index) in dataList" :key="index">
32
+					<radio class="hidden" hidden :disabled="disabled || item.disabled" :value="item[map.value]+''"
33
+						:checked="item.selected" />
28 34
 					<view v-if="(mode !=='tag' && mode !== 'list') || ( mode === 'list' && icon === 'left')" class="radio__inner"
29
-					 :style="item.styleBackgroud">
35
+						:style="item.styleBackgroud">
30 36
 						<view class="radio__inner-icon" :style="item.styleIcon"></view>
31 37
 					</view>
32 38
 					<view class="checklist-content" :class="{'list-content':mode === 'list' && icon ==='left'}">
@@ -68,7 +74,7 @@
68 74
 	export default {
69 75
 		name: 'uniDataChecklist',
70 76
 		mixins: [uniCloud.mixinDatacom || {}],
71
-		emits:['input','update:modelValue','change'],
77
+		emits: ['input', 'update:modelValue', 'change'],
72 78
 		props: {
73 79
 			mode: {
74 80
 				type: String,
@@ -88,7 +94,7 @@
88 94
 			// TODO vue3
89 95
 			modelValue: {
90 96
 				type: [Array, String, Number],
91
-				default() {
97
+				default () {
92 98
 					return '';
93 99
 				}
94 100
 			},
@@ -122,20 +128,20 @@
122 128
 				type: String,
123 129
 				default: ''
124 130
 			},
125
-			emptyText:{
131
+			emptyText: {
126 132
 				type: String,
127 133
 				default: '暂无数据'
128 134
 			},
129
-			disabled:{
135
+			disabled: {
130 136
 				type: Boolean,
131 137
 				default: false
132 138
 			},
133
-			map:{
139
+			map: {
134 140
 				type: Object,
135
-				default(){
141
+				default () {
136 142
 					return {
137
-						text:'text',
138
-						value:'value'
143
+						text: 'text',
144
+						value: 'value'
139 145
 					}
140 146
 				}
141 147
 			}
@@ -177,18 +183,18 @@
177 183
 					contentrefresh: '加载中',
178 184
 					contentnomore: '没有更多'
179 185
 				},
180
-				isLocal:true,
186
+				isLocal: true,
181 187
 				styles: {
182 188
 					selectedColor: '#2979ff',
183 189
 					selectedTextColor: '#666',
184 190
 				},
185
-				isTop:0
191
+				isTop: 0
186 192
 			};
187 193
 		},
188
-		computed:{
189
-			dataValue(){
190
-				if(this.value === '')return this.modelValue
191
-				if(this.modelValue === '') return this.value
194
+		computed: {
195
+			dataValue() {
196
+				if (this.value === '') return this.modelValue
197
+				if (this.modelValue === '') return this.value
192 198
 				return this.value
193 199
 			}
194 200
 		},
@@ -223,15 +229,15 @@
223 229
 		},
224 230
 		methods: {
225 231
 			loadData() {
226
-				this.mixinDatacomGet().then(res=>{
232
+				this.mixinDatacomGet().then(res => {
227 233
 					this.mixinDatacomResData = res.result.data
228
-					if(this.mixinDatacomResData.length === 0){
234
+					if (this.mixinDatacomResData.length === 0) {
229 235
 						this.isLocal = false
230 236
 						this.mixinDatacomErrorMessage = this.emptyText
231
-					}else{
237
+					} else {
232 238
 						this.isLocal = true
233 239
 					}
234
-				}).catch(err=>{
240
+				}).catch(err => {
235 241
 					this.mixinDatacomErrorMessage = err.message
236 242
 				})
237 243
 			},
@@ -248,7 +254,7 @@
248 254
 				}
249 255
 				return parent;
250 256
 			},
251
-			chagne(e) {
257
+			change(e) {
252 258
 				const values = e.detail.value
253 259
 
254 260
 				let detail = {
@@ -383,13 +389,13 @@
383 389
 			 */
384 390
 			setStyleBackgroud(item) {
385 391
 				let styles = {}
386
-				let selectedColor = this.selectedColor?this.selectedColor:'#2979ff'
392
+				let selectedColor = this.selectedColor ? this.selectedColor : '#2979ff'
387 393
 				if (this.selectedColor) {
388 394
 					if (this.mode !== 'list') {
389
-						styles['border-color'] = item.selected?selectedColor:'#DCDFE6'
395
+						styles['border-color'] = item.selected ? selectedColor : '#DCDFE6'
390 396
 					}
391 397
 					if (this.mode === 'tag') {
392
-						styles['background-color'] = item.selected? selectedColor:'#f5f5f5'
398
+						styles['background-color'] = item.selected ? selectedColor : '#f5f5f5'
393 399
 					}
394 400
 				}
395 401
 				let classles = ''
@@ -402,13 +408,13 @@
402 408
 				let styles = {}
403 409
 				let classles = ''
404 410
 				if (this.selectedColor) {
405
-					let selectedColor = this.selectedColor?this.selectedColor:'#2979ff'
406
-					styles['background-color'] = item.selected?selectedColor:'#fff'
407
-					styles['border-color'] = item.selected?selectedColor:'#DCDFE6'
408
-					
409
-					if(!item.selected && item.disabled){
411
+					let selectedColor = this.selectedColor ? this.selectedColor : '#2979ff'
412
+					styles['background-color'] = item.selected ? selectedColor : '#fff'
413
+					styles['border-color'] = item.selected ? selectedColor : '#DCDFE6'
414
+
415
+					if (!item.selected && item.disabled) {
410 416
 						styles['background-color'] = '#F2F6FC'
411
-						styles['border-color'] = item.selected?selectedColor:'#DCDFE6'
417
+						styles['border-color'] = item.selected ? selectedColor : '#DCDFE6'
412 418
 					}
413 419
 				}
414 420
 				for (let i in styles) {
@@ -420,13 +426,13 @@
420 426
 				let styles = {}
421 427
 				let classles = ''
422 428
 				if (this.selectedColor) {
423
-					let selectedColor = this.selectedColor?this.selectedColor:'#2979ff'
429
+					let selectedColor = this.selectedColor ? this.selectedColor : '#2979ff'
424 430
 					if (this.mode === 'tag') {
425
-						styles.color = item.selected?(this.selectedTextColor?this.selectedTextColor:'#fff'):'#666'
431
+						styles.color = item.selected ? (this.selectedTextColor ? this.selectedTextColor : '#fff') : '#666'
426 432
 					} else {
427
-						styles.color = item.selected?(this.selectedTextColor?this.selectedTextColor:selectedColor):'#666'
433
+						styles.color = item.selected ? (this.selectedTextColor ? this.selectedTextColor : selectedColor) : '#666'
428 434
 					}
429
-					if(!item.selected && item.disabled){
435
+					if (!item.selected && item.disabled) {
430 436
 						styles.color = '#999'
431 437
 					}
432 438
 				}
@@ -439,7 +445,7 @@
439 445
 				let styles = {}
440 446
 				let classles = ''
441 447
 				if (this.mode === 'list') {
442
-					styles['border-color'] = item.selected?this.styles.selectedColor:'#DCDFE6'
448
+					styles['border-color'] = item.selected ? this.styles.selectedColor : '#DCDFE6'
443 449
 				}
444 450
 				for (let i in styles) {
445 451
 					classles += `${i}:${styles[i]};`
@@ -454,7 +460,7 @@
454 460
 <style lang="scss">
455 461
 	$uni-primary: #2979ff !default;
456 462
 	$border-color: #DCDFE6;
457
-	$disable:0.4;
463
+	$disable: 0.4;
458 464
 
459 465
 	@mixin flex {
460 466
 		/* #ifndef APP-NVUE */
@@ -476,6 +482,7 @@
476 482
 		position: relative;
477 483
 		z-index: 0;
478 484
 		flex: 1;
485
+
479 486
 		// 多选样式
480 487
 		.checklist-group {
481 488
 			@include flex;
@@ -506,6 +513,7 @@
506 513
 					flex-direction: row;
507 514
 					align-items: center;
508 515
 					justify-content: space-between;
516
+
509 517
 					.checklist-text {
510 518
 						font-size: 14px;
511 519
 						color: #666;
@@ -517,7 +525,7 @@
517 525
 						border-right-width: 1px;
518 526
 						border-right-color: #007aff;
519 527
 						border-right-style: solid;
520
-						border-bottom-width:1px;
528
+						border-bottom-width: 1px;
521 529
 						border-bottom-color: #007aff;
522 530
 						border-bottom-style: solid;
523 531
 						height: 12px;
@@ -542,6 +550,7 @@
542 550
 					border-radius: 4px;
543 551
 					background-color: #fff;
544 552
 					z-index: 1;
553
+
545 554
 					.checkbox__inner-icon {
546 555
 						position: absolute;
547 556
 						/* #ifdef APP-NVUE */
@@ -556,7 +565,7 @@
556 565
 						border-right-width: 1px;
557 566
 						border-right-color: #fff;
558 567
 						border-right-style: solid;
559
-						border-bottom-width:1px ;
568
+						border-bottom-width: 1px;
560 569
 						border-bottom-color: #fff;
561 570
 						border-bottom-style: solid;
562 571
 						opacity: 0;
@@ -597,6 +606,7 @@
597 606
 					&.is-disable {
598 607
 						/* #ifdef H5 */
599 608
 						cursor: not-allowed;
609
+
600 610
 						/* #endif */
601 611
 						.checkbox__inner {
602 612
 							background-color: #F2F6FC;
@@ -610,6 +620,7 @@
610 620
 							background-color: #F2F6FC;
611 621
 							border-color: $border-color;
612 622
 						}
623
+
613 624
 						.checklist-text {
614 625
 							color: #999;
615 626
 						}
@@ -626,16 +637,20 @@
626 637
 								transform: rotate(45deg);
627 638
 							}
628 639
 						}
640
+
629 641
 						.radio__inner {
630 642
 							border-color: $uni-primary;
643
+
631 644
 							.radio__inner-icon {
632 645
 								opacity: 1;
633 646
 								background-color: $uni-primary;
634 647
 							}
635 648
 						}
649
+
636 650
 						.checklist-text {
637 651
 							color: $uni-primary;
638 652
 						}
653
+
639 654
 						// 选中禁用
640 655
 						&.is-disable {
641 656
 							.checkbox__inner {
@@ -645,6 +660,7 @@
645 660
 							.checklist-text {
646 661
 								opacity: $disable;
647 662
 							}
663
+
648 664
 							.radio__inner {
649 665
 								opacity: $disable;
650 666
 							}
@@ -667,6 +683,7 @@
667 683
 						/* #endif */
668 684
 						border: 1px #eee solid;
669 685
 						opacity: $disable;
686
+
670 687
 						.checkbox__inner {
671 688
 							background-color: #F2F6FC;
672 689
 							border-color: $border-color;
@@ -674,6 +691,7 @@
674 691
 							cursor: not-allowed;
675 692
 							/* #endif */
676 693
 						}
694
+
677 695
 						.radio__inner {
678 696
 							background-color: #F2F6FC;
679 697
 							border-color: $border-color;
@@ -681,6 +699,7 @@
681 699
 							cursor: not-allowed;
682 700
 							/* #endif */
683 701
 						}
702
+
684 703
 						.checklist-text {
685 704
 							color: #999;
686 705
 						}
@@ -688,9 +707,11 @@
688 707
 
689 708
 					&.is-checked {
690 709
 						border-color: $uni-primary;
710
+
691 711
 						.checkbox__inner {
692 712
 							border-color: $uni-primary;
693 713
 							background-color: $uni-primary;
714
+
694 715
 							.checkbox__inner-icon {
695 716
 								opacity: 1;
696 717
 								transform: rotate(45deg);
@@ -747,6 +768,7 @@
747 768
 						}
748 769
 					}
749 770
 				}
771
+
750 772
 				// 列表样式
751 773
 				&.is--list {
752 774
 					/* #ifndef APP-NVUE */
@@ -764,6 +786,7 @@
764 786
 					&.is-disable {
765 787
 						/* #ifdef H5 */
766 788
 						cursor: not-allowed;
789
+
767 790
 						/* #endif */
768 791
 						.checkbox__inner {
769 792
 							background-color: #F2F6FC;
@@ -772,6 +795,7 @@
772 795
 							cursor: not-allowed;
773 796
 							/* #endif */
774 797
 						}
798
+
775 799
 						.checklist-text {
776 800
 							color: #999;
777 801
 						}
@@ -787,11 +811,15 @@
787 811
 								transform: rotate(45deg);
788 812
 							}
789 813
 						}
814
+
790 815
 						.radio__inner {
816
+							border-color: $uni-primary;
791 817
 							.radio__inner-icon {
792 818
 								opacity: 1;
819
+								background-color: $uni-primary;
793 820
 							}
794 821
 						}
822
+
795 823
 						.checklist-text {
796 824
 							color: $uni-primary;
797 825
 						}

+ 1 - 1
uni_modules/uni-data-checkbox/package.json

@@ -1,7 +1,7 @@
1 1
 {
2 2
   "id": "uni-data-checkbox",
3 3
   "displayName": "uni-data-checkbox 数据选择器",
4
-  "version": "1.0.3",
4
+  "version": "1.0.5",
5 5
   "description": "通过数据驱动的单选框和复选框",
6 6
   "keywords": [
7 7
     "uni-ui",

+ 2 - 0
uni_modules/uni-data-picker/changelog.md

@@ -1,3 +1,5 @@
1
+## 2.0.0(2023-12-14)
2
+- 新增 支持 uni-app-x
1 3
 ## 1.1.2(2023-04-11)
2 4
 - 修复 更改 modelValue 报错的 bug
3 5
 - 修复 v-for 未使用 key 值控制台 warning

+ 380 - 0
uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.uvue

@@ -0,0 +1,380 @@
1
+<template>
2
+  <view class="uni-data-tree">
3
+    <view class="uni-data-tree-input" @click="handleInput">
4
+      <slot :data="selectedPaths" :error="error">
5
+        <view class="input-value" :class="{'input-value-border': border}">
6
+          <text v-if="error!=null" class="error-text">{{error!.errMsg}}</text>
7
+          <scroll-view v-if="selectedPaths.length" class="selected-path" scroll-x="true">
8
+            <view class="selected-list">
9
+              <template v-for="(item, index) in selectedPaths">
10
+                <text class="text-color">{{item[mappingTextName]}}</text>
11
+                <text v-if="index<selectedPaths.length-1" class="input-split-line">{{split}}</text>
12
+              </template>
13
+            </view>
14
+          </scroll-view>
15
+          <text v-else-if="error==null&&!loading" class="placeholder">{{placeholder}}</text>
16
+          <view v-if="!readonly" class="arrow-area">
17
+            <view class="input-arrow"></view>
18
+          </view>
19
+        </view>
20
+      </slot>
21
+      <view v-if="loading && !isOpened" class="selected-loading">
22
+        <slot name="picker-loading" :loading="loading"></slot>
23
+      </view>
24
+    </view>
25
+    <view class="uni-data-tree-cover" v-if="isOpened" @click="handleClose"></view>
26
+    <view class="uni-data-tree-dialog" v-if="isOpened">
27
+      <view class="uni-popper__arrow"></view>
28
+      <view class="dialog-caption">
29
+        <view class="dialog-title-view">
30
+          <text class="dialog-title">{{popupTitle}}</text>
31
+        </view>
32
+        <view class="dialog-close" @click="handleClose">
33
+          <view class="dialog-close-plus" data-id="close"></view>
34
+          <view class="dialog-close-plus dialog-close-rotate" data-id="close"></view>
35
+        </view>
36
+      </view>
37
+      <view ref="pickerView" class="uni-data-pickerview">
38
+        <view v-if="error!=null" class="error">
39
+          <text class="error-text">{{error!.errMsg}}</text>
40
+        </view>
41
+        <scroll-view v-if="!isCloudDataList" :scroll-x="true">
42
+          <view class="selected-node-list">
43
+            <template v-for="(item, index) in selectedNodes">
44
+              <text class="selected-node-item" :class="{'selected-node-item-active':index==selectedIndex}"
45
+                @click="onTabSelect(index)">
46
+                {{item[mappingTextName]}}
47
+              </text>
48
+            </template>
49
+          </view>
50
+        </scroll-view>
51
+        <list-view class="list-view" :scroll-y="true">
52
+          <list-item class="list-item" v-for="(item, _) in currentDataList" @click="onNodeClick(item)">
53
+            <text class="item-text" :class="{'item-text-disabled': item['disable']}">{{item[mappingTextName]}}</text>
54
+            <text class="check" v-if="item[mappingValueName] == selectedNodes[selectedIndex][mappingValueName]"></text>
55
+          </list-item>
56
+        </list-view>
57
+        <view class="loading-cover" v-if="loading">
58
+          <slot name="pickerview-loading" :loading="loading"></slot>
59
+        </view>
60
+      </view>
61
+    </view>
62
+  </view>
63
+</template>
64
+
65
+<script>
66
+  import { dataPicker } from "../uni-data-pickerview/uni-data-picker.uts"
67
+
68
+  /**
69
+   * DataPicker 级联选择
70
+   * @description 支持单列、和多列级联选择。列数没有限制,如果屏幕显示不全,顶部tab区域会左右滚动。
71
+   * @tutorial https://ext.dcloud.net.cn/plugin?id=3796
72
+   * @property {String} popup-title 弹出窗口标题
73
+   * @property {Array} localdata 本地数据,参考
74
+   * @property {Boolean} border = [true|false] 是否有边框
75
+   * @property {Boolean} readonly = [true|false] 是否仅读
76
+   * @property {Boolean} preload = [true|false] 是否预加载数据
77
+   * @value true 开启预加载数据,点击弹出窗口后显示已加载数据
78
+   * @value false 关闭预加载数据,点击弹出窗口后开始加载数据
79
+   * @property {Boolean} step-searh = [true|false] 是否分布查询
80
+   * @value true 启用分布查询,仅查询当前选中节点
81
+   * @value false 关闭分布查询,一次查询出所有数据
82
+   * @property {String|DBFieldString} self-field 分布查询当前字段名称
83
+   * @property {String|DBFieldString} parent-field 分布查询父字段名称
84
+   * @property {String|DBCollectionString} collection 表名
85
+   * @property {String|DBFieldString} field 查询字段,多个字段用 `,` 分割
86
+   * @property {String} orderby 排序字段及正序倒叙设置
87
+   * @property {String|JQLString} where 查询条件
88
+   * @event {Function} popupshow 弹出的选择窗口打开时触发此事件
89
+   * @event {Function} popuphide 弹出的选择窗口关闭时触发此事件
90
+   */
91
+  export default {
92
+    name: 'UniDataPicker',
93
+    emits: ['popupopened', 'popupclosed', 'nodeclick', 'change', 'input', 'update:modelValue', 'inputclick'],
94
+    mixins: [dataPicker],
95
+    props: {
96
+      popupTitle: {
97
+        type: String,
98
+        default: '请选择'
99
+      },
100
+      placeholder: {
101
+        type: String,
102
+        default: '请选择'
103
+      },
104
+      heightMobile: {
105
+        type: String,
106
+        default: ''
107
+      },
108
+      readonly: {
109
+        type: Boolean,
110
+        default: false
111
+      },
112
+      clearIcon: {
113
+        type: Boolean,
114
+        default: true
115
+      },
116
+      border: {
117
+        type: Boolean,
118
+        default: true
119
+      },
120
+      split: {
121
+        type: String,
122
+        default: '/'
123
+      },
124
+      ellipsis: {
125
+        type: Boolean,
126
+        default: true
127
+      }
128
+    },
129
+    data() {
130
+      return {
131
+        isOpened: false
132
+      }
133
+    },
134
+    computed: {
135
+      isShowClearIcon() : boolean {
136
+        if (this.readonly) {
137
+          return false
138
+        }
139
+
140
+        if (this.clearIcon && this.selectedPaths.length > 0) {
141
+          return true
142
+        }
143
+
144
+        return false
145
+      }
146
+    },
147
+    created() {
148
+      this.load()
149
+    },
150
+    methods: {
151
+      clear() {
152
+      },
153
+      load() {
154
+        if (this.isLocalData) {
155
+          this.loadLocalData()
156
+        } else if (this.isCloudDataList || this.isCloudDataTree) {
157
+          this.loadCloudDataPath()
158
+        }
159
+      },
160
+      show() {
161
+        this.isOpened = true
162
+        this.$emit('popupopened')
163
+        if (!this.hasCloudTreeData) {
164
+          this.loadData()
165
+        }
166
+      },
167
+      hide() {
168
+        this.isOpened = false
169
+        this.$emit('popupclosed')
170
+      },
171
+      handleInput() {
172
+        if (this.readonly) {
173
+          this.$emit('inputclick')
174
+        } else {
175
+          this.show()
176
+        }
177
+      },
178
+      handleClose() {
179
+        this.hide()
180
+      },
181
+      onFinish() {
182
+        this.selectedPaths = this.getChangeNodes()
183
+        this.$emit('change', this.selectedPaths)
184
+        this.hide()
185
+      }
186
+    }
187
+  }
188
+</script>
189
+
190
+<style>
191
+  @import url("../uni-data-pickerview/uni-data-pickerview.css");
192
+
193
+  .uni-data-tree {
194
+    position: relative;
195
+  }
196
+
197
+  .uni-data-tree-input {
198
+    position: relative;
199
+  }
200
+
201
+  .selected-loading {
202
+    display: flex;
203
+    justify-content: center;
204
+    position: absolute;
205
+    left: 0;
206
+    top: 0;
207
+    right: 0;
208
+    bottom: 0;
209
+  }
210
+
211
+  .error-text {
212
+    flex: 1;
213
+    font-size: 12px;
214
+    color: #DD524D;
215
+  }
216
+
217
+  .input-value {
218
+    flex-direction: row;
219
+    align-items: center;
220
+    flex-wrap: nowrap;
221
+    padding: 5px 5px;
222
+    padding-right: 5px;
223
+    overflow: hidden;
224
+    min-height: 28px;
225
+  }
226
+
227
+  .input-value-border {
228
+    border: 1px solid #e5e5e5;
229
+    border-radius: 5px;
230
+  }
231
+
232
+  .selected-path {
233
+    flex: 1;
234
+    flex-direction: row;
235
+    overflow: hidden;
236
+  }
237
+
238
+  .load-more {
239
+    width: 40px;
240
+  }
241
+
242
+  .selected-list {
243
+    flex-direction: row;
244
+    flex-wrap: nowrap;
245
+  }
246
+
247
+  .selected-item {
248
+    flex-direction: row;
249
+    flex-wrap: nowrap;
250
+  }
251
+
252
+  .text-color {
253
+    font-size: 14px;
254
+    color: #333;
255
+  }
256
+
257
+  .placeholder {
258
+    color: grey;
259
+    font-size: 14px;
260
+  }
261
+
262
+  .input-split-line {
263
+    opacity: .5;
264
+    margin-left: 1px;
265
+    margin-right: 1px;
266
+  }
267
+
268
+  .arrow-area {
269
+    position: relative;
270
+    padding: 0 12px;
271
+    margin-left: auto;
272
+    justify-content: center;
273
+    transform: rotate(-45deg);
274
+    transform-origin: center;
275
+  }
276
+
277
+  .input-arrow {
278
+    width: 8px;
279
+    height: 8px;
280
+    border-left: 2px solid #999;
281
+    border-bottom: 2px solid #999;
282
+  }
283
+
284
+  .uni-data-tree-cover {
285
+    position: fixed;
286
+    left: 0;
287
+    top: 0;
288
+    right: 0;
289
+    bottom: 0;
290
+    background-color: rgba(0, 0, 0, .4);
291
+    flex-direction: column;
292
+    z-index: 100;
293
+  }
294
+
295
+  .uni-data-tree-dialog {
296
+    position: fixed;
297
+    left: 0;
298
+    top: 20%;
299
+    right: 0;
300
+    bottom: 0;
301
+    background-color: #FFFFFF;
302
+    border-top-left-radius: 10px;
303
+    border-top-right-radius: 10px;
304
+    flex-direction: column;
305
+    z-index: 102;
306
+    overflow: hidden;
307
+  }
308
+
309
+  .dialog-caption {
310
+    position: relative;
311
+    flex-direction: row;
312
+  }
313
+
314
+  .dialog-title-view {
315
+    flex: 1;
316
+  }
317
+
318
+  .dialog-title {
319
+    align-self: center;
320
+    padding: 0 10px;
321
+    line-height: 44px;
322
+  }
323
+
324
+  .dialog-close {
325
+    position: absolute;
326
+    top: 0;
327
+    right: 0;
328
+    bottom: 0;
329
+    flex-direction: row;
330
+    align-items: center;
331
+    padding: 0 15px;
332
+  }
333
+
334
+  .dialog-close-plus {
335
+    width: 16px;
336
+    height: 2px;
337
+    background-color: #666;
338
+    border-radius: 2px;
339
+    transform: rotate(45deg);
340
+  }
341
+
342
+  .dialog-close-rotate {
343
+    position: absolute;
344
+    transform: rotate(-45deg);
345
+  }
346
+
347
+  .uni-data-pickerview {
348
+    flex: 1;
349
+  }
350
+
351
+  .icon-clear {
352
+    display: flex;
353
+    align-items: center;
354
+  }
355
+
356
+  /* #ifdef H5 */
357
+  @media all and (min-width: 768px) {
358
+    .uni-data-tree-cover {
359
+      background-color: transparent;
360
+    }
361
+
362
+    .uni-data-tree-dialog {
363
+      position: absolute;
364
+      top: 55px;
365
+      height: auto;
366
+      min-height: 400px;
367
+      max-height: 50vh;
368
+      background-color: #fff;
369
+      border: 1px solid #EBEEF5;
370
+      box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
371
+      border-radius: 4px;
372
+      overflow: unset;
373
+    }
374
+
375
+    .dialog-caption {
376
+      display: none;
377
+    }
378
+  }
379
+  /* #endif */
380
+</style>

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 0
uni_modules/uni-data-picker/components/uni-data-pickerview/loading.uts


+ 693 - 0
uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-picker.uts

@@ -0,0 +1,693 @@
1
+export type PaginationType = {
2
+  current : number,
3
+  size : number,
4
+  count : number
5
+}
6
+
7
+export type LoadMoreType = {
8
+  contentdown : string,
9
+  contentrefresh : string,
10
+  contentnomore : string
11
+}
12
+
13
+export type SelectedItemType = {
14
+  name : string,
15
+  value : string,
16
+}
17
+
18
+export type GetCommandOptions = {
19
+  collection ?: UTSJSONObject,
20
+  field ?: string,
21
+  orderby ?: string,
22
+  where ?: any,
23
+  pageData ?: string,
24
+  pageCurrent ?: number,
25
+  pageSize ?: number,
26
+  getCount ?: boolean,
27
+  getTree ?: any,
28
+  getTreePath ?: UTSJSONObject,
29
+  startwith ?: string,
30
+  limitlevel ?: number,
31
+  groupby ?: string,
32
+  groupField ?: string,
33
+  distinct ?: boolean,
34
+  pageIndistinct ?: boolean,
35
+  foreignKey ?: string,
36
+  loadtime ?: string,
37
+  manual ?: boolean
38
+}
39
+
40
+const DefaultSelectedNode = {
41
+  text: '请选择',
42
+  value: ''
43
+}
44
+
45
+export const dataPicker = defineMixin({
46
+  props: {
47
+    localdata: {
48
+      type: Array as PropType<Array<UTSJSONObject>>,
49
+      default: [] as Array<UTSJSONObject>
50
+    },
51
+    collection: {
52
+      type: Object,
53
+      default: ''
54
+    },
55
+    field: {
56
+      type: String,
57
+      default: ''
58
+    },
59
+    orderby: {
60
+      type: String,
61
+      default: ''
62
+    },
63
+    where: {
64
+      type: Object,
65
+      default: ''
66
+    },
67
+    pageData: {
68
+      type: String,
69
+      default: 'add'
70
+    },
71
+    pageCurrent: {
72
+      type: Number,
73
+      default: 1
74
+    },
75
+    pageSize: {
76
+      type: Number,
77
+      default: 20
78
+    },
79
+    getcount: {
80
+      type: Boolean,
81
+      default: false
82
+    },
83
+    gettree: {
84
+      type: Object,
85
+      default: ''
86
+    },
87
+    gettreepath: {
88
+      type: Object,
89
+      default: ''
90
+    },
91
+    startwith: {
92
+      type: String,
93
+      default: ''
94
+    },
95
+    limitlevel: {
96
+      type: Number,
97
+      default: 10
98
+    },
99
+    groupby: {
100
+      type: String,
101
+      default: ''
102
+    },
103
+    groupField: {
104
+      type: String,
105
+      default: ''
106
+    },
107
+    distinct: {
108
+      type: Boolean,
109
+      default: false
110
+    },
111
+    pageIndistinct: {
112
+      type: Boolean,
113
+      default: false
114
+    },
115
+    foreignKey: {
116
+      type: String,
117
+      default: ''
118
+    },
119
+    loadtime: {
120
+      type: String,
121
+      default: 'auto'
122
+    },
123
+    manual: {
124
+      type: Boolean,
125
+      default: false
126
+    },
127
+    preload: {
128
+      type: Boolean,
129
+      default: false
130
+    },
131
+    stepSearh: {
132
+      type: Boolean,
133
+      default: true
134
+    },
135
+    selfField: {
136
+      type: String,
137
+      default: ''
138
+    },
139
+    parentField: {
140
+      type: String,
141
+      default: ''
142
+    },
143
+    multiple: {
144
+      type: Boolean,
145
+      default: false
146
+    },
147
+    value: {
148
+      type: Object,
149
+      default: ''
150
+    },
151
+    modelValue: {
152
+      type: Object,
153
+      default: ''
154
+    },
155
+    defaultProps: {
156
+      type: Object as PropType<UTSJSONObject>,
157
+    }
158
+  },
159
+  data() {
160
+    return {
161
+      loading: false,
162
+      error: null as UniCloudError | null,
163
+      treeData: [] as Array<UTSJSONObject>,
164
+      selectedIndex: 0,
165
+      selectedNodes: [] as Array<UTSJSONObject>,
166
+      selectedPages: [] as Array<UTSJSONObject>[],
167
+      selectedValue: '',
168
+      selectedPaths: [] as Array<UTSJSONObject>,
169
+      pagination: {
170
+        current: 1,
171
+        size: 20,
172
+        count: 0
173
+      } as PaginationType
174
+    }
175
+  },
176
+  computed: {
177
+    mappingTextName() : string {
178
+      // TODO
179
+      return (this.defaultProps != null) ? this.defaultProps!.getString('text', 'text') : 'text'
180
+    },
181
+    mappingValueName() : string {
182
+      // TODO
183
+      return (this.defaultProps != null) ? this.defaultProps!.getString('value', 'value') : 'value'
184
+    },
185
+    currentDataList() : Array<UTSJSONObject> {
186
+      if (this.selectedIndex > this.selectedPages.length - 1) {
187
+        return [] as Array<UTSJSONObject>
188
+      }
189
+      return this.selectedPages[this.selectedIndex]
190
+    },
191
+    isLocalData() : boolean {
192
+      return this.localdata.length > 0
193
+    },
194
+    isCloudData() : boolean {
195
+      return this._checkIsNotNull(this.collection)
196
+    },
197
+    isCloudDataList() : boolean {
198
+      return (this.isCloudData && (this.parentField.length == 0 && this.selfField.length == 0))
199
+    },
200
+    isCloudDataTree() : boolean {
201
+      return (this.isCloudData && this.parentField.length > 0 && this.selfField.length > 0)
202
+    },
203
+    dataValue() : any {
204
+      return this.hasModelValue ? this.modelValue : this.value
205
+    },
206
+    hasCloudTreeData() : boolean {
207
+      return this.treeData.length > 0
208
+    },
209
+    hasModelValue() : boolean {
210
+      if (typeof this.modelValue == 'string') {
211
+        const valueString = this.modelValue as string
212
+        return (valueString.length > 0)
213
+      } else if (Array.isArray(this.modelValue)) {
214
+        const valueArray = this.modelValue as Array<string>
215
+        return (valueArray.length > 0)
216
+      }
217
+      return false
218
+    },
219
+    hasCloudDataValue() : boolean {
220
+      if (typeof this.dataValue == 'string') {
221
+        const valueString = this.dataValue as string
222
+        return (valueString.length > 0)
223
+      }
224
+      return false
225
+    }
226
+  },
227
+  created() {
228
+    this.pagination.current = this.pageCurrent
229
+    this.pagination.size = this.pageSize
230
+
231
+    this.$watch(
232
+      () : any => [
233
+        this.pageCurrent,
234
+        this.pageSize,
235
+        this.localdata,
236
+        this.value,
237
+        this.collection,
238
+        this.field,
239
+        this.getcount,
240
+        this.orderby,
241
+        this.where,
242
+        this.groupby,
243
+        this.groupField,
244
+        this.distinct
245
+      ],
246
+      (newValue : Array<any>, oldValue : Array<any>) => {
247
+        this.pagination.size = this.pageSize
248
+        if (newValue[0] !== oldValue[0]) {
249
+          this.pagination.current = this.pageCurrent
250
+        }
251
+
252
+        this.onPropsChange()
253
+      }
254
+    )
255
+  },
256
+  methods: {
257
+    onPropsChange() {
258
+      this.selectedIndex = 0
259
+      this.treeData.length = 0
260
+      this.selectedNodes.length = 0
261
+      this.selectedPages.length = 0
262
+      this.selectedPaths.length = 0
263
+
264
+      // 加载数据
265
+      this.$nextTick(() => {
266
+        this.loadData()
267
+      })
268
+    },
269
+
270
+    onTabSelect(index : number) {
271
+      this.selectedIndex = index
272
+    },
273
+
274
+    onNodeClick(nodeData : UTSJSONObject) {
275
+      if (nodeData.getBoolean('disable', false)) {
276
+        return
277
+      }
278
+
279
+      const isLeaf = this._checkIsLeafNode(nodeData)
280
+
281
+      this._trimSelectedNodes(nodeData)
282
+
283
+      this.$emit('nodeclick', nodeData)
284
+
285
+      if (this.isLocalData) {
286
+        if (isLeaf || !this._checkHasChildren(nodeData)) {
287
+          this.onFinish()
288
+        }
289
+      } else if (this.isCloudDataList) {
290
+        this.onFinish()
291
+      } else if (this.isCloudDataTree) {
292
+        if (isLeaf) {
293
+          this.onFinish()
294
+        } else if (!this._checkHasChildren(nodeData)) {
295
+          // 尝试请求一次,如果没有返回数据标记为叶子节点
296
+          this.loadCloudDataNode(nodeData)
297
+        }
298
+      }
299
+    },
300
+
301
+    getChangeNodes(): Array<UTSJSONObject> {
302
+      const nodes: Array<UTSJSONObject> = []
303
+      this.selectedNodes.forEach((node : UTSJSONObject) => {
304
+        const newNode: UTSJSONObject = {}
305
+        newNode[this.mappingTextName] = node.getString(this.mappingTextName)
306
+        newNode[this.mappingValueName] = node.getString(this.mappingValueName)
307
+        nodes.push(newNode)
308
+      })
309
+      return nodes
310
+    },
311
+
312
+    onFinish() { },
313
+
314
+    // 加载数据(自动判定环境)
315
+    loadData() {
316
+      if (this.isLocalData) {
317
+        this.loadLocalData()
318
+      } else if (this.isCloudDataList) {
319
+        this.loadCloudDataList()
320
+      } else if (this.isCloudDataTree) {
321
+        this.loadCloudDataTree()
322
+      }
323
+    },
324
+
325
+    // 加载本地数据
326
+    loadLocalData() {
327
+      this.treeData = this.localdata
328
+      if (Array.isArray(this.dataValue)) {
329
+        const value = this.dataValue as Array<UTSJSONObject>
330
+        this.selectedPaths = value.slice(0)
331
+        this._pushSelectedTreeNodes(value, this.localdata)
332
+      } else {
333
+        this._pushSelectedNodes(this.localdata)
334
+      }
335
+    },
336
+
337
+    // 加载 Cloud 数据 (单列)
338
+    loadCloudDataList() {
339
+      this._loadCloudData(null, (data : Array<UTSJSONObject>) => {
340
+        this.treeData = data
341
+        this._pushSelectedNodes(data)
342
+      })
343
+    },
344
+
345
+    // 加载 Cloud 数据 (树形)
346
+    loadCloudDataTree() {
347
+      let commandOptions = {
348
+        field: this._cloudDataPostField(),
349
+        where: this._cloudDataTreeWhere(),
350
+        getTree: true
351
+      } as GetCommandOptions
352
+      if (this._checkIsNotNull(this.gettree)) {
353
+        commandOptions.startwith = `${this.selfField}=='${this.dataValue as string}'`
354
+      }
355
+      this._loadCloudData(commandOptions, (data : Array<UTSJSONObject>) => {
356
+        this.treeData = data
357
+        if (this.selectedPaths.length > 0) {
358
+          this._pushSelectedTreeNodes(this.selectedPaths, data)
359
+        } else {
360
+          this._pushSelectedNodes(data)
361
+        }
362
+      })
363
+    },
364
+
365
+    // 加载 Cloud 数据 (节点)
366
+    loadCloudDataNode(nodeData : UTSJSONObject) {
367
+      const commandOptions = {
368
+        field: this._cloudDataPostField(),
369
+        where: this._cloudDataNodeWhere()
370
+      } as GetCommandOptions
371
+      this._loadCloudData(commandOptions, (data : Array<UTSJSONObject>) => {
372
+        nodeData['children'] = data
373
+        if (data.length == 0) {
374
+          nodeData['isleaf'] = true
375
+          this.onFinish()
376
+        } else {
377
+          this._pushSelectedNodes(data)
378
+        }
379
+      })
380
+    },
381
+
382
+    // 回显 Cloud Tree Path
383
+    loadCloudDataPath() {
384
+      if (!this.hasCloudDataValue) {
385
+        return
386
+      }
387
+
388
+      const command : GetCommandOptions = {}
389
+
390
+      // 单列
391
+      if (this.isCloudDataList) {
392
+        // 根据 field's as value标识匹配 where 条件
393
+        let where : Array<string> = [];
394
+        let whereField = this._getForeignKeyByField();
395
+        if (whereField.length > 0) {
396
+          where.push(`${whereField} == '${this.dataValue as string}'`)
397
+        }
398
+
399
+        let whereString = where.join(' || ')
400
+        if (this._checkIsNotNull(this.where)) {
401
+          whereString = `(${this.where}) && (${whereString})`
402
+        }
403
+
404
+        command.field = this._cloudDataPostField()
405
+        command.where = whereString
406
+      }
407
+
408
+      // 树形
409
+      if (this.isCloudDataTree) {
410
+        command.field = this._cloudDataPostField()
411
+        command.getTreePath = {
412
+          startWith: `${this.selfField}=='${this.dataValue as string}'`
413
+        }
414
+      }
415
+
416
+      this._loadCloudData(command, (data : Array<UTSJSONObject>) => {
417
+        this._extractTreePath(data, this.selectedPaths)
418
+      })
419
+    },
420
+
421
+    _loadCloudData(options ?: GetCommandOptions, callback ?: ((data : Array<UTSJSONObject>) => void)) {
422
+      if (this.loading) {
423
+        return
424
+      }
425
+      this.loading = true
426
+
427
+      this.error = null
428
+
429
+      this._getCommand(options).then((response : UniCloudDBGetResult) => {
430
+        callback?.(response.data)
431
+      }).catch((err : any | null) => {
432
+        this.error = err as UniCloudError
433
+      }).finally(() => {
434
+        this.loading = false
435
+      })
436
+    },
437
+
438
+    _cloudDataPostField() : string {
439
+      let fields = [this.field];
440
+      if (this.parentField.length > 0) {
441
+        fields.push(`${this.parentField} as parent_value`)
442
+      }
443
+      return fields.join(',')
444
+    },
445
+
446
+    _cloudDataTreeWhere() : string {
447
+      let result : Array<string> = []
448
+      let selectedNodes = this.selectedNodes.length > 0 ? this.selectedNodes : this.selectedPaths
449
+      let parentField = this.parentField
450
+      if (parentField.length > 0) {
451
+        result.push(`${parentField} == null || ${parentField} == ""`)
452
+      }
453
+      if (selectedNodes.length > 0) {
454
+        for (var i = 0; i < selectedNodes.length - 1; i++) {
455
+          const parentFieldValue = selectedNodes[i].getString('value', '')
456
+          result.push(`${parentField} == '${parentFieldValue}'`)
457
+        }
458
+      }
459
+
460
+      let where : Array<string> = []
461
+      if (this._checkIsNotNull(this.where)) {
462
+        where.push(`(${this.where as string})`)
463
+      }
464
+
465
+      if (result.length > 0) {
466
+        where.push(`(${result.join(' || ')})`)
467
+      }
468
+
469
+      return where.join(' && ')
470
+    },
471
+
472
+    _cloudDataNodeWhere() : string {
473
+      const where : Array<string> = []
474
+      if (this.selectedNodes.length > 0) {
475
+        const value = this.selectedNodes[this.selectedNodes.length - 1].getString('value', '')
476
+        where.push(`${this.parentField} == '${value}'`)
477
+      }
478
+
479
+      let whereString = where.join(' || ')
480
+      if (this._checkIsNotNull(this.where)) {
481
+        return `(${this.where as string}) && (${whereString})`
482
+      }
483
+
484
+      return whereString
485
+    },
486
+
487
+    _getWhereByForeignKey() : string {
488
+      let result : Array<string> = []
489
+      let whereField = this._getForeignKeyByField();
490
+      if (whereField.length > 0) {
491
+        result.push(`${whereField} == '${this.dataValue as string}'`)
492
+      }
493
+
494
+      if (this._checkIsNotNull(this.where)) {
495
+        return `(${this.where}) && (${result.join(' || ')})`
496
+      }
497
+
498
+      return result.join(' || ')
499
+    },
500
+
501
+    _getForeignKeyByField() : string {
502
+      const fields = this.field.split(',')
503
+      let whereField = ''
504
+      for (let i = 0; i < fields.length; i++) {
505
+        const items = fields[i].split('as')
506
+        if (items.length < 2) {
507
+          continue
508
+        }
509
+        if (items[1].trim() === 'value') {
510
+          whereField = items[0].trim()
511
+          break
512
+        }
513
+      }
514
+      return whereField
515
+    },
516
+
517
+    _getCommand(options ?: GetCommandOptions) : Promise<UniCloudDBGetResult> {
518
+      let db = uniCloud.databaseForJQL()
519
+
520
+      let collection = Array.isArray(this.collection) ? db.collection(...(this.collection as Array<any>)) : db.collection(this.collection)
521
+
522
+      let filter : UniCloudDBFilter | null = null
523
+      if (this.foreignKey.length > 0) {
524
+        filter = collection.foreignKey(this.foreignKey)
525
+      }
526
+
527
+      const where : any = options?.where ?? this.where
528
+      if (typeof where == 'string') {
529
+        const whereString = where as string
530
+        if (whereString.length > 0) {
531
+          filter = (filter != null) ? filter.where(where) : collection.where(where)
532
+        }
533
+      } else {
534
+        filter = (filter != null) ? filter.where(where) : collection.where(where)
535
+      }
536
+
537
+      let query : UniCloudDBQuery | null = null
538
+      if (this.field.length > 0) {
539
+        query = (filter != null) ? filter.field(this.field) : collection.field(this.field)
540
+      }
541
+      if (this.groupby.length > 0) {
542
+        if (query != null) {
543
+          query = query.groupBy(this.groupby)
544
+        } else if (filter != null) {
545
+          query = filter.groupBy(this.groupby)
546
+        }
547
+      }
548
+      if (this.groupField.length > 0) {
549
+        if (query != null) {
550
+          query = query.groupField(this.groupField)
551
+        } else if (filter != null) {
552
+          query = filter.groupField(this.groupField)
553
+        }
554
+      }
555
+      if (this.distinct == true) {
556
+        if (query != null) {
557
+          query = query.distinct(this.field)
558
+        } else if (filter != null) {
559
+          query = filter.distinct(this.field)
560
+        }
561
+      }
562
+      if (this.orderby.length > 0) {
563
+        if (query != null) {
564
+          query = query.orderBy(this.orderby)
565
+        } else if (filter != null) {
566
+          query = filter.orderBy(this.orderby)
567
+        }
568
+      }
569
+
570
+      const size = this.pagination.size
571
+      const current = this.pagination.current
572
+      if (query != null) {
573
+        query = query.skip(size * (current - 1)).limit(size)
574
+      } else if (filter != null) {
575
+        query = filter.skip(size * (current - 1)).limit(size)
576
+      } else {
577
+        query = collection.skip(size * (current - 1)).limit(size)
578
+      }
579
+
580
+      const getOptions = {}
581
+      const treeOptions = {
582
+        limitLevel: this.limitlevel,
583
+        startWith: this.startwith
584
+      }
585
+      if (this.getcount == true) {
586
+        getOptions['getCount'] = this.getcount
587
+      }
588
+
589
+      const getTree : any = options?.getTree ?? this.gettree
590
+      if (typeof getTree == 'string') {
591
+        const getTreeString = getTree as string
592
+        if (getTreeString.length > 0) {
593
+          getOptions['getTree'] = treeOptions
594
+        }
595
+      } else if (typeof getTree == 'object') {
596
+        getOptions['getTree'] = treeOptions
597
+      } else {
598
+        getOptions['getTree'] = getTree
599
+      }
600
+
601
+      const getTreePath = options?.getTreePath ?? this.gettreepath
602
+      if (typeof getTreePath == 'string') {
603
+        const getTreePathString = getTreePath as string
604
+        if (getTreePathString.length > 0) {
605
+          getOptions['getTreePath'] = getTreePath
606
+        }
607
+      } else {
608
+        getOptions['getTreePath'] = getTreePath
609
+      }
610
+
611
+      return query.get(getOptions)
612
+    },
613
+
614
+    _checkIsNotNull(value : any) : boolean {
615
+      if (typeof value == 'string') {
616
+        const valueString = value as string
617
+        return (valueString.length > 0)
618
+      } else if (value instanceof UTSJSONObject) {
619
+        return true
620
+      }
621
+      return false
622
+    },
623
+
624
+    _checkIsLeafNode(nodeData : UTSJSONObject) : boolean {
625
+      if (this.selectedIndex >= this.limitlevel) {
626
+        return true
627
+      }
628
+
629
+      if (nodeData.getBoolean('isleaf', false)) {
630
+        return true
631
+      }
632
+
633
+      return false
634
+    },
635
+
636
+    _checkHasChildren(nodeData : UTSJSONObject) : boolean {
637
+      const children = nodeData.getArray('children') ?? ([] as Array<any>)
638
+      return children.length > 0
639
+    },
640
+
641
+    _pushSelectedNodes(nodes : Array<UTSJSONObject>) {
642
+      this.selectedNodes.push(DefaultSelectedNode)
643
+      this.selectedPages.push(nodes)
644
+      this.selectedIndex = this.selectedPages.length - 1
645
+    },
646
+
647
+    _trimSelectedNodes(nodeData : UTSJSONObject) {
648
+      this.selectedNodes.splice(this.selectedIndex)
649
+      this.selectedNodes.push(nodeData)
650
+
651
+      if (this.selectedPages.length > 0) {
652
+        this.selectedPages.splice(this.selectedIndex + 1)
653
+      }
654
+
655
+      const children = nodeData.getArray<UTSJSONObject>('children') ?? ([] as Array<UTSJSONObject>)
656
+      if (children.length > 0) {
657
+        this.selectedNodes.push(DefaultSelectedNode)
658
+        this.selectedPages.push(children)
659
+      }
660
+
661
+      this.selectedIndex = this.selectedPages.length - 1
662
+    },
663
+
664
+    _pushSelectedTreeNodes(paths : Array<UTSJSONObject>, nodes : Array<UTSJSONObject>) {
665
+      let children : Array<UTSJSONObject> = nodes
666
+      paths.forEach((node : UTSJSONObject) => {
667
+        const findNode = children.find((item : UTSJSONObject) : boolean => {
668
+          return (item.getString(this.mappingValueName) == node.getString(this.mappingValueName))
669
+        })
670
+        if (findNode != null) {
671
+          this.selectedPages.push(children)
672
+          this.selectedNodes.push(node)
673
+          children = findNode.getArray<UTSJSONObject>('children') ?? ([] as Array<UTSJSONObject>)
674
+        }
675
+      })
676
+      this.selectedIndex = this.selectedPages.length - 1
677
+    },
678
+
679
+    _extractTreePath(nodes : Array<UTSJSONObject>, result : Array<UTSJSONObject>) {
680
+      if (nodes.length == 0) {
681
+        return
682
+      }
683
+
684
+      const node = nodes[0]
685
+      result.push(node)
686
+
687
+      const children = node.getArray<UTSJSONObject>('children')
688
+      if (Array.isArray(children) && children!.length > 0) {
689
+        this._extractTreePath(children, result)
690
+      }
691
+    }
692
+  }
693
+})

+ 76 - 0
uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.css

@@ -0,0 +1,76 @@
1
+.uni-data-pickerview {
2
+  position: relative;
3
+  flex-direction: column;
4
+  overflow: hidden;
5
+}
6
+
7
+.loading-cover {
8
+  position: absolute;
9
+  left: 0;
10
+  top: 0;
11
+  right: 0;
12
+  bottom: 0;
13
+  align-items: center;
14
+  justify-content: center;
15
+  background-color: rgba(150, 150, 150, .1);
16
+}
17
+
18
+.error {
19
+  background-color: #fff;
20
+  padding: 15px;
21
+}
22
+
23
+.error-text {
24
+  color: #DD524D;
25
+}
26
+
27
+.selected-node-list {
28
+  flex-direction: row;
29
+  flex-wrap: nowrap;
30
+}
31
+
32
+.selected-node-item {
33
+  margin-left: 10px;
34
+  margin-right: 10px;
35
+  padding: 8px 10px 8px 10px;
36
+  border-bottom: 2px solid transparent;
37
+}
38
+
39
+.selected-node-item-active {
40
+  color: #007aff;
41
+  border-bottom-color: #007aff;
42
+}
43
+
44
+.list-view {
45
+  flex: 1;
46
+}
47
+
48
+.list-item {
49
+  flex-direction: row;
50
+  justify-content: space-between;
51
+  padding: 12px 15px;
52
+  border-bottom: 1px solid #f0f0f0;
53
+}
54
+
55
+.item-text {
56
+  color: #333333;
57
+}
58
+
59
+.item-text-disabled {
60
+  opacity: .5;
61
+}
62
+
63
+.item-text-overflow {
64
+  overflow: hidden;
65
+}
66
+
67
+.check {
68
+  margin-right: 5px;
69
+  border: 2px solid #007aff;
70
+  border-left: 0;
71
+  border-top: 0;
72
+  height: 12px;
73
+  width: 6px;
74
+  transform-origin: center;
75
+  transform: rotate(45deg);
76
+}

+ 69 - 0
uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.uvue

@@ -0,0 +1,69 @@
1
+<template>
2
+  <view class="uni-data-pickerview">
3
+    <view v-if="error!=null" class="error">
4
+      <text class="error-text">{{error!.errMsg}}</text>
5
+    </view>
6
+    <scroll-view v-if="!isCloudDataList" :scroll-x="true">
7
+      <view class="selected-node-list">
8
+        <template v-for="(item, index) in selectedNodes">
9
+          <text class="selected-node-item" :class="{'selected-node-item-active':index==selectedIndex}"
10
+            @click="onTabSelect(index)">
11
+            {{item[mappingTextName]}}
12
+          </text>
13
+        </template>
14
+      </view>
15
+    </scroll-view>
16
+    <list-view class="list-view" :scroll-y="true">
17
+      <list-item class="list-item" v-for="(item, _) in currentDataList" @click="onNodeClick(item)">
18
+        <text class="item-text" :class="{'item-text-disabled': item['disable']}">{{item[mappingTextName]}}</text>
19
+        <text class="check" v-if="item[mappingValueName] == selectedNodes[selectedIndex][mappingValueName]"></text>
20
+      </list-item>
21
+    </list-view>
22
+    <view class="loading-cover" v-if="loading">
23
+      <slot name="pickerview-loading" :loading="loading"></slot>
24
+    </view>
25
+  </view>
26
+</template>
27
+
28
+<script>
29
+  import { dataPicker } from "./uni-data-picker.uts"
30
+
31
+  /**
32
+   * DataPickerview
33
+   * @description uni-data-pickerview
34
+   * @tutorial https://ext.dcloud.net.cn/plugin?id=3796
35
+   * @property {Array} localdata 本地数据,参考
36
+   * @property {Boolean} step-searh = [true|false] 是否分布查询
37
+   * @value true 启用分布查询,仅查询当前选中节点
38
+   * @value false 关闭分布查询,一次查询出所有数据
39
+   * @property {String|DBFieldString} self-field 分布查询当前字段名称
40
+   * @property {String|DBFieldString} parent-field 分布查询父字段名称
41
+   * @property {String|DBCollectionString} collection 表名
42
+   * @property {String|DBFieldString} field 查询字段,多个字段用 `,` 分割
43
+   * @property {String} orderby 排序字段及正序倒叙设置
44
+   * @property {String|JQLString} where 查询条件
45
+   */
46
+  export default {
47
+    name: 'UniDataPickerView',
48
+    emits: ['nodeclick', 'change', 'update:modelValue'],
49
+    mixins: [dataPicker],
50
+    props: {
51
+      ellipsis: {
52
+        type: Boolean,
53
+        default: true
54
+      }
55
+    },
56
+    created() {
57
+      this.loadData()
58
+    },
59
+    methods: {
60
+      onFinish() {
61
+        this.$emit('change', this.getChangeNodes())
62
+      }
63
+    }
64
+  }
65
+</script>
66
+
67
+<style>
68
+  @import url("uni-data-pickerview.css");
69
+</style>

+ 4 - 3
uni_modules/uni-data-picker/package.json

@@ -1,7 +1,7 @@
1 1
 {
2 2
   "id": "uni-data-picker",
3 3
   "displayName": "uni-data-picker 数据驱动的picker选择器",
4
-  "version": "1.1.2",
4
+  "version": "2.0.0",
5 5
   "description": "单列、多列级联选择器,常用于省市区城市选择、公司部门选择、多级分类等场景",
6 6
   "keywords": [
7 7
     "uni-ui",
@@ -53,7 +53,8 @@
53 53
       "client": {
54 54
         "App": {
55 55
           "app-vue": "y",
56
-          "app-nvue": "u"
56
+          "app-nvue": "y",
57
+          "app-uvue": "y"
57 58
         },
58 59
         "H5-mobile": {
59 60
           "Safari": "y",
@@ -87,4 +88,4 @@
87 88
       }
88 89
     }
89 90
   }
90
-}
91
+}

+ 1 - 1
uni_modules/uni-data-picker/readme.md

@@ -19,4 +19,4 @@
19 19
 在uniCloud数据表中新建表“uni-id-address”和“opendb-city-china”,这2个表的schema自带foreignKey关联。在“uni-id-address”表的表结构页面使用schema2code生成前端页面,会自动生成地址管理的维护页面,自动从“opendb-city-china”表包含的中国所有省市区信息里选择地址。
20 20
 
21 21
 ### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-data-picker)
22
-#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 
22
+#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839

+ 4 - 0
uni_modules/uni-data-select/changelog.md

@@ -1,3 +1,7 @@
1
+## 1.0.8(2024-03-28)
2
+- 修复 在vue2下:style动态绑定导致编译失败的bug
3
+## 1.0.7(2024-01-20)
4
+- 修复 长文本回显超过容器的bug,超过容器部分显示省略号
1 5
 ## 1.0.6(2023-04-12)
2 6
 - 修复 微信小程序点击时会改变背景颜色的 bug
3 7
 ## 1.0.5(2023-02-03)

+ 77 - 32
uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue

@@ -4,18 +4,18 @@
4 4
 		<view class="uni-stat-box" :class="{'uni-stat__actived': current}">
5 5
 			<view class="uni-select" :class="{'uni-select--disabled':disabled}">
6 6
 				<view class="uni-select__input-box" @click="toggleSelector">
7
-					<view v-if="current" class="uni-select__input-text">{{current}}</view>
7
+					<view v-if="current" class="uni-select__input-text">{{textShow}}</view>
8 8
 					<view v-else class="uni-select__input-text uni-select__input-placeholder">{{typePlaceholder}}</view>
9
-					<view v-if="current && clear && !disabled" @click.stop="clearVal" >
10
-						<uni-icons type="clear" color="#c0c4cc" size="24"/>
9
+					<view v-if="current && clear && !disabled" @click.stop="clearVal">
10
+						<uni-icons type="clear" color="#c0c4cc" size="24" />
11 11
 					</view>
12 12
 					<view v-else>
13 13
 						<uni-icons :type="showSelector? 'top' : 'bottom'" size="14" color="#999" />
14 14
 					</view>
15 15
 				</view>
16 16
 				<view class="uni-select--mask" v-if="showSelector" @click="toggleSelector" />
17
-				<view class="uni-select__selector" v-if="showSelector">
18
-					<view class="uni-popper__arrow"></view>
17
+				<view class="uni-select__selector" :style="getOffsetByPlacement" v-if="showSelector">
18
+					<view :class="placement=='bottom'?'uni-popper__arrow_bottom':'uni-popper__arrow_top'"></view>
19 19
 					<scroll-view scroll-y="true" class="uni-select__selector-scroll">
20 20
 						<view class="uni-select__selector-empty" v-if="mixinDatacomResData.length === 0">
21 21
 							<text>{{emptyTips}}</text>
@@ -43,6 +43,9 @@
43 43
 	 * @property {String} label 左侧标题
44 44
 	 * @property {String} placeholder 输入框的提示文字
45 45
 	 * @property {Boolean} disabled 是否禁用
46
+	 * @property {String} placement 弹出位置
47
+	 * 	@value top   		顶部弹出
48
+	 * 	@value bottom		底部弹出(default)
46 49
 	 * @event {Function} change  选中发生变化触发
47 50
 	 */
48 51
 
@@ -93,6 +96,10 @@
93 96
 				type: String,
94 97
 				default: ''
95 98
 			},
99
+			placement: {
100
+				type: String,
101
+				default: 'bottom'
102
+			}
96 103
 		},
97 104
 		data() {
98 105
 			return {
@@ -125,15 +132,32 @@
125 132
 					common + placeholder :
126 133
 					common
127 134
 			},
128
-			valueCom(){
135
+			valueCom() {
129 136
 				// #ifdef VUE3
130 137
 				return this.modelValue;
131 138
 				// #endif
132 139
 				// #ifndef VUE3
133 140
 				return this.value;
134 141
 				// #endif
142
+			},
143
+			textShow() {
144
+				// 长文本显示
145
+				let text = this.current;
146
+				if (text.length > 10) {
147
+					return text.slice(0, 25) + '...';
148
+				}
149
+				return text;
150
+			},
151
+			getOffsetByPlacement() {
152
+				switch (this.placement) {
153
+					case 'top':
154
+						return "bottom:calc(100% + 12px);";
155
+					case 'bottom':
156
+						return "top:calc(100% + 12px);";
157
+				}
135 158
 			}
136 159
 		},
160
+
137 161
 		watch: {
138 162
 			localdata: {
139 163
 				immediate: true,
@@ -153,10 +177,11 @@
153 177
 						this.initDefVal()
154 178
 					}
155 179
 				}
156
-			}
180
+			},
181
+
157 182
 		},
158 183
 		methods: {
159
-			debounce(fn, time = 100){
184
+			debounce(fn, time = 100) {
160 185
 				let timer = null
161 186
 				return function(...args) {
162 187
 					if (timer) clearTimeout(timer)
@@ -166,11 +191,11 @@
166 191
 				}
167 192
 			},
168 193
 			// 执行数据库查询
169
-			query(){
194
+			query() {
170 195
 				this.mixinDatacomEasyGet();
171 196
 			},
172 197
 			// 监听查询条件变更事件
173
-			onMixinDatacomPropsChange(){
198
+			onMixinDatacomPropsChange() {
174 199
 				if (this.collection) {
175 200
 					this.debounceGet();
176 201
 				}
@@ -193,9 +218,9 @@
193 218
 						}
194 219
 						defValue = defItem
195 220
 					}
196
-          if (defValue || defValue === 0) {
197
-					  this.emit(defValue)
198
-          }
221
+					if (defValue || defValue === 0) {
222
+						this.emit(defValue)
223
+					}
199 224
 				}
200 225
 				const def = this.mixinDatacomResData.find(item => item.value === defValue)
201 226
 				this.current = def ? this.formatItemName(def) : ''
@@ -258,7 +283,7 @@
258 283
 					let str = "";
259 284
 					str = this.format;
260 285
 					for (let key in item) {
261
-						str = str.replace(new RegExp(`{${key}}`,"g"),item[key]);
286
+						str = str.replace(new RegExp(`{${key}}`, "g"), item[key]);
262 287
 					}
263 288
 					return str;
264 289
 				} else {
@@ -272,26 +297,26 @@
272 297
 				}
273 298
 			},
274 299
 			// 获取当前加载的数据
275
-			getLoadData(){
300
+			getLoadData() {
276 301
 				return this.mixinDatacomResData;
277 302
 			},
278 303
 			// 获取当前缓存key
279
-			getCurrentCacheKey(){
304
+			getCurrentCacheKey() {
280 305
 				return this.collection;
281 306
 			},
282 307
 			// 获取缓存
283
-			getCache(name=this.getCurrentCacheKey()){
308
+			getCache(name = this.getCurrentCacheKey()) {
284 309
 				let cacheData = uni.getStorageSync(this.cacheKey) || {};
285 310
 				return cacheData[name];
286 311
 			},
287 312
 			// 设置缓存
288
-			setCache(value, name=this.getCurrentCacheKey()){
313
+			setCache(value, name = this.getCurrentCacheKey()) {
289 314
 				let cacheData = uni.getStorageSync(this.cacheKey) || {};
290 315
 				cacheData[name] = value;
291 316
 				uni.setStorageSync(this.cacheKey, cacheData);
292 317
 			},
293 318
 			// 删除缓存
294
-			removeCache(name=this.getCurrentCacheKey()){
319
+			removeCache(name = this.getCurrentCacheKey()) {
295 320
 				let cacheData = uni.getStorageSync(this.cacheKey) || {};
296 321
 				delete cacheData[name];
297 322
 				uni.setStorageSync(this.cacheKey, cacheData);
@@ -306,7 +331,6 @@
306 331
 	$uni-secondary-color: #909399 !default;
307 332
 	$uni-border-3: #e5e5e5;
308 333
 
309
-
310 334
 	/* #ifndef APP-NVUE */
311 335
 	@media screen and (max-width: 500px) {
312 336
 		.hide-on-phone {
@@ -407,7 +431,6 @@
407 431
 		box-sizing: border-box;
408 432
 		/* #endif */
409 433
 		position: absolute;
410
-		top: calc(100% + 12px);
411 434
 		left: 0;
412 435
 		width: 100%;
413 436
 		background-color: #FFFFFF;
@@ -431,6 +454,7 @@
431 454
 			max-height: 600px;
432 455
 		}
433 456
 	}
457
+
434 458
 	/* #endif */
435 459
 
436 460
 	.uni-select__selector-empty,
@@ -463,18 +487,21 @@
463 487
 	}
464 488
 
465 489
 	/* picker 弹出层通用的指示小三角 */
466
-	.uni-popper__arrow,
467
-	.uni-popper__arrow::after {
468
-		position: absolute;
469
-		display: block;
470
-		width: 0;
471
-		height: 0;
472
-		border-color: transparent;
473
-		border-style: solid;
474
-		border-width: 6px;
490
+	.uni-popper__arrow_bottom,
491
+	.uni-popper__arrow_bottom::after,
492
+	.uni-popper__arrow_top,
493
+	.uni-popper__arrow_top::after,
494
+	{
495
+	position: absolute;
496
+	display: block;
497
+	width: 0;
498
+	height: 0;
499
+	border-color: transparent;
500
+	border-style: solid;
501
+	border-width: 6px;
475 502
 	}
476 503
 
477
-	.uni-popper__arrow {
504
+	.uni-popper__arrow_bottom {
478 505
 		filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
479 506
 		top: -6px;
480 507
 		left: 10%;
@@ -483,7 +510,7 @@
483 510
 		border-bottom-color: #EBEEF5;
484 511
 	}
485 512
 
486
-	.uni-popper__arrow::after {
513
+	.uni-popper__arrow_bottom::after {
487 514
 		content: " ";
488 515
 		top: 1px;
489 516
 		margin-left: -6px;
@@ -491,6 +518,24 @@
491 518
 		border-bottom-color: #fff;
492 519
 	}
493 520
 
521
+	.uni-popper__arrow_top {
522
+		filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
523
+		bottom: -6px;
524
+		left: 10%;
525
+		margin-right: 3px;
526
+		border-bottom-width: 0;
527
+		border-top-color: #EBEEF5;
528
+	}
529
+
530
+	.uni-popper__arrow_top::after {
531
+		content: " ";
532
+		bottom: 1px;
533
+		margin-left: -6px;
534
+		border-bottom-width: 0;
535
+		border-top-color: #fff;
536
+	}
537
+
538
+
494 539
 	.uni-select__input-text {
495 540
 		// width: 280px;
496 541
 		width: 100%;

+ 3 - 2
uni_modules/uni-data-select/package.json

@@ -1,7 +1,7 @@
1 1
 {
2 2
   "id": "uni-data-select",
3 3
   "displayName": "uni-data-select 下拉框选择器",
4
-  "version": "1.0.6",
4
+  "version": "1.0.8",
5 5
   "description": "通过数据驱动的下拉框选择器",
6 6
   "keywords": [
7 7
     "uni-ui",
@@ -43,7 +43,8 @@
43 43
     "platforms": {
44 44
       "cloud": {
45 45
         "tcb": "y",
46
-        "aliyun": "y"
46
+        "aliyun": "y",
47
+        "alipay": "n"
47 48
       },
48 49
       "client": {
49 50
         "App": {

+ 30 - 3
uni_modules/uni-datetime-picker/changelog.md

@@ -1,13 +1,40 @@
1
+## 2.2.34(2024-04-24)
2
+- 新增 日期点击事件,在点击日期时会触发该事件。
3
+## 2.2.33(2024-04-15)
4
+- 修复 抖音小程序事件传递失效bug
5
+## 2.2.32(2024-02-20)
6
+- 修复 日历的close事件触发异常的bug [详情](https://github.com/dcloudio/uni-ui/issues/844)
7
+## 2.2.31(2024-02-20)
8
+- 修复 h5平台 右边日历的月份默认+1的bug [详情](https://github.com/dcloudio/uni-ui/issues/841)
9
+## 2.2.30(2024-01-31)
10
+- 修复 隐藏“秒”时,在IOS15及以下版本时出现 结束时间在开始时间之前 的bug [详情](https://github.com/dcloudio/uni-ui/issues/788)
11
+## 2.2.29(2024-01-20)
12
+- 新增 show事件,弹窗弹出时触发该事件 [详情](https://github.com/dcloudio/uni-app/issues/4694)
13
+## 2.2.28(2024-01-18)
14
+- 去除 noChange事件,当进行日期范围选择时,若只选了一天,则开始结束日期都为同一天 [详情](https://github.com/dcloudio/uni-ui/issues/815)
15
+## 2.2.27(2024-01-10)
16
+- 优化 增加noChange事件,当进行日期范围选择时,若有空值,则触发该事件 [详情](https://github.com/dcloudio/uni-ui/issues/815)
17
+## 2.2.26(2024-01-08)
18
+- 修复 字节小程序时间选择范围器失效问题 [详情](https://github.com/dcloudio/uni-ui/issues/834)
19
+## 2.2.25(2023-10-18)
20
+- 修复 PC端初次修改时间,开始时间未更新的Bug [详情](https://github.com/dcloudio/uni-ui/issues/737)
21
+## 2.2.24(2023-06-02)
22
+- 修复 部分情况修改时间,开始、结束时间显示异常的Bug [详情](https://ask.dcloud.net.cn/question/171146)
23
+- 优化 当前月可以选择上月、下月的日期的Bug
24
+## 2.2.23(2023-05-02)
25
+- 修复 部分情况修改时间,开始时间未更新的Bug [详情](https://github.com/dcloudio/uni-ui/issues/737)
26
+- 修复 部分平台及设备第一次点击无法显示弹框的Bug
27
+- 修复 ios 日期格式未补零显示及使用异常的Bug [详情](https://ask.dcloud.net.cn/question/162979)
1 28
 ## 2.2.22(2023-03-30)
2
-- 修复 日历 picker 修改年月后,自动选中当月1日 [详情](https://ask.dcloud.net.cn/question/165937)
3
-- 修复 小程序端 低版本 ios NaN [详情](https://ask.dcloud.net.cn/question/162979)
29
+- 修复 日历 picker 修改年月后,自动选中当月1日的Bug [详情](https://ask.dcloud.net.cn/question/165937)
30
+- 修复 小程序端 低版本 ios NaN的Bug [详情](https://ask.dcloud.net.cn/question/162979)
4 31
 ## 2.2.21(2023-02-20)
5 32
 - 修复 firefox 浏览器显示区域点击无法拉起日历弹框的Bug [详情](https://ask.dcloud.net.cn/question/163362)
6 33
 ## 2.2.20(2023-02-17)
7 34
 - 优化 值为空依然选中当天问题
8 35
 - 优化 提供 default-value 属性支持配置选择器打开时默认显示的时间
9 36
 - 优化 非范围选择未选择日期时间,点击确认按钮选中当前日期时间
10
-- 优化 字节小程序日期时间范围选择,底部日期换行问题
37
+- 优化 字节小程序日期时间范围选择,底部日期换行的Bug
11 38
 ## 2.2.19(2023-02-09)
12 39
 - 修复 2.2.18 引起范围选择配置 end 选择无效的Bug [详情](https://github.com/dcloudio/uni-ui/issues/686)
13 40
 ## 2.2.18(2023-02-08)

+ 91 - 72
uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue

@@ -21,7 +21,7 @@
21 21
 					<view class="uni-calendar__header-btn uni-calendar--right"></view>
22 22
 				</view>
23 23
 
24
-				<view v-if="!insert" class="dialog-close" @click="close">
24
+				<view v-if="!insert" class="dialog-close" @click="maskClick">
25 25
 					<view class="dialog-close-plus" data-id="close"></view>
26 26
 					<view class="dialog-close-plus dialog-close-rotate" data-id="close"></view>
27 27
 				</view>
@@ -58,9 +58,8 @@
58 58
 
59 59
 				<view class="uni-calendar__weeks" v-for="(item,weekIndex) in weeks" :key="weekIndex">
60 60
 					<view class="uni-calendar__weeks-item" v-for="(weeks,weeksIndex) in item" :key="weeksIndex">
61
-						<calendar-item class="uni-calendar-item--hook" :weeks="weeks" :calendar="calendar"
62
-							:selected="selected" :checkHover="range" @change="choiceDate"
63
-							@handleMouse="handleMouse">
61
+						<calendar-item class="uni-calendar-item--hook" :weeks="weeks" :calendar="calendar" :selected="selected"
62
+							:checkHover="range" @change="choiceDate" @handleMouse="handleMouse">
64 63
 						</calendar-item>
65 64
 					</view>
66 65
 				</view>
@@ -101,13 +100,21 @@
101 100
 </template>
102 101
 
103 102
 <script>
104
-	import { Calendar, getDate, getTime } from './util.js';
103
+	import {
104
+		Calendar,
105
+		getDate,
106
+		getTime
107
+	} from './util.js';
105 108
 	import calendarItem from './calendar-item.vue'
106 109
 	import timePicker from './time-picker.vue'
107 110
 
108
-	import { initVueI18n } from '@dcloudio/uni-i18n'
111
+	import {
112
+		initVueI18n
113
+	} from '@dcloudio/uni-i18n'
109 114
 	import i18nMessages from './i18n/index.js'
110
-	const { t } = initVueI18n(i18nMessages)
115
+	const {
116
+		t
117
+	} = initVueI18n(i18nMessages)
111 118
 
112 119
 	/**
113 120
 	 * Calendar 日历
@@ -134,6 +141,15 @@
134 141
 			calendarItem,
135 142
 			timePicker
136 143
 		},
144
+
145
+		options: {
146
+			// #ifdef MP-TOUTIAO
147
+			virtualHost: false,
148
+			// #endif
149
+			// #ifndef MP-TOUTIAO
150
+			virtualHost: true
151
+			// #endif
152
+		},
137 153
 		props: {
138 154
 			date: {
139 155
 				type: String,
@@ -163,8 +179,8 @@
163 179
 				type: String,
164 180
 				default: ''
165 181
 			},
166
-      startPlaceholder: {
167
-        type: String,
182
+			startPlaceholder: {
183
+				type: String,
168 184
 				default: ''
169 185
 			},
170 186
 			endPlaceholder: {
@@ -210,10 +226,10 @@
210 226
 					}
211 227
 				}
212 228
 			},
213
-      defaultValue: {
214
-        type: [String, Object, Array],
215
-        default: ''
216
-      }
229
+			defaultValue: {
230
+				type: [String, Object, Array],
231
+				default: ''
232
+			}
217 233
 		},
218 234
 		data() {
219 235
 			return {
@@ -260,7 +276,7 @@
260 276
 			},
261 277
 			startDate(val) {
262 278
 				// 字节小程序 watch 早于 created
263
-				if(!this.cale){
279
+				if (!this.cale) {
264 280
 					return
265 281
 				}
266 282
 				this.cale.setStartDate(val)
@@ -269,7 +285,7 @@
269 285
 			},
270 286
 			endDate(val) {
271 287
 				// 字节小程序 watch 早于 created
272
-				if(!this.cale){
288
+				if (!this.cale) {
273 289
 					return
274 290
 				}
275 291
 				this.cale.setEndDate(val)
@@ -278,7 +294,7 @@
278 294
 			},
279 295
 			selected(newVal) {
280 296
 				// 字节小程序 watch 早于 created
281
-				if(!this.cale){
297
+				if (!this.cale) {
282 298
 					return
283 299
 				}
284 300
 				this.cale.setSelectInfo(this.nowDate.fullDate, newVal)
@@ -309,16 +325,16 @@
309 325
 								this.cale.lastHover = false
310 326
 							}
311 327
 						} else {
312
-              // 字节小程序 watch 早于 created
313
-              if(!this.cale){
314
-                return
315
-              }
328
+							// 字节小程序 watch 早于 created
329
+							if (!this.cale) {
330
+								return
331
+							}
316 332
 
317 333
 							this.cale.setDefaultMultiple(before, after)
318 334
 							if (which === 'left' && before) {
319 335
 								this.setDate(before)
320 336
 								this.weeks = this.cale.weeks
321
-							} else if(after) {
337
+							} else if (after) {
322 338
 								this.setDate(after)
323 339
 								this.weeks = this.cale.weeks
324 340
 							}
@@ -423,7 +439,7 @@
423 439
 			},
424 440
 			// 蒙版点击事件
425 441
 			maskClick() {
426
-        this.close()
442
+				this.close()
427 443
 				this.$emit('maskClose')
428 444
 			},
429 445
 
@@ -454,36 +470,38 @@
454 470
 			 * @param {Object} date
455 471
 			 */
456 472
 			init(date) {
457
-        // 字节小程序 watch 早于 created
458
-				if(!this.cale){
473
+				// 字节小程序 watch 早于 created
474
+				if (!this.cale) {
459 475
 					return
460 476
 				}
461 477
 				this.cale.setDate(date || new Date())
462 478
 				this.weeks = this.cale.weeks
463 479
 				this.nowDate = this.cale.getInfo(date)
464
-        this.calendar = {...this.nowDate}
465
-        if(!date){
466
-          // 优化date为空默认不选中今天
467
-          this.calendar.fullDate = ''
468
-          if(this.defaultValue && !this.range){
469
-            // 暂时只支持移动端非范围选择
470
-            const defaultDate = new Date(this.defaultValue)
471
-            const fullDate = getDate(defaultDate)
472
-            const year = defaultDate.getFullYear()
473
-            const month = defaultDate.getMonth()+1
474
-            const date = defaultDate.getDate()
475
-            const day = defaultDate.getDay()
476
-            this.calendar = {
477
-              fullDate,
478
-              year,
479
-              month,
480
-              date,
481
-              day
482
-            },
483
-            this.tempSingleDate = fullDate
484
-            this.time = getTime(defaultDate, this.hideSecond)
485
-          }
486
-        }
480
+				this.calendar = {
481
+					...this.nowDate
482
+				}
483
+				if (!date) {
484
+					// 优化date为空默认不选中今天
485
+					this.calendar.fullDate = ''
486
+					if (this.defaultValue && !this.range) {
487
+						// 暂时只支持移动端非范围选择
488
+						const defaultDate = new Date(this.defaultValue)
489
+						const fullDate = getDate(defaultDate)
490
+						const year = defaultDate.getFullYear()
491
+						const month = defaultDate.getMonth() + 1
492
+						const date = defaultDate.getDate()
493
+						const day = defaultDate.getDay()
494
+						this.calendar = {
495
+								fullDate,
496
+								year,
497
+								month,
498
+								date,
499
+								day
500
+							},
501
+							this.tempSingleDate = fullDate
502
+						this.time = getTime(defaultDate, this.hideSecond)
503
+					}
504
+				}
487 505
 			},
488 506
 			/**
489 507
 			 * 打开日历弹窗
@@ -523,8 +541,8 @@
523 541
 			/**
524 542
 			 * 变化触发
525 543
 			 */
526
-			change() {
527
-				if (!this.insert) return
544
+			change(isSingleChange) {
545
+				if (!this.insert && !isSingleChange) return
528 546
 				this.setEmit('change')
529 547
 			},
530 548
 			/**
@@ -545,13 +563,13 @@
545 563
 			 * @param {Object} name
546 564
 			 */
547 565
 			setEmit(name) {
548
-        if(!this.range){
549
-					if(!this.calendar.fullDate){
550
-					  this.calendar = this.cale.getInfo(new Date())
551
-					  this.tempSingleDate = this.calendar.fullDate
566
+				if (!this.range) {
567
+					if (!this.calendar.fullDate) {
568
+						this.calendar = this.cale.getInfo(new Date())
569
+						this.tempSingleDate = this.calendar.fullDate
552 570
 					}
553
-					if(this.hasTime && !this.time) {
554
-					  this.time = getTime(new Date(), this.hideSecond)
571
+					if (this.hasTime && !this.time) {
572
+						this.time = getTime(new Date(), this.hideSecond)
555 573
 					}
556 574
 				}
557 575
 				let {
@@ -593,19 +611,19 @@
593 611
 					this.tempRange.before = this.cale.multipleStatus.before
594 612
 					this.tempRange.after = this.cale.multipleStatus.after
595 613
 				}
596
-				this.change()
597
-			},
598
-      changeMonth(type) {
599
-        let newDate
600
-        if(type === 'pre') {
601
-          newDate = this.cale.getPreMonthObj(this.nowDate.fullDate).fullDate
602
-        } else if(type === 'next') {
603
-          newDate = this.cale.getNextMonthObj(this.nowDate.fullDate).fullDate
604
-        }
614
+				this.change(true)
615
+			},
616
+			changeMonth(type) {
617
+				let newDate
618
+				if (type === 'pre') {
619
+					newDate = this.cale.getPreMonthObj(this.nowDate.fullDate).fullDate
620
+				} else if (type === 'next') {
621
+					newDate = this.cale.getNextMonthObj(this.nowDate.fullDate).fullDate
622
+				}
605 623
 
606
-        this.setDate(newDate)
624
+				this.setDate(newDate)
607 625
 				this.monthSwitch()
608
-      },
626
+			},
609 627
 			/**
610 628
 			 * 设置日期
611 629
 			 * @param {Object} date
@@ -619,7 +637,7 @@
619 637
 	}
620 638
 </script>
621 639
 
622
-<style lang="scss" >
640
+<style lang="scss">
623 641
 	$uni-primary: #007aff !default;
624 642
 
625 643
 	.uni-calendar {
@@ -855,17 +873,17 @@
855 873
 
856 874
 	.uni-date-changed--time-end {
857 875
 		/* #ifndef APP-NVUE */
858
-    display: flex;
876
+		display: flex;
859 877
 		/* #endif */
860 878
 		align-items: center;
861 879
 	}
862 880
 
863 881
 	.uni-date-changed--time-date {
864
-    color: #999;
882
+		color: #999;
865 883
 		line-height: 50px;
866
-    /* #ifdef MP-TOUTIAO */
867
-    font-size: 16px;
868
-    /* #endif */
884
+		/* #ifdef MP-TOUTIAO */
885
+		font-size: 16px;
886
+		/* #endif */
869 887
 		margin-right: 5px;
870 888
 		// opacity: 0.6;
871 889
 	}
@@ -924,5 +942,6 @@
924 942
 	.uni-datetime-picker--btn:active {
925 943
 		opacity: 0.7;
926 944
 	}
945
+
927 946
 	/* #endif */
928 947
 </style>

+ 22 - 16
uni_modules/uni-datetime-picker/components/uni-datetime-picker/time-picker.vue

@@ -81,10 +81,16 @@
81 81
 </template>
82 82
 
83 83
 <script>
84
-	import { initVueI18n } from '@dcloudio/uni-i18n'
84
+	import {
85
+		initVueI18n
86
+	} from '@dcloudio/uni-i18n'
85 87
 	import i18nMessages from './i18n/index.js'
86
-	const {	t	} = initVueI18n(i18nMessages)
87
-  import { fixIosDateFormat } from './util'
88
+	const {
89
+		t
90
+	} = initVueI18n(i18nMessages)
91
+	import {
92
+		fixIosDateFormat
93
+	} from './util'
88 94
 
89 95
 	/**
90 96
 	 * DatetimePicker 时间选择器
@@ -134,6 +140,14 @@
134 140
 				endSecond: 59,
135 141
 			}
136 142
 		},
143
+		options: {
144
+			// #ifdef MP-TOUTIAO
145
+			virtualHost: false,
146
+			// #endif
147
+			// #ifndef MP-TOUTIAO
148
+			virtualHost: true
149
+			// #endif
150
+		},
137 151
 		props: {
138 152
 			type: {
139 153
 				type: String,
@@ -176,11 +190,11 @@
176 190
 			// #ifndef VUE3
177 191
 			value: {
178 192
 				handler(newVal) {
179
-          if (newVal) {
180
-            this.parseValue(fixIosDateFormat(newVal))
193
+					if (newVal) {
194
+						this.parseValue(fixIosDateFormat(newVal))
181 195
 						this.initTime(false)
182 196
 					} else {
183
-            this.time = ''
197
+						this.time = ''
184 198
 						this.parseValue(Date.now())
185 199
 					}
186 200
 				},
@@ -189,8 +203,8 @@
189 203
 			// #endif
190 204
 			// #ifdef VUE3
191 205
 			modelValue: {
192
-        handler(newVal) {
193
-          if (newVal) {
206
+				handler(newVal) {
207
+					if (newVal) {
194 208
 						this.parseValue(fixIosDateFormat(newVal))
195 209
 						this.initTime(false)
196 210
 					} else {
@@ -649,14 +663,6 @@
649 663
 				return new Date(year, month, 0).getDate();
650 664
 			},
651 665
 
652
-			//兼容 iOS、safari 日期格式
653
-			fixIosDateFormat(value) {
654
-				if (typeof value === 'string') {
655
-					value = value.replace(/-/g, '/')
656
-				}
657
-				return value
658
-			},
659
-
660 666
 			/**
661 667
 			 * 生成时间戳
662 668
 			 * @param {Object} time

+ 226 - 195
uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue

@@ -2,22 +2,20 @@
2 2
 	<view class="uni-date">
3 3
 		<view class="uni-date-editor" @click="show">
4 4
 			<slot>
5
-				<view
6
-          class="uni-date-editor--x"
7
-          :class="{'uni-date-editor--x__disabled': disabled,'uni-date-x--border': border}"
8
-        >
5
+				<view class="uni-date-editor--x"
6
+					:class="{'uni-date-editor--x__disabled': disabled,'uni-date-x--border': border}">
9 7
 					<view v-if="!isRange" class="uni-date-x uni-date-single">
10 8
 						<uni-icons class="icon-calendar" type="calendar" color="#c0c4cc" size="22"></uni-icons>
11 9
 						<view class="uni-date__x-input">{{ displayValue || singlePlaceholderText }}</view>
12 10
 					</view>
13 11
 
14 12
 					<view v-else class="uni-date-x uni-date-range">
15
-            <uni-icons class="icon-calendar" type="calendar" color="#c0c4cc" size="22"></uni-icons>
16
-            <view class="uni-date__x-input text-center">{{ displayRangeValue.startDate || startPlaceholderText }}</view>
13
+						<uni-icons class="icon-calendar" type="calendar" color="#c0c4cc" size="22"></uni-icons>
14
+						<view class="uni-date__x-input text-center">{{ displayRangeValue.startDate || startPlaceholderText }}</view>
17 15
 
18
-            <view class="range-separator">{{rangeSeparator}}</view>
16
+						<view class="range-separator">{{rangeSeparator}}</view>
19 17
 
20
-            <view class="uni-date__x-input text-center">{{ displayRangeValue.endDate || endPlaceholderText }}</view>
18
+						<view class="uni-date__x-input text-center">{{ displayRangeValue.endDate || endPlaceholderText }}</view>
21 19
 					</view>
22 20
 
23 21
 					<view v-if="showClearIcon" class="uni-date__icon-clear" @click.stop="clear">
@@ -34,8 +32,7 @@
34 32
 				<view class="uni-popper__arrow"></view>
35 33
 
36 34
 				<view v-if="hasTime" class="uni-date-changed popup-x-header">
37
-					<input class="uni-date__input text-center" type="text" v-model="inputDate"
38
-						:placeholder="selectDateText" />
35
+					<input class="uni-date__input text-center" type="text" v-model="inputDate" :placeholder="selectDateText" />
39 36
 
40 37
 					<time-picker type="time" v-model="pickerTime" :border="false" :disabled="!inputDate"
41 38
 						:start="timepickerStartTime" :end="timepickerEndTime" :hideSecond="hideSecond" style="width: 100%;">
@@ -45,8 +42,7 @@
45 42
 				</view>
46 43
 
47 44
 				<Calendar ref="pcSingle" :showMonth="false" :start-date="calendarRange.startDate"
48
-					:end-date="calendarRange.endDate" :date="calendarDate" @change="singleChange"
49
-          :default-value="defaultValue"
45
+					:end-date="calendarRange.endDate" :date="calendarDate" @change="singleChange" :default-value="defaultValue"
50 46
 					style="padding: 0 8px;" />
51 47
 
52 48
 				<view v-if="hasTime" class="popup-x-footer">
@@ -58,18 +54,17 @@
58 54
 				<view class="uni-popper__arrow"></view>
59 55
 				<view v-if="hasTime" class="popup-x-header uni-date-changed">
60 56
 					<view class="popup-x-header--datetime">
61
-            <input class="uni-date__input uni-date-range__input" type="text" v-model="tempRange.startDate"
62
-            :placeholder="startDateText" />
57
+						<input class="uni-date__input uni-date-range__input" type="text" v-model="tempRange.startDate"
58
+							:placeholder="startDateText" />
63 59
 
64 60
 						<time-picker type="time" v-model="tempRange.startTime" :start="timepickerStartTime" :border="false"
65
-            :disabled="!tempRange.startDate" :hideSecond="hideSecond">
66
-            <input class="uni-date__input uni-date-range__input" type="text"
67
-            v-model="tempRange.startTime" :placeholder="startTimeText"
68
-            :disabled="!tempRange.startDate" />
69
-          </time-picker>
70
-        </view>
61
+							:disabled="!tempRange.startDate" :hideSecond="hideSecond">
62
+							<input class="uni-date__input uni-date-range__input" type="text" v-model="tempRange.startTime"
63
+								:placeholder="startTimeText" :disabled="!tempRange.startDate" />
64
+						</time-picker>
65
+					</view>
71 66
 
72
-        <uni-icons type="arrowthinright" color="#999" style="line-height: 40px;"></uni-icons>
67
+					<uni-icons type="arrowthinright" color="#999" style="line-height: 40px;"></uni-icons>
73 68
 
74 69
 					<view class="popup-x-header--datetime">
75 70
 						<input class="uni-date__input uni-date-range__input" type="text" v-model="tempRange.endDate"
@@ -85,12 +80,11 @@
85 80
 
86 81
 				<view class="popup-x-body">
87 82
 					<Calendar ref="left" :showMonth="false" :start-date="calendarRange.startDate"
88
-            :end-date="calendarRange.endDate" :range="true" :pleStatus="endMultipleStatus"
89
-            @change="leftChange" @firstEnterCale="updateRightCale" style="padding: 0 8px;" />
83
+						:end-date="calendarRange.endDate" :range="true" :pleStatus="endMultipleStatus" @change="leftChange"
84
+						@firstEnterCale="updateRightCale" style="padding: 0 8px;"/>
90 85
 					<Calendar ref="right" :showMonth="false" :start-date="calendarRange.startDate"
91
-						:end-date="calendarRange.endDate" :range="true" @change="rightChange"
92
-						:pleStatus="startMultipleStatus" @firstEnterCale="updateLeftCale"
93
-						style="padding: 0 8px;border-left: 1px solid #F1F1F1;" />
86
+						:end-date="calendarRange.endDate" :range="true" @change="rightChange" :pleStatus="startMultipleStatus"
87
+						@firstEnterCale="updateLeftCale" style="padding: 0 8px;border-left: 1px solid #F1F1F1;" />
94 88
 				</view>
95 89
 
96 90
 				<view v-if="hasTime" class="popup-x-footer">
@@ -102,10 +96,9 @@
102 96
 
103 97
 		<Calendar v-if="isPhone" ref="mobile" :clearDate="false" :date="calendarDate" :defTime="mobileCalendarTime"
104 98
 			:start-date="calendarRange.startDate" :end-date="calendarRange.endDate" :selectableTimes="mobSelectableTime"
105
-      :startPlaceholder="startPlaceholder" :endPlaceholder="endPlaceholder"
106
-      :default-value="defaultValue"
99
+			:startPlaceholder="startPlaceholder" :endPlaceholder="endPlaceholder" :default-value="defaultValue"
107 100
 			:pleStatus="endMultipleStatus" :showMonth="false" :range="isRange" :hasTime="hasTime" :insert="false"
108
-			:hideSecond="hideSecond" @confirm="mobileChange" @maskClose="close" />
101
+			:hideSecond="hideSecond" @confirm="mobileChange" @maskClose="close" @change="calendarClick"/>
109 102
 	</view>
110 103
 </template>
111 104
 <script>
@@ -133,14 +126,30 @@
133 126
 	 **/
134 127
 	import Calendar from './calendar.vue'
135 128
 	import TimePicker from './time-picker.vue'
136
-	import { initVueI18n } from '@dcloudio/uni-i18n'
129
+	import {
130
+		initVueI18n
131
+	} from '@dcloudio/uni-i18n'
137 132
 	import i18nMessages from './i18n/index.js'
138
-  import { getDateTime, getDate, getTime, getDefaultSecond, dateCompare, checkDate, fixIosDateFormat } from './util'
133
+	import {
134
+		getDateTime,
135
+		getDate,
136
+		getTime,
137
+		getDefaultSecond,
138
+		dateCompare,
139
+		checkDate,
140
+		fixIosDateFormat
141
+	} from './util'
139 142
 
140 143
 	export default {
141 144
 		name: 'UniDatetimePicker',
145
+
142 146
 		options: {
147
+			// #ifdef MP-TOUTIAO
148
+			virtualHost: false,
149
+			// #endif
150
+			// #ifndef MP-TOUTIAO
143 151
 			virtualHost: true
152
+			// #endif
144 153
 		},
145 154
 		components: {
146 155
 			Calendar,
@@ -188,7 +197,7 @@
188 197
 				isEmitValue: false,
189 198
 				isPhone: false,
190 199
 				isFirstShow: true,
191
-        i18nT: () => {}
200
+				i18nT: () => {}
192 201
 			}
193 202
 		},
194 203
 		props: {
@@ -221,7 +230,7 @@
221 230
 				default: ''
222 231
 			},
223 232
 			startPlaceholder: {
224
-        type: String,
233
+				type: String,
225 234
 				default: ''
226 235
 			},
227 236
 			endPlaceholder: {
@@ -248,16 +257,16 @@
248 257
 				type: [Boolean],
249 258
 				default: false
250 259
 			},
251
-      defaultValue: {
252
-        type: [String, Object, Array],
253
-        default: ''
254
-      }
260
+			defaultValue: {
261
+				type: [String, Object, Array],
262
+				default: ''
263
+			}
255 264
 		},
256 265
 		watch: {
257 266
 			type: {
258 267
 				immediate: true,
259 268
 				handler(newVal) {
260
-          this.hasTime = newVal.indexOf('time') !== -1
269
+					this.hasTime = newVal.indexOf('time') !== -1
261 270
 					this.isRange = newVal.indexOf('range') !== -1
262 271
 				}
263 272
 			},
@@ -348,9 +357,9 @@
348 357
 			selectDateText() {
349 358
 				return this.i18nT("uni-datetime-picker.selectDate")
350 359
 			},
351
-      selectDateTimeText() {
352
-        return this.i18nT("uni-datetime-picker.selectDateTime")
353
-      },
360
+			selectDateTimeText() {
361
+				return this.i18nT("uni-datetime-picker.selectDateTime")
362
+			},
354 363
 			selectTimeText() {
355 364
 				return this.i18nT("uni-datetime-picker.selectTime")
356 365
 			},
@@ -373,18 +382,19 @@
373 382
 				return this.i18nT("uni-datetime-picker.clear")
374 383
 			},
375 384
 			showClearIcon() {
376
-				return this.clearIcon && !this.disabled && (this.displayValue || (this.displayRangeValue.startDate && this.displayRangeValue.endDate))
385
+				return this.clearIcon && !this.disabled && (this.displayValue || (this.displayRangeValue.startDate && this
386
+					.displayRangeValue.endDate))
377 387
 			}
378 388
 		},
379 389
 		created() {
380 390
 			this.initI18nT()
381
-      this.platform()
391
+			this.platform()
382 392
 		},
383 393
 		methods: {
384
-      initI18nT() {
385
-        const vueI18n = initVueI18n(i18nMessages)
386
-        this.i18nT = vueI18n.t
387
-      },
394
+			initI18nT() {
395
+				const vueI18n = initVueI18n(i18nMessages)
396
+				this.i18nT = vueI18n.t
397
+			},
388 398
 			initPicker(newVal) {
389 399
 				if ((!newVal && !this.defaultValue) || Array.isArray(newVal) && !newVal.length) {
390 400
 					this.$nextTick(() => {
@@ -394,26 +404,26 @@
394 404
 				}
395 405
 
396 406
 				if (!Array.isArray(newVal) && !this.isRange) {
397
-          if(newVal){
398
-            this.displayValue = this.inputDate = this.calendarDate = getDate(newVal)
399
-            if (this.hasTime) {
400
-              this.pickerTime = getTime(newVal, this.hideSecond)
401
-              this.displayValue = `${this.displayValue} ${this.pickerTime}`
402
-            }
403
-          }else if(this.defaultValue){
404
-            this.inputDate = this.calendarDate = getDate(this.defaultValue)
405
-            if(this.hasTime){
406
-              this.pickerTime = getTime(this.defaultValue, this.hideSecond)
407
-            }
408
-          }
407
+					if (newVal) {
408
+						this.displayValue = this.inputDate = this.calendarDate = getDate(newVal)
409
+						if (this.hasTime) {
410
+							this.pickerTime = getTime(newVal, this.hideSecond)
411
+							this.displayValue = `${this.displayValue} ${this.pickerTime}`
412
+						}
413
+					} else if (this.defaultValue) {
414
+						this.inputDate = this.calendarDate = getDate(this.defaultValue)
415
+						if (this.hasTime) {
416
+							this.pickerTime = getTime(this.defaultValue, this.hideSecond)
417
+						}
418
+					}
409 419
 				} else {
410 420
 					const [before, after] = newVal
411 421
 					if (!before && !after) return
412
-          const beforeDate = getDate(before)
413
-          const beforeTime = getTime(before, this.hideSecond)
422
+					const beforeDate = getDate(before)
423
+					const beforeTime = getTime(before, this.hideSecond)
414 424
 
415
-          const afterDate = getDate(after)
416
-          const afterTime = getTime(after, this.hideSecond)
425
+					const afterDate = getDate(after)
426
+					const afterTime = getTime(after, this.hideSecond)
417 427
 					const startDate = beforeDate
418 428
 					const endDate = afterDate
419 429
 					this.displayRangeValue.startDate = this.tempRange.startDate = startDate
@@ -450,17 +460,26 @@
450 460
 				right.setDate(this.$refs.right.nowDate.fullDate)
451 461
 			},
452 462
 			platform() {
453
-				const { windowWidth } = uni.getSystemInfoSync()
463
+				if (typeof navigator !== "undefined") {
464
+					this.isPhone = navigator.userAgent.toLowerCase().indexOf('mobile') !== -1
465
+					return
466
+				}
467
+				const {
468
+					windowWidth
469
+				} = uni.getSystemInfoSync()
454 470
 				this.isPhone = windowWidth <= 500
455 471
 				this.windowWidth = windowWidth
456 472
 			},
457 473
 			show() {
474
+				this.$emit("show")
458 475
 				if (this.disabled) {
459 476
 					return
460 477
 				}
461 478
 				this.platform()
462 479
 				if (this.isPhone) {
463
-					this.$refs.mobile.open()
480
+					setTimeout(() => {
481
+						this.$refs.mobile.open()
482
+					}, 0);
464 483
 					return
465 484
 				}
466 485
 				this.pickerPositionStyle = {
@@ -485,8 +504,10 @@
485 504
 								this.$refs.right.changeMonth('pre')
486 505
 							}
487 506
 						} else {
488
-							this.$refs.right.changeMonth('next')
489
-							this.$refs.right.cale.lastHover = false
507
+							// this.$refs.right.changeMonth('next')
508
+							if (this.isPhone) {
509
+								this.$refs.right.cale.lastHover = false;
510
+							}
490 511
 						}
491 512
 					}
492 513
 
@@ -538,52 +559,52 @@
538 559
 				this.confirmSingleChange()
539 560
 			},
540 561
 			confirmSingleChange() {
541
-        if(!checkDate(this.inputDate)){
562
+				if (!checkDate(this.inputDate)) {
542 563
 					const now = new Date()
543
-          this.calendarDate = this.inputDate = getDate(now)
564
+					this.calendarDate = this.inputDate = getDate(now)
544 565
 					this.pickerTime = getTime(now, this.hideSecond)
545
-        }
546
-
547
-        let startLaterInputDate = false
548
-        let startDate, startTime
549
-        if(this.start) {
550
-          let startString = this.start
551
-          if(typeof this.start === 'number'){
552
-            startString = getDateTime(this.start, this.hideSecond)
553
-          }
554
-          [startDate, startTime] = startString.split(' ')
555
-          if(this.start && !dateCompare(startDate, this.inputDate)) {
556
-            startLaterInputDate = true
557
-            this.inputDate = startDate
558
-          }
559
-        }
560
-
561
-        let endEarlierInputDate = false
562
-        let endDate, endTime
563
-        if(this.end) {
564
-          let endString = this.end
565
-          if(typeof this.end === 'number'){
566
-            endString = getDateTime(this.end, this.hideSecond)
567
-          }
568
-          [endDate, endTime] = endString.split(' ')
569
-          if(this.end && !dateCompare(this.inputDate, endDate)) {
570
-            endEarlierInputDate = true
571
-            this.inputDate = endDate
572
-          }
573
-        }
566
+				}
567
+
568
+				let startLaterInputDate = false
569
+				let startDate, startTime
570
+				if (this.start) {
571
+					let startString = this.start
572
+					if (typeof this.start === 'number') {
573
+						startString = getDateTime(this.start, this.hideSecond)
574
+					}
575
+					[startDate, startTime] = startString.split(' ')
576
+					if (this.start && !dateCompare(startDate, this.inputDate)) {
577
+						startLaterInputDate = true
578
+						this.inputDate = startDate
579
+					}
580
+				}
581
+
582
+				let endEarlierInputDate = false
583
+				let endDate, endTime
584
+				if (this.end) {
585
+					let endString = this.end
586
+					if (typeof this.end === 'number') {
587
+						endString = getDateTime(this.end, this.hideSecond)
588
+					}
589
+					[endDate, endTime] = endString.split(' ')
590
+					if (this.end && !dateCompare(this.inputDate, endDate)) {
591
+						endEarlierInputDate = true
592
+						this.inputDate = endDate
593
+					}
594
+				}
574 595
 				if (this.hasTime) {
575
-          if(startLaterInputDate){
576
-            this.pickerTime = startTime || getDefaultSecond(this.hideSecond)
577
-          }
578
-          if(endEarlierInputDate){
579
-            this.pickerTime = endTime || getDefaultSecond(this.hideSecond)
580
-          }
581
-          if(!this.pickerTime){
582
-            this.pickerTime = getTime(Date.now(), this.hideSecond)
583
-          }
596
+					if (startLaterInputDate) {
597
+						this.pickerTime = startTime || getDefaultSecond(this.hideSecond)
598
+					}
599
+					if (endEarlierInputDate) {
600
+						this.pickerTime = endTime || getDefaultSecond(this.hideSecond)
601
+					}
602
+					if (!this.pickerTime) {
603
+						this.pickerTime = getTime(Date.now(), this.hideSecond)
604
+					}
584 605
 					this.displayValue = `${this.inputDate} ${this.pickerTime}`
585 606
 				} else {
586
-          this.displayValue = this.inputDate
607
+					this.displayValue = this.inputDate
587 608
 				}
588 609
 				this.setEmit(this.displayValue)
589 610
 				this.pickerVisible = false
@@ -601,6 +622,7 @@
601 622
 					fulldate: e.fulldate
602 623
 				}
603 624
 				this.startMultipleStatus = Object.assign({}, this.startMultipleStatus, obj)
625
+				this.$emit('calendarClick', e)
604 626
 			},
605 627
 			rightChange(e) {
606 628
 				const {
@@ -615,14 +637,17 @@
615 637
 					fulldate: e.fulldate
616 638
 				}
617 639
 				this.endMultipleStatus = Object.assign({}, this.endMultipleStatus, obj)
640
+				this.$emit('calendarClick', e)
618 641
 			},
619 642
 			mobileChange(e) {
620 643
 				if (this.isRange) {
621
-					const {before, after} = e.range
622
-
623
-          if(!before || !after){
624
-            return
625
-          }
644
+					const {
645
+						before,
646
+						after
647
+					} = e.range
648
+					if (!before) {
649
+						return;
650
+					}
626 651
 
627 652
 					this.handleStartAndEnd(before, after, true)
628 653
 					if (this.hasTime) {
@@ -655,79 +680,79 @@
655 680
 					this.pickerVisible = false
656 681
 					return
657 682
 				}
658
-        if(!checkDate(this.tempRange.startDate)){
659
-          this.tempRange.startDate = getDate(Date.now())
660
-        }
661
-        if(!checkDate(this.tempRange.endDate)){
662
-          this.tempRange.endDate = getDate(Date.now())
663
-        }
683
+				if (!checkDate(this.tempRange.startDate)) {
684
+					this.tempRange.startDate = getDate(Date.now())
685
+				}
686
+				if (!checkDate(this.tempRange.endDate)) {
687
+					this.tempRange.endDate = getDate(Date.now())
688
+				}
664 689
 
665 690
 				let start, end
666 691
 
667
-        let startDateLaterRangeStartDate = false
668
-        let startDateLaterRangeEndDate = false
669
-        let startDate, startTime
670
-        if(this.start) {
671
-          let startString = this.start
672
-          if(typeof this.start === 'number'){
673
-            startString = getDateTime(this.start, this.hideSecond)
674
-          }
675
-          [startDate,startTime] = startString.split(' ')
676
-          if(this.start && !dateCompare(this.start, this.tempRange.startDate)) {
677
-            startDateLaterRangeStartDate = true
678
-            this.tempRange.startDate = startDate
679
-          }
680
-          if(this.start && !dateCompare(this.start, this.tempRange.endDate)) {
681
-            startDateLaterRangeEndDate = true
682
-            this.tempRange.endDate = startDate
683
-          }
684
-        }
685
-        let endDateEarlierRangeStartDate = false
686
-        let endDateEarlierRangeEndDate = false
687
-        let endDate, endTime
688
-        if(this.end) {
689
-          let endString = this.end
690
-          if(typeof this.end === 'number'){
691
-            endString = getDateTime(this.end, this.hideSecond)
692
-          }
693
-          [endDate,endTime] = endString.split(' ')
694
-
695
-          if(this.end && !dateCompare(this.tempRange.startDate, this.end)) {
696
-            endDateEarlierRangeStartDate = true
697
-            this.tempRange.startDate = endDate
698
-          }
699
-          if(this.end && !dateCompare(this.tempRange.endDate, this.end)) {
700
-            endDateEarlierRangeEndDate = true
701
-            this.tempRange.endDate = endDate
702
-          }
703
-        }
692
+				let startDateLaterRangeStartDate = false
693
+				let startDateLaterRangeEndDate = false
694
+				let startDate, startTime
695
+				if (this.start) {
696
+					let startString = this.start
697
+					if (typeof this.start === 'number') {
698
+						startString = getDateTime(this.start, this.hideSecond)
699
+					}
700
+					[startDate, startTime] = startString.split(' ')
701
+					if (this.start && !dateCompare(this.start, this.tempRange.startDate)) {
702
+						startDateLaterRangeStartDate = true
703
+						this.tempRange.startDate = startDate
704
+					}
705
+					if (this.start && !dateCompare(this.start, this.tempRange.endDate)) {
706
+						startDateLaterRangeEndDate = true
707
+						this.tempRange.endDate = startDate
708
+					}
709
+				}
710
+				let endDateEarlierRangeStartDate = false
711
+				let endDateEarlierRangeEndDate = false
712
+				let endDate, endTime
713
+				if (this.end) {
714
+					let endString = this.end
715
+					if (typeof this.end === 'number') {
716
+						endString = getDateTime(this.end, this.hideSecond)
717
+					}
718
+					[endDate, endTime] = endString.split(' ')
719
+
720
+					if (this.end && !dateCompare(this.tempRange.startDate, this.end)) {
721
+						endDateEarlierRangeStartDate = true
722
+						this.tempRange.startDate = endDate
723
+					}
724
+					if (this.end && !dateCompare(this.tempRange.endDate, this.end)) {
725
+						endDateEarlierRangeEndDate = true
726
+						this.tempRange.endDate = endDate
727
+					}
728
+				}
704 729
 				if (!this.hasTime) {
705
-          start = this.displayRangeValue.startDate = this.tempRange.startDate
730
+					start = this.displayRangeValue.startDate = this.tempRange.startDate
706 731
 					end = this.displayRangeValue.endDate = this.tempRange.endDate
707 732
 				} else {
708
-          if(startDateLaterRangeStartDate){
709
-            this.tempRange.startTime = startTime || getDefaultSecond(this.hideSecond)
710
-          }else if(endDateEarlierRangeStartDate){
711
-            this.tempRange.startTime = endTime || getDefaultSecond(this.hideSecond)
712
-          }
713
-          if(!this.tempRange.startTime){
714
-            this.tempRange.startTime = getTime(Date.now(), this.hideSecond)
715
-          }
716
-
717
-          if(startDateLaterRangeEndDate){
718
-            this.tempRange.endTime = startTime || getDefaultSecond(this.hideSecond)
719
-          }else if(endDateEarlierRangeEndDate){
720
-            this.tempRange.endTime = endTime || getDefaultSecond(this.hideSecond)
721
-          }
722
-          if(!this.tempRange.endTime){
723
-            this.tempRange.endTime = getTime(Date.now(), this.hideSecond)
724
-          }
733
+					if (startDateLaterRangeStartDate) {
734
+						this.tempRange.startTime = startTime || getDefaultSecond(this.hideSecond)
735
+					} else if (endDateEarlierRangeStartDate) {
736
+						this.tempRange.startTime = endTime || getDefaultSecond(this.hideSecond)
737
+					}
738
+					if (!this.tempRange.startTime) {
739
+						this.tempRange.startTime = getTime(Date.now(), this.hideSecond)
740
+					}
741
+
742
+					if (startDateLaterRangeEndDate) {
743
+						this.tempRange.endTime = startTime || getDefaultSecond(this.hideSecond)
744
+					} else if (endDateEarlierRangeEndDate) {
745
+						this.tempRange.endTime = endTime || getDefaultSecond(this.hideSecond)
746
+					}
747
+					if (!this.tempRange.endTime) {
748
+						this.tempRange.endTime = getTime(Date.now(), this.hideSecond)
749
+					}
725 750
 					start = this.displayRangeValue.startDate = `${this.tempRange.startDate} ${this.tempRange.startTime}`
726 751
 					end = this.displayRangeValue.endDate = `${this.tempRange.endDate} ${this.tempRange.endTime}`
727 752
 				}
728
-        if(!dateCompare(start,end)){
729
-          [start, end] = [end, start]
730
-        }
753
+				if (!dateCompare(start, end)) {
754
+					[start, end] = [end, start]
755
+				}
731 756
 				this.displayRangeValue.startDate = start
732 757
 				this.displayRangeValue.endDate = end
733 758
 				const displayRange = [start, end]
@@ -735,13 +760,13 @@
735 760
 				this.pickerVisible = false
736 761
 			},
737 762
 			handleStartAndEnd(before, after, temp = false) {
738
-				if (!(before && after)) return
739
-
763
+				if (!before) return
764
+				if (!after) after = before;
740 765
 				const type = temp ? 'tempRange' : 'range'
741
-        const isStartEarlierEnd = dateCompare(before, after)
742
-        this[type].startDate = isStartEarlierEnd ? before : after
743
-        this[type].endDate = isStartEarlierEnd ? after : before
744
-    },
766
+				const isStartEarlierEnd = dateCompare(before, after)
767
+				this[type].startDate = isStartEarlierEnd ? before : after
768
+				this[type].endDate = isStartEarlierEnd ? after : before
769
+			},
745 770
 			/**
746 771
 			 * 比较时间大小
747 772
 			 */
@@ -800,6 +825,10 @@
800 825
 						this.$emit('update:modelValue', [])
801 826
 					}
802 827
 				}
828
+			},
829
+
830
+			calendarClick(e) {
831
+				this.$emit('calendarClick', e)
803 832
 			}
804 833
 		}
805 834
 	}
@@ -812,6 +841,7 @@
812 841
 		width: 100%;
813 842
 		flex: 1;
814 843
 	}
844
+
815 845
 	.uni-date-x {
816 846
 		display: flex;
817 847
 		flex-direction: row;
@@ -823,16 +853,17 @@
823 853
 		font-size: 14px;
824 854
 		flex: 1;
825 855
 
826
-    .icon-calendar{
827
-      padding-left: 3px;
828
-    }
829
-    .range-separator{
830
-      height: 35px;
831
-      /* #ifndef MP */
832
-      padding: 0 2px;
833
-      /* #endif */
856
+		.icon-calendar {
857
+			padding-left: 3px;
858
+		}
859
+
860
+		.range-separator {
861
+			height: 35px;
862
+			/* #ifndef MP */
863
+			padding: 0 2px;
864
+			/* #endif */
834 865
 			line-height: 35px;
835
-    }
866
+		}
836 867
 	}
837 868
 
838 869
 	.uni-date-x--border {
@@ -859,9 +890,9 @@
859 890
 	.uni-date__x-input {
860 891
 		width: auto;
861 892
 		height: 35px;
862
-    /* #ifndef MP */
863
-    padding-left: 5px;
864
-    /* #endif */
893
+		/* #ifndef MP */
894
+		padding-left: 5px;
895
+		/* #endif */
865 896
 		position: relative;
866 897
 		flex: 1;
867 898
 		line-height: 35px;

+ 101 - 83
uni_modules/uni-datetime-picker/components/uni-datetime-picker/util.js

@@ -13,7 +13,7 @@ class Calendar {
13 13
 		this.startDate = startDate
14 14
 		// 终止时间
15 15
 		this.endDate = endDate
16
-    // 是否范围选择
16
+		// 是否范围选择
17 17
 		this.range = range
18 18
 		// 多选状态
19 19
 		this.cleanMultipleStatus()
@@ -49,44 +49,44 @@ class Calendar {
49 49
 		this.endDate = endDate
50 50
 	}
51 51
 
52
-  getPreMonthObj(date){
53
-    date = fixIosDateFormat(date)
54
-    date = new Date(date)
55
-
56
-    const oldMonth = date.getMonth()
57
-    date.setMonth(oldMonth - 1)
58
-    const newMonth = date.getMonth()
59
-    if(oldMonth !== 0 && newMonth - oldMonth === 0){
60
-      date.setMonth(newMonth - 1)
61
-    }
62
-    return this.getDateObj(date)
63
-  }
64
-  getNextMonthObj(date){
65
-    date = fixIosDateFormat(date)
66
-    date = new Date(date)
67
-
68
-    const oldMonth = date.getMonth()
69
-    date.setMonth(oldMonth + 1)
70
-    const newMonth = date.getMonth()
71
-    if(newMonth - oldMonth > 1){
72
-      date.setMonth(newMonth - 1)
73
-    }
74
-    return this.getDateObj(date)
75
-  }
52
+	getPreMonthObj(date) {
53
+		date = fixIosDateFormat(date)
54
+		date = new Date(date)
55
+
56
+		const oldMonth = date.getMonth()
57
+		date.setMonth(oldMonth - 1)
58
+		const newMonth = date.getMonth()
59
+		if (oldMonth !== 0 && newMonth - oldMonth === 0) {
60
+			date.setMonth(newMonth - 1)
61
+		}
62
+		return this.getDateObj(date)
63
+	}
64
+	getNextMonthObj(date) {
65
+		date = fixIosDateFormat(date)
66
+		date = new Date(date)
67
+
68
+		const oldMonth = date.getMonth()
69
+		date.setMonth(oldMonth + 1)
70
+		const newMonth = date.getMonth()
71
+		if (newMonth - oldMonth > 1) {
72
+			date.setMonth(newMonth - 1)
73
+		}
74
+		return this.getDateObj(date)
75
+	}
76 76
 
77 77
 	/**
78 78
 	 * 获取指定格式Date对象
79 79
 	 */
80 80
 	getDateObj(date) {
81
-    date = fixIosDateFormat(date)
82
-    date = new Date(date)
81
+		date = fixIosDateFormat(date)
82
+		date = new Date(date)
83 83
 
84 84
 		return {
85 85
 			fullDate: getDate(date),
86
-      year: date.getFullYear(),
87
-      month: addZero(date.getMonth() + 1),
88
-      date: addZero(date.getDate()),
89
-      day: date.getDay()
86
+			year: date.getFullYear(),
87
+			month: addZero(date.getMonth() + 1),
88
+			date: addZero(date.getDate()),
89
+			day: date.getDay()
90 90
 		}
91 91
 	}
92 92
 
@@ -96,7 +96,7 @@ class Calendar {
96 96
 	getPreMonthDays(amount, dateObj) {
97 97
 		const result = []
98 98
 		for (let i = amount - 1; i >= 0; i--) {
99
-      const month = dateObj.month - 1
99
+			const month = dateObj.month - 1
100 100
 			result.push({
101 101
 				date: new Date(dateObj.year, month, -i).getDate(),
102 102
 				month,
@@ -135,11 +135,11 @@ class Calendar {
135 135
 			let multiples = this.multipleStatus.data
136 136
 			let multiplesStatus = -1
137 137
 			if (this.range && multiples) {
138
-        multiplesStatus = multiples.findIndex((item) => {
139
-          return this.dateEqual(item, currentDate)
140
-        })
138
+				multiplesStatus = multiples.findIndex((item) => {
139
+					return this.dateEqual(item, currentDate)
140
+				})
141 141
 			}
142
-      const checked = multiplesStatus !== -1
142
+			const checked = multiplesStatus !== -1
143 143
 
144 144
 			result.push({
145 145
 				fullDate: currentDate,
@@ -149,10 +149,11 @@ class Calendar {
149 149
 				beforeMultiple: this.isLogicBefore(currentDate, this.multipleStatus.before, this.multipleStatus.after),
150 150
 				afterMultiple: this.isLogicAfter(currentDate, this.multipleStatus.before, this.multipleStatus.after),
151 151
 				month: dateObj.month,
152
-				disable: (this.startDate && !dateCompare(this.startDate, currentDate)) || (this.endDate && !dateCompare(currentDate,this.endDate)),
152
+				disable: (this.startDate && !dateCompare(this.startDate, currentDate)) || (this.endDate && !dateCompare(
153
+					currentDate, this.endDate)),
153 154
 				isToday,
154 155
 				userChecked: false,
155
-        extraInfo: info
156
+				extraInfo: info
156 157
 			})
157 158
 		}
158 159
 		return result
@@ -162,7 +163,7 @@ class Calendar {
162 163
 	 */
163 164
 	_getNextMonthDays(amount, dateObj) {
164 165
 		const result = []
165
-    const month = dateObj.month + 1
166
+		const month = dateObj.month + 1
166 167
 		for (let i = 1; i <= amount; i++) {
167 168
 			result.push({
168 169
 				date: i,
@@ -240,7 +241,7 @@ class Calendar {
240 241
 	 *  获取多选状态
241 242
 	 */
242 243
 	setMultiple(fullDate) {
243
-    if (!this.range) return
244
+		if (!this.range) return
244 245
 
245 246
 		let {
246 247
 			before,
@@ -259,6 +260,7 @@ class Calendar {
259 260
 		} else {
260 261
 			if (!before) {
261 262
 				this.multipleStatus.before = fullDate
263
+				this.multipleStatus.after = undefined;
262 264
 				this.lastHover = false
263 265
 			} else {
264 266
 				this.multipleStatus.after = fullDate
@@ -279,9 +281,12 @@ class Calendar {
279 281
 	 *  鼠标 hover 更新多选状态
280 282
 	 */
281 283
 	setHoverMultiple(fullDate) {
282
-    if (!this.range || this.lastHover) return
283
-
284
-		const { before } = this.multipleStatus
284
+		//抖音小程序点击会触发hover事件,需要避免一下
285
+		// #ifndef MP-TOUTIAO
286
+		if (!this.range || this.lastHover) return
287
+		const {
288
+			before
289
+		} = this.multipleStatus
285 290
 
286 291
 		if (!before) {
287 292
 			this.multipleStatus.before = fullDate
@@ -294,6 +299,8 @@ class Calendar {
294 299
 			}
295 300
 		}
296 301
 		this.getWeeks(fullDate)
302
+		// #endif
303
+
297 304
 	}
298 305
 
299 306
 	/**
@@ -324,22 +331,22 @@ class Calendar {
324 331
 		} = this.getDateObj(dateData)
325 332
 
326 333
 		const preMonthDayAmount = new Date(year, month - 1, 1).getDay()
327
-    const preMonthDays = this.getPreMonthDays(preMonthDayAmount, this.getDateObj(dateData))
334
+		const preMonthDays = this.getPreMonthDays(preMonthDayAmount, this.getDateObj(dateData))
328 335
 
329 336
 		const currentMonthDayAmount = new Date(year, month, 0).getDate()
330
-    const currentMonthDays = this.getCurrentMonthDays(currentMonthDayAmount, this.getDateObj(dateData))
337
+		const currentMonthDays = this.getCurrentMonthDays(currentMonthDayAmount, this.getDateObj(dateData))
331 338
 
332
-    const nextMonthDayAmount = 42 - preMonthDayAmount - currentMonthDayAmount
333
-    const nextMonthDays = this._getNextMonthDays(nextMonthDayAmount, this.getDateObj(dateData))
339
+		const nextMonthDayAmount = 42 - preMonthDayAmount - currentMonthDayAmount
340
+		const nextMonthDays = this._getNextMonthDays(nextMonthDayAmount, this.getDateObj(dateData))
334 341
 
335 342
 		const calendarDays = [...preMonthDays, ...currentMonthDays, ...nextMonthDays]
336 343
 
337 344
 		const weeks = new Array(6)
338 345
 		for (let i = 0; i < calendarDays.length; i++) {
339
-      const index = Math.floor(i / 7)
340
-      if(!weeks[index]){
341
-        weeks[index] = new Array(7)
342
-      }
346
+			const index = Math.floor(i / 7)
347
+			if (!weeks[index]) {
348
+				weeks[index] = new Array(7)
349
+			}
343 350
 			weeks[index][i % 7] = calendarDays[i]
344 351
 		}
345 352
 
@@ -348,56 +355,67 @@ class Calendar {
348 355
 	}
349 356
 }
350 357
 
351
-function getDateTime(date, hideSecond){
352
-  return `${getDate(date)} ${getTime(date, hideSecond)}`
358
+function getDateTime(date, hideSecond) {
359
+	return `${getDate(date)} ${getTime(date, hideSecond)}`
353 360
 }
354 361
 
355 362
 function getDate(date) {
356
-  date = fixIosDateFormat(date)
357
-  date = new Date(date)
358
-  const year = date.getFullYear()
359
-  const month = date.getMonth()+1
360
-  const day = date.getDate()
361
-  return `${year}-${addZero(month)}-${addZero(day)}`
363
+	date = fixIosDateFormat(date)
364
+	date = new Date(date)
365
+	const year = date.getFullYear()
366
+	const month = date.getMonth() + 1
367
+	const day = date.getDate()
368
+	return `${year}-${addZero(month)}-${addZero(day)}`
362 369
 }
363 370
 
364
-function getTime(date, hideSecond){
365
-  date = fixIosDateFormat(date)
366
-  date = new Date(date)
367
-  const hour = date.getHours()
368
-  const minute = date.getMinutes()
369
-  const second = date.getSeconds()
370
-  return hideSecond ? `${addZero(hour)}:${addZero(minute)}` : `${addZero(hour)}:${addZero(minute)}:${addZero(second)}`
371
+function getTime(date, hideSecond) {
372
+	date = fixIosDateFormat(date)
373
+	date = new Date(date)
374
+	const hour = date.getHours()
375
+	const minute = date.getMinutes()
376
+	const second = date.getSeconds()
377
+	return hideSecond ? `${addZero(hour)}:${addZero(minute)}` : `${addZero(hour)}:${addZero(minute)}:${addZero(second)}`
371 378
 }
372 379
 
373 380
 function addZero(num) {
374
-  if(num < 10){
375
-    num = `0${num}`
376
-  }
377
-  return num
381
+	if (num < 10) {
382
+		num = `0${num}`
383
+	}
384
+	return num
378 385
 }
379 386
 
380 387
 function getDefaultSecond(hideSecond) {
381
-  return hideSecond ? '00:00' : '00:00:00'
388
+	return hideSecond ? '00:00' : '00:00:00'
382 389
 }
383 390
 
384 391
 function dateCompare(startDate, endDate) {
385
-  startDate = new Date(fixIosDateFormat(startDate))
386
-  endDate = new Date(fixIosDateFormat(endDate))
387
-  return startDate <= endDate
392
+	startDate = new Date(fixIosDateFormat(startDate))
393
+	endDate = new Date(fixIosDateFormat(endDate))
394
+	return startDate <= endDate
388 395
 }
389 396
 
390
-function checkDate(date){
391
-  const dateReg = /((19|20)\d{2})(-|\/)\d{1,2}(-|\/)\d{1,2}/g
392
-  return date.match(dateReg)
397
+function checkDate(date) {
398
+	const dateReg = /((19|20)\d{2})(-|\/)\d{1,2}(-|\/)\d{1,2}/g
399
+	return date.match(dateReg)
393 400
 }
401
+//ios低版本15及以下,无法匹配 没有 ’秒‘ 时的情况,所以需要在末尾 秒 加上 问号
402
+const dateTimeReg = /^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])( [0-5]?[0-9]:[0-5]?[0-9](:[0-5]?[0-9])?)?$/;
394 403
 
395
-const dateTimeReg = /^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])( [0-5][0-9]:[0-5][0-9]:[0-5][0-9])?$/
396 404
 function fixIosDateFormat(value) {
397
-  if (typeof value === 'string' && dateTimeReg.test(value)) {
398
-    value = value.replace(/-/g, '/')
399
-  }
400
-  return value
405
+	if (typeof value === 'string' && dateTimeReg.test(value)) {
406
+		value = value.replace(/-/g, '/')
407
+	}
408
+	return value
401 409
 }
402 410
 
403
-export {Calendar, getDateTime, getDate, getTime, addZero, getDefaultSecond, dateCompare, checkDate, fixIosDateFormat}
411
+export {
412
+	Calendar,
413
+	getDateTime,
414
+	getDate,
415
+	getTime,
416
+	addZero,
417
+	getDefaultSecond,
418
+	dateCompare,
419
+	checkDate,
420
+	fixIosDateFormat
421
+}

+ 3 - 2
uni_modules/uni-datetime-picker/package.json

@@ -1,7 +1,7 @@
1 1
 {
2 2
   "id": "uni-datetime-picker",
3 3
   "displayName": "uni-datetime-picker 日期选择器",
4
-  "version": "2.2.22",
4
+  "version": "2.2.34",
5 5
   "description": "uni-datetime-picker 日期时间选择器,支持日历,支持范围选择",
6 6
   "keywords": [
7 7
     "uni-datetime-picker",
@@ -46,7 +46,8 @@
46 46
     "platforms": {
47 47
       "cloud": {
48 48
         "tcb": "y",
49
-        "aliyun": "y"
49
+        "aliyun": "y",
50
+        "alipay": "n"
50 51
       },
51 52
       "client": {
52 53
         "App": {

+ 1 - 1
uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue

@@ -105,7 +105,7 @@
105 105
 	}
106 106
 </script>
107 107
 
108
-<style lang="scss" >
108
+<style lang="scss" scoped>
109 109
 	$uni-mask: rgba($color: #000000, $alpha: 0.4) ;
110 110
 	// 抽屉宽度
111 111
 	$drawer-width: 220px;

+ 16 - 0
uni_modules/uni-easyinput/changelog.md

@@ -1,3 +1,19 @@
1
+## 1.1.18(2024-04-11)
2
+- 修复 easyinput组件双向绑定问题
3
+## 1.1.17(2024-03-28)
4
+- 修复 在头条小程序下丢失事件绑定的问题
5
+## 1.1.16(2024-03-20)
6
+- 修复 在密码输入情况下 清除和小眼睛覆盖bug 在edge浏览器下显示双眼睛bug
7
+## 1.1.15(2024-02-21)
8
+- 新增 左侧插槽:left
9
+## 1.1.14(2024-02-19)
10
+- 修复 onBlur的emit传值错误
11
+## 1.1.12(2024-01-29)
12
+- 补充 adjust-position文档属性补充
13
+## 1.1.11(2024-01-29)
14
+- 补充 adjust-position属性传递值:(Boolean)当键盘弹起时,是否自动上推页面
15
+## 1.1.10(2024-01-22)
16
+- 去除 移除无用的log输出
1 17
 ## 1.1.9(2023-04-11)
2 18
 - 修复 vue3 下 keyboardheightchange 事件报错的bug
3 19
 ## 1.1.8(2023-03-29)

+ 0 - 2
uni_modules/uni-easyinput/components/uni-easyinput/common.js

@@ -6,9 +6,7 @@
6 6
  */
7 7
 export const debounce = function(func, wait = 1000, immediate = true) {
8 8
 	let timer;
9
-	console.log(1);
10 9
 	return function() {
11
-		console.log(123);
12 10
 		let context = this,
13 11
 			args = arguments;
14 12
 		if (timer) clearTimeout(timer);

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 645 - 609
uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue


+ 3 - 2
uni_modules/uni-easyinput/package.json

@@ -1,7 +1,7 @@
1 1
 {
2 2
   "id": "uni-easyinput",
3 3
   "displayName": "uni-easyinput 增强输入框",
4
-  "version": "1.1.9",
4
+  "version": "1.1.18",
5 5
   "description": "Easyinput 组件是对原生input组件的增强",
6 6
   "keywords": [
7 7
     "uni-ui",
@@ -46,7 +46,8 @@
46 46
     "platforms": {
47 47
       "cloud": {
48 48
         "tcb": "y",
49
-        "aliyun": "y"
49
+        "aliyun": "y",
50
+        "alipay": "n"
50 51
       },
51 52
       "client": {
52 53
         "App": {

+ 8 - 0
uni_modules/uni-file-picker/changelog.md

@@ -1,3 +1,11 @@
1
+## 1.0.8(2024-03-20)
2
+- 补充 删除文件时返回文件下标
3
+## 1.0.7(2024-02-21)
4
+- 新增 微信小程序选择视频时改用chooseMedia,并返回视频缩略图
5
+## 1.0.6(2024-01-06)
6
+- 新增 微信小程序不再调用chooseImage,而是调用chooseMedia
7
+## 1.0.5(2024-01-03)
8
+- 新增 上传文件至云存储携带本地文件名称
1 9
 ## 1.0.4(2023-03-29)
2 10
 - 修复 手动上传删除一个文件后不能再上传的bug
3 11
 ## 1.0.3(2022-12-19)

+ 67 - 4
uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js

@@ -11,6 +11,28 @@ function chooseImage(opts) {
11 11
 		extension
12 12
 	} = opts
13 13
 	return new Promise((resolve, reject) => {
14
+		// 微信由于旧接口不再维护,针对微信小程序平台改用chooseMedia接口
15
+		// #ifdef MP-WEIXIN
16
+		uni.chooseMedia({
17
+			count,
18
+			sizeType,
19
+			sourceType,
20
+			mediaType: ['image'],
21
+			extension,
22
+			success(res) {
23
+				res.tempFiles.forEach(item => {
24
+					item.path = item.tempFilePath;
25
+				})
26
+				resolve(normalizeChooseAndUploadFileRes(res, 'image'));
27
+			},
28
+			fail(res) {
29
+				reject({
30
+					errMsg: res.errMsg.replace('chooseImage:fail', ERR_MSG_FAIL),
31
+				});
32
+			},
33
+		})
34
+		// #endif
35
+		// #ifndef MP-WEIXIN
14 36
 		uni.chooseImage({
15 37
 			count,
16 38
 			sizeType,
@@ -25,11 +47,14 @@ function chooseImage(opts) {
25 47
 				});
26 48
 			},
27 49
 		});
50
+		// #endif
51
+
28 52
 	});
29 53
 }
30 54
 
31 55
 function chooseVideo(opts) {
32 56
 	const {
57
+		count,
33 58
 		camera,
34 59
 		compressed,
35 60
 		maxDuration,
@@ -37,6 +62,45 @@ function chooseVideo(opts) {
37 62
 		extension
38 63
 	} = opts;
39 64
 	return new Promise((resolve, reject) => {
65
+		// 微信由于旧接口不再维护,针对微信小程序平台改用chooseMedia接口
66
+		// #ifdef MP-WEIXIN
67
+		uni.chooseMedia({
68
+			count,
69
+			compressed,
70
+			maxDuration,
71
+			sourceType,
72
+			extension,
73
+			mediaType: ['video'],
74
+			success(res) {
75
+				const {
76
+					tempFiles,
77
+				} = res;
78
+				resolve(normalizeChooseAndUploadFileRes({
79
+					errMsg: 'chooseVideo:ok',
80
+					tempFiles: tempFiles.map(item => {
81
+						return {
82
+							name: item.name || '',
83
+							path: item.tempFilePath,
84
+							thumbTempFilePath: item.thumbTempFilePath,
85
+							size:item.size,
86
+							type: (res.tempFile && res.tempFile.type) || '',
87
+							width:item.width,
88
+							height:item.height,
89
+							duration:item.duration,
90
+							fileType: 'video',
91
+							cloudPath: '',
92
+						}
93
+					}),
94
+				}, 'video'));
95
+			},
96
+			fail(res) {
97
+				reject({
98
+					errMsg: res.errMsg.replace('chooseVideo:fail', ERR_MSG_FAIL),
99
+				});
100
+			},
101
+		})
102
+		// #endif
103
+		// #ifndef MP-WEIXIN
40 104
 		uni.chooseVideo({
41 105
 			camera,
42 106
 			compressed,
@@ -54,8 +118,7 @@ function chooseVideo(opts) {
54 118
 				resolve(normalizeChooseAndUploadFileRes({
55 119
 					errMsg: 'chooseVideo:ok',
56 120
 					tempFilePaths: [tempFilePath],
57
-					tempFiles: [
58
-					{
121
+					tempFiles: [{
59 122
 						name: (res.tempFile && res.tempFile.name) || '',
60 123
 						path: tempFilePath,
61 124
 						size,
@@ -74,6 +137,7 @@ function chooseVideo(opts) {
74 137
 				});
75 138
 			},
76 139
 		});
140
+		// #endif
77 141
 	});
78 142
 }
79 143
 
@@ -211,8 +275,7 @@ function chooseAndUploadFile(opts = {
211 275
 }) {
212 276
 	if (opts.type === 'image') {
213 277
 		return uploadFiles(chooseImage(opts), opts);
214
-	}
215
-	else if (opts.type === 'video') {
278
+	} else if (opts.type === 'video') {
216 279
 		return uploadFiles(chooseVideo(opts), opts);
217 280
 	}
218 281
 	return uploadFiles(chooseAll(opts), opts);

+ 12 - 1
uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue

@@ -191,6 +191,10 @@
191 191
 				default () {
192 192
 					return  ['album', 'camera']
193 193
 				}
194
+			},
195
+			provider: {
196
+				type: String,
197
+				default: '' // 默认上传到 unicloud 内置存储 extStorage 扩展存储
194 198
 			}
195 199
 		},
196 200
 		data() {
@@ -331,7 +335,6 @@
331 335
 			 * 选择文件
332 336
 			 */
333 337
 			choose() {
334
-
335 338
 				if (this.disabled) return
336 339
 				if (this.files.length >= Number(this.limitLength) && this.showType !== 'grid' && this.returnType ===
337 340
 					'array') {
@@ -418,6 +421,13 @@
418 421
 				if (!this.autoUpload || this.noSpace) {
419 422
 					res.tempFiles = []
420 423
 				}
424
+				res.tempFiles.forEach((fileItem, index) => {
425
+					this.provider && (fileItem.provider = this.provider);
426
+					const fileNameSplit = fileItem.name.split('.')
427
+					const ext = fileNameSplit.pop()
428
+					const fileName = fileNameSplit.join('.').replace(/[\s\/\?<>\\:\*\|":]/g, '_')
429
+					fileItem.cloudPath = fileName + '_' + Date.now() + '_' + index + '.' + ext
430
+				})
421 431
 			},
422 432
 
423 433
 			/**
@@ -523,6 +533,7 @@
523 533
 			 */
524 534
 			delFile(index) {
525 535
 				this.$emit('delete', {
536
+					index,
526 537
 					tempFile: this.files[index],
527 538
 					tempFilePath: this.files[index].url
528 539
 				})

+ 1 - 0
uni_modules/uni-file-picker/components/uni-file-picker/utils.js

@@ -90,6 +90,7 @@ export const get_file_data = async (files, type = 'image') => {
90 90
 		extname: extname || '',
91 91
 		cloudPath: files.cloudPath,
92 92
 		fileType: files.fileType,
93
+		thumbTempFilePath: files.thumbTempFilePath,
93 94
 		url: files.path || files.path,
94 95
 		size: files.size, //单位是字节
95 96
 		image: {},

+ 1 - 1
uni_modules/uni-file-picker/package.json

@@ -1,7 +1,7 @@
1 1
 {
2 2
   "id": "uni-file-picker",
3 3
   "displayName": "uni-file-picker 文件选择上传",
4
-  "version": "1.0.4",
4
+  "version": "1.0.8",
5 5
   "description": "文件选择上传组件,可以选择图片、视频等任意文件并上传到当前绑定的服务空间",
6 6
   "keywords": [
7 7
     "uni-ui",

+ 2 - 0
uni_modules/uni-forms/changelog.md

@@ -1,3 +1,5 @@
1
+## 1.4.10(2023-11-03)
2
+- 优化 labelWidth 描述错误
1 3
 ## 1.4.9(2023-02-10)
2 4
 - 修复 required 参数无法动态绑定
3 5
 ## 1.4.8(2022-08-23)

+ 5 - 5
uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue

@@ -36,7 +36,7 @@
36 36
 	 * @tutorial https://ext.dcloud.net.cn/plugin?id=2773
37 37
 	 * @property {Boolean} required 是否必填,左边显示红色"*"号
38 38
 	 * @property {String } 	label 				输入框左边的文字提示
39
-	 * @property {Number } 	labelWidth 			label的宽度,单位px(默认65
39
+	 * @property {Number } 	labelWidth 			label的宽度,单位px(默认70
40 40
 	 * @property {String } 	labelAlign = [left|center|right] label的文字对齐方式(默认left)
41 41
 	 * 	@value left		label 左侧显示
42 42
 	 * 	@value center	label 居中
@@ -91,7 +91,7 @@
91 91
 				type: String,
92 92
 				default: ''
93 93
 			},
94
-			// label的宽度 ,默认 80
94
+			// label的宽度
95 95
 			labelWidth: {
96 96
 				type: [String, Number],
97 97
 				default: ''
@@ -128,7 +128,7 @@
128 128
 				errMsg: '',
129 129
 				userRules: null,
130 130
 				localLabelAlign: 'left',
131
-				localLabelWidth: '65px',
131
+				localLabelWidth: '70px',
132 132
 				localLabelPos: 'left',
133 133
 				border: false,
134 134
 				isFirstBorder: false,
@@ -413,9 +413,9 @@
413 413
 				// 	const {
414 414
 				// 		labelWidth
415 415
 				// 	} = this.form
416
-				return this.num2px(this.labelWidth ? this.labelWidth : (labelWidth || (this.label ? 65 : 'auto')))
416
+				return this.num2px(this.labelWidth ? this.labelWidth : (labelWidth || (this.label ? 70 : 'auto')))
417 417
 				// }
418
-				// return '65px'
418
+				// return '70px'
419 419
 			},
420 420
 			// 处理 label 位置
421 421
 			_labelPosition() {

+ 1 - 1
uni_modules/uni-forms/components/uni-forms/uni-forms.vue

@@ -52,7 +52,7 @@
52 52
 	 * @property {String} labelPosition = [top|left]	label 位置 默认 left
53 53
 	 * @value top		顶部显示 label
54 54
 	 * @value left	左侧显示 label
55
-	 * @property {String} labelWidth	label 宽度,默认 65px
55
+	 * @property {String} labelWidth	label 宽度,默认 70px
56 56
 	 * @property {String} labelAlign = [left|center|right]	label 居中方式  默认 left
57 57
 	 * @value left		label 左侧显示
58 58
 	 * @value center	label 居中

+ 1 - 1
uni_modules/uni-forms/package.json

@@ -1,7 +1,7 @@
1 1
 {
2 2
   "id": "uni-forms",
3 3
   "displayName": "uni-forms 表单",
4
-  "version": "1.4.9",
4
+  "version": "1.4.10",
5 5
   "description": "由输入框、选择器、单选框、多选框等控件组成,用以收集、校验、提交数据",
6 6
   "keywords": [
7 7
     "uni-ui",

+ 1 - 1
uni_modules/uni-grid/components/uni-grid-item/uni-grid-item.vue

@@ -68,7 +68,7 @@
68 68
 	}
69 69
 </script>
70 70
 
71
-<style lang="scss" >
71
+<style lang="scss" scoped>
72 72
 	.uni-grid-item {
73 73
 		/* #ifndef APP-NVUE */
74 74
 		height: 100%;

+ 1 - 1
uni_modules/uni-grid/components/uni-grid/uni-grid.vue

@@ -106,7 +106,7 @@
106 106
 	}
107 107
 </script>
108 108
 
109
-<style lang="scss" >
109
+<style lang="scss" scoped>
110 110
 	.uni-grid-wrap {
111 111
 		/* #ifndef APP-NVUE */
112 112
 		display: flex;

+ 18 - 0
uni_modules/uni-icons/changelog.md

@@ -1,3 +1,21 @@
1
+## 2.0.9(2024-01-12)
2
+fix: 修复图标大小默认值错误的问题
3
+## 2.0.8(2023-12-14)
4
+- 修复 项目未使用 ts 情况下,打包报错的bug
5
+## 2.0.7(2023-12-14)
6
+- 修复 size 属性为 string 时,不加单位导致尺寸异常的bug
7
+## 2.0.6(2023-12-11)
8
+- 优化 兼容老版本icon类型,如 top ,bottom 等
9
+## 2.0.5(2023-12-11)
10
+- 优化 兼容老版本icon类型,如 top ,bottom 等
11
+## 2.0.4(2023-12-06)
12
+- 优化 uni-app x 下示例项目图标排序
13
+## 2.0.3(2023-12-06)
14
+- 修复 nvue下引入组件报错的bug
15
+## 2.0.2(2023-12-05)
16
+-优化 size 属性支持单位
17
+## 2.0.1(2023-12-05)
18
+- 新增 uni-app x 支持定义图标
1 19
 ## 1.3.5(2022-01-24)
2 20
 - 优化 size 属性可以传入不带单位的字符串数值
3 21
 ## 1.3.4(2022-01-24)

+ 91 - 0
uni_modules/uni-icons/components/uni-icons/uni-icons.uvue

@@ -0,0 +1,91 @@
1
+<template>
2
+	<text class="uni-icons" :style="styleObj">
3
+		<slot>{{unicode}}</slot>
4
+	</text>
5
+</template>
6
+
7
+<script>
8
+	import { fontData, IconsDataItem } from './uniicons_file'
9
+
10
+	/**
11
+	 * Icons 图标
12
+	 * @description 用于展示 icon 图标
13
+	 * @tutorial https://ext.dcloud.net.cn/plugin?id=28
14
+	 * @property {Number} size 图标大小
15
+	 * @property {String} type 图标图案,参考示例
16
+	 * @property {String} color 图标颜色
17
+	 * @property {String} customPrefix 自定义图标
18
+	 * @event {Function} click 点击 Icon 触发事件
19
+	 */
20
+	export default {
21
+		name: "uni-icons",
22
+		props: {
23
+			type: {
24
+				type: String,
25
+				default: ''
26
+			},
27
+			color: {
28
+				type: String,
29
+				default: '#333333'
30
+			},
31
+			size: {
32
+				type: Object,
33
+				default: 16
34
+			},
35
+			fontFamily: {
36
+				type: String,
37
+				default: ''
38
+			}
39
+		},
40
+		data() {
41
+			return {};
42
+		},
43
+		computed: {
44
+			unicode() : string {
45
+				let codes = fontData.find((item : IconsDataItem) : boolean => { return item.font_class == this.type })
46
+				if (codes !== null) {
47
+					return codes.unicode
48
+				}
49
+				return ''
50
+			},
51
+			iconSize() : string {
52
+				const size = this.size
53
+				if (typeof size == 'string') {
54
+					const reg = /^[0-9]*$/g
55
+					return reg.test(size as string) ? '' + size + 'px' : '' + size;
56
+					// return '' + this.size
57
+				}
58
+				return this.getFontSize(size as number)
59
+			},
60
+			styleObj() : UTSJSONObject {
61
+				if (this.fontFamily !== '') {
62
+					return { color: this.color, fontSize: this.iconSize, fontFamily: this.fontFamily }
63
+				}
64
+				return { color: this.color, fontSize: this.iconSize }
65
+			}
66
+		},
67
+		created() { },
68
+		methods: {
69
+			/**
70
+			 * 字体大小
71
+			 */
72
+			getFontSize(size : number) : string {
73
+				return size + 'px';
74
+			},
75
+		},
76
+	}
77
+</script>
78
+
79
+<style scoped>
80
+	@font-face {
81
+		font-family: UniIconsFontFamily;
82
+		src: url('./uniicons.ttf');
83
+	}
84
+
85
+	.uni-icons {
86
+		font-family: UniIconsFontFamily;
87
+		font-size: 18px;
88
+		font-style: normal;
89
+		color: #333;
90
+	}
91
+</style>

+ 31 - 17
uni_modules/uni-icons/components/uni-icons/uni-icons.vue

@@ -1,24 +1,28 @@
1 1
 <template>
2 2
 	<!-- #ifdef APP-NVUE -->
3
-	<text :style="{ color: color, 'font-size': iconSize }" class="uni-icons" @click="_onClick">{{unicode}}</text>
3
+	<text :style="styleObj" class="uni-icons" @click="_onClick">{{unicode}}</text>
4 4
 	<!-- #endif -->
5 5
 	<!-- #ifndef APP-NVUE -->
6
-	<text :style="{ color: color, 'font-size': iconSize }" class="uni-icons" :class="['uniui-'+type,customPrefix,customPrefix?type:'']" @click="_onClick"></text>
6
+	<text :style="styleObj" class="uni-icons" :class="['uniui-'+type,customPrefix,customPrefix?type:'']" @click="_onClick">
7
+		<slot></slot>
8
+	</text>
7 9
 	<!-- #endif -->
8 10
 </template>
9 11
 
10 12
 <script>
11
-	import icons from './icons.js';
13
+	import { fontData } from './uniicons_file_vue.js';
14
+
12 15
 	const getVal = (val) => {
13 16
 		const reg = /^[0-9]*$/g
14
-		return (typeof val === 'number' || reg.test(val) )? val + 'px' : val;
15
-	} 
17
+		return (typeof val === 'number' || reg.test(val)) ? val + 'px' : val;
18
+	}
19
+
16 20
 	// #ifdef APP-NVUE
17 21
 	var domModule = weex.requireModule('dom');
18 22
 	import iconUrl from './uniicons.ttf'
19 23
 	domModule.addRule('fontFace', {
20 24
 		'fontFamily': "uniicons",
21
-		'src': "url('"+iconUrl+"')"
25
+		'src': "url('" + iconUrl + "')"
22 26
 	});
23 27
 	// #endif
24 28
 
@@ -34,7 +38,7 @@
34 38
 	 */
35 39
 	export default {
36 40
 		name: 'UniIcons',
37
-		emits:['click'],
41
+		emits: ['click'],
38 42
 		props: {
39 43
 			type: {
40 44
 				type: String,
@@ -48,26 +52,36 @@
48 52
 				type: [Number, String],
49 53
 				default: 16
50 54
 			},
51
-			customPrefix:{
55
+			customPrefix: {
56
+				type: String,
57
+				default: ''
58
+			},
59
+			fontFamily: {
52 60
 				type: String,
53 61
 				default: ''
54 62
 			}
55 63
 		},
56 64
 		data() {
57 65
 			return {
58
-				icons: icons.glyphs
66
+				icons: fontData
59 67
 			}
60 68
 		},
61
-		computed:{
62
-			unicode(){
63
-				let code = this.icons.find(v=>v.font_class === this.type)
64
-				if(code){
65
-					return unescape(`%u${code.unicode}`)
69
+		computed: {
70
+			unicode() {
71
+				let code = this.icons.find(v => v.font_class === this.type)
72
+				if (code) {
73
+					return code.unicode
66 74
 				}
67 75
 				return ''
68 76
 			},
69
-			iconSize(){
77
+			iconSize() {
70 78
 				return getVal(this.size)
79
+			},
80
+			styleObj() {
81
+				if (this.fontFamily !== '') {
82
+					return `color: ${this.color}; font-size: ${this.iconSize}; font-family: ${this.fontFamily};`
83
+				}
84
+				return `color: ${this.color}; font-size: ${this.iconSize};`
71 85
 			}
72 86
 		},
73 87
 		methods: {
@@ -81,9 +95,10 @@
81 95
 <style lang="scss">
82 96
 	/* #ifndef APP-NVUE */
83 97
 	@import './uniicons.css';
98
+
84 99
 	@font-face {
85 100
 		font-family: uniicons;
86
-		src: url('./uniicons.ttf') format('truetype');
101
+		src: url('./uniicons.ttf');
87 102
 	}
88 103
 
89 104
 	/* #endif */
@@ -92,5 +107,4 @@
92 107
 		text-decoration: none;
93 108
 		text-align: center;
94 109
 	}
95
-
96 110
 </style>

+ 32 - 31
uni_modules/uni-icons/components/uni-icons/uniicons.css

@@ -1,3 +1,12 @@
1
+
2
+.uniui-cart-filled:before {
3
+  content: "\e6d0";
4
+}
5
+
6
+.uniui-gift-filled:before {
7
+  content: "\e6c4";
8
+}
9
+
1 10
 .uniui-color:before {
2 11
   content: "\e6cf";
3 12
 }
@@ -58,10 +67,6 @@
58 67
   content: "\e6c3";
59 68
 }
60 69
 
61
-.uniui-gift-filled:before {
62
-  content: "\e6c4";
63
-}
64
-
65 70
 .uniui-fire-filled:before {
66 71
   content: "\e6c5";
67 72
 }
@@ -82,6 +87,18 @@
82 87
   content: "\e698";
83 88
 }
84 89
 
90
+.uniui-arrowthinleft:before {
91
+  content: "\e6d2";
92
+}
93
+
94
+.uniui-arrowthinup:before {
95
+  content: "\e6d3";
96
+}
97
+
98
+.uniui-arrowthindown:before {
99
+  content: "\e6d4";
100
+}
101
+
85 102
 .uniui-back:before {
86 103
   content: "\e6b9";
87 104
 }
@@ -94,55 +111,43 @@
94 111
   content: "\e6bb";
95 112
 }
96 113
 
97
-.uniui-arrowthinright:before {
98
-  content: "\e6bb";
99
-}
100
-
101 114
 .uniui-arrow-left:before {
102 115
   content: "\e6bc";
103 116
 }
104 117
 
105
-.uniui-arrowthinleft:before {
106
-  content: "\e6bc";
107
-}
108
-
109 118
 .uniui-arrow-up:before {
110 119
   content: "\e6bd";
111 120
 }
112 121
 
113
-.uniui-arrowthinup:before {
114
-  content: "\e6bd";
115
-}
116
-
117 122
 .uniui-arrow-down:before {
118 123
   content: "\e6be";
119 124
 }
120 125
 
121
-.uniui-arrowthindown:before {
122
-  content: "\e6be";
126
+.uniui-arrowthinright:before {
127
+  content: "\e6d1";
123 128
 }
124 129
 
125
-.uniui-bottom:before {
130
+.uniui-down:before {
126 131
   content: "\e6b8";
127 132
 }
128 133
 
129
-.uniui-arrowdown:before {
134
+.uniui-bottom:before {
130 135
   content: "\e6b8";
131 136
 }
132 137
 
133
-.uniui-right:before {
134
-  content: "\e6b5";
138
+.uniui-arrowright:before {
139
+  content: "\e6d5";
135 140
 }
136 141
 
137
-.uniui-arrowright:before {
142
+.uniui-right:before {
138 143
   content: "\e6b5";
139 144
 }
140 145
 
141
-.uniui-top:before {
146
+.uniui-up:before {
142 147
   content: "\e6b6";
143 148
 }
144 149
 
145
-.uniui-arrowup:before {
150
+.uniui-top:before {
146 151
   content: "\e6b6";
147 152
 }
148 153
 
@@ -150,8 +155,8 @@
150 155
   content: "\e6b7";
151 156
 }
152 157
 
153
-.uniui-arrowleft:before {
154
-  content: "\e6b7";
158
+.uniui-arrowup:before {
159
+  content: "\e6d6";
155 160
 }
156 161
 
157 162
 .uniui-eye:before {
@@ -638,10 +643,6 @@
638 643
   content: "\e627";
639 644
 }
640 645
 
641
-.uniui-cart-filled:before {
642
-  content: "\e629";
643
-}
644
-
645 646
 .uniui-checkbox:before {
646 647
   content: "\e62b";
647 648
 }

BIN
uni_modules/uni-icons/components/uni-icons/uniicons.ttf


+ 664 - 0
uni_modules/uni-icons/components/uni-icons/uniicons_file.ts

@@ -0,0 +1,664 @@
1
+
2
+export type IconsData = {
3
+	id : string
4
+	name : string
5
+	font_family : string
6
+	css_prefix_text : string
7
+	description : string
8
+	glyphs : Array<IconsDataItem>
9
+}
10
+
11
+export type IconsDataItem = {
12
+	font_class : string
13
+	unicode : string
14
+}
15
+
16
+
17
+export const fontData = [
18
+  {
19
+    "font_class": "arrow-down",
20
+    "unicode": "\ue6be"
21
+  },
22
+  {
23
+    "font_class": "arrow-left",
24
+    "unicode": "\ue6bc"
25
+  },
26
+  {
27
+    "font_class": "arrow-right",
28
+    "unicode": "\ue6bb"
29
+  },
30
+  {
31
+    "font_class": "arrow-up",
32
+    "unicode": "\ue6bd"
33
+  },
34
+  {
35
+    "font_class": "auth",
36
+    "unicode": "\ue6ab"
37
+  },
38
+  {
39
+    "font_class": "auth-filled",
40
+    "unicode": "\ue6cc"
41
+  },
42
+  {
43
+    "font_class": "back",
44
+    "unicode": "\ue6b9"
45
+  },
46
+  {
47
+    "font_class": "bars",
48
+    "unicode": "\ue627"
49
+  },
50
+  {
51
+    "font_class": "calendar",
52
+    "unicode": "\ue6a0"
53
+  },
54
+  {
55
+    "font_class": "calendar-filled",
56
+    "unicode": "\ue6c0"
57
+  },
58
+  {
59
+    "font_class": "camera",
60
+    "unicode": "\ue65a"
61
+  },
62
+  {
63
+    "font_class": "camera-filled",
64
+    "unicode": "\ue658"
65
+  },
66
+  {
67
+    "font_class": "cart",
68
+    "unicode": "\ue631"
69
+  },
70
+  {
71
+    "font_class": "cart-filled",
72
+    "unicode": "\ue6d0"
73
+  },
74
+  {
75
+    "font_class": "chat",
76
+    "unicode": "\ue65d"
77
+  },
78
+  {
79
+    "font_class": "chat-filled",
80
+    "unicode": "\ue659"
81
+  },
82
+  {
83
+    "font_class": "chatboxes",
84
+    "unicode": "\ue696"
85
+  },
86
+  {
87
+    "font_class": "chatboxes-filled",
88
+    "unicode": "\ue692"
89
+  },
90
+  {
91
+    "font_class": "chatbubble",
92
+    "unicode": "\ue697"
93
+  },
94
+  {
95
+    "font_class": "chatbubble-filled",
96
+    "unicode": "\ue694"
97
+  },
98
+  {
99
+    "font_class": "checkbox",
100
+    "unicode": "\ue62b"
101
+  },
102
+  {
103
+    "font_class": "checkbox-filled",
104
+    "unicode": "\ue62c"
105
+  },
106
+  {
107
+    "font_class": "checkmarkempty",
108
+    "unicode": "\ue65c"
109
+  },
110
+  {
111
+    "font_class": "circle",
112
+    "unicode": "\ue65b"
113
+  },
114
+  {
115
+    "font_class": "circle-filled",
116
+    "unicode": "\ue65e"
117
+  },
118
+  {
119
+    "font_class": "clear",
120
+    "unicode": "\ue66d"
121
+  },
122
+  {
123
+    "font_class": "close",
124
+    "unicode": "\ue673"
125
+  },
126
+  {
127
+    "font_class": "closeempty",
128
+    "unicode": "\ue66c"
129
+  },
130
+  {
131
+    "font_class": "cloud-download",
132
+    "unicode": "\ue647"
133
+  },
134
+  {
135
+    "font_class": "cloud-download-filled",
136
+    "unicode": "\ue646"
137
+  },
138
+  {
139
+    "font_class": "cloud-upload",
140
+    "unicode": "\ue645"
141
+  },
142
+  {
143
+    "font_class": "cloud-upload-filled",
144
+    "unicode": "\ue648"
145
+  },
146
+  {
147
+    "font_class": "color",
148
+    "unicode": "\ue6cf"
149
+  },
150
+  {
151
+    "font_class": "color-filled",
152
+    "unicode": "\ue6c9"
153
+  },
154
+  {
155
+    "font_class": "compose",
156
+    "unicode": "\ue67f"
157
+  },
158
+  {
159
+    "font_class": "contact",
160
+    "unicode": "\ue693"
161
+  },
162
+  {
163
+    "font_class": "contact-filled",
164
+    "unicode": "\ue695"
165
+  },
166
+  {
167
+    "font_class": "down",
168
+    "unicode": "\ue6b8"
169
+  },
170
+	{
171
+	  "font_class": "bottom",
172
+	  "unicode": "\ue6b8"
173
+	},
174
+  {
175
+    "font_class": "download",
176
+    "unicode": "\ue68d"
177
+  },
178
+  {
179
+    "font_class": "download-filled",
180
+    "unicode": "\ue681"
181
+  },
182
+  {
183
+    "font_class": "email",
184
+    "unicode": "\ue69e"
185
+  },
186
+  {
187
+    "font_class": "email-filled",
188
+    "unicode": "\ue69a"
189
+  },
190
+  {
191
+    "font_class": "eye",
192
+    "unicode": "\ue651"
193
+  },
194
+  {
195
+    "font_class": "eye-filled",
196
+    "unicode": "\ue66a"
197
+  },
198
+  {
199
+    "font_class": "eye-slash",
200
+    "unicode": "\ue6b3"
201
+  },
202
+  {
203
+    "font_class": "eye-slash-filled",
204
+    "unicode": "\ue6b4"
205
+  },
206
+  {
207
+    "font_class": "fire",
208
+    "unicode": "\ue6a1"
209
+  },
210
+  {
211
+    "font_class": "fire-filled",
212
+    "unicode": "\ue6c5"
213
+  },
214
+  {
215
+    "font_class": "flag",
216
+    "unicode": "\ue65f"
217
+  },
218
+  {
219
+    "font_class": "flag-filled",
220
+    "unicode": "\ue660"
221
+  },
222
+  {
223
+    "font_class": "folder-add",
224
+    "unicode": "\ue6a9"
225
+  },
226
+  {
227
+    "font_class": "folder-add-filled",
228
+    "unicode": "\ue6c8"
229
+  },
230
+  {
231
+    "font_class": "font",
232
+    "unicode": "\ue6a3"
233
+  },
234
+  {
235
+    "font_class": "forward",
236
+    "unicode": "\ue6ba"
237
+  },
238
+  {
239
+    "font_class": "gear",
240
+    "unicode": "\ue664"
241
+  },
242
+  {
243
+    "font_class": "gear-filled",
244
+    "unicode": "\ue661"
245
+  },
246
+  {
247
+    "font_class": "gift",
248
+    "unicode": "\ue6a4"
249
+  },
250
+  {
251
+    "font_class": "gift-filled",
252
+    "unicode": "\ue6c4"
253
+  },
254
+  {
255
+    "font_class": "hand-down",
256
+    "unicode": "\ue63d"
257
+  },
258
+  {
259
+    "font_class": "hand-down-filled",
260
+    "unicode": "\ue63c"
261
+  },
262
+  {
263
+    "font_class": "hand-up",
264
+    "unicode": "\ue63f"
265
+  },
266
+  {
267
+    "font_class": "hand-up-filled",
268
+    "unicode": "\ue63e"
269
+  },
270
+  {
271
+    "font_class": "headphones",
272
+    "unicode": "\ue630"
273
+  },
274
+  {
275
+    "font_class": "heart",
276
+    "unicode": "\ue639"
277
+  },
278
+  {
279
+    "font_class": "heart-filled",
280
+    "unicode": "\ue641"
281
+  },
282
+  {
283
+    "font_class": "help",
284
+    "unicode": "\ue679"
285
+  },
286
+  {
287
+    "font_class": "help-filled",
288
+    "unicode": "\ue674"
289
+  },
290
+  {
291
+    "font_class": "home",
292
+    "unicode": "\ue662"
293
+  },
294
+  {
295
+    "font_class": "home-filled",
296
+    "unicode": "\ue663"
297
+  },
298
+  {
299
+    "font_class": "image",
300
+    "unicode": "\ue670"
301
+  },
302
+  {
303
+    "font_class": "image-filled",
304
+    "unicode": "\ue678"
305
+  },
306
+  {
307
+    "font_class": "images",
308
+    "unicode": "\ue650"
309
+  },
310
+  {
311
+    "font_class": "images-filled",
312
+    "unicode": "\ue64b"
313
+  },
314
+  {
315
+    "font_class": "info",
316
+    "unicode": "\ue669"
317
+  },
318
+  {
319
+    "font_class": "info-filled",
320
+    "unicode": "\ue649"
321
+  },
322
+  {
323
+    "font_class": "left",
324
+    "unicode": "\ue6b7"
325
+  },
326
+  {
327
+    "font_class": "link",
328
+    "unicode": "\ue6a5"
329
+  },
330
+  {
331
+    "font_class": "list",
332
+    "unicode": "\ue644"
333
+  },
334
+  {
335
+    "font_class": "location",
336
+    "unicode": "\ue6ae"
337
+  },
338
+  {
339
+    "font_class": "location-filled",
340
+    "unicode": "\ue6af"
341
+  },
342
+  {
343
+    "font_class": "locked",
344
+    "unicode": "\ue66b"
345
+  },
346
+  {
347
+    "font_class": "locked-filled",
348
+    "unicode": "\ue668"
349
+  },
350
+  {
351
+    "font_class": "loop",
352
+    "unicode": "\ue633"
353
+  },
354
+  {
355
+    "font_class": "mail-open",
356
+    "unicode": "\ue643"
357
+  },
358
+  {
359
+    "font_class": "mail-open-filled",
360
+    "unicode": "\ue63a"
361
+  },
362
+  {
363
+    "font_class": "map",
364
+    "unicode": "\ue667"
365
+  },
366
+  {
367
+    "font_class": "map-filled",
368
+    "unicode": "\ue666"
369
+  },
370
+  {
371
+    "font_class": "map-pin",
372
+    "unicode": "\ue6ad"
373
+  },
374
+  {
375
+    "font_class": "map-pin-ellipse",
376
+    "unicode": "\ue6ac"
377
+  },
378
+  {
379
+    "font_class": "medal",
380
+    "unicode": "\ue6a2"
381
+  },
382
+  {
383
+    "font_class": "medal-filled",
384
+    "unicode": "\ue6c3"
385
+  },
386
+  {
387
+    "font_class": "mic",
388
+    "unicode": "\ue671"
389
+  },
390
+  {
391
+    "font_class": "mic-filled",
392
+    "unicode": "\ue677"
393
+  },
394
+  {
395
+    "font_class": "micoff",
396
+    "unicode": "\ue67e"
397
+  },
398
+  {
399
+    "font_class": "micoff-filled",
400
+    "unicode": "\ue6b0"
401
+  },
402
+  {
403
+    "font_class": "minus",
404
+    "unicode": "\ue66f"
405
+  },
406
+  {
407
+    "font_class": "minus-filled",
408
+    "unicode": "\ue67d"
409
+  },
410
+  {
411
+    "font_class": "more",
412
+    "unicode": "\ue64d"
413
+  },
414
+  {
415
+    "font_class": "more-filled",
416
+    "unicode": "\ue64e"
417
+  },
418
+  {
419
+    "font_class": "navigate",
420
+    "unicode": "\ue66e"
421
+  },
422
+  {
423
+    "font_class": "navigate-filled",
424
+    "unicode": "\ue67a"
425
+  },
426
+  {
427
+    "font_class": "notification",
428
+    "unicode": "\ue6a6"
429
+  },
430
+  {
431
+    "font_class": "notification-filled",
432
+    "unicode": "\ue6c1"
433
+  },
434
+  {
435
+    "font_class": "paperclip",
436
+    "unicode": "\ue652"
437
+  },
438
+  {
439
+    "font_class": "paperplane",
440
+    "unicode": "\ue672"
441
+  },
442
+  {
443
+    "font_class": "paperplane-filled",
444
+    "unicode": "\ue675"
445
+  },
446
+  {
447
+    "font_class": "person",
448
+    "unicode": "\ue699"
449
+  },
450
+  {
451
+    "font_class": "person-filled",
452
+    "unicode": "\ue69d"
453
+  },
454
+  {
455
+    "font_class": "personadd",
456
+    "unicode": "\ue69f"
457
+  },
458
+  {
459
+    "font_class": "personadd-filled",
460
+    "unicode": "\ue698"
461
+  },
462
+  {
463
+    "font_class": "personadd-filled-copy",
464
+    "unicode": "\ue6d1"
465
+  },
466
+  {
467
+    "font_class": "phone",
468
+    "unicode": "\ue69c"
469
+  },
470
+  {
471
+    "font_class": "phone-filled",
472
+    "unicode": "\ue69b"
473
+  },
474
+  {
475
+    "font_class": "plus",
476
+    "unicode": "\ue676"
477
+  },
478
+  {
479
+    "font_class": "plus-filled",
480
+    "unicode": "\ue6c7"
481
+  },
482
+  {
483
+    "font_class": "plusempty",
484
+    "unicode": "\ue67b"
485
+  },
486
+  {
487
+    "font_class": "pulldown",
488
+    "unicode": "\ue632"
489
+  },
490
+  {
491
+    "font_class": "pyq",
492
+    "unicode": "\ue682"
493
+  },
494
+  {
495
+    "font_class": "qq",
496
+    "unicode": "\ue680"
497
+  },
498
+  {
499
+    "font_class": "redo",
500
+    "unicode": "\ue64a"
501
+  },
502
+  {
503
+    "font_class": "redo-filled",
504
+    "unicode": "\ue655"
505
+  },
506
+  {
507
+    "font_class": "refresh",
508
+    "unicode": "\ue657"
509
+  },
510
+  {
511
+    "font_class": "refresh-filled",
512
+    "unicode": "\ue656"
513
+  },
514
+  {
515
+    "font_class": "refreshempty",
516
+    "unicode": "\ue6bf"
517
+  },
518
+  {
519
+    "font_class": "reload",
520
+    "unicode": "\ue6b2"
521
+  },
522
+  {
523
+    "font_class": "right",
524
+    "unicode": "\ue6b5"
525
+  },
526
+  {
527
+    "font_class": "scan",
528
+    "unicode": "\ue62a"
529
+  },
530
+  {
531
+    "font_class": "search",
532
+    "unicode": "\ue654"
533
+  },
534
+  {
535
+    "font_class": "settings",
536
+    "unicode": "\ue653"
537
+  },
538
+  {
539
+    "font_class": "settings-filled",
540
+    "unicode": "\ue6ce"
541
+  },
542
+  {
543
+    "font_class": "shop",
544
+    "unicode": "\ue62f"
545
+  },
546
+  {
547
+    "font_class": "shop-filled",
548
+    "unicode": "\ue6cd"
549
+  },
550
+  {
551
+    "font_class": "smallcircle",
552
+    "unicode": "\ue67c"
553
+  },
554
+  {
555
+    "font_class": "smallcircle-filled",
556
+    "unicode": "\ue665"
557
+  },
558
+  {
559
+    "font_class": "sound",
560
+    "unicode": "\ue684"
561
+  },
562
+  {
563
+    "font_class": "sound-filled",
564
+    "unicode": "\ue686"
565
+  },
566
+  {
567
+    "font_class": "spinner-cycle",
568
+    "unicode": "\ue68a"
569
+  },
570
+  {
571
+    "font_class": "staff",
572
+    "unicode": "\ue6a7"
573
+  },
574
+  {
575
+    "font_class": "staff-filled",
576
+    "unicode": "\ue6cb"
577
+  },
578
+  {
579
+    "font_class": "star",
580
+    "unicode": "\ue688"
581
+  },
582
+  {
583
+    "font_class": "star-filled",
584
+    "unicode": "\ue68f"
585
+  },
586
+  {
587
+    "font_class": "starhalf",
588
+    "unicode": "\ue683"
589
+  },
590
+  {
591
+    "font_class": "trash",
592
+    "unicode": "\ue687"
593
+  },
594
+  {
595
+    "font_class": "trash-filled",
596
+    "unicode": "\ue685"
597
+  },
598
+  {
599
+    "font_class": "tune",
600
+    "unicode": "\ue6aa"
601
+  },
602
+  {
603
+    "font_class": "tune-filled",
604
+    "unicode": "\ue6ca"
605
+  },
606
+  {
607
+    "font_class": "undo",
608
+    "unicode": "\ue64f"
609
+  },
610
+  {
611
+    "font_class": "undo-filled",
612
+    "unicode": "\ue64c"
613
+  },
614
+  {
615
+    "font_class": "up",
616
+    "unicode": "\ue6b6"
617
+  },
618
+	{
619
+	  "font_class": "top",
620
+	  "unicode": "\ue6b6"
621
+	},
622
+  {
623
+    "font_class": "upload",
624
+    "unicode": "\ue690"
625
+  },
626
+  {
627
+    "font_class": "upload-filled",
628
+    "unicode": "\ue68e"
629
+  },
630
+  {
631
+    "font_class": "videocam",
632
+    "unicode": "\ue68c"
633
+  },
634
+  {
635
+    "font_class": "videocam-filled",
636
+    "unicode": "\ue689"
637
+  },
638
+  {
639
+    "font_class": "vip",
640
+    "unicode": "\ue6a8"
641
+  },
642
+  {
643
+    "font_class": "vip-filled",
644
+    "unicode": "\ue6c6"
645
+  },
646
+  {
647
+    "font_class": "wallet",
648
+    "unicode": "\ue6b1"
649
+  },
650
+  {
651
+    "font_class": "wallet-filled",
652
+    "unicode": "\ue6c2"
653
+  },
654
+  {
655
+    "font_class": "weibo",
656
+    "unicode": "\ue68b"
657
+  },
658
+  {
659
+    "font_class": "weixin",
660
+    "unicode": "\ue691"
661
+  }
662
+] as IconsDataItem[]
663
+
664
+// export const fontData = JSON.parse<IconsDataItem>(fontDataJson)

+ 649 - 0
uni_modules/uni-icons/components/uni-icons/uniicons_file_vue.js

@@ -0,0 +1,649 @@
1
+
2
+export const fontData = [
3
+  {
4
+    "font_class": "arrow-down",
5
+    "unicode": "\ue6be"
6
+  },
7
+  {
8
+    "font_class": "arrow-left",
9
+    "unicode": "\ue6bc"
10
+  },
11
+  {
12
+    "font_class": "arrow-right",
13
+    "unicode": "\ue6bb"
14
+  },
15
+  {
16
+    "font_class": "arrow-up",
17
+    "unicode": "\ue6bd"
18
+  },
19
+  {
20
+    "font_class": "auth",
21
+    "unicode": "\ue6ab"
22
+  },
23
+  {
24
+    "font_class": "auth-filled",
25
+    "unicode": "\ue6cc"
26
+  },
27
+  {
28
+    "font_class": "back",
29
+    "unicode": "\ue6b9"
30
+  },
31
+  {
32
+    "font_class": "bars",
33
+    "unicode": "\ue627"
34
+  },
35
+  {
36
+    "font_class": "calendar",
37
+    "unicode": "\ue6a0"
38
+  },
39
+  {
40
+    "font_class": "calendar-filled",
41
+    "unicode": "\ue6c0"
42
+  },
43
+  {
44
+    "font_class": "camera",
45
+    "unicode": "\ue65a"
46
+  },
47
+  {
48
+    "font_class": "camera-filled",
49
+    "unicode": "\ue658"
50
+  },
51
+  {
52
+    "font_class": "cart",
53
+    "unicode": "\ue631"
54
+  },
55
+  {
56
+    "font_class": "cart-filled",
57
+    "unicode": "\ue6d0"
58
+  },
59
+  {
60
+    "font_class": "chat",
61
+    "unicode": "\ue65d"
62
+  },
63
+  {
64
+    "font_class": "chat-filled",
65
+    "unicode": "\ue659"
66
+  },
67
+  {
68
+    "font_class": "chatboxes",
69
+    "unicode": "\ue696"
70
+  },
71
+  {
72
+    "font_class": "chatboxes-filled",
73
+    "unicode": "\ue692"
74
+  },
75
+  {
76
+    "font_class": "chatbubble",
77
+    "unicode": "\ue697"
78
+  },
79
+  {
80
+    "font_class": "chatbubble-filled",
81
+    "unicode": "\ue694"
82
+  },
83
+  {
84
+    "font_class": "checkbox",
85
+    "unicode": "\ue62b"
86
+  },
87
+  {
88
+    "font_class": "checkbox-filled",
89
+    "unicode": "\ue62c"
90
+  },
91
+  {
92
+    "font_class": "checkmarkempty",
93
+    "unicode": "\ue65c"
94
+  },
95
+  {
96
+    "font_class": "circle",
97
+    "unicode": "\ue65b"
98
+  },
99
+  {
100
+    "font_class": "circle-filled",
101
+    "unicode": "\ue65e"
102
+  },
103
+  {
104
+    "font_class": "clear",
105
+    "unicode": "\ue66d"
106
+  },
107
+  {
108
+    "font_class": "close",
109
+    "unicode": "\ue673"
110
+  },
111
+  {
112
+    "font_class": "closeempty",
113
+    "unicode": "\ue66c"
114
+  },
115
+  {
116
+    "font_class": "cloud-download",
117
+    "unicode": "\ue647"
118
+  },
119
+  {
120
+    "font_class": "cloud-download-filled",
121
+    "unicode": "\ue646"
122
+  },
123
+  {
124
+    "font_class": "cloud-upload",
125
+    "unicode": "\ue645"
126
+  },
127
+  {
128
+    "font_class": "cloud-upload-filled",
129
+    "unicode": "\ue648"
130
+  },
131
+  {
132
+    "font_class": "color",
133
+    "unicode": "\ue6cf"
134
+  },
135
+  {
136
+    "font_class": "color-filled",
137
+    "unicode": "\ue6c9"
138
+  },
139
+  {
140
+    "font_class": "compose",
141
+    "unicode": "\ue67f"
142
+  },
143
+  {
144
+    "font_class": "contact",
145
+    "unicode": "\ue693"
146
+  },
147
+  {
148
+    "font_class": "contact-filled",
149
+    "unicode": "\ue695"
150
+  },
151
+  {
152
+    "font_class": "down",
153
+    "unicode": "\ue6b8"
154
+  },
155
+	{
156
+	  "font_class": "bottom",
157
+	  "unicode": "\ue6b8"
158
+	},
159
+  {
160
+    "font_class": "download",
161
+    "unicode": "\ue68d"
162
+  },
163
+  {
164
+    "font_class": "download-filled",
165
+    "unicode": "\ue681"
166
+  },
167
+  {
168
+    "font_class": "email",
169
+    "unicode": "\ue69e"
170
+  },
171
+  {
172
+    "font_class": "email-filled",
173
+    "unicode": "\ue69a"
174
+  },
175
+  {
176
+    "font_class": "eye",
177
+    "unicode": "\ue651"
178
+  },
179
+  {
180
+    "font_class": "eye-filled",
181
+    "unicode": "\ue66a"
182
+  },
183
+  {
184
+    "font_class": "eye-slash",
185
+    "unicode": "\ue6b3"
186
+  },
187
+  {
188
+    "font_class": "eye-slash-filled",
189
+    "unicode": "\ue6b4"
190
+  },
191
+  {
192
+    "font_class": "fire",
193
+    "unicode": "\ue6a1"
194
+  },
195
+  {
196
+    "font_class": "fire-filled",
197
+    "unicode": "\ue6c5"
198
+  },
199
+  {
200
+    "font_class": "flag",
201
+    "unicode": "\ue65f"
202
+  },
203
+  {
204
+    "font_class": "flag-filled",
205
+    "unicode": "\ue660"
206
+  },
207
+  {
208
+    "font_class": "folder-add",
209
+    "unicode": "\ue6a9"
210
+  },
211
+  {
212
+    "font_class": "folder-add-filled",
213
+    "unicode": "\ue6c8"
214
+  },
215
+  {
216
+    "font_class": "font",
217
+    "unicode": "\ue6a3"
218
+  },
219
+  {
220
+    "font_class": "forward",
221
+    "unicode": "\ue6ba"
222
+  },
223
+  {
224
+    "font_class": "gear",
225
+    "unicode": "\ue664"
226
+  },
227
+  {
228
+    "font_class": "gear-filled",
229
+    "unicode": "\ue661"
230
+  },
231
+  {
232
+    "font_class": "gift",
233
+    "unicode": "\ue6a4"
234
+  },
235
+  {
236
+    "font_class": "gift-filled",
237
+    "unicode": "\ue6c4"
238
+  },
239
+  {
240
+    "font_class": "hand-down",
241
+    "unicode": "\ue63d"
242
+  },
243
+  {
244
+    "font_class": "hand-down-filled",
245
+    "unicode": "\ue63c"
246
+  },
247
+  {
248
+    "font_class": "hand-up",
249
+    "unicode": "\ue63f"
250
+  },
251
+  {
252
+    "font_class": "hand-up-filled",
253
+    "unicode": "\ue63e"
254
+  },
255
+  {
256
+    "font_class": "headphones",
257
+    "unicode": "\ue630"
258
+  },
259
+  {
260
+    "font_class": "heart",
261
+    "unicode": "\ue639"
262
+  },
263
+  {
264
+    "font_class": "heart-filled",
265
+    "unicode": "\ue641"
266
+  },
267
+  {
268
+    "font_class": "help",
269
+    "unicode": "\ue679"
270
+  },
271
+  {
272
+    "font_class": "help-filled",
273
+    "unicode": "\ue674"
274
+  },
275
+  {
276
+    "font_class": "home",
277
+    "unicode": "\ue662"
278
+  },
279
+  {
280
+    "font_class": "home-filled",
281
+    "unicode": "\ue663"
282
+  },
283
+  {
284
+    "font_class": "image",
285
+    "unicode": "\ue670"
286
+  },
287
+  {
288
+    "font_class": "image-filled",
289
+    "unicode": "\ue678"
290
+  },
291
+  {
292
+    "font_class": "images",
293
+    "unicode": "\ue650"
294
+  },
295
+  {
296
+    "font_class": "images-filled",
297
+    "unicode": "\ue64b"
298
+  },
299
+  {
300
+    "font_class": "info",
301
+    "unicode": "\ue669"
302
+  },
303
+  {
304
+    "font_class": "info-filled",
305
+    "unicode": "\ue649"
306
+  },
307
+  {
308
+    "font_class": "left",
309
+    "unicode": "\ue6b7"
310
+  },
311
+  {
312
+    "font_class": "link",
313
+    "unicode": "\ue6a5"
314
+  },
315
+  {
316
+    "font_class": "list",
317
+    "unicode": "\ue644"
318
+  },
319
+  {
320
+    "font_class": "location",
321
+    "unicode": "\ue6ae"
322
+  },
323
+  {
324
+    "font_class": "location-filled",
325
+    "unicode": "\ue6af"
326
+  },
327
+  {
328
+    "font_class": "locked",
329
+    "unicode": "\ue66b"
330
+  },
331
+  {
332
+    "font_class": "locked-filled",
333
+    "unicode": "\ue668"
334
+  },
335
+  {
336
+    "font_class": "loop",
337
+    "unicode": "\ue633"
338
+  },
339
+  {
340
+    "font_class": "mail-open",
341
+    "unicode": "\ue643"
342
+  },
343
+  {
344
+    "font_class": "mail-open-filled",
345
+    "unicode": "\ue63a"
346
+  },
347
+  {
348
+    "font_class": "map",
349
+    "unicode": "\ue667"
350
+  },
351
+  {
352
+    "font_class": "map-filled",
353
+    "unicode": "\ue666"
354
+  },
355
+  {
356
+    "font_class": "map-pin",
357
+    "unicode": "\ue6ad"
358
+  },
359
+  {
360
+    "font_class": "map-pin-ellipse",
361
+    "unicode": "\ue6ac"
362
+  },
363
+  {
364
+    "font_class": "medal",
365
+    "unicode": "\ue6a2"
366
+  },
367
+  {
368
+    "font_class": "medal-filled",
369
+    "unicode": "\ue6c3"
370
+  },
371
+  {
372
+    "font_class": "mic",
373
+    "unicode": "\ue671"
374
+  },
375
+  {
376
+    "font_class": "mic-filled",
377
+    "unicode": "\ue677"
378
+  },
379
+  {
380
+    "font_class": "micoff",
381
+    "unicode": "\ue67e"
382
+  },
383
+  {
384
+    "font_class": "micoff-filled",
385
+    "unicode": "\ue6b0"
386
+  },
387
+  {
388
+    "font_class": "minus",
389
+    "unicode": "\ue66f"
390
+  },
391
+  {
392
+    "font_class": "minus-filled",
393
+    "unicode": "\ue67d"
394
+  },
395
+  {
396
+    "font_class": "more",
397
+    "unicode": "\ue64d"
398
+  },
399
+  {
400
+    "font_class": "more-filled",
401
+    "unicode": "\ue64e"
402
+  },
403
+  {
404
+    "font_class": "navigate",
405
+    "unicode": "\ue66e"
406
+  },
407
+  {
408
+    "font_class": "navigate-filled",
409
+    "unicode": "\ue67a"
410
+  },
411
+  {
412
+    "font_class": "notification",
413
+    "unicode": "\ue6a6"
414
+  },
415
+  {
416
+    "font_class": "notification-filled",
417
+    "unicode": "\ue6c1"
418
+  },
419
+  {
420
+    "font_class": "paperclip",
421
+    "unicode": "\ue652"
422
+  },
423
+  {
424
+    "font_class": "paperplane",
425
+    "unicode": "\ue672"
426
+  },
427
+  {
428
+    "font_class": "paperplane-filled",
429
+    "unicode": "\ue675"
430
+  },
431
+  {
432
+    "font_class": "person",
433
+    "unicode": "\ue699"
434
+  },
435
+  {
436
+    "font_class": "person-filled",
437
+    "unicode": "\ue69d"
438
+  },
439
+  {
440
+    "font_class": "personadd",
441
+    "unicode": "\ue69f"
442
+  },
443
+  {
444
+    "font_class": "personadd-filled",
445
+    "unicode": "\ue698"
446
+  },
447
+  {
448
+    "font_class": "personadd-filled-copy",
449
+    "unicode": "\ue6d1"
450
+  },
451
+  {
452
+    "font_class": "phone",
453
+    "unicode": "\ue69c"
454
+  },
455
+  {
456
+    "font_class": "phone-filled",
457
+    "unicode": "\ue69b"
458
+  },
459
+  {
460
+    "font_class": "plus",
461
+    "unicode": "\ue676"
462
+  },
463
+  {
464
+    "font_class": "plus-filled",
465
+    "unicode": "\ue6c7"
466
+  },
467
+  {
468
+    "font_class": "plusempty",
469
+    "unicode": "\ue67b"
470
+  },
471
+  {
472
+    "font_class": "pulldown",
473
+    "unicode": "\ue632"
474
+  },
475
+  {
476
+    "font_class": "pyq",
477
+    "unicode": "\ue682"
478
+  },
479
+  {
480
+    "font_class": "qq",
481
+    "unicode": "\ue680"
482
+  },
483
+  {
484
+    "font_class": "redo",
485
+    "unicode": "\ue64a"
486
+  },
487
+  {
488
+    "font_class": "redo-filled",
489
+    "unicode": "\ue655"
490
+  },
491
+  {
492
+    "font_class": "refresh",
493
+    "unicode": "\ue657"
494
+  },
495
+  {
496
+    "font_class": "refresh-filled",
497
+    "unicode": "\ue656"
498
+  },
499
+  {
500
+    "font_class": "refreshempty",
501
+    "unicode": "\ue6bf"
502
+  },
503
+  {
504
+    "font_class": "reload",
505
+    "unicode": "\ue6b2"
506
+  },
507
+  {
508
+    "font_class": "right",
509
+    "unicode": "\ue6b5"
510
+  },
511
+  {
512
+    "font_class": "scan",
513
+    "unicode": "\ue62a"
514
+  },
515
+  {
516
+    "font_class": "search",
517
+    "unicode": "\ue654"
518
+  },
519
+  {
520
+    "font_class": "settings",
521
+    "unicode": "\ue653"
522
+  },
523
+  {
524
+    "font_class": "settings-filled",
525
+    "unicode": "\ue6ce"
526
+  },
527
+  {
528
+    "font_class": "shop",
529
+    "unicode": "\ue62f"
530
+  },
531
+  {
532
+    "font_class": "shop-filled",
533
+    "unicode": "\ue6cd"
534
+  },
535
+  {
536
+    "font_class": "smallcircle",
537
+    "unicode": "\ue67c"
538
+  },
539
+  {
540
+    "font_class": "smallcircle-filled",
541
+    "unicode": "\ue665"
542
+  },
543
+  {
544
+    "font_class": "sound",
545
+    "unicode": "\ue684"
546
+  },
547
+  {
548
+    "font_class": "sound-filled",
549
+    "unicode": "\ue686"
550
+  },
551
+  {
552
+    "font_class": "spinner-cycle",
553
+    "unicode": "\ue68a"
554
+  },
555
+  {
556
+    "font_class": "staff",
557
+    "unicode": "\ue6a7"
558
+  },
559
+  {
560
+    "font_class": "staff-filled",
561
+    "unicode": "\ue6cb"
562
+  },
563
+  {
564
+    "font_class": "star",
565
+    "unicode": "\ue688"
566
+  },
567
+  {
568
+    "font_class": "star-filled",
569
+    "unicode": "\ue68f"
570
+  },
571
+  {
572
+    "font_class": "starhalf",
573
+    "unicode": "\ue683"
574
+  },
575
+  {
576
+    "font_class": "trash",
577
+    "unicode": "\ue687"
578
+  },
579
+  {
580
+    "font_class": "trash-filled",
581
+    "unicode": "\ue685"
582
+  },
583
+  {
584
+    "font_class": "tune",
585
+    "unicode": "\ue6aa"
586
+  },
587
+  {
588
+    "font_class": "tune-filled",
589
+    "unicode": "\ue6ca"
590
+  },
591
+  {
592
+    "font_class": "undo",
593
+    "unicode": "\ue64f"
594
+  },
595
+  {
596
+    "font_class": "undo-filled",
597
+    "unicode": "\ue64c"
598
+  },
599
+  {
600
+    "font_class": "up",
601
+    "unicode": "\ue6b6"
602
+  },
603
+	{
604
+	  "font_class": "top",
605
+	  "unicode": "\ue6b6"
606
+	},
607
+  {
608
+    "font_class": "upload",
609
+    "unicode": "\ue690"
610
+  },
611
+  {
612
+    "font_class": "upload-filled",
613
+    "unicode": "\ue68e"
614
+  },
615
+  {
616
+    "font_class": "videocam",
617
+    "unicode": "\ue68c"
618
+  },
619
+  {
620
+    "font_class": "videocam-filled",
621
+    "unicode": "\ue689"
622
+  },
623
+  {
624
+    "font_class": "vip",
625
+    "unicode": "\ue6a8"
626
+  },
627
+  {
628
+    "font_class": "vip-filled",
629
+    "unicode": "\ue6c6"
630
+  },
631
+  {
632
+    "font_class": "wallet",
633
+    "unicode": "\ue6b1"
634
+  },
635
+  {
636
+    "font_class": "wallet-filled",
637
+    "unicode": "\ue6c2"
638
+  },
639
+  {
640
+    "font_class": "weibo",
641
+    "unicode": "\ue68b"
642
+  },
643
+  {
644
+    "font_class": "weixin",
645
+    "unicode": "\ue691"
646
+  }
647
+]
648
+
649
+// export const fontData = JSON.parse<IconsDataItem>(fontDataJson)

+ 14 - 12
uni_modules/uni-icons/package.json

@@ -1,7 +1,7 @@
1 1
 {
2 2
   "id": "uni-icons",
3 3
   "displayName": "uni-icons 图标",
4
-  "version": "1.3.5",
4
+  "version": "2.0.9",
5 5
   "description": "图标组件,用于展示移动端常见的图标,可自定义颜色、大小。",
6 6
   "keywords": [
7 7
     "uni-ui",
@@ -16,11 +16,7 @@
16 16
   "directories": {
17 17
     "example": "../../temps/example_temps"
18 18
   },
19
-  "dcloudext": {
20
-    "category": [
21
-      "前端组件",
22
-      "通用组件"
23
-    ],
19
+"dcloudext": {
24 20
     "sale": {
25 21
       "regular": {
26 22
         "price": "0.00"
@@ -37,7 +33,8 @@
37 33
       "data": "无",
38 34
       "permissions": "无"
39 35
     },
40
-    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
36
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
37
+    "type": "component-vue"
41 38
   },
42 39
   "uni_modules": {
43 40
     "dependencies": ["uni-scss"],
@@ -50,7 +47,8 @@
50 47
       "client": {
51 48
         "App": {
52 49
           "app-vue": "y",
53
-          "app-nvue": "y"
50
+          "app-nvue": "y",
51
+          "app-uvue": "y"
54 52
         },
55 53
         "H5-mobile": {
56 54
           "Safari": "y",
@@ -70,11 +68,15 @@
70 68
           "阿里": "y",
71 69
           "百度": "y",
72 70
           "字节跳动": "y",
73
-          "QQ": "y"
71
+          "QQ": "y",
72
+					"钉钉": "y",
73
+					"快手": "y",
74
+					"飞书": "y",
75
+					"京东": "y"
74 76
         },
75 77
         "快应用": {
76
-          "华为": "u",
77
-          "联盟": "u"
78
+          "华为": "y",
79
+          "联盟": "y"
78 80
         },
79 81
         "Vue": {
80 82
             "vue2": "y",
@@ -83,4 +85,4 @@
83 85
       }
84 86
     }
85 87
   }
86
-}
88
+}

+ 1 - 1
uni_modules/uni-indexed-list/components/uni-indexed-list/uni-indexed-list-item.vue

@@ -53,7 +53,7 @@
53 53
 	}
54 54
 </script>
55 55
 
56
-<style lang="scss" >
56
+<style lang="scss" scoped>
57 57
 	.uni-indexed-list__list {
58 58
 		background-color: $uni-bg-color;
59 59
 		/* #ifndef APP-NVUE */

+ 2 - 2
uni_modules/uni-indexed-list/components/uni-indexed-list/uni-indexed-list.vue

@@ -140,7 +140,7 @@
140 140
 			setList() {
141 141
 				let index = 0;
142 142
 				this.lists = []
143
-				this.options.forEach((value) => {
143
+				this.options.forEach((value, index) => {
144 144
 					if (value.data.length === 0) {
145 145
 						return
146 146
 					}
@@ -282,7 +282,7 @@
282 282
 		}
283 283
 	}
284 284
 </script>
285
-<style lang="scss" >
285
+<style lang="scss" scoped>
286 286
 	.uni-indexed-list {
287 287
 		position: absolute;
288 288
 		left: 0;

+ 2 - 0
uni_modules/uni-notice-bar/changelog.md

@@ -1,3 +1,5 @@
1
+## 1.2.2(2023-12-20)
2
+- 修复动态绑定title时,滚动速度不一致的问题
1 3
 ## 1.2.1(2022-09-05)
2 4
 - 新增 属性 fontSize,可修改文字大小。
3 5
 ## 1.2.0(2021-11-19)

+ 5 - 0
uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar.vue

@@ -150,6 +150,11 @@
150 150
 				animationDelay: '0s'
151 151
 			}
152 152
 		},
153
+		watch:{
154
+			text:function(newValue,oldValue){
155
+				this.initSize();
156
+			}
157
+		},
153 158
 		computed: {
154 159
 			isShowGetMore() {
155 160
 				return this.showGetMore === true || this.showGetMore === 'true'

+ 1 - 1
uni_modules/uni-notice-bar/package.json

@@ -1,7 +1,7 @@
1 1
 {
2 2
   "id": "uni-notice-bar",
3 3
   "displayName": "uni-notice-bar 通告栏",
4
-  "version": "1.2.1",
4
+  "version": "1.2.2",
5 5
   "description": "NoticeBar 通告栏组件,常用于展示公告信息,可设为滚动公告",
6 6
   "keywords": [
7 7
     "uni-ui",

+ 14 - 0
uni_modules/uni-number-box/changelog.md

@@ -1,3 +1,17 @@
1
+## 1.2.8(2024-04-26)
2
+- 修复 在vue2下H5黑边的bug
3
+## 1.2.7(2024-04-26)
4
+- 修复 在vue2手动输入后失焦导致清空数值的严重bug
5
+## 1.2.6(2024-02-22)
6
+- 新增 设置宽度属性width(单位:px)
7
+## 1.2.5(2024-02-21)
8
+- 修复 step步长小于1时,键盘类型为number的bug
9
+## 1.2.4(2024-02-02)
10
+- 修复 加减号垂直位置偏移样式问题
11
+## 1.2.3(2023-05-23)
12
+- 更新示例工程
13
+## 1.2.2(2023-05-08)
14
+- 修复 change 事件执行顺序错误的问题
1 15
 ## 1.2.1(2021-11-22)
2 16
 - 修复 vue3中某些scss变量无法找到的问题
3 17
 ## 1.2.0(2021-11-19)

+ 22 - 11
uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue

@@ -1,12 +1,14 @@
1 1
 <template>
2 2
 	<view class="uni-numbox">
3 3
 		<view @click="_calcValue('minus')" class="uni-numbox__minus uni-numbox-btns" :style="{background}">
4
-			<text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue <= min || disabled }" :style="{color}">-</text>
4
+			<text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue <= min || disabled }"
5
+				:style="{color}">-</text>
5 6
 		</view>
6
-		<input :disabled="disabled" @focus="_onFocus" @blur="_onBlur" class="uni-numbox__value" type="number"
7
-			v-model="inputValue" :style="{background, color}" />
7
+		<input :disabled="disabled" @focus="_onFocus" @blur="_onBlur" class="uni-numbox__value"
8
+			:type="step<1?'digit':'number'" v-model="inputValue" :style="{background, color, width:widthWithPx}" />
8 9
 		<view @click="_calcValue('plus')" class="uni-numbox__plus uni-numbox-btns" :style="{background}">
9
-			<text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue >= max || disabled }" :style="{color}">+</text>
10
+			<text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue >= max || disabled }"
11
+				:style="{color}">+</text>
10 12
 		</view>
11 13
 	</view>
12 14
 </template>
@@ -21,6 +23,7 @@
21 23
 	 * @property {Number} step 每次点击改变的间隔大小
22 24
 	 * @property {String} background 背景色
23 25
 	 * @property {String} color 字体颜色(前景色)
26
+	 * @property {Number} width 输入框宽度(单位:px)
24 27
 	 * @property {Boolean} disabled = [true|false] 是否为禁用状态
25 28
 	 * @event {Function} change 输入框值改变时触发的事件,参数为输入框当前的 value
26 29
 	 * @event {Function} focus 输入框聚焦时触发的事件,参数为 event 对象
@@ -62,6 +65,10 @@
62 65
 			disabled: {
63 66
 				type: Boolean,
64 67
 				default: false
68
+			},
69
+			width: {
70
+				type: Number,
71
+				default: 40,
65 72
 			}
66 73
 		},
67 74
 		data() {
@@ -77,6 +84,11 @@
77 84
 				this.inputValue = +val;
78 85
 			}
79 86
 		},
87
+		computed: {
88
+			widthWithPx() {
89
+				return this.width + 'px';
90
+			}
91
+		},
80 92
 		created() {
81 93
 			if (this.value === 1) {
82 94
 				this.inputValue = +this.modelValue;
@@ -114,11 +126,11 @@
114 126
 				}
115 127
 
116 128
 				this.inputValue = (value / scale).toFixed(String(scale).length - 1);
117
-				this.$emit("change", +this.inputValue);
118 129
 				// TODO vue2 兼容
119 130
 				this.$emit("input", +this.inputValue);
120 131
 				// TODO vue3 兼容
121 132
 				this.$emit("update:modelValue", +this.inputValue);
133
+				this.$emit("change", +this.inputValue);
122 134
 			},
123 135
 			_getDecimalScale() {
124 136
 
@@ -133,7 +145,7 @@
133 145
 				this.$emit('blur', event)
134 146
 				let value = event.detail.value;
135 147
 				if (isNaN(value)) {
136
-					this.inputValue = this.min;
148
+					this.inputValue = this.value;
137 149
 					return;
138 150
 				}
139 151
 				value = +value;
@@ -144,9 +156,9 @@
144 156
 				}
145 157
 				const scale = this._getDecimalScale();
146 158
 				this.inputValue = value.toFixed(String(scale).length - 1);
147
-				this.$emit("change", +this.inputValue);
148 159
 				this.$emit("input", +this.inputValue);
149 160
 				this.$emit("update:modelValue", +this.inputValue);
161
+				this.$emit("change", +this.inputValue);
150 162
 			},
151 163
 			_onFocus(event) {
152 164
 				this.$emit('focus', event)
@@ -154,7 +166,7 @@
154 166
 		}
155 167
 	};
156 168
 </script>
157
-<style lang="scss" >
169
+<style lang="scss">
158 170
 	$box-height: 26px;
159 171
 	$bg: #f5f5f5;
160 172
 	$br: 2px;
@@ -188,8 +200,7 @@
188 200
 		height: $box-height;
189 201
 		text-align: center;
190 202
 		font-size: 14px;
191
-		border-left-width: 0;
192
-		border-right-width: 0;
203
+		border-width: 0;
193 204
 		color: $color;
194 205
 	}
195 206
 
@@ -206,7 +217,7 @@
206 217
 	.uni-numbox--text {
207 218
 		// fix nvue
208 219
 		line-height: 20px;
209
-
220
+		margin-bottom: 2px;
210 221
 		font-size: 20px;
211 222
 		font-weight: 300;
212 223
 		color: $color;

+ 6 - 8
uni_modules/uni-number-box/package.json

@@ -1,7 +1,7 @@
1 1
 {
2 2
   "id": "uni-number-box",
3 3
   "displayName": "uni-number-box 数字输入框",
4
-  "version": "1.2.1",
4
+  "version": "1.2.8",
5 5
   "description": "NumberBox 带加减按钮的数字输入框组件,用户可以控制每次点击增加的数值,支持小数。",
6 6
   "keywords": [
7 7
     "uni-ui",
@@ -15,11 +15,7 @@
15 15
   "directories": {
16 16
     "example": "../../temps/example_temps"
17 17
   },
18
-  "dcloudext": {
19
-    "category": [
20
-      "前端组件",
21
-      "通用组件"
22
-    ],
18
+"dcloudext": {
23 19
     "sale": {
24 20
       "regular": {
25 21
         "price": "0.00"
@@ -36,7 +32,8 @@
36 32
       "data": "无",
37 33
       "permissions": "无"
38 34
     },
39
-    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
35
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
36
+    "type": "component-vue"
40 37
   },
41 38
   "uni_modules": {
42 39
     "dependencies": ["uni-scss"],
@@ -44,7 +41,8 @@
44 41
     "platforms": {
45 42
       "cloud": {
46 43
         "tcb": "y",
47
-        "aliyun": "y"
44
+        "aliyun": "y",
45
+        "alipay": "n"
48 46
       },
49 47
       "client": {
50 48
         "App": {

+ 16 - 0
uni_modules/uni-popup/changelog.md

@@ -1,3 +1,19 @@
1
+## 1.9.1(2024-04-02)
2
+- 修复 uni-popup-dialog vue3下使用value无法进行绑定的bug(双向绑定兼容旧写法)
3
+## 1.9.0(2024-03-28)
4
+- 修复 uni-popup-dialog 双向绑定时初始化逻辑修正
5
+## 1.8.9(2024-03-20)
6
+- 修复 uni-popup-dialog 数据输入时修正为双向绑定
7
+## 1.8.8(2024-02-20)
8
+- 修复 uni-popup 在微信小程序下出现文字向上闪动的bug
9
+## 1.8.7(2024-02-02)
10
+- 新增 uni-popup-dialog 新增属性focus:input模式下,是否自动自动聚焦
11
+## 1.8.6(2024-01-30)
12
+- 新增 uni-popup-dialog 新增属性maxLength:限制输入框字数
13
+## 1.8.5(2024-01-26)
14
+- 新增 uni-popup-dialog 新增属性showClose:控制关闭按钮的显示
15
+## 1.8.4(2023-11-15)
16
+- 新增 uni-popup 支持uni-app-x 注意暂时仅支持 `maskClick` `@open` `@close`
1 17
 ## 1.8.3(2023-04-17)
2 18
 - 修复 uni-popup 重复打开时的 bug
3 19
 ## 1.8.2(2023-02-02)

+ 62 - 21
uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue

@@ -10,14 +10,15 @@
10 10
 		</view>
11 11
 		<view v-else class="uni-dialog-content">
12 12
 			<slot>
13
-				<input class="uni-dialog-input" v-model="val" :type="inputType" :placeholder="placeholderText" :focus="focus" >
13
+				<input class="uni-dialog-input" :maxlength="maxlength" v-model="val" :type="inputType"
14
+					:placeholder="placeholderText" :focus="focus">
14 15
 			</slot>
15 16
 		</view>
16 17
 		<view class="uni-dialog-button-group">
17
-			<view class="uni-dialog-button" @click="closeDialog">
18
+			<view class="uni-dialog-button" v-if="showClose" @click="closeDialog">
18 19
 				<text class="uni-dialog-button-text">{{closeText}}</text>
19 20
 			</view>
20
-			<view class="uni-dialog-button uni-border-left" @click="onOk">
21
+			<view class="uni-dialog-button" :class="showClose?'uni-border-left':''" @click="onOk">
21 22
 				<text class="uni-dialog-button-text uni-button-color">{{okText}}</text>
22 23
 			</view>
23 24
 		</view>
@@ -28,16 +29,19 @@
28 29
 <script>
29 30
 	import popup from '../uni-popup/popup.js'
30 31
 	import {
31
-	initVueI18n
32
+		initVueI18n
32 33
 	} from '@dcloudio/uni-i18n'
33 34
 	import messages from '../uni-popup/i18n/index.js'
34
-	const {	t } = initVueI18n(messages)
35
+	const {
36
+		t
37
+	} = initVueI18n(messages)
35 38
 	/**
36 39
 	 * PopUp 弹出层-对话框样式
37 40
 	 * @description 弹出层-对话框样式
38 41
 	 * @tutorial https://ext.dcloud.net.cn/plugin?id=329
39 42
 	 * @property {String} value input 模式下的默认值
40 43
 	 * @property {String} placeholder input 模式下输入提示
44
+	 * @property {Boolean} focus input模式下是否自动聚焦,默认为true
41 45
 	 * @property {String} type = [success|warning|info|error] 主题样式
42 46
 	 *  @value success 成功
43 47
 	 * 	@value warning 提示
@@ -46,8 +50,10 @@
46 50
 	 * @property {String} mode = [base|input] 模式、
47 51
 	 * 	@value base 基础对话框
48 52
 	 * 	@value input 可输入对话框
53
+	 * @showClose {Boolean} 是否显示关闭按钮
49 54
 	 * @property {String} content 对话框内容
50 55
 	 * @property {Boolean} beforeClose 是否拦截取消事件
56
+	 * @property {Number} maxlength 输入
51 57
 	 * @event {Function} confirm 点击确认按钮触发
52 58
 	 * @event {Function} close 点击取消按钮触发
53 59
 	 */
@@ -55,16 +61,30 @@
55 61
 	export default {
56 62
 		name: "uniPopupDialog",
57 63
 		mixins: [popup],
58
-		emits:['confirm','close'],
64
+		emits: ['confirm', 'close', 'update:modelValue', 'input'],
59 65
 		props: {
60
-			inputType:{
66
+			inputType: {
61 67
 				type: String,
62 68
 				default: 'text'
63 69
 			},
70
+			showClose: {
71
+				type: Boolean,
72
+				default: true
73
+			},
74
+			// #ifdef VUE2
64 75
 			value: {
65 76
 				type: [String, Number],
66 77
 				default: ''
67 78
 			},
79
+			// #endif
80
+			// #ifdef VUE3
81
+			modelValue: {
82
+				type: [Number, String],
83
+				default: ''
84
+			},
85
+			// #endif
86
+
87
+
68 88
 			placeholder: {
69 89
 				type: [String, Number],
70 90
 				default: ''
@@ -89,19 +109,26 @@
89 109
 				type: Boolean,
90 110
 				default: false
91 111
 			},
92
-			cancelText:{
112
+			cancelText: {
93 113
 				type: String,
94 114
 				default: ''
95 115
 			},
96
-			confirmText:{
116
+			confirmText: {
97 117
 				type: String,
98 118
 				default: ''
119
+			},
120
+			maxlength: {
121
+				type: Number,
122
+				default: -1,
123
+			},
124
+			focus: {
125
+				type: Boolean,
126
+				default: true,
99 127
 			}
100 128
 		},
101 129
 		data() {
102 130
 			return {
103 131
 				dialogType: 'error',
104
-				focus: false,
105 132
 				val: ""
106 133
 			}
107 134
 		},
@@ -129,7 +156,21 @@
129 156
 				}
130 157
 			},
131 158
 			value(val) {
132
-				this.val = val
159
+				if (this.maxlength != -1 && this.mode === 'input') {
160
+					this.val = val.slice(0, this.maxlength);
161
+				} else {
162
+					this.val = val
163
+				}
164
+			},
165
+			val(val) {
166
+				// #ifdef VUE2
167
+				// TODO 兼容 vue2
168
+				this.$emit('input', val);
169
+				// #endif
170
+				// #ifdef VUE3
171
+				// TODO 兼容 vue3
172
+				this.$emit('update:modelValue', val);
173
+				// #endif
133 174
 			}
134 175
 		},
135 176
 		created() {
@@ -138,25 +179,25 @@
138 179
 			// this.popup.closeMask()
139 180
 			if (this.mode === 'input') {
140 181
 				this.dialogType = 'info'
141
-				this.val = this.value
182
+				this.val = this.value;
183
+				// #ifdef VUE3
184
+				this.val = this.modelValue;
185
+				// #endif
142 186
 			} else {
143 187
 				this.dialogType = this.type
144 188
 			}
145 189
 		},
146
-		mounted() {
147
-			this.focus = true
148
-		},
149 190
 		methods: {
150 191
 			/**
151 192
 			 * 点击确认按钮
152 193
 			 */
153 194
 			onOk() {
154
-				if (this.mode === 'input'){
195
+				if (this.mode === 'input') {
155 196
 					this.$emit('confirm', this.val)
156
-				}else{
197
+				} else {
157 198
 					this.$emit('confirm')
158 199
 				}
159
-				if(this.beforeClose) return
200
+				if (this.beforeClose) return
160 201
 				this.popup.close()
161 202
 			},
162 203
 			/**
@@ -164,17 +205,17 @@
164 205
 			 */
165 206
 			closeDialog() {
166 207
 				this.$emit('close')
167
-				if(this.beforeClose) return
208
+				if (this.beforeClose) return
168 209
 				this.popup.close()
169 210
 			},
170
-			close(){
211
+			close() {
171 212
 				this.popup.close()
172 213
 			}
173 214
 		}
174 215
 	}
175 216
 </script>
176 217
 
177
-<style lang="scss" >
218
+<style lang="scss">
178 219
 	.uni-popup-dialog {
179 220
 		width: 300px;
180 221
 		border-radius: 11px;

+ 1 - 1
uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue

@@ -47,7 +47,7 @@
47 47
 					{
48 48
 						text: '支付宝',
49 49
 						icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/d684ae40-50be-11eb-8ff1-d5dcf8779628.png',
50
-						name: 'wx'
50
+						name: 'ali'
51 51
 					},
52 52
 					{
53 53
 						text: 'QQ',

+ 90 - 0
uni_modules/uni-popup/components/uni-popup/uni-popup.uvue

@@ -0,0 +1,90 @@
1
+<template>
2
+  <view class="popup-root" v-if="isOpen" v-show="isShow" @click="clickMask">
3
+    <view @click.stop>
4
+      <slot></slot>
5
+    </view>
6
+  </view>
7
+</template>
8
+
9
+<script>
10
+  type CloseCallBack = ()=> void;
11
+  let closeCallBack:CloseCallBack = () :void => {};
12
+  export default {
13
+    emits:["close","clickMask"],
14
+    data() {
15
+      return {
16
+        isShow:false,
17
+        isOpen:false
18
+      }
19
+    },
20
+    props: {
21
+      maskClick: {
22
+        type: Boolean,
23
+        default: true
24
+      },
25
+    },
26
+    watch: {
27
+      // 设置show = true 时,如果没有 open 需要设置为 open
28
+      isShow:{
29
+        handler(isShow) {
30
+          // console.log("isShow",isShow)
31
+          if(isShow && this.isOpen == false){
32
+            this.isOpen = true
33
+          }
34
+        },
35
+        immediate:true
36
+      },
37
+      // 设置isOpen = true 时,如果没有 isShow 需要设置为 isShow
38
+      isOpen:{
39
+        handler(isOpen) {
40
+          // console.log("isOpen",isOpen)
41
+          if(isOpen && this.isShow == false){
42
+            this.isShow = true
43
+          }
44
+        },
45
+        immediate:true
46
+      }
47
+    },
48
+    methods:{
49
+      open(){
50
+        // ...funs : CloseCallBack[]
51
+        // if(funs.length > 0){
52
+        //   closeCallBack = funs[0]
53
+        // }
54
+        this.isOpen = true;
55
+      },
56
+      clickMask(){
57
+        if(this.maskClick == true){
58
+          this.$emit('clickMask')
59
+          this.close()
60
+        }
61
+      },
62
+      close(): void{
63
+        this.isOpen = false;
64
+        this.$emit('close')
65
+        closeCallBack()
66
+      },
67
+      hiden(){
68
+        this.isShow = false
69
+      },
70
+      show(){
71
+        this.isShow = true
72
+      }
73
+    }
74
+  }
75
+</script>
76
+
77
+<style>
78
+.popup-root {
79
+  position: fixed;
80
+  top: 0;
81
+  left: 0;
82
+  width: 750rpx;
83
+  height: 100%;
84
+  flex: 1;
85
+  background-color: rgba(0, 0, 0, 0.3);
86
+  justify-content: center;
87
+  align-items: center;
88
+  z-index: 99;
89
+}
90
+</style>

+ 38 - 8
uni_modules/uni-popup/components/uni-popup/uni-popup.vue

@@ -5,7 +5,7 @@
5 5
 				:duration="duration" :show="showTrans" @click="onTap" />
6 6
 			<uni-transition key="2" :mode-class="ani" name="content" :styles="transClass" :duration="duration"
7 7
 				:show="showTrans" @click="onTap">
8
-				<view class="uni-popup__wrapper" :style="{ backgroundColor: bg }" :class="[popupstyle]" @click="clear">
8
+				<view class="uni-popup__wrapper" :style="getStyles" :class="[popupstyle]" @click="clear">
9 9
 					<slot />
10 10
 				</view>
11 11
 			</uni-transition>
@@ -39,6 +39,7 @@
39 39
 	 * @property {Boolean} isMaskClick = [true|false] 蒙版点击是否关闭弹窗
40 40
 	 * @property {String}  backgroundColor 主窗口背景色
41 41
 	 * @property {String}  maskBackgroundColor 蒙版颜色
42
+	 * @property {String}  borderRadius 设置圆角(左上、右上、右下和左下) 示例:"10px 10px 10px 10px"
42 43
 	 * @property {Boolean} safeArea		   是否适配底部安全区
43 44
 	 * @event {Function} change 打开关闭弹窗触发,e={show: false}
44 45
 	 * @event {Function} maskClick 点击遮罩触发
@@ -86,6 +87,9 @@
86 87
 				type: String,
87 88
 				default: 'rgba(0, 0, 0, 0.4)'
88 89
 			},
90
+			borderRadius:{
91
+				type: String,
92
+			}
89 93
 		},
90 94
 
91 95
 		watch: {
@@ -157,16 +161,25 @@
157 161
 					backgroundColor: 'rgba(0, 0, 0, 0.4)'
158 162
 				},
159 163
 				transClass: {
164
+					backgroundColor: 'transparent',
165
+					borderRadius: this.borderRadius || "0",
160 166
 					position: 'fixed',
161 167
 					left: 0,
162 168
 					right: 0
163 169
 				},
164 170
 				maskShow: true,
165 171
 				mkclick: true,
166
-				popupstyle: this.isDesktop ? 'fixforpc-top' : 'top'
172
+				popupstyle: 'top'
167 173
 			}
168 174
 		},
169 175
 		computed: {
176
+			getStyles() {
177
+				let res = { backgroundColor: this.bg };
178
+				if (this.borderRadius || "0") {
179
+					res = Object.assign(res, { borderRadius: this.borderRadius })
180
+				}
181
+				return res;
182
+			},
170 183
 			isDesktop() {
171 184
 				return this.popupWidth >= 500 && this.popupHeight >= 500
172 185
 			},
@@ -221,6 +234,12 @@
221 234
 			this.setH5Visible()
222 235
 		},
223 236
 		// #endif
237
+		activated() {
238
+   	  this.setH5Visible(!this.showPopup);
239
+    },
240
+    deactivated() {
241
+      this.setH5Visible(true);
242
+    },
224 243
 		created() {
225 244
 			// this.mkclick =  this.isMaskClick || this.maskClick
226 245
 			if (this.isMaskClick === null && this.maskClick === null) {
@@ -240,10 +259,10 @@
240 259
 			this.maskClass.backgroundColor = this.maskBackgroundColor
241 260
 		},
242 261
 		methods: {
243
-			setH5Visible() {
262
+			setH5Visible(visible = true) {
244 263
 				// #ifdef H5
245 264
 				// fix by mehaotian 处理 h5 滚动穿透的问题
246
-				document.getElementsByTagName('body')[0].style.overflow = 'visible'
265
+				document.getElementsByTagName('body')[0].style.overflow =  visible ? "visible" : "hidden";
247 266
 				// #endif
248 267
 			},
249 268
 			/**
@@ -323,7 +342,8 @@
323 342
 					position: 'fixed',
324 343
 					left: 0,
325 344
 					right: 0,
326
-					backgroundColor: this.bg
345
+					backgroundColor: this.bg,
346
+					borderRadius:this.borderRadius || "0"
327 347
 				}
328 348
 				// TODO 兼容 type 属性 ,后续会废弃
329 349
 				if (type) return
@@ -347,7 +367,8 @@
347 367
 					right: 0,
348 368
 					bottom: 0,
349 369
 					paddingBottom: this.safeAreaInsets + 'px',
350
-					backgroundColor: this.bg
370
+					backgroundColor: this.bg,
371
+					borderRadius:this.borderRadius || "0",
351 372
 				}
352 373
 				// TODO 兼容 type 属性 ,后续会废弃
353 374
 				if (type) return
@@ -359,7 +380,13 @@
359 380
 			 */
360 381
 			center(type) {
361 382
 				this.popupstyle = 'center'
362
-				this.ani = ['zoom-out', 'fade']
383
+				//微信小程序下,组合动画会出现文字向上闪动问题,再此做特殊处理
384
+				// #ifdef MP-WEIXIN
385
+					this.ani = ['fade']
386
+				// #endif
387
+				// #ifndef MP-WEIXIN
388
+					this.ani = ['zoom-out', 'fade']
389
+				// #endif
363 390
 				this.transClass = {
364 391
 					position: 'fixed',
365 392
 					/* #ifndef APP-NVUE */
@@ -371,7 +398,8 @@
371 398
 					right: 0,
372 399
 					top: 0,
373 400
 					justifyContent: 'center',
374
-					alignItems: 'center'
401
+					alignItems: 'center',
402
+					borderRadius:this.borderRadius || "0"
375 403
 				}
376 404
 				// TODO 兼容 type 属性 ,后续会废弃
377 405
 				if (type) return
@@ -387,6 +415,7 @@
387 415
 					bottom: 0,
388 416
 					top: 0,
389 417
 					backgroundColor: this.bg,
418
+					borderRadius:this.borderRadius || "0",
390 419
 					/* #ifndef APP-NVUE */
391 420
 					display: 'flex',
392 421
 					flexDirection: 'column'
@@ -406,6 +435,7 @@
406 435
 					right: 0,
407 436
 					top: 0,
408 437
 					backgroundColor: this.bg,
438
+					borderRadius:this.borderRadius || "0",
409 439
 					/* #ifndef APP-NVUE */
410 440
 					display: 'flex',
411 441
 					flexDirection: 'column'

+ 3 - 2
uni_modules/uni-popup/package.json

@@ -1,7 +1,7 @@
1 1
 {
2 2
 	"id": "uni-popup",
3 3
 	"displayName": "uni-popup 弹出层",
4
-	"version": "1.8.3",
4
+	"version": "1.9.1",
5 5
 	"description": " Popup 组件,提供常用的弹层",
6 6
 	"keywords": [
7 7
         "uni-ui",
@@ -46,7 +46,8 @@
46 46
 		"platforms": {
47 47
 			"cloud": {
48 48
 				"tcb": "y",
49
-				"aliyun": "y"
49
+                "aliyun": "y",
50
+                "alipay": "n"
50 51
 			},
51 52
 			"client": {
52 53
 				"App": {

+ 25 - 29
uni_modules/uni-rate/components/uni-rate/uni-rate.vue

@@ -258,34 +258,32 @@
258 258
 			 * 获取星星个数
259 259
 			 */
260 260
 			_getRateCount(clientX) {
261
-				const _this = this;
262
-				this._getSize(function() {
263
-					const size = Number(_this.size)
264
-					if (isNaN(size)) {
265
-						return new Error('size 属性只能设置为数字')
266
-					}
267
-					const rateMoveRange = clientX - _this._rateBoxLeft
268
-					let index = parseInt(rateMoveRange / (size + _this.marginNumber))
269
-					index = index < 0 ? 0 : index;
270
-					index = index > _this.max ? _this.max : index;
271
-					const range = parseInt(rateMoveRange - (size + _this.marginNumber) * index);
272
-					let value = 0;
273
-					if (_this._oldValue === index && !_this.PC) return;
274
-					_this._oldValue = index;
275
-					if (_this.allowHalf) {
276
-						if (range > (size / 2)) {
277
-							value = index + 1
278
-						} else {
279
-							value = index + 0.5
280
-						}
281
-					} else {
261
+				this._getSize()
262
+				const size = Number(this.size)
263
+				if (isNaN(size)) {
264
+					return new Error('size 属性只能设置为数字')
265
+				}
266
+				const rateMoveRange = clientX - this._rateBoxLeft
267
+				let index = parseInt(rateMoveRange / (size + this.marginNumber))
268
+				index = index < 0 ? 0 : index;
269
+				index = index > this.max ? this.max : index;
270
+				const range = parseInt(rateMoveRange - (size + this.marginNumber) * index);
271
+				let value = 0;
272
+				if (this._oldValue === index && !this.PC) return;
273
+				this._oldValue = index;
274
+				if (this.allowHalf) {
275
+					if (range > (size / 2)) {
282 276
 						value = index + 1
277
+					} else {
278
+						value = index + 0.5
283 279
 					}
284
-					
285
-					value = Math.max(0.5, Math.min(value, _this.max))
286
-					_this.valueSync = value
287
-					_this._onChange()
288
-				})
280
+				} else {
281
+					value = index + 1
282
+				}
283
+
284
+				value = Math.max(0.5, Math.min(value, this.max))
285
+				this.valueSync = value
286
+				this._onChange()
289 287
 			},
290 288
 
291 289
 			/**
@@ -302,7 +300,7 @@
302 300
 			/**
303 301
 			 * 获取星星距离屏幕左侧距离
304 302
 			 */
305
-			_getSize(fn) {
303
+			_getSize() {
306 304
 				// #ifndef APP-NVUE
307 305
 				uni.createSelectorQuery()
308 306
 					.in(this)
@@ -311,7 +309,6 @@
311 309
 					.exec(ret => {
312 310
 						if (ret) {
313 311
 							this._rateBoxLeft = ret[0].left
314
-							fn && fn()
315 312
 						}
316 313
 					})
317 314
 				// #endif
@@ -320,7 +317,6 @@
320 317
 					const size = ret.size
321 318
 					if (size) {
322 319
 						this._rateBoxLeft = size.left
323
-						fn && fn()
324 320
 					}
325 321
 				})
326 322
 				// #endif

+ 1 - 1
uni_modules/uni-row/components/uni-col/uni-col.vue

@@ -212,7 +212,7 @@
212 212
 	}
213 213
 </script>
214 214
 
215
-<style lang='scss' >
215
+<style lang='scss' scoped>
216 216
 	/* breakpoints */
217 217
 	$--sm: 768px !default;
218 218
 	$--md: 992px !default;

+ 1 - 1
uni_modules/uni-row/components/uni-row/uni-row.vue

@@ -180,7 +180,7 @@
180 180
 	}
181 181
 
182 182
 	// 字节、QQ配置后不生效
183
-	// 此处用法无法使用
183
+	// 此处用法无法使用scoped
184 184
 	/* #ifdef MP-WEIXIN || MP-TOUTIAO || MP-QQ */
185 185
 	:host {
186 186
 		display: block;

+ 14 - 0
uni_modules/uni-search-bar/changelog.md

@@ -1,3 +1,17 @@
1
+## 1.3.0(2024-04-22)
2
+- 修复 textColor默认值导致的文字不显示的bug
3
+## 1.2.9(2024-04-17)
4
+- 修复 textColor不生效的bug
5
+## 1.2.8(2024-02-22)
6
+- 修复 清空按钮emit值错误的bug
7
+## 1.2.7(2024-02-21)
8
+- 新增 设置输入框字体颜色:textColor
9
+## 1.2.6(2024-02-20)
10
+- 修复 uni-search-bar在支付宝小程序下样式兼容问题
11
+## 1.2.5(2024-01-31)
12
+- 修复 uni-search-bar居中问题,现在默认居左,并修复样式偏移问题
13
+## 1.2.4(2023-05-09)
14
+- 修复 i18n 国际化不正确的 Bug
1 15
 ## 1.2.3(2022-05-24)
2 16
 - 新增 readonly 属性,组件只读
3 17
 ## 1.2.2(2022-05-06)

+ 1 - 1
uni_modules/uni-search-bar/components/uni-search-bar/i18n/zh-Hans.json

@@ -1,4 +1,4 @@
1 1
 {
2
-	"uni-search-bar.cancel": "cancel",
2
+	"uni-search-bar.cancel": "取消",
3 3
 	"uni-search-bar.placeholder": "请输入搜索内容"
4 4
 }

+ 1 - 1
uni_modules/uni-search-bar/components/uni-search-bar/i18n/zh-Hant.json

@@ -1,4 +1,4 @@
1 1
 {
2
-	"uni-search-bar.cancel": "cancel",
2
+	"uni-search-bar.cancel": "取消",
3 3
 	"uni-search-bar.placeholder": "請輸入搜索內容"
4 4
 }

+ 18 - 7
uni_modules/uni-search-bar/components/uni-search-bar/uni-search-bar.vue

@@ -8,8 +8,8 @@
8 8
 				</slot>
9 9
 			</view>
10 10
 			<input v-if="show || searchVal" :focus="showSync" :disabled="readonly" :placeholder="placeholderText" :maxlength="maxlength"
11
-				class="uni-searchbar__box-search-input" confirm-type="search" type="text" v-model="searchVal"
12
-				@confirm="confirm" @blur="blur" @focus="emitFocus" />
11
+				class="uni-searchbar__box-search-input" confirm-type="search" type="text" v-model="searchVal" :style="{color:textColor}"
12
+				@confirm="confirm" @blur="blur" @focus="emitFocus"/>
13 13
 			<text v-else class="uni-searchbar__text-placeholder">{{ placeholder }}</text>
14 14
 			<view v-if="show && (clearButton==='always'||clearButton==='auto'&&searchVal!=='') &&!readonly"
15 15
 				class="uni-searchbar__box-icon-clear" @click="clear">
@@ -49,6 +49,7 @@
49 49
 	 * 	@value none 一直不显示
50 50
 	 * @property {String} cancelText 取消按钮的文字
51 51
 	 * @property {String} bgColor 输入框背景颜色
52
+	 * @property {String} textColor 输入文字颜色
52 53
 	 * @property {Boolean} focus 是否自动聚焦
53 54
 	 * @property {Boolean} readonly 组件只读,不能有任何操作,只做展示
54 55
 	 * @event {Function} confirm uniSearchBar 的输入框 confirm 事件,返回参数为uniSearchBar的value,e={value:Number}
@@ -80,12 +81,16 @@
80 81
 			},
81 82
 			cancelText: {
82 83
 				type: String,
83
-				default: '取消'
84
+				default: ""
84 85
 			},
85 86
 			bgColor: {
86 87
 				type: String,
87 88
 				default: "#F8F8F8"
88 89
 			},
90
+			textColor: {
91
+				type: String,
92
+				default: "#000000"
93
+			},
89 94
 			maxlength: {
90 95
 				type: [Number, String],
91 96
 				default: 100
@@ -176,10 +181,10 @@
176 181
 				})
177 182
 			},
178 183
 			clear() {
179
-				this.$emit("clear", {
180
-					value: this.searchVal
181
-				})
182 184
 				this.searchVal = ""
185
+				this.$nextTick(() => {
186
+					this.$emit("clear", { value: "" })
187
+				})
183 188
 			},
184 189
 			cancel() {
185 190
 				if(this.readonly) return
@@ -242,11 +247,11 @@
242 247
 		/* #ifndef APP-NVUE */
243 248
 		display: flex;
244 249
 		box-sizing: border-box;
250
+		justify-content: left;
245 251
 		/* #endif */
246 252
 		overflow: hidden;
247 253
 		position: relative;
248 254
 		flex: 1;
249
-		justify-content: center;
250 255
 		flex-direction: row;
251 256
 		align-items: center;
252 257
 		height: $uni-searchbar-height;
@@ -269,6 +274,11 @@
269 274
 		flex: 1;
270 275
 		font-size: 14px;
271 276
 		color: #333;
277
+		margin-left: 5px;
278
+		margin-top: 1px;
279
+		/* #ifndef APP-NVUE */
280
+		background-color: inherit;
281
+		/* #endif */
272 282
 	}
273 283
 
274 284
 	.uni-searchbar__box-icon-clear {
@@ -284,6 +294,7 @@
284 294
 		font-size: 14px;
285 295
 		color: #B3B3B3;
286 296
 		margin-left: 5px;
297
+		text-align: left;
287 298
 	}
288 299
 
289 300
 	.uni-searchbar__cancel {

+ 6 - 8
uni_modules/uni-search-bar/package.json

@@ -1,7 +1,7 @@
1 1
 {
2 2
   "id": "uni-search-bar",
3 3
   "displayName": "uni-search-bar 搜索栏",
4
-  "version": "1.2.3",
4
+  "version": "1.3.0",
5 5
   "description": "搜索栏组件,通常用于搜索商品、文章等",
6 6
   "keywords": [
7 7
     "uni-ui",
@@ -16,11 +16,7 @@
16 16
   "directories": {
17 17
     "example": "../../temps/example_temps"
18 18
   },
19
-  "dcloudext": {
20
-    "category": [
21
-      "前端组件",
22
-      "通用组件"
23
-    ],
19
+"dcloudext": {
24 20
     "sale": {
25 21
       "regular": {
26 22
         "price": "0.00"
@@ -37,7 +33,8 @@
37 33
       "data": "无",
38 34
       "permissions": "无"
39 35
     },
40
-    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
36
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
37
+    "type": "component-vue"
41 38
   },
42 39
   "uni_modules": {
43 40
     "dependencies": [
@@ -48,7 +45,8 @@
48 45
     "platforms": {
49 46
       "cloud": {
50 47
         "tcb": "y",
51
-        "aliyun": "y"
48
+        "aliyun": "y",
49
+        "alipay": "n"
52 50
       },
53 51
       "client": {
54 52
         "App": {

+ 6 - 0
uni_modules/uni-segmented-control/changelog.md

@@ -1,3 +1,9 @@
1
+## 1.2.3(2024-04-02)
2
+- 修复 修复在微信小程序下inactiveColor失效bug
3
+## 1.2.2(2024-03-28)
4
+- 修复 在vue2下:style动态绑定导致编译失败的bug
5
+## 1.2.1(2024-03-20)
6
+- 新增 inActiveColor属性,可供配置未激活时的颜色
1 7
 ## 1.2.0(2021-11-19)
2 8
 - 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
3 9
 - 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-segmented-control](https://uniapp.dcloud.io/component/uniui/uni-segmented-control)

+ 15 - 14
uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.vue

@@ -1,21 +1,16 @@
1 1
 <template>
2 2
 	<view :class="[styleType === 'text'?'segmented-control--text' : 'segmented-control--button' ]"
3 3
 		:style="{ borderColor: styleType === 'text' ? '' : activeColor }" class="segmented-control">
4
-		<view v-for="(item, index) in values" :class="[ styleType === 'text' ? '': 'segmented-control__item--button',
5
-		index === currentIndex&&styleType === 'button' ? 'segmented-control__item--button--active': '',
6
-		index === 0&&styleType === 'button' ? 'segmented-control__item--button--first': '',
7
-			index === values.length - 1&&styleType === 'button' ? 'segmented-control__item--button--last': '' ]" :key="index"
8
-			:style="{ backgroundColor: index === currentIndex && styleType === 'button' ? activeColor : '',borderColor: index === currentIndex&&(styleType === 'text'||styleType === 'button')?activeColor:'#d9d9d9' }"
4
+		<view v-for="(item, index) in values" :class="[styleType === 'text' ? '' : 'segmented-control__item--button',
5
+					index === 0 && styleType === 'button' ? 'segmented-control__item--button--first' : '',
6
+					index === values.length - 1 && styleType === 'button' ? 'segmented-control__item--button--last':'']" :key="index"
7
+			:style="{backgroundColor: index === currentIndex && styleType === 'button' ? activeColor : styleType === 'button' ?inActiveColor:'transparent', borderColor: index === currentIndex && styleType === 'text' || styleType === 'button' ? activeColor : inActiveColor}"
9 8
 			class="segmented-control__item" @click="_onClick(index)">
10 9
 			<view>
11
-				<text :style="{color:
12
-				    index === currentIndex
13
-				      ? styleType === 'text'
14
-				        ? activeColor
15
-				        : '#fff'
16
-				      : styleType === 'text'
17
-				        ? '#000'
18
-				        : activeColor}" class="segmented-control__text" :class="styleType === 'text' && index === currentIndex ? 'segmented-control__item--text': ''">{{ item }}</text>
10
+				<text
11
+					:style="{color:index === currentIndex? styleType === 'text'? activeColor: '#fff': styleType === 'text'? '#000': activeColor}"
12
+					class="segmented-control__text"
13
+					:class="styleType === 'text' && index === currentIndex ? 'segmented-control__item--text': ''">{{ item }}</text>
19 14
 			</view>
20 15
 
21 16
 		</view>
@@ -32,6 +27,7 @@
32 27
 	 * 	@value button 按钮类型
33 28
 	 * 	@value text 文字类型
34 29
 	 * @property {String} activeColor 选中的标签背景色与边框颜色
30
+	 * @property {String} inActiveColor 未选中的标签背景色与边框颜色
35 31
 	 * @property {Array} values 选项数组
36 32
 	 * @event {Function} clickItem 组件触发点击事件时触发,e={currentIndex}
37 33
 	 */
@@ -54,6 +50,10 @@
54 50
 				type: String,
55 51
 				default: '#2979FF'
56 52
 			},
53
+			inActiveColor: {
54
+				type: String,
55
+				default: 'transparent'
56
+			},
57 57
 			styleType: {
58 58
 				type: String,
59 59
 				default: 'button'
@@ -71,6 +71,7 @@
71 71
 				}
72 72
 			}
73 73
 		},
74
+		computed: {},
74 75
 		created() {
75 76
 			this.currentIndex = this.current
76 77
 		},
@@ -87,7 +88,7 @@
87 88
 	}
88 89
 </script>
89 90
 
90
-<style lang="scss" >
91
+<style lang="scss" scoped>
91 92
 	.segmented-control {
92 93
 		/* #ifndef APP-NVUE */
93 94
 		display: flex;

+ 6 - 8
uni_modules/uni-segmented-control/package.json

@@ -1,7 +1,7 @@
1 1
 {
2 2
   "id": "uni-segmented-control",
3 3
   "displayName": "uni-segmented-control 分段器",
4
-  "version": "1.2.0",
4
+  "version": "1.2.3",
5 5
   "description": "分段器由至少 2 个分段控件组成,用作不同视图的显示",
6 6
   "keywords": [
7 7
     "uni-ui",
@@ -17,11 +17,7 @@
17 17
   "directories": {
18 18
     "example": "../../temps/example_temps"
19 19
   },
20
-  "dcloudext": {
21
-    "category": [
22
-      "前端组件",
23
-      "通用组件"
24
-    ],
20
+"dcloudext": {
25 21
     "sale": {
26 22
       "regular": {
27 23
         "price": "0.00"
@@ -38,7 +34,8 @@
38 34
       "data": "无",
39 35
       "permissions": "无"
40 36
     },
41
-    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
37
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
38
+    "type": "component-vue"
42 39
   },
43 40
   "uni_modules": {
44 41
     "dependencies": ["uni-scss"],
@@ -46,7 +43,8 @@
46 43
     "platforms": {
47 44
       "cloud": {
48 45
         "tcb": "y",
49
-        "aliyun": "y"
46
+        "aliyun": "y",
47
+        "alipay": "n"
50 48
       },
51 49
       "client": {
52 50
         "App": {

+ 2 - 0
uni_modules/uni-steps/changelog.md

@@ -1,3 +1,5 @@
1
+## 1.1.2(2024-03-28)
2
+- 修复 uni-steps为竖排列时,文本长度过长引起点错乱的bug
1 3
 ## 1.1.1(2021-11-22)
2 4
 - 修复 vue3中某些scss变量无法找到的问题
3 5
 ## 1.1.0(2021-11-19)

+ 20 - 9
uni_modules/uni-steps/components/uni-steps/uni-steps.vue

@@ -12,21 +12,20 @@
12 12
 			</view>
13 13
 			<view :class="[direction==='column'?'uni-steps__column-container':'uni-steps__row-container']">
14 14
 				<view :class="[direction==='column'?'uni-steps__column-line-item':'uni-steps__row-line-item']"
15
-					v-for="(item,index) in options" :key="index">
15
+					v-for="(item,index) in options" :key="index" :style="{height: direction === 'column'?heightArr[index]+'px':'14px'}">
16 16
 					<view
17 17
 						:class="[direction==='column'?'uni-steps__column-line':'uni-steps__row-line',direction==='column'?'uni-steps__column-line--before':'uni-steps__row-line--before']"
18 18
 						:style="{backgroundColor:index<=active&&index!==0?activeColor:index===0?'transparent':deactiveColor}">
19 19
 					</view>
20 20
 					<view :class="[direction==='column'?'uni-steps__column-check':'uni-steps__row-check']"
21 21
 						v-if="index === active">
22
-						<uni-icons :color="activeColor" :type="activeIcon" size="14"></uni-icons>
22
+						<uni-icons :color="activeColor" :type="activeIcon" size="14" />
23 23
 					</view>
24 24
 					<view v-else :class="[direction==='column'?'uni-steps__column-circle':'uni-steps__row-circle']"
25
-						:style="{backgroundColor:index<active?activeColor:deactiveColor}"></view>
25
+						:style="{backgroundColor:index<active?activeColor:deactiveColor}" />
26 26
 					<view
27 27
 						:class="[direction==='column'?'uni-steps__column-line':'uni-steps__row-line',direction==='column'?'uni-steps__column-line--after':'uni-steps__row-line--after']"
28
-						:style="{backgroundColor:index<active&&index!==options.length-1?activeColor:index===options.length-1?'transparent':deactiveColor}">
29
-					</view>
28
+						:style="{backgroundColor:index<active&&index!==options.length-1?activeColor:index===options.length-1?'transparent':deactiveColor}" />
30 29
 				</view>
31 30
 			</view>
32 31
 		</view>
@@ -82,14 +81,27 @@
82 81
 			} // 数据
83 82
 		},
84 83
 		data() {
85
-			return {}
86
-		}
84
+			return {
85
+				heightArr: [],
86
+			}
87
+		},
88
+		mounted() {
89
+			//根据内容设置步骤条的长度
90
+			if (this.direction === 'column') {
91
+				let that = this;
92
+				//只能用类选择器,用id选择器所获取的元素信息不准确
93
+				uni.createSelectorQuery().in(this).selectAll('.uni-steps__column-text').boundingClientRect(data => {
94
+					that.heightArr = data.map(item => item.height + 1);
95
+				}).exec()
96
+			}
97
+		},
87 98
 	}
88 99
 </script>
89 100
 
90 101
 <style lang="scss">
91 102
 	$uni-primary: #2979ff !default;
92
-	$uni-border-color:#EDEDED;
103
+	$uni-border-color: #EDEDED;
104
+
93 105
 	.uni-steps {
94 106
 		/* #ifndef APP-NVUE */
95 107
 		display: flex;
@@ -207,7 +219,6 @@
207 219
 		display: flex;
208 220
 		/* #endif */
209 221
 		flex-direction: column;
210
-		flex: 1;
211 222
 		align-items: center;
212 223
 		justify-content: center;
213 224
 	}

+ 6 - 8
uni_modules/uni-steps/package.json

@@ -1,7 +1,7 @@
1 1
 {
2 2
   "id": "uni-steps",
3 3
   "displayName": "uni-steps 步骤条",
4
-  "version": "1.1.1",
4
+  "version": "1.1.2",
5 5
   "description": "步骤条组件,提供横向和纵向两种布局格式。",
6 6
   "keywords": [
7 7
     "uni-ui",
@@ -16,11 +16,7 @@
16 16
   "directories": {
17 17
     "example": "../../temps/example_temps"
18 18
   },
19
-  "dcloudext": {
20
-    "category": [
21
-      "前端组件",
22
-      "通用组件"
23
-    ],
19
+"dcloudext": {
24 20
     "sale": {
25 21
       "regular": {
26 22
         "price": "0.00"
@@ -37,7 +33,8 @@
37 33
       "data": "无",
38 34
       "permissions": "无"
39 35
     },
40
-    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
36
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
37
+    "type": "component-vue"
41 38
   },
42 39
   "uni_modules": {
43 40
     "dependencies": [
@@ -48,7 +45,8 @@
48 45
     "platforms": {
49 46
       "cloud": {
50 47
         "tcb": "y",
51
-        "aliyun": "y"
48
+        "aliyun": "y",
49
+        "alipay": "n"
52 50
       },
53 51
       "client": {
54 52
         "App": {

+ 4 - 0
uni_modules/uni-swipe-action/changelog.md

@@ -1,3 +1,7 @@
1
+## 1.3.10(2024-01-17)
2
+- 修复 点击按钮时,按钮会被点击穿透导致自动收缩的 bug(兼容阿里/百度/抖音小程序)
3
+## 1.3.9(2024-01-17)
4
+- 修复 点击按钮时,按钮会被点击穿透导致自动收缩的 bug
1 5
 ## 1.3.8(2023-04-13)
2 6
 - 修复`uni-swipe-action`和`uni-swipe-action-item`不同时使用导致 closeOther 方法报错的 bug
3 7
 ## 1.3.7(2022-06-06)

+ 15 - 14
uni_modules/uni-swipe-action/components/uni-swipe-action-item/uni-swipe-action-item.vue

@@ -6,20 +6,19 @@
6 6
 		<view class="uni-swipe_box" :change:prop="wxsswipe.showWatch" :prop="is_show" :data-threshold="threshold"
7 7
 			:data-disabled="disabled" @touchstart="wxsswipe.touchstart" @touchmove="wxsswipe.touchmove"
8 8
 			@touchend="wxsswipe.touchend">
9
-			<!-- #endif -->
9
+		<!-- #endif -->
10 10
 			<!--  #ifndef MP-WEIXIN || VUE3 -->
11 11
 			<view class="uni-swipe_box" :change:prop="renderswipe.showWatch" :prop="is_show" :data-threshold="threshold"
12 12
 				:data-disabled="disabled+''" @touchstart="renderswipe.touchstart" @touchmove="renderswipe.touchmove"
13 13
 				@touchend="renderswipe.touchend">
14
-				<!-- #endif -->
14
+			<!-- #endif -->
15 15
 				<!-- 在微信小程序 app vue端 h5 使用wxs 实现-->
16 16
 				<view class="uni-swipe_button-group button-group--left">
17 17
 					<slot name="left">
18 18
 						<view v-for="(item,index) in leftOptions" :key="index" :style="{
19 19
 					  backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD'
20
-					}" class="uni-swipe_button button-hock" @touchstart="appTouchStart"
21
-							@touchend="appTouchEnd($event,index,item,'left')"
22
-							@click.stop="onClickForPC(index,item,'left')">
20
+					}" class="uni-swipe_button button-hock" @touchstart.stop="appTouchStart"
21
+							@touchend.stop="appTouchEnd($event,index,item,'left')" @click.stop="onClickForPC(index,item,'left')">
23 22
 							<text class="uni-swipe_button-text"
24 23
 								:style="{color: item.style && item.style.color ? item.style.color : '#FFFFFF',fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px'}">{{ item.text }}</text>
25 24
 						</view>
@@ -32,9 +31,9 @@
32 31
 					<slot name="right">
33 32
 						<view v-for="(item,index) in rightOptions" :key="index" :style="{
34 33
 					  backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD'
35
-					}" class="uni-swipe_button button-hock" @touchstart="appTouchStart"
36
-							@touchend="appTouchEnd($event,index,item,'right')"
37
-							@click.stop="onClickForPC(index,item,'right')"><text class="uni-swipe_button-text"
34
+					}" class="uni-swipe_button button-hock" @touchstart.stop="appTouchStart"
35
+							@touchend.stop="appTouchEnd($event,index,item,'right')" @click.stop="onClickForPC(index,item,'right')"><text
36
+								class="uni-swipe_button-text"
38 37
 								:style="{color: item.style && item.style.color ? item.style.color : '#FFFFFF',fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px'}">{{ item.text }}</text>
39 38
 						</view>
40 39
 					</slot>
@@ -49,9 +48,11 @@
49 48
 				<slot name="left">
50 49
 					<view v-for="(item,index) in leftOptions" :key="index" :style="{
51 50
 				  backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD'
52
-				}" class="uni-swipe_button button-hock" @click.stop="onClick(index,item,'left')"><text
53
-							class="uni-swipe_button-text"
54
-							:style="{color: item.style && item.style.color ? item.style.color : '#FFFFFF', fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px'}">{{ item.text }}</text>
51
+				}" class="uni-swipe_button button-hock" @click.stop="onClick(index,item,'left')">
52
+						<text class="uni-swipe_button-text"
53
+							:style="{color: item.style && item.style.color ? item.style.color : '#FFFFFF', fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px'}">
54
+							{{ item.text }}
55
+						</text>
55 56
 					</view>
56 57
 				</slot>
57 58
 			</view>
@@ -80,8 +81,8 @@
80 81
 						<view v-for="(item,index) in leftOptions" :key="index" :style="{
81 82
 					  backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD',
82 83
 					  fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px'
83
-					}" class="uni-swipe_button button-hock" @touchstart="appTouchStart"
84
-							@touchend="appTouchEnd($event,index,item,'left')"><text class="uni-swipe_button-text"
84
+					}" class="uni-swipe_button button-hock" @touchstart.stop="appTouchStart"
85
+							@touchend.stop="appTouchEnd($event,index,item,'left')"><text class="uni-swipe_button-text"
85 86
 								:style="{color: item.style && item.style.color ? item.style.color : '#FFFFFF',}">{{ item.text }}</text>
86 87
 						</view>
87 88
 					</slot>
@@ -92,7 +93,7 @@
92 93
 						<view v-for="(item,index) in rightOptions" :key="index" :style="{
93 94
 					  backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD',
94 95
 					  fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px'
95
-					}" @touchstart="appTouchStart" @touchend="appTouchEnd($event,index,item,'right')"
96
+					}" @touchstart.stop="appTouchStart" @touchend.stop="appTouchEnd($event,index,item,'right')"
96 97
 							class="uni-swipe_button button-hock"><text class="uni-swipe_button-text"
97 98
 								:style="{color: item.style && item.style.color ? item.style.color : '#FFFFFF',}">{{ item.text }}</text>
98 99
 						</view>

+ 5 - 8
uni_modules/uni-swipe-action/package.json

@@ -1,7 +1,7 @@
1 1
 {
2 2
 	"id": "uni-swipe-action",
3 3
 	"displayName": "uni-swipe-action 滑动操作",
4
-	"version": "1.3.8",
4
+	"version": "1.3.10",
5 5
 	"description": "SwipeAction 滑动操作操作组件",
6 6
 	"keywords": [
7 7
         "",
@@ -17,12 +17,8 @@
17 17
 	"directories": {
18 18
 		"example": "../../temps/example_temps"
19 19
 	},
20
-	"dcloudext": {
21
-		"category": [
22
-			"前端组件",
23
-			"通用组件"
24
-		],
25
-		"sale": {
20
+    "dcloudext": {
21
+        "sale": {
26 22
 			"regular": {
27 23
 				"price": "0.00"
28 24
 			},
@@ -38,7 +34,8 @@
38 34
 			"data": "无",
39 35
 			"permissions": "无"
40 36
 		},
41
-		"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
37
+        "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
38
+        "type": "component-vue"
42 39
 	},
43 40
 	"uni_modules": {
44 41
 		"dependencies": ["uni-scss"],

+ 1 - 1
uni_modules/uni-swiper-dot/components/uni-swiper-dot/uni-swiper-dot.vue

@@ -120,7 +120,7 @@
120 120
 	}
121 121
 </script>
122 122
 
123
-<style lang="scss">
123
+<style lang="scss" scoped>
124 124
 	.uni-swiper__warp {
125 125
 		/* #ifndef APP-NVUE */
126 126
 		display: flex;

+ 2 - 0
uni_modules/uni-table/changelog.md

@@ -1,3 +1,5 @@
1
+## 1.2.4(2023-12-19)
2
+- 修复 uni-tr只有一列时minWidth计算错误,列变化实时计算更新
1 3
 ## 1.2.3(2023-03-28)
2 4
 - 修复 在vue3模式下可能会出现错误的问题
3 5
 ## 1.2.2(2022-11-29)

+ 5 - 1
uni_modules/uni-table/components/uni-tr/uni-tr.vue

@@ -71,7 +71,7 @@ export default {
71 71
 	mounted() {
72 72
 		if (this.widthThArr.length > 0) {
73 73
 			const selectionWidth = this.selection === 'selection' ? 50 : 0
74
-			this.root.minWidth = this.widthThArr.reduce((a, b) => Number(a) + Number(b)) + selectionWidth
74
+			this.root.minWidth = Number(this.widthThArr.reduce((a, b) => Number(a) + Number(b))) + selectionWidth;
75 75
 		}
76 76
 	},
77 77
 	// #ifndef VUE3
@@ -91,6 +91,10 @@ export default {
91 91
 	methods: {
92 92
 		minWidthUpdate(width) {
93 93
 			this.widthThArr.push(width)
94
+			if (this.widthThArr.length > 0) {
95
+				const selectionWidth = this.selection === 'selection' ? 50 : 0;
96
+				this.root.minWidth = Number(this.widthThArr.reduce((a, b) => Number(a) + Number(b))) + selectionWidth;
97
+			}
94 98
 		},
95 99
 		// 选中
96 100
 		checkboxSelected(e) {

+ 1 - 1
uni_modules/uni-table/package.json

@@ -1,7 +1,7 @@
1 1
 {
2 2
   "id": "uni-table",
3 3
   "displayName": "uni-table 表格",
4
-  "version": "1.2.3",
4
+  "version": "1.2.4",
5 5
   "description": "表格组件,多用于展示多条结构类似的数据,如",
6 6
   "keywords": [
7 7
     "uni-ui",

+ 2 - 0
uni_modules/uni-tag/changelog.md

@@ -1,3 +1,5 @@
1
+## 2.1.1(2024-03-20)
2
+- 优化 app下边框过窄导致不显示的bug
1 3
 ## 2.1.0(2021-11-19)
2 4
 - 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
3 5
 - 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-tag](https://uniapp.dcloud.io/component/uniui/uni-tag)

+ 7 - 7
uni_modules/uni-tag/components/uni-tag/uni-tag.vue

@@ -106,7 +106,7 @@
106 106
 	};
107 107
 </script>
108 108
 
109
-<style lang="scss">
109
+<style lang="scss" scoped>
110 110
 	$uni-primary: #2979ff !default;
111 111
 	$uni-success: #18bc37 !default;
112 112
 	$uni-warning: #f3a73f !default;
@@ -126,7 +126,7 @@
126 126
 		color: #fff;
127 127
 		border-radius: 3px;
128 128
 		background-color: $uni-info;
129
-		border-width: 1rpx;
129
+		border-width: 1px;
130 130
 		border-style: solid;
131 131
 		border-color: $uni-info;
132 132
 		/* #ifdef H5 */
@@ -206,14 +206,14 @@
206 206
 
207 207
 		// other attr
208 208
 		&--circle {
209
-			border-radius: 15px !important;
209
+			border-radius: 15px;
210 210
 		}
211 211
 
212 212
 		&--mark {
213
-			border-top-left-radius: 0 !important;
214
-			border-bottom-left-radius: 0 !important;
215
-			border-top-right-radius: 15px !important;
216
-			border-bottom-right-radius: 15px !important;
213
+			border-top-left-radius: 0;
214
+			border-bottom-left-radius: 0;
215
+			border-top-right-radius: 15px;
216
+			border-bottom-right-radius: 15px;
217 217
 		}
218 218
 
219 219
 		&--disabled {

+ 4 - 7
uni_modules/uni-tag/package.json

@@ -1,7 +1,7 @@
1 1
 {
2 2
   "id": "uni-tag",
3 3
   "displayName": "uni-tag 标签",
4
-  "version": "2.1.0",
4
+  "version": "2.1.1",
5 5
   "description": "Tag 组件,用于展示1个或多个文字标签,可点击切换选中、不选中的状态。",
6 6
   "keywords": [
7 7
     "uni-ui",
@@ -17,11 +17,7 @@
17 17
   "directories": {
18 18
     "example": "../../temps/example_temps"
19 19
   },
20
-  "dcloudext": {
21
-    "category": [
22
-      "前端组件",
23
-      "通用组件"
24
-    ],
20
+"dcloudext": {
25 21
     "sale": {
26 22
       "regular": {
27 23
         "price": "0.00"
@@ -38,7 +34,8 @@
38 34
       "data": "无",
39 35
       "permissions": "无"
40 36
     },
41
-    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
37
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
38
+    "type": "component-vue"
42 39
   },
43 40
   "uni_modules": {
44 41
     "dependencies": ["uni-scss"],

+ 6 - 0
uni_modules/uni-tooltip/changelog.md

@@ -1,3 +1,9 @@
1
+## 0.2.4(2024-04-23)
2
+- 修复 弹出位置默认值不一致导致的错位
3
+## 0.2.3(2024-03-20)
4
+- 修复 弹出位置修正
5
+## 0.2.2(2024-01-15)
6
+- 新增 placement支持设置四个方向:top bottom left right
1 7
 ## 0.2.1(2022-05-09)
2 8
 - 修复 content 为空时仍然弹出的bug
3 9
 ## 0.2.0(2022-05-07)

+ 45 - 5
uni_modules/uni-tooltip/components/uni-tooltip/uni-tooltip.vue

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
 	<view class="uni-tooltip">
3 3
 		<slot></slot>
4
-		<view v-if="content || $slots.content" class="uni-tooltip-popup">
4
+		<view v-if="content || $slots.content" class="uni-tooltip-popup" :style="initPlacement">
5 5
 			<slot name="content">
6 6
 				{{content}}
7 7
 			</slot>
@@ -16,10 +16,8 @@
16 16
 	 * @description 常用于展示鼠标 hover 时的提示信息。
17 17
 	 * @tutorial https://uniapp.dcloud.io/component/uniui/uni-tooltip
18 18
 	 * @property {String} content   弹出层显示的内容
19
-	 * @property {String}  placement出现位置, 目前只支持 left
19
+	 * @property {String}  placement出现位置, 目前支持:left right top bottom
20 20
 	 */
21
-
22
-
23 21
 	export default {
24 22
 		name: "uni-tooltip",
25 23
 		data() {
@@ -27,6 +25,47 @@
27 25
 
28 26
 			};
29 27
 		},
28
+		methods: {},
29
+		computed: {
30
+			initPlacement() {
31
+				let style = {};
32
+				switch (this.placement) {
33
+					case 'left':
34
+						style = {
35
+							top: '50%',
36
+							transform: 'translateY(-50%)',
37
+							right: '100%',
38
+							"margin-right": '10rpx',
39
+						}
40
+						break;
41
+					case 'right':
42
+						style = {
43
+							top: '50%',
44
+							transform: 'translateY(-50%)',
45
+							left: '100%',
46
+							"margin-left": '10rpx',
47
+						}
48
+						break;
49
+					case 'top':
50
+						style = {
51
+							bottom: '100%',
52
+							transform: 'translateX(-50%)',
53
+							left: '50%',
54
+							"margin-bottom": '10rpx',
55
+						}
56
+						break;
57
+					case 'bottom':
58
+						style = {
59
+							top: '100%',
60
+							transform: 'translateX(-50%)',
61
+							left: '50%',
62
+							"margin-top": '10rpx',
63
+						}
64
+						break;
65
+				}
66
+				return style;
67
+			}
68
+		},
30 69
 		props: {
31 70
 			content: {
32 71
 				type: String,
@@ -45,13 +84,13 @@
45 84
 	.uni-tooltip {
46 85
 		position: relative;
47 86
 		cursor: pointer;
87
+		display: inline-block;
48 88
 	}
49 89
 
50 90
 	.uni-tooltip-popup {
51 91
 		z-index: 1;
52 92
 		display: none;
53 93
 		position: absolute;
54
-		left: 0;
55 94
 		background-color: #333;
56 95
 		border-radius: 8px;
57 96
 		color: #fff;
@@ -59,6 +98,7 @@
59 98
 		text-align: left;
60 99
 		line-height: 16px;
61 100
 		padding: 12px;
101
+		overflow: auto;
62 102
 	}
63 103
 
64 104
 

+ 7 - 9
uni_modules/uni-tooltip/package.json

@@ -1,7 +1,7 @@
1 1
 {
2 2
   "id": "uni-tooltip",
3 3
   "displayName": "uni-tooltip 提示文字",
4
-  "version": "0.2.1",
4
+  "version": "0.2.4",
5 5
   "description": "Tooltip 提示文字",
6 6
   "keywords": [
7 7
     "uni-tooltip",
@@ -9,7 +9,7 @@
9 9
     "tooltip",
10 10
     "tip",
11 11
     "文字提示"
12
-  ],
12
+],
13 13
   "repository": "https://github.com/dcloudio/uni-ui",
14 14
   "engines": {
15 15
     "HBuilderX": ""
@@ -17,11 +17,7 @@
17 17
   "directories": {
18 18
     "example": "../../temps/example_temps"
19 19
   },
20
-  "dcloudext": {
21
-    "category": [
22
-      "前端组件",
23
-      "通用组件"
24
-    ],
20
+"dcloudext": {
25 21
     "sale": {
26 22
       "regular": {
27 23
         "price": "0.00"
@@ -38,7 +34,8 @@
38 34
       "data": "无",
39 35
       "permissions": "无"
40 36
     },
41
-    "npmurl": ""
37
+    "npmurl": "",
38
+    "type": "component-vue"
42 39
   },
43 40
   "uni_modules": {
44 41
     "dependencies": [],
@@ -46,7 +43,8 @@
46 43
     "platforms": {
47 44
       "cloud": {
48 45
         "tcb": "y",
49
-        "aliyun": "y"
46
+        "aliyun": "y",
47
+        "alipay": "n"
50 48
       },
51 49
       "client": {
52 50
         "Vue": {

+ 4 - 0
uni_modules/uni-transition/changelog.md

@@ -1,3 +1,7 @@
1
+## 1.3.3(2024-04-23)
2
+- 修复 当元素会受变量影响自动隐藏的bug
3
+## 1.3.2(2023-05-04)
4
+- 修复 NVUE 平台报错的问题
1 5
 ## 1.3.1(2021-11-23)
2 6
 - 修复 init 方法初始化问题
3 7
 ## 1.3.0(2021-11-19)

+ 7 - 2
uni_modules/uni-transition/components/uni-transition/uni-transition.vue

@@ -1,5 +1,10 @@
1 1
 <template>
2
-	<view v-if="isShow||onceRender" v-show="isShow" ref="ani" :animation="animationData" :class="customClass" :style="transformStyles" @click="onClick"><slot></slot></view>
2
+  <!-- #ifndef APP-NVUE -->
3
+  <view v-show="isShow" ref="ani" :animation="animationData" :class="customClass" :style="transformStyles" @click="onClick"><slot></slot></view>
4
+  <!-- #endif -->
5
+  <!-- #ifdef APP-NVUE -->
6
+  <view v-if="isShow" ref="ani" :animation="animationData" :class="customClass" :style="transformStyles" @click="onClick"><slot></slot></view>
7
+  <!-- #endif -->
3 8
 </template>
4 9
 
5 10
 <script>
@@ -249,7 +254,7 @@ export default {
249 254
 		},
250 255
 		animationType(type) {
251 256
 			return {
252
-				fade: type ? 1 : 0,
257
+				fade: type ? 0 : 1,
253 258
 				'slide-top': `translateY(${type ? '0' : '-100%'})`,
254 259
 				'slide-right': `translateX(${type ? '0' : '100%'})`,
255 260
 				'slide-bottom': `translateY(${type ? '0' : '100%'})`,

+ 6 - 8
uni_modules/uni-transition/package.json

@@ -1,7 +1,7 @@
1 1
 {
2 2
   "id": "uni-transition",
3 3
   "displayName": "uni-transition 过渡动画",
4
-  "version": "1.3.1",
4
+  "version": "1.3.3",
5 5
   "description": "元素的简单过渡动画",
6 6
   "keywords": [
7 7
     "uni-ui",
@@ -17,11 +17,7 @@
17 17
   "directories": {
18 18
     "example": "../../temps/example_temps"
19 19
   },
20
-  "dcloudext": {
21
-    "category": [
22
-      "前端组件",
23
-      "通用组件"
24
-    ],
20
+"dcloudext": {
25 21
     "sale": {
26 22
       "regular": {
27 23
         "price": "0.00"
@@ -38,7 +34,8 @@
38 34
       "data": "无",
39 35
       "permissions": "无"
40 36
     },
41
-    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
37
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
38
+    "type": "component-vue"
42 39
   },
43 40
   "uni_modules": {
44 41
     "dependencies": ["uni-scss"],
@@ -46,7 +43,8 @@
46 43
     "platforms": {
47 44
       "cloud": {
48 45
         "tcb": "y",
49
-        "aliyun": "y"
46
+        "aliyun": "y",
47
+        "alipay": "n"
50 48
       },
51 49
       "client": {
52 50
         "App": {

+ 0 - 0
uni_modules/uni-ui/changelog.md


이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.