feat: 视频保存
This commit is contained in:
@@ -124,8 +124,11 @@
|
||||
const currentOrigin = ref("sketch")
|
||||
const coverOrigin = ref([])
|
||||
const handleChangeOrigin = (type) => {
|
||||
const targetOrigin = coverOrigin.value.find((el) => el.type === type)
|
||||
if (!targetOrigin) return
|
||||
|
||||
currentOrigin.value = type
|
||||
data.url = coverOrigin.value.filter((el) => el.type === type)[0].url
|
||||
data.url = targetOrigin.url
|
||||
}
|
||||
|
||||
const show = ref(false)
|
||||
@@ -136,7 +139,7 @@
|
||||
|
||||
coverOrigin.value = []
|
||||
data.url = null
|
||||
currentOrigin.value = 'sketch'
|
||||
currentOrigin.value = "sketch"
|
||||
|
||||
data.url = url
|
||||
data.callback = callback
|
||||
@@ -148,9 +151,11 @@
|
||||
if (options.hasOwnProperty("isPreview")) data.isPreview = options.isPreview
|
||||
data.isProduct = options.isProduct
|
||||
}
|
||||
if (origin?.length && !data.url) {
|
||||
if (origin?.length) {
|
||||
coverOrigin.value = origin
|
||||
data.url = origin[0].url
|
||||
const defaultOrigin = origin.find((el) => el.type === options?.coverFrom) || origin[0]
|
||||
currentOrigin.value = defaultOrigin.type
|
||||
data.url = defaultOrigin.url
|
||||
}
|
||||
show.value = true
|
||||
}
|
||||
@@ -160,7 +165,7 @@
|
||||
const imageClipRef = ref(null)
|
||||
const onSubmit = () => {
|
||||
imageClipRef.value.getCropBlob().then((blob) => {
|
||||
if (data.callback) data.callback(blobToFile(blob, "image.png"))
|
||||
if (data.callback) data.callback(blobToFile(blob, "image.png"), currentOrigin.value)
|
||||
onCancel()
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user