wip: test
This commit is contained in:
@@ -14,14 +14,16 @@
|
||||
</view>
|
||||
<view class="info">
|
||||
<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 class="right">
|
||||
<view class="image"></view>
|
||||
<!-- <text>{{ dzStr || 0 }}w</text> -->
|
||||
<text>{{ userInfo.pulse || 0 }}</text>
|
||||
</view>
|
||||
<view class="game_btn" @click="handleRule">游戏规则</view>
|
||||
<!-- <view class="game_btn" @click="handleRule">游戏规则</view> -->
|
||||
</view>
|
||||
<view class="kj-box">
|
||||
<view class="title">
|
||||
@@ -163,6 +165,10 @@ const timeStr = ref('')
|
||||
|
||||
const isKj = ref(false)
|
||||
|
||||
const offColorChange = ref(false)
|
||||
|
||||
const time_i = ref<NodeJS.Timeout>()
|
||||
|
||||
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) => {
|
||||
|
||||
Reference in New Issue
Block a user