[C#] 纯文本查看 复制代码
#region MyRegion
StringBuilder sb = new StringBuilder();
sb.Append("package aa{ public class JScript {");
sb.Append("/**");
sb.Append("* 加载页面异步相关信息");
sb.Append("*/");
sb.Append("function loadOrderExt() {");
sb.Append("var actionUrl = OrderAppConfig.AsyncDomain");
sb.Append("+ \"/obtainOrderExt.action\";");
sb.Append("var param = addFlowTypeParam();");
sb.Append("jQuery.ajax( {");
sb.Append(" type : \"POST\",");
sb.Append(" dataType : \"json\",");
sb.Append(" url : actionUrl,");
sb.Append(" data : param,");
sb.Append(" cache : false,");
sb.Append(" success : function(dataResult, textStatus) {");
sb.Append(" // 没有登录跳登录");
sb.Append(" if (isUserNotLogin(dataResult)) {");
sb.Append(" goToLogin();");
sb.Append(" return;");
sb.Append(" }");
sb.Append(" // 服务器返回异常处理,如果有消息div则放入,没有则弹出");
sb.Append(" if (isHasMessage(dataResult)) {");
sb.Append(" var message = getMessage(dataResult);");
sb.Append(" alert(message);");
sb.Append(" }");
sb.Append(" ");
sb.Append(" //=================1.刷新商品库存状态==============");
sb.Append(" var states = dataResult.skuStockInfos;");
sb.Append(" // 成功后如果有divID直接放入div,没有则返回结果");
sb.Append(" loadSkuListStockData(states);");
sb.Append(" ");
sb.Append(" //=================2.加载验证码==============");
sb.Append(" if(dataResult.showCheckCode){");
sb.Append(" refreshCheckCode(dataResult.encryptClientInfo);");
sb.Append(" }");
sb.Append(" //===============3.加载订单备注==============");
sb.Append(" if(dataResult.showOrderRemark){");
sb.Append(" showOrderRemark();");
sb.Append(" }");
sb.Append(" //===============4.是否需要支付密码==============");
sb.Append(" if (dataResult.needPayPwd) {");
sb.Append(" $(\"#paypasswordPanel\").show();");
sb.Append(" } else {");
sb.Append(" $(\"#paypasswordPanel\").hide();");
sb.Append(" } ");
sb.Append(" //==================5.加载余额==================");
sb.Append(" if(dataResult.balance.success){");
sb.Append(" var useFlag = dataResult.balance.checked;");
sb.Append(" $(\"#selectOrderBalance\").attr(\"checked\",useFlag);");
sb.Append(" $(\"#canUsedBalanceId\").text(\"使用余额(账户当前余额:\" + dataResult.balance.leavyMoney.toFixed(2) + \"元)\");");
sb.Append(" if(dataResult.balance.leavyMoney > 0){");
sb.Append(" $(\"#showOrderBalance\").css(\"display\", \"block\");");
sb.Append(" }else{");
sb.Append(" $(\"#showOrderBalance\").css(\"display\", \"none\");");
sb.Append(" }");
sb.Append(" // 验证余额是否开启支付密码");
sb.Append(" if(dataResult.showOpenPayPwd){");
sb.Append(" cancelUsedBalance();");
sb.Append(" }");
sb.Append(" }");
sb.Append(" //京豆优惠购是否足额和京豆优惠购商品id");
sb.Append(" var showOpenPayPwd = dataResult.showOpenPayPwd;");
sb.Append(" var existsJdbeanPromotion = dataResult.existsJdbeanPromotion;");
sb.Append(" var checkJdbeanPromotion = dataResult.checkJdbeanPromotion;");
sb.Append(" // 成功后如果有divID直接放入div,没有则返回结果");
sb.Append(" checkShowOpenPwd(showOpenPayPwd,existsJdbeanPromotion,checkJdbeanPromotion);");
sb.Append("},");
sb.Append("error : function(XMLHttpResponse) {");
sb.Append("}");
sb.Append("});");
sb.Append("} ");
sb.Append("}}");
#endregion
CompilerParameters parameters = new CompilerParameters();
parameters.GenerateInMemory = true;
CompilerResults results = _provider.CompileAssemblyFromSource(parameters, sb.ToString());
Assembly assembly = results.CompiledAssembly;
_evaluateType = assembly.GetType("aa.JScript");
|