Merge pull request 'zdg_dev' (#236) from zdg_dev into main
Reviewed-on: #236
This commit is contained in:
commit
38227cc282
|
@ -80,6 +80,7 @@ provide(injectKeySlideScale, scale)
|
|||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
.slide-item {
|
||||
position: absolute;
|
||||
|
|
|
@ -198,7 +198,7 @@ export default (isLoader?: boolean = true) => {
|
|||
const touchInfo = ref<{ x: number; y: number; } | null>(null)
|
||||
|
||||
const touchStartListener = (e: TouchEvent) => {
|
||||
e.preventDefault() // 阻止默认事件
|
||||
// e.preventDefault() // 阻止默认事件
|
||||
touchInfo.value = {
|
||||
// x: e.changedTouches[0].pageX,
|
||||
// y: e.changedTouches[0].pageY,
|
||||
|
@ -208,6 +208,7 @@ export default (isLoader?: boolean = true) => {
|
|||
}
|
||||
const touchEndListener = (e: TouchEvent) => {
|
||||
if (!touchInfo.value) return
|
||||
// window.scrollTo(0, 0) // 滚动到顶部
|
||||
const offsetX = Math.abs(touchInfo.value.x - e.changedTouches[0].clientX)
|
||||
const offsetY = e.changedTouches[0].clientY - touchInfo.value.y
|
||||
if ( Math.abs(offsetY) > offsetX && Math.abs(offsetY) > 50 ) {
|
||||
|
|
|
@ -438,17 +438,23 @@ const toRousrceUrl = async (o) => {
|
|||
if (!!o.src) { // 如果有src就转换
|
||||
const isBase64 = /^data:image\/(\w+);base64,/.test(o.src)
|
||||
const isBlobUrl = /^blob:/.test(o.src)
|
||||
let onLineUrl = '' // 线上地址
|
||||
if (!!o.zipPath) onLineUrl = pptMedia[o.zipPath] || '' // 是否已上传过
|
||||
let onLineUrl = '', typeExt = '' // 线上地址|文件后缀
|
||||
if (!!o.zipPath) {
|
||||
onLineUrl = pptMedia[o.zipPath] || '' // 是否已上传过
|
||||
typeExt = o.zipPath.split('.').pop()
|
||||
}
|
||||
if (onLineUrl) o.src = onLineUrl // 已存在线上地址直接赋值
|
||||
else { // 不存在重新上传
|
||||
if (isBase64) { // 相同资源处理
|
||||
const url = await getOnlineFileUrl(o.src)
|
||||
if(!typeExt) typeExt = 'png'
|
||||
const url = await getOnlineFileUrl(o.src, typeExt)
|
||||
url &&(o.src = url)
|
||||
url && o.zipPath && (pptMedia[o.zipPath] = url) // 缓存
|
||||
} else if (isBlobUrl) { // 视频和音频
|
||||
if(!typeExt) typeExt = o.type=='video'?'mp4':'mp3'
|
||||
const res = await fetch(o.src)
|
||||
const blob = await res.blob()
|
||||
const url = await getOnlineFileUrl(blob, o.type=='video'?'mp4':'mp3')
|
||||
const url = await getOnlineFileUrl(blob, typeExt)
|
||||
URL.revokeObjectURL(o.src) // 释放内存
|
||||
url &&(o.src = url)
|
||||
url && o.zipPath && (pptMedia[o.zipPath] = url) // 缓存
|
||||
|
|
|
@ -653,17 +653,23 @@ export default {
|
|||
if (!!o.src) { // 如果有src就转换
|
||||
const isBase64 = /^data:image\/(\w+);base64,/.test(o.src)
|
||||
const isBlobUrl = /^blob:/.test(o.src)
|
||||
let onLineUrl = '' // 线上地址
|
||||
if (!!o.zipPath) onLineUrl = this.pptMedia[o.zipPath] || '' // 是否已上传过
|
||||
let onLineUrl = '', typeExt = '' // 线上地址|文件后缀
|
||||
if (!!o.zipPath) {
|
||||
onLineUrl = this.pptMedia[o.zipPath] || '' // 是否已上传过
|
||||
typeExt = o.zipPath.split('.').pop()
|
||||
}
|
||||
if (onLineUrl) o.src = onLineUrl // 已存在线上地址直接赋值
|
||||
else { // 不存在重新上传
|
||||
if (isBase64) { // 相同资源处理
|
||||
const url = await this.getOnlineFileUrl(o.src)
|
||||
if(!typeExt) typeExt = 'png'
|
||||
const url = await this.getOnlineFileUrl(o.src, typeExt)
|
||||
url &&(o.src = url)
|
||||
url && o.zipPath && (this.pptMedia[o.zipPath] = url) // 缓存
|
||||
} else if (isBlobUrl) { // 视频和音频
|
||||
if(!typeExt) typeExt = o.type=='video'?'mp4':'mp3'
|
||||
const res = await fetch(o.src)
|
||||
const blob = await res.blob()
|
||||
const url = await this.getOnlineFileUrl(blob, o.type=='video'?'mp4':'mp3')
|
||||
const url = await this.getOnlineFileUrl(blob, typeExt)
|
||||
URL.revokeObjectURL(o.src) // 释放内存
|
||||
url &&(o.src = url)
|
||||
url && o.zipPath && (this.pptMedia[o.zipPath] = url) // 缓存
|
||||
|
|
Loading…
Reference in New Issue