/*! Layer v3.1.1 */
;!function(e,t){"use strict";var i,n,a=e.layui&&layui.define,o={getPath:function(){var e=document.currentScript?document.currentScript.src:function(){for(var e,t=document.scripts,i=t.length-1,n=i;n>0;n--)if("interactive"===t[n].readyState){e=t[n].src;break}return e||t[i].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),config:{},end:{},minIndex:0,minLeft:[],btn:["确定","取消"],type:["dialog","page","iframe","loading","tips"],getStyle:function(t,i){var n=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](i)},link:function(t,i,n){}},r={v:"3.1.1",ie:function(){var t=navigator.userAgent.toLowerCase();return!!(e.ActiveXObject||"ActiveXObject"in e)&&((t.match(/msie\s(\d+)/)||[])[1]||"11")}(),index:e.layer&&e.layer.v?1e5:0,path:o.getPath,config:function(e,t){return e=e||{},r.cache=o.config=i.extend({},o.config,e),r.path=o.config.path||r.path,"string"==typeof e.extend&&(e.extend=[e.extend]),o.config.path&&r.ready(),e.extend?(a?layui.addcss("modules/layer/"+e.extend):o.link("theme/"+e.extend),this):this},ready:function(e){},alert:function(e,t,n){var a="function"==typeof t;return a&&(n=t),r.open(i.extend({content:e,yes:n},a?{}:t))},confirm:function(e,t,n,a){var s="function"==typeof t;return s&&(a=n,n=t),r.open(i.extend({content:e,btn:o.btn,yes:n,btn2:a},s?{}:t))},msg:function(e,n,a){var s="function"==typeof n,f=o.config.skin,c=(f?f+" "+f+"-msg":"")||"layui-layer-msg",u=l.anim.length-1;return s&&(a=n),r.open(i.extend({content:e,time:3e3,shade:!1,skin:c,title:!1,closeBtn:!1,btn:!1,resize:!1,end:a},s&&!o.config.skin?{skin:c+" layui-layer-hui",anim:u}:function(){return n=n||{},(n.icon===-1||n.icon===t&&!o.config.skin)&&(n.skin=c+" "+(n.skin||"layui-layer-hui")),n}()))},load:function(e,t){return r.open(i.extend({type:3,icon:e||0,resize:!1,shade:.01},t))},tips:function(e,t,n){return r.open(i.extend({type:4,content:[e,t],closeBtn:!1,time:3e3,shade:!1,resize:!1,fixed:!1,maxWidth:210},n))}},s=function(e){var t=this;t.index=++r.index,t.config=i.extend({},t.config,o.config,e),document.body?t.creat():setTimeout(function(){t.creat()},30)};s.pt=s.prototype;var l=["layui-layer",".layui-layer-title",".layui-layer-main",".layui-layer-dialog","layui-layer-iframe","layui-layer-content","layui-layer-btn","layui-layer-close"];l.anim=["layer-anim-00","layer-anim-01","layer-anim-02","layer-anim-03","layer-anim-04","layer-anim-05","layer-anim-06"],s.pt.config={type:0,shade:.3,fixed:!0,move:l[1],title:"信息",offset:"auto",area:"auto",closeBtn:1,time:0,zIndex:19891014,maxWidth:360,anim:0,isOutAnim:!0,icon:-1,moveType:1,resize:!0,scrollbar:!0,tips:2},s.pt.vessel=function(e,t){var n=this,a=n.index,r=n.config,s=r.zIndex+a,f="object"==typeof r.title,c=r.maxmin&&(1===r.type||2===r.type),u=r.title?'
'+(f?r.title[0]:r.title)+"
":"";return r.zIndex=s,t([r.shade?'':"",''+(e&&2!=r.type?"":u)+'
'+(0==r.type&&r.icon!==-1?'':"")+(1==r.type&&e?"":r.content||"")+'
'+function(){var e=c?'':"";return r.closeBtn&&(e+=''),e}()+""+(r.btn?function(){var e="";"string"==typeof r.btn&&(r.btn=[r.btn]);for(var t=0,i=r.btn.length;t
'+r.btn[t]+"";return''+e+"
"}():"")+(r.resize?'':"")+" "],u,i('')),n},s.pt.creat=function(){var e=this,t=e.config,a=e.index,s=t.content,f="object"==typeof s,c=i("body");if(!t.id||!i("#"+t.id)[0]){switch("string"==typeof t.area&&(t.area="auto"===t.area?["",""]:[t.area,""]),t.shift&&(t.anim=t.shift),6==r.ie&&(t.fixed=!1),t.type){case 0:t.btn="btn"in t?t.btn:o.btn[0],r.closeAll("dialog");break;case 2:var s=t.content=f?t.content:[t.content||"http://layer.layui.com","auto"];t.content='';break;case 3:delete t.title,delete t.closeBtn,t.icon===-1&&0===t.icon,r.closeAll("loading");break;case 4:f||(t.content=[t.content,"body"]),t.follow=t.content[1],t.content=t.content[0]+'',delete t.title,t.tips="object"==typeof t.tips?t.tips:[t.tips,!0],t.tipsMore||r.closeAll("tips")}if(e.vessel(f,function(n,r,u){c.append(n[0]),f?function(){2==t.type||4==t.type?function(){i("body").append(n[1])}():function(){s.parents("."+l[0])[0]||(s.data("display",s.css("display")).show().addClass("layui-layer-wrap").wrap(n[1]),i("#"+l[0]+a).find("."+l[5]).before(r))}()}():c.append(n[1]),i(".layui-layer-move")[0]||c.append(o.moveElem=u),e.layero=i("#"+l[0]+a),t.scrollbar||l.html.css("overflow","hidden").attr("layer-full",a)}).auto(a),i("#layui-layer-shade"+e.index).css({"background-color":t.shade[1]||"#000",opacity:t.shade[0]||t.shade}),2==t.type&&6==r.ie&&e.layero.find("iframe").attr("src",s[0]),4==t.type?e.tips():e.offset(),t.fixed&&n.on("resize",function(){e.offset(),(/^\d+%$/.test(t.area[0])||/^\d+%$/.test(t.area[1]))&&e.auto(a),4==t.type&&e.tips()}),t.time<=0||setTimeout(function(){r.close(e.index)},t.time),e.move().callback(),l.anim[t.anim]){var u="layer-anim "+l.anim[t.anim];e.layero.addClass(u).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){i(this).removeClass(u)})}t.isOutAnim&&e.layero.data("isOutAnim",!0)}},s.pt.auto=function(e){var t=this,a=t.config,o=i("#"+l[0]+e);""===a.area[0]&&a.maxWidth>0&&(r.ie&&r.ie<8&&a.btn&&o.width(o.innerWidth()),o.outerWidth()>a.maxWidth&&o.width(a.maxWidth));var s=[o.innerWidth(),o.innerHeight()],f=o.find(l[1]).outerHeight()||0,c=o.find("."+l[6]).outerHeight()||0,u=function(e){e=o.find(e),e.height(s[1]-f-c-2*(0|parseFloat(e.css("padding-top"))))};switch(a.type){case 2:u("iframe");break;default:""===a.area[1]?a.maxHeight>0&&o.outerHeight()>a.maxHeight?(s[1]=a.maxHeight,u("."+l[5])):a.fixed&&s[1]>=n.height()&&(s[1]=n.height(),u("."+l[5])):u("."+l[5])}return t},s.pt.offset=function(){var e=this,t=e.config,i=e.layero,a=[i.outerWidth(),i.outerHeight()],o="object"==typeof t.offset;e.offsetTop=(n.height()-a[1])/2,e.offsetLeft=(n.width()-a[0])/2,o?(e.offsetTop=t.offset[0],e.offsetLeft=t.offset[1]||e.offsetLeft):"auto"!==t.offset&&("t"===t.offset?e.offsetTop=0:"r"===t.offset?e.offsetLeft=n.width()-a[0]:"b"===t.offset?e.offsetTop=n.height()-a[1]:"l"===t.offset?e.offsetLeft=0:"lt"===t.offset?(e.offsetTop=0,e.offsetLeft=0):"lb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=0):"rt"===t.offset?(e.offsetTop=0,e.offsetLeft=n.width()-a[0]):"rb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=n.width()-a[0]):e.offsetTop=t.offset),t.fixed||(e.offsetTop=/%$/.test(e.offsetTop)?n.height()*parseFloat(e.offsetTop)/100:parseFloat(e.offsetTop),e.offsetLeft=/%$/.test(e.offsetLeft)?n.width()*parseFloat(e.offsetLeft)/100:parseFloat(e.offsetLeft),e.offsetTop+=n.scrollTop(),e.offsetLeft+=n.scrollLeft()),i.attr("minLeft")&&(e.offsetTop=n.height()-(i.find(l[1]).outerHeight()||0),e.offsetLeft=i.css("left")),i.css({top:e.offsetTop,left:e.offsetLeft})},s.pt.tips=function(){var e=this,t=e.config,a=e.layero,o=[a.outerWidth(),a.outerHeight()],r=i(t.follow);r[0]||(r=i("body"));var s={width:r.outerWidth(),height:r.outerHeight(),top:r.offset().top,left:r.offset().left},f=a.find(".layui-layer-TipsG"),c=t.tips[0];t.tips[1]||f.remove(),s.autoLeft=function(){s.left+o[0]-n.width()>0?(s.tipLeft=s.left+s.width-o[0],f.css({right:12,left:"auto"})):s.tipLeft=s.left},s.where=[function(){s.autoLeft(),s.tipTop=s.top-o[1]-10,f.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left+s.width+10,s.tipTop=s.top,f.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color",t.tips[1])},function(){s.autoLeft(),s.tipTop=s.top+s.height+10,f.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left-o[0]-10,s.tipTop=s.top,f.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color",t.tips[1])}],s.where[c-1](),1===c?s.top-(n.scrollTop()+o[1]+16)<0&&s.where[2]():2===c?n.width()-(s.left+s.width+o[0]+16)>0||s.where[3]():3===c?s.top-n.scrollTop()+s.height+o[1]+16-n.height()>0&&s.where[0]():4===c&&o[0]+16-s.left>0&&s.where[1](),a.find("."+l[5]).css({"background-color":t.tips[1],"padding-right":t.closeBtn?"30px":""}),a.css({left:s.tipLeft-(t.fixed?n.scrollLeft():0),top:s.tipTop-(t.fixed?n.scrollTop():0)})},s.pt.move=function(){var e=this,t=e.config,a=i(document),s=e.layero,l=s.find(t.move),f=s.find(".layui-layer-resize"),c={};return t.move&&l.css("cursor","move"),l.on("mousedown",function(e){e.preventDefault(),t.move&&(c.moveStart=!0,c.offset=[e.clientX-parseFloat(s.css("left")),e.clientY-parseFloat(s.css("top"))],o.moveElem.css("cursor","move").show())}),f.on("mousedown",function(e){e.preventDefault(),c.resizeStart=!0,c.offset=[e.clientX,e.clientY],c.area=[s.outerWidth(),s.outerHeight()],o.moveElem.css("cursor","se-resize").show()}),a.on("mousemove",function(i){if(c.moveStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1],l="fixed"===s.css("position");if(i.preventDefault(),c.stX=l?0:n.scrollLeft(),c.stY=l?0:n.scrollTop(),!t.moveOut){var f=n.width()-s.outerWidth()+c.stX,u=n.height()-s.outerHeight()+c.stY;af&&(a=f),ou&&(o=u)}s.css({left:a,top:o})}if(t.resize&&c.resizeStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1];i.preventDefault(),r.style(e.index,{width:c.area[0]+a,height:c.area[1]+o}),c.isResize=!0,t.resizing&&t.resizing(s)}}).on("mouseup",function(e){c.moveStart&&(delete c.moveStart,o.moveElem.hide(),t.moveEnd&&t.moveEnd(s)),c.resizeStart&&(delete c.resizeStart,o.moveElem.hide())}),e},s.pt.callback=function(){function e(){var e=a.cancel&&a.cancel(t.index,n);e===!1||r.close(t.index)}var t=this,n=t.layero,a=t.config;t.openLayer(),a.success&&(2==a.type?n.find("iframe").on("load",function(){a.success(n,t.index)}):a.success(n,t.index)),6==r.ie&&t.IE6(n),n.find("."+l[6]).children("a").on("click",function(){var e=i(this).index();if(0===e)a.yes?a.yes(t.index,n):a.btn1?a.btn1(t.index,n):r.close(t.index);else{var o=a["btn"+(e+1)]&&a["btn"+(e+1)](t.index,n);o===!1||r.close(t.index)}}),n.find("."+l[7]).on("click",e),a.shadeClose&&i("#layui-layer-shade"+t.index).on("click",function(){r.close(t.index)}),n.find(".layui-layer-min").on("click",function(){var e=a.min&&a.min(n);e===!1||r.min(t.index,a)}),n.find(".layui-layer-max").on("click",function(){i(this).hasClass("layui-layer-maxmin")?(r.restore(t.index),a.restore&&a.restore(n)):(r.full(t.index,a),setTimeout(function(){a.full&&a.full(n)},100))}),a.end&&(o.end[t.index]=a.end)},o.reselect=function(){i.each(i("select"),function(e,t){var n=i(this);n.parents("."+l[0])[0]||1==n.attr("layer")&&i("."+l[0]).length<1&&n.removeAttr("layer").show(),n=null})},s.pt.IE6=function(e){i("select").each(function(e,t){var n=i(this);n.parents("."+l[0])[0]||"none"===n.css("display")||n.attr({layer:"1"}).hide(),n=null})},s.pt.openLayer=function(){var e=this;r.zIndex=e.config.zIndex,r.setTop=function(e){var t=function(){r.zIndex++,e.css("z-index",r.zIndex+1)};return r.zIndex=parseInt(e[0].style.zIndex),e.on("mousedown",t),r.zIndex}},o.record=function(e){var t=[e.width(),e.height(),e.position().top,e.position().left+parseFloat(e.css("margin-left"))];e.find(".layui-layer-max").addClass("layui-layer-maxmin"),e.attr({area:t})},o.rescollbar=function(e){l.html.attr("layer-full")==e&&(l.html[0].style.removeProperty?l.html[0].style.removeProperty("overflow"):l.html[0].style.removeAttribute("overflow"),l.html.removeAttr("layer-full"))},e.layer=r,r.getChildFrame=function(e,t){return t=t||i("."+l[4]).attr("times"),i("#"+l[0]+t).find("iframe").contents().find(e)},r.getFrameIndex=function(e){return i("#"+e).parents("."+l[4]).attr("times")},r.iframeAuto=function(e){if(e){var t=r.getChildFrame("html",e).outerHeight(),n=i("#"+l[0]+e),a=n.find(l[1]).outerHeight()||0,o=n.find("."+l[6]).outerHeight()||0;n.css({height:t+a+o}),n.find("iframe").css({height:t})}},r.iframeSrc=function(e,t){i("#"+l[0]+e).find("iframe").attr("src",t)},r.style=function(e,t,n){var a=i("#"+l[0]+e),r=a.find(".layui-layer-content"),s=a.attr("type"),f=a.find(l[1]).outerHeight()||0,c=a.find("."+l[6]).outerHeight()||0;a.attr("minLeft");s!==o.type[3]&&s!==o.type[4]&&(n||(parseFloat(t.width)<=260&&(t.width=260),parseFloat(t.height)-f-c<=64&&(t.height=64+f+c)),a.css(t),c=a.find("."+l[6]).outerHeight(),s===o.type[2]?a.find("iframe").css({height:parseFloat(t.height)-f-c}):r.css({height:parseFloat(t.height)-f-c-parseFloat(r.css("padding-top"))-parseFloat(r.css("padding-bottom"))}))},r.min=function(e,t){var a=i("#"+l[0]+e),s=a.find(l[1]).outerHeight()||0,f=a.attr("minLeft")||181*o.minIndex+"px",c=a.css("position");o.record(a),o.minLeft[0]&&(f=o.minLeft[0],o.minLeft.shift()),a.attr("position",c),r.style(e,{width:180,height:s,left:f,top:n.height()-s,position:"fixed",overflow:"hidden"},!0),a.find(".layui-layer-min").hide(),"page"===a.attr("type")&&a.find(l[4]).hide(),o.rescollbar(e),a.attr("minLeft")||o.minIndex++,a.attr("minLeft",f)},r.restore=function(e){var t=i("#"+l[0]+e),n=t.attr("area").split(",");t.attr("type");r.style(e,{width:parseFloat(n[0]),height:parseFloat(n[1]),top:parseFloat(n[2]),left:parseFloat(n[3]),position:t.attr("position"),overflow:"visible"},!0),t.find(".layui-layer-max").removeClass("layui-layer-maxmin"),t.find(".layui-layer-min").show(),"page"===t.attr("type")&&t.find(l[4]).show(),o.rescollbar(e)},r.full=function(e){var t,a=i("#"+l[0]+e);o.record(a),l.html.attr("layer-full")||l.html.css("overflow","hidden").attr("layer-full",e),clearTimeout(t),t=setTimeout(function(){var t="fixed"===a.css("position");r.style(e,{top:t?0:n.scrollTop(),left:t?0:n.scrollLeft(),width:n.width(),height:n.height()},!0),a.find(".layui-layer-min").hide()},100)},r.title=function(e,t){var n=i("#"+l[0]+(t||r.index)).find(l[1]);n.html(e)},r.close=function(e){var t=i("#"+l[0]+e),n=t.attr("type"),a="layer-anim-close";if(t[0]){var s="layui-layer-wrap",f=function(){if(n===o.type[1]&&"object"===t.attr("conType")){t.children(":not(."+l[5]+")").remove();for(var a=t.find("."+s),r=0;r<2;r++)a.unwrap();a.css("display",a.data("display")).removeClass(s)}else{if(n===o.type[2])try{var f=i("#"+l[4]+e)[0];f.contentWindow.document.write(""),f.contentWindow.close(),t.find("."+l[5])[0].removeChild(f)}catch(c){}t[0].innerHTML="",t.remove()}"function"==typeof o.end[e]&&o.end[e](),delete o.end[e]};t.data("isOutAnim")&&t.addClass("layer-anim "+a),i("#layui-layer-moves, #layui-layer-shade"+e).remove(),6==r.ie&&o.reselect(),o.rescollbar(e),t.attr("minLeft")&&(o.minIndex--,o.minLeft.push(t.attr("minLeft"))),r.ie&&r.ie<10||!t.data("isOutAnim")?f():setTimeout(function(){f()},200)}},r.closeAll=function(e){i.each(i("."+l[0]),function(){var t=i(this),n=e?t.attr("type")===e:1;n&&r.close(t.attr("times")),n=null})};var f=r.cache||{},c=function(e){return f.skin?" "+f.skin+" "+f.skin+"-"+e:""};r.prompt=function(e,t){var a="";if(e=e||{},"function"==typeof e&&(t=e),e.area){var o=e.area;a='style="width: '+o[0]+"; height: "+o[1]+';"',delete e.area}var s,l=2==e.formType?'":function(){return''}(),f=e.success;return delete e.success,r.open(i.extend({type:1,btn:["确定","取消"],content:l,skin:"layui-layer-prompt"+c("prompt"),maxWidth:n.width(),success:function(e){s=e.find(".layui-layer-input"),s.focus(),"function"==typeof f&&f(e)},resize:!1,yes:function(i){var n=s.val();""===n?s.focus():n.length>(e.maxlength||500)?r.tips("最多输入"+(e.maxlength||500)+"个字数",s,{tips:1}):t&&t(n,i,s)}},e))},r.tab=function(e){e=e||{};var t=e.tab||{},n="layui-this",a=e.success;return delete e.success,r.open(i.extend({type:1,skin:"layui-layer-tab"+c("tab"),resize:!1,title:function(){var e=t.length,i=1,a="";if(e>0)for(a=''+t[0].title+"";i"+t[i].title+"";return a}(),content:''+function(){var e=t.length,i=1,a="";if(e>0)for(a='- '+(t[0].content||"no content")+"
";i'+(t[i].content||"no content")+"";return a}()+"
",success:function(t){var o=t.find(".layui-layer-title").children(),r=t.find(".layui-layer-tabmain").children();o.on("mousedown",function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0;var a=i(this),o=a.index();a.addClass(n).siblings().removeClass(n),r.eq(o).show().siblings().hide(),"function"==typeof e.change&&e.change(o)}),"function"==typeof a&&a(t)}},e))},r.photos=function(t,n,a){function o(e,t,i){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,t(n)},void(n.onerror=function(e){n.onerror=null,i(e)}))}var s={};if(t=t||{},t.photos){var l=t.photos.constructor===Object,f=l?t.photos:{},u=f.data||[],d=f.start||0;s.imgIndex=(0|d)+1,t.img=t.img||"img";var y=t.success;if(delete t.success,l){if(0===u.length)return r.msg("没有图片")}else{var p=i(t.photos),h=function(){u=[],p.find(t.img).each(function(e){var t=i(this);t.attr("layer-index",e),u.push({alt:t.attr("alt"),pid:t.attr("layer-pid"),src:t.attr("layer-src")||t.attr("src"),thumb:t.attr("src")})})};if(h(),0===u.length)return;if(n||p.on("click",t.img,function(){var e=i(this),n=e.attr("layer-index");r.photos(i.extend(t,{photos:{start:n,data:u,tab:t.tab},full:t.full}),!0),h()}),!n)return}s.imgprev=function(e){s.imgIndex--,s.imgIndex<1&&(s.imgIndex=u.length),s.tabimg(e)},s.imgnext=function(e,t){s.imgIndex++,s.imgIndex>u.length&&(s.imgIndex=1,t)||s.tabimg(e)},s.keyup=function(e){if(!s.end){var t=e.keyCode;e.preventDefault(),37===t?s.imgprev(!0):39===t?s.imgnext(!0):27===t&&r.close(s.index)}},s.tabimg=function(e){if(!(u.length<=1))return f.start=s.imgIndex-1,r.close(s.index),r.photos(t,!0,e)},s.event=function(){s.bigimg.hover(function(){s.imgsee.show()},function(){s.imgsee.hide()}),s.bigimg.find(".layui-layer-imgprev").on("click",function(e){e.preventDefault(),s.imgprev()}),s.bigimg.find(".layui-layer-imgnext").on("click",function(e){e.preventDefault(),s.imgnext()}),i(document).on("keyup",s.keyup)},s.loadi=r.load(1,{shade:!("shade"in t)&&.9,scrollbar:!1}),o(u[d].src,function(n){r.close(s.loadi),s.index=r.open(i.extend({type:1,id:"layui-layer-photos",area:function(){var a=[n.width,n.height],o=[i(e).width()-100,i(e).height()-100];if(!t.full&&(a[0]>o[0]||a[1]>o[1])){var r=[a[0]/o[0],a[1]/o[1]];r[0]>r[1]?(a[0]=a[0]/r[0],a[1]=a[1]/r[0]):r[0]",success:function(e,i){s.bigimg=e.find(".layui-layer-phimg"),s.imgsee=e.find(".layui-layer-imguide,.layui-layer-imgbar"),s.event(e),t.tab&&t.tab(u[d],e),"function"==typeof y&&y(e)},end:function(){s.end=!0,i(document).off("keyup",s.keyup)}},t))},function(){r.close(s.loadi),r.msg("当前图片地址异常
是否继续查看下一张?",{time:3e4,btn:["下一张","不看了"],yes:function(){u.length>1&&s.imgnext(!0,!0)}})})}},o.run=function(t){i=t,n=i(e),l.html=i("html"),r.open=function(e){var t=new s(e);return t.index}},e.layui&&layui.define?(r.ready(),layui.define("jquery",function(t){r.path=layui.cache.dir,o.run(layui.$),e.layer=r,t("layer",r)})):"function"==typeof define&&define.amd?define(["jquery"],function(){return o.run(e.jQuery),r}):function(){o.run(e.jQuery),r.ready()}()}(window);
/*!
* clipboard.js v1.6.1
* https://zenorocha.github.io/clipboard.js
*
* Licensed MIT © Zeno Rocha
*/
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Clipboard=e()}}(function(){var e,t,n;return function e(t,n,o){function i(a,c){if(!n[a]){if(!t[a]){var l="function"==typeof require&&require;if(!c&&l)return l(a,!0);if(r)return r(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var s=n[a]={exports:{}};t[a][0].call(s.exports,function(e){var n=t[a][1][e];return i(n?n:e)},s,s.exports,e,t,n,o)}return n[a].exports}for(var r="function"==typeof require&&require,a=0;a0&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function e(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function e(){var t=this,n="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=document.body.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[n?"right":"left"]="-9999px";var o=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=o+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,document.body.appendChild(this.fakeElem),this.selectedText=(0,i.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function e(){this.fakeHandler&&(document.body.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(document.body.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function e(){this.selectedText=(0,i.default)(this.target),this.copyText()}},{key:"copyText",value:function e(){var t=void 0;try{t=document.execCommand(this.action)}catch(e){t=!1}this.handleResult(t)}},{key:"handleResult",value:function e(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function e(){this.target&&this.target.blur(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function e(){this.removeFake()}},{key:"action",set:function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function e(){return this._action}},{key:"target",set:function e(t){if(void 0!==t){if(!t||"object"!==("undefined"==typeof t?"undefined":r(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function e(){return this._target}}]),e}();e.exports=c})},{select:5}],8:[function(t,n,o){!function(i,r){if("function"==typeof e&&e.amd)e(["module","./clipboard-action","tiny-emitter","good-listener"],r);else if("undefined"!=typeof o)r(n,t("./clipboard-action"),t("tiny-emitter"),t("good-listener"));else{var a={exports:{}};r(a,i.clipboardAction,i.tinyEmitter,i.goodListener),i.clipboard=a.exports}}(this,function(e,t,n,o){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e,t){var n="data-clipboard-"+e;if(t.hasAttribute(n))return t.getAttribute(n)}var u=i(t),s=i(n),f=i(o),d=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText}},{key:"listenClick",value:function e(t){var n=this;this.listener=(0,f.default)(t,"click",function(e){return n.onClick(e)})}},{key:"onClick",value:function e(t){var n=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new u.default({action:this.action(n),target:this.target(n),text:this.text(n),trigger:n,emitter:this})}},{key:"defaultAction",value:function e(t){return l("action",t)}},{key:"defaultTarget",value:function e(t){var n=l("target",t);if(n)return document.querySelector(n)}},{key:"defaultText",value:function e(t){return l("text",t)}},{key:"destroy",value:function e(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],n="string"==typeof t?[t]:t,o=!!document.queryCommandSupported;return n.forEach(function(e){o=o&&!!document.queryCommandSupported(e)}),o}}]),t}(s.default);e.exports=h})},{"./clipboard-action":7,"good-listener":4,"tiny-emitter":6}]},{},[8])(8)});
/*Powered by mobantu.com*/
jQuery(function($){
popupTemplate = {
toast: function(t) {
var e = t.type,
n = t.icon,
a = t.text,
s = t.display;
return '\n \n ' + (n && "text" !== e ? "\n " + ("icon-loading" === n ? '\n \n ': '\n \n ') + "\n ": "") + "\n " + (a && "icon" !== e ? '\n \n ": "") + "\n \n "
},
customModal: function(t) {
return '\n \n "
}
},
customModalTemplate = {
erphpWppayQrcode: function(t) {
var payment = _ERPHPDOWN.payment,
paymentImg = '扫一扫',
bgstyle = '';
if(payment == 6){
bgstyle = 'style="background-color: #21ab36 !important;"';
var aliqr = '',wxqr = '',wxtit='',alitit='',warning='',warning2='';
if(t.code){
if(t.gift){
warning = '随机减免,请务必支付金额¥'+t.price+'
';
}
if(!t.code2){
aliqr = '\n 扫一扫支付 '+t.price+' 元
'+warning+' \n \n \n 支付完成后请等待5秒左右,期间请勿关闭此页面
\n 启动支付宝APP支付
\n ';
alitit = '支付宝\n';
bgstyle = 'style="background-color: #00a3ee !important;"';
}else{
aliqr = '\n 扫一扫支付 '+t.price+' 元
'+warning+' \n \n \n 支付完成后请等待5秒左右,期间请勿关闭此页面
\n 启动支付宝APP支付
\n ';
alitit = '支付宝\n';
}
}
if(t.code2){
if(t.gift2){
warning2 = '随机减免,请务必支付金额¥'+t.price2+'
';
}
wxqr = '\n 扫一扫支付 '+t.price2+' 元
'+warning2+' \n \n \n 支付完成后请等待5秒左右,期间请勿关闭此页面
\n 请截屏,打开微信扫一扫,从相册里选择截图
\n ';
wxtit = '微信\n';
}
return '\n \n \n \n '+wxqr+'\n '+aliqr+'\n \n \n '
}else if(payment == 4){
bgstyle = 'style="background-color: #00a3ee !important;"';
return '\n \n 扫一扫支付 '+t.price+' 元
\n \n \n \n \n \n \n 支付完成后请等待5秒左右,期间请勿关闭此页面
\n 请截屏,打开微信扫一扫,从相册里选择截图
\n \n \n \n '
}else if(payment == 5){
/* Powered by mobantu.com */
bgstyle = 'style="background-color: #21ab36 !important;"';
var aliqr = '',wxqr = '',wxtit='',alitit='',aliwap = '',wxwap = '请截屏,打开微信扫一扫,从相册里选择截图
';
if(t.code){
if(t.aliurl){
aliwap = '启动支付宝APP支付
';
}
if(!t.code2){
aliqr = '\n \n \n \n 支付完成后请等待5秒左右,期间请勿关闭此页面
\n '+aliwap+'\n ';
alitit = '支付宝\n';
bgstyle = 'style="background-color: #00a3ee !important;"';
}else{
aliqr = '\n \n \n \n 支付完成后请等待5秒左右,期间请勿关闭此页面
\n '+aliwap+'\n ';
alitit = '支付宝\n';
}
}
if(t.code2){
if(t.wxurl){
wxwap = '启动微信APP支付
';
}
wxqr = '\n \n \n \n 支付完成后请等待5秒左右,期间请勿关闭此页面
\n '+wxwap+'\n ';
wxtit = '微信\n';
}
return '\n \n 扫一扫支付 '+t.price+' 元
\n \n '+wxqr+'\n '+aliqr+'\n \n \n '
}else{
var wap = '';
if(payment == 1){
paymentImg = '';
bgstyle = 'style="background-color: #00a3ee !important;"';
wap = '启动支付宝APP支付
';
}else if(payment == 3){
paymentImg = '';
bgstyle = 'style="background-color: #21ab36 !important;"';
wap = '手机端请截屏,打开微信扫一扫,从相册里选择截图
';
}
return '\n \n \n \n \n 扫一扫支付 '+t.price+' 元
\n \n \n 支付完成后请等待5秒左右,期间请勿关闭此页面
\n '+wap+'\n \n \n \n '
}
}
},
customModalFunc = {
addEvent: function() {
var t = this;
$(popup.element.customModal).on("click", "*[data-custom-action]",
function(e) {
var n = $(this).data("custom-action");
t[n]($(this), e)
})
},
removeEvent: function() {
$(popup.element.customModal).off("click", "*[data-custom-action]")
},
switchWppayPayment: function(t) {
var ptype = t.data("payment");
var e = t.index();
if(ptype == "weixin"){
$(".tab-list").css("background-color", "#21ab36");
}else{
$(".tab-list").css("background-color", "#00a3ee");
}
t.addClass("active").siblings().removeClass("active"),
$(".tab-list .item").eq(e).show().siblings().hide()
},
};
window.popup = {
element: {
body: "body",
head: "head",
toast: "#toast",
modal: "#modal",
customModal: "#customModal",
scrollBodyStyle: "#scrollBodyStyle"
},
addEvent: function() {
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "body",
e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null,
n = this,
a = null !== e ? '*[data-popup-action="' + e + '"]': "*[data-popup-action]";
$(this.element[t]).on("click", a,
function(t) {
var e = $(this).data("popup-action");
n[e]($(this), t)
})
},
removeEvent: function() {
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "body",
e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null,
n = null !== e ? '*[data-popup-action="' + e + '"]': "*[data-popup-action]";
$(this.element[t]).off("click", n)
},
showToast: function() {
var t = this,
e = arguments,
n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},
a = n.type,
s = void 0 === a ? "icon": a,
o = n.icon,
i = void 0 === o ? "icon-loading": o,
c = n.text,
l = void 0 === c ? "加载中...": c,
d = n.display,
p = void 0 === d ? "fs": d,
m = n.el,
u = void 0 === m ? "": m,
r = n.time,
h = void 0 === r ? 1500 : r,
v = n.callback;
$(this.element.body).find(this.element.toast).length <= 0 ? ("el" === p ? (u = "string" == typeof u ? $(u) : u, u.append(popupTemplate.toast({
type: s,
icon: i,
text: l,
display: p
}))) : $(this.element.body).append(popupTemplate.toast({
type: s,
icon: i,
text: l,
display: p
})), $(this.element.toast).animate({
opacity: 1
},
300), this.toastTimer = setTimeout(function() {
$(t.element.toast).animate({
opacity: 0
},
300,
function() {
$(t.element.toast).remove(),
"function" == typeof v && v()
})
},
h)) : this.hideToast(function() {
t.showToast.call(t, e[0])
})
},
hideToast: function(t) {
var e = this;
$(this.element.toast).animate({
opacity: 0
},
300,
function() {
$(e.element.toast).remove(),
clearTimeout(e.toastTimer),
e.toastTimer = null,
"function" == typeof t ? t() : void 0
})
},
showCustomModal: function(t) {
var e = t.template,
n = void 0 === e ? "": e,
a = t.data,
s = void 0 === a ? {}: a,
o = t.callback,
i = t.layerClose,
c = void 0 === i ? !1 : i,
l = this;
$(this.element.body).find(this.element.customModal).length <= 0 && ($(this.element.body).append(popupTemplate.customModal(customModalTemplate[n](s))), this.addEvent("body", "customModalClose"), customModalFunc.addEvent(), c && $(this.element.customModal).on("click",
function(t) {
l.layerClose($(this), t)
}), $(this.element.customModal).find("*[data-custom-submit]").length > 0 && $(this.element.customModal).on("click", "*[data-custom-submit]",
function() {
var t = {};
$(l.element.customModal).find("*[name]").each(function() {
var e = $(this).attr("name");
t[e] = $(this).val() || ""
}),
"function" == typeof o ? o($(this), t) : function() {}
}))
},
hideModal: function(t) {
$("#" + t).remove(),
this.commonHide()
},
customModalClose: function(t) {
t.parents("" + this.element.customModal).remove(),
this.commonHide()
},
layerClose: function(t, e) {
var n = e.target,
a = t.data("layer");
n.id && n.id === a && ($("#" + a).off("click").remove(), this.commonHide())
},
commonHide: function() {
var t = $(this.element.body).find("*[data-lib]").length;
0 >= t && (this.removeEvent()),
$(this.element.body).off("click", '*[data-popup-action="customModalClose"]'),
customModalFunc.removeEvent(),
$(this.element.customModal).off("click", "*[data-custom-submit]")
}
};
var erphpWppayTimer, erphpWppayOrder;
$("body").on("click", ".erphp-wppay-loader", function(){
clearInterval(erphpWppayOrder);
clearInterval(erphpWppayTimer);
var post_id = $(this).data("post");
if(post_id){
if(_ERPHPDOWN.wppay == 'link'){
var href = _ERPHPDOWN.uri+"/buy.php?postid="+post_id;
layer.open({
type: 2,
area: ['360px', '445px'],
title: '购买详情',
resize:false,
scrollbar: false,
shadeClose: true,
content: href
});
}else{
popup.showToast({
type: "it",
text: "处理中...",
time: 1e5
});
$.post(_ERPHP.ajaxurl, {
"action": "epd_wppay",
"post_id": post_id
}, function(result) {
if( result.status == 202 ){
$.post(_ERPHP.ajaxurl, {
"action": "epd_wppay_pay",
"post_id": post_id,
"order_num": result.num
}, function(data) {
if(data.status == "1"){
clearInterval(erphpWppayOrder);
popup.hideModal('customModal');
popup.showToast({
type: "text",
text: "支付成功!"
});
//location.reload(true);
if (window.location.href.indexOf("?") != -1) {
location.href=window.location.href+'×tamp='+new Date().getTime();
}else{
location.href=window.location.href+'?timestamp='+new Date().getTime();
}
}
});
}else if( result.status == 200 ){
popup.hideToast();
popup.showCustomModal({
template: "erphpWppayQrcode",
layerClose: 0,
data: {
price: result.price,
price2: result.price2,
code: result.code,
code2: result.code2,
gift: result.gift,
gift2: result.gift2,
aliurl: result.aliurl,
wxurl: result.wxurl
}
});
var m = 5;
if(result.minute) m = result.minute;
erphpWppayOrder = setInterval(function() {
$.post(_ERPHP.ajaxurl, {
"action": "epd_wppay_pay",
"post_id": post_id,
"order_num": result.num
}, function(data) {
if(data.status == "1"){
clearInterval(erphpWppayOrder);
popup.hideModal('customModal');
popup.showToast({
type: "text",
text: "支付成功!"
});
//location.reload(true);
if (window.location.href.indexOf("?") != -1) {
location.href=window.location.href+'×tamp='+new Date().getTime();
}else{
location.href=window.location.href+'?timestamp='+new Date().getTime();
}
}
});
}, 5000);
var s = 0;
wppayCountdown();
erphpWppayTimer = setInterval(function(){ wppayCountdown(); },1000);
function wppayCountdown(){
$(".wtime").html("支付倒计时:0"+m+"分"+s+"秒");
if( m == 0 && s == 0 ){
clearInterval(erphpWppayOrder);
clearInterval(erphpWppayTimer);
popup.hideModal('customModal');
m = 4;
s = 59;
}else if( m >= 0 ){
if( s > 0 ){
s--;
}else if( s == 0 ){
m--;
s = 59;
}
}
}
}else if( result.status == 201 ){
popup.showToast({
type: "text",
text: result.msg
});
}else{
popup.showToast({
type: "text",
text: "获取支付信息失败!"
});
}
}, 'json');
}
}else{
popup.showToast({
type: "text",
text: "获取支付信息失败!"
});
}
return false;
});
$("body").on("click", ".erphpdown-buy-index", function(){
var post_id = $(this).data("post"),
index_id = $(this).data("index"),
price = $(this).data("price"),
that = $(this);
if(post_id && index_id && price){
popup.showToast({
type: "it",
text: "处理中...",
time: 1e5
});
$.post(_ERPHP.ajaxurl, {
"action": "epd_index",
"post_id": post_id,
"index_id": index_id,
"price": price
}, function(result) {
if( result.status == 200 ){
popup.showToast({
type: "text",
text: "购买成功!"
});
//location.reload(true);
if (window.location.href.indexOf("?") != -1) {
location.href=window.location.href+'×tamp='+new Date().getTime();
}else{
location.href=window.location.href+'?timestamp='+new Date().getTime();
}
}else if( result.status == 201 ){
popup.showToast({
type: "text",
text: result.msg
});
}else if( result.status == 202 ){
if(!that.parent().find(".erphpdown-vip-index").length){
that.after('立即充值');
}
popup.showToast({
type: "text",
text: result.msg
});
}else{
popup.showToast({
type: "text",
text: "购买失败,请稍后重试!"
});
}
}, 'json');
}else{
popup.showToast({
type: "text",
text: "购买失败,请稍后重试!"
});
}
return false;
});
var bodyWidth = $(window).width();
$("body").on("click", ".erphpdown-vip-do", function(){
var user_type = $(this).data("type");
if(user_type){
var href = _ERPHPDOWN.uri+"/buy.php?user_type="+user_type;
layer.open({
type: 2,
area: ['360px', '480px'],
title: '购买VIP',
resize:false,
scrollbar: false,
shadeClose: true,
content: href
});
}
return false;
})
$(".do-erphpdown-vip-pay").click(function(){
var that = $(this);
var type = that.data("type");
if(type){
that.text("支付中...").attr("disabled","disabled");
$.post(_ERPHP.ajaxurl, {
"action": "epd_vip_pay",
"type": type
}, function(data) {
that.text("余额支付").removeAttr("disabled");
if( data.error ){
if( data.msg ){
layer.msg(data.msg);
}
}else{
layer.msg("升级成功");
parent.location.reload();
}
}, 'json');
}
return false;
});
$("body").on("click", ".erphpdown-iframe", function(){
var href = $(this).attr("href");
layer.open({
type: 2,
area: ['360px', '480px'],
title: '购买详情',
resize:false,
scrollbar: false,
shadeClose: true,
content: href
});
return false;
});
$("body").on("click", ".erphpdown-down-layui", function(){
var href = $(this).attr("href");
layer.open({
type: 2,
area: ['360px', '445px'],
title: '下载详情',
resize:false,
scrollbar: false,
shadeClose: true,
content: href
});
return false;
});
$("body").on("click", ".erphpdown-see-btn", function(){
var post_id = $(this).data("post"),
token = $(this).data("token"),
vip = $(this).data("vip");
if(post_id){
popup.showToast({
type: "it",
text: "处理中...",
time: 1e5
});
$.post(_ERPHP.ajaxurl, {
"action": "epd_see",
"post_id": post_id,
"vip": vip,
"token": token
}, function(result) {
if( result.status == 200 ){
popup.hideToast();
location.reload(true);
}else if( result.status == 202 ){
popup.showToast({
type: "text",
text: "抱歉,权限不足!"
});
}else{
popup.showToast({
type: "text",
text: "查看失败,请检查今天的查看次数是否已用光!"
});
}
}, 'json');
}else{
popup.showToast({
type: "text",
text: "查看失败!"
});
}
return false;
});
$("body").on("click", ".erphp-checkin", function(){
var that = $(this);
if(!that.hasClass("disabled")){
that.addClass("disabled");
if(!that.hasClass("active")){
that.text("签到中...");
$.post(_ERPHP.ajaxurl, {
"action": "epd_checkin"
}, function(result) {
if( result.status == 200 ){
that.addClass("active").text("签到成功");
layer.msg("签到成功");
}else{
that.text("今日签到");
layer.msg(result.msg);
}
}, 'json');
}
}
return false;
});
$("body").on("click", ".erphpdown-checkpan", function(){
var post_id = $(this).data("id"),
post_buy = $(this).data("buy"),
post_index = $(this).data("index"),
that = $(this);
if(post_id){
popup.showToast({
type: "it",
text: "检测中...",
time: 1e5
});
$.post(_ERPHP.ajaxurl, {
"action": "epd_check_pan",
"post_id": post_id,
"post_index": post_index
}, function(data) {
if(data.status == "500" || data.status == "200"){
popup.showToast({
type: "text",
text: data.msg
});
if(data.status == "200"){
that.removeClass("erphpdown-checkpan").addClass("erphpdown-iframe erphpdown-buy").attr("href",post_buy).text("立即购买");
}
}else{
popup.showToast({
type: "text",
text: "检测失败,请稍后重试!"
});
}
});
}
return false;
});
$("body").on("click", ".erphpdown-checkpan2", function(){
var post_id = $(this).data("id"),
post_index = $(this).data("index"),
that = $(this);
if(post_id){
popup.showToast({
type: "it",
text: "检测中...",
time: 1e5
});
$.post(_ERPHP.ajaxurl, {
"action": "epd_check_pan",
"post_id": post_id,
"post_index": post_index
}, function(data) {
if(data.status == "500" || data.status == "200"){
popup.showToast({
type: "text",
text: data.msg
});
if(data.status == "200"){
that.removeClass("erphpdown-checkpan2").addClass("erphp-wppay-loader").text("立即购买");
}
}else{
popup.showToast({
type: "text",
text: "检测失败,请稍后重试!"
});
}
});
}
return false;
});
$("body").on("click", ".erphp-promo-do", function(){
var promo = $("#erphp_promo").val(),
that = $(this);
if(promo){
$.post(_ERPHP.ajaxurl, {
"action": "epd_promo",
"promo": promo
}, function(data) {
if(data.status == '1'){
if(that.hasClass('erphp-promo-do-vip')){
if($(".erphpdown-type-desc .type-price span").data("price")){
var oldprice = parseFloat($(".erphpdown-type-desc .type-price span").data("price"));
}else{
var oldprice = parseFloat($(".erphpdown-type-desc .type-price span").text());
}
if(data.type == 1){
if(oldprice <= data.money){
layer.msg("抱歉,价格异常");
return false;
}
$(".erphpdown-type-desc .type-price span").html(parseFloat(oldprice-data.money).toFixed(2)+' '+oldprice.toFixed(2)+'');
}else if(data.type == 2){
$(".erphpdown-type-desc .type-price span").html(parseFloat(oldprice*0.1*data.money).toFixed(2)+' '+oldprice.toFixed(2)+'');
}
}else{
var nologin = 0;
if($(".item-price .tit t").hasClass("no-login")){
nologin = 1;
}
var oldprice = parseFloat($(".item-price .tit t").data("price"));
var lmoney = $("#erphpdown_left").text();
var jmoney = data.money;
if(nologin == '1'){
jmoney = data.money / $(".item-price .tit t").data("proportion");
}
if(data.type == 1){
if(oldprice <= jmoney){
layer.msg("抱歉,价格异常");
return false;
}
$(".item-price .tit t").html(parseFloat(oldprice-jmoney).toFixed(2)+' '+oldprice.toFixed(2)+'');
if(lmoney >= (oldprice-jmoney)){
$(".erphpdown-btn-show").hide();
$(".erphpdown-btn-hide").show();
}
}else if(data.type == 2){
$(".item-price .tit t").html(parseFloat(oldprice*0.1*data.money).toFixed(2)+' '+oldprice.toFixed(2)+'');
if(lmoney >= (oldprice*0.1*data.money)){
$(".erphpdown-btn-show").hide();
$(".erphpdown-btn-hide").show();
}
}
}
if(data.type == 1){
layer.msg("优惠码使用成功,价格减"+data.money);
}else if(data.type == 2){
layer.msg("优惠码使用成功,价格"+data.money+"折");
}
}else{
layer.msg("优惠码无效");
}
});
}
return false;
});
if(_ERPHPDOWN.tuan == '1'){
$(".erphpdown-tuan-loader").on("click",function(){
var post_id = $(this).data("post");
var tuan_num = $(this).data("num");
if(post_id){
layer.msg("处理中...", {
icon: 16,
shade: 0.4,
time: -1
});
$.post(_ERPHP.ajaxurl, {
"action": "epd_tuan",
"post_id": post_id,
"tuan_num": tuan_num
}, function(result) {
if( result.status == 200 ){
location.reload(true);
}else if( result.status == 201 ){
layer.msg(result.msg);
}else{
layer.msg("参团失败,请稍后重试!");
}
}, 'json');
}
return false;
});
$(".erphpdown-tuituan").click(function(){
var post_tui = $(this).data("tui");
if(confirm("退团会扣除"+post_tui+"%的手续费哦~")){
var post_id = $(this).data("post");
var tuan_num = $(this).data("num");
if(post_id && tuan_num){
layer.msg("处理中...", {
icon: 16,
shade: 0.4,
time: -1
});
$.post(_ERPHP.ajaxurl, {
"action": "epd_tuituan",
"post_id": post_id,
"tuan_num": tuan_num
}, function(result) {
if( result.status == 200 ){
layer.msg("退团成功!");
location.reload(true);
}else if( result.status == 201 ){
layer.msg(result.msg);
if(result.reload){
location.reload(true);
}
}else{
layer.msg("退团失败,请稍后重试!");
}
}, 'json');
}else{
layer.msg("获取退团信息失败!");
}
return false;
}
});
}
if($(".erphpdown-see-pay").length > 1){
$(".erphpdown-see-pay .erphpdown-buy, .erphpdown-see-pay .erphp-see-must").after('(购买一个,查看所有)');
}
if($(".erphpdown-see.erphpdown-see-video").length){
$(".erphpdown-see.erphpdown-see-video").each(function(){
$(this).height($(this).width()*9/16);
});
}
var clipboard = new Clipboard(".erphpdown-copy");
clipboard.on("success", function(e) {
layer.msg("已复制",{time:500});
});
});
function erphpdownOrderSuccess(){
layer.open({
title: '提示',
area: ['360px', '180px'],
btn: ['已支付', '再想想'],
content: '订单是否已支付?',
yes: function(index, layero){
layer.close(index);
//location.reload(true);
if (window.location.href.indexOf("?") != -1) {
location.href=window.location.href+'×tamp='+new Date().getTime();
}else{
location.href=window.location.href+'?timestamp='+new Date().getTime();
}
}
,btn2: function(index, layero){
layer.close(index);
}
});
}
/* Powered by QQ:82708210 */