Commit e0ff3e4f by 李伟康

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

在提单成功后,为提升用户体验,增加 loading 提示,并将合同预览弹窗的展示延迟 1.5 秒,
以确保接口请求和数据处理完成后再进行页面跳转与弹窗显示。
1 parent 15785f69
......@@ -591,38 +591,44 @@ export default {
this.$emit('jump', 'EquityManagement')
}, 1500)
} else {
// 从URL获取文件名
const getFileNameFromUrl = (url) => {
return url.split('/').pop().split('?')[0] || '未知文件'
}
const { contractNo } = params,
url = await uni.$api.equityApi.printContract({ contractNo }),
fileName = getFileNameFromUrl(url),
type = 3
if (!url) throw '获取合同失败'
this.noticeObj = {
title: '提单成功',
text: '提单合同支持分享或保存',
type: 'success',
buttons: [
{
text: '查看合同',
type: 'primary',
callback: _ => {
this.$refs.reportNotice.close()
this.$emit('jump', 'EquityManagement')
// 跳转到预览页面
uni.navigateTo({
url: `/pages/common/filePreview?fileUrl=${encodeURIComponent(url)}&fileType=${type}&fileName=${encodeURIComponent(fileName)}`
})
uni.showLoading({
mask: true
})
setTimeout(async () => {
// 从URL获取文件名
const getFileNameFromUrl = (url) => {
return url.split('/').pop().split('?')[0] || '未知文件'
}
const { contractNo } = params,
url = await uni.$api.equityApi.printContract({ contractNo }),
fileName = getFileNameFromUrl(url),
type = 3
if (!url) throw '获取合同失败'
this.noticeObj = {
title: '提单成功',
text: '提单合同支持分享或保存',
type: 'success',
buttons: [
{
text: '查看合同',
type: 'primary',
callback: _ => {
this.$refs.reportNotice.close()
this.$emit('jump', 'EquityManagement')
// 跳转到预览页面
uni.navigateTo({
url: `/pages/common/filePreview?fileUrl=${encodeURIComponent(url)}&fileType=${type}&fileName=${encodeURIComponent(fileName)}`
})
}
}
}
]
}
setTimeout(() => {
uni.hideLoading()
this.$refs.reportNotice.open()
}, 100)
]
}
setTimeout(() => {
uni.hideLoading()
this.$refs.reportNotice.open()
}, 100)
}, 1500)
}
} else throw message
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!