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.
1497 lines
60 KiB
1497 lines
60 KiB
$(document).ready(function() {
|
|
var notRadio = '';
|
|
var yesRadio = '';
|
|
var notChecked = '';
|
|
var checked = '';
|
|
var payResultTimer = null;
|
|
var service_domain = location.origin+'/';
|
|
// var service_domain = 'https://www.90616.com/'
|
|
// 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 add_ppt = 0;//增值服务的ppt
|
|
var child_ppt = 0;
|
|
var check_type = '94'
|
|
var child_src = ''
|
|
var curTypeWordsData = {}
|
|
var allAiServicesData = {}
|
|
var value_added_servicesList = null;
|
|
var value_added_select = [];//已选择的增值服务
|
|
var stepFlag = false;
|
|
var table_and_formulas = '';
|
|
var noCheckList = ['62','63','81']
|
|
var cssurl = $('#styleUrl').attr('url');
|
|
// 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':'职称论文',
|
|
'97':'职称论文',
|
|
'62':'开题报告',
|
|
'64':'论文选题',
|
|
'91':'文献综述',
|
|
'96':'答辩PPT',
|
|
'63':'任务书',
|
|
'82':'英文论文',
|
|
}
|
|
var tableType={
|
|
'1':'图片',
|
|
'2':'表格',
|
|
'3':'公式',
|
|
'4':'代码',
|
|
}
|
|
var addservicedsDescList = [
|
|
{
|
|
title:'论文封面',
|
|
desc:'贴合学校查重结果,原创力MAX'
|
|
},
|
|
{
|
|
title:'论文封面',
|
|
desc:'规范整洁的第一页很重要哦'
|
|
},
|
|
{
|
|
title:'论文提纲',
|
|
desc:'对应正文内容,赠送提纲'
|
|
},
|
|
{
|
|
title:'论文摘要',
|
|
desc:'精炼总结,一眼抓住研究核心'
|
|
},
|
|
{
|
|
title:'论文致谢',
|
|
desc:'感恩有“你”,温馨致谢'
|
|
},
|
|
{
|
|
title:'参考文献',
|
|
desc:'权威引用,规范格式,真实可查'
|
|
}
|
|
]
|
|
// window.addEventListener('resize', function(event) {
|
|
// console.log('页面大小变化了!');
|
|
// console.log('宽度:', window.innerWidth);
|
|
// console.log('高度:', window.innerHeight);
|
|
// // if(window.innerHeight> 347*2){
|
|
// // $('.look_backImg').css('width',347*(740/428))
|
|
// // }
|
|
// });
|
|
$(function(){
|
|
bindFileUpload();
|
|
initFun()
|
|
});
|
|
function initFun(){
|
|
getadd_Value('94')
|
|
getWordsCount()
|
|
scrollView()
|
|
}
|
|
// 渲染字数数据
|
|
|
|
function getWordsCount(){
|
|
$.ajax({
|
|
type: "post",
|
|
dataType:'json',
|
|
url: service_domain +'ajax_get_ai_services',
|
|
data: {
|
|
// type
|
|
},
|
|
success:function(res){
|
|
if(res.status){
|
|
allAiServicesData = res.data.ai_input_config;
|
|
getCurWordsCount()
|
|
}
|
|
},
|
|
error:function(err){
|
|
|
|
}
|
|
})
|
|
}
|
|
function getCurWordsCount(){
|
|
var wordsData = allAiServicesData[check_type]['major2wordcount'];
|
|
if(wordsData){
|
|
var edu = parseInt($('#educationRight').find('.edu_active_select input').val());
|
|
// var edu1 = parseInt($('#educationRight').find('input[type="radio"]:checked').val());
|
|
renderWordsHtml(wordsData[edu])
|
|
}
|
|
}
|
|
function renderWordsHtml(data){
|
|
var html1 = ''
|
|
data.forEach(item=>{
|
|
html1 += ` <div class="essayWords">
|
|
<input value="`+ item +`" type="radio" name="wordnums" >
|
|
<div></div>
|
|
<label>约`+ item+`字</label>
|
|
</div>`
|
|
})
|
|
$('.words_content').html(html1)
|
|
}
|
|
$('.words_content').on('click', '.essayWords input', function () {
|
|
$('.words_content .essayWords').removeClass('essayWords_active');
|
|
$(this).parent().addClass('essayWords_active');
|
|
})
|
|
$('#educationRight').on('click', '.education input', function () {
|
|
$('#educationRight .education').removeClass('edu_active_select');
|
|
$(this).parent().addClass('edu_active_select');
|
|
if(check_type == '94'){
|
|
getCurWordsCount()
|
|
}
|
|
})
|
|
//首页增值服务相关展示
|
|
let servicedsHtml = ''
|
|
addservicedsDescList.forEach((item,i)=>{
|
|
var url = `${cssurl}/img/gift${i+1}.svg`
|
|
servicedsHtml += ` <div class="listMes_item">
|
|
<b><img src="`+ url +`" alt=""> `+item.title+` <span>X1</span></b>
|
|
<p>`+item.desc+` </p>
|
|
</div>`
|
|
})
|
|
$('.left_ai_listMes').html(servicedsHtml)
|
|
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="`+cssurl+`/img/pay_wx.svg" alt="">
|
|
<span>微信支付</span>
|
|
<img class="pay_icon" src="`+ cssurl +`/img/pay_icon.svg" alt="">
|
|
</div>
|
|
<div class="pay_every" pay_type="3">
|
|
<img src="`+ cssurl +`/img/pay_zfb.svg" alt="">
|
|
<span>支付宝支付</span>
|
|
<img class="pay_icon" src="`+ cssurl +`/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="`+ cssurl +`/img/pay_succ.svg" alt="">
|
|
支付成功!订单号是下载范文唯一凭证
|
|
</div>
|
|
<div class="pay_succ_content">
|
|
<img id="qrcode1" src="" alt="">
|
|
<div class="pay_succ_right">
|
|
<p>
|
|
<img src="`+ cssurl +`/img/succ_tip_icon.svg" alt="">
|
|
微信扫码,随时获知生成状态
|
|
</p>
|
|
<p>
|
|
订单号:<span id="pay_succ_tid">OIY898998787721878233</span>
|
|
<img src="`+ cssurl +`/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="`+ cssurl +`/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);
|
|
// });
|
|
|
|
// 首页增值服务相关
|
|
var add_item_valueText = {
|
|
'62':'选题正文一步到位',
|
|
'63':'导师看了都说好',
|
|
'96':'可自定义风格,答辩最靓的仔',
|
|
}
|
|
var add_item_valueUrl = {
|
|
'62': cssurl +'/img/kaiti_preview.png',
|
|
'63': cssurl +'/img/renwushu_preview.png',
|
|
'96':'',
|
|
'AIGC': cssurl +'/img/AIGC_preview.png'
|
|
}
|
|
function getadd_Value(type){
|
|
$.ajax({
|
|
type: "post",
|
|
dataType:'json',
|
|
url: service_domain +'ajax_get_value_added_services',
|
|
data: {
|
|
type
|
|
},
|
|
|
|
success:function(res){
|
|
if(res.status){
|
|
let addListBoxHtml = ''
|
|
value_added_servicesList = Object.values(res.data.value_added_services);
|
|
value_added_servicesList.forEach((item,i)=>{
|
|
if(item.type != '96'){
|
|
addListBoxHtml+= `<div class="add_item flex add_active add_item`+item.type+`" type=`+item.type+`>
|
|
<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">
|
|
<b>预览</b>
|
|
<div class="img ">
|
|
<img class="preview" src=`+add_item_valueUrl[item.type]+` alt="">
|
|
</div>
|
|
</span>
|
|
</div>`
|
|
}else{
|
|
addListBoxHtml+= `<div class="add_item add_ppt_item add_active flex" type=`+item.type+`>
|
|
<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 class="add_lookPPT point">
|
|
<span id="cur_ppt_selectName">清新绿意通用模板</span>
|
|
<img src="`+ cssurl+`/img/add_lookppt_icon.svg" alt="">
|
|
</p>
|
|
</div>
|
|
</div>`
|
|
}
|
|
})
|
|
$('.addListBox').html(addListBoxHtml)
|
|
// $('.addListBox')
|
|
}else{
|
|
alert(res.info)
|
|
}
|
|
|
|
},
|
|
error:function(){
|
|
alert('网络错误1');
|
|
}
|
|
})
|
|
}
|
|
$('.btn_mast').click(function(){
|
|
stepFlag = true;
|
|
geiAiUpgradeInfo(createCatalogue)
|
|
})
|
|
function createCatalogue() {
|
|
if (!$('.agree-item').hasClass('active')) {
|
|
alert("请阅读并勾选同意《服务条款》");
|
|
return;
|
|
}
|
|
var chkType = $('li.active_select').attr('type');
|
|
$.ajax({
|
|
type: "post",
|
|
url: service_domain + '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;
|
|
}
|
|
let pathType = {
|
|
'94': 'aiessayzx',
|
|
'82': 'aiessayen'
|
|
}
|
|
var title = $(".inputChange").val();
|
|
var r = checkTitle(title);
|
|
if (!r) return;
|
|
var edu = parseInt($('#educationRight').find('input[type="radio"]:checked').val());
|
|
if (edu <= 0 || !edu) {
|
|
alert("请选择您的学历");
|
|
return;
|
|
}
|
|
if (chkType != '82' && $('.form_essayWords').css('display') !== 'none') {
|
|
var wordnums = parseInt($('input[type="radio"][name="wordnums"]:checked').val());
|
|
if (wordnums <= 0 || isNaN(wordnums)) {
|
|
alert("请选择您的字数");
|
|
return;
|
|
}
|
|
}
|
|
|
|
var major = parseInt($('.dropdown-input').attr('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 = service_domain + pathType[chkType] + "/catalogue?title=" + encodeURIComponent(title);
|
|
// var url = data.data.agent_domain + "/catalogue?title=" + encodeURIComponent(title);
|
|
var content_min_limit = $("#htmlconfig").attr('content_min_limit');
|
|
if ($('.coreContent').css('display') !== 'none') {
|
|
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').css('display') !== 'none') {
|
|
url += '&aiessay_wordnum=' + wordnums;
|
|
}
|
|
if (major) url += '&major=' + major;
|
|
if (edu) url += '&edu=' + edu;
|
|
if (stepFlag) {
|
|
showNextStep(title, chkType, wordnums, eduObj, edu)
|
|
return
|
|
}
|
|
setTimeout(() => {
|
|
window.open(url);
|
|
}, 1500)
|
|
}
|
|
});
|
|
}
|
|
function showNextStep(title, chkType, wordnums, eduObj, edu) {
|
|
//修改步骤条状态
|
|
$('.step_line').removeClass('suc_step_line')
|
|
$('.normal_step').removeClass('active_step')
|
|
$('.step_line').eq(0).addClass('suc_step_line')
|
|
$('.step_line').eq(1).addClass('suc_step_line')
|
|
$('.normal_step').eq(0).addClass('success_step')
|
|
$('.normal_step').eq(1).addClass('success_step')
|
|
$('.normal_step').eq(2).addClass('active_step')
|
|
// $('.step_add_three').removeClass('hide')
|
|
// $('#mainText').html(title)
|
|
// $('.user_none').removeClass('hide')//禁用
|
|
// if (chkType != '82') {
|
|
// let mainEduWords = eduObj[edu] + '·约' + wordnums + '字'
|
|
// $('.step_add_three .mainEduWords').html(mainEduWords)
|
|
// } else {
|
|
// $('.step_add_three .mainEduWords').html(eduObj[edu])
|
|
// }
|
|
// if (chkType == '94') {
|
|
// window.scrollTo({ top: 1000, behavior: 'smooth' })
|
|
// } else {
|
|
// window.scrollTo({ top: 800, behavior: 'smooth' })
|
|
// }
|
|
showPayModal()
|
|
}
|
|
function geiAiUpgradeInfo(callback, param) {
|
|
$.ajax({
|
|
type: "post",
|
|
url: service_domain + '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);
|
|
}
|
|
});
|
|
}
|
|
$('.addListBox').on('click','.add_lookPPT',function(){
|
|
$('.look_PPT_modal').removeClass('hide')
|
|
if (!$('.look_PPT_modal').hasClass('hide')) {
|
|
if(add_ppt !== null){
|
|
setLookPPT_active(add_ppt)
|
|
}else{
|
|
setLookPPT_active(0)
|
|
}
|
|
setLeftShow(add_ppt != null ? add_ppt : 0)
|
|
}
|
|
})
|
|
// 增值服务 选择
|
|
$('.addListBox').on('click','.title',function(){
|
|
if ($(this).parent().parent().hasClass('add_active')) {
|
|
$(this).parent().parent().removeClass('add_active');
|
|
payAction()
|
|
return;
|
|
}
|
|
$(this).parent().parent().addClass('add_active')
|
|
payAction()
|
|
})
|
|
//点击生成
|
|
// $('#click_AI_moretext').click(function(){
|
|
function showPayModal(){
|
|
var wordnums = parseInt($('input[type="radio"][name="wordnums"]:checked').val());
|
|
let title = $('.inputChange').val();
|
|
// pay_completeDetailMes
|
|
let html1 = ''
|
|
html1 += `<div class="detailMesItem flex">
|
|
<span class="lable">写作题目:</span>
|
|
<span class="content">`+title+`</span>
|
|
</div>`
|
|
html1 +=`<div class="detailMesItem flex">
|
|
<span class="lable">写作类型:</span>
|
|
<span class="content">`+checkTypeList[check_type]+`</span>
|
|
</div>`
|
|
|
|
html1 +=` <div class="detailMesItem flex">
|
|
<span class="lable">论文金额:</span>
|
|
<span class="content textPrice">---元</span>
|
|
</div>`
|
|
if(check_type == '94'){
|
|
html1 +=`<div class="detailMesItem flex">
|
|
<span class="lable">字  数:</span>
|
|
<span class="content">约`+wordnums+`字</span>
|
|
</div>`
|
|
var table_and_formulas_obj = $('#paper-table_and_formulas-wrapper').find('input:checked');
|
|
if(table_and_formulas_obj.length >0){
|
|
var table_and_formulas_text = [];
|
|
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_text = tableType[table_and_formulasval];
|
|
table_and_formulas = table_and_formulasval;
|
|
continue;
|
|
}
|
|
table_and_formulas += '' + table_and_formulasval;
|
|
table_and_formulas_text.push(tableType[table_and_formulasval])
|
|
}
|
|
html1 += ` <div class="detailMesItem flex">
|
|
<span class="lable">正文包含:</span>
|
|
<span class="content">`+table_and_formulas_text.join('、')+`</span>
|
|
</div>`
|
|
}
|
|
}
|
|
$('.pay_completeDetailMes').html(html1)
|
|
$('.pay_complete_main').html(payhtml)
|
|
payAction()
|
|
}
|
|
|
|
//step监听滚动位置
|
|
// new QRCode(document.getElementById("qrcode"), {
|
|
// text: 'weixin://wxpay/bizpayurl?pr=BbrGBgBz3',
|
|
// width: 135,
|
|
// height: 135,
|
|
// colorDark : "#000000",
|
|
// colorLight : "#ffffff",
|
|
// correctLevel : QRCode.CorrectLevel.H
|
|
// });
|
|
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')
|
|
}
|
|
});
|
|
$('.payModal_main').on('click','.pay_every',function(){
|
|
if ($('.payModal_main .pay_every').hasClass('pay_active')) {
|
|
$('.payModal_main .pay_every').removeClass('pay_active')
|
|
}
|
|
$(this).addClass('pay_active')
|
|
let pay_type = $('.pay_active').attr('pay_type');
|
|
allPostData = {...allPostData,pay_type}
|
|
payAction()
|
|
})
|
|
$('.pay_complete_main').on('click','.pay_every',function(){
|
|
if ($('.pay_complete_main .pay_every').hasClass('pay_active')) {
|
|
$('.pay_complete_main .pay_every').removeClass('pay_active')
|
|
}
|
|
$(this).addClass('pay_active')
|
|
let pay_type = $('.pay_active').attr('pay_type');
|
|
allPostData = {...allPostData,pay_type}
|
|
payAction()
|
|
})
|
|
$('.close_modal').on('click',function(e){
|
|
$('.pageMask').addClass('hide');
|
|
if(!$('.pay_complete_modal').hasClass('hide')){
|
|
$('.pay_complete_modal').addClass('hide');
|
|
if($('.pay_complete_modal .modal_mes').hasClass('hide')){
|
|
$('.pay_complete_modal .modal_mes').removeClass('hide')
|
|
}
|
|
if($('.pay_complete_modal .pay_content').hasClass('hide')){
|
|
$('.pay_complete_modal .pay_content').removeClass('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(){
|
|
var flag = noCheckList.includes(check_type)
|
|
value_added_select = [];
|
|
let check_type1 = $('li.active_select').attr('type');
|
|
check_type = check_type1
|
|
let check_flag = $('li.active_select').attr('check_flag');
|
|
let pay_type = getPayType();
|
|
let title = $('.inputChange').val().trim();
|
|
// let add_selected = []
|
|
$('.addListBox .add_active').each(function() {
|
|
let value = $(this).attr('type');
|
|
let this_item = value_added_servicesList.forEach(item=> {
|
|
if(item.type == value){
|
|
value_added_select.push(item.type)
|
|
}
|
|
return item.type == value
|
|
})
|
|
// add_selected.push(...this_item)
|
|
});
|
|
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')
|
|
$('.inputText').removeClass('warnInputText')
|
|
return;
|
|
}
|
|
}else if(check_type == '96'){
|
|
if(title.length >100){
|
|
alert('论文标题不得多于300字');
|
|
$('.inputChange').val('')//重置输入框文本
|
|
$('.inputText').text('0/300')
|
|
$('.inputText').removeClass('warnInputText')
|
|
return;
|
|
}
|
|
}
|
|
if(title.length >100){
|
|
alert('论文标题不得多于100字');
|
|
$('.inputChange').val('')//重置输入框文本
|
|
$('.inputText').text('0/100')
|
|
$('.inputText').removeClass('warnInputText')
|
|
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 ($('.coreContent').css('display') !== 'none'){
|
|
postData.core_content = $('#coreTextarea').val()
|
|
}
|
|
if(!$('.custom-dropdown').hasClass('disNone') && !flag){
|
|
var major= parseInt($('.dropdown-input').attr('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)) {
|
|
if(check_type!= '81'){
|
|
alert("请选择您的字数");
|
|
return;
|
|
}
|
|
}
|
|
postData.aiessay_wordnum = wordnums;
|
|
}
|
|
if(check_type == '96'){
|
|
if (!old_parent_ppt) {
|
|
alert("请选择ppt模板");
|
|
return;
|
|
}
|
|
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;
|
|
}
|
|
if(check_type == '94'){
|
|
if(value_added_select.indexOf('96') > -1){
|
|
postData.ppt_tpl = pptUrlList[add_ppt]['ppt_id'];
|
|
}
|
|
var wordnums = parseInt($('input[type="radio"][name="wordnums"]:checked').val());
|
|
postData.aiessay_wordnum = wordnums;
|
|
}
|
|
if(check_type == '94' || check_type == '82'){
|
|
postData.value_added_services = value_added_select.join(',')
|
|
}
|
|
allPostData = {...allPostData,check_flag,recharge_goods_id:'0',...postData}
|
|
$('.normal_step').removeClass('active_step')
|
|
$('.step_line').removeClass('suc_step_line')
|
|
$('.step_line').eq(0).addClass('suc_step_line')
|
|
$('.normal_step').eq(0).addClass('success_step')
|
|
$('.normal_step').eq(2).addClass('active_step')
|
|
//检验信息
|
|
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) {
|
|
}
|
|
});
|
|
// let pay_type = getPayType();
|
|
// postData.pay_type = pay_type
|
|
$.ajax({
|
|
type: "post",
|
|
dataType:'json',
|
|
url: service_domain + allPostData.check_flag+'/ajax_check_aisubmit',
|
|
data: {
|
|
...postData
|
|
},
|
|
success: function (res) {
|
|
if(res.data && res.data.user_not_enough_money) {
|
|
if(check_type !== '94' && check_type !== '82'){
|
|
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
|
|
}else{
|
|
$('.pageMask').removeClass('hide')
|
|
$('.pay_complete_modal').removeClass('hide')
|
|
$('.textPrice').html(res.data.user_not_enough_money+'元')
|
|
}
|
|
if(postData.pay_type == 2 || postData.pay_type == 3){
|
|
getRechargePayUrl()
|
|
// getRechargeGoods(payInfo, configData);
|
|
}
|
|
}else{
|
|
alert(res.info)
|
|
}
|
|
}
|
|
});
|
|
}
|
|
function getRechargePayUrl(){
|
|
var postData1 = new Object();
|
|
postData1.type = allPostData.check_type;
|
|
postData1.pay_type = allPostData.pay_type;
|
|
postData1.title = allPostData.title;
|
|
if(!$('.custom-dropdown').hasClass('disNone')){
|
|
var major= parseInt($('.dropdown-input').attr('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 == '81' || postData1.type == '85'){
|
|
postData1.core_content = $('.core_content').val()//核心内容
|
|
}
|
|
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;
|
|
}
|
|
if(postData1.type == '94'){
|
|
if(value_added_select.indexOf('96') > -1){
|
|
postData1.ppt_tpl = pptUrlList[add_ppt]['ppt_id'];
|
|
}
|
|
// table_and_formulas
|
|
if(table_and_formulas !== ''){
|
|
postData1.table_and_formulas = table_and_formulas;
|
|
}
|
|
var wordnums = parseInt($('input[type="radio"][name="wordnums"]:checked').val());
|
|
postData1.aiessay_wordnum = wordnums;
|
|
}
|
|
if(postData1.type == '82' || postData1.type == '94'){
|
|
postData1.value_added_services = value_added_select.join(',')
|
|
}
|
|
$.ajax({
|
|
url:service_domain+allPostData.check_flag+'/ajax_get_ai_pay_url',
|
|
type:'post',
|
|
dataType:'json',
|
|
data:{...postData1},
|
|
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 + '元')
|
|
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);
|
|
}
|
|
// $('.pay_complete_modal')
|
|
$('.pay_complete_modal').on('click','.payresultBtn2',function(){
|
|
goLoadDown(data.tid,'.pay_complete_modal')
|
|
// $('.user_none').addClass('hide')//取消禁用
|
|
// $('.step_add_three').addClass('hide')//恢复进度
|
|
})
|
|
$('.payModal').on('click','.payresultBtn2',function(){
|
|
goLoadDown(data.tid,'.payModal')
|
|
})
|
|
$('.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('复制成功')
|
|
})
|
|
|
|
}
|
|
$('.step_main').on('click','.normal_step1',function(){
|
|
window.scrollTo({ top: 200, behavior: 'smooth' })
|
|
})
|
|
$('.step_main').on('click','.normal_step2.success_step',function(){
|
|
window.scrollTo({ top: 500, behavior: 'smooth' })
|
|
})
|
|
$('.step_main').on('click','.normal_step3.active_step',function(){
|
|
if(check_type == '94'){
|
|
window.scrollTo({ top: 1000, behavior: 'smooth' })
|
|
}else{
|
|
window.scrollTo({ top: 800, behavior: 'smooth' })
|
|
}
|
|
})
|
|
function goLoadDown(tid,dom){
|
|
$('.right_btn').removeClass('activebtn')
|
|
$('.right_btn').eq(1).addClass('activebtn')
|
|
$('.pageMask').addClass('hide');
|
|
$(dom).addClass('hide');//支付弹框
|
|
resetStep_status()
|
|
clearhisText()
|
|
$('.main_page_top').addClass('hide')
|
|
$('.main_page').addClass('hide')
|
|
$('#report_page').removeClass('hide')
|
|
$('.report_input').val(tid)//22383694321962804
|
|
searchOrder()
|
|
}
|
|
function resetStep_status (){
|
|
$('.normal_step').removeClass('success_step')
|
|
$('.normal_step').removeClass('active_step')
|
|
$('.step_line').removeClass('suc_step_line')
|
|
$('.normal_step').eq(0).addClass('active_step')
|
|
}
|
|
$('.main_select li').click(function(e) {
|
|
if ($('li').hasClass('active_select')) {
|
|
$('li').removeClass('active_select')
|
|
}
|
|
$(this).addClass('active_select')
|
|
var element = $('.step_back');
|
|
var element2 = $('.footer');
|
|
element.removeClass('stickyStep')
|
|
element2.removeClass('footer2')
|
|
clearhisText()//清空记录
|
|
var t = $('li.active_select').attr('type');
|
|
check_type = t;
|
|
//重置步骤条状态
|
|
resetStep_status()
|
|
//重置ppt模板选择
|
|
old_parent_ppt = null;//首页选择的
|
|
new_parent_ppt = 0;//弹框内选择的
|
|
$('.form_pptItem .ppt_tem_item').removeClass('ppt_item_active')
|
|
|
|
// if(!$('.step_add_three').hasClass('hide')){
|
|
// $('.step_add_three').addClass('hide')
|
|
// }
|
|
if(t =='94'){//字数
|
|
setDomShow(['.form_essayWords','.side_info','.step_two','.checkbox_wrap'])
|
|
$('.key_words').addClass('hide')
|
|
getadd_Value('94')
|
|
} else{
|
|
setDomHide(['.form_essayWords','.side_info','.step_two','.checkbox_wrap'])
|
|
$('.key_words').removeClass('hide')
|
|
}
|
|
if(t == '94' || t == '82'){
|
|
setDomShow(['[step="3"]','.btn_result','.step_two','.btn_mast'])
|
|
setDomHide(['[step="2"]','.btn_result_now'])
|
|
$('.normal_step3').removeClass('step_three')
|
|
$('.payModal_main').html('')
|
|
$('.pay_complete_main').html(payhtml)
|
|
getCurWordsCount()
|
|
}else{
|
|
setDomHide(['[step="3"]','.btn_result','.step_two','.btn_mast'])
|
|
setDomShow(['[step="2"]','.btn_result_now'])
|
|
$('.normal_step3').addClass('step_three')
|
|
$('.payModal_main').html(payhtml)
|
|
$('.pay_complete_main').html('')
|
|
}
|
|
if(t == '64'){
|
|
$('.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'){
|
|
setInputText_length('500')
|
|
}else if(t=='82'){
|
|
setInputText_length('200')
|
|
getadd_Value('82')
|
|
}else{
|
|
setInputText_length('100')
|
|
}
|
|
if(t == '96'){
|
|
setInputText_length('300')
|
|
$('.form_pptItem').show()
|
|
$('#formInputSumbtn').html('生成答辩PPT')
|
|
}else{
|
|
$('.form_pptItem').hide()
|
|
$('#formInputSumbtn').html('立即生成')
|
|
}
|
|
if(t == '97' || t == '81'){
|
|
setDomShow(['.form_essayWords'])
|
|
var wordsData = allAiServicesData[check_type]['word_count_list'];
|
|
renderWordsHtml(wordsData)
|
|
if(t == '97'){
|
|
setInputText_length('100')
|
|
}
|
|
}
|
|
// else{
|
|
// setDomHide(['.form_essayWords','.coreContent'])
|
|
// }
|
|
// $("#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-dropdown')// 专业优化
|
|
changeLiActive(t,'support_edu','.formItem_pro')// 学历优化
|
|
changeLiActive(t,'support_core','.coreContent')// 核心内容优化
|
|
window.scrollTo({ top: 200, behavior: 'smooth' })
|
|
// if($('.custom-dropdown').hasClass('disNone') && $('.opt-advise').hasClass('disNone')){}
|
|
});
|
|
function setDomHide(arr){
|
|
arr.forEach(item=>{
|
|
$(item).hide()
|
|
})
|
|
}
|
|
function setDomShow(arr){
|
|
arr.forEach(item=>{
|
|
$(item).show()
|
|
})
|
|
}
|
|
function setInputText_length(num){
|
|
$('.inputText').attr('max',num)
|
|
$('.inputText').text('0/'+num)
|
|
}
|
|
|
|
function changeLiActive(t,attr_type,ele){
|
|
var support_titleMore = getTableFormulaTypes(attr_type);
|
|
if (support_titleMore) {
|
|
if (support_titleMore.indexOf(t) !== -1) {
|
|
$(ele).removeClass('disNone');
|
|
} else{
|
|
$(ele).addClass('disNone');
|
|
}
|
|
}
|
|
}
|
|
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}/img/ppt_${ind+1}_${i+1}.png`
|
|
list.push(url)
|
|
}
|
|
item.url = `${cssurl}/img/ppt_${ind+1}.png`;
|
|
item.bgurl = `${cssurl}/img/pptbg_${ind+1}.png`;
|
|
list.unshift(item.url)
|
|
return {
|
|
...item,
|
|
list
|
|
}
|
|
})
|
|
// console.log(pptUrlList,'pptUrlList');
|
|
// 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="`+ cssurl +`/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');
|
|
$('.look_backImg').attr('src',pptUrlList[key]['bgurl'])
|
|
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){
|
|
if ($('.form_pptItem').css('display') == 'none') {
|
|
add_ppt=new_parent_ppt;
|
|
$('#cur_ppt_selectName').html(pptUrlList[add_ppt]['name'])
|
|
payAction()
|
|
}else{
|
|
old_parent_ppt = new_parent_ppt;
|
|
setPagePPT_active(new_parent_ppt)
|
|
}
|
|
$('.look_PPT_modal').addClass('hide')
|
|
})
|
|
|
|
|
|
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]; // 获取文件
|
|
if (file) {
|
|
// 这里可以添加上传文件之前的逻辑,例如文件验证
|
|
// 创建FormData对象
|
|
formData.append('paper_file', file);
|
|
formData.append('paper_type', '1');
|
|
formData.append('is_asynch', '1');
|
|
formData.append('ver_chktype', check_type);
|
|
// 使用jQuery AJAX上传文件
|
|
$.ajax({
|
|
url: service_domain+'/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
|
|
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) {
|
|
// 错误回调
|
|
$(".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="`+cssurl+`/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('请求失败');
|
|
}
|
|
});
|
|
}
|
|
// $('.addListBox').on('hover','.add_item_right b',function(){
|
|
|
|
// $('.addListBox .add_item_right .img').removeClass('hide')
|
|
// },function(){
|
|
// $('.addListBox .add_item_right .img').addClass('hide');
|
|
// })
|
|
$('.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');
|
|
});
|
|
});
|