You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
136 lines
4.4 KiB
136 lines
4.4 KiB
$(document).ready(function() {
|
|
var notRadio = '';
|
|
var yesRadio = '';
|
|
var notChecked = '';
|
|
var checked = '';
|
|
$.get('你的接口URL', function(response) {
|
|
// 请求成功时的回调函数
|
|
console.log(response);
|
|
}).fail(function(xhr, status, error) {
|
|
// 请求失败时的回调函数
|
|
console.log(error);
|
|
});
|
|
//step监听滚动位置
|
|
$(window).scroll(function() {
|
|
var element = $('.step_back');
|
|
var distanceToTop = element.offset().top - $(this).scrollTop();
|
|
if(distanceToTop <= 64){
|
|
element.addClass('stickyStep')
|
|
}else{
|
|
element.removeClass('stickyStep')
|
|
}
|
|
});
|
|
//标题输入字数
|
|
$('.inputChange').on('input', function() {
|
|
// var maxLength = $(this).attr('maxlength');
|
|
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').addClass('warnInputText')
|
|
}else{
|
|
$('.inputText').removeClass('warnInputText')
|
|
// $('.inputText').removeClass('recommend_title')
|
|
}
|
|
});
|
|
// $('.inputChange').on('blur', function() {
|
|
// console.log('blur----');
|
|
// getAiTitleList()
|
|
// });
|
|
$('.normal_step').click(function(e) {
|
|
|
|
});
|
|
function showOptArea(area){
|
|
$('.opt-area').css('display','none');
|
|
$('#'+area).css('display','block');
|
|
}
|
|
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');
|
|
}
|
|
$('li').click(function(e) {
|
|
if ($('li').hasClass('active_select')) {
|
|
$('li').removeClass('active_select')
|
|
}
|
|
$(this).addClass('active_select')
|
|
});
|
|
});
|