hui.zhou
parent
035ed7a28d
commit
e7331af0e8
|
|
@ -34,6 +34,7 @@
|
|||
"build:mp-qq": "uni build -p mp-qq",
|
||||
"build:mp-toutiao": "uni build -p mp-toutiao",
|
||||
"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:quickapp-webview": "uni build -p quickapp-webview",
|
||||
"build:quickapp-webview-huawei": "uni build -p quickapp-webview-huawei",
|
||||
|
|
|
|||
|
|
@ -155,3 +155,7 @@ export const submitUploadUserInfo = (params, config = {}) => {
|
|||
export const getLatestGameLogs = () => {
|
||||
return http.get(`/api/miniprogram/latest-game-logs`);
|
||||
}
|
||||
// 最新竞猜记录
|
||||
export const activityGameLogs = (params) => {
|
||||
return http.get(`/api/miniprogram/activity-game-logs`,{ params });
|
||||
}
|
||||
|
|
@ -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>
|
||||
|
|
@ -1,6 +1,14 @@
|
|||
<template>
|
||||
<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">
|
||||
<up-avatar size="84rpx" mode="aspectFit" :src="data.avatar"></up-avatar>
|
||||
</view>
|
||||
|
|
@ -17,7 +25,9 @@
|
|||
</view>
|
||||
<view>{{ data.score }}</view>
|
||||
</view>
|
||||
<view :style="{color:currentStatus.color}">{{ currentStatus.label }}</view>
|
||||
<view :style="{ color: currentStatus.color }">{{
|
||||
currentStatus.label
|
||||
}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -26,30 +36,13 @@
|
|||
</template>
|
||||
<script setup>
|
||||
import { computed } from 'vue'
|
||||
import { status } from './status'
|
||||
const props = defineProps({
|
||||
data: {
|
||||
item: Object,
|
||||
},
|
||||
})
|
||||
|
||||
const status = [
|
||||
{
|
||||
value: 0,
|
||||
label: '未公布',
|
||||
color: '#1b2f85',
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '猜中了',
|
||||
color: '#e91f35',
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '未猜中',
|
||||
color: '#808080',
|
||||
},
|
||||
]
|
||||
|
||||
const currentStatus = computed(() =>
|
||||
status.find((e) => e.value == props.data.status)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,17 +1,35 @@
|
|||
<template>
|
||||
<view>
|
||||
<view>2024-05-01 英超第九场</view>
|
||||
<view class="grid grid-cols-2">
|
||||
<view class="grid grid-cols-2">
|
||||
<view>法国</view>
|
||||
<view class="text-center">VS</view>
|
||||
<view class="text-right">德国</view>
|
||||
</view>
|
||||
<view class="grid grid-cols-2">
|
||||
<view>胜</view>
|
||||
<view class="text-right">猜中了</view>
|
||||
<view class="text-sm">
|
||||
<view class="p-3">
|
||||
<view>{{ data.game_day }} {{ data.game_name }}</view>
|
||||
<view class="grid grid-cols-2 mt-2">
|
||||
<view class="grid grid-cols-3 mr-20rpx">
|
||||
<view>{{ data.game_home_field }}</view>
|
||||
<view class="text-center">VS</view>
|
||||
<view class="text-right">{{ data.game_away }}</view>
|
||||
</view >
|
||||
<view class="grid grid-cols-2 ml-40rpx">
|
||||
<view>{{ data.score }}</view>
|
||||
<view :style="{ color: currentStatus.color }" class="text-right">{{
|
||||
currentStatus.label
|
||||
}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<up-line color="#EEEEEE"></up-line>
|
||||
</view>
|
||||
</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>
|
||||
|
|
|
|||
|
|
@ -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
|
|
@ -10,29 +10,49 @@
|
|||
},
|
||||
}"
|
||||
>
|
||||
<view>
|
||||
<view class="h-188px w-full" v-if="detail.cover">
|
||||
<image class="w-full" mode="aspectFill" :src="detail.cover" />
|
||||
</view>
|
||||
<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>
|
||||
<view class="bg-white rounded-12px relative">
|
||||
1111
|
||||
<view>
|
||||
<view class="h-188px w-full" v-if="detail.cover">
|
||||
<image class="w-full" mode="aspectFill" :src="detail.cover" />
|
||||
</view>
|
||||
<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>
|
||||
<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>
|
||||
</mescroll-body>
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import dayjs from 'dayjs'
|
||||
import { onPageScroll, onReachBottom, onLoad } from '@dcloudio/uni-app'
|
||||
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 { ref } from 'vue'
|
||||
const activityId = ref(null)
|
||||
const userId = ref(null)
|
||||
const detail = ref({})
|
||||
const list = ref([])
|
||||
const { mescrollInit, downCallback, getMescroll } = useMescroll(
|
||||
onPageScroll,
|
||||
onReachBottom
|
||||
|
|
@ -43,9 +63,24 @@ onLoad((query) => {
|
|||
userId.value = query.user_id
|
||||
})
|
||||
|
||||
const upCallback = (mescroll) => {
|
||||
const upCallback = async (mescroll) => {
|
||||
const { size, num } = mescroll
|
||||
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 () => {
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 39 KiB |
|
|
@ -39,7 +39,7 @@ const GlobalOption = {
|
|||
textLoading: '加载中 ...', // 加载中的提示文本
|
||||
textNoMore: '-- END --', // 没有更多数据的提示文本
|
||||
empty: {
|
||||
tip: '~ 空空如也 ~' // 空提示
|
||||
tip: '' // 空提示
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue