This commit is contained in:
2023-09-01 23:01:53 +08:00
parent eaae975626
commit 88e96df20c
8 changed files with 203 additions and 138 deletions

View File

@@ -13,23 +13,29 @@
</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 v-if="list.length > 0">
<view class="card desc" v-for="(item,index) in list as any[]" :key="index">
<view>
点数:
<text style="color: red">{{ item.Name }}</text>
<view>{{ item.Periods }}期投注:
</view>
<view>
点数:
<text style="color: red">{{ item.Name }}</text>
</view>
<view class="sub">投注时间:
<text>{{ item.DrawTime }}</text>
</view>
</view>
<view class="sub">投注时间:
<text>{{ item.DrawTime }}</text>
<view style="text-align: right">
<view style="color: red" v-if="item.State === 1">+{{ item.DrawNum }}积分</view>
<view style="color: green">-{{ item.Number }}豆子</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 v-else>
<view style="margin-top: 100px">暂无记录.....</view>
</view>
</template>
</view>
</template>
@@ -46,17 +52,26 @@ const typeNum = ref(0)
Taro.useLoad((options) => {
typeNum.value = Number(options.type)
Taro.setNavigationBarTitle({title: options.type === '1' ? '开奖记录' : '投注记录'})
getData(options.type)
getData()
})
const getData = async (type: string) => {
Taro.usePullDownRefresh(() => {
getData()
})
const getData = async () => {
let res: any
if (type === '1') {
if (typeNum.value === 1) {
res = await getKaiJiangList()
list.value = res.data.data
} else {
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>
@@ -65,8 +80,11 @@ const getData = async (type: string) => {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
//justify-content: center;
font-size: 35px;
width: 100%;
padding: 10px;
box-sizing: border-box;
}
.card {
@@ -86,6 +104,7 @@ const getData = async (type: string) => {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
}
</style>