Files

157 lines
3.2 KiB
Vue
Executable File

<template>
<view class="page">
<scroll-view scroll-y="true" scroll-top="100%">
<view class="group">
<view class="list-info-group" v-for="(item,index) in list" :key="index">
<view class="list-info-item">
<text class="list-title">{{item.FTitle}}</text>
</view>
<view class="list-info-item ">
<text>发送人:{{item.user_name}}</text>
</view>
<view class="list-info-item list-border">
<text>日期:{{item.FDateTime}}</text>
</view>
<view class="list-info-center" @click="Detail(item)">
<text>查看详情</text>
</view>
</view>
</view>
</scroll-view>
</view>
</template>
<script>
import {
mapState
} from 'vuex';
export default {
data() {
return {
list:[],
pageIndex:1
}
},
computed: {
...mapState(['hasLogin', 'userInfo'])
},
onLoad() {
this.GetPrivateInfo()
//隐藏TabBar红标
this.$global.setUnReadObj({isShow:false})
},
methods: {
GetPrivateInfo(){
let requestParams = {
"id": this.userInfo.token
};
let tokenParam = this.userInfo.dbAlise+","+this.userInfo.UserID+","+ this.userInfo.UserName;
uni.showLoading({
icon:'loading',
title:'加载中……',
mask:true
});
this.$request.post(
{
data: {
action: 'GetPrivateMessage',
params: requestParams,
data:{
page:this.pageIndex
}
}
},
tokenParam
).then(res => {
uni.hideLoading();
let data=JSON.parse(res)
for(let item of data)
{
this.list.push(item)
}
}).catch(err=>{
uni.hideLoading();
let data=JSON.parse(err)
})
},
Detail:function(item){
console.log(item)
var data = {};
data.interId=item.FInterID
data.datetime = item.FDateTime;
data.title = item.FTitle
data.article_type = 0;
// data.source = this.userInfo.OrgStructures.FName.substr(0, 4)
data.comment_count = 0
data.content=item.FInfo
uni.navigateTo({
url: `/pages/home/detail/detail?data=${JSON.stringify(data)}`
})
}
}
}
</script>
<style>
page{
background-color: #F2F2F2;
}
view{
display: flex;
}
.page{
width: 100%;
height: 100%;
flex-direction: column;
align-items: center;
}
.group {
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 5%;
}
.list-info-group{
background-color: #FFFFFF;
flex-direction: column;
justify-content: center;
border: 1upx solid #D8D8D8;
border-radius: 10px;
width: 80%;
height: 250upx;
margin-top: 5%;
padding-top: 5px;
}
.list-info-item{
align-items: center;
padding-left: 5%;
}
.list-border{
flex-direction: column;
justify-content: center;
align-items: flex-start;
border-bottom: 1upx solid #CCCCCC;
}
.list-info-center{
flex-direction: column;
align-items: center;
justify-content: center;
}
.list-title{
font-weight: bold;
font-size: 16px;
margin-right: 5%;
/* 文字不换行 */
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap; //文本不换行,这样超出一行的部分被截取,显示...
}
</style>