@10yun/cv-mobile-ui 0.5.62 → 0.5.63
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/package.json +1 -1
- package/plugins/uni-extend.js +10 -10
- package/ui-fireui/components/u-action-sheet/u-action-sheet.vue +46 -16
- package/ui-fireui/components/u-alert/u-alert.vue +11 -5
- package/ui-fireui/components/u-badge/u-badge.vue +52 -69
- package/ui-fireui/components/u-bottom-navigation/u-bottom-navigation.vue +28 -20
- package/ui-fireui/components/u-bottom-popup/u-bottom-popup.vue +40 -11
- package/ui-fireui/components/u-bubble-popup/u-bubble-popup.vue +3 -6
- package/ui-fireui/components/u-button/u-button.vue +262 -259
- package/ui-fireui/components/u-calendar/u-calendar.vue +227 -44
- package/ui-fireui/components/u-calendar/u-calendar2.js +562 -0
- package/ui-fireui/components/u-card/u-card.vue +50 -32
- package/ui-fireui/components/u-cascade-selection/u-cascade-selection.vue +197 -74
- package/ui-fireui/components/u-circular-progress/u-circular-progress.vue +324 -0
- package/ui-fireui/components/u-clipboard2/tui-clipboard.js +53 -0
- package/ui-fireui/components/u-collapse/u-collapse.vue +8 -8
- package/ui-fireui/components/u-config/index.js +129 -0
- package/ui-fireui/components/u-count-down/u-count-down.vue +124 -19
- package/ui-fireui/components/u-datetime/u-datetime.vue +416 -176
- package/ui-fireui/components/u-divider/u-divider.vue +3 -3
- package/ui-fireui/components/u-drawer/u-drawer.vue +55 -12
- package/ui-fireui/components/u-dropdown-list/u-dropdown-list.vue +103 -0
- package/ui-fireui/components/u-fab/u-fab.vue +344 -0
- package/ui-fireui/components/u-footer/u-footer.vue +148 -0
- package/ui-fireui/components/u-grid/u-grid.vue +2 -8
- package/ui-fireui/components/u-grid-item/u-grid-item.vue +22 -5
- package/ui-fireui/components/u-icon/u-icon-new.js +190 -0
- package/ui-fireui/components/u-icon/u-icon-new.vue +100 -0
- package/ui-fireui/components/u-image-cropper/u-image-cropper.vue +1144 -0
- package/ui-fireui/components/u-image-group/u-image-group.vue +164 -0
- package/ui-fireui/components/u-keyboard/u-keyboard.vue +3 -2
- package/ui-fireui/components/u-keyboard-input/u-keyboard-input.vue +1 -1
- package/ui-fireui/components/u-list-cell/u-list-cell.vue +82 -72
- package/ui-fireui/components/u-list-view/u-list-view.vue +33 -8
- package/ui-fireui/components/u-loading/u-loading.vue +107 -27
- package/ui-fireui/components/u-loadmore/u-loadmore.vue +21 -3
- package/ui-fireui/components/u-modal/u-modal.vue +140 -176
- package/ui-fireui/components/u-navigation-bar/u-navigation-bar.vue +121 -28
- package/ui-fireui/components/u-no-data/u-no-data.vue +58 -20
- package/ui-fireui/components/u-nomore/u-nomore.vue +5 -4
- package/ui-fireui/components/u-numberbox/u-numberbox.vue +88 -45
- package/ui-fireui/components/u-picture-cropper/u-picture-cropper.vue +94 -36
- package/ui-fireui/components/u-picture-cropper/u-picture-cropper.wxs +27 -17
- package/ui-fireui/components/u-rate/u-rate.vue +197 -0
- package/ui-fireui/components/u-round-progress/u-round-progress.vue +62 -42
- package/ui-fireui/components/u-scroll-top/u-scroll-top.vue +4 -3
- package/ui-fireui/components/u-section/u-section.vue +149 -0
- package/ui-fireui/components/u-skeleton/u-skeleton.vue +37 -6
- package/ui-fireui/components/u-steps/u-steps.vue +110 -27
- package/ui-fireui/components/u-sticky/u-sticky.vue +35 -21
- package/ui-fireui/components/u-sticky-wxs/u-sticky-wxs.vue +7 -4
- package/ui-fireui/components/u-sticky-wxs/u-sticky.wxs +39 -36
- package/ui-fireui/components/u-swipe-action/u-swipe-action.vue +76 -19
- package/ui-fireui/components/u-tabbar/u-tabbar.vue +71 -38
- package/ui-fireui/components/u-tabs/u-tabs.vue +133 -51
- package/ui-fireui/components/u-tag/u-tag.vue +109 -226
- package/ui-fireui/components/u-time-axis/u-time-axis.vue +1 -1
- package/ui-fireui/components/u-timeaxis-item/u-timeaxis-item.vue +1 -1
- package/ui-fireui/components/u-tips/u-tips.vue +35 -15
- package/ui-fireui/components/u-toast/u-toast.vue +9 -5
- package/ui-fireui/components/u-top-dropdown/u-top-dropdown.vue +8 -6
- package/ui-fireui/components/u-upload/u-upload-old.vue +462 -0
- package/ui-fireui/components/u-upload/u-upload.vue +648 -446
- package/ui-fireui/components/u-white-space/u-white-space.vue +68 -0
- package/ui-fireui/components/u-wing-blank/u-wing-blank.vue +100 -0
- package/uview-plus/libs/ctocode/index.js +1 -0
- package/uview-plus/libs/ctocode/richText.js +0 -1
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="up-circular-container" :style="{ width: diam + 'px', height: (height || diam) + 'px' }">
|
|
3
|
+
<!-- #ifndef MP-ALIPAY -->
|
|
4
|
+
<canvas
|
|
5
|
+
class="up-circular-default"
|
|
6
|
+
:canvas-id="defaultCanvasId"
|
|
7
|
+
:id="defaultCanvasId"
|
|
8
|
+
:style="{ width: diam + 'px', height: (height || diam) + 'px' }"
|
|
9
|
+
v-if="defaultShow && defaultCanvasId"
|
|
10
|
+
></canvas>
|
|
11
|
+
<canvas
|
|
12
|
+
class="up-circular-progress"
|
|
13
|
+
:canvas-id="progressCanvasId"
|
|
14
|
+
:id="progressCanvasId"
|
|
15
|
+
:style="{ width: diam + 'px', height: (height || diam) + 'px' }"
|
|
16
|
+
v-if="progressCanvasId"
|
|
17
|
+
></canvas>
|
|
18
|
+
<!-- #endif -->
|
|
19
|
+
|
|
20
|
+
<!-- #ifdef MP-ALIPAY -->
|
|
21
|
+
<canvas
|
|
22
|
+
class="up-circular-default"
|
|
23
|
+
:canvas-id="defaultCanvasId"
|
|
24
|
+
:id="defaultCanvasId"
|
|
25
|
+
:style="{ width: diam * 4 + 'px', height: (height || diam) * 4 + 'px' }"
|
|
26
|
+
v-if="defaultShow"
|
|
27
|
+
></canvas>
|
|
28
|
+
<canvas
|
|
29
|
+
class="up-circular-progress"
|
|
30
|
+
:canvas-id="progressCanvasId"
|
|
31
|
+
:id="progressCanvasId"
|
|
32
|
+
:style="{ width: diam * 4 + 'px', height: (height || diam) * 4 + 'px' }"
|
|
33
|
+
></canvas>
|
|
34
|
+
<!-- #endif -->
|
|
35
|
+
<slot></slot>
|
|
36
|
+
</view>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<script>
|
|
40
|
+
export default {
|
|
41
|
+
name: 'tuiCircularProgress',
|
|
42
|
+
emits: ['change', 'end'],
|
|
43
|
+
props: {
|
|
44
|
+
/*
|
|
45
|
+
传值需使用rpx进行转换保证各终端兼容
|
|
46
|
+
px = rpx / 750 * wx.getSystemInfoSync().windowWidth
|
|
47
|
+
圆形进度条(画布)宽度,直径 [px]
|
|
48
|
+
*/
|
|
49
|
+
diam: {
|
|
50
|
+
type: Number,
|
|
51
|
+
default: 60
|
|
52
|
+
},
|
|
53
|
+
//圆形进度条(画布)高度,默认取diam值[当画半弧时传值,height有值时则取height]
|
|
54
|
+
height: {
|
|
55
|
+
type: Number,
|
|
56
|
+
default: 0
|
|
57
|
+
},
|
|
58
|
+
//进度条线条宽度[px]
|
|
59
|
+
lineWidth: {
|
|
60
|
+
type: Number,
|
|
61
|
+
default: 4
|
|
62
|
+
},
|
|
63
|
+
/*
|
|
64
|
+
线条的端点样式
|
|
65
|
+
butt:向线条的每个末端添加平直的边缘
|
|
66
|
+
round 向线条的每个末端添加圆形线帽
|
|
67
|
+
square 向线条的每个末端添加正方形线帽
|
|
68
|
+
*/
|
|
69
|
+
lineCap: {
|
|
70
|
+
type: String,
|
|
71
|
+
default: 'round'
|
|
72
|
+
},
|
|
73
|
+
//圆环进度字体大小 [px]
|
|
74
|
+
fontSize: {
|
|
75
|
+
type: Number,
|
|
76
|
+
default: 12
|
|
77
|
+
},
|
|
78
|
+
//圆环进度字体颜色
|
|
79
|
+
fontColor: {
|
|
80
|
+
type: String,
|
|
81
|
+
default: ''
|
|
82
|
+
},
|
|
83
|
+
//是否显示进度文字
|
|
84
|
+
fontShow: {
|
|
85
|
+
type: Boolean,
|
|
86
|
+
default: true
|
|
87
|
+
},
|
|
88
|
+
/*
|
|
89
|
+
自定义显示文字[默认为空,显示百分比,fontShow=true时生效]
|
|
90
|
+
可以使用 slot自定义显示内容
|
|
91
|
+
*/
|
|
92
|
+
percentText: {
|
|
93
|
+
type: String,
|
|
94
|
+
default: ''
|
|
95
|
+
},
|
|
96
|
+
//是否显示默认(背景)进度条
|
|
97
|
+
defaultShow: {
|
|
98
|
+
type: Boolean,
|
|
99
|
+
default: true
|
|
100
|
+
},
|
|
101
|
+
//默认进度条颜色
|
|
102
|
+
defaultColor: {
|
|
103
|
+
type: String,
|
|
104
|
+
default: '#CCCCCC'
|
|
105
|
+
},
|
|
106
|
+
//进度条颜色
|
|
107
|
+
progressColor: {
|
|
108
|
+
type: String,
|
|
109
|
+
default: ''
|
|
110
|
+
},
|
|
111
|
+
//进度条渐变颜色[结合progressColor使用,默认为空]
|
|
112
|
+
gradualColor: {
|
|
113
|
+
type: String,
|
|
114
|
+
default: ''
|
|
115
|
+
},
|
|
116
|
+
//起始弧度,单位弧度
|
|
117
|
+
sAngle: {
|
|
118
|
+
type: Number,
|
|
119
|
+
default: -Math.PI / 2
|
|
120
|
+
},
|
|
121
|
+
//指定弧度的方向是逆时针还是顺时针。默认是false,即顺时针
|
|
122
|
+
counterclockwise: {
|
|
123
|
+
type: Boolean,
|
|
124
|
+
default: false
|
|
125
|
+
},
|
|
126
|
+
//进度百分比 [10% 传值 10]
|
|
127
|
+
percentage: {
|
|
128
|
+
type: Number,
|
|
129
|
+
default: 0
|
|
130
|
+
},
|
|
131
|
+
//进度百分比缩放倍数[使用半弧为100%时,则可传2]
|
|
132
|
+
multiple: {
|
|
133
|
+
type: Number,
|
|
134
|
+
default: 1
|
|
135
|
+
},
|
|
136
|
+
//动画执行时间[单位毫秒,低于50无动画]
|
|
137
|
+
duration: {
|
|
138
|
+
type: Number,
|
|
139
|
+
default: 800
|
|
140
|
+
},
|
|
141
|
+
//backwards: 动画从头播;forwards:动画从上次结束点接着播
|
|
142
|
+
activeMode: {
|
|
143
|
+
type: String,
|
|
144
|
+
default: 'backwards'
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
watch: {
|
|
148
|
+
percentage(val) {
|
|
149
|
+
this.initDraw();
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
data() {
|
|
153
|
+
// #ifndef MP-WEIXIN || MP-QQ
|
|
154
|
+
let cid = `id01_${Math.ceil(Math.random() * 10e5).toString(36)}`;
|
|
155
|
+
let did = `id02_${Math.ceil(Math.random() * 10e5).toString(36)}`;
|
|
156
|
+
// #endif
|
|
157
|
+
return {
|
|
158
|
+
// #ifdef MP-WEIXIN || MP-QQ
|
|
159
|
+
progressCanvasId: 'progressCanvasId',
|
|
160
|
+
defaultCanvasId: 'defaultCanvasId',
|
|
161
|
+
// #endif
|
|
162
|
+
// #ifndef MP-WEIXIN || MP-QQ
|
|
163
|
+
progressCanvasId: cid,
|
|
164
|
+
defaultCanvasId: did,
|
|
165
|
+
// #endif
|
|
166
|
+
progressContext: null,
|
|
167
|
+
linearGradient: null,
|
|
168
|
+
//起始百分比
|
|
169
|
+
startPercentage: 0
|
|
170
|
+
// dpi
|
|
171
|
+
//pixelRatio: uni.getSystemInfoSync().pixelRatio
|
|
172
|
+
};
|
|
173
|
+
},
|
|
174
|
+
mounted() {
|
|
175
|
+
this.$nextTick(() => {
|
|
176
|
+
setTimeout(() => {
|
|
177
|
+
this.initDraw(true);
|
|
178
|
+
}, 50);
|
|
179
|
+
});
|
|
180
|
+
},
|
|
181
|
+
methods: {
|
|
182
|
+
//初始化绘制
|
|
183
|
+
initDraw(init) {
|
|
184
|
+
let start = this.activeMode === 'backwards' ? 0 : this.startPercentage;
|
|
185
|
+
start = start > this.percentage ? 0 : start;
|
|
186
|
+
if (this.defaultShow && init) {
|
|
187
|
+
this.drawDefaultCircular();
|
|
188
|
+
}
|
|
189
|
+
this.drawProgressCircular(start);
|
|
190
|
+
},
|
|
191
|
+
//默认(背景)圆环
|
|
192
|
+
drawDefaultCircular() {
|
|
193
|
+
let ctx = uni.createCanvasContext(this.defaultCanvasId, this);
|
|
194
|
+
let lineWidth = Number(this.lineWidth);
|
|
195
|
+
// #ifdef MP-ALIPAY
|
|
196
|
+
lineWidth = lineWidth * 4;
|
|
197
|
+
// #endif
|
|
198
|
+
ctx.setLineWidth(lineWidth);
|
|
199
|
+
ctx.setStrokeStyle(this.defaultColor);
|
|
200
|
+
//终止弧度
|
|
201
|
+
let eAngle = Math.PI * (this.height ? 1 : 2) + this.sAngle;
|
|
202
|
+
this.drawArc(ctx, eAngle);
|
|
203
|
+
},
|
|
204
|
+
//进度圆环
|
|
205
|
+
drawProgressCircular(startPercentage) {
|
|
206
|
+
let ctx = this.progressContext;
|
|
207
|
+
let gradient = this.linearGradient;
|
|
208
|
+
if (!ctx) {
|
|
209
|
+
ctx = uni.createCanvasContext(this.progressCanvasId, this);
|
|
210
|
+
//创建一个线性的渐变颜色 CanvasGradient对象
|
|
211
|
+
let diam = Number(this.diam);
|
|
212
|
+
// #ifdef MP-ALIPAY
|
|
213
|
+
diam = diam * 4;
|
|
214
|
+
// #endif
|
|
215
|
+
const progressColor = this.progressColor || (uni && uni.$tui && uni.$tui.color.primary) || '#5677fc';
|
|
216
|
+
gradient = ctx.createLinearGradient(0, 0, diam, 0);
|
|
217
|
+
gradient.addColorStop('0', progressColor);
|
|
218
|
+
if (this.gradualColor) {
|
|
219
|
+
gradient.addColorStop('1', this.gradualColor);
|
|
220
|
+
}
|
|
221
|
+
// #ifdef APP-PLUS || MP
|
|
222
|
+
const res = uni.getSystemInfoSync();
|
|
223
|
+
if (!this.gradualColor && res.platform.toLocaleLowerCase() == 'android') {
|
|
224
|
+
gradient.addColorStop('1', progressColor);
|
|
225
|
+
}
|
|
226
|
+
// #endif
|
|
227
|
+
this.progressContext = ctx;
|
|
228
|
+
this.linearGradient = gradient;
|
|
229
|
+
}
|
|
230
|
+
let lineWidth = Number(this.lineWidth);
|
|
231
|
+
// #ifdef MP-ALIPAY
|
|
232
|
+
lineWidth = lineWidth * 4;
|
|
233
|
+
// #endif
|
|
234
|
+
ctx.setLineWidth(lineWidth);
|
|
235
|
+
ctx.setStrokeStyle(gradient);
|
|
236
|
+
let time = this.percentage == 0 || this.duration < 50 ? 0 : this.duration / this.percentage;
|
|
237
|
+
if (this.percentage > 0) {
|
|
238
|
+
startPercentage = this.duration < 50 ? this.percentage - 1 : startPercentage;
|
|
239
|
+
startPercentage++;
|
|
240
|
+
}
|
|
241
|
+
if (this.fontShow) {
|
|
242
|
+
let fontSize = Number(this.fontSize);
|
|
243
|
+
// #ifdef MP-ALIPAY
|
|
244
|
+
fontSize = fontSize * 4;
|
|
245
|
+
// #endif
|
|
246
|
+
ctx.setFontSize(fontSize);
|
|
247
|
+
const fontColor = this.fontColor || (uni && uni.$tui && uni.$tui.color.primary) || '#5677fc';
|
|
248
|
+
ctx.setFillStyle(fontColor);
|
|
249
|
+
ctx.setTextAlign('center');
|
|
250
|
+
ctx.setTextBaseline('middle');
|
|
251
|
+
let percentage = this.percentText;
|
|
252
|
+
if (!percentage) {
|
|
253
|
+
percentage = this.counterclockwise ? 100 - startPercentage * this.multiple : startPercentage * this.multiple;
|
|
254
|
+
percentage = `${percentage}%`;
|
|
255
|
+
}
|
|
256
|
+
let radius = this.diam / 2;
|
|
257
|
+
// #ifdef MP-ALIPAY
|
|
258
|
+
radius = radius * 4;
|
|
259
|
+
// #endif
|
|
260
|
+
ctx.fillText(percentage, radius, radius);
|
|
261
|
+
}
|
|
262
|
+
if (this.percentage == 0 || (this.counterclockwise && startPercentage == 100)) {
|
|
263
|
+
ctx.draw();
|
|
264
|
+
} else {
|
|
265
|
+
let eAngle = ((2 * Math.PI) / 100) * startPercentage + this.sAngle;
|
|
266
|
+
this.drawArc(ctx, eAngle);
|
|
267
|
+
}
|
|
268
|
+
setTimeout(() => {
|
|
269
|
+
this.startPercentage = startPercentage;
|
|
270
|
+
if (startPercentage >= this.percentage) {
|
|
271
|
+
this.$emit('end', {
|
|
272
|
+
canvasId: this.progressCanvasId,
|
|
273
|
+
percentage: startPercentage
|
|
274
|
+
});
|
|
275
|
+
} else {
|
|
276
|
+
this.drawProgressCircular(startPercentage);
|
|
277
|
+
}
|
|
278
|
+
this.$emit('change', {
|
|
279
|
+
percentage: startPercentage
|
|
280
|
+
});
|
|
281
|
+
}, time);
|
|
282
|
+
// #ifdef H5
|
|
283
|
+
// requestAnimationFrame(()=>{})
|
|
284
|
+
// #endif
|
|
285
|
+
},
|
|
286
|
+
//创建弧线
|
|
287
|
+
drawArc(ctx, eAngle) {
|
|
288
|
+
ctx.setLineCap(this.lineCap);
|
|
289
|
+
ctx.beginPath();
|
|
290
|
+
let radius = this.diam / 2; //x=y
|
|
291
|
+
let lineWidth = Number(this.lineWidth);
|
|
292
|
+
// #ifdef MP-ALIPAY
|
|
293
|
+
radius = radius * 4;
|
|
294
|
+
lineWidth = lineWidth * 4;
|
|
295
|
+
// #endif
|
|
296
|
+
ctx.arc(radius, radius, radius - lineWidth, this.sAngle, eAngle, this.counterclockwise);
|
|
297
|
+
ctx.stroke();
|
|
298
|
+
ctx.draw();
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
</script>
|
|
303
|
+
|
|
304
|
+
<style scoped>
|
|
305
|
+
.up-circular-container,
|
|
306
|
+
.up-circular-default {
|
|
307
|
+
position: relative;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/* #ifdef MP-ALIPAY */
|
|
311
|
+
.up-circular-default,
|
|
312
|
+
.up-circular-progress {
|
|
313
|
+
zoom: 0.25;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/* #endif */
|
|
317
|
+
|
|
318
|
+
.up-circular-progress {
|
|
319
|
+
position: absolute;
|
|
320
|
+
left: 0;
|
|
321
|
+
top: 0;
|
|
322
|
+
z-index: 10;
|
|
323
|
+
}
|
|
324
|
+
</style>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 复制文本 兼容H5
|
|
3
|
+
* 来自 ThorUI www.thorui.cn | 文档地址: www.donarui.com
|
|
4
|
+
* @author echo.
|
|
5
|
+
* @version 1.0.0
|
|
6
|
+
**/
|
|
7
|
+
// #ifdef H5
|
|
8
|
+
import ClipboardJS from '../js-sdk/clipboard.min.js';
|
|
9
|
+
// #endif
|
|
10
|
+
const thorui = {
|
|
11
|
+
/**
|
|
12
|
+
* data 需要复制的数据
|
|
13
|
+
* callback 回调
|
|
14
|
+
* e 当用户点击后需要先请求接口再进行复制时,需要传入此参数,或者将异步请求转为同步 (H5端)
|
|
15
|
+
* **/
|
|
16
|
+
getClipboardData: function (data, callback, e) {
|
|
17
|
+
// #ifdef APP-PLUS || MP
|
|
18
|
+
uni.setClipboardData({
|
|
19
|
+
data: data,
|
|
20
|
+
success(res) {
|
|
21
|
+
'function' == typeof callback && callback(true);
|
|
22
|
+
},
|
|
23
|
+
fail(res) {
|
|
24
|
+
'function' == typeof callback && callback(false);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
// #endif
|
|
28
|
+
|
|
29
|
+
// #ifdef H5
|
|
30
|
+
let event = window.event || e || {};
|
|
31
|
+
let clipboard = new ClipboardJS('', {
|
|
32
|
+
text: () => data
|
|
33
|
+
});
|
|
34
|
+
clipboard.on('success', (e) => {
|
|
35
|
+
'function' == typeof callback && callback(true);
|
|
36
|
+
clipboard.off('success');
|
|
37
|
+
clipboard.off('error');
|
|
38
|
+
clipboard.destroy();
|
|
39
|
+
});
|
|
40
|
+
clipboard.on('error', (e) => {
|
|
41
|
+
'function' == typeof callback && callback(false);
|
|
42
|
+
clipboard.off('success');
|
|
43
|
+
clipboard.off('error');
|
|
44
|
+
clipboard.destroy();
|
|
45
|
+
});
|
|
46
|
+
clipboard.onClick(event);
|
|
47
|
+
// #endif
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export default {
|
|
52
|
+
getClipboardData: thorui.getClipboardData
|
|
53
|
+
};
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view
|
|
3
|
-
class="up-collapse"
|
|
4
|
-
style="margin-left: 20upx; margin-right: 20upx; border-radius: 11upx"
|
|
5
|
-
:style="{ backgroundColor: bgColor }"
|
|
6
|
-
>
|
|
2
|
+
<view class="up-collapse" :style="{ backgroundColor: bgColor }">
|
|
7
3
|
<view class="up-collapse-head" :style="{ backgroundColor: hdBgColor }" @tap.stop="handleClick">
|
|
8
4
|
<view class="up-header" :class="{ 'up-opacity': disabled }">
|
|
9
5
|
<slot name="title"></slot>
|
|
@@ -28,7 +24,8 @@
|
|
|
28
24
|
|
|
29
25
|
<script>
|
|
30
26
|
export default {
|
|
31
|
-
name: '
|
|
27
|
+
name: 'tuiCollapse',
|
|
28
|
+
emits: ['click'],
|
|
32
29
|
props: {
|
|
33
30
|
//collapse背景颜色
|
|
34
31
|
bgColor: {
|
|
@@ -105,15 +102,18 @@ export default {
|
|
|
105
102
|
|
|
106
103
|
<style scoped>
|
|
107
104
|
@font-face {
|
|
108
|
-
font-family: '
|
|
105
|
+
font-family: 'tuiCollapse';
|
|
109
106
|
src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAQ4AA0AAAAABlgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAEHAAAABoAAAAciRx3B0dERUYAAAP8AAAAHgAAAB4AKQAKT1MvMgAAAaAAAABCAAAAVjxuR/JjbWFwAAAB9AAAAD4AAAFCAA/pq2dhc3AAAAP0AAAACAAAAAj//wADZ2x5ZgAAAkAAAABEAAAARCs1U/toZWFkAAABMAAAADAAAAA2FpaT+mhoZWEAAAFgAAAAHQAAACQHngOFaG10eAAAAeQAAAAPAAAAEAwAAEBsb2NhAAACNAAAAAoAAAAKACIAAG1heHAAAAGAAAAAHwAAACABDwAdbmFtZQAAAoQAAAFJAAACiCnmEVVwb3N0AAAD0AAAACMAAAA1DunpUnjaY2BkYGAAYja/oO54fpuvDNwsDCBwc4/6fzjtwNDNfICpBMjlYGACiQIAGVAKZnjaY2BkYGBu+N/AEMPCAALMBxgYGVABCwBVNgMsAAAAeNpjYGRgYGBhEGQA0QwMTEDMBYQMDP/BfAYACnYBLQB42mNgZGFgnMDAysDA1Ml0hoGBoR9CM75mMGLkAIoysDIzYAUBaa4pDA7PGJ4xMDf8b2CIYW5gaAAKM4LkANq9C9sAAHjaY2GAABYIdgAAAMAATQB42mNgYGBmgGAZBkYGELAB8hjBfBYGBSDNAoRA/jOG//8hpBQzVCUDIxsDjMnAyAQkmBhQASPDsAcAMCAGoQAAAAAAAAAAAAAAIgAAAAEAQACLA8ACdAAQAAAlASYiBhQXARYyNwE2NCYiBwIA/oYNIBkMAZcNIA0BlwwZIA3uAXoMGSAN/mkMDAGXDSAZDAB42n2QPU4DMRCFn/MHJBJCIKhdUQDa/JQpEyn0CKWjSDbekGjXXnmdSDkBLRUHoOUYHIAbINFyCl6WSZMia+3o85uZ57EBnOMbCv/fJe6EFY7xKFzBETLhKvUX4Rr5XbiOFj6FG9R/hJu4VQPhFi7UGx1U7YS7m9JtywpnGAhXcIon4Sr1lXCN/CpcxxU+hBvUv4SbGONXuIVrZakM4WEwQWCcQWOKDeMCMRwskjIG1qE59GYSzExPN3oRO5s4GyjvV2KXAx5oOeeAKe09t2a+Sif+YMuB1JhuHgVLtimNLiJ0KBtfLJzV3ahzsP2e7ba02L9rgTXH7FENbNT8Pdsz0khsDK+QkjXyMrekElOPaGus8btnKdbzXgiJTrzL9IjHmjR1OvduaeLA4ufyjBx9tLmSPfeoHD5jWQh5v91OxCCKXYY/k9hxGQAAAHjaY2BigAAuMMnIgA5YwKJMjExciUVF+eW6KfnleQAZ0wQyAAAAAAH//wACAAEAAAAMAAAAFgAAAAIAAQADAAMAAQAEAAAAAgAAAAB42mNgYGBkAIKrS9Q5QPTNPer/YTQAQ+0HIAAA)
|
|
110
107
|
format('woff');
|
|
111
108
|
font-weight: normal;
|
|
112
109
|
font-style: normal;
|
|
113
110
|
}
|
|
111
|
+
.up-collapse{
|
|
112
|
+
margin-left: 20upx; margin-right: 20upx; border-radius: 11upx
|
|
113
|
+
}
|
|
114
114
|
|
|
115
115
|
.up-collapse-icon {
|
|
116
|
-
font-family: '
|
|
116
|
+
font-family: 'tuiCollapse' !important;
|
|
117
117
|
font-style: normal;
|
|
118
118
|
-webkit-font-smoothing: antialiased;
|
|
119
119
|
-moz-osx-font-smoothing: grayscale;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/*
|
|
2
|
+
基础组件props属性全局配置文件。优先级:全局配置文件props < 单独设置组件props
|
|
3
|
+
温馨提示:未设置则使用组件内默认值,避免出错,请勿删减以下配置
|
|
4
|
+
组件属性介绍请查看文档
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
//组件内主色配置
|
|
8
|
+
const color = {
|
|
9
|
+
primary: '#5677fc',
|
|
10
|
+
success: '#07c160',
|
|
11
|
+
warning: '#ff7900',
|
|
12
|
+
danger: '#EB0909',
|
|
13
|
+
pink: '#f74d54',
|
|
14
|
+
blue: '#007AFF',
|
|
15
|
+
link: '#586c94'
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const propsConfig = {
|
|
19
|
+
//组件内主色配置
|
|
20
|
+
color,
|
|
21
|
+
//组件名称,字体图标组件 up-icon
|
|
22
|
+
tuiIcon: {
|
|
23
|
+
//组件属性值
|
|
24
|
+
size: 32,
|
|
25
|
+
unit: 'px',
|
|
26
|
+
color: '#999'
|
|
27
|
+
},
|
|
28
|
+
//按钮组件 up-button
|
|
29
|
+
tuiButton: {
|
|
30
|
+
height: '96rpx',
|
|
31
|
+
size: 32
|
|
32
|
+
},
|
|
33
|
+
//列表项组件 up-list-cell
|
|
34
|
+
tuiListCell: {
|
|
35
|
+
arrowColor: '#c0c0c0',
|
|
36
|
+
lineColor: '#eaeef1',
|
|
37
|
+
lineLeft: 44,
|
|
38
|
+
padding: '26rpx 44rpx',
|
|
39
|
+
color: '#333',
|
|
40
|
+
size: 28
|
|
41
|
+
},
|
|
42
|
+
//按钮组件 up-form-button
|
|
43
|
+
tuiFormButton: {
|
|
44
|
+
background: color.primary,
|
|
45
|
+
color: '#fff',
|
|
46
|
+
height: '96rpx',
|
|
47
|
+
size: 32,
|
|
48
|
+
radius: '6rpx'
|
|
49
|
+
},
|
|
50
|
+
//文本组件 up-text
|
|
51
|
+
tuiText: {
|
|
52
|
+
size: 32,
|
|
53
|
+
unit: 'rpx',
|
|
54
|
+
color: ''
|
|
55
|
+
},
|
|
56
|
+
//输入框组件 up-input
|
|
57
|
+
tuiInput: {
|
|
58
|
+
requiredColor: color.danger,
|
|
59
|
+
labelSize: 32,
|
|
60
|
+
labelColor: '#333',
|
|
61
|
+
size: 32,
|
|
62
|
+
color: '#333',
|
|
63
|
+
padding: '26rpx 30rpx',
|
|
64
|
+
backgroundColor: '#FFFFFF',
|
|
65
|
+
radius: 0
|
|
66
|
+
},
|
|
67
|
+
//表单项组件 up-form-item
|
|
68
|
+
tuiFormItem: {
|
|
69
|
+
padding: '28rpx 30rpx',
|
|
70
|
+
labelSize: 32,
|
|
71
|
+
labelColor: '#333',
|
|
72
|
+
labelFontWeight: 400,
|
|
73
|
+
asteriskColor: color.danger,
|
|
74
|
+
background: '#fff',
|
|
75
|
+
arrowColor: '#c0c0c0',
|
|
76
|
+
borderColor: '#eaeef1',
|
|
77
|
+
radius: '0rpx',
|
|
78
|
+
position: 2
|
|
79
|
+
},
|
|
80
|
+
//表单校验组件 up-form
|
|
81
|
+
tuiForm: {
|
|
82
|
+
tipBackgroundColor: color.pink,
|
|
83
|
+
duration: 2000
|
|
84
|
+
},
|
|
85
|
+
//全局方法,调用 uni.$tui.toast
|
|
86
|
+
toast(text, duration, success) {
|
|
87
|
+
uni.showToast({
|
|
88
|
+
// #ifndef MP-ALIPAY
|
|
89
|
+
duration: duration || 2000,
|
|
90
|
+
// #endif
|
|
91
|
+
title: text || '出错啦~',
|
|
92
|
+
icon: success ? 'success' : 'none'
|
|
93
|
+
});
|
|
94
|
+
},
|
|
95
|
+
modal(title, content, showCancel, callback, confirmColor, confirmText) {
|
|
96
|
+
uni.showModal({
|
|
97
|
+
title: title || '提示',
|
|
98
|
+
content: content,
|
|
99
|
+
showCancel: showCancel,
|
|
100
|
+
cancelColor: '#555',
|
|
101
|
+
confirmColor: confirmColor || color.primary,
|
|
102
|
+
confirmText: confirmText || '确定',
|
|
103
|
+
success(res) {
|
|
104
|
+
if (res.confirm) {
|
|
105
|
+
callback && callback(true);
|
|
106
|
+
} else {
|
|
107
|
+
callback && callback(false);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
},
|
|
112
|
+
//跳转页面
|
|
113
|
+
href(url, isMain) {
|
|
114
|
+
if (isMain) {
|
|
115
|
+
uni.switchTab({
|
|
116
|
+
url: url
|
|
117
|
+
});
|
|
118
|
+
} else {
|
|
119
|
+
uni.navigateTo({
|
|
120
|
+
url: url
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
rpx2px(value) {
|
|
125
|
+
return uni.upx2px(value);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
export default propsConfig;
|