字体调整

调整UI大小;
加入消息选中删除功能
This commit is contained in:
471615499@qq.com 2024-08-28 22:13:01 +08:00
parent d267842a86
commit 50c09303e8
9 changed files with 149 additions and 48 deletions

View File

@ -145,6 +145,15 @@ export function repairRemindReadRq(data) {
});
}
// 删除指定id消息
export function repairRemindRemoveRq(data) {
return request({
url: `/app/repairRemind/remove`,
method: "post",
data
});
}
// 清空消息列表
export function repairRemindClearRq(data) {
return request({

View File

@ -3,11 +3,12 @@ const app = getApp()
import {
repairRemindListRq,
repairRemindReadRq,
repairRemindClearRq
repairRemindClearRq,
repairRemindRemoveRq
} from "../../../api/repair/repair.js"
import Dialog from '@vant/weapp/dialog/dialog';
import Notify from '@vant/weapp/notify/notify';
Page({
/**
@ -22,8 +23,26 @@ Page({
dataList: [],
isDataAll: false,
},
checkedId: {},
showEdit: false
},
openEdit() {
this.setData({
showEdit: true,
checkedId: {}
})
},
cancelEdit() {
this.setData({
showEdit: false,
checkedId: {}
})
},
removeChecked() {
this.setData({
showEdit: true
})
},
/**
* 生命周期函数--监听页面加载
*/
@ -83,6 +102,10 @@ Page({
},
jumpInfoDetail(e) {
if (this.data.showEdit) {
// 编辑模式下不可跳转
return
}
console.log('detail', e);
let id = e.currentTarget.dataset.obj.id
let repairId = e.currentTarget.dataset.obj.repairId
@ -100,6 +123,58 @@ Page({
})
})
},
changeCheck(e) {
console.log(e)
let id = e.currentTarget.dataset.obj.id
let _this = this
let _checkedId = `checkedId[${id}]`
_this.setData({
[_checkedId]: e.detail
})
},
removeChecked() {
let _this = this
let _idArr = _this.data.checkedId
let _idStr = ''
for (let key in _idArr) {
// console.log(_idArr[key])
if(_idArr[key]) {
_idStr += key + ','
}
}
if (_idStr != '') {
_idStr = _idStr.slice(0, -1)
} else {
Notify('请至少勾选一条消息!')
return
}
// console.log(_idStr)
Dialog.confirm({
title: '请确认',
message: '是否删除选中的消息?',
})
.then(() => {
repairRemindRemoveRq({
id:_idStr
}).then(res => {
// 重新加载列表
_this.setData({
info: {
pageNum: 1,
pageSize: 10,
dataList: [],
isDataAll: false,
},
checkedId: {}
})
// 重新加载
_this.getDataList()
})
})
.catch(() => {
// on cancel
})
},
removeAll() {
let _this = this
// 确认

View File

@ -1,9 +1,12 @@
{
"navigationBarTitleText": "消息通知",
"usingComponents": {
"van-divider": "@vant/weapp/divider/index",
"van-icon": "@vant/weapp/icon/index",
"van-dialog": "@vant/weapp/dialog/index"
},
"onReachBottomDistance": 100
"navigationBarTitleText": "消息通知",
"usingComponents": {
"van-divider": "@vant/weapp/divider/index",
"van-icon": "@vant/weapp/icon/index",
"van-dialog": "@vant/weapp/dialog/index",
"van-checkbox": "@vant/weapp/checkbox/index",
"van-checkbox-group": "@vant/weapp/checkbox-group/index",
"van-notify": "@vant/weapp/notify/index"
},
"onReachBottomDistance": 100
}

View File

@ -1,22 +1,29 @@
<view class="containerView public">
<view class="itemTitleView">
<view class="title"></view>
<view class="more" bind:tap="removeAll">清空</view>
</view>
<view class="infoView">
<view class="itemView {{item.read != '1' ? 'activity' : ''}} " wx:for="{{info.dataList}}" wx:for-item="item" wx:key="*this" data-obj="{{item}}" bind:tap="jumpInfoDetail">
<view class="contentView ellipsisFont">
<view class="title">消息提醒</view>
<view class="msg ellipsisFont">{{item.content}}</view>
<view class="time">{{item.createTime}}</view>
</view>
<van-icon class="arrow" name="arrow" color="#c3c3c3" size="40rpx" />
</view>
</view>
<view class="title"></view>
<view class="more" wx:if="{{ !showEdit }}" bind:tap="openEdit">管理</view>
<view class="more" wx:if="{{ showEdit }}" bind:tap="cancelEdit">取消</view>
<view class="more" wx:if="{{ showEdit }}" bind:tap="removeChecked">删除已选</view>
<view class="more" wx:if="{{ showEdit }}" bind:tap="removeAll">清空全部</view>
</view>
<view style="clear: both;"></view>
<view class="infoView">
<view class="loadAllLine" wx:if="{{info.isDataAll}}">
<van-divider class="van-divider" customStyle="font-size: 26rpx;" contentPosition="center">数据已全部加载</van-divider>
<view class="itemView {{item.read != '1' ? 'activity' : ''}} " wx:for="{{info.dataList}}" wx:for-item="item" wx:key="*this">
<van-checkbox wx:if="{{ showEdit }}" value="{{ checkedId[item.id] }}" data-obj="{{item}}" bind:change="changeCheck"></van-checkbox>
<view class="contentView ellipsisFont" data-obj="{{item}}" bind:tap="jumpInfoDetail">
<view class="title">消息提醒</view>
<view class="msg ellipsisFont">{{item.content}}</view>
<view class="time">{{item.createTime}}</view>
</view>
<van-icon class="arrow" name="arrow" color="#c3c3c3" size="40rpx" data-obj="{{item}}" bind:tap="jumpInfoDetail" />
</view>
</view>
<view class="loadAllLine" wx:if="{{info.isDataAll}}">
<van-divider class="van-divider" customStyle="font-size: 26rpx;" contentPosition="center">数据已全部加载</van-divider>
</view>
</view>
<van-dialog id="van-dialog" />
<van-notify id="van-notify" />

View File

@ -6,7 +6,7 @@
.itemTitleView {
/* border-left: 8rpx solid #76aef9; */
display: flex;
/* display: flex; */
justify-content: space-between;
align-items: center;
margin: 10px;
@ -20,10 +20,14 @@
.itemTitleView .more {
font-size: 28rpx;
/* display: inline; */
float: right;
font-size: 32rpx;
color: #5482de;
margin-right: 15px;
margin-top: 5px;
margin-bottom: 5px;
}
.infoView {
/* border: 1px solid red; */
background: white;
@ -62,12 +66,13 @@
}
.infoView .itemView .contentView .title {
font-size: 30rpx;
font-size: 32rpx;
color: black;
font-weight: 700;
}
.infoView .itemView .contentView .msg {
font-size: 26rpx;
font-size: 30rpx;
color: gray;
margin-top: 16rpx;
}

View File

@ -59,9 +59,10 @@
}
.topHead .contentView .label1 {
font-size: 28rpx;
font-size: 32rpx;
color: white;
line-height: 1;
font-weight: 700;
}
.topHead .contentView .label2 {
@ -89,7 +90,7 @@
}
.mainView .statusView .label {
font-size: 28rpx;
font-size: 32rpx;
font-weight: bold;
}
@ -108,7 +109,7 @@
.mainView .statusView .time {
margin-top: 20rpx;
font-size: 28rpx;
font-size: 32rpx;
}
.mainView .statusView .leftImg {
@ -131,7 +132,7 @@
.mainView .reportView .topTitle {
padding: 30rpx;
font-size: 28rpx;
font-size: 36rpx;
font-weight: bold;
}
@ -146,13 +147,13 @@
.mainView .reportView .itemView .label {
flex-shrink: 0;
width: 200rpx;
font-size: 30rpx;
width: 240rpx;
font-size: 32rpx;
color: gray;
}
.mainView .reportView .itemView .content {
font-size: 30rpx;
font-size: 32rpx;
word-break: break-all;
}
@ -189,12 +190,12 @@
.mainView .reportView .itemLineView .label {
flex-shrink: 0;
width: 200rpx;
font-size: 30rpx;
font-size: 32rpx;
color: gray;
}
.mainView .reportView .itemLineView .content {
font-size: 30rpx;
font-size: 32rpx;
word-break: break-all;
}
@ -213,7 +214,7 @@
.mainView .reportView .repairProgressView .label {
margin-top: 10rpx;
font-size: 28rpx;
font-size: 32rpx;
color: #5176b1;
}

View File

@ -42,21 +42,21 @@
.itemView .centerView .rightView .labelName {
line-height: 1;
font-size: 28rpx;
font-size: 32rpx;
font-weight: bold;
}
.itemView .centerView .rightView .labelContent1 {
line-height: 1;
margin-top: 30rpx;
font-size: 24rpx;
font-size: 28rpx;
color: gray;
}
.itemView .centerView .rightView .labelContent2 {
line-height: 1.5;
margin-top: 10rpx;
font-size: 24rpx;
font-size: 28rpx;
color: gray;
}

View File

@ -42,7 +42,7 @@
.itemView .centerView .rightView .labelContent {
line-height: 1;
line-height: 1.2;
margin-top: 18rpx;
overflow: hidden;
@ -50,7 +50,7 @@
white-space: nowrap;
word-break: break-all;
font-size: 26rpx;
font-size: 32rpx;
}
.itemView .centerView .rightView .labelContent:first-of-type {

View File

@ -91,7 +91,7 @@
.contentView .rowColumnView .label {
display: inline-block;
position: relative;
font-size: 30rpx;
font-size: 34rpx;
color: #000000;
/* max-width: 160rpx; */
margin-right: 30rpx;
@ -109,7 +109,7 @@
}
.input {
font-size: 30rpx;
font-size: 34rpx;
}
@ -158,6 +158,7 @@
height: 250rpx !important;
/* border: 1px solid rgb(126, 126, 126, 0.2) !important; */
padding: 10rpx !important;
font-size: 34rpx;
}
.dialogBtnView {