|
|
@@ -244,43 +244,40 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
async down(info){
|
|
|
-
|
|
|
+ let imgUrl = ''
|
|
|
+ let name = ''
|
|
|
await this.$service.order.down({ id:info.id }).then(data => {
|
|
|
-
|
|
|
+ imgUrl = data.url
|
|
|
+ name = data.name
|
|
|
});
|
|
|
-
|
|
|
- const imgUrl = 'https://api.shop.hzghd.com/image.png'
|
|
|
- const response = await fetch(imgUrl)
|
|
|
- const blob = await response.blob()
|
|
|
- // 创建下载链接
|
|
|
- const url = window.URL.createObjectURL(blob)
|
|
|
- const link = document.createElement('a')
|
|
|
- link.href = url
|
|
|
- link.download = 'image.png'
|
|
|
- document.body.appendChild(link)
|
|
|
- link.click()
|
|
|
- document.body.removeChild(link)
|
|
|
- // 释放 Blob URL
|
|
|
- window.URL.revokeObjectURL(url)
|
|
|
+ console.log(imgUrl)
|
|
|
+ const response = await fetch(imgUrl)
|
|
|
+ const blob = await response.blob()
|
|
|
+ const url = window.URL.createObjectURL(blob)
|
|
|
+ const link = document.createElement('a')
|
|
|
+ link.href = url
|
|
|
+ link.download = name
|
|
|
+ document.body.appendChild(link)
|
|
|
+ link.click()
|
|
|
+ document.body.removeChild(link)
|
|
|
+ window.URL.revokeObjectURL(url)
|
|
|
},
|
|
|
async allDown(){
|
|
|
-
|
|
|
+ let imgUrl = ''
|
|
|
+ let name = ''
|
|
|
await this.$service.order.allDown({ id:info.id }).then(data => {
|
|
|
-
|
|
|
+ imgUrl = data.url
|
|
|
+ name = data.name
|
|
|
})
|
|
|
-
|
|
|
- const imgUrl = 'https://api.shop.hzghd.com/image.png'
|
|
|
const response = await fetch(imgUrl)
|
|
|
const blob = await response.blob()
|
|
|
- // 创建下载链接
|
|
|
const url = window.URL.createObjectURL(blob)
|
|
|
const link = document.createElement('a')
|
|
|
link.href = url
|
|
|
- link.download = 'image.png'
|
|
|
+ link.download = name
|
|
|
document.body.appendChild(link)
|
|
|
link.click()
|
|
|
document.body.removeChild(link)
|
|
|
- // 释放 Blob URL
|
|
|
window.URL.revokeObjectURL(url)
|
|
|
},
|
|
|
detailShowFn(item) {
|