提交数据
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
<!-- 创建项目模块列表 -->
|
||||
<view class="create-modules">
|
||||
<!-- 计时项目模块 -->
|
||||
<view @click="showTimingProjectModal" class="create-card timing-card">
|
||||
<view @click="showTimingProjectModal(1)" class="create-card timing-card">
|
||||
<view class="card-icon">
|
||||
<view class="icon-circle timing-icon">
|
||||
<u-icon name="clock" size="40" color="#fff"></u-icon>
|
||||
@@ -29,7 +29,7 @@
|
||||
</view>
|
||||
|
||||
<!-- 包干项目模块 -->
|
||||
<view @click="createPackageProject" class="create-card package-card">
|
||||
<view @click="showTimingProjectModal(2)" class="create-card package-card">
|
||||
<view class="card-icon">
|
||||
<view class="icon-circle package-icon">
|
||||
<u-icon name="grid" size="40" color="#fff"></u-icon>
|
||||
@@ -74,7 +74,7 @@
|
||||
|
||||
<view class="modal-content">
|
||||
<!-- 新增按钮 -->
|
||||
<view class="add-btn" @click="createTimingProject">
|
||||
<view v-if="currentIndex!==2" class="add-btn" @click="createTimingProject">
|
||||
<u-icon name="plus" size="18" color="#1890ff"></u-icon>
|
||||
<text class="add-btn-text">新增项目</text>
|
||||
</view>
|
||||
@@ -84,7 +84,7 @@
|
||||
<text class="list-title" v-if="projects.length > 0">项目列表</text>
|
||||
<view v-if="projects.length > 0" class="list-container">
|
||||
<view v-for="project in projects" :key="project.id" class="project-item"
|
||||
@click="Service.GoPage('/pages/userFunc/swiming')">
|
||||
@click=" goPageFunc() ">
|
||||
<view class="item-icon">
|
||||
<view class="icon-bg">
|
||||
<text class="icon-text">{{ project.name.charAt(0) }}</text>
|
||||
@@ -128,7 +128,9 @@
|
||||
age : string
|
||||
}[]
|
||||
}
|
||||
|
||||
|
||||
let currentIndex=ref(0)
|
||||
|
||||
// 模拟项目数据
|
||||
const projects = ref<Project[]>([
|
||||
{
|
||||
@@ -175,10 +177,21 @@
|
||||
const showTimingModal = ref(false)
|
||||
const showDetailModal = ref(false)
|
||||
const currentProject = ref<Project | null>(null)
|
||||
|
||||
|
||||
|
||||
// 生命周期
|
||||
onMounted(() => {
|
||||
// TODO: 实际应从接口获取项目列表
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
// 清理
|
||||
})
|
||||
|
||||
// 显示计时项目列表弹窗
|
||||
const showTimingProjectModal = () => {
|
||||
const showTimingProjectModal = (index:any) => {
|
||||
showTimingModal.value = true
|
||||
currentIndex.value=index
|
||||
}
|
||||
|
||||
// 关闭计时项目列表弹窗
|
||||
@@ -200,7 +213,7 @@
|
||||
const createSegmentProject = () => {
|
||||
Service.GoPage('/pages/userFunc/setCourse')
|
||||
}
|
||||
|
||||
|
||||
// 显示项目详情
|
||||
const showProjectDetail = (project : Project) => {
|
||||
currentProject.value = project
|
||||
@@ -213,15 +226,17 @@
|
||||
showDetailModal.value = false
|
||||
currentProject.value = null
|
||||
}
|
||||
|
||||
// 生命周期
|
||||
onMounted(() => {
|
||||
// TODO: 实际应从接口获取项目列表
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
// 清理
|
||||
})
|
||||
|
||||
|
||||
const goPageFunc=()=>{
|
||||
if(currentIndex.value==1){
|
||||
Service.GoPage('/pages/userFunc/swiming')
|
||||
}else{
|
||||
Service.GoPage('/pages/userFunc/project')
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user