diff --git a/src/api/index.js b/src/api/index.js index 2a6998f..6576a17 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -18,3 +18,6 @@ export const GetIsWin = async (uid) => // 获取中奖信息 export const GetWinInfo = async () => await alovaInst.Get(`/dice/all/user/win`); + +// 获取参与人数 +export const GetJoinNum = async () => await alovaInst.Get(`/dice/user/play/count`); diff --git a/src/pages/index/index.scss b/src/pages/index/index.scss index d8a41e9..cb3c02e 100644 --- a/src/pages/index/index.scss +++ b/src/pages/index/index.scss @@ -82,11 +82,14 @@ .danmaku-box { width: 100%; + height: 420px; + .danmaku { position: absolute; width: 100%; height: 420px; top: 0; + z-index: 1; } } diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index b1f3c84..2284706 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -2,11 +2,9 @@ - - + + @@ -61,9 +60,12 @@ + 当前参与人数: {{ joinNum }} + + 距{{ pStr }}期截止时间 {{ tStr }} @@ -193,6 +195,7 @@ import { GetBetRecord, GetIsWin, GetWinInfo, + GetJoinNum } from "../../api"; import "tcplayer.js/dist/tcplayer.min.css"; // import Srs from "../../utils/srs.sdk"; @@ -210,6 +213,16 @@ onMounted(() => { }); const danmakuRef = ref(); const danmus = ref([]); +// const danmus = ref([ +// { +// User: { +// avatarUrl: "https://img.loliapi.cn/i/pp/img132.web", +// nickName: "Huakk" +// }, +// DrawNum: "10000", +// Number: "100" +// } +// ]); const player = ref(null); @@ -282,6 +295,7 @@ Taro.useDidShow(() => { getBetList(); getRecord(); getNum(); + getJoinNum(); }); const uid = ref(""); @@ -858,6 +872,17 @@ const getWinInfo = async () => { // danmus.value = [{ img: "https://img.loliapi.cn/i/pp/img132.webp", name: "huakk", text: "恭喜你中奖了" }]; danmakuRef.value.play(); }; + +const joinNum = ref(0); + +const getJoinNum = async () => { + const res = await GetJoinNum(); + joinNum.value = res.number; +} + +setInterval(() => { + getJoinNum(); +}, 5000)