From 5dca485c4cb7c87c7e9ef13ee4bdccf7305645a6 Mon Sep 17 00:00:00 2001 From: zq <136432190602163.com> Date: Fri, 20 Dec 2024 18:15:06 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AB=8B=E5=8D=B3=E7=94=9F=E6=88=90=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E4=BF=A1=E6=81=AF=E6=8F=90=E7=A4=BA=E5=8F=8A=E5=90=B8?= =?UTF-8?q?=E9=A1=B6=E6=95=88=E6=9E=9C=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- home.html | 79 +++++++----- style/css/index.css | 99 +++++++++++++-- style/img/AI_title_icon.svg | 1 + style/img/changeMore_tit.svg | 1 + style/js/index.js | 292 +++++++++++++++++++++++-------------------- 5 files changed, 297 insertions(+), 175 deletions(-) create mode 100644 style/img/AI_title_icon.svg create mode 100644 style/img/changeMore_tit.svg diff --git a/home.html b/home.html index 134c114..ac60cc6 100644 --- a/home.html +++ b/home.html @@ -77,7 +77,7 @@
-
+
@@ -86,10 +86,11 @@ 生成论文初稿
-
+
- + +
下载论文 @@ -135,7 +136,7 @@ 文献综述 -
  • +
  • 答辩PPT @@ -155,7 +156,7 @@
    + support_edu="63,96,82,94" support_pro="82,94" support_pro="94,63"> @@ -178,11 +179,11 @@
    -
    +
    - +
    - 0/50 + 0/100
    @@ -205,7 +206,7 @@
    -
    忽略
    +
    忽略
    开始优化
    @@ -235,11 +236,11 @@
    -
    智能优化标题
    +
    智能优化标题
    - 换一批 + 换一批
    @@ -275,7 +276,7 @@
    关键词
    - +
    @@ -285,11 +286,22 @@ placeholder="请输入相关的辅助信息,帮助论文生成的更加准确!(非必填)">
    -
    +
    @@ -385,8 +397,8 @@
    - - + +

    我已阅读并同意:生成的论文范文仅用于参考,不作为毕业论文使用

    @@ -517,7 +529,6 @@ //第三步 等待第二步动画加载完成 开启加载动画 let ani3 = stepLoading(3, 'analysis') -debugger if ($('#advise-ul').html()) { //如果推荐已存在 销毁加载动画 开启完成动画 ani3.destroy(); @@ -562,6 +573,7 @@ debugger } $('.opt-advise input').on('input', function() { + console.log('------input'); if ($(this).val() !== window.title) { showTitleChange() } @@ -637,7 +649,9 @@ debugger }); } function confirmTitle(obj){ + console.log(obj.innerText.length,'obj.innerText.length'); $('.inputChange').val(obj.innerHTML); + $('.inputText').text(obj.innerText.length + '/100'); hideOptArea(); } function checkAiTitle() { @@ -726,6 +740,7 @@ debugger $(this).addClass('active') }); function checkTitle(title) { + console.log('0000000000'); title = title.replace(/\n/g, '\r\n').replace(/^[\n\r\f\t\v\x20]+/, '').replace(/[\n\r\f\t\v\x20]+$/, ''); if (title.length == 0) { alert('请输入标题'); @@ -736,7 +751,7 @@ debugger alert('标题不能少于' + title_min_limit + '字'); return false; } - var title_max_limit = 50; + var title_max_limit = 100; if (title.length > title_max_limit) { alert('标题不能多于' + title_max_limit + '字'); return false; @@ -771,6 +786,7 @@ debugger return; } var chkType = $('li.active_select').attr('type'); + console.log(chkType,'chkType===='); $.ajax({ type: "post", url: 'http://aitest.chachongz.com/ajax_get_config', @@ -785,6 +801,11 @@ debugger alert(data.info); return; } + var service_domain = 'http://aitest.chachongz.com/' + let pathType = { + '94':'aiessayzx', + '82':'aiessayen' + } var title = $(".inputChange").val(); var r = checkTitle(title); if (!r) return; @@ -798,7 +819,7 @@ debugger alert("请选择您的学历"); return; } - if (!$('.form_essayWords').hasClass('hide')) { + if (chkType != '82' && !$('.form_essayWords').hasClass('hide')) { var wordnums = parseInt($('input[type="radio"][name="wordnums"]:checked').val()); if (wordnums <= 0 || isNaN(wordnums)) { alert("请选择您的字数"); @@ -806,8 +827,6 @@ debugger } } var major = parseInt($('#project_select').find('option:selected').val()); - var selectedValue = $("#project_select").find("option:selected").val(); - console.log(selectedValue,'selectedValue',major); if (major <= 0 || !major) { alert("请选择您的专业"); return; @@ -823,7 +842,7 @@ debugger table_and_formulas += ',' + table_and_formulasval; } //固定外部链接 - var url = 'http://aitest.chachongz.com/aiessayzx' + "/catalogue?title=" + encodeURIComponent(title); + var url = service_domain+ pathType[chkType] + "/catalogue?title=" + encodeURIComponent(title); // var url = data.data.agent_domain + "/catalogue?title=" + encodeURIComponent(title); var content_min_limit = $("#htmlconfig").attr('content_min_limit'); if (!$('.coreContent').hasClass('hide')) { @@ -905,14 +924,14 @@ debugger
    diff --git a/style/css/index.css b/style/css/index.css index c50a6a3..5e5c796 100644 --- a/style/css/index.css +++ b/style/css/index.css @@ -417,6 +417,10 @@ header .right div{ color: #3D3D3D; font-size: 14px; } +header .right div a{ + text-decoration: none; + color: #3D3D3D; +} header .right .activebtn{ font-weight: bold; font-variation-settings: "opsz" auto; @@ -551,24 +555,50 @@ header .right .activebtn{ } .main_content .step_back{ margin-bottom: 12px ; - padding: 10px 0; + /* padding: 10px 0; */ width: 100%; background: rgba(255, 255, 255, 0.5); backdrop-filter: blur(10px); display: flex; justify-content: center; + transition:all .7s; } .main_content .stickyStep{ position: sticky; top: 64px; opacity: 1; + padding: 0; z-index: 9; - background: rgba(255, 255, 255, 0.5); + background: rgba(255, 255, 255, 0.8); box-sizing: border-box; border-width: 0px 0px 1px 0px; border-style: solid; border-image: linear-gradient(270deg, rgba(114, 119, 244, 0) 8%, #7177F4 47%, rgba(117, 119, 245, 0) 89%) 0 0 1 0; backdrop-filter: blur(20px); + transition:all .5s; +} +.stickyStep .step_main{ + padding: 0 164px; + transition: all .5s; +} +.stickyStep.step_back{ + padding: 0 0; + transition: all .5s; +} +.stickyStep .step_main dd{ + font-size: 12px; + transition: all .5s; + line-height: 25px; +} +.stickyStep .step_main .active_step_title{ + font-size: 14px; + transition: all .5s; +} +.stickyStep .step_main .nor_step_title{ + font-size: 14px; + transition: all .5s; + margin-bottom: 0; + } .main_content .step_back .step_line{ min-width: 70px; @@ -662,6 +692,7 @@ header .right .activebtn{ font-size: 16px; font-weight: bold; color: #3D3D3D; + letter-spacing: 0.01em; } .step_main dl{ display: flex; @@ -673,6 +704,7 @@ header .right .activebtn{ margin: 0 0 0 12px; font-size: 14px; font-weight: 400; + letter-spacing: 0.06em; color: #626573; } .main_select{ @@ -789,6 +821,10 @@ li .select_icon, .pay_every .pay_icon{ width: 186px; margin-right: 22px; } +.key_words{ + line-height: 45px !important; + margin-top: -40px; +} .key_words input{ display: flex; flex: 1; @@ -796,7 +832,7 @@ li .select_icon, .pay_every .pay_icon{ align-items: center; background-color: #fff; border: 1px solid #E8E8E8; - padding: 8px 8px 8px 12px; + padding: 14px 8px 14px 12px; border-radius: 6px; } .oneRight{ @@ -948,18 +984,55 @@ li .select_icon, .pay_every .pay_icon{ .opt-block .advise-li{ font-weight: 400; font-size: 14px; - color: #282828; line-height: 20px; padding: 8px 17px; + color: #3D3D3D; + transition: all .3s; } .opt-block .advise-li:hover{ - background: #ECF5FF; + background: #F1F4FF; border-radius: 6px; + transition: all .3s; +} +.opt-block .title-change{ + display: flex; + /* width: 374px; */ + height: 31px; + background: rgba(0, 0, 0, 0.7531); + border-radius: 6px; + line-height: 20px; + padding: 5px 7px; + position: absolute; + top:10px; + left: 50%; + margin-left: -180px; + opacity: 0; /* 初始状态为完全透明 */ + transition: opacity 1s ease-in-out; /* 设置透明度过渡 */ + font-family: Microsoft YaHei UI; + align-items: center; + justify-content: center; +} +.opt-block .title-change.fade{ + opacity: 1; +} +.opt-block .change-text{ + font-weight: 400; + font-size: 13px; + color: #FFFFFF; + margin-right: 7px; + font-family: Microsoft YaHei UI; +} +.opt-block .change-yes, .change-no{ + font-weight: 400; + font-size: 13px; + color: #FFCE5C; + margin: 0 7px; + font-family: Microsoft YaHei UI; } .opt-block .advise-refresh{ font-weight: 400; font-size: 14px; - color: #1675FF; + color: #5B6FF6; line-height: 20px; padding-top: 8px; text-align: right; @@ -1159,12 +1232,12 @@ li .select_icon, .pay_every .pay_icon{ transition: all .3s; background: linear-gradient(270deg, #6C69F5 0%, #3467E5 100%); } -.btn_result:hover{ +.btn_result:hover, .btn_result_now:hover{ transition: all .3s; opacity: 0.8; background: linear-gradient(270deg, #6C69F5 0%, #3467E5 100%); } -.btn_result:active{ +.btn_result:active,.btn_result_now:active{ transition: all .3s; opacity: 1; background: linear-gradient(270deg, #6C69F5 0%, #3467E5 100%); @@ -1267,8 +1340,16 @@ li .select_icon, .pay_every .pay_icon{ } .textAreaRight{ display: flex; + position: relative; +} + +.char-count { + position: absolute; + bottom: 5px; /* 根据需要调整距离底部的位置 */ + right: 10px; /* 根据需要调整距离右侧的位置 */ + font-size: 12px; /* 根据需要调整字体大小 */ } -#side_textarea{ +#side_textarea, #coreTextarea{ flex: 1; /* width: 100%; */ padding: 14px 12px; diff --git a/style/img/AI_title_icon.svg b/style/img/AI_title_icon.svg new file mode 100644 index 0000000..d9a1ef0 --- /dev/null +++ b/style/img/AI_title_icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/style/img/changeMore_tit.svg b/style/img/changeMore_tit.svg new file mode 100644 index 0000000..5426873 --- /dev/null +++ b/style/img/changeMore_tit.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/style/js/index.js b/style/js/index.js index 21f8fd8..eed8f98 100644 --- a/style/js/index.js +++ b/style/js/index.js @@ -4,10 +4,11 @@ $(document).ready(function() { var notChecked = ''; var checked = ''; var payResultTimer = null; - + var service_domain = 'http://aitest.chachongz.com/' var isPayDialog = false var allPostData=new Object() - $.get('你的接口URL', function(response) { + //获取服务项目具体信息 + $.ajax(service_domain +'ajax_get_ai_services', function(response) { // 请求成功时的回调函数 console.log(response); }).fail(function(xhr, status, error) { @@ -34,15 +35,15 @@ $(document).ready(function() { } //标题输入字数 $('.inputChange').on('input', function() { - // var maxLength = $(this).attr('maxlength'); + var maxLength = $('.inputText').attr('max'); var currentLength = $(this).val().length; if(currentLength > 0){ $('.normal_recommend_title').addClass('recommend_title') }else{ $('.normal_recommend_title').removeClass('recommend_title') } - $('.inputText').text(currentLength + '/' + '50'); - if(currentLength >50){ + $('.inputText').text(currentLength + '/' + maxLength); + if(currentLength >maxLength){ $('.inputText').addClass('warnInputText') }else{ $('.inputText').removeClass('warnInputText') @@ -63,82 +64,6 @@ $(document).ready(function() { function hideOptArea(){ $('.opt-area').css('display','none'); } - function getAiTitleList(){ - let title = $('.inputChange').val(); - let title_type = $('#project_select').val() - console.log($('#project_select'),title_type); - $.ajax({ - type: "post", - url: 'http://aitest.chachongz.com/ajax_advise_ai_title', - data: { - title: title, - title_type: title_type - }, - success: function(jsondata) { - // $('#cur_request').val(0) - - var res = JSON.parse(jsondata); - console.log(res,'====='); - // if(!res.status){ - // alert(res.info); - // return false; - // } - - // if(res.data.title != $('#cur_title').val()){ - // return false; - // } - - // if(res.data.list.length>0){ - // let html = '' - // res.data.list.forEach(function(item) { - // html += '
    '+item+'
    '; - // }); - // $('#advise-ul').html(html); - - // let ani3 = stepLoading(3, 'done') - // ani3.addEventListener('complete', function() { - // stepDone(3, ani3) - - // //第四步默认完成 - // let ani4 = stepLoading(4, 'done') - // ani4.addEventListener('complete', function() { - // ani4.destroy(); - // }); - - // showAdviseList() - // }); - // } - } - }); - } - function checkAiTitle() { - let title = $('.inputChange').val(); - $.ajax({ - type: "post", - url: '/ajax_check_ai_title', - data: { - title: title - }, - success: function (jsondata) { - var res = JSON.parse(jsondata); - if (!res.status) { - alert(res.info); - return false; - } - - $('#cur_title_type').val(res.data); - - if (res.status && res.data != 1) { - if($('#loading').css('display') == 'none'){ - showOptArea('not-title'); - } - } - } - }); - } - function showAdviseTitle(){ - console.log('haha'); - } function getWordCountList(){ var chkType = $('li.active_select').attr('type'); var word_list_str = $("#word_list_str"+chkType).val(); @@ -176,8 +101,6 @@ $(document).ready(function() { $('.pay_content').removeClass('hide') } clearTimeout(payResultTimer); - - // clearInterval() }) function getPayType() { var paytype = $('.pay_active').attr('pay_type'); @@ -187,7 +110,7 @@ $(document).ready(function() { let check_type = $('li.active_select').attr('type'); let check_flag = $('li.active_select').attr('check_flag'); let pay_type = getPayType(); - let title = $('.inputChange').val(); + let title = $('.inputChange').val().trim(); // goods_id 0 // const postData = { // title:'88', @@ -198,22 +121,85 @@ $(document).ready(function() { // // recharge_goods_id:'0', // // value_added_services:''//增值服务 // } + if(check_type == '') { + alert('提交类型不合法'); + errorJump(); + return false; + } const postData = { - title: '123', - check_type: '94', + title, + check_type, pay_type, get_pay_goods: '1', - aiessay_wordnum: '3000' } - allPostData = {...allPostData,check_flag,recharge_goods_id:'0',...postData} - - if(check_type == '94'){ - + if ($('.opt-advise').css('display') !== 'none') { + if(title == ''){ + alert('提交标题不能为空'); + return; + } + if(check_type == '62' ||check_type == '63'){ + if(title.length >500){ + alert('论文标题不得多于500字'); + // errorJump(); + $('.inputChange').val('')//重置输入框文本 + $('.inputText').text('0/500') + return; + } + } + if(title.length >100){ + alert('论文标题不得多于100字'); + $('.inputChange').val('')//重置输入框文本 + $('.inputText').text('0/100') + return; + } } + if(check_type == '64'){ + title = $('.key_words_input').val().trim() + if(title == ''){ + alert('关键词不能为空'); + return; + } + if(title.length >50){ + alert('关键词不得多于50字'); + $('.inputChange').val('')//重置输入框文本 + return; + } + postData.title = title + } + if(!$('.custom-select').hasClass('disNone')){ + var major = parseInt($('#project_select').find('option:selected').val()); + if (major <= 0 || !major) { + alert("请选择您的专业"); + return; + } + } + if ($('.form_essayWords').css('display') !== 'none') { + var wordnums = parseInt($('input[type="radio"][name="wordnums"]:checked').val()); + if (wordnums <= 0 || isNaN(wordnums)) { + alert("请选择您的字数"); + return; + } + } + allPostData = {...allPostData,check_flag,recharge_goods_id:'0',...postData} //检验信息 getPayQrcode(postData) } + function clearhisText(){ + $('.inputChange').val('')//重置输入框文本 + $('.key_words_input').val('')//重置输入框文本 + $('.inputText').text('0/100') + $('#project_select').val('') + $('.coreWordCount').val('') + if($('.normal_recommend_title').hasClass('recommend_title'))$('.normal_recommend_title').removeClass('recommend_title') + } + function errorJump() { + // if(isPayDialog) { + location.reload(); + return; + // } + // location.href = '/'; + } $('#formInputSumbtn').on('click',function(e){ payAction() }) @@ -222,7 +208,7 @@ $(document).ready(function() { $.ajax({ type: "post", dataType:'json', - url: 'http://aitest.chachongz.com/'+ allPostData.check_flag+'/ajax_check_aisubmit', + url: service_domain + allPostData.check_flag+'/ajax_check_aisubmit', data: { ...postData }, @@ -253,41 +239,41 @@ $(document).ready(function() { // if(configData.ppt_tpl != '') postData1.ppt_tpl = configData.ppt_tpl;//ppt // postData1.recharge_goods_id = '0'; postData1.title = allPostData.title; - postData1.core_content = core_content; -// type==94 - // var edu= parseInt($('#paper-edu-wrapper').find('input[type="radio"]:checked').val()); - // if(edu<=0 || !edu) { - // alert("请选择您的学历"); - // return; - // } - // if(!$('.form_essayWords').hasClass('hide')){ - // var wordnums= parseInt($('.textLength').find('input[type="radio"]:checked').val()); - // if(wordnums<=0 || isNaN(wordnums)) { - // alert("请选择您的字数"); - // return; - // } - // } - // var major = parseInt($('#paper-major-wrapper').find('option:selected').val()); - // if(major<=0 || !major) { - // alert("请选择您的专业"); - // return; + // postData1.core_content = core_content; + // if(postData1.type == '63'){ + // postData1.major = parseInt($('#project_select').find('option:selected').val()); // } + if(!$('.custom-select').hasClass('disNone')){ + var major = parseInt($('#project_select').find('option:selected').val()); + postData1.aiessay_major = major + } + if(!$('.formItem_pro').hasClass('disNone')){ + var edu = parseInt($('#educationRight').find('input[type="radio"]:checked').val()); + postData1.aiessay_edu = edu + } + if ($('.form_essayWords').css('display') !== 'none') { + var wordnums = parseInt($('input[type="radio"][name="wordnums"]:checked').val()); + postData1.aiessay_wordnum = wordnums + } + if(postData1.type == '94'){ + postData1.core_content = $('.core_content').val().trim()//核心内容 + } $.ajax({ - url:"http://aitest.chachongz.com/"+allPostData.check_flag+'/ajax_get_ai_pay_url', + url:service_domain+allPostData.check_flag+'/ajax_get_ai_pay_url', type:'post', dataType:'json', - // data:{...postData1}, - data:{ - type: '94', - pay_type: postData1.pay_type, - value_added_services: '', - recharge_goods_id: '0', - title: '123', - fuid: '', - aiessay_wordnum: '3000', - aiessay_edu: '2', - aiessay_major: '1' - }, + data:{...postData1}, + // data:{ + // type: '94', + // pay_type: postData1.pay_type, + // value_added_services: '', + // recharge_goods_id: '0', + // title: '123', + // fuid: '', + // aiessay_wordnum: '3000', + // aiessay_edu: '2', + // aiessay_major: '1' + // }, success:function(res){ if(res.status){ $('#qrcode').html(''); @@ -311,20 +297,21 @@ $(document).ready(function() { alert('网络错误1'); } }); - // console.log(allPostData,'allPostData===='); } function getRechargePayResult(payinfo){ + console.log(payinfo,'payinfo'); clearTimeout(payResultTimer); if (payinfo.tid) { ptid = payinfo.tid; } $.ajax({ - url:"http://aitest.chachongz.com/"+ allPostData.check_flag +'/ajax_get_ai_pay_result', + url:service_domain+ allPostData.check_flag +'/ajax_get_ai_pay_result', type:'post', dataType:'json', data:{ tid:ptid, - pay_type:'2'}, + pay_type:getPayType() + }, success:function(res){ if(res.status){ if(res.data.pay_status == 'NOTPAY') { @@ -359,12 +346,12 @@ $(document).ready(function() { var data = res.data; if(data.wechat_qrcode_url){ $('#pay_succ_tid').text(data.tid) - // $('#qrcode1').attr('src', data.wechat_qrcode_url); - $('#qrcode1').attr('src', "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=gQFX8DwAAAAAAAAAAS5odHRwOi8vd2VpeGluLnFxLmNvbS9xLzAyZ0dySDRYMTVmZmsxTHM4ODFEY3YAAgTcO2FnAwQAjScA"); + $('#qrcode1').attr('src', data.wechat_qrcode_url); + // $('#qrcode1').attr('src', "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=gQFX8DwAAAAAAAAAAS5odHRwOi8vd2VpeGluLnFxLmNvbS9xLzAyZ0dySDRYMTVmZmsxTHM4ODFEY3YAAgTcO2FnAwQAjScA"); } $('.payresultBtn2').click(function(){ - location.href = "http://aitest.chachongz.com/report2?oid="+data.tid; + location.href = `${service_domain}report2?oid=${data.tid}`; }); $('.payresultBtn1').click(function(){ console.log(isPayDialog,'isPayDialog----'); @@ -393,33 +380,65 @@ $(document).ready(function() { $('li').removeClass('active_select') } $(this).addClass('active_select') - getWordCountList(); - + // getWordCountList(); + clearhisText()//清空记录 var t = $('li.active_select').attr('type'); - console.log(t,'=======ttttt'); + if(t =='96'){ + location.href = 'http://aitest.chachongz.com/aippt' + return + } if(t =='94'){//字数 $('.form_essayWords').show(); $('.side_info').show(); - $('.btn_result').show() - $('.btn_result_now').hide() + $('.step_two').show() $('.key_words').addClass('hide') + $('.checkbox_wrap').show() } else{ - $('.btn_result').hide() - $('.btn_result_now').show() + $('.checkbox_wrap').hide() + $('.step_two').hide() $('.form_essayWords').hide(); $('.side_info').hide(); $('.key_words').removeClass('hide') } + if(t == '94' || t == '82'){ + $('[step="3"]').show() + $('[step="2"]').hide() + $('.btn_result').show() + $('.btn_result_now').hide() + $('.step_two').show() + }else{ + $('.btn_result').hide() + $('.btn_result_now').show() + $('.step_two').hide() + $('[step="2"]').show() + $('[step="3"]').hide() + } if(t == '64'){ $('.key_words').show() + $('.key_words').show() + if ($('.opt-advise').css('display') !== 'none') { + // 元素是隐藏的 + $('.opt-advise').hide() + } }else{ $('.key_words').hide() + $('.opt-advise').show() } if (['81','85'].indexOf(t) !== -1) {// $('.coreContent').show(); } else{ $('.coreContent').hide(); } + if(t == '62' ||t == '63'){ + $('.inputText').attr('max','500') + $('.inputText').text('0/500') + }else if(t==82){ + $('.inputText').attr('max','200') + $('.inputText').text('0/200') + }else{ + $('.inputText').attr('max','100') + $('.inputText').text('0/100') + } // $("#downdemo").attr('href', '/downreportdemo/type/'+t); //图表公式 var table_formula_types = getTableFormulaTypes('support_table_formula_types'); @@ -433,6 +452,7 @@ $(document).ready(function() { changeLiActive(t,'support_titleMore','.normal_recommend_title')// 标题优化 changeLiActive(t,'support_pro','.custom-select')// 专业优化 changeLiActive(t,'support_edu','.formItem_pro')// 学历优化 + // if($('.custom-select').hasClass('disNone') && $('.opt-advise').hasClass('disNone')){} }); function changeLiActive(t,attr_type,ele){