|
|
@ -7,43 +7,83 @@ import Screen from "./components/Screen.vue"; |
|
|
|
import CitySwitch from "./components/CitySwitch.vue"; |
|
|
|
import { taskStore } from "../../store/task"; |
|
|
|
import PositionType from './components/PositionType.vue' |
|
|
|
import { taskAllList } from "@/api/task"; |
|
|
|
import { showToast } from 'vant' |
|
|
|
const store=taskStore() |
|
|
|
const taskList=reactive([ |
|
|
|
{ |
|
|
|
id:1 |
|
|
|
}, |
|
|
|
{ |
|
|
|
id:2 |
|
|
|
}, |
|
|
|
]) |
|
|
|
const state=reactive({ |
|
|
|
citySwitchBool:false, |
|
|
|
PositionTypeBool:false, |
|
|
|
ScreenBool:false, |
|
|
|
positionValue:'', |
|
|
|
serviceMode:'', |
|
|
|
taskCycle:'' |
|
|
|
taskCycle:'', |
|
|
|
taskList:[], |
|
|
|
pageNum:0, |
|
|
|
pageSize:10, |
|
|
|
loading:false, |
|
|
|
finished:false |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const gettaskAllList=async ()=>{ |
|
|
|
state.loading=true |
|
|
|
if(state.pageNum==1){ |
|
|
|
state.taskList=[] |
|
|
|
} |
|
|
|
const res:any =await taskAllList({ |
|
|
|
"position_name": state.positionValue, |
|
|
|
"service_mode": state.serviceMode, |
|
|
|
"task_cycle": state.taskCycle, |
|
|
|
"pageNum": state.pageNum, |
|
|
|
"pageSize": state.pageSize, |
|
|
|
"city": store.cityValue, |
|
|
|
}) |
|
|
|
console.log('getPositionTypeList------',res); |
|
|
|
if(res){ |
|
|
|
state.taskList=state.taskList.concat(res.records) |
|
|
|
state.loading=false |
|
|
|
if(state.taskList.length>=res.total){ |
|
|
|
state.finished=true |
|
|
|
}else{ |
|
|
|
state.finished = false |
|
|
|
} |
|
|
|
}else{ |
|
|
|
showToast(res.msg) |
|
|
|
state.loading=false |
|
|
|
} |
|
|
|
} |
|
|
|
const onLoad=()=>{ |
|
|
|
state.pageNum=state.pageNum+1 |
|
|
|
gettaskAllList() |
|
|
|
} |
|
|
|
const onRefresh=()=>{ |
|
|
|
state.pageNum=1 |
|
|
|
gettaskAllList() |
|
|
|
} |
|
|
|
const closeCitySwitch=(name:string)=>{ |
|
|
|
if(name){ |
|
|
|
store.setCityValue(name) |
|
|
|
store.setCityValue(name) |
|
|
|
onRefresh() |
|
|
|
} |
|
|
|
state.citySwitchBool=false |
|
|
|
} |
|
|
|
const closePositionType=(name:string)=>{ |
|
|
|
if(name){ |
|
|
|
state.positionValue=name |
|
|
|
onRefresh() |
|
|
|
} |
|
|
|
state.PositionTypeBool=false |
|
|
|
} |
|
|
|
const screenClick=()=>{ |
|
|
|
state.ScreenBool=true |
|
|
|
state.ScreenBool=true |
|
|
|
} |
|
|
|
const closeScreenBool=(obj:any)=>{ |
|
|
|
if(obj){ |
|
|
|
state.serviceMode=obj.mode |
|
|
|
state.taskCycle=obj.cycle |
|
|
|
onRefresh() |
|
|
|
} |
|
|
|
state.ScreenBool=false |
|
|
|
} |
|
|
@ -53,9 +93,6 @@ provide('popup',{ |
|
|
|
closeScreenBool |
|
|
|
} |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script> |
|
|
|
|
|
|
|
<template> |
|
|
@ -76,7 +113,19 @@ provide('popup',{ |
|
|
|
<div class="task-screen-pop" @click="screenClick()">筛选<span></span></div> |
|
|
|
</div> |
|
|
|
<Banner></Banner> |
|
|
|
<TaskList :taskList="taskList"></TaskList> |
|
|
|
<van-pull-refresh v-model="state.loading" @refresh="onRefresh"> |
|
|
|
<van-list |
|
|
|
v-model:loading="state.loading" |
|
|
|
:finished="state.finished" |
|
|
|
finished-text="没有更多了" |
|
|
|
@load="onLoad" |
|
|
|
> |
|
|
|
<TaskList :taskList="state.taskList"></TaskList> |
|
|
|
<div class="wy-no-data" v-if="!state.loading && state.taskList.length==0">暂无数据</div> |
|
|
|
</van-list> |
|
|
|
</van-pull-refresh> |
|
|
|
|
|
|
|
|
|
|
|
<van-popup |
|
|
|
v-model:show="state.citySwitchBool" |
|
|
|
position="left" |
|
|
@ -107,8 +156,8 @@ provide('popup',{ |
|
|
|
<FooterTabbar></FooterTabbar> |
|
|
|
|
|
|
|
</template> |
|
|
|
<style scoped> |
|
|
|
.task-page{ |
|
|
|
<style scoped> |
|
|
|
.task-page{ |
|
|
|
background: #f9f9f9; |
|
|
|
padding: 0 0.59rem 3rem; |
|
|
|
min-height: calc(100vh - 3rem); |
|
|
@ -187,5 +236,16 @@ provide('popup',{ |
|
|
|
border-top: 0.36rem solid #333333; |
|
|
|
margin-left: 0.25rem; |
|
|
|
} |
|
|
|
|
|
|
|
.wy-no-data{ |
|
|
|
width: 8.96rem; |
|
|
|
height: 5.73rem; |
|
|
|
background: url('../../assets/img/icon/icon-no-data.png') no-repeat; |
|
|
|
background-size: 100%; |
|
|
|
padding-top: 7.5rem; |
|
|
|
text-align: center; |
|
|
|
color: #666666; |
|
|
|
margin: 6rem auto 0; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
</style> |