Commit 3dd4588a authored by xinzhedeai's avatar xinzhedeai

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

parent 8dc9bb9d
...@@ -99,10 +99,13 @@ body { ...@@ -99,10 +99,13 @@ body {
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
margin-bottom: 8px;
}
.bold{
color: #333; color: #333;
font-size: 0.3rem; font-size: 0.3rem;
font-weight: bold; font-weight: bold;
margin-bottom: 8px;
} }
.tab1-row2{ .tab1-row2{
display: flex; justify-content: space-between; color: #666; font-size: 0.28rem; margin-bottom: 8px; display: flex; justify-content: space-between; color: #666; font-size: 0.28rem; margin-bottom: 8px;
......
...@@ -26,23 +26,26 @@ ...@@ -26,23 +26,26 @@
</van-tabs> </van-tabs>
</div> </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)"> <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 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"> <div class="tab1-row1">
<span>场所类型:{{ item.smallPlaceTypeName }}</span> <span>场所类型:{{ item.placeType }}</span>
<span>检查单位:{{ item.checkUnit }}</span>
</div> </div>
<!-- 第三行:监察人 + 检查日期(两列) --> <!-- 第三行:监察人 + 检查日期(两列) -->
<div class="tab1-row2"> <div class="tab1-row2">
<span>检查人:{{ item.checkPeopleName }}</span> <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>
<!-- 第四行:未整改数 + 隐患数(两列) --> <!-- 第四行:未整改数 + 隐患数(两列) -->
......
...@@ -57,8 +57,12 @@ window.addEventListener('load', function () { ...@@ -57,8 +57,12 @@ window.addEventListener('load', function () {
hiddenCount: 0, //隐患数 hiddenCount: 0, //隐患数
hiddenNoReCount: 0, //未整改数 hiddenNoReCount: 0, //未整改数
}, },
loading: false,
finished: false,
page: 1, page: 1,
size: 10, size: 10,
total: 0,
merId: null, // 商户id merId: null, // 商户id
unitName: '', // 单位名称 unitName: '', // 单位名称
smallPlaceTypeName: '', // 场所类型 smallPlaceTypeName: '', // 场所类型
...@@ -73,25 +77,25 @@ window.addEventListener('load', function () { ...@@ -73,25 +77,25 @@ window.addEventListener('load', function () {
}, },
computed: {}, computed: {},
methods: { methods: {
reset(){ reset() {
this.page = 1 this.page = 1
this.size = 10 this.size = 10
this.total = 0
this.hazardList = [] this.hazardList = []
}, },
onSearch() { onSearch() {
console.log('xxxx', this.merName) console.log('xxxx', this.merName)
this.reset() this.init()
this.getMerchantSelfCheckData()
}, },
//初始化页面 //初始化页面
init() { init() {
// this.getMerchantSelfCheckData()
},
tabChange(){
this.reset() this.reset()
this.getMerchantSelfCheckData() this.getList()
},
tabChange() {
this.init()
}, },
getMerchantSelfCheckData() { getList() {
// 更多示例数据... // 更多示例数据...
vant.Toast.loading({ vant.Toast.loading({
message: '正在加载...', message: '正在加载...',
...@@ -121,16 +125,18 @@ window.addEventListener('load', function () { ...@@ -121,16 +125,18 @@ window.addEventListener('load', function () {
vant.Toast.clear() vant.Toast.clear()
this.page = this.page - 1 // 重新请求后,分页数恢复上一次请求的值 this.page = this.page - 1 // 重新请求后,分页数恢复上一次请求的值
setTimeout(() => { setTimeout(() => {
this.getMerchantSelfCheckData() this.getList()
}, 0) }, 0)
return return
} }
if (res) { if (res) {
var result = JSON.parse(res) var result = JSON.parse(res)
console.log('接口信息', result)
if (result.code !== 200 && result.data == null) { if (result.code !== 200 && result.data == null) {
return return
} }
this.hazardList.push(...result.rows) this.hazardList.push(...result.rows)
this.total = result.total
if (this.page * this.size >= this.total) { if (this.page * this.size >= this.total) {
this.finished = true // 下滑不在刷新数据 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