bonus-Certificate-app/pages/certificateManage/certificateInfo/index.vue

185 lines
5.2 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<page-meta :page-font-size="fontValue+'px'" :root-font-size="fontValue+'px'"></page-meta>
<view class="certificate-list">
<Navbar title="证件信息" :showRightText="true" :backGround="false" :isBack="true" :text="'新增'" @clickIcon="addInfo"/>
<view style="width: 94%;height: 80rpx;margin: 10rpx auto;">
<u-search shape="square" placeholder="搜索" v-model="keyword" :showAction="true" actionText="搜索" :animation="false" @custom="searchList"></u-search>
</view>
<scroll-view style="width: 100%;height: 85vh;" @scrolltolower="onScrollTolower" scroll-y="true">
<view class="info-item" v-for="(item, index) in infoList" :key="index">
<view style="width: 100%;height: 100%;padding-top: 10rpx;font-size: 24rpx;">
<view class="label-box">
<view class="label-view" style="width: 60%;">
<view class="label">姓名</view>
<view class="text">{{item.name}}</view>
</view>
<view style="font-size: 20rpx;color: #333333;width: 15%;display: flex;align-items: center;">{{item.stateName}}</view>
</view>
<view class="label-box">
<view class="label-view" style="width: 50%;">
<view class="label">身份证号</view>
<view class="text">{{item.idNumber}}</view>
</view>
<view class="label-view" style="width: 50%;">
<view class="label">证件编号</view>
<view class="text">{{item.certificateNo}}</view>
</view>
</view>
<view class="label-box">
<view class="label-view" style="width: 50%;">
<view class="label">出生日期</view>
<view class="text">{{item.birthday}}</view>
</view>
<view class="label-view" style="width: 50%;">
<view class="label">出生地点</view>
<view class="text">{{item.birthAddr}}</view>
</view>
</view>
<view class="label-box">
<view class="label-view" style="width: 50%;">
<view class="label">证件类型</view>
<view class="text">{{item.certificateTypeName}}</view>
</view>
<view class="label-view" style="width: 50%;">
<view class="label">签发地</view>
<view class="text">{{item.issueAddr}}</view>
</view>
</view>
<view class="label-box">
<view class="label-view" style="width: 50%;">
<view class="label">签发日期</view>
<view class="text">{{item.issueDay}}</view>
</view>
<view class="label-view" style="width: 50%;">
<view class="label">有效期至</view>
<view class="text">{{item.issueLifespan}}</view>
</view>
</view>
<view class="label-box">
<view class="label-view" style="width: 50%;">
<view class="label">设备编号</view>
<view class="text">{{item.deviceNo}}</view>
</view>
<view class="label-view" style="width: 50%;">
<view class="label">槽位编号</view>
<view class="text">{{item.soltNo}}</view>
</view>
</view>
</view>
</view>
<view style="margin: 20px 0" v-if="infoList.length > 0">
<u-loadmore :status="status" nomoreText="没有更多数据了" />
</view>
<view v-else class="flex justify-center align-center" style="height: 50vh">
<u-empty icon="../../static/images/not_order.png" text="暂无数据" textColor="#000" />
</view>
</scroll-view>
</view>
</template>
<script>
import { certificateInfoListApi } from '@/api/certificateManage/index.js';
export default {
data() {
return {
fontValue:uni.getStorageSync('fontSize') || 8,
keyword:"",
pageNum: 1,
pageSize: 10,
total: 0,
infoList: [],
status: 'loadmore',
}
},
onLoad() {
},
onShow(){
this.getList()
},
methods: {
//搜索
searchList(value){
this.pageNum=1
this.infoList=[]
this.getList()
},
// 翻页
onScrollTolower(){
console.log(this.infoList.length)
if(this.total>this.infoList.length){
this.pageNum++
this.getList()
}
},
//获取列表
async getList() {
console.log('获取列表')
const params = {
pageNum: this.pageNum,
pageSize: this.pageSize,
keyword: this.keyword
}
try {
const res = await certificateInfoListApi(params)
console.log('?? ~ getList ~ res:', res)
this.total = res.total;
if(this.pageNum==1){
this.infoList = res.rows
}else{
this.infoList.push(...res.rows)
}
this.status = this.total == this.infoList.length ? 'nomore' : 'loadmore'
} catch (error) {
console.log(error)
}
},
handleEdit(certificate) {
uni.navigateTo({
url: `/pages/certificateManage/certificateInfo/editCertificate?certificate=${JSON.stringify(certificate)}`
})
},
addInfo() {
uni.navigateTo({
url: `/pages/certificateManage/certificateInfo/editCertificate`
})
},
}
}
</script>
<style lang="scss" scoped>
.certificate-list {
height: 100vh;
background-color: #f8f8f8;
padding: 30rpx;
}
.info-item{
width: 100%;
height: auto;
display: flex;
align-items: center;
margin: 10rpx auto;
border-bottom: 1px solid #ccc;
}
.label-box{
width: 100%;
height: auto;
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 2px;
}
.label-view{
width: 100%;
display: flex;
align-items: center;
}
.label{
font-weight: 600;
}
.text{
}
</style>