|
|
|
$(document).ready(function() {
|
|
|
|
var notRadio = '';
|
|
|
|
var yesRadio = '';
|
|
|
|
var notChecked = '';
|
|
|
|
var checked = '';
|
|
|
|
var payResultTimer = null;
|
|
|
|
// var service_domain = location.origin+'/'
|
|
|
|
var service_domain = 'https://aitest.chachongz.com/'
|
|
|
|
var isPayDialog = false
|
|
|
|
var allPostData=new Object()
|
|
|
|
var old_parent_ppt = null;
|
|
|
|
var new_parent_ppt = 0;
|
|
|
|
var child_ppt = 0;
|
|
|
|
var child_src = ''
|
|
|
|
var value_added_servicesList = null;
|
|
|
|
value_added_select = null;//已选择的增值服务
|
|
|
|
// var cssurl= '{$priv_style}/img/'
|
|
|
|
var cssurl= './style/img/'//dev
|
|
|
|
var pptUrlList = [
|
|
|
|
{
|
|
|
|
name:'清新绿意通用模版',
|
|
|
|
url:'',
|
|
|
|
list:[],
|
|
|
|
ppt_id:'2'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name:'蓝色启航通用模版',
|
|
|
|
ppt_id:'3'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name:'蓝色梦境通用模版',
|
|
|
|
ppt_id:'5'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name:'棕韵蓝调通用模版',
|
|
|
|
ppt_id:'6'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name:'绿野金辉通用模版',
|
|
|
|
ppt_id:'7'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name:'深邃星空通用模版',
|
|
|
|
ppt_id:'8'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name:'毕业庆典通用模版',
|
|
|
|
ppt_id:'9'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name:'生命之链通用模版',
|
|
|
|
ppt_id:'10'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name:'云水之间通用模版',
|
|
|
|
ppt_id:'11'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name:'金色地标通用模版',
|
|
|
|
ppt_id:'12'
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
]
|
|
|
|
var checkTypeList={
|
|
|
|
'94':'毕业论文',
|
|
|
|
'81':'课程论文',
|
|
|
|
'85':'职称论文',
|
|
|
|
'62':'开题报告',
|
|
|
|
'64':'论文选题',
|
|
|
|
'91':'文献综述',
|
|
|
|
'96':'答辩PPT',
|
|
|
|
'63':'任务书',
|
|
|
|
'82':'英文论文',
|
|
|
|
}
|
|
|
|
var addservicedsDescList = [
|
|
|
|
'论文封面',
|
|
|
|
'论文提纲',
|
|
|
|
'论文摘要',
|
|
|
|
'论文致谢',
|
|
|
|
'参考文献',
|
|
|
|
'查重报告',
|
|
|
|
]
|
|
|
|
//首页增值服务相关展示
|
|
|
|
let servicedsHtml = ''
|
|
|
|
addservicedsDescList.forEach(item=>{
|
|
|
|
servicedsHtml += `<div class="serviceds_bot_item flex">
|
|
|
|
<span>送</span>
|
|
|
|
<span>`+item+`</span>
|
|
|
|
<b>X</b>1
|
|
|
|
</div>`
|
|
|
|
})
|
|
|
|
$('.serviceds_bottom').html(servicedsHtml)
|
|
|
|
// var stepList = [
|
|
|
|
// {
|
|
|
|
// step:1,
|
|
|
|
// title:'输入论文题目',
|
|
|
|
// desc:'生成千字大纲'
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// step:2,
|
|
|
|
// title:'编辑大纲',
|
|
|
|
// desc:'生成论文初稿'
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// step:3,
|
|
|
|
// title:'下载论文',
|
|
|
|
// desc:'一键快速下载论文'
|
|
|
|
// },
|
|
|
|
// ]
|
|
|
|
// $('step_main').html('');
|
|
|
|
// var step_html = '';
|
|
|
|
// stepList.forEach(item=>{
|
|
|
|
// step_html+= ``
|
|
|
|
// })
|
|
|
|
var payhtml = `<div class="pay_content flex" include-html="pay.html" mes="网站已通过备案请放心使用,如支付宝提示风险属于系统正常提示,按提示继续操作就可以,有任何疑问都可联系右侧在线客服">
|
|
|
|
<div id="qrcode" class="qrcode"></div>
|
|
|
|
<div class="pay_type">
|
|
|
|
<div class="pay_left">
|
|
|
|
<div class="pay_every pay_active" pay_type="2">
|
|
|
|
<img src="./style/img/pay_wx.svg" alt="">
|
|
|
|
<span>微信支付</span>
|
|
|
|
<img class="pay_icon" src="./style/img/pay_icon.svg" alt="">
|
|
|
|
</div>
|
|
|
|
<div class="pay_every" pay_type="3">
|
|
|
|
<img src="./style/img/pay_zfb.svg" alt="">
|
|
|
|
<span>支付宝支付</span>
|
|
|
|
<img class="pay_icon" src="./style/img/pay_icon.svg" alt="">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="pay_right">
|
|
|
|
<p class="pay_moneyNum">应付总额:¥<span id="totalMoney"></span></p>
|
|
|
|
<p>扫码支付自动提交,请勿刷新</p>
|
|
|
|
<p>提交成功用订单号查询结果</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="pay_detail hide" mes="此页面信息至关重要,您可截图保存避免丢失">
|
|
|
|
<div class="pay_succ_header">
|
|
|
|
<img src="./style/img/pay_succ.svg" alt="">
|
|
|
|
支付成功!订单号是下载范文唯一凭证
|
|
|
|
</div>
|
|
|
|
<div class="pay_succ_content">
|
|
|
|
<img id="qrcode1" src="" alt="">
|
|
|
|
<div class="pay_succ_right">
|
|
|
|
<p>
|
|
|
|
<img src="./style/img/succ_tip_icon.svg" alt="">
|
|
|
|
微信扫码,随时获知生成状态
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
订单号:<span id="pay_succ_tid">OIY898998787721878233</span>
|
|
|
|
<img src="./style/img/copy_icon.svg" class="point" id="copy_tid" alt="">
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="pay_opera_btn">
|
|
|
|
<div class="payresultBtn1 point">再生成一篇</div>
|
|
|
|
<div class="payresultBtn2 point">去下载</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="modal_mes">
|
|
|
|
<img src="./style/img/lingdang.svg" alt="">
|
|
|
|
<p style="font-size: 12px;font-weight: 400;color: #EE7000;line-height: 17px;text-align:center;">
|
|
|
|
本网站已通过备案请放心使用,如支付宝提示风险属于系统正常提示,按提示继续操作即可,有疑问联系网站右侧客服!</p>
|
|
|
|
</div>`
|
|
|
|
//获取服务项目具体信息
|
|
|
|
// $.ajax(service_domain +'ajax_get_ai_services', function(response) {
|
|
|
|
// // 请求成功时的回调函数
|
|
|
|
// console.log(response);
|
|
|
|
// }).fail(function(xhr, status, error) {
|
|
|
|
// // 请求失败时的回调函数
|
|
|
|
// console.log(error);
|
|
|
|
// });
|
|
|
|
// $.ajax(service_domain +'/ajax_get_value_added_services',
|
|
|
|
// function(response) {
|
|
|
|
// // 请求成功时的回调函数
|
|
|
|
// console.log(response);
|
|
|
|
// }).fail(function(xhr, status, error) {
|
|
|
|
// // 请求失败时的回调函数
|
|
|
|
// console.log(error);
|
|
|
|
// });
|
|
|
|
// 首页增值服务相关
|
|
|
|
var add_item_valueText = {
|
|
|
|
'62':'选题正文一步到位',
|
|
|
|
'63':'导师看了都说好',
|
|
|
|
'96':'可自定义风格,答辩最靓的仔',
|
|
|
|
}
|
|
|
|
$.ajax({
|
|
|
|
type: "post",
|
|
|
|
dataType:'json',
|
|
|
|
url: service_domain +'ajax_get_value_added_services',
|
|
|
|
data: {
|
|
|
|
type:'94'
|
|
|
|
},
|
|
|
|
success:function(res){
|
|
|
|
if(res.status){
|
|
|
|
let addListBoxHtml = ''
|
|
|
|
value_added_servicesList = Object.values(res.data.value_added_services);
|
|
|
|
value_added_servicesList.forEach(item=>{
|
|
|
|
if(item.type != '96'){
|
|
|
|
addListBoxHtml+= ` <div class="add_item flex " type=`+item.type+`>
|
|
|
|
<div class="pos_top">`+add_item_valueText[item.type]+`</div>
|
|
|
|
<div class="add_item_left">
|
|
|
|
<p class="title">`+item.name +`</p>
|
|
|
|
<p>
|
|
|
|
<span class="curPrice">`+item.price_desc.slice(0,-3)+`</span>
|
|
|
|
<span class="normalPrice hide">12.00元</span>
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<span class="add_item_right">预览</span>
|
|
|
|
</div>`
|
|
|
|
}else{
|
|
|
|
addListBoxHtml+= `<div class="add_item add_ppt_item flex" type=`+item.type+`>
|
|
|
|
<div class="pos_top">`+add_item_valueText[item.type]+`</div>
|
|
|
|
<div class="add_item_left">
|
|
|
|
<p class="title">`+item.name +`</p>
|
|
|
|
<p>
|
|
|
|
<span class="curPrice">`+item.price_desc.slice(0,-3)+`</span>
|
|
|
|
<span class="normalPrice hide">12.00元</span>
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<div class="dashedLine"></div>
|
|
|
|
<div class="add_ppt_right">
|
|
|
|
<p>当前模板</p>
|
|
|
|
<p>
|
|
|
|
<span id="cur_ppt_selectName">清新绿意通用模板</span>
|
|
|
|
<img src="./style/img/lookAllPPT.svg" alt="">
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>`
|
|
|
|
}
|
|
|
|
})
|
|
|
|
$('.addListBox').html(addListBoxHtml)
|
|
|
|
// $('.addListBox')
|
|
|
|
}else{
|
|
|
|
alert(res.info)
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
error:function(){
|
|
|
|
alert('网络错误1');
|
|
|
|
}
|
|
|
|
})
|
|
|
|
// 增值服务 选择
|
|
|
|
$('.addListBox').on('click','.title',function(){
|
|
|
|
if ($(this).parent().parent().hasClass('add_active')) {
|
|
|
|
$(this).parent().parent().removeClass('add_active');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
$(this).parent().parent().addClass('add_active')
|
|
|
|
})
|
|
|
|
|
|
|
|
//step监听滚动位置
|
|
|
|
$('.pay_complete_main').html(payhtml)
|
|
|
|
// $('.payModal_main').html(payhtml)
|
|
|
|
|
|
|
|
new QRCode(document.getElementById("qrcode"), {
|
|
|
|
text: 'weixin://wxpay/bizpayurl?pr=BbrGBgBz3',
|
|
|
|
width: 135,
|
|
|
|
height: 135,
|
|
|
|
colorDark : "#000000",
|
|
|
|
colorLight : "#ffffff",
|
|
|
|
correctLevel : QRCode.CorrectLevel.H
|
|
|
|
});
|
|
|
|
scrollView()
|
|
|
|
function scrollView(){
|
|
|
|
$(window).scroll(function() {
|
|
|
|
var element = $('.step_back');
|
|
|
|
var element2 = $('.footer');
|
|
|
|
// console.log($(this).scrollTop(),'$(this).scrollTop()');
|
|
|
|
var distanceToTop = element.offset().top - $(this).scrollTop();
|
|
|
|
if(distanceToTop <= 64){
|
|
|
|
if($('.main_page_top').hasClass('hide'))return
|
|
|
|
element.addClass('stickyStep')
|
|
|
|
element2.addClass('footer2')
|
|
|
|
|
|
|
|
}else{
|
|
|
|
element.removeClass('stickyStep')
|
|
|
|
element2.removeClass('footer2')
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
$('.right_btn').click(function(){
|
|
|
|
$('.right_btn').removeClass('activebtn')
|
|
|
|
$(this).addClass('activebtn')
|
|
|
|
if($(this).attr('type') == '1'){
|
|
|
|
$('.main_page_top').removeClass('hide')
|
|
|
|
$('.main_page').removeClass('hide')
|
|
|
|
$('#report_page').addClass('hide')
|
|
|
|
}else{
|
|
|
|
$('.main_page_top').addClass('hide')
|
|
|
|
$('.main_page').addClass('hide')
|
|
|
|
$('#report_page').removeClass('hide')
|
|
|
|
}
|
|
|
|
})
|
|
|
|
// function getFormData() {
|
|
|
|
// var formData = new FormData(document.querySelector('form'));
|
|
|
|
// var data = {};
|
|
|
|
// for (var [key, value] of formData.entries()) {
|
|
|
|
// data[key] = value;
|
|
|
|
// }
|
|
|
|
// console.log(data);
|
|
|
|
// }
|
|
|
|
//标题输入字数
|
|
|
|
$('.inputChange').on('input', function() {
|
|
|
|
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 + '/' + maxLength);
|
|
|
|
if(currentLength >maxLength){
|
|
|
|
$('.inputText').addClass('warnInputText')
|
|
|
|
}else{
|
|
|
|
$('.inputText').removeClass('warnInputText')
|
|
|
|
// $('.inputText').removeClass('recommend_title')
|
|
|
|
}
|
|
|
|
});
|
|
|
|
// $('.inputChange').on('blur', function() {
|
|
|
|
// console.log('blur----');
|
|
|
|
// getAiTitleList()
|
|
|
|
// });
|
|
|
|
// $('.right_btn').click(function(e) {
|
|
|
|
// if ($('.right_btn').hasClass('activebtn')) {
|
|
|
|
// $('.right_btn').removeClass('activebtn')
|
|
|
|
// }
|
|
|
|
// $(this).addClass('activebtn')
|
|
|
|
// });
|
|
|
|
function showOptArea(area){
|
|
|
|
$('.opt-area').css('display','none');
|
|
|
|
$('#'+area).css('display','block');
|
|
|
|
}
|
|
|
|
function hideOptArea(){
|
|
|
|
$('.opt-area').css('display','none');
|
|
|
|
}
|
|
|
|
function getWordCountList(){
|
|
|
|
var chkType = $('li.active_select').attr('type');
|
|
|
|
var word_list_str = $("#word_list_str"+chkType).val();
|
|
|
|
|
|
|
|
$('.form_essayWords').addClass('disNone');
|
|
|
|
if(word_list_str){
|
|
|
|
var word_list = word_list_str.split(",");
|
|
|
|
if(word_list.length>0){
|
|
|
|
$('.form_essayWords').removeClass('disNone');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$('.pay_every').click(function(e){
|
|
|
|
if ($('.pay_every').hasClass('pay_active')) {
|
|
|
|
$('.pay_every').removeClass('pay_active')
|
|
|
|
}
|
|
|
|
$(this).addClass('pay_active')
|
|
|
|
let pay_type = $('.pay_active').attr('pay_type');
|
|
|
|
allPostData = {...allPostData,pay_type}
|
|
|
|
// $('#totalMoney').text('')
|
|
|
|
payAction()
|
|
|
|
// getPayQrcode(postData,check_flag)
|
|
|
|
|
|
|
|
})
|
|
|
|
$('.close_modal').on('click',function(e){
|
|
|
|
$('.pageMask').addClass('hide');
|
|
|
|
if(!$('.pay_complete_modal').hasClass('hide')){
|
|
|
|
$('.pay_complete_modal').addClass('hide');
|
|
|
|
|
|
|
|
}else{
|
|
|
|
$('.payModal').addClass('hide');
|
|
|
|
if(!$('.payModal .pay_detail').hasClass('hide')){
|
|
|
|
$('.payModal .pay_detail').addClass('hide')
|
|
|
|
}
|
|
|
|
if($('.payModal .modal_mes').hasClass('hide')){
|
|
|
|
$('.payModal .modal_mes').removeClass('hide')
|
|
|
|
}
|
|
|
|
if($('.payModal .pay_content').hasClass('hide')){
|
|
|
|
$('.payModal.pay_content').removeClass('hide')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
clearTimeout(payResultTimer);
|
|
|
|
})
|
|
|
|
function getPayType() {
|
|
|
|
var paytype = $('.pay_active').attr('pay_type');
|
|
|
|
return paytype;
|
|
|
|
}
|
|
|
|
function payAction(){
|
|
|
|
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().trim();
|
|
|
|
// goods_id 0
|
|
|
|
// const postData = {
|
|
|
|
// title:'88',
|
|
|
|
// check_type,
|
|
|
|
// pay_type,
|
|
|
|
// get_pay_goods:'1',
|
|
|
|
// aiessay_wordnum:'3000',
|
|
|
|
// // recharge_goods_id:'0',
|
|
|
|
// // value_added_services:''//增值服务
|
|
|
|
// }
|
|
|
|
if(check_type == '') {
|
|
|
|
alert('提交类型不合法');
|
|
|
|
errorJump();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
const postData = {
|
|
|
|
title,
|
|
|
|
check_type,
|
|
|
|
pay_type,
|
|
|
|
get_pay_goods: '1',
|
|
|
|
}
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}else if(check_type == '96'){
|
|
|
|
if(title.length >100){
|
|
|
|
alert('论文标题不得多于200字');
|
|
|
|
$('.inputChange').val('')//重置输入框文本
|
|
|
|
$('.inputText').text('0/200')
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(check_type == '96'){
|
|
|
|
var pptid = pptUrlList[old_parent_ppt]['ppt_id'];
|
|
|
|
var upload_file_md5 = $("#upload_file_md5").val();
|
|
|
|
var upload_file_name = $("#upload_file_name").val();
|
|
|
|
var upload_file_tmpname = $("#upload_file_tmpname").val();
|
|
|
|
|
|
|
|
if (!upload_file_md5 || !upload_file_name || !upload_file_tmpname) {
|
|
|
|
alert("请上传论文文件");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (!pptid) {
|
|
|
|
alert("请选择ppt模板");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
postData.ppt_tpl = pptid;
|
|
|
|
postData.upload_file_md5 = upload_file_md5;
|
|
|
|
postData.upload_file_name = upload_file_name;
|
|
|
|
postData.upload_file_tmpname = upload_file_tmpname;
|
|
|
|
}
|
|
|
|
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()
|
|
|
|
})
|
|
|
|
function getPayQrcode(postData){
|
|
|
|
$.ajax({
|
|
|
|
type: "post",
|
|
|
|
url: '/bd_buy_click_log',
|
|
|
|
async:false,
|
|
|
|
success: function(jsondata2) {
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
type: "post",
|
|
|
|
dataType:'json',
|
|
|
|
url: service_domain + allPostData.check_flag+'/ajax_check_aisubmit',
|
|
|
|
data: {
|
|
|
|
...postData
|
|
|
|
},
|
|
|
|
success: function (res) {
|
|
|
|
if(res.data.user_not_enough_money) {
|
|
|
|
if(isPayDialog){
|
|
|
|
$('.pageMask').addClass('hide');
|
|
|
|
$('.payModal').addClass('hide');
|
|
|
|
}
|
|
|
|
$('.pageMask').removeClass('hide');
|
|
|
|
$('.payModal').removeClass('hide');
|
|
|
|
$('.pay_message').html(`<span>写作题目:</span><p>`+ postData.title+`</p>
|
|
|
|
<span>写作类型:</span><p>`+ checkTypeList[postData.check_type]+`</p>
|
|
|
|
<span>订单金额:</span><p style="color: #E65628;" class="pay_money">—— 元</p>`)
|
|
|
|
|
|
|
|
// $('.payCode').removeClass('hide');
|
|
|
|
// $('.pay_content').html = $('#payCode').html
|
|
|
|
isPayDialog = true
|
|
|
|
if(postData.pay_type == 2 || postData.pay_type == 3){
|
|
|
|
getRechargePayUrl()
|
|
|
|
// getRechargeGoods(payInfo, configData);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
function getRechargePayUrl(){
|
|
|
|
var core_content = $('.coreWordCount').val();
|
|
|
|
var postData1 = new Object();
|
|
|
|
postData1.type = allPostData.check_type;
|
|
|
|
postData1.pay_type = allPostData.pay_type;
|
|
|
|
// postData1.value_added_services = configData.addedServicesStr;//增值服务
|
|
|
|
// 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;
|
|
|
|
// 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()//核心内容
|
|
|
|
}
|
|
|
|
if(postData1.type == '96'){
|
|
|
|
var pptid = pptUrlList[old_parent_ppt]['ppt_id'];
|
|
|
|
var upload_file_md5 = $("#upload_file_md5").val();
|
|
|
|
var upload_file_name = $("#upload_file_name").val();
|
|
|
|
var upload_file_tmpname = $("#upload_file_tmpname").val();
|
|
|
|
postData1.ppt_tpl = pptid;
|
|
|
|
postData1.recharge_goods_id=0
|
|
|
|
postData1.upload_file_md5 = upload_file_md5;
|
|
|
|
postData1.upload_file_name = upload_file_name;
|
|
|
|
postData1.upload_file_tmpname = upload_file_tmpname;
|
|
|
|
}
|
|
|
|
$.ajax({
|
|
|
|
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'
|
|
|
|
// },
|
|
|
|
success:function(res){
|
|
|
|
if(res.status){
|
|
|
|
$('#qrcode').html('');
|
|
|
|
$('#qrcode').attr('tid', res.data.tid);
|
|
|
|
$('#qrcode').attr('paytype', postData1.pay_type);
|
|
|
|
$('#totalMoney').text(res.data.total_fee)
|
|
|
|
$('.pay_money').text(res.data.total_fee + '元')
|
|
|
|
|
|
|
|
var qrcode = new QRCode(document.getElementById("qrcode"), {
|
|
|
|
text: res.data.qrcode_url,
|
|
|
|
width: 135,
|
|
|
|
height: 135,
|
|
|
|
colorDark : "#000000",
|
|
|
|
colorLight : "#ffffff",
|
|
|
|
correctLevel : QRCode.CorrectLevel.H
|
|
|
|
});
|
|
|
|
getRechargePayResult(res.data)
|
|
|
|
}else{
|
|
|
|
alert(res.info);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
error:function(){
|
|
|
|
alert('网络错误1');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function getRechargePayResult(payinfo){
|
|
|
|
console.log(payinfo,'payinfo');
|
|
|
|
clearTimeout(payResultTimer);
|
|
|
|
if (payinfo.tid) {
|
|
|
|
ptid = payinfo.tid;
|
|
|
|
}
|
|
|
|
$.ajax({
|
|
|
|
url:service_domain+ allPostData.check_flag +'/ajax_get_ai_pay_result',
|
|
|
|
type:'post',
|
|
|
|
dataType:'json',
|
|
|
|
data:{
|
|
|
|
tid:ptid,
|
|
|
|
pay_type:getPayType()
|
|
|
|
},
|
|
|
|
success:function(res){
|
|
|
|
if(res.status){
|
|
|
|
if(res.data.pay_status == 'NOTPAY') {
|
|
|
|
payResultTimer = setTimeout(function(){
|
|
|
|
getRechargePayResult(payinfo);
|
|
|
|
}, 2000);
|
|
|
|
return;
|
|
|
|
}else if(res.data.pay_status == 'SUCCESS'){
|
|
|
|
if(isPayDialog){
|
|
|
|
// $('.pageMask').addClass('hide');
|
|
|
|
$('.pay_content').addClass('hide');
|
|
|
|
$('.modal_mes').addClass('hide');
|
|
|
|
$('.pay_detail').removeClass('hide');
|
|
|
|
}
|
|
|
|
payresultAction(res)
|
|
|
|
}
|
|
|
|
clearTimeout(payResultTimer);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
clearTimeout(payResultTimer);
|
|
|
|
alert(res.info);
|
|
|
|
},
|
|
|
|
error:function(err){
|
|
|
|
alert('网络错误2');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
// payresultAction({data:{tid:'99237482378','wechat_qrcode_url':'iuyeriuweyi'}})
|
|
|
|
function payresultAction(res) {
|
|
|
|
var data = res.data;
|
|
|
|
if(data.wechat_qrcode_url){
|
|
|
|
$('#pay_succ_tid').text(data.tid)
|
|
|
|
$('#qrcode1').attr('src', data.wechat_qrcode_url);
|
|
|
|
}
|
|
|
|
$('.payresultBtn2').click(function(){
|
|
|
|
location.href = `${service_domain}report2?oid=${data.tid}`;
|
|
|
|
});
|
|
|
|
$('.payresultBtn1').click(function(){
|
|
|
|
if(isPayDialog) {
|
|
|
|
location.reload();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
$('#copy_tid').unbind('click');
|
|
|
|
var clipboard2 = new ClipboardJS('#copy_tid', {
|
|
|
|
text: function () {
|
|
|
|
return $('#pay_succ_tid').text();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
clipboard2.on('success', function(e) {
|
|
|
|
alert('复制成功')
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$('li').click(function(e) {
|
|
|
|
if ($('li').hasClass('active_select')) {
|
|
|
|
$('li').removeClass('active_select')
|
|
|
|
}
|
|
|
|
$(this).addClass('active_select')
|
|
|
|
var element = $('.step_back');
|
|
|
|
var element2 = $('.footer');
|
|
|
|
// $('.main_page').animate({
|
|
|
|
// scrollTop: 500
|
|
|
|
// }, 1000);
|
|
|
|
element.removeClass('stickyStep')
|
|
|
|
element2.removeClass('footer2')
|
|
|
|
// getWordCountList();
|
|
|
|
clearhisText()//清空记录
|
|
|
|
var t = $('li.active_select').attr('type');
|
|
|
|
// if(t =='96'){
|
|
|
|
// location.href = location.origin+'/aippt'
|
|
|
|
// return
|
|
|
|
// }
|
|
|
|
if(t =='94'){//字数
|
|
|
|
$('.form_essayWords').show();
|
|
|
|
$('.side_info').show();
|
|
|
|
$('.step_two').show()
|
|
|
|
$('.normal_step3').removeClass('step_three')
|
|
|
|
$('.key_words').addClass('hide')
|
|
|
|
$('.checkbox_wrap').show()
|
|
|
|
} else{
|
|
|
|
$('.checkbox_wrap').hide()
|
|
|
|
$('.step_two').hide()
|
|
|
|
$('.normal_step3').addClass('step_three')
|
|
|
|
$('.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()
|
|
|
|
$('.normal_step3').removeClass('step_three')
|
|
|
|
|
|
|
|
}else{
|
|
|
|
$('.btn_result').hide()
|
|
|
|
$('.btn_result_now').show()
|
|
|
|
$('.step_two').hide()
|
|
|
|
$('[step="2"]').show()
|
|
|
|
$('.normal_step3').addClass('step_three')
|
|
|
|
$('[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();
|
|
|
|
$('#charCount').html('0/200')
|
|
|
|
} 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')
|
|
|
|
}
|
|
|
|
if(t == '96'){
|
|
|
|
$('.inputText').attr('max','300')
|
|
|
|
$('.inputText').text('0/300')
|
|
|
|
$('.form_pptItem').show()
|
|
|
|
$('#formInputSumbtn').html('生成答辩PPT')
|
|
|
|
}else{
|
|
|
|
$('.form_pptItem').hide()
|
|
|
|
$('#formInputSumbtn').html('立即生成')
|
|
|
|
}
|
|
|
|
// $("#downdemo").attr('href', '/downreportdemo/type/'+t);
|
|
|
|
//图表公式
|
|
|
|
var table_formula_types = getTableFormulaTypes('support_table_formula_types');
|
|
|
|
if (table_formula_types) {
|
|
|
|
if (table_formula_types.indexOf(t) !== -1) {
|
|
|
|
$('#paper-table_and_formulas-wrapper').parent().show();
|
|
|
|
} else{
|
|
|
|
$('#paper-table_and_formulas-wrapper').parent().hide();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
changeLiActive(t,'support_titleMore','.normal_recommend_title')// 标题优化
|
|
|
|
changeLiActive(t,'support_pro','.custom-select')// 专业优化
|
|
|
|
changeLiActive(t,'support_edu','.formItem_pro')// 学历优化
|
|
|
|
window.scrollTo({ top: 200, behavior: 'smooth' })
|
|
|
|
// if($('.custom-select').hasClass('disNone') && $('.opt-advise').hasClass('disNone')){}
|
|
|
|
});
|
|
|
|
|
|
|
|
function changeLiActive(t,attr_type,ele){
|
|
|
|
var support_titleMore = getTableFormulaTypes(attr_type);
|
|
|
|
if (support_titleMore) {
|
|
|
|
if (support_titleMore.indexOf(t) !== -1) {
|
|
|
|
$(ele).removeClass('disNone');
|
|
|
|
// $(ele).css('display','block')
|
|
|
|
} else{
|
|
|
|
$(ele).addClass('disNone');
|
|
|
|
// $(ele).css('display','none')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function getTableFormulaTypes(attr_type) {
|
|
|
|
var support_table_formula_types = $("#htmlconfig").attr(attr_type);
|
|
|
|
if (!support_table_formula_types) return '';
|
|
|
|
|
|
|
|
var support_table_formula_types_arr = support_table_formula_types.split(",");
|
|
|
|
return support_table_formula_types_arr;
|
|
|
|
}
|
|
|
|
pptUrlList = pptUrlList.map((item,ind)=>{
|
|
|
|
let list = [];
|
|
|
|
let num = 8;
|
|
|
|
for(let i=0;i<num;i++){
|
|
|
|
let url = `${cssurl}ppt_${ind+1}_${i+1}.png`
|
|
|
|
list.push(url)
|
|
|
|
}
|
|
|
|
item.url = `${cssurl}ppt_${ind+1}.png`;
|
|
|
|
list.unshift(item.url)
|
|
|
|
return {
|
|
|
|
...item,
|
|
|
|
list
|
|
|
|
}
|
|
|
|
})
|
|
|
|
// if ($('.form_pptItem').css('display') !== 'none') {
|
|
|
|
let html = '';
|
|
|
|
let pptlist = [...pptUrlList]
|
|
|
|
// ppt_item_active
|
|
|
|
pptlist.forEach((item,i)=>{
|
|
|
|
html += `<div class="ppt_tem_item point " index=`+i+`>
|
|
|
|
<img class="pptImg" src=`+ item.url + ` alt="" ppt_id=`+ item.ppt_id+` index=`+i+`>
|
|
|
|
<div class="firstlook ft14" index=`+i+`>预览</div>
|
|
|
|
<img src="./style/img/ppt_tem_select.png" class="ppt_select" alt="">
|
|
|
|
<p class="ft12">`+item.name +`</p>
|
|
|
|
</div>`
|
|
|
|
})
|
|
|
|
$('.ppt_temList').html(html);
|
|
|
|
|
|
|
|
// }
|
|
|
|
//附图片
|
|
|
|
//初识设置
|
|
|
|
function setLeftShow(key){
|
|
|
|
if(!$('.look_PPT_modal').hasClass('hide')){
|
|
|
|
let html = '';
|
|
|
|
let childList = []
|
|
|
|
childList = pptUrlList[key]['list']
|
|
|
|
childList.forEach((item,i)=>{
|
|
|
|
html += `<img class="gallery_img point" src=`+ item +` index=` + i + ` alt="图片丢失。。。">`
|
|
|
|
})
|
|
|
|
$('.gallery').html(html);
|
|
|
|
$('.gallery_img').eq(child_ppt).addClass('ppt_child_active');
|
|
|
|
setBackImgUrl(childList[child_ppt],true)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 弹窗模版
|
|
|
|
$('.look_right .pptImg').click(function(e){
|
|
|
|
let index = $(this).attr('index');
|
|
|
|
setLookPPT_active(index)
|
|
|
|
new_parent_ppt = index;
|
|
|
|
child_ppt = 0;
|
|
|
|
setLeftShow(new_parent_ppt)
|
|
|
|
})
|
|
|
|
//页面模版
|
|
|
|
$('.form_pptItem .pptImg').click(function(e){
|
|
|
|
let index = $(this).attr('index');
|
|
|
|
setPagePPT_active(index)
|
|
|
|
old_parent_ppt = new_parent_ppt = index;
|
|
|
|
child_ppt = 0;
|
|
|
|
setLeftShow(old_parent_ppt)
|
|
|
|
})
|
|
|
|
function setPagePPT_active(index){
|
|
|
|
$('.form_pptItem .ppt_tem_item').removeClass('ppt_item_active')
|
|
|
|
$('.form_pptItem .ppt_tem_item').eq(index).addClass('ppt_item_active');
|
|
|
|
}
|
|
|
|
function setLookPPT_active(index){
|
|
|
|
$('.look_right .ppt_tem_item').removeClass('ppt_item_active')
|
|
|
|
$('.look_right .ppt_tem_item').eq(index).addClass('ppt_item_active');
|
|
|
|
}
|
|
|
|
//子图片
|
|
|
|
$('.gallery_img').unbind('click')
|
|
|
|
$('.gallery').on('click','.gallery_img',function(){
|
|
|
|
let index = $(this).attr('index');
|
|
|
|
let src = $(this).attr('src');
|
|
|
|
$('.gallery_img').removeClass('ppt_child_active')
|
|
|
|
$('.gallery_img').eq(index).addClass('ppt_child_active');
|
|
|
|
child_ppt = index;
|
|
|
|
setBackImgUrl(src,false)
|
|
|
|
})
|
|
|
|
function setBackImgUrl(url,flag){
|
|
|
|
$('.topimg').attr('src',url)
|
|
|
|
if(!flag)return
|
|
|
|
$('.look_backImg').attr('src',url)
|
|
|
|
}
|
|
|
|
|
|
|
|
$('.lookAll').click(function(e){
|
|
|
|
$('.look_PPT_modal').removeClass('hide')
|
|
|
|
if (!$('.look_PPT_modal').hasClass('hide')) {
|
|
|
|
if(old_parent_ppt !== null){
|
|
|
|
setLookPPT_active(old_parent_ppt)
|
|
|
|
}else{
|
|
|
|
setLookPPT_active(0)
|
|
|
|
}
|
|
|
|
setLeftShow(old_parent_ppt != null ? old_parent_ppt : 0)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
$('.firstlook').click(function(e){
|
|
|
|
let index = $(this).attr('index');
|
|
|
|
old_parent_ppt = index;
|
|
|
|
child_ppt = 0;
|
|
|
|
$('.look_PPT_modal').removeClass('hide')
|
|
|
|
setLookPPT_active(old_parent_ppt)
|
|
|
|
setLeftShow(old_parent_ppt)
|
|
|
|
})
|
|
|
|
$('.exitLook,.ppt_cancel').click(function(e){
|
|
|
|
$('.look_PPT_modal').addClass('hide')
|
|
|
|
})
|
|
|
|
$('.ppt_submit').click(function(e){
|
|
|
|
old_parent_ppt = new_parent_ppt;
|
|
|
|
setPagePPT_active(old_parent_ppt)
|
|
|
|
$('.look_PPT_modal').addClass('hide')
|
|
|
|
})
|
|
|
|
|
|
|
|
$(function(){
|
|
|
|
bindFileUpload();
|
|
|
|
});
|
|
|
|
function bindFileUpload() {
|
|
|
|
var formData = new FormData();
|
|
|
|
$('.uploadShow').on('click', function (event) {
|
|
|
|
$('#fileUpload').trigger('click')
|
|
|
|
})
|
|
|
|
$('#againBtn').on('click', function (event) {
|
|
|
|
$('#fileUpload').trigger('click')
|
|
|
|
})
|
|
|
|
$('#cancleBtn').click(function(){
|
|
|
|
formData = new FormData();
|
|
|
|
$('.uploadMes').html('')
|
|
|
|
})
|
|
|
|
$('#fileUpload').on('change', function () {
|
|
|
|
$('#againBtn').addClass('hide')
|
|
|
|
var fileInput = $(this);
|
|
|
|
var files = fileInput.prop('files');
|
|
|
|
var file = files[0]; // 获取文件
|
|
|
|
console.log(files,file.name,'======');
|
|
|
|
if (file) {
|
|
|
|
// 这里可以添加上传文件之前的逻辑,例如文件验证
|
|
|
|
// 创建FormData对象
|
|
|
|
formData.append('paper_file', file);
|
|
|
|
formData.append('paper_type', '1');
|
|
|
|
formData.append('is_asynch', '1');
|
|
|
|
formData.append('ver_chktype', $("#ppt_type").val());
|
|
|
|
// 使用jQuery AJAX上传文件
|
|
|
|
$.ajax({
|
|
|
|
url: 'https://aitest.chachongz.com'+'/upload_file',
|
|
|
|
type: 'POST',
|
|
|
|
data: formData,
|
|
|
|
dataType: 'json',
|
|
|
|
processData: false, // 告诉jQuery不要处理发送的数据
|
|
|
|
contentType: false, // 告诉jQuery不要设置Content-Type请求头
|
|
|
|
xhr: function () {
|
|
|
|
$(".uploadShow").addClass('hide');
|
|
|
|
$(".uploadMesShow").removeClass('hide');
|
|
|
|
$(".uploadMes").removeClass('hide');
|
|
|
|
$('#cancleBtn').removeClass('hide')
|
|
|
|
|
|
|
|
var xhr = $.ajaxSettings.xhr();
|
|
|
|
if (xhr.upload) {
|
|
|
|
$(".fileName").html(file.name);
|
|
|
|
|
|
|
|
xhr.upload.addEventListener('progress', function (e) {
|
|
|
|
if (e.lengthComputable) {
|
|
|
|
var progress = Math.ceil((e.loaded / e.total) * 100);
|
|
|
|
console.log('progress', progress)
|
|
|
|
$('.uploadMes').html('上传中......' + progress + '%');
|
|
|
|
}
|
|
|
|
}, false);
|
|
|
|
}
|
|
|
|
return xhr;
|
|
|
|
},
|
|
|
|
success: function (res) {
|
|
|
|
// 成功回调
|
|
|
|
// res = fileMockData
|
|
|
|
console.log('File uploaded successfully:', res);
|
|
|
|
if (res.status) {
|
|
|
|
$(".uploadShow").addClass('hide');
|
|
|
|
$("#cancleBtn").addClass('hide');
|
|
|
|
$(".uploadMes").html('上传成功');
|
|
|
|
$(".uploadMes").removeClass('hide');
|
|
|
|
|
|
|
|
$('#againBtn').removeClass('hide')
|
|
|
|
$("#upload_file_md5").val(res.data.upload_file_md5);
|
|
|
|
$("#upload_file_name").val(res.data.upload_file_name);
|
|
|
|
$("#upload_file_tmpname").val(res.data.upload_file_tmpname);
|
|
|
|
} else {
|
|
|
|
$(".uploadShow").addClass('hide');
|
|
|
|
$(".uploadMes").html(res.info);
|
|
|
|
$("#cancleBtn").addClass('hide');
|
|
|
|
$('#againBtn').removeClass('hide')
|
|
|
|
$('.uploadMes').addClass("uploadfile-error");
|
|
|
|
$(".uploadMes").removeClass('hide');
|
|
|
|
}
|
|
|
|
},
|
|
|
|
error: function (jqXHR, textStatus, errorThrown) {
|
|
|
|
// 错误回调
|
|
|
|
console.log('File upload failed:', textStatus);
|
|
|
|
$(".uploadShow").addClass('hide');
|
|
|
|
$('.uploadMes').html('解析失败!请检查文件重新上传');
|
|
|
|
$('.uploadMes').addClass("uploadfile-error");
|
|
|
|
$(".uploadMes").removeClass('hide');
|
|
|
|
$('#againBtn').removeClass('hide')
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// 报告查找
|
|
|
|
$('#searchReport').click(function(){
|
|
|
|
searchOrder()
|
|
|
|
})
|
|
|
|
|
|
|
|
function searchOrder() {
|
|
|
|
var tid = $('.report_input').val();
|
|
|
|
searchOrderByTid(tid);
|
|
|
|
}
|
|
|
|
function searchOrderByTid(tid){
|
|
|
|
tid = tid.trim();
|
|
|
|
if(!tid.trim || tid.length<=0){
|
|
|
|
alert('订单编号不能为空');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
url:service_domain + '/ajax_search_order?tid='+tid,
|
|
|
|
dataType:'json',
|
|
|
|
type:'get',
|
|
|
|
success:function(res){
|
|
|
|
$('.main_top').html('');
|
|
|
|
if (res.status && res.data.report_list) {
|
|
|
|
$('.empty').hide()
|
|
|
|
$('.report_main').show()
|
|
|
|
$('.downLoad').hide()
|
|
|
|
for(var i=0; i<res.data.report_list.length;i++) {
|
|
|
|
var reportinfo = res.data.report_list[i];
|
|
|
|
if(reportinfo.status.num == 5){
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
var obj = '';
|
|
|
|
obj += `<div class="main_item">
|
|
|
|
<label>订单编号:</label>
|
|
|
|
<p>`+reportinfo.tid+`</p>
|
|
|
|
</div>`
|
|
|
|
obj += `<div class="main_item">
|
|
|
|
<label>类  型:</label>
|
|
|
|
<p>`+reportinfo.type+`</p>
|
|
|
|
</div>`
|
|
|
|
obj += `<div class="main_item">
|
|
|
|
<label>标  题:</label>
|
|
|
|
<p>`+reportinfo.title+`</p>
|
|
|
|
</div>`
|
|
|
|
obj += `<div class="main_item">
|
|
|
|
<label>上传时间:</label>
|
|
|
|
<p>`+reportinfo.add_date+`</p>
|
|
|
|
</div>`
|
|
|
|
if(reportinfo.status.num == 1){
|
|
|
|
obj += `<div class="main_item">
|
|
|
|
<label>状  态:</label>
|
|
|
|
<p class="report_finish"><img src="./style/img/report_finish.svg" alt=""/>完成</p>
|
|
|
|
</div>`
|
|
|
|
obj += `<div class="main_item">
|
|
|
|
<label>完成时间:</label>
|
|
|
|
<p>`+reportinfo.report_date+`</p>
|
|
|
|
</div>`
|
|
|
|
$('.downLoad').show()
|
|
|
|
$('.downLoad').attr('herf',service_domain+'downreport/sid/'+reportinfo.sid+'/tid/'+tid)
|
|
|
|
}
|
|
|
|
// else if(reportinfo.status.num == 2) {
|
|
|
|
// obj += '<tr><td class="result-td1">状态:</td><td class="result-td2 result-status-waring">取消('+reportinfo.status.extra+')</td></tr>';
|
|
|
|
|
|
|
|
// } else if(reportinfo.status.num == 6) {
|
|
|
|
// obj += '<tr><td class="result-td1">状态:</td><td class="result-td2 result-status-waring">暂停('+reportinfo.status.extra+')</td></tr>';
|
|
|
|
|
|
|
|
// }
|
|
|
|
else {
|
|
|
|
obj += `<div class="main_item">
|
|
|
|
<label>状  态:</label>
|
|
|
|
<p class="waiting">进行中,请等待</p>
|
|
|
|
</div>`
|
|
|
|
obj += `<div class="main_item">
|
|
|
|
<label>完成时间:</label>
|
|
|
|
<p style="opacity:.6;">—— ——</p>
|
|
|
|
</div>`
|
|
|
|
}
|
|
|
|
$('.main_top').append(obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
if($('.main_top').html() == '') {
|
|
|
|
$('.empty').show()
|
|
|
|
$('.report_main').hide()
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
$('.empty').show()
|
|
|
|
$('.report_main').hide()
|
|
|
|
}
|
|
|
|
},
|
|
|
|
error:function(){
|
|
|
|
alert('请求失败');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
$('.downLoad').click(function(){
|
|
|
|
let href = $('.downLoad').attr('herf');
|
|
|
|
location.href = href
|
|
|
|
})
|
|
|
|
$('.report_ques').hover(function(){
|
|
|
|
$('.findtid-wrap').removeClass('hide');
|
|
|
|
},function(){
|
|
|
|
$('.findtid-wrap').addClass('hide');
|
|
|
|
$('.findtid-wrap').find('li').removeClass('select');
|
|
|
|
$('.findtid-wrap').find('li').eq(0).addClass('select');
|
|
|
|
$('.findtid-wrap').find('img').addClass('hide');
|
|
|
|
$('.findtid-wrap').find('img').eq(0).removeClass('hide');
|
|
|
|
});
|
|
|
|
$('.findtid-wrap').hover(function(){
|
|
|
|
$('.findtid-wrap').removeClass('hide');
|
|
|
|
},function(){
|
|
|
|
$('.findtid-wrap').addClass('hide');
|
|
|
|
$('.findtid-wrap').find('li').removeClass('select');
|
|
|
|
$('.findtid-wrap').find('li').eq(0).addClass('select');
|
|
|
|
$('.findtid-wrap').find('img').addClass('hide');
|
|
|
|
$('.findtid-wrap').find('img').eq(0).removeClass('hide');
|
|
|
|
});
|
|
|
|
$('.findtid-wrap').find('li').hover(function(){
|
|
|
|
$('.findtid-wrap').find('li').removeClass('select');
|
|
|
|
$('.findtid-wrap').find('li').eq($(this).index()).addClass('select');
|
|
|
|
$('.findtid-wrap').find('img').addClass('hide');
|
|
|
|
$('.findtid-wrap').find('img').eq($(this).index()).removeClass('hide');
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
});
|