develop #1

Merged
dashixiong merged 37 commits from develop into main 2026-02-11 02:07:35 +00:00
7 changed files with 395 additions and 33 deletions
Showing only changes of commit 78334cfa6a - Show all commits

View File

@ -1,9 +1,9 @@
import request from '@/utils/request'
// 查询工单主列表
export function listTicket({pageNum, pageSize}) {
export function listTicket(url) {
return request({
url: `/ticket/list?pageNum=${pageNum}&pageSize=${pageSize}`,
url,
method: 'get',
})
}

View File

@ -1,4 +1,15 @@
<template>
<view class="container">
<view class="btn-list">
<uni-row >
<uni-col :span="12">
<button type="default" class="btns" :class="{'active-btn' : active === 'undone'}" @click="changeTab('undone')">未处理</button>
</uni-col>
<uni-col :span="12">
<button type="default" class="btns" :class="{'active-btn' : active === 'done'}" @click="changeTab('done')">已处理</button>
</uni-col>
</uni-row>
</view>
<scroll-view class="scroll-y" :scroll-y="true" @scrolltolower="lower" scrolltoupper="upper" >
<view class="content">
<view class="item-list" v-for="item in list" :key="item.ticketNo+'ticket'" @click="toDetail(item.id)">
@ -13,6 +24,7 @@
</view>
</view>
</scroll-view>
</view>
</template>
<script>
import {mapState} from 'vuex'
@ -25,6 +37,7 @@
},
data(){
return {
active:'undone',
total:0,
list:[],
pageNum:1,
@ -32,6 +45,12 @@
}
},
methods:{
changeTab(active){
if(active===this.active)return
this.active = active
this.reset()
this.init()
},
lower(){
if(this.list.length>=this.total){
return console.log('数据已经加载完成')
@ -40,8 +59,15 @@
this.init().catch(()=>{this.pageNum-=1})
},
init(){
//0:'待处理', 1:'已处理', 2:'处理中'
let url=`/ticket/list?pageNum=${this.pageNum}&pageSize=${this.pageSize}`
if(this.active === 'done'){
url +=`&status=1`
}else{
url +=`&status=0&status=2`
}
uni.showLoading()
return listTicket({pageNum:this.pageNum,pageSize:this.pageSize}).then(response=>{
return listTicket(url).then(response=>{
const data = JSON.parse(JSON.stringify(response?.rows || []))
this.list =this.list.concat(data)
this.total = response?.total || 0
@ -64,12 +90,41 @@
</script>
<style scoped lang="scss">
.container{
position: relative;
}
uni-button:after{
border:none;
border-radius: 0;
}
.btn-list{
position: absolute;
top:0;
left: 0;
width:100%;
z-index:2;
.btns{
border-radius: 0;
border:none;
border-bottom: 1px solid #eee;
width:100%;
text-align: center;
font-size: 16px;
line-height: 50px;
background-color: #fff;
&.active-btn{
background-color: #3a98ff;
color:#fff;
}
}
}
.scroll-y{
height: calc(100vh - 50px)
height: calc(100vh - 50px);
z-index:1;
}
.content {
background-color: #ffffff;
padding:50px 20px;
padding:70px 20px 50px 20px;//todo 根据顶部tab设置padding-top
}
.item-list{
border-radius: 7px;