hui.zhou
ihzero 2024-06-24 22:12:09 +08:00
parent 035ed7a28d
commit e7331af0e8
11 changed files with 1551 additions and 720 deletions

View File

@ -34,6 +34,7 @@
"build:mp-qq": "uni build -p mp-qq", "build:mp-qq": "uni build -p mp-qq",
"build:mp-toutiao": "uni build -p mp-toutiao", "build:mp-toutiao": "uni build -p mp-toutiao",
"build:mp-weixin": "uni build -p mp-weixin", "build:mp-weixin": "uni build -p mp-weixin",
"build:mp-weixin:dev": "uni build -p mp-weixin --mode development",
"build:mp-xhs": "uni build -p mp-xhs", "build:mp-xhs": "uni build -p mp-xhs",
"build:quickapp-webview": "uni build -p quickapp-webview", "build:quickapp-webview": "uni build -p quickapp-webview",
"build:quickapp-webview-huawei": "uni build -p quickapp-webview-huawei", "build:quickapp-webview-huawei": "uni build -p quickapp-webview-huawei",

View File

@ -155,3 +155,7 @@ export const submitUploadUserInfo = (params, config = {}) => {
export const getLatestGameLogs = () => { export const getLatestGameLogs = () => {
return http.get(`/api/miniprogram/latest-game-logs`); return http.get(`/api/miniprogram/latest-game-logs`);
} }
// 最新竞猜记录
export const activityGameLogs = (params) => {
return http.get(`/api/miniprogram/activity-game-logs`,{ params });
}

View File

@ -0,0 +1,19 @@
<template>
<view class="relative h-46rpx flex items-center">
<view
class="absolute left-0 w-4px h-[80%] transform top-[50%] translate-y-[-50%]"
:style="{ background: '#D8524C' }"
></view>
<view class="ml-16px font-bold text-base">{{ title }}</view>
</view>
</template>
<script setup>
const props = defineProps({
title: {
type: String,
default: '标题',
},
color: '#D8524C',
})
</script>

View File

@ -1,6 +1,14 @@
<template> <template>
<view> <view>
<view class="flex items-center py-2" @click="$goToPage({url:'pages/quiz/logs', params: { activity_id: data.activity_id,user_id: data.user_id}})"> <view
class="flex items-center py-2"
@click="
$goToPage({
url: 'pages/quiz/logs',
params: { activity_id: data.activity_id, user_id: data.user_id },
})
"
>
<view class="w-84rpx h-84rpx rounded-full flex-none"> <view class="w-84rpx h-84rpx rounded-full flex-none">
<up-avatar size="84rpx" mode="aspectFit" :src="data.avatar"></up-avatar> <up-avatar size="84rpx" mode="aspectFit" :src="data.avatar"></up-avatar>
</view> </view>
@ -17,7 +25,9 @@
</view> </view>
<view>{{ data.score }}</view> <view>{{ data.score }}</view>
</view> </view>
<view :style="{color:currentStatus.color}">{{ currentStatus.label }}</view> <view :style="{ color: currentStatus.color }">{{
currentStatus.label
}}</view>
</view> </view>
</view> </view>
</view> </view>
@ -26,30 +36,13 @@
</template> </template>
<script setup> <script setup>
import { computed } from 'vue' import { computed } from 'vue'
import { status } from './status'
const props = defineProps({ const props = defineProps({
data: { data: {
item: Object, item: Object,
}, },
}) })
const status = [
{
value: 0,
label: '未公布',
color: '#1b2f85',
},
{
value: 1,
label: '猜中了',
color: '#e91f35',
},
{
value: 2,
label: '未猜中',
color: '#808080',
},
]
const currentStatus = computed(() => const currentStatus = computed(() =>
status.find((e) => e.value == props.data.status) status.find((e) => e.value == props.data.status)
) )

View File

@ -1,17 +1,35 @@
<template> <template>
<view> <view class="text-sm">
<view>2024-05-01 英超第九场</view> <view class="p-3">
<view class="grid grid-cols-2"> <view>{{ data.game_day }} {{ data.game_name }}</view>
<view class="grid grid-cols-2"> <view class="grid grid-cols-2 mt-2">
<view>法国</view> <view class="grid grid-cols-3 mr-20rpx">
<view class="text-center">VS</view> <view>{{ data.game_home_field }}</view>
<view class="text-right">德国</view> <view class="text-center">VS</view>
</view> <view class="text-right">{{ data.game_away }}</view>
<view class="grid grid-cols-2"> </view >
<view></view> <view class="grid grid-cols-2 ml-40rpx">
<view class="text-right">猜中了</view> <view>{{ data.score }}</view>
<view :style="{ color: currentStatus.color }" class="text-right">{{
currentStatus.label
}}</view>
</view>
</view> </view>
</view> </view>
<up-line color="#EEEEEE"></up-line> <up-line color="#EEEEEE"></up-line>
</view> </view>
</template> </template>
<script setup>
import { computed } from 'vue'
import { status } from './status'
const props = defineProps({
data: {
type: Object,
default: () => {},
},
})
const currentStatus = computed(() =>
status.find((e) => e.value == props.data.status)
)
</script>

View File

@ -0,0 +1,17 @@
export const status = [
{
value: 0,
label: '未公布',
color: '#1b2f85'
},
{
value: 1,
label: '猜中了',
color: '#e91f35'
},
{
value: 2,
label: '未猜中',
color: '#808080'
},
]

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -10,29 +10,49 @@
}, },
}" }"
> >
<view> <view>
<view class="h-188px w-full" v-if="detail.cover"> <view class="h-188px w-full" v-if="detail.cover">
<image class="w-full" mode="aspectFill" :src="detail.cover" /> <image class="w-full" mode="aspectFill" :src="detail.cover" />
</view> </view>
<view class="min-h-screen relative bg-hex-1b2f85 p-3"> <view class="min-h-screen relative bg-hex-1b2f85 p-3">
<image class="absolute left-0 w-full top-0" mode="widthFix" :src="`${config.baseUrl}/images/mini-bg.jpg`"></image> <image
<view class="bg-white rounded-12px relative"> class="absolute left-0 w-full top-0"
1111 mode="widthFix"
:src="`${config.baseUrl}/images/mini-bg.jpg`"
></image>
<view class="relative text-white space-x-2">
<view class="text-base">{{ detail.name }}</view>
<view class="text-xs mt-3">{{
dayjs(detail.start_at).format('YYYY-MM-DD')
}}</view>
</view>
<view class="bg-white rounded-12px relative mt-4">
<view class="px-3 pt-16rpx">
<CTitle title="他的战绩"></CTitle>
</view>
<view class="">
<Item v-for="(item, i) in list" :key="i" :data="item"></Item>
<mescroll-empty v-if="!list.length"></mescroll-empty>
</view>
</view>
</view> </view>
</view> </view>
</view>
</mescroll-body> </mescroll-body>
</view> </view>
</template> </template>
<script setup> <script setup>
import dayjs from 'dayjs'
import { onPageScroll, onReachBottom, onLoad } from '@dcloudio/uni-app' import { onPageScroll, onReachBottom, onLoad } from '@dcloudio/uni-app'
import useMescroll from '@/uni_modules/mescroll-uni/hooks/useMescroll.js' import useMescroll from '@/uni_modules/mescroll-uni/hooks/useMescroll.js'
import { queryActivitiesDetail } from '@/api/xinjiang_guess' import { queryActivitiesDetail, activityGameLogs } from '@/api/xinjiang_guess'
import Item from '@/components/quiz/item.vue'
import CTitle from '@/components/c-title/index.vue'
import config from '@/common/config' import config from '@/common/config'
import { ref } from 'vue' import { ref } from 'vue'
const activityId = ref(null) const activityId = ref(null)
const userId = ref(null) const userId = ref(null)
const detail = ref({}) const detail = ref({})
const list = ref([])
const { mescrollInit, downCallback, getMescroll } = useMescroll( const { mescrollInit, downCallback, getMescroll } = useMescroll(
onPageScroll, onPageScroll,
onReachBottom onReachBottom
@ -43,9 +63,24 @@ onLoad((query) => {
userId.value = query.user_id userId.value = query.user_id
}) })
const upCallback = (mescroll) => { const upCallback = async (mescroll) => {
const { size, num } = mescroll const { size, num } = mescroll
if (num === 1) getActiveDetail() if (num === 1) getActiveDetail()
try {
const resData = await activityGameLogs({
user_id: userId.value,
activity_id: activityId.value,
per_page: size,
page: num,
})
const arr = resData.data.list || [] //
if (num == 1) list.value = [] //
list.value = list.value.concat(arr) //
mescroll.endSuccess(arr.length) // ,
} catch (error) {
mescroll.endErr()
console.log(error)
}
} }
const getActiveDetail = async () => { const getActiveDetail = async () => {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 39 KiB

View File

@ -39,7 +39,7 @@ const GlobalOption = {
textLoading: '加载中 ...', // 加载中的提示文本 textLoading: '加载中 ...', // 加载中的提示文本
textNoMore: '-- END --', // 没有更多数据的提示文本 textNoMore: '-- END --', // 没有更多数据的提示文本
empty: { empty: {
tip: '~ 空空如也 ~' // 空提示 tip: '' // 空提示
} }
} }
}, },