');$('#modal-dialog1').find('.modal-title').html($('#modal-dialog').find('.modal-title').html());$('#modal-dialog1').modal('show');t1 =window.setInterval(queryOrderStatus,3000,orderId);},error:function (err) {let responseText =err.responseText;let errJ =JSON.parse(responseText);$.alert({title:'Tooltip:',content:errJ.msg});} }).postFormData();} else if (payType ==='alipay') {window.location.href ='https://www.freedgo.com/order/api/v1/alipay/pcPayForTemplate/mind/' + orderId;} } },error:function (err) {let responseText =err.responseText;let errJ =JSON.parse(responseText);$.alert({title:'Tooltip:',content:errJ.msg});} }).postFormData();});$('#modal-dialog').on('hidden.bs.modal',function () {$('#modal-dialog').removeData("bs.modal");window.clearInterval(t1);});});function openModal(productId,name,price,type) {Http({url:'/order/api/v1/mind/order/createFreeTemplateOrder',data:{templateId:productId},headers:{'Content-Type':'application/x-www-form-urlencoded'},success:function (result,status,xhr) {if (status ==='success') {var custDrawId =result;if (custDrawId !='-1') {window.document.location.href ="https://www.freedgo.com/mind/mind.html#O" + custDrawId;} else {$('#payType').val($('.price-pay-type.ac').attr("tit"));$('#templateId').val(productId);$('#modal-dialog').find('.modal-title').html('购买' + name);$('.pay-num').text(price);$('#modal-dialog').modal('show');} } },error:function (xhr,status,error) {var msg ='';if (xhr.responseText) {var errdata =JSON.parse(xhr.responseText);msg =errdata.msg;} else {msg ='注册用户只能制作五个文件,请升级为会员版。';} $.alert({title:'错误提示!',content:'' + msg + '',autoClose:'cancel|10000',buttons:{cancel:{text:"关闭",action:function () {} } } });} }).postFormData();} var t1 ="";function queryOrderStatus(orderId) {Http({url:'/order/api/v1/mind/order/' + orderId,headers:{'Content-Type':'application/x-www-form-urlencoded'},success:function (data) {if (data) {var status =data.orderStatus;var custDrawId =data.custDrawId;if (status ==='ORDER_COMPLETED' &&custDrawId) {window.clearInterval(t1);window.document.location.href ="https://www.freedgo.com/mind/mind.html#O" + custDrawId;} } },error:function (err) {let responseText =err.responseText;let errJ =JSON.parse(responseText);$.alert({title:'Tooltip:',content:errJ.msg});} }).get();}