完成了登录模块

This commit is contained in:
2025-05-19 09:17:46 +08:00
parent 3fe9c3c209
commit 10f0ebaf3d
8 changed files with 282 additions and 0 deletions

View File

@ -0,0 +1,52 @@
const { baseUrl } = require('../../../request');
Page({
data: {
title: '',
createTime: '',
content: '',
id: null
},
onLoad(options) {
// 1. 获取跳转传来的 id
const id = options.id;
this.setData({ id });
// 2. 拉取通知详情
this.fetchNotificationDetail(id);
},
fetchNotificationDetail(id) {
const token = wx.getStorageSync('token');
wx.request({
url: baseUrl + '/projectNotification/mini/query/id', // 用你的实际接口
method: 'POST',
header: {
Authorization: token
},
data: { id },
success: (res) => {
if (res.data.code === 1) {
const detail = res.data.data || {};
this.setData({
title: detail.notificationTitle || '',
createTime: detail.createTime || '',
content: detail.notificationContent || ''
});
} else {
wx.showToast({
title: res.data.message || '获取通知失败',
icon: 'none'
});
}
},
fail: () => {
wx.showToast({
title: '网络错误',
icon: 'none'
});
}
});
}
});

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,7 @@
<view class="flex-col page">
<text class="self-start text">{{title}}</text>
<text class="self-start text_2 mt-17">{{createTime}}</text>
<view class="self-stretch section mt-17">
<rich-text class="notification-content mt-17" nodes="{{content}}"></rich-text>
</view>
</view>

View File

@ -0,0 +1,25 @@
.mt-17 {
margin-top: 31.88rpx;
}
.page {
padding: 45rpx 30rpx 978.75rpx;
background-color: #ffffff;
width: 100%;
overflow-y: auto;
overflow-x: hidden;
height: 100%;
}
.text {
color: #000000;
font-size: 30rpx;
font-family: SourceHanSansCN;
line-height: 27.99rpx;
font-weight: bold;
}
.text_2 {
color: #969696;
font-size: 22.5rpx;
font-family: SourceHanSansCN;
line-height: 26.25rpx;
width: 256.25rpx;
}