living.js 23 KB

12
  1. "use strict";const e=require("../../common/vendor.js"),d=require("../../api/live.js");require("../../api/order.js");const x=require("../../api/home.js"),h=require("../../common/assets.js"),C=()=>"../../components/ThreeItemSwiper.js";var P="wss://live.test.ylrztop.com/ws/live-api/app/webSocket";const S={components:{ThreeItemSwiper:C},data(){return{videoCurrentTime:0,isVideoPlaying:!1,videoProgressKey:"",inAndOut:{},isShowPrize:!1,prizeInfo:[],timeData:{},lotteryTime:0,lotteryProducts:[],lotteryList:[],talklist:{},isShowLotteryPop:!1,liveItem:{},isSending:!1,welcomeTimer:null,redTimer:null,lotteryTimer:null,isShowLottery:!1,isShowRedCard:!1,redCard:null,integral:{},lotteryInfo:{},goodsCard:{},redInfo:{},storeId:null,isFocus:!1,shopping:!1,inputInfo:"",showWelcomeMessage:!1,scrollIntoView:"",isShowGoods:!1,isShowRed:!1,lastClickTime:0,clickDelay:300,videoRetryCounts:{},placeholderText:"说点什么...",liveUserTotal:null,viewPageSize:10,viewPageNum:1,viewLoading:!1,viewNoMoreData:!1,scrollHeight:0,scrollTimer:null,socketInstance:null,reconnectCount:0,maxReconnectAttempts:3,isManualClose:!1,showRed:!0,searchTimer:null,reconnectTimer:null,isCollect:!1,showPurchasePrompt:!1,purchasePromptTimer:null,prevOrderCount:0,videoUrl:null,showType:1,boxHeight:300,liveViewers:[],likeName:0,hlsPlayer:null,livingUrl:"",products:{},store:{},orderUser:{},userType:0,timestamp:"",liveId:null,userinfo:"",value:"",talkdisabled:!1,autoplay:!1,showadd:!1,videoContext:"",livedata:{}}},onLoad(i){if(this.initTime(),e.index.__f__("log","at pages/home/living.vue:551",i),i.liveId&&(this.liveId=i.liveId),this.userinfo=JSON.parse(e.index.getStorageSync("userInfo")),this.liveId==null){e.index.showToast({title:"未知错误,请联系管理员!",icon:"none"});return}e.index.__f__("log","at pages/home/living.vue:563",this.liveId),this.getliving(this.liveId),this.initSocket();const t=e.index.getWindowInfo().platform;["mp-weixin","mp-alipay","mp-baidu","mp-toutiao"].includes(t)&&(e.index.showShareMenu?e.index.showShareMenu({withShareTicket:!0,success:()=>{e.index.__f__("log","at pages/home/living.vue:577","分享菜单显示成功")},fail:l=>{e.index.__f__("error","at pages/home/living.vue:580","分享菜单显示失败:",l)}}):e.index.__f__("warn","at pages/home/living.vue:584","当前平台不支持 uni.showShareMenu"))},onReady(){},onShareAppMessage(){return{title:this.livedata.liveName,path:"/pages/home/living",imageUrl:this.products.image,success(i){e.index.__f__("log","at pages/home/living.vue:595","分享成功",i)},fail(i){e.index.__f__("error","at pages/home/living.vue:598","分享失败",i)}}},computed:{filteredViewers(){return!Array.isArray(this.liveViewers)||this.liveViewers.length===0?[]:this.liveViewers.slice(0,3)}},onHide(){this.saveVideoProgress();const i=this.liveItem;i&&(this.pauseVideo(i),this.clearTimeTimer(i)),this.closeAllWebSockets(),this.lotteryList&&this.clearTimeTimer(this.lotteryList)},mounted(){this.getCurrentActivities(),this.getliveOrder()},onUnload(){this.saveVideoProgress(),this.redTimer&&(clearInterval(this.redTimer),this.redTimer=null),this.lotteryTimer&&(clearInterval(this.lotteryTimer),this.lotteryTimer=null),this.welcomeTimer&&(clearInterval(this.welcomeTimer),this.welcomeTimer=null),this.closeWebSocket(),this.removeAllEventListeners(),this.clearAllTimers(),this.hlsPlayer&&(this.hlsPlayer.destroy(),this.hlsPlayer=null),this.removeAllEventListeners(),this.clearAllTimers(),this.hlsPlayer&&(this.hlsPlayer.destroy(),this.hlsPlayer=null);const i=`myVideo_${this.liveId}`,t=e.index.createVideoContext(i,this);t&&t.pause()},watch:{"orderUser.count":{handler(i,t){i!==this.prevOrderCount&&(this.prevOrderCount=i,this.showPurchaseMessage())},immediate:!0}},methods:{onVideoMetaLoaded(i){this.videoProgressKey=`videoProgress_${this.liveId}`,e.index.getStorage({key:this.videoProgressKey,success:t=>{this.videoCurrentTime=t.data,this.setVideoCurrentTime(this.videoCurrentTime)},fail:t=>{e.index.__f__("log","at pages/home/living.vue:716","没有找到保存的播放进度或获取失败",t),this.videoCurrentTime=0}})},onVideoLoaded(i){e.index.__f__("log","at pages/home/living.vue:724","视频数据加载完成")},onVideoTimeUpdate(i){this.videoCurrentTime=i.detail.currentTime,Math.floor(this.videoCurrentTime)%5===0&&this.saveVideoProgress()},onVideoPause(i){this.isVideoPlaying=!1,this.saveVideoProgress()},onVideoPlay(i){this.isVideoPlaying=!0},setVideoCurrentTime(i){const t=`myVideo_${this.liveId}`,l=e.index.createVideoContext(t,this);l&&l.seek(i)},saveVideoProgress(){this.videoProgressKey&&e.index.setStorage({key:this.videoProgressKey,data:this.videoCurrentTime,success:()=>{},fail:i=>{e.index.__f__("error","at pages/home/living.vue:769","保存视频进度失败:",i)}})},onChange(i){this.timeData=i},onClaim(){let i={liveId:this.liveId,lotteryId:this.lotteryInfo.lotteryId};d.claim(i).then(t=>{t.code==200?(e.index.showToast({title:t.msg,icon:"none"}),this.isShowLotteryPop=!1):e.index.showToast({title:t.msg,icon:"none"})},t=>{})},onLottery(){if(this.lotteryTimer&&(clearInterval(this.lotteryTimer),this.lotteryTimer=null),!this.lotteryInfo)return;let i={lotteryId:this.lotteryInfo.lotteryId};d.liveLottery(i).then(t=>{this.isShowLotteryPop=!0,t.code==200?(this.lotteryList=t.data,this.lotteryProducts=t.data.products):e.index.showToast({title:t.msg,icon:"none"})},t=>{})},onGoodsCollect(i){e.index.__f__("log","at pages/home/living.vue:842","商品收藏",i),!(!i||i.length===0||!i.goodsId)&&d.collectGoods(i.goodsId).then(t=>{t.code==200?(e.index.showToast({title:t.msg,icon:"none"}),i.isFavorite=!i.isFavorite):e.index.showToast({title:t.msg,icon:"none"})},t=>{})},inputFocus(){this.isFocus=!0},inputBlur(){this.isFocus=!1},getliveOrder(i){this.liveId&&d.liveOrderUser(this.liveId).then(t=>{e.index.__f__("log","at pages/home/living.vue:877","正在购买",t),t.code==200?this.orderUser=t:e.index.__f__("error","at pages/home/living.vue:881","获取正在购买用户失败:",error)},t=>{})},onLiveStateChange(i,t){i.detail.code},onLiveError(i,t){this.videoError(i,t)},getCurrentActivities(){this.liveId&&d.currentActivities(this.liveId).then(i=>{var t;i.code==200?(i.red&&(this.redInfo=i.red[0]),i.lottery&&(this.lotteryInfo=i.lottery[0]),this.goodsCard=i.goods,this.lotteryTime=((t=this.lotteryInfo)==null?void 0:t.duration)*60*1e3,this.goodsCard&&this.goodsCard.status==1?this.isShowGoods=!0:this.isShowGoods=!1,this.redInfo&&this.redInfo.redStatus==1?this.isShowRed=!0:this.isShowRed=!1,this.lotteryInfo&&this.lotteryInfo.lotteryStatus==1?this.isShowLottery=!0:this.isShowLottery=!1):e.index.showToast({title:i.msg,icon:"none"})},i=>{})},calculateTimeDiff(i,t=""){if(!i)return;let l="";if(l=i||"",!l){t==="lottery"||this.$set(this.liveItem,"totalTime","00:00:00");return}const n=l.replace(/-/g,"/"),s=new Date(n);if(isNaN(s.getTime())){t==="lottery"?this.lotteryTime={hours:"00",minutes:"00",seconds:"00"}:this.$set(this.liveItem,"totalTime","00:00:00"),e.index.__f__("warn","at pages/home/living.vue:998","时间解析失败,原始格式:",l);return}const r=new Date;let u=0;t==="lottery"?u=Math.max(0,s-r):u=Math.max(0,r-s);const v=Math.floor(u/1e3),m=this.padZero(Math.floor(v/3600)),f=this.padZero(Math.floor(v%3600/60)),g=this.padZero(v%60);t==="lottery"||this.$set(this.liveItem,"totalTime",`${m}:${f}:${g}`)},padZero(i){return i<10?`0${i}`:i},startTimeTimer(i,t=""){i&&(t==="lottery"?(this.calculateTimeDiff(i.updateTime,"lottery"),i.timeTimer=setInterval(()=>{this.calculateTimeDiff(i.updateTime,"lottery")},1e3)):(this.calculateTimeDiff(i.startTime),i.timeTimer=setInterval(()=>{this.calculateTimeDiff(i.startTime)},1e3)))},clearTimeTimer(i){i.timeTimer&&(clearInterval(i.timeTimer),i.timeTimer=null)},toggleViewerList(){const i=Date.now();i-this.lastClickTime>this.clickDelay&&(this.showadd=!this.showadd,this.lastClickTime=i)},closeAllWebSockets(){this.isManualClose=!0},removeAllEventListeners(){e.index.$off("initSocket"),e.index.$off("sendMsg"),e.index.$off("closeWebSocket"),e.index.$off("refreshOrder")},clearAllTimers(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null),this.pingpangTimes&&(clearInterval(this.pingpangTimes),this.pingpangTimes=null),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null),this.scrollTimer&&(clearTimeout(this.scrollTimer),this.scrollTimer=null),this.searchTimer&&(clearTimeout(this.searchTimer),this.searchTimer=null),this.purchasePromptTimer&&(clearTimeout(this.purchasePromptTimer),this.purchasePromptTimer=null)},playVideo(i){if(i)try{if(i.liveType===1&&i.livingUrl){const t=`myLivePlayer_${this.liveId}`,l=e.index.createLivePlayerContext(t,this);l&&l.play()}else if(i.liveType===2&&i.videoUrl){const t=`myVideo_${this.liveId}`,l=e.index.createVideoContext(t,this);l&&l.pause(()=>{l.play()})}else if(i.liveType===3&&i.videoUrl){const t=`myVideo_${this.liveId}`,l=e.index.createVideoContext(t,this);l&&l.pause(()=>{l.play()})}}catch(t){e.index.__f__("error","at pages/home/living.vue:1153","播放视频失败:",t)}},pauseVideo(i){if(i)try{if(i.liveType===1){const t=`myLivePlayer_${this.liveId}`,l=e.index.createLivePlayerContext(t,this);l&&l.pause()}else if(i.liveType===2){const t=`myVideo_${this.liveId}`,l=e.index.createVideoContext(t,this);l&&l.pause()}}catch(t){e.index.__f__("error","at pages/home/living.vue:1178","暂停视频失败:",t)}},openViews(){this.$nextTick(()=>{e.index.createSelectorQuery().in(this).select(".view-box").boundingClientRect(t=>{t&&(this.scrollHeight=t.height-80-120)}).exec()})},async getliveUser(i=!1){this.viewLoading=!0;try{const t=await d.watchUserList(this.liveId,this.viewPageSize,this.viewPageNum,!1);if(t.code===200){this.liveUserTotal=t.total||0;const l=Array.isArray(t.rows)?t.rows:[];this.liveViewers=i?[...this.liveViewers,...l]:l,this.viewPageNum++}}catch(t){e.index.__f__("error","at pages/home/living.vue:1211","获取观众列表失败:",t),this.liveViewers=[]}finally{this.viewLoading=!1}},handleScrollToLower(){this.scrollTimer&&clearTimeout(this.scrollTimer),this.scrollTimer=setTimeout(()=>{},1e3)},async getLiveMsg(i){if(!i||!this.liveId){e.index.__f__("error","at pages/home/living.vue:1233","getLiveMsg 错误:无效的 liveItem",{liveItem:i,currentIndex:this.currentSwiperIndex});return}try{const t=await d.liveMsg(this.liveId,30,1);if(t.code==200){const n=[...Array.isArray(t.rows)?t.rows:[]].reverse();this.talklist=n,this.$nextTick(()=>{this.scrollIntoView=`list_${n.length-1}`})}}catch(t){e.index.__f__("error","at pages/home/living.vue:1253","获取聊天记录失败:",t)}},onRed(){var t;if(!this.liveId||!((t=this.redInfo)!=null&&t.redId))return;this.redTimer&&(clearInterval(this.redTimer),this.redTimer=null);let i={liveId:this.liveId,userId:this.userinfo.userId,redId:this.redInfo.redId};d.liveRed(i).then(l=>{this.isShowRed=!1,this.redCard=l,this.isShowRedCard=!0},l=>{})},handleSearchInput(){clearTimeout(this.searchTimer),this.searchTimer=setTimeout(()=>{this.queryCollect()},500)},showPurchaseMessage(){this.purchasePromptTimer&&clearTimeout(this.purchasePromptTimer),this.showPurchasePrompt=!0,this.purchasePromptTimer=setTimeout(()=>{this.showPurchasePrompt=!1},2e3)},truncateString(i,t){return i.length>t?i.slice(0,t)+"...":i},goOrderList(){e.index.navigateTo({url:"/pages_shop/order"})},initHlsPlayer(){if(e.Hls.isSupported()&&this.livingUrl){const i=document.getElementById("myVideo");i&&(this.hlsPlayer=new e.Hls,this.hlsPlayer.loadSource(this.livingUrl),this.hlsPlayer.attachMedia(i),this.hlsPlayer.on(e.Hls.Events.MANIFEST_PARSED,()=>{i.play()}))}},videoError(i,t){if(!(!t||!this.liveId)){if(this.videoRetryCounts[t.liveId]===void 0&&(this.videoRetryCounts[t.liveId]=0),this.videoRetryCounts[t.liveId]>=3){e.index.__f__("error","at pages/home/living.vue:1338",`直播间 ${this.liveId} 视频加载失败,停止重试`),e.index.showToast({title:"视频加载失败,请检查网络",icon:"none",duration:2e3});return}this.videoRetryCounts[this.liveId]++,setTimeout(()=>{this.liveId===this.liveId&&(e.index.__f__("log","at pages/home/living.vue:1353",`第${this.videoRetryCounts[this.liveId]}次重试播放视频`),this.playVideo(t))},2e3)}},async getliving(i){const t={id:i};try{const l=await x.getlive(t);if(l.code!==200){e.index.showToast({title:l.msg,icon:"none"});return}this.liveItem=l.data,this.talklist=l.data.talklist,l.data.liveType===2?(this.$set(this.liveItem,"videoUrl",l.data.videoUrl),this.$set(this.liveItem,"livingUrl","")):l.data.liveType===1?(this.$set(this.liveItem,"livingUrl",l.data.flvHlsUrl),this.$set(this.liveItem,"videoUrl","")):(this.$set(this.liveItem,"livingUrl",""),this.$set(this.liveItem,"videoUrl","")),this.startTimeTimer(this.liveItem),await this.getLiveMsg(this.liveItem),await this.getliveViewData(this.liveItem),this.$set(this.liveItem,"autoplay",l.data.liveType!==0),this.$set(this.liveItem,"showType",l.data.showType),this.storeId=l.storeId}catch(l){e.index.__f__("error","at pages/home/living.vue:1402","获取直播信息失败:",l),e.index.showToast({title:"获取直播信息失败",icon:"none"})}},maskString(i,t="*"){return i?String(i).split("").map((n,s)=>s===0?n:t).join(""):""},getPureDecimal(i,t=6){const l=Math.abs(i).toFixed(t).split(".")[1];return(l==null?void 0:l.replace(/0+$/,""))||""},goBack(){const i=this.liveItem;i&&this.pauseVideo(i),this.closeWebSocket(),getCurrentPages().length>1?e.index.navigateBack():e.index.reLaunch({url:"/pages/list/index"})},async onLike(i){if(!(!i||!this.liveId))try{const t=await d.liveDataLike(this.liveId);t!=null&&t.like?i.liveViewData.like++:e.index.showToast({title:t.msg,icon:"none"})}catch(t){e.index.__f__("error","at pages/home/living.vue:1458","点赞失败:",t)}},async getliveViewData(i){if(!(!i||!this.liveId))try{const t=await d.getLiveViewData(this.liveId);t.code==200&&this.$set(i,"liveViewData",t)}catch(t){e.index.__f__("error","at pages/home/living.vue:1471","获取直播间数据失败:",t),this.$set(i,"liveViewData",{like:0,watchCount:0})}},goShop(i,t){this.liveId&&e.index.navigateTo({url:"/pages_shop/goods?productId="+i+"&liveId="+this.liveId+"&goodsId="+t+"&storeId="+this.storeId})},async queryCollect(){if(this.liveId){this.inputInfo==null&&(this.inputInfo="");try{const i=await d.liveStore(this.liveId,this.inputInfo);i.code===200&&(this.products=i.data)}catch(i){e.index.__f__("error","at pages/home/living.vue:1502","获取小黄车商品失败:",i)}}},initTime(){const i=new Date;this.timestamp=i.getTime()},openCart(){this.queryCollect(),this.shopping=!0},close(){this.showadd=!1},closeShop(){this.shopping=!1},getEWechatSdk(){},closeWebSocket(){var i;(i=this.socket)==null||i.close()},initSocket(){var t;if(!this.liveId||(t=this.userinfo)!=null&&t.userId)return;const i=e.CryptoJS.HmacSHA256(`${this.liveId}${this.userinfo.userId}${this.userType}${this.timestamp}`,this.timestamp.toString()).toString(e.CryptoJS.enc.Hex);try{const l=e.index.connectSocket({url:`${P}?userId=${this.userinfo.userId}&liveId=${this.liveId}&userType=${this.userType}&timestamp=${this.timestamp}&signature=${i}`,success:()=>{},fail:n=>{}});l.onOpen(n=>{this.socket=l}),l.onMessage(n=>{const s=this.liveItem;s&&this.handleSocketMessage(n,s)})}catch(l){e.index.__f__("error","at pages/home/living.vue:1575","创建 WebSocket 异常:",l)}},handleSocketMessage(i,t){let l=JSON.parse(i.data);const n=l.data;if(l.code==200){const s={...n,cmd:n.cmd||"",ts:Date.now()};if(n.cmd=="sendMsg"){const u=[...this.talklist||[],s];this.talklist=u,this.$nextTick(()=>{const v=this.talklist.length-1;this.scrollIntoView=`list_${v}`})}else if(n.cmd=="red")if(this.redInfo=JSON.parse(n.data),n.status==1){this.isShowRed=!0;let r=this.redInfo.duration;this.redTimer=setInterval(()=>{this.isShowRed=!1},r*6e4)}else this.isShowRed=!1;else if(n.cmd=="goods")this.goodsCard=JSON.parse(n.data),n.status==1?this.isShowGoods=!0:this.isShowGoods=!1;else if(n.cmd=="lottery")if(this.lotteryInfo=JSON.parse(n.data),n.status==1){this.isShowLottery=!0;let r=this.lotteryInfo.duration;this.lotteryTimer=setInterval(()=>{this.isShowLottery=!1},r*6e4),this.lotteryTime=r*60*1e3}else this.isShowLottery=!1;else n.cmd=="entry"||n.cmd=="out"?(this.inAndOut=n,this.showWelcomeMessage=!1,this.showWelcomeMessage=!0,this.getliveUser(!1),this.welcomeTimer&&clearTimeout(this.welcomeTimer),this.welcomeTimer=setTimeout(()=>{this.showWelcomeMessage=!1},1e3)):n.cmd=="Integral"?this.integral={msg:n.msg,status:!0}:n.cmd=="LotteryDetail"?(this.prizeInfo=JSON.parse(n.data),this.isShowPrize=!0,this.isShowLottery=!1):n.cmd=="blockUser"&&e.index.removeStorage({key:"AppToken",success:()=>{e.index.reLaunch({url:"/pages/auth/login"})}})}else e.index.showToast({title:l.msg,icon:"none"})},sendMsg(){if(!this.liveId||this.isSending)return;this.isSending=!0,setTimeout(()=>{this.isSending=!1},800);const i=(this.value||"").trim();if(!i){e.index.showToast({title:"不能发送空消息",icon:"none"});return}const t=this.liveId;this.socket,this.value="";const l={liveId:t,userId:this.userinfo.userId,userType:0,cmd:"sendMsg",msg:i,nickName:this.userinfo.nickName,avatar:this.userinfo.avatar};try{this.socket.send({data:JSON.stringify(l),success:()=>{},fail:n=>{e.index.showToast({title:n,icon:"none"}),this.value=i}})}catch{}}}};if(!Array){const i=e.resolveComponent("u-avatar"),t=e.resolveComponent("u-input"),l=e.resolveComponent("u-icon"),n=e.resolveComponent("u-count-down"),s=e.resolveComponent("ThreeItemSwiper"),r=e.resolveComponent("u-popup");(i+t+l+n+s+r)()}const V=()=>"../../uni_modules/uview-plus/components/u-avatar/u-avatar.js",L=()=>"../../uni_modules/uview-plus/components/u-input/u-input.js",k=()=>"../../uni_modules/uview-plus/components/u-icon/u-icon.js",U=()=>"../../uni_modules/uview-plus/components/u-count-down/u-count-down.js",b=()=>"../../uni_modules/uview-plus/components/u-popup/u-popup.js";Math||(V+L+k+U+b)();function M(i,t,l,n,s,r){var u,v,m,f,g,p,y,I,_,w;return e.e({a:e.o((...o)=>r.goBack&&r.goBack(...o)),b:h._imports_0$2,c:e.p({src:s.liveItem.liveImgUrl||i.$img.logo,size:"32"}),d:e.t(s.liveItem.liveName?r.truncateString(s.liveItem.liveName,8):"未命名"),e:Array.isArray(r.filteredViewers)},Array.isArray(r.filteredViewers)?{f:e.f(r.filteredViewers,(o,a,c)=>({a,b:o.avatar||i.$img.logo}))}:{},{g:e.t(s.liveUserTotal||0),h:e.o((...o)=>r.toggleViewerList&&r.toggleViewerList(...o)),i:e.o(o=>r.onLike(s.liveItem)),j:h._imports_1$3,k:e.t(((u=s.liveItem.liveViewData)==null?void 0:u.like)||0),l:h._imports_2,m:e.n(s.liveItem.showType==1?"siderow-group":"side-group"),n:s.isShowRed},s.isShowRed?{o:h._imports_3,p:e.o(o=>r.onRed())}:{},{q:s.isShowLottery},s.isShowLottery?{r:h._imports_4,s:e.o(o=>r.onLottery())}:{},{t:s.showPurchasePrompt&&((v=s.orderUser)==null?void 0:v.count)},s.showPurchasePrompt&&((m=s.orderUser)!=null&&m.count)?{v:h._imports_5,w:e.t(s.orderUser.userName?r.maskString(s.orderUser.userName):""),x:e.t(s.orderUser.count||0)}:{},{y:s.liveItem.livingUrl&&s.liveItem.liveType===1},s.liveItem.livingUrl&&s.liveItem.liveType===1?{z:"myLivePlayer_"+s.liveId,A:s.liveItem.livingUrl,B:e.o(o=>r.onLiveStateChange(o,s.liveItem)),C:e.o(o=>r.onLiveError(o,s.liveItem))}:{},{D:s.liveItem.videoUrl&&s.liveItem.liveType==2},s.liveItem.videoUrl&&s.liveItem.liveType==2?{E:`myVideo_${s.liveId}`,F:s.liveItem.videoUrl,G:e.o((...o)=>r.videoError&&r.videoError(...o)),H:e.o((...o)=>r.onVideoTimeUpdate&&r.onVideoTimeUpdate(...o)),I:e.o((...o)=>r.onVideoLoaded&&r.onVideoLoaded(...o)),J:e.o((...o)=>r.onVideoMetaLoaded&&r.onVideoMetaLoaded(...o)),K:e.o((...o)=>r.onVideoPause&&r.onVideoPause(...o)),L:e.o((...o)=>r.onVideoPlay&&r.onVideoPlay(...o))}:{},{M:s.liveItem.videoUrl&&s.liveItem.liveType==3},s.liveItem.videoUrl&&s.liveItem.liveType==3?{N:`myVideo_${s.liveId}`,O:s.liveItem.videoUrl,P:s.liveItem.isSpeedAllowed,Q:e.o((...o)=>r.videoError&&r.videoError(...o)),R:e.o((...o)=>r.onVideoTimeUpdate&&r.onVideoTimeUpdate(...o)),S:e.o((...o)=>r.onVideoLoaded&&r.onVideoLoaded(...o)),T:e.o((...o)=>r.onVideoMetaLoaded&&r.onVideoMetaLoaded(...o)),U:e.o((...o)=>r.onVideoPause&&r.onVideoPause(...o)),V:e.o((...o)=>r.onVideoPlay&&r.onVideoPlay(...o)),W:e.o((...o)=>i.onVideoSeek&&i.onVideoSeek(...o))}:{},{X:s.liveItem.videoUrl&&s.liveItem.liveType==2},s.liveItem.videoUrl&&s.liveItem.liveType==2?{Y:e.t(s.liveItem.totalTime)}:{},{Z:s.liveItem.videoUrl&&s.liveItem.liveType==3},s.liveItem.videoUrl&&s.liveItem.liveType==3?{}:{},{aa:e.n(s.liveItem.showType==1?"video_row":""),ab:e.f(s.talklist,(o,a,c)=>({a:e.t(o.nickName),b:e.t(o.msg),c:a,d:`list_${a}`,e:o.cmd!="red"&&o.cmd!="out"&&o.cmd!="entry"})),ac:s.showWelcomeMessage},s.showWelcomeMessage?{ad:e.t(s.inAndOut.nickName),ae:e.t(s.inAndOut.msg),af:e.t(s.liveItem.messageContent),ag:s.inAndOut.cmd=="entry"||s.inAndOut.cmd=="out"}:{},{ah:s.scrollIntoView,ai:e.o(r.inputFocus),aj:e.o(r.inputBlur),ak:e.o(o=>s.value=o),al:e.p({placeholder:s.placeholderText,border:"none",customStyle:"font-size:24rpx;",shape:"circle",color:"#fff",placeholderStyle:"color:#e7e7e7",modelValue:s.value}),am:e.o(o=>r.sendMsg()),an:h._imports_6,ao:e.o(o=>r.openCart()),ap:s.isShowGoods},s.isShowGoods?{aq:h._imports_7,ar:h._imports_8,as:e.o(o=>s.isShowGoods=!1),at:(f=s.goodsCard)==null?void 0:f.imgUrl,av:e.t((g=s.goodsCard)==null?void 0:g.price),aw:e.t((p=s.goodsCard)==null?void 0:p.otPrice),ax:e.t((y=s.goodsCard)==null?void 0:y.productName),ay:e.o(o=>{var a,c;return r.goShop((a=s.goodsCard)==null?void 0:a.productId,(c=s.goodsCard)==null?void 0:c.goodsId)})}:{},{az:h._imports_9,aA:h._imports_10,aB:e.o(o=>s.isShowLotteryPop=!1),aC:e.p({name:"close",color:"#fff",size:"20"}),aD:h._imports_11,aE:e.t(s.timeData.hours>10?s.timeData.hours:"0"+s.timeData.hours),aF:e.t(s.timeData.minutes),aG:e.t(s.timeData.seconds),aH:e.o(r.onChange),aI:e.p({time:s.lotteryTime||0,format:"DD:HH:mm:ss",autoStart:!0,millisecond:!0}),aJ:e.p({products:s.lotteryProducts}),aK:e.f(s.lotteryProducts,(o,a,c)=>({a})),aL:e.o((...o)=>r.onClaim&&r.onClaim(...o)),aM:e.o(o=>!s.isShowLotteryPop),aN:e.p({show:s.isShowLotteryPop,round:"40rpx"}),aO:h._imports_12,aP:e.t((I=s.integral)==null?void 0:I.msg),aQ:e.o(o=>s.integral.status=i.flase),aR:e.o(o=>{var a;return!((a=s.integral)!=null&&a.status)}),aS:e.p({show:(_=s.integral)==null?void 0:_.status,round:"20rpx",mode:"center",bgColor:"#ffffff",zIndex:"10076"}),aT:h._imports_13,aU:e.t((w=s.redCard)==null?void 0:w.msg),aV:e.o(o=>s.isShowRedCard=i.flase),aW:e.o(o=>!s.isShowRedCard),aX:e.p({show:s.isShowRedCard,round:"20rpx",mode:"center",bgColor:"transparent",zIndex:"10076"}),aY:e.t(s.prizeInfo.length),aZ:e.f(s.prizeInfo,(o,a,c)=>({a:e.t(o.userName),b:e.t(o.prizeLevel),c:a})),ba:e.o(o=>s.isShowPrize=i.flase),bb:e.o(o=>!s.isShowPrize),bc:e.p({show:s.isShowPrize,round:"20rpx",mode:"center",bgColor:"#fff",zIndex:"10076"}),bd:e.f(s.liveViewers,(o,a,c)=>({a:e.t(a+1),b:a===0?"#FF3B30":a===1?"#FF9500":a===2?"#FFCC00":"#8E8E93",c:a<3?"bold":"normal",d:"471975a0-10-"+c+",471975a0-9",e:e.p({src:o.avatar||i.$img.logo,size:"36"}),f:e.t(o.nickName||"未命名"),g:a})),be:s.scrollHeight+"px",bf:e.o((...o)=>r.handleScrollToLower&&r.handleScrollToLower(...o)),bg:e.o(r.close),bh:e.o(r.openViews),bi:e.p({show:s.showadd,round:"20rpx",bgColor:"#ffffff",zIndex:"10077"}),bj:h._imports_1$2,bk:e.o([o=>s.inputInfo=o.detail.value,(...o)=>r.handleSearchInput&&r.handleSearchInput(...o)]),bl:s.inputInfo,bm:h._imports_15,bn:e.o(o=>r.goOrderList(s.liveItem)),bo:e.f(s.products,(o,a,c)=>e.e({a:o.imgUrl,b:e.t(a+1),c:e.t(o.productName),d:e.t(o.sales),e:e.t(Math.trunc(o.price)),f:e.t(r.getPureDecimal(o.price)?r.getPureDecimal(o.price):"00"),g:o.isFavorite},o.isFavorite?{h:e.o(T=>r.onGoodsCollect(o),a),i:h._imports_16}:{j:e.o(T=>r.onGoodsCollect(o),a),k:h._imports_17},{l:o.status==1},o.status==1?{m:e.o(T=>r.goShop(o.productId,o.goodsId),a)}:o.status==0?{}:{},{n:o.status==0,o:a})),bp:s.boxHeight+"px",bq:e.o(r.closeShop),br:e.p({show:s.shopping,round:"20rpx",bgColor:"f3f5f9",zIndex:"10075"})})}const D=e._export_sfc(S,[["render",M],["__scopeId","data-v-471975a0"]]);S.__runtimeHooks=2;wx.createPage(D);
  2. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/home/living.js.map