bztang-admin/addons/yun_shop/static/app/js/chunk-6848ff86.d2784d88.js

1 line
17 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6848ff86"],{"1dcd":function(t,e,i){var a=i("24fb");e=a(!1),e.push([t.i,'#foreshow[data-v-014d639c]{width:100%;position:relative}.header[data-v-014d639c]{width:100%;height:100%;background-size:contain;background-position:top;background-repeat:no-repeat}.title[data-v-014d639c]{position:fixed;top:0;left:0;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;color:#fff;font-size:17px;font-weight:700;padding:.5rem}.title span[data-v-014d639c]{width:80%;line-height:2rem}.title i[data-v-014d639c]{font-weight:700;font-size:18px;-webkit-box-flex:0;-webkit-flex:0 0 10%;-ms-flex:0 0 10%;flex:0 0 10%;line-height:2rem}.content[data-v-014d639c]{position:fixed;bottom:0;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);width:100%;height:66%;background:#fff;border-radius:1.5rem 1.5rem 0 0}.member-head[data-v-014d639c]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;padding:1rem}.member-head .left[data-v-014d639c]{width:4rem;height:4rem}.member-head .left img[data-v-014d639c]{height:100%;width:100%;border-radius:50%}.member-head .name[data-v-014d639c]{font-weight:700;font-size:16px;text-align:left;width:15rem}.member-head .right[data-v-014d639c]{margin-left:.5rem;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;padding:.2rem 0}.member-head .share[data-v-014d639c]{background-color:#ff7e00;color:#fff;border-radius:15px;padding:.2rem .6rem}.member-head .build[data-v-014d639c]{background-color:#6105de;color:#fff;border-radius:15px;padding:.2rem .5rem;margin-left:.5rem}.number_time[data-v-014d639c]{margin:1.5rem auto;color:#333;font-size:15px;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}.number_time[data-v-014d639c],.number_time .active_time[data-v-014d639c],.number_time .active_time span[data-v-014d639c]{-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center}.number_time .active_time span[data-v-014d639c]{font-size:20px;background-color:#e71a1a;color:#fff;padding:.3rem;border-radius:10px}.number_time .active_time em[data-v-014d639c]{font-weight:700;display:inline-block;padding:0 .5rem}.hope[data-v-014d639c]{margin:0 auto 1.5rem auto;line-height:2rem}.hope[data-v-014d639c]:before{margin-right:.5rem}.hope[data-v-014d639c]:after,.hope[data-v-014d639c]:before{height:1px;width:7rem;vertical-align:middle;background-color:#eee;content:"";display:inline-block}.hope[data-v-014d639c]:after{margin-left:.5rem}.button[data-v-014d639c]{border:1px solid #e71a1a;color:#e71a1a;width:15rem;height:3rem;border-radius:.734rem;text-align:center;margin:0 auto;line-height:3rem;font-size:17px;font-weight:700}.popupClass2[data-v-014d639c]{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);width:19.375rem;z-index:999}.popupClass2 .popup-box[data-v-014d639c]{width:19.375rem;margin:0 auto;overflow:hidden;border-radius:8px}.popupClass2 .code[data-v-014d639c]{width:19.375rem;background-color:#fff;border-radius:8px;padding-top:.5rem;padding-bottom:1rem}.popupClass2 .code .shop_top[data-v-014d639c]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:1.75rem;margin-bottom:.5rem}.popupClass2 .code .shop_top .shop_icon[data-v-014d639c]{width:1.75rem;height:1.75rem;border-radius:100%;margin:0}.popupClass2 .code .shop_top .shop_name[data-v-014d639c]{height:1.75rem;line-height:1.75rem;margin-left:1rem;font-size:.875rem;color:#000}.popupClass2 .code .bgBox[data-v-014d639c]{position:relative;margin:0 auto;width:17.5rem}.popupClass2 .code .bgBox .bg[data-v-014d639c]{width:17.5rem;max-height:18rem;display:block;-o-object-fit:cover;object-fit:cover}.popupClass2 .code .bgBox .anchorInfo[data-v-014d639c]{position:absolute;top:.6rem;left:.6rem;background:rgba(0,0,0,.4);color:#fff;height:1.375rem;line-height:1.375rem;border-radius:.875rem;padding-right:.375rem;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.popupClass2 .code .bgBox .anchorInfo img[data-v-014d639c]{width:1.375rem;height:1.375rem;border-radius:100%;margin-right:.25rem}.popupClass2 .code .bgBox .anchorInfo .nickname[data-v-014d639c]{max-width:5rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.popupClass2 .code .bgBox .live_status[data-v-014d639c]{position:absolute;top:.6rem;right:.6rem;color:#fff;width:4rem;height:1.375rem;line-height:1.375rem;background-color:#ff7200;border-radius:.656rem}.popupClass2 .code .posterBottom[data-v-014d639c]{width:17.5rem;margin:0 auto;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;text-align:left}.popupClass2 .code .posterBottom .l_info[data-v-014d639c]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column}.popupClass2 .code .posterBottom .l_info .titless[data-v-014d639c]{width:11rem;height:2.5rem;line-height:1.25rem;color:#000;font-size:.875rem;text-align:left;margin-top:1.375rem;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical;-webkit-line-clamp:2}.popupClass2 .code .posterBottom .l_info .live_time[data-v-014d639c]{font-size:10px;color:#ff7200;margin-top:1.875rem}.popupClass2 .code .posterBottom .l_info .share_meber[data-v-014d639c]{color:#666;margin-top:.875rem;height:1.5rem;line-height:1.5rem;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.popupClass2 .code .posterBottom .l_info .share_meber img[data-v-014d639c]{width:1.5rem;height:1.5rem;border-radius:100%;margin:0;vertical-align:top;margin-right:.25rem}.popupClass2 .code .posterBottom .l_info .share_meber .m_nickname[data-v-014d639c]{max-width:5rem;overflow:hidden}.popupClass2 .code .posterBottom .r_info[data-v-014d639c]{margin-top:1.375rem;text-align:right}.popupClass2 .code .posterBottom .r_info img[data-v-014d639c]{width:5.969rem;height:5.656rem;-o-object-fit:contain;object-fit:contain}.popupClass2 .code .posterBottom .r_info p[data-v-014d639c]{font-size:.625rem}.popupClass2 .closeBox[data-v-014d639c]{width:2rem;height:2rem;line-height:2rem;border:.125rem solid #fff;border-radius:100%;color:#fff;position:absolute;left:50%;bottom:-2.5rem;margin-left:-1rem;z-index:999}.popupClass2 .closeBox i[data-v-014d639c]{font-size:1rem}',""]),t.exports=e},4834:function(t,e,i){var a=i("1dcd");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);var o=i("499e").default;o("f811f69e",a,!0,{sourceMap:!1,shadowMode:!1})},"9d39":function(t,e,i){"use strict";i.r(e);var a=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{style:{height:t.innerHeight+"px"},attrs:{id:"foreshow"}},[i("div",{staticClass:"header",style:{backgroundImage:"url("+t.info.cover+")"}}),i("div",{staticClass:"title set-pc-style"},[i("i",{staticClass:"iconfont icon-back",on:{click:function(e){return t.goto()}}}),i("span",[t._v("预告")])]),i("div",{staticClass:"content",style:{width:3==t.fun.getPhoneEnv()?"375px":""}},[i("div",{staticClass:"member-head"},[i("div",{staticClass:"left",on:{click:t.gotoAnchor}},[i("img",{attrs:{src:t.info.avatar,alt:""}})]),i("div",{staticClass:"right"},[i("p",{staticClass:"name overflow"},[t._v(t._s(t.info.nickname))]),i("div",{staticStyle:{display:"flex"}},[i("p",{staticClass:"share",on:{click:t.shareMessage}},[t._v("分享")]),i("p",{staticClass:"build",on:{click:t.showPoster}},[t._v("生成海报")])])])]),i("div",{staticClass:"number_time"},[i("p",{directives:[{name:"show",rawName:"v-show",value:!t.stop,expression:"!stop"}],staticStyle:{"font-weight":"bold"}},[t._v("距离开播仅剩")]),i("p",{directives:[{name:"show",rawName:"v-show",value:!t.stop&&t.end,expression:"!stop && end"}],staticClass:"active_time"},[i("span",[t._v(t._s(t.Day))]),i("em",[t._v("天")]),t._v(" "),i("span",[t._v(t._s(t.Hour))]),i("em",[t._v(":")]),t._v(" "),i("span",[t._v(t._s(t.Min))]),i("em",[t._v(":")]),i("span",[t._v(t._s(t.Sec))])]),i("p",{directives:[{name:"show",rawName:"v-show",value:t.stop,expression:"stop"}],staticClass:"active_time"},[t._v(t._s(2==t.PosterData.status?"等待主播开播中":"已开播"))])]),2==t.info.status?i("div",[i("div",{staticClass:"hope"},[t._v("敬请期待")]),t.isSetNotice?i("div",{staticClass:"button",on:{click:t.cancelNotice}},[t._v("已订阅")]):t._e(),t.isSetNotice?t._e():i("div",{staticClass:"button",on:{click:t.showToast}},[t._v("开播提醒")])]):t._e(),3==t.info.status?i("div",[i("div",{staticClass:"hope"},[t._v("正在直播")]),i("div",{staticClass:"button",on:{click:t.comeLive}},[t._v("进入直播间")])]):t._e(),4==t.info.status?i("div",[i("div",{staticClass:"hope"},[t._v("直播结束")]),i("div",{staticClass:"button",on:{click:t.gotoAnchor}},[t._v("主播主页")])]):t._e()]),i("van-overlay",{attrs:{show:t.show},on:{click:function(e){t.show=!1}}}),i("div",{staticClass:"popupClass2",style:{top:t.show?"50%":"-100%"},on:{touchmove:function(t){t.stopPropagation()}}},[i("div",{directives:[{name:"show",rawName:"v-show",value:t.loadingImg,expression:"loadingImg"}],staticClass:"popup-box"},[i("div",{staticClass:"code",attrs:{id:"code_box"}},[i("div",{staticClass:"shop_top"},[i("img",{staticClass:"shop_icon",attrs:{src:t.base64Datas[0],alt:""}}),i("div",{staticClass:"shop_name"},[t._v(t._s(t.PosterData.shop_name))])]),i("div",{staticClass:"bgBox"},[i("img",{staticClass:"bg",staticStyle:{"object-fit":"cover"},attrs:{src:t.base64Datas[1],alt:""}}),i("div",{staticClass:"anchorInfo"},[i("img",{attrs:{src:t.base64Datas[2],alt:""}}),i("div",{staticClass:"nickname"},[t._v(t._s(t.PosterData.nickname))])]),i("div",{staticClass:"live_status"},[t._v(" "+t._s(2==t.PosterData.status?"预告":3==t.PosterData.status?"直播中":"回放中")+" ")])]),i("div",{staticClass:"posterBottom"},[i("div",{staticClass:"l_info"},[i("div",{staticClass:"titless"},[t._v(t._s(t.PosterData.title))]),i("div",{staticClass:"live_time"},[t._v("直播时间"+t._s(t.PosterData.live_time))]),i("div",{staticClass:"share_meber"},[i("img",{attrs:{src:t.base64Datas[3],alt:""}}),i("div",{staticClass:"m_nickname"},[t._v(t._s(t.nameEllipsis))]),t._v(" 的分享 ")])]),i("div",{staticClass:"r_info"},[i("img",{attrs:{src:t.base64Datas[4],alt:""}}),i("p",[t._v("长按识别或者保存图片")])])])])]),i("div",{directives:[{name:"show",rawName:"v-show",value:!t.loadingImg,expression:"!loadingImg"}],staticStyle:{width:"19.375rem",margin:"0 auto","border-radius":"8px"}},[i("img",{staticStyle:{width:"19.375rem","border-radius":"8px"},attrs:{id:"thecanvas"}})]),i("div",{staticClass:"closeBox",on:{click:function(e){t.show=!1}}},[i("i",{staticClass:"iconfont icon-close11"})])])],1)},o=[],s=i("c7eb"),r=i("1da1"),n=(i("e7e5"),i("d399")),c=(i("14d9"),i("d3b7"),i("99af"),i("c0e9")),l=i.n(c),d=null,m=document.body.clientHeight,p={data:function(){return{innerHeight:m,star_time:null,time:"",Day:"01",Hour:"03",Min:"32",Sec:"34",stop:!1,show:!1,loadingImg:!0,dataURL:"",info:{avatar:null,nickname:null,qr_code:null,cover:null},isSetNotice:!1,end:null,PosterData:{},posterImg:[],base64Datas:[]}},activated:function(){this.initData(),this.getData(),this.getPoster()},deactivated:function(){this.pollStautsTimer&&clearInterval(this.pollStautsTimer)},methods:{initData:function(){this.time="",this.Day="",this.Hour="",this.Min="",this.Sec="",this.show=!1,this.isSetNotice=!1,this.info={avatar:null,nickname:null,qr_code:null,cover:null},this.star_time=null,this.end=null,this.PosterData={},this.posterImg=[],this.base64Datas=[],this.loadingImg=!0},getData:function(){var t=this;$http.post("plugin.room.frontend.live-list.room-notice",{id:this.$route.params.id},"").then((function(e){if(1===e.result){t.info=e.data;var i={};if(t.fun.getKey("f")&&"cps"==t.fun.getKey("f")&&(i.f="cps"),3==e.data.status)return Object(n["a"])("已开播,正在为您跳至直播间!"),i.shareType="livePlay",i.room_id=t.$route.params.id,void t.$router.push(t.fun.getUrl("livePage",{},i));if(4==e.data.status)return Object(n["a"])("直播已结束,正在为您跳至主播页面!"),void t.$router.push(t.fun.getUrl("anchorDetail",{id:t.info.anchor_member_id}));t.end=e.data.live_time,t.isSetNotice=1==e.data.notice,t.countdown(),t.fun.wxShare("",{},{title:t.PosterData.nickname,imgUrl:t.PosterData.cover,description:"邀请您进入直播间"}),t.pollStautsTimer=setInterval((function(){t.pollingLiveStatus()}),15e3)}else Object(n["a"])(e.msg)})).catch((function(t){}))},getPoster:function(){var t=this;$http.post("plugin.room.frontend.live-list.room-post",{id:this.$route.params.id,shareType:"foreshow"},"").then((function(e){1===e.result?(t.PosterData=e.data,t.posterImg.push(t.PosterData.shop_logo,t.PosterData.cover,t.info.avatar,t.PosterData.m_avatar,t.PosterData.qr_code),t.loop()):Object(n["a"])(e.msg)})).catch((function(t){}))},loop:function(){var t=this;return Object(r["a"])(Object(s["a"])().mark((function e(){var i,a;return Object(s["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:i=t,a=0;case 2:if(!(a<i.posterImg.length)){e.next=8;break}return e.next=5,i.onloadImg(i.posterImg[a],a);case 5:a++,e.next=2;break;case 8:t.$nextTick((function(){setTimeout((function(){i.saveImg()}),1e3),setTimeout((function(){i.loadingImg=!1}),3e3)}));case 9:case"end":return e.stop()}}),e)})))()},onloadImg:function(t,e,i){var a=this;return new Promise((function(e,i){var o=new Image;o.setAttribute("crossOrigin","anonymous");var s=t;o.src="".concat(s,"?").concat(Date.now());var r=a;o.onload=function(){var t=document.createElement("canvas");t.width=o.width,t.height=o.height;var i=t.getContext("2d");i.drawImage(o,0,0,o.width,o.height);var a=.8,s=t.toDataURL("image/png",a);r.base64Datas.push(s),e()},o.onerror=function(){r.base64Datas.push(""),e()}}))},showPoster:function(){var t=this;!this.loadingImg&&this.dataURL?this.show=!0:(Object(n["a"])("正在为您生成海报中..."),setTimeout((function(){t.show=!0}),1800))},cancelNotice:function(){var t=this;$http.post("plugin.room.frontend.live-list.cancel-notice",{id:this.$route.params.id},"").then((function(e){1===e.result?(Object(n["a"])("已取消开播提醒"),t.isSetNotice=!1):Object(n["a"])(e.msg)})).catch((function(t){}))},showToast:function(){var t=this;$http.post("plugin.room.frontend.live-list.play-notice",{id:this.$route.params.id},"").then((function(e){1===e.result?(Object(n["a"])("提醒成功"),t.isSetNotice=!0):Object(n["a"])(e.msg)})).catch((function(t){}))},shareMessage:function(){this.$dialog.alert({message:"请生成海报或点击右上角分享"})},saveImg:function(){this.dataURL=null;var t=document.getElementById("code_box"),e=this;l()(t,{useCORS:!0,backgroundColor:null}).then((function(t){e.dataURL=t.toDataURL("image/png"),document.getElementById("thecanvas").setAttribute("src",e.dataURL)}))},comeLive:function(){var t={};this.fun.getKey("f")&&"cps"==this.fun.getKey("f")&&(t.f="cps"),t.shareType="livePlay",t.room_id=this.$route.params.id,this.$router.push(this.fun.getUrl("livePage",{},t))},countdown:function(){var t=this,e=null;if(e=Date.parse(new Date)/1e3,this.end-e<=0)return this.stop=!0,void clearTimeout(d);var i=0;i=this.end-e;var a=parseInt(i/60/60/24),o=parseInt(i/60/60%24),s=parseInt(i/60%60),r=parseInt(i%60);a=a>9?a:"0"+a,o=o>9?o:"0"+o,s=s>9?s:"0"+s,r=r>9?r:"0"+r,this.Day=a,this.Hour=o,this.Min=s,this.Sec=r,d=setTimeout((function(){t.countdown()}),1e3)},gotoAnchor:function(){this.info.anchor_member_id&&this.$router.push(this.fun.getUrl("anchorDetail",{id:this.info.anchor_member_id}))},goto:function(){this.$router.push(this.fun.getUrl("liveList",{}))},pollingLiveStatus:function(){var t=this;return Object(r["a"])(Object(s["a"])().mark((function e(){var i,a,o;return Object(s["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,$http.get("plugin.room.frontend.live-list.room-notice",{id:t.$route.params.id},"");case 2:if(i=e.sent,a=i.result,i.msg,o=i.data,1!=a||3!=o.status){e.next=8;break}return e.abrupt("return",t.comeLive());case 8:case"end":return e.stop()}}),e)})))()}},computed:{nameEllipsis:function(){if(this.PosterData.m_nickname)return this.PosterData.m_nickname.length>4?this.PosterData.m_nickname.substring(0,4)+"...":this.PosterData.m_nickname}},components:{}},h=p,u=h,f=(i("9f75"),i("2877")),v=Object(f["a"])(u,a,o,!1,null,"014d639c",null);e["default"]=v.exports},"9f75":function(t,e,i){"use strict";i("4834")}}]);