提交 08a578bc 编写于 作者: D DCloud_LXH

chore: remove useless code

上级 9e2e54cd
......@@ -10,79 +10,79 @@ const __uniRoutes = instanceContext.__uniRoutes;
var serviceContext = (function (vue) {
'use strict';
/*
* base64-arraybuffer
* https://github.com/niklasvh/base64-arraybuffer
*
* Copyright (c) 2012 Niklas von Hertzen
* Licensed under the MIT license.
*/
var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
// Use a lookup table to find the index.
var lookup = /*#__PURE__*/ (function () {
const lookup = new Uint8Array(256);
for (var i = 0; i < chars.length; i++) {
lookup[chars.charCodeAt(i)] = i;
}
return lookup
})();
function encode$3(arraybuffer) {
var bytes = new Uint8Array(arraybuffer),
i,
len = bytes.length,
base64 = '';
for (i = 0; i < len; i += 3) {
base64 += chars[bytes[i] >> 2];
base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];
base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];
base64 += chars[bytes[i + 2] & 63];
}
if (len % 3 === 2) {
base64 = base64.substring(0, base64.length - 1) + '=';
} else if (len % 3 === 1) {
base64 = base64.substring(0, base64.length - 2) + '==';
}
return base64
}
function decode$1(base64) {
var bufferLength = base64.length * 0.75,
len = base64.length,
i,
p = 0,
encoded1,
encoded2,
encoded3,
encoded4;
if (base64[base64.length - 1] === '=') {
bufferLength--;
if (base64[base64.length - 2] === '=') {
bufferLength--;
}
}
var arraybuffer = new ArrayBuffer(bufferLength),
bytes = new Uint8Array(arraybuffer);
for (i = 0; i < len; i += 4) {
encoded1 = lookup[base64.charCodeAt(i)];
encoded2 = lookup[base64.charCodeAt(i + 1)];
encoded3 = lookup[base64.charCodeAt(i + 2)];
encoded4 = lookup[base64.charCodeAt(i + 3)];
bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);
bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);
bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);
}
return arraybuffer
/*
* base64-arraybuffer
* https://github.com/niklasvh/base64-arraybuffer
*
* Copyright (c) 2012 Niklas von Hertzen
* Licensed under the MIT license.
*/
var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
// Use a lookup table to find the index.
var lookup = /*#__PURE__*/ (function () {
const lookup = new Uint8Array(256);
for (var i = 0; i < chars.length; i++) {
lookup[chars.charCodeAt(i)] = i;
}
return lookup
})();
function encode$3(arraybuffer) {
var bytes = new Uint8Array(arraybuffer),
i,
len = bytes.length,
base64 = '';
for (i = 0; i < len; i += 3) {
base64 += chars[bytes[i] >> 2];
base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];
base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];
base64 += chars[bytes[i + 2] & 63];
}
if (len % 3 === 2) {
base64 = base64.substring(0, base64.length - 1) + '=';
} else if (len % 3 === 1) {
base64 = base64.substring(0, base64.length - 2) + '==';
}
return base64
}
function decode$1(base64) {
var bufferLength = base64.length * 0.75,
len = base64.length,
i,
p = 0,
encoded1,
encoded2,
encoded3,
encoded4;
if (base64[base64.length - 1] === '=') {
bufferLength--;
if (base64[base64.length - 2] === '=') {
bufferLength--;
}
}
var arraybuffer = new ArrayBuffer(bufferLength),
bytes = new Uint8Array(arraybuffer);
for (i = 0; i < len; i += 4) {
encoded1 = lookup[base64.charCodeAt(i)];
encoded2 = lookup[base64.charCodeAt(i + 1)];
encoded3 = lookup[base64.charCodeAt(i + 2)];
encoded4 = lookup[base64.charCodeAt(i + 3)];
bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);
bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);
bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);
}
return arraybuffer
}
/**
......@@ -7057,7 +7057,7 @@ var serviceContext = (function (vue) {
plus.gallery.save(options.filePath, warpPlusSuccessCallback(resolve), warpPlusErrorCallback(reject));
}, SaveImageToPhotosAlbumProtocol, SaveImageToPhotosAlbumOptions);
const compressImage$1 = defineAsyncApi(API_COMPRESS_IMAGE, (options, { resolve, reject }) => {
const compressImage = defineAsyncApi(API_COMPRESS_IMAGE, (options, { resolve, reject }) => {
const dst = `${TEMP_PATH}/compressed/${Date.now()}_${getFileName(options.src)}`;
plus.zip.compressImage(extend({}, options, {
dst,
......@@ -7091,23 +7091,6 @@ var serviceContext = (function (vue) {
}, reject);
});
}
function compressImage(tempFilePath) {
const dst = `${TEMP_PATH}/compressed/${Date.now()}_${getFileName(tempFilePath)}`;
return new Promise((resolve) => {
plus.nativeUI.showWaiting();
plus.zip.compressImage({
src: tempFilePath,
dst,
overwrite: true,
}, () => {
plus.nativeUI.closeWaiting();
resolve(dst);
}, () => {
plus.nativeUI.closeWaiting();
resolve(tempFilePath);
});
});
}
const chooseImage = defineAsyncApi(API_CHOOSE_IMAGE,
// @ts-ignore crop 属性App特有
({ count, sizeType, sourceType, crop } = {}, { resolve, reject }) => {
......@@ -7117,37 +7100,13 @@ var serviceContext = (function (vue) {
function successCallback(paths) {
const tempFiles = [];
const tempFilePaths = [];
// plus.zip.compressImage 压缩文件并发调用在iOS端容易出现问题(图像错误、闪退),改为队列执行
paths
.reduce((promise, path) => {
return promise
.then(() => {
return getFileInfo(path);
})
.then((fileInfo) => {
const size = fileInfo.size;
// 压缩阈值 0.5 兆
const THRESHOLD = 1024 * 1024 * 0.5;
// 判断是否需要压缩
if (!crop &&
sizeType.includes('compressed') &&
size > THRESHOLD) {
return compressImage(path).then((dstPath) => {
path = dstPath;
return getFileInfo(path);
});
}
return fileInfo;
})
.then(({ size }) => {
Promise.all(paths.map((path) => getFileInfo(path)))
.then((filesInfo) => {
filesInfo.forEach((file, index) => {
const path = paths[index];
tempFilePaths.push(path);
tempFiles.push({
path,
size: size,
});
tempFiles.push({ path, size: file.size });
});
}, Promise.resolve())
.then(() => {
resolve({
tempFilePaths,
tempFiles,
......@@ -7173,6 +7132,8 @@ var serviceContext = (function (vue) {
filename: TEMP_PATH + '/gallery/',
permissionAlert: true,
crop,
// @ts-expect-error
sizeType,
});
}
if (sourceType.length === 1) {
......@@ -10061,7 +10022,9 @@ var serviceContext = (function (vue) {
function createPreloadWebview() {
if (!preloadWebview$1 || preloadWebview$1.__uniapp_route) {
// 不存在,或已被使用
preloadWebview$1 = plus.webview.create(VIEW_WEBVIEW_PATH, String(genWebviewId()));
preloadWebview$1 = plus.webview.create(VIEW_WEBVIEW_PATH, String(genWebviewId()),
// @ts-expect-error
{ contentAdjust: false });
if ((process.env.NODE_ENV !== 'production')) {
console.log(formatLog('createPreloadWebview', preloadWebview$1.id));
}
......@@ -11999,7 +11962,7 @@ var serviceContext = (function (vue) {
getRecorderManager: getRecorderManager,
saveVideoToPhotosAlbum: saveVideoToPhotosAlbum,
saveImageToPhotosAlbum: saveImageToPhotosAlbum,
compressImage: compressImage$1,
compressImage: compressImage,
compressVideo: compressVideo,
chooseImage: chooseImage,
chooseVideo: chooseVideo,
......
<template>
<uni-audio
:id="id"
:controls="!!controls"
v-bind="$attrs"
>
<audio
ref="audio"
:loop="loop"
style="display:none;"
/>
<div class="uni-audio-default">
<div
:style="'background-image: url('+$getRealPath(poster)+');'"
class="uni-audio-left"
>
<div
:class="{play:!playing,pause:playing}"
class="uni-audio-button"
@click="trigger"
/>
</div>
<div class="uni-audio-right">
<div class="uni-audio-time">
{{ currentTime }}
</div>
<div class="uni-audio-info">
<div class="uni-audio-name">
{{ name }}
</div>
<div class="uni-audio-author">
{{ author }}
</div>
</div>
</div>
</div>
</uni-audio>
</template>
<script>
import {
subscriber
} from '../../mixins'
export default {
name: 'Audio',
mixins: [subscriber],
props: {
id: {
type: String,
default: ''
},
src: {
type: String,
default: ''
},
loop: {
type: [Boolean, String],
default: false
},
controls: {
type: [Boolean, String],
default: false
},
poster: {
type: String,
default: ''
},
name: {
type: String,
default: ''
},
author: {
type: String,
default: ''
}
},
data () {
return {
playing: false,
currentTime: this.getTime(0)
}
},
watch: {
src (val) {
if (this.$refs.audio) {
this.$refs.audio.src = this.$getRealPath(val)
}
}
},
mounted () {
const audio = this.$refs.audio
audio.addEventListener('error', $event => {
this.playing = false
this.$trigger('error', $event, {})
})
audio.addEventListener('play', $event => {
this.playing = true
this.$trigger('play', $event, {})
})
audio.addEventListener('pause', $event => {
this.playing = false
this.$trigger('pause', $event, {})
})
audio.addEventListener('ended', $event => {
this.playing = false
this.$trigger('ended', $event, {})
})
audio.addEventListener('timeupdate', $event => {
var currentTime = audio.currentTime
this.currentTime = this.getTime(currentTime)
var duration = audio.duration
this.$trigger('timeupdate', $event, {
currentTime,
duration
})
})
audio.src = this.$getRealPath(this.src)
},
methods: {
_handleSubscribe ({
type,
data = {}
}) {
var audio = this.$refs.audio
switch (type) {
case 'setSrc':
audio.src = this.$getRealPath(data.src)
this.$emit('update:src', data.src)
break
case 'play':
audio.play()
break
case 'pause':
audio.pause()
break
case 'seek':
audio.currentTime = data.position
break
}
},
trigger () {
if (this.playing) {
this.$refs.audio.pause()
} else {
this.$refs.audio.play()
}
},
getTime (time) {
var h = Math.floor(time / 3600)
var m = Math.floor(time % 3600 / 60)
var s = Math.floor(time % 3600 % 60)
h = (h < 10 ? '0' : '') + h
m = (m < 10 ? '0' : '') + m
s = (s < 10 ? '0' : '') + s
var str = m + ':' + s
if (h !== '00') {
str = h + ':' + str
}
return str
}
}
}
</script>
import Audio from './audio/index.vue'
import Button from './button/index'
import Canvas from './canvas/index'
import Checkbox from './checkbox/index'
......@@ -28,7 +27,6 @@ import Text from './text/index'
import Textarea from './textarea/index'
import View from './view/index'
export {
Audio,
Button,
Canvas,
Checkbox,
......
import { upx2px } from '@dcloudio/uni-api'
function converPx(value) {
if (/^-?\d+[ur]px$/i.test(value)) {
return value.replace(/(^-?\d+)[ur]px$/i, (text, num) => {
return `${upx2px(parseFloat(num))}px`
})
// eslint-disable-next-line no-useless-escape
} else if (/^-?[\d\.]+$/.test(value)) {
return `${value}px`
}
return value || ''
}
function converType(type) {
return type
.replace(/[A-Z]/g, text => {
return `-${text.toLowerCase()}`
})
.replace('webkit', '-webkit')
}
function getStyle(action) {
const animateTypes1 = [
'matrix',
'matrix3d',
'scale',
'scale3d',
'rotate3d',
'skew',
'translate',
'translate3d'
]
const animateTypes2 = [
'scaleX',
'scaleY',
'scaleZ',
'rotate',
'rotateX',
'rotateY',
'rotateZ',
'skewX',
'skewY',
'translateX',
'translateY',
'translateZ'
]
const animateTypes3 = ['opacity', 'background-color']
const animateTypes4 = ['width', 'height', 'left', 'right', 'top', 'bottom']
const animates = action.animates
const option = action.option
const transition = option.transition
const style = {}
const transform = []
animates.forEach(animate => {
let type = animate.type
let args = [...animate.args]
if (animateTypes1.concat(animateTypes2).includes(type)) {
if (type.startsWith('rotate') || type.startsWith('skew')) {
args = args.map(value => parseFloat(value) + 'deg')
} else if (type.startsWith('translate')) {
args = args.map(converPx)
}
if (animateTypes2.indexOf(type) >= 0) {
args.length = 1
}
transform.push(`${type}(${args.join(',')})`)
} else if (animateTypes3.concat(animateTypes4).includes(args[0])) {
type = args[0]
const value = args[1]
style[type] = animateTypes4.includes(type) ? converPx(value) : value
}
})
style.transform = style.webkitTransform = transform.join(' ')
style.transition = style.webkitTransition = Object.keys(style)
.map(
type =>
`${converType(type)} ${transition.duration}ms ${
transition.timingFunction
} ${transition.delay}ms`
)
.join(',')
style.transformOrigin = style.webkitTransformOrigin = option.transformOrigin
return style
}
function startAnimation(context) {
const animation = context.animation
if (!animation || !animation.actions || !animation.actions.length) {
return
}
let index = 0
const actions = animation.actions
const length = animation.actions.length
function animate() {
const action = actions[index]
const transition = action.option.transition
const style = getStyle(action)
Object.keys(style).forEach(key => {
context.$el.style[key] = style[key]
})
index += 1
if (index < length) {
setTimeout(animate, transition.duration + transition.delay)
}
}
setTimeout(() => {
animate()
}, 0)
}
export default {
props: ['animation'],
watch: {
animation() {
startAnimation(this)
}
},
mounted() {
startAnimation(this)
}
}
import { debounce } from '@dcloudio/uni-shared'
import { throttle } from '../helpers/throttle'
import emitter from './emitter'
import keyboard from './keyboard'
export default {
name: 'BaseInput',
mixins: [emitter, keyboard],
model: {
prop: 'value',
event: 'update:value'
},
props: {
value: {
type: [String, Number],
default: ''
}
},
data() {
return {
valueSync: this._getValueString(this.value)
}
},
created() {
const valueChange = (this.__valueChange = debounce(val => {
this.valueSync = this._getValueString(val)
}, 100))
this.$watch('value', valueChange)
this.__triggerInput = throttle(($event, detail) => {
this.$emit('update:value', detail.value)
this.$trigger('input', $event, detail)
}, 100)
this.$triggerInput = ($event, detail) => {
this.__valueChange.cancel()
this.__triggerInput($event, detail)
}
},
beforeDestroy() {
this.__valueChange.cancel()
this.__triggerInput.cancel()
},
methods: {
_getValueString(value) {
return value === null ? '' : String(value)
}
}
}
import getRealPath from 'uni-platform/helpers/get-real-path'
import { processEvent } from 'uni-view/plugins/events'
export default {
methods: {
$getRealPath(src) {
return src ? getRealPath(src) : src
},
$trigger(name, $event, detail) {
this.$emit(
name,
processEvent.call(this, name, $event, detail, this.$el, this.$el)
)
}
}
}
// 暂不提供通知所有
// function broadcast (componentName, eventName, ...params) {
// this.$children.forEach(child => {
// const name = child.$options.name && child.$options.name.substr(1)
// if (~componentName.indexOf(name)) {
// child.$emit.apply(child, [eventName].concat(params))
// } else {
// broadcast.apply(child, [componentName, eventName].concat([params]))
// }
// })
// }
function broadcast(componentName, eventName, ...params) {
const children = this.$children
const len = children.length
for (let i = 0; i < len; i++) {
const child = children[i]
const name = child.$options.name && child.$options.name.substr(4)
if (~componentName.indexOf(name)) {
child.$emit.apply(child, [eventName].concat(params))
return false
} else {
if (
broadcast.apply(child, [componentName, eventName].concat([params])) ===
false
) {
return false
}
}
}
}
export default {
methods: {
$dispatch(componentName, eventName, ...params) {
console.log('$dispatch', componentName, eventName, params)
// if (typeof componentName === 'string') {
// componentName = [componentName]
// }
// let parent = this.$parent || this.$root
// let name = parent.$options.name && parent.$options.name.substr(4)
// while (parent && (!name || !~componentName.indexOf(name))) {
// parent = parent.$parent
// if (parent) {
// name = parent.$options.name && parent.$options.name.substr(4)
// }
// }
// if (parent) {
// parent.$emit.apply(parent, [eventName].concat(params))
// }
},
$broadcast(componentName, eventName, ...params) {
if (typeof componentName === 'string') {
componentName = [componentName]
}
broadcast.apply(this, [componentName, eventName].concat(params))
},
},
}
export default {
data() {
return {
hovering: false
}
},
props: {
hoverClass: {
type: String,
default: 'none'
},
hoverStopPropagation: {
type: Boolean,
default: false
},
hoverStartTime: {
type: [Number, String],
default: 50
},
hoverStayTime: {
type: [Number, String],
default: 400
}
},
methods: {
_hoverTouchStart(evt) {
// TODO detect scrolling
if (evt._hoverPropagationStopped) {
return
}
if (!this.hoverClass || this.hoverClass === 'none' || this.disabled) {
return
}
if (evt.touches.length > 1) {
return
}
if (this.hoverStopPropagation) {
evt._hoverPropagationStopped = true
}
this._hoverTouch = true
this._hoverStartTimer = setTimeout(() => {
this.hovering = true
if (!this._hoverTouch) {
// 防止在hoverStartTime时间内触发了 touchend 或 touchcancel
this._hoverReset()
}
}, this.hoverStartTime)
},
_hoverTouchEnd(evt) {
this._hoverTouch = false
if (this.hovering) {
this._hoverReset()
}
},
_hoverReset() {
requestAnimationFrame(() => {
clearTimeout(this._hoverStayTimer)
this._hoverStayTimer = setTimeout(() => {
this.hovering = false
}, this.hoverStayTime)
})
},
_hoverTouchCancel(evt) {
this._hoverTouch = false
this.hovering = false
clearTimeout(this._hoverStartTimer)
}
}
}
// @ts-ignore
export { default as emitter } from './emitter'
// @ts-ignore
export { default as listeners } from './listeners'
// @ts-ignore
export { default as hover } from './hover'
// @ts-ignore
export { default as subscriber } from './subscriber'
// @ts-ignore
export { default as keyboard } from './keyboard'
// @ts-ignore
export { default as baseInput } from './base-input'
// @ts-ignore
export { default as interact } from './interact'
const passiveOptions = {
passive: true,
capture: true,
}
const vms = []
let userInteract = 0
let inited
function addInteractListener(vm) {
if (!inited) {
inited = true
const eventNames = [
'touchstart',
'touchmove',
'touchend',
'mousedown',
'mouseup',
]
eventNames.forEach((eventName) => {
document.addEventListener(
eventName,
function () {
vms.forEach((vm) => {
vm.userInteract = true
userInteract++
setTimeout(() => {
userInteract--
if (!userInteract) {
vm.userInteract = false
}
}, 0)
})
},
passiveOptions
)
})
}
vms.push(vm)
}
function removeInteractListener(vm) {
const index = vms.indexOf(vm)
if (index >= 0) {
vms.splice(index, 1)
}
}
export default {
data() {
return {
/**
* 是否用户交互行为
*/
userInteract: false,
}
},
mounted() {
addInteractListener(this)
},
beforeDestroy() {
removeInteractListener(this)
},
}
import { plusReady } from '@dcloudio/uni-shared'
function hideKeyboard() {
document.activeElement.blur()
}
/**
* 保证iOS点击输入框外隐藏键盘
*/
function iosHideKeyboard() {}
export default {
name: 'Keyboard',
props: {
cursorSpacing: {
type: [Number, String],
default: 0
},
showConfirmBar: {
type: [Boolean, String],
default: 'auto'
},
adjustPosition: {
type: Boolean,
default: true
}
},
watch: {
focus(val) {
if (val && __PLATFORM__ === 'app-plus') {
this.showSoftKeybord()
}
}
},
mounted() {
if (this.autoFocus || this.focus) {
this.showSoftKeybord()
}
},
beforeDestroy() {
this.onKeyboardHide()
},
methods: {
initKeyboard(el) {
el.addEventListener('focus', () => {
this.hideKeyboardTemp = function() {
hideKeyboard()
}
UniViewJSBridge.subscribe('hideKeyboard', this.hideKeyboardTemp)
document.addEventListener('click', iosHideKeyboard, false)
if (__PLATFORM__ === 'app-plus') {
this.setSoftinputNavBar()
this.setSoftinputTemporary()
}
})
el.addEventListener('blur', this.onKeyboardHide.bind(this))
},
showSoftKeybord() {
plusReady(() => {
plus.key.showSoftKeybord()
})
},
setSoftinputTemporary() {
plusReady(() => {
const currentWebview = plus.webview.currentWebview()
const style = currentWebview.getStyle() || {}
const rect = this.$el.getBoundingClientRect()
currentWebview.setSoftinputTemporary &&
currentWebview.setSoftinputTemporary({
mode:
style.softinputMode === 'adjustResize'
? 'adjustResize'
: this.adjustPosition
? 'adjustPan'
: 'nothing',
position: {
top: rect.top,
height: rect.height + (Number(this.cursorSpacing) || 0)
}
})
})
},
setSoftinputNavBar() {
if (this.showConfirmBar === 'auto') {
delete this.__softinputNavBar
return
}
plusReady(() => {
const currentWebview = plus.webview.currentWebview()
const { softinputNavBar } = currentWebview.getStyle() || {}
const showConfirmBar = softinputNavBar !== 'none'
if (showConfirmBar !== this.showConfirmBar) {
this.__softinputNavBar = softinputNavBar || 'auto'
currentWebview.setStyle({
softinputNavBar: this.showConfirmBar ? 'auto' : 'none'
})
} else {
delete this.__softinputNavBar
}
})
},
resetSoftinputNavBar() {
const softinputNavBar = this.__softinputNavBar
if (softinputNavBar) {
plusReady(() => {
const currentWebview = plus.webview.currentWebview()
currentWebview.setStyle({
softinputNavBar
})
})
}
},
onKeyboardHide() {
UniViewJSBridge.unsubscribe('hideKeyboard', this.hideKeyboardTemp)
document.removeEventListener('click', iosHideKeyboard, false)
if (__PLATFORM__ === 'app-plus') {
this.resetSoftinputNavBar()
}
// 修复ios端显示与点击位置错位的Bug by:wyq
if (String(navigator.vendor).indexOf('Apple') === 0) {
document.documentElement.scrollTo(
document.documentElement.scrollLeft,
document.documentElement.scrollTop
)
}
}
}
}
import { isPlainObject } from '@vue/shared'
export default {
props: {
id: {
type: String,
default: ''
}
},
created() {
this._addListeners(this.id) // 初始化监听
this.$watch('id', (newId, oldId) => {
// watch id
this._removeListeners(oldId, true)
this._addListeners(newId, true)
})
},
beforeDestroy() {
// 销毁时移除
this._removeListeners(this.id)
},
methods: {
_addListeners(id, watch) {
if (watch && !id) {
// id被置空
return
}
const { listeners } = this.$options
if (!isPlainObject(listeners)) {
return
}
Object.keys(listeners).forEach(name => {
if (watch) {
// watch id
if (name.indexOf('@') !== 0 && name.indexOf('uni-') !== 0) {
/* eslint-disable standard/computed-property-even-spacing */
UniViewJSBridge.on(
`uni-${name}-${this.$page.id}-${id}`,
this[listeners[name]]
)
}
} else {
if (name.indexOf('@') === 0) {
/* eslint-disable standard/computed-property-even-spacing */
this.$on(`uni-${name.substr(1)}`, this[listeners[name]])
} else if (name.indexOf('uni-') === 0) {
// 完全限定
/* eslint-disable standard/computed-property-even-spacing */
UniViewJSBridge.on(name, this[listeners[name]])
} else if (id) {
// scoped
/* eslint-disable standard/computed-property-even-spacing */
UniViewJSBridge.on(
`uni-${name}-${this.$page.id}-${id}`,
this[listeners[name]]
)
}
}
})
},
_removeListeners(id, watch) {
if (watch && !id) {
// id之前不存在
return
}
const { listeners } = this.$options
if (!isPlainObject(listeners)) {
return
}
Object.keys(listeners).forEach(name => {
if (watch) {
// watch id
if (name.indexOf('@') !== 0 && name.indexOf('uni-') !== 0) {
/* eslint-disable standard/computed-property-even-spacing */
UniViewJSBridge.off(
`uni-${name}-${this.$page.id}-${id}`,
this[listeners[name]]
)
}
} else {
if (name.indexOf('@') === 0) {
/* eslint-disable standard/computed-property-even-spacing */
this.$off(`uni-${name.substr(1)}`, this[listeners[name]])
} else if (name.indexOf('uni-') === 0) {
// 完全限定
/* eslint-disable standard/computed-property-even-spacing */
UniViewJSBridge.off(name, this[listeners[name]])
} else if (id) {
// scoped
/* eslint-disable standard/computed-property-even-spacing */
UniViewJSBridge.off(
`uni-${name}-${this.$page.id}-${id}`,
this[listeners[name]]
)
}
}
})
}
}
}
export function Friction(e) {
this._drag = e
this._dragLog = Math.log(e)
this._x = 0
this._v = 0
this._startTime = 0
}
Friction.prototype.set = function (e, t) {
this._x = e
this._v = t
this._startTime = new Date().getTime()
}
Friction.prototype.setVelocityByEnd = function (e) {
this._v = ((e - this._x) * this._dragLog) / (Math.pow(this._drag, 100) - 1)
}
Friction.prototype.x = function (e) {
if (e === undefined) {
e = (new Date().getTime() - this._startTime) / 1e3
}
var t
t =
e === this._dt && this._powDragDt
? this._powDragDt
: (this._powDragDt = Math.pow(this._drag, e))
this._dt = e
return this._x + (this._v * t) / this._dragLog - this._v / this._dragLog
}
Friction.prototype.dx = function (e) {
if (e === undefined) {
e = (new Date().getTime() - this._startTime) / 1e3
}
var t
t =
e === this._dt && this._powDragDt
? this._powDragDt
: (this._powDragDt = Math.pow(this._drag, e))
this._dt = e
return this._v * t
}
Friction.prototype.done = function () {
return Math.abs(this.dx()) < 3
}
Friction.prototype.reconfigure = function (e) {
var t = this.x()
var n = this.dx()
this._drag = e
this._dragLog = Math.log(e)
this.set(t, n)
}
Friction.prototype.configuration = function () {
var e = this
return [
{
label: 'Friction',
read: function () {
return e._drag
},
write: function (t) {
e.reconfigure(t)
},
min: 0.001,
max: 0.1,
step: 0.001,
},
]
}
import { Friction } from './Friction'
import { Spring } from './Spring'
export function Scroll(extent, friction, spring) {
this._extent = extent
this._friction = friction || new Friction(0.01)
this._spring = spring || new Spring(1, 90, 20)
this._startTime = 0
this._springing = false
this._springOffset = 0
}
Scroll.prototype.snap = function (e, t) {
this._springOffset = 0
this._springing = true
this._spring.snap(e)
this._spring.setEnd(t)
}
Scroll.prototype.set = function (e, t) {
this._friction.set(e, t)
if (e > 0 && t >= 0) {
this._springOffset = 0
this._springing = true
this._spring.snap(e)
this._spring.setEnd(0)
} else {
if (e < -this._extent && t <= 0) {
this._springOffset = 0
this._springing = true
this._spring.snap(e)
this._spring.setEnd(-this._extent)
} else {
this._springing = false
}
}
this._startTime = new Date().getTime()
}
Scroll.prototype.x = function (e) {
if (!this._startTime) {
return 0
}
if (!e) {
e = (new Date().getTime() - this._startTime) / 1e3
}
if (this._springing) {
return this._spring.x() + this._springOffset
}
var t = this._friction.x(e)
var n = this.dx(e)
if ((t > 0 && n >= 0) || (t < -this._extent && n <= 0)) {
this._springing = true
this._spring.setEnd(0, n)
if (t < -this._extent) {
this._springOffset = -this._extent
} else {
this._springOffset = 0
}
t = this._spring.x() + this._springOffset
}
return t
}
Scroll.prototype.dx = function (e) {
var t = 0
t =
this._lastTime === e
? this._lastDx
: this._springing
? this._spring.dx(e)
: this._friction.dx(e)
this._lastTime = e
this._lastDx = t
return t
}
Scroll.prototype.done = function () {
return this._springing ? this._spring.done() : this._friction.done()
}
Scroll.prototype.setVelocityByEnd = function (e) {
this._friction.setVelocityByEnd(e)
}
Scroll.prototype.configuration = function () {
var e = this._friction.configuration()
e.push.apply(e, this._spring.configuration())
return e
}
import { Scroll } from './Scroll'
function i(scroll, t, n) {
function i(t, scroll, r, o) {
if (!t || !t.cancelled) {
r(scroll)
var a = scroll.done()
if (!a) {
if (!t.cancelled) {
t.id = requestAnimationFrame(i.bind(null, t, scroll, r, o))
}
}
if (a && o) {
o(scroll)
}
}
}
function r(scroll) {
if (scroll && scroll.id) {
cancelAnimationFrame(scroll.id)
}
if (scroll) {
scroll.cancelled = true
}
}
var o = {
id: 0,
cancelled: false,
}
i(o, scroll, t, n)
return {
cancel: r.bind(null, o),
model: scroll,
}
}
export function Scroller(element, options) {
options = options || {}
this._element = element
this._options = options
this._enableSnap = options.enableSnap || false
this._itemSize = options.itemSize || 0
this._enableX = options.enableX || false
this._enableY = options.enableY || false
this._shouldDispatchScrollEvent = !!options.onScroll
if (this._enableX) {
this._extent =
(options.scrollWidth || this._element.offsetWidth) -
this._element.parentElement.offsetWidth
this._scrollWidth = options.scrollWidth
} else {
this._extent =
(options.scrollHeight || this._element.offsetHeight) -
this._element.parentElement.offsetHeight
this._scrollHeight = options.scrollHeight
}
this._position = 0
this._scroll = new Scroll(this._extent, options.friction, options.spring)
this._onTransitionEnd = this.onTransitionEnd.bind(this)
this.updatePosition()
}
Scroller.prototype.onTouchStart = function () {
this._startPosition = this._position
this._lastChangePos = this._startPosition
if (this._startPosition > 0) {
this._startPosition /= 0.5
} else {
if (this._startPosition < -this._extent) {
this._startPosition =
(this._startPosition + this._extent) / 0.5 - this._extent
}
}
if (this._animation) {
this._animation.cancel()
this._scrolling = false
}
this.updatePosition()
}
Scroller.prototype.onTouchMove = function (x, y) {
var startPosition = this._startPosition
if (this._enableX) {
startPosition += x
} else if (this._enableY) {
startPosition += y
}
if (startPosition > 0) {
startPosition *= 0.5
} else if (startPosition < -this._extent) {
startPosition = 0.5 * (startPosition + this._extent) - this._extent
}
this._position = startPosition
this.updatePosition()
this.dispatchScroll()
}
Scroller.prototype.onTouchEnd = function (e, r, o) {
if (
this._enableSnap &&
this._position > -this._extent &&
this._position < 0
) {
if (
this._enableY &&
((Math.abs(r) < this._itemSize && Math.abs(o.y) < 300) ||
Math.abs(o.y) < 150)
) {
this.snap()
return
}
if (
this._enableX &&
((Math.abs(e) < this._itemSize && Math.abs(o.x) < 300) ||
Math.abs(o.x) < 150)
) {
this.snap()
return
}
}
if (this._enableX) {
this._scroll.set(this._position, o.x)
} else if (this._enableY) {
this._scroll.set(this._position, o.y)
}
if (this._enableSnap) {
var s = this._scroll._friction.x(100)
var l = s % this._itemSize
var c =
Math.abs(l) > this._itemSize / 2
? s - (this._itemSize - Math.abs(l))
: s - l
if (c <= 0 && c >= -this._extent) {
this._scroll.setVelocityByEnd(c)
}
}
this._lastTime = Date.now()
this._lastDelay = 0
this._scrolling = true
this._lastChangePos = this._position
this._lastIdx = Math.floor(Math.abs(this._position / this._itemSize))
this._animation = i(
this._scroll,
() => {
var e = Date.now()
var i = (e - this._scroll._startTime) / 1e3
var r = this._scroll.x(i)
this._position = r
this.updatePosition()
var o = this._scroll.dx(i)
if (
this._shouldDispatchScrollEvent &&
e - this._lastTime > this._lastDelay
) {
this.dispatchScroll()
this._lastDelay = Math.abs(2e3 / o)
this._lastTime = e
}
},
() => {
if (this._enableSnap) {
if (c <= 0 && c >= -this._extent) {
this._position = c
this.updatePosition()
}
if (typeof this._options.onSnap === 'function') {
this._options.onSnap(
Math.floor(Math.abs(this._position) / this._itemSize)
)
}
}
if (this._shouldDispatchScrollEvent) {
this.dispatchScroll()
}
this._scrolling = false
}
)
}
Scroller.prototype.onTransitionEnd = function () {
this._element.style.transition = ''
this._element.style.webkitTransition = ''
this._element.removeEventListener('transitionend', this._onTransitionEnd)
this._element.removeEventListener(
'webkitTransitionEnd',
this._onTransitionEnd
)
if (this._snapping) {
this._snapping = false
}
this.dispatchScroll()
}
Scroller.prototype.snap = function () {
var e = this._itemSize
var t = this._position % e
var i =
Math.abs(t) > this._itemSize / 2
? this._position - (e - Math.abs(t))
: this._position - t
if (this._position !== i) {
this._snapping = true
this.scrollTo(-i)
if (typeof this._options.onSnap === 'function') {
this._options.onSnap(
Math.floor(Math.abs(this._position) / this._itemSize)
)
}
}
}
Scroller.prototype.scrollTo = function (e, t) {
if (this._animation) {
this._animation.cancel()
this._scrolling = false
}
if (typeof e === 'number') {
this._position = -e
}
if (this._position < -this._extent) {
this._position = -this._extent
} else {
if (this._position > 0) {
this._position = 0
}
}
this._element.style.transition = 'transform ' + (t || 0.2) + 's ease-out'
this._element.style.webkitTransition =
'-webkit-transform ' + (t || 0.2) + 's ease-out'
this.updatePosition()
this._element.addEventListener('transitionend', this._onTransitionEnd)
this._element.addEventListener('webkitTransitionEnd', this._onTransitionEnd)
}
Scroller.prototype.dispatchScroll = function () {
if (
typeof this._options.onScroll === 'function' &&
Math.round(this._lastPos) !== Math.round(this._position)
) {
this._lastPos = this._position
var e = {
target: {
scrollLeft: this._enableX ? -this._position : 0,
scrollTop: this._enableY ? -this._position : 0,
scrollHeight: this._scrollHeight || this._element.offsetHeight,
scrollWidth: this._scrollWidth || this._element.offsetWidth,
offsetHeight: this._element.parentElement.offsetHeight,
offsetWidth: this._element.parentElement.offsetWidth,
},
}
this._options.onScroll(e)
}
}
Scroller.prototype.update = function (e, t, n) {
var i = 0
var r = this._position
if (this._enableX) {
i = this._element.childNodes.length
? (t || this._element.offsetWidth) -
this._element.parentElement.offsetWidth
: 0
this._scrollWidth = t
} else {
i = this._element.childNodes.length
? (t || this._element.offsetHeight) -
this._element.parentElement.offsetHeight
: 0
this._scrollHeight = t
}
if (typeof e === 'number') {
this._position = -e
}
if (this._position < -i) {
this._position = -i
} else {
if (this._position > 0) {
this._position = 0
}
}
this._itemSize = n || this._itemSize
this.updatePosition()
if (r !== this._position) {
this.dispatchScroll()
if (typeof this._options.onSnap === 'function') {
this._options.onSnap(
Math.floor(Math.abs(this._position) / this._itemSize)
)
}
}
this._extent = i
this._scroll._extent = i
}
Scroller.prototype.updatePosition = function () {
var transform = ''
if (this._enableX) {
transform = 'translateX(' + this._position + 'px) translateZ(0)'
} else {
if (this._enableY) {
transform = 'translateY(' + this._position + 'px) translateZ(0)'
}
}
this._element.style.webkitTransform = transform
this._element.style.transform = transform
}
Scroller.prototype.isScrolling = function () {
return this._scrolling || this._snapping
}
function o(e, t, n) {
return e > t - n && e < t + n
}
function a(e, t) {
return o(e, 0, t)
}
export function Spring(e, t, n) {
this._m = e
this._k = t
this._c = n
this._solution = null
this._endPosition = 0
this._startTime = 0
}
Spring.prototype._solve = function (e, t) {
var n = this._c
var i = this._m
var r = this._k
var o = n * n - 4 * i * r
if (o === 0) {
const a = -n / (2 * i)
const s = e
const l = t / (a * e)
return {
x: function (e) {
return (s + l * e) * Math.pow(Math.E, a * e)
},
dx: function (e) {
var t = Math.pow(Math.E, a * e)
return a * (s + l * e) * t + l * t
},
}
}
if (o > 0) {
const c = (-n - Math.sqrt(o)) / (2 * i)
const u = (-n + Math.sqrt(o)) / (2 * i)
const l = (t - c * e) / (u - c)
const s = e - l
return {
x: function (e) {
let t
let n
if (e === this._t) {
t = this._powER1T
n = this._powER2T
}
this._t = e
if (!t) {
t = this._powER1T = Math.pow(Math.E, c * e)
}
if (!n) {
n = this._powER2T = Math.pow(Math.E, u * e)
}
return s * t + l * n
},
dx: function (e) {
let t
let n
if (e === this._t) {
t = this._powER1T
n = this._powER2T
}
this._t = e
if (!t) {
t = this._powER1T = Math.pow(Math.E, c * e)
}
if (!n) {
n = this._powER2T = Math.pow(Math.E, u * e)
}
return s * c * t + l * u * n
},
}
}
var d = Math.sqrt(4 * i * r - n * n) / (2 * i)
var a = (-n / 2) * i
var s = e
var l = (t - a * e) / d
return {
x: function (e) {
return (
Math.pow(Math.E, a * e) * (s * Math.cos(d * e) + l * Math.sin(d * e))
)
},
dx: function (e) {
var t = Math.pow(Math.E, a * e)
var n = Math.cos(d * e)
var i = Math.sin(d * e)
return t * (l * d * n - s * d * i) + a * t * (l * i + s * n)
},
}
}
Spring.prototype.x = function (e) {
if (e === undefined) {
e = (new Date().getTime() - this._startTime) / 1e3
}
return this._solution ? this._endPosition + this._solution.x(e) : 0
}
Spring.prototype.dx = function (e) {
if (e === undefined) {
e = (new Date().getTime() - this._startTime) / 1e3
}
return this._solution ? this._solution.dx(e) : 0
}
Spring.prototype.setEnd = function (e, t, n) {
if (!n) {
n = new Date().getTime()
}
if (e !== this._endPosition || !a(t, 0.4)) {
t = t || 0
var i = this._endPosition
if (this._solution) {
if (a(t, 0.4)) {
t = this._solution.dx((n - this._startTime) / 1e3)
}
i = this._solution.x((n - this._startTime) / 1e3)
if (a(t, 0.4)) {
t = 0
}
if (a(i, 0.4)) {
i = 0
}
i += this._endPosition
}
if (!(this._solution && a(i - e, 0.4) && a(t, 0.4))) {
this._endPosition = e
this._solution = this._solve(i - this._endPosition, t)
this._startTime = n
}
}
}
Spring.prototype.snap = function (e) {
this._startTime = new Date().getTime()
this._endPosition = e
this._solution = {
x: function () {
return 0
},
dx: function () {
return 0
},
}
}
Spring.prototype.done = function (e) {
if (!e) {
e = new Date().getTime()
}
return o(this.x(), this._endPosition, 0.4) && a(this.dx(), 0.4)
}
Spring.prototype.reconfigure = function (e, t, n) {
this._m = e
this._k = t
this._c = n
if (!this.done()) {
this._solution = this._solve(this.x() - this._endPosition, this.dx())
this._startTime = new Date().getTime()
}
}
Spring.prototype.springConstant = function () {
return this._k
}
Spring.prototype.damping = function () {
return this._c
}
Spring.prototype.configuration = function () {
function e(e, t) {
e.reconfigure(1, t, e.damping())
}
function t(e, t) {
e.reconfigure(1, e.springConstant(), t)
}
return [
{
label: 'Spring Constant',
read: this.springConstant.bind(this),
write: e.bind(this, this),
min: 100,
max: 1e3,
},
{
label: 'Damping',
read: this.damping.bind(this),
write: t.bind(this, this),
min: 1,
max: 500,
},
]
}
import { Scroller } from './Scroller'
export default {
methods: {
initScroller: function (element, options) {
this._touchInfo = {
trackingID: -1,
maxDy: 0,
maxDx: 0,
}
this._scroller = new Scroller(element, options)
this.__handleTouchStart = this._handleTouchStart.bind(this)
this.__handleTouchMove = this._handleTouchMove.bind(this)
this.__handleTouchEnd = this._handleTouchEnd.bind(this)
this._initedScroller = true
},
_findDelta: function (event) {
var touchInfo = this._touchInfo
return event.detail.state === 'move' || event.detail.state === 'end'
? {
x: event.detail.dx,
y: event.detail.dy,
}
: {
x: event.screenX - touchInfo.x,
y: event.screenY - touchInfo.y,
}
},
_handleTouchStart: function (e) {
var t = this._touchInfo
var n = this._scroller
if (n) {
if (e.detail.state === 'start') {
t.trackingID = 'touch'
t.x = e.detail.x
t.y = e.detail.y
} else {
t.trackingID = 'mouse'
t.x = e.screenX
t.y = e.screenY
}
t.maxDx = 0
t.maxDy = 0
t.historyX = [0]
t.historyY = [0]
t.historyTime = [e.detail.timeStamp]
t.listener = n
if (n.onTouchStart) {
n.onTouchStart()
}
e.preventDefault()
}
},
_handleTouchMove: function (event) {
var touchInfo = this._touchInfo
if (touchInfo.trackingID !== -1) {
event.preventDefault()
var delta = this._findDelta(event)
if (delta) {
for (
touchInfo.maxDy = Math.max(touchInfo.maxDy, Math.abs(delta.y)),
touchInfo.maxDx = Math.max(touchInfo.maxDx, Math.abs(delta.x)),
touchInfo.historyX.push(delta.x),
touchInfo.historyY.push(delta.y),
touchInfo.historyTime.push(event.detail.timeStamp);
touchInfo.historyTime.length > 10;
) {
touchInfo.historyTime.shift()
touchInfo.historyX.shift()
touchInfo.historyY.shift()
}
if (touchInfo.listener && touchInfo.listener.onTouchMove) {
touchInfo.listener.onTouchMove(
delta.x,
delta.y,
event.detail.timeStamp
)
}
}
}
},
_handleTouchEnd: function (event) {
var touchInfo = this._touchInfo
if (touchInfo.trackingID !== -1) {
event.preventDefault()
var delta = this._findDelta(event)
if (delta) {
var listener = touchInfo.listener
touchInfo.trackingID = -1
touchInfo.listener = null
var r = touchInfo.historyTime.length
var o = {
x: 0,
y: 0,
}
if (r > 2) {
for (
var a = touchInfo.historyTime.length - 1,
s = touchInfo.historyTime[a],
l = touchInfo.historyX[a],
c = touchInfo.historyY[a];
a > 0;
) {
a--
var u = touchInfo.historyTime[a]
var d = s - u
if (d > 30 && d < 50) {
o.x = (l - touchInfo.historyX[a]) / (d / 1e3)
o.y = (c - touchInfo.historyY[a]) / (d / 1e3)
break
}
}
}
touchInfo.historyTime = []
touchInfo.historyX = []
touchInfo.historyY = []
if (listener && listener.onTouchEnd) {
listener.onTouchEnd(delta.x, delta.y, o)
}
}
}
},
},
}
import { isFunction } from '@vue/shared'
export default {
// 取消id的定义,某些组件(canvas)内不在props内定义id
// props: {
// id: {
// type: String,
// default: ''
// }
// },
mounted() {
this._toggleListeners('subscribe', this.id) // 初始化监听
this.$watch('id', (newId, oldId) => {
// watch id
this._toggleListeners('unsubscribe', oldId, true)
this._toggleListeners('subscribe', newId, true)
})
},
beforeDestroy() {
// 销毁时移除
this._toggleListeners('unsubscribe', this.id)
if (this._contextId) {
this._toggleListeners('unsubscribe', this._contextId)
}
},
methods: {
_toggleListeners(type, id, watch) {
if (watch && !id) {
// id被置空
return
}
if (!isFunction(this._handleSubscribe)) {
return
}
// 纠正VUniVideo等组件命名为Video
UniViewJSBridge[type](
this.$page.id +
'-' +
this.$options.name.replace(/VUni([A-Z])/, '$1').toLowerCase() +
'-' +
id,
this._handleSubscribe
)
},
_getContextInfo() {
const id = `context-${this._uid}`
if (!this._contextId) {
this._toggleListeners('subscribe', id)
this._contextId = id
}
return {
name: this.$options.name.replace(/VUni([A-Z])/, '$1').toLowerCase(),
id,
page: this.$page.id
}
}
}
}
const addListenerToElement = function(element, type, callback, capture) {
// 暂时忽略 capture
element.addEventListener(
type,
$event => {
if (typeof callback === 'function') {
if (callback($event) === false) {
$event.preventDefault()
$event.stopPropagation()
}
}
},
{
passive: false
}
)
}
export default {
beforeDestroy() {
document.removeEventListener('mousemove', this.__mouseMoveEventListener)
document.removeEventListener('mouseup', this.__mouseUpEventListener)
},
methods: {
touchtrack: function(element, method, useCancel) {
const self = this
let x0 = 0
let y0 = 0
let x1 = 0
let y1 = 0
const fn = function($event, state, x, y) {
if (
self[method]({
target: $event.target,
currentTarget: $event.currentTarget,
preventDefault: $event.preventDefault.bind($event),
stopPropagation: $event.stopPropagation.bind($event),
touches: $event.touches,
changedTouches: $event.changedTouches,
detail: {
state,
x0: x,
y0: y,
dx: x - x0,
dy: y - y0,
ddx: x - x1,
ddy: y - y1,
timeStamp: $event.timeStamp
}
}) === false
) {
return false
}
}
let $eventOld = null
let hasTouchStart
let hasMouseDown
addListenerToElement(element, 'touchstart', function($event) {
hasTouchStart = true
if ($event.touches.length === 1 && !$eventOld) {
$eventOld = $event
x0 = x1 = $event.touches[0].pageX
y0 = y1 = $event.touches[0].pageY
return fn($event, 'start', x0, y0)
}
})
addListenerToElement(element, 'mousedown', function($event) {
hasMouseDown = true
if (!hasTouchStart && !$eventOld) {
// TODO touches changedTouches
$eventOld = $event
x0 = x1 = $event.pageX
y0 = y1 = $event.pageY
return fn($event, 'start', x0, y0)
}
})
addListenerToElement(element, 'touchmove', function($event) {
if ($event.touches.length === 1 && $eventOld) {
const res = fn(
$event,
'move',
$event.touches[0].pageX,
$event.touches[0].pageY
)
x1 = $event.touches[0].pageX
y1 = $event.touches[0].pageY
return res
}
})
const mouseMoveEventListener = (this.__mouseMoveEventListener = function(
$event
) {
if (!hasTouchStart && hasMouseDown && $eventOld) {
// TODO target currentTarget touches changedTouches
const res = fn($event, 'move', $event.pageX, $event.pageY)
x1 = $event.pageX
y1 = $event.pageY
return res
}
})
document.addEventListener('mousemove', mouseMoveEventListener)
addListenerToElement(element, 'touchend', function($event) {
if ($event.touches.length === 0 && $eventOld) {
hasTouchStart = false
$eventOld = null
return fn(
$event,
'end',
$event.changedTouches[0].pageX,
$event.changedTouches[0].pageY
)
}
})
const mouseUpEventListener = (this.__mouseUpEventListener = function(
$event
) {
hasMouseDown = false
if (!hasTouchStart && $eventOld) {
// TODO target currentTarget touches changedTouches
$eventOld = null
return fn($event, 'end', $event.pageX, $event.pageY)
}
})
document.addEventListener('mouseup', mouseUpEventListener)
addListenerToElement(element, 'touchcancel', function($event) {
if ($eventOld) {
hasTouchStart = false
const $eventTemp = $eventOld
$eventOld = null
return fn(
$event,
useCancel ? 'cancel' : 'end',
$eventTemp.touches[0].pageX,
$eventTemp.touches[0].pageY
)
}
})
}
}
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports[Symbol.toStringTag] = "Module";
var shared = require("@vue/shared");
var uniShared = require("@dcloudio/uni-shared");
var vue = require("vue");
var uniShared = require("@dcloudio/uni-shared");
var uniI18n = require("@dcloudio/uni-i18n");
var shared = require("@vue/shared");
var vueRouter = require("vue-router");
var subscriber = {
mounted() {
this._toggleListeners("subscribe", this.id);
this.$watch("id", (newId, oldId) => {
this._toggleListeners("unsubscribe", oldId, true);
this._toggleListeners("subscribe", newId, true);
});
},
beforeDestroy() {
this._toggleListeners("unsubscribe", this.id);
if (this._contextId) {
this._toggleListeners("unsubscribe", this._contextId);
}
},
methods: {
_toggleListeners(type, id, watch) {
if (watch && !id) {
return;
}
if (!shared.isFunction(this._handleSubscribe)) {
return;
}
UniViewJSBridge[type](this.$page.id + "-" + this.$options.name.replace(/VUni([A-Z])/, "$1").toLowerCase() + "-" + id, this._handleSubscribe);
},
_getContextInfo() {
const id = `context-${this._uid}`;
if (!this._contextId) {
this._toggleListeners("subscribe", id);
this._contextId = id;
}
return {
name: this.$options.name.replace(/VUni([A-Z])/, "$1").toLowerCase(),
id,
page: this.$page.id
};
}
}
};
function throttle(fn, wait) {
let last = 0;
let timeout;
let waitCallback;
const newFn = function(...arg) {
const now = Date.now();
clearTimeout(timeout);
waitCallback = () => {
waitCallback = null;
last = now;
fn.apply(this, arg);
};
if (now - last < wait) {
timeout = setTimeout(waitCallback, wait - (now - last));
return;
}
waitCallback();
};
newFn.cancel = function() {
clearTimeout(timeout);
waitCallback = null;
};
newFn.flush = function() {
clearTimeout(timeout);
waitCallback && waitCallback();
};
return newFn;
}
const _sfc_main$1 = {
name: "Audio",
mixins: [subscriber],
props: {
id: {
type: String,
default: ""
},
src: {
type: String,
default: ""
},
loop: {
type: [Boolean, String],
default: false
},
controls: {
type: [Boolean, String],
default: false
},
poster: {
type: String,
default: ""
},
name: {
type: String,
default: ""
},
author: {
type: String,
default: ""
}
},
data() {
return {
playing: false,
currentTime: this.getTime(0)
};
},
watch: {
src(val) {
if (this.$refs.audio) {
this.$refs.audio.src = this.$getRealPath(val);
}
}
},
mounted() {
const audio = this.$refs.audio;
audio.addEventListener("error", ($event) => {
this.playing = false;
this.$trigger("error", $event, {});
});
audio.addEventListener("play", ($event) => {
this.playing = true;
this.$trigger("play", $event, {});
});
audio.addEventListener("pause", ($event) => {
this.playing = false;
this.$trigger("pause", $event, {});
});
audio.addEventListener("ended", ($event) => {
this.playing = false;
this.$trigger("ended", $event, {});
});
audio.addEventListener("timeupdate", ($event) => {
var currentTime = audio.currentTime;
this.currentTime = this.getTime(currentTime);
var duration = audio.duration;
this.$trigger("timeupdate", $event, {
currentTime,
duration
});
});
audio.src = this.$getRealPath(this.src);
},
methods: {
_handleSubscribe({
type,
data = {}
}) {
var audio = this.$refs.audio;
switch (type) {
case "setSrc":
audio.src = this.$getRealPath(data.src);
this.$emit("update:src", data.src);
break;
case "play":
audio.play();
break;
case "pause":
audio.pause();
break;
case "seek":
audio.currentTime = data.position;
break;
}
},
trigger() {
if (this.playing) {
this.$refs.audio.pause();
} else {
this.$refs.audio.play();
}
},
getTime(time) {
var h = Math.floor(time / 3600);
var m = Math.floor(time % 3600 / 60);
var s = Math.floor(time % 3600 % 60);
h = (h < 10 ? "0" : "") + h;
m = (m < 10 ? "0" : "") + m;
s = (s < 10 ? "0" : "") + s;
var str = m + ":" + s;
if (h !== "00") {
str = h + ":" + str;
}
return str;
}
}
};
const _hoisted_1$1 = { class: "uni-audio-default" };
const _hoisted_2$1 = { class: "uni-audio-right" };
const _hoisted_3$1 = { class: "uni-audio-time" };
const _hoisted_4$1 = { class: "uni-audio-info" };
const _hoisted_5 = { class: "uni-audio-name" };
const _hoisted_6 = { class: "uni-audio-author" };
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createBlock("uni-audio", vue.mergeProps({
id: $props.id,
controls: !!$props.controls
}, _ctx.$attrs), [
vue.createVNode("audio", {
ref: "audio",
loop: $props.loop,
style: { "display": "none" }
}, null, 8, ["loop"]),
vue.createVNode("div", _hoisted_1$1, [
vue.createVNode("div", {
style: "background-image: url(" + _ctx.$getRealPath($props.poster) + ");",
class: "uni-audio-left"
}, [
vue.createVNode("div", {
class: [{ play: !$data.playing, pause: $data.playing }, "uni-audio-button"],
onClick: _cache[1] || (_cache[1] = (...args) => $options.trigger && $options.trigger(...args))
}, null, 2)
], 4),
vue.createVNode("div", _hoisted_2$1, [
vue.createVNode("div", _hoisted_3$1, vue.toDisplayString($data.currentTime), 1),
vue.createVNode("div", _hoisted_4$1, [
vue.createVNode("div", _hoisted_5, vue.toDisplayString($props.name), 1),
vue.createVNode("div", _hoisted_6, vue.toDisplayString($props.author), 1)
])
])
])
], 16, ["id", "controls"]);
}
_sfc_main$1.render = _sfc_render$1;
let i18n;
function useI18n() {
if (!i18n) {
......@@ -2914,6 +2692,34 @@ function useImageSize(rootRef, props2, state) {
resetSize
};
}
function throttle(fn, wait) {
let last = 0;
let timeout;
let waitCallback;
const newFn = function(...arg) {
const now = Date.now();
clearTimeout(timeout);
waitCallback = () => {
waitCallback = null;
last = now;
fn.apply(this, arg);
};
if (now - last < wait) {
timeout = setTimeout(waitCallback, wait - (now - last));
return;
}
waitCallback();
};
newFn.cancel = function() {
clearTimeout(timeout);
waitCallback = null;
};
newFn.flush = function() {
clearTimeout(timeout);
waitCallback && waitCallback();
};
return newFn;
}
uniShared.passive(true);
function useUserAction() {
const state = vue.reactive({
......@@ -10876,7 +10682,6 @@ var index = /* @__PURE__ */ defineSystemComponent({
});
exports.AsyncErrorComponent = index$1;
exports.AsyncLoadingComponent = index;
exports.Audio = _sfc_main$1;
exports.Button = index$w;
exports.Canvas = index$v;
exports.Checkbox = index$t;
......
import { isFunction, extend, isString, hyphenate, isPlainObject, isArray, hasOwn, isObject, capitalize, toRawType, makeMap as makeMap$1, isPromise, invokeArrayFns as invokeArrayFns$1 } from "@vue/shared";
import { withModifiers, createVNode, getCurrentInstance, defineComponent, ref, provide, computed, watch, onUnmounted, inject, onBeforeUnmount, mergeProps, reactive, onActivated, onMounted, nextTick, onBeforeMount, withDirectives, vShow, shallowRef, watchEffect, isVNode, Fragment, markRaw, createTextVNode, injectHook, onBeforeActivate, onBeforeDeactivate, openBlock, createBlock, renderList, onDeactivated, createApp, Transition, withCtx, KeepAlive, resolveDynamicComponent, renderSlot } from "vue";
import { once, passive, initCustomDataset, invokeArrayFns, normalizeTarget, isBuiltInComponent, ON_RESIZE, ON_APP_ENTER_FOREGROUND, ON_APP_ENTER_BACKGROUND, ON_SHOW, ON_HIDE, ON_PAGE_SCROLL, ON_REACH_BOTTOM, EventChannel, SCHEME_RE, DATA_RE, getCustomDataset, ON_ERROR, callOptions, PRIMARY_COLOR, removeLeadingSlash, getLen, debounce, NAVBAR_HEIGHT, parseQuery, ON_UNLOAD, ON_REACH_BOTTOM_DISTANCE, decodedQuery, WEB_INVOKE_APPSERVICE, ON_WEB_INVOKE_APP_SERVICE, updateElementStyle, ON_BACK_PRESS, parseUrl, addFont, scrollTo, RESPONSIVE_MIN_WIDTH, formatDateTime, ON_PULL_DOWN_REFRESH } from "@dcloudio/uni-shared";
import { openBlock, createBlock, mergeProps, createVNode, toDisplayString, withModifiers, getCurrentInstance, defineComponent, ref, provide, computed, watch, onUnmounted, inject, onBeforeUnmount, reactive, onActivated, onMounted, nextTick, onBeforeMount, withDirectives, vShow, shallowRef, watchEffect, isVNode, Fragment, markRaw, createTextVNode, injectHook, onBeforeActivate, onBeforeDeactivate, renderList, onDeactivated, createApp, Transition, withCtx, KeepAlive, resolveDynamicComponent, renderSlot } from "vue";
import { initVueI18n, LOCALE_EN, LOCALE_ES, LOCALE_FR, LOCALE_ZH_HANS, LOCALE_ZH_HANT } from "@dcloudio/uni-i18n";
import { extend, isString, hyphenate, isPlainObject, isFunction, isArray, hasOwn, isObject, capitalize, toRawType, makeMap as makeMap$1, isPromise, invokeArrayFns as invokeArrayFns$1 } from "@vue/shared";
import { useRoute, createRouter, createWebHistory, createWebHashHistory, useRouter, isNavigationFailure, RouterView } from "vue-router";
var subscriber = {
mounted() {
this._toggleListeners("subscribe", this.id);
this.$watch("id", (newId, oldId) => {
this._toggleListeners("unsubscribe", oldId, true);
this._toggleListeners("subscribe", newId, true);
});
},
beforeDestroy() {
this._toggleListeners("unsubscribe", this.id);
if (this._contextId) {
this._toggleListeners("unsubscribe", this._contextId);
}
},
methods: {
_toggleListeners(type, id2, watch2) {
if (watch2 && !id2) {
return;
}
if (!isFunction(this._handleSubscribe)) {
return;
}
UniViewJSBridge[type](this.$page.id + "-" + this.$options.name.replace(/VUni([A-Z])/, "$1").toLowerCase() + "-" + id2, this._handleSubscribe);
},
_getContextInfo() {
const id2 = `context-${this._uid}`;
if (!this._contextId) {
this._toggleListeners("subscribe", id2);
this._contextId = id2;
}
return {
name: this.$options.name.replace(/VUni([A-Z])/, "$1").toLowerCase(),
id: id2,
page: this.$page.id
};
}
}
};
function throttle(fn, wait) {
let last = 0;
let timeout;
let waitCallback;
const newFn = function(...arg) {
const now = Date.now();
clearTimeout(timeout);
waitCallback = () => {
waitCallback = null;
last = now;
fn.apply(this, arg);
};
if (now - last < wait) {
timeout = setTimeout(waitCallback, wait - (now - last));
return;
}
waitCallback();
};
newFn.cancel = function() {
clearTimeout(timeout);
waitCallback = null;
};
newFn.flush = function() {
clearTimeout(timeout);
waitCallback && waitCallback();
};
return newFn;
}
const _sfc_main$1 = {
name: "Audio",
mixins: [subscriber],
props: {
id: {
type: String,
default: ""
},
src: {
type: String,
default: ""
},
loop: {
type: [Boolean, String],
default: false
},
controls: {
type: [Boolean, String],
default: false
},
poster: {
type: String,
default: ""
},
name: {
type: String,
default: ""
},
author: {
type: String,
default: ""
}
},
data() {
return {
playing: false,
currentTime: this.getTime(0)
};
},
watch: {
src(val) {
if (this.$refs.audio) {
this.$refs.audio.src = this.$getRealPath(val);
}
}
},
mounted() {
const audio = this.$refs.audio;
audio.addEventListener("error", ($event) => {
this.playing = false;
this.$trigger("error", $event, {});
});
audio.addEventListener("play", ($event) => {
this.playing = true;
this.$trigger("play", $event, {});
});
audio.addEventListener("pause", ($event) => {
this.playing = false;
this.$trigger("pause", $event, {});
});
audio.addEventListener("ended", ($event) => {
this.playing = false;
this.$trigger("ended", $event, {});
});
audio.addEventListener("timeupdate", ($event) => {
var currentTime = audio.currentTime;
this.currentTime = this.getTime(currentTime);
var duration = audio.duration;
this.$trigger("timeupdate", $event, {
currentTime,
duration
});
});
audio.src = this.$getRealPath(this.src);
},
methods: {
_handleSubscribe({
type,
data = {}
}) {
var audio = this.$refs.audio;
switch (type) {
case "setSrc":
audio.src = this.$getRealPath(data.src);
this.$emit("update:src", data.src);
break;
case "play":
audio.play();
break;
case "pause":
audio.pause();
break;
case "seek":
audio.currentTime = data.position;
break;
}
},
trigger() {
if (this.playing) {
this.$refs.audio.pause();
} else {
this.$refs.audio.play();
}
},
getTime(time) {
var h = Math.floor(time / 3600);
var m = Math.floor(time % 3600 / 60);
var s = Math.floor(time % 3600 % 60);
h = (h < 10 ? "0" : "") + h;
m = (m < 10 ? "0" : "") + m;
s = (s < 10 ? "0" : "") + s;
var str = m + ":" + s;
if (h !== "00") {
str = h + ":" + str;
}
return str;
}
}
};
const _hoisted_1$1 = { class: "uni-audio-default" };
const _hoisted_2$1 = { class: "uni-audio-right" };
const _hoisted_3$1 = { class: "uni-audio-time" };
const _hoisted_4$1 = { class: "uni-audio-info" };
const _hoisted_5 = { class: "uni-audio-name" };
const _hoisted_6 = { class: "uni-audio-author" };
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createBlock("uni-audio", mergeProps({
id: $props.id,
controls: !!$props.controls
}, _ctx.$attrs), [
createVNode("audio", {
ref: "audio",
loop: $props.loop,
style: { "display": "none" }
}, null, 8, ["loop"]),
createVNode("div", _hoisted_1$1, [
createVNode("div", {
style: "background-image: url(" + _ctx.$getRealPath($props.poster) + ");",
class: "uni-audio-left"
}, [
createVNode("div", {
class: [{ play: !$data.playing, pause: $data.playing }, "uni-audio-button"],
onClick: _cache[1] || (_cache[1] = (...args) => $options.trigger && $options.trigger(...args))
}, null, 2)
], 4),
createVNode("div", _hoisted_2$1, [
createVNode("div", _hoisted_3$1, toDisplayString($data.currentTime), 1),
createVNode("div", _hoisted_4$1, [
createVNode("div", _hoisted_5, toDisplayString($props.name), 1),
createVNode("div", _hoisted_6, toDisplayString($props.author), 1)
])
])
])
], 16, ["id", "controls"]);
}
_sfc_main$1.render = _sfc_render$1;
let i18n;
function useI18n() {
if (!i18n) {
......@@ -786,7 +564,7 @@ var safeAreaInsets = {
onChange,
offChange
};
var out = safeAreaInsets;
var D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out = safeAreaInsets;
const onEventPrevent = /* @__PURE__ */ withModifiers(() => {
}, ["prevent"]);
const onEventStop = /* @__PURE__ */ withModifiers(() => {
......@@ -798,10 +576,10 @@ function getWindowOffset() {
const left = parseInt(style.getPropertyValue("--window-left"));
const right = parseInt(style.getPropertyValue("--window-right"));
return {
top: top ? top + out.top : 0,
bottom: bottom ? bottom + out.bottom : 0,
left: left ? left + out.left : 0,
right: right ? right + out.right : 0
top: top ? top + D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.top : 0,
bottom: bottom ? bottom + D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.bottom : 0,
left: left ? left + D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.left : 0,
right: right ? right + D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.right : 0
};
}
function updateCssVar(cssVars) {
......@@ -7945,6 +7723,34 @@ function useImageSize(rootRef, props2, state2) {
resetSize
};
}
function throttle(fn, wait) {
let last = 0;
let timeout;
let waitCallback;
const newFn = function(...arg) {
const now = Date.now();
clearTimeout(timeout);
waitCallback = () => {
waitCallback = null;
last = now;
fn.apply(this, arg);
};
if (now - last < wait) {
timeout = setTimeout(waitCallback, wait - (now - last));
return;
}
waitCallback();
};
newFn.cancel = function() {
clearTimeout(timeout);
waitCallback = null;
};
newFn.flush = function() {
clearTimeout(timeout);
waitCallback && waitCallback();
};
return newFn;
}
const passiveOptions$1 = passive(true);
const states = [];
let userInteract = 0;
......@@ -13350,7 +13156,7 @@ function normalizePageMeta(pageMeta) {
}, pageMeta.pullToRefresh));
const { type, style } = navigationBar;
if (style !== "custom" && type !== "transparent") {
pullToRefresh.offset += NAVBAR_HEIGHT + out.top;
pullToRefresh.offset += NAVBAR_HEIGHT + D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.top;
}
pageMeta.pullToRefresh = pullToRefresh;
}
......@@ -15548,7 +15354,7 @@ const getSystemInfoSync = /* @__PURE__ */ defineSyncApi("getSystemInfoSync", ()
const windowWidth = getWindowWidth(screenWidth);
let windowHeight = window.innerHeight;
const language = navigator.language;
const statusBarHeight = out.top;
const statusBarHeight = D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.top;
let osname;
let osversion;
let model;
......@@ -15661,12 +15467,12 @@ const getSystemInfoSync = /* @__PURE__ */ defineSyncApi("getSystemInfoSync", ()
const system = `${osname} ${osversion}`;
const platform = osname.toLocaleLowerCase();
const safeArea = {
left: out.left,
right: windowWidth - out.right,
top: out.top,
bottom: windowHeight - out.bottom,
width: windowWidth - out.left - out.right,
height: windowHeight - out.top - out.bottom
left: D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.left,
right: windowWidth - D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.right,
top: D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.top,
bottom: windowHeight - D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.bottom,
width: windowWidth - D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.left - D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.right,
height: windowHeight - D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.top - D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.bottom
};
const { top: windowTop, bottom: windowBottom } = getWindowOffset();
windowHeight -= windowTop;
......@@ -15686,10 +15492,10 @@ const getSystemInfoSync = /* @__PURE__ */ defineSyncApi("getSystemInfoSync", ()
model,
safeArea,
safeAreaInsets: {
top: out.top,
right: out.right,
bottom: out.bottom,
left: out.left
top: D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.top,
right: D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.right,
bottom: D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.bottom,
left: D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.left
}
};
});
......@@ -21286,4 +21092,4 @@ var index = /* @__PURE__ */ defineSystemComponent({
return openBlock(), createBlock("div", clazz, [loadingVNode]);
}
});
export { $emit, $off, $on, $once, index$1 as AsyncErrorComponent, index as AsyncLoadingComponent, _sfc_main$1 as Audio, index$s as Button, index$q as Canvas, index$o as Checkbox, index$p as CheckboxGroup, index$4 as CoverImage, index$5 as CoverView, index$n as Editor, index$u as Form, index$m as Icon, index$l as Image, Input, index$t as Label, LayoutComponent, Map$1 as Map, MovableArea, MovableView, index$k as Navigator, index$2 as PageComponent, index$3 as Picker, PickerView, PickerViewColumn, index$j as Progress, index$h as Radio, index$i as RadioGroup, ResizeSensor, index$g as RichText, ScrollView, index$f as Slider, Swiper, SwiperItem, index$e as Switch, index$d as Text, index$c as Textarea, UniServiceJSBridge$1 as UniServiceJSBridge, UniViewJSBridge$1 as UniViewJSBridge, index$8 as Video, index$b as View, index$7 as WebView, addInterceptor, addPhoneContact, arrayBufferToBase64, base64ToArrayBuffer, canIUse, canvasGetImageData, canvasPutImageData, canvasToTempFilePath, chooseFile, chooseImage, chooseLocation, chooseVideo, clearStorage, clearStorageSync, closeSocket, connectSocket, createAnimation$1 as createAnimation, createCameraContext, createCanvasContext, createInnerAudioContext, createIntersectionObserver, createLivePlayerContext, createMapContext, createMediaQueryObserver, createSelectorQuery, createVideoContext, cssBackdropFilter, cssConstant, cssEnv, cssVar, downloadFile, getApp$1 as getApp, getCurrentPages$1 as getCurrentPages, getFileInfo, getImageInfo, getLeftWindowStyle, getLocation, getNetworkType, getProvider, getRealPath, getRecorderManager, getRightWindowStyle, getSavedFileInfo, getSavedFileList, getScreenBrightness, getSelectedTextRange$1 as getSelectedTextRange, getStorage, getStorageInfo, getStorageInfoSync, getStorageSync, getSystemInfo, getSystemInfoSync, getTopWindowStyle, getVideoInfo, hideKeyboard, hideLeftWindow, hideLoading, hideNavigationBarLoading, hideRightWindow, hideTabBar, hideTabBarRedDot, hideToast, hideTopWindow, loadFontFace, login, makePhoneCall, navigateBack, navigateTo, offAccelerometerChange, offCompassChange, offNetworkStatusChange, offWindowResize, onAccelerometerChange, onCompassChange, onGyroscopeChange, onMemoryWarning, onNetworkStatusChange, onSocketClose, onSocketError, onSocketMessage, onSocketOpen, onTabBarMidButtonTap, onUserCaptureScreen, onWindowResize, openDocument, openLocation, pageScrollTo, index$9 as plugin, preloadPage, previewImage, promiseInterceptor, reLaunch, redirectTo, removeInterceptor, removeSavedFileInfo, removeStorage, removeStorageSync, removeTabBarBadge, request, saveFile, saveImageToPhotosAlbum, saveVideoToPhotosAlbum, scanCode, sendSocketMessage, setKeepScreenOn, setLeftWindowStyle, setNavigationBarColor, setNavigationBarTitle, setRightWindowStyle, setScreenBrightness, setStorage, setStorageSync, setTabBarBadge, setTabBarItem, setTabBarStyle, setTopWindowStyle, setupApp, setupPage, setupWindow, showActionSheet, showLeftWindow, showLoading, showModal, showNavigationBarLoading, showRightWindow, showTabBar, showTabBarRedDot, showToast, showTopWindow, startAccelerometer, startCompass, startGyroscope, startPullDownRefresh, stopAccelerometer, stopCompass, stopGyroscope, stopPullDownRefresh, switchTab, uni$1 as uni, uploadFile, upx2px, useTabBar, vibrateLong, vibrateShort };
export { $emit, $off, $on, $once, index$1 as AsyncErrorComponent, index as AsyncLoadingComponent, index$s as Button, index$q as Canvas, index$o as Checkbox, index$p as CheckboxGroup, index$4 as CoverImage, index$5 as CoverView, index$n as Editor, index$u as Form, index$m as Icon, index$l as Image, Input, index$t as Label, LayoutComponent, Map$1 as Map, MovableArea, MovableView, index$k as Navigator, index$2 as PageComponent, index$3 as Picker, PickerView, PickerViewColumn, index$j as Progress, index$h as Radio, index$i as RadioGroup, ResizeSensor, index$g as RichText, ScrollView, index$f as Slider, Swiper, SwiperItem, index$e as Switch, index$d as Text, index$c as Textarea, UniServiceJSBridge$1 as UniServiceJSBridge, UniViewJSBridge$1 as UniViewJSBridge, index$8 as Video, index$b as View, index$7 as WebView, addInterceptor, addPhoneContact, arrayBufferToBase64, base64ToArrayBuffer, canIUse, canvasGetImageData, canvasPutImageData, canvasToTempFilePath, chooseFile, chooseImage, chooseLocation, chooseVideo, clearStorage, clearStorageSync, closeSocket, connectSocket, createAnimation$1 as createAnimation, createCameraContext, createCanvasContext, createInnerAudioContext, createIntersectionObserver, createLivePlayerContext, createMapContext, createMediaQueryObserver, createSelectorQuery, createVideoContext, cssBackdropFilter, cssConstant, cssEnv, cssVar, downloadFile, getApp$1 as getApp, getCurrentPages$1 as getCurrentPages, getFileInfo, getImageInfo, getLeftWindowStyle, getLocation, getNetworkType, getProvider, getRealPath, getRecorderManager, getRightWindowStyle, getSavedFileInfo, getSavedFileList, getScreenBrightness, getSelectedTextRange$1 as getSelectedTextRange, getStorage, getStorageInfo, getStorageInfoSync, getStorageSync, getSystemInfo, getSystemInfoSync, getTopWindowStyle, getVideoInfo, hideKeyboard, hideLeftWindow, hideLoading, hideNavigationBarLoading, hideRightWindow, hideTabBar, hideTabBarRedDot, hideToast, hideTopWindow, loadFontFace, login, makePhoneCall, navigateBack, navigateTo, offAccelerometerChange, offCompassChange, offNetworkStatusChange, offWindowResize, onAccelerometerChange, onCompassChange, onGyroscopeChange, onMemoryWarning, onNetworkStatusChange, onSocketClose, onSocketError, onSocketMessage, onSocketOpen, onTabBarMidButtonTap, onUserCaptureScreen, onWindowResize, openDocument, openLocation, pageScrollTo, index$9 as plugin, preloadPage, previewImage, promiseInterceptor, reLaunch, redirectTo, removeInterceptor, removeSavedFileInfo, removeStorage, removeStorageSync, removeTabBarBadge, request, saveFile, saveImageToPhotosAlbum, saveVideoToPhotosAlbum, scanCode, sendSocketMessage, setKeepScreenOn, setLeftWindowStyle, setNavigationBarColor, setNavigationBarTitle, setRightWindowStyle, setScreenBrightness, setStorage, setStorageSync, setTabBarBadge, setTabBarItem, setTabBarStyle, setTopWindowStyle, setupApp, setupPage, setupWindow, showActionSheet, showLeftWindow, showLoading, showModal, showNavigationBarLoading, showRightWindow, showTabBar, showTabBarRedDot, showToast, showTopWindow, startAccelerometer, startCompass, startGyroscope, startPullDownRefresh, stopAccelerometer, stopCompass, stopGyroscope, stopPullDownRefresh, switchTab, uni$1 as uni, uploadFile, upx2px, useTabBar, vibrateLong, vibrateShort };
export {
Audio,
Button,
Canvas,
Checkbox,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册