fix: bug修复

This commit is contained in:
kaizheng(郑凯) 2025-02-27 13:45:38 +08:00
parent 149fac2021
commit 041773b1c1
3 changed files with 153 additions and 164 deletions

View File

@ -49,7 +49,7 @@
>
<LivePlayList v-if="active === 3" :id="route.query.id" />
<ShotVideoList v-else-if="active === 35" :id="route.query.id" />
<CircleList v-else-if="active === 1" :id="route.query.id" />
<CircleList v-else-if="active === 41" :id="route.query.id" />
<Empty text="暂无内容" v-else />
</van-tab>
</van-tabs>
@ -92,12 +92,6 @@ const getTgTab = async () => {
let ret = await queryTgTab({ id: route.query.id })
if (ret.code === 0) {
tabList.value = ret.data
tabList.value.push({
productType: 1,
showName: "圈子",
sort: 3,
status: 1,
})
}
}

View File

@ -11,10 +11,10 @@
</template>
<script setup>
import { defineProps } from "vue";
import { useRoute } from "vue-router";
import { queryCartRead } from "@/api/video";
import { useStore } from "vuex";
import { defineProps } from "vue"
import { useRoute } from "vue-router"
import { queryCartRead } from "@/api/video"
import { useStore } from "vuex"
const props = defineProps({
item: {
required: true,
@ -41,9 +41,9 @@ const props = defineProps({
type: Number,
default: 3,
},
});
const route = useRoute();
const store = useStore();
})
const route = useRoute()
const store = useStore()
const toDetail = async () => {
if (props.isShopCar) {
await queryCartRead({
@ -51,7 +51,7 @@ const toDetail = async () => {
productType: props.item.productType,
videoId: route.query.id,
saleUserId: route.query.saleUserId,
});
})
}
if (props.item.productType === 21) {
// let bvideo = `${
@ -65,7 +65,7 @@ const toDetail = async () => {
token: store.state.userInfo.token,
refreshToken: store.state.userInfo.refreshToken,
activityId: props.item.url,
});
})
} else {
if (props.liveProductId) {
location.href = `${location.origin}/tgh5/viewpackageDetail/${
@ -74,12 +74,12 @@ const toDetail = async () => {
props.liveCategoryId
}&liveMarketId=${
route.query.saleUserId ? route.query.saleUserId : ""
}&liveTgId=${props.tgId}`;
}&liveTgId=${props.tgId}`
} else {
location.href = `${location.origin}/tgh5/viewpackageDetail/${props.item.id}`;
location.href = `${location.origin}/tgh5/viewpackageDetail/${props.item.id}`
}
}
}
};
</script>
<style scoped lang="scss">
@media screen and (min-width: 480px) {

View File

@ -136,27 +136,27 @@ import {
reactive,
computed,
defineExpose,
} from "vue";
import { useRoute } from "vue-router";
import { showToast } from "vant";
} from "vue"
import { useRoute } from "vue-router"
import { showToast } from "vant"
import Share from "@/components/Share";
import Share from "@/components/Share"
// import { likeVideo, queryLiveCoupon } from "@/api/video";
import { likeVideo } from "@/api/video";
import emitter from "@/utils/emitter";
import useGetLiveStatusObj from "@/hooks/useGetLiveStatusObj";
import QuestionnairePopup from "../components/QuestionnairePopup.vue";
import { useStore } from "vuex";
import ChatFrame from "./ChatFrame.vue";
import Interact from "./Interact.vue";
import { terminalType } from "@/utils/index";
import { getSystem } from "@/utils/index";
import { likeVideo } from "@/api/video"
import emitter from "@/utils/emitter"
import useGetLiveStatusObj from "@/hooks/useGetLiveStatusObj"
import QuestionnairePopup from "../components/QuestionnairePopup.vue"
import { useStore } from "vuex"
import ChatFrame from "./ChatFrame.vue"
import Interact from "./Interact.vue"
import { terminalType } from "@/utils/index"
import { getSystem } from "@/utils/index"
// import TgChatFrame from "./TgChatFrame.vue";
// import MainInteract from "./MainInteract.vue";
import { queryCartRead } from "@/api/video";
const $liveStatusObj = useGetLiveStatusObj();
const store = useStore();
const system = getSystem();
import { queryCartRead } from "@/api/video"
const $liveStatusObj = useGetLiveStatusObj()
const store = useStore()
const system = getSystem()
const props = defineProps({
detail: {
@ -184,105 +184,102 @@ const props = defineProps({
type: Object,
default: () => ({}),
},
});
})
const msgTipIcon = {
1: require("@/assets/images/open-msg-tip.png"),
2: require("@/assets/images/close-msg-tip.png"),
};
}
const showRecommend = ref(false); //
const route = useRoute();
const showRecommend = ref(false) //
const route = useRoute()
watch(
() => props.activityObj,
() => {
if (props.activityObj && Object.keys(props.activityObj).length) {
showRecommend.value = true;
showRecommend.value = true
}
}
);
)
const newMsgTree = computed(() => {
return store.state.interactMsgObj.newTreeMsg.slice(-3);
});
return store.state.interactMsgObj.newTreeMsg.slice(-3)
})
const showCarPush = ref(false); //
const showCarPush = ref(false) //
watch(
() => props.carPushObj,
() => {
if (props.carPushObj && Object.keys(props.carPushObj).length) {
showCarPush.value = true;
showCarPush.value = true
} else {
showCarPush.value = false;
showCarPush.value = false
}
}
);
)
onBeforeUnmount(() => {
emitter.off("getCouponDetail");
emitter.off("informUserInRoom");
});
emitter.off("getCouponDetail")
emitter.off("informUserInRoom")
})
async function toActivityPage(type) {
if (type === 1) {
location.href = props.activityObj.url;
location.href = props.activityObj.url
} else {
await queryCartRead({
productId: props.carPushObj.productId,
productType: props.carPushObj.productType,
videoId: route.query.id,
saleUserId: route.query.saleUserId,
});
// type // :3 , : 35 , : 32, : 33
let bvideo = `${
props.carPushObj.url.indexOf("?") === -1 ? "?" : "&"
}bvideo=videoId_${route.query.id},type_3`;
if (route.query.saleUserId) {
bvideo = `${bvideo},saleUserId_${route.query.saleUserId}`;
}
location.href = `${props.carPushObj.url}${bvideo}`;
})
location.href = window.config.getCarProductLink({
token: store.state.userInfo.token,
refreshToken: store.state.userInfo.refreshToken,
activityId: props.carPushObj.url,
})
}
}
const text = ref();
const shareRef = ref();
const sendTextLoading = ref(false);
const emit = defineEmits(["sendMsg", "closeActivity", "closeCarPush"]);
const showGuide = ref(false);
const text = ref()
const shareRef = ref()
const sendTextLoading = ref(false)
const emit = defineEmits(["sendMsg", "closeActivity", "closeCarPush"])
const showGuide = ref(false)
const sendMsg = (type, params = {}) => {
if (![1, 4].includes(type)) {
//
emit("sendMsg", type, params);
emit("sendMsg", type, params)
}
switch (type) {
case 1:
if (text.value) {
sendTextLoading.value = true;
sendTextLoading.value = true
emit("sendMsg", type, {
...params,
callBack: () => {
sendTextLoading.value = false;
text.value = "";
sendTextLoading.value = false
text.value = ""
},
errorBack: () => {
sendTextLoading.value = false;
sendTextLoading.value = false
},
});
})
} else {
showToast("请输入互动内容!");
showToast("请输入互动内容!")
}
break;
break
case 4:
dblclickLive();
break;
dblclickLive()
break
case 5:
optShare();
break;
optShare()
break
default:
break;
break
}
}
};
const optShare = () => {
//
@ -290,108 +287,106 @@ const optShare = () => {
typeof WeixinJSBridge === "object" &&
typeof window.WeixinJSBridge.invoke === "function"
) {
showGuide.value = true;
showGuide.value = true
} else {
shareRef.value.showPopup = true;
shareRef.value.showPopup = true
}
}
};
const ChatFrameRef = ref();
const ChatFrameRef = ref()
function inputMsg() {
let bs = ChatFrameRef.value.bs;
bs && bs.stop();
bs && bs.scrollTo(0, bs.maxScrollY, 0);
let bs = ChatFrameRef.value.bs
bs && bs.stop()
bs && bs.scrollTo(0, bs.maxScrollY, 0)
}
function bsRefresh() {
ChatFrameRef.value &&
ChatFrameRef.value.bs &&
ChatFrameRef.value.bs.refresh();
ChatFrameRef.value && ChatFrameRef.value.bs && ChatFrameRef.value.bs.refresh()
}
//
const closeActivity = () => {
showRecommend.value = false;
emit("closeActivity");
};
showRecommend.value = false
emit("closeActivity")
}
//
const closeCarPush = () => {
showCarPush.value = false;
emit("closeCarPush");
};
showCarPush.value = false
emit("closeCarPush")
}
let liveIndex = 0;
let liveIndex = 0
const liveIcon = [
require("@/assets/images/liveIcon/icon1.png"),
require("@/assets/images/liveIcon/icon2.png"),
require("@/assets/images/liveIcon/icon3.png"),
require("@/assets/images/liveIcon/icon4.png"),
];
]
const favorUserCountObj = reactive({
favorUserCount: props.detail.favorUserCount,
isFavor: props.detail.isFavor,
});
})
const sendLikeVideo = async (liveNum) => {
const ret = await likeVideo({
id: props.detail.id,
option: 1,
num: liveNum,
});
})
if (ret.code === 0) {
favorUserCountObj.isFavor = 1;
favorUserCountObj.favorUserCount = ret.data.count;
emitter.emit("updateVideoDetail", favorUserCountObj);
favorUserCountObj.isFavor = 1
favorUserCountObj.favorUserCount = ret.data.count
emitter.emit("updateVideoDetail", favorUserCountObj)
}
};
let sendLiveTime = null;
}
let sendLiveTime = null
const dblclickLive = () => {
const img = document.createElement("img");
img.setAttribute("src", liveIcon[liveIndex % 4]);
img.setAttribute("class", "live-icon");
document.querySelector(".star").appendChild(img);
liveIndex++;
((img) => {
const img = document.createElement("img")
img.setAttribute("src", liveIcon[liveIndex % 4])
img.setAttribute("class", "live-icon")
document.querySelector(".star").appendChild(img)
liveIndex++
;((img) => {
setTimeout(() => {
let star = document.querySelector(".star");
star && star.removeChild(img);
}, 2000);
})(img);
clearTimeout(sendLiveTime);
let star = document.querySelector(".star")
star && star.removeChild(img)
}, 2000)
})(img)
clearTimeout(sendLiveTime)
sendLiveTime = setTimeout(() => {
sendLikeVideo(liveIndex);
liveIndex = 0;
}, 1000);
};
sendLikeVideo(liveIndex)
liveIndex = 0
}, 1000)
}
function bigNumberTransform(value) {
let param = {};
let param = {}
let k = 10000,
sizes = ["", "万", "亿", "万亿"],
i;
i
if (value < k) {
param.value = value;
param.unit = "";
param.value = value
param.unit = ""
} else {
i = Math.floor(Math.log(value) / Math.log(k));
param.value = parseInt(value / Math.pow(k, i));
param.unit = `${sizes[i]}+`;
i = Math.floor(Math.log(value) / Math.log(k))
param.value = parseInt(value / Math.pow(k, i))
param.unit = `${sizes[i]}+`
}
let number = param.value + param.unit;
return number;
let number = param.value + param.unit
return number
}
const couponDetail = ref();
const couponDetail = ref()
//
emitter.on("getCouponDetail", (value) => {
couponDetail.value = value;
});
couponDetail.value = value
})
const showDiscountCoupon = () => {
emitter.emit("showDiscountCoupon", couponDetail.value);
};
emitter.emit("showDiscountCoupon", couponDetail.value)
}
// const getLiveCoupon = async () => {
// let ret = await queryLiveCoupon({
@ -407,45 +402,45 @@ const showDiscountCoupon = () => {
//
// getLiveCoupon();
let tipLook = false;
let tipLook = false
const userInTip = (name) => {
try {
const span = document.createElement("span");
span.innerHTML = `${name} 来了`;
span.setAttribute("class", "user-in-tip");
document.querySelector(".msg-content").appendChild(span);
((span) => {
const span = document.createElement("span")
span.innerHTML = `${name} 来了`
span.setAttribute("class", "user-in-tip")
document.querySelector(".msg-content").appendChild(span)
;((span) => {
setTimeout(() => {
let star = document.querySelector(".msg-content");
star && star.removeChild(span);
tipLook = false;
}, 3000);
})(span);
let star = document.querySelector(".msg-content")
star && star.removeChild(span)
tipLook = false
}, 3000)
})(span)
} catch (error) {
tipLook = false;
tipLook = false
}
}
};
const InteractRef = ref();
const InteractRef = ref()
const showInteractAction = () => {
InteractRef.value.show = true;
};
InteractRef.value.show = true
}
const msgTipIndex = ref(1);
const msgTipIndex = ref(1)
const changeMsgTip = () => {
msgTipIndex.value = msgTipIndex.value === 1 ? 2 : 1;
};
msgTipIndex.value = msgTipIndex.value === 1 ? 2 : 1
}
emitter.on("informUserInRoom", (name) => {
if (!tipLook) {
tipLook = true;
userInTip(name);
tipLook = true
userInTip(name)
}
});
})
defineExpose({
bsRefresh,
});
})
</script>
<style scoped lang="scss">
::v-deep .user-in-tip {