init project

This commit is contained in:
limqhz
2020-06-21 16:27:58 +08:00
commit e8fe10b5fb
178 changed files with 9964 additions and 0 deletions

84
pages/notice/index.js Normal file
View File

@@ -0,0 +1,84 @@
// pages/notice/index.js
const app = getApp();
let id = ''
Page({
/**
* 页面的初始数据
*/
data: {
announcement: {},
isGoHome: false,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
id = options.id;
app.$api.announcementDetail({
id: id
}).then(res => {
res.announcement.description = res.announcement.description.replace(/section/g, "div");
this.setData({
announcement: res.announcement
})
}, err => {
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
let pages = getCurrentPages();
this.setData({
isGoHome: pages.length == 1
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
return {
title: '智慧云馆'
}
}
})

6
pages/notice/index.json Normal file
View File

@@ -0,0 +1,6 @@
{
"navigationBarTitleText": "公告",
"usingComponents": {
"header": "/component/header/header"
}
}

12
pages/notice/index.wxml Normal file
View File

@@ -0,0 +1,12 @@
<!--pages/notice/index.wxml-->
<header title="公告" isGoHome="{{isGoHome}}"></header>
<view class='container'>
<view class='body'>
<view class='title'>{{announcement.title}}</view>
<view class='date'>{{announcement.time}}</view>
<view class='rich-box'>
<rich-text nodes="{{announcement.description}}"></rich-text>
</view>
</view>
</view>

38
pages/notice/index.wxss Normal file
View File

@@ -0,0 +1,38 @@
/* pages/notice/index.wxss */
.container {
/* min-height: calc(1100 - 200rpx); */
background: #fff;
}
.body {
padding-bottom: 40rpx;
padding-left: 30rpx;
padding-right: 30rpx;
background: #fff;
}
.title {
padding-top: 40rpx;
font-size: 32rpx;
font-weight: bold;
}
.date {
height: 20rpx;
margin-top: 36rpx;
font-size: 20rpx;
color: #cfcfcf;
line-height: 20rpx;
}
.rich-box {
margin-top: 40rpx;
font-size: 26rpx;
line-height: 40rpx;
}
.rich-box .wscnph {
width: 100%;
}