{ 'title':'layui 表单提交后弹出两个弹框的解决方法', 'description':'本文介绍了在 layui 表单提交后弹出两个弹框的原因以及解决方法。通过将第一个弹框的代码移动到第二个弹框的条件判断语句内部,可以避免出现两个弹框同时出现的情况。', 'keywords':'layui, 表单提交, 弹框, 解决方法, 两个弹框, 条件判断', 'content':''<button type='button' lay-submit='' lay-filter='costButton' id='costButton'\n class='layui-btn calculate-button' style=''>计算\n form.on('submit(costButton)', function (data) {\n if (table.cache.costEstimatesMFNRate.length === 0\n || table.cache.costEstimatesOptimalRate.length === 0) {\n layer.open({\n title: '温馨提示',\n type: 1,\n area: ['35%', '40%'], //宽高\n content: '

\n' + ' <div style='display: flex;justify-content: center;align-items: center;padding: 50px'>\n' + '
\n' + ' <img src='/images/intelligentInquiry/100.png' alt=''>\n'
\n' + ' <div style='font-size: 18px;color: #ff761b;padding: 20px'>请先完成最优税率测算
再来预估成本哦~
\n'
\n' + ' <div style='display: flex;justify-content: center;align-items: center;'>\n' + ' <a href='javascript:toTaxCalculator()'>\n' + ' <div class='calculate-btn'>最优税费测算
\n' \n'
\n' + '
'', success: function(layero, index){ if (checkedData === '') { layer.msg('请选择一般贸易税率后点击查询'); layer.close(index); return; } } }); return; } if (checkedData === '') { layer.msg('请选择一般贸易税率后点击查询'); return; }});'}

layui 表单提交后弹出两个弹框的解决方法

原文地址: https://www.cveoy.top/t/topic/qkMd 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录