uview-plus 3.4.40 → 3.4.42
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 +10 -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 +24 -10
- package/components/u-qrcode/u-qrcode.vue +412 -281
- 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,11 +1100,15 @@ let QRCode = {};
|
|
|
1101
1100
|
catch (e) {
|
|
1102
1101
|
console.error("createCanvasContextFail",e)
|
|
1103
1102
|
}
|
|
1104
|
-
|
|
1105
1103
|
})
|
|
1106
1104
|
}
|
|
1107
1105
|
// 创建canvas
|
|
1108
1106
|
let createCanvas = async function (options) {
|
|
1107
|
+
let isApp = false;
|
|
1108
|
+
// #ifdef APP
|
|
1109
|
+
isApp = true;
|
|
1110
|
+
// #endif
|
|
1111
|
+
|
|
1109
1112
|
if(options.showLoading){
|
|
1110
1113
|
uni.showLoading({
|
|
1111
1114
|
title: options.loadingText,
|
|
@@ -1124,9 +1127,18 @@ let QRCode = {};
|
|
|
1124
1127
|
canvas.width = options.size;
|
|
1125
1128
|
canvas.height = options.size;
|
|
1126
1129
|
// #endif
|
|
1127
|
-
|
|
1130
|
+
// #ifdef APP
|
|
1131
|
+
ctx = uni.createCanvasContext(options.canvasId, options.context);
|
|
1132
|
+
// #endif
|
|
1133
|
+
// #ifndef APP
|
|
1128
1134
|
ctx = canvas.getContext('2d');
|
|
1135
|
+
// #endif
|
|
1136
|
+
|
|
1129
1137
|
}
|
|
1138
|
+
// 设置组件中data里面的ctx
|
|
1139
|
+
options.context.ctx = ctx;
|
|
1140
|
+
options.context.canvas = canvas;
|
|
1141
|
+
|
|
1130
1142
|
var count = qrCodeAlg.getModuleCount();
|
|
1131
1143
|
var ratioSize = options.size;
|
|
1132
1144
|
var ratioImgSize = options.imageSize;
|
|
@@ -1160,12 +1172,14 @@ let QRCode = {};
|
|
|
1160
1172
|
ctx.drawImage(options.image, x, y, ratioImgSize, ratioImgSize);
|
|
1161
1173
|
}
|
|
1162
1174
|
else {
|
|
1163
|
-
// #ifdef H5
|
|
1175
|
+
// #ifdef H5 || APP
|
|
1164
1176
|
const img = new Image();
|
|
1165
1177
|
// #endif
|
|
1166
|
-
|
|
1178
|
+
|
|
1179
|
+
// #ifndef H5 || APP
|
|
1167
1180
|
const img = canvas.createImage();
|
|
1168
1181
|
// #endif
|
|
1182
|
+
|
|
1169
1183
|
img.onload = () => {
|
|
1170
1184
|
ctx.drawImage(img, x, y, ratioImgSize, ratioImgSize);
|
|
1171
1185
|
};
|
|
@@ -1173,7 +1187,7 @@ let QRCode = {};
|
|
|
1173
1187
|
}
|
|
1174
1188
|
// 画圆角矩形
|
|
1175
1189
|
function drawRoundedRect(ctxi, x, y, width, height, r, lineWidth, fill, stroke) {
|
|
1176
|
-
if (options.nvueContext) {
|
|
1190
|
+
if (options.nvueContext || isApp) {
|
|
1177
1191
|
ctxi.setLineWidth(lineWidth);
|
|
1178
1192
|
ctxi.setFillStyle(options.background);
|
|
1179
1193
|
ctxi.setStrokeStyle(options.background);
|
|
@@ -1208,7 +1222,7 @@ let QRCode = {};
|
|
|
1208
1222
|
}
|
|
1209
1223
|
setTimeout(() => {
|
|
1210
1224
|
// canvas2 绘制是自动的不需要手动绘制
|
|
1211
|
-
if(options.nvueContext){
|
|
1225
|
+
if(options.nvueContext || isApp){
|
|
1212
1226
|
ctx.draw(true, () => {
|
|
1213
1227
|
// 保存到临时区域
|
|
1214
1228
|
setTimeout(() => {
|