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

This commit is contained in:
2024-07-15 16:06:19 +08:00
parent 6dbb832197
commit f479863d7d

View File

@@ -156,11 +156,11 @@
@click="betSelect(item)" @click="betSelect(item)"
> >
<view <view
:class=" :style="{
formData.betIndexs.includes(item.value) color: formData.betIndexs.includes(item.value)
? 'text-white' ? 'white'
: `text-[${item.color}]` : getTextColor(item.label),
" }"
><view>{{ item.label }}</view> ><view>{{ item.label }}</view>
<view class="text-[25px] text-[#EB1313] leading-[50px]">{{ <view class="text-[25px] text-[#EB1313] leading-[50px]">{{
item.odds item.odds
@@ -171,7 +171,7 @@
</view> </view>
</template> </template>
<!-- </scroll-view> --> <!-- </scroll-view> -->
<view class="h-[400px]"></view> <view class="h-[350px]"></view>
<!-- 操作栏 --> <!-- 操作栏 -->
<view class="fixed bottom-0 w-full"> <view class="fixed bottom-0 w-full">
<!-- 投注信息 --> <!-- 投注信息 -->
@@ -182,7 +182,11 @@
<view <view
> >
<text class="text-[#EB1313]">{{ formData.betIndexs.length }}</text> <text class="text-[#EB1313]">{{ formData.betIndexs.length }}</text>
<text class="text-[#EB1313]">{{ getTotalNum }}</text> 豆子</view
<text class="text-[#EB1313]">{{
formData.betIndexs.length * formData.value
}}</text>
豆子</view
> >
<view> 单注最多可赢 <text class="text-[#EB1313]">100</text> 积分 </view> <view> 单注最多可赢 <text class="text-[#EB1313]">100</text> 积分 </view>
</view> </view>
@@ -199,11 +203,11 @@
>可用豆子: >可用豆子:
<text class="text-[#EB1313]">{{ user.pulse }}</text> 豆子</view <text class="text-[#EB1313]">{{ user.pulse }}</text> 豆子</view
> >
<!-- @input="betIput" -->
<view class="flex" <view class="flex"
>单注: >单注:
<input <input
v-model="formData.value" v-model="formData.value"
@input="betIput"
type="number" 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=""
@@ -213,13 +217,13 @@
</view> </view>
</view> </view>
<!-- 确认投注 --> <!-- 确认投注 -->
<nut-button <view
style="height: 70px; font-size: 36px" class="text-[36px] h-[100px] bg-[red] text-white text-center leading-[100px]"
shape="square" shape="square"
block block
type="primary" type="primary"
@click="submit" @click="submit"
>一键投注</nut-button >一键投注</view
> >
<!-- <button @click="lottieFn(2, 1000)">text</button> --> <!-- <button @click="lottieFn(2, 1000)">text</button> -->
</view> </view>
@@ -262,6 +266,7 @@ const isLottie = ref(false); // 是否显示动画
Taro.useLoad((options) => { Taro.useLoad((options) => {
uid.value = options.uid; uid.value = options.uid;
initWs(options); initWs(options);
loadTplayer();
}); });
const ws = ref(null); const ws = ref(null);
@@ -313,7 +318,6 @@ const initWs = (options) => {
}; };
Taro.useDidShow(() => { Taro.useDidShow(() => {
loadTplayer();
// loadAliplayer(); // loadAliplayer();
// initPlayer(); // initPlayer();
getUserInfo(); getUserInfo();
@@ -333,15 +337,15 @@ const getRecord = async () => {
hm: [ hm: [
{ {
num: item.A, num: item.A,
color: "#088207", color: getTextColor(item.A),
}, },
{ num: item.B, color: "#0500FA" }, { num: item.B, color: getTextColor(item.B) },
{ num: item.C, color: "#0500FA" }, { num: item.C, color: getTextColor(item.C) },
{ num: item.D, color: "#088207" }, { num: item.D, color: getTextColor(item.D) },
{ num: item.E, color: "#FF0204" }, { num: item.E, color: getTextColor(item.E) },
{ num: item.F, color: "#0500FA" }, { num: item.F, color: getTextColor(item.F) },
{}, {},
{ num: item.G, color: "#FF0204" }, { num: item.G, color: getTextColor(item.G) },
], ],
tt: item.Name, tt: item.Name,
t: item.DrawTime, t: item.DrawTime,
@@ -354,6 +358,68 @@ const getNum = async () => {
pStr.value = res.periods; pStr.value = res.periods;
}; };
const getTextColor = (text) => {
const redArr = [
"1",
"2",
"7",
"8",
"12",
"13",
"18",
"19",
"23",
"24",
"29",
"30",
"34",
"35",
"40",
"45",
"46",
];
const blueArr = [
"3",
"4",
"9",
"10",
"14",
"15",
"20",
"25",
"26",
"31",
"36",
"37",
"41",
"42",
"47",
"48",
];
const greenArr = [
"5",
"6",
"11",
"16",
"17",
"21",
"22",
"27",
"28",
"32",
"33",
"38",
"39",
"43",
"44",
"49",
];
if (redArr.includes(text)) return "#FF0204";
if (blueArr.includes(text)) return "#0500FA";
if (greenArr.includes(text)) return "#088207";
};
const getUserInfo = async () => { const getUserInfo = async () => {
const res = await GetUserInfo(uid.value); const res = await GetUserInfo(uid.value);
user.value = res.data; user.value = res.data;
@@ -666,7 +732,7 @@ const betSelect = (item) => {
} else { } else {
formData.value.betIndexs.push(item.value); formData.value.betIndexs.push(item.value);
} }
formData.value.value = ""; // formData.value.value = "";
}; };
const getBetList = async () => { const getBetList = async () => {
@@ -709,13 +775,21 @@ const submit = async () => {
title: "请选择投注项", title: "请选择投注项",
icon: "none", icon: "none",
}); });
if (Number(formData.value.value) % 100 !== 0) {
Taro.showToast({
title: "请输入100的倍数",
icon: "none",
});
return;
}
const arr = []; const arr = [];
betList.value.forEach((item) => { betList.value.forEach((item) => {
formData.value.betIndexs.forEach((i) => { formData.value.betIndexs.forEach((i) => {
if (i === item.value && item.betVal > 0) { if (i === item.value) {
arr.push({ arr.push({
sid: item.value, sid: item.value,
number: item.betVal, number: Number(formData.value.value),
name: item.label, name: item.label,
}); });
} }
@@ -728,6 +802,7 @@ const submit = async () => {
}) })
); );
isBet.value = true; isBet.value = true;
getUserInfo();
clearbet(); clearbet();
}; };