初始化

This commit is contained in:
2025-08-01 10:44:40 +08:00
commit bf2139d3df
1058 changed files with 146426 additions and 0 deletions

71
pages/notify/detail.vue Normal file
View File

@@ -0,0 +1,71 @@
<template>
<view class="notify">
<view class="notify-title">{{detail.title}}</view>
<view class="notify-time">{{detail.createTime}}</view>
<view class="notify-front">
<image mode="heightFix" :src="getImgSrc(detail.front)"></image>
</view>
<view class="notify-content" v-html="getContent(detail.content)">
</view>
</view>
</template>
<script>
import {getNotify} from "@/api/notifyApi.js";
import {getImgSrc } from "@/api/helpFunc.js";
import {BASE_URL} from "@/config/baseUrl.js";
export default {
data() {
return {
detail:{
title:'',
front:null,
content:"",
createTime:""
},
getImgSrc,
}
},
onLoad(options) {
let id = options.id;
getNotify(id).then(res=>{
this.detail = {...res.data};
});
},
methods: {
getContent(v){
return v.replace("/dev-api",BASE_URL).replace("<img","<img style='width:100%'");
}
}
}
</script>
<style scoped lang="scss">
.notify{
padding:10rpx;
.notify-title{
text-align: center;
font-weight: bolder;
font-size:1.25rem ;
}
.notify-time{
text-align: right;
font-size: 0.8rem;
margin-right: 50rpx;
margin-top: 10rpx;
}
.notify-front{
text-align: center;
height: 400rpx;
image{
height: 100%;
}
}
.notify-content{
padding: 20rpx;
}
}
</style>

168
pages/notify/index.vue Normal file
View File

@@ -0,0 +1,168 @@
<template>
<view class="notify">
<u-sticky bgColor="#fff">
<u-tabs :list="tabsList" lineWidth="42" :inactiveStyle="{color:'#909399'}" :activeStyle="{color:'#303133'}"
@click="clickTabs"></u-tabs>
</u-sticky>
<view class="content">
<view class="card" v-for="(item,index) in todoList" :key="index" @click="toTask(item)">
<view class="left">
<text class="name">项目名称</text>
<text class="create-time">创建时间</text>
<text class="deadline">截止时间</text>
</view>
<view class="right">
<view class="title-state">
<text :class="item.status != '0'?'state':'error'">{{item.status | fileState}}</text>
<text>{{item.taskName}}</text>
</view>
<text class="create-time">{{ moment(item.startTime).format("yyyy-MM-DD") }}</text>
<text class="deadline">{{moment(item.endTime).format("yyyy-MM-DD") }}</text>
</view>
</view>
</view>
<zero-loading v-if="loading"></zero-loading>
</view>
</template>
<script>
import {listTodo,listOwnTodo} from "@/api/toApi.js";
import moment from "moment";
export default {
data() {
return {
moment,
loading:false,
todoList : [],
tabsList: [{
name: "全部"
},
// {
// name: "完成"
// },
// {
// name: "未完成"
// }
],
}
},
onShow() {
this.getTodo()
},
methods: {
toTask(v){
try{
uni.switchTab({
url:v.url
})
}catch(e){
console.log(e)
}finally{
uni.navigateTo({
url:"/pages/step/index"
})
}
},
async getTodo() {
this.loading = true;
let res = await listOwnTodo();
this.loading = false;
console.log(res)
if (res.code == 200) {
this.todoList = res.rows;
}
},
clickTabs(item) {
}
},
filters: {
fileState(value) {
if (value != '0')
return "已完成"
return "未完成"
}
}
}
</script>
<style lang="scss" scoped>
.state,
.error {
margin: 6rpx 0 0 12rpx;
display: block;
width: 90rpx;
height: 40rpx;
font-size: 20rpx;
background-color: #85CE61;
text-align: center;
line-height: 40rpx;
color: white;
border-radius: 40rpx;
}
.error {
background-color: #F78989;
}
.notify {
min-height: 100vh;
background-color: #F6F7F9;
.content {
padding: 28rpx;
.card {
height: 200rpx;
display: flex;
justify-content: space-between;
margin-bottom: 25rpx;
background-color: #FFFFFF;
padding: 20rpx;
.left,
.right {
font-size: 28rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.create-time,
.deadline {
color: #808080;
}
.left {
.name {
color: #4A90E2;
}
}
.right {
align-items: flex-end;
.create-time,
.deadline {}
.title-state {
display: flex;
align-items: center;
text:nth-child(2) {
margin-left: 20rpx;
font-size: 32rpx;
font-weight: 900;
color: #525252;
}
}
}
}
}
}
</style>