This commit is contained in:
@@ -156,11 +156,11 @@
|
||||
@click="betSelect(item)"
|
||||
>
|
||||
<view
|
||||
:class="
|
||||
formData.betIndexs.includes(item.value)
|
||||
? 'text-white'
|
||||
: `text-[${item.color}]`
|
||||
"
|
||||
:style="{
|
||||
color: formData.betIndexs.includes(item.value)
|
||||
? 'white'
|
||||
: getTextColor(item.label),
|
||||
}"
|
||||
><view>{{ item.label }}</view>
|
||||
<view class="text-[25px] text-[#EB1313] leading-[50px]">{{
|
||||
item.odds
|
||||
@@ -171,7 +171,7 @@
|
||||
</view>
|
||||
</template>
|
||||
<!-- </scroll-view> -->
|
||||
<view class="h-[400px]"></view>
|
||||
<view class="h-[350px]"></view>
|
||||
<!-- 操作栏 -->
|
||||
<view class="fixed bottom-0 w-full">
|
||||
<!-- 投注信息 -->
|
||||
@@ -182,7 +182,11 @@
|
||||
<view
|
||||
>共
|
||||
<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>
|
||||
@@ -199,11 +203,11 @@
|
||||
>可用豆子:
|
||||
<text class="text-[#EB1313]">{{ user.pulse }}</text> 豆子</view
|
||||
>
|
||||
<!-- @input="betIput" -->
|
||||
<view class="flex"
|
||||
>单注:
|
||||
<input
|
||||
v-model="formData.value"
|
||||
@input="betIput"
|
||||
type="number"
|
||||
class="ml-1 mr-1 border border-[#D9D9D9] rounded-[10px] w-[140px] pl-[10px] pr-[10px] text-[#FF0204] text-center"
|
||||
placeholder=""
|
||||
@@ -213,13 +217,13 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- 确认投注 -->
|
||||
<nut-button
|
||||
style="height: 70px; font-size: 36px"
|
||||
<view
|
||||
class="text-[36px] h-[100px] bg-[red] text-white text-center leading-[100px]"
|
||||
shape="square"
|
||||
block
|
||||
type="primary"
|
||||
@click="submit"
|
||||
>一键投注</nut-button
|
||||
>一键投注</view
|
||||
>
|
||||
<!-- <button @click="lottieFn(2, 1000)">text</button> -->
|
||||
</view>
|
||||
@@ -262,6 +266,7 @@ const isLottie = ref(false); // 是否显示动画
|
||||
Taro.useLoad((options) => {
|
||||
uid.value = options.uid;
|
||||
initWs(options);
|
||||
loadTplayer();
|
||||
});
|
||||
|
||||
const ws = ref(null);
|
||||
@@ -313,7 +318,6 @@ const initWs = (options) => {
|
||||
};
|
||||
|
||||
Taro.useDidShow(() => {
|
||||
loadTplayer();
|
||||
// loadAliplayer();
|
||||
// initPlayer();
|
||||
getUserInfo();
|
||||
@@ -333,15 +337,15 @@ const getRecord = async () => {
|
||||
hm: [
|
||||
{
|
||||
num: item.A,
|
||||
color: "#088207",
|
||||
color: getTextColor(item.A),
|
||||
},
|
||||
{ num: item.B, color: "#0500FA" },
|
||||
{ num: item.C, color: "#0500FA" },
|
||||
{ num: item.D, color: "#088207" },
|
||||
{ num: item.E, color: "#FF0204" },
|
||||
{ num: item.F, color: "#0500FA" },
|
||||
{ num: item.B, color: getTextColor(item.B) },
|
||||
{ num: item.C, color: getTextColor(item.C) },
|
||||
{ num: item.D, color: getTextColor(item.D) },
|
||||
{ num: item.E, color: getTextColor(item.E) },
|
||||
{ num: item.F, color: getTextColor(item.F) },
|
||||
{},
|
||||
{ num: item.G, color: "#FF0204" },
|
||||
{ num: item.G, color: getTextColor(item.G) },
|
||||
],
|
||||
tt: item.Name,
|
||||
t: item.DrawTime,
|
||||
@@ -354,6 +358,68 @@ const getNum = async () => {
|
||||
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 res = await GetUserInfo(uid.value);
|
||||
user.value = res.data;
|
||||
@@ -666,7 +732,7 @@ const betSelect = (item) => {
|
||||
} else {
|
||||
formData.value.betIndexs.push(item.value);
|
||||
}
|
||||
formData.value.value = "";
|
||||
// formData.value.value = "";
|
||||
};
|
||||
|
||||
const getBetList = async () => {
|
||||
@@ -709,13 +775,21 @@ const submit = async () => {
|
||||
title: "请选择投注项",
|
||||
icon: "none",
|
||||
});
|
||||
|
||||
if (Number(formData.value.value) % 100 !== 0) {
|
||||
Taro.showToast({
|
||||
title: "请输入100的倍数",
|
||||
icon: "none",
|
||||
});
|
||||
return;
|
||||
}
|
||||
const arr = [];
|
||||
betList.value.forEach((item) => {
|
||||
formData.value.betIndexs.forEach((i) => {
|
||||
if (i === item.value && item.betVal > 0) {
|
||||
if (i === item.value) {
|
||||
arr.push({
|
||||
sid: item.value,
|
||||
number: item.betVal,
|
||||
number: Number(formData.value.value),
|
||||
name: item.label,
|
||||
});
|
||||
}
|
||||
@@ -728,6 +802,7 @@ const submit = async () => {
|
||||
})
|
||||
);
|
||||
isBet.value = true;
|
||||
getUserInfo();
|
||||
clearbet();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user