diff --git a/pages/activity/activity.js b/pages/activity/activity.js index f5ce8cc..c6d4ffe 100644 --- a/pages/activity/activity.js +++ b/pages/activity/activity.js @@ -7,11 +7,38 @@ Page({ */ data: { dataList: [], + areaList: [], pages: { page: 1, - rows: 5 + rows: 5, + county: '' } }, + getAreaList: function () { + var self = this; + app.restAjax.get(app.restAjax.path(app.usercenterUrl + '/app/dataarea/listareabyparentidrelease/640675', []), + self.data.pages, null, function (code, data) { + if (code == '200') { + self.setData({ + areaList: data + }) + } + } + ) + }, + changeArea: function (e) { + app.dialog.loading('正在加载'); + this.setData({ + 'pages.county': e.currentTarget.dataset.area + }) + this.getActivityList() + }, + loadAll: function () { + this.setData({ + 'pages.county': '' + }) + this.getActivityList() + }, goDetail: function (e) { var id = e.currentTarget.dataset.id; wx.navigateTo({ @@ -50,6 +77,7 @@ Page({ }, function() { wx.hideNavigationBarLoading(); //完成停止加载图标 wx.stopPullDownRefresh(); + wx.hideLoading(); }) }, /** @@ -57,6 +85,7 @@ Page({ */ onLoad: function (options) { this.getActivityList(); + this.getAreaList() }, /** diff --git a/pages/activity/activity.wxml b/pages/activity/activity.wxml index a415140..c1644db 100644 --- a/pages/activity/activity.wxml +++ b/pages/activity/activity.wxml @@ -1,3 +1,7 @@ + + 全部 + {{item.areaName}} + diff --git a/pages/activity/activity.wxss b/pages/activity/activity.wxss index 454a8b4..a496ac3 100644 --- a/pages/activity/activity.wxss +++ b/pages/activity/activity.wxss @@ -1,5 +1,6 @@ .activity{ padding: 20rpx 30rpx 0; + margin-top: 80rpx; } .activity-box{ margin-bottom: 20rpx; @@ -66,4 +67,23 @@ margin-top: 10rpx; font-size: 24rpx; color: #242424; +} +.area{ + position: fixed; + top: 0; + left: 0; + right: 0; + height: 80rpx; + white-space: nowrap; + overflow-x: auto; +} +.area-box{ + display: inline-block; + width: 25%; + line-height: 80rpx; + text-align: center; + font-size: 30rpx; +} +.area-box.active{ + color: #9F1512; } \ No newline at end of file diff --git a/pages/newsList/newsList.js b/pages/newsList/newsList.js index 6c4e7f4..2e7175e 100644 --- a/pages/newsList/newsList.js +++ b/pages/newsList/newsList.js @@ -13,7 +13,8 @@ Page({ directoriesParentId: 'f497904b-7727-4832-891c-604c36ae4167', currentNewsDictionariesId: '', currentPage: 1, - rows: 10 + rows: 10, + areaId: '' }, doGetNewsDictionariesList: function() { var self = this; @@ -43,15 +44,21 @@ Page({ }); self.doGetNewsList(1); }, - doGetNewsList: function(page) { + doGetNewsList: function(page, lv) { var self = this; app.dialog.loading('正在加载'); - app.restAjax.get(app.restAjax.path('{newsUrl}/app/newscontent/listpagenewscontentrelease', [self.data.news.newsUrl]), { + var info = { newsDirectoriesParentId: self.data.directoriesParentId, newsDirectoriesId: self.data.currentNewsDictionariesId ? self.data.currentNewsDictionariesId : '', page: page, rows: self.data.rows - }, null, function(code, data) { + } + if (lv) { + lv = 'area' + lv + info[lv] = self.data.areaId + } + console.log(info) + app.restAjax.get(app.restAjax.path('{newsUrl}/app/newscontent/listpagenewscontentrelease', [self.data.news.newsUrl]), info, null, function(code, data) { var newsArray; if(page <= 1) { newsArray = data.rows; @@ -79,6 +86,32 @@ Page({ url: '../newsDetail/newsDetail?templateRecordUrl='+ event.currentTarget.dataset.templateRecordUrl, }) }, + getAreaList: function () { + var self = this; + app.restAjax.get(app.restAjax.path(app.usercenterUrl + '/app/dataarea/listareabyparentidrelease/640675', []), + self.data.pages, null, function (code, data) { + if (code == '200') { + self.setData({ + areaList: data + }) + } + } + ) + }, + changeArea: function (e) { + app.dialog.loading('正在加载'); + var lv = parseInt(e.currentTarget.dataset.level) + 1 + this.setData({ + areaId: e.currentTarget.dataset.area + }) + this.doGetNewsList(1, lv) + }, + loadAll: function () { + this.setData({ + areaId: '' + }) + this.doGetNewsList(1) + }, /** * 生命周期函数--监听页面加载 */ @@ -94,6 +127,7 @@ Page({ }); } self.doGetNewsDictionariesList(); + self.getAreaList(); }, /** diff --git a/pages/newsList/newsList.wxml b/pages/newsList/newsList.wxml index e008858..7d31b3a 100644 --- a/pages/newsList/newsList.wxml +++ b/pages/newsList/newsList.wxml @@ -1,13 +1,27 @@ - - - 全部 - + + + + 全部 + + + + + {{item.directoriesName}} + + - - - {{item.directoriesName}} - + + + + 全部 + + + + + {{item.areaName}} + + diff --git a/pages/newsList/newsList.wxss b/pages/newsList/newsList.wxss index 43041b4..03719e3 100644 --- a/pages/newsList/newsList.wxss +++ b/pages/newsList/newsList.wxss @@ -3,12 +3,14 @@ top: 0; left: 0; right: 0; - display: flex; box-shadow:0 0 17rpx 0 rgba(0,0,0,0.1); border-radius:0 0 31rpx 31rpx; background: #fff; overflow-x: auto; } +.type{ + display: flex; +} .tab-box{ display: inline-flex; justify-content: center; @@ -35,15 +37,52 @@ display: block; } .tab-box image.selected-l{ - left: 40rpx; + left: 20rpx; } .tab-box image.selected-r{ - right: 40rpx; + right: 20rpx; +} +.area{ + overflow-x: auto; + white-space: nowrap; +} +.area-box{ + display: inline-block; + width: 30%; + height: 90rpx; + line-height: 90rpx; + text-align: center; + padding: 0 20px; + box-sizing: border-box; + position: relative; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.area-box.active{ + color: #9F1512; +} +.area-box image{ + position: absolute; + width: 15rpx; + height: 40rpx; + top: 50%; + margin-top: -20rpx; + display: none; +} +.area-box.active image{ + display: block; +} +.area-box image.selected-l{ + left: 20rpx; +} +.area-box image.selected-r{ + right: 20rpx; } .news{ padding: 30rpx; border-bottom: 5px solid #FBFBFB; - margin-top: 90rpx; + margin-top: 180rpx; } .news-box{ padding: 30rpx 0; diff --git a/pages/venue/venue.js b/pages/venue/venue.js index edfb9a3..4e3104e 100644 --- a/pages/venue/venue.js +++ b/pages/venue/venue.js @@ -16,7 +16,11 @@ Page({ orderKey : '', venueType : '', latitude: '', - longitude: '' + longitude: '', + selectingArea: false, // 显示隐藏选择区域 + areaList: [], + venueArea: '', + areaName: '' }, //获取定位 @@ -63,6 +67,7 @@ Page({ latitude: self.data.latitude, longitude: self.data.longitude, selfLocation: 'TX', + venueArea: self.data.venueArea }, null, function(code, data){ data.rows.forEach(element => { @@ -77,11 +82,15 @@ Page({ venuesList : data.rows, page : data.page }); + if (data.rows.length == 0) { + app.dialog.msg('暂无数据'); + } }, function(code,data){ app.dialog.msg(data.msg); },function(){ wx.hideNavigationBarLoading(); wx.stopPullDownRefresh(); + wx.hideLoading(); } ); }, @@ -115,12 +124,51 @@ Page({ }) }, + //选择区域 + selectArea: function () { + this.setData({ + selectingArea: true + }) + }, + + // 获取地区列表 + getAreaList: function () { + var self = this; + app.restAjax.get(app.restAjax.path(app.usercenterUrl + '/app/dataarea/listareabyparentidrelease/640675', []), + self.data.pages, null, function (code, data) { + if (code == '200') { + self.setData({ + areaList: data + }) + } + }) + }, + // 切换地区 + changeArea: function (e) { + app.dialog.loading('正在加载'); + this.setData({ + venueArea: e.currentTarget.dataset.area, + selectingArea: false, + areaName: e.currentTarget.dataset.areaname + }) + this.listPageVenuesInfo() + }, + + // 全部地区 + loadAll: function () { + this.setData({ + venueArea: '', + selectingArea: false + }) + this.listPageVenuesInfo() + }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { this.listVenueType(); this.getLocation(); + this.getAreaList(); }, /** diff --git a/pages/venue/venue.wxml b/pages/venue/venue.wxml index 621c0ef..e2adffb 100644 --- a/pages/venue/venue.wxml +++ b/pages/venue/venue.wxml @@ -19,6 +19,12 @@ 最新发布 + + 选择区域 + + + {{areaName}} + @@ -35,3 +41,9 @@ + + + 全部 + {{item.areaName}} + + \ No newline at end of file diff --git a/pages/venue/venue.wxss b/pages/venue/venue.wxss index 3aa914a..09ff6b5 100644 --- a/pages/venue/venue.wxss +++ b/pages/venue/venue.wxss @@ -3,7 +3,7 @@ top: 0; left: 0; right: 0; - padding: 0 30rpx; + padding: 0 30rpx 10rpx; background: #fff; } .fixed-tab{ @@ -44,7 +44,7 @@ } .venue{ height: 400rpx; - margin-top: 240rpx; + margin-top: 250rpx; padding: 0 30rpx; } @@ -85,4 +85,41 @@ font-size: 28rpx; color: #242424; margin-top: 10rpx; +} +.select-area{ + position: fixed; + top: 0; + bottom: 0; + right: 0; + left: 0; + background: rgba(0,0,0,0.6); +} +.area-container{ + background: #fff; + padding: 15rpx 15rpx 0; + font-size: 0; +} +.area-box{ + display: inline-block; + width: 32%; + height: 60rpx; + line-height: 60rpx; + margin-bottom: 15rpx; + margin-right: 2%; + text-align: center; + font-size: 30rpx; + border: 1px solid #DDD; + border-radius: 10rpx; + box-sizing: border-box; + padding: 0 10rpx; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.area-box.active{ + border: #9F1512 1px solid; + color: #9F1512; +} +.area-box:nth-child(3n){ + margin-right: 0; } \ No newline at end of file