diff --git a/api/index/indexApi.js b/api/index/indexApi.js index b4c53c8..09f79b8 100644 --- a/api/index/indexApi.js +++ b/api/index/indexApi.js @@ -16,28 +16,28 @@ import {dateTimeStringToDateString} from '../../utils/DateUtil.js' /** * 查询活动列表 */ -export function getActivitiTitle() { - return [{ - typeCd: '10003', - name: '公共安全及消防' - }, - { - typeCd: '10004', - name: '政务及党政' - }, - { - typeCd: '10005', - name: '费用公开' - }, - { - typeCd: '10001', - name: '小区文化' - }, - { - typeCd: '10002', - name: '其他' - } - ]; +export function getActivitiTitle(dataObj) { + + return new Promise( + (resolve, reject) => { + requestNoAuth({ + url: url.queryActivitiesType, + method: "GET", + data: dataObj, + //动态数据 + success: function(res) { + if (res.statusCode == 200) { + let _activites = res.data.data; + resolve(_activites); + return; + } + reject(); + }, + fail: function(e) { + reject(); + } + }); + }) } /** diff --git a/constant/url.js b/constant/url.js index c1ed779..b82c5a6 100644 --- a/constant/url.js +++ b/constant/url.js @@ -90,6 +90,7 @@ export default { toOweFeePay: baseUrl + "app/payment/toOweFeePay", //欠费缴费 queryRentingPool: baseUrl + 'app/renting/queryRentingPool', saveRentingAppointment: baseUrl + 'app/rentingAppointment/saveRentingAppointment', //房屋预约 + queryActivitiesType: baseUrl +'app/activitiesType/queryActivitiesType', NEED_NOT_LOGIN_PAGE: [ '/pages/login/login', '/pages/register/register', diff --git a/pages/index/index.vue b/pages/index/index.vue index 8d80213..6426c57 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -40,7 +40,7 @@ - {{item.name}} + {{item.typeName}} @@ -103,7 +103,7 @@ page: 1, row: 7, activitiTitle: [], - curTypeCd: '10003', + curTypeCd: '', categoryList: {}, selected: 0, mask1Hidden: true, @@ -124,10 +124,7 @@ */ onLoad: function(options) { let _that = this; - this.vc.onLoad(options); - - //查询 活动标题 - this.activitiTitle = getActivitiTitle(); + this.vc.onLoad(options); //查询目录 this.categoryList = getCategoryList(); }, @@ -170,9 +167,32 @@ .then(function(_communityInfo){ _that.communityId = _communityInfo.communityId; //查询小区活动信息 - _that._loadActivites(); _that._loadAdvertPhoto(); }) + .then(function(){ + _that._loadActivitiesType(); + }) + }, + _loadActivitiesType:function(){ + let _that = this; + let _objData = { + page: 1, + row: 10, + communityId: _that.communityId, + defaultShow:'Y' + }; + //查询 活动标题 + getActivitiTitle(_objData) + .then((actType)=>{ + _that.activitiTitle = actType; + + }) + .then((acts)=>{ + if(_that.activitiTitle.length > 0){ + _that.curTypeCd = _that.activitiTitle[0].typeCd; + } + _that._loadActivites(); + }) }, judgeBindOwnerFun: function() { //查询业主 @@ -185,6 +205,9 @@ */ _loadActivites: function() { let _that = this; + if(this.curTypeCd == ''){ + return ; + } let _objData = { page: this.page, row: this.row,