init version kelfy-mini for new gitea
This commit is contained in:
145
pages/notification/notification.js
Normal file
145
pages/notification/notification.js
Normal file
@@ -0,0 +1,145 @@
|
||||
// pages/notification/notification.js
|
||||
const app = getApp()
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
msgList: [],
|
||||
show: ''
|
||||
},
|
||||
naviTo(e) {
|
||||
console.log(e.currentTarget.dataset.item.ID)
|
||||
let id = e.currentTarget.dataset.item.ID
|
||||
let content = e.currentTarget.dataset.item.CONTENT
|
||||
wx.request({
|
||||
url:'https://fy.btlsoln.com:8443/setMessageNoticeRead?id',
|
||||
// url:'http://sayetest.f3322.org:5000/setMessageNoticeRead?id',
|
||||
method: "GET",
|
||||
data: {
|
||||
id: id
|
||||
},
|
||||
header: {
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
success: (res) => {
|
||||
console.log(res, "读取消息")
|
||||
}
|
||||
})
|
||||
let state = 0
|
||||
wx.navigateTo({
|
||||
url: '/pages/message/message?content=' + content + '&state=' + state,
|
||||
})
|
||||
},
|
||||
|
||||
getList() {
|
||||
wx.request({
|
||||
url:'https://fy.btlsoln.com:8443/findAllMessageNotice?openid= ',
|
||||
// url:'http://sayetest.f3322.org:5000/findMessageNotice?openid',
|
||||
method: "GET",
|
||||
data: {
|
||||
openid: app.globalData.openId
|
||||
},
|
||||
header: {
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
success: (res) => {
|
||||
console.log(res, "消息通知")
|
||||
if (res.data == '') {
|
||||
this.setData({
|
||||
show: true
|
||||
})
|
||||
} else {
|
||||
this.setData({
|
||||
msgList: res.data,
|
||||
show: false
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
clickRead() {
|
||||
wx.request({
|
||||
url: 'https://fy.btlsoln.com:8443/setMessageNoticeAllRead?openid= ',
|
||||
// url:'http://sayetest.f3322.org:5000/findMessageNotice?openid',
|
||||
method: "GET",
|
||||
data: {
|
||||
openid: app.globalData.openId
|
||||
},
|
||||
header: {
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
success: (res) => {
|
||||
console.log(res, "全部已读")
|
||||
this.getList()
|
||||
|
||||
// if(res.data == ''){
|
||||
// this.setData({
|
||||
// show:true
|
||||
// })
|
||||
// }else{
|
||||
// this.setData({
|
||||
// msgList:res.data,
|
||||
// show:false
|
||||
// })
|
||||
// }
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
wx.setNavigationBarTitle({
|
||||
title: '消息通知'
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
this.getList()
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
||||
5
pages/notification/notification.json
Normal file
5
pages/notification/notification.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
|
||||
}
|
||||
}
|
||||
20
pages/notification/notification.wxml
Normal file
20
pages/notification/notification.wxml
Normal file
@@ -0,0 +1,20 @@
|
||||
<!--pages/notification/notification.wxml-->
|
||||
<view class="main">
|
||||
<view class="readed-container">
|
||||
<view class="readed" bindtap="clickRead">一键已读</view>
|
||||
</view>
|
||||
|
||||
<view class="content" wx:if="{{!show}}">
|
||||
<view class="item" wx:for="{{msgList}}" wx:key="item" data-item="{{item}}" bindtap="naviTo">
|
||||
<view class="title">
|
||||
<view>{{item.TITLE}}</view>
|
||||
<view class="icon" wx:if="{{item.STATUS == 0}}"></view>
|
||||
</view>
|
||||
<view class="msg">{{item.CONTENT}}</view>
|
||||
<view class="bottom">查看详情</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content" wx:else>
|
||||
<view class="item2">暂无通知</view>
|
||||
</view>
|
||||
</view>
|
||||
88
pages/notification/notification.wxss
Normal file
88
pages/notification/notification.wxss
Normal file
@@ -0,0 +1,88 @@
|
||||
/* pages/notification/notification.wxss */
|
||||
.main {
|
||||
margin: 30rpx 0;
|
||||
width: 750rpx;
|
||||
}
|
||||
|
||||
.content {
|
||||
height: 100%;
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.item {
|
||||
height: 25vh;
|
||||
width: 100%;
|
||||
border-radius: 5rpx;
|
||||
margin: 40rpx auto;
|
||||
box-shadow: 0px 0px 15rpx #e2e2e2;
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.item2 {
|
||||
height: 250rpx;
|
||||
width: 100%;
|
||||
border-radius: 5rpx;
|
||||
margin: 40rpx auto;
|
||||
box-shadow: 0px 0px 15rpx #e2e2e2;
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 35rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.title {
|
||||
height: 80rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
font-size: 35rpx;
|
||||
color: #333;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.icon {
|
||||
height: 80rpx;
|
||||
width: 80rpx;
|
||||
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAUFJREFUaEPtlk9Kw0AYxV9imOJG9ACKixYCrkqX7cqj6Ak8iSewR3Fll6WrQkEXRQ/Q4qZ0iIkEKfinSjLfAxl42Wa+b+b9fjOTJIj8SSJfPxTgvw3KgAwYCWgLGQGay2XAjNDYQAaMAM3lMmBGaGwgA0aA5nIZ+A3h7BzHh2V2Ub/fpMW8v8TajHtPA7qBxy6O3rbuFgmuvsxXYXzQ8Te9J7wyg1AD1IsvvLtPgMG+RVbANHP+khmCGmBx6u5+kP+epMI4f/HXLAu0AB973q2aLGyT+hPWmaAFWJxlQyB9aBIAKEf5czFpNvbvUQqw4xP9FqqDRH2I6wDRX6O7ENF+yD7fF9H+SjCuxjY9aNdom0mZYxWASTOklwyEUGPWyACTZkgvGQihxqyRASbNkF4yEEKNWSMDTJohvWQghBqz5h1dzlgxx+Kj6QAAAABJRU5ErkJggg==);
|
||||
background-size: 100%;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.msg {
|
||||
height: 10vh;
|
||||
width: 100%;
|
||||
font-size: 30rpx;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.bottom {
|
||||
height: 70rpx;
|
||||
color: #333;
|
||||
font-size: 30rpx;
|
||||
line-height: 70rpx;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.readed-container {
|
||||
width: 100vw;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.readed {
|
||||
width: 20vw;
|
||||
display: flex;
|
||||
margin-right: 5vw;
|
||||
padding: 5rpx 5rpx 5rpx 5rpx;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: small;
|
||||
background-color: #E2EDFE;
|
||||
border-radius: 10rpx;
|
||||
color: #4393FE;
|
||||
}
|
||||
Reference in New Issue
Block a user