uview-plus 3.6.29 → 3.7.13
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/README.md +20 -5
- package/changelog.md +352 -0
- package/components/u-action-sheet/actionSheet.js +2 -0
- package/components/u-action-sheet/props.js +10 -0
- package/components/u-action-sheet/u-action-sheet.vue +3 -3
- package/components/u-album/album.js +1 -1
- package/components/u-avatar/avatar.js +4 -4
- package/components/u-avatar-group/avatarGroup.js +4 -4
- package/components/u-back-top/backtop.js +4 -4
- package/components/u-badge/badge.js +4 -4
- package/components/u-box/box.js +24 -0
- package/components/u-box/props.js +37 -7
- package/components/u-box/u-box.vue +29 -14
- package/components/u-button/button.js +4 -4
- package/components/u-calendar/calendar.js +4 -4
- package/components/u-canvas/u-canvas.vue +423 -0
- package/components/u-car-keyboard/carKeyboard.js +4 -4
- package/components/u-cascader/u-cascader.vue +19 -10
- package/components/u-cate-tab/u-cate-tab.vue +14 -4
- package/components/u-cell/cell.js +4 -4
- package/components/u-cell-group/cellGroup.js +4 -4
- package/components/u-checkbox/checkbox.js +4 -4
- package/components/u-checkbox-group/checkboxGroup.js +4 -4
- package/components/u-checkbox-group/u-checkbox-group.vue +4 -1
- package/components/u-circle-progress/circleProgress.js +4 -4
- package/components/u-code/code.js +3 -3
- package/components/u-code-input/codeInput.js +4 -4
- package/components/u-col/col.js +4 -4
- package/components/u-collapse/collapse.js +4 -4
- package/components/u-collapse-item/collapseItem.js +4 -4
- package/components/u-column-notice/columnNotice.js +4 -4
- package/components/u-count-down/countDown.js +4 -4
- package/components/u-count-to/countTo.js +4 -4
- package/components/u-cropper/u-cropper.vue +6 -3
- package/components/u-datetime-picker/datetimePicker.js +4 -4
- package/components/u-divider/divider.js +4 -4
- package/components/u-dragsort/u-dragsort.vue +85 -72
- package/components/u-empty/empty.js +4 -4
- package/components/u-form/form.js +4 -4
- package/components/u-form-item/formItem.js +4 -4
- package/components/u-gap/gap.js +4 -4
- package/components/u-grid/grid.js +4 -4
- package/components/u-grid/u-grid.vue +1 -1
- package/components/u-grid-item/gridItem.js +4 -4
- package/components/u-icon/icon.js +4 -4
- package/components/u-image/image.js +4 -4
- package/components/u-index-anchor/indexAnchor.js +4 -4
- package/components/u-index-list/indexList.js +4 -4
- package/components/u-input/input.js +1 -1
- package/components/u-input/u-input.vue +5 -2
- package/components/u-keyboard/keyboard.js +4 -4
- package/components/u-line/line.js +4 -4
- package/components/u-line-progress/lineProgress.js +4 -4
- package/components/u-link/link.js +4 -4
- package/components/u-list/list.js +4 -4
- package/components/u-list/u-list.vue +4 -1
- package/components/u-list-item/listItem.js +4 -4
- package/components/u-loading-icon/loadingIcon.js +4 -4
- package/components/u-loading-page/loadingPage.js +4 -4
- package/components/u-loadmore/loadmore.js +4 -4
- package/components/u-modal/modal.js +5 -5
- package/components/u-navbar/navbar.js +4 -4
- package/components/u-no-network/noNetwork.js +4 -4
- package/components/u-no-network/u-no-network.vue +7 -3
- package/components/u-notice-bar/noticeBar.js +4 -4
- package/components/u-notify/notify.js +4 -4
- package/components/u-number-box/numberBox.js +4 -4
- package/components/u-number-keyboard/numberKeyboard.js +4 -4
- package/components/u-overlay/overlay.js +4 -4
- package/components/u-parse/props.js +1 -1
- package/components/u-picker/picker.js +4 -4
- package/components/u-picker/props.js +4 -0
- package/components/u-picker/u-picker.vue +1 -1
- package/components/u-popup/popup.js +4 -4
- package/components/u-qrcode/qrcode.js +17 -67
- package/components/u-qrcode/u-qrcode.vue +179 -86
- package/components/u-radio/radio.js +4 -4
- package/components/u-radio-group/radioGroup.js +3 -3
- package/components/u-rate/rate.js +4 -4
- package/components/u-read-more/readMore.js +4 -4
- package/components/u-row/row.js +4 -4
- package/components/u-row-notice/rowNotice.js +4 -4
- package/components/u-scroll-list/scrollList.js +4 -4
- package/components/u-search/search.js +7 -5
- package/components/u-search/u-search.vue +2 -2
- package/components/u-section/section.js +4 -4
- package/components/u-select/u-select.vue +7 -1
- package/components/u-signature/u-signature.vue +138 -137
- package/components/u-skeleton/skeleton.js +4 -4
- package/components/u-slider/props.js +17 -2
- package/components/u-slider/slider.js +10 -7
- package/components/u-slider/u-slider.vue +112 -35
- package/components/u-status-bar/statusBar.js +4 -4
- package/components/u-steps/steps.js +4 -4
- package/components/u-steps/u-steps.vue +1 -1
- package/components/u-steps-item/stepsItem.js +4 -4
- package/components/u-sticky/sticky.js +4 -4
- package/components/u-subsection/subsection.js +4 -4
- package/components/u-swipe-action/swipeAction.js +4 -4
- package/components/u-swipe-action-item/swipeActionItem.js +4 -4
- package/components/u-swiper/swiper.js +4 -4
- package/components/u-swiper-indicator/swipterIndicator.js +4 -4
- package/components/u-switch/switch.js +4 -4
- package/components/u-tabbar/tabbar.js +4 -4
- package/components/u-tabbar-item/tabbarItem.js +4 -4
- package/components/u-tabs/tabs.js +4 -4
- package/components/u-tabs/u-tabs.vue +83 -95
- package/components/u-tag/tag.js +4 -4
- package/components/u-text/text.js +4 -4
- package/components/u-textarea/textarea.js +4 -4
- package/components/u-toast/toast.js +4 -4
- package/components/u-toolbar/toolbar.js +4 -4
- package/components/u-tooltip/tooltip.js +4 -4
- package/components/u-transition/transition.js +4 -4
- package/components/u-upload/upload.js +4 -4
- package/libs/css/flex.scss +2 -1
- package/libs/function/index.js +9 -4
- package/libs/util/gcanvas/bridge/bridge-weex.js +2 -1
- package/libs/util/gcanvas/env/image.js +24 -16
- package/package.json +2 -4
- package/types/comps/radio.d.ts +6 -2
- package/types/func.d.ts +317 -0
- package/types/index.d.ts +73 -105
- package/components/u-scroll-list/other.js +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* @Author : LQ
|
|
3
3
|
* @Description :
|
|
4
|
-
* @version :
|
|
4
|
+
* @version : 3.0
|
|
5
5
|
* @Date : 2021-08-20 16:44:21
|
|
6
|
-
* @LastAuthor :
|
|
7
|
-
* @lastTime :
|
|
8
|
-
* @FilePath : /
|
|
6
|
+
* @LastAuthor : jry
|
|
7
|
+
* @lastTime : 2025-12-19 08:55:21
|
|
8
|
+
* @FilePath : /uview-plus/libs/config/props/search.js
|
|
9
9
|
*/
|
|
10
10
|
import { t } from '../../libs/i18n'
|
|
11
11
|
export default {
|
|
@@ -34,6 +34,8 @@ export default {
|
|
|
34
34
|
value: '',
|
|
35
35
|
maxlength: '-1',
|
|
36
36
|
height: 32,
|
|
37
|
-
label: null
|
|
37
|
+
label: null,
|
|
38
|
+
adjustPosition: true,
|
|
39
|
+
autoBlur: true
|
|
38
40
|
}
|
|
39
41
|
}
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
</view>
|
|
31
31
|
<input
|
|
32
32
|
confirm-type="search"
|
|
33
|
-
@blur="
|
|
33
|
+
@blur="blurFunc"
|
|
34
34
|
:value="keyword"
|
|
35
35
|
@confirm="search"
|
|
36
36
|
@input="inputChange"
|
|
@@ -220,7 +220,7 @@
|
|
|
220
220
|
this.$emit('focus', this.keyword);
|
|
221
221
|
},
|
|
222
222
|
// 失去焦点
|
|
223
|
-
|
|
223
|
+
blurFunc() {
|
|
224
224
|
// 最开始使用的是监听图标@touchstart事件,自从hx2.8.4后,此方法在微信小程序出错
|
|
225
225
|
// 这里改为监听点击事件,手点击清除图标时,同时也发生了@blur事件,导致图标消失而无法点击,这里做一个延时
|
|
226
226
|
setTimeout(() => {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* @Author : LQ
|
|
3
3
|
* @Description :
|
|
4
|
-
* @version :
|
|
4
|
+
* @version : 3.0
|
|
5
5
|
* @Date : 2021-08-20 16:44:21
|
|
6
|
-
* @LastAuthor :
|
|
7
|
-
* @lastTime :
|
|
8
|
-
* @FilePath : /
|
|
6
|
+
* @LastAuthor : jry
|
|
7
|
+
* @lastTime : 2025-12-19 08:55:21
|
|
8
|
+
* @FilePath : /uview-plus/libs/config/props/section.js
|
|
9
9
|
*/
|
|
10
10
|
import { t } from '../../libs/i18n'
|
|
11
11
|
export default {
|
|
@@ -46,9 +46,12 @@
|
|
|
46
46
|
</template>
|
|
47
47
|
|
|
48
48
|
<script>
|
|
49
|
+
import { mpMixin } from '../../libs/mixin/mpMixin';
|
|
50
|
+
import { mixin } from '../../libs/mixin/mixin';
|
|
49
51
|
import { getWindowInfo } from '../../libs/function/index';
|
|
50
52
|
export default {
|
|
51
53
|
name:"up-select",
|
|
54
|
+
mixins: [mpMixin, mixin],
|
|
52
55
|
emits: ['update:current', 'select'],
|
|
53
56
|
props: {
|
|
54
57
|
maxHeight: {
|
|
@@ -143,6 +146,9 @@ export default {
|
|
|
143
146
|
}
|
|
144
147
|
});
|
|
145
148
|
},
|
|
149
|
+
closeSelect() {
|
|
150
|
+
this.isOpen = false;
|
|
151
|
+
},
|
|
146
152
|
overlayClick() {
|
|
147
153
|
this.isOpen = false;
|
|
148
154
|
},
|
|
@@ -155,7 +161,6 @@ export default {
|
|
|
155
161
|
let wi = getWindowInfo();
|
|
156
162
|
let windowWidth = wi.windowWidth;
|
|
157
163
|
this.$uGetRect('.u-select__options__wrap').then(rect => {
|
|
158
|
-
console.log(rect)
|
|
159
164
|
if (rect.left + rect.width > windowWidth) {
|
|
160
165
|
// 如果右侧被遮挡,则调整到左侧
|
|
161
166
|
this.optionsWrapLeft = 'auto';
|
|
@@ -216,3 +221,4 @@ export default {
|
|
|
216
221
|
}
|
|
217
222
|
}
|
|
218
223
|
</style>
|
|
224
|
+
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="u-signature">
|
|
3
|
-
<view class="u-signature__canvas-wrap">
|
|
4
|
-
<canvas
|
|
5
|
-
|
|
6
|
-
:canvas-id="canvasId"
|
|
7
|
-
:
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
<view class="u-signature__canvas-wrap" :style="{background: bgColor}">
|
|
4
|
+
<up-canvas
|
|
5
|
+
ref="signatureCanvas"
|
|
6
|
+
:canvas-id="canvasId"
|
|
7
|
+
:width="canvasWidth"
|
|
8
|
+
:height="canvasHeight"
|
|
9
|
+
:bg-color="bgColor"
|
|
10
|
+
@touchstart="touchStart"
|
|
11
|
+
@touchmove="touchMove"
|
|
10
12
|
@touchend="touchEnd"
|
|
13
|
+
:disable-scroll="true"
|
|
14
|
+
class="u-signature__canvas"
|
|
11
15
|
:style="{
|
|
12
16
|
width: canvasWidth + 'px',
|
|
13
17
|
height: canvasHeight + 'px',
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
></canvas>
|
|
18
|
+
}">
|
|
19
|
+
</up-canvas>
|
|
17
20
|
</view>
|
|
18
21
|
|
|
19
22
|
<view v-if="showToolbar" class="u-signature__toolbar">
|
|
@@ -116,7 +119,6 @@
|
|
|
116
119
|
isDrawing: false,
|
|
117
120
|
pathStack: [], // 存储绘制路径用于回退
|
|
118
121
|
currentPath: [], // 当前绘制路径
|
|
119
|
-
ctx: null,
|
|
120
122
|
isEmpty: true,
|
|
121
123
|
presetColors: [
|
|
122
124
|
'#000000', // 黑色
|
|
@@ -130,11 +132,16 @@
|
|
|
130
132
|
],
|
|
131
133
|
showBrushSettings: false,
|
|
132
134
|
showColorSettings: false,
|
|
133
|
-
lastPoint: null // 保存上一个点的坐标
|
|
135
|
+
lastPoint: null, // 保存上一个点的坐标
|
|
136
|
+
canvasInstance: null // 缓存canvas实例
|
|
134
137
|
}
|
|
135
138
|
},
|
|
136
139
|
mounted() {
|
|
137
|
-
|
|
140
|
+
// 初始化时获取canvas实例
|
|
141
|
+
this.$nextTick(() => {
|
|
142
|
+
this.getCanvasInstance();
|
|
143
|
+
this.clearCanvas();
|
|
144
|
+
});
|
|
138
145
|
},
|
|
139
146
|
watch: {
|
|
140
147
|
width: {
|
|
@@ -163,32 +170,41 @@
|
|
|
163
170
|
}
|
|
164
171
|
},
|
|
165
172
|
methods: {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
this.
|
|
171
|
-
|
|
173
|
+
t,
|
|
174
|
+
|
|
175
|
+
// 获取签名画布实例
|
|
176
|
+
getCanvasInstance() {
|
|
177
|
+
if (this.canvasInstance) {
|
|
178
|
+
return this.canvasInstance;
|
|
179
|
+
}
|
|
172
180
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
181
|
+
const canvasRef = this.$refs.signatureCanvas;
|
|
182
|
+
if (canvasRef) {
|
|
183
|
+
this.canvasInstance = canvasRef;
|
|
184
|
+
return canvasRef;
|
|
185
|
+
}
|
|
186
|
+
return null;
|
|
176
187
|
},
|
|
177
188
|
|
|
178
189
|
touchStart(e) {
|
|
179
|
-
if (!this.ctx)
|
|
190
|
+
if (!this.canvasInstance || !this.canvasInstance.ctx) {
|
|
191
|
+
this.getCanvasInstance();
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
if (!this.canvasInstance || !this.canvasInstance.ctx) return;
|
|
195
|
+
|
|
196
|
+
this.isDrawing = true;
|
|
197
|
+
this.isEmpty = false;
|
|
198
|
+
this.currentPath = [];
|
|
180
199
|
|
|
181
|
-
|
|
182
|
-
this.isEmpty = false
|
|
183
|
-
this.currentPath = []
|
|
200
|
+
const { x, y } = this.getCanvasPoint(e);
|
|
184
201
|
|
|
185
|
-
|
|
186
|
-
this.
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
this.
|
|
190
|
-
this.
|
|
191
|
-
this.ctx.setLineWidth(this.lineWidth)
|
|
202
|
+
// 设置线条样式
|
|
203
|
+
this.canvasInstance.setLineStyle(this.lineColor, this.lineWidth);
|
|
204
|
+
|
|
205
|
+
// 开始路径
|
|
206
|
+
this.canvasInstance.beginPath();
|
|
207
|
+
this.canvasInstance.moveTo(x, y);
|
|
192
208
|
|
|
193
209
|
// 记录起始点
|
|
194
210
|
this.currentPath.push({
|
|
@@ -197,83 +213,69 @@
|
|
|
197
213
|
type: 'start',
|
|
198
214
|
color: this.lineColor,
|
|
199
215
|
width: this.lineWidth
|
|
200
|
-
})
|
|
216
|
+
});
|
|
201
217
|
|
|
202
218
|
// 保存上一个点
|
|
203
|
-
this.lastPoint = { x, y }
|
|
219
|
+
this.lastPoint = { x, y };
|
|
204
220
|
|
|
205
221
|
// 阻止默认事件以提高性能
|
|
206
|
-
e.preventDefault()
|
|
222
|
+
e.preventDefault();
|
|
207
223
|
},
|
|
208
224
|
|
|
209
225
|
touchMove(e) {
|
|
210
|
-
if (!this.isDrawing || !this.ctx) return
|
|
226
|
+
if (!this.isDrawing || !this.canvasInstance || !this.canvasInstance.ctx) return;
|
|
211
227
|
|
|
212
228
|
// 阻止默认事件以提高性能
|
|
213
|
-
e.preventDefault()
|
|
229
|
+
e.preventDefault();
|
|
214
230
|
|
|
215
|
-
const { x, y } = this.getCanvasPoint(e)
|
|
231
|
+
const { x, y } = this.getCanvasPoint(e);
|
|
216
232
|
|
|
217
|
-
//
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
const t = i / steps
|
|
227
|
-
const midX = this.lastPoint.x + (x - this.lastPoint.x) * t
|
|
228
|
-
const midY = this.lastPoint.y + (y - this.lastPoint.y) * t
|
|
229
|
-
|
|
230
|
-
this.ctx.lineTo(midX, midY)
|
|
231
|
-
this.ctx.stroke()
|
|
232
|
-
this.currentPath.push({
|
|
233
|
-
x: midX,
|
|
234
|
-
y: midY,
|
|
235
|
-
type: 'move'
|
|
236
|
-
})
|
|
237
|
-
}
|
|
238
|
-
} else {
|
|
239
|
-
this.ctx.lineTo(x, y)
|
|
240
|
-
this.ctx.stroke()
|
|
241
|
-
this.currentPath.push({
|
|
242
|
-
x,
|
|
243
|
-
y,
|
|
244
|
-
type: 'move'
|
|
245
|
-
})
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
this.ctx.draw(true)
|
|
233
|
+
// 从上一个点画线到当前点
|
|
234
|
+
this.canvasInstance.lineTo(x, y);
|
|
235
|
+
this.canvasInstance.stroke(); // 实时绘制当前线段
|
|
236
|
+
this.currentPath.push({
|
|
237
|
+
x,
|
|
238
|
+
y,
|
|
239
|
+
type: 'move'
|
|
240
|
+
});
|
|
241
|
+
this.canvasInstance.draw(false);
|
|
249
242
|
|
|
250
243
|
// 更新上一个点
|
|
251
|
-
this.lastPoint = { x, y }
|
|
244
|
+
this.lastPoint = { x, y };
|
|
252
245
|
},
|
|
253
246
|
|
|
254
247
|
touchEnd(e) {
|
|
255
|
-
if (!this.isDrawing || !this.ctx) return
|
|
248
|
+
if (!this.isDrawing || !this.canvasInstance || !this.canvasInstance.ctx) return;
|
|
256
249
|
|
|
257
|
-
this.isDrawing = false
|
|
258
|
-
this.
|
|
259
|
-
this.lastPoint = null
|
|
250
|
+
this.isDrawing = false;
|
|
251
|
+
this.canvasInstance.closePath();
|
|
252
|
+
this.lastPoint = null;
|
|
260
253
|
|
|
261
254
|
// 将当前路径加入栈中用于回退
|
|
262
255
|
if (this.currentPath.length > 0) {
|
|
263
|
-
this.pathStack.push([...this.currentPath])
|
|
256
|
+
this.pathStack.push([...this.currentPath]);
|
|
264
257
|
}
|
|
258
|
+
|
|
259
|
+
// 最后统一执行一次绘制
|
|
260
|
+
this.canvasInstance.draw(true);
|
|
265
261
|
},
|
|
266
262
|
|
|
267
263
|
// 同步获取canvas坐标点(兼容处理)
|
|
268
264
|
getCanvasPoint(e) {
|
|
269
|
-
|
|
270
|
-
const
|
|
265
|
+
// #ifdef MP-WEIXIN
|
|
266
|
+
const touch = e.touches && e.touches[0] ? e.touches[0] : e.mp.touches[0];
|
|
267
|
+
// #endif
|
|
268
|
+
// #ifndef MP-WEIXIN
|
|
269
|
+
const touch = e.touches[0];
|
|
270
|
+
// #endif
|
|
271
271
|
|
|
272
|
-
//
|
|
272
|
+
// 计算相对于canvas的坐标
|
|
273
|
+
// 由于无法直接获取canvas位置,这里简化处理
|
|
274
|
+
// 实际应用中可能需要通过uni.createSelectorQuery获取canvas位置
|
|
273
275
|
return {
|
|
274
276
|
x: touch.x,
|
|
275
277
|
y: touch.y
|
|
276
|
-
}
|
|
278
|
+
};
|
|
277
279
|
},
|
|
278
280
|
|
|
279
281
|
// 选择颜色
|
|
@@ -294,84 +296,83 @@
|
|
|
294
296
|
|
|
295
297
|
// 重新绘制所有路径
|
|
296
298
|
redraw() {
|
|
297
|
-
this.
|
|
299
|
+
if (!this.canvasInstance) {
|
|
300
|
+
this.getCanvasInstance();
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
if (!this.canvasInstance) return;
|
|
304
|
+
|
|
305
|
+
// 先清空画布
|
|
306
|
+
this.canvasInstance.clearCanvas();
|
|
298
307
|
|
|
299
308
|
if (this.pathStack.length === 0) {
|
|
300
|
-
this.isEmpty = true
|
|
301
|
-
return
|
|
309
|
+
this.isEmpty = true;
|
|
310
|
+
return;
|
|
302
311
|
}
|
|
303
312
|
|
|
304
|
-
this.isEmpty = false
|
|
313
|
+
this.isEmpty = false;
|
|
305
314
|
|
|
306
|
-
//
|
|
315
|
+
// 逐个绘制路径
|
|
307
316
|
this.pathStack.forEach(path => {
|
|
308
|
-
if (path.length === 0) return
|
|
317
|
+
if (path.length === 0) return;
|
|
309
318
|
|
|
310
|
-
this.
|
|
311
|
-
this.ctx.setLineCap('round')
|
|
312
|
-
this.ctx.setLineJoin('round')
|
|
319
|
+
this.canvasInstance.beginPath();
|
|
313
320
|
|
|
314
|
-
let lastPoint = null
|
|
321
|
+
let lastPoint = null;
|
|
315
322
|
path.forEach((point, index) => {
|
|
316
323
|
if (index === 0 && point.type === 'start') {
|
|
317
|
-
//
|
|
318
|
-
this.
|
|
319
|
-
this.
|
|
320
|
-
|
|
321
|
-
lastPoint = { x: point.x, y: point.y }
|
|
324
|
+
// 设置线条样式
|
|
325
|
+
this.canvasInstance.setLineStyle(point.color, point.width);
|
|
326
|
+
this.canvasInstance.moveTo(point.x, point.y);
|
|
327
|
+
lastPoint = { x: point.x, y: point.y };
|
|
322
328
|
} else if (point.type === 'move') {
|
|
323
|
-
this.
|
|
324
|
-
lastPoint = { x: point.x, y: point.y }
|
|
329
|
+
this.canvasInstance.lineTo(point.x, point.y);
|
|
330
|
+
lastPoint = { x: point.x, y: point.y };
|
|
325
331
|
}
|
|
326
|
-
})
|
|
327
|
-
|
|
328
|
-
this.
|
|
329
|
-
|
|
330
|
-
})
|
|
331
|
-
// #endif
|
|
332
|
-
},
|
|
333
|
-
|
|
334
|
-
// 清空画布
|
|
335
|
-
clear() {
|
|
336
|
-
this.pathStack = []
|
|
337
|
-
this.currentPath = []
|
|
338
|
-
this.isEmpty = true
|
|
339
|
-
this.lastPoint = null
|
|
340
|
-
this.clearCanvas()
|
|
332
|
+
});
|
|
333
|
+
this.canvasInstance.stroke();
|
|
334
|
+
this.canvasInstance.draw(true);
|
|
335
|
+
});
|
|
341
336
|
},
|
|
342
337
|
|
|
343
338
|
// 清空画布内容
|
|
344
339
|
clearCanvas() {
|
|
345
|
-
if (!this.
|
|
340
|
+
if (!this.canvasInstance) {
|
|
341
|
+
this.getCanvasInstance();
|
|
342
|
+
}
|
|
346
343
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
this.
|
|
350
|
-
this.ctx.draw()
|
|
351
|
-
// #endif
|
|
344
|
+
if (!this.canvasInstance) return;
|
|
345
|
+
|
|
346
|
+
this.canvasInstance.clearCanvas();
|
|
352
347
|
},
|
|
353
348
|
|
|
354
349
|
// 导出签名图片
|
|
355
|
-
exportSignature() {
|
|
356
|
-
if (this.isEmpty)
|
|
350
|
+
async exportSignature() {
|
|
351
|
+
if (this.isEmpty) {
|
|
352
|
+
console.warn('签名为空,无法导出');
|
|
353
|
+
return;
|
|
354
|
+
}
|
|
357
355
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
fileType: 'png',
|
|
362
|
-
quality: 1,
|
|
363
|
-
success: (res) => {
|
|
364
|
-
this.$emit('confirm', res.tempFilePath)
|
|
365
|
-
},
|
|
366
|
-
fail: (err) => {
|
|
367
|
-
this.$emit('error', err)
|
|
368
|
-
}
|
|
369
|
-
}, this)
|
|
370
|
-
// #endif
|
|
356
|
+
if (!this.canvasInstance) {
|
|
357
|
+
this.getCanvasInstance();
|
|
358
|
+
}
|
|
371
359
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
360
|
+
if (!this.canvasInstance) {
|
|
361
|
+
console.error('无法获取画布实例');
|
|
362
|
+
return;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
try {
|
|
366
|
+
// 先重绘整个签名内容
|
|
367
|
+
this.redraw();
|
|
368
|
+
|
|
369
|
+
// 导出图片
|
|
370
|
+
const imagePath = await this.canvasInstance.exportImage('png', 1);
|
|
371
|
+
this.$emit('confirm', imagePath);
|
|
372
|
+
} catch (error) {
|
|
373
|
+
console.error('导出签名图片失败:', error);
|
|
374
|
+
this.$emit('error', error);
|
|
375
|
+
}
|
|
375
376
|
},
|
|
376
377
|
|
|
377
378
|
// 切换笔画设置显示
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* @Author : LQ
|
|
3
3
|
* @Description :
|
|
4
|
-
* @version :
|
|
4
|
+
* @version : 3.0
|
|
5
5
|
* @Date : 2021-08-20 16:44:21
|
|
6
|
-
* @LastAuthor :
|
|
7
|
-
* @lastTime :
|
|
8
|
-
* @FilePath : /
|
|
6
|
+
* @LastAuthor : jry
|
|
7
|
+
* @lastTime : 2025-12-19 08:55:21
|
|
8
|
+
* @FilePath : /uview-plus/libs/config/props/skeleton.js
|
|
9
9
|
*/
|
|
10
10
|
export default {
|
|
11
11
|
// skeleton
|
|
@@ -82,7 +82,7 @@ export const props = defineMixin({
|
|
|
82
82
|
type: Boolean,
|
|
83
83
|
default: () => defProps.slider.useNative
|
|
84
84
|
},
|
|
85
|
-
//
|
|
85
|
+
// 滑块厚度
|
|
86
86
|
height: {
|
|
87
87
|
type: String,
|
|
88
88
|
default: () => defProps.slider.height
|
|
@@ -91,5 +91,20 @@ export const props = defineMixin({
|
|
|
91
91
|
type: Object,
|
|
92
92
|
default: () => defProps.slider.innerStyle
|
|
93
93
|
},
|
|
94
|
+
// 是否垂直方向
|
|
95
|
+
vertical: {
|
|
96
|
+
type: Boolean,
|
|
97
|
+
default: defProps.slider.vertical
|
|
98
|
+
},
|
|
99
|
+
// 滑块粗细,为了支持垂直模式下统一粗细参数,用size代替height。
|
|
100
|
+
size: {
|
|
101
|
+
type: [Number, String],
|
|
102
|
+
default: () => defProps.slider.size
|
|
103
|
+
},
|
|
104
|
+
// 滑块长度,水平和垂直模式的长度。
|
|
105
|
+
length: {
|
|
106
|
+
type: [Number, String],
|
|
107
|
+
default: 'auto'
|
|
108
|
+
}
|
|
94
109
|
}
|
|
95
|
-
})
|
|
110
|
+
})
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* @Author : LQ
|
|
3
3
|
* @Description :
|
|
4
|
-
* @version :
|
|
4
|
+
* @version : 3.0
|
|
5
5
|
* @Date : 2021-08-20 16:44:21
|
|
6
|
-
* @LastAuthor :
|
|
7
|
-
* @lastTime :
|
|
8
|
-
* @FilePath : /
|
|
6
|
+
* @LastAuthor : jry
|
|
7
|
+
* @lastTime : 2025-12-19 08:55:21
|
|
8
|
+
* @FilePath : /uview-plus/libs/config/props/slider.js
|
|
9
9
|
*/
|
|
10
10
|
export default {
|
|
11
11
|
// slider组件
|
|
@@ -22,7 +22,10 @@ export default {
|
|
|
22
22
|
disabled:false,
|
|
23
23
|
blockStyle: {},
|
|
24
24
|
useNative: false,
|
|
25
|
-
height: '
|
|
26
|
-
innerStyle: {}
|
|
25
|
+
height: '',
|
|
26
|
+
innerStyle: {},
|
|
27
|
+
vertical: false,
|
|
28
|
+
size: '2px',
|
|
29
|
+
length: 'auto'
|
|
27
30
|
}
|
|
28
|
-
}
|
|
31
|
+
}
|