This commit is contained in:
Lx 2025-04-17 10:01:13 +08:00
parent f4e040e0a8
commit 6fb394ef18
4 changed files with 434 additions and 398 deletions

View File

@ -1,16 +1,19 @@
<template>
<view class="container">
<VNavigationBar background-color="#fff" title-color="#333" title="消息中心" :showClear="showClear" @clearNoRead="clearNoReadFun"></VNavigationBar>
<VNavigationBar background-color="#fff" title-color="#333" title="消息中心" :showClear="showClear"
@clearNoRead="clearNoReadFun"></VNavigationBar>
<view class="body">
<view class="messageList">
<scroll-view scroll-y="true" class="itemContent" @scrolltolower="onReachBottomCus"
refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered">
<view v-for="(item, index) in messageList" :key="index" class="messageItem" @click="readNotice(item)">
<scroll-view scroll-y="true" class="itemContent" @scrolltolower="onReachBottomCus" refresher-enabled
@refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered">
<view v-for="(item, index) in messageList" :key="index" class="messageItem"
@click="readNotice(item)">
<image class="messageIcon" src="@/static/imgs/message-icon1.png" mode="aspectFit"></image>
<view class="messageContent">
<view :class="{'messageTitle':item.readStatus,'noReadTitle':!item.readStatus}" >系统通知</view>
<view :class="{'messageTitle':item.readStatus,'noReadTitle':!item.readStatus}">系统通知</view>
<view class="messageContent_content">{{item.templateContent}}</view>
<view class="messageContent_content" style="text-align: right">{{formatTime(item.createTime)}}</view>
<view class="messageContent_content" style="text-align: right">
{{formatTime(item.createTime)}}</view>
</view>
</view>
<view style="text-align: center" v-if="messageList.length==0">
@ -20,7 +23,7 @@
</view>
</view>
<!-- 普通弹窗 -->
<uni-popup ref="popup" background-color="#fff" >
<uni-popup ref="popup" background-color="#fff">
<view class="popup-content" :class="{ 'popup-height': type === 'left' || type === 'right' }">
<text class="text popup-content-text">{{ nowReadItem.templateContent }}</text>
<button class="button popup-info" @click="dialogToggle"><text
@ -41,26 +44,26 @@
},
data() {
return {
type:"center",
type: "center",
messageList: [],
pageNo: 1,
pageSize: 15,
total: 0,
//
isTriggered:false,
isTriggered: false,
//
showClear:true,
nowReadItem:{},
showClear: true,
nowReadItem: {},
systemCode: 'jiaxiao',
};
},
onLoad(){
onLoad() {
},
onShow(){
onShow() {
this.getList()
},
methods:{
methods: {
/**
* 点击阅读消息
*/
@ -72,10 +75,12 @@
await request({
url: "/app-api/system/notify-message/update-read",
method: "PUT",
params:{ids:this.nowReadItem.id},
tenantIdFlag:false
params: {
ids: this.nowReadItem.id
},
tenantIdFlag: false
}).then((res) => {
if(res.code==200){
if (res.code == 200) {
this.onRefresherrefresh()
}
})
@ -83,31 +88,31 @@
/**
* 消息设置为已读
*/
dialogToggle(){
dialogToggle() {
this.$refs.popup.close()
},
/**
* 一键清空未读消息
*/
async clearNoReadFun(){
async clearNoReadFun() {
console.log("清空了")
await request({
url: "/app-api/system/notify-message/update-all-read",
method: "PUT",
tenantIdFlag:false
tenantIdFlag: false
}).then((res) => {
if(res.code==200){
if (res.code == 200) {
uni.showToast({
title: '操作成功',
icon: 'none'
})
setTimeout(()=>{
setTimeout(() => {
this.onRefresherrefresh()
},500)
}, 500)
}
})
},
formatTime(value){
formatTime(value) {
// Date
const date = new Date(value);
//
@ -137,7 +142,7 @@
/**
* 下拉刷新数据
*/
onRefresherrefresh(){
onRefresherrefresh() {
this.isTriggered = true
this.pageNo = 1
this.total = 0
@ -147,16 +152,16 @@
/**
* 分页查询
*/
async getList(){
async getList() {
await request({
url: "/app-api/system/notify-message/my-page",
method: "GET",
params:{
pageNo:this.pageNo,
pageSize:this.pageSize,
params: {
pageNo: this.pageNo,
pageSize: this.pageSize,
systemCode: this.systemCode,
},
tenantIdFlag:false
tenantIdFlag: false
}).then((res) => {
// concat n
if (this.pageNo != 1) {
@ -174,16 +179,18 @@
</script>
<style lang="less" scoped>
.container {
.container {
height: 100vh;
display: flex;
flex-direction: column;
.body {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
}
.messageList {
flex: 1;
display: flex;
@ -198,6 +205,7 @@
}
}
.messageItem {
padding: 30rpx 0;
display: flex;
@ -209,17 +217,22 @@
width: 80rpx;
height: 80rpx;
}
.noReadTitle {
font-weight: bold;
font-size: 32rpx;
color: #333333;
}
.noReadTitle:after{
.noReadTitle:after {
content: "*";
color: red;
display: block; /* 或者其他的块级显示类型,比如 inline-block, table 等 */
position: absolute; /* 或者 absolute 或者 fixed取决于你的布局需求 */
z-index: 1; /* 确保它在元素的上方 */
display: block;
/* 或者其他的块级显示类型,比如 inline-block, table 等 */
position: absolute;
/* 或者 absolute 或者 fixed取决于你的布局需求 */
z-index: 1;
/* 确保它在元素的上方 */
right: 0;
}
@ -227,10 +240,12 @@
flex: 1;
width: 0;
}
.messageTitle {
font-size: 32rpx;
color: #333333;
}
.messageContent_content {
font-weight: 500;
font-size: 28rpx;
@ -242,6 +257,7 @@
margin-top: 20rpx;
}
}
.popup-content {
padding: 15px;
height: auto;
@ -249,6 +265,7 @@
width: 80%;
background-color: #fff;
}
.popup-content-text {
display: flex;
align-items: center;
@ -268,5 +285,5 @@
.info-text {
color: #909399;
}
}
}
</style>

View File

@ -55,6 +55,7 @@
getCoachId,
getInviteId,
getLocalUserInfo,
getStaffType,
getToken,
removeCoachId,
removeInviteId,
@ -150,6 +151,8 @@
if (res.data != null) {
this.qTenantId = res.data.tenantId
this.qCoachId = res.data.userId
console.log('tenantId', this.qTenantId)
console.log('coachId', this.qCoachId)
setTenantId(res.data.tenantId)
this.getList()
if (res.data.type == 'jl') {
@ -160,6 +163,8 @@
setCoachId(res.data.userId)
setStaffType('01')
}
console.log('getCoachId', getCoachId())
console.log('getStaffType', getStaffType())
}
})
},

View File

@ -3,7 +3,7 @@
{
"path": "newPages/newIndex/index",
"style": {
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"navigationBarTitleText": "首页",
"navigationStyle": "custom"
}

View File

@ -5,11 +5,9 @@
<uni-icons type="left" color="#000000" size="22px"></uni-icons>
</headers>
</view>
<scroll-view :style="{ height: scrollHeight + 'px' }" scroll-y="true" class="scroll-view">
<view class="group_3 flex-col">
<image
style="width: 100%; height: 100%;"
:src="imagesUrl + '/' + courseDetails.photo"
/>
<image style="width: 100%; height: 100%;" :src="imagesUrl + '/' + courseDetails.photo" />
</view>
<view class="group_4 flex-col">
<view class="section_2 flex-row justify-between">
@ -17,7 +15,7 @@
<text class="text_3"></text>
<text class="text_4">{{ courseDetails.price ? courseDetails.price.toFixed(2) : '--' }}</text>
</view>
<!-- <text class="text_5">3000.00</text>-->
<!-- <text class="text_5">3000.00</text>-->
</view>
<text class="text_6">{{ courseDetails.name }}</text>
<view class="section_3 flex-row justify-between">
@ -39,20 +37,15 @@
<u-parse :content="courseDetails.remark"></u-parse>
</view>
<view class="u-content" v-else>
<u-empty
mode="list"
text="该课程没有简介..."
>
<u-empty mode="list" text="该课程没有简介...">
</u-empty>
</view>
</view>
</scroll-view>
<view class="group_6 flex-row">
<view class="image-text_1 flex-col justify-between" @click="zxkf()">
<image
class="label_2"
referrerpolicy="no-referrer"
src="/static/lanhu_kechengxiangqing/FigmaDDSSlicePNG283b4603035848d5dcc7209d10653327.png"
/>
<image class="label_2" referrerpolicy="no-referrer"
src="/static/lanhu_kechengxiangqing/FigmaDDSSlicePNG283b4603035848d5dcc7209d10653327.png" />
<text class="text-group_1">咨询客服</text>
</view>
<view class="text-wrapper_4 flex-col" @click="goRegisterNow()">
@ -62,13 +55,19 @@
</view>
</template>
<script>
import request from "@/utils/request";
import config from "@/config.js"
import {getLocalUserInfo, getUserInfo, getToken} from "@/utils/auth";
import headers from "@/components/header/headers.vue";
import request from "@/utils/request";
import config from "@/config.js"
import {
getLocalUserInfo,
getUserInfo,
getToken
} from "@/utils/auth";
import headers from "@/components/header/headers.vue";
export default {
components: {headers},
export default {
components: {
headers
},
data() {
return {
courseId: undefined,
@ -77,6 +76,7 @@ export default {
driveSchoolPhone: [],
imagesUrl: config.imagesUrl,
userDetails: [],
scrollHeight: 0,
};
},
onLoad(options) {
@ -86,6 +86,10 @@ export default {
this.userDetails = getLocalUserInfo();
this.getServicePhone()
},
onReady() {
//
this.calculateScrollHeight();
},
methods: {
goBack() {
uni.navigateBack({
@ -122,8 +126,17 @@ export default {
})
},
calculateScrollHeight() {
//
const screenHeight = uni.getSystemInfoSync().windowHeight;
//
const topHeight = 166;
//
this.scrollHeight = screenHeight - topHeight;
},
goRegisterNow() {
console.log('token',getToken())
console.log('token', getToken())
if (!getToken()) {
uni.showModal({
title: '未登录',
@ -145,13 +158,14 @@ export default {
});
},
}
};
};
</script>
<style lang='scss'>
@import '../common/common.scss';
@import './assets/style/index.rpx.scss';
.u-content{
@import '../common/common.scss';
@import './assets/style/index.rpx.scss';
.u-content {
margin-top: 20rpx;
padding: 10rpx;
}
}
</style>