Commit 7fe1b9f8 authored by 刘怀志's avatar 刘怀志

feat(消息): 消息模块-1

parent 3dd01d04
......@@ -8,7 +8,13 @@ export function listPetmNotice(query) {
params: query
})
}
export function sysMail(params) {
return request({
url: '/sysMail/queryByPagination',
method: 'get',
params
})
}
// 查询消息详细
export function getPetmNotice(id) {
return request({
......
{
"name" : "若依移动端",
"appid" : "__UNI__25A9D80",
"appid" : "__UNI__A3D4D74",
"description" : "",
"versionName" : "1.1.0",
"versionCode" : "100",
......
<template>
<view style="background-color: #fff;height: 100vh">
<ya-navbar title="消息中心" :left-icon="null" bg-style="#fff" :fixed="true" :title-style="titleStyle" />
<mine-navbar title="DHEC QMS" />
<view class="notice-container">
<!--顶部提示-->
<view v-if="tipsShow" class="topTips">
暂无可选消息
</view>
<!--顶部选择-->
<view v-if="!checkShow && !delShow" class="topContent">
<view class="topSelect">
<u-subsection
:list="topSelectList"
:current="queryNotice.isRead"
mode="subsection"
inactive-color="#343744"
@change="sectionChange"
/>
</view>
<view class="topButton">
<span v-if="queryNotice.isRead === 0" @click="toMark">选择</span>
<span v-else @click="toDelete">选择</span>
</view>
</view>
<view v-if="checkShow" class="topContent_read">
<view style="width: 20%;" class="fontColor" @click="cancelMark">
取消
</view>
<view style="text-align: right;width: 80%" class="fontColor" @click="setRead">
标记已读
</view>
</view>
<view v-if="delShow" class="topContent_read">
<view style="width: 20%" class="fontColor" @click="cancelDel">
取消
</view>
<view style="text-align: right;width: 80%" class="fontColor" @click="setDel">
删除
</view>
<!--顶部选择-->
<view class="top-tabs">
<u-tabs :list="list1" lineWidth="90"
lineColor="#333399"
:activeStyle="{
color: '#333399',
}"
:inactiveStyle="{
color: '#111111'}"
@click="clickTabs"
></u-tabs>
</view>
<!--消息卡片-->
<view v-for="(item,key) in noticeList" :key="key" style="display: flex;background-color: #ffffff">
<!-- <view class="checkView" v-show="checkShow">-->
<view v-if="checkShow" class="checkView" @click="selectRead(item)">
<u-checkbox-group v-model="item.checkStatus" @change="selectRead(item)">
<u-checkbox
......@@ -68,11 +42,11 @@
<view style="display: flex">
<u-icon v-if="item.isPlatform === '1'" size="24" :name="imageUrl + '/tmt-pic/pet-app/xiaoxi_icon_tuisong@2x.png'" />
<u-icon v-else size="24" :name="imageUrl + '/tmt-pic/pet-app/xiaoxi_icon_xitong@2x.png'" />
<view class="titleClass">{{ item.title }}</view>
<view class="titleClass">{{ queryNotice.mesType === '1' ? '生产信息审批' : '基础数据审批' }}</view>
</view>
<view class="subTitleClass">{{ item.subtitle }}</view>
<view class="subTitleClass">{{ item.message }}</view>
<view class="timeClass">
{{ item.createTime !== undefined && item.createTime !== null ? parseTime(item.createTime, '{y}/{m}/{d} {h}:{i}') : '暂无数据' }}
{{ item.updateDate !== undefined && item.updateDate !== null ? parseTime(item.updateDate, '{m}-{d} {h}:{i}:{s}') : '暂无数据' }}
</view>
</view>
</view>
......@@ -84,7 +58,7 @@
</view>
<view style="font-size: 26rpx;font-weight: 400;color: #666666;line-height: 30rpx;margin-top: 36rpx">
<text>
{{ queryNotice.isRead === 0 ? '暂无未读消息': '暂无已读消息' }}
{{ '暂无消息' }}
</text>
</view>
</view>
......@@ -109,14 +83,20 @@
</template>
<script>
import { delPetmNotice, listPetmNotice, readPetmNotice, updatePetmNotice } from '../../api/system/petmNotice'
import {delPetmNotice, listPetmNotice, readPetmNotice, sysMail, updatePetmNotice} from '../../api/system/petmNotice'
import { parseTime } from '../../api/utils/ruoyi'
import { imageUrl } from '../../config'
import MineNavbar from "../../components/mine-navbar/mineNavbar";
export default {
name: 'Index',
components: { MineNavbar },
data() {
return {
list1: [{
name: '基础数据审批',
}, {
name: '生产信息审批',
}, ],
tipsShow: false,
loading: true,
checkShow: false,
......@@ -140,10 +120,10 @@ export default {
topSelectValue: 0,
defaultPageSize: 10,
queryNotice: {
pageNum: 1,
pageSize: 10,
page: 1,
rows: 10,
receiverId: undefined,
isRead: 0
mesType: '1'
},
noticeList: [],
total: 0,
......@@ -160,31 +140,25 @@ export default {
readArrayId: []
}
},
onShow() {
const user = JSON.parse(uni.getStorageSync('user'))
console.log('user', user)
this.queryNotice.receiverId = user.userId
created() {
this.getPetmNoticeList()
// this.getUserOpenId()
},
methods: {
parseTime,
sectionChange(index) {
this.queryNotice.isRead = index
clickTabs(item) {
this.queryNotice.mesType = item === '基础数据审批' ? '1' : '2'
this.getPetmNoticeList()
},
parseTime,
getPetmNoticeList() {
this.loading = true
listPetmNotice(this.queryNotice).then(res => {
if (res.code === 200) {
sysMail(this.queryNotice).then(res => {
console.log('消息列表', res)
this.noticeList = res.rows
this.total = res.total
if (this.queryNotice.pageSize * this.queryNotice.pageNum >= this.total) {
if (this.queryNotice.rows * this.queryNotice.page >= this.total) {
this.loadStatus = 'nomore'
}
this.loading = false
}
})
},
toMark() {
......@@ -234,10 +208,10 @@ export default {
},
onReachBottom() {
this.loadStatus = 'loading'
if (this.queryNotice.pageSize * this.queryNotice.pageNum >= this.total) {
if (this.queryNotice.rows * this.queryNotice.page >= this.total) {
this.loadStatus = 'nomore'
} else {
this.queryNotice.pageSize += this.defaultPageSize
this.queryNotice.rows += this.defaultPageSize
this.getPetmNoticeList()
this.loadStatus = 'loadmore'
}
......@@ -383,8 +357,9 @@ export default {
}
.notice-container {
width: 100%;
margin-top: 542rpx;
background-color: #fff;
min-height: calc(100vh - 160rpx);
overflow-y: hidden;
}
.topContent {
display: flex;
......@@ -511,20 +486,26 @@ export default {
margin-right: 0 !important;
}
::v-deep .u-line-1 {
font-size: 24rpx !important;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400 !important;
color: #999BA1 !important;
line-height: 28rpx !important;
}
::v-deep .u-loading-page__warpper__loading-icon__img{
width: 90rpx !important;
height: 90rpx !important;
}
::v-deep .u-navbar--fixed {
background-color: #fff !important;
::v-deep .u-tabs__wrapper__nav__item__text{
font-family: PingFangSC, PingFang SC;
font-weight: 500;
font-size: 28rpx;
}
.top-tabs{
display: flex;
justify-content: center;
align-items: center;
margin-top: 20rpx;
border-bottom: 2rpx solid #F2F2F2;
::v-deep .u-tabs{
width: 60%;
}
}
//::v-deep .u-subsection {
// background: black;
......
This diff is collapsed.
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