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.
97 lines
3.2 KiB
97 lines
3.2 KiB
![]()
5 months ago
|
$(document).ready(function() {
|
||
|
$.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')
|
||
|
}
|
||
|
});
|
||
|
//标题输入字数
|
||
|
$('.inputChange').on('keyup', function() {
|
||
|
// var maxLength = $(this).attr('maxlength');
|
||
|
var currentLength = $(this).val().length;
|
||
|
console.log(currentLength,'currentLength');
|
||
|
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() {
|
||
|
|
||
|
});
|
||
|
$('.normal_step').click(function(e) {
|
||
|
|
||
|
});
|
||
|
function showOptArea(area){
|
||
|
$('.opt-area').css('display','none');
|
||
|
$('#'+area).css('display','block');
|
||
|
}
|
||
|
function hideOptArea(){
|
||
|
$('.opt-area').css('display','none');
|
||
|
}
|
||
|
// $.ajax({
|
||
|
// type: "post",
|
||
|
// url: 'http://aitest.chachongz.com/ajax_advise_ai_title',
|
||
|
// data: {
|
||
|
// title: '兔子吃草研究',
|
||
|
// title_type: '1'
|
||
|
// },
|
||
|
// 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()
|
||
|
// // });
|
||
|
// // }
|
||
|
// }
|
||
|
// });
|
||
|
$('li').click(function(e) {
|
||
|
if ($('li').hasClass('active_select')) {
|
||
|
$('li').removeClass('active_select')
|
||
|
}
|
||
|
$(this).addClass('active_select')
|
||
|
});
|
||
|
});
|