..
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
<template>
|
||||
<view class="page-container">
|
||||
<view style="position:relative;width: 100%;height: 400rpx;overflow: hidden;margin-bottom: 0rpx">
|
||||
<image :src="actData.cover" mode="aspectFill" style="width: 100%"></image>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {onLoad, onPageScroll} from "@dcloudio/uni-app";
|
||||
import {Toast} from "tdesign-mobile-vue";
|
||||
import {ref} from 'vue'
|
||||
import {useRequest} from "@/utils/request";
|
||||
import moment from "moment/moment";
|
||||
|
||||
const request = useRequest()
|
||||
|
||||
const actId = ref('');
|
||||
const actData = ref({});
|
||||
const signUpInfo = ref({})
|
||||
|
||||
|
||||
onLoad((option) => {
|
||||
if (option.id) {
|
||||
actId.value = option.id;
|
||||
getDetailData(option.id);
|
||||
getSignUpInfo(option.id);
|
||||
} else {
|
||||
Toast({message: 'ID不存在', theme: 'error'});
|
||||
}
|
||||
});
|
||||
|
||||
// 获取详情
|
||||
const getDetailData = async (id) => {
|
||||
const loading = Toast({
|
||||
theme: 'loading',
|
||||
duration: 0
|
||||
});
|
||||
try {
|
||||
const {code, data} = await request.get('/client/activity/get/' + id)
|
||||
if (code === 0) {
|
||||
actData.value = data;
|
||||
|
||||
// 如果活动未开始,开始倒计时
|
||||
// if (activityStatus.value === 'notStarted') {
|
||||
// startCountdown();
|
||||
// }
|
||||
} else {
|
||||
Toast({message: '获取详情失败', theme: 'error'});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取详情失败', error);
|
||||
Toast({message: '获取详情失败', theme: 'error'});
|
||||
} finally {
|
||||
loading.clear()
|
||||
}
|
||||
};
|
||||
|
||||
// 查询报名信息
|
||||
const getSignUpInfo = async () => {
|
||||
try {
|
||||
const {code, data} = await request.get('/client/activity/sign-info/' + actId.value);
|
||||
if (code === 0 && data) {
|
||||
signUpInfo.value = data;
|
||||
} else {
|
||||
Toast({message: '查询报名信息失败', theme: 'error'});
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.page-container {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,11 +0,0 @@
|
||||
<script setup>
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user