支付",t.className="disabled";else{var a=t.className;a.indexOf("hb_3_payway")<0&&a.indexOf("hb_6_payway")<0&&a.indexOf("hb_12_payway")<0&&(t.innerHTML="正在支付",t.setAttribute("disabled","disabled"))}return keyboard.setAttribute("disabled","disabled"),auth_status&&hight_fenqi_status?"pay"===t.id&&merchant_coupon_list.length?(utilFuns.controllPopup([[mainPopup,"normal","addClass"],[popupMask,"show","addClass"]],function(){lastPrice!=price&&(current_coupon={},valid_coupon=[],valid_coupon=utilFuns.gMember_coupon_list(price-no_discount_amount,merchant_coupon_list),utilFuns.calculate()),lastPrice=price,secondMainPopup.className="second-popup",addClass(document.querySelector("#secondMainPopupClose"),"hidden"),removeClass(document.querySelector("#payWayBack"),"hidden")}),void keyboard.removeAttribute("disabled")):checkFenqiSwitch(totalfee||accMul(price,100))&&"pay"===t.id?void utilFuns.showPay(totalfee||accMul(price,100),"only_hb"):n?void goHbPrepay({currentNum:n}):void(market_activity_status&¤t_coupon.coupon_no?api.marketCouponFreeze(current_coupon.coupon_no,function(e){return"01"!=e.result_code||"01"!=e.return_code?(document.getElementById("dig_content").innerText=e.result_msg||e.return_msg||"网络错误",dialog.style.display="block",dialog.setAttribute("close","false"),void initPayBtnStyle()):e.coupon_credential?void goPrePay(e.coupon_credential):(document.getElementById("dig_content").innerText="获取优惠券凭证失败,请尝试选择其它优惠",dialog.style.display="block",dialog.setAttribute("close","false"),void initPayBtnStyle())},function(t){document.getElementById("dig_content").innerText=e.retmsg||"网络错误",dialog.style.display="block"}):goPrePay()):void(pay_btn_status=!0)}}function ajax(e){e=e||{},e.type=(e.type||"GET").toUpperCase(),e.dataType=e.dataType||"json";var t=new XMLHttpRequest;t.onreadystatechange=function(){if(4==t.readyState){var n=t.status;n>=200&&n<300?e.success&&e.success(JSON.parse(t.responseText),t.responseXML):e.fail&&e.fail(n)}},"GET"==e.type?(t.open("GET",e.url+"?"+formatParams(e.data),!0),t.timeout=e.timeout,t.send(null)):"POST"==e.type&&(t.open("POST",e.url,!0),t.setRequestHeader("Content-Type",e.contentType),t.timeout=e.timeout,t.send(e.data)),t.ontimeout=function(){!!e.timeoutCallback&&e.timeoutCallback()}}function formatParams(e){var t=[];for(var n in e)t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t.push(("v="+Math.random()).replace(".","")),t.join("&")}function accMul(e,t){var n=0,a=e.toString(),i=t.toString();try{n+=a.split(".")[1].length}catch(o){}try{n+=i.split(".")[1].length}catch(o){}return Number(a.replace(".",""))*Number(i.replace(".",""))/Math.pow(10,n)}function accDiv(arg1,arg2){var t1=0,t2=0,r1,r2;try{t1=arg1.toString().split(".")[1].length}catch(e){}try{t2=arg2.toString().split(".")[1].length}catch(e){}with(Math)return r1=Number(arg1.toString().replace(".","")),r2=Number(arg2.toString().replace(".","")),r1/r2*pow(10,t2-t1)}function dcmAdd(e,t){var n,a,i;try{n=e.toString().split(".")[1].length}catch(o){n=0}try{a=t.toString().split(".")[1].length}catch(o){a=0}return i=Math.pow(10,Math.max(n,a)),(accMul(e,i)+accMul(t,i))/i}function dcmMinus(e,t){var n,a,i;try{n=e.toString().split(".")[1].length}catch(o){n=0}try{a=t.toString().split(".")[1].length}catch(o){a=0}return i=Math.pow(10,Math.max(n,a)),(accMul(e,i)-accMul(t,i))/i}function fen2Yuan(e){return e=1*e,"number"!=typeof e||isNaN(e)?0:accDiv(e,100).toFixed(2)}function closeWd(){isEnv("qq")?history.back():isEnv("alipay")?AlipayJSBridge.call("closeWebview"):isEnv("weixin")?closeWx():isEnv("bestpay")?App.exitApp():history.back()}function closeWx(){function e(){WeixinJSBridge.invoke("closeWindow",{},function(e){})}"undefined"==typeof WeixinJSBridge?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",e,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",e),document.attachEvent("onWeixinJSBridgeReady",e)):e()}function amount_check(e){var t=/^\d{1,6}(\.\d{0,2})?$/;return!!t.test(e)}function isEnv(e){var t={qq:/\bqq\/([\d\.]+)/i,weixin:/MicroMessenger/i,wxwork:/wxwork.+MicroMessenger/i,alipay:/AlipayClient/i,bestpay:/bestpay/i,ios:/iphone|ipad|ipod/i,android:/android/i,unionpay:/unionpay/i};return!!navigator.userAgent.toLowerCase().match(t[e])}function setCookie(e,t){var n=new Date;n.setTime(n.getTime()+72e5),document.cookie=e+"="+escape(t)+";expires="+n.toGMTString()+";path="+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/")+1)+"fenqi_sdk;domain="+window.location.hostname}function getCookie(e){var t,n=new RegExp("(^| )"+e+"=([^;]*)(;|$)");return(t=document.cookie.match(n))?unescape(t[2]):null}function clearAllCookie(){var e=document.cookie.match(/[^ =;]+(?=\=)/g);if(e)for(var t=e.length;t--;)document.cookie=e[t]+"=0;expires="+new Date(0).toUTCString()}function hasClass(e,t){return t=t||"",0!=t.replace(/\s/g,"").length&&new RegExp(" "+t+" ").test(" "+e.className+" ")}function addClass(e,t){hasClass(e,t)||(e.className=""==e.className?t:e.className+" "+t)}function removeClass(e,t){if(hasClass(e,t)){for(var n=" "+e.className.replace(/[\t\r\n]/g,"")+" ";n.indexOf(" "+t+" ")>=0;)n=n.replace(" "+t+" "," ");e.className=n.replace(/^\s+|\s+$/g,"")}}function productUid(){for(var e=[],t="0123456789abcdef",n=0;n<32;n++)e[n]=t.substr(Math.floor(16*Math.random()),1);e[14]="4",e[19]=t.substr(3&e[19]|8,1),e[8]=e[13]=e[18]=e[23];var a=e.join("");return a}function safeArea(){var e=window.navigator.userAgent,t=!!e.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),n=window.screen.height;!isEnv("bestpay")&&t&&n>=812&&(document.getElementById("keyboard").style.paddingBottom="6vw")}window.onresize=function(){var e=375,t=document.documentElement.clientWidth;document.getElementsByTagName("html")[0].style.fontSize=t/e*62.5+"%"},window.onresize(),clearAllCookie(),document.body.addEventListener("touchmove",function(e){e.preventDefault()});var getQueryString=function(e){var t=new RegExp("(^|&|;)"+e+"=([^&|;]*)(&|;|$)","i"),n=window.location.search.substr(1).match(t);return null!=n?decodeURIComponent(n[2]):null},api={jsticket:function(e,t){httpRequest.get("/wx/jsapi/jsticket_wxwork",{appid:sub_appid,url:location.href.split("#")[0]},e,t)},getPrePayData:function(e,t,n,a,i,o,r){httpRequest.get("/wappay/110/pay/geth5pay_sdk",{pay_code:e,uni_code:t,terminal_no:n,pay_type:a,sub_appid:i},o,r)},prePay:function(e,t,n){var a={pay_ver:pay_ver||"100",pay_type:e.paytype_code||paytype_code,service_id:"012",merchant_no:e.merchant_no||merchant_no,terminal_id:e.terminal_no||terminal_no,terminal_time:e.terminaltime||(new Date).Format("yyyyMMddhhmmss"),total_fee:e.total_fee,open_id:e.pay_openid||pay_openid,order_body:e.order_body||"",terminal_trace:e.terminaltrace||(new Date).getTime(),notify_url:e.notify_url||"",sub_appid:e.sub_appid,attach:e.attach,operator_id:e.operator_id,repeated_trace:e.repeated_trace,front_url:e.front_url||fronturl,coupon_no:e.coupon_no,no_discount_amount:e.no_discount_amount,coupon_credential:e.coupon_credential};httpRequest.post("/wappay/100/pay/h5pay",a,t,n)},fenqiPrePay:function(e,t,n,a,i,o,r,c){var s={client_type:isEnv("alipay")?"01":"02",client_id:e,merchant_no:t,terminal_no:n,trace_no:i||(new Date).getTime(),total_fee:a,fenqi_num:"6"};httpRequest.post("/pay/200/fenqi/prepay",s,r,c)},payNotify:function(e,t){var n=setTimeout(t,1e3);httpRequest.get("/wappay/100/pay/h5payfrontnotify",{tradeno:e},function(e){"01"==e.result_code&&(clearTimeout(n),t())},function(){})},showAd:function(e,t,n,a,i){var o=httpRequest._server+":"+httpRequest._port+httpRequest._urlPrefix+"/common/advertise/pay/adurl?auth_code=&uniopenid="+e+"&pay_type="+t+"&merchant_no="+n+"&terminal_no="+a+"&adprivatestatus="+i;location.replace(o)},wxpay:function(e,t,n,a,i,o,r,c){function s(){WeixinJSBridge.invoke("getBrandWCPayRequest",{appId:e,timeStamp:t,nonceStr:n,"package":a,signType:i,paySign:o},function(e){"get_brand_wcpay_request:ok"==e.err_msg||"get_brand_wcpay_request:cancel"==e.err_msg?r(e):c(e)})}"undefined"==typeof WeixinJSBridge?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",s,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",s),document.attachEvent("onWeixinJSBridgeReady",s)):s()},qqpay:function(e,t,n,a,i){mqq.tenpay.pay({tokenId:e,pubAcc:t,pubAccHint:n},function(e){0==e.resultCode||e.resultCode==-11001||e.resultCode==-1?a(e):i(e)})},pay_redirect:function(e){location.replace(e)},alipay_old:function(e){location.href=e},alipay:function(e,t,n){AlipayJSBridge.call("tradePay",{tradeNO:e},function(e){"9000"==e.resultCode||"6001"==e.resultCode?t(e):n(e)})},bestPay:function(e,t,n){var a=User.getProduct();e=JSON.parse(e),e.ACCOUNTID=a,e.CUSTOMERID=a,Payment.onPay(e,function(){t()},function(){n()})},hbPrepay:function(e,t,n){var a={pay_ver:pay_ver||"100",pay_type:"020",service_id:"012",merchant_no:merchant_no,terminal_id:terminal_no,terminal_time:e.terminaltime||(new Date).Format("yyyyMMddhhmmss"),total_fee:e.total_fee,open_id:pay_openid,order_body:e.order_body,terminal_trace:e.terminaltrace||(new Date).getTime(),fenqi_num:e.currentNum,attach:e.attach,notify_url:e.notify_url,repeated_trace:e.repeated_trace,operator_id:e.operator_id};httpRequest.post("/pay/200/fenqi/hbjspay",a,t,n)},creditcardFenqi:function(e){api.fenqiPrePay(e.union_openid,e.merchant_no,e.terminal_no,e.totalfee,e.terminaltrace,e.fronturl,function(t){if("01"!=t.result_code||"01"!=t.return_code)return document.getElementById("dig_content").innerText=t.result_msg||t.return_msg||"网络错误",void(dialog.style.display="block");var n=t.fenqi_channel;if(0==n){var a=document.getElementById("kfqForm"),i="https://m.kutianxia.com/kubaitiao/merchant/gateway",o=t.sign,r=t.data,c=t.midPlatform,s=t.version,u='
';a.innerHTML=u,document.getElementById("kfqFormContent").submit()}else 1==n?(t.remark=e.remark,t.d=e.d,t.fqonly=e.fqonly,t.notify_url=e.notify_url,t.front_url=e.fronturl,t.terminaltime=e.terminaltime,setCookie("fenqiStep1",JSON.stringify(t)),location.replace("./fenqi_sdk/selectfenqi.html")):(document.getElementById("dig_content").innerText="分期配置有误",dialog.style.display="block");initPayBtnStyle()},function(e){document.getElementById("dig_content").innerText=e.retmsg||"网络错误",dialog.style.display="block"})},getFenqiInfo:function(e,t,n,a,i){httpRequest.post("/wappay/110/pay/query_fenqiinfo",{terminal_no:e,trace_no:t,pay_mode:n},a,i)},getMarketCouponList:function(e,t,n){httpRequest.post(marketCouponBaseUrl+"/coupon/taika/findCouponList",e,t,n)},marketCouponFreeze:function(e,t,n){var a={api_ver:"100",trace_no:productUid(),merchant_no:merchant_no,terminal_id:terminal_no,coupon_no:e};httpRequest.post(marketCouponBaseUrl+"/coupon/taika/freeze",a,t,n)},marketCouponUnFreeze:function(e,t,n){var a={api_ver:"100",trace_no:productUid(),merchant_no:merchant_no,terminal_id:terminal_no,coupon_no:e};httpRequest.post(marketCouponBaseUrl+"/coupon/taika/unfreeze",a,t,n)},payCancel:function(e,t,n){httpRequest.post("/wappay/110/pay/closepayment",e,t,n)}},head_wrap=document.getElementById("head_wrap"),terminal_no=getQueryString("terminalno"),paylogourl=getQueryString("paylogourl"),payname=getQueryString("payname")||"向商家付款",storename=getQueryString("storename"),adstatus="1",totalfee=getQueryString("totalfee"),terminaltrace=getQueryString("terminaltrace"),terminaltime=getQueryString("terminaltime"),orderbody=getQueryString("orderbody"),fronturl=getQueryString("fronturl"),attach=getQueryString("attach")||"",auto_pay=getQueryString("autopay"),notify_url=getQueryString("notifyurl"),repeated_trace=getQueryString("repeated_trace"),pay_ver=getQueryString("pay_ver"),auth_status=!1,pay_btn_status=!1,marketCouponBaseUrl="https://open-mkt.lcsw.cn",activity_switch=getQueryString("activity_switch")||0,app_activity_status=getQueryString("app_activity_status")||0,market_activity_status=3==activity_switch&&1==app_activity_status,no_discount_amount_url=getQueryString("no_discount_amount"),dialog=document.getElementById("dialog"),payLogo=document.getElementById("pay_logo"),remark=document.getElementById("remark"),remark_win=document.getElementById("remark_win"),remark_content=document.getElementById("remark_content"),remark_btn=document.getElementById("remark_btn"),remark_input=document.getElementById("remark_input"),mask=document.getElementById("mask"),price=document.getElementById("price").innerText=totalfee?fen2Yuan(totalfee):"",no_discount_amount=no_discount_amount_url?fen2Yuan(no_discount_amount_url):"",payFenqiBtn=null,payBtn=null,current_coupon={},valid_coupon=[],merchant_coupon_list=[],price_sign=document.querySelector("#price_sign"),price_placeholder=document.querySelector("#price_placeholder"),price_cursor=document.querySelector("#cursor");document.getElementById("no_discount_amount").innerText=no_discount_amount_url?"¥"+fen2Yuan(no_discount_amount_url):"";var lastPrice=0,popupWraper=document.querySelector("#popup-wraper"),popupMask=document.querySelector("#popup-mask"),mainPopup=popupWraper.querySelector("#main-popup"),secondMainPopup=popupWraper.querySelector("#second-main-popup"),yhqPopup=popupWraper.querySelector("#yhq-popup"),payWayList=popupWraper.querySelector("#payWayList"),fenqi_switch=getQueryString("fenqi_switch")||0,adprivatestatus=getQueryString("adprivatestatus")||0,fenqi_merchant_no=getQueryString("fenqi_merchant_no"),fqonly=13==getQueryString("paytype")?1:0,huabei_fenqi_switch=getQueryString("huabei_fenqi_switch")||0,hight_fenqi_data=[],hight_fenqi_fee=0,hight_fenqi_status=!1,isFenqi_open=checkFenqiSwitch(totalfee||accMul(price,100));(1==fenqi_switch||isEnv("alipay")&&huabei_fenqi_switch>0)&&(document.getElementById("fenqi_tip").style.display="inline-block"),parseFloat(price)>0?(keyboard=document.getElementById("keyboard2"),document.querySelector("#price_placeholder").style.display="none",keyboard.style.display="block",1==fqonly&&(keyboard.children[0].style.display="none"),setMoneyTip(price),payBtn=keyboard.children[0],parseFloat(no_discount_amount)>0&&(document.getElementById("no_discount").style.display="block",document.getElementById("order_no_discount_amount-cell").style.display="block",toggleMoneyLineTip(!0))):(document.getElementById("cursor").style.display="block",keyboard=document.getElementById("keyboard"),payBtn=keyboard.children[7],safeArea(),keyboard.style.display="block"),paylogourl?(paylogourl=decodeURIComponent(paylogourl)+"@130h_130w_2e.png",paylogourl=paylogourl.replace(/http:/,"https:")):paylogourl="images/pay_logo.png",payLogo.src=paylogourl,setPayName();var store_name=document.getElementById("store_name");storename?store_name.innerHTML="'+l+""+u+""+p+'
满'+s+"元可用
'+(1==r.use_rule?"可与商家活动同享":"不可与商家活动同享")+(r.top_fee>0?'最高优惠'+fen2Yuan(r.top_fee)+"元":"")+"
",n+=''+g+f+"
",n+=''+l+""+u+""+p+'
满'+s+"元可用
'+(1==r.use_rule?"可与商家活动同享":"不可与商家活动同享")+'
'+g+f+'