<template>
|
<view>
|
<!-- 自定义导航栏 -->
|
<view class="navBarBox fix">
|
<!-- 状态栏占位 -->
|
<view class="statusBar" :style="{ paddingTop: statusBarHeight + 'px' }"></view>
|
<!-- 真正的导航栏内容 -->
|
<view class="navBar">
|
<view class="barText">叫应记录</view>
|
</view>
|
</view>
|
<!-- 页面内容 -->
|
<view class="responseList" v-if="responseList.length > 0">
|
<view v-for="(item, index) in responseList" :key="index" class="itemContent">
|
<view class="timeLeft">
|
<text>{{item.time}}</text>
|
<text>{{item.timeMin}}</text>
|
</view>
|
<view class="contentRight">
|
<text>{{item.content}}</text>
|
<text style="color: rgb(76, 197, 248);" @click="toDetail(item)">[查看信息详情]</text>
|
</view>
|
</view>
|
</view>
|
<view v-else>
|
<u-empty
|
mode="data"
|
icon="http://cdn.uviewui.com/uview/empty/data.png"
|
margin-top="50%">
|
</u-empty>
|
</view>
|
<tabBar :currentPagePath="page"></tabBar>
|
</view>
|
</template>
|
|
<script>
|
import { getResponse, getDetail } from '../../../api/response.js'
|
import tabBar from '../tabBarIndex.vue'
|
export default {
|
components:{
|
tabBar
|
},
|
data() {
|
return {
|
data: {
|
pageIndex: 1,
|
pageSize: 10000000
|
},
|
// 状态栏高度
|
statusBarHeight: 0,
|
responseList: [],
|
page: 'pages/tabBar/response/response'
|
}
|
},
|
onShow () {
|
this.getResponseList();
|
},
|
onLoad() {
|
//获取手机状态栏高度
|
this.statusBarHeight = uni.getSystemInfoSync()['statusBarHeight'];
|
uni.hideTabBar();
|
},
|
methods: {
|
getResponseList() {
|
getResponse(this.data).then(res => {
|
console.log("res",res);
|
if (res.code === 100) {
|
this.responseList = res.data ? res.data : [];
|
if (this.responseList.length > 0) {
|
this.responseList.forEach((item, index) => {
|
this.responseList[index].time = item.responseTime.substring(0,10);
|
this.responseList[index].timeMin = item.responseTime.substring(10,19);
|
this.responseList[index].content = item.receiveUnit + " " + item.recipienterName + " " + "在" + item.title + ' 进行了“已安排部署”叫应。';
|
})
|
}
|
}else {
|
this.responseList = [];
|
}
|
}).catch(err=>{})
|
},
|
toDetail(item) {
|
console.log("de",item)
|
getDetail({id: item.id}).then(res => {
|
console.log("response",res)
|
if(res.code == 100) {
|
uni.navigateTo({
|
url: `/pages/tabBar/notice/detail?data=` + encodeURIComponent(JSON.stringify(res.data))
|
})
|
}
|
});
|
},
|
//下拉刷新
|
onPullDownRefresh() {
|
console.log('refresh');
|
setTimeout(() => {
|
uni.stopPullDownRefresh();
|
this.getResponseList();
|
}, 1000);
|
},
|
}
|
}
|
</script>
|
|
<style>
|
.navBarBox .navBar {
|
background-color:#fff;
|
height: 50px;
|
display: flex;
|
flex-direction: row;
|
justify-content: center;
|
align-items: center;
|
box-shadow: 0 3px 12px rgba(0,0,0,0.05);
|
}
|
.barText{
|
/* margin-left: 20px; */
|
text-align: center;
|
width: 85%;
|
font-size: 16px;
|
/* text-align: center; */
|
font-weight: 600;
|
}
|
.fix{
|
position: sticky;
|
top: 0;
|
left: 0;
|
right: 0;
|
width: 100%;
|
z-index: 1;
|
}
|
.statusBar{
|
background-color:lightgrey;
|
}
|
.responseList{
|
display: flex;
|
flex-direction: column;
|
margin: 0 12px;
|
background: #fff;
|
border-radius: 5px;
|
box-shadow: 0 3px 12px rgba(0,0,0,0.05);
|
margin-top: 12px;
|
}
|
.itemContent{
|
display: flex;
|
align-items: center;
|
font-size: 16px;
|
color: #333;
|
margin-top: 15px;
|
padding: 0 12px;
|
border-bottom: 1px solid #ebebeb;
|
|
&:last-of-type{
|
border-bottom: none;
|
}
|
}
|
.timeLeft{
|
border-radius: 5px;
|
padding: 15px 15px;
|
background-color: rgb(174, 228, 255) ;
|
display: flex;
|
flex-direction: column;
|
align-items: flex-start;
|
justify-content: center;
|
margin-bottom: 15px;
|
}
|
.contentRight{
|
flex: 1;
|
font-size: 18px;
|
margin: 0 5px 15px 8px;
|
}
|
</style>
|