uview-plus 3.6.28 → 3.7.0
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 +314 -0
- 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-button/button.js +4 -4
- package/components/u-calendar/calendar.js +4 -4
- package/components/u-canvas/u-canvas.vue +146 -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-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 +178 -85
- 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 +4 -1
- package/components/u-signature/u-signature.vue +1 -0
- package/components/u-skeleton/skeleton.js +4 -4
- package/components/u-slider/slider.js +4 -4
- 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-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/function/index.js +11 -5
- package/libs/util/gcanvas/bridge/bridge-weex.js +2 -1
- package/libs/util/gcanvas/env/image.js +24 -16
- package/package.json +2 -2
- 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/loadingPage.js
|
|
9
9
|
*/
|
|
10
10
|
import { t } from '../../libs/i18n'
|
|
11
11
|
export default {
|
|
@@ -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/loadmore.js
|
|
9
9
|
*/
|
|
10
10
|
import { t } from '../../libs/i18n'
|
|
11
11
|
export default {
|
|
@@ -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/modal.js
|
|
9
9
|
*/
|
|
10
10
|
import { t } from '../../libs/i18n'
|
|
11
11
|
export default {
|
|
@@ -29,7 +29,7 @@ export default {
|
|
|
29
29
|
confirmButtonShape: '',
|
|
30
30
|
duration: 400,
|
|
31
31
|
contentTextAlign: 'left',
|
|
32
|
-
asyncCloseTip: t("up.common.
|
|
32
|
+
asyncCloseTip: t("up.common.inOperation") + '...',
|
|
33
33
|
asyncCancelClose: false,
|
|
34
34
|
contentStyle: {}
|
|
35
35
|
}
|
|
@@ -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/navbar.js
|
|
9
9
|
*/
|
|
10
10
|
import color from '../../libs/config/color'
|
|
11
11
|
export default {
|
|
@@ -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/noNetwork.js
|
|
9
9
|
*/
|
|
10
10
|
import { t } from '../../libs/i18n'
|
|
11
11
|
export default {
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
</view>
|
|
31
31
|
<!-- #endif -->
|
|
32
32
|
<view class="u-no-network__retry">
|
|
33
|
-
<
|
|
33
|
+
<up-button
|
|
34
34
|
size="mini"
|
|
35
35
|
:text="t('up.common.retry')"
|
|
36
36
|
type="primary"
|
|
37
37
|
plain
|
|
38
38
|
@click="retry"
|
|
39
|
-
></
|
|
39
|
+
></up-button>
|
|
40
40
|
</view>
|
|
41
41
|
</view>
|
|
42
42
|
</u-overlay>
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
* @property {String | Number} zIndex 组件的z-index值
|
|
57
57
|
* @property {String} image 无网络的图片提示,可用的src地址或base64图片
|
|
58
58
|
* @event {Function} retry 用户点击页面的"重试"按钮时触发
|
|
59
|
-
* @example <
|
|
59
|
+
* @example <up-no-network></u-no-network>
|
|
60
60
|
*/
|
|
61
61
|
export default {
|
|
62
62
|
name: "u-no-network",
|
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
},
|
|
70
70
|
mounted() {
|
|
71
71
|
this.isIOS = (getDeviceInfo().platform === 'ios')
|
|
72
|
+
// HarmonyOS Next 平台使用时需要添加权限 ohos.permission.GET_NETWORK_INFO
|
|
72
73
|
uni.onNetworkStatusChange((res) => {
|
|
73
74
|
this.isConnected = res.isConnected
|
|
74
75
|
this.networkType = res.networkType
|
|
@@ -83,6 +84,9 @@
|
|
|
83
84
|
} else {
|
|
84
85
|
this.isConnected = true
|
|
85
86
|
}
|
|
87
|
+
},
|
|
88
|
+
fail: (res) => {
|
|
89
|
+
console.log(res)
|
|
86
90
|
}
|
|
87
91
|
})
|
|
88
92
|
},
|
|
@@ -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/noticeBar.js
|
|
9
9
|
*/
|
|
10
10
|
export default {
|
|
11
11
|
// noticeBar
|
|
@@ -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/notify.js
|
|
9
9
|
*/
|
|
10
10
|
export default {
|
|
11
11
|
// notify组件
|
|
@@ -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/numberBox.js
|
|
9
9
|
*/
|
|
10
10
|
export default {
|
|
11
11
|
// 步进器组件
|
|
@@ -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/numberKeyboard.js
|
|
9
9
|
*/
|
|
10
10
|
export default {
|
|
11
11
|
// 数字键盘
|
|
@@ -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/overlay.js
|
|
9
9
|
*/
|
|
10
10
|
export default {
|
|
11
11
|
// overlay组件
|
|
@@ -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/picker.js
|
|
9
9
|
*/
|
|
10
10
|
import { t } from '../../libs/i18n'
|
|
11
11
|
export default {
|
|
@@ -212,7 +212,7 @@ export default {
|
|
|
212
212
|
let firstItem = this.innerColumns[0] && this.innerColumns[0][0];
|
|
213
213
|
// //区分是不是对象数组
|
|
214
214
|
if (firstItem && Object.prototype.toString.call(firstItem) === '[object Object]') {
|
|
215
|
-
let res = this.innerColumns[0].filter(item => this.modelValue.includes(item[
|
|
215
|
+
let res = this.innerColumns[0].filter(item => this.modelValue.includes(item[this.valueName]))
|
|
216
216
|
res = res.map(item => item[this.keyName]);
|
|
217
217
|
return res.join("/");
|
|
218
218
|
|
|
@@ -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/popup.js
|
|
9
9
|
*/
|
|
10
10
|
export default {
|
|
11
11
|
// popup组件
|
|
@@ -18,6 +18,7 @@ let QRCode = {};
|
|
|
18
18
|
return [c0, c1];
|
|
19
19
|
// 3 bytes
|
|
20
20
|
} else {
|
|
21
|
+
|
|
21
22
|
c0 = 224 + (code >> 12);
|
|
22
23
|
c1 = 128 + (code >> 6 & 63);
|
|
23
24
|
c2 = 128 + (code & 63);
|
|
@@ -1031,15 +1032,14 @@ let QRCode = {};
|
|
|
1031
1032
|
image: '',
|
|
1032
1033
|
imageSize: 30,
|
|
1033
1034
|
canvasId: opt.canvasId,
|
|
1034
|
-
|
|
1035
|
-
|
|
1035
|
+
ctx: opt.ctx,
|
|
1036
|
+
isNvue: opt.isNvue,
|
|
1037
|
+
vuectx: opt.vuectx,
|
|
1036
1038
|
usingComponents: opt.usingComponents,
|
|
1037
1039
|
showLoading: opt.showLoading,
|
|
1038
1040
|
loadingText: opt.loadingText,
|
|
1039
1041
|
};
|
|
1040
1042
|
|
|
1041
|
-
let canvas = null;
|
|
1042
|
-
|
|
1043
1043
|
if (typeof opt === 'string') { // 只编码ASCII字符串
|
|
1044
1044
|
opt = {
|
|
1045
1045
|
text: opt
|
|
@@ -1087,21 +1087,6 @@ let QRCode = {};
|
|
|
1087
1087
|
return options.foreground;
|
|
1088
1088
|
}
|
|
1089
1089
|
|
|
1090
|
-
let getCanvas = async (id) => {
|
|
1091
|
-
return new Promise((resolve, reject)=>{
|
|
1092
|
-
try {
|
|
1093
|
-
const query = uni.createSelectorQuery().in(this.options.context);
|
|
1094
|
-
query.select(`#${id}`)
|
|
1095
|
-
.fields({ node: true, size: true })
|
|
1096
|
-
.exec((res) => {
|
|
1097
|
-
resolve(res[0].node)
|
|
1098
|
-
})
|
|
1099
|
-
}
|
|
1100
|
-
catch (e) {
|
|
1101
|
-
console.error("createCanvasContextFail",e)
|
|
1102
|
-
}
|
|
1103
|
-
})
|
|
1104
|
-
}
|
|
1105
1090
|
// 创建canvas
|
|
1106
1091
|
let createCanvas = async function (options) {
|
|
1107
1092
|
let isApp = false;
|
|
@@ -1116,28 +1101,7 @@ let QRCode = {};
|
|
|
1116
1101
|
});
|
|
1117
1102
|
}
|
|
1118
1103
|
var ctx = '';
|
|
1119
|
-
|
|
1120
|
-
ctx = options.nvueContext;
|
|
1121
|
-
}
|
|
1122
|
-
else {
|
|
1123
|
-
// 获取canvas node节点
|
|
1124
|
-
canvas = await getCanvas(options.canvasId);
|
|
1125
|
-
// #ifdef MP
|
|
1126
|
-
// 不清楚是小程序的bug还是什么原因,canvas的node节点宽高和设置的宽高不一致 重新设置下
|
|
1127
|
-
canvas.width = options.size;
|
|
1128
|
-
canvas.height = options.size;
|
|
1129
|
-
// #endif
|
|
1130
|
-
// #ifdef APP
|
|
1131
|
-
ctx = uni.createCanvasContext(options.canvasId, options.context);
|
|
1132
|
-
// #endif
|
|
1133
|
-
// #ifndef APP
|
|
1134
|
-
ctx = canvas.getContext('2d');
|
|
1135
|
-
// #endif
|
|
1136
|
-
|
|
1137
|
-
}
|
|
1138
|
-
// 设置组件中data里面的ctx
|
|
1139
|
-
options.context.ctx = ctx;
|
|
1140
|
-
options.context.canvas = canvas;
|
|
1104
|
+
ctx = options.ctx;
|
|
1141
1105
|
|
|
1142
1106
|
var count = qrCodeAlg.getModuleCount();
|
|
1143
1107
|
var ratioSize = options.size;
|
|
@@ -1156,7 +1120,7 @@ let QRCode = {};
|
|
|
1156
1120
|
count: count,
|
|
1157
1121
|
options: options
|
|
1158
1122
|
});
|
|
1159
|
-
if (options.
|
|
1123
|
+
if (options.isNvue) {
|
|
1160
1124
|
ctx.setFillStyle(qrCodeAlg.modules[row][col] ? foreground : options.background);
|
|
1161
1125
|
} else {
|
|
1162
1126
|
ctx.fillStyle = qrCodeAlg.modules[row][col] ? foreground : options.background;
|
|
@@ -1168,26 +1132,10 @@ let QRCode = {};
|
|
|
1168
1132
|
var x = Number(((ratioSize - ratioImgSize) / 2).toFixed(2));
|
|
1169
1133
|
var y = Number(((ratioSize - ratioImgSize) / 2).toFixed(2));
|
|
1170
1134
|
drawRoundedRect(ctx, x, y, ratioImgSize, ratioImgSize, 2, 6, true, true)
|
|
1171
|
-
|
|
1172
|
-
ctx.drawImage(options.image, x, y, ratioImgSize, ratioImgSize);
|
|
1173
|
-
}
|
|
1174
|
-
else {
|
|
1175
|
-
// #ifdef H5 || APP
|
|
1176
|
-
const img = new Image();
|
|
1177
|
-
// #endif
|
|
1178
|
-
|
|
1179
|
-
// #ifndef H5 || APP
|
|
1180
|
-
const img = canvas.createImage();
|
|
1181
|
-
// #endif
|
|
1182
|
-
|
|
1183
|
-
img.onload = () => {
|
|
1184
|
-
ctx.drawImage(img, x, y, ratioImgSize, ratioImgSize);
|
|
1185
|
-
};
|
|
1186
|
-
img.src = options.image;
|
|
1187
|
-
}
|
|
1135
|
+
options.vuectx.drawImage(options.image, x, y, ratioImgSize, ratioImgSize);
|
|
1188
1136
|
// 画圆角矩形
|
|
1189
1137
|
function drawRoundedRect(ctxi, x, y, width, height, r, lineWidth, fill, stroke) {
|
|
1190
|
-
if (options.
|
|
1138
|
+
if (options.isNvue || isApp) {
|
|
1191
1139
|
ctxi.setLineWidth(lineWidth);
|
|
1192
1140
|
ctxi.setFillStyle(options.background);
|
|
1193
1141
|
ctxi.setStrokeStyle(options.background);
|
|
@@ -1222,11 +1170,11 @@ let QRCode = {};
|
|
|
1222
1170
|
}
|
|
1223
1171
|
setTimeout(() => {
|
|
1224
1172
|
// canvas2 绘制是自动的不需要手动绘制
|
|
1225
|
-
if(options.
|
|
1173
|
+
if(options.isNvue || isApp){
|
|
1226
1174
|
ctx.draw(true, () => {
|
|
1227
1175
|
// 保存到临时区域
|
|
1228
1176
|
setTimeout(() => {
|
|
1229
|
-
if (options.
|
|
1177
|
+
if (options.isNvue) {
|
|
1230
1178
|
ctx.toTempFilePath(
|
|
1231
1179
|
0,
|
|
1232
1180
|
0,
|
|
@@ -1251,6 +1199,7 @@ let QRCode = {};
|
|
|
1251
1199
|
canvasId: options.canvasId,
|
|
1252
1200
|
quality: Number(1),
|
|
1253
1201
|
success: function (res) {
|
|
1202
|
+
// console.log('绘制成功', res)
|
|
1254
1203
|
if (options.cbResult) {
|
|
1255
1204
|
// 由于官方还没有统一此接口的输出字段,所以先判定下 支付宝为 res.apFilePath
|
|
1256
1205
|
if (!empty(res.tempFilePath)) {
|
|
@@ -1263,6 +1212,7 @@ let QRCode = {};
|
|
|
1263
1212
|
}
|
|
1264
1213
|
},
|
|
1265
1214
|
fail: function (res) {
|
|
1215
|
+
console.log('绘制失败', res)
|
|
1266
1216
|
if (options.cbResult) {
|
|
1267
1217
|
options.cbResult(res)
|
|
1268
1218
|
}
|
|
@@ -1270,7 +1220,7 @@ let QRCode = {};
|
|
|
1270
1220
|
complete: function () {
|
|
1271
1221
|
uni.hideLoading();
|
|
1272
1222
|
},
|
|
1273
|
-
}, options.
|
|
1223
|
+
}, options.vuectx);
|
|
1274
1224
|
}
|
|
1275
1225
|
}, options.text.length + 100);
|
|
1276
1226
|
});
|
|
@@ -1279,7 +1229,7 @@ let QRCode = {};
|
|
|
1279
1229
|
options.cbResult("")
|
|
1280
1230
|
}
|
|
1281
1231
|
|
|
1282
|
-
}, options.usingComponents ?
|
|
1232
|
+
}, options.usingComponents ? 100 : 200);
|
|
1283
1233
|
}
|
|
1284
1234
|
createCanvas(this.options);
|
|
1285
1235
|
// 空判定
|
|
@@ -1302,10 +1252,10 @@ let QRCode = {};
|
|
|
1302
1252
|
};
|
|
1303
1253
|
QRCode.prototype.clear = function (fn) {
|
|
1304
1254
|
var ctx = '';
|
|
1305
|
-
if (options.
|
|
1306
|
-
ctx = options.
|
|
1255
|
+
if (options.isNvue) {
|
|
1256
|
+
ctx = options.ctx;
|
|
1307
1257
|
} else {
|
|
1308
|
-
uni.createCanvasContext(this.options.canvasId, this.options.
|
|
1258
|
+
uni.createCanvasContext(this.options.canvasId, this.options.vuectx)
|
|
1309
1259
|
}
|
|
1310
1260
|
ctx.clearRect(0, 0, this.options.size, this.options.size)
|
|
1311
1261
|
ctx.draw(false, () => {
|