Compare commits

9 Commits

Author SHA1 Message Date
d84fab8977 update
All checks were successful
continuous-integration/drone/push Build is passing
2024-12-20 16:08:34 +08:00
e11c83235d update
All checks were successful
continuous-integration/drone/push Build is passing
2024-12-19 21:12:37 +08:00
f596891d5a update
All checks were successful
continuous-integration/drone/push Build is passing
2024-10-11 23:23:16 +08:00
67ddfd36db update
All checks were successful
continuous-integration/drone/push Build is passing
2024-10-11 23:18:26 +08:00
22592a1826 update
All checks were successful
continuous-integration/drone/push Build is passing
2024-10-11 23:05:51 +08:00
c58db3595c update
All checks were successful
continuous-integration/drone/push Build is passing
2024-10-11 22:24:43 +08:00
4386ff3652 update
All checks were successful
continuous-integration/drone/push Build is passing
2024-10-11 22:19:33 +08:00
519e3242f4 增加弹幕源
All checks were successful
continuous-integration/drone/push Build is passing
2024-10-11 21:40:14 +08:00
91429a1a38 update
All checks were successful
continuous-integration/drone/push Build is passing
2024-10-08 17:58:12 +08:00
3 changed files with 194 additions and 67 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

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

View File

@@ -1,37 +1,56 @@
<template> <template>
<view class="relative absolute"> <view class="relative">
<!-- 直播区域 --> <!-- 直播区域 -->
<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
: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
<text class="text-[#fff] text-[28px]">恭喜{{ danmu.User.nickName }}获得{{ danmu.DrawNum }}积分,价值{{ class="w-[45px] h-[45px] mr-[10px] rounded-full"
danmu.Number :src="danmu.User.avatarUrl"
}}</text> ></image>
<text class="text-[#fff] text-[28px]"
>恭喜{{ danmu.User.nickName }}获得{{ danmu.DrawNum }}积分,价值{{
danmu.Number
}}</text
>
</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> -->
<!-- <view class="player" id="mse"></view> --> <!-- <view class="player" id="mse"></view> -->
<!-- 头部 --> <!-- 头部 -->
<view class="z-50 bg-[#EB1313] w-full h-[110px] p-[18px] text-[30px] flex text-white justify-between items-center"> <view
class="z-50 bg-[#EB1313] w-full h-[110px] p-[18px] text-[30px] flex text-white justify-between items-center"
>
<view>积分: {{ user.integral }}</view> <view>积分: {{ user.integral }}</view>
<view class="flex items-center justify-center"> <view class="flex items-center justify-center">
<view class="pr-[10px] text-[25px]"> <view class="pr-[10px] text-[25px]">
<view></view> <view></view>
<view></view> <view></view>
</view> </view>
<nut-popover v-model:visible="showSelector" :list="selector" location="bottom" @choose="onChange"> <nut-popover
v-model:visible="showSelector"
:list="selector"
location="bottom"
@choose="onChange"
>
<template #reference> <template #reference>
<!-- @click.stop="showSelector = !showSelector" --> <!-- @click.stop="showSelector = !showSelector" -->
<view @click.stop="showSelector = !showSelector" <view
class="w-[200px] h-[70px] pl-2 pr-2 border-2 rounded-md border-white flex items-center justify-center"> @click.stop="showSelector = !showSelector"
class="w-[200px] h-[70px] pl-2 pr-2 border-2 rounded-md border-white flex items-center justify-center"
>
<view>{{ formData.selectorChecked }}</view> <view>{{ formData.selectorChecked }}</view>
<down theme="filled" size="25" fill="#fff" /> <down theme="filled" size="25" fill="#fff" />
</view> </view>
@@ -55,12 +74,20 @@
</view> </view>
</template> </template>
</nut-popover> --> </nut-popover> -->
<navigator :url="`/pages/bet_record/index?uid=${uid}`" open-type="navigate" hover-class="none" <navigator
class="flex items-center"> :url="`/pages/bet_record/index?uid=${uid}`"
open-type="navigate"
hover-class="none"
class="flex items-center"
>
<view>投注记录</view> <view>投注记录</view>
<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">
@@ -68,26 +95,46 @@
<view class="text-[red] text-[40px]">{{ tStr }}</view> <view class="text-[red] text-[40px]">{{ tStr }}</view>
</view> </view>
<view class="flex flex-col items-center popover"> <view class="flex flex-col items-center popover">
<nut-popover v-model:visible="showTable" location="bottom" @open="openTable"> <nut-popover
v-model:visible="showTable"
location="bottom"
@open="openTable"
>
<template #reference> <template #reference>
<view class="flex items-center" @click.stop="showTable = !showTable"> <view
class="flex items-center"
@click.stop="showTable = !showTable"
>
<text class="text-[#333333] text-[28px]">近期开奖</text> <text class="text-[#333333] text-[28px]">近期开奖</text>
<down class="mr-1" theme="filled" size="25" fill="#333333" /> <down class="mr-1" theme="filled" size="25" fill="#333333" />
</view> </view>
</template> </template>
<template #content> <template #content>
<nut-table style="width: 900px" :columns="columns" :data="data" striped :bordered="true"></nut-table> <nut-table
style="width: 900px"
:columns="columns"
:data="data"
striped
:bordered="true"
></nut-table>
</template> </template>
</nut-popover> </nut-popover>
<view class="flex"> <view class="flex">
<view class="m-[5px] rounded-full w-[44px] h-[44px] text-white text-[28px] text-center leading-[44px]" <view
v-for="(item, index) in numList" :key="index"> class="m-[5px] rounded-full w-[44px] h-[44px] text-white text-[28px] text-center leading-[44px]"
v-for="(item, index) in numList"
:key="index"
>
<view v-if="!item.num" class="m-[5px]"> <view v-if="!item.num" class="m-[5px]">
<plus-cross theme="filled" size="20" fill="#333333" /> <plus-cross theme="filled" size="20" fill="#333333" />
</view> </view>
<view class="rounded-full" :style="{ <view
backgroundColor: item.color, class="rounded-full"
}">{{ item.num }}</view> :style="{
backgroundColor: item.color,
}"
>{{ item.num }}</view
>
</view> </view>
</view> </view>
</view> </view>
@@ -96,20 +143,30 @@
<!-- <scroll-view scroll-y class="h-[800px]"> --> <!-- <scroll-view scroll-y class="h-[800px]"> -->
<template v-if="formData.betType !== 2"> <template v-if="formData.betType !== 2">
<view class="grid gap-1 grid-cols-4 place-items-center p-[20px]"> <view class="grid gap-1 grid-cols-4 place-items-center p-[20px]">
<view v-for="(item, index) in betList" :key="index" <view
v-for="(item, index) in betList"
:key="index"
class="shadow-md border border-[#E6E6E6] rounded-[10px] w-[150px] mb-[20px] h-[150px] max-[150px] bg-[red] text-center flex justify-center items-center" class="shadow-md border border-[#E6E6E6] rounded-[10px] w-[150px] mb-[20px] h-[150px] max-[150px] bg-[red] text-center flex justify-center items-center"
:class="formData.betIndexs.includes(item.value) :class="
? 'bg-[#EB1313]' formData.betIndexs.includes(item.value)
: 'bg-white' ? 'bg-[#EB1313]'
" @click="betSelect(item)"> : 'bg-white'
<view :class="formData.betIndexs.includes(item.value) ? 'text-white' : ''"> "
@click="betSelect(item)"
>
<view
:class="formData.betIndexs.includes(item.value) ? 'text-white' : ''"
>
<view>{{ item.label }}</view> <view>{{ item.label }}</view>
<view :class="[ <view
formData.betIndexs.includes(item.value) :class="[
? 'text-white' formData.betIndexs.includes(item.value)
: 'text-[#EB1313]', ? 'text-white'
'text-[30px]', : 'text-[#EB1313]',
]">{{ item.odds }}</view> 'text-[30px]',
]"
>{{ item.odds }}</view
>
<!-- <viwe v-if="item.betVal > 0">{{ item.betVal }}</viwe> --> <!-- <viwe v-if="item.betVal > 0">{{ item.betVal }}</viwe> -->
</view> </view>
</view> </view>
@@ -117,17 +174,24 @@
</template> </template>
<template v-else> <template v-else>
<view class="grid gap-5 grid-cols-6 place-items-center p-[20px]"> <view class="grid gap-5 grid-cols-6 place-items-center p-[20px]">
<view v-for="(item, index) in betList" :key="index" <view
v-for="(item, index) in betList"
:key="index"
class="shadow-md border border-[#E6E6E6] rounded-full w-[80px] mb-[20px] h-[80px] max-[200px]: bg-[red] text-center leading-[80px]" class="shadow-md border border-[#E6E6E6] rounded-full w-[80px] mb-[20px] h-[80px] max-[200px]: bg-[red] text-center leading-[80px]"
:class="formData.betIndexs.includes(item.value) :class="
? 'bg-[#EB1313]' formData.betIndexs.includes(item.value)
: 'bg-white' ? 'bg-[#EB1313]'
" @click="betSelect(item)"> : 'bg-white'
<view :style="{ "
color: formData.betIndexs.includes(item.value) @click="betSelect(item)"
? 'white' >
: getTextColor(item.label), <view
}"> :style="{
color: formData.betIndexs.includes(item.value)
? 'white'
: getTextColor(item.label),
}"
>
<view>{{ item.label }}</view> <view>{{ item.label }}</view>
<view class="text-[28px] text-[#EB1313] leading-[50px]">{{ <view class="text-[28px] text-[#EB1313] leading-[50px]">{{
item.odds item.odds
@@ -142,9 +206,12 @@
<!-- 操作栏 --> <!-- 操作栏 -->
<view class="fixed bottom-0 w-full"> <view class="fixed bottom-0 w-full">
<!-- 投注信息 --> <!-- 投注信息 -->
<view v-if="formData.betIndexs.length > 0" <view
class="bg-[#F5F5F5] w-full text-[28px] p-[26px] flex justify-between items-center"> v-if="formData.betIndexs.length > 0"
<view> class="bg-[#F5F5F5] w-full text-[28px] p-[26px] flex justify-between items-center"
>
<view
>
<text class="text-[#EB1313]">{{ formData.betIndexs.length }}</text> <text class="text-[#EB1313]">{{ formData.betIndexs.length }}</text>
<text class="text-[#EB1313]">{{ <text class="text-[#EB1313]">{{
@@ -154,25 +221,41 @@
</view> </view>
<!-- <view> 单注最多可赢 <text class="text-[#EB1313]">100</text> 积分 </view> --> <!-- <view> 单注最多可赢 <text class="text-[#EB1313]">100</text> 积分 </view> -->
</view> </view>
<view class="bg-white p-[30px] w-full text-[28px] flex justify-between items-center"> <view
<view @click="clearbet" class="bg-white p-[30px] w-full text-[28px] flex justify-between items-center"
class="bg-[#FFE8E8] rounded-[10px] border border-[#FF0204] w-[100px] h-[60px] text-[#FF0204] text-center leading-[60px]"> >
清空</view> <view
@click="clearbet"
class="bg-[#FFE8E8] rounded-[10px] border border-[#FF0204] w-[100px] h-[60px] text-[#FF0204] text-center leading-[60px]"
>
清空</view
>
<view> <view>
<view>可用豆子: <text class="text-[#EB1313]">{{ user.pulse }}</text> 豆子 <view
>可用豆子: <text class="text-[#EB1313]">{{ user.pulse }}</text> 豆子
</view> </view>
<!-- @input="betIput" --> <!-- @input="betIput" -->
<view class="flex">单注: <view class="flex"
<input v-model="formData.value" type="number" >单注:
<input
v-model="formData.value"
type="number"
class="ml-1 mr-1 border border-[#D9D9D9] rounded-[10px] w-[140px] pl-[10px] pr-[10px] text-[#FF0204] text-center" class="ml-1 mr-1 border border-[#D9D9D9] rounded-[10px] w-[140px] pl-[10px] pr-[10px] text-[#FF0204] text-center"
placeholder="" /> placeholder=""
/>
豆子 豆子
</view> </view>
</view> </view>
</view> </view>
<!-- 确认投注 --> <!-- 确认投注 -->
<view class="text-[36px] h-[100px] bg-[red] text-white text-center leading-[100px]" shape="square" block <view
type="primary" @click="submit">一键投注</view> class="text-[36px] h-[100px] bg-[red] text-white text-center leading-[100px]"
shape="square"
block
type="primary"
@click="submit"
>一键投注</view
>
<!-- <button @click="lottieFn(2, 1000)">text</button> --> <!-- <button @click="lottieFn(2, 1000)">text</button> -->
</view> </view>
<view id="lottie" v-show="isLottie"></view> <view id="lottie" v-show="isLottie"></view>
@@ -193,6 +276,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";
@@ -205,11 +289,23 @@ import wzj from "../../static/wzj.json";
import zj from "../../static/zj.json"; import zj from "../../static/zj.json";
import vueDanmaku from "vue3-danmaku"; import vueDanmaku from "vue3-danmaku";
onMounted(() => { }); onMounted(() => {
// getWinInfo()
});
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 +378,7 @@ Taro.useDidShow(() => {
getBetList(); getBetList();
getRecord(); getRecord();
getNum(); getNum();
getJoinNum();
}); });
const uid = ref(""); const uid = ref("");
@@ -520,12 +617,12 @@ const initPlayer = () => {
const showSelector = ref(false); const showSelector = ref(false);
const selector = ref([ const selector = ref([
{ name: "单双", value: 3 },
{ name: "特码", value: 2 }, { name: "特码", value: 2 },
{ {
name: "头尾数", name: "头尾数",
value: 1, value: 1,
}, },
{ name: "单双", value: 3 },
]); ]);
const onChange = async ({ name, value }) => { const onChange = async ({ name, value }) => {
@@ -663,13 +760,13 @@ const columns = ref([
const data = ref([]); const data = ref([]);
const openTable = () => { }; const openTable = () => {};
const numList = ref([]); const numList = ref([]);
const formData = ref({ const formData = ref({
selectorChecked: "特码", selectorChecked: "单双",
betType: 2, betType: 3,
betIndexs: [], betIndexs: [],
value: "", value: "",
total: 0, total: 0,
@@ -845,8 +942,7 @@ const lottieFn = async (type, num = 0) => {
// 获取中奖信息 // 获取中奖信息
setTimeout(() => { setTimeout(() => {
getWinInfo(); getWinInfo();
}, 1500) }, 1500);
}); });
getUserInfo(); getUserInfo();
}; };
@@ -855,9 +951,35 @@ const getWinInfo = async () => {
danmus.value = []; danmus.value = [];
const res = await GetWinInfo(); const res = await GetWinInfo();
danmus.value = res.list; danmus.value = res.list;
// danmus.value = [{ img: "https://img.loliapi.cn/i/pp/img132.webp", name: "huakk", text: "恭喜你中奖了" }]; Taro.request({
url: "https://danmu.jdt168.com/get_danmu",
method: "GET",
success: ({ data: res }) => {
const newData = res.data.map((item) => ({
User: {
nickName: item.nick_name,
avatarUrl: item.avatar,
},
DrawNum: item.draw_num,
Number: item.win_number,
}));
danmus.value.push(...newData);
},
});
danmakuRef.value.play(); danmakuRef.value.play();
}; };
const joinNum = ref(0);
const getJoinNum = async () => {
const res = await GetJoinNum();
const random_num = Math.floor(Math.random() * (300 - 100));
joinNum.value = res.number ? res.number : random_num;
};
setInterval(() => {
getJoinNum();
}, 20 * 1000);
</script> </script>
<style lang="scss"></style> <style lang="scss"></style>