diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue
index 7b166dc..f18e4d5 100644
--- a/src/pages/index/index.vue
+++ b/src/pages/index/index.vue
@@ -156,11 +156,11 @@
@click="betSelect(item)"
>
{{ item.label }}
{{
item.odds
@@ -171,7 +171,7 @@
-
+
@@ -182,7 +182,11 @@
共
{{ formData.betIndexs.length }} 注
- 共 {{ getTotalNum }} 豆子{{
+ formData.betIndexs.length * formData.value
+ }}
+ 豆子
单注最多可赢 100 积分
@@ -199,11 +203,11 @@
>可用豆子:
{{ user.pulse }} 豆子
+
单注:
- 一键投注一键投注
@@ -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();
};