PageSourceSearch

https://www.chinaacc.com/js/template/2020precisionMarketing-v3.js?v=1.0

js chinaacc.com collected 2026-10-02 07:35:44 UTC 44,695 bytes, 874 lines download raw bytes

1var marketingInitConfig = {
2    serverTime:new Date().getTime(), //服务器时间
3    timeDiffer:0,  //本地时间服务器时间差
4    sid: CDEL.getCookie("sid"),
5    uid:CDEL.getCookie("cdeluid") || "",
6    memberId:CDEL.getCookie("username"),
7    bdpUid:CDEL.getCookie('bdp_uuid') || "",
8    sendCoupon:false,
9    sendCouponPop:false,
10    precisionMarketingSubjectTypeId:"",
11    marketingInitConfigUsedUID:"",
12    activityFlag:"",
13    couponName:"",
14    isNews:false,
15    isXuanke:false,
16    isDetails:false,
17    isProject:false,
18    isProduct:false,
19    isTracker:false,
20    isShoppingCart:false,
21    getLotteryGuidePop:false
22};
23
24$(function () {
25    if(CDEL.getCookie("precisionMarketingUsedUID")){
26        marketingInitConfig.marketingInitConfigUsedUID = CDEL.getCookie("precisionMarketingUsedUID").replace(/\"/g, "")
27    }else {
28        marketingInitConfig.marketingInitConfigUsedUID = ""
29    }
30
31    if(CDEL.isApp){
32        $(".precisionMarketing-CommonPop .link-btn.isApp").css("display","block").siblings(".link-btn").hide();
33    }
34
35    if($('.column-loginRegister').length < 1){
36        //顶部登录未更新执行
37        setTimeout(function () {
38            CDEL.loginStatus(function(json) {
39                isLoginStatus(json)
40            })
41        },300)
42    }
43    //抽奖后展示弹出框
44    $(".show-precisionMarketingPop").click(function () {
45        precisionMarketingPop("precisionMarketing-pop")
46    })
47
48    $(".precisionMarketing-CommonPop .use-btn:not(.precisionMarketing-animated)").click(function () {
49        if($(this).parents(".precisionMarketing-CommonPop").hasClass("guide-tags")){
50            CDELTracker.$track($('body')[0], {
51                category: '引导弹窗-点击去选课',
52                context: '引导弹窗-点击去选课'
53            });
54        }
55    })
56
57    $(".precisionMarketing-CommonPop .use-btn:not(.precisionMarketing-animated)").click(function () {
58        if($(this).parents(".precisionMarketing-CommonPop").hasClass("drawEnd-tags")){
59            CDELTracker.$track($('body')[0], {
60                category: '抽奖后弹窗-点击去选课',
61                context: '抽奖后弹窗-点击去选课'
62            });
63        }
64    })
65
66    $(".precisionMarketing-CommonPop .use-btn.precisionMarketing-animated").click(function () {
67        CDELTracker.$track($('body')[0], {
68            category: '抽奖前弹窗-试试手气',
69            context: '抽奖前弹窗-试试手气'
70        });
71    })
72
73    $(".precisionMarketing-CommonPop .couponList .link-btn").click(function () {
74        if($(this).parents(".precisionMarketing-CommonPop").hasClass("guide-tags")){
75            CDELTracker.$track($('body')[0], {
76                category: '引导弹窗-点击优惠券',
77                context: marketingInitConfig.couponName
78            });
79        }
80    })
81
82    $(".precisionMarketing-CommonPop .couponList .link-btn").click(function () {
83        if($(this).parents(".precisionMarketing-CommonPop").hasClass("drawEnd-tags")){
84            CDELTracker.$track($('body')[0], {
85                category: '抽奖后弹窗-点击优惠券',
86                context: marketingInitConfig.couponName
87            });
88        }
89    })
90
91})
92
93//是否登录执行方法
94var isLoginStatus = function (json) {
95    if(json.loginFlag){
96        marketingInitConfig.uid = json.uid;
97        marketingInitConfig.userName = json.username;
98        $(".precisionMarketing-yesLogin").show();
99        $(".precisionMarketing-noLogin").hide();
100        //未登录时,在登录后调用领取弹出框
101        if(CDEL.getCookie("precisionMarketingUsedPop")){
102            marketingPopNew('draw-tags');
103            $(".precisionMarketing-maxDiscount").html(CDEL.getCookie("precisionMarketingMaxDiscount").replace(/"/ig, ''));
104            $(".precisionMarketing-lotteryUserCount").html(CDEL.getCookie("precisionMarketingLotteryUserCount").replace(/"/ig, ''));
105        }
106    }else{
107        $(".precisionMarketing-yesLogin").hide();
108        $(".precisionMarketing-noLogin").show();
109    }
110
111    //预测概率
112    if($("#subjectTypeId").length > 0){ //pc资讯页
113        marketingInitConfig.isNews = true;
114        marketingInitConfig.precisionMarketingSubjectTypeId = $("#subjectTypeId").val();
115        // promptProbability(marketingInitConfig.precisionMarketingSubjectTypeId,"1")
116        if(marketingInitConfig.uid && marketingInitConfig.sid){
117            marketingInitConfig.activityFlag = "V3";
118            promptProbability(marketingInitConfig.precisionMarketingSubjectTypeId,"5")
119        }else {
120            marketingInitConfig.activityFlag = "V3";
121            promptProbability(0,"5")
122        }
123
124    }
125    if($("#fdid").length > 0){ //m端资讯页
126        marketingInitConfig.isNews = true;
127        marketingInitConfig.precisionMarketingSubjectTypeId = $("#fdid").val();
128        // promptProbability(marketingInitConfig.precisionMarketingSubjectTypeId,"1")
129        if(marketingInitConfig.uid && marketingInitConfig.sid){
130            marketingInitConfig.activityFlag = "V3";
131            promptProbability(marketingInitConfig.precisionMarketingSubjectTypeId,"103")
132        }else {
133            marketingInitConfig.activityFlag = "V3";
134            promptProbability(0,"103")
135        }
136    }
137    if($("#courseEduId_value").length > 0 || $("#courseEduId").length > 0){//Pc M 选课列表页
138        marketingInitConfig.isXuanke = true;
139        marketingInitConfig.precisionMarketingSubjectTypeId = $("#courseEduId_value").val() || $("#courseEduId").val();
140        var sourceVal = '3';
141        if($("#courseEduId").length > 0){
142            sourceVal = '106'
143        }
144        promptProbability(marketingInitConfig.precisionMarketingSubjectTypeId,sourceVal)
145    }
146    if($("#buyType").length > 0 && $("#siteUrl").length > 0 && $(".wrap-details").length > 0){ //m端商品详情页
147        marketingInitConfig.isDetails = true;
148        if(CDEL.isApp){
149            promptProbability("0","201")
150        }else{
151            promptProbability("0","101")
152        }
153    }
154    if($("#productProject").length > 0){ //pc方案
155        marketingInitConfig.isProject = true;
156        marketingInitConfig.precisionMarketingSubjectTypeId = $("#productProject").val();
157        promptProbability(marketingInitConfig.precisionMarketingSubjectTypeId,"2")
158    }
159    if(getUrlParam("product")){ //落地页
160        marketingInitConfig.isProduct = true;
161        var p1 = getUrlParam("p1");
162        if(getUrlParam("p1")){
163            marketingInitConfig.uid = p1;
164        }
165        promptProbability(marketingInitConfig.precisionMarketingSubjectTypeId,"202")
166    }
167    if(window.location.pathname == "/" || window.location.pathname == "/index.shtml" || window.location.pathname == "/index2019.shtml" || window.location.pathname == "/index2020.shtml" || window.location.pathname == "/cssy/"){//首页
168        marketingInitConfig.precisionMarketingSubjectTypeId = "0";
169        marketingInitConfig.activityFlag = "V3";
170        if(CDEL.getCookie("lingjuanzhongxin")){
171            return false;
172        }
173        if(CDEL.isMobile){
174            promptProbability(marketingInitConfig.precisionMarketingSubjectTypeId,"102");
175        }else {
176            promptProbability(marketingInitConfig.precisionMarketingSubjectTypeId,"4");
177        }
178    }
179    //Pc M端购物车
180    if($('#precisionMarketing-shoppingCart-pc').length > 0 || $('#precisionMarketing-shoppingCart-m').length > 0){
181        marketingInitConfig.isShoppingCart = true;
182        if($('#precisionMarketing-shoppingCart-pc').length > 0){
183            promptProbability("0","8")
184        }else{
185            promptProbability("0","105")
186        }
187    }
188}
189
190//判断登陆
191var columnHeadLoginStatus = function (json) {
192    isLoginStatus(json)
193}
194
195//获取url参数
196function getUrlParam(name) {
197    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
198    var r = window.location.search.substr(1).match(reg);  //匹配目标参数
199    if (r != null) return unescape(r[2]); return null; //返回参数值
200}
201
202var precisionMarketingCommonInfo = function (couponTime){
203    var couponTimeVal = couponTime || new Date().getTime() + 172800000;
204    $(".precisionMarketingV3-mod").show().find('.drawResult-con').show().siblings(".drawBefore-con").hide();
205    $("#precisionMarketingCountDown").attr("data-countDown",couponTimeVal);
206    precisionMarketingCountDown("precisionMarketingCountDown")
207    if(marketingInitConfig.isXuanke || marketingInitConfig.isProject || marketingInitConfig.isDetails || marketingInitConfig.isShoppingCart){
208        $("#precisionMarketingCountDown02").attr("data-countDown",couponTimeVal);
209        precisionMarketingCountDown("precisionMarketingCountDown02")
210        if(!couponTime){
211            precisionMarketingPop("precisionMarketing-pop")
212        }
213    }
214}
215//发优惠卷
216var sendCoupon = function (source) {
217    if(source == "201" || source == "101"){
218        if(CDEL.isApp){
219            source = "201"
220        }else {
221            source = "101"
222        }
223    }
224
225    if(marketingInitConfig.sid && marketingInitConfig.uid){
226        if(marketingInitConfig.sendCoupon){
227            return false;
228        }
229        if(marketingInitConfig.memberId){
230            usedUID = marketingInitConfig.memberId
231        }else {
232            usedUID = ""
233        }
234        marketingInitConfig.sendCoupon = true;
235        $("body").append("<div class='openingCeremony'></div>");
236        postAesData({
237            data : {
238                "params" : {
239                    "time":new Date().getTime(),
240                    "uuid":marketingInitConfig.bdpUid,
241                    "eduID":marketingInitConfig.precisionMarketingSubjectTypeId, //辅导id
242                    "source":source, //1:pc咨询 2:pc方案 3:pc选课中心 101:m站购课详情  201:移动端购课详情  202:移动端红包落地页
243                    "uid":marketingInitConfig.uid,
244                    "usedUID":marketingInitConfig.marketingInitConfigUsedUI
244D
245                },
246                "domain" : "chinaacc",
247                "resourcePath" : "+/precision/getLotteryResults",
248                "af":"1",                //类型:String  必有字段  备注:无
249                "ap":"pc"                //类型:String  必有字段  备注:无
250            },
251            // ajax成功回调
252            success : function (data) {
253                if(data.success==true){//网关调用成功
254                    $(".openingCeremony").remove();
255                    $(".precisionMarketingV3-mod .drawBefore-con").hide();
256                    var result = data.result,
257                        HtmlStr = "",
258                        couponDiscount = result.couponType.toString(),
259                        courseResult = result.viewClassInfoList;
260
261                    marketingInitConfig.sendCoupon = false;
262
263                    //折扣
264                    $(".precisionMarketing-discount").html(couponDiscount.split('').join('.'));
265
266                    //抽奖人数
267                    if(result.lotteryUserCount == null){
268                        result.lotteryUserCount = 0
269                    }
270                    $(".precisionMarketing-lotteryUserCount").html(parseInt(result.lotteryUserCount)+1500);
271
272                    //优惠卷说明
273                    $(".precisionMarketing-couponExplain,.news-precisionMarketing-mod .coupon-con .tips").html(result.useDesc)
274
275                    //推荐课程
276                    if(courseResult != null > 0 && marketingInitConfig.isNews){
277                        for(var i=0; i<courseResult.length; i++) {
278                            // var myPrize = 0;
279                            // myPrize = courseResult[i].price - parseInt(courseResult[i].price*przieDiscount);
280                            // discountPrizeList.push(myPrize)
281                            if(courseResult[i].minDiscount == courseResult[i].maxDiscount){
282                                var prize = courseResult[i].minDiscount;
283                            }else {
284                                var prize = courseResult[i].minDiscount+"-"+courseResult[i].maxDiscount;
285                            }
286
287                            if(courseResult[i].productName.indexOf("高效实验") > 0){
288                                var tips = "<div class='tips'><p>省力拿高分</p><p>名师点拨</p></div>";
289                            }else if(courseResult[i].productName.indexOf("点题密训") > 0){
290                                var tips = "<div class='tips'><p>考前突击</p><p>刷题集训</p></div>";
291                            }else if(courseResult[i].productName.indexOf("超值精品") > 0){
292                                var tips = "<div class='tips'><p>高性价比</p><p>课程精讲</p></div>";
293                            }else {
294                                var tips = "<div class='tips'></div>";
295                            }
296                            HtmlStr += '<li><div class="introduce-text clearfix"><div class="name"><h3>'+courseResult[i].courseEduName+'<br>'+courseResult[i].className+'</h3><p>¥'+courseResult[i].price+'/科起</p></div>'+tips+'</div><div class="price-wrap">用券可优惠'+prize+'元</div><a href="'+courseResult[i].pcDetailUrl+'" class="buy-btn" target="_blank" data-uid="'+marketingInitConfig.uid+'"  title="'+courseResult[i].productName+'">去买课</a></li>';
297                        }
298                        //输出html
299                        $(".drawPrecisionMarketing-courseList").html(HtmlStr);
300                    }
301
302                    //推荐课程-落地页
303                    if(courseResult != null && marketingInitConfig.isProduct){
304                        for(var i=0; i<courseResult.length; i++) {
305                            if(courseResult[i].minDiscount == courseResult[i].maxDiscount){
306                                var prize = courseResult[i].minDiscount;
307                            }else {
308                                var prize = courseResult[i].minDiscount+"-"+courseResult[i].maxDiscount;
309                            }
310
311                            if(courseResult[i].productName.indexOf("高效实验") > 0){
312                                var tips = "<div class='tips'><p>省力拿高分</p><p>名师点拨</p></div>";
313                            }else if(courseResult[i].productName.indexOf("点题密训") > 0){
314                                var tips = "<div class='tips'><p>考前突击</p><p>刷题集训</p></div>";
315                            }else if(courseResult[i].productName.indexOf("超值精品") > 0){
316                                var tips = "<div class='tips'><p>高性价比</p><p>课程精讲</p></div>";
317                            }else {
318                                var tips = "<div class='tips'></div>";
319                            }
320                            HtmlStr += '<li><div class="introduce-text clearfix"><div class="name"><h3>
320'+courseResult[i].courseEduName+'</h3><h4>'+courseResult[i].className+'</h4><p>¥'+courseResult[i].price+'/科起</p></div>'+tips+'</div><div class="price-wrap">用券可优惠'+prize+'元</div><a href="'+courseResult[i].mdetailUrl+'" class="buy-btn" target="_blank" alt="'+marketingInitConfig.uid+'" title="'+courseResult[i].productName+'">去买课</a></li>';
321                        }
322                        $(".precisionMarketing-courseList").html(HtmlStr);
323                    }
324
325                    //取优惠价格最大和最小
326                    // discountPrizeList.sort(function (a, b) {
327                    //     return a-b;
328                    // });
329                    // $(".precisionMarketing-minPrzie").html(discountPrizeList[0])
330                    // $(".precisionMarketing-maxPrzie").html(discountPrizeList[discountPrizeList.length - 1])
331                    $(".precisionMarketing-minPrzie").html(result.minDiscount);
332                    $(".precisionMarketing-maxPrzie").html(result.maxDiscount);
333
334                    //显示抽奖后展示的内容
335                    precisionMarketingCommonInfo()
336
337                }else{//网关调用失败,写提示语
338                    // CDEL.alertTip("出错啦,请刷新页面再试一次吧~");
339                    marketingInitConfig.sendCoupon = false;
340                }
341            },
342            // ajax失败回调
343            error : function (xhr) {
344                // CDEL.alertTip("出错啦,请刷新页面再试一次吧~");
345                marketingInitConfig.sendCoupon = false;
346            }
347        });
348    }else {
349        CDEL.ucLogin();
350    }
351
352}
353
354//发优惠卷-弹出框
355var sendCouponPop = function(source){
356    if(marketingInitConfig.sid && marketingInitConfig.uid){
357        CDEL.removeCookie("precisionMarketingUsedPop");
358        CDEL.removeCookie("precisionMarketingMaxDiscount");
359        CDEL.removeCookie("precisionMarketingLotteryUserCount");
360        if(marketingInitConfig.sendCouponPop){
361            return false;
362        }
363        if(marketingInitConfig.memberId){
364            usedUID = marketingInitConfig.memberId
365        }else {
366            usedUID = ""
367        }
368        marketingInitConfig.sendCouponPop = true;
369        //source参数
370        // 1:PC端资讯页
371        // 2:PC端招生方案页
372        // 3:PC端选课中心页
373        // 4:PC端首页弹窗
374        // 5:PC端资讯页弹窗
375        // 6:PC端付费用户升班
376        // 8:PC端购物车试试手气
377        // 101:M站购课详情页
378        // 102:M站首页弹窗
379        // 103:M站资讯页弹窗
380        // 104:M站付费用户升班
381        // 105:M站购物车试试手气
382        // 106:M站选课列表页试试手气
383        // 201:移动端购课详情页
384        // 202:移动端红包落地页
385        // 203:移动端选课Tab页弹窗
386        // 204:移动端首页信息流
387        // 205:移动端付费用户升班
388        // 301:会搜页面
389        postAesData({
390            data : {
391                "params" : {
392                    "time":new Date().getTime(),
393                    "uuid":marketingInitConfig.bdpUid,
394                    "eduID":marketingInitConfig.precisionMarketingSubjectTypeId, //辅导id
395                    "source":source,
396                    "uid":marketingInitConfig.uid,
397                    "banci":marketingInitConfig.precisionMarketingSubjectTypeId,
398                    "usedUID":marketingInitConfig.marketingInitConfigUsedUID
399                },
400                "domain" : "chinaacc",
401                "resourcePath" : "+/precision/getLotteryResultsV3Api",
402                "af":"1",                //类型:String  必有字段  备注:无
403                "ap":"pc"                //类型:String  必有字段  备注:无
404            },
405            // ajax成功回调
406            success : function (data) {
407                if(data.success==true || data.success=="true"){//网关调用成功
408                    var result = data.result,
409                        HtmlStr = "",
410                        courseResult = result.couponList;
411                    marketingInitConfig.sendCouponPop = false;
412                    //推荐课程
413                    if(result.type == 2){
414                        CDEL.alertTip("您已经领取过优惠卷了");
415                        closeMarketingPopNew('draw-tags',"noCDELTracker");
416                    }else if(result.type == 0){
417                        CDEL.alertTip("抱歉  服务异常,领取失败");
418                        closeMarketingPopNew('draw-tags',"noCDELTracker");
419                    }else if(courseResult != null && result.type == 1){
420                        for(var i=0; i<courseResult.length; i++) {
421                            // HtmlStr += '<li><div class="introduce-text clearfix"><div class="name"><h3>'+courseResult[i].courseEduName+'<br>'+courseResult[i].className+'</h3><p>¥'+courseResult[i].price+'/科起</p></div>'+tips+'</div><div class="price-wrap">用券可优惠'+prize+'元</div><a href="'+courseResult[i].pcDetailUrl+'" class="buy-btn" target="_blank" data-uid="'+marketingInitConfig.uid+'"  title="'+courseResult[i].productName+'">去买课</a></li>';
422                            HtmlStr += '<li><div class="coupon-prize"><h4><strong>'+courseResult[i].discountName+'</strong></h4></div><div class="explain-text" title="'+courseResult[i].useDesc+'">使用范围:'+courseResult[i].useDesc+'<a href="//member.chinaacc.com/homes/account/coupons" target="_blank">优惠券说明</a></div><div class="precisionMarketingCountDownNew" data-countdown="'+courseResult[i].couponTime+'"><span class="tit"></span>  <span class="time"></span></div></li>';
423                            marketingInitConfig.couponName += courseResult[i].discountName+','
424                        }
425                        //输出html
426                        $(".precisionMarketingPop-list").html(HtmlStr);
427                        if($(".precisionMarketing-CommonPop .couponList li").length<2){
428                            $(".precisionMarketing-CommonPop .couponList").css("height",$(".precisionMarketing-CommonPop .couponList li").outerHeight(true)*$(".precisionMarketing-CommonPop .couponList li").length)
429                        }
430                        if(result.couponType == "85"){
431                            $(".precisionMarketing-CommonPop.przieList-tags .top-tit").html("恭喜您获得特等奖!");
432                        }else {
433                            $(".precisionMarketing-CommonPop.przieList-tags .top-tit").html("恭喜您获得一等奖!");
434                        }
435
436                        if(result.couponType == "90"){
437                            CDELTracker.$track($('body')[0], {
438                                click: "expo_precision_marketing_couponbag_entr_home"
439                            })
440                        }
441
442                        //倒计时
443                        precisionMarketingCountDownNew("precisionMarketingCountDownNew")
444
445                        //弹出框
446                        $(".precisionMarketing-CommonPop.przieList-tags").addClass("drawEnd-tags");
447                        closeMarketingPopNew('draw-tags',"noCDELTracker");
448                        marketingPopNew('przieList-tags');
449                        $(".news-precisionMarketing-mod").hide();
450                    }
451                }else{//网关调用失败,写提示语
452                    // CDEL.alertTip("出错啦,请刷新页面再试一次吧~");
453                    marketingInitConfig.sendCouponPop = false;
454                }
455            },
456            // ajax失败回调
457            error : function (xhr) {
458                // CDEL.alertTip("出错啦,请刷新页面再试一次吧~");
459                marketingInitConfig.sendCouponPop = false;
460            }
461        });
462    }else {
463        CDEL.ucLogin();
464    }
465
466}
467
468//预测概率
469var promptProbability = function(eduID,source,otherTags){
470    postAesData({
471        data : {
472            "params" : {
473                "time":new Date().getTime(),
474                "uuid":marketingInitConfig.bdpUid,
475                "eduID":eduID, //辅导id
476                "source":source, //1:pc咨询 2:pc方案 3:pc选课中心 101:m站购课详情  201:移动端购课详情  202:移动端红包落地页
477                "activityFlag":marketingInitConfig.activityFlag,
478                "uid":marketingInitConfig.uid,
479                "usedUID":marketingInitConfig.marketingInitConfigUsedUI
479D //
480            },
481            "domain" : "chinaacc",
482            "resourcePath" : "+/precision/promptProbability",
483            "af":"1",                //类型:String  必有字段  备注:无
484            "ap":"pc"                //类型:String  必有字段  备注:无
485        },
486        // ajax成功回调
487        success : function (data) {
488            if(data.success==true){//网关调用成功
489                var result = data.result,
490                    HtmlStr = "",
491                    usedUID = result.usedUID,
492                    courseResult = result.viewClassInfoList,
493                    voucherStatus = result.voucherStatus || '',
494                    couponType = result.couponType%10 ? result.couponType : result.couponType/10;
495                if(result.type == 0){
496                    if(marketingInitConfig.isProduct){
497                        $(".introduce-con strong").hide();
498                        $(".topHeader .none").show();
499                        $(".course-list").addClass("none")
500                    }
501                    if(!marketingInitConfig.getLotteryGuidePop && marketingInitConfig.sid && marketingInitConfig.uid){
502                        if($("#subjectTypeId").length > 0 || window.location.pathname == "/" || window.location.pathname == "/index.shtml" || window.location.pathname == "/index2019.shtml" || window.location.pathname == "/index2020.shtml" || window.location.pathname == "/cssy/"){ //pc端资讯页+首页
503                            getLotteryGuidePop("1")
504                        }
505                        if($("#fdid").length > 0){ //m端资讯页
506                            getLotteryGuidePop("2")
507                        }
508                    }else {
509                        if($(".commonHome-tanmu").length > 0 && !CDEL.getCookie("precisionMarketingUsedPop")){
510                            commonDanmuAd('commonHome-tanmu');
511                        }else {
512                            if($(".newPeopleGift-pop").length > 0){
513                                newPeopleGift()
514                            }
515                        }
516                    }
517                }else{
518                    //最大和最小折扣
519                    $(".precisionMarketing-maxDiscount").html(result.maxDiscount);
520                    $(".precisionMarketing-minDiscount").html(result.minDiscount);
521                    //折扣
522                    $("#precisionMarketing-spanDiscount,.precisionMarketing-discount").html(couponType);
523                    //抽奖人数
524                    if(result.lotteryUserCount == null){
525                        result.lotteryUserCount = 0
526                    }
527                    $(".precisionMarketing-lotteryUserCount").html(parseInt(result.lotteryUserCount)+1500);
528
529                    //资讯页面弹出框
530                    if((source == 5 || source == 103) && marketingInitConfig.isNews){
531                        if(marketingInitConfig.uid == ""){
532                            CDEL.setCookie("precisionMarketingUsedPop","precisionMarketingUsedPop","1");
533                            CDEL.setCookie("precisionMarketingMaxDiscount",$(".precisionMarketing-maxDiscount").html(),"1");
534                            CDEL.setCookie("precisionMarketingLotteryUserCount",$(".precisionMarketing-lotteryUserCount").html(),"1");
535                        }
536                        //弹出框
537                        marketingPopNew('draw-tags');
538                        $(".precisionMarketing-lotteryUserCount").html(parseInt(result.lotteryUserCount)+1500);
539                        $(".precisionMarketingV3-mod").show().find(".drawBefore-con").show();
540                    }else{
541                        var _this = $('body')[0];
542                        CDELTracker.$track(_this, {
543                            category: '获取大数据推荐',
544                            context: '展示内容'
545                        });
546
547                        if(marketingInitConfig.isProject || marketingInitConfig.isNews){
548                            if($(".precisionMarketingV3-mod").length > 0){
549                                var scrollEvent = function(){
550                                    var winTop = $(window).scrollTop(),
551                                        winHeight = $(window).height(),
552                                        precisionMarketingMod = $(".precisionMarketingV3-mod").offset().top - winHeight/2;
553                                    if(winTop > precisionMarketingMod){
554                                        if(marketingInitConfig.isTracker == false){
555                                            CDELTracker.$track(_this, {
556                                                category: '获取大数据推荐-看见内容',
557                                                context: '展示内容'
558                                            });
559                                        }
560                                        marketingInitConfig.isTracker = true;
561                                    }
562                                };
563                                $(window).bind('load scroll',scrollEvent);
564                            }
565                        }
566
567                        //方案页
568                        var precisionMarketingTotalMon = $(".join_class .set_meal .total_mon");
569                        if(precisionMarketingTotalMon.length>0){
570                            precisionMarketingTotalMon.addClass("precisionMarketing-tags")
571                        }
572                        var precisionMarketingBanner = $(".bannerCenter-wrap");
573                        if(precisionMarketingBanner.length>0){
574                            precisionMarketingBanner.addClass("precisionMarketing-tags")
575                            $(".precisionMarketingV3-mod").addClass("other-tags")
576                            precisionMarketingBanner.find("p.fl").css("fontSize","28px")
577                        }
578
579                        //选课页
580                        if(marketingInitConfig.isXuanke){
581                            $(".shoppingCart-wrap .selected-con").css({"width":"310px","height":"62px"})
582                        }
583
584                        //usedUID cookie
585                        if(marketingInitConfig.uid != ""){
586                            CDEL.removeCookie("precisionMarketingUsedUID",'/');
587                        }else {
588                            CDEL.setCookie("precisionMarketingUsedUID",usedUID,"1");
589                        }
590                        // if(CDEL.getCookie("precisionMarketingUsedUID") == null){
591                        //     CDEL.setCookie("precisionMarketingUsedUID",usedUID,"1");
592                        // }
593
594                        //推荐课程-pc/m详情页
595                        if(courseResult != null && marketingInitConfig.isNews){
596                            for(var i=0; i<courseResult.length; i++) {
597                                if(courseResult[i].productName.indexOf("高效实验") > 0){
598                                    var tips = "<div class='tips'><p>省力拿高分</p><p>名师点拨</p></div>";
599                                }else if(courseResult[i].productName.indexOf("点题密训") > 0){
600                                    var tips = "<div class='tips'><p>考前突击</p><p>刷题集训</p></div>";
601                                }else if(courseResult[i].productName.indexOf("超值精品") > 0){
602                                    var tips = "<div class='tips'><p>高性价比</p><p>课程精讲</p></div>";
603                                }else {
604                                    var tips = "<div class='tips'></div>";
605                                }
606                                HtmlStr += '<li><div class="introduce-text clearfix"><div class="name"><h3>'+courseResult[i].courseEduName+'<br>'+courseResult[i].className+'</h3><p>¥'+courseResult[i].price+'/科起</p></div>'+tips+'</div><div class="price-wrap">¥'+courseResult[i].price+' - ?= ?</div></li>';
607                            }
608                            $(".precisionMarketing-courseList").html(HtmlStr);
609
610                        }
611
612                        //推荐课程-落地页
613                        if(courseResult != null && marketingInitConfig.isProduct){
614                            for(var i=0; i<courseResult.length; i++) {
615                                if(courseResult[i].productName.indexOf("高效实验") > 0){
616                                    var tips = "<div class='tips'><p>省力拿高分</p><p>名师点拨</p></div>";
617                                }else if(courseResult[i].productName.indexOf("点题密训") > 0){
618                                    var tips = "<div class='tips'><p>考前突击</p><p>刷题集训</p></div>";
619                                }else if(courseResult[i].productName.indexOf("超值精品") > 0){
620                                    var tips = "<div class='tips'><p>高性价比</p><p>课程精讲</p></div>";
621                                }else {
622                                    var tips = "<div class='tips'></div>";
623                                }
624                                HtmlStr += '<li><div class="introduce-text clearfix"><div class="name"><h3>
624'+courseResult[i].courseEduName+'</h3><h4>'+courseResult[i].className+'</h4><p>¥'+courseResult[i].price+'/科起</p></div>'+tips+'</div><div class="price-wrap">¥'+courseResult[i].price+' - ?= ?</div></li>';
625                            }
626                            $(".precisionMarketing-courseList").html(HtmlStr);
627                        }
628                        //首页
629                        if(courseResult != null && ((source == 4 || source == 102)  && eduID == 0)){
630                            if(marketingInitConfig.uid == ""){
631                                CDEL.setCookie("precisionMarketingUsedPop","precisionMarketingUsedPop","1");
632                                CDEL.setCookie("precisionMarketingMaxDiscount",$(".precisionMarketing-maxDiscount").html(),"1");
633                                CDEL.setCookie("precisionMarketingLotteryUserCount",$(".precisionMarketing-lotteryUserCount").html(),"1");
634                            }
635                            marketingPopNew('draw-tags');
636                            $(".precisionMarketing-lotteryUserCount").html(parseInt(result.lotteryUserCount)+1500);
637                        }
638
639                        //其他页面
640                        if(otherTags){
641                            if(marketingInitConfig.uid == ""){
642                                CDEL.setCookie("precisionMarketingUsedPop","precisionMarketingUsedPop","1");
643                                CDEL.setCookie("precisionMarketingMaxDiscount",$(".precisionMarketing-maxDiscount").html(),"1");
644                                CDEL.setCookie("precisionMarketingLotteryUserCount",$(".precisionMarketing-lotteryUserCount").html(),"1");
645                            }
646                            marketingPopNew('draw-tags');
647                            $(".precisionMarketing-lotteryUserCount").html(parseInt(result.lotteryUserCount)+1500);
648                        }
649
650                        //显示试试手气相关
651                        if(voucherStatus != 1 && voucherStatus != 2){
652                            $(".precisionMarketingV3-mod").show().find(".drawBefore-con").show();
653                        }else if(voucherStatus == 1){
654                            precisionMarketingCommonInfo(result.couponTime)
655                            //优惠卷说明
656                            $(".precisionMarketing-couponExplain").html(result.useDesc || '')
657                            CDELTracker.$track($('.precisionMarketingV3-mod .drawResult-con')[0], {
658                                context: 'entr_kjw_coupon_popup'
659                            });
660                        }
661                    }
662                }
663            }else{//网关调用失败,写提示语
664                if(marketingInitConfig.isProduct){
665                    $(".introduce-con strong").hide();
666                    $(".topHeader .none").show();
667                    $(".course-list").addClass("none")
668                }
669                // CDEL.alertTip("出错啦,请刷新页面再试一次吧~");
670            }
671        },
672        // ajax失败回调
673        error : function (xhr) {
674            if(marketingInitConfig.isProduct){
675                $(".introduce-con strong").hide();
676                $(".topHeader .none").show();
677                $(".course-list").addClass("none")
678            }
679            // CDEL.alertTip("出错啦,请刷新页面再试一次吧~");
680        }
681    });
682}
683
684//优惠卷引导
685var getLotteryGuidePop = function (source) {
686    marketingInitConfig.getLotteryGuidePop = true
687    postAesData({
688        data : {
689            "params" : {
690                "time":new Date().getTime(),
691                "uid":parseInt(marketingInitConfig.uid), //辅导id
692                "platform":parseInt(source) //1:pc 2:m 3:app
693            },
694            "domain" : "chinaacc",
695            "resourcePath" : "+/precision/getLotteryGuidePop",
696            "af":"1",                //类型:String  必有字段  备注:无
697            "ap":"pc"                //类型:String  必有字段  备注:无
698        },
699        // ajax成功回调
700        success : function (data) {
701            if(data.success==true){//网关调用成功
702                var result = data.result,
703                    HtmlStr = "";
704                //推荐课程
705                if(result.length > 0){
706                    for(var i=0; i<result.length; i++) {
707                        HtmlStr += '<li><div class="coupon-prize"><h4><strong>
707'+result[i].shortName+'</strong></h4><span>优惠券</span></div><div class="explain-text" title="'+result[i].useDesc+'">使用范围:'+result[i].useDesc+'</div><div class="precisionMarketingCountDownNew" data-countdown="'+result[i].couponTime+'"><span class="tit"></span>  <span class="time"></span></div></li>';
708                        marketingInitConfig.couponName += result[i].shortName +','
709                    }
710                    //输出html
711                    $(".precisionMarketingPop-list").html(HtmlStr);
712                    $(".precisionMarketing-CommonPop.przieList-tags .top-tit").html("您有"+result.length+"张限时立减优惠券待使用");
713                    //倒计时
714                    precisionMarketingCountDownNew("precisionMarketingCountDownNew")
715                    //弹出框
716                    $(".precisionMarketing-CommonPop.przieList-tags").addClass("guide-tags");
717                    marketingPopNew('przieList-tags');
718                }else{
719                    if($(".commonHome-tanmu").length > 0 && !CDEL.getCookie("precisionMarketingUsedPop")){
720                        commonDanmuAd('commonHome-tanmu');
721                    }else {
722                        if($(".newPeopleGift-pop").length > 0){
723                            newPeopleGift()
724                        }
725                    }
726                }
727            }else{//网关调用失败,写提示语
728                if($(".commonHome-tanmu").length > 0 && !CDEL.getCookie("precisionMarketingUsedPop")){
729                    commonDanmuAd('commonHome-tanmu');
730                }else {
731                    if($(".newPeopleGift-pop").length > 0){
732                        newPeopleGift()
733                    }
734                }
735                // CDEL.alertTip("出错啦,请刷新页面再试一次吧~");
736            }
737        },
738        // ajax失败回调
739        error : function (xhr) {
740            marketingInitConfig.isAddPopTwo = true;
741            // CDEL.alertTip("出错啦,请刷新页面再试一次吧~");
742        }
743    });
744}
745
746//方案页-弹出框
747var precisionMarketingPop = function (el) {
748    var _this = $("." + el);
749    var myHeight = _this.height();
750    _this.css("marginTop", -myHeight / 2)
751    $(".precisionMarketing-mask").show();
752    $("." + el).fadeIn();
753    $(".project-precisionMarketing-pop .top-tit .close-btn").click(function () {
754        $(".precisionMarketing-mask").hide();
755        $("." + el).hide();
756    })
757}
758var closePrecisionMarketingPop = function (el) {
759    $(".precisionMarketing-mask").hide();
760    $("." + el).hide();
761}
762
763//倒计时
764var precisionMarketingCountDownNew = function (eleId) {
765    var element = $("."+eleId);
766    if(element){
767        var EndTime = parseInt(element.attr('data-countDown')),
768            NowTime = new Date().getTime() + marketingInitConfig.timeDiffer;
769        var t = EndTime - NowTime;
770        if(t >0){
771            var d = Math.floor(t / 1000 / 60 / 60 / 24, 10),
772                h = Math.floor(t / 1000 / 60 / 60),
773                hh = Math.floor(t / 1000 / 60 / 60 % 24, 10),
774                m = Math.floor(t / 1000 / 60 % 60),
775                s = Math.floor(t / 1000 % 60),
776                hm = Math.floor(t % 1000 / 100);
777            if(d > 1){
778                $(".precisionMarketingCountDownNew").find("span.tit").html(parseInt(d+1)+"天后失效");
779                $(".precisionMarketingCountDownNew").find("span.time").html("<em>"+ d + "天</em><em>"+ hh + "</em><em>:</em><em>"+ m + "</em><em>:</em><em>"+ s + "</em><em>:</em><em>"+ hm + "</em>")
780            }else {
781                $(".precisionMarketingCountDownNew").find("span.tit").html(parseInt(h+1)+"小时后失效");
782                $(".precisionMarketingCountDownNew").find("span.time").html("<em>"+ h + "</em><em>:</em><em>"+ m + "</em><em>:</em><em>"+ s + "</em><em>:</em><em>"+ hm + "</em>")
783            }
784            setTimeout(function(){precisionMarketingCountDownNew(eleId)}, 100);
785        }
786    }
787};
788var precisionMarketingCountDown = function (eleId) {
789    var element = document.getElementById(eleId);
790    if(element){
791        // var EndTime = new Date(element.getAttribute('data-countDown')).getTime(),
792        // NowTime = new Date().getTime() + marketingInitConfig.timeDiffer;
793        var EndTime = element.getAttribute('data-countDown'),
794            NowTime = new Date().getTime() + marketingInitConfig.timeDiffer,
795            t = EndTime - NowTime;
796        if(t >0){
797            var d = Math.floor(t / 1000 / 60 / 60 / 24),
798                h = Math.floor(t / 1000 / 60 / 60),
799                m = Math.floor(t / 1000 / 60 % 60),
800                s = Math.floor(t / 1000 % 60),
801                hm = Math.floor(t % 1000 / 100);
802            element.innerHTML = '<em>'+ h + '</em><em>:</em><em>'+ m + '</em><em>:</em><em>'+ s + '</em><em>:</em><em>'+ hm + '</em>';
803            setTimeout(function(){precisionMarketingCountDown(eleId)}, 100);
804        }
805    }
806};
807
808//弹出框New
809var marketingPopNew = function (el) {
810    var _this = $("." + el);
811    if(el == "przieList-tags"){
812        var $thisHegiht = $("."+el).outerHeight(),
813            $thisList = $("."+el).find(".couponList"),
814            windowHeight = $(window).height();
815        if(windowHeight < $thisHegiht){
816            $thisList.css("height",$thisList.find("li").outerHeight(true)*2)
817        }
818        $(".precisionMarketing-CommonPop .couponList .link-btn").css("height",$thisList.find("li").outerHeight(true)*$thisList.find("li").length)
819        var myHeight = _this.outerHeight(true);
820        _this.css("marginTop", -myHeight / 2+20);
821
822        if($(".precisionMarketing-CommonPop").hasClass("guide-tags")){
823            CDELTracker.$track($('body')[0], {
824                category: '引导弹窗-展示优惠卷',
825                context: marketingInitConfig.couponName
826            });
827        }else if($(".precisionMarketing-CommonPop").hasClass("drawEnd-tags")){
828            CDELTracker.$track($('body')[0], {
829                category: '抽奖后弹窗-展示优惠卷',
830                context: marketingInitConfig.couponName
831            });
832        }
833    }else {
834        var myHeight = _this.outerHeight(true);
835        _this.css("marginTop", -myHeight / 2);
836    }
837
838    if(el == "draw-tags"){
839        CDELTracker.$track($('body')[0], {
840            category: '抽奖前弹窗-弹出弹窗',
841            context: '抽奖前弹窗-弹出弹窗'
842        });
843    }
844    $(".precisionMarketing-CommonPop-mask").show();
845    _this.fadeIn();
846}
847
848var closeMarketingPopNew = function (el,type) {
849    $(".precisionMarketing-CommonPop-mask").hide();
850    $("." + el).hide();
851    CDEL.removeCookie("precisionMarketingUsedPop");
852    CDEL.removeCookie("precisionMarketingMaxDiscount");
853    CDEL.removeCookie("precisionMarketingLotteryUserCount");
854    if(el == "przieList-tags" && type != "noCDELTracker"){
855        if($(".precisionMarketing-CommonPop.przieList-tags").hasClass("guide-tags")){
856            CDELTracker.$track($('body')[0], {
857                category: '引导弹窗-点击关闭弹窗-优惠卷',
858                context: '引导弹窗-点击关闭弹窗-优惠卷'
859            });
860        }else if($(".precisionMarketing-CommonPop.przieList-tags").hasClass("drawEnd-tags")){
861            CDELTracker.$track($('body')[0], {
862                category: '抽奖后弹窗-点击关闭弹窗-优惠卷',
863                context: '抽奖后弹窗-点击关闭弹窗-优惠卷'
864            });
865        }
866    }else if(el == "draw-tags" && type != "noCDELTracker"){
867        CDELTracker.$track($('body')[0], {
868            category: '抽奖前弹窗-点击关闭弹窗-抽奖',
869            context: '抽奖前弹窗-点击关闭弹窗-抽奖'
870        });
871    }
872
873}
874

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.