webpackJsonp([20],{"8EdE":function(e,t){},bNYG:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});i("v2ns");var o=i("7QTg"),s=i("sf/l"),r=i("CCn6"),a=i("E26C"),n=i.n(a),c=i("kXdI"),l=i.n(c),p=i("XaoW"),u=i.n(p),d=i("zpE/"),g=i.n(d),_=i("WIsT"),h=i("0ZjB"),v=i.n(h),f=i("1UEi"),b=i.n(f),m={name:"index",components:{swiper:o.swiper,swiperSlide:o.swiperSlide,loginPage:_.a},data:function(){return{refBg:n.a,bindMobile:{show:!1,mobile:"",img_code:"",verify_code:"",flag:!1},join:!1,popType:!1,popFill:!1,popupVisible:!1,refVisible:!1,tabType:!0,popcontentW:"您已经购买过课程,无需重复<br>购买,您可以添加微信公众号了解更多",popcontentT:"为了更好地为您进行课程服务,<br>请扫码添加老师二维码",qrCode:g.a,weChatIcon:u.a,closeUrl:v.a,moreUrl:l.a,refIcon:b.a,swiperOption:{pagination:{el:".swiper-pagination"}},QRCodeB:!1,payFlag:!0,dataURL:null,user_id:null,invite_code_f:!0,invite_code:"",this_code:"",shopId:"",buyType:"",groupId:null,groupDetail:!1,groupData:null,couponInfo:{},couponShadow:!1}},mounted:function(){this.getDetail()},methods:{goToBuyPage:function(){var e=this,t={shopId:this.shopId,invite_code:this.invite_code},i=this.invite_code;if(this.$sa.track("buyCourse",{buyType:2===this.groupDetail.goods_type&&0===this.buyType?"团购":"直购",goodsID:this.shopId,salesType:i?i.split("-")[1]:"null",salesID:i?Number(i.split("-")[2]):0}),this.groupId&&(t.group_order_id=this.groupId),0!==this.buyType||this.groupId){if(0===this.buyType&&this.groupId)return this.$router.push({name:"buyDetail",query:{shopId:this.shopId,invite_code:this.invite_code}}),window.location.reload(),!1;t.type=""}else t.type="single",this.buyType="single";localStorage.getItem("gdt_vid")&&(t.gdt_vid=localStorage.getItem("gdt_vid")),window.location.href.indexOf("cct_user_id")>-1&&(t.cct_user_id=s.a.getUrlParam().cct_user_id),this.$router.push({name:"buy",query:t}),this.$nextTick(function(){e.payFlag=!0})},goToActivity:function(){var e={};window.location.href.indexOf("shopId")>-1&&(e.shopId=this.$route.query.shopId),window.location.href.indexOf("groupId")>-1&&(e.groupId=this.$route.query.groupId),window.location.href.indexOf("invite_code")>-1&&(e.invite_code=this.$route.query.invite_code),this.$router.push({name:"activity",query:e})},enableShare:function(e){Object(r.K)({api_list:"onMenuShareAppMessage,onMenuShareTimeline",url:window.location.href.split("#")[0]}).then(function(t){wx.config({debug:!1,appId:t.appId,timestamp:parseInt(t.timestamp),nonceStr:t.nonceStr,signature:t.signature,jsApiList:t.jsApiList}),wx.ready(function(){wx.onMenuShareTimeline({title:e.product_title,desc:e.desc,link:e.shareUrl,imgUrl:e.shareIcon||"https://cdn.singsingenglish.com/singsing/recommend/logo-refer.png",success:function(){},cancel:function(){}}),wx.onMenuShareAppMessage({title:e.product_title,desc:e.desc,link:e.shareUrl,imgUrl:e.shareIcon||"https://cdn.singsingenglish.com/singsing/recommend/logo-refer.png",success:function(){},cancel:function(){}})})})},handleInviteCode:function(){if(this.invite_code){var e=this.invite_code.split("-");e.length>2&&("TEACHER"===e[1]||"XXMM"===e[1])&&(e[1]="USER");var t=e[0]+"-"+e[1];this.this_code=t+"-"+this.user_id}else this.this_code="CC-USER-"+this.user_id},onShare:function(e){this.handleInviteCode();var t="https://wechat.changchangenglish.com/#/buyDetail?shopId="+this.shopId+"&invite_code="+this.this_code;this.enableShare({product_title:this.groupDetail.share_desc.title,desc:this.groupDetail.share_desc.content,shareIcon:this.groupDetail.share_desc.img[0].url,shareUrl:t})},toDataURLBase64:function(e,t){var i=new XMLHttpRequest;i.onload=function(){var e=new FileReader;e.onloadend=function(){t(e.result)},e.readAsDataURL(i.response)},i.responseType="blob",i.open("GET",e,!0),i.send()},getDetail:function(){var e=this;window.location.href.indexOf("invite_code")>-1&&(this.invite_code=this.$route.query.invite_code,2===this.invite_code.split("-").length&&(this.invite_code_f=!1));this.$route.query.invite_code&&(this.invite_code=this.$route.query.invite_code),this.user_id=JSON.parse(localStorage.getItem("userDesc")).user_id,window.location.href.indexOf("shopId")>-1&&(this.shopId=this.$route.query.shopId,Object(r.l)(this.shopId).then(function(t){if(t.desc=JSON.parse(t.desc),t.goods_desc=JSON.parse(t.goods_desc),t.share_desc=JSON.parse(t.share_desc),2===t.status&&t.bind_goods_id)return e.$router.push({name:"buyDetail",query:{shopId:t.bind_goods_id,invite_code:e.invite_code}}),void e.getDetail();e.groupDetail=t;for(var i=0;i<e.groupDetail.header_url.length;i++)e.groupDetail.header_url[i]=e.groupDetail.header_url[i].replace("http://","https://");if(e.groupDetail.desc.detail=e.groupDetail.desc.detail.replace(/http:\/\//g,"https://"),e.groupDetail.desc.qa=e.groupDetail.desc.qa.replace(/http:\/\//g,"https://"),e.groupDetail.share_desc.refImg&&1===e.groupDetail.share_desc.refImg.length){e.groupDetail.share_desc.refImg[0].url=e.groupDetail.share_desc.refImg[0].url.replace("http://","https://");var o=e;e.toDataURLBase64(e.groupDetail.share_desc.refImg[0].url,function(e){o.groupDetail.share_desc.refImg[0].url=e})}var s=e.invite_code;e.$sa.track("viewCourseDetail",{goodsID:e.groupDetail.id.toString(),courseCate:1===e.groupDetail.course_type?"体验课":"正式课",lessonNumber:e.groupDetail.watch_num,goodsName:e.groupDetail.name,coursePrice:Number(e.groupDetail.original_price/100),discountPrice:Number(e.groupDetail.current_price/100),courseID:e.groupDetail.course_id,courseName:"",salesType:s?s.split("-")[1]:"null",salesID:s?Number(s.split("-")[2]):0}),2===e.groupDetail.goods_type?(localStorage.getItem("cc_token")&&Object(r.B)({goods_id:e.shopId}).then(function(t){t.out_trade_no&&(1===t.buy_type?e.$router.push({name:"buySuccess",query:{out_trade_no:t.out_trade_no}}):e.$router.push({name:"success",query:{out_trade_no:t.out_trade_no}}))}),window.location.href.indexOf("groupId")>-1?(e.groupId=e.$route.query.groupId,Object(r.n)(e.groupId).then(function(t){e.groupData=t}),e.onShare(0)):e.onShare(1)):(e.onShare(1),e.handleInviteCode())})),JSON.parse(localStorage.getItem("userCourse")).periods_list||Object(r.h)(this.$route.query.shopId).then(function(t){t.length&&(e.couponInfo=t[0],e.couponShadow=!0)})},showTeacher:function(){this.popType=!1,this.popupVisible=!0},buttonClick:function(e,t){this.$sa.track("buttonClick",{tabTitle:"商品",moduleTitle:"详情页",buttonType:e,buttonName:t})},groupPay:function(e){var t=this;this.buyType=e,JSON.parse(localStorage.getItem("userDesc")).mobile&&""!==JSON.parse(localStorage.getItem("userDesc")).mobile?this.goToBuyPage():(this.bindMobile.flag=e,this.bindMobile.show=!0,setTimeout(function(){t.$sa.track("ViewRegisterpage",{})},1e3))}}},D={render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[i("div",{staticStyle:{height:"100vh",overflow:"auto"}},[e.groupDetail?i("div",{ref:"index",staticClass:"group-index",staticStyle:{"min-height":"120vh"}},[i("swiper",{ref:"mySwiper",staticClass:"banner",attrs:{options:e.swiperOption}},[e._l(e.groupDetail.goods_desc.img,function(t,o){return e.groupDetail.goods_desc?i("swiper-slide",{key:o},[i("img",{attrs:{src:t.url}})]):e._e()}),e._v(" "),i("div",{staticClass:"swiper-pagination",attrs:{slot:"pagination"},slot:"pagination"})],2),e._v(" "),1===e.groupDetail.is_auth_user?i("img",{staticClass:"ref-icon shake",attrs:{src:e.refIcon},on:{click:function(t){e.goToActivity(),e.buttonClick("功能","生成海报")}}}):e._e(),e._v(" "),i("div",{staticClass:"head"},[i("div",{staticClass:"title"},[e._v(e._s(e.groupDetail.name))]),e._v(" "),i("span",{staticClass:"detail"},[e._v(e._s(e.groupDetail.goods_desc.desc))]),e._v(" "),i("div",{staticClass:"price"},[i("span",{staticClass:"price-content"},[e._v("¥"+e._s(e.groupDetail.current_price/100)+"元")]),e._v(" "),1===e.groupDetail.goods_type&&e.groupDetail.original_price>e.groupDetail.current_price?i("span",{staticStyle:{"text-decoration":"line-through",color:"#bbb","font-size":"14px"}},[e._v("¥"+e._s(e.groupDetail.original_price/100))]):e._e()])]),e._v(" "),i("div",{staticClass:"head-icon"},[e._l(e.groupDetail.header_url,function(t,o){return o<5?i("img",{key:t,staticClass:"icon",attrs:{src:t}}):e._e()}),e._v(" "),i("img",{staticClass:"more",attrs:{src:e.moreUrl}}),e._v(" "),i("span",{staticClass:"has"},[e._v("已售"+e._s(e.groupDetail.has_group_num)+"件")])],2),e._v(" "),e.groupDetail.head_welfare&&""!==e.groupDetail.head_welfare&&null!==e.groupDetail.head_welfare?i("div",{staticClass:"welfare"},[e._v("团长福利:"+e._s(e.groupDetail.head_welfare))]):e._e(),e._v(" "),i("div",{staticClass:"main-detail"},[i("div",{staticClass:"tab-content"},[i("div",{class:{"tab-btn":!0,active:e.tabType},on:{click:function(t){e.tabType=!0,e.buttonClick("展示","图文详情")}}},[e._v("图文详情")]),e._v(" "),i("div",{class:{"tab-btn":!0,active:!e.tabType},on:{click:function(t){e.tabType=!1,e.buttonClick("展示","购买须知")}}},[e._v("购买须知")])]),e._v(" "),e.tabType?i("div",{staticClass:"detail"},[i("div",{staticClass:"detail-content",domProps:{innerHTML:e._s(e.groupDetail.desc.detail)}})]):e._e(),e._v(" "),e.tabType?e._e():i("div",{staticClass:"qa-block"},[i("div",{staticClass:"qa-content qaDetail",domProps:{innerHTML:e._s(e.groupDetail.desc.qa)}})])]),e._v(" "),e.groupDetail.desc.customer_service[0]?i("div",[i("mt-popup",{model:{value:e.popupVisible,callback:function(t){e.popupVisible=t},expression:"popupVisible"}},[i("div",{staticClass:"pop-block"},[e.popType?i("img",{attrs:{src:e.qrCode}}):e._e(),e._v(" "),e.popType?e._e():i("img",{attrs:{src:e.groupDetail.desc.customer_service[0].url}}),e._v(" "),i("div",[e.popType?i("span",{domProps:{innerHTML:e._s(e.popcontentW)}}):e._e(),e._v(" "),e.popType?e._e():i("span",{domProps:{innerHTML:e._s(e.popcontentT)}})]),e._v(" "),i("img",{staticClass:"close",attrs:{src:e.closeUrl},on:{click:function(t){e.popupVisible=!1}}})])])],1):e._e(),e._v(" "),i("mt-popup",{attrs:{closeOnClickModal:!1},model:{value:e.popFill,callback:function(t){e.popFill=t},expression:"popFill"}},[i("div",{staticClass:"pop-fill"},[e._v("\n 您好,本次拼团已经结束。您可以选择重新开团或单独购买\n "),i("div",{staticClass:"btn-block"},[i("div",{staticClass:"btn",on:{click:function(t){e.rePlay()}}},[e._v("重新开团")])])])]),e._v(" "),i("mt-popup",{staticStyle:{"background-color":"transparent","margin-top":"-80vw","margin-left":"-40vw",transform:"none"},model:{value:e.refVisible,callback:function(t){e.refVisible=t},expression:"refVisible"}},[e.groupDetail.share_desc.refImg&&e.groupDetail.share_desc.refImg.length>0?i("div",{staticClass:"ref-content",style:{backgroundImage:"url("+e.refBg+")"}},[i("div",{staticClass:"tips"},[e._v("长按保存图片")])]):e._e(),e._v(" "),e.groupDetail.share_desc.refImg&&e.groupDetail.share_desc.refImg.length>0?i("div",{ref:"imageWrapper",staticClass:"img-cvs",attrs:{id:"capture"}},[i("img",{attrs:{src:e.groupDetail.share_desc.refImg[0].url}}),e._v(" "),i("div",{staticClass:"qrcode",attrs:{id:"qrcode"}})]):e._e(),e._v(" "),i("img",{staticClass:"cvs-img",attrs:{src:e.dataURL}})]),e._v(" "),1===e.groupDetail.status&&e.invite_code_f?i("div",[e.couponInfo.money?i("div",{staticClass:"couponBox"},[e._v("您有"+e._s(e.couponInfo.money/100)+"元优惠券可使用")]):e._e(),e._v(" "),e.groupDetail.goods_type&&2===e.groupDetail.goods_type?i("footer",[e.groupDetail.desc.customer_service[0]?i("div",{staticClass:"btn",on:{click:function(t){e.showTeacher(),e.buttonClick("老师","客服")}}},[i("img",{attrs:{src:e.weChatIcon}})]):e._e(),e._v(" "),e.groupData&&0!==e.groupData.status?i("div",{staticClass:"btn big price full"},[e.groupId?i("div",[e._v("该团已满")]):e._e()]):e._e(),e._v(" "),i("div",{class:e.groupData&&0!==e.groupData.status?"btn big price":"btn big",attrs:{id:e.groupId?"reGroup":"singleBuy"},on:{click:function(t){e.groupPay(0),e.buttonClick("购买按钮",e.groupId?"重新开团":"单独购买")}}},[e.groupId?e._e():i("span",[e._v("¥"+e._s(e.groupDetail.original_price/100))]),e._v(" "),e.groupId?e._e():i("div",[e._v("单独购")]),e._v(" "),e.groupId?i("span",[e._v("¥"+e._s(e.groupDetail.current_price/100))]):e._e(),e._v(" "),e.groupId?i("div",[e._v("重新开团")]):e._e()]),e._v(" "),e.groupData&&0!==e.groupData.status?e._e():i("div",{staticClass:"btn big price",attrs:{id:e.groupId?"joinGroup":"newGroup"},on:{click:function(t){e.groupPay(1),e.buttonClick("购买按钮",e.groupId?"立即参团":"创建团")}}},[i("span",[e._v("¥"+e._s(e.groupDetail.current_price/100))]),e._v(" "),e.groupId?e._e():i("div",[e._v(e._s(e.groupDetail.desc.group_number)+"人团")]),e._v(" "),e.groupId?i("div",[e._v("立即参团")]):e._e()])]):e._e(),e._v(" "),e.groupDetail.goods_type&&2!==e.groupDetail.goods_type?i("footer",[e.groupDetail.desc.customer_service[0]?i("div",{staticClass:"btn",on:{click:function(t){e.showTeacher(),e.buttonClick("功能","客服")}}},[i("img",{attrs:{src:e.weChatIcon}})]):e._e(),e._v(" "),e.groupDetail.current_price>0?i("div",{staticClass:"btn big price",on:{click:function(t){e.groupPay(1),e.buttonClick("购买按钮","直购购买")}}},[i("span",[e._v("¥"+e._s(e.groupDetail.current_price/100))]),e._v(" "),i("div",[e._v("立即购买")])]):e._e(),e._v(" "),0==e.groupDetail.current_price?i("div",{staticClass:"btn big price",on:{click:function(t){e.groupPay(1),e.buttonClick("购买按钮","直购购买")}}},[i("div",{staticClass:"free"},[e._v("免费领")])]):e._e()]):e._e()]):e._e(),e._v(" "),1!==e.groupDetail.status?i("div",[e._m(0)]):e._e()],1):e._e()]),e._v(" "),e.groupDetail?i("login-page",{attrs:{"bind-mobile":e.bindMobile,groupDetail:e.groupDetail},on:{goToBuyPage:e.goToBuyPage}}):e._e()],1)},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("footer",[t("div",{staticStyle:{color:"#888"}},[this._v("已售罄")])])}]};var y=i("VU/8")(m,D,!1,function(e){i("cVCm"),i("8EdE")},"data-v-ca1d311e",null);t.default=y.exports},cVCm:function(e,t){}});
-
chenyishuai@singsingenglish.com authored2ba6c448