Commit 3dd4588a authored by xinzhedeai's avatar xinzhedeai

add: 检查记录 最新提醒标记、布局调整

parent 8dc9bb9d
......@@ -99,10 +99,13 @@ body {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-bottom: 8px;
}
.bold{
color: #333;
font-size: 0.3rem;
font-weight: bold;
margin-bottom: 8px;
}
.tab1-row2{
display: flex; justify-content: space-between; color: #666; font-size: 0.28rem; margin-bottom: 8px;
......
......@@ -26,24 +26,27 @@
</van-tabs>
</div>
<van-list>
<van-list v-model:loading="loading" :offset="10" :finished="finished" finished-text="没有更多了" @load="getList" :immediate-check="false">
<van-cell v-for="item in hazardList" :key="item.id" @click="viewDetail(item.id)">
<div style="width: 100%;position: relative;" v-if="activeTab=='1'">
<div class="reminder-badge"></div>
<div class="reminder-badge" v-if="!item.msgFlag"></div>
<!-- 第一行:商户名称 -->
<div class="tab1-row1">{{ item.merchantName }}</div>
<div class="tab1-row1 bold">{{ item.merName }}</div>
<!-- 第二行:场所类型 + 检查单位(两列) -->
<div class="tab1-row2">
<span>场所类型:{{ item.smallPlaceTypeName }}</span>
<span>检查单位:{{ item.checkUnit }}</span>
<div class="tab1-row1">
<span>场所类型:{{ item.placeType }}</span>
</div>
<!-- 第三行:监察人 + 检查日期(两列) -->
<div class="tab1-row2">
<span>检查人:{{ item.checkPeopleName }}</span>
<span>检查日期:{{ item.checkDate }}</span>
<span>检查日期:{{ item.checkDate && item.checkDate.split(' ')[0] }}</span>
</div>
<div class="tab1-row1">
<span>检查单位:{{ item.checkUnit }}</span>
</div>
<!-- 第四行:未整改数 + 隐患数(两列) -->
<div class="tab1-row2">
......
......@@ -4,7 +4,7 @@ window.addEventListener('load', function () {
el: '#app',
data() {
return {
merName: '',
merName: '',
// 新增子Tab数据
activeTab: '1',
hazardList: [
......@@ -57,8 +57,12 @@ window.addEventListener('load', function () {
hiddenCount: 0, //隐患数
hiddenNoReCount: 0, //未整改数
},
loading: false,
finished: false,
page: 1,
size: 10,
total: 0,
merId: null, // 商户id
unitName: '', // 单位名称
smallPlaceTypeName: '', // 场所类型
......@@ -73,25 +77,25 @@ window.addEventListener('load', function () {
},
computed: {},
methods: {
reset(){
this.page = 1
this.size = 10
this.hazardList = []
},
onSearch() {
console.log('xxxx', this.merName)
this.reset()
this.getMerchantSelfCheckData()
},
reset() {
this.page = 1
this.size = 10
this.total = 0
this.hazardList = []
},
onSearch() {
console.log('xxxx', this.merName)
this.init()
},
//初始化页面
init() {
// this.getMerchantSelfCheckData()
this.reset()
this.getList()
},
tabChange(){
this.reset()
this.getMerchantSelfCheckData()
},
getMerchantSelfCheckData() {
tabChange() {
this.init()
},
getList() {
// 更多示例数据...
vant.Toast.loading({
message: '正在加载...',
......@@ -111,8 +115,8 @@ window.addEventListener('load', function () {
pageNum: this.page++, // 每次请求增加下一页
pageSize: this.size,
sort: 'lawId,desc',
merName: this.merName,
merName: this.merName,
},
},
(res) => {
......@@ -121,16 +125,18 @@ window.addEventListener('load', function () {
vant.Toast.clear()
this.page = this.page - 1 // 重新请求后,分页数恢复上一次请求的值
setTimeout(() => {
this.getMerchantSelfCheckData()
this.getList()
}, 0)
return
}
if (res) {
var result = JSON.parse(res)
console.log('接口信息', result)
if (result.code !== 200 && result.data == null) {
return
}
this.hazardList.push(...result.rows)
this.total = result.total
if (this.page * this.size >= this.total) {
this.finished = true // 下滑不在刷新数据
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment