update
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-10-08 17:58:12 +08:00
parent 3fdc176008
commit 91429a1a38
3 changed files with 34 additions and 3 deletions

View File

@@ -18,3 +18,6 @@ export const GetIsWin = async (uid) =>
// 获取中奖信息 // 获取中奖信息
export const GetWinInfo = async () => export const GetWinInfo = async () =>
await alovaInst.Get(`/dice/all/user/win`); await alovaInst.Get(`/dice/all/user/win`);
// 获取参与人数
export const GetJoinNum = async () => await alovaInst.Get(`/dice/user/play/count`);

View File

@@ -82,11 +82,14 @@
.danmaku-box { .danmaku-box {
width: 100%; width: 100%;
height: 420px;
.danmaku { .danmaku {
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 420px; height: 420px;
top: 0; top: 0;
z-index: 1;
} }
} }

View File

@@ -2,11 +2,9 @@
<view class="relative absolute"> <view class="relative absolute">
<!-- 直播区域 --> <!-- 直播区域 -->
<view id="Player" class="w-full h-[420px] relative"> </view>
<view class="danmaku-box"> <view class="danmaku-box">
<vue-danmaku ref="danmakuRef" class="danmaku" v-model:danmus="danmus" useSlot :speeds="100"> <vue-danmaku ref="danmakuRef" class="danmaku" v-model:danmus="danmus" useSlot loop :speeds="100">
<template v-slot:dm="{ danmu }"> <template v-slot:dm="{ danmu }">
<!-- <span>{{ index }}{{ danmu.name }}{{ danmu.text }}</span> -->
<view class="flex items-center text-box"> <view class="flex items-center text-box">
<image class="w-[45px] h-[45px] mr-[10px] rounded-full" :src="danmu.User.avatarUrl"></image> <image class="w-[45px] h-[45px] mr-[10px] rounded-full" :src="danmu.User.avatarUrl"></image>
<text class="text-[#fff] text-[28px]">恭喜{{ danmu.User.nickName }}获得{{ danmu.DrawNum }}积分,价值{{ <text class="text-[#fff] text-[28px]">恭喜{{ danmu.User.nickName }}获得{{ danmu.DrawNum }}积分,价值{{
@@ -15,6 +13,7 @@
</view> </view>
</template> </template>
</vue-danmaku> </vue-danmaku>
<view id="Player" class="w-full h-[420px]"></view>
</view> </view>
<!-- <view id="J_prismPlayer"></view> --> <!-- <view id="J_prismPlayer"></view> -->
@@ -61,9 +60,12 @@
<right theme="filled" size="25" fill="#ffffff" /> <right theme="filled" size="25" fill="#ffffff" />
</navigator> </navigator>
</view> </view>
<view class="text-[25px] font-bold text-[red] text-center mt-[10px] mb-[10px]">当前参与人数: {{ joinNum }}</view>
<!-- 开奖 --> <!-- 开奖 -->
<view class="flex justify-between items-center p-[20px]"> <view class="flex justify-between items-center p-[20px]">
<view class="text-center relative aft"> <view class="text-center relative aft">
<view class="text-[28px] text-[#333333]">{{ pStr }}期截止时间</view> <view class="text-[28px] text-[#333333]">{{ pStr }}期截止时间</view>
<view class="text-[red] text-[40px]">{{ tStr }}</view> <view class="text-[red] text-[40px]">{{ tStr }}</view>
</view> </view>
@@ -193,6 +195,7 @@ import {
GetBetRecord, GetBetRecord,
GetIsWin, GetIsWin,
GetWinInfo, GetWinInfo,
GetJoinNum
} from "../../api"; } from "../../api";
import "tcplayer.js/dist/tcplayer.min.css"; import "tcplayer.js/dist/tcplayer.min.css";
// import Srs from "../../utils/srs.sdk"; // import Srs from "../../utils/srs.sdk";
@@ -210,6 +213,16 @@ onMounted(() => { });
const danmakuRef = ref(); const danmakuRef = ref();
const danmus = 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); const player = ref(null);
@@ -282,6 +295,7 @@ Taro.useDidShow(() => {
getBetList(); getBetList();
getRecord(); getRecord();
getNum(); getNum();
getJoinNum();
}); });
const uid = ref(""); const uid = ref("");
@@ -858,6 +872,17 @@ const getWinInfo = async () => {
// danmus.value = [{ img: "https://img.loliapi.cn/i/pp/img132.webp", name: "huakk", text: "恭喜你中奖了" }]; // danmus.value = [{ img: "https://img.loliapi.cn/i/pp/img132.webp", name: "huakk", text: "恭喜你中奖了" }];
danmakuRef.value.play(); danmakuRef.value.play();
}; };
const joinNum = ref(0);
const getJoinNum = async () => {
const res = await GetJoinNum();
joinNum.value = res.number;
}
setInterval(() => {
getJoinNum();
}, 5000)
</script> </script>
<style lang="scss"></style> <style lang="scss"></style>