diff --git a/home.html b/home.html index a92ab97..04325cd 100644 --- a/home.html +++ b/home.html @@ -20,7 +20,7 @@
论文写作
-
报告下载
+
报告下载
@@ -88,47 +88,52 @@
+ + +
-
- 请选择您的论文专业 +
+
+
+ +
+
+ +
+ +
+
+ +
+ +
+
+
+
+
关键词
+
+ +
+
+
+
辅助信息
+
+ +
+
+
+
核心内容
+
+ +
+
+
+
+ 论文字数 + +
+
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+
+
+
图表公式
+
+
+
+ +
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+ +
- -
-
-
-
- 选择学历 - -
-
-
- - -
-
- - -
-
- - -
-
-
-
-
辅助信息
-
- -
-
-
-
- 论文字数 - -
-
-
- - -
-
- - -
-
- - -
-
-
-
-
图表公式
-
-
-
- - -
-
- - -
-
- - -
-
- - -
-
-

将在所生成范文的随机位置插入所选项

-
-
-
- -

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

-
+ //点击页面其余地方隐藏标题信息 + $(document).click(function(event) { + if (!$(event.target).closest('.opt-advise').length) { + hideOptArea() + } + }); + function showOptArea(area){ + $('.opt-area').css('display','none'); + $('.'+area).css('display','block'); + } + function hideOptArea(){ + $('.opt-area').css('display','none'); + } + function getEducation2(radioName, value,eleClass,addClass){ + let elePar = event.target.parentElement + if(elePar.classList.contains(addClass)){ + elePar.classList.remove(addClass) + event.target.checked = false; + }else{ + elePar.classList.add(addClass) + event.target.checked = true; + } + $('input[type="checkbox"]:checked').each(function() { + console.log($(this).val()); + });//获取所有被选中的复选框 + var selectedValues = $('input[type="radio"][name="wordnums"]:checked').val(); + console.log(selectedValues,'selectedValues'); + } + function getEducation(radioName, value,eleClass,addClass){ + document.querySelectorAll(eleClass).forEach(function(elem) { + elem.addEventListener('click', function() { + document.querySelectorAll(eleClass).forEach(function(el) { + el.classList.remove(addClass); + }); + // 给当前点击的元素添加 'active' 类名 + this.classList.add(addClass); + }); + }); + var radios = document.getElementsByName(radioName); + for (var i = 0; i < radios.length; i++) { + if (radios[i].value === value) { + radios[i].checked = true; + break; + } + } + var selectedValues = $('input[type="radio"][name="wordnums"]:checked').val(); + console.log(selectedValues,'selectedValues'); + } + $('.agree-item').click(function(){ + if($(this).hasClass('active')){ + $(this).removeClass('active'); + return; + } + $(this).addClass('active') + }); + function checkTitle(title) { + 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('请输入标题'); + return false; + } + var title_min_limit = 1; + if (title.length < title_min_limit) { + alert('标题不能少于'+title_min_limit+'字'); + return false; + } + var title_max_limit = 50; + if (title.length > title_max_limit) { + alert('标题不能多于'+title_max_limit+'字'); + return false; + } + return true; + } + + function checkContent(content) { + content = content.replace(/\n/g,'\r\n').replace(/^[\n\r\f\t\v\x20]+/, '').replace(/[\n\r\f\t\v\x20]+$/, ''); + var content_min_limit = 1; + // var content_min_limit = $("#htmlconfig").attr('content_min_limit'); + if (content.length < content_min_limit) { + alert('内容不能少于'+content_min_limit+'字'); + return false; + } + // var content_max_limit = $("#htmlconfig").attr('content_max_limit'); + // if (content.length > content_max_limit) { + // alert('内容不能多于'+content_max_limit+'字'); + // return false; + // } + return true; + } + function showCreateCatalogue(){ + geiAiUpgradeInfo(createCatalogue) + } + function createCatalogue(){ + if(!$('.agree-item').hasClass('active')){ + alert("请阅读并勾选同意《服务条款》"); + return; + } + + + var chkType = $('li.active_select').attr('type'); + $.ajax({ + type: "post", + url: 'http://aitest.chachongz.com/ajax_get_config', + async:false, + data: { + type: chkType, + is_pc_webpage: 1 + }, + success: function(jsondata) { + var data = JSON.parse(jsondata); + if(!data.status){ + alert(data.info); + return; + } + var title = $(".inputChange").val(); + var r = checkTitle(title); + if(!r) return; + + var core_content = $('.textAreaForWordCount').val(); + var r = checkContent(core_content); + if(!r) return; + + 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; + } + var table_and_formulas_obj = $('#paper-table_and_formulas-wrapper').find('input:checked'); + var table_and_formulas=''; + for (var index = 0; index < table_and_formulas_obj.length; index++) { + var table_and_formulasval = table_and_formulas_obj.eq(index).val(); + if(table_and_formulas == '') { + table_and_formulas = table_and_formulasval; + continue; + } + table_and_formulas += ','+table_and_formulasval; + } + var url = data.data.agent_domain+"/catalogue?title="+encodeURIComponent(title); + var content_min_limit = $("#htmlconfig").attr('content_min_limit'); + if(!$('.coreContent').hasClass('hide')){ + var core_content = $('.textAreaForWordCount').val(); + if(core_content.trim().length == 0 && content_min_limit>0){ + alert("论文核心内容不能为空"); + return; + } + url += '&core='+encodeURIComponent(core_content.trim()); + } + if(table_and_formulas != '' && table_formula_types.indexOf(chkType) !== -1) url += '&table_and_formulas='+table_and_formulas; + if(!$('.form_essayWords').hasClass('hide')) url += '&aiessay_wordnum='+wordnums; + if(major) url += '&major='+major; + if(edu) url += '&edu='+edu; + loginComAction(url); + } + }); + } + function geiAiUpgradeInfo(callback, param){ + $.ajax({ + type: "post", + url: 'http://aitest.chachongz.com/ajax_ai_upgrade_info', + data: {}, + success: function (jsondata) { + var res = JSON.parse(jsondata); + if(res.status && res.data){ + $('#upgrade_time').html(res.data) + $('#upgrade-modal').show() + return true; + } + + callback(param); + } + }); + } +