Merge pull request 'zdg_dev' (#236) from zdg_dev into main

Reviewed-on: #236
This commit is contained in:
zhengdegang 2025-02-14 16:36:32 +08:00
commit 38227cc282
4 changed files with 23 additions and 9 deletions

View File

@ -80,6 +80,7 @@ provide(injectKeySlideScale, scale)
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
}
.slide-item {
position: absolute;

View File

@ -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 ) {

View File

@ -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) //

View File

@ -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) //