Commit 8cf13b20 by liangjianmin

feat: 优化获取合同信息逻辑,简化按钮状态管理,提升用户体验

parent 312794d8
Showing with 9 additions and 11 deletions
......@@ -438,17 +438,14 @@ export default {
this.contract_id = contractItem.contractId;
this.disabled = true; // 重置按钮状态
this.signDialogVisible = true;
// 等待DOM更新后检查初始滚动状态
this.$nextTick(() => {
var contractContent = this.$refs.contractContent;
if (contractContent) {
// 如果内容高度小于等于容器高度,直接启用按钮
if (contractContent.scrollHeight <= contractContent.clientHeight) {
this.disabled = false;
}
//获取合同信息
this.$http('POST', "/api/purContract/getContractInfo", { contract_id: this.contract_id }).then(res => {
if (res.code === 0) {
this.signContractData = res.data;
}
});
})
},
// 关闭签署合同弹窗
closeSignDialog() {
......@@ -477,7 +474,7 @@ export default {
if (!this.disabled) {
return;
}
var contractContent = this.$refs.contractContent;
// 检查是否滚动到底部
if (contractContent.scrollHeight - contractContent.scrollTop === contractContent.clientHeight) {
......@@ -493,6 +490,7 @@ export default {
<style scoped>
@import "../../assets/css/goods/goods.min.css";
@import "../../assets/css/public/contract.css";
.el-button--primary.is-disabled,
.el-button--primary.is-disabled:active,
.el-button--primary.is-disabled:focus,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment