|
|
@ -26,7 +26,15 @@ |
|
|
|
<div class="text-gray-400">上传缴费凭证</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<a-upload list-type="picture-card" :file-list="fileList" @preview="handlePreview" @change="handleChange"> |
|
|
|
<a-upload |
|
|
|
list-type="picture-card" |
|
|
|
:action="action" |
|
|
|
:headers="headers" |
|
|
|
name="param" |
|
|
|
:file-list="fileList" |
|
|
|
@preview="handlePreview" |
|
|
|
@change="handleChange" |
|
|
|
> |
|
|
|
<div v-if="fileList.length < 1"> |
|
|
|
<a-icon class="mb-2 text-xl" type="plus" /> |
|
|
|
<div class="ant-upload-text">上传照片</div> |
|
|
@ -67,10 +75,17 @@ export default { |
|
|
|
previewVisible: false, |
|
|
|
previewImage: '', |
|
|
|
fileList: [], |
|
|
|
action: uploadImg, |
|
|
|
}; |
|
|
|
}, |
|
|
|
|
|
|
|
computed: mapState('home', ['projectId', 'userId', 'roleId']), |
|
|
|
computed: { |
|
|
|
...mapState('home', ['projectId', 'userId', 'roleId']), |
|
|
|
headers() { |
|
|
|
const token = sessionStorage.getItem('anyringToken'); |
|
|
|
return { Authorization: `Bearer ${token}` }; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
mounted() { |
|
|
|
this.timer = setInterval(async () => { |
|
|
@ -129,28 +144,27 @@ export default { |
|
|
|
|
|
|
|
handleChange({ fileList }) { |
|
|
|
this.fileList = fileList; |
|
|
|
console.log(this.fileList); |
|
|
|
this.uploadImg(); |
|
|
|
// this.uploadImg(); |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 上传文件 |
|
|
|
*/ |
|
|
|
async uploadImg() { |
|
|
|
try { |
|
|
|
const params = { param: this.fileList[0] }; |
|
|
|
const res = await uploadImg(); |
|
|
|
const { code, msg, data } = res.data; |
|
|
|
if (code === 200) { |
|
|
|
this.fileId = data.fileId; |
|
|
|
} else { |
|
|
|
this.$message.error(msg || '获取失败'); |
|
|
|
throw msg; |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
throw error || '获取失败'; |
|
|
|
} |
|
|
|
}, |
|
|
|
// async uploadImg() { |
|
|
|
// try { |
|
|
|
// const params = { param: this.fileList[0] }; |
|
|
|
// const res = await uploadImg(); |
|
|
|
// const { code, msg, data } = res.data; |
|
|
|
// if (code === 200) { |
|
|
|
// this.fileId = data.fileId; |
|
|
|
// } else { |
|
|
|
// this.$message.error(msg || '获取失败'); |
|
|
|
// throw msg; |
|
|
|
// } |
|
|
|
// } catch (error) { |
|
|
|
// throw error || '获取失败'; |
|
|
|
// } |
|
|
|
// }, |
|
|
|
|
|
|
|
async uploadPay() { |
|
|
|
try { |
|
|
@ -175,15 +189,7 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
back() { |
|
|
|
window.open( |
|
|
|
'https://test.tall.wiki/tall/v3.2.0/#/pages/project-webview/project-webview?u=' + |
|
|
|
this.projectId + |
|
|
|
'&p=' + |
|
|
|
this.userId + |
|
|
|
'&pname=' + |
|
|
|
this.name + |
|
|
|
'&url=https://test.tall.wiki/gateway/sports', |
|
|
|
); |
|
|
|
window.history.back(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|