Commit afdd37f1 authored by xinzhedeai's avatar xinzhedeai

add:隐患列表 全部已读UI

parent 7164cd96
...@@ -95,3 +95,27 @@ body { ...@@ -95,3 +95,27 @@ body {
position: absolute; position: absolute;
right: 0; right: 0;
} }
/* 在现有样式中添加以下CSS */
.float-read-btn {
position: fixed; /* 固定定位 */
right: 0.3rem; /* 右侧距离 */
bottom: 0.3rem; /* 底部距离 */
width: 1.07rem; /* 宽度 */
height: 1.07rem; /* 高度 */
background: #40A6FF; /* 背景色 */
border-radius: 50%; /* 圆角 */
display: flex; /* 弹性布局 */
flex-direction: column; /* 垂直排列 */
justify-content: center; /* 垂直居中 */
align-items: center; /* 水平居中 */
z-index: 999; /* 层级保证不被遮挡 */
cursor: pointer; /* 手型光标 */
}
.float-read-btn .btn-text {
font-size: 0.28rem; /* 文字大小 */
color: #FFFFFF; /* 文字颜色 */
line-height: 1.2; /* 行高 */
}
\ No newline at end of file
...@@ -74,6 +74,12 @@ ...@@ -74,6 +74,12 @@
</div> </div>
</van-cell> </van-cell>
</van-list> </van-list>
<!-- 新增悬浮按钮 -->
<div class="float-read-btn" @click="markAllAsRead">
<span class="btn-text">全部</span>
<span class="btn-text">已读</span>
</div>
</div> </div>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -11,104 +11,129 @@ window.addEventListener('load', function () { ...@@ -11,104 +11,129 @@ window.addEventListener('load', function () {
// 更多示例数据... // 更多示例数据...
], ],
activeTab: '', activeTab: '',
status: '', status: '',
merId: '', merId: '',
showSearch: false, // 控制搜索框的显示和隐藏 showSearch: false, // 控制搜索框的显示和隐藏
// 整改状态 0:待整改 1:已整改 2:待审核 3:整改逾期 // 整改状态 0:待整改 1:已整改 2:待审核 3:整改逾期
tabList: [ tabList: [
{ name: '', title: '全部', msgNum:0, }, { name: '', title: '全部', msgNum: 0, },
{ name: '2', title: '待审核', msgNum:0, }, { name: '2', title: '待审核', msgNum: 0, },
{ name: '0', title: '待整改', msgNum:5, }, { name: '0', title: '待整改', msgNum: 0, },
{ name: '1', title: '已整改' , msgNum:6,}, { name: '1', title: '已整改', msgNum: 0, },
{ name: '3', title: '整改逾期' , msgNum:7,}, { name: '3', title: '整改逾期', msgNum: 0, },
], ],
loading: false, loading: false,
finished: false, finished: false,
page: 0, page: 0,
size: 6, size: 6,
total: 0, total: 0,
remindStatistic:[] remindStatistic: []
} }
}, },
computed: { computed: {
}, },
created() { created() {
let merId = gemhoUtil.getParameter('merId') let merId = gemhoUtil.getParameter('merId')
if (merId !== undefined && merId !== null) { if (merId !== undefined && merId !== null) {
this.merId = merId this.merId = merId
} else { } else {
this.merId = '' this.merId = ''
} }
// 2025年6月7日 新增首页(信息统计跳转)类别区分逻辑。 // 2025年6月7日 新增首页(信息统计跳转)类别区分逻辑。
let type = gemhoUtil.getParameter('type') let type = gemhoUtil.getParameter('type')
if(type === 'nopass'){ if (type === 'nopass') {
this.activeTab = 2 this.activeTab = 2
}else if(type === 'willExpire'){ // 即将超期待整改 } else if (type === 'willExpire') { // 即将超期待整改
this.activeTab = 2 this.activeTab = 2
}else if(type === 'expired'){ // 超期 整改逾期 } else if (type === 'expired') { // 超期 整改逾期
this.activeTab = 4 this.activeTab = 4
} }
if (gemhoUtil.getCookie('userType') !== 'shop') { if (gemhoUtil.getCookie('userType') !== 'shop') {
this.showSearch = true this.showSearch = true
} }
this.init() this.init()
this.getRemindStatistic() this.getRemindStatistic()
}, },
methods: { methods: {
getRemindStatistic(){ markAllAsRead() { // 全部标记为已读
http2.post( http2.post(
{ {
serviceId: API_KEY_MAP['no-page']['id'], serviceId: API_KEY_MAP['no-page']['id'],
interfacePublicKey: API_KEY_MAP['no-page']['publicKey'], interfacePublicKey: API_KEY_MAP['no-page']['publicKey'],
interfacePrivateKey: API_KEY_MAP['no-page']['privateKey'], interfacePrivateKey: API_KEY_MAP['no-page']['privateKey'],
reqParams: { reqParams: {
sign: 24, // 隐患tab sign: 24, // 隐患tab
}, },
}, },
(res) => { (res) => {
if (!res) { if (!res) {
// 中台返回为undefined 重新请求 // 中台返回为undefined 重新请求
setTimeout(() => { setTimeout(() => {
this.getRemindStatistic() this.markAllAsRead()
}, 0) }, 0)
return return
} }
if (res) { if (res) {
var result = JSON.parse(res) var result = JSON.parse(res)
this.remindStatistic = result.data this.remindStatistic = result.data
} }
} }
) )
}, },
reset(){ getRemindStatistic() {
this.page = 0 http2.post(
this.size = 6 {
this.hazardList = [] serviceId: API_KEY_MAP['no-page']['id'],
}, interfacePublicKey: API_KEY_MAP['no-page']['publicKey'],
yhstatus(){ // tab值对应的隐患状态码装欢 interfacePrivateKey: API_KEY_MAP['no-page']['privateKey'],
if(this.activeTab === 0){ reqParams: {
return '' sign: 24, // 隐患tab
}else if(this.activeTab === 1){ },
return ~~'2' },
}else if(this.activeTab === 2){ (res) => {
return ~~'0' if (!res) {
}else if(this.activeTab === 3){ // 中台返回为undefined 重新请求
return ~~'1' setTimeout(() => {
}else if(this.activeTab === 4){ this.getRemindStatistic()
return ~~'3' }, 0)
} return
}, }
tabChange(title){ if (res) {
console.log('tab 切换', title) var result = JSON.parse(res)
this.reset() this.remindStatistic = result.data
this.getList() }
}, }
)
},
reset() {
this.page = 0
this.size = 6
this.hazardList = []
},
yhstatus() { // tab值对应的隐患状态码装欢
if (this.activeTab === 0) {
return ''
} else if (this.activeTab === 1) {
return ~~'2'
} else if (this.activeTab === 2) {
return ~~'0'
} else if (this.activeTab === 3) {
return ~~'1'
} else if (this.activeTab === 4) {
return ~~'3'
}
},
tabChange(title) {
console.log('tab 切换', title)
this.reset()
this.getList()
},
init() { init() {
this.getList() this.getList()
}, },
onSearch() { onSearch() {
this.reset() this.reset()
this.getList() this.getList()
}, },
// 新增选择确认方法 // 新增选择确认方法
onConfirmType(value) { onConfirmType(value) {
...@@ -151,13 +176,13 @@ window.addEventListener('load', function () { ...@@ -151,13 +176,13 @@ window.addEventListener('load', function () {
interfacePublicKey: API_KEY_MAP['page']['publicKey'], interfacePublicKey: API_KEY_MAP['page']['publicKey'],
interfacePrivateKey: API_KEY_MAP['page']['privateKey'], interfacePrivateKey: API_KEY_MAP['page']['privateKey'],
reqParams: { reqParams: {
sign: 3, sign: 3,
// merId: this.merId ? this.merId : '', // merId: this.merId ? this.merId : '',
merName: this.shanghuName, merName: this.shanghuName,
pageNum: this.page++, // 每次请求增加下一页 pageNum: this.page++, // 每次请求增加下一页
pageSize: this.size, pageSize: this.size,
sort: 'lawId,desc', sort: 'lawId,desc',
status: this.yhstatus() status: this.yhstatus()
}, },
}, },
(res) => { (res) => {
...@@ -171,23 +196,23 @@ window.addEventListener('load', function () { ...@@ -171,23 +196,23 @@ window.addEventListener('load', function () {
return return
} }
if (res) { if (res) {
var result = JSON.parse(res) var result = JSON.parse(res)
console.log(result, 'result') console.log(result, 'result')
this.loading = false; // 加载状态结束 this.loading = false; // 加载状态结束
this.hazardList.push(...result.rows); this.hazardList.push(...result.rows);
this.total = result.total this.total = result.total
if (this.page * this.size >= this.total) { if (this.page * this.size >= this.total) {
this.finished = true; // 下滑不在刷新数据 this.finished = true; // 下滑不在刷新数据
} }
} }
this.loading = false this.loading = false
setTimeout(() => { setTimeout(() => {
this.$nextTick(()=>{ this.$nextTick(() => {
vant.Toast.clear() vant.Toast.clear()
}) })
}, 0); }, 0);
} }
) )
}, 0) }, 0)
......
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