From 25a9f6459e832ad72575d3a8e51f9e2e14a7d663 Mon Sep 17 00:00:00 2001
From: YuanHuakk <1751826683@qq.com>
Date: Tue, 2 Jan 2024 09:23:56 +0800
Subject: [PATCH] wip: test
---
src/pages/aoshi/index/index.scss | 5 ++--
src/pages/aoshi/index/index.vue | 47 ++++++++++++++++++++++++++------
2 files changed, 41 insertions(+), 11 deletions(-)
diff --git a/src/pages/aoshi/index/index.scss b/src/pages/aoshi/index/index.scss
index 04a0ce4..6e7b3c3 100644
--- a/src/pages/aoshi/index/index.scss
+++ b/src/pages/aoshi/index/index.scss
@@ -56,8 +56,8 @@
}
.right {
- width: 200px;
- height: 80px;
+ // width: 200px;
+ // height: 80px;
background-color: rgba(255, 255, 255, 0.4);
border-radius: 40px;
text-align: center;
@@ -66,6 +66,7 @@
display: flex;
align-items: center;
justify-content: space-around;
+ padding: 0 20px;
.image {
width: 50px;
diff --git a/src/pages/aoshi/index/index.vue b/src/pages/aoshi/index/index.vue
index 5622749..f4b0cd2 100644
--- a/src/pages/aoshi/index/index.vue
+++ b/src/pages/aoshi/index/index.vue
@@ -14,14 +14,16 @@
{{ userInfo.nickName || '用户' }}
- 积分: {{ userInfo.integral || 0 }}
+
+ 积分: {{ jfStr || 0 }}w
+
{{ userInfo.pulse || 0 }}
- 游戏规则
+
@@ -163,6 +165,10 @@ const timeStr = ref('')
const isKj = ref(false)
+const offColorChange = ref(false)
+
+const time_i = ref()
+
const countdownFn = () => {
const currentTimestamp = dayjs().valueOf()
const timeLeft = kjData.value.drawTime * 1000 - currentTimestamp
@@ -171,19 +177,42 @@ const countdownFn = () => {
const m = Number(dayjs(timeLeft).format('mm'))
const s = Number(dayjs(timeLeft).format('ss'))
+ isKj.value = m === 0 && s < 40 ? true : false
+
+ if (m === 0 && s < 40 && !offColorChange.value) {
+ startColorFn()
+ }
+
if (m === 0 && s === 0) {
clearInterval(timeId.value)
+ clearInterval(time_i.value)
+ offColorChange.value = true
setTimeout(() => {
get_list()
get_info()
}, 3000)
}
- isKj.value = m === 0 && s < 40 ? true : false
}
+const startColorFn = () => {
+ nums.value.forEach((item) => {
+ item.active = false
+ })
+
+ // 随机选中一个
+ const randomNum = Math.floor(Math.random() * nums.value.length)
+ nums.value[randomNum].active = true
+}
+const dzStr = ref('')
+const jfStr = ref('')
+
const get_info = async () => {
const res = await get_user_info(Taro.getStorageSync('uid'))
+
userInfo.value = res.data.data || {}
+
+ dzStr.value = String(userInfo.value.pulse / 10000)
+ jfStr.value = String(userInfo.value.integral / 10000)
}
const handleClick = (itemOpt) => {
@@ -238,12 +267,12 @@ const handleBet = () => {
})
}
-const handleRule = () => {
- Taro.showToast({
- title: '暂无规则',
- icon: 'none',
- })
-}
+// const handleRule = () => {
+// Taro.showToast({
+// title: '暂无规则',
+// icon: 'none',
+// })
+// }
// 前往开奖和投注记录
const toPage = (type: number) => {