|
@@ -9,13 +9,11 @@ import { promisefiyPostMessage } from '@/helpers/native-message'
|
|
|
export default defineComponent({
|
|
|
name: 'contactus',
|
|
|
setup(props, ctx) {
|
|
|
- const loading = ref(false)
|
|
|
const users = [
|
|
|
{ name: '客服人员 1', src: kefu1 },
|
|
|
{ name: '客服人员 2', src: kefu2 }
|
|
|
]
|
|
|
const onSaveImg = (src: string) => {
|
|
|
- loading.value = true
|
|
|
fetch(src)
|
|
|
.then(response => response.blob())
|
|
|
.then(res => {
|
|
@@ -24,13 +22,10 @@ export default defineComponent({
|
|
|
fileReader.readAsDataURL(res)
|
|
|
fileReader.onload = async () => {
|
|
|
await download(fileReader.result as string)
|
|
|
- loading.value = false
|
|
|
}
|
|
|
} catch (error) {
|
|
|
- loading.value = false
|
|
|
}
|
|
|
})
|
|
|
- .catch(_ => (loading.value = false))
|
|
|
}
|
|
|
|
|
|
const download = async (base64: string) => {
|
|
@@ -68,7 +63,6 @@ export default defineComponent({
|
|
|
type="primary"
|
|
|
size="small"
|
|
|
onClick={() => onSaveImg(n.src)}
|
|
|
- disabled={loading.value}
|
|
|
>
|
|
|
保存二维码
|
|
|
</Button>
|