"use strict";const t=require("../../common/vendor.js"),m=require("../../api/list.js"),d=require("../../api/live.js");require("../../api/order.js");const _=require("../../api/home.js"),h=require("../../common/assets.js");var I="ws://192.168.10.166:7114/app/webSocket",v=!1;const x={data(){return{swiperDuration:0,videoRetryCounts:{},socketInstances:{},currentSwiperIndex:0,list:[],preloading:!1,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,isZoom:!1,userinfo:"",value:"",talkdisabled:!1,autoplay:!1,showadd:!1,scrollIntoView:"",videoContext:"",thistime:t.index.$u.timeFormat(new Date,"yyyy-mm-dd hh:MM:ss"),isSubmit:!1,messageContent:"",showziliao:!1,isScreen:!0,scrollTop:0,old:{scrollTop:0},livedata:{}}},onLoad(e){this.initTime(),e.liveId&&(this.liveId=e.liveId),this.userinfo=JSON.parse(t.index.getStorageSync("userInfo")),this.initLiveList(e),this.getliveUser(!1);const s=t.index.getWindowInfo().platform;this.initLiveList(e),["mp-weixin","mp-alipay","mp-baidu","mp-toutiao"].includes(s)?t.index.showShareMenu?t.index.showShareMenu({withShareTicket:!0,success:()=>{console.log("分享菜单显示成功")},fail:i=>{console.error("分享菜单显示失败:",i)}}):console.warn("当前平台不支持 uni.showShareMenu"):console.log("当前平台无需显示分享菜单")},onReady(){},onShareAppMessage(){return{title:this.livedata.liveName,path:"/pages/home/living",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)}},onHide(){const e=this.list[this.currentSwiperIndex];e&&this.pauseVideo(e)},onUnload(){this.closeAllWebSockets(),this.removeAllEventListeners(),this.clearAllTimers(),this.hlsPlayer&&(this.hlsPlayer.destroy(),this.hlsPlayer=null),this.list.forEach(e=>{const s=`myVideo_${e.liveId}`,i=t.index.createVideoContext(s,this);i&&i.destroy()})},watch:{"orderUser.count":{handler(e,s){e!==this.prevOrderCount&&(this.prevOrderCount=e,this.showPurchaseMessage())},immediate:!0}},methods:{resetUserListParams(){this.viewPageNum=1,this.viewNoMoreData=!1,this.liveViewers=[]},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={},v=!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&&(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)},async initCurrentLiveData(){const e=this.list[this.currentSwiperIndex];if(e){console.log("initCurrentLiveData:"+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 i=this.list.findIndex(n=>n.liveId==e.liveId);this.currentSwiperIndex=i!==-1?i:0}else this.currentSwiperIndex=0;setTimeout(()=>{this.swiperDuration=300},100);const s=this.list[this.currentSwiperIndex];s&&(this.liveId=s.liveId,this.initSocket(),this.preloadNearbyLives(),this.resetUserListParams(),this.getliveUser(!0))}catch(s){console.error("初始化失败:",s)}},async onSwiperChange(e){const s=e.detail.current,i=this.currentSwiperIndex;if(s===i)return;const n=this.list[i];n&&(this.pauseVideo(n),this.closeWebSocket(n.liveId)),this.currentSwiperIndex=s;const l=this.list[s];if(l){this.liveId=l.liveId;try{await Promise.all([this.initSocket(l),this.getliving(l),this.getLiveMsg(l),this.getliveViewData(l),this.resetUserListParams(),this.getliveUser(!1)]),n&&this.pauseVideo(n),setTimeout(()=>{this.playVideo(l)},100)}catch(c){console.error("切换直播间失败:",c)}}},async getList(){const e={page:1,page_size:20};try{const s=await m.liveList(e);s.code===200?(this.list=s.rows.map(i=>({...i,talklist:[],loading:!1,loaded:!1,shopping:!1,inputInfo:"",showWelcomeMessage:!1,redInfo:{}})),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)try{const s=`myVideo_${e.liveId}`,i=t.index.createVideoContext(s,this);i&&i.pause(()=>{i.play()})}catch(s){console.error("播放视频失败:",s)}},pauseVideo(e){if(e)try{const s=`myVideo_${e.liveId}`,i=t.index.createVideoContext(s,this);i&&i.pause()}catch(s){console.error("暂停视频失败:",s)}},async preloadNearbyLives(){this.preloading=!0;const e=this.currentSwiperIndex,s=[];e>0&&s.push(e-1),e>1&&s.push(e-2),e{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.liveViewers=[],this.livingUrl="",this.videoUrl=null,this.products={},this.store={},this.orderUser={},this.talklist=[],this.livedata={},this.shopping=!1,this.inputInfo="",Object.assign(this,e)},async getliveUser(e=!1){const s=this.liveId;if(s){this.viewLoading=!0;try{const i=await d.watchUserList(s,this.viewPageSize,this.viewPageNum,!1);if(i.code===200){if(this.liveId!==s)return;if(this.liveUserTotal=i.total,i.rows.length===0){this.viewNoMoreData=!0;return}this.liveViewers=e?[...this.liveViewers,...i.rows]:i.rows,this.viewPageNum++}}catch(i){console.error("获取观众列表失败:",i)}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 d.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)}},onRed(e){var i;if(!e.liveId||!((i=e.redInfo)!=null&&i.redId))return;let s={liveId:e.liveId,userId:this.userinfo.userId,redId:e.redInfo.redId};console.log("点了this.liveId",s),d.liveRed(s).then(n=>{n.code==200?t.index.showToast({title:n.msg,icon:"none"}):t.index.showToast({title:n.msg,icon:"none"})},n=>{})},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(e){if(console.log("带过去storeId",e),!e.storeId){t.index.showToast({title:"当前直播间暂未开通店铺",icon:"none"});return}t.index.navigateTo({url:"/pages_shop/store?liveId="+e.liveId+"&storeId="+e.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,s){if(!(!s||s.liveId!==this.liveId)){if(this.videoRetryCounts[s.liveId]>=3){console.error(`直播间 ${s.liveId} 视频加载失败`);return}this.videoRetryCounts[s.liveId]++,setTimeout(()=>{s.liveId===this.liveId&&this.playVideo(s)},2e3)}},async getliving(e){if(!(!e||!e.liveId)){e.liveId;try{const s=await _.getlive({id:e.liveId});if(s.code!==200){t.index.showToast({title:s.msg,icon:"none"});return}s.data.liveType===2?(this.$set(e,"videoUrl",s.data.videoUrl),this.$set(e,"livingUrl",""),this.$set(e,"placeholderText","说点什么...")):s.data.liveType===1?(this.$set(e,"livingUrl",s.data.flvHlsUrl),this.$set(e,"videoUrl",""),this.$set(e,"placeholderText","说点什么...")):(this.$set(e,"livingUrl",""),this.$set(e,"videoUrl",""));const i=this.currentSwiperIndex===this.list.findIndex(n=>n.liveId===e.liveId);this.$set(e,"autoplay",i&&s.data.liveType!==0),this.$set(e,"showType",s.data.showType),this.$set(e,"storeId",s.storeId),this.queryCollect()}catch(s){console.error("获取直播信息失败:",s),t.index.showToast({title:"获取直播信息失败",icon:"none"})}}},setupVideoPlayback(e,s){if(!e.livingUrl)return;const i=`myVideo_${e.liveId}`,n=t.index.createVideoContext(i,this);s.liveType===1?n.seek(s.nowDuration||0):n.play()},maskString(e,s="*"){return e?String(e).split("").map((n,l)=>l===0?n:s).join(""):""},getPureDecimal(e,s=6){const i=Math.abs(e).toFixed(s).split(".")[1];return(i==null?void 0:i.replace(/0+$/,""))||""},goBack(){const e=this.list[this.currentSwiperIndex];e&&this.pauseVideo(e),this.closeWebSocket(),getCurrentPages().length>1?t.index.navigateBack():t.index.reLaunch({url:"/pages/list/index"})},async getliveOrder(){const e=this.liveId;if(e)try{const s=await d.liveOrderUser(e);if(s.code===200){const i=this.list[this.currentSwiperIndex];i&&(this.$set(i,"orderUser",s),this.orderUser=s)}}catch(s){console.error("获取正在购买用户失败:",s)}},getLiveinformation(){this.liveId&&d.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)){if(!e.liveViewData&&(await this.getliveViewData(e),!e.liveViewData)){t.index.showToast({title:"数据加载中,请稍后再试",icon:"none"});return}try{const s=await d.liveDataLike(e.liveId);s.code===200?s.like?e.liveViewData.like++:t.index.showToast({title:s.msg,icon:"none"}):t.index.showToast({title:s.msg,icon:"none"})}catch(s){console.error("点赞失败:",s)}}},async getliveViewData(e){if(!(!e||!e.liveId))try{const s=await d.getLiveViewData(e.liveId);s.code==200&&this.$set(e,"liveViewData",s)}catch(s){console.error("获取直播间数据失败:",s)}},goShop(e,s){const i=this.list[this.currentSwiperIndex];!i||!i.liveId||t.index.navigateTo({url:"/pages_shop/goods?productId="+e+"&liveId="+i.liveId+"&goodsId="+s+"&storeId="+i.storeId})},async queryCollect(){const e=this.list[this.currentSwiperIndex];if(!e||!e.liveId)return;const{storeId:s}=e;if(s)try{const i=await d.store(e.storeId,e.inputInfo,e.liveId);i.code===200&&(this.$set(e,"products",i.data.goodsList),this.$set(e,"store",i.data),this.products=i.data.goodsList,this.store=i.data)}catch(i){console.error("获取小黄车商品失败:",i)}},onStoreCollect(e){console.log("店铺收藏",e),e.storeId&&d.collectStore(e.storeId).then(s=>{s.code==200?(t.index.showToast({title:s.msg,icon:"none"}),e.store.isFavorite=!e.store.isFavorite):t.index.showToast({title:s.msg,icon:"none"})},s=>{})},onGoodsCollect(e){console.log("商品收藏",e),!(!e||e.length===0||!e.goodsId)&&d.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=>{})},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()})},openCart(e){if(!e.storeId){t.index.showToast({title:"当前直播间暂未开通店铺",icon:"none"});return}e.shopping=!e.shopping},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(){const e=this.list[this.currentSwiperIndex];e&&this.$set(e,"shopping",!e.shopping)},closeRed(){this.showRed=!this.showRed},handleTouchEnd(){this.isZoom=!1},getEWechatSdk(){},closeWebSocket(e=null){if(this.isManualClose=!0,clearInterval(this.pingpangTimes),clearInterval(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(i){console.error("关闭 WebSocket 时出错:",i)}}),this.socketInstances={};v=!1},reConnect(){var e=this;try{t.index.closeSocket()}catch{}setTimeout(function(){e.initSocket()},1e4)},startHeartbeat(){clearInterval(this.pingpangTimes),this.pingpangTimes=setInterval(()=>{if(!v)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(){var i;if(!this.liveId)return;const e=this.liveId;if(this.currentSwiperIndex!==this.list.findIndex(n=>n.liveId===e)){console.log(`不初始化非当前直播间 ${e} 的WebSocket`);return}if(this.socketInstances[e]&&this.closeWebSocket(e),(i=this.socketInstances[e])!=null&&i.isOpen||this.reconnectCount>=this.maxReconnectAttempts)return;this.isManualClose=!1,console.log(this.timestamp);const s=t.CryptoJS.HmacSHA256(`${e}${this.userinfo.userId}${this.userType}${this.timestamp}`,this.timestamp.toString()).toString(t.CryptoJS.enc.Hex);this.socketInstances[e]={instance:null,isOpen:!1};try{const n=t.index.connectSocket({url:`${I}?userId=${this.userinfo.userId}&liveId=${e}&userType=${this.userType}×tamp=${this.timestamp}&signature=${s}`,success:()=>{console.log("WebSocket API 调用成功,正在建立连接...")},fail:l=>{console.error("WebSocket 连接失败:",l),this.scheduleReconnect(e)}});n.onOpen(l=>{console.log("WebSocket 连接已成功建立",l),this.socketInstances[e].instance=n,this.socketInstances[e].isOpen=!0}),n.onMessage(l=>{const c=this.list.find(p=>p.liveId===e);this.handleSocketMessage(l,c)})}catch(n){console.error("创建 WebSocket 异常:",n),this.scheduleReconnect(e)}},handleSocketMessage(e,s){let i=JSON.parse(e.data);const n=i.data;if(i.code==200){const l={...n,cmd:n.cmd||""};n.cmd=="sendMsg"?(this.$set(s,"talklist",[...s.talklist,l]),console.log("发消息:",s),this.$nextTick(()=>{this.$set(s,"scrollIntoView",`list_${s.talklist.length-1}`)})):n.cmd=="red"?(this.$set(s,"redInfo",JSON.parse(n.data)),console.log("红包是liveItem.redInfo",s)):n.cmd=="sendRedPacketQuestion"?JSON.parse(e.data.data):n.cmd=="entry"?(console.log("在线人数进入:"),this.$set(s,"talklist",[...s.talklist,l]),this.$set(s,"showWelcomeMessage",!1),this.$set(s,"showWelcomeMessage",!0),this.getliveUser(!1),console.log("开启欢迎消息:",s.showWelcomeMessage),s.welcomeTimer&&clearTimeout(s.welcomeTimer),s.welcomeTimer=setTimeout(()=>{this.$set(s,"showWelcomeMessage",!1),console.log("关闭欢迎消息:",s.showWelcomeMessage)},1e3)):n.cmd=="live_start"||n.cmd=="live_end"||(n.data.cmd=="deleteId"?t.index.$emit("deleteId"):n.data.cmd=="sendRedPacketQuestion")}else t.index.showToast({title:i.msg,icon:"none"})},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=setInterval(()=>{this.initSocket()},e)},sendMsg(e){if(console.log("sendMsg"),!e||!e.liveId)return;const s=e.liveId,i=this.socketInstances[s];if(!i||!i.instance||!i.isOpen){this.initSocket(e),t.index.showToast({title:"连接未建立,正在重试...",icon:"none"});return}const n={liveId:s,userId:this.userinfo.userId,userType:0,cmd:"sendMsg",msg:e.value,nickName:this.userinfo.nickName,avatar:this.userinfo.avatar};if(!(e!=null&&e.value.trim())&&(console.log(!this.value.trim()),!this.value.trim())){t.index.showToast({title:"不能发送空消息",icon:"none"});return}i.instance.send({data:JSON.stringify(n),success:()=>{console.log("发送成功"),this.$set(e,"value","")},fail:l=>{console.error("发送失败:",l),t.index.showToast({title:"发送失败,请重试",icon:"none"})}})}}};if(!Array){const e=t.resolveComponent("u-avatar"),s=t.resolveComponent("u-loading"),i=t.resolveComponent("u-input"),n=t.resolveComponent("u-popup");(e+s+i+n)()}const C=()=>"../../uni_modules/uview-plus/components/u-avatar/u-avatar.js",L=()=>"../../uni_modules/uview-plus/components/u-input/u-input.js",U=()=>"../../uni_modules/uview-plus/components/u-popup/u-popup.js";Math||(C+L+U)();function V(e,s,i,n,l,c){var p;return{a:t.f(l.list,(o,f,u)=>{var S,y,T,k;return t.e({a:t.o((...r)=>c.goBack&&c.goBack(...r),o.liveId),b:"471975a0-0-"+u,c:t.p({src:o.liveImgUrl||e.$img.logo,size:"32"}),d:t.t(o.liveName?c.truncateString(o.liveName,5):"未命名"),e:t.f(c.filteredViewers,(r,a,g)=>({a,b:r.avatar||e.$img.logo})),f:t.o(r=>l.showadd=!l.showadd,o.liveId),g:((S=o.redInfo)==null?void 0:S.redStatus)==1},((y=o.redInfo)==null?void 0:y.redStatus)==1?{h:t.o(r=>c.onRed(o),o.liveId),i:h._imports_1$3}:{},{j:t.o(r=>c.onLike(o),o.liveId),k:t.t(((T=o.liveViewData)==null?void 0:T.like)||0),l:t.o(r=>c.goStore(o),o.liveId),m:t.n(o.showType==1?"siderow-group":"side-group")},l.showPurchasePrompt&&((k=l.orderUser)!=null&&k.count)?{n:h._imports_5,o:t.t(l.orderUser.userName?c.maskString(l.orderUser.userName):""),p:t.t(l.orderUser.count||0)}:{},{q:o.livingUrl},o.livingUrl?{r:"myVideo_"+o.liveId,s:t.n(o.showType==1?"video_row":"videotop"),t:o.livingUrl,v:l.currentSwiperIndex===f,w:t.o((...r)=>c.videoError&&c.videoError(...r),o.liveId)}:{},{x:o.videoUrl},o.videoUrl?{y:t.n(o.showType==1?"video_row":"videotop"),z:o.videoUrl,A:l.currentSwiperIndex===f,B:t.o((...r)=>c.videoError&&c.videoError(...r),o.liveId)}:{},{C:o.loading},o.loading?{D:"471975a0-1-"+u,E:t.p({mode:"circle",color:"#ffffff",size:"36"})}:{},{F:t.f(o.talklist,(r,a,g)=>({a:t.t(r.msg),b:a,c:r.cmd=="announcement"})),G:t.t(o.messageContent),H:t.f(o.talklist,(r,a,g)=>({a:t.t(r.nickName),b:t.t(r.msg),c:a,d:`list_${a}`,e:r.cmd!="red"&&r.cmd!="out"&&r.cmd!="entry"})),I:o.showWelcomeMessage},o.showWelcomeMessage?{J:t.f(o.talklist,(r,a,g)=>({a:t.t(r.nickName),b:t.t(r.msg),c:a,d:r.cmd=="entry"||r.cmd=="out"})),K:t.t(o.messageContent)}:{},{L:o.scrollIntoView,M:t.o(r=>c.sendMsg(o),o.liveId),N:"471975a0-2-"+u,O:t.o(r=>o.value=r,o.liveId),P:t.p({placeholder:o.placeholderText,border:"none",customStyle:"font-size:24rpx;",shape:"circle",color:"#fff",placeholderStyle:"color:#e7e7e7",modelValue:o.value}),Q:t.o(r=>c.openCart(o),o.liveId),R:t.f(l.liveViewers,(r,a,g)=>({a:t.t(a+1),b:a===0?"#FF3B30":a===1?"#FF9500":a===2?"#FFCC00":"#8E8E93",c:a<3?"bold":"normal",d:"471975a0-4-"+u+"-"+g+","+("471975a0-3-"+u),e:t.p({src:r.avatar||e.$img.logo,size:"32"}),f:t.t(r.nickName||"未命名"),g:a}))},l.viewNoMoreData&&l.liveViewers.length>0?{}:{},{S:t.o((...r)=>c.handleScrollToLower&&c.handleScrollToLower(...r),o.liveId),T:t.o(c.close,o.liveId),U:t.o(c.openViews,o.liveId),V:"471975a0-3-"+u,W:"471975a0-6-"+u+","+("471975a0-5-"+u),X:t.o([r=>o.inputInfo=r.detail.value,(...r)=>c.handleSearchInput&&c.handleSearchInput(...r)],o.liveId),Y:o.inputInfo},l.store.isFavorite?{Z:t.o(r=>c.onStoreCollect(o),o.liveId),aa:h._imports_12}:{ab:t.o(r=>c.onStoreCollect(o),o.liveId),ac:h._imports_13},{ad:t.o(r=>c.goOrderList(o),o.liveId),ae:t.f(l.products,(r,a,g)=>t.e({a:r.imgUrl,b:t.t(a+1),c:t.t(r.productName),d:t.t(r.sales),e:t.t(Math.trunc(r.price)),f:t.t(c.getPureDecimal(r.price)?c.getPureDecimal(r.price):"00"),g:r.isFavorite},r.isFavorite?{h:t.o(w=>c.onGoodsCollect(r),a),i:h._imports_12}:{j:t.o(w=>c.onGoodsCollect(r),a),k:h._imports_13},{l:r.status==1},r.status==1?{m:t.o(w=>c.goShop(r.productId,r.goodsId),a)}:r.status==0?{o:t.o(w=>c.goShop(r.productId),a)}:{},{n:r.status==0,p:a})),af:t.o(c.closeShop,o.liveId),ag:t.o(c.openShop,o.liveId),ah:"471975a0-5-"+u,ai:t.p({show:o.shopping,round:"20rpx",bgColor:"f3f5f9"}),aj:l.currentSwiperIndex===f?1:"",ak:o.liveId})}),b:h._imports_0$2,c:t.t(l.liveUserTotal||0),d:h._imports_2,e:h._imports_3,f:h._imports_4,g:l.showPurchasePrompt&&((p=l.orderUser)==null?void 0:p.count),h:h._imports_6,i:l.viewNoMoreData&&l.liveViewers.length>0,j:l.scrollHeight+"px",k:t.p({show:l.showadd,round:"20rpx",bgColor:"#ffffff"}),l:t.p({src:l.store.logoUrl,size:"36"}),m:h._imports_1$2,n:l.store.isFavorite,o:h._imports_11,p:l.boxHeight+"px",q:l.currentSwiperIndex,r:t.o((...o)=>c.onSwiperChange&&c.onSwiperChange(...o)),s:l.swiperDuration}}const b=t._export_sfc(x,[["render",V],["__scopeId","data-v-471975a0"]]);x.__runtimeHooks=2;wx.createPage(b);