合并代码

This commit is contained in:
his-uncles-father 2020-01-17 23:27:56 +08:00
commit 7aa17ea568
6 changed files with 204 additions and 1 deletions

View File

@ -0,0 +1,139 @@
// pages/activites/activites.js
const context = require("../../context/Java110Context.js");
const constant = context.constant;
const util = context.util;
Page({
/**
* 页面的初始数据
*/
data: {
activities:[]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let _that = this;
context.getOwner(function (_owner) {
let _communityId = '';
if (_owner == null) {
_communityId = '7020181217000001'
} else {
_communityId = _owner.communityId;
}
_that.setData({
communityId: _communityId
});
//查询小区文化
_that._loadActivites();
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
/**
* 加载活动
* 第一次加载是可能没有小区 则直接下载固定小区
*
*/
_loadActivites: function () {
let _that = this;
let _objData = {
page: 1,
row: 15,
communityId: this.data.communityId
};
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;
let _acts = [];
_activites.forEach(function (_item) {
_item.src = constant.url.filePath + "?fileId=" + _item.headerImg + "&communityId=" + _that.data.communityId + "&time=" + new Date();
let _startTime = _item.startTime.replace(/\-/g, "/")
let _tmpStartTime = new Date(_startTime);
_item.startTime = util.date.formatDate(_tmpStartTime);
_acts.push(_item);
});
_that.setData({
activities: _acts
});
return;
}
wx.showToast({
title: "服务器异常了",
icon: 'none',
duration: 2000
})
},
fail: function (e) {
wx.showToast({
title: "服务器异常了",
icon: 'none',
duration: 2000
})
}
});
},
})

View File

@ -0,0 +1,3 @@
{
"navigationBarTitleText": "小区文化"
}

View File

@ -0,0 +1,24 @@
<!--pages/activites/activites.wxml-->
<view class="act">
<block wx:for="{{activities}}" wx:key="index">
<navigator url="/pages/activitesDetail/activitesDetail?activitiesId={{item.activitiesId}}&title={{item.title}}&communityId={{item.communityId}}">
<view class="act_item">
<view class="act_img">
<image class="headImg" src="{{item.src}}"></image>
</view>
<view class="act_title">
<van-row>
<van-col span="18">
<text>{{item.title}}</text>
</van-col>
<van-col span="4" offset="2">
<text>{{item.userName}}</text>
</van-col>
</van-row>
</view>
</view>
</navigator>
</block>
</view>

View File

@ -0,0 +1,33 @@
/* .act{
background-color: #fff;
} */
.act .act_item{
background-color: #fff;
margin: 30rpx 0rpx;
padding: 30rpx 20rpx 15rpx 20rpx;
}
.act .act_item .headImg{
border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx;
width: 100%;
height: 400rpx;
}
.act .act_title{
margin-top: 10rpx;
width: 100%;
overflow: hidden;
}
.act .act_title van-col view{
overflow: hidden;
}
.act .act_title text{
overflow: hidden;
font-size: 28rpx;
white-space:nowrap;
text-overflow: ellipsis;
}

View File

@ -21,7 +21,7 @@
</van-cell-group>
</view>
</view>
<view class="block__title"></view>
<view class="block__bottom"></view>
<van-submit-bar price="{{ receivableAmount }}" button-text="提交订单" bind:submit="onPayFee" />

View File

@ -13,4 +13,8 @@
.button_up_blank{
height: 40rpx;
}
.block__bottom{
height: 180rpx;
}