"use strict";const t=require("../../common/vendor.js"),I=require("../../api/list.js"),u=require("../../api/live.js");require("../../api/order.js");const C=require("../../api/home.js"),h=require("../../common/assets.js");var L="wss://live.test.ylrztop.com/ws/live-api/app/webSocket",w=!1;const _={data(){return{socketInstances:{},currentSwiperIndex:0,preloadCount:5,list:[],preloading:!1,socketInstances:{},liveUserTotal:null,viewPageSize:10,viewPageNum:1,viewLoading:!1,viewNoMoreData:!1,scrollHeight:0,scrollTimer:null,socketInstance:null,reconnectCount:0,maxReconnectAttempts:3,isManualClose:!1,showRed:!0,redInfo:{},inputInfo:"",searchTimer:null,storeId:null,reconnectCount:0,maxReconnectAttempts:3,reconnectTimer:null,isCollect:!1,showPurchasePrompt:!1,purchasePromptTimer:null,prevOrderCount:0,videoUrl:null,showType:1,boxHeight:300,isFollow:!0,liveViewData:{},liveViewers:[],likeName:0,hlsPlayer:null,livingUrl:"",products:{},store:{},orderUser:{},userType:0,timestamp:"",liveId:null,placeholderText:"说点什么...",isZoom:!1,userinfo:"",value:"",talkdisabled:!1,autoplay:!1,showadd:!1,talklist:[],scrollIntoView:"",videoContext:"",thistime:t.index.$u.timeFormat(new Date,"yyyy-mm-dd hh:MM:ss"),showWelcomeMessage:!1,isSubmit:!1,messageContent:"",showziliao:!1,isScreen:!0,shopping:!1,scrollTop:0,old:{scrollTop:0},livedata:{}}},onLoad(e){this.userinfo=JSON.parse(t.index.getStorageSync("userInfo")),this.initLiveList(e)},onShareAppMessage(){return{title:this.livedata.liveName,path:"/pages/home/index",imageUrl:this.products.image,success(e){console.log("分享成功",e)},fail(e){console.error("分享失败",e)}}},computed:{filteredViewers(){if(this.liveViewers)return this.liveViewers.slice(0,3)}},mounted(){this.getliveViewData(),this.getliveOrder(),this.getliveUser(),this.initTime(),this.initSocket();var e=this;t.index.$on("initSocket",()=>{e.initSocket()}),t.index.$on("sendMsg",s=>{e.sendMsg(s)}),t.index.$on("closeWebSocket",()=>{e.closeWebSocket()}),this.getEWechatSdk(),this.getliving()},onHide(){clearInterval(this.intervalId)},onUnload(){this.closeAllWebSockets(),this.removeAllEventListeners(),this.clearAllTimers(),this.hlsPlayer&&(this.hlsPlayer.destroy(),this.hlsPlayer=null)},watch:{"orderUser.count":{handler(e,s){e!==this.prevOrderCount&&(this.prevOrderCount=e,this.showPurchaseMessage())},immediate:!0}},methods:{closeAllWebSockets(){this.isManualClose=!0,Object.keys(this.socketInstances).forEach(e=>{try{this.socketInstances[e]&&this.socketInstances[e].instance&&(this.socketInstances[e].instance.close({code:1e3,reason:"页面关闭"}),console.log(`直播间 ${e} WebSocket 已关闭`))}catch(s){console.error(`关闭直播间 ${e} WebSocket 时出错:`,s)}}),this.socketInstances={},w=!1},removeAllEventListeners(){t.index.$off("initSocket"),t.index.$off("sendMsg"),t.index.$off("closeWebSocket"),t.index.$off("refreshOrder")},clearAllTimers(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null),this.pingpangTimes&&(clearInterval(this.pingpangTimes),this.pingpangTimes=null),this.reconnectTimer&&(clearTimeout(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)},async initCurrentLiveData(){const e=this.list[this.currentSwiperIndex];if(e){(!this.socketInstances[e.liveId]||!this.socketInstances[e.liveId].isOpen)&&this.initSocket(e);try{await Promise.allSettled([this.getLiveMsg(e),this.getliveViewData(e),this.getliving(e),this.initSocket(e)]),e.loaded=!0}catch(s){console.error("初始化直播间数据失败:",s)}finally{e.loading=!1}}},async initLiveList(e){try{if(await this.getList(),this.list.length===0){console.error("直播间列表为空,无法初始化");return}if(e.liveId){const o=this.list.findIndex(l=>l.liveId==e.liveId);this.currentSwiperIndex=o!==-1?o:0}else this.currentSwiperIndex=0;const s=this.list[this.currentSwiperIndex];s&&(this.liveId=s.liveId,await this.getLiveMsg(s),await this.initCurrentLiveData(),this.preloadNearbyLives())}catch(s){console.error("初始化失败:",s)}},async preloadNearbyLives(){if(this.list.length===0){console.warn("list 为空,跳过预加载");return}this.preloading=!0;const e=[],s=this.currentSwiperIndex;s>0&&e.push(s-1),sthis.playVideo(n))}catch(a){console.error("切换直播间加载数据失败:",a)}}},async getList(){const e={page:1,page_size:20};try{const s=await I.liveList(e);s.code===200?(this.list=s.rows.map(o=>({...o,talklist:[],loading:!1,loaded:!1})),console.log("直播间列表加载成功,数量:",this.list.length)):(t.index.showToast({title:s.msg,icon:"none"}),this.list=[])}catch(s){console.error("获取直播间列表失败:",s),this.list=[]}},playVideo(e){if(!e){console.error("播放失败:直播间数据不存在");return}if(!e.livingUrl&&!e.videoUrl){console.error("播放失败:无视频源",e),e.loading=!0,this.getliving(e).then(()=>{e.loading=!1,this.$nextTick(()=>this.playVideo(e))});return}this.$nextTick(()=>{try{const s=`myVideo_${e.liveId}`,o=t.index.createVideoContext(s,this);o?o.play():console.error("未找到视频组件",s)}catch(s){console.error("播放视频失败:",s)}})},async preloadNearbyLives(){this.preloading=!0;const e=this.currentSwiperIndex,s=[];e>0&&s.push(e-1),e{this.getliveViewData()},60*1e3)},openViews(){this.$nextTick(()=>{t.index.createSelectorQuery().in(this).select(".view-box").boundingClientRect(s=>{s&&(this.scrollHeight=s.height-80-120)}).exec()})},resetLiveData(){const e={userinfo:this.userinfo,list:this.list,currentSwiperIndex:this.currentSwiperIndex};this.liveUserTotal=null,this.liveViewData={},this.liveViewers=[],this.livingUrl="",this.videoUrl=null,this.products={},this.store={},this.orderUser={},this.talklist=[],this.livedata={},this.isFollow=!0,Object.assign(this,e)},async getliveUser(e=!1){const s=this.liveId;if(s&&!(this.viewLoading||this.viewNoMoreData)){this.viewLoading=!0;try{const o=await u.watchUserList(s,this.viewPageSize,this.viewPageNum,!1);if(o.code===200){if(this.liveId!==s)return;if(this.liveUserTotal=o.total,o.rows.length===0){this.viewNoMoreData=!0;return}this.liveViewers=e?[...this.liveViewers,...o.rows]:o.rows,this.viewPageNum++}}catch(o){console.error("获取观众列表失败:",o)}finally{this.viewLoading=!1}}},handleScrollToLower(){this.scrollTimer&&clearTimeout(this.scrollTimer),this.scrollTimer=setTimeout(()=>{this.getliveUser(!0)},1e3)},async getLiveMsg(e){if(!e||!e.liveId){console.error("getLiveMsg 错误:无效的 liveItem",{liveItem:e,currentIndex:this.currentSwiperIndex,listLength:this.list.length});return}try{const s=await u.liveMsg(e.liveId,30,1);s.code==200&&(this.$set(e,"talklist",[...s.rows]),this.$nextTick(()=>{this.$set(e,"scrollIntoView",`list_${e.talklist.length-1}`)}))}catch(s){console.error("获取聊天记录失败:",s)}},pauseVideo(e){if(!(!e.livingUrl&&!e.videoUrl))try{const s=`myVideo_${e.liveId}`,o=t.index.createVideoContext(s,this);o&&o.pause()}catch(s){console.error("暂停视频失败:",s)}},onRed(){var s;if(console.log("点了"),!this.liveId||(console.log("点了this.liveId",this.liveId),!((s=this.redInfo)!=null&&s.redId)))return;console.log("点了this.redInfo?.redId",this.redInfo.redId),console.log("点了this.userinfo.userId",this.userinfo.userId);let e={liveId:this.liveId,userId:this.userinfo.userId,redId:this.redInfo.redId};u.liveRed(e).then(o=>{o.code==200||t.index.showToast({title:o.msg,icon:"none"})},o=>{})},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(e,s){return e.length>s?e.slice(0,s)+"...":e},goStore(){console.log("带过去storeId",this.storeId),t.index.navigateTo({url:"/pages_shop/store?liveId="+this.liveId+"&storeId="+this.storeId})},goOrderList(){t.index.navigateTo({url:"/pages_shop/order"})},initHlsPlayer(){if(t.Hls.isSupported()&&this.livingUrl){const e=document.getElementById("myVideo");e&&(this.hlsPlayer=new t.Hls,this.hlsPlayer.loadSource(this.livingUrl),this.hlsPlayer.attachMedia(e),this.hlsPlayer.on(t.Hls.Events.MANIFEST_PARSED,()=>{e.play()}))}},videoError(e){console.error("视频播放错误:",e.detail.errMsg),this.livingUrl&&setTimeout(()=>{this.videoContext.play()},2e3)},async getliving(e){if(!e||!e.liveId)return;console.log("获取直播信息:",e.liveId);const s={id:e.liveId};try{const o=await C.getlive(s);if(o.code!==200){t.index.showToast({title:o.msg,icon:"none"});return}o.data.liveType===2?(this.$set(e,"videoUrl",o.data.videoUrl),this.$set(e,"livingUrl","")):o.data.liveType===1?(this.$set(e,"livingUrl",o.data.flvHlsUrl),this.$set(e,"videoUrl","")):(this.$set(e,"livingUrl",""),this.$set(e,"videoUrl","")),this.$set(e,"showType",o.data.showType),this.$set(e,"storeId",o.storeId),this.$set(e,"autoplay",o.data.liveType!==0)}catch(o){console.error("获取直播信息失败:",o),t.index.showToast({title:"获取直播信息失败",icon:"none"})}},setupVideoPlayback(e,s){if(!e.livingUrl)return;const o=`myVideo_${e.liveId}`,l=t.index.createVideoContext(o,this);s.liveType===1?l.seek(s.nowDuration||0):l.play()},maskString(e,s="*"){return e?String(e).split("").map((l,n)=>n===0?l:s).join(""):""},getPureDecimal(e,s=6){const o=Math.abs(e).toFixed(s).split(".")[1];return(o==null?void 0:o.replace(/0+$/,""))||""},goBack(){const e=this.list[this.currentSwiperIndex];e&&this.pauseVideo(e),this.closeWebSocket(),getCurrentPages().length>1?t.index.navigateBack():t.index.switchTab({url:"/pages/list/index"})},async getliveViewData(e){if(!(!e||!e.liveId))try{const s=await u.getLiveViewData(e.liveId);s.code==200&&(e.liveViewData=s)}catch(s){console.error("获取直播间数据失败:",s)}},async getliveOrder(){const e=this.liveId;if(e)try{const s=await u.liveOrderUser(e);if(s.code===200){const o=this.list[this.currentSwiperIndex];o&&(this.$set(o,"orderUser",s),this.orderUser=s)}}catch(s){console.error("获取正在购买用户失败:",s)}},getLiveinformation(){this.liveId&&u.getLiveInfo(this.liveId).then(e=>{e.code==200?(console.log("获取直播间信息接口>>>>",e),this.livingUrl=e.livingUrl):t.index.showToast({title:e.msg,icon:"none"})},e=>{})},async onLike(e){if(!(!e||!e.liveId))try{(await u.liveDataLike(e.liveId)).code===200&&e.liveViewData&&e.liveViewData.like++}catch(s){console.error("点赞失败:",s)}},goShop(e,s){t.index.navigateTo({url:"/pages_shop/goods?productId="+e+"&liveId="+this.liveId+"&goodsId="+s+"&storeId="+this.storeId})},async queryCollect(){const e=this.list[this.currentSwiperIndex];if(!e||!e.liveId)return;const{storeId:s}=e;if(s)try{const o=await u.store(e.storeId,e.inputInfo);o.code===200&&(this.$set(e,"products",o.data.goodsList),this.$set(e,"store",o.data),this.products=o.data.goodsList,this.store=o.data)}catch(o){console.error("获取小黄车商品失败:",o)}},onStoreCollect(){this.storeId&&u.collectStore(this.storeId).then(e=>{e.code==200?(t.index.showToast({title:e.msg,icon:"none"}),this.store.isFavorite=!this.store.isFavorite):t.index.showToast({title:e.msg,icon:"none"})},e=>{})},onGoodsCollect(e){!e||e.length===0||!e.goodsId||u.collectGoods(e.goodsId).then(s=>{s.code==200?(t.index.showToast({title:s.msg,icon:"none"}),e.isFavorite=!e.isFavorite):t.index.showToast({title:s.msg,icon:"none"})},s=>{})},async onFollow(e){if(!(!e||!e.liveId))try{const s=await u.follow(e.liveId);e.isFollow=!e.isFollow,t.index.showToast({title:s.msg,icon:"none"})}catch(s){console.error("关注操作失败:",s)}},initTime(){const e=new Date;this.timestamp=e.getTime()},lowerChat:function(e){console.log(e)},scroll:function(e){console.log(e),this.old.scrollTop=e.detail.scrollTop},loadmore(){},openShop(){},openViews(){this.$nextTick(()=>{t.index.createSelectorQuery().in(this).select(".view-box").boundingClientRect(s=>{s&&(this.scrollHeight=s.height-80-120)}).exec()})},close(){this.showadd=!this.showadd},closes(){this.showziliao=!this.showziliao},closest(){this.showAnswer=!this.showAnswer},closestred(){this.showAnswerred=!this.showAnswerred},closeanswer(){this.answerbtn=!this.answerbtn},closeShop(){this.shopping=!this.shopping},closeRed(){this.showRed=!this.showRed},handleTouchEnd(){this.isZoom=!1},getEWechatSdk(){},closeWebSocket(e=null){if(this.isManualClose=!0,clearInterval(this.pingpangTimes),clearTimeout(this.reconnectTimer),e){if(this.socketInstances[e]){try{t.index.closeSocket({instance:this.socketInstances[e]}),console.log(`直播间 ${e} WebSocket 已安全关闭`)}catch(s){console.error("关闭 WebSocket 时出错:",s)}delete this.socketInstances[e]}}else Object.keys(this.socketInstances).forEach(s=>{try{t.index.closeSocket({instance:this.socketInstances[s]}),console.log(`直播间 ${s} WebSocket 已安全关闭`)}catch(o){console.error("关闭 WebSocket 时出错:",o)}}),this.socketInstances={};w=!1},reConnect(){var e=this;try{t.index.closeSocket()}catch{}setTimeout(function(){e.initSocket()},1e4)},startHeartbeat(){clearInterval(this.pingpangTimes),this.pingpangTimes=setInterval(()=>{if(!w)return;const e={cmd:"ping",timestamp:Date.now()};t.index.sendSocketMessage({data:JSON.stringify(e),success:()=>console.debug("心跳发送成功"),fail:s=>{console.error("心跳发送失败:",s),this.scheduleReconnect()}})},3e4)},initSocket(e){var l;if(!e||!e.liveId)return;const s=e.liveId;if(this.currentSwiperIndex!==this.list.findIndex(n=>n.liveId===s)){console.log(`不初始化非当前直播间 ${s} 的WebSocket`);return}if(this.socketInstances[s]&&this.closeWebSocket(s),(l=this.socketInstances[s])!=null&&l.isOpen||this.reconnectCount>=this.maxReconnectAttempts)return;this.isManualClose=!1;const o=t.CryptoJS.HmacSHA256(`${s}${this.userinfo.userId}${this.userType}${this.timestamp}`,this.timestamp.toString()).toString(t.CryptoJS.enc.Hex);this.socketInstances[s]={instance:null,isOpen:!1};try{const n=t.index.connectSocket({url:`${L}?userId=${this.userinfo.userId}&liveId=${s}&userType=${this.userType}×tamp=${this.timestamp}&signature=${o}`,success:()=>{this.socketInstances[s].instance=n,this.setupSocketListeners(s)},fail:a=>{console.error("WebSocket 连接失败:",a),this.scheduleReconnect(s)}})}catch(n){console.error("创建 WebSocket 异常:",n),this.scheduleReconnect(s)}},setupSocketListeners(e){const s=this.socketInstances[e];if(!s||!s.instance)return;const o=s.instance;o.onOpen(()=>{s.isOpen=!0,this.reconnectCount=0,console.log(`直播间 ${e} WebSocket 连接成功`),this.startHeartbeat(e)}),o.onClose(()=>{s.isOpen=!1,console.log(`直播间 ${e} WebSocket 连接关闭`),this.isManualClose||this.scheduleReconnect(e)}),o.onMessage(l=>{try{const n=JSON.parse(l.data),a=this.list.find(i=>i.liveId===e);a&&(a.talklist.push(n.data),this.$nextTick(()=>{a.scrollIntoView=`list_${a.talklist.length-1}`}),this.handleSocketMessage(n.data,a))}catch(n){console.error("解析消息失败:",n)}})},handleSocketMessage(e,s){if(e.cmd=="red")s.redInfo=JSON.parse(e.data);else if(e.cmd=="sendRedPacketQuestion")JSON.parse(e.data);else if(e.cmd=="entry")s.showWelcomeMessage=!0,setTimeout(()=>{s.showWelcomeMessage=!1},1e3);else if(redata.data.cmd!="live_start"){if(redata.data.cmd!="live_end"){if(redata.data.cmd=="deleteId")t.index.$emit("deleteId");else if(redata.data.cmd=="sendRedPacketQuestion"){const o=JSON.parse(redata.data.data);s.redanswerAll=[...s.redanswerAll,...o],s.redanswerAll[1].randomAmount!==null&&(s.redanswertips=JSON.parse(s.redanswerAll[0].randomAmount))}}}},scheduleReconnect(){if(this.isManualClose||this.reconnectCount>=this.maxReconnectAttempts)return;this.reconnectCount++;const e=Math.min(3e3*this.reconnectCount,3e4);console.log(`将在 ${e}ms 后重连 (尝试 ${this.reconnectCount}/${this.maxReconnectAttempts})`),this.reconnectTimer=setTimeout(()=>{this.initSocket()},e)},sendMsg(e){if(!e||!e.liveId)return;const s=e.liveId,o=this.socketInstances[s];if(!o||!o.instance||!o.isOpen){this.initSocket(e),t.index.showToast({title:"连接未建立,正在重试...",icon:"none"}),setTimeout(()=>{this.sendMsg(e)},3e3);return}const l={liveId:s,userId:this.userinfo.userId,userType:0,cmd:"sendMsg",msg:e.value,nickName:this.userinfo.nickName,avatar:this.userinfo.avatar};if(!e.value.trim()){t.index.showToast({title:"不能发送空消息",icon:"none"});return}o.instance.send({data:JSON.stringify(l),success:()=>{console.log("发送成功"),e.value=""},fail:n=>{console.error("发送失败:",n),t.index.showToast({title:"发送失败,请重试",icon:"none"})}})}}};if(!Array){const e=t.resolveComponent("u-avatar"),s=t.resolveComponent("u-loading"),o=t.resolveComponent("u-input"),l=t.resolveComponent("u-popup");(e+s+o+l)()}const U=()=>"../../uni_modules/uview-plus/components/u-avatar/u-avatar.js",b=()=>"../../uni_modules/uview-plus/components/u-input/u-input.js",V=()=>"../../uni_modules/uview-plus/components/u-popup/u-popup.js";Math||(U+b+V)();function M(e,s,o,l,n,a){return t.e({a:t.f(n.list,(i,p,d)=>{var v,S,k,y,T,x,m;return t.e({a:t.o((...r)=>a.goBack&&a.goBack(...r),i.liveId),b:"471975a0-0-"+d,c:t.p({src:i.liveImgUrl||e.$img.logo,size:"32"}),d:t.t(i.liveName?a.truncateString(i.liveName,5):"未命名"),e:t.t((v=i.liveViewData)!=null&&v.follow||((S=i.liveViewData)==null?void 0:S.follow)===0?i.liveViewData.follow:0),f:i.isFollow},i.isFollow?{g:t.o(r=>a.onFollow(i),i.liveId)}:{h:t.o(r=>a.onFollow(i),i.liveId)},{i:t.f(i.filteredViewers,(r,c,g)=>({a:c,b:r.avatar||e.$img.logo})),j:t.t(i.liveUserTotal||0),k:t.o(r=>n.showadd=!n.showadd,i.liveId),l:((k=i.redInfo)==null?void 0:k.redStatus)==1},((y=i.redInfo)==null?void 0:y.redStatus)==1?{m:t.o(r=>a.onRed(i),i.liveId),n:h._imports_1$1}:{},{o:t.o(r=>a.onLike(i),i.liveId),p:t.t(((T=i.liveViewData)==null?void 0:T.like)||0),q:t.o(r=>a.goStore(i),i.liveId),r:t.n(i.showType==1?"siderow-group":"side-group"),s:i.showPurchasePrompt&&((x=i.orderUser)==null?void 0:x.count)},i.showPurchasePrompt&&((m=i.orderUser)!=null&&m.count)?{t:h._imports_5,v:t.t(i.orderUser.userName?a.maskString(i.orderUser.userName):""),w:t.t(i.orderUser.count||0)}:{},{x:i.livingUrl},i.livingUrl?{y:"myVideo_"+i.liveId,z:t.n(i.showType==1?"video_row":"videotop"),A:i.livingUrl,B:n.currentSwiperIndex===p,C:t.o((...r)=>a.videoError&&a.videoError(...r),i.liveId)}:{},{D:i.videoUrl},i.videoUrl?{E:t.n(i.showType==1?"video_row":"videotop"),F:i.videoUrl,G:n.currentSwiperIndex===p,H:t.o((...r)=>a.videoError&&a.videoError(...r),i.liveId)}:{},{I:i.loading},i.loading?{J:"471975a0-1-"+d,K:t.p({mode:"circle",color:"#ffffff",size:"36"})}:{},{L:t.f(i.talklist,(r,c,g)=>({a:t.t(r.msg),b:c,c:r.cmd=="announcement"})),M:t.t(i.messageContent),N:t.f(i.talklist,(r,c,g)=>({a:t.t(r.nickName),b:t.t(r.msg),c,d:`list_${c}`,e:r.cmd!="red"&&r.cmd!="out"&&r.cmd!="entry"})),O:i.showWelcomeMessage},i.showWelcomeMessage?{P:t.f(i.talklist,(r,c,g)=>({a:t.t(r.nickName),b:t.t(r.msg),c,d:r.cmd=="entry"||r.cmd=="out"})),Q:t.t(i.messageContent)}:{},{R:i.scrollIntoView,S:t.o(r=>a.sendMsg(i),i.liveId),T:t.o(r=>a.sendMsg(i),i.liveId),U:"471975a0-2-"+d,V:t.o(r=>i.value=r,i.liveId),W:t.p({placeholder:i.placeholderText,border:"none",customStyle:"font-size:24rpx;",shape:"circle",color:"#fff",placeholderStyle:"color:#e7e7e7",modelValue:i.value}),X:t.o(r=>i.shopping=!i.shopping,i.liveId),Y:t.o(r=>i.showziliao=!i.showziliao,i.liveId),Z:t.f(n.liveViewers,(r,c,g)=>({a:t.t(c+1),b:c===0?"#FF3B30":c===1?"#FF9500":c===2?"#FFCC00":"#8E8E93",c:c<3?"bold":"normal",d:"471975a0-4-"+d+"-"+g+","+("471975a0-3-"+d),e:t.p({src:r.avatar||e.$img.logo,size:"32"}),f:t.t(r.nickName||"未命名"),g:c}))},n.viewNoMoreData&&n.liveViewers.length>0?{}:{},{aa:t.o((...r)=>a.handleScrollToLower&&a.handleScrollToLower(...r),i.liveId),ab:"471975a0-5-"+d+","+("471975a0-3-"+d),ac:t.o(a.close,i.liveId),ad:t.o(a.openViews,i.liveId),ae:"471975a0-3-"+d,af:"471975a0-7-"+d+","+("471975a0-6-"+d),ag:t.o([r=>n.inputInfo=r.detail.value,(...r)=>a.handleSearchInput&&a.handleSearchInput(...r)],i.liveId)},n.store.isFavorite?{ah:t.o((...r)=>a.onStoreCollect&&a.onStoreCollect(...r),i.liveId),ai:h._imports_12}:{aj:t.o((...r)=>a.onStoreCollect&&a.onStoreCollect(...r),i.liveId),ak:h._imports_13},{al:t.o((...r)=>a.goOrderList&&a.goOrderList(...r),i.liveId),am:t.f(n.products,(r,c,g)=>t.e({a:r.imgUrl,b:t.t(c+1),c:t.t(r.productName),d:t.t(r.sales),e:t.t(Math.trunc(r.price)),f:t.t(a.getPureDecimal(r.price)?a.getPureDecimal(r.price):"00"),g:r.isFavorite},r.isFavorite?{h:t.o(f=>a.onGoodsCollect(r),c),i:h._imports_12}:{j:t.o(f=>a.onGoodsCollect(r),c),k:h._imports_13},{l:r.status==1},r.status==1?{m:t.o(f=>a.goShop(r.productId,r.goodsId),c)}:r.status==0?{o:t.o(f=>a.goShop(r.productId),c)}:{},{n:r.status==0,p:c})),an:t.o(a.closeShop,i.liveId),ao:t.o(a.openShop,i.liveId),ap:"471975a0-6-"+d,aq:n.currentSwiperIndex===p?1:"",ar:i.liveId})}),b:h._imports_0$1,c:h._imports_2,d:h._imports_3,e:h._imports_4,f:h._imports_6,g:h._imports_7,h:n.viewNoMoreData&&n.liveViewers.length>0,i:n.scrollHeight+"px",j:t.p({src:n.livedata.liveImgUrl||e.$img.logo,size:"32"}),k:t.t(n.livedata.liveName||"未命名"),l:t.p({show:n.showadd,round:"20rpx",bgColor:"#ffffff"}),m:t.p({src:n.store.logoUrl,size:"36"}),n:h._imports_1,o:n.inputInfo,p:n.store.isFavorite,q:h._imports_11,r:n.boxHeight+"px",s:t.p({show:n.shopping,round:"20rpx",bgColor:"f3f5f9"}),t:n.currentSwiperIndex,v:t.o((...i)=>a.onSwiperChange&&a.onSwiperChange(...i)),w:n.preloading},n.preloading?{x:t.p({mode:"circle",color:"#ffffff",size:"28"})}:{})}const P=t._export_sfc(_,[["render",M],["__scopeId","data-v-471975a0"]]);_.__runtimeHooks=2;wx.createPage(P);