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

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

parent 3dd01d04
...@@ -8,7 +8,13 @@ export function listPetmNotice(query) { ...@@ -8,7 +8,13 @@ export function listPetmNotice(query) {
params: query params: query
}) })
} }
export function sysMail(params) {
return request({
url: '/sysMail/queryByPagination',
method: 'get',
params
})
}
// 查询消息详细 // 查询消息详细
export function getPetmNotice(id) { export function getPetmNotice(id) {
return request({ return request({
......
{ {
"name" : "若依移动端", "name" : "若依移动端",
"appid" : "__UNI__25A9D80", "appid" : "__UNI__A3D4D74",
"description" : "", "description" : "",
"versionName" : "1.1.0", "versionName" : "1.1.0",
"versionCode" : "100", "versionCode" : "100",
......
<template> <template>
<view style="background-color: #fff;height: 100vh"> <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 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 class="top-tabs">
取消 <u-tabs :list="list1" lineWidth="90"
</view> lineColor="#333399"
<view style="text-align: right;width: 80%" class="fontColor" @click="setRead"> :activeStyle="{
标记已读 color: '#333399',
</view> }"
</view> :inactiveStyle="{
color: '#111111'}"
<view v-if="delShow" class="topContent_read"> @click="clickTabs"
<view style="width: 20%" class="fontColor" @click="cancelDel"> ></u-tabs>
取消
</view>
<view style="text-align: right;width: 80%" class="fontColor" @click="setDel">
删除
</view>
</view> </view>
<!--消息卡片--> <!--消息卡片-->
<view v-for="(item,key) in noticeList" :key="key" style="display: flex;background-color: #ffffff"> <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)"> <view v-if="checkShow" class="checkView" @click="selectRead(item)">
<u-checkbox-group v-model="item.checkStatus" @change="selectRead(item)"> <u-checkbox-group v-model="item.checkStatus" @change="selectRead(item)">
<u-checkbox <u-checkbox
...@@ -68,11 +42,11 @@ ...@@ -68,11 +42,11 @@
<view style="display: flex"> <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-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'" /> <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>
<view class="subTitleClass">{{ item.subtitle }}</view> <view class="subTitleClass">{{ item.message }}</view>
<view class="timeClass"> <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> </view>
</view> </view>
...@@ -84,7 +58,7 @@ ...@@ -84,7 +58,7 @@
</view> </view>
<view style="font-size: 26rpx;font-weight: 400;color: #666666;line-height: 30rpx;margin-top: 36rpx"> <view style="font-size: 26rpx;font-weight: 400;color: #666666;line-height: 30rpx;margin-top: 36rpx">
<text> <text>
{{ queryNotice.isRead === 0 ? '暂无未读消息': '暂无已读消息' }} {{ '暂无消息' }}
</text> </text>
</view> </view>
</view> </view>
...@@ -109,14 +83,20 @@ ...@@ -109,14 +83,20 @@
</template> </template>
<script> <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 { parseTime } from '../../api/utils/ruoyi'
import { imageUrl } from '../../config' import { imageUrl } from '../../config'
import MineNavbar from "../../components/mine-navbar/mineNavbar";
export default { export default {
name: 'Index', name: 'Index',
components: { MineNavbar },
data() { data() {
return { return {
list1: [{
name: '基础数据审批',
}, {
name: '生产信息审批',
}, ],
tipsShow: false, tipsShow: false,
loading: true, loading: true,
checkShow: false, checkShow: false,
...@@ -140,10 +120,10 @@ export default { ...@@ -140,10 +120,10 @@ export default {
topSelectValue: 0, topSelectValue: 0,
defaultPageSize: 10, defaultPageSize: 10,
queryNotice: { queryNotice: {
pageNum: 1, page: 1,
pageSize: 10, rows: 10,
receiverId: undefined, receiverId: undefined,
isRead: 0 mesType: '1'
}, },
noticeList: [], noticeList: [],
total: 0, total: 0,
...@@ -160,31 +140,25 @@ export default { ...@@ -160,31 +140,25 @@ export default {
readArrayId: [] readArrayId: []
} }
}, },
onShow() { created() {
const user = JSON.parse(uni.getStorageSync('user'))
console.log('user', user)
this.queryNotice.receiverId = user.userId
this.getPetmNoticeList() this.getPetmNoticeList()
// this.getUserOpenId()
}, },
methods: { methods: {
parseTime, clickTabs(item) {
sectionChange(index) { this.queryNotice.mesType = item === '基础数据审批' ? '1' : '2'
this.queryNotice.isRead = index
this.getPetmNoticeList() this.getPetmNoticeList()
}, },
parseTime,
getPetmNoticeList() { getPetmNoticeList() {
this.loading = true this.loading = true
listPetmNotice(this.queryNotice).then(res => { sysMail(this.queryNotice).then(res => {
if (res.code === 200) {
console.log('消息列表', res) console.log('消息列表', res)
this.noticeList = res.rows this.noticeList = res.rows
this.total = res.total 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.loadStatus = 'nomore'
} }
this.loading = false this.loading = false
}
}) })
}, },
toMark() { toMark() {
...@@ -234,10 +208,10 @@ export default { ...@@ -234,10 +208,10 @@ export default {
}, },
onReachBottom() { onReachBottom() {
this.loadStatus = 'loading' this.loadStatus = 'loading'
if (this.queryNotice.pageSize * this.queryNotice.pageNum >= this.total) { if (this.queryNotice.rows * this.queryNotice.page >= this.total) {
this.loadStatus = 'nomore' this.loadStatus = 'nomore'
} else { } else {
this.queryNotice.pageSize += this.defaultPageSize this.queryNotice.rows += this.defaultPageSize
this.getPetmNoticeList() this.getPetmNoticeList()
this.loadStatus = 'loadmore' this.loadStatus = 'loadmore'
} }
...@@ -383,8 +357,9 @@ export default { ...@@ -383,8 +357,9 @@ export default {
} }
.notice-container { .notice-container {
width: 100%; width: 100%;
margin-top: 542rpx;
background-color: #fff; background-color: #fff;
min-height: calc(100vh - 160rpx); overflow-y: hidden;
} }
.topContent { .topContent {
display: flex; display: flex;
...@@ -511,20 +486,26 @@ export default { ...@@ -511,20 +486,26 @@ export default {
margin-right: 0 !important; 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{ ::v-deep .u-loading-page__warpper__loading-icon__img{
width: 90rpx !important; width: 90rpx !important;
height: 90rpx !important; height: 90rpx !important;
} }
::v-deep .u-navbar--fixed { ::v-deep .u-tabs__wrapper__nav__item__text{
background-color: #fff !important; 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 { //::v-deep .u-subsection {
// background: black; // 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