mirror of
https://gitee.com/java110/WechatOwnerService.git
synced 2026-06-11 14:17:25 +08:00
合并代码
This commit is contained in:
commit
ea33b3caf0
130
pages/activitesDetail/activitesDetail.js
Normal file
130
pages/activitesDetail/activitesDetail.js
Normal file
@ -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
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
3
pages/activitesDetail/activitesDetail.json
Normal file
3
pages/activitesDetail/activitesDetail.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "小区文化内容"
|
||||
}
|
||||
16
pages/activitesDetail/activitesDetail.wxml
Normal file
16
pages/activitesDetail/activitesDetail.wxml
Normal file
@ -0,0 +1,16 @@
|
||||
<!--pages/detail/detail.wxml -->
|
||||
<view class="detailContainer">
|
||||
<image class="headImg" src="{{src}}"></image>
|
||||
<view class="ad_titile">
|
||||
<text class="company">{{title}}</text>
|
||||
</view>
|
||||
<van-row>
|
||||
<van-col span="8" offset="4"><text class="ad_au_text">{{userName}}</text></van-col>
|
||||
<van-col span="8" offset="2"><text class="ad_au_text">{{startTime}}</text></van-col>
|
||||
</van-row>
|
||||
|
||||
<view class="ad_context">
|
||||
<van-divider />
|
||||
<rich-text nodes="{{context}}"/>
|
||||
</view>
|
||||
</view>
|
||||
22
pages/activitesDetail/activitesDetail.wxss
Normal file
22
pages/activitesDetail/activitesDetail.wxss
Normal file
@ -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;
|
||||
}
|
||||
@ -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(){
|
||||
|
||||
@ -48,27 +48,27 @@
|
||||
|
||||
<view class="header-title">
|
||||
<text class="new">小区文化</text>
|
||||
<text class="iconfont icongengduo1 gd"></text>
|
||||
<text class="iconfont icongengduo1 gd" catchtap="_moreActivities"></text>
|
||||
</view>
|
||||
<view class="noticesList">
|
||||
<block wx:for="{{notices}}" wx:key="index">
|
||||
<navigator url="/pages/menu/menu">
|
||||
<view class="noticesList-list">
|
||||
<navigator url="/pages/activitesDetail/activitesDetail?activitiesId={{item.activitiesId}}&title={{item.title}}&communityId={{item.communityId}}">
|
||||
<view class="noticesList-list" >
|
||||
<view class="notices-info">
|
||||
<view class="notices-info-name">{{item.name}}</view>
|
||||
<view class="notices-info-name">{{item.title}}</view>
|
||||
|
||||
<view class="notice-bottom">
|
||||
<view>
|
||||
<text class="iconfont iconaccount1"></text>
|
||||
<text>wuxw</text>
|
||||
<text>{{item.userName}}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text class="iconfont iconyuedu"></text>
|
||||
<text>1179</text>
|
||||
<text>{{item.readCount}}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text class="iconfont icongood-fill"></text>
|
||||
<text>37</text>
|
||||
<text>{{item.likeCount}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user