diff --git a/app.json b/app.json index 14f3a2f..ff2f78b 100644 --- a/app.json +++ b/app.json @@ -34,7 +34,7 @@ "window": { "backgroundTextStyle": "light", "navigationBarBackgroundColor": "#9F1512", - "navigationBarTitleText": "日喀则数字文化馆", + "navigationBarTitleText": "日喀则市数字文化云", "navigationBarTextStyle": "white" }, "tabBar": { diff --git a/pages/index/index.js b/pages/index/index.js index 67ddf05..c7a82cf 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -7,12 +7,9 @@ Page({ indicatorDots: true, autoplay: true, token: '', - library: { - libraryUrl: app.libraryUrl, - bannerLibrary: [], - }, news: { newsUrl: app.newsUrl, + bannerList: [], newsList: [] }, venue: { @@ -53,16 +50,17 @@ Page({ } }) }, - doGetLibrary: function() { + doGetBanner: function() { var self = this; - app.restAjax.get(app.restAjax.path('{libraryUrl}/app/intangiblelibrary/listpageintangiblelibraryrelease', [self.data.library.libraryUrl]), { + app.restAjax.get(app.restAjax.path('{newsUrl}/app/newscontent/listpagenewscontentrelease', [self.data.news.newsUrl]), { + newsDirectoriesId: 'eab0ca3c-d35d-4c02-9397-ace2bdd10fc1', page: 1, rows: 5 }, null, function(code, data) { self.setData({ - 'library.bannerLibrary': data.rows - }); - }, function(code, data){ + 'news.bannerList': data.rows + }) + }, function(code, data) { app.dialog.msg(data.msg); }); }, @@ -95,6 +93,7 @@ Page({ doGetNewsList: function() { var self = this; app.restAjax.get(app.restAjax.path('{newsUrl}/app/newscontent/listpagenewscontentrelease', [self.data.news.newsUrl]), { + newsDirectoriesParentId: 'f497904b-7727-4832-891c-604c36ae4167', page: 1, rows: 5 }, null, function(code, data) { @@ -169,7 +168,7 @@ Page({ onLoad: function (options) { var self = this; self.doLogin(); - self.doGetLibrary(); + self.doGetBanner(); self.doGetNewsList(); self.doGetLiveList(); self.doGetVenueList(); diff --git a/pages/index/index.wxml b/pages/index/index.wxml index df5b0ff..5760780 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -1,7 +1,7 @@ - - + + @@ -48,7 +48,7 @@ - 新闻资讯 + 文化动态 diff --git a/pages/newsList/newsList.js b/pages/newsList/newsList.js index 98fbf79..21566fc 100644 --- a/pages/newsList/newsList.js +++ b/pages/newsList/newsList.js @@ -7,15 +7,48 @@ Page({ data: { news: { newsUrl: app.newsUrl, + newsDictionaries: [], newsList: [], }, + directoriesParentId: 'f497904b-7727-4832-891c-604c36ae4167', + currentNewsDictionariesId: '', currentPage: 1, rows: 10 }, + doGetNewsDictionariesList: function() { + var self = this; + app.dialog.loading('正在加载'); + app.restAjax.get(app.restAjax.path('{newsUrl}/app/newsdirectories/listnewsdirectoriesrelease', [self.data.news.newsUrl]), { + directoriesParentId: self.data.directoriesParentId, + }, null, function(code, data) { + self.setData({ + 'news.newsDictionaries': data + }) + self.doGetNewsList(1); + }, function(code, data) { + app.dialog.msg(data.msg); + }, function() {}); + }, + doClickDictionaries: function(event) { + var self = this; + self.setData({ + currentNewsDictionariesId: event.currentTarget.dataset.newsDirectoriesId + }); + self.doGetNewsList(1); + }, + doClearCurrentNewsDictionariesId: function() { + var self = this; + self.setData({ + currentNewsDictionariesId: '' + }); + self.doGetNewsList(1); + }, doGetNewsList: function(page) { var self = this; app.dialog.loading('正在加载'); app.restAjax.get(app.restAjax.path('{newsUrl}/app/newscontent/listpagenewscontentrelease', [self.data.news.newsUrl]), { + newsDirectoriesParentId: self.data.directoriesParentId, + newsDirectoriesId: self.data.currentNewsDictionariesId ? self.data.currentNewsDictionariesId : '', page: page, rows: self.data.rows }, null, function(code, data) { @@ -51,7 +84,7 @@ Page({ */ onLoad: function (options) { var self = this; - self.doGetNewsList(1); + self.doGetNewsDictionariesList(); }, /** diff --git a/pages/newsList/newsList.wxml b/pages/newsList/newsList.wxml index 604b7bf..e008858 100644 --- a/pages/newsList/newsList.wxml +++ b/pages/newsList/newsList.wxml @@ -1,22 +1,12 @@ - + - 未参加 + 全部 - + - 已参加 - - - - - 已参加 - - - - - 已参加 + {{item.directoriesName}}