i
This commit is contained in:
91
src/pages/yaotouzi/records/index.vue
Normal file
91
src/pages/yaotouzi/records/index.vue
Normal file
@@ -0,0 +1,91 @@
|
||||
<template>
|
||||
<view class="app">
|
||||
<template v-if="typeNum===1">
|
||||
<view class="card" v-for="(item,index) in list as any[]" :key="index">
|
||||
<view>
|
||||
<view>第{{ item.Periods }}期开奖:
|
||||
<text style="color: red">{{ item.Start }},{{ item.End }}</text>
|
||||
</view>
|
||||
<view class="sub">开奖时间:
|
||||
<text>{{ item.DrawTime }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class="card desc" v-for="(item,index) in list as any[]" :key="index">
|
||||
<view>
|
||||
<view>第{{ item.Periods }}期投注:
|
||||
</view>
|
||||
<view>
|
||||
点数:
|
||||
<text style="color: red">{{ item.Name }}</text>
|
||||
</view>
|
||||
<view class="sub">投注时间:
|
||||
<text>{{ item.DrawTime }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view style="color: red" v-if="item.State === 1">+{{ item.DrawNum }}积分</view>
|
||||
<view style="color: green">-{{ item.Number }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {ref} from 'vue'
|
||||
import Taro from '@tarojs/taro'
|
||||
import {getKaiJiangList, getTzJl} from '@/api'
|
||||
|
||||
const list = ref<any[]>([])
|
||||
|
||||
const typeNum = ref(0)
|
||||
|
||||
Taro.useLoad((options) => {
|
||||
typeNum.value = Number(options.type)
|
||||
Taro.setNavigationBarTitle({title: options.type === '1' ? '开奖记录' : '投注记录'})
|
||||
getData(options.type)
|
||||
})
|
||||
|
||||
const getData = async (type: string) => {
|
||||
let res: any
|
||||
if (type === '1') {
|
||||
res = await getKaiJiangList()
|
||||
} else {
|
||||
res = await getTzJl(Taro.getStorageSync('uid'))
|
||||
}
|
||||
list.value = res.data.data
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.app {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 35px;
|
||||
}
|
||||
|
||||
.card {
|
||||
width: 90%;
|
||||
padding: 20px;
|
||||
background-color: #fff;
|
||||
margin-top: 10px;
|
||||
border-radius: 10px;
|
||||
|
||||
.sub {
|
||||
margin-top: 10px;
|
||||
color: #555555;
|
||||
}
|
||||
}
|
||||
|
||||
.desc {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user