uview-plus 3.4.40 → 3.4.41
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/changelog.md +7 -0
- package/components/u-action-sheet/u-action-sheet.vue +0 -1
- package/components/u-album/u-album.vue +0 -2
- package/components/u-alert/u-alert.vue +0 -1
- package/components/u-avatar/u-avatar.vue +0 -1
- package/components/u-avatar-group/u-avatar-group.vue +0 -1
- package/components/u-back-top/u-back-top.vue +0 -1
- package/components/u-badge/u-badge.vue +0 -1
- package/components/u-box/u-box.vue +0 -1
- package/components/u-button/u-button.vue +0 -2
- package/components/u-calendar/header.vue +0 -1
- package/components/u-calendar/month.vue +0 -1
- package/components/u-calendar/u-calendar.vue +0 -2
- package/components/u-car-keyboard/u-car-keyboard.vue +0 -1
- package/components/u-card/u-card.vue +0 -2
- package/components/u-cell/u-cell.vue +0 -1
- package/components/u-cell-group/u-cell-group.vue +0 -1
- package/components/u-checkbox/u-checkbox.vue +0 -1
- package/components/u-checkbox-group/u-checkbox-group.vue +0 -1
- package/components/u-circle-progress/u-circle-progress.vue +0 -1
- package/components/u-code/u-code.vue +0 -1
- package/components/u-code-input/u-code-input.vue +0 -1
- package/components/u-col/u-col.vue +0 -1
- package/components/u-collapse/u-collapse.vue +0 -1
- package/components/u-collapse-item/u-collapse-item.vue +0 -1
- package/components/u-column-notice/u-column-notice.vue +0 -1
- package/components/u-count-down/u-count-down.vue +0 -1
- package/components/u-count-to/u-count-to.vue +0 -2
- package/components/u-datetime-picker/u-datetime-picker.vue +0 -1
- package/components/u-divider/u-divider.vue +0 -1
- package/components/u-dropdown/u-dropdown.vue +0 -1
- package/components/u-dropdown-item/u-dropdown-item.vue +0 -1
- package/components/u-empty/u-empty.vue +0 -1
- package/components/u-float-button/u-float-button.vue +0 -2
- package/components/u-form-item/u-form-item.vue +0 -1
- package/components/u-gap/u-gap.vue +0 -1
- package/components/u-grid/u-grid.vue +0 -1
- package/components/u-grid-item/u-grid-item.vue +0 -1
- package/components/u-icon/u-icon.vue +0 -1
- package/components/u-image/u-image.vue +0 -2
- package/components/u-index-anchor/u-index-anchor.vue +0 -1
- package/components/u-index-item/u-index-item.vue +0 -1
- package/components/u-index-list/u-index-list.vue +0 -1
- package/components/u-input/u-input.vue +0 -2
- package/components/u-keyboard/u-keyboard.vue +0 -1
- package/components/u-lazy-load/u-lazy-load.vue +0 -2
- package/components/u-line/u-line.vue +0 -1
- package/components/u-line-progress/u-line-progress.vue +0 -1
- package/components/u-link/u-link.vue +0 -1
- package/components/u-list/u-list.vue +0 -1
- package/components/u-list-item/u-list-item.vue +0 -1
- package/components/u-loading-icon/u-loading-icon.vue +0 -1
- package/components/u-loading-page/u-loading-page.vue +0 -2
- package/components/u-loadmore/u-loadmore.vue +0 -1
- package/components/u-modal/u-modal.vue +0 -1
- package/components/u-navbar/u-navbar.vue +0 -1
- package/components/u-navbar-mini/u-navbar-mini.vue +0 -1
- package/components/u-no-network/u-no-network.vue +0 -1
- package/components/u-notice-bar/u-notice-bar.vue +0 -1
- package/components/u-notify/u-notify.vue +0 -1
- package/components/u-number-box/u-number-box.vue +0 -2
- package/components/u-number-keyboard/u-number-keyboard.vue +0 -1
- package/components/u-overlay/u-overlay.vue +0 -1
- package/components/u-picker/u-picker.vue +0 -1
- package/components/u-picker-column/u-picker-column.vue +0 -1
- package/components/u-popup/u-popup.vue +0 -1
- package/components/u-qrcode/qrcode.js +7 -6
- package/components/u-qrcode/u-qrcode.vue +111 -11
- package/components/u-radio/u-radio.vue +0 -1
- package/components/u-radio-group/u-radio-group.vue +0 -1
- package/components/u-rate/u-rate.vue +0 -1
- package/components/u-read-more/u-read-more.vue +0 -2
- package/components/u-row/u-row.vue +0 -1
- package/components/u-row-notice/u-row-notice.vue +0 -1
- package/components/u-scroll-list/u-scroll-list.vue +0 -2
- package/components/u-search/u-search.vue +0 -1
- package/components/u-skeleton/u-skeleton.vue +0 -1
- package/components/u-slider/u-slider.vue +0 -1
- package/components/u-steps/u-steps.vue +0 -1
- package/components/u-steps-item/u-steps-item.vue +0 -1
- package/components/u-subsection/u-subsection.vue +0 -2
- package/components/u-swipe-action-item/u-swipe-action-item.vue +0 -1
- package/components/u-swiper/u-swiper.vue +0 -1
- package/components/u-swiper-indicator/u-swiper-indicator.vue +0 -1
- package/components/u-switch/u-switch.vue +0 -1
- package/components/u-tabbar/u-tabbar.vue +0 -1
- package/components/u-tabbar-item/u-tabbar-item.vue +0 -1
- package/components/u-table/u-table.vue +0 -1
- package/components/u-tabs/u-tabs.vue +0 -1
- package/components/u-tag/u-tag.vue +0 -1
- package/components/u-td/u-td.vue +0 -1
- package/components/u-text/u-text.vue +4 -6
- package/components/u-textarea/u-textarea.vue +9 -11
- package/components/u-th/u-th.vue +0 -1
- package/components/u-toast/u-toast.vue +2 -2
- package/components/u-toolbar/u-toolbar.vue +0 -1
- package/components/u-tooltip/u-tooltip.vue +0 -1
- package/components/u-tr/u-tr.vue +0 -1
- package/components/u-transition/u-transition.vue +114 -3
- package/components/u-upload/u-upload.vue +0 -1
- package/components/u-view/u-view.vue +0 -2
- package/components/u-waterfall/u-waterfall.vue +0 -2
- package/index.scss +2 -1
- package/libs/util/gcanvas/bridge/bridge-weex.js +0 -0
- package/libs/util/gcanvas/context-2d/FillStyleLinearGradient.js +0 -0
- package/libs/util/gcanvas/context-2d/FillStylePattern.js +0 -0
- package/libs/util/gcanvas/context-2d/FillStyleRadialGradient.js +0 -0
- package/libs/util/gcanvas/context-2d/RenderingContext.js +0 -0
- package/libs/util/gcanvas/context-webgl/ActiveInfo.js +0 -0
- package/libs/util/gcanvas/context-webgl/Buffer.js +0 -0
- package/libs/util/gcanvas/context-webgl/Framebuffer.js +0 -0
- package/libs/util/gcanvas/context-webgl/GLenum.js +0 -0
- package/libs/util/gcanvas/context-webgl/GLmethod.js +0 -0
- package/libs/util/gcanvas/context-webgl/GLtype.js +0 -0
- package/libs/util/gcanvas/context-webgl/Program.js +0 -0
- package/libs/util/gcanvas/context-webgl/Renderbuffer.js +0 -0
- package/libs/util/gcanvas/context-webgl/RenderingContext.js +0 -0
- package/libs/util/gcanvas/context-webgl/Shader.js +0 -0
- package/libs/util/gcanvas/context-webgl/ShaderPrecisionFormat.js +0 -0
- package/libs/util/gcanvas/context-webgl/Texture.js +0 -0
- package/libs/util/gcanvas/context-webgl/UniformLocation.js +0 -0
- package/libs/util/gcanvas/context-webgl/classUtils.js +0 -0
- package/libs/util/gcanvas/env/canvas.js +0 -0
- package/libs/util/gcanvas/env/image.js +0 -0
- package/libs/util/gcanvas/env/tool.js +0 -0
- package/libs/util/gcanvas/index.js +0 -0
- package/package.json +1 -1
- package/types/comps/qrcode.d.ts +77 -0
- package/types/comps.d.ts +1 -0
|
@@ -1036,11 +1036,10 @@ let QRCode = {};
|
|
|
1036
1036
|
usingComponents: opt.usingComponents,
|
|
1037
1037
|
showLoading: opt.showLoading,
|
|
1038
1038
|
loadingText: opt.loadingText,
|
|
1039
|
-
that: opt.that
|
|
1040
1039
|
};
|
|
1041
1040
|
|
|
1042
1041
|
let canvas = null;
|
|
1043
|
-
|
|
1042
|
+
|
|
1044
1043
|
if (typeof opt === 'string') { // 只编码ASCII字符串
|
|
1045
1044
|
opt = {
|
|
1046
1045
|
text: opt
|
|
@@ -1087,11 +1086,11 @@ let QRCode = {};
|
|
|
1087
1086
|
}
|
|
1088
1087
|
return options.foreground;
|
|
1089
1088
|
}
|
|
1090
|
-
|
|
1089
|
+
|
|
1091
1090
|
let getCanvas = async (id) => {
|
|
1092
1091
|
return new Promise((resolve, reject)=>{
|
|
1093
1092
|
try {
|
|
1094
|
-
const query = uni.createSelectorQuery().in(this.options.
|
|
1093
|
+
const query = uni.createSelectorQuery().in(this.options.context);
|
|
1095
1094
|
query.select(`#${id}`)
|
|
1096
1095
|
.fields({ node: true, size: true })
|
|
1097
1096
|
.exec((res) => {
|
|
@@ -1101,7 +1100,6 @@ let QRCode = {};
|
|
|
1101
1100
|
catch (e) {
|
|
1102
1101
|
console.error("createCanvasContextFail",e)
|
|
1103
1102
|
}
|
|
1104
|
-
|
|
1105
1103
|
})
|
|
1106
1104
|
}
|
|
1107
1105
|
// 创建canvas
|
|
@@ -1124,9 +1122,12 @@ let QRCode = {};
|
|
|
1124
1122
|
canvas.width = options.size;
|
|
1125
1123
|
canvas.height = options.size;
|
|
1126
1124
|
// #endif
|
|
1127
|
-
|
|
1128
1125
|
ctx = canvas.getContext('2d');
|
|
1129
1126
|
}
|
|
1127
|
+
// 设置组件中data里面的ctx
|
|
1128
|
+
options.context.ctx = ctx;
|
|
1129
|
+
options.context.canvas = canvas;
|
|
1130
|
+
|
|
1130
1131
|
var count = qrCodeAlg.getModuleCount();
|
|
1131
1132
|
var ratioSize = options.size;
|
|
1132
1133
|
var ratioImgSize = options.imageSize;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view class="u-qrcode"
|
|
2
|
+
<view class="u-qrcode"
|
|
3
|
+
:id="rootId"
|
|
4
|
+
:style="{
|
|
5
|
+
width: useRootHeightAndWidth ? '100%' : 'auto',
|
|
6
|
+
height: useRootHeightAndWidth ? '100%' : 'auto',
|
|
7
|
+
}"
|
|
8
|
+
@longpress="longpress">
|
|
3
9
|
<view class="u-qrcode__content" @click="preview">
|
|
4
10
|
<!-- #ifndef APP-NVUE -->
|
|
5
11
|
<canvas
|
|
@@ -7,15 +13,15 @@
|
|
|
7
13
|
:id="cid"
|
|
8
14
|
:canvas-id="cid"
|
|
9
15
|
type="2d"
|
|
10
|
-
:style="{ width:
|
|
16
|
+
:style="{ width: sizeLocal + unit, height: sizeLocal + unit }" />
|
|
11
17
|
<!-- #endif -->
|
|
12
18
|
<!-- #ifdef APP-NVUE -->
|
|
13
19
|
<gcanvas class="u-qrcode__canvas" ref="gcanvess"
|
|
14
|
-
:style="{ width:
|
|
20
|
+
:style="{ width: sizeLocal + unit, height: sizeLocal + unit }">
|
|
15
21
|
</gcanvas>
|
|
16
22
|
<!-- #endif -->
|
|
17
23
|
<view v-if="showLoading && loading" class="u-qrcode__loading"
|
|
18
|
-
:style="{ width:
|
|
24
|
+
:style="{ width: sizeLocal + unit, height: sizeLocal + unit }">
|
|
19
25
|
<up-loading-icon vertical :text="loadingText" textSize="14px"></up-loading-icon>
|
|
20
26
|
</view>
|
|
21
27
|
</view>
|
|
@@ -104,8 +110,13 @@ export default {
|
|
|
104
110
|
type: Boolean,
|
|
105
111
|
default: false
|
|
106
112
|
},
|
|
113
|
+
// 是否使用根节点宽高
|
|
114
|
+
useRootHeightAndWidth: {
|
|
115
|
+
type: Boolean,
|
|
116
|
+
default: () => false
|
|
117
|
+
},
|
|
107
118
|
},
|
|
108
|
-
emits: ['result', '
|
|
119
|
+
emits: ['result', 'longpressCallback'],
|
|
109
120
|
data() {
|
|
110
121
|
return {
|
|
111
122
|
loading: false,
|
|
@@ -116,12 +127,21 @@ export default {
|
|
|
116
127
|
name: '保存二维码',
|
|
117
128
|
}
|
|
118
129
|
],
|
|
130
|
+
rootId: `rootId${Number(Math.random() * 100).toFixed(0)}`,
|
|
119
131
|
ganvas: null,
|
|
120
132
|
context: '',
|
|
121
|
-
canvasObj: {}
|
|
133
|
+
canvasObj: {},
|
|
134
|
+
sizeLocal: this.size,
|
|
135
|
+
ctx: null, // ctx 在new Qrcode 时js文件内部设置
|
|
136
|
+
canvas: null, // ctx 在new Qrcode 时js文件内部设置
|
|
122
137
|
}
|
|
123
138
|
},
|
|
124
|
-
mounted(){
|
|
139
|
+
async mounted(){
|
|
140
|
+
// 如果使用根节点的宽高 则 重新设置 size
|
|
141
|
+
if(this.useRootHeightAndWidth){
|
|
142
|
+
await this.setNewSize()
|
|
143
|
+
}
|
|
144
|
+
|
|
125
145
|
// #ifdef APP-NVUE
|
|
126
146
|
/*获取元素引用*/
|
|
127
147
|
this.ganvas = this.$refs["gcanvess"]
|
|
@@ -158,14 +178,13 @@ export default {
|
|
|
158
178
|
showLoading: false, // 是否显示loading
|
|
159
179
|
loadingText: that.loadingText, // loading文字
|
|
160
180
|
text: that.val, // 生成内容
|
|
161
|
-
size: that.
|
|
181
|
+
size: that.sizeLocal, // 二维码大小
|
|
162
182
|
background: that.background, // 背景色
|
|
163
183
|
foreground: that.foreground, // 前景色
|
|
164
184
|
pdground: that.pdground, // 定位角点颜色
|
|
165
185
|
correctLevel: that.lv, // 容错级别
|
|
166
186
|
image: that.icon, // 二维码图标
|
|
167
187
|
imageSize: that.iconSize,// 二维码图标大小
|
|
168
|
-
that,
|
|
169
188
|
cbResult: function (res) { // 生成二维码的回调
|
|
170
189
|
that._result(res)
|
|
171
190
|
},
|
|
@@ -223,9 +242,90 @@ export default {
|
|
|
223
242
|
url: this.result
|
|
224
243
|
}, e)
|
|
225
244
|
},
|
|
226
|
-
longpress() {
|
|
227
|
-
|
|
245
|
+
async longpress() {
|
|
246
|
+
if (this.context) {
|
|
247
|
+
this.ctx.toTempFilePath(
|
|
248
|
+
0,
|
|
249
|
+
0,
|
|
250
|
+
this.sizeLocal,
|
|
251
|
+
this.sizeLocal,
|
|
252
|
+
this.sizeLocal,
|
|
253
|
+
this.sizeLocal,
|
|
254
|
+
"",
|
|
255
|
+
1,
|
|
256
|
+
res => {
|
|
257
|
+
this.$emit('longpressCallback', res.tempFilePath)
|
|
258
|
+
}
|
|
259
|
+
);
|
|
260
|
+
}
|
|
261
|
+
else {
|
|
262
|
+
const canvas = await this.getNode(this.cId,true);
|
|
263
|
+
// #ifdef MP-TOUTIAO || H5
|
|
264
|
+
this.$emit('longpressCallback', this.ctx.canvas.toDataURL("image/png", 1));
|
|
265
|
+
// #endif
|
|
266
|
+
|
|
267
|
+
// #ifndef MP-TOUTIAO || H5
|
|
268
|
+
uni.canvasToTempFilePath(
|
|
269
|
+
{
|
|
270
|
+
canvas,
|
|
271
|
+
success :res => {
|
|
272
|
+
console.log(res.tempFilePath)
|
|
273
|
+
this.$emit('longpressCallback', res.tempFilePath)
|
|
274
|
+
},
|
|
275
|
+
fail: err =>{
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
this)
|
|
279
|
+
// #endif
|
|
280
|
+
|
|
281
|
+
}
|
|
282
|
+
|
|
228
283
|
},
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* 使用根节点宽高 设置新的size
|
|
287
|
+
* @return {Promise<void>}
|
|
288
|
+
*/
|
|
289
|
+
async setNewSize(){
|
|
290
|
+
const rootNode = await this.getNode(this.rootId,false);
|
|
291
|
+
const { width , height } = rootNode;
|
|
292
|
+
// 将最短的设置为二维码 的size
|
|
293
|
+
if(width > height){
|
|
294
|
+
this.sizeLocal = height
|
|
295
|
+
}
|
|
296
|
+
else{
|
|
297
|
+
this.sizeLocal = width
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* 获取节点
|
|
303
|
+
* @param id 节点id
|
|
304
|
+
* @param isCanvas 是否为Canvas节点
|
|
305
|
+
* @return {Promise<unknown>}
|
|
306
|
+
*/
|
|
307
|
+
async getNode(id,isCanvas){
|
|
308
|
+
return new Promise((resolve, reject)=>{
|
|
309
|
+
try {
|
|
310
|
+
const query = uni.createSelectorQuery().in(this);
|
|
311
|
+
query.select(`#${id}`)
|
|
312
|
+
.fields({ node: true, size: true })
|
|
313
|
+
.exec((res) => {
|
|
314
|
+
if(isCanvas){
|
|
315
|
+
resolve(res[0].node)
|
|
316
|
+
}
|
|
317
|
+
else{
|
|
318
|
+
resolve(res[0])
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
})
|
|
322
|
+
}
|
|
323
|
+
catch (e) {
|
|
324
|
+
console.error("获取节点失败",e)
|
|
325
|
+
}
|
|
326
|
+
})
|
|
327
|
+
},
|
|
328
|
+
|
|
229
329
|
selectClick(index) {
|
|
230
330
|
switch (index) {
|
|
231
331
|
case 0:
|
package/components/u-td/u-td.vue
CHANGED
|
@@ -120,11 +120,11 @@ export default {
|
|
|
120
120
|
}
|
|
121
121
|
// 占满剩余空间
|
|
122
122
|
if (this.flex1) {
|
|
123
|
-
style.flex = 1;
|
|
124
|
-
// #ifndef APP-NVUE
|
|
125
|
-
style.width = '100%';
|
|
123
|
+
style.flex = 1;
|
|
124
|
+
// #ifndef APP-NVUE
|
|
125
|
+
style.width = '100%';
|
|
126
126
|
// #endif
|
|
127
|
-
}
|
|
127
|
+
}
|
|
128
128
|
return style;
|
|
129
129
|
},
|
|
130
130
|
valueStyle() {
|
|
@@ -175,8 +175,6 @@ export default {
|
|
|
175
175
|
</script>
|
|
176
176
|
|
|
177
177
|
<style lang="scss" scoped>
|
|
178
|
-
@import '../../libs/css/components.scss';
|
|
179
|
-
|
|
180
178
|
.u-text {
|
|
181
179
|
@include flex(row);
|
|
182
180
|
align-items: center;
|
|
@@ -145,15 +145,15 @@ export default {
|
|
|
145
145
|
}
|
|
146
146
|
// #endif
|
|
147
147
|
},
|
|
148
|
-
computed: {
|
|
149
|
-
fieldStyle() {
|
|
150
|
-
let style = {};
|
|
151
|
-
style['height'] = addUnit(this.height);
|
|
152
|
-
if (this.autoHeight) {
|
|
153
|
-
style['height'] = 'auto';
|
|
154
|
-
style['minHeight'] = addUnit(this.height);
|
|
155
|
-
}
|
|
156
|
-
return style;
|
|
148
|
+
computed: {
|
|
149
|
+
fieldStyle() {
|
|
150
|
+
let style = {};
|
|
151
|
+
style['height'] = addUnit(this.height);
|
|
152
|
+
if (this.autoHeight) {
|
|
153
|
+
style['height'] = 'auto';
|
|
154
|
+
style['minHeight'] = addUnit(this.height);
|
|
155
|
+
}
|
|
156
|
+
return style;
|
|
157
157
|
},
|
|
158
158
|
// 组件的类名
|
|
159
159
|
textareaClass() {
|
|
@@ -245,8 +245,6 @@ export default {
|
|
|
245
245
|
</script>
|
|
246
246
|
|
|
247
247
|
<style lang="scss" scoped>
|
|
248
|
-
@import "../../libs/css/components.scss";
|
|
249
|
-
|
|
250
248
|
.u-textarea {
|
|
251
249
|
border-radius: 4px;
|
|
252
250
|
background-color: #fff;
|
package/components/u-th/u-th.vue
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<view class="u-toast">
|
|
3
3
|
<u-overlay
|
|
4
4
|
:show="isShow"
|
|
5
|
-
:zIndex="tmpConfig.overlay ?
|
|
5
|
+
:zIndex="tmpConfig.overlay ? tmpConfig.zIndex : -1"
|
|
6
6
|
:custom-style="overlayStyle"
|
|
7
7
|
>
|
|
8
8
|
<view
|
|
@@ -77,6 +77,7 @@
|
|
|
77
77
|
config: {
|
|
78
78
|
message: '', // 显示文本
|
|
79
79
|
type: '', // 主题类型,primary,success,error,warning,black
|
|
80
|
+
zIndex: 10090, // 层级
|
|
80
81
|
duration: 2000, // 显示的时间,毫秒
|
|
81
82
|
icon: true, // 显示的图标
|
|
82
83
|
position: 'center', // toast出现的位置
|
|
@@ -193,7 +194,6 @@
|
|
|
193
194
|
</script>
|
|
194
195
|
|
|
195
196
|
<style lang="scss" scoped>
|
|
196
|
-
@import "../../libs/css/components.scss";
|
|
197
197
|
|
|
198
198
|
$u-toast-color:#fff !default;
|
|
199
199
|
$u-toast-border-radius:4px !default;
|