wip: test
This commit is contained in:
@@ -56,8 +56,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.right {
|
.right {
|
||||||
width: 200px;
|
// width: 200px;
|
||||||
height: 80px;
|
// height: 80px;
|
||||||
background-color: rgba(255, 255, 255, 0.4);
|
background-color: rgba(255, 255, 255, 0.4);
|
||||||
border-radius: 40px;
|
border-radius: 40px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@@ -66,6 +66,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
|
padding: 0 20px;
|
||||||
|
|
||||||
.image {
|
.image {
|
||||||
width: 50px;
|
width: 50px;
|
||||||
|
|||||||
@@ -14,14 +14,16 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="info">
|
<view class="info">
|
||||||
<view class="name">{{ userInfo.nickName || '用户' }}</view>
|
<view class="name">{{ userInfo.nickName || '用户' }}</view>
|
||||||
<view class="level">积分: {{ userInfo.integral || 0 }}</view>
|
<!-- <view class="level">积分: {{ userInfo.integral || 0 }}</view> -->
|
||||||
|
<view class="level">积分: {{ jfStr || 0 }}w</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="right">
|
<view class="right">
|
||||||
<view class="image"></view>
|
<view class="image"></view>
|
||||||
|
<!-- <text>{{ dzStr || 0 }}w</text> -->
|
||||||
<text>{{ userInfo.pulse || 0 }}</text>
|
<text>{{ userInfo.pulse || 0 }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="game_btn" @click="handleRule">游戏规则</view>
|
<!-- <view class="game_btn" @click="handleRule">游戏规则</view> -->
|
||||||
</view>
|
</view>
|
||||||
<view class="kj-box">
|
<view class="kj-box">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
@@ -163,6 +165,10 @@ const timeStr = ref('')
|
|||||||
|
|
||||||
const isKj = ref(false)
|
const isKj = ref(false)
|
||||||
|
|
||||||
|
const offColorChange = ref(false)
|
||||||
|
|
||||||
|
const time_i = ref<NodeJS.Timeout>()
|
||||||
|
|
||||||
const countdownFn = () => {
|
const countdownFn = () => {
|
||||||
const currentTimestamp = dayjs().valueOf()
|
const currentTimestamp = dayjs().valueOf()
|
||||||
const timeLeft = kjData.value.drawTime * 1000 - currentTimestamp
|
const timeLeft = kjData.value.drawTime * 1000 - currentTimestamp
|
||||||
@@ -171,19 +177,42 @@ const countdownFn = () => {
|
|||||||
const m = Number(dayjs(timeLeft).format('mm'))
|
const m = Number(dayjs(timeLeft).format('mm'))
|
||||||
const s = Number(dayjs(timeLeft).format('ss'))
|
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) {
|
if (m === 0 && s === 0) {
|
||||||
clearInterval(timeId.value)
|
clearInterval(timeId.value)
|
||||||
|
clearInterval(time_i.value)
|
||||||
|
offColorChange.value = true
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
get_list()
|
get_list()
|
||||||
get_info()
|
get_info()
|
||||||
}, 3000)
|
}, 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 get_info = async () => {
|
||||||
const res = await get_user_info(Taro.getStorageSync('uid'))
|
const res = await get_user_info(Taro.getStorageSync('uid'))
|
||||||
|
|
||||||
userInfo.value = res.data.data || {}
|
userInfo.value = res.data.data || {}
|
||||||
|
|
||||||
|
dzStr.value = String(userInfo.value.pulse / 10000)
|
||||||
|
jfStr.value = String(userInfo.value.integral / 10000)
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleClick = (itemOpt) => {
|
const handleClick = (itemOpt) => {
|
||||||
@@ -238,12 +267,12 @@ const handleBet = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleRule = () => {
|
// const handleRule = () => {
|
||||||
Taro.showToast({
|
// Taro.showToast({
|
||||||
title: '暂无规则',
|
// title: '暂无规则',
|
||||||
icon: 'none',
|
// icon: 'none',
|
||||||
})
|
// })
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 前往开奖和投注记录
|
// 前往开奖和投注记录
|
||||||
const toPage = (type: number) => {
|
const toPage = (type: number) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user