This commit is contained in:
2023-10-08 22:52:44 +08:00
parent 88e96df20c
commit 2980496abc
23 changed files with 649 additions and 305 deletions

View File

@@ -4,11 +4,18 @@
<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>
<!-- <text style="color: red">{{ item.Start }},{{ item.End }}</text>-->
<text v-for="(num,i) in item.Name" :key="i" :style="{
color: numColor(num)
}">{{ num }},
</text>
</view>
<!-- <view class="sub">开奖个数:-->
<!-- <text v-for="(num,i) in item.Name" :key="i" :style="{-->
<!-- color: numColor(num)-->
<!-- }">{{ num }},-->
<!-- </text>-->
<!-- </view>-->
</view>
</view>
</template>
@@ -16,15 +23,9 @@
<view v-if="list.length > 0">
<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>{{ item.Periods }}期投注:</view>
<view>点数:<text style="color: red">{{ item.Name }}</text></view>
<view class="sub">投注时间:<text>{{ item.DrawTime }}</text></view>
</view>
<view style="text-align: right">
<view style="color: red" v-if="item.State === 1">+{{ item.DrawNum }}积分</view>
@@ -59,14 +60,35 @@ Taro.usePullDownRefresh(() => {
getData()
})
const numColor = (num: string) => {
switch (num) {
case '大':
return 'red'
case '小':
return 'green'
case '单':
return 'orange'
case '双':
return 'blue'
case '和':
return 'purple'
default:
return 'black'
}
}
const getData = async () => {
let res: any
if (typeNum.value === 1) {
res = await getKaiJiangList()
list.value = res.data.data
list.value = res.data.data.map((item: any) => {
return {
...item,
Name: item.Name.split('-')
}
})
} else {
res = await getTzJl(Taro.getStorageSync('uid'))
console.log(res)
list.value = res.data.data.sort(
(a: any, b: any) => b.Periods - a.Periods
)