修复签到展示bug,修改图片比例为16:9
This commit is contained in:
+3
-3
@@ -3,10 +3,10 @@ ENV = 'development'
|
||||
# 'development'
|
||||
|
||||
|
||||
# VITE_APP_BASE_API_Url = 'https://aits.jlbank.com.cn:7001'
|
||||
#VITE_APP_BASE_API_Url = 'https://aits.jlbank.com.cn:7001'
|
||||
|
||||
|
||||
#VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001'
|
||||
VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001'
|
||||
|
||||
# VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002'
|
||||
|
||||
@@ -15,7 +15,7 @@ ENV = 'development'
|
||||
# VITE_APP_BASE_API_Url = 'http://aitscdn.jlbank.com.cn:7001'
|
||||
# VITE_APP_BASE_API_Url = 'http://192.168.108.129'
|
||||
# dev
|
||||
VITE_APP_BASE_API_Url = 'http://25.18.122.65:7001'
|
||||
# VITE_APP_BASE_API_Url = 'http://25.18.122.65:7001'
|
||||
# sit
|
||||
|
||||
|
||||
|
||||
@@ -144,4 +144,8 @@
|
||||
.bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
.maoh{
|
||||
margin-right: 8rpx;
|
||||
margin-left: 2rpx;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -50,3 +50,13 @@ export const queryMessageNoticeClass = (data) => {
|
||||
};
|
||||
|
||||
|
||||
// 按照分类一键读取消息
|
||||
export const oneTimeReadByNoticeTyp = (data) => {
|
||||
return request({
|
||||
url: base_url + '/traPersonalMessageNotice/oneTimeReadByNoticeTyp',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -178,7 +178,7 @@
|
||||
// 计算text字段
|
||||
let text = '1'; // 默认显示1
|
||||
if (dayNumber === 30) {
|
||||
text = '30'; // 第30天显示30
|
||||
text = '20'; // 第30天显示30
|
||||
} else if ((dayNumber % 30) % 7 === 0) {
|
||||
text = '5'; // 每7天(第7、14、21、28、35天)显示5
|
||||
}
|
||||
@@ -207,8 +207,8 @@
|
||||
}
|
||||
|
||||
const open = (isSignedStatus, days, onCheckInClick = () => {}, onCheckInSuccess = () => {}) => {
|
||||
console.log('isSignedStatus', isSignedStatus);
|
||||
isSigned.value = isSignedStatus; // 今日签到状态
|
||||
// isSigned.value = false; // 今日签到状态
|
||||
continuousDay.value = days; // 连续签到
|
||||
checkInClickCallback = onCheckInClick;
|
||||
checkInSuccessCallback = onCheckInSuccess;
|
||||
|
||||
@@ -127,20 +127,19 @@
|
||||
margin: 17rpx 20rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 32rpx 22rpx;
|
||||
padding: 22rpx 22rpx;
|
||||
.details_div {
|
||||
display: flex;
|
||||
|
||||
.img_div {
|
||||
position: relative;
|
||||
width: 226rpx;
|
||||
height: 168rpx;
|
||||
width: 256rpx;
|
||||
height: 144rpx;
|
||||
overflow: hidden;
|
||||
border-radius: 22rpx;
|
||||
|
||||
border-radius: 16rpx;
|
||||
.img {
|
||||
width: 226rpx;
|
||||
height: 168rpx;
|
||||
width: 256rpx;
|
||||
height: 144rpx;
|
||||
}
|
||||
|
||||
.subscript {
|
||||
@@ -188,7 +187,7 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
overflow: hidden;
|
||||
height: 116rpx;
|
||||
height: 92rpx;
|
||||
background-color: #f9fbff;
|
||||
border-radius: 8rpx;
|
||||
justify-content: space-around;
|
||||
|
||||
@@ -122,20 +122,19 @@
|
||||
margin: 17rpx 20rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 32rpx 22rpx;
|
||||
padding: 22rpx 22rpx;
|
||||
.details_div {
|
||||
display: flex;
|
||||
|
||||
.img_div {
|
||||
position: relative;
|
||||
width: 224rpx;
|
||||
height: 168rpx;
|
||||
width: 256rpx;
|
||||
height: 144rpx;
|
||||
overflow: hidden;
|
||||
border-radius: 22rpx;
|
||||
|
||||
border-radius: 16rpx;
|
||||
.img {
|
||||
width: 224rpx;
|
||||
height: 168rpx;
|
||||
width: 256rpx;
|
||||
height: 144rpx;
|
||||
}
|
||||
|
||||
.subscript {
|
||||
@@ -183,7 +182,7 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
overflow: hidden;
|
||||
height: 116rpx;
|
||||
height: 92rpx;
|
||||
background-color: #f9fbff;
|
||||
border-radius: 8rpx;
|
||||
justify-content: space-around;
|
||||
|
||||
@@ -121,20 +121,19 @@
|
||||
margin: 17rpx 20rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 32rpx 22rpx;
|
||||
padding: 22rpx 22rpx;
|
||||
.details_div {
|
||||
display: flex;
|
||||
|
||||
.img_div {
|
||||
position: relative;
|
||||
width: 224rpx;
|
||||
height: 168rpx;
|
||||
width: 256rpx;
|
||||
height: 144rpx;
|
||||
overflow: hidden;
|
||||
border-radius: 22rpx;
|
||||
|
||||
border-radius: 16rpx;
|
||||
.img {
|
||||
width: 224rpx;
|
||||
height: 168rpx;
|
||||
width: 256rpx;
|
||||
height: 144rpx;
|
||||
}
|
||||
|
||||
.subscript {
|
||||
@@ -182,7 +181,7 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
overflow: hidden;
|
||||
height: 116rpx;
|
||||
height: 92rpx;
|
||||
background-color: #f9fbff;
|
||||
border-radius: 8rpx;
|
||||
justify-content: space-around;
|
||||
|
||||
@@ -122,20 +122,18 @@
|
||||
margin: 17rpx 20rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 32rpx 22rpx;
|
||||
padding: 22rpx 22rpx;
|
||||
.details_div {
|
||||
display: flex;
|
||||
|
||||
.img_div {
|
||||
position: relative;
|
||||
width: 224rpx;
|
||||
height: 168rpx;
|
||||
width: 256rpx;
|
||||
height: 144rpx;
|
||||
overflow: hidden;
|
||||
border-radius: 22rpx;
|
||||
|
||||
border-radius: 16rpx;
|
||||
.img {
|
||||
width: 224rpx;
|
||||
height: 168rpx;
|
||||
width: 256rpx;
|
||||
height: 144rpx;
|
||||
}
|
||||
|
||||
.subscript {
|
||||
@@ -183,7 +181,7 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
overflow: hidden;
|
||||
height: 116rpx;
|
||||
height: 92rpx;
|
||||
background-color: #f9fbff;
|
||||
border-radius: 8rpx;
|
||||
justify-content: space-around;
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="time_and_num">
|
||||
<view class="mr-10">发布:{{ item.issuTm?.substr(0, 10) }}</view>
|
||||
<view>已学:{{ item.accmStdyCnt }}次</view>
|
||||
<view class="mr-10">发布<text class="maoh">:</text>{{ item.issuTm?.substr(0, 10) }}</view>
|
||||
<view>已学<text class="maoh">:</text>{{ item.accmStdyCnt }}次</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -106,7 +106,7 @@
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
.item-swipe-action {
|
||||
margin: 32rpx 22rpx;
|
||||
margin: 22rpx 22rpx;
|
||||
overflow: hidden;
|
||||
:deep(.uv-swipe-action-item__right__button__wrapper) {
|
||||
border-radius: 20rpx !important;
|
||||
@@ -114,18 +114,17 @@
|
||||
}
|
||||
|
||||
.item {
|
||||
height: 170rpx;
|
||||
// height: 180rpx;
|
||||
display: flex;
|
||||
.img_div {
|
||||
position: relative;
|
||||
width: 224rpx;
|
||||
height: 168rpx;
|
||||
width: 256rpx;
|
||||
height: 144rpx;
|
||||
overflow: hidden;
|
||||
border-radius: 22rpx;
|
||||
|
||||
border-radius: 16rpx;
|
||||
.img {
|
||||
width: 224rpx;
|
||||
height: 168rpx;
|
||||
width: 256rpx;
|
||||
height: 144rpx;
|
||||
}
|
||||
|
||||
.subscript {
|
||||
|
||||
@@ -28,18 +28,18 @@
|
||||
{{ item.taskName }}
|
||||
</view>
|
||||
<view class="time_div">
|
||||
起止时间:
|
||||
起止时间<text class="maoh">:</text>
|
||||
<text class="blod_color">
|
||||
{{ item.startTm?.substr(0, 10) }}至{{ item.endTm?.substr(0, 10) }}
|
||||
</text>
|
||||
</view>
|
||||
<view class="people_progress_div">
|
||||
<view class="mr-10">
|
||||
完成人数:
|
||||
<view class="mr-10 nowrap">
|
||||
完成人数<text class="maoh">:</text>
|
||||
<text class="blod_color">{{ item.taskFinishSums ?? 0 }}/{{ item.taskSums ?? 0 }}</text>
|
||||
</view>
|
||||
<view>
|
||||
进度:
|
||||
<view class="nowrap">
|
||||
进度<text class="maoh">:</text>
|
||||
<text class="blod_color">
|
||||
{{ item.finishCrs ?? item.learnedNumber ?? 0 }}/{{
|
||||
item.sumCrs ?? item.taskNumber ?? 0
|
||||
@@ -184,7 +184,7 @@
|
||||
}
|
||||
}
|
||||
.item-swipe-action {
|
||||
margin: 32rpx 22rpx;
|
||||
margin: 22rpx 20rpx;
|
||||
overflow: hidden;
|
||||
|
||||
:deep(.uv-swipe-action-item__right__button__wrapper) {
|
||||
@@ -193,21 +193,20 @@
|
||||
}
|
||||
|
||||
.item {
|
||||
height: 170rpx;
|
||||
display: flex;
|
||||
|
||||
.img_div {
|
||||
position: relative;
|
||||
width: 224rpx;
|
||||
height: 168rpx;
|
||||
width: 256rpx;
|
||||
height: 144rpx;
|
||||
overflow: hidden;
|
||||
border-radius: 22rpx;
|
||||
|
||||
border-radius: 16rpx;
|
||||
|
||||
.img {
|
||||
width: 224rpx;
|
||||
height: 168rpx;
|
||||
width: 256rpx;
|
||||
height: 144rpx;
|
||||
}
|
||||
|
||||
|
||||
.subscript {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
@@ -259,12 +258,15 @@
|
||||
font-size: 22rpx;
|
||||
color: #666;
|
||||
margin-bottom: 22rpx;
|
||||
|
||||
line-height: 24rpx;
|
||||
flex-wrap: nowrap;
|
||||
height: 24rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.nowrap{
|
||||
flex-wrap: nowrap;
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<template >
|
||||
<!-- 热门课程分模块标题 -->
|
||||
<view class="module_title_div">
|
||||
<view class="module_title_div" v-if="class_list.length !== 0">
|
||||
<view class="icon icon_1">
|
||||
<image class="img" :src="icon"></image>
|
||||
</view>
|
||||
@@ -11,28 +11,6 @@
|
||||
<scroll-view class="scroll-view" :scroll-x="true" :show-scrollbar="false">
|
||||
<view class="scroll-view-item" v-for="(item, index) in class_list" :key="index">
|
||||
<view class="item_div">
|
||||
<!-- <uv-skeletons :loading="!item.crsNum" :rows="3" avatar avatar-shape="square" :title="false">
|
||||
<view class="item" @click="goto_course_detail(item.crsId)">
|
||||
<view class="left">
|
||||
<image-preview
|
||||
class="img-box img"
|
||||
:imgId="item.imgId"
|
||||
:isCache="true"
|
||||
:width="240"
|
||||
:height="240"
|
||||
></image-preview>
|
||||
</view>
|
||||
<view class="right">
|
||||
<view class="title ellipsis-text">{{ item.crsName }}</view>
|
||||
<view class="note ellipsis-text">更新:{{ (item.mtTime || '').substr(0, 10) }}</view>
|
||||
<view class="button_div">
|
||||
<view class="note ellipsis-text">已学:{{ item.accmStdyCnt }}人次</view>
|
||||
<view class="button">去学习</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</uv-skeletons> -->
|
||||
|
||||
<uv-skeletons :loading="!item.crsNum" avatar avatar-shape="square" :title="false" :skeleton="skeleton">
|
||||
<view class="item" @click="goto_course_detail(item.crsId)">
|
||||
<view class="left">
|
||||
@@ -116,7 +94,7 @@
|
||||
accmStdyCnt: ''
|
||||
}
|
||||
];
|
||||
const class_list = ref([...init_class_data]);
|
||||
const class_list = ref([]);
|
||||
const skeleton = [
|
||||
{
|
||||
type: 'flex',
|
||||
@@ -125,7 +103,7 @@
|
||||
{
|
||||
type: 'avatar',
|
||||
num: 1,
|
||||
style: 'marginRight: 22rpx;width: 200rpx;height:150rpx;border-radius:16rpx;'
|
||||
style: 'marginRight: 22rpx;width: 256rpx;height:144rpx;border-radius:16rpx;'
|
||||
},
|
||||
{
|
||||
type: 'line',
|
||||
@@ -137,6 +115,8 @@
|
||||
}
|
||||
];
|
||||
const get_data = () => {
|
||||
|
||||
class_list.value = [...init_class_data]
|
||||
fetchFunction().then((res) => {
|
||||
if (props.name === 'hot_class') {
|
||||
} else {
|
||||
@@ -170,32 +150,33 @@
|
||||
background-color: #ffffff;
|
||||
border-radius: 22rpx;
|
||||
box-shadow: #eaeaea 0 0 6rpx;
|
||||
padding: 32rpx 22rpx 36rpx 26rpx;
|
||||
padding: 32rpx 20rpx 36rpx 34rpx;
|
||||
}
|
||||
|
||||
.item_div {
|
||||
width: 562rpx;
|
||||
// width: 562rpx;
|
||||
width: calc(562rpx + 56rpx);
|
||||
// display: block;
|
||||
}
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
width: 562rpx;
|
||||
width: calc(562rpx + 56rpx);
|
||||
.left {
|
||||
border-radius: 16rpx;
|
||||
overflow: hidden;
|
||||
width: 200rpx;
|
||||
height: 150rpx;
|
||||
width: 256rpx;
|
||||
height: 144rpx;
|
||||
.img {
|
||||
width: 200rpx;
|
||||
height: 150rpx;
|
||||
width: 256rpx;
|
||||
height: 144rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
overflow: hidden;
|
||||
flex: 1;
|
||||
padding-left: 22rpx;
|
||||
padding-left: 16rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
|
||||
@@ -10,16 +10,16 @@
|
||||
{{ item.taskName }}
|
||||
</view>
|
||||
<view class="time_div" v-if="item.limitTyp === '02'">
|
||||
起止时间:
|
||||
起止时间<text class="maoh">:</text>
|
||||
<text class="blod_color">{{ item.startTm?.substr(0, 10) }}至{{ item.endTm?.substr(0, 10) }}</text>
|
||||
</view>
|
||||
<view class="people_progress_div">
|
||||
<view class="mr-10">
|
||||
完成人数:
|
||||
完成人数<text class="maoh">:</text>
|
||||
<text class="">{{ item.taskFinishSums ?? 0 }}/{{ item.taskSums ?? 0 }}</text>
|
||||
</view>
|
||||
<view>
|
||||
进度:
|
||||
进度<text class="maoh">:</text>
|
||||
<text class="">
|
||||
{{ item.finishCrs ?? item.learnedNumber ?? 0 }}/{{ item.sumCrs ?? item.taskNumber ?? 0 }}门课程
|
||||
</text>
|
||||
@@ -102,19 +102,18 @@
|
||||
}
|
||||
.item {
|
||||
padding-top: 16rpx;
|
||||
padding-bottom: 16rpx;
|
||||
padding-bottom: 12rpx;
|
||||
display: flex;
|
||||
|
||||
.img_div {
|
||||
position: relative;
|
||||
width: 224rpx;
|
||||
height: 168rpx;
|
||||
width: 256rpx;
|
||||
height: 144rpx;
|
||||
overflow: hidden;
|
||||
border-radius: 22rpx;
|
||||
|
||||
border-radius: 16rpx;
|
||||
.img {
|
||||
width: 224rpx;
|
||||
height: 168rpx;
|
||||
width: 256rpx;
|
||||
height: 144rpx;
|
||||
}
|
||||
|
||||
.subscript {
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="time">
|
||||
<text class="color_3">起止时间:</text>
|
||||
<text class="color_3">起止时间<text class="maoh">:</text></text>
|
||||
<text class="color_class">
|
||||
{{ detailData.startTm?.substr(0, 10) }}至{{ detailData.endTm?.substr(0, 10) }}
|
||||
</text>
|
||||
@@ -49,11 +49,11 @@
|
||||
</view>
|
||||
<view class="num_div">
|
||||
<view class="num_div_item">
|
||||
<text class="color_3">完成人数:</text>
|
||||
<text class="color_3">完成人数<text class="maoh">:</text></text>
|
||||
<text class="color_2">{{ detailData.taskFinishSums ?? 0 }}/{{ detailData.taskSums ?? 0 }}</text>
|
||||
</view>
|
||||
<view class="num_div_item">
|
||||
<text class="color_3">进度:</text>
|
||||
<text class="color_3">进度<text class="maoh">:</text></text>
|
||||
<text class="color_2">{{ detailData.finishCrs ?? 0 }}/{{ detailData.sumCrs ?? 0 }}门课程</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -490,13 +490,10 @@
|
||||
}
|
||||
.scroll-div {
|
||||
background: linear-gradient(180deg, #ebf2fe 0%, #f3f7fe 6%, #f9fbff 12%, #f4f6f8 100%);
|
||||
|
||||
// background: linear-gradient(180deg, #ebf2fe 0%, #f3f7fe 6%, #fafbfc 12%, #fafbfc 100%);
|
||||
border-radius: 16rpx;
|
||||
margin-top: -20rpx;
|
||||
z-index: 2;
|
||||
box-shadow: 0 0 10rpx #f9fbff;
|
||||
|
||||
border: 2rpx solid #f9f9fa;
|
||||
margin: 0 auto;
|
||||
width: calc(100% - 52rpx);
|
||||
@@ -529,7 +526,7 @@
|
||||
}
|
||||
|
||||
.detail_div {
|
||||
height: 250rpx;
|
||||
height: 210rpx;
|
||||
z-index: 2;
|
||||
width: 100%;
|
||||
padding: 36rpx 26rpx 20rpx 26rpx;
|
||||
@@ -556,8 +553,10 @@
|
||||
border-radius: 0 0 0 28rpx;
|
||||
}
|
||||
.left > .img {
|
||||
width: 224rpx;
|
||||
height: 168rpx;
|
||||
// width: 224rpx;
|
||||
// height: 168rpx;
|
||||
width: 256rpx;
|
||||
height: 144rpx;
|
||||
border-radius: 16rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@@ -210,6 +210,7 @@
|
||||
});
|
||||
// 签到打开
|
||||
const checkInClick = () => {
|
||||
|
||||
checkInRef.value.open(
|
||||
user_info.checkInToday === 1,
|
||||
user_info.checkInDays,
|
||||
@@ -217,6 +218,8 @@
|
||||
(status, days, pointsList = [], badgesList = []) => {
|
||||
user_info.checkInToday = status ? 1 : 2;
|
||||
user_info.checkInDays = days;
|
||||
statistics_data['get_statistics_data'](true); // 强制获取统计数据
|
||||
|
||||
handlePointsBadgePopup(pointsList, badgesList);
|
||||
}
|
||||
);
|
||||
@@ -254,11 +257,11 @@
|
||||
this.currentRankName = points_data.currentRankName;
|
||||
}
|
||||
},
|
||||
get_statistics_data: async function () {
|
||||
get_statistics_data: async function (status=false) {
|
||||
try {
|
||||
const time_now = Date.now();
|
||||
let points_data = common.getValue('points_data') || {};
|
||||
if (time_now - this.request_time > 300) {
|
||||
if (time_now - this.request_time > 300 && status) {
|
||||
this.request_time = time_now;
|
||||
// 获取最新数据
|
||||
const res = await queryCurrentStatus();
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
<template>
|
||||
<z-paging ref="pagingRef" v-model="data_list" @query="queryList" class="scroll_div" empty-view-text="暂无数据">
|
||||
<z-paging
|
||||
ref="pagingRef"
|
||||
v-model="data_list"
|
||||
@query="queryList"
|
||||
class="scroll_div"
|
||||
empty-view-text="暂无数据"
|
||||
:refresher-enabled="true"
|
||||
:loading-more-enabled="false"
|
||||
>
|
||||
<template #top>
|
||||
<view class="main_div">
|
||||
<view class="body-title">
|
||||
@@ -32,9 +40,6 @@
|
||||
<view class="time">
|
||||
{{ item.msgTm?.substr(0, 16) }}
|
||||
</view>
|
||||
<!-- <view class="note ellipsis-text">
|
||||
{{ item.noticeContent }}
|
||||
</view> -->
|
||||
<view class="read_div" v-if="item?.isMsg === 'Y'"></view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -44,7 +49,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { ref, reactive, defineExpose } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import {
|
||||
queryTraPersonalMessageNoticePaging,
|
||||
@@ -60,13 +65,9 @@
|
||||
import type_05 from '@/static/images/messageNotification/type_05.png';
|
||||
import type_06 from '@/static/images/messageNotification/type_06.png';
|
||||
import type_07 from '@/static/images/messageNotification/type_07.png';
|
||||
import useZpaging from '@/composables/useZpaging.js';
|
||||
|
||||
const pagingRef = ref(null);
|
||||
const data_list = ref([]);
|
||||
// const { pagingRef, queryList, data_list, reload } = useZpaging({
|
||||
// fetchFunction: noticeMessageCount
|
||||
// });
|
||||
const queryList = () => {
|
||||
queryMessageNoticeClass().then(({ body }) => {
|
||||
data_list.value = body;
|
||||
@@ -109,6 +110,15 @@
|
||||
common.hideLoading();
|
||||
});
|
||||
};
|
||||
const refreshType = (type) => {
|
||||
const index = data_list.value.findIndex((res) => res.noticeTyp === type);
|
||||
if (index === -1) {
|
||||
return false;
|
||||
}
|
||||
data_list.value[index].isMsg = 'N';
|
||||
};
|
||||
|
||||
defineExpose({ refreshType });
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<script setup>
|
||||
import { ref, reactive, computed } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { queryTraPersonalMessageNoticePaging } from '@/api/messageNotification.js';
|
||||
import { queryTraPersonalMessageNoticePaging, oneTimeReadByNoticeTyp } from '@/api/messageNotification.js';
|
||||
import common from '@/common/common';
|
||||
import type_01 from '@/static/images/messageNotification/type_01.png';
|
||||
import type_02 from '@/static/images/messageNotification/type_02.png';
|
||||
@@ -52,7 +52,24 @@
|
||||
import type_06 from '@/static/images/messageNotification/type_06.png';
|
||||
import type_07 from '@/static/images/messageNotification/type_07.png';
|
||||
import useZpaging from '@/composables/useZpaging.js';
|
||||
const fetchFunction = (params) => queryTraPersonalMessageNoticePaging({ noticeTyp: typeValue.value, ...params });
|
||||
const fetchFunction = (params) => {
|
||||
const page = params?.page || 1;
|
||||
if (page === 1) {
|
||||
oneTimeReadByNoticeTyp({ noticeTyp: typeValue.value }).then((res) => {
|
||||
const pages = getCurrentPages();
|
||||
if (pages.length >= 1) {
|
||||
const prevPage = pages[pages.length - 2];
|
||||
if (prevPage.route === 'pages/messageNotification/index') {
|
||||
if (prevPage.$vm && typeof prevPage.$vm.$?.exposed?.refreshType === 'function') {
|
||||
prevPage.$vm.$?.exposed?.refreshType(typeValue.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return queryTraPersonalMessageNoticePaging({ noticeTyp: typeValue.value, ...params });
|
||||
};
|
||||
|
||||
const { pagingRef, queryList, data_list } = useZpaging({
|
||||
fetchFunction: fetchFunction
|
||||
});
|
||||
|
||||
@@ -1,370 +0,0 @@
|
||||
<template>
|
||||
<z-paging ref="pagingRef" v-model="data_list" @query="queryList" class="scroll_div" empty-view-text="暂无数据">
|
||||
<template #top>
|
||||
<view class="main_div">
|
||||
<view class="body-title">
|
||||
<view class="back_div" @click="common.navigateBack()">
|
||||
<view class="back-icon"></view>
|
||||
</view>
|
||||
<view>消息</view>
|
||||
<view class="delete_div" @click="oneClickReadMessage">
|
||||
<image
|
||||
class="img"
|
||||
src="@/static/images/messageNotification/delete_icon.png"
|
||||
mode="aspectFit"
|
||||
></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<view class="scroll-Y">
|
||||
<view class="item" v-for="(item, index) in data_list" @click="readMessageOpen(item)">
|
||||
<view class="icon">
|
||||
<image class="img_100" :src="imageMap[item.noticeTyp]" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="right">
|
||||
<view class="top">
|
||||
<view class="title">
|
||||
{{ item.noticeTitle }}
|
||||
</view>
|
||||
<view class="time">
|
||||
{{ item.ctTime?.substr(0, 16) }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom">
|
||||
<view class="note ellipsis-text">
|
||||
{{ item.noticeContent }}
|
||||
</view>
|
||||
<view class="read_div" v-if="item?.isRead === '01'"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<uni-popup ref="popup" type="bottom">
|
||||
<view
|
||||
class="popup"
|
||||
@touchmove.stop.prevent="
|
||||
() => {
|
||||
return false;
|
||||
}
|
||||
"
|
||||
>
|
||||
<view class="message_popup_div">
|
||||
<view class="title">
|
||||
{{ popup_info.title }}
|
||||
</view>
|
||||
<view class="text">{{ popup_info.text }}</view>
|
||||
<view class="button_div" @click.stop="readMessage">
|
||||
<uv-button :loading="readLoading" class="button">我知道了</uv-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</z-paging>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { queryTraPersonalMessageNoticePaging, readNotice, oneTimeRead } from '@/api/messageNotification.js';
|
||||
import common from '../../common/common';
|
||||
|
||||
import type_01 from '@/static/images/messageNotification/type_01.png';
|
||||
import type_02 from '@/static/images/messageNotification/type_02.png';
|
||||
import type_03 from '@/static/images/messageNotification/type_03.png';
|
||||
import type_04 from '@/static/images/messageNotification/type_04.png';
|
||||
import type_05 from '@/static/images/messageNotification/type_05.png';
|
||||
import useZpaging from '@/composables/useZpaging.js';
|
||||
const { pagingRef, queryList, data_list, reload } = useZpaging({
|
||||
fetchFunction: queryTraPersonalMessageNoticePaging
|
||||
});
|
||||
const imageMap = {
|
||||
'01': type_01,
|
||||
'02': type_02,
|
||||
'03': type_03,
|
||||
'04': type_04,
|
||||
'05': type_05
|
||||
};
|
||||
const readLoading = ref(false);
|
||||
const offset = ref(0);
|
||||
const popup_info = reactive({
|
||||
id: '',
|
||||
title: '',
|
||||
text: '',
|
||||
isRead: ''
|
||||
});
|
||||
const popup = ref(null);
|
||||
|
||||
const readMessage = () => {
|
||||
if (popup_info.isRead === '02') {
|
||||
popup.value.close();
|
||||
return;
|
||||
}
|
||||
readLoading.value = true;
|
||||
readNotice({ noticeId: popup_info.id })
|
||||
.then((res) => {
|
||||
popup.value.close();
|
||||
readLoading.value = false;
|
||||
data_list.value.forEach((item) => {
|
||||
if (item.noticeId === popup_info.id) {
|
||||
item.isRead = res.body.isRead;
|
||||
return;
|
||||
}
|
||||
});
|
||||
})
|
||||
.finally(() => {
|
||||
readLoading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
const oneClickReadMessage = () => {
|
||||
const state = data_list.value.every((res) => res.isRead === '02');
|
||||
if (state) {
|
||||
common.msg('暂无未读消息');
|
||||
return;
|
||||
}
|
||||
common.loading();
|
||||
oneTimeRead()
|
||||
.then((res) => {
|
||||
data_list.value.forEach((item) => {
|
||||
item.isRead = '02';
|
||||
});
|
||||
common.hideLoading();
|
||||
setTimeout(() => {
|
||||
common.msg('一键读取成功');
|
||||
}, 10);
|
||||
})
|
||||
.catch(() => {
|
||||
common.hideLoading();
|
||||
});
|
||||
};
|
||||
|
||||
// 读取消息
|
||||
const readMessageOpen = (item) => {
|
||||
console.log('item', item);
|
||||
popup_info.id = item.noticeId;
|
||||
popup_info.title = item.noticeTitle;
|
||||
popup_info.text = item.noticeContent;
|
||||
popup_info.isRead = item.isRead;
|
||||
popup.value.open();
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.popup {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
position: relative;
|
||||
}
|
||||
.message_popup_div {
|
||||
width: 580rpx;
|
||||
border-radius: 38rpx;
|
||||
background: #ffffff url('@/static/images/messageNotification/popup_bg.png') no-repeat center -4rpx;
|
||||
background-size: auto 50%;
|
||||
background-color: #ffffff;
|
||||
margin: 0 auto;
|
||||
overflow: hidden;
|
||||
top: 30%;
|
||||
position: absolute;
|
||||
left: calc(50% - 290rpx);
|
||||
.title {
|
||||
padding: 0 40rpx;
|
||||
width: 100%;
|
||||
height: 90rpx;
|
||||
line-height: 110rpx;
|
||||
font-weight: 700;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.text {
|
||||
padding: 16rpx 40rpx;
|
||||
font-family: PingFangSC;
|
||||
font-size: 30rpx;
|
||||
color: #333333;
|
||||
line-height: 48rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
min-height: 300rpx;
|
||||
max-height: 650rpx;
|
||||
overflow: auto;
|
||||
}
|
||||
.button_div {
|
||||
overflow: hidden;
|
||||
.button {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
:deep(.uv-button) {
|
||||
height: 100rpx;
|
||||
font-family: PingFangSC;
|
||||
font-weight: 500;
|
||||
font-size: 36rpx;
|
||||
color: #0066ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.scroll-Y {
|
||||
height: 100%;
|
||||
position: relative;
|
||||
border-radius: 20rpx 20rpx 0 0;
|
||||
background-color: #fff;
|
||||
.item {
|
||||
height: 154rpx;
|
||||
padding: 38rpx 0 38rpx 0;
|
||||
margin: 0 38rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-bottom: 2rpx solid #efefef;
|
||||
.icon {
|
||||
width: 78rpx;
|
||||
height: 78rpx;
|
||||
}
|
||||
|
||||
.right {
|
||||
margin-left: 16rpx;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
.top {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.title {
|
||||
font-family: PingFangSC;
|
||||
font-weight: 600;
|
||||
font-size: 30rpx;
|
||||
color: #000000;
|
||||
line-height: 46rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.time {
|
||||
font-size: 23rpx;
|
||||
color: #999999;
|
||||
line-height: 30rpx;
|
||||
text-align: right;
|
||||
font-style: normal;
|
||||
}
|
||||
}
|
||||
|
||||
.bottom {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
.note {
|
||||
font-family: PingFangSC;
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #666666;
|
||||
line-height: 35rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.num_div {
|
||||
padding: 0 8rpx;
|
||||
height: 31rpx;
|
||||
background: #ff6c75;
|
||||
border-radius: 15rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-family: ArialMT;
|
||||
font-size: 22rpx;
|
||||
color: #ffffff;
|
||||
line-height: 26px;
|
||||
min-width: 40rpx;
|
||||
}
|
||||
.read_div {
|
||||
width: 16rpx;
|
||||
height: 16rpx;
|
||||
background-color: #d70c18;
|
||||
border-radius: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.main_div {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
background: linear-gradient(0deg, rgba(195, 219, 255, 0) 0%, #c3dbff 100%);
|
||||
background-size: 100% 300px;
|
||||
background-repeat: no-repeat; /* 防止渐变重复平铺 */
|
||||
padding-top: var(--status-bar-height);
|
||||
overflow: hidden;
|
||||
margin-bottom: -20rpx;
|
||||
}
|
||||
|
||||
.body-title {
|
||||
width: 100%;
|
||||
height: 120rpx;
|
||||
font-size: 33rpx;
|
||||
padding-top: 10rpx;
|
||||
font-weight: 500;
|
||||
color: #000;
|
||||
font-weight: 600;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
|
||||
.delete_div {
|
||||
position: absolute;
|
||||
right: 20rpx;
|
||||
top: 7rpx;
|
||||
width: 70rpx;
|
||||
height: 70rpx;
|
||||
.img {
|
||||
margin-top: 10rpx;
|
||||
width: 34rpx;
|
||||
height: 34rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.back_div {
|
||||
position: absolute;
|
||||
left: 26rpx;
|
||||
top: 17rpx;
|
||||
padding: 0 14rpx 14rpx 0;
|
||||
|
||||
.back-icon {
|
||||
position: relative;
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.back-icon::before,
|
||||
.back-icon::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.back-icon::after {
|
||||
top: 25%;
|
||||
left: 25%;
|
||||
width: 40%;
|
||||
height: 40%;
|
||||
border-top: 4rpx solid #2b2c2e;
|
||||
border-left: 4rpx solid #2b2c2e;
|
||||
transform: rotate(-45deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.input-view {
|
||||
width: 90%;
|
||||
margin: 20rpx auto;
|
||||
height: 78rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -51,19 +51,20 @@
|
||||
}
|
||||
|
||||
.item {
|
||||
height: 170rpx;
|
||||
margin: 32rpx 22rpx;
|
||||
// height: 170rpx;
|
||||
margin: 22rpx 22rpx;
|
||||
display: flex;
|
||||
.img_div {
|
||||
position: relative;
|
||||
width: 224rpx;
|
||||
height: 168rpx;
|
||||
width: 256rpx;
|
||||
height: 144rpx;
|
||||
overflow: hidden;
|
||||
border-radius: 22rpx;
|
||||
|
||||
border-radius: 16rpx;
|
||||
.img {
|
||||
width: 224rpx;
|
||||
height: 168rpx;
|
||||
// width: 224rpx;
|
||||
// height: 168rpx;
|
||||
width: 256rpx;
|
||||
height: 144rpx;
|
||||
}
|
||||
|
||||
.subscript {
|
||||
|
||||
@@ -118,20 +118,19 @@
|
||||
margin: 17rpx 20rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 32rpx 22rpx;
|
||||
padding: 22rpx 22rpx;
|
||||
.details_div {
|
||||
display: flex;
|
||||
|
||||
.img_div {
|
||||
position: relative;
|
||||
width: 224rpx;
|
||||
height: 168rpx;
|
||||
width: 256rpx;
|
||||
height: 144rpx;
|
||||
overflow: hidden;
|
||||
border-radius: 22rpx;
|
||||
|
||||
border-radius: 16rpx;
|
||||
.img {
|
||||
width: 224rpx;
|
||||
height: 168rpx;
|
||||
width: 256rpx;
|
||||
height: 144rpx;
|
||||
}
|
||||
|
||||
.subscript {
|
||||
@@ -179,7 +178,7 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
overflow: hidden;
|
||||
height: 116rpx;
|
||||
height: 92rpx;
|
||||
background-color: #f9fbff;
|
||||
border-radius: 8rpx;
|
||||
justify-content: space-around;
|
||||
|
||||
@@ -120,20 +120,19 @@
|
||||
margin: 17rpx 20rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 32rpx 22rpx;
|
||||
padding: 22rpx 22rpx;
|
||||
.details_div {
|
||||
display: flex;
|
||||
|
||||
.img_div {
|
||||
position: relative;
|
||||
width: 224rpx;
|
||||
height: 168rpx;
|
||||
width: 256rpx;
|
||||
height: 144rpx;
|
||||
overflow: hidden;
|
||||
border-radius: 22rpx;
|
||||
|
||||
border-radius: 16rpx;
|
||||
.img {
|
||||
width: 224rpx;
|
||||
height: 168rpx;
|
||||
width: 256rpx;
|
||||
height: 144rpx;
|
||||
}
|
||||
|
||||
.subscript {
|
||||
@@ -181,7 +180,7 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
overflow: hidden;
|
||||
height: 116rpx;
|
||||
height: 92rpx;
|
||||
background-color: #f9fbff;
|
||||
border-radius: 8rpx;
|
||||
justify-content: space-around;
|
||||
|
||||
Reference in New Issue
Block a user