You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
15 KiB
JavaScript

2 years ago
"use strict";!function(t,e){function n(e){var n=new RegExp("(^|&)"+e+"=([^&]*)(&|$)","i"),o=t.location.search.substr(1).match(n);return null!=o?unescape(o[2]):null}function o(e){for(var n=t.location.search.substring(1),o=n.split("&"),i=0;i<o.length;i++){var a=o[i].split("=");if(a[0]==e)return a[1]}return""}function i(){var e=n("api_env"),o=t.location.host,i="https://mall.csdn.net",a=document.getElementsByTagName("meta").ordercart;!e&&a&&a.content&&a.content.length?o=JSON.parse(a.content).api_env:e&&(o=e);var s=/^beta|test|loc[a-z]*/;return o.indexOf(".blog.csdn.net")>=0?i="https://mall.csdn.net":o.match(s)?i="https://test-mall-order.csdn.net":o.match(/^pre-|pre[a-z]*/)&&(i="https://pre-mall.csdn.net"),i}function a(n,o,i){o=isNaN(o)?3e3:o;var a=document.createElement("div");a.innerHTML=n,a.style.cssText="width:124px;opacity: 0.8;height: 40px;background:rgba(34,34,38,1);color: rgb(255, 255, 255);line-height: 40px;text-align: center;border-radius: 4px;position: fixed;top: 35%;left:50%;margin-left:-62px;z-index: 999999;font-size: 16px;",document.getElementById("user-ordertip").appendChild(a),setTimeout(function(){a.style.webkitTransition="-webkit-transform 0.5s ease-in, opacity 0.5s ease-in",a.style.opacity="0",setTimeout(function(){document.getElementById("user-ordertip").removeChild(a),i&&(e("#user-ordertip-box").remove(),t.location.reload())},500)},o)}function s(t,n,o){e("#ordertip_notify").show().html('<img class="pay_icon" src="https://csdnimg.cn/release/download/images/'+t+'.png"/><span class="pay_tip">'+n+"</span>"),e("#ordertip_qr_code").html('<img src="https://csdnimg.cn/public/static/img/csdn-userimg250.gif" width="130" height="130"/>'),e("#ordertip_notify .pay_icon,#ordertip_notify .pay_tip").on("click",function(){u.getPayCode()})}function d(){s("pay_error","已扫码<br>请在手机端操作","")}function r(){s("pay_error","获取失败,点击重试","code_2")}function c(){s("pay_time_out","点击重新获取","")}function l(){a("支付成功","2000",!0)}function p(){this.goodType="",this.goodsList={},this.goodsInfo={},this.isUseBalance=!0,this.sale="",this.toPay="",this.errType="",this.reportExt={},this.navList=[],this.payMethods=[],this.price=0,this.payUrl="",this.params={}}t.csdn=t.csdn||{},csdn.userOrderTip=csdn.userOrderTip?csdn.userOrderTip:{};var g="https://g.csdnimg.cn/user-ordertip/4.1.3/images";!function(t){var e=document.createElement("link");e.rel="stylesheet",e.type="text/css",e.href=t,document.getElementsByTagName("head")[0].appendChild(e)}("https://g.csdnimg.cn/user-ordertip/4.1.3/user-ordertip.css"),p.prototype={constructor:p,close:function(){e("#user-ordertip").remove()},show:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.getOrderTipData(this.init,t)},init:function(t){var e=this;e.params=t,e.sale=t.sale_source||o("sale_source"),e.reportExt=t.report_ext||{},-1!=this.navList.findIndex(function(e){return e.flag==t.flag})?e.goodType=t.flag:e.goodType=e.goodType,e.getGoodsShowList(t),e.renderDialog(),e.setDefaultGoodsItem()},renderDialog:function(){var t=this;t.renderUserOrderTip(),t.renderNav(),t.renderGoodRights(),t.renderPaymenthods(),t.renderPaymentInfo()},renderUserOrderTip:function(){var t=this,n=e('<div id="user-ordertip">\n <div class="user_ordertip_dialog">\n <div class="ordertip_dialog_wrapper">\n <div class="dialog_wrapper_header">\n <div class="dialog_title"></div>\n <span class="dialog_header_btn"> + </span>\n </div>\n \n <div class="dialog_wrapper_content">\n <div class="dialog_product"></div>\n <div class="dialog_rights"></div>\n\n <div class="dialog_payment">\n <li class="recharge_mode '+(0!=t.price?"block":"none")+'">\n <div class="recharge_mode_qr_code" id="ordertip_qr_code">\n <img class="loading" src="'+g+'/che