|
|
@ -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 += '<div onclick="confirmTitle(this)" class="advise-li">'+item+'</div>';
|
|
|
|
// });
|
|
|
|
// $('#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){ |
|
|
|