uview-plus 3.8.49 → 3.8.86
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 +2043 -1827
- package/components/u-action-sheet/props.js +3 -1
- package/components/u-action-sheet/u-action-sheet.vue +1 -0
- package/components/u-album/props.js +3 -1
- package/components/u-alert/props.js +4 -2
- package/components/u-avatar/props.js +4 -1
- package/components/u-avatar-group/props.js +4 -1
- package/components/u-back-top/props.js +4 -1
- package/components/u-badge/props.js +4 -1
- package/components/u-barcode/u-barcode.vue +46 -15
- package/components/u-box/props.js +5 -2
- package/components/u-button/props.js +4 -1
- package/components/u-button/vue.scss +3 -3
- package/components/u-calendar/calendar.js +14 -2
- package/components/u-calendar/month.vue +41 -6
- package/components/u-calendar/props.js +63 -1
- package/components/u-calendar/u-calendar.vue +311 -2
- package/components/u-calendar-strip/props.js +3 -1
- package/components/u-canvas/u-canvas.vue +734 -423
- package/components/u-car-keyboard/props.js +3 -1
- package/components/u-card/props.js +3 -1
- package/components/u-cell/props.js +4 -1
- package/components/u-cell/u-cell.vue +1 -1
- package/components/u-cell-group/props.js +4 -1
- package/components/u-checkbox/props.js +4 -1
- package/components/u-checkbox/u-checkbox.vue +7 -3
- package/components/u-checkbox-group/props.js +3 -1
- package/components/u-circle-progress/props.js +4 -1
- package/components/u-code/props.js +4 -1
- package/components/u-code-input/props.js +4 -1
- package/components/u-col/props.js +4 -1
- package/components/u-collapse/props.js +4 -1
- package/components/u-collapse-item/props.js +4 -1
- package/components/u-color-picker/u-color-picker.vue +1 -0
- package/components/u-column-notice/props.js +4 -1
- package/components/u-count-down/props.js +4 -1
- package/components/u-count-to/props.js +4 -1
- package/components/u-cropper/u-cropper.vue +95 -51
- package/components/u-datetime-picker/props.js +4 -1
- package/components/u-divider/props.js +4 -1
- package/components/u-dragsort/u-dragsort.vue +2 -1
- package/components/u-dropdown/props.js +3 -1
- package/components/u-dropdown-item/props.js +3 -1
- package/components/u-empty/props.js +4 -1
- package/components/u-form/props.js +4 -1
- package/components/u-form-item/props.js +4 -1
- package/components/u-gap/props.js +4 -1
- package/components/u-grid/props.js +4 -1
- package/components/u-grid-item/props.js +4 -1
- package/components/u-guide/props.js +3 -1
- package/components/u-icon/props.js +4 -1
- package/components/u-icon/u-icon.vue +2 -2
- package/components/u-icon/upicon.ttf +0 -0
- package/components/u-icon/util.js +29 -7
- package/components/u-image/props.js +4 -1
- package/components/u-image/u-image.vue +280 -267
- package/components/u-index-anchor/props.js +4 -1
- package/components/u-index-item/props.js +2 -1
- package/components/u-index-list/props.js +4 -1
- package/components/u-input/props.js +3 -1
- package/components/u-input/u-input.vue +10 -1
- package/components/u-keyboard/props.js +4 -1
- package/components/u-line/props.js +4 -1
- package/components/u-line-progress/props.js +6 -3
- package/components/u-link/props.js +4 -1
- package/components/u-list/props.js +4 -1
- package/components/u-list-item/props.js +4 -1
- package/components/u-loading-icon/props.js +4 -1
- package/components/u-loading-page/props.js +3 -1
- package/components/u-loadmore/props.js +4 -1
- package/components/u-markdown/u-markdown.vue +45 -3
- package/components/u-modal/props.js +4 -1
- package/components/u-navbar/props.js +4 -2
- package/components/u-navbar/u-navbar.vue +15 -9
- package/components/u-no-network/props.js +4 -1
- package/components/u-notice-bar/props.js +4 -1
- package/components/u-notify/props.js +4 -1
- package/components/u-number-box/props.js +4 -1
- package/components/u-number-box/u-number-box.vue +2 -2
- package/components/u-number-keyboard/props.js +4 -1
- package/components/u-overlay/props.js +4 -1
- package/components/u-pagination/u-pagination.vue +60 -39
- package/components/u-parse/props.js +4 -1
- package/components/u-picker/props.js +4 -1
- package/components/u-picker/u-picker.vue +15 -0
- package/components/u-picker-column/props.js +3 -1
- package/components/u-popover/props.js +2 -1
- package/components/u-popup/props.js +4 -1
- package/components/u-poster/u-poster.vue +29 -14
- package/components/u-qrcode/qrcode.js +88 -87
- package/components/u-qrcode/u-qrcode.vue +138 -256
- package/components/u-radio/props.js +4 -1
- package/components/u-radio/u-radio.vue +7 -3
- package/components/u-radio-group/props.js +4 -1
- package/components/u-rate/props.js +4 -1
- package/components/u-read-more/props.js +4 -1
- package/components/u-row/props.js +4 -1
- package/components/u-row-notice/props.js +4 -1
- package/components/u-safe-bottom/props.js +2 -1
- package/components/u-scroll-list/props.js +4 -1
- package/components/u-search/props.js +3 -1
- package/components/u-skeleton/props.js +4 -1
- package/components/u-slider/props.js +3 -1
- package/components/u-slider/u-slider.vue +70 -28
- package/components/u-status-bar/props.js +4 -1
- package/components/u-steps/props.js +4 -1
- package/components/u-steps-item/props.js +4 -1
- package/components/u-sticky/props.js +4 -1
- package/components/u-sticky/u-sticky.vue +11 -0
- package/components/u-subsection/props.js +3 -1
- package/components/u-swipe-action/props.js +4 -1
- package/components/u-swipe-action-item/props.js +4 -1
- package/components/u-swipe-action-item/u-swipe-action-item.vue +14 -0
- package/components/u-swiper/props.js +9 -1
- package/components/u-swiper/swiper.js +1 -0
- package/components/u-swiper/u-swiper.vue +2 -0
- package/components/u-swiper-indicator/props.js +4 -1
- package/components/u-switch/props.js +4 -1
- package/components/u-tabbar/props.js +3 -1
- package/components/u-tabbar-item/props.js +4 -1
- package/components/u-table/props.js +3 -1
- package/components/u-table2/tableRow.vue +155 -69
- package/components/u-table2/u-table2.vue +328 -140
- package/components/u-tabs/props.js +4 -1
- package/components/u-tabs-item/props.js +3 -1
- package/components/u-tag/props.js +4 -1
- package/components/u-td/props.js +3 -1
- package/components/u-text/props.js +4 -1
- package/components/u-textarea/props.js +3 -1
- package/components/u-textarea/u-textarea.vue +16 -5
- package/components/u-th/props.js +3 -1
- package/components/u-toolbar/props.js +4 -1
- package/components/u-tooltip/props.js +10 -2
- package/components/u-tooltip/tooltip.js +2 -1
- package/components/u-tooltip/u-tooltip.vue +31 -3
- package/components/u-tr/props.js +3 -1
- package/components/u-transition/nvue-ani-map.js +75 -68
- package/components/u-transition/props.js +4 -1
- package/components/u-transition/transitionMixin.js +164 -163
- package/components/u-upload/props.js +4 -1
- package/components/u-upload/u-upload.vue +47 -40
- package/components/u-waterfall/u-waterfall.vue +50 -51
- package/index.js +65 -8
- package/libs/config/props.js +179 -204
- package/libs/css/components.scss +3 -0
- package/libs/function/uni-api-shims.js +29 -0
- package/libs/i18n/index.js +71 -36
- package/libs/i18n/locale-packs.js +11 -0
- package/libs/i18n/locales/all.js +23 -0
- package/libs/i18n/locales/{de.json → de.js} +1 -1
- package/libs/i18n/locales/{en.json → en.js} +2 -2
- package/libs/i18n/locales/{es.json → es.js} +1 -1
- package/libs/i18n/locales/{fr.json → fr.js} +2 -2
- package/libs/i18n/locales/{ja.json → ja.js} +1 -1
- package/libs/i18n/locales/{ko.json → ko.js} +1 -1
- package/libs/i18n/locales/{ru.json → ru.js} +1 -1
- package/libs/i18n/locales/{th.json → th.js} +1 -1
- package/libs/i18n/locales/{zh-Hans.json → zh-Hans.js} +1 -1
- package/libs/i18n/locales/{zh-Hant.json → zh-Hant.js} +1 -1
- package/libs/mixin/mixin.js +14 -4
- package/libs/util/gcanvas/bridge/bridge-weex.js +10 -5
- package/package.json +4 -5
- package/tsconfig.json +18 -0
- package/types/comps/calendar.d.ts +57 -0
- package/types/comps/checkbox.d.ts +12 -0
- package/types/comps/lineProgress.d.ts +5 -0
- package/types/comps/navbar.d.ts +3 -3
- package/types/comps/swiper.d.ts +5 -0
- package/types/comps/tooltip.d.ts +36 -1
- /package/components/u-markdown/{marked.esm.js → marked.esm.mjs} +0 -0
|
@@ -4,36 +4,20 @@
|
|
|
4
4
|
:style="{
|
|
5
5
|
width: useRootHeightAndWidth ? '100%' : 'auto',
|
|
6
6
|
height: useRootHeightAndWidth ? '100%' : 'auto',
|
|
7
|
-
|
|
8
|
-
@longpress="longpress">
|
|
9
|
-
<view class="u-qrcode__content" @click="preview">
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class="u-qrcode__canvas"
|
|
13
|
-
:id="cid"
|
|
14
|
-
:
|
|
15
|
-
|
|
16
|
-
:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class="u-qrcode__canvas"
|
|
22
|
-
:id="cid"
|
|
23
|
-
:canvas-id="cid"
|
|
24
|
-
:style="{ width: sizeLocal + unit, height: sizeLocal + unit }" />
|
|
25
|
-
<!-- #endif -->
|
|
26
|
-
|
|
27
|
-
<!-- #ifdef APP-NVUE -->
|
|
28
|
-
<web-view v-if="icon != ''" ref="web" src="/static/app-plus/up-canvas/local.html"
|
|
29
|
-
:style="'width:' + sizeLocal + 'px;height:' + sizeLocal + 'px'"
|
|
30
|
-
@onPostMessage="_onMessage" />
|
|
31
|
-
<gcanvas v-else class="u-qrcode__canvas" ref="gcanvess"
|
|
32
|
-
:style="{ width: sizeLocal + unit, height: sizeLocal + unit }">
|
|
33
|
-
</gcanvas>
|
|
34
|
-
<!-- #endif -->
|
|
35
|
-
<view v-if="showLoading && loading" class="u-qrcode__loading"
|
|
36
|
-
:style="{ width: sizeLocal + unit, height: sizeLocal + unit }">
|
|
7
|
+
}"
|
|
8
|
+
@longpress="longpress">
|
|
9
|
+
<view class="u-qrcode__content" @click="preview">
|
|
10
|
+
<up-canvas
|
|
11
|
+
ref="qrcodeCanvas"
|
|
12
|
+
class="u-qrcode__canvas"
|
|
13
|
+
:canvas-id="cid"
|
|
14
|
+
:width="sizeLocal"
|
|
15
|
+
:height="sizeLocal"
|
|
16
|
+
:unit="unit"
|
|
17
|
+
bg-color="transparent"
|
|
18
|
+
:style="{ width: sizeLocal + unit, height: sizeLocal + unit }" />
|
|
19
|
+
<view v-if="showLoading && loading" class="u-qrcode__loading"
|
|
20
|
+
:style="{ width: sizeLocal + unit, height: sizeLocal + unit }">
|
|
37
21
|
<up-loading-icon vertical :text="loadingText" textSize="14px"></up-loading-icon>
|
|
38
22
|
</view>
|
|
39
23
|
</view>
|
|
@@ -41,22 +25,10 @@
|
|
|
41
25
|
</view>
|
|
42
26
|
</template>
|
|
43
27
|
|
|
44
|
-
<script>
|
|
45
|
-
import QRCode from "./qrcode.js"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
// https://github.com/dcloudio/NvueCanvasDemo/blob/master/README.md
|
|
49
|
-
import {
|
|
50
|
-
enable,
|
|
51
|
-
WeexBridge,
|
|
52
|
-
Image as GImage
|
|
53
|
-
} from '../../libs/util/gcanvas/index.js';
|
|
54
|
-
import { nextTick } from "vue";
|
|
55
|
-
// #endif
|
|
56
|
-
let qrcode
|
|
57
|
-
// 20260201不能在data中存储canvas,否则会导致在微信小程序getContext获取不到canvas对象报错Cannot read property 'type'
|
|
58
|
-
let canvas = null
|
|
59
|
-
export default {
|
|
28
|
+
<script>
|
|
29
|
+
import QRCode from "./qrcode.js"
|
|
30
|
+
let qrcode
|
|
31
|
+
export default {
|
|
60
32
|
name: "u-qrcode",
|
|
61
33
|
props: {
|
|
62
34
|
cid: {
|
|
@@ -149,34 +121,26 @@ export default {
|
|
|
149
121
|
{
|
|
150
122
|
name: '保存二维码',
|
|
151
123
|
}
|
|
152
|
-
],
|
|
153
|
-
rootId: `rootId${Number(Math.random() * 100).toFixed(0)}`,
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
async mounted(){
|
|
162
|
-
// 如果使用根节点的宽高 则 重新设置 size
|
|
163
|
-
if(this.useRootHeightAndWidth){
|
|
164
|
-
await this.setNewSize()
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
canvas.height = this.sizeLocal
|
|
173
|
-
// #endif
|
|
174
|
-
// #ifdef APP-PLUS-NVUE
|
|
175
|
-
this.isNvue = true
|
|
176
|
-
// #endif
|
|
177
|
-
this.ctx = this.getUPCanvasContext('2d')
|
|
178
|
-
|
|
179
|
-
if (this.loadMake) {
|
|
124
|
+
],
|
|
125
|
+
rootId: `rootId${Number(Math.random() * 100).toFixed(0)}`,
|
|
126
|
+
canvasObj: {},
|
|
127
|
+
sizeLocal: this.size,
|
|
128
|
+
ctx: null,
|
|
129
|
+
isNvue: false,
|
|
130
|
+
canvasHost: null
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
async mounted(){
|
|
134
|
+
// 如果使用根节点的宽高 则 重新设置 size
|
|
135
|
+
if(this.useRootHeightAndWidth){
|
|
136
|
+
await this.setNewSize()
|
|
137
|
+
}
|
|
138
|
+
// #ifdef APP-NVUE
|
|
139
|
+
this.isNvue = true
|
|
140
|
+
// #endif
|
|
141
|
+
await this.initCanvas()
|
|
142
|
+
|
|
143
|
+
if (this.loadMake) {
|
|
180
144
|
if (!this._empty(this.val)) {
|
|
181
145
|
setTimeout(() => {
|
|
182
146
|
setTimeout(()=>{
|
|
@@ -185,56 +149,43 @@ export default {
|
|
|
185
149
|
}, 0);
|
|
186
150
|
}
|
|
187
151
|
}
|
|
188
|
-
},
|
|
189
|
-
methods: {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
this.$refs.web.evalJs('setContent('+JSON.stringify(this.$props) +')')
|
|
198
|
-
break
|
|
199
|
-
// qrcodeOk
|
|
200
|
-
case 'qrcodeOk':
|
|
201
|
-
this._result(message.imageData)
|
|
202
|
-
// this.$emit('load')
|
|
203
|
-
break
|
|
204
|
-
}
|
|
205
|
-
},
|
|
206
|
-
_makeCode() {
|
|
207
|
-
let that = this
|
|
208
|
-
if (!canvas) return
|
|
209
|
-
if (!this._empty(this.val)) {
|
|
152
|
+
},
|
|
153
|
+
methods: {
|
|
154
|
+
async _makeCode() {
|
|
155
|
+
let that = this
|
|
156
|
+
if (!this.ctx) {
|
|
157
|
+
await this.initCanvas(true)
|
|
158
|
+
}
|
|
159
|
+
if (!this.ctx) return
|
|
160
|
+
if (!this._empty(this.val)) {
|
|
210
161
|
// #ifndef APP-NVUE
|
|
211
162
|
this.loading = true
|
|
212
163
|
// #endif
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
} else {
|
|
164
|
+
qrcode = new QRCode({
|
|
165
|
+
vuectx: that, // 上下文环境
|
|
166
|
+
canvasId: that.cid, // canvas-id
|
|
167
|
+
ctx: that.ctx,
|
|
168
|
+
canvasHost: that.canvasHost,
|
|
169
|
+
isNvue: that.isNvue,
|
|
170
|
+
usingComponents: that.usingComponents, // 是否是自定义组件
|
|
171
|
+
showLoading: false, // 是否显示loading
|
|
172
|
+
loadingText: that.loadingText, // loading文字
|
|
173
|
+
text: that.val, // 生成内容
|
|
174
|
+
size: that.sizeLocal, // 二维码大小
|
|
175
|
+
width: that.sizeLocal,
|
|
176
|
+
height: that.sizeLocal,
|
|
177
|
+
background: that.background, // 背景色
|
|
178
|
+
foreground: that.foreground, // 前景色
|
|
179
|
+
pdground: that.pdground, // 定位角点颜色
|
|
180
|
+
quietZone: that.quietZone, // 静区宽度
|
|
181
|
+
correctLevel: that.lv, // 容错级别
|
|
182
|
+
image: that.icon, // 二维码图标
|
|
183
|
+
imageSize: that.iconSize,// 二维码图标大小
|
|
184
|
+
cbResult: function (res) { // 生成二维码的回调
|
|
185
|
+
that._result(res)
|
|
186
|
+
},
|
|
187
|
+
});
|
|
188
|
+
} else {
|
|
238
189
|
uni.showToast({
|
|
239
190
|
title: '二维码内容不能为空',
|
|
240
191
|
icon: 'none',
|
|
@@ -242,10 +193,10 @@ export default {
|
|
|
242
193
|
});
|
|
243
194
|
}
|
|
244
195
|
},
|
|
245
|
-
_clearCode() {
|
|
246
|
-
this._result('')
|
|
247
|
-
qrcode.clear()
|
|
248
|
-
},
|
|
196
|
+
_clearCode() {
|
|
197
|
+
this._result('')
|
|
198
|
+
if (qrcode) qrcode.clear()
|
|
199
|
+
},
|
|
249
200
|
_saveCode() {
|
|
250
201
|
let that = this;
|
|
251
202
|
if (this.result != "") {
|
|
@@ -305,42 +256,25 @@ export default {
|
|
|
305
256
|
url: this.result
|
|
306
257
|
}, e)
|
|
307
258
|
},
|
|
308
|
-
async toTempFilePath({success, fail}) {
|
|
309
|
-
if (this.
|
|
310
|
-
this.
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
tempFilePath: this.ctx.canvas.toDataURL("image/png", 1)
|
|
328
|
-
})
|
|
329
|
-
// #endif
|
|
330
|
-
|
|
331
|
-
// #ifndef H5
|
|
332
|
-
uni.canvasToTempFilePath(
|
|
333
|
-
{
|
|
334
|
-
canvasId: this.cid,
|
|
335
|
-
success :res => {
|
|
336
|
-
success(res)
|
|
337
|
-
},
|
|
338
|
-
fail: fail
|
|
339
|
-
},
|
|
340
|
-
this)
|
|
341
|
-
// #endif
|
|
342
|
-
}
|
|
343
|
-
},
|
|
259
|
+
async toTempFilePath({success, fail}) {
|
|
260
|
+
if (!this.canvasHost) {
|
|
261
|
+
await this.initCanvas(true)
|
|
262
|
+
}
|
|
263
|
+
if (!this.canvasHost) {
|
|
264
|
+
if (fail) fail(new Error('无法获取二维码画布实例'))
|
|
265
|
+
return
|
|
266
|
+
}
|
|
267
|
+
this.canvasHost.toTempFilePath({
|
|
268
|
+
width: this.sizeLocal,
|
|
269
|
+
height: this.sizeLocal,
|
|
270
|
+
destWidth: this.sizeLocal,
|
|
271
|
+
destHeight: this.sizeLocal,
|
|
272
|
+
success,
|
|
273
|
+
fail
|
|
274
|
+
}).catch(err => {
|
|
275
|
+
if (fail) fail(err)
|
|
276
|
+
})
|
|
277
|
+
},
|
|
344
278
|
async longpress() {
|
|
345
279
|
this.toTempFilePath({
|
|
346
280
|
success: res => {
|
|
@@ -355,9 +289,10 @@ export default {
|
|
|
355
289
|
* 使用根节点宽高 设置新的size
|
|
356
290
|
* @return {Promise<void>}
|
|
357
291
|
*/
|
|
358
|
-
async setNewSize(){
|
|
359
|
-
const rootNode = await this.
|
|
360
|
-
|
|
292
|
+
async setNewSize(){
|
|
293
|
+
const rootNode = await this.getRootNode();
|
|
294
|
+
if (!rootNode) return
|
|
295
|
+
const { width , height } = rootNode;
|
|
361
296
|
// 将最短的设置为二维码 的size
|
|
362
297
|
if(width > height){
|
|
363
298
|
this.sizeLocal = height
|
|
@@ -367,98 +302,45 @@ export default {
|
|
|
367
302
|
}
|
|
368
303
|
},
|
|
369
304
|
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
// #endif
|
|
410
|
-
} catch (e) {
|
|
411
|
-
console.error("获取节点失败", e)
|
|
412
|
-
}
|
|
413
|
-
})
|
|
414
|
-
},
|
|
415
|
-
getUPCanvasContext() {
|
|
416
|
-
// #ifdef APP-PLUS
|
|
417
|
-
return uni.createCanvasContext(this.cid, this);
|
|
418
|
-
// #endif
|
|
419
|
-
// #ifdef APP-PLUS-NVUE || MP || H5
|
|
420
|
-
return canvas.getContext('2d');
|
|
421
|
-
// #endif
|
|
422
|
-
},
|
|
423
|
-
drawImage(url, x, y, w, h) {
|
|
424
|
-
try {
|
|
425
|
-
let img = {}
|
|
426
|
-
// #ifdef APP-NVUE
|
|
427
|
-
img = new GImage();
|
|
428
|
-
// #endif
|
|
429
|
-
|
|
430
|
-
// #ifdef H5
|
|
431
|
-
// APP下不支持会一直卡住
|
|
432
|
-
img = new Image();
|
|
433
|
-
// #endif
|
|
434
|
-
|
|
435
|
-
// #ifdef MP
|
|
436
|
-
// 小程序2d
|
|
437
|
-
// https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Canvas.createImage.html
|
|
438
|
-
img = canvas.createImage();
|
|
439
|
-
// #endif
|
|
440
|
-
// #ifdef APP-NVUE
|
|
441
|
-
let that = this
|
|
442
|
-
// console.log(img)
|
|
443
|
-
img.onload = function(){
|
|
444
|
-
if (process.env.NODE_ENV === 'development') {
|
|
445
|
-
console.log('drawImage绘制2...')
|
|
446
|
-
}
|
|
447
|
-
that.cxt.drawImage(img, x, y, w, h);
|
|
448
|
-
}
|
|
449
|
-
// #endif
|
|
450
|
-
// #ifdef H5 || MP
|
|
451
|
-
img.onload = () => {
|
|
452
|
-
this.ctx.drawImage(img, x, y, w, h);
|
|
453
|
-
};
|
|
454
|
-
// #endif
|
|
455
|
-
img.src = url;
|
|
456
|
-
// #ifdef APP-VUE
|
|
457
|
-
this.ctx.drawImage(url, x, y, w, h);
|
|
458
|
-
// #endif
|
|
459
|
-
} catch (error) {
|
|
460
|
-
console.log('drawImage绘制出错', error)
|
|
461
|
-
}
|
|
305
|
+
async getRootNode() {
|
|
306
|
+
return new Promise((resolve, reject) => {
|
|
307
|
+
try {
|
|
308
|
+
const query = uni.createSelectorQuery().in(this).select(`#${this.rootId}`);
|
|
309
|
+
query.fields({
|
|
310
|
+
size: true
|
|
311
|
+
})
|
|
312
|
+
.exec((res) => {
|
|
313
|
+
resolve(res[0] || false)
|
|
314
|
+
})
|
|
315
|
+
} catch (e) {
|
|
316
|
+
console.error("获取二维码根节点失败", e)
|
|
317
|
+
resolve(false)
|
|
318
|
+
}
|
|
319
|
+
})
|
|
320
|
+
},
|
|
321
|
+
async initCanvas(force = false) {
|
|
322
|
+
await this.$nextTick()
|
|
323
|
+
const canvasRef = this.$refs.qrcodeCanvas
|
|
324
|
+
if (!canvasRef) return false
|
|
325
|
+
await canvasRef.initCanvas(force)
|
|
326
|
+
this.canvasHost = canvasRef
|
|
327
|
+
this.ctx = canvasRef.getRawContext()
|
|
328
|
+
return !!this.ctx
|
|
329
|
+
},
|
|
330
|
+
getUPCanvasContext() {
|
|
331
|
+
return this.canvasHost ? this.canvasHost.getRawContext() : null
|
|
332
|
+
},
|
|
333
|
+
async drawImage(url, x, y, w, h) {
|
|
334
|
+
try {
|
|
335
|
+
if (!this.canvasHost) {
|
|
336
|
+
await this.initCanvas(true)
|
|
337
|
+
}
|
|
338
|
+
if (this.canvasHost) {
|
|
339
|
+
await this.canvasHost.drawImage(url, x, y, w, h)
|
|
340
|
+
}
|
|
341
|
+
} catch (error) {
|
|
342
|
+
console.log('drawImage绘制出错', error)
|
|
343
|
+
}
|
|
462
344
|
},
|
|
463
345
|
|
|
464
346
|
selectClick(index) {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { defineMixin } from '../../libs/vue'
|
|
2
|
-
import
|
|
2
|
+
import RadioDefaultProps from './radio'
|
|
3
|
+
import { registerComponentProps } from '../../libs/config/props.js'
|
|
4
|
+
|
|
5
|
+
const defProps = registerComponentProps(RadioDefaultProps)
|
|
3
6
|
export const props = defineMixin({
|
|
4
7
|
props: {
|
|
5
8
|
// radio的名称
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
:class="iconClasses"
|
|
12
12
|
:style="[iconWrapStyle]"
|
|
13
13
|
>
|
|
14
|
-
<slot name="icon" :elIconSize="elIconSize" :elIconColor="elIconColor">
|
|
14
|
+
<slot name="icon" :elIconSize="elIconSize" :elIconColor="elIconColor" :checked="checked" :elDisabled="elDisabled">
|
|
15
15
|
<up-icon
|
|
16
16
|
class="u-radio__icon-wrap__icon"
|
|
17
17
|
name="checkbox-mark"
|
|
@@ -145,8 +145,12 @@
|
|
|
145
145
|
if (this.elDisabled) {
|
|
146
146
|
classes.push('u-radio__icon-wrap--disabled')
|
|
147
147
|
}
|
|
148
|
-
if (this.checked
|
|
149
|
-
|
|
148
|
+
if (this.checked) {
|
|
149
|
+
if (this.elDisabled) {
|
|
150
|
+
classes.push('u-radio__icon-wrap--disabled--checked')
|
|
151
|
+
} else {
|
|
152
|
+
classes.push('u-radio__icon-wrap--checked')
|
|
153
|
+
}
|
|
150
154
|
}
|
|
151
155
|
// 支付宝,头条小程序无法动态绑定一个数组类名,否则解析出来的结果会带有",",而导致失效
|
|
152
156
|
// #ifdef MP-ALIPAY || MP-TOUTIAO
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { defineMixin } from '../../libs/vue'
|
|
2
|
-
import
|
|
2
|
+
import RadioGroupDefaultProps from './radioGroup'
|
|
3
|
+
import { registerComponentProps } from '../../libs/config/props.js'
|
|
4
|
+
|
|
5
|
+
const defProps = registerComponentProps(RadioGroupDefaultProps)
|
|
3
6
|
export const props = defineMixin({
|
|
4
7
|
props: {
|
|
5
8
|
// #ifdef VUE3
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { defineMixin } from '../../libs/vue'
|
|
2
|
-
import
|
|
2
|
+
import RateDefaultProps from './rate'
|
|
3
|
+
import { registerComponentProps } from '../../libs/config/props.js'
|
|
4
|
+
|
|
5
|
+
const defProps = registerComponentProps(RateDefaultProps)
|
|
3
6
|
export const props = defineMixin({
|
|
4
7
|
props: {
|
|
5
8
|
// #ifdef VUE3
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { defineMixin } from '../../libs/vue'
|
|
2
|
-
import
|
|
2
|
+
import ReadMoreDefaultProps from './readMore'
|
|
3
|
+
import { registerComponentProps } from '../../libs/config/props.js'
|
|
4
|
+
|
|
5
|
+
const defProps = registerComponentProps(ReadMoreDefaultProps)
|
|
3
6
|
export const props = defineMixin({
|
|
4
7
|
props: {
|
|
5
8
|
// 默认的显示占位高度
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { defineMixin } from '../../libs/vue'
|
|
2
|
-
import
|
|
2
|
+
import RowDefaultProps from './row'
|
|
3
|
+
import { registerComponentProps } from '../../libs/config/props.js'
|
|
4
|
+
|
|
5
|
+
const defProps = registerComponentProps(RowDefaultProps)
|
|
3
6
|
export const props = defineMixin({
|
|
4
7
|
props: {
|
|
5
8
|
// 给col添加间距,左右边距各占一半
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { defineMixin } from '../../libs/vue'
|
|
2
|
-
import
|
|
2
|
+
import RowNoticeDefaultProps from './rowNotice'
|
|
3
|
+
import { registerComponentProps } from '../../libs/config/props.js'
|
|
4
|
+
|
|
5
|
+
const defProps = registerComponentProps(RowNoticeDefaultProps)
|
|
3
6
|
export const props = defineMixin({
|
|
4
7
|
props: {
|
|
5
8
|
// 显示的内容,字符串
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineMixin } from '../../libs/vue'
|
|
2
|
-
import
|
|
2
|
+
import { registerComponentProps } from '../../libs/config/props.js'
|
|
3
3
|
|
|
4
|
+
const defProps = registerComponentProps({ safeBottom: {} })
|
|
4
5
|
export const props = defineMixin({
|
|
5
6
|
props: {
|
|
6
7
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { defineMixin } from '../../libs/vue'
|
|
2
|
-
import
|
|
2
|
+
import ScrollListDefaultProps from './scrollList'
|
|
3
|
+
import { registerComponentProps } from '../../libs/config/props.js'
|
|
4
|
+
|
|
5
|
+
const defProps = registerComponentProps(ScrollListDefaultProps)
|
|
3
6
|
export const props = defineMixin({
|
|
4
7
|
props: {
|
|
5
8
|
// 指示器的整体宽度
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { defineMixin } from '../../libs/vue'
|
|
2
|
-
import
|
|
2
|
+
import SearchDefaultProps from './search'
|
|
3
|
+
import { registerComponentProps } from '../../libs/config/props.js'
|
|
3
4
|
|
|
5
|
+
const defProps = registerComponentProps(SearchDefaultProps)
|
|
4
6
|
export const props = defineMixin({
|
|
5
7
|
props: {
|
|
6
8
|
// #ifdef VUE3
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { defineMixin } from '../../libs/vue'
|
|
2
|
-
import
|
|
2
|
+
import SkeletonDefaultProps from './skeleton'
|
|
3
|
+
import { registerComponentProps } from '../../libs/config/props.js'
|
|
4
|
+
|
|
5
|
+
const defProps = registerComponentProps(SkeletonDefaultProps)
|
|
3
6
|
export const props = defineMixin({
|
|
4
7
|
props: {
|
|
5
8
|
// 是否展示骨架组件
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { defineMixin } from '../../libs/vue'
|
|
2
|
-
import
|
|
2
|
+
import SliderDefaultProps from './slider'
|
|
3
|
+
import { registerComponentProps } from '../../libs/config/props.js'
|
|
3
4
|
|
|
5
|
+
const defProps = registerComponentProps(SliderDefaultProps)
|
|
4
6
|
export const props = defineMixin({
|
|
5
7
|
props: {
|
|
6
8
|
// 最小可选值
|