webpackJsonp([12],{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"),l=i.n(c),p=i("kXdI"),d=i.n(p),u=(i("1UEi"),i("XaoW")),g=i.n(u),_=i("zpE/"),h=i.n(_),v=i("0ZjB"),f=i.n(v),m=i("2Pnh"),I=i.n(m),b={name:"index",components:{swiper:o.swiper,swiperSlide:o.swiperSlide},data:function(){return{refBg:l.a,join:!1,popType:!1,popFill:!1,popupVisible:!1,refVisible:!1,tabType:!0,popcontentW:"您已经购买过课程,无需重复<br>购买,您可以添加微信公众号了解更多",popcontentT:"为了更好地为您进行课程服务,<br>请扫码添加老师二维码",qrCode:h.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");var t=e.invite_code.split("-");t.length>2&&"TEACHER"===t[1]&&(t[1]="USER");var i=t[0]+"-"+t[1],o="https://wechat.changchangenglish.com/#/buyDetail?shopId="+e.shopId+"&invite_code="+i+"-"+e.user_id;e.groupId&&"null"!==e.groupId&&(o+="&groupId="+e.groupId),e.qrcode(o),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,l=t.left+n-a;return{top:Math.round(c),left:Math.round(l)}},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){Object(a.y)({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(){console.log("分享成功")},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(){},cancel:function(){}})})})},handleInviteCode:function(){if(this.invite_code){var e=this.invite_code.split("-");e.length>2&&"TEACHER"===e[1]&&(e[1]="USER");var t=e[0]+"-"+e[1];this.invite_code=t+"-"+this.user_id}else this.invite_code="CC-USER-"+this.user_id},onShare:function(e){this.handleInviteCode();var 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,2===this.invite_code.split("-").length&&(this.invite_code_f=!1));Object(a.w)().then(function(t){e.user_id=t.user_id,window.location.href.indexOf("shopId")>-1&&(e.shopId=e.$route.query.shopId,Object(a.g)(e.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.s)({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(a.i)(e.groupId).then(function(t){e.groupData=t}),e.onShare(0)):e.onShare(1)):e.handleInviteCode()}))})},showTeacher:function(){this.popType=!1,this.popupVisible=!0},groupPay:function(e){var t={shopId:this.shopId,invite_code:this.$route.query.invite_code};if(this.groupId&&(t.group_order_id=this.groupId),0!==e||this.groupId){if(0===e&&this.groupId)return this.$router.push({name:"buyDetail",query:{shopId:this.shopId,invite_code:this.$route.query.invite_code}}),window.location.reload(),!1;t.type=""}else t.type="single";this.$router.push({name:"buy",query:t})}}},y={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")(b,y,!1,function(e){i("qBol"),i("x8xZ")},"data-v-6760f12f",null);t.default=D.exports},qBol:function(e,t){},x8xZ:function(e,t){}});
//# sourceMappingURL=12.5783c2d52be398977e98.js.map
-
wangwei authored8a2e217d