Browse Source

修改英文标题校验、生成大纲按钮

master
zq 2 months ago
parent
commit
391d6f97ba
  1. 17
      home.html
  2. 37
      style/css/index.css
  3. 26
      style/js/index.js

17
home.html

@ -184,6 +184,7 @@
<div class="oneRight opt-advise"> <div class="oneRight opt-advise">
<img src="{$priv_style}/img/input_icon.svg" alt=""> <img src="{$priv_style}/img/input_icon.svg" alt="">
<input type="text" class="inputChange " placeholder="输入完整的论文标题,获得更好的生成效果"> <input type="text" class="inputChange " placeholder="输入完整的论文标题,获得更好的生成效果">
<p id="errorText"></p>
<div class="total_length"> <div class="total_length">
<span class="inputText" max="100" min="1">0/100</span> <span class="inputText" max="100" min="1">0/100</span>
</div> </div>
@ -396,10 +397,14 @@
</div> </div>
</form> </form>
<div class="flex btnWrap"> <div class="flex btnWrap">
<button class="btn_mast point" >立即生成正文</button>
<button class="btn_result_now point" id="formInputSumbtn">立即生成</button> <button class="btn_result_now point" id="formInputSumbtn">立即生成</button>
<button class="btn_result point" >先生成论文大纲</button> <div class="btn_group1">
<button class="btn_result point" >免费生成大纲</button>
<div class="btn_group2 flex">
想直接生成完整论文?&nbsp;
<span class="btn_mast point" >点击这里一键生成</span>
</div>
</div>
</div> </div>
<div class="checkbox_wrap"> <div class="checkbox_wrap">
<p class="active agree-item">我已阅读并同意:生成的论文范文仅用于参考,不作为毕业论文使用</p> <p class="active agree-item">我已阅读并同意:生成的论文范文仅用于参考,不作为毕业论文使用</p>
@ -818,6 +823,10 @@
alert('请输入标题'); alert('请输入标题');
return false; return false;
} }
if ($('.oneRight').hasClass('error')) {
alert('标题格式错误');
return false;
}
var title_min_limit = 1; var title_min_limit = 1;
if (title.length < title_min_limit) { if (title.length < title_min_limit) {
alert('标题不能少于' + title_min_limit + '字'); alert('标题不能少于' + title_min_limit + '字');
@ -1104,7 +1113,7 @@
</div> </div>
{$access_stats_code} {$access_stats_code}
<script src="{$priv_style}/js/index.js?v=1020"></script> <script src="{$priv_style}/js/index.js?v=1021"></script>
</body> </body>
</html> </html>

37
style/css/index.css

@ -1076,6 +1076,16 @@ li .select_icon, .pay_every .pay_icon{
padding: 14px 8px 14px 12px; padding: 14px 8px 14px 12px;
border-radius: 6px; border-radius: 6px;
} }
.error{
border-color: #FB533B !important;
}
#errorText{
color: #FB533B;
position: absolute;
bottom: -20px;
font-size: 12px;
right: 0;
}
.oneRight{ .oneRight{
flex: 1; flex: 1;
display: flex; display: flex;
@ -1700,13 +1710,32 @@ li .select_icon, .pay_every .pay_icon{
.tableChart_active div{ .tableChart_active div{
background: url(../img/checked_icon.svg); background: url(../img/checked_icon.svg);
} }
.btn_group1{
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.btn_group2 {
margin-top: 16px;
color: #3B54FD;
}
.btn_group2 span{
font-size: 14px;
font-weight: normal;
line-height: normal;
letter-spacing: normal;
text-decoration: underline;
color: #3B54FD;
}
.btnWrap{ .btnWrap{
justify-content: center; justify-content: center;
} }
.btn_mast ,.btn_result_now{ .btn_result_now{
margin-right: 20px; margin-right: 20px;
} }
.btn_result,.btn_result_now,.downLoad,.btn_result_now2,.btn_mast{ .btn_result,.btn_result_now,.downLoad,.btn_result_now2{
font-family: Microsoft YaHei UI;
width: 200px; width: 200px;
height: 50px; height: 50px;
font-size: 15px; font-size: 15px;
@ -1719,12 +1748,12 @@ li .select_icon, .pay_every .pay_icon{
transition: all .3s ease; transition: all .3s ease;
background: linear-gradient(270deg, #6C69F5 0%, #3467E5 100%); background: linear-gradient(270deg, #6C69F5 0%, #3467E5 100%);
} }
.btn_result:hover, .btn_result_now:hover,.downLoad:hover,.btn_result_now2:hover,.btn_mast:hover{ .btn_result:hover, .btn_result_now:hover,.downLoad:hover,.btn_result_now2:hover{
transition: all .3s ease; transition: all .3s ease;
opacity: 0.8; opacity: 0.8;
background: linear-gradient(270deg, #6C69F5 0%, #3467E5 100%); background: linear-gradient(270deg, #6C69F5 0%, #3467E5 100%);
} }
.btn_result:active,.btn_result_now:active,.downLoad:active,.btn_result_now2:active,.btn_mast:active{ .btn_result:active,.btn_result_now:active,.downLoad:active,.btn_result_now2:active{
transition: all .3s ease; transition: all .3s ease;
opacity: 1; opacity: 1;
background: linear-gradient(270deg, #6C69F5 0%, #3467E5 100%); background: linear-gradient(270deg, #6C69F5 0%, #3467E5 100%);

26
style/js/index.js

@ -343,6 +343,7 @@ $(document).ready(function () {
}) })
function createCatalogue() { function createCatalogue() {
if (!$('.agree-item').hasClass('active')) { if (!$('.agree-item').hasClass('active')) {
alert("请阅读并勾选同意《服务条款》"); alert("请阅读并勾选同意《服务条款》");
return; return;
@ -595,6 +596,18 @@ $(document).ready(function () {
// } // }
//标题输入字数 //标题输入字数
$('.inputChange').on('input', function () { $('.inputChange').on('input', function () {
// 英文增加校验提示
if(check_type =='82'){
const englishRegex = /^[A-Za-z\s]*$/; // 正则表达式,允许字母和空格
const isValid = englishRegex.test($('.inputChange').val());
if (!isValid) {
$('.oneRight').addClass('error')
$('#errorText').html('请输入英文标题');
} else {
$('.oneRight').removeClass('error')
$('#errorText').html(''); // 清空错误信息
}
}
var maxLength = $('.inputText').attr('max'); var maxLength = $('.inputText').attr('max');
var currentLength = $(this).val().length; var currentLength = $(this).val().length;
if (currentLength > 0) { if (currentLength > 0) {
@ -1079,6 +1092,11 @@ $(document).ready(function () {
if ($('li').hasClass('active_select')) { if ($('li').hasClass('active_select')) {
$('li').removeClass('active_select') $('li').removeClass('active_select')
} }
if ($('.oneRight').hasClass('error')) {
$('.oneRight').removeClass('error')
$('#errorText').html(''); // 清空错误信息
}
$(this).addClass('active_select') $(this).addClass('active_select')
var element = $('.step_back'); var element = $('.step_back');
var element2 = $('.footer'); var element2 = $('.footer');
@ -1108,22 +1126,22 @@ $(document).ready(function () {
} }
if (allAiServicesData[check_type]['outline']) { if (allAiServicesData[check_type]['outline']) {
setDomShow(['[step="3"]', '.btn_result', '.step_two', '.btn_mast']) setDomShow(['[step="3"]', '.step_two','.btn_group1'])
setDomHide(['[step="2"]', '.btn_result_now']) setDomHide(['[step="2"]', '.btn_result_now'])
$('.normal_step3').removeClass('step_three') $('.normal_step3').removeClass('step_three')
$('.payModal_main').html('') $('.payModal_main').html('')
$('.pay_complete_main').html(payhtml) $('.pay_complete_main').html(payhtml)
getCurWordsCount() getCurWordsCount()
} else { } else {
setDomHide(['[step="3"]', '.btn_result', '.step_two', '.btn_mast']) setDomHide(['[step="3"]', '.step_two','.btn_group1'])
setDomShow(['[step="2"]', '.btn_result_now']) setDomShow(['[step="2"]', '.btn_result_now'])
$('.normal_step3').addClass('step_three') $('.normal_step3').addClass('step_three')
$('.payModal_main').html(payhtml) $('.payModal_main').html(payhtml)
$('.pay_complete_main').html('') $('.pay_complete_main').html('')
if(t == '97'){ if(t == '97'){
setDomShow(['.btn_result']) setDomShow(['.btn_group1'])
}else{ }else{
setDomHide(['.btn_result']) setDomHide(['.btn_group1'])
} }
} }
if (t == '64') { if (t == '64') {

Loading…
Cancel
Save