webpackJsonp([10],{bNYG:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});i("v2ns");var o=i("7QTg"),s=i("MJLE"),n=i.n(s),r=i("Au9i"),a=i("CCn6"),c=i("E26C"),p=i.n(c),l=i("kXdI"),d=i.n(l),u=(i("1UEi"),i("XaoW")),g=i.n(u),h=i("zpE/"),_=i.n(h),v=i("0ZjB"),f=i.n(v),m=i("2Pnh"),I=i.n(m),w={name:"index",components:{swiper:o.swiper,swiperSlide:o.swiperSlide},data:function(){return{refBg:p.a,join:!1,popType:!1,popFill:!1,popupVisible:!1,refVisible:!1,tabType:!0,popcontentW:"您已经购买过课程,无需重复<br>购买,您可以添加微信公众号了解更多",popcontentT:"为了更好地为您进行课程服务,<br>请扫码添加老师二维码",qrCode:_.a,weChatIcon:g.a,closeUrl:f.a,moreUrl:d.a,refIcon:"https://cdn.singsingenglish.com/new-sing/b7f43ced8f8268655c2c5b289360df990ec8f18e.png",swiperOption:{pagination:{el:".swiper-pagination"}},QRCodeB:!1,dataURL:null,user_id:null,invite_code_f:!0,invite_code:"",shopId:"",groupId:null,groupDetail:!1,groupData:null}},mounted:function(){this.getDetail()},methods:{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})},refshow:function(){var e=this;if(r.Indicator.open(),document.body.scrollTop<10&&(document.body.scrollTop=20,document.documentElement.scrollTop=20),localStorage.getItem("cc_token")&&""!==localStorage.getItem("cc_token"))setTimeout(function(){r.Indicator.close(),e.invite_code||(e.invite_code="CC-USER"),Object(a.q)().then(function(t){e.user_id=t.user_id;var i=e.invite_code.split("-");i.length>2&&"TEACHER"===i[1]&&(i[1]="USER");var o=i[0]+"-"+i[1],s="https://wechat.changchangenglish.com/#/buyDetail?shopId="+e.shopId+"&invite_code="+o+"-"+e.user_id;e.groupId&&"null"!==e.groupId&&(s+="&groupId="+e.groupId),console.log(s),e.qrcode(s),e.refVisible=!0,e.$nextTick(function(){e.dataURL||setTimeout(function(){var t=document.getElementById("capture").getClientRects()[0],i=(t.height,t.width);document.getElementById("capture").style.width=i+"px";e.getOffsetRect(e.$refs.imageWrapper);var o=document.getElementById("capture").getClientRects()[0],s=o.height1,n=o.width1;I()(document.getElementById("capture"),{async:!0,timeout:500,scrollX:1,scale:3,width:n,height:s,letterRendering:!0}).then(function(t){var i=t.toDataURL("image/jpg");e.dataURL=i}).catch(function(e){alert(e),console.log()})},500)})})},500);else{var t={retUrl:this.$route.fullPath,is_new_user_url:"1"};this.$router.push({name:"author",query:t})}},getOffsetRect:function(e){var t=e.getBoundingClientRect(),i=document.body,o=document.documentElement,s=window.pageYOffset||o.scrollTop||i.scrollTop,n=window.pageXOffset||o.scrollLeft||i.scrollLeft,r=o.clientTop||i.clientTop,a=o.clientLeft||i.clientLeft,c=t.top+s-r,p=t.left+n-a;return{top:Math.round(c),left:Math.round(p)}},qrcode:function(e){this.QRCodeB?this.QRCodeB.makeCode(e):this.QRCodeB=new n.a("qrcode",{width:80,height:80,text:e,image:""})},enableShare:function(e){var t=this;Object(a.t)({api_list:"onMenuShareAppMessage,onMenuShareTimeline",url:window.location.href.split("#")[0]}).then(function(i){wx.config({debug:!1,appId:i.appId,timestamp:parseInt(i.timestamp),nonceStr:i.nonceStr,signature:i.signature,jsApiList:i.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(){console.log("分享成功"),window._hmt.push(["_trackEvent","分享","商品页好友分享","id"+t.shopId,t.invite_code])},cancel:function(){console.log("分享失败")}}),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(){window._hmt.push(["_trackEvent","分享","商品页朋友圈分享","id"+t.shopId,t.invite_code])},cancel:function(){}})})})},onShare:function(e){var t="https://wechat.changchangenglish.com/#/buyDetail??shopId="+this.shopId+"&groupId="+this.groupId+"&invite_code="+this.invite_code;1===e&&(t="https://wechat.changchangenglish.com/#/buyDetail??shopId="+this.shopId+"&invite_code="+this.invite_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,this.invite_code.split("-").length<3&&(this.invite_code_f=!1));window.location.href.indexOf("shopId")>-1&&(this.shopId=this.$route.query.shopId,Object(a.d)(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}}),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})}2===e.groupDetail.goods_type&&(localStorage.getItem("cc_token")&&Object(a.n)({goods_id:e.shopId}).then(function(t){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(a.f)(e.groupId).then(function(t){e.groupData=t}),e.onShare(0)):e.onShare(1))}))},showTeacher:function(){this.popType=!1,this.popupVisible=!0},groupPay:function(e){var t={shopId:this.shopId,invite_code:this.invite_code};this.groupId&&(t.group_order_id=this.groupId),0!==e||this.groupId?0===e&&this.groupId?(window.location.href="/#/buyDetail?shopId="+this.shopId,window._hmt.push(["_trackEvent","购买","商品页团购重新开团","id"+this.shopId,this.invite_code])):(window._hmt.push(["_trackEvent","购买","商品页购买","id"+this.shopId,this.invite_code]),t.type=""):(t.type="single",window._hmt.push(["_trackEvent","购买","商品页团购单独购买","id"+this.shopId,this.invite_code])),this.$router.push({name:"buy",query:t})}}},b={render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return e.groupDetail?i("div",{ref:"index",staticClass:"group-index"},[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._e(),e._v(" "),i("div",{staticClass:"head"},[i("div",{staticClass:"title"},[e._v("\n "+e._s(e.groupDetail.name)+"\n ")]),e._v(" "),i("span",{staticClass:"detail"},[e._v("\n "+e._s(e.groupDetail.goods_desc.desc)+"\n ")]),e._v(" "),i("div",{staticClass:"price"},[i("span",{staticClass:"price-content"},[e._v("¥"+e._s(e.groupDetail.current_price/100)+"元")])])]),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("\n 团长福利:"+e._s(e.groupDetail.head_welfare)+"\n ")]):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._v("图文详情")]),e._v(" "),i("div",{class:{"tab-btn":!0,active:!e.tabType},on:{click:function(t){e.tabType=!1}}},[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(" "),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}}})])]),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("\n 长按保存图片\n ")])]):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.groupDetail.goods_type&&2===e.groupDetail.goods_type?i("footer",[i("div",{staticClass:"btn",on:{click:function(t){e.showTeacher()}}},[i("img",{attrs:{src:e.weChatIcon}})]),e._v(" "),i("div",{staticClass:"btn big",attrs:{id:e.groupId?"reGroup":"singleBuy"},on:{click:function(t){e.groupPay(0)}}},[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(" "),i("div",{staticClass:"btn big price",attrs:{id:e.groupId?"joinGroup":"newGroup"},on:{click:function(t){e.groupPay(1)}}},[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",[i("div",{staticClass:"btn",on:{click:function(t){e.showTeacher()}}},[i("img",{attrs:{src:e.weChatIcon}})]),e._v(" "),i("div",{staticClass:"btn big price",on:{click:function(t){e.groupPay(1)}}},[i("span",[e._v("¥"+e._s(e.groupDetail.current_price/100))]),e._v(" "),i("div",[e._v("立即购买")])])]):e._e()]):e._e(),e._v(" "),1!==e.groupDetail.status?i("div",[e._m(0)]):e._e()],1):e._e()},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("footer",[t("div",{staticStyle:{color:"#888"}},[this._v("\n 已售罄\n ")])])}]};var D=i("VU/8")(w,b,!1,function(e){i("m6in"),i("rhXN")},"data-v-ac006272",null);t.default=D.exports},m6in:function(e,t){},rhXN:function(e,t){}});
//# sourceMappingURL=10.aa0b38c97083823b99fb.js.map
-
王 authored0cacc862