<!--
 * @Author: ysh
 * @Date: 2025-01-21 10:01:39
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2025-02-19 15:18:10
-->
<template>
	<view class="u-page">
		<scroll-view class="scroll-list" scroll-y="true">
			<view class="uni-list">
				<view class="uni-list-cell">
					<view class="uni-media-list" @click="$tab.navigateTo('/pages/message/apply/apply')">
						<view style="margin-right: 20rpx;">
							<u-image :fade="false" src="@/static/images/message/apply.png" width="40px" height="40px"></u-image>
						</view>
						<view class="uni-media-list-body">
							<view class="uni-media-list-text-top"><span>审批</span>
							</view>
							<view class="uni-media-list-text-bottom">
								<uni-text><span>您有新流程待审批</span></uni-text>
							</view>
						</view>
						<view class="info">
							<span style="font-size: 26rpx;color: #999999;">{{ acceptTime }}</span>
							<u-badge class="info-badge" type="error" count="2" :max="99" :value="detail"></u-badge>
						</view>
					</view>
				</view>
				<view class="uni-list-cell">
					<view class="uni-media-list" @click="$tab.navigateTo('/pages/message/completed/index')">
						<view style="margin-right: 20rpx;">
							<u-image :fade="false" src="@/static/images/message/completed.png" width="40px" height="40px"></u-image>
						</view>
						<view class="uni-media-list-body">
							<view class="uni-media-list-text-top"><span>已办任务</span>
							</view>
							<view class="uni-media-list-text-bottom">
								<uni-text><span>您的已办任务，在此进行撤回或查看已办任务等操作</span></uni-text>
							</view>
						</view>
					</view>
				</view>
				<view class="uni-list-cell">
					<view class="uni-media-list" @click="$tab.navigateTo('/pages/message/myProcess/index')">
						<view style="margin-right: 20rpx;">
							<u-image :fade="false" src="@/static/images/message/flowable.png" width="40px" height="40px"></u-image>
						</view>
						<view class="uni-media-list-body">
							<view class="uni-media-list-text-top"><span>我的流程</span>
							</view>
							<view class="uni-media-list-text-bottom">
								<uni-text><span>您发起的流程，在此可取消流程</span></uni-text>
							</view>
						</view>
					</view>
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
import {
	todoList
} from "@/api/flowable/todo";
export default {
	data() {
		return {
			todoList: [],
			detail: 0,
			acceptTime: ''
		};
	},
	created() {
		this.getTodoList();
	},
	onLoad() {

	},
	methods: {
		getTodoList() {
			todoList({
				pageNum: 1,
				pageSize: 999,
				name: null
			}).then(response => {
				this.detail = response.data.total;
				this.todoList = response.data.records;
				this.acceptTime = response.data.records[0].createTime;
			});
		}
	},
};
</script>
<style lang="scss">
@import '../common/uni.css';

.info {
	position: relative;

	.info-badge {
		position: absolute;
		right: 0;
		top: 45rpx;
	}
}
</style>
<style>
.icon {
	width: 1em;
	height: 1em;
	vertical-align: -0.15em;
	fill: currentColor;
	overflow: hidden;
}
</style>