diff --git a/pages/activitesDetail/activitesDetail.js b/pages/activitesDetail/activitesDetail.js new file mode 100644 index 0000000..cab9e85 --- /dev/null +++ b/pages/activitesDetail/activitesDetail.js @@ -0,0 +1,130 @@ +const context = require("../../context/Java110Context.js"); +const constant = context.constant; +const util = context.util; +Page({ + + /** + * 页面的初始数据 + */ + data: { + activitiesId:'', + title:'', + communityId:'' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + activitiesId: options.activitiesId, + title: options.title, + communityId: options.communityId + }); + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + let _that = this; + context.getOwner(function (_owner) { + let _communityId = ''; + if (_owner == null) { + _communityId = '7020181217000001' + } else { + _communityId = _owner.communityId; + } + _that.setData({ + communityId: _communityId + }); + + _that._loadActivite(); + }) + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + _loadActivite:function(){ + let _that = this; + let _objData = { + page: 1, + row: 1, + communityId: this.data.communityId, + activitiesId: this.data.activitiesId + }; + context.request({ + url: constant.url.listActivitiess, + header: context.getHeaders(), + method: "GET", + data: _objData, //动态数据 + success: function (res) { + console.log("请求返回信息:", res); + if (res.statusCode == 200) { + + let _activites = res.data.activitiess[0]; + _activites.src = constant.url.filePath + "?fileId=" + _activites.headerImg + "&communityId=" + _that.data.communityId + "&time=" + new Date(); + let _startTime = _activites.startTime.replace(/\-/g, "/") + let _tmpStartTime = new Date(_startTime); + + _activites.startTime = util.date.formatDate(_tmpStartTime); + _that.setData(_activites); + return; + } + wx.showToast({ + title: "服务器异常了", + icon: 'none', + duration: 2000 + }) + }, + fail: function (e) { + wx.showToast({ + title: "服务器异常了", + icon: 'none', + duration: 2000 + }) + } + }); + } +}) \ No newline at end of file diff --git a/pages/activitesDetail/activitesDetail.json b/pages/activitesDetail/activitesDetail.json new file mode 100644 index 0000000..5aaef3d --- /dev/null +++ b/pages/activitesDetail/activitesDetail.json @@ -0,0 +1,3 @@ +{ + "navigationBarTitleText": "小区文化内容" +} \ No newline at end of file diff --git a/pages/activitesDetail/activitesDetail.wxml b/pages/activitesDetail/activitesDetail.wxml new file mode 100644 index 0000000..867f03f --- /dev/null +++ b/pages/activitesDetail/activitesDetail.wxml @@ -0,0 +1,16 @@ + + + + + {{title}} + + + {{userName}} + {{startTime}} + + + + + + + \ No newline at end of file diff --git a/pages/activitesDetail/activitesDetail.wxss b/pages/activitesDetail/activitesDetail.wxss new file mode 100644 index 0000000..b40b53c --- /dev/null +++ b/pages/activitesDetail/activitesDetail.wxss @@ -0,0 +1,22 @@ +.detailContainer{ + background-color: #fff; +} +.detailContainer .headImg{ + width: 100%; + height: 400rpx; +} + +.detailContainer .ad_titile{ + text-align: center; + margin-top: 30rpx; + margin-bottom: 30rpx; + font-size: 44rpx; +} + +.detailContainer .ad_au_text{ + font-size: 32rpx; + color: #8e8e8e +} +.detailContainer .ad_context{ + padding: 0rpx 40rpx 40rpx 40rpx; +} \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js index 14fec9b..805f3db 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -33,10 +33,6 @@ Page({ name: "报修", src: "/images/5.png", href: "/pages/repair/repair" - }, { - name: "报修新", - src: "/images/5.png", - href: "/pages/repair/repair2" }, { name: "房屋出租", src: "/images/6.png" @@ -126,6 +122,7 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function(options) { + let _that = this; console.log(context); context.getOwner(function (_owner) { let _communityId = ''; @@ -158,12 +155,12 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function() { - var that = this; + var _that = this; - that.setData({ + _that.setData({ location: wx.getStorageSync('location') }); - that._judgeBindOwner(); + _that._judgeBindOwner(); }, _judgeBindOwner:function(){ diff --git a/pages/index/index.wxml b/pages/index/index.wxml index fedd01f..4a3a16d 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -48,27 +48,27 @@ 小区文化 - + - - + + - {{item.name}} + {{item.title}} - wuxw + {{item.userName}} - 1179 + {{item.readCount}} - 37 + {{item.likeCount}} diff --git a/pages/index/index.wxss b/pages/index/index.wxss index 2aef59e..f9655b2 100644 --- a/pages/index/index.wxss +++ b/pages/index/index.wxss @@ -256,6 +256,7 @@ page { width: 200rpx; height: 150rpx; margin: 10rpx 20rpx 0rpx 20rpx; + border-radius: 10rpx; } .notices-info{ margin: 10rpx 0rpx 0rpx 20rpx; @@ -299,4 +300,4 @@ page { .ad-swiper image{ width: 100%; height: inherit; -} +} \ No newline at end of file