@vtj/materials 0.10.6 → 0.10.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/antdv/index.umd.js +2 -2
- package/dist/assets/charts/index.umd.js +2 -2
- package/dist/assets/element/index.umd.js +2 -2
- package/dist/assets/ui/index.umd.js +2 -2
- package/dist/assets/uni-h5/index.umd.js +3 -3
- package/dist/assets/uni-ui/index.umd.js +3 -3
- package/dist/assets/vant/index.umd.js +2 -2
- package/dist/deps/@vtj/charts/index.umd.js +2 -2
- package/dist/deps/@vtj/icons/index.umd.js +2 -2
- package/dist/deps/@vtj/ui/index.umd.js +3 -3
- package/dist/deps/@vtj/utils/index.umd.js +20 -20
- package/dist/deps/@vueuse/core/index.iife.min.js +1 -1
- package/dist/deps/uni-ui/index.umd.js +1 -1
- package/dist/deps/uni-ui/style.css +1 -1
- package/package.json +7 -7
- package/src/uni-h5/components/input.ts +2 -2
- package/src/uni-h5/components/scrollView.ts +3 -3
- package/src/uni-h5/components/video.ts +1 -1
- package/src/uni-ui/components/badge.ts +1 -5
- package/src/uni-ui/components/breadcrumb.ts +1 -20
- package/src/uni-ui/components/collapse.ts +22 -23
- package/src/uni-ui/components/grid.ts +0 -9
- package/src/uni-ui/components/group.ts +1 -10
- package/src/uni-ui/components/index.ts +4 -4
- package/src/uni-ui/components/popup.ts +10 -2
- package/src/uni-ui/components/swiperDot.ts +21 -7
- package/src/uni-ui/components/table.ts +9 -3
- package/src/uni-ui/components/transition.ts +10 -1
- package/src/uni-ui/index.ts +19 -44
- package/src/uni-ui/lib/uni-collapse/uni-collapse.vue +153 -0
- package/src/uni-ui/lib/uni-collapse-item/uni-collapse-item.vue +425 -0
- package/src/uni-ui/lib/uni-data-picker/keypress.js +45 -0
- package/src/uni-ui/lib/uni-data-picker/uni-data-picker.vue +604 -0
- package/src/uni-ui/lib/uni-data-pickerview/uni-data-picker.js +622 -0
- package/src/uni-ui/lib/uni-data-pickerview/uni-data-pickerview.css +76 -0
- package/src/uni-ui/lib/uni-data-pickerview/uni-data-pickerview.vue +335 -0
- package/src/uni-ui/lib/uni-datetime-picker/calendar-item.vue +181 -170
- package/src/uni-ui/lib/uni-datetime-picker/calendar.vue +977 -939
- package/src/uni-ui/lib/uni-datetime-picker/time-picker.vue +1024 -932
- package/src/uni-ui/lib/uni-datetime-picker/uni-datetime-picker.vue +15 -17
- package/src/uni-ui/lib/uni-datetime-picker/util.js +419 -392
- package/src/uni-ui/lib/uni-fav/i18n/en.json +4 -0
- package/src/uni-ui/lib/uni-fav/i18n/index.js +8 -0
- package/src/uni-ui/lib/uni-fav/i18n/zh-Hans.json +4 -0
- package/src/uni-ui/lib/uni-fav/i18n/zh-Hant.json +4 -0
- package/src/uni-ui/lib/uni-fav/uni-fav.vue +170 -0
- package/src/uni-ui/lib/uni-file-picker/choose-and-upload-file.js +280 -0
- package/src/uni-ui/lib/uni-file-picker/uni-file-picker.vue +668 -0
- package/src/uni-ui/lib/uni-file-picker/upload-file.vue +325 -0
- package/src/uni-ui/lib/uni-file-picker/upload-image.vue +292 -0
- package/src/uni-ui/lib/uni-file-picker/utils.js +110 -0
- package/src/uni-ui/lib/uni-grid/uni-grid.vue +148 -0
- package/src/uni-ui/lib/uni-indexed-list/uni-indexed-list-item.vue +152 -128
- package/src/uni-ui/lib/uni-indexed-list/uni-indexed-list.vue +50 -50
- package/src/uni-ui/lib/uni-load-more/i18n/en.json +5 -0
- package/src/uni-ui/lib/uni-load-more/i18n/index.js +8 -0
- package/src/uni-ui/lib/uni-load-more/i18n/zh-Hans.json +5 -0
- package/src/uni-ui/lib/uni-load-more/i18n/zh-Hant.json +5 -0
- package/src/uni-ui/lib/uni-load-more/uni-load-more.vue +456 -0
- package/src/uni-ui/lib/uni-notice-bar/uni-notice-bar.vue +484 -0
- package/src/uni-ui/lib/uni-popup/uni-popup.vue +4 -4
- package/src/uni-ui/lib/uni-popup-message/uni-popup-message.vue +149 -0
- package/src/uni-ui/lib/uni-rate/uni-rate.vue +362 -343
- package/src/uni-ui/lib/uni-row/uni-row.vue +193 -0
- package/src/uni-ui/lib/uni-search-bar/i18n/en.json +4 -0
- package/src/uni-ui/lib/uni-search-bar/i18n/index.js +8 -0
- package/src/uni-ui/lib/uni-search-bar/i18n/zh-Hans.json +4 -0
- package/src/uni-ui/lib/uni-search-bar/i18n/zh-Hant.json +4 -0
- package/src/uni-ui/lib/uni-search-bar/uni-search-bar.vue +339 -0
- package/src/uni-ui/lib/uni-swipe-action-item/bindingx.js +294 -285
- package/src/uni-ui/lib/uni-swipe-action-item/uni-swipe-action-item.vue +8 -9
- package/src/uni-ui/lib/uni-th/filter-dropdown.vue +551 -503
- package/src/uni-ui/lib/uni-tr/table-checkbox.vue +165 -163
- package/src/uni-ui/lib/uni-tr/uni-tr.vue +6 -6
- package/src/uni-ui/lib/uni-transition/createAnimation.js +131 -0
- package/src/uni-ui/lib/uni-transition/uni-transition.vue +310 -0
- package/src/version.ts +2 -2
@@ -1,361 +1,380 @@
|
|
1
1
|
<template>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
2
|
+
<view>
|
3
|
+
<view ref="uni-rate" class="uni-rate">
|
4
|
+
<view
|
5
|
+
class="uni-rate__icon"
|
6
|
+
:class="{ 'uni-cursor-not-allowed': disabled }"
|
7
|
+
:style="{ 'margin-right': marginNumber + 'px' }"
|
8
|
+
v-for="(star, index) in stars"
|
9
|
+
:key="index"
|
10
|
+
@touchstart.stop="touchstart"
|
11
|
+
@touchmove.stop="touchmove"
|
12
|
+
@mousedown.stop="mousedown"
|
13
|
+
@mousemove.stop="mousemove"
|
14
|
+
@mouseleave="mouseleave">
|
15
|
+
<uni-icons
|
16
|
+
:color="color"
|
17
|
+
:size="size"
|
18
|
+
:type="isFill ? 'star-filled' : 'star'" />
|
19
|
+
<!-- #ifdef APP-NVUE -->
|
20
|
+
<!-- <view
|
21
|
+
:style="{
|
22
|
+
width: (star.activeWitch.replace('%', '') * size) / 100 + 'px'
|
23
|
+
}"
|
24
|
+
class="uni-rate__icon-on">
|
25
|
+
<uni-icons
|
26
|
+
style="text-align: left"
|
27
|
+
:color="disabled ? '#ccc' : activeColor"
|
28
|
+
:size="size"
|
29
|
+
type="star-filled" />
|
30
|
+
</view> -->
|
31
|
+
<!-- #endif -->
|
32
|
+
<!-- #ifndef APP-NVUE -->
|
33
|
+
<view :style="{ width: star.activeWitch }" class="uni-rate__icon-on">
|
34
|
+
<uni-icons
|
35
|
+
:color="disabled ? disabledColor : activeColor"
|
36
|
+
:size="size"
|
37
|
+
type="star-filled" />
|
38
|
+
</view>
|
39
|
+
<!-- #endif -->
|
40
|
+
</view>
|
41
|
+
</view>
|
42
|
+
</view>
|
23
43
|
</template>
|
24
44
|
|
25
45
|
<script>
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
46
|
+
// #ifdef APP-NVUE
|
47
|
+
// const dom = uni.requireNativePlugin('dom');
|
48
|
+
// #endif
|
49
|
+
/**
|
50
|
+
* Rate 评分
|
51
|
+
* @description 评分组件
|
52
|
+
* @tutorial https://ext.dcloud.net.cn/plugin?id=33
|
53
|
+
* @property {Boolean} isFill = [true|false] 星星的类型,是否为实心类型, 默认为实心
|
54
|
+
* @property {String} color 未选中状态的星星颜色,默认为 "#ececec"
|
55
|
+
* @property {String} activeColor 选中状态的星星颜色,默认为 "#ffca3e"
|
56
|
+
* @property {String} disabledColor 禁用状态的星星颜色,默认为 "#c0c0c0"
|
57
|
+
* @property {Number} size 星星的大小
|
58
|
+
* @property {Number} value/v-model 当前评分
|
59
|
+
* @property {Number} max 最大评分评分数量,目前一分一颗星
|
60
|
+
* @property {Number} margin 星星的间距,单位 px
|
61
|
+
* @property {Boolean} disabled = [true|false] 是否为禁用状态,默认为 false
|
62
|
+
* @property {Boolean} readonly = [true|false] 是否为只读状态,默认为 false
|
63
|
+
* @property {Boolean} allowHalf = [true|false] 是否实现半星,默认为 false
|
64
|
+
* @property {Boolean} touchable = [true|false] 是否支持滑动手势,默认为 true
|
65
|
+
* @event {Function} change uniRate 的 value 改变时触发事件,e={value:Number}
|
66
|
+
*/
|
47
67
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
68
|
+
export default {
|
69
|
+
name: 'UniRate',
|
70
|
+
props: {
|
71
|
+
isFill: {
|
72
|
+
// 星星的类型,是否镂空
|
73
|
+
type: [Boolean, String],
|
74
|
+
default: true
|
75
|
+
},
|
76
|
+
color: {
|
77
|
+
// 星星未选中的颜色
|
78
|
+
type: String,
|
79
|
+
default: '#ececec'
|
80
|
+
},
|
81
|
+
activeColor: {
|
82
|
+
// 星星选中状态颜色
|
83
|
+
type: String,
|
84
|
+
default: '#ffca3e'
|
85
|
+
},
|
86
|
+
disabledColor: {
|
87
|
+
// 星星禁用状态颜色
|
88
|
+
type: String,
|
89
|
+
default: '#c0c0c0'
|
90
|
+
},
|
91
|
+
size: {
|
92
|
+
// 星星的大小
|
93
|
+
type: [Number, String],
|
94
|
+
default: 24
|
95
|
+
},
|
96
|
+
value: {
|
97
|
+
// 当前评分
|
98
|
+
type: [Number, String],
|
99
|
+
default: 0
|
100
|
+
},
|
101
|
+
modelValue: {
|
102
|
+
// 当前评分
|
103
|
+
type: [Number, String],
|
104
|
+
default: 0
|
105
|
+
},
|
106
|
+
max: {
|
107
|
+
// 最大评分
|
108
|
+
type: [Number, String],
|
109
|
+
default: 5
|
110
|
+
},
|
111
|
+
margin: {
|
112
|
+
// 星星的间距
|
113
|
+
type: [Number, String],
|
114
|
+
default: 0
|
115
|
+
},
|
116
|
+
disabled: {
|
117
|
+
// 是否可点击
|
118
|
+
type: [Boolean, String],
|
119
|
+
default: false
|
120
|
+
},
|
121
|
+
readonly: {
|
122
|
+
// 是否只读
|
123
|
+
type: [Boolean, String],
|
124
|
+
default: false
|
125
|
+
},
|
126
|
+
allowHalf: {
|
127
|
+
// 是否显示半星
|
128
|
+
type: [Boolean, String],
|
129
|
+
default: false
|
130
|
+
},
|
131
|
+
touchable: {
|
132
|
+
// 是否支持滑动手势
|
133
|
+
type: [Boolean, String],
|
134
|
+
default: true
|
135
|
+
}
|
136
|
+
},
|
137
|
+
data() {
|
138
|
+
return {
|
139
|
+
valueSync: '',
|
140
|
+
userMouseFristMove: true,
|
141
|
+
userRated: false,
|
142
|
+
userLastRate: 1
|
143
|
+
};
|
144
|
+
},
|
145
|
+
watch: {
|
146
|
+
// value(newVal) {
|
147
|
+
// this.valueSync = Number(newVal);
|
148
|
+
// },
|
149
|
+
modelValue(newVal) {
|
150
|
+
this.valueSync = Number(newVal);
|
151
|
+
}
|
152
|
+
},
|
153
|
+
computed: {
|
154
|
+
stars() {
|
155
|
+
const value = this.valueSync ? this.valueSync : 0;
|
156
|
+
const starList = [];
|
157
|
+
const floorValue = Math.floor(value);
|
158
|
+
const ceilValue = Math.ceil(value);
|
159
|
+
for (let i = 0; i < this.max; i++) {
|
160
|
+
if (floorValue > i) {
|
161
|
+
starList.push({
|
162
|
+
activeWitch: '100%'
|
163
|
+
});
|
164
|
+
} else if (ceilValue - 1 === i) {
|
165
|
+
starList.push({
|
166
|
+
activeWitch: (value - floorValue) * 100 + '%'
|
167
|
+
});
|
168
|
+
} else {
|
169
|
+
starList.push({
|
170
|
+
activeWitch: '0'
|
171
|
+
});
|
172
|
+
}
|
173
|
+
}
|
174
|
+
return starList;
|
175
|
+
},
|
156
176
|
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
const {
|
193
|
-
clientX,
|
194
|
-
screenX
|
195
|
-
} = e.changedTouches[0]
|
196
|
-
this._getRateCount(clientX || screenX)
|
197
|
-
},
|
177
|
+
marginNumber() {
|
178
|
+
return Number(this.margin);
|
179
|
+
}
|
180
|
+
},
|
181
|
+
created() {
|
182
|
+
this.valueSync = Number(this.value || this.modelValue);
|
183
|
+
this._rateBoxLeft = 0;
|
184
|
+
this._oldValue = null;
|
185
|
+
},
|
186
|
+
mounted() {
|
187
|
+
setTimeout(() => {
|
188
|
+
this._getSize();
|
189
|
+
}, 100);
|
190
|
+
// #ifdef H5
|
191
|
+
this.PC = this.IsPC();
|
192
|
+
// #endif
|
193
|
+
},
|
194
|
+
methods: {
|
195
|
+
touchstart(e) {
|
196
|
+
// #ifdef H5
|
197
|
+
if (this.IsPC()) return;
|
198
|
+
// #endif
|
199
|
+
if (this.readonly || this.disabled) return;
|
200
|
+
const { clientX, screenX } = e.changedTouches[0];
|
201
|
+
// TODO 做一下兼容,只有 Nvue 下才有 screenX,其他平台式 clientX
|
202
|
+
this._getRateCount(clientX || screenX);
|
203
|
+
},
|
204
|
+
touchmove(e) {
|
205
|
+
// #ifdef H5
|
206
|
+
if (this.IsPC()) return;
|
207
|
+
// #endif
|
208
|
+
if (this.readonly || this.disabled || !this.touchable) return;
|
209
|
+
const { clientX, screenX } = e.changedTouches[0];
|
210
|
+
this._getRateCount(clientX || screenX);
|
211
|
+
},
|
198
212
|
|
199
|
-
|
200
|
-
|
201
|
-
|
213
|
+
/**
|
214
|
+
* 兼容 PC @tian
|
215
|
+
*/
|
202
216
|
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
217
|
+
mousedown(e) {
|
218
|
+
// #ifdef H5
|
219
|
+
if (!this.IsPC()) return;
|
220
|
+
if (this.readonly || this.disabled) return;
|
221
|
+
const { clientX } = e;
|
222
|
+
this.userLastRate = this.valueSync;
|
223
|
+
this._getRateCount(clientX);
|
224
|
+
this.userRated = true;
|
225
|
+
// #endif
|
226
|
+
},
|
227
|
+
mousemove(e) {
|
228
|
+
// #ifdef H5
|
229
|
+
if (!this.IsPC()) return;
|
230
|
+
if (this.userRated) return;
|
231
|
+
if (this.userMouseFristMove) {
|
232
|
+
// console.log('---mousemove----', this.valueSync);
|
233
|
+
this.userLastRate = this.valueSync;
|
234
|
+
this.userMouseFristMove = false;
|
235
|
+
}
|
236
|
+
if (this.readonly || this.disabled || !this.touchable) return;
|
237
|
+
const { clientX } = e;
|
238
|
+
this._getRateCount(clientX);
|
239
|
+
// #endif
|
240
|
+
},
|
241
|
+
mouseleave(e) {
|
242
|
+
// #ifdef H5
|
243
|
+
if (!this.IsPC()) return;
|
244
|
+
if (this.readonly || this.disabled || !this.touchable) return;
|
245
|
+
if (this.userRated) {
|
246
|
+
this.userRated = false;
|
247
|
+
return;
|
248
|
+
}
|
249
|
+
this.valueSync = this.userLastRate;
|
250
|
+
// #endif
|
251
|
+
},
|
252
|
+
// #ifdef H5
|
253
|
+
IsPC() {
|
254
|
+
var userAgentInfo = navigator.userAgent;
|
255
|
+
var Agents = [
|
256
|
+
'Android',
|
257
|
+
'iPhone',
|
258
|
+
'SymbianOS',
|
259
|
+
'Windows Phone',
|
260
|
+
'iPad',
|
261
|
+
'iPod'
|
262
|
+
];
|
263
|
+
var flag = true;
|
264
|
+
for (let v = 0; v < Agents.length - 1; v++) {
|
265
|
+
if (userAgentInfo.indexOf(Agents[v]) > 0) {
|
266
|
+
flag = false;
|
267
|
+
break;
|
268
|
+
}
|
269
|
+
}
|
270
|
+
return flag;
|
271
|
+
},
|
272
|
+
// #endif
|
256
273
|
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
274
|
+
/**
|
275
|
+
* 获取星星个数
|
276
|
+
*/
|
277
|
+
_getRateCount(clientX) {
|
278
|
+
this._getSize();
|
279
|
+
const size = Number(this.size);
|
280
|
+
if (isNaN(size)) {
|
281
|
+
return new Error('size 属性只能设置为数字');
|
282
|
+
}
|
283
|
+
const rateMoveRange = clientX - this._rateBoxLeft;
|
284
|
+
let index = parseInt(rateMoveRange / (size + this.marginNumber));
|
285
|
+
index = index < 0 ? 0 : index;
|
286
|
+
index = index > this.max ? this.max : index;
|
287
|
+
const range = parseInt(
|
288
|
+
rateMoveRange - (size + this.marginNumber) * index
|
289
|
+
);
|
290
|
+
let value = 0;
|
291
|
+
if (this._oldValue === index && !this.PC) return;
|
292
|
+
this._oldValue = index;
|
293
|
+
if (this.allowHalf) {
|
294
|
+
if (range > size / 2) {
|
295
|
+
value = index + 1;
|
296
|
+
} else {
|
297
|
+
value = index + 0.5;
|
298
|
+
}
|
299
|
+
} else {
|
300
|
+
value = index + 1;
|
301
|
+
}
|
283
302
|
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
303
|
+
value = Math.max(0.5, Math.min(value, this.max));
|
304
|
+
this.valueSync = value;
|
305
|
+
this._onChange();
|
306
|
+
},
|
288
307
|
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
308
|
+
/**
|
309
|
+
* 触发动态修改
|
310
|
+
*/
|
311
|
+
_onChange() {
|
312
|
+
this.$emit('input', this.valueSync);
|
313
|
+
this.$emit('update:modelValue', this.valueSync);
|
314
|
+
this.$emit('change', {
|
315
|
+
value: this.valueSync
|
316
|
+
});
|
317
|
+
},
|
318
|
+
/**
|
319
|
+
* 获取星星距离屏幕左侧距离
|
320
|
+
*/
|
321
|
+
_getSize() {
|
322
|
+
// #ifndef APP-NVUE
|
323
|
+
uni
|
324
|
+
.createSelectorQuery()
|
325
|
+
.in(this)
|
326
|
+
.select('.uni-rate')
|
327
|
+
.boundingClientRect()
|
328
|
+
.exec((ret) => {
|
329
|
+
if (ret) {
|
330
|
+
this._rateBoxLeft = ret[0].left;
|
331
|
+
}
|
332
|
+
});
|
333
|
+
// #endif
|
334
|
+
// #ifdef APP-NVUE
|
335
|
+
// dom.getComponentRect(this.$refs['uni-rate'], (ret) => {
|
336
|
+
// const size = ret.size;
|
337
|
+
// if (size) {
|
338
|
+
// this._rateBoxLeft = size.left;
|
339
|
+
// }
|
340
|
+
// });
|
341
|
+
// #endif
|
342
|
+
}
|
343
|
+
}
|
344
|
+
};
|
326
345
|
</script>
|
327
346
|
|
328
347
|
<style lang="scss">
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
348
|
+
.uni-rate {
|
349
|
+
/* #ifndef APP-NVUE */
|
350
|
+
display: flex;
|
351
|
+
/* #endif */
|
352
|
+
line-height: 1;
|
353
|
+
font-size: 0;
|
354
|
+
flex-direction: row;
|
355
|
+
/* #ifdef H5 */
|
356
|
+
cursor: pointer;
|
357
|
+
/* #endif */
|
358
|
+
}
|
340
359
|
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
360
|
+
.uni-rate__icon {
|
361
|
+
position: relative;
|
362
|
+
line-height: 1;
|
363
|
+
font-size: 0;
|
364
|
+
}
|
346
365
|
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
366
|
+
.uni-rate__icon-on {
|
367
|
+
overflow: hidden;
|
368
|
+
position: absolute;
|
369
|
+
top: 0;
|
370
|
+
left: 0;
|
371
|
+
line-height: 1;
|
372
|
+
text-align: left;
|
373
|
+
}
|
355
374
|
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
375
|
+
.uni-cursor-not-allowed {
|
376
|
+
/* #ifdef H5 */
|
377
|
+
cursor: not-allowed !important;
|
378
|
+
/* #endif */
|
379
|
+
}
|
361
380
|
</style>
|