Commit 87b807a5 by 李伟康

feat(equity): 提单成功后显示加载提示并延迟打开通知弹窗

在提单成功后,新增显示 loading 提示,并延时 1500ms 后再打开通知弹窗,优化用户体验。
同时确保合同预览跳转逻辑在弹窗关闭后正确执行。
1 parent 8e53cf5f
...@@ -619,38 +619,43 @@ export default { ...@@ -619,38 +619,43 @@ export default {
this.$emit('jump', 'EquityManagement') this.$emit('jump', 'EquityManagement')
}, 1500) }, 1500)
} else { } else {
// 从URL获取文件名 uni.showLoading({
const getFileNameFromUrl = (url) => { mask: true
return url.split('/').pop().split('?')[0] || '未知文件' })
} setTimeout(async () => {
const { contractNo } = params, // 从URL获取文件名
url = await uni.$api.equityApi.printContract({ contractNo }), const getFileNameFromUrl = (url) => {
fileName = getFileNameFromUrl(url), return url.split('/').pop().split('?')[0] || '未知文件'
type = 3 }
if (!url) throw '获取合同失败' const { contractNo } = params,
this.noticeObj = { url = await uni.$api.equityApi.printContract({ contractNo }),
title: '提单成功', fileName = getFileNameFromUrl(url),
text: '提单合同支持分享或保存', type = 3
type: 'success', if (!url) throw '获取合同失败'
buttons: [ this.noticeObj = {
{ title: '提单成功',
text: '查看合同', text: '提单合同支持分享或保存',
type: 'primary', type: 'success',
callback: _ => { buttons: [
this.$refs.reportNotice.close() {
this.$emit('jump', 'EquityManagement') text: '查看合同',
// 跳转到预览页面 type: 'primary',
uni.navigateTo({ callback: _ => {
url: `/pages/common/filePreview?fileUrl=${encodeURIComponent(url)}&fileType=${type}&fileName=${encodeURIComponent(fileName)}` this.$refs.reportNotice.close()
}) this.$emit('jump', 'EquityManagement')
// 跳转到预览页面
uni.navigateTo({
url: `/pages/common/filePreview?fileUrl=${encodeURIComponent(url)}&fileType=${type}&fileName=${encodeURIComponent(fileName)}`
})
}
} }
} ]
] }
} setTimeout(() => {
setTimeout(() => { uni.hideLoading()
uni.hideLoading() this.$refs.reportNotice.open()
this.$refs.reportNotice.open() }, 100)
}, 100) }, 1500)
} }
} else throw message } else throw message
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!