|
@@ -4,12 +4,15 @@ 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.166:7114/app/webSocket";
|
|
|
+var wsUrl = "ws://192.168.10.125:7114/app/webSocket";
|
|
|
var isSocketOpen = false;
|
|
|
var socket = null;
|
|
|
const _sfc_main = {
|
|
|
data() {
|
|
|
return {
|
|
|
+ redInfo: null,
|
|
|
+ inputInfo: "",
|
|
|
+ searchTimer: null,
|
|
|
storeId: null,
|
|
|
reconnectCount: 0,
|
|
|
maxReconnectAttempts: 3,
|
|
@@ -114,9 +117,9 @@ const _sfc_main = {
|
|
|
};
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
- if (options.liveId) {
|
|
|
+ if (options.liveId && options.liveId !== this.liveId) {
|
|
|
this.liveId = options.liveId;
|
|
|
- console.log("接收到的liveId:", this.liveId);
|
|
|
+ this.getliveViewData();
|
|
|
}
|
|
|
common_vendor.index.showShareMenu({
|
|
|
withShareTicket: true
|
|
@@ -168,6 +171,9 @@ const _sfc_main = {
|
|
|
onReady: function(res) {
|
|
|
this.videoContext = common_vendor.index.createVideoContext("myVideo");
|
|
|
},
|
|
|
+ onHide() {
|
|
|
+ clearInterval(this.intervalId);
|
|
|
+ },
|
|
|
onUnload() {
|
|
|
this.closeWebSocket();
|
|
|
if (this.hlsPlayer) {
|
|
@@ -191,6 +197,21 @@ const _sfc_main = {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ onRed() {
|
|
|
+ if (!this.liveId)
|
|
|
+ return;
|
|
|
+ ({
|
|
|
+ liveId: this.liveId,
|
|
|
+ userId: this.userinfo.userId,
|
|
|
+ redId: this.redInfo.redId
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleSearchInput() {
|
|
|
+ clearTimeout(this.searchTimer);
|
|
|
+ this.searchTimer = setTimeout(() => {
|
|
|
+ this.queryCollect();
|
|
|
+ }, 500);
|
|
|
+ },
|
|
|
// 显示购买提示信息
|
|
|
showPurchaseMessage() {
|
|
|
if (this.purchasePromptTimer) {
|
|
@@ -322,6 +343,7 @@ const _sfc_main = {
|
|
|
},
|
|
|
//直播间点赞、关注、在线人数数据
|
|
|
getliveViewData() {
|
|
|
+ console.log("直播间点赞、关注、在线人数数据>>>", this.liveId);
|
|
|
if (!this.liveId)
|
|
|
return;
|
|
|
api_live.getLiveViewData(this.liveId).then(
|
|
@@ -457,7 +479,7 @@ const _sfc_main = {
|
|
|
queryCollect() {
|
|
|
if (!this.storeId)
|
|
|
return;
|
|
|
- api_live.store(this.storeId).then(
|
|
|
+ api_live.store(this.storeId, this.inputInfo).then(
|
|
|
(res) => {
|
|
|
if (res.code == 200) {
|
|
|
console.log("查询店铺>>", res);
|
|
@@ -478,7 +500,7 @@ const _sfc_main = {
|
|
|
onStoreCollect() {
|
|
|
if (!this.storeId)
|
|
|
return;
|
|
|
- api_live.collectStore(this.products[0].storeId).then(
|
|
|
+ api_live.collectStore(this.storeId).then(
|
|
|
(res) => {
|
|
|
if (res.code == 200) {
|
|
|
common_vendor.index.showToast({
|
|
@@ -639,7 +661,6 @@ const _sfc_main = {
|
|
|
// }
|
|
|
// },
|
|
|
getAnswerlists() {
|
|
|
- console.log(123);
|
|
|
if (!this.liveId)
|
|
|
return;
|
|
|
const data = {
|
|
@@ -824,12 +845,15 @@ const _sfc_main = {
|
|
|
this.$nextTick(() => {
|
|
|
this.scrollIntoView = `list_${this.talklist.length - 1}`;
|
|
|
});
|
|
|
- if (redata.cmd == "deleteId") {
|
|
|
+ if (redata.data.cmd == "deleteId") {
|
|
|
common_vendor.index.$emit("deleteId");
|
|
|
- } else if (redata.cmd == "init") {
|
|
|
+ } else if (redata.data.cmd == "init") {
|
|
|
common_vendor.index.$emit("init", redata.data);
|
|
|
- } else if (redata.cmd == "reload") {
|
|
|
+ } else if (redata.data.cmd == "reload") {
|
|
|
common_vendor.index.$emit("reload");
|
|
|
+ } else if (redata.data.cmd == "red") {
|
|
|
+ console.log(" 领红包>>", redata);
|
|
|
+ this.redInfo = JSON.parse(redata.data.data);
|
|
|
} else if (redata.data.cmd == "sendRedPacketQuestion") {
|
|
|
const list = JSON.parse(redata.data.data);
|
|
|
this.redanswerAll = [...this.redanswerAll, ...list];
|
|
@@ -931,6 +955,7 @@ if (!Math) {
|
|
|
(_easycom_u_avatar + _easycom_u_input + _easycom_u_icon + _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,
|
|
@@ -953,34 +978,39 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
};
|
|
|
}),
|
|
|
j: common_vendor.t($data.liveViewData.online || 0),
|
|
|
- k: common_vendor.o((...args) => $options.onLike && $options.onLike(...args)),
|
|
|
- l: common_assets._imports_1$1,
|
|
|
- m: common_vendor.t($data.liveViewData.like),
|
|
|
- n: common_vendor.o(($event) => $options.goStore()),
|
|
|
+ k: ((_a = $data.redInfo) == null ? void 0 : _a.status) == 1
|
|
|
+ }, ((_b = $data.redInfo) == null ? void 0 : _b.status) == 1 ? {
|
|
|
+ l: common_vendor.o((...args) => $options.onRed && $options.onRed(...args)),
|
|
|
+ m: common_assets._imports_1$1
|
|
|
+ } : {}, {
|
|
|
+ n: common_vendor.o((...args) => $options.onLike && $options.onLike(...args)),
|
|
|
o: common_assets._imports_2,
|
|
|
- p: common_assets._imports_3,
|
|
|
- q: common_vendor.n($data.showType == 1 ? "siderow-group" : "side-group"),
|
|
|
- r: $data.showPurchasePrompt
|
|
|
- }, $data.showPurchasePrompt ? {
|
|
|
+ p: common_vendor.t($data.liveViewData.like),
|
|
|
+ q: common_vendor.o(($event) => $options.goStore()),
|
|
|
+ r: common_assets._imports_3,
|
|
|
s: common_assets._imports_4,
|
|
|
- t: common_vendor.t($data.orderUser.userName ? $options.maskString($data.orderUser.userName) : ""),
|
|
|
- v: common_vendor.t($data.orderUser.count || 0)
|
|
|
+ t: common_vendor.n($data.showType == 1 ? "siderow-group" : "side-group"),
|
|
|
+ v: $data.showPurchasePrompt
|
|
|
+ }, $data.showPurchasePrompt ? {
|
|
|
+ w: common_assets._imports_5,
|
|
|
+ x: common_vendor.t($data.orderUser.userName ? $options.maskString($data.orderUser.userName) : ""),
|
|
|
+ y: common_vendor.t($data.orderUser.count || 0)
|
|
|
} : {}, {
|
|
|
- w: $data.livingUrl
|
|
|
+ z: $data.livingUrl
|
|
|
}, $data.livingUrl ? {
|
|
|
- x: common_vendor.n($data.showType == 1 ? "video_row" : "videotop"),
|
|
|
- y: $data.livingUrl,
|
|
|
- z: $data.autoplay,
|
|
|
- A: common_vendor.o((...args) => $options.videoError && $options.videoError(...args))
|
|
|
+ A: common_vendor.n($data.showType == 1 ? "video_row" : "videotop"),
|
|
|
+ B: $data.livingUrl,
|
|
|
+ C: $data.autoplay,
|
|
|
+ D: common_vendor.o((...args) => $options.videoError && $options.videoError(...args))
|
|
|
} : {}, {
|
|
|
- B: $data.videoUrl
|
|
|
+ E: $data.videoUrl
|
|
|
}, $data.videoUrl ? {
|
|
|
- C: common_vendor.n($data.showType == 1 ? "video_row" : "videotop"),
|
|
|
- D: $data.videoUrl,
|
|
|
- E: $data.autoplay,
|
|
|
- F: common_vendor.o((...args) => $options.videoError && $options.videoError(...args))
|
|
|
+ F: common_vendor.n($data.showType == 1 ? "video_row" : "videotop"),
|
|
|
+ G: $data.videoUrl,
|
|
|
+ H: $data.autoplay,
|
|
|
+ I: common_vendor.o((...args) => $options.videoError && $options.videoError(...args))
|
|
|
} : {}, {
|
|
|
- G: common_vendor.f($data.talklist, (item, index, i0) => {
|
|
|
+ J: common_vendor.f($data.talklist, (item, index, i0) => {
|
|
|
return {
|
|
|
a: common_vendor.t(item.msg),
|
|
|
b: item.index,
|
|
@@ -988,8 +1018,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
d: item.cmd == "announcement"
|
|
|
};
|
|
|
}),
|
|
|
- H: common_vendor.t($data.messageContent),
|
|
|
- I: common_vendor.f($data.talklist, (item, index, i0) => {
|
|
|
+ K: common_vendor.t($data.messageContent),
|
|
|
+ L: common_vendor.f($data.talklist, (item, index, i0) => {
|
|
|
return {
|
|
|
a: common_vendor.t(item.nickName),
|
|
|
b: common_vendor.t(item.msg),
|
|
@@ -998,9 +1028,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
e: item.cmd == "sendMsg"
|
|
|
};
|
|
|
}),
|
|
|
- J: $data.showWelcomeMessage
|
|
|
+ M: $data.showWelcomeMessage
|
|
|
}, $data.showWelcomeMessage ? {
|
|
|
- K: common_vendor.f($data.talklist, (item, index, i0) => {
|
|
|
+ N: common_vendor.f($data.talklist, (item, index, i0) => {
|
|
|
return {
|
|
|
a: common_vendor.t(item.nickName),
|
|
|
b: common_vendor.t(item.msg),
|
|
@@ -1009,13 +1039,13 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
e: item.cmd == "entry" || item.cmd == "out"
|
|
|
};
|
|
|
}),
|
|
|
- L: common_vendor.t($data.messageContent)
|
|
|
+ O: common_vendor.t($data.messageContent)
|
|
|
} : {}, {
|
|
|
- M: $data.scrollIntoView,
|
|
|
- N: common_vendor.o($options.sendMsg),
|
|
|
- O: common_vendor.o($options.sendMsg),
|
|
|
- P: common_vendor.o(($event) => $data.value = $event),
|
|
|
- Q: common_vendor.p({
|
|
|
+ P: $data.scrollIntoView,
|
|
|
+ Q: common_vendor.o($options.sendMsg),
|
|
|
+ R: common_vendor.o($options.sendMsg),
|
|
|
+ S: common_vendor.o(($event) => $data.value = $event),
|
|
|
+ T: common_vendor.p({
|
|
|
placeholder: $data.placeholderText,
|
|
|
border: "none",
|
|
|
customStyle: "font-size:24rpx;",
|
|
@@ -1024,38 +1054,40 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
placeholderStyle: "color:#e7e7e7",
|
|
|
modelValue: $data.value
|
|
|
}),
|
|
|
- R: common_assets._imports_5,
|
|
|
- S: common_vendor.o(($event) => $data.shopping = !$data.shopping),
|
|
|
- T: common_assets._imports_6,
|
|
|
- U: common_vendor.o(($event) => $data.showziliao = !$data.showziliao),
|
|
|
- V: common_vendor.o(($event) => $data.showziliao = !$data.showziliao),
|
|
|
- W: common_vendor.p({
|
|
|
+ U: common_assets._imports_6,
|
|
|
+ V: common_vendor.o(($event) => $data.shopping = !$data.shopping),
|
|
|
+ W: common_assets._imports_7,
|
|
|
+ X: common_vendor.o(($event) => $data.showziliao = !$data.showziliao),
|
|
|
+ Y: common_vendor.o(($event) => $data.showziliao = !$data.showziliao),
|
|
|
+ Z: common_vendor.p({
|
|
|
name: "close",
|
|
|
size: "18"
|
|
|
}),
|
|
|
- X: $data.livedata.liveDesc,
|
|
|
- Y: common_vendor.o($options.closes),
|
|
|
- Z: common_vendor.p({
|
|
|
+ aa: $data.livedata.liveDesc,
|
|
|
+ ab: common_vendor.o($options.closes),
|
|
|
+ ac: common_vendor.p({
|
|
|
show: $data.showziliao,
|
|
|
round: "20",
|
|
|
bgColor: "#fffee1"
|
|
|
}),
|
|
|
- aa: common_vendor.p({
|
|
|
+ ad: common_vendor.p({
|
|
|
src: $data.store.logoUrl,
|
|
|
size: "36"
|
|
|
}),
|
|
|
- ab: common_assets._imports_1,
|
|
|
- ac: $data.store.isFavorite
|
|
|
+ ae: common_assets._imports_1,
|
|
|
+ af: common_vendor.o([($event) => $data.inputInfo = $event.detail.value, (...args) => $options.handleSearchInput && $options.handleSearchInput(...args)]),
|
|
|
+ ag: $data.inputInfo,
|
|
|
+ ah: $data.store.isFavorite
|
|
|
}, $data.store.isFavorite ? {
|
|
|
- ad: common_assets._imports_11
|
|
|
+ ai: common_vendor.o((...args) => $options.onStoreCollect && $options.onStoreCollect(...args)),
|
|
|
+ aj: common_assets._imports_12
|
|
|
} : {
|
|
|
- ae: common_vendor.o((...args) => $options.onStoreCollect && $options.onStoreCollect(...args)),
|
|
|
- af: common_assets._imports_12
|
|
|
+ ak: common_vendor.o((...args) => $options.onStoreCollect && $options.onStoreCollect(...args)),
|
|
|
+ al: common_assets._imports_13
|
|
|
}, {
|
|
|
- ag: common_vendor.o((...args) => $options.onStoreCollect && $options.onStoreCollect(...args)),
|
|
|
- ah: common_assets._imports_10,
|
|
|
- ai: common_vendor.o((...args) => $options.goOrderList && $options.goOrderList(...args)),
|
|
|
- aj: common_vendor.f($data.products, (item, index, i0) => {
|
|
|
+ am: common_assets._imports_11,
|
|
|
+ an: common_vendor.o((...args) => $options.goOrderList && $options.goOrderList(...args)),
|
|
|
+ ao: common_vendor.f($data.products, (item, index, i0) => {
|
|
|
return common_vendor.e({
|
|
|
a: item.imgUrl,
|
|
|
b: common_vendor.t(index + 1),
|
|
@@ -1066,10 +1098,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
g: item.isFavorite
|
|
|
}, item.isFavorite ? {
|
|
|
h: common_vendor.o(($event) => $options.onGoodsCollect(item), index),
|
|
|
- i: common_assets._imports_11
|
|
|
+ i: common_assets._imports_12
|
|
|
} : {
|
|
|
j: common_vendor.o(($event) => $options.onGoodsCollect(item), index),
|
|
|
- k: common_assets._imports_12
|
|
|
+ k: common_assets._imports_13
|
|
|
}, {
|
|
|
l: item.status == 1
|
|
|
}, item.status == 1 ? {
|
|
@@ -1081,10 +1113,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
p: index
|
|
|
});
|
|
|
}),
|
|
|
- ak: $data.boxHeight + "px",
|
|
|
- al: common_vendor.o($options.closeshop),
|
|
|
- am: common_vendor.o($options.open),
|
|
|
- an: common_vendor.p({
|
|
|
+ ap: $data.boxHeight + "px",
|
|
|
+ aq: common_vendor.o($options.closeshop),
|
|
|
+ ar: common_vendor.o($options.open),
|
|
|
+ as: common_vendor.p({
|
|
|
show: $data.shopping,
|
|
|
round: "20rpx",
|
|
|
bgColor: "#f3f5f9"
|