add miniprogram
This commit is contained in:
62
miniprogram/pages/notice/notice.js
Normal file
62
miniprogram/pages/notice/notice.js
Normal file
@@ -0,0 +1,62 @@
|
||||
//issues.js
|
||||
//获取应用实例
|
||||
var app = getApp();
|
||||
var util = require('../../utils/util')
|
||||
Page({
|
||||
data: {
|
||||
title: '',
|
||||
content: '',
|
||||
time:''
|
||||
},
|
||||
|
||||
titleInput: function (e) {
|
||||
this.setData({
|
||||
title: e.detail.value
|
||||
})
|
||||
},
|
||||
|
||||
contentInput: function (e) {
|
||||
this.setData({
|
||||
content: e.detail.value
|
||||
})
|
||||
},
|
||||
|
||||
submit:function () {
|
||||
var TIME = util.formatTime(new Date());
|
||||
wx.request({
|
||||
url: 'http://127.0.0.1:8080/notice/addNotice',
|
||||
data: {
|
||||
title: this.data.title,
|
||||
content: this.data.content,
|
||||
time:TIME,
|
||||
},
|
||||
success: function (d) {
|
||||
if (d.data != "提交失败") {
|
||||
wx.showToast({
|
||||
title: d.data,
|
||||
icon: 'success',
|
||||
duration: 2000,
|
||||
success: function () {
|
||||
setTimeout(function() {
|
||||
wx.switchTab({
|
||||
url: '../home/home'
|
||||
})
|
||||
}, 2000);
|
||||
}
|
||||
})
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: d.data,
|
||||
icon: 'error',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
onLoad: function(){
|
||||
|
||||
},
|
||||
|
||||
});
|
3
miniprogram/pages/notice/notice.json
Normal file
3
miniprogram/pages/notice/notice.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
10
miniprogram/pages/notice/notice.wxml
Normal file
10
miniprogram/pages/notice/notice.wxml
Normal file
@@ -0,0 +1,10 @@
|
||||
<!--issues.wxml-->
|
||||
<view class="perason">
|
||||
<view class="issues-panel">
|
||||
<input class="issues-input" placeholder="请输入标题" bindinput="titleInput" />
|
||||
<textarea class="issues-textarea" placeholder="请输入内容" bindinput="contentInput" auto-height></textarea>
|
||||
</view>
|
||||
<view class="submit-btn" bindtap="submit">
|
||||
<text>发布公告</text>
|
||||
</view>
|
||||
</view>
|
113
miniprogram/pages/notice/notice.wxss
Normal file
113
miniprogram/pages/notice/notice.wxss
Normal file
@@ -0,0 +1,113 @@
|
||||
/**issuse.wxss**/
|
||||
.perason{
|
||||
background-color: #f6f6f6;
|
||||
padding: 0;
|
||||
padding-top: 30rpx;
|
||||
font-size: 11pt;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
min-height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-bottom: 100rpx;
|
||||
}
|
||||
.issues-label{
|
||||
font-size: 10pt;
|
||||
line-height: 100%;
|
||||
color: #999;
|
||||
margin: 25rpx 20rpx 15rpx;
|
||||
}
|
||||
.issues-panel{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
background-color: #fff;
|
||||
border-top: 1px solid #e5e5e5;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
}
|
||||
.issues-img-panel{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
background-color: #fff;
|
||||
border-top: 1px solid #e5e5e5;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
padding: 15rpx 25rpx;
|
||||
}
|
||||
.issues-input{
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
padding: 15rpx 25rpx;
|
||||
}
|
||||
.issues-textarea{
|
||||
padding: 25rpx;
|
||||
min-height: 225rpx;
|
||||
}
|
||||
.issues-photo-item {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #888;
|
||||
margin: 20rpx;
|
||||
margin-right: 0;
|
||||
width: 135rpx;
|
||||
height: 135rpx;
|
||||
border: 1rpx solid #e5e5e5;
|
||||
border-radius: 5rpx;
|
||||
}
|
||||
.issues-photo-item:active{
|
||||
opacity: .8;
|
||||
}
|
||||
.issues-photo-item .remind-img{
|
||||
padding: 0;
|
||||
}
|
||||
.issues-photo-item image{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.add-photo:active {
|
||||
background: #f0f0f0;
|
||||
}
|
||||
.add-photo::before, .add-photo::after{
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
background: #e5e5e5;
|
||||
}
|
||||
.add-photo:active::before, .add-photo:active::after{
|
||||
background: #ddd;
|
||||
}
|
||||
.add-photo::before {
|
||||
width: 10rpx;
|
||||
height: 80rpx;
|
||||
margin-top: -40rpx;
|
||||
margin-left: -5rpx;
|
||||
}
|
||||
.add-photo::after {
|
||||
width: 80rpx;
|
||||
height: 10rpx;
|
||||
margin-top: -5rpx;
|
||||
margin-left: -40rpx;
|
||||
}
|
||||
.issues-remind {
|
||||
flex: 1;
|
||||
font-size: 9pt;
|
||||
line-height: 135%;
|
||||
color: #ccc;
|
||||
padding: 0 30rpx;
|
||||
word-break: break-all;
|
||||
text-indent: 1em;
|
||||
padding-top: 30rpx;
|
||||
}
|
||||
.submit-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: 40rpx 3%;
|
||||
height: 80rpx;
|
||||
border-radius: 3px;
|
||||
text-align: center;
|
||||
background-color: #FF8966;
|
||||
color: #fff;
|
||||
font-size: 12pt;
|
||||
}
|
Reference in New Issue
Block a user