"use strict"; const common_vendor = require("../../common/vendor.js"); const api_live = require("../../api/live.js"); require("../../api/order.js"); const api_home = require("../../api/home.js"); const common_assets = require("../../common/assets.js"); var wsUrl = "ws://192.168.10.125:7114/app/webSocket"; var isSocketOpen = false; const _sfc_main = { data() { return { liveUserTotal: null, viewPageSize: 10, // 每页数量 viewPageNum: 1, // 当前页码 viewLoading: false, // 是否正在加载 viewNoMoreData: false, // 是否没有更多数据 scrollHeight: 0, scrollTimer: null, // 滚动防抖定时器 socketInstance: null, // 统一管理 socket 实例 reconnectCount: 0, maxReconnectAttempts: 3, isManualClose: false, // 标记是否手动关闭 showRed: true, redInfo: {}, inputInfo: "", searchTimer: null, storeId: null, reconnectCount: 0, maxReconnectAttempts: 3, reconnectTimer: null, isCollect: false, showPurchasePrompt: false, purchasePromptTimer: null, prevOrderCount: 0, // 用于记录上一次的购买人数 videoUrl: null, showType: 1, //横屏1 竖屏2 boxHeight: 300, //小黄车高度 isFollow: true, liveViewData: {}, liveViewers: [], //观众 likeName: 0, hlsPlayer: null, // HLS播放器实例, livingUrl: "", products: {}, store: {}, orderUser: {}, //正在购买 userType: 0, timestamp: "", liveId: null, // userId: uni.getStorageSync("userInfo.userId"), codeimg: "", placeholderText: "说点什么...", isZoom: false, //点赞按钮控制是否放大 userinfo: "", //用户信息 path: "http://192.168.10.166/dev-api", //余红奇 // path: 'http://v56c9b8e.natappfree.cc', //余红奇 // path: 'live.test.ylrztop.com/prod-api', //余红奇 // path: 'http://192.168.10.170/dev-api', //陈果 value: "", talkdisabled: false, //输入框是否禁用 autoplay: false, //视频自动播放 showadd: false, talklist: [], scrollIntoView: "", bufferRate: 0, //视频缓冲时间 playDuration: 0, //视频播放时间 videoContext: "", thistime: common_vendor.index.$u.timeFormat(/* @__PURE__ */ new Date(), "yyyy-mm-dd hh:MM:ss"), upDown: true, //是否视频显示隐藏 isLongPress: false, // 是否长按 timeout: null, // 计时器 showWelcomeMessage: false, isSubmit: false, messageContent: "", showziliao: false, isScreen: true, showAnswer: false, //展示答题 Answerlistall: {}, //所有题目 answerlist: {}, //当前题目 answerfrist: 0, //当前选择 checkboxValue: [], //多选数据 checkboxFormValue: "", //多选数据 allAnswerLists: [], // 新增:存储所有题目列表 showAnswerred: false, //展示红包答题 answerbtn: false, //答题按钮弹窗 redallAnswerLists: [], //储存所有红包答题列表 redanswerAll: [], //红包当前题目 redanswerList: [], //红包答题列表 redanswertips: [], //红包答题提示 shopping: false, //小黄车弹窗 scrollTop: 0, //弹幕 old: { scrollTop: 0 }, livedata: {} //直播间点赞、关注、在线人数数据 }; }, onLoad(options) { this.userinfo = JSON.parse(common_vendor.index.getStorageSync("userInfo")); if (options.liveId) { this.liveId = options.liveId; } common_vendor.index.showShareMenu({ withShareTicket: true }); }, onShareAppMessage() { return { // title: this.product.title, title: this.livedata.liveName, path: "/pages/home/index", imageUrl: this.products.image, success(res) { console.log("分享成功", res); }, fail(err) { console.error("分享失败", err); } }; }, computed: { filteredViewers() { if (!this.liveViewers) { return; } else { return this.liveViewers.slice(0, 3); } } }, mounted() { this.getLiveMsg(); this.getliveViewData(); this.getliveOrder(); this.getliveUser(); this.initTime(); this.initSocket(); var that = this; common_vendor.index.$on("initSocket", () => { that.initSocket(); }); common_vendor.index.$on("sendMsg", (item) => { that.sendMsg(item); }); common_vendor.index.$on("closeWebSocket", () => { that.closeWebSocket(); }); this.getEWechatSdk(); this.getliving(); }, onReady: function(res) { this.videoContext = common_vendor.index.createVideoContext("myVideo"); }, onHide() { clearInterval(this.intervalId); }, onUnload() { this.closeWebSocket(); common_vendor.index.$off("refreshOrder"); clearInterval(this.intervalId); if (this.hlsPlayer) { this.hlsPlayer.destroy(); } if (this.pingpangTimes) { clearInterval(this.pingpangTimes); } }, watch: { // 监听orderUser.count的变化 "orderUser.count": { handler(newVal, oldVal) { if (newVal !== this.prevOrderCount) { this.prevOrderCount = newVal; this.showPurchaseMessage(); } }, immediate: true } }, methods: { openViews() { this.$nextTick(() => { const query = common_vendor.index.createSelectorQuery().in(this); query.select(".view-box").boundingClientRect((data) => { if (data) { this.scrollHeight = data.height - 80 - 120; } }).exec(); }); }, // 获取直播间用户 async getliveUser(isLoadMore = false) { if (this.viewLoading || this.viewNoMoreData) return; this.viewLoading = true; try { const res = await api_live.watchUserList(this.liveId, this.viewPageSize, this.viewPageNum, false); if (res.code == 200) { this.liveUserTotal = res.total; if (res.rows.length === 0) { this.viewNoMoreData = true; if (this.viewPageNum > 1) { common_vendor.index.showToast({ title: "没有更多数据了", icon: "none" }); } return; } if (isLoadMore) { this.liveViewers = [...this.liveViewers, ...res.rows]; } else { this.liveViewers = res.rows; } this.viewPageNum++; } else { common_vendor.index.showToast({ title: res.msg, icon: "none" }); } } catch (error) { console.error("获取观众列表失败:", error); common_vendor.index.showToast({ title: "获取数据失败", icon: "none" }); } finally { this.viewLoading = false; } }, // 滚动到底部触发 handleScrollToLower() { if (this.scrollTimer) { clearTimeout(this.scrollTimer); } this.scrollTimer = setTimeout(() => { this.getliveUser(true); }, 1e3); }, // gettalklist() { // if (!this.liveId) return; // const param = { // id: this.liveId // } // gettextlist(param).then(res => { // if (res.code == 200) { // this.talklist = res.data // // console.log(res.data); // this.$nextTick(() => { // this.scrollIntoView = `list_${this.talklist.length-1}` // }) // } // }) // }, // 获取最近聊天记录 getLiveMsg() { if (!this.liveId) return; let pageSize = 30; let pageNum = 1; api_live.liveMsg(this.liveId, pageSize, pageNum).then((res) => { if (res.code == 200) { this.talklist = [...res.rows]; console.log("获取最近聊天记录>>", this.talklist); this.$nextTick(() => { this.scrollIntoView = `list_${this.talklist.length - 1}`; console.log("应该滚动到:", this.scrollIntoView); }); } else { common_vendor.index.showToast({ title: res.msg, icon: "none" }); } }); }, // 点击红包 onRed() { var _a; console.log("点了"); if (!this.liveId) return; console.log("点了this.liveId", this.liveId); if (!((_a = this.redInfo) == null ? void 0 : _a.redId)) return; console.log("点了this.redInfo?.redId", this.redInfo.redId); console.log("点了this.userinfo.userId", this.userinfo.userId); let data = { liveId: this.liveId, userId: this.userinfo.userId, redId: this.redInfo.redId }; api_live.liveRed(data).then( (res) => { if (res.code == 200) ; else { common_vendor.index.showToast({ title: res.msg, icon: "none" }); } }, (rej) => { } ); }, handleSearchInput() { clearTimeout(this.searchTimer); this.searchTimer = setTimeout(() => { this.queryCollect(); }, 500); }, // 显示购买提示信息 showPurchaseMessage() { if (this.purchasePromptTimer) { clearTimeout(this.purchasePromptTimer); } this.showPurchasePrompt = true; this.purchasePromptTimer = setTimeout(() => { this.showPurchasePrompt = false; }, 2e3); }, truncateString(str, maxLength) { return str.length > maxLength ? str.slice(0, maxLength) + "..." : str; }, goStore() { console.log("带过去storeId", this.storeId); common_vendor.index.navigateTo({ url: "/pages_shop/store?liveId=" + this.liveId + "&storeId=" + this.storeId }); }, // 去订单列表 goOrderList() { common_vendor.index.navigateTo({ url: "/pages_shop/order" }); }, // 初始化HLS播放器 initHlsPlayer() { if (common_vendor.Hls.isSupported() && this.livingUrl) { const video = document.getElementById("myVideo"); if (video) { this.hlsPlayer = new common_vendor.Hls(); this.hlsPlayer.loadSource(this.livingUrl); this.hlsPlayer.attachMedia(video); this.hlsPlayer.on(common_vendor.Hls.Events.MANIFEST_PARSED, () => { video.play(); }); } } }, // 视频错误处理 videoError(e) { console.error("视频播放错误:", e.detail.errMsg); if (this.livingUrl) { setTimeout(() => { this.videoContext.play(); }, 2e3); } }, getliving() { if (!this.liveId) return; console.log("获取直播信息"); const param = { id: this.liveId }; api_home.getlive(param).then((res) => { if (res.code !== 200) { common_vendor.index.showToast({ title: res.msg, icon: "none", duration: 2e3 }); return; } this.livedata = res.data; this.showType = res.data.showType; this.storeId = res.storeId; this.queryCollect(); console.log("横屏1或竖屏2", this.showType); if (res.data.liveType === 2) { this.videoUrl = res.data.videoUrl; this.autoplay = true; this.placeholderText = "观看回放中"; this.talkdisabled = false; } else if (res.data.liveType === 1) { this.livingUrl = res.data.flvHlsUrl; this.autoplay = true; this.placeholderText = "说点什么..."; this.talkdisabled = false; } else { this.livingUrl = ""; this.autoplay = false; this.placeholderText = "直播未开始,暂时无法发言"; this.talkdisabled = true; return; } this.$nextTick(() => { if (!this.livingUrl) return; if (!this.videoContext) { this.videoContext = common_vendor.index.createVideoContext("myVideo", this); } if (res.data.liveType === 1) { this.videoContext.seek(res.data.nowDuration || 0); } else { this.videoContext.play(); } }); }).catch((err) => { console.error("获取直播信息失败:", err); common_vendor.index.showToast({ title: "获取直播信息失败", icon: "none" }); }); }, maskString(str, maskChar = "*") { if (!str) return ""; const strVal = String(str); return strVal.split("").map((char, index) => index === 0 ? char : maskChar).join(""); }, getPureDecimal(num, precision = 6) { const decimalPart = Math.abs(num).toFixed(precision).split(".")[1]; return (decimalPart == null ? void 0 : decimalPart.replace(/0+$/, "")) || ""; }, // 返回上一个页面并关闭WebSocket goBack() { const pages = getCurrentPages(); this.closeWebSocket(); if (pages.length > 1) { common_vendor.index.navigateBack(); } else { common_vendor.index.switchTab({ url: "/pages/list/index" // 替换为你的首页路径 }); } }, //直播间点赞、关注、在线人数数据 getliveViewData() { if (!this.liveId) return; api_live.getLiveViewData(this.liveId).then( (res) => { if (res.code == 200) { this.liveViewData = res; } else { common_vendor.index.showToast({ title: res.msg, icon: "none" }); } }, (rej) => { } ); }, //正在购买 getliveOrder() { if (!this.liveId) return; api_live.liveOrderUser(this.liveId).then( (res) => { if (res.code == 200) { console.log("正在购买>>>>", res); this.orderUser = res; } else { common_vendor.index.showToast({ title: res.msg, icon: "none" }); } }, (rej) => { } ); }, //小黄车 店铺展示 // getliveStore() { // if (!this.liveId) return; // let data = { // pageSize: 10, // page: 1 // } // liveStore(this.liveId, data).then(res => { // if (res.code == 200) { // console.log("小黄车 店铺展示>>>>", res) // this.products = res.data // this.queryCollect() // } else { // uni.showToast({ // title: res.msg, // icon: 'none' // }); // } // }, // rej => {} // ); // }, // 获取直播间信息接口 getLiveinformation() { if (!this.liveId) return; api_live.getLiveInfo(this.liveId).then( (res) => { if (res.code == 200) { console.log("获取直播间信息接口>>>>", res); this.livingUrl = res.livingUrl; } else { common_vendor.index.showToast({ title: res.msg, icon: "none" }); } }, (rej) => { } ); }, // 点赞 onLike() { if (!this.liveId) return; api_live.liveDataLike(this.liveId).then( (res) => { if (res.code == 200) { if (res.like) { this.liveViewData.like++; } else { common_vendor.index.showToast({ title: res.msg, icon: "none" }); } } else { common_vendor.index.showToast({ title: res.msg, icon: "none" }); } }, (rej) => { } ); }, // 去购买,跳商品详情 goShop(productId, goodsId) { common_vendor.index.navigateTo({ url: "/pages_shop/goods?productId=" + productId + "&liveId=" + this.liveId + "&goodsId=" + goodsId + "&storeId=" + this.storeId }); }, // 查询店铺 queryCollect() { if (!this.storeId) return; api_live.store(this.storeId, this.inputInfo).then( (res) => { if (res.code == 200) { console.log("查询店铺>>", res); this.products = res.data.goodsList; this.store = res.data; } else { common_vendor.index.showToast({ title: res.msg, icon: "none" }); } }, (rej) => { } ); }, // 店铺收藏 onStoreCollect() { if (!this.storeId) return; api_live.collectStore(this.storeId).then( (res) => { if (res.code == 200) { common_vendor.index.showToast({ title: res.msg, icon: "none" }); this.store.isFavorite = !this.store.isFavorite; } else { common_vendor.index.showToast({ title: res.msg, icon: "none" }); } }, (rej) => { } ); }, // 商品收藏 onGoodsCollect(item) { if (!item || item.length === 0 || !item.goodsId) { return; } api_live.collectGoods(item.goodsId).then( (res) => { if (res.code == 200) { common_vendor.index.showToast({ title: res.msg, icon: "none" }); item.isFavorite = !item.isFavorite; } else { common_vendor.index.showToast({ title: res.msg, icon: "none" }); } }, (rej) => { } ); }, // 关注 onFollow() { if (!this.liveId) return; api_live.follow(this.liveId).then( (res) => { this.isFollow = !this.isFollow; common_vendor.index.showToast({ title: res.msg, icon: "none" }); }, (rej) => { } ); }, // 时间戳 initTime() { const now = /* @__PURE__ */ new Date(); this.timestamp = now.getTime(); }, // initWebSocket() { // const liveWS = new LiveWS('ws://your-server.com', 123, 456); // // 从 URL 中解析 timestamp // const urlParams = new URL(liveWS.url).searchParams; // this.timestamp = urlParams.get('timestamp'); // // console.log('Timestamp:', timestamp); // }, // 弹幕滚动 lowerChat: function(e) { console.log(e); }, scroll: function(e) { console.log(e); this.old.scrollTop = e.detail.scrollTop; }, loadmore() { }, // 弹幕 scrollchat() { }, noredanswer() { if (this.Answerlistall > 0) { this.showAnswer = !this.this.showAnswer; } else { common_vendor.index.showToast({ title: "暂无题目", icon: "none" }); } }, redbagAnswer() { this.showAnswerred = !this.showAnswerred; this.answerbtn = !this.answerbtn; }, submitAnswers() { if (this.isSubmit) return; this.isSubmit = true; const data = { questionId: this.answerlist.id, answer: this.checkboxFormValue }; api_home.submitAnswer(data).then((res) => { if (res.code == 200) { common_vendor.index.showToast({ title: res.msg, icon: "none" }); } if (this.answerfrist < this.Answerlistall - 1) { this.answerfrist++; this.answerlist = this.allAnswerLists[this.answerfrist]; this.answerlist.content = JSON.parse(this.answerlist.content); } else { common_vendor.index.showToast({ title: "已是最后一题", icon: "none" }); this.showAnswer = false; } this.checkboxValue = []; this.checkboxFormValue = ""; common_vendor.index.showToast({ title: res.msg, icon: "none" }); }).finally((e) => { this.isSubmit = false; }); }, // handleCheckboxSelect(value) { // const index = this.checkboxValue.indexOf(value) // console.log(value) // if (this.answerlist.type == 1) { // this.checkboxValue = [value] // this.checkboxFormValue = this.checkboxValue.join(',') // setTimeout(() => { // uni.showToast({ // title: '准备下一题', // icon: 'none', // duration: 2000 // }); // }, 1000); // this.submitAnswers() // console.log(this.checkboxValue) // } else if (this.answerlist.type == 2) { // if (index > -1) { // this.checkboxValue.splice(index, 1) // this.checkboxFormValue = this.checkboxValue.join(',') // } else { // this.checkboxValue.push(value) // this.checkboxFormValue = this.checkboxValue.join(',') // } // console.log(this.checkboxFormValue) // } // }, getAnswerlists() { if (!this.liveId) return; const data = { liveId: this.liveId }; api_home.getAnswerlist(data).then((res) => { if (res.code == 200) { if (res.data.length > 0) { this.allAnswerLists = res.data; this.Answerlistall = res.data.length; if (this.allAnswerLists.length > 0) { this.answerlist = this.allAnswerLists[0]; this.answerlist.content = JSON.parse(this.allAnswerLists[0].content); } this.showAnswer = true; } else { this.showAnswer = false; } } }); }, openShop() { }, openViews() { }, 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; }, // longPress() { // this.timeout = setTimeout(() => { // this.isLongPress = true; // // 执行保存图片的操作 // uni.saveImageToPhotosAlbum({ // filePath: this.livedata.qwQrCode, // 图片的本地路径或网络路径 // success: () => { // uni.showToast({ // title: '保存成功' // }); // }, // fail: () => { // uni.showToast({ // title: '', // icon: 'none' // }); // } // }); // }, 500); // 设置长按的阈值时间,这里是500毫秒 // }, // cancelLongPress() { // clearTimeout(this.timeout); // this.isLongPress = false; // }, // 触摸开始 handleTouchStart() { this.isZoom = true; }, // 触摸结束 handleTouchEnd() { this.isZoom = false; }, getEWechatSdk() { }, closeWebSocket() { this.isManualClose = true; clearInterval(this.pingpangTimes); clearTimeout(this.reconnectTimer); if (this.socketInstance) { try { common_vendor.index.closeSocket(); console.log("WebSocket 已安全关闭"); } catch (e) { console.error("关闭 WebSocket 时出错:", e); } this.socketInstance = null; } isSocketOpen = false; }, reConnect() { var that = this; try { common_vendor.index.closeSocket(); } catch (e) { } setTimeout(function() { that.initSocket(); }, 1e4); }, startHeartbeat() { clearInterval(this.pingpangTimes); this.pingpangTimes = setInterval(() => { if (!isSocketOpen) return; const pingData = { cmd: "ping", timestamp: Date.now() }; common_vendor.index.sendSocketMessage({ data: JSON.stringify(pingData), success: () => console.debug("心跳发送成功"), fail: (err) => { console.error("心跳发送失败:", err); this.scheduleReconnect(); } }); }, 3e4); }, initSocket() { if (isSocketOpen || this.reconnectCount >= this.maxReconnectAttempts) { return; } this.closeWebSocket(); this.isManualClose = false; if (!this.liveId) { return; } const signature = common_vendor.CryptoJS.HmacSHA256( `${this.liveId}${this.userinfo.userId}${this.userType}${this.timestamp}`, this.timestamp.toString() ).toString(common_vendor.CryptoJS.enc.Hex); try { this.socketInstance = common_vendor.index.connectSocket({ url: `${wsUrl}?userId=${this.userinfo.userId}&liveId=${this.liveId}&userType=${this.userType}×tamp=${this.timestamp}&signature=${signature}`, success: () => { this.setupSocketListeners(); }, fail: (err) => { console.error("WebSocket 连接失败:", err); this.scheduleReconnect(); } }); } catch (e) { console.error("创建 WebSocket 异常:", e); this.scheduleReconnect(); } }, // 设置 WebSocket 监听器 setupSocketListeners() { common_vendor.index.onSocketOpen(() => { isSocketOpen = true; this.reconnectCount = 0; console.log("WebSocket 连接成功"); this.startHeartbeat(); }); common_vendor.index.onSocketClose(() => { isSocketOpen = false; console.log("WebSocket 连接关闭"); if (!this.isManualClose) { this.scheduleReconnect(); } }); common_vendor.index.onSocketError((err) => { isSocketOpen = false; console.error("WebSocket 错误:", err); if (!this.isManualClose) { this.scheduleReconnect(); } }); common_vendor.index.onSocketMessage((res) => { try { const redata = JSON.parse(res.data); this.talklist.push(redata.data); this.$nextTick(() => { this.scrollIntoView = `list_${this.talklist.length - 1}`; }); if (redata.data.cmd == "deleteId") { common_vendor.index.$emit("deleteId"); } else if (redata.data.cmd == "red") { this.redInfo = JSON.parse(redata.data.data); console.log(" 领红包1redata.data>>", redata.data); console.log(" 领红包2redata.data.data>>", redata.data.data); console.log(" 领红包3this.redInfo>>", this.redInfo); console.log(" 领红包4this.redInfo.redId>>", this.redInfo.redId); } else if (redata.data.cmd == "sendRedPacketQuestion") { const list = JSON.parse(redata.data.data); this.redanswerAll = [...this.redanswerAll, ...list]; if (this.redanswerAll[1].randomAmount !== null) { this.redanswertips = JSON.parse(this.redanswerAll[0].randomAmount); } console.log(this.redanswertips); console.log(this.redanswerAll); } else if (redata.data.cmd == "entry") { this.showWelcomeMessage = true; common_vendor.index.$emit("entry", redata.data); } } catch (e) { console.error("解析消息失败:", e); } }); }, scheduleReconnect() { if (this.isManualClose || this.reconnectCount >= this.maxReconnectAttempts) return; this.reconnectCount++; const delay = Math.min(3e3 * this.reconnectCount, 3e4); console.log(`将在 ${delay}ms 后重连 (尝试 ${this.reconnectCount}/${this.maxReconnectAttempts})`); this.reconnectTimer = setTimeout(() => { this.initSocket(); }, delay); }, sendMsg() { if (!isSocketOpen) { common_vendor.index.showToast({ title: "连接未建立,请稍后再试", icon: "none" }); return; } if (!this.socketInstance) { common_vendor.index.showToast({ title: "连接异常", icon: "none" }); return; } const data = { liveId: this.liveId, userId: this.userinfo.userId, userType: 0, cmd: "sendMsg", msg: this.value, nickName: this.userinfo.nickName, avatar: this.userinfo.avatar }; if (!this.value.trim()) { common_vendor.index.showToast({ title: "不能发送空消息", icon: "none" }); return; } this.socketInstance.send({ data: JSON.stringify(data), success: () => { console.log("发送成功"); this.value = ""; }, fail: (err) => { console.error("发送失败:", err); common_vendor.index.showToast({ title: "发送失败,请重试", icon: "none" }); } }); } } }; if (!Array) { const _easycom_u_avatar2 = common_vendor.resolveComponent("u-avatar"); const _easycom_u_input2 = common_vendor.resolveComponent("u-input"); const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup"); (_easycom_u_avatar2 + _easycom_u_input2 + _easycom_u_popup2)(); } const _easycom_u_avatar = () => "../../uni_modules/uview-plus/components/u-avatar/u-avatar.js"; const _easycom_u_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js"; const _easycom_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js"; if (!Math) { (_easycom_u_avatar + _easycom_u_input + _easycom_u_popup)(); } function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { var _a, _b; return common_vendor.e({ a: common_vendor.o((...args) => $options.goBack && $options.goBack(...args)), b: common_assets._imports_0$1, c: common_vendor.p({ src: $data.livedata.liveImgUrl || _ctx.$img.logo, size: "32" }), d: common_vendor.t($data.livedata.liveName ? $options.truncateString($data.livedata.liveName, 5) : "未命名"), e: common_vendor.t($data.liveViewData.follow || $data.liveViewData.follow === 0 ? $data.liveViewData.follow : 0), f: $data.isFollow }, $data.isFollow ? { g: common_vendor.o((...args) => $options.onFollow && $options.onFollow(...args)) } : { h: common_vendor.o((...args) => $options.onFollow && $options.onFollow(...args)) }, { i: common_vendor.f($options.filteredViewers, (item, index, i0) => { return { a: index, b: item.avatar || _ctx.$img.logo }; }), j: common_vendor.t($data.liveUserTotal || 0), k: common_vendor.o(($event) => $data.showadd = !$data.showadd), l: ((_a = $data.redInfo) == null ? void 0 : _a.redStatus) == 1 }, ((_b = $data.redInfo) == null ? void 0 : _b.redStatus) == 1 ? { m: common_vendor.o((...args) => $options.onRed && $options.onRed(...args)), n: common_assets._imports_1$1 } : {}, { o: common_vendor.o((...args) => $options.onLike && $options.onLike(...args)), p: common_assets._imports_2, q: common_vendor.t($data.liveViewData.like), r: common_vendor.o(($event) => $options.goStore()), s: common_assets._imports_3, t: common_assets._imports_4, v: common_vendor.n($data.showType == 1 ? "siderow-group" : "side-group"), w: $data.showPurchasePrompt }, $data.showPurchasePrompt ? { x: common_assets._imports_5, y: common_vendor.t($data.orderUser.userName ? $options.maskString($data.orderUser.userName) : ""), z: common_vendor.t($data.orderUser.count || 0) } : {}, { A: $data.livingUrl }, $data.livingUrl ? { B: common_vendor.n($data.showType == 1 ? "video_row" : "videotop"), C: $data.livingUrl, D: $data.autoplay, E: common_vendor.o((...args) => $options.videoError && $options.videoError(...args)) } : {}, { F: $data.videoUrl }, $data.videoUrl ? { G: common_vendor.n($data.showType == 1 ? "video_row" : "videotop"), H: $data.videoUrl, I: $data.autoplay, J: common_vendor.o((...args) => $options.videoError && $options.videoError(...args)) } : {}, { K: common_vendor.f($data.talklist, (item, index, i0) => { return { a: common_vendor.t(item.msg), b: index, c: item.cmd == "announcement" }; }), L: common_vendor.t($data.messageContent), M: common_vendor.f($data.talklist, (item, index, i0) => { return { a: common_vendor.t(item.nickName), b: common_vendor.t(item.msg), c: index, d: `list_${index}`, e: item.cmd != "red" && item.cmd != "out" && item.cmd != "entry" }; }), N: $data.showWelcomeMessage }, $data.showWelcomeMessage ? { O: common_vendor.f($data.talklist, (item, index, i0) => { return { a: common_vendor.t(item.nickName), b: common_vendor.t(item.msg), c: index, d: item.cmd == "entry" || item.cmd == "out" }; }), P: common_vendor.t($data.messageContent) } : {}, { Q: $data.scrollIntoView, R: common_vendor.o($options.sendMsg), S: common_vendor.o($options.sendMsg), T: common_vendor.o(($event) => $data.value = $event), U: common_vendor.p({ placeholder: $data.placeholderText, border: "none", customStyle: "font-size:24rpx;", shape: "circle", color: "#fff", placeholderStyle: "color:#e7e7e7", modelValue: $data.value }), V: common_assets._imports_6, W: common_vendor.o(($event) => $data.shopping = !$data.shopping), X: common_assets._imports_7, Y: common_vendor.o(($event) => $data.showziliao = !$data.showziliao), Z: common_vendor.f($data.liveViewers, (item, index, i0) => { return { a: common_vendor.t(index + 1), b: index === 0 ? "#FF3B30" : index === 1 ? "#FF9500" : index === 2 ? "#FFCC00" : "#8E8E93", c: index < 3 ? "bold" : "normal", d: "471975a0-3-" + i0 + ",471975a0-2", e: common_vendor.p({ src: item.avatar || _ctx.$img.logo, size: "32" }), f: common_vendor.t(item.nickName || "未命名"), g: index }; }), aa: $data.viewNoMoreData && $data.liveViewers.length > 0 }, $data.viewNoMoreData && $data.liveViewers.length > 0 ? {} : {}, { ab: $data.scrollHeight + "px", ac: common_vendor.o((...args) => $options.handleScrollToLower && $options.handleScrollToLower(...args)), ad: common_vendor.p({ src: $data.livedata.liveImgUrl || _ctx.$img.logo, size: "32" }), ae: common_vendor.t($data.livedata.liveName || "未命名"), af: common_vendor.o($options.close), ag: common_vendor.o($options.openViews), ah: common_vendor.p({ show: $data.showadd, round: "20rpx", bgColor: "#ffffff" }), ai: common_vendor.p({ src: $data.store.logoUrl, size: "36" }), aj: common_assets._imports_1, ak: common_vendor.o([($event) => $data.inputInfo = $event.detail.value, (...args) => $options.handleSearchInput && $options.handleSearchInput(...args)]), al: $data.inputInfo, am: $data.store.isFavorite }, $data.store.isFavorite ? { an: common_vendor.o((...args) => $options.onStoreCollect && $options.onStoreCollect(...args)), ao: common_assets._imports_12 } : { ap: common_vendor.o((...args) => $options.onStoreCollect && $options.onStoreCollect(...args)), aq: common_assets._imports_13 }, { ar: common_assets._imports_11, as: common_vendor.o((...args) => $options.goOrderList && $options.goOrderList(...args)), at: common_vendor.f($data.products, (item, index, i0) => { return common_vendor.e({ a: item.imgUrl, b: common_vendor.t(index + 1), c: common_vendor.t(item.productName), d: common_vendor.t(item.sales), e: common_vendor.t(Math.trunc(item.price)), f: common_vendor.t($options.getPureDecimal(item.price) ? $options.getPureDecimal(item.price) : "00"), g: item.isFavorite }, item.isFavorite ? { h: common_vendor.o(($event) => $options.onGoodsCollect(item), index), i: common_assets._imports_12 } : { j: common_vendor.o(($event) => $options.onGoodsCollect(item), index), k: common_assets._imports_13 }, { l: item.status == 1 }, item.status == 1 ? { m: common_vendor.o(($event) => $options.goShop(item.productId, item.goodsId), index) } : item.status == 0 ? { o: common_vendor.o(($event) => $options.goShop(item.productId), index) } : {}, { n: item.status == 0, p: index }); }), av: $data.boxHeight + "px", aw: common_vendor.o($options.closeShop), ax: common_vendor.o($options.openShop), ay: common_vendor.p({ show: $data.shopping, round: "20rpx", bgColor: "#f3f5f9" }) }); } const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-471975a0"]]); _sfc_main.__runtimeHooks = 2; wx.createPage(MiniProgramPage);