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

228 lines
8.3 KiB
Vue

<template>
<page-meta :page-font-size="fontValue+'px'" :root-font-size="fontValue+'px'"></page-meta>
<view class="certificate-list">
<Navbar title="我的证件" :backGround="false" :isBack="true" />
<scroll-view style="width: 100%;height: 90vh;margin-top: 4vh;" @scrolltolower="onScrollTolower" scroll-y="true">
<view class="certificate-box" v-for="(item, index) in infoList" :key="index" @click="handleDetail(item)">
<!-- <image style="width: 140rpx;height: 140rpx;position: absolute;top:30%;right: 5%;" src="/static/images/system/statusIcon1.png"></image> -->
<view class="certificate-view1" v-if="item.certificateType==1">
<view style="display: flex;align-items: center;margin-bottom: 10rpx;">
<view style="font-size: 28rpx;color: #2A2B2F;font-weight: 600;">{{item.certificateTypeName}}</view>
<view style="color:#64686E;margin-left: 10px;font-size: 26rpx;">{{item.certificateNo}}</view>
<view class="status-view" style="margin-left: 10px;">{{item.stateName}}</view>
</view>
<view style="width: 100%;margin: 10rpx 0;display: flex;align-items: center;">
<view style="width: 50%;">
<view class="text-view" style="color: #979B9F;">有效期</view>
<view class="text-view" style="color: #2A2B2F;">{{ item.issueDay }} 至 {{ item.issueLifespan }}</view>
</view>
<view style="width: 50%;">
<view class="text-view" style="color: #979B9F;">姓名 </view>
<view class="text-view" style="color: #2A2B2F;">{{item.name}}</view>
</view>
</view>
<view style="width: 100%;margin: 10rpx 0;display: flex;align-items: center;">
<view style="width: 50%;">
<view class="text-view" style="color: #979B9F;">证件柜</view>
<view class="text-view" style="color: #2A2B2F;">{{item.deviceName||'无'}}</view>
</view>
<view style="width: 50%;">
<view class="text-view" style="color: #979B9F;">槽位 </view>
<view class="text-view" style="color: #2A2B2F;">{{item.slotNo||'无'}}</view>
</view>
</view>
<view class="text-view" style="color: #979B9F;">位置</view>
<view class="text-view" style="color: #2A2B2F;">{{item.deviceAddr||'无'}}</view>
</view>
<view class="certificate-view2" v-if="item.certificateType==2">
<view style="display: flex;align-items: center;margin-bottom: 10rpx;">
<view style="font-size: 28rpx;color: #2A2B2F;font-weight: 600;">{{item.certificateTypeName}}</view>
<view style="color:#64686E;margin-left: 10px;font-size: 26rpx;">{{item.certificateNo}}</view>
<view class="status-view" style="margin-left: 10px;">{{item.stateName}}</view>
</view>
<view style="width: 100%;margin: 10rpx 0;display: flex;align-items: center;">
<view style="width: 50%;">
<view class="text-view" style="color: #979B9F;">有效期</view>
<view class="text-view" style="color: #2A2B2F;">{{ item.issueDay }} 至 {{ item.issueLifespan }}</view>
</view>
<view style="width: 50%;">
<view class="text-view" style="color: #979B9F;">姓名 </view>
<view class="text-view" style="color: #2A2B2F;">{{item.name}}</view>
</view>
</view>
<view style="width: 100%;margin: 10rpx 0;display: flex;align-items: center;">
<view style="width: 50%;">
<view class="text-view" style="color: #979B9F;">证件柜</view>
<view class="text-view" style="color: #2A2B2F;">{{item.deviceName||'无'}}</view>
</view>
<view style="width: 50%;">
<view class="text-view" style="color: #979B9F;">槽位 </view>
<view class="text-view" style="color: #2A2B2F;">{{item.slotNo||'无'}}</view>
</view>
</view>
<view class="text-view" style="color: #979B9F;">位置</view>
<view class="text-view" style="color: #2A2B2F;">{{item.deviceAddr||'无'}}</view>
</view>
<view class="certificate-view3" v-if="item.certificateType==3">
<view style="display: flex;align-items: center;margin-bottom: 10rpx;">
<view style="font-size: 28rpx;color: #2A2B2F;font-weight: 600;">{{item.certificateTypeName}}</view>
<view style="color:#64686E;margin-left: 10px;font-size: 26rpx;">{{item.certificateNo}}</view>
<view class="status-view" style="margin-left: 10px;">{{item.stateName}}</view>
</view>
<view style="width: 100%;margin: 10rpx 0;display: flex;align-items: center;">
<view style="width: 50%;">
<view class="text-view" style="color: #979B9F;">有效期</view>
<view class="text-view" style="color: #2A2B2F;">{{ item.issueDay }} 至 {{ item.issueLifespan }}</view>
</view>
<view style="width: 50%;">
<view class="text-view" style="color: #979B9F;">姓名 </view>
<view class="text-view" style="color: #2A2B2F;">{{item.name}}</view>
</view>
</view>
<view style="width: 100%;margin: 10rpx 0;display: flex;align-items: center;">
<view style="width: 50%;">
<view class="text-view" style="color: #979B9F;">证件柜</view>
<view class="text-view" style="color: #2A2B2F;">{{item.deviceName||'无'}}</view>
</view>
<view style="width: 50%;">
<view class="text-view" style="color: #979B9F;">槽位 </view>
<view class="text-view" style="color: #2A2B2F;">{{item.slotNo||'无'}}</view>
</view>
</view>
<view class="text-view" style="color: #979B9F;">位置</view>
<view class="text-view" style="color: #2A2B2F;">{{item.deviceAddr||'无'}}</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: [
// {certificateType:1,certificateNo:"F2304892901"},
// {certificateType:2,certificateNo:"F2304892902"},
// {certificateType:3,certificateNo:"F2304892903"},
],
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,
userId:uni.getStorageSync("userId")
}
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)
}
},
handleDetail(certificate) {
uni.navigateTo({
url: `/pages/certificateManage/certificatePersonalInfo/detail?certificate=${JSON.stringify(certificate)}`
})
},
addInfo() {
uni.navigateTo({
url: `/pages/certificateManage/certificateInfo/editCertificate`
})
},
}
}
</script>
<style lang="scss" scoped>
.certificate-list {
height: 100vh;
background-image: url('@/static/images/system/pageBg.png');
background-size: 100% 100%;
// padding: 30rpx;
}
.certificate-box{
width: 96%;
height: 420rpx;
margin: 20rpx auto;
position: relative;
}
.certificate-view1{
width: 100%;
height: 100%;
padding: 20rpx;
background-image: url('@/static/images/system/certificate1.png');
background-size: 100% 100%;
}
.certificate-view2{
width: 100%;
height: 100%;
padding: 20rpx;
background-image: url('@/static/images/system/certificate2.png');
background-size: 100% 100%;
}
.certificate-view3{
width: 100%;
height: 100%;
padding: 20rpx;
background-image: url('@/static/images/system/certificate3.png');
background-size: 100% 100%;
}
.status-view{
padding: 5rpx 10rpx;
background: #BEDAFF;
color: #1F72EA;
font-size: 24rpx;
border-radius: 8rpx;
}
.text-view{
margin-bottom: 10rpx;font-size: 28rpx;
}
</style>