Commit e0ff3e4f by 李伟康

fix(equity): 提单成功后延迟显示合同预览弹窗并增加loading提示

在提单成功后,为提升用户体验,增加 loading 提示,并将合同预览弹窗的展示延迟 1.5 秒,
以确保接口请求和数据处理完成后再进行页面跳转与弹窗显示。
1 parent 15785f69
...@@ -591,38 +591,44 @@ export default { ...@@ -591,38 +591,44 @@ 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!