PageSourceSearch

https://sale.chinaacc.com/newweb/resources/js/cart/shoppingCart.js?v=20260408

js chinaacc.com collected 2026-10-02 07:36:24 UTC 39,138 bytes, 1,164 lines download raw bytes

1$.cookie('select_course_list', '',{path:'/', domain: '.chinaacc.com' });
2$.cookie('buy_book_list', '',{path:'/', domain: '.chinaacc.com' });
3
4var isLogin = false;
5
6CDEL.loginStatus(function (json) {
7	if(json.loginFlag != 'undefined'){
8		isLogin = json.loginFlag;
9	}
10})
11
12$(function () {
13    //领取优惠券
14    $(".shoppingCart-mod .coupon-wrap").hover(function () {
15        $(this).find(".coupon-pop").fadeIn();
16    },function () {
17        $(this).find(".coupon-pop").hide();
18    })
19
20
21   $(".shoppingCart-mod .course-con .coupon-pop .btn").on("click",function () {
22	   $(this).parents(".coupon-pop").hide();
23    });
24    
25    courseChoice();
26    getNeedMoney();
27
28    //更多立减弹出框
29    $(".shoppingCart-mod .course-con .con .course-price p .more-btn").hover(function () {
30       $(this).parents(".course-price").find(".sale-pop").show();
31    },function () {
32        $(this).parents(".course-price").find(".sale-pop").hide();
33    })
34
35    //吸顶效果 吸底效果
36    var _shoppingCartTit = $('.shoppingCart-tit'),
37        _settlementMod = $('.settlement-mod'),
38        shoppingCartTitTop = _shoppingCartTit.position().top;
39        if(_settlementMod.length > 0){
40        	var settlementModTop = _settlementMod.position().top,
41            settlementModHeight = _settlementMod.outerHeight(true),
42            shoppingCartFixedEvent = function () {
43                var sTop= $(document).scrollTop(),
44                    winHeight = $(window).height(),
45                    settlementFixedEnd = sTop + winHeight + settlementModHeight;
46                if(sTop >= shoppingCartTitTop){
47                    _shoppingCartTit.addClass('shoppingCart-tit-fixed')
48                }else{
49                    _shoppingCartTit.removeClass('shoppingCart-tit-fixed')
50                }
51                if(settlementModTop > winHeight && (settlementModTop + settlementModHeight * 2) >= settlementFixedEnd){
52                    $('.settlement-mod-visible').height(settlementModHeight)
53                    $('body').addClass('settlement-mod-body')
54                }else{
55                    $('body').removeClass('settlement-mod-body')
56                }
57                if(sTop > 200){
58                    $('.shoppingCart-goBack').fadeIn()
59                }else{
60                    $('.shoppingCart-goBack').fadeOut()
61                }
62            }
63        	$(window).bind('load scroll resize',shoppingCartFixedEvent);
64        }
65    //返回顶部
66    $('.shoppingCart-goBack a').click(function (){
67        $("html, body").animate({
68            scrollTop: 0
69        }, 120);
70    })
71    
72    //20200602 add by sunke
73    $(".depositAgreement-con").click(function () {
74	    var $this = $(this),
75	        $input = $(this).find("input");
76	    if($input.is(':checked')){
77	        $this.removeClass("on");
78	        $input.prop("checked", false);
79	    }else {
80	        $this.addClass("on");
81	        $input.prop("checked", true);
82	    }
83    })
84    
85    /*20210427 add by liyanjiao*/
86    $(".del_all").click(function (){
87        var allChk = $(this).parents(".settlement-mod").siblings(".shoppingCart-mod").find(".course-chk i.on");
88        if(allChk.length != 0){
89            $(".mask,.del_modal").show();
90        }else{
91            CDEL.alertTip("您尚未选择任何宝贝");
92        }
93        // console.log(allChk)
94    })
95    $(".del_close,.btn_cancel").click(function (){
96        $(".mask,.del_modal").hide();
97    })
98    $(".del_modal .del_btn .btn_sure").click(function (){
99    	deleteCartBatch();
100    })
101    
102    //领券曝光埋点
103	setTimeout(function(){
104		//领券曝光埋点
105		var _couponsCenterDetailsBth = $('.couponCenterTagBth');
106		if(_couponsCenterDetailsBth.size() > 0){
107			CDELTracker.$track(_couponsCenterDetailsBth[0],{
108				expo: 'expo_couponbag_entr_scart'
109		    })
110		}
111	},1000)
112	
113	getRecommended();
114    
115})
116var submitCart = function(){
117	if(!isLogin){
118//		var logReg = new headUcLoginRegister();
119//		logReg.dialogShow(headUcLogRegObj.url.LOGIN_URL, 450, 500);
120		CDEL.ucLogin();
121		return;
122	}
123	
124	var order_course_list = "";
125	var order_book_list = "";
126	
127	var money = 0;
128	var listNum = 0;
129	var frontNum = 0;
130	var restNum = 0;
131	var productList = "";
132	
133	var $inputs = $('input[name="checkProduct"]:checked');
134	var secKillSubjectType2ProductIdArray = new Array();
135	$inputs.each(function(){
136		if($(this).attr('secKillSubjectType') == 2){
137			secKillSubjectType2ProductIdArray.push($(this).attr('productId'));
138		}
139	});
140	//如果有含有直播秒杀的商品则需要先进行判断
141	if(secKillSubjectType2ProductIdArray.length > 0){
142		var productIdsStr = secKillSubjectType2ProductIdArray.join(",");
143		postAesData({
144	        data:{
145	            "params":{
146	                "productIds": productIdsStr,
147	                "time": new Date().getTime()
148	            },
149	            "domain": "chinaacc",
150	            "resourcePath": "+/act/seckill/getSecKillProductStu",
151	            "af": "1",                //类型:String  必有字段  备注:无
152	            "ap": "pc"                //类型:String  必有字段  备注:无
153	        },
154	        //ajax成功回调
155	        success: function(data){
156	        	var flagRes = true;
157	        	var success = data.success;
158	            var res = data.result;
159	            if((success == true || success == "true")){//网关调用成功
160	                for(var i = 0; i < res.length; i++){
161	                	var statue = res[i].killStatu;
162		                if(statue == 0){
163		                	toast("您勾选的商品秒杀未开始");
164		                	setTimeout("window.location.reload()", 2000);
165		                	flagRes = false;
166		                	break;
167		                }else if(statue == 2){
168		                	toast("您勾选的商品秒杀已结束");
169		                	setTimeout("window.location.reload()", 2000);
170		                	flagRes = false;
171		                	break;
172		                }else if(statue == 3){
173		                	toast("您勾选的商品已被秒光");
174		                	setTimeout("window.location.reload()", 2000);
175		                	flagRes = false;
176		                	break;
177		                }
178	                }
179	            }else{//网关调用失败,写提示语
180	            	toast("出现异常,请联系客服");
181	            	flagRes = false;
182	            }
183	            if(!flagRes){
184	            	return;
185	            }
186	            handleSubmitOrder($inputs, money, listNum, frontNum, restNum, productList, order_course_list, order_book_list);
187	        },
188	        //ajax失败回调
189	        error: function(xhr){
190	            resolve(xhr);
191	        }
192	    });
193	}else{
194		handleSubmitOrder($inputs, money, listNum, frontNum, restNum, productList, order_course_list, order_book_list);
195	}
196}
197
198//处理提交订单后续所需的操作
199function handleSubmitOrder($inputs, money, listNum, frontNum, restNum, productList, order_course_list, order_book_list){
200	var why = encodeURI("2020年爽11定金");
201	$inputs.each(function(index,element){//遍历每一个名字为interest的复选框,其中选中的执行函数    
202		var productId = $(this).val().split(':')[0];
203		var productType = $("#productType_"+productId).val();
204		if(1 == productType){
205			if(order_course_list ==  ""){
206				order_course_list = productId;
207			}else{
208				order_course_list = order_course_list + "," +  productId;
209			}
210		}else{
211			if(order_book_list ==  ""){
212				order_book_list = $(this).val() + ":1";
213			}else{
214				order_book_list = order_book_list + "," +  $(this).val() + ":1";
215			}
216			
217		}
218		
219		listNum++;
220		var itemPayType = $(this).attr("payType");
221		if(typeof (itemPayType) == "undefined"){
222			itemPayType = -1;
223		}
224		if(itemPayType == 1){
225			frontNum++;
226			var price = $(this).attr("price")
227			var tempFrontMoney = $(this).attr("frontMoney")=="undefined"?0:$(this).attr("frontMoney")
228			money = parseFloat(money) + parseFloat(tempFrontMoney);
229			var productId = $(this).attr("productId")
230			productList += productId + ":1:"+tempFrontMoney+":0,";
231		}else if(itemPayType == 2){
232			restNum++;
233		}
234		
235	});
236	if(frontNum > 0 && frontNum == listNum){
237		if(!$("#frontmoneychk").is(':checked')){
238    		toast("请先勾选协议条款哦!");
239    		return false;
240		}
241		var currentUrl =window.location.href;
242		window.location = "//sale.chinaacc.com/web/sale/order/order.shtml?v_payMoney="+money+"&v_why="+why+"&isManual=1&isFrontMoney=1&productList=" + productList+"&gotoUrl="+currentUrl;
243		return;
244	}
245	if(frontNum > 0 && frontNum != listNum){
246		toast("定金不能与其他商品同时结算哦!");
247		return false;
248	}
249	if(restNum > 0 && restNum != listNum){
250		toast("付尾款商品不能和其他商品一起结算!");
251		return false;
252	}
253	
254	setProCookie("order_course_list",null);
255	setProCookie("order_course_list",order_course_list);
256	setProCookie("order_book_list",null);
257	setProCookie("order_book_list",order_book_list);
258	var path = "//sale.chinaacc.com/web/sale/order/order.shtml";
259	if(restNum > 0 && restNum == listNum){
260		var activity_product_list = "";
261		$('input[name="checkProduct"]:checked').each(function(index,element){//遍历每一个名字为interest的复选框,其中选中的执行函数    
262			var productId = $(this).val().split(':')[0];
263			var itemPayType = $(this).attr("payType");
264			if(typeof (itemPayType) == "undefined"){
265				itemPayType = -1;
266			}
267			if(itemPayType == 2){
268				if(activity_product_list == ""){
269					activity_product_list = productId + ":2";
270				}else{
271					activity_product_list = activity_product_list + "," + productId + ":2";
272				}
273			}
274		});
275		setProCookie("activity_product_list",null);
276		setProCookie("activity_product_list",activity_product_list);
277	}
278	var isClient = getUrlParam("isClient");
279	if(isClient == 1){
280		path = "//sale.chinaacc.com/web/sale/order/order.shtml?isClient=1";
281	}
282	if(order_course_list ==  "" && order_book_list == ""){
283		alert("请选择结算商品!");
284	}else{
285		//领券
286		var canReceiveCouponIds = $("#canReceiveCouponIds").val();
287		if(canReceiveCouponIds == ""){
288			window.location = path;
289		}else{
290			try {
291				var time = new Date().getTime();
292				var setting = {
293					"uid":CDEL.getCookie("cdeluid"),
294					"source":1,
295					"voucherIds":canReceiveCouponIds,
296					"ltime":time,
297					"time":time
298				}
299				postAesData({
300					data:{
301						"params":setting,
302						"domain": "chinaacc",
303						"resourcePath": "+/c-sel/w-sale/coupon/receiveCoupons",
304						"af": "1",
305						"sid": CDEL.getCookie("sid"),
306						"fs": "201",
307						"platform": "0",
308						"lt": time+"",
309						"ap": "b3316459-ceeb-47f8-a469-12751ff3075e"
310
311					},
312					//ajax成功回调
313					success: function(data){
314						window.location = path;
315					},
316					//ajax失败回调
317					error: function(xhr){
318					}
319				});
320			} catch (e) {
321			}
322		}
323	}
324}
325
326function getUrlParam(name) {
327    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
328    var r = window.location.search.substr(1).match(reg);  //匹配目标参数
329    if (r != null) return unescape(r[2]); return null; //返回参数值
330}
331
332var openUrl = function (url) {
333	url = "//" + url;
334	window.open(url,"_blank");
335};
336
337//购课协议弹出框
338var buyCourseTipsPop = function () {
339    $(".buyCourseTips-pop,.mask").show();
340    $("#buyCourseTipClose").show();
341    //关闭弹出框
342    $(".buyCourseTips-pop .tit .close-btn").on("click",function () {
343        $(".buyCourseTips-pop,.mask").hide()
344    });
345}
346
347var buyCourseTipClose = function() {
348	 $(".buyCourseTips-pop,.mask").hide();
349	 $("#buyCourseTipClose").hide();
350}
351
352
353//购课提醒
354var buyCourseTips = function (classesId , productId ) {
355	var param = "?classesId="+classesId+"&productId="+productId+"&buyType=3";
356	$.ajax({
357		type : "POST",
358		url : "//sale.chinaacc.com/newweb/buyCourseTipsPop.shtm"+param,
359		dataType : "html",
360		contentType : "application/json",
361		success : function (data) {
362			$("#buyCourse").html(data);
363			// 调取购课提醒弹框
364			buyCourseTipsPop();
365			$("#lianbaoCourseSubmit").hide();
366		}
367	})
368}
369
370//赠送优惠券
371var getCoupon = function (discountId) {
372	if(!isLogin){
373//		var logReg = new headUcLoginRegister();
374//		logReg.dialogShow(headUcLogRegObj.url.LOGIN_URL, 450, 500);
375		CDEL.ucLogin();
376		return;
377	}
378	var param = "?discountId=" + discountId;
379	$.ajax({
380		type : "POST",
381		url : "//sale.chinaacc.com/newweb/cart/getCoupon.shtm"+param,
382		dataType : "html",
383		contentType : "application/json",
384		success : function (data) {
385			var result = $.parseJSON(data);
386			if(result.code == 1){
387				$(".couponShow_"+discountId).addClass("no")
388				$(".couponShow_"+discountId).text("已领取")
389				alert(result.msg);
390			}
391		}
392	})
393}
394
395//联报班弹出层
396var lianbaoCoursePop = function (classId , subjectIds) {
397    //去选购弹出框-选
398    var isClient = getUrlParam("isClient");
399    if(null == isClient){
400        isClient = 0;
401    }
402    if(subjectIds == null){
403    	var param = "?classesId=" + classId + "&judgeId=1" + "&isClient=" + isClient;
404    }else{
405    	var param = "?classesId=" + classId + "&subjectIds="+ subjectIds + "&judgeId=1"+ "&isClient=" + isClient;
406    }
407	$.ajax({
408		type : "POST",
409		url : "//sale.chinaacc.com/newweb/cart/lianbaoCourse.shtm"+param,
410		dataType : "html",
411		contentType : "application/json",
412		success : function (data) {
413			$("#lianbaoCourse").html(data);
414			 courseChoicePop();
415			var _this = $(".lianbaoCourse-pop");
416		    var _thisHeight = _this.height()/2;
417		    var mask = $(".mask");
418		    _this.show().css("marginTop",-_thisHeight)
419		    mask.show()
420		    $(".lianbaoCourse-pop .close-btn").click(function () {
421		        _this.hide()
422		        mask.hide()
423		    })
424		},
425	})
426	$("#buyCourseTipClose").hide();
427	
428}
429
430
431//去选购弹出框-选课
432var courseChoicePop = function () {
433    //班次选择
434    $(".lianbaoCourse-pop .choice-classes p").on("click",function () {
435        var _this = $(this);
436        var singleChk = _this.hasClass("single-chk");
437        var setMeal = _this.hasClass("setMeal-chk");
438        //联报
439        if(setMeal){
440            if(_this.hasClass('on')){
441                _this.find("input").prop("checked", false);
442                _this.removeClass("on");
443                $(".choice-setMeal .setMeal-con.single-chk").addClass("no").removeClass("on").find("input").prop("checked", false);
444            }else {
445                _this.find("input").prop("checked", true);
446                _this.addClass("on").siblings("p").removeClass("on").find("input").prop("checked", false);
447                $(".choice-setMeal .setMeal-con.setMeal-chk").addClass("no").removeClass("on").find("input").prop("checked", false);
448                $(".choice-setMeal .setMeal-con.single-chk").removeClass("no")
449            }
450        }
451        //单科
452        if(singleChk){
453            if(_this.hasClass('on')){
454                _this.removeClass("on").find("input").prop("checked", false);
455                if(!_this.siblings(".single-chk").hasClass("on")){
456                    $(".choice-setMeal .setMeal-con.setMeal-chk").addClass("no").removeClass("on").find("input").prop("checked", false);
457                }
458            }else {
459                _this.addClass("on").find("input").prop("checked", true);
460                _this.siblings(".setMeal-chk").removeClass("on").find("input").prop("checked", false);
461                $(".choice-setMeal .setMeal-con.setMeal-chk").removeClass("no")
462                if(!_this.siblings(".single-chk").hasClass("on")){
463                    $(".choice-setMeal .setMeal-con.single-chk").addClass("no").removeClass("on").find("input").prop("checked", false);
464                }
465            }
466        }
467    });
468
469    //套餐选择
470    $(".choice-setMeal .setMeal-con").on("click",function () {
471        var _this = $(this);
472        if(!_this.hasClass("no")){
473            if(_this.hasClass('on')){
474                _this.removeClass("on").find("input").prop("checked", false);
475                var price = _this.find("input").attr("data-val");
476                $(".price-content").text("ï¿¥" +price);
477            }else {
478            	_this.addClass("on").siblings().removeClass("on").find("input").prop("checked", false);
479                _this.find("input").prop("checked", true);
480                var price = _this.find("input").attr("data-val");
481                $(".price-content").text("ï¿¥" +price);
482            }
483        }
484    })
485}
486//选课-勾选
487var courseChoice = function () {
488
489    //全部课程全选按钮
490    $(".shoppingCart-tit li.all-chk i,.settlement-mod .all-chk i").on("click",function () {
491        var $this = $(this);
492        var _thisOn = $this.hasClass("on");
493        var allChk = $(".shoppingCart-mod .course-con .tit h3 i:not(.no-tags),.shoppingCart-mod .course-con .con .course-chk i:not(.no-tags)");
494        var $otherChk = $(".all-chkTags");
495        if(_thisOn){
496            $otherChk.removeClass("on")
497            allChk.removeClass("on").siblings("input").prop("checked", false)
498            $(".shoppingCart-mod .course-con .tit,.shoppingCart-mod .course-con .con li").removeClass("on")
499        }else {
500            $otherChk.addClass("on")
501            allChk.addClass("on").siblings("input").prop("checked", true)
502            $(".shoppingCart-mod .course-con .tit,.shoppingCart-mod .course-con .con li").addClass("on")
503        }
504        getNeedMoney();
505    })
506
507    //辅导全选按钮
508    $(".shoppingCart-mod .course-con .tit h3 i:not(.no-tags)").on("click",function () {
509        var $this = $(this);
510        var _thisOn = $this.hasClass("on");
511        var allChk = $this.parents(".shoppingCart-mod").find(".course-chk i:not
511(.no-tags)");
512        if(_thisOn){
513            $this.parents(".tit").removeClass("on").siblings(".con").find("li:not(.sold-tags)").removeClass("on");
514            $this.parents(".course-con").find(".con .course-chk i:not(.no-tags)").removeClass("on").siblings("input").prop("checked", false)
515            $this.removeClass("on")
516        }else {
517            $this.parents(".tit").addClass("on").siblings(".con").find("li:not(.sold-tags)").addClass("on");
518            $this.parents(".course-con").find(".con .course-chk i:not(.no-tags)").addClass("on").siblings("input").prop("checked", true)
519            $this.addClass("on")
520        }
521
522        //全选按钮状态
523        for(var j = 0; j < allChk.length; j++){
524            if(!allChk.eq(j).hasClass("on")){
525                $(".all-chkTags").removeClass("on")
526                getNeedMoney();
527                return false
528            }else {
529                $(".all-chkTags").addClass("on")
530            }
531        }
532        getNeedMoney();
533    })
534
535    //单选按钮
536    $(".shoppingCart-mod .course-con .con .course-chk i:not(.no-tags)").on("click",function () {
537        var $this = $(this);
538        var _thisOn = $this.hasClass("on");
539        var otherChk = $this.parents(".con").find("li");
540        var allChkLen = $(".shoppingCart-mod li");
541        var nums = 0;
542        var flag = true;
543        if(_thisOn){
544            $this.removeClass("on").siblings("input").prop("checked", false)
545            $this.parents("li").removeClass("on")
546            //单科辅导全选状态
547            if(otherChk.length == nums ){
548                $this.parents(".course-con").find(".tit i").addClass("on")
549                $this.parents(".course-con").find(".tit").addClass("on")
550            }else {
551                $this.parents(".course-con").find(".tit i").removeClass("on")
552                $(".all-chkTags").removeClass("on")
553                $this.parents(".course-con").find(".tit").removeClass("on")
554            }
555            //全选按钮状态
556            for(var j = 0; j< allChkLen.length;j++){
557                if(!allChkLen.eq(j).find("i").hasClass("on")){
558                    flag = false
559                    getNeedMoney();
560                    return false;
561                }
562            }
563            if(flag){
564                $(".all-chkTags").addClass("on")
565            }
566            getNeedMoney();
567        }else {
568        	var $input = $this.siblings("input[name=checkProduct]");
569            var productId = $input.attr("productId");
570            var secKillSubjectType = $input.attr("secKillSubjectType");
571            if(secKillSubjectType == 2){
572        		postAesData({
573        	        data:{
574        	        	"params" : {
575        			        "time":new Date().getTime(),
576        			        "productId":productId.toString(),
577        			        "isMobile": "N"
578        			    },
579        	            "domain": "chinaacc",
580        	            "resourcePath": "+/act/seckill/getSecKillProduct",
581        	            "af": "1",                //类型:String  必有字段  备注:无
582        	            "ap": "pc"                //类型:String  必有字段  备注:无
583        	        },
584        	        //ajax成功回调
585        	        success: function(data){
586        	        	var flagRes = true;
587        	        	var success = data.success;
588        	            var result = data.result;
589        	            if((success==true||success=="true") && result.productId != null){//网关调用成功
590        	            	var statue = result.killStatu;
591    		                if(statue == 0){
592    		                	toast("您勾选的商品秒杀未开始");
593    		                	setTimeout("window.location.reload()", 2000);
594    		                	flagRes = false;
595    		                }else if(statue == 2){
596    		                	toast("您勾选的商品秒杀已结束");
597    		                	setTimeout("window.location.reload()", 2000);
598    		                	flagRes = false;
599    		                }else if(statue == 3){
600    		                	toast("您勾选的商品已被秒光");
601    		                	setTimeout("window.location.reload()", 2000);
602    		                	flagRes = false;
603    		                }
604        	            }else{//网关调用失败,写提示语
605        	            	toast("出现异常,请联系客服");
606        	            	flagRes = false;
607        	            }
608        	            if(!flagRes){
609        	            	return;
610        	            }
611        	            handleSingleChkWithSelected($this, otherChk, allChkLen, nums, flag);
612        	        },
613        	        //ajax失败回调
614        	        error: function(xhr){
615        	        	toast("出现异常,请联系客服");
616        	            resolve(xhr);
617        	        }
618        	    });
619        	}else{
620        		handleSingleChkWithSelected($this, otherChk, allChkLen, nums, flag);
621        	}
622        }
623    })
624}
625
626//处理选中时---单科辅导全选以及全局全选状态
627function handleSingleChkWithSelected($this, otherChk, allChkLen, nums, flag){
628	$this.addClass("on").siblings("input").prop("checked", true)
629    $this.parents("li").addClass("on")
630    //选中+1
631    for(var i = 0; i< otherChk.length;i++){
632        if(otherChk.eq(i).find(".course-chk i").hasClass("on")){
633            nums++
634        }
635    }
636	//单科辅导全选状态
637    if(otherChk.length == nums ){
638        $this.parents(".course-con").find(".tit i").addClass("on")
639        $this.parents(".course-con").find(".tit").addClass("on")
640    }else {
641        $this.parents(".course-con").find(".tit i").removeClass("on")
642        $(".all-chkTags").removeClass("on")
643        $this.parents(".course-con").find(".tit").removeClass("on")
644    }
645    //全选按钮状态
646    for(var j = 0; j< allChkLen.length;j++){
647        if(!allChkLen.eq(j).find("i").hasClass("on")){
648            flag = false
649            getNeedMoney();
650            return false;
651        }
652    }
653    if(flag){
654        $(".all-chkTags").addClass("on")
655    }
656    getNeedMoney();
657}
658
659
660// 删除购物车
661var deleteCart = function(productId){
662	var param = "?productIds=" + productId;
663	$.ajax({
664		type : "POST",
665		url : "//sale.chinaacc.com/newweb/cart/delCart.shtm"+param,
666		dataType : "html",
667		contentType : "application/json",
668		success : function (data) {
669			var path = "//sale.chinaacc.com/newweb/cart/initCart.shtm";
670			var isClient = getUrlParam("isClient");
671			if(isClient == 1){
672				path = "//sale.chinaacc.com/newweb/cart/initCart.shtm?isClient=1";
673			}
674			window.location = path;
675		},
676	})
677}
678
679//批量删除购物车
680var deleteCartBatch = function(){
681	var productIdArray = [];
682	var $inputs = $('input[name="checkProduct"]:checked');
683	$inputs.each(function(index,element){
684		var productId = $(this).attr('productId');
685		productIdArray.push(productId);
686	});
687	if(productIdArray.length > 0){
688		var productIdsStr = productIdArray.join(",");
689		deleteCart(productIdsStr);
690	}
691}
692
693// 计算金额
694var getNeedMoney = function(){
695	var cartParam = "";
696	var isClient = getUrlParam("isClient");
697	var frontNum = 0;
698	var restNum = 0;
699	$('input[name="checkProduct"]:checked').each(function(){//遍历每一个名字为interest的复选框,其中选中的执行函数    
700		if(cartParam ==  ""){
701			cartParam = $(this).val();
702		}else{
703			cartParam = cartParam + "," +  $(this).val();
704		}
705		var itemPayType = $(this).attr("payType");
706		if(typeof (itemPayType) == "undefined"){
707			itemPayType = -1;
708		}
709		if(itemPayType == 1){
710			frontNum++;
711		}else if(itemPayType == 2){
712			restNum++;
713		}
714	});
715	if(frontNum == 0){
716		$(".settlement-mod .all-chk,.settlement-mod .but-btn").removeClass("mt15");
717		$(".depositAgreement-con").hide();
718	}
719	if(frontNum > 0){
720		$(".settlement-mod .all-chk,.settlement-mod .but-btn").addClass("mt15");
721		$(".depositAgreement-con").show();
722	}
723	if(cartParam == ""){
724		$("#discountP").hide();
725		$("#cartNum").text(0);
726		$("#needMoney").text("Â¥0");
727		$("#allneedMoney").text("Â¥0");
728		$("#discountMoney").text("Â¥0");
729		$("#couponMoney").text("Â¥0");
730		addOnItem();
731	}else{
732		var param = "?cartParam=" + cartParam + "&version=8.7.20";
733		if(isClient == 1){
734			param = "?cartParam=" + cartParam + "&isClient=1&version=8.7.20";
735		}
736		$.ajax({
737			type : "POST",
738			url : "//sale.chinaacc.com/newweb/cart/computeCart.shtm"+param,
739			dataType : "html",
740			contentType : "application/json",
741			success : function (data) {
742				var result = $.parseJSON(data);
743				if(result.discountMoney > 0){
744					$("#discountP").show();
745				}else{
746					$("#discountP").hide();
747				}
748				$("#cartNum").text(result.cartNum);
749				$("#needMoney").text("Â¥" +  result.needMoney);
750				$("#allneedMoney").text("Â¥" +  result.allneedMoney);
751				$("#discountMoney").text("Â¥" +  result.discountMoney);
752				$("#couponMoney").text("Â¥0");
753				
754				var products = result.products;
755				for(var i = 0; i < products.length; i++){
756					 var product = products[i];
757					 var htmlStr = "";
758					 if(product.discountTitle != ""){
759						 htmlStr = product.discountTitle+":¥"+product.money;
760					 }else{
761						 htmlStr = "Â¥" + product.money;
762					 }
763					 if(product.productType == 1){
764						 if(product.money < product.price){
765							 var delPrice = product.price;
766							 htmlStr = htmlStr + '<del id="pricedel_'+product.productId+'">Â¥'+delPrice+'</del>';
767						 }
768					 }else{
769						 if(product.money < product.initPrice){
770							 var delPrice = product.initPrice;
771							 htmlStr = htmlStr + '<del id="pricedel_'+product.productId+'">Â¥'+delPrice+'</del>';
772						 }
773						 $("#exceptDiscount_"+product.productId).val(product.exceptDiscountStr);
774					 }
775					 $('#priceShow_'+product.productId).html(htmlStr);
776					 
777					 $('#ruleName_'+product.productId).html("");
778					 for(var j = 0; j < product.ruleNames.length; j++){
779						 var ruleName = product.ruleNames[j];
780						 var htmlStr2 = '<span>· '+ruleName+'</span>';
781						 $('#ruleName_'+product.productId).append(htmlStr2);
782					 }
783		        	if(product.ruleNames.length>0){
784		        		$('#ruleName_'+product.productId).parents(".saleNew_box").show();
785		        	}else{
786		        		$('#ruleName_'+product.productId).parents(".saleNew_box").hide();
787		        	}
788					 
789				 }
790				var thatinput = $('input[name="checkProduct"]');
791			    thatinput.each(function(){
792					var thisinput  = $(this);
793					var productId = thisinput.attr('productid');
794					if(thisinput.is(':checked')){
795			        }else {
796			        	var productType = $("#productType_"+productId).val();
797			        	var htmlStr = $("#promotionMoney_"+productId).val();
798			        	var delStr = $("#pricedel_"+productId).html();
799			        	if(null != delStr && productType == 1){
800			        		if(htmlStr < $("#productType_"+productId).attr('price')){
801			        			htmlStr = htmlStr + '<del id="pricedel_'+productId+'">'+delStr+'</del>';
802			        		}
803			        	}else if(null != delStr && productType != 1){
804			        		if(htmlStr < $("#productType_"+productId).attr('initPrice')){
805			        			htmlStr = htmlStr + '<del id="pricedel_'+productId+'">'+delStr+'</del>';
806			        		}
807			        	}
808			        	$('#priceShow_'+productId).html("Â¥" + htmlStr);
809			        	var htmlStr2 = $("#ruleName2_"+productId).html();
810			        	$('#ruleName_'+productId).html(htmlStr2);
811			        	if(typeof(htmlStr2)== "undefined"){
812			        		$('#ruleName_'+productId).parents(".saleNew_box").hide();
813			        	}
814			        }
815					
816			    });
817			    
818			    addOnItem();
819			    
820			    $("#discountMoney").text("Â¥" +  result.promotionMoney);
821                $("#couponMoney").text("Â¥" +  result.couponMoney);
822			    if(result.canReceiveCouponIds.length > 0){
823			    	var canReceiveCouponIdstr = "";
824			    	for(var i = 0; i < result.canReceiveCouponIds.length; i++){
825			    		canReceiveCouponIdstr = canReceiveCouponIdstr +","+result.canReceiveCouponIds[i];
826					}
827			    	$("#canReceiveCouponIds").val(canReceiveCouponIdstr);
828			    	$("#discountP").show();
829                    $("#needMoney").text("Â¥" +  result.needMoney);
830                    $("#allneedMoney").text("Â¥" +  result.allneedMoney);
831                    $(".but-btn").html("领券结算");
832			    }else{
833			    	$(".but-btn").html("去结算");
834			    	$("#canReceiveCouponIds").val("");
835			    }
836			},
837		})
838	}
839}
840
841//购物车重新计算优惠券金额
842function getCouponMoney(cartParam, isClient){
843    var param = "?cartParam=" + cartParam;
844    if(isClient == 1){
845        param = "?cartParam=" + cartParam + "&isClient=1";
846    }
847    $.ajax({
848        type : "POST",
849        url : "//sale.chinaacc.com/newweb/cart/getCouponMoneyInCart.shtm"+param,
850        dataType : "html",
851        contentType : "application/json",
852        success : function (data) {
853            if(data != null && data != 'null'){
854                var result = $.parseJSON(data);
855                if(result.couponMoney > 0){
856                    $("#discountP").show();
857                    $("#needMoney").text("Â¥" +  result.needMoney);
858                    $("#allneedMoney").text("Â¥" +  result.allneedMoney);
859                    $("#discountMoney").text("Â¥" +  result.discountMoney);
860                    $("#couponMoney").text("Â¥" +  result.couponMoney);
861                }
862            }
863        },
864    })
865}
866
867// 减实物商品数量
868var minus = function(productId){
869	var num = parseInt($("#productNum_"+productId).val());
870	if(num > 1){
871		num = num - 1;
872	}
873	$("#productNum_"+productId).val(num);
874	var cartParam = productId + ":" + num;
875	$("#product_"+productId).val(cartParam);
876	var param = "?cartParam=" + cartParam;
877	$.ajax({
878		type : "POST",
879		url : "//sale.chinaacc.com/newweb/cart/updateCart.shtm"+param,
880		dataType : "html",
881		contentType : "application/json",
882		success : function (data) {
883			
884		},
885	})
886	if($("#product_"+productId).is(":checked")){
887		getNeedMoney();
888	}
889}
890
891//加实物商品数量
892var add = function(productId){
893	var num = parseInt($("#productNum_"+productId).val());
894	if(num < 100){
895		num = num + 1;
896	}
897	$("#productNum_"+productId).val(num);
898	var cartParam = productId + ":" + num;
899	$("#product_"+productId).val(cartParam);
900	var param = "?cartParam=" + cartParam;
901	$.ajax({
902		type : "POST",
903		url : "//sale.chinaacc.com/newweb/cart/updateCart.shtm"+param,
904		dataType : "html",
905		contentType : "application/json",
906		success : function (data) {
907			
908		},
909	})
910	if($("#product_"+productId).is(":checked")){
911		getNeedMoney();
912	}
913}
914
915//修改实物商品数量
916var changeNum = function(productId){
917	var num = parseInt($("#productNum_"+productId).val());
918	if(num < 1){
919		alert("商品数量最小为1")
920		num = 1;
921	}
922	if(num > 99){
923		alert("商品数量最大为99")
924		num = 99; 
925	}
926	$("#productNum_"+productId).val(num);
927	var cartParam = productId + ":" + num;
928	$("#product_"+productId).val(cartParam);
929	var param = "?cartParam=" + cartParam;
930	$.ajax({
931		type : "POST",
932		url : "//sale.chinaacc.com/newweb/cart/updateCart.shtm"+param,
933		dataType : "html",
934		contentType : "application/json",
935		success : function (data) {
936			
937		},
938	})
939	if($("#product_"+productId).is(":checked")){
940		getNeedMoney();
941	}
942}
943
944
945var lianbaoCourseSubmit = function () {
946	var productInfo = $("#cartPorductInfo").val();
947	var data = {};
948	data.cartParam = productInfo;
949	$.ajax({
950		type : "POST",
951		url : "//sale.chinaacc.com/newweb/cart/lianbaoCourseSubmit.shtm",
952		data : JSON.stringify(data),
953		dataType : "json",
954		contentType:'application/json;charset=utf-8',
955		success : function (data) {
956			window.location.reload();
957		}
958	})
959}
960
961var openAgreement = function (url) {
962	window.open(url, "_blank");
963}
964
965//加实物商品数量
966var addCart = function(productId){
967	var param = "?productId=" + productId;
968	$.ajax({
969		type : "POST",
970		url : "//sale.chinaacc.com/newweb/cart/addCart.shtm"+param,
971		dataType : "html",
972		contentType : "application/json",
973		success : function (data) {
974			var path = "//sale.chinaacc.com/newweb/cart/initCart.shtm";
975			var isClient = getUrlParam("isClient");
976			if(isClient == 1){
977				path = "//sale.chinaacc.com/newweb/cart/initCart.shtm?isClient=1";
978			}
979			window.location = path;
980		},
981	})
982}
983
984var toast = function(text, width){
985    if (width) {
986        $(".toast").css("width", width)
987    }
988    $(".toast").fadeIn().find("p").html(text);
989    setTimeout(function () {
990        $(".toast").fadeOut().find("p").html("");
991    }, 2000)
992}
993
994$('.couponCenterTagBth').click(function () {
995	var that = $(this);
996    var thatinput = that.parents('.course-con').find('[name=checkProduct]');
997    var productidList = [];
998    thatinput.each(function(){
999          var thisinput  = $(this);
1000          productidList.push(thisinput.attr('productid'));
1001    })
1002    CDELTracker.$track(this, {
1003        click: 'click_couponbag_click_scart'
1004    })
1005   couponCenter({
1006       uid: CDEL.getCookie("cdeluid"),    //uid
1007       source: 12,
1008       cls: 'index',  //领券弹窗自定义class 
1009       //productIds:'52021,52022,48246',  // 商品ID 获取该商品ID下的优惠券
1010       productIds:productidList.join(','),
1011       attributeShow: '',    //飘窗曝光埋点
1012       attributeClick: '',  //飘窗点击埋点
1013       attributeClose: '' //飘窗点击关闭埋点
1014   }, function () {
1015       // 回调
1016   })
1017   
1018})
1019
1020//查询凑单促销信息
1021var addOnItem = function(){
1022	var isClient = getUrlParam("isClient");
1023	var thatinput = $('input[name="checkProduct"]');
1024	var products = new Array();
1025    thatinput.each(function(){
1026		var product = {};
1027		var thisinput  = $(this);
1028		var productId = thisinput.attr('productid');
1029		var productNum = $("#product_"+productId).attr('productNum');
1030		var productType = $("#productType_"+productId).val();
1031		var exceptDiscountStr = $("#exceptDiscount_"+productId).val();
1032		if(thisinput.is(':checked')){
1033			product.selected=true;
1034        }else {
1035        	product.selected=false;
1036        }
1037		product.productId=productId;
1038		product.productNum=productNum;
1039		product.productType=productType;
1040		product.exceptDiscountStr=exceptDiscountStr;
1041		products.push(product);
1042    });
1043	
1044	try {
1045		var time = new Date().getTime();
1046		var setting = {
1047			"uid":CDEL.getCookie("cdeluid"),
1048			"bdp_uuid":CDEL.getCookie("bdp_uuid"),
1049			"platform":1,
1050			"products":products,
1051			"isClient":isClient,
1052			"iosPlatform":0,
1053			"isIOSApp":0,
1054			"ltime":time,
1055			"time":time
1056		}
1057		postAesData({
1058			data:{
1059				"params":setting,
1060				"domain": "chinaacc",
1061				"resourcePath": "+/c-sel/w-sale/cart/addonCart",
1062				"af": "1",
1063				"sid": CDEL.getCookie("sid"),
1064				"fs": "201",
1065				"platform": "0",
1066				"lt": time+"",
1067				"ap": "b3316459-ceeb-47f8-a469-12751ff3075e"
1068
1069			},
1070			//ajax成功回调
1071			success: function(data){
1072				var success = data.success;
1073				if((success == true || success == "true")){//网关调用成功
1074					 var products = data.result.products;
1075            		 $(".addOnItem").html("");
1076					 for(var i = 0; i < products.length; i++){
1077						 var product = products[i];
1078						 var htmlStr = '';
1079						 for(var j = 0; j < product.addonShows.length; j++){
1080							 var addonDiscountShow = product.addonShows[j];
1081							 htmlStr = htmlStr + '<div class="discount2024-con clearfix">'+
1082							 '<span class="tags">'+addonDiscountShow.awardKeyWordStr+'</span><p>'+addonDiscountShow.showDescribe+'</p>'+
1083							 '<a href="'+addonDiscountShow.url+'" class="btn">去凑单 ></a></div>';
1084						 }
1085						 $('#addOnItem_'+product.productId).append(htmlStr);
1086					 }
1087				}else{//网关调用失败,写提示语
1088//					tips("出现异常,请联系客服");
1089				}
1090			},
1091			//ajax失败回调
1092			error: function(xhr){
1093				alert("出现异常,请联系客服");
1094			}
1095		});
1096	} catch (e) {
1097		alert("出现异常,请联系客服");
1098	}
1099}
1100
1101var getRecommended = function(){
1102	var thatinput = $('input[name="checkProduct"]');
1103	var productIds = "";
1104	thatinput.each(function(){
1105		var thisinput  = $(this);
1106		var productId = thisinput.attr('productid');
1107		productIds = productIds + "," + productId;
1108	});
1109	
1110	try {
1111		var time = new Date().getTime();
1112		var setting={
1113		        "uid":CDEL.getCookie("cdeluid"),
1114		        "bdpUuid":CDEL.getCookie("bdp_uuid"),
1115		        "platform":105,
1116		        "recNum":4,
1117		        "source":"Cart",
1118		        "productIds":productIds
1119		    }
1120		postAesData({
1121			data:{
1122				"params":setting,
1123				"domain": "chinaacc",
1124				"resourcePath": "+/c-sel/w-order/saleapi/payment/getRecommendedList",
1125				"af": "1",
1126				"sid": CDEL.getCookie("sid"),
1127				"fs": "201",
1128				"platform": "0",
1129				"lt": time+"",
1130				"ap": "b3316459-ceeb-47f8-a469-12751ff3075e"
1131					
1132			},
1133			//ajax成功回调
1134			success: function(data){
1135				var success = data.success;
1136				if((success == true || success == "true")){//网关调用成功
1137					var json = data.result;
1138					var recommendedCoursesList = json.recommendedCoursesList;
1139					if (null != recommendedCoursesList){
1140	                    var recommendedHtml = "";
1141	                    for (i = 0; i < recommendedCoursesList.length; i++) {
1142	                        recommendedHtml += '<div class="box">'+
1143	                            '<a href="'+recommendedCoursesList[i].urlPc+'" class="btn" target="_blank">'+recommendedCoursesList[i].productName+'</a>'+
1144	                            '<div class="pic"><img src="'+recommendedCoursesList[i].productPic+'"></div>'+
1145	                            '<h4>'+recommendedCoursesList[i].productName+'</h4>'+
1146	                            '<p>ï¿¥'+recommendedCoursesList[i].price+'</p>'+
1147	                            '</div>';
1148	                    }
1149	                    $(".recommended").html(recommendedHtml);
1150	                    $(".recommendCourse-mod").show();
1151	                }
1152				}else{//网关调用失败,写提示语
1153//					tips("出现异常,请联系客服");
1154				}
1155			},
1156			//ajax失败回调
1157			error: function(xhr){
1158				alert("出现异常,请联系客服");
1159			}
1160		});
1161	} catch (e) {
1162		alert("出现异常,请联系客服");
1163	}
1164}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.