i
This commit is contained in:
@@ -11,5 +11,5 @@ export default defineAppConfig({
|
|||||||
navigationBarTitleText: 'Game',
|
navigationBarTitleText: 'Game',
|
||||||
navigationBarTextStyle: 'black'
|
navigationBarTextStyle: 'black'
|
||||||
},
|
},
|
||||||
// animation: false
|
animation: false
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
.index {
|
.index {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100vh;
|
||||||
|
|
||||||
.swiper {
|
.swiper {
|
||||||
background-color: white;
|
background-color: white;
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
.index {
|
.index {
|
||||||
|
width: 100%;
|
||||||
|
height: 100vh;
|
||||||
.title {
|
.title {
|
||||||
margin: 60px;
|
margin: 60px;
|
||||||
font-size: 50px;
|
font-size: 50px;
|
||||||
|
|||||||
@@ -3,14 +3,14 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
.tips {
|
//.tips {
|
||||||
border-radius: 0;
|
// border-radius: 0;
|
||||||
width: 100%;
|
// width: 100%;
|
||||||
height: 60px;
|
// height: 60px;
|
||||||
}
|
//}
|
||||||
|
|
||||||
.userInfo {
|
.userInfo {
|
||||||
width: 680px;
|
width: 90%;
|
||||||
margin: 20px auto;
|
margin: 20px auto;
|
||||||
//margin: auto;
|
//margin: auto;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.gameInfo {
|
.gameInfo {
|
||||||
width: 680px;
|
width: 90%;
|
||||||
margin: 20px auto;
|
margin: 20px auto;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -90,7 +90,7 @@
|
|||||||
|
|
||||||
.game_box {
|
.game_box {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
width: 250px;
|
width: 200px;
|
||||||
// 文字超出显示省略号
|
// 文字超出显示省略号
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
@@ -119,6 +119,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.center {
|
||||||
|
font-size: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
.right {
|
.right {
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
@@ -178,25 +182,42 @@
|
|||||||
|
|
||||||
.opt1 {
|
.opt1 {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-evenly;
|
justify-content: space-between;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
height: 400px;
|
||||||
|
padding: 10px;
|
||||||
|
|
||||||
|
.optt {
|
||||||
|
width: 27%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
width: 200px;
|
width: 100%;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 31px 0;
|
|
||||||
border: 1px dashed #228960;
|
border: 1px dashed #228960;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
height: 48%;
|
||||||
|
|
||||||
.name {
|
.name {
|
||||||
font-size: 55px;
|
font-size: 55px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
position: absolute;
|
||||||
|
top: 40%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.odd {
|
.odd {
|
||||||
font-size: 25px;
|
font-size: 25px;
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
top: 60%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -10%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.mask {
|
.mask {
|
||||||
@@ -222,8 +243,9 @@
|
|||||||
.base {
|
.base {
|
||||||
background-image: url("../../../static/cais.png");
|
background-image: url("../../../static/cais.png");
|
||||||
background-size: 100% 100%;
|
background-size: 100% 100%;
|
||||||
width: 300px;
|
//flex: 1;
|
||||||
height: 400px;
|
width: 43%;
|
||||||
|
height: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
@@ -234,8 +256,8 @@
|
|||||||
.qz {
|
.qz {
|
||||||
background-image: url("../../../static/qz.png");
|
background-image: url("../../../static/qz.png");
|
||||||
background-size: 100% 100%;
|
background-size: 100% 100%;
|
||||||
width: 300px;
|
width: 100%;
|
||||||
height: 100px;
|
height: 25%;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
line-height: 100px;
|
line-height: 100px;
|
||||||
color: #FBE039;
|
color: #FBE039;
|
||||||
@@ -318,12 +340,15 @@
|
|||||||
@keyframes flicker {
|
@keyframes flicker {
|
||||||
0% {
|
0% {
|
||||||
border: 1px dashed #228960;
|
border: 1px dashed #228960;
|
||||||
|
background-color: #228960;
|
||||||
}
|
}
|
||||||
50% {
|
50% {
|
||||||
border: 1px dashed white;
|
border: 1px dashed white;
|
||||||
|
background: rgba(225, 225, 225, 0.5);
|
||||||
}
|
}
|
||||||
100% {
|
100% {
|
||||||
border: 1px dashed #228960;
|
border: 1px dashed #228960;
|
||||||
|
background-color: #228960;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,110 +2,113 @@
|
|||||||
<view class="index">
|
<view class="index">
|
||||||
<!-- 公告 -->
|
<!-- 公告 -->
|
||||||
<view class="subColor tips"></view>
|
<view class="subColor tips"></view>
|
||||||
<!-- 用户信息 -->
|
<scroll-view style="height: 100vh" scroll-y>
|
||||||
<view class="subColor userInfo">
|
<!-- 用户信息 -->
|
||||||
<view class="left">
|
<view class="subColor userInfo">
|
||||||
<image :src="userInfo.avatarUrl"></image>
|
<view class="left">
|
||||||
<view class="userText">
|
<image :src="userInfo.avatarUrl"></image>
|
||||||
<view class="userName">{{ userInfo.nickName || '用户' }}</view>
|
<view class="userText">
|
||||||
<view class="userScore">积分: {{ userInfo.integral || 0 }}</view>
|
<view class="userName">{{ userInfo.nickName || '用户' }}</view>
|
||||||
|
<view class="userScore">积分: {{ userInfo.integral || 0 }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="right">
|
||||||
|
<view class="icon"></view>
|
||||||
|
<view class="bean">{{ userInfo.pulse || 0 }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="right">
|
<!-- 游戏信息 -->
|
||||||
<view class="icon"></view>
|
<view class="subColor gameInfo">
|
||||||
<view class="bean">{{ userInfo.pulse || 0 }}</view>
|
<view class="left">
|
||||||
|
<image src="../../../static/tx.png"></image>
|
||||||
|
<view class="game_box">
|
||||||
|
<view class="gameName">第{{ kJData[0]?.Periods || 0 }}期开奖</view>
|
||||||
|
<view class="lottery">
|
||||||
|
<text class="text">{{ kJData[0]?.Start || 0 }}</text>
|
||||||
|
<text class="text">{{ kJData[0]?.End || 0 }}</text>
|
||||||
|
<!-- <text class="text">6</text>-->
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="center">
|
||||||
|
<view>剩余{{ time }}s开奖</view>
|
||||||
|
</view>
|
||||||
|
<view class="right">
|
||||||
|
<view class="btn" @click="toPage(1)">开奖记录</view>
|
||||||
|
<view class="btn mt-15" @click="toPage(2)">投注记录</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
<!-- 选项区 -->
|
||||||
<!-- 游戏信息 -->
|
<view class="opt">
|
||||||
<view class="subColor gameInfo">
|
<view class="subColor item" :class="{flicker: item.flicker}" v-for="item in odds" :key="item.id"
|
||||||
<view class="left">
|
@click.stop="addNum(item)">
|
||||||
<image src="../../../static/tx.png"></image>
|
<view class="name">{{ item.name }}</view>
|
||||||
<view class="game_box">
|
<view class="odd">赢{{ item.odds }}倍</view>
|
||||||
<view class="gameName">第{{ kJData[0]?.Periods || 0 }}期开奖</view>
|
<view class="mask" v-if="item.status">
|
||||||
<view class="lottery">
|
<view class="text">{{ item.markNum }}</view>
|
||||||
<text class="text">{{ kJData[0]?.Start || 0 }}</text>
|
|
||||||
<text class="text">{{ kJData[0]?.End || 0 }}</text>
|
|
||||||
<!-- <text class="text">6</text>-->
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="right">
|
<view class="opt1" v-if="odds1.length > 0">
|
||||||
<view class="btn" @click="toPage(1)">开奖记录</view>
|
<view class="optt">
|
||||||
<view class="btn mt-15" @click="toPage(2)">投注记录</view>
|
<view class="subColor item" :class="{flicker: odds1[0].flicker}" @click.stop="addNum(odds1[0])">
|
||||||
</view>
|
<view class="name">{{ odds1[0].name }}</view>
|
||||||
</view>
|
<view class="odd">赢{{ odds1[0].odds }}倍</view>
|
||||||
<!-- 选项区 -->
|
<view class="mask" v-if="odds1[0].status">
|
||||||
<view class="opt">
|
<view class="text">{{ odds1[0].markNum }}</view>
|
||||||
<view class="subColor item" :class="{flicker: item.flicker}" v-for="item in odds" :key="item.id"
|
</view>
|
||||||
@click.stop="addNum(item)">
|
</view>
|
||||||
<view class="name">{{ item.name }}</view>
|
<view class="subColor item" :class="{flicker: odds1[1].flicker}" @click.stop="addNum(odds1[1])">
|
||||||
<view class="odd">赢{{ item.odds }}倍</view>
|
<view class="name">{{ odds1[1].name }}</view>
|
||||||
<view class="mask" v-if="item.status">
|
<view class="odd">赢{{ odds1[1].odds }}倍</view>
|
||||||
<view class="text">{{ item.markNum }}</view>
|
<view class="mask" v-if="odds1[1].status">
|
||||||
</view>
|
<view class="text">{{ odds1[1].markNum }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
|
||||||
<view style="height: 8px"></view>
|
|
||||||
<view class="opt1" v-if="odds1.length > 0">
|
|
||||||
<view>
|
|
||||||
<view class="subColor item" :class="{flicker: odds1[0].flicker}" @click.stop="addNum(odds1[0])">
|
|
||||||
<view class="name">{{ odds1[0].name }}</view>
|
|
||||||
<view class="odd">赢{{ odds1[0].odds }}倍</view>
|
|
||||||
<view class="mask" v-if="odds1[0].status">
|
|
||||||
<view class="text">{{ odds1[0].markNum }}</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="subColor item" :class="{flicker: odds1[1].flicker}" @click.stop="addNum(odds1[1])">
|
<view class="base">
|
||||||
<view class="name">{{ odds1[1].name }}</view>
|
<view class="qz">
|
||||||
<view class="odd">赢{{ odds1[1].odds }}倍</view>
|
<view :class="{ activeQz: isExpanding }">
|
||||||
<view class="mask" v-if="odds1[1].status">
|
{{ qzTitle }}
|
||||||
<view class="text">{{ odds1[1].markNum }}</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="expanding-div" v-if="isShow">{{ nowKJInfo.Start }} - {{ nowKJInfo.End }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="optt">
|
||||||
|
<view class="subColor item" :class="{flicker: odds1[2].flicker}" @click.stop="addNum(odds1[2])">
|
||||||
|
<view class="name">{{ odds1[2].name }}</view>
|
||||||
|
<view class="odd">赢{{ odds1[2].odds }}倍</view>
|
||||||
|
<view class="mask" v-if="odds1[2].status">
|
||||||
|
<view class="text">{{ odds1[2].markNum }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="subColor item" :class="{flicker: odds1[3].flicker}" @click.stop="addNum(odds1[3])">
|
||||||
|
<view class="name">{{ odds1[3].name }}</view>
|
||||||
|
<view class="odd">赢{{ odds1[3].odds }}倍</view>
|
||||||
|
<view class="mask" v-if="odds1[3].status">
|
||||||
|
<view class="text">{{ odds1[3].markNum }}</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="base">
|
<view class="opt">
|
||||||
<view class="qz">
|
<view
|
||||||
<view :class="{ activeQz: isExpanding }">
|
|
||||||
{{ qzTitle }}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="expanding-div" v-if="isShow">{{ nowKJInfo.Start }} - {{ nowKJInfo.End }}</view>
|
|
||||||
</view>
|
|
||||||
<view>
|
|
||||||
<view class="subColor item" :class="{flicker: odds1[2].flicker}" @click.stop="addNum(odds1[2])">
|
|
||||||
<view class="name">{{ odds1[2].name }}</view>
|
|
||||||
<view class="odd">赢{{ odds1[2].odds }}倍</view>
|
|
||||||
<view class="mask" v-if="odds1[2].status">
|
|
||||||
<view class="text">{{ odds1[2].markNum }}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="subColor item" :class="{flicker: odds1[3].flicker}" @click.stop="addNum(odds1[3])">
|
|
||||||
<view class="name">{{ odds1[3].name }}</view>
|
|
||||||
<view class="odd">赢{{ odds1[3].odds }}倍</view>
|
|
||||||
<view class="mask" v-if="odds1[3].status">
|
|
||||||
<view class="text">{{ odds1[3].markNum }}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view style="height: 4px"></view>
|
|
||||||
<view class="opt">
|
|
||||||
<view
|
|
||||||
class="subColor item"
|
class="subColor item"
|
||||||
:class="{flicker: item.flicker}"
|
:class="{flicker: item.flicker}"
|
||||||
style="margin-bottom: 10px"
|
style="margin-bottom: 10px"
|
||||||
v-for="item in odds2"
|
v-for="item in odds2"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
@click.stop="addNum(item)"
|
@click.stop="addNum(item)"
|
||||||
>
|
>
|
||||||
<view class="name">{{ item.name }}</view>
|
<view class="name">{{ item.name }}</view>
|
||||||
<view class="odd">赢{{ item.odds }}倍</view>
|
<view class="odd">赢{{ item.odds }}倍</view>
|
||||||
<view class="mask" v-if="item.status">
|
<view class="mask" v-if="item.status">
|
||||||
<view class="text">{{ item.markNum }}</view>
|
<view class="text">{{ item.markNum }}</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view style="width: 18%;"></view>
|
||||||
</view>
|
</view>
|
||||||
<view style="width: 18%;"></view>
|
</scroll-view>
|
||||||
</view>
|
|
||||||
<!-- 底部操作栏 -->
|
<!-- 底部操作栏 -->
|
||||||
<view class="subColor bottomBar">
|
<view class="subColor bottomBar">
|
||||||
<view class="btn1" @click="clearBet">重置</view>
|
<view class="btn1" @click="clearBet">重置</view>
|
||||||
@@ -146,6 +149,8 @@ const odds2 = ref<Odd[]>([])
|
|||||||
|
|
||||||
const qzTitle = ref('请投注')
|
const qzTitle = ref('请投注')
|
||||||
|
|
||||||
|
const time = ref(0)
|
||||||
|
|
||||||
const nowKJInfo = ref<{
|
const nowKJInfo = ref<{
|
||||||
Start?: string
|
Start?: string
|
||||||
End?: string
|
End?: string
|
||||||
@@ -159,7 +164,7 @@ const userInfo = ref<{
|
|||||||
avatarUrl?: string
|
avatarUrl?: string
|
||||||
}>({})
|
}>({})
|
||||||
|
|
||||||
const zjObj = ref({})
|
const zjObj = ref<any>([])
|
||||||
|
|
||||||
const iMsgNum = ref(0)
|
const iMsgNum = ref(0)
|
||||||
|
|
||||||
@@ -235,6 +240,7 @@ const initWs = () => {
|
|||||||
switch (res.code) {
|
switch (res.code) {
|
||||||
case 200:
|
case 200:
|
||||||
let num = Number(res.data)
|
let num = Number(res.data)
|
||||||
|
time.value = num
|
||||||
if (num === 5) {
|
if (num === 5) {
|
||||||
openDraw()
|
openDraw()
|
||||||
}
|
}
|
||||||
@@ -268,15 +274,12 @@ const initWs = () => {
|
|||||||
})
|
})
|
||||||
break
|
break
|
||||||
case 666:
|
case 666:
|
||||||
|
break
|
||||||
|
default:
|
||||||
iMsgNum.value++
|
iMsgNum.value++
|
||||||
const newObj = JSON.parse(res.data)
|
const arr = Object.values(res)
|
||||||
const arr = Object.values(newObj)
|
zjObj.value.push(...arr)
|
||||||
// zjObj.value = {
|
if (iMsgNum.value === 3 || zjObj.value.length === 1) {
|
||||||
// ...zjObj.value,
|
|
||||||
// ...newObj
|
|
||||||
// }
|
|
||||||
console.log(arr)
|
|
||||||
if (iMsgNum.value === 19) {
|
|
||||||
iMsgNum.value = 0
|
iMsgNum.value = 0
|
||||||
startFlicker()
|
startFlicker()
|
||||||
}
|
}
|
||||||
@@ -314,17 +317,17 @@ const openDraw = () => {
|
|||||||
}, 5000)
|
}, 5000)
|
||||||
}
|
}
|
||||||
|
|
||||||
const oddVal = ref(1)
|
const oddVal = ref(10)
|
||||||
const changeOdd = () => {
|
const changeOdd = () => {
|
||||||
switch (oddVal.value) {
|
switch (oddVal.value) {
|
||||||
case 1:
|
|
||||||
oddVal.value = 10
|
|
||||||
break
|
|
||||||
case 10:
|
case 10:
|
||||||
oddVal.value = 100
|
oddVal.value = 100
|
||||||
break
|
break
|
||||||
|
// case 10:
|
||||||
|
// oddVal.value = 100
|
||||||
|
// break
|
||||||
case 100:
|
case 100:
|
||||||
oddVal.value = 1
|
oddVal.value = 10
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -357,6 +360,12 @@ const addNum = (item: any) => {
|
|||||||
|
|
||||||
// 投注
|
// 投注
|
||||||
const verifyBet = () => {
|
const verifyBet = () => {
|
||||||
|
|
||||||
|
if (isKj.value) return Taro.showToast({
|
||||||
|
title: '正在开奖,不能下注',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
|
||||||
let numCount = 0
|
let numCount = 0
|
||||||
|
|
||||||
odds.value.forEach((item: any) => {
|
odds.value.forEach((item: any) => {
|
||||||
@@ -424,7 +433,9 @@ const verifyBet = () => {
|
|||||||
data: data
|
data: data
|
||||||
}))
|
}))
|
||||||
|
|
||||||
getUserInfo()
|
setTimeout(() => {
|
||||||
|
getUserInfo()
|
||||||
|
}, 1000)
|
||||||
|
|
||||||
qzTitle.value = '已投注'
|
qzTitle.value = '已投注'
|
||||||
clearBet()
|
clearBet()
|
||||||
@@ -448,22 +459,22 @@ const playAminExpand = () => {
|
|||||||
|
|
||||||
// 开始闪烁
|
// 开始闪烁
|
||||||
const startFlicker = () => {
|
const startFlicker = () => {
|
||||||
console.log('开始闪烁', zjObj.value)
|
|
||||||
flickerItems(odds.value)
|
flickerItems(odds.value)
|
||||||
flickerItems(odds1.value)
|
flickerItems(odds1.value)
|
||||||
flickerItems(odds2.value)
|
flickerItems(odds2.value)
|
||||||
|
zjObj.value = []
|
||||||
}
|
}
|
||||||
|
|
||||||
const flickerItems = (items: any[]) => {
|
const flickerItems = (items: any[]) => {
|
||||||
items.forEach((item) => {
|
items.forEach((item) => {
|
||||||
for (const val in zjObj.value) {
|
zjObj.value.forEach((item2: any) => {
|
||||||
if (item.name === zjObj.value[val]) {
|
if (item.name === item2) {
|
||||||
item.flicker = true
|
item.flicker = true
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
item.flicker = false
|
item.flicker = false
|
||||||
}, 3000)
|
}, 3000)
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
navigationBarBackgroundColor: '#23684B'
|
navigationBarBackgroundColor: '#23684B',
|
||||||
|
enablePullDownRefresh: true
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -13,23 +13,29 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<view class="card desc" v-for="(item,index) in list as any[]" :key="index">
|
<view v-if="list.length > 0">
|
||||||
<view>
|
<view class="card desc" v-for="(item,index) in list as any[]" :key="index">
|
||||||
<view>第{{ item.Periods }}期投注:
|
|
||||||
</view>
|
|
||||||
<view>
|
<view>
|
||||||
点数:
|
<view>第{{ item.Periods }}期投注:
|
||||||
<text style="color: red">{{ item.Name }}</text>
|
</view>
|
||||||
|
<view>
|
||||||
|
点数:
|
||||||
|
<text style="color: red">{{ item.Name }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="sub">投注时间:
|
||||||
|
<text>{{ item.DrawTime }}</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="sub">投注时间:
|
<view style="text-align: right">
|
||||||
<text>{{ item.DrawTime }}</text>
|
<view style="color: red" v-if="item.State === 1">+{{ item.DrawNum }}积分</view>
|
||||||
|
<view style="color: green">-{{ item.Number }}豆子</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
|
||||||
<view style="color: red" v-if="item.State === 1">+{{ item.DrawNum }}积分</view>
|
|
||||||
<view style="color: green">-{{ item.Number }}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
<view v-else>
|
||||||
|
<view style="margin-top: 100px">暂无记录.....</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -46,17 +52,26 @@ const typeNum = ref(0)
|
|||||||
Taro.useLoad((options) => {
|
Taro.useLoad((options) => {
|
||||||
typeNum.value = Number(options.type)
|
typeNum.value = Number(options.type)
|
||||||
Taro.setNavigationBarTitle({title: options.type === '1' ? '开奖记录' : '投注记录'})
|
Taro.setNavigationBarTitle({title: options.type === '1' ? '开奖记录' : '投注记录'})
|
||||||
getData(options.type)
|
getData()
|
||||||
})
|
})
|
||||||
|
|
||||||
const getData = async (type: string) => {
|
Taro.usePullDownRefresh(() => {
|
||||||
|
getData()
|
||||||
|
})
|
||||||
|
|
||||||
|
const getData = async () => {
|
||||||
let res: any
|
let res: any
|
||||||
if (type === '1') {
|
if (typeNum.value === 1) {
|
||||||
res = await getKaiJiangList()
|
res = await getKaiJiangList()
|
||||||
|
list.value = res.data.data
|
||||||
} else {
|
} else {
|
||||||
res = await getTzJl(Taro.getStorageSync('uid'))
|
res = await getTzJl(Taro.getStorageSync('uid'))
|
||||||
|
console.log(res)
|
||||||
|
list.value = res.data.data.sort(
|
||||||
|
(a: any, b: any) => b.Periods - a.Periods
|
||||||
|
)
|
||||||
}
|
}
|
||||||
list.value = res.data.data
|
Taro.stopPullDownRefresh()
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -65,8 +80,11 @@ const getData = async (type: string) => {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
//justify-content: center;
|
||||||
font-size: 35px;
|
font-size: 35px;
|
||||||
|
width: 100%;
|
||||||
|
padding: 10px;
|
||||||
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card {
|
.card {
|
||||||
@@ -86,6 +104,7 @@ const getData = async (type: string) => {
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -9,6 +9,9 @@ export interface RequestParams {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const request = (request: RequestParams): Promise<any> => {
|
const request = (request: RequestParams): Promise<any> => {
|
||||||
|
Taro.showLoading({
|
||||||
|
title: '加载中',
|
||||||
|
})
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
Taro.request({
|
Taro.request({
|
||||||
url: `${app.API_URL()}${request.url}`,
|
url: `${app.API_URL()}${request.url}`,
|
||||||
@@ -19,9 +22,11 @@ const request = (request: RequestParams): Promise<any> => {
|
|||||||
data: request.data || {},
|
data: request.data || {},
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
resolve(res.data);
|
resolve(res.data);
|
||||||
|
Taro.hideLoading();
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
reject(err);
|
reject(err);
|
||||||
|
Taro.hideLoading();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user