detection-business/pages/xiaoxi/xiaoxi.vue

363 lines
6.2 KiB
Vue
Raw Normal View History

2024-09-11 15:55:28 +08:00
<!-- 默认复制 -->
<template>
<view class="content">
<view class="c-top">
<view class="">
2024-11-11 13:18:56 +08:00
2024-09-11 15:55:28 +08:00
</view>
<view class="c-title">官方通知</view>
<view class=""></view>
</view>
2024-11-11 13:18:56 +08:00
2024-09-11 15:55:28 +08:00
<view class="cont">
2024-11-11 13:18:56 +08:00
2024-09-11 15:55:28 +08:00
<view class="bjimg" v-if="arrlist == ''">
<image src="http://www.nuoyunr.com/lananRsc/detection/qs.png" mode=""></image>
</view>
<view class="c-box" v-for="(item,index) in arrlist" :key="index" @click="getdetails(item.id)">
<view class="hongdian" v-if="item.isRead == '0'"></view>
<view class="c-b-top">
<view class="t-left">
2024-09-18 19:09:42 +08:00
<image :src="baseImageUrl+item.newsCover" mode="aspectFill"></image>
2024-09-11 15:55:28 +08:00
</view>
<view class="t-right">
<view class="t-tilte">{{item.newsTitle}}</view>
<view class="tw-tilte">{{item.publishUnit}}</view>
<view class="t-zi" v-html="item.newsContent"></view>
</view>
</view>
2024-11-11 13:18:56 +08:00
2024-09-11 15:55:28 +08:00
<view class="c-b-bom">
<view class="b-left"></view>
<view class="b-left">
{{item.createTime ? item.createTime.substring(0,item.createTime.length - 3) : ''}}
</view>
</view>
</view>
</view>
2024-11-11 13:18:56 +08:00
2024-09-11 15:55:28 +08:00
<view style="width: 100%; height: 50px;"></view>
<tabBar ref="tarBar" :msg="msg"></tabBar>
</view>
</template>
<script>
import config from '@/config'
import request from '../../utils/request';
import tabBar from'../../components/tabBar/tabBar.vue'
export default{
data(){
return{
msg:'2',
chuan:'',
roles:[],
jcshopRole:false,
jcgfRole:false,
isOpen: false,
fab:false,
imgs:'',
type:'zflm',
animationData: {},
isRote: false,
animation: null,
actindex:0,
partnerId:'',
arrlist:[],
taplist:[],
pageNum: 1,//第几页
pageSize: 20,//一页多少张
totalPages: 0,//总数
2024-09-18 19:09:42 +08:00
baseImageUrl:this.$baseImageUrl
2024-09-11 15:55:28 +08:00
}
},
2024-11-11 13:18:56 +08:00
2024-09-11 15:55:28 +08:00
onReachBottom() {
if (this.pageSize > this.totalPages) {
uni.showToast({
title: '没有下一页数据',
icon: 'none'
})
2024-11-11 13:18:56 +08:00
2024-09-11 15:55:28 +08:00
} else {
this.pageNum++
this.getlistindex()
}
},
onLoad(){
this.partnerId = uni.getStorageSync('partnerId')
2024-11-11 13:18:56 +08:00
2024-09-11 15:55:28 +08:00
this.interval = setInterval(() => {
this.getlistindex()
}, 3000);
},
onShow() {
this.getlistindex()
this.imgs = this.$baseUrl
2024-11-11 13:18:56 +08:00
2024-09-11 15:55:28 +08:00
},
2024-11-11 13:18:56 +08:00
2024-09-11 15:55:28 +08:00
components:{
tabBar,
},
methods:{
getdetails(id){
uni.navigateTo({
url:'/pages/xiaoxi/details?id='+id
})
},
getback(){
uni.navigateBack({
delta:1,
2024-11-11 13:18:56 +08:00
})
2024-09-11 15:55:28 +08:00
},
async getlistindex(){
let res = await request({
url: '/appInspection/news/msgList',
method: 'get',
data: {
partnerId:this.partnerId,
pageSize:this.pageSize,
pageNum:this.pageNum
}
})
// this.arrlist = res.rows
if (this.pageNum != 1){
this.arrlist = this.arrlist.concat(res.rows)
}else{
this.arrlist = res.rows
}
let total = res.total
2024-11-11 13:18:56 +08:00
this.totalPages = Math.ceil(total / this.pageSize);
2024-09-11 15:55:28 +08:00
},
2024-11-11 13:18:56 +08:00
2024-09-11 15:55:28 +08:00
},
beforeDestroy() {
clearInterval(this.interval);
},
2024-11-11 13:18:56 +08:00
2024-09-11 15:55:28 +08:00
}
</script>
<style scoped lang="scss">
.content{
width: 100%;
height: calc(100vh);
background-color: #F6F6F6;
box-sizing: border-box;
// padding-top: 45px;
}
.top-icon{
margin-bottom: 45px;
}
.q-fab{
position: fixed;
bottom: 50px;
right: 15px;
width: 55px;
height: 55px;
border-radius: 50%;
overflow: hidden;
image{
width: 100%;
height: 100%;
}
}
.fab-z1{
position: fixed;
bottom: 115px;
right: 15px;
width: 50px;
height: 50px;
border-radius: 50%;
overflow: hidden;
image{
width: 100%;
height: 100%;
}
}
.fab-z2{
position: fixed;
bottom: 50px;
right: 80px;
width: 50px;
height: 50px;
border-radius: 50%;
overflow: hidden;
image{
width: 100%;
height: 100%;
}
}
.c-tap{
width: 100%;
height: 40px;
box-sizing: border-box;
padding: 15px;
display: flex;
background-color: white;
align-items: center;
}
.c-top{
width: 100%;
height: 88px;
box-sizing: border-box;
padding: 15px;
padding-top: 44px;
display: flex;
justify-content: space-between;
align-items: center;
background-color: white;
}
.c-title{
font-size: 18px;
font-weight: bold
}
.cont{
width: 100%;
padding: 15px;
padding-top: 0px ;
box-sizing: border-box;
background-color: #F6F6F6;
2024-11-11 13:18:56 +08:00
2024-09-11 15:55:28 +08:00
}
.hongdian{
width: 15px;
height: 15px;
background-color: crimson;
border-radius: 50%;
overflow: hidden;
position: absolute;
top: 5px;
right: 5px;
z-index: 9999;
}
.c-box{
width: 100%;
box-sizing: border-box;
padding: 7px;
background-color: white;
margin-top: 10px;
border-radius: 10px;
position: relative;
}
.c-b-top{
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
}
.t-left{
width: 40%;
height: 100px;
border-radius: 7px;
margin-right: 10px;
overflow: hidden;
image{
width: 100%;
height: 100%;
}
2024-11-11 13:18:56 +08:00
2024-09-11 15:55:28 +08:00
}
.t-right{
width: 60%;
}
.t-tilte{
font-size: 20px;
font-weight: bold;
color: #333333;
2024-11-11 13:18:56 +08:00
white-space: nowrap;
2024-09-11 15:55:28 +08:00
overflow: hidden;
text-overflow: ellipsis;
}
.tw-tilte{
width: 100%;
text-align: right;
font-size: 16px;
font-weight: bold;
color: #5e5e5e;
2024-11-11 13:18:56 +08:00
white-space: nowrap;
2024-09-11 15:55:28 +08:00
overflow: hidden;
text-overflow: ellipsis;
2024-11-11 13:18:56 +08:00
2024-09-11 15:55:28 +08:00
}
.t-zi{
font-size: 14px;
font-weight: 400;
color: #666666;
overflow: hidden;
text-overflow: ellipsis;
2024-11-11 13:18:56 +08:00
display: -webkit-box;
2024-09-11 15:55:28 +08:00
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
}
.bjimg{
width: 255px;
height: 236px;
margin: 0px auto;
margin-top: 100px;
image{
width: 100%;
height: 100%;
}
}
.c-b-bom{
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 5px;
}
.b-left{
color: #0D2E8D;
font-size: 14px;
}
.b-right{
display: flex;
justify-content: space-between;
align-items: center;
}
.z-lv{
display: flex;
align-items: center;
color: #0D2E8D;
font-size: 15px;
margin-right: 10px;
}
.y-hong{
display: flex;
align-items: center;
color: #fa3534;
font-size: 15px;
margin-right: 15px;
}
.z-img{
width: 20px;
height: 15px;
image{
width: 100%;
height: 100%;
}
margin-right: 2px;
}
.tap-box{
width: 30%;
text-align: center;
}
.gang{
height: 4px;
background: #0D2E8D;
width: 80%;
margin: 0px auto;
}
.lan{
color: #0D2E8D;
}
2024-11-11 13:18:56 +08:00
</style>