societyHome.vue
3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<template>
<view class="company_container">
<up-navbar placeholder :leftIconSize="0" bgColor="transparent" />
<view class="work_box">
<view class="work_list">
<carCard v-for="carItem in List" :key="carItem.taskId" tipContent="待办" :carInfo="carItem">
<template #header>
<navTop :carNum="carItem.licensePlateNumber" />
</template>
<template #center>
<wordInfo :phone="carItem.phone" :userName="carItem.name" :company="carItem.sysDeptName" />
</template>
<template #footer>
<operateList :carInfo="carItem" @refreshList="getList" />
</template>
</carCard>
<up-empty
:show="List.length == 0"
mode="list"
text="暂无待办事项"
/>
</view>
<!-- 分页器 -->
<view v-show="List.length > 0">
<uni-pagination :total="allTotal" v-model="queryParams.pageNum" :pageSize="queryParams.pageSize" @change="getList" />
</view>
</view>
<!-- 底部导航栏 -->
<up-tabbar
:value="useTabbar.societyCurrent"
activeColor="#3680FE"
inactiveColor="#707070"
>
<up-tabbar-item text="主页" icon="home" :badge="useTabbar.societyTotal"></up-tabbar-item>
<up-tabbar-item text="我的" icon="account" @click="goRouter">
<template #active-icon>
<image style="width: 48rpx;" class="u-page__item__slot-icon" src="@/static/tabbarIcon/my-active.png" mode="widthFix"></image>
</template>
<template #inactive-icon>
<image style="width: 48rpx;" class="u-page__item__slot-icon" src="@/static/tabbarIcon/my.png" mode="widthFix"></image>
</template>
</up-tabbar-item>
</up-tabbar>
</view>
</template>
<script setup>
import { ref, reactive } from 'vue';
import { onPullDownRefresh } from '@dcloudio/uni-app'
import { queryMyList } from '@/api/work.js'
import carCard from '@/components/carCard.vue';
import navTop from '@/components/navTop.vue';
import wordInfo from '@/components/wordInfo.vue';
import operateList from '@/components/operateList.vue';
import useTabbarStore from '@/store/modules/tabbar.js'
const useTabbar = useTabbarStore()
const List = ref([])
const allTotal = ref(0)
const titleStyle = {
fontSize: '36rpx',
color: '#fff',
fontWeight: 500
}
const queryParams = reactive({
pageNum: 1,
pageSize: 10
});
// 获取待办任务
const getList = async () => {
const { data } = await queryMyList(queryParams);
List.value = data.rows;
allTotal.value = data.total;
useTabbar.societyTotal = data.total;
}
// 用户下拉刷新
onPullDownRefresh(async () => {
queryParams.pageNum = 1
List.value = []
await getList()
uni.stopPullDownRefresh()
})
const goRouter = (index) => {
useTabbar.societyCurrent = index
uni.redirectTo({
url: '/pages/societyMy/societyMy'
})
}
getList()
</script>
<style lang="scss" scoped>
.company_container{
width: 100%;
height: 100vh;
background: url('http://bxhd.crgx.net/profile/avatar/2024/09/25/bg-index_20240925113012A004.png') no-repeat;
background-size: 100% 100%;
overflow: hidden;
.work_box{
padding: 20rpx 30rpx 250rpx;
height: calc(100vh - 88rpx);
background-color: #F8F9FF;
overflow-y: scroll;
.work_list{
display: flex;
flex-direction: column;
gap: 20rpx;
margin-bottom: 30rpx;
}
}
}
</style>