diff --git a/src/common/components/common.js b/src/common/components/common.js index 7437ff9..f5987d6 100644 --- a/src/common/components/common.js +++ b/src/common/components/common.js @@ -3,12 +3,14 @@ const url = 'http://49.233.36.36:58099/xzszwhy/' const liveUrl = 'https://www.xzszwhy.cn/' const shopUrl = 'http://175.24.42.217:9016/xzshop/' /** - * 基础区域编码 - * 日喀则:540200000000 - * 南木林县: 540221000000 - * @type {string} + * 基础区域ID、编码 + * 日喀则:640675, 540200000000 + * 南木林县: 640865, 540221000000 */ -const areaCode = '540221000000' +const area = { + areaId: '640675', + areaCode: '540200000000' +} const phoneSafe = (phone) => { if (phone.length === 11) { @@ -21,6 +23,6 @@ export default { url, liveUrl, shopUrl, - areaCode: areaCode, + area: area, phoneSafe } diff --git a/src/pages/ArtTrain/ArtTrain.vue b/src/pages/ArtTrain/ArtTrain.vue index a5995ce..fa51398 100644 --- a/src/pages/ArtTrain/ArtTrain.vue +++ b/src/pages/ArtTrain/ArtTrain.vue @@ -90,7 +90,7 @@ export default { getNewsList: function (item) { var self = this self.isLoading = true - axios.get(self.url + 'app/newscontent/listpagenewscontentrelease', { + axios.get(self.url + 'app/newscontent/listpagenewscontentrelease/' + common.area.areaCode, { params: { page: 1, rows: 8, diff --git a/src/pages/ArtTrainList/ArtTrainList.vue b/src/pages/ArtTrainList/ArtTrainList.vue index 454ae88..c330ed6 100644 --- a/src/pages/ArtTrainList/ArtTrainList.vue +++ b/src/pages/ArtTrainList/ArtTrainList.vue @@ -138,7 +138,7 @@ export default { }, getList: function () { var self = this - axios.get(self.url + 'app/newscontent/listpagenewscontentrelease', { + axios.get(self.url + 'app/newscontent/listpagenewscontentrelease/' + common.area.areaCode, { params: self.page }).then(function (res) { for (var i = 0; i < res.data.rows.length; i++) { diff --git a/src/pages/CultureActivity/CultureActivity.vue b/src/pages/CultureActivity/CultureActivity.vue index 210a7ff..169394e 100644 --- a/src/pages/CultureActivity/CultureActivity.vue +++ b/src/pages/CultureActivity/CultureActivity.vue @@ -10,14 +10,14 @@
活动类别> - - + +
选择区域>
- - + +
@@ -33,12 +33,12 @@

{{list.activityTitle}}

{{list.activityStartTime}}至{{list.activityEndTime}}

{{list.activityAddress}}

- - - - - - + + + + + + @@ -51,18 +51,18 @@ 首页 上一页 @@ -104,6 +104,8 @@ export default { activityType: '', county: '' }, + defaultArea: common.area.areaCode, + area: common.area.areaCode, url: common.url, isLoading: false } @@ -117,16 +119,10 @@ export default { } }, methods: { - changeArea: function (area, lv) { + changeArea: function (code) { this.page.page = 1 this.changePage = 1 - if (area) { - this.page.county = area - var areaLv = 'area' + (parseInt(lv) + 1) - console.log(areaLv) - } else { - this.page.county = '' - } + this.area = code this.getActivityList() }, doJumpPage: function () { @@ -147,7 +143,7 @@ export default { getActivityList: function () { var self = this self.isLoading = true - axios.get(self.url + 'app/activitylibrary/listpageactivitylibraryfornetrelease', { + axios.get(self.url + 'app/activitylibrary/listpageactivitylibraryfornetrelease/' + self.area, { params: self.page }).then(function (res) { var result = res.data.rows @@ -170,7 +166,7 @@ export default { }, getAreaList: function () { var self = this - axios.get(self.url + 'app/area/listbyparentidrelease/640675').then(function (res) { + axios.get(self.url + 'app/area/listbyparentidrelease/' + common.area.areaId).then(function (res) { self.areaList = res.data }) } diff --git a/src/pages/CultureDynamics/CultureDynamics.vue b/src/pages/CultureDynamics/CultureDynamics.vue index 20ac8ef..e8b6ff0 100644 --- a/src/pages/CultureDynamics/CultureDynamics.vue +++ b/src/pages/CultureDynamics/CultureDynamics.vue @@ -10,15 +10,15 @@
类型:
区域:
@@ -47,18 +47,18 @@ 首页 上一页 @@ -98,10 +98,10 @@ export default { page: 1, rows: 8, totalPage: 1, - newsDirectoriesId: '', - newsDirectoriesParentId: 'f497904b-7727-4832-891c-604c36ae4167' + newsDirectoriesId: '' }, - area: '', + defaultArea: common.area.areaCode, + area: common.area.areaCode, url: common.url, isLoading: false } @@ -115,23 +115,10 @@ export default { } }, methods: { - changeArea: function (area, lv) { + changeArea: function (code) { this.page.page = 1 this.changePage = 1 - this.area = area - if (area) { - var level = 'area' + (parseInt(lv) + 1) - this.$set(this.page, level, area) - } else { - this.area = '' - this.page = { - page: 1, - rows: 8, - totalPage: 1, - newsDirectoriesId: '', - newsDirectoriesParentId: 'f497904b-7727-4832-891c-604c36ae4167' - } - } + this.area = code this.getNews() }, doJumpPage: function () { @@ -141,7 +128,7 @@ export default { getNews: function () { var self = this self.isLoading = true - axios.get(self.url + 'app/newscontent/listpagenewscontentrelease', { + axios.get(self.url + 'app/newscontent/listpagenewscontentrelease/' + self.area, { params: self.page }).then(function (res) { for (var i = 0; i < res.data.rows.length; i++) { @@ -187,7 +174,7 @@ export default { }, getAreaList: function () { var self = this - axios.get(self.url + 'app/area/listbyparentidrelease/640675').then(function (res) { + axios.get(self.url + 'app/area/listbyparentidrelease/' + common.area.areaId).then(function (res) { self.areaList = res.data }) } diff --git a/src/pages/CultureVenue/CultureVenue.vue b/src/pages/CultureVenue/CultureVenue.vue index 3c05673..92ddb5f 100644 --- a/src/pages/CultureVenue/CultureVenue.vue +++ b/src/pages/CultureVenue/CultureVenue.vue @@ -10,14 +10,14 @@
活动类别> - - + +
选择区域>
- - + +
@@ -41,18 +41,18 @@ 首页 上一页 @@ -91,10 +91,10 @@ export default { page: 1, rows: 8, totalPage: 1, - venueType: '', - venueArea: '', - areaLevel: '' + venueType: '' }, + defaultArea: common.area.areaCode, + area: common.area.areaCode, url: common.url, isLoading: false } @@ -108,15 +108,10 @@ export default { } }, methods: { - changeArea: function (area, lv) { + changeArea: function (code) { this.page.page = 1 this.changePage = 1 - if (area) { - this.page.venueArea = area - this.page.areaLevel = 'area' + (parseInt(lv) + 1) - } else { - this.page.venueArea = '' - } + this.area = code this.getVenueList() }, changeType: function (type) { @@ -145,14 +140,14 @@ export default { }, getAreaList: function () { var self = this - axios.get(self.url + 'app/area/listbyparentidrelease/640675').then(function (res) { + axios.get(self.url + 'app/area/listbyparentidrelease/' + common.area.areaId).then(function (res) { self.areaList = res.data }) }, getVenueList: function () { var self = this self.isLoading = true - axios.get(self.url + 'app/venuesinfo/listpagevenuesinforelease', { + axios.get(self.url + 'app/venuesinfo/listpagevenuesinforelease/' + self.area, { params: self.page }).then(function (res) { for (var i = 0; i < res.data.rows.length; i++) { diff --git a/src/pages/Exhibition/Exhibition.vue b/src/pages/Exhibition/Exhibition.vue index 1d85ed1..d65edf6 100644 --- a/src/pages/Exhibition/Exhibition.vue +++ b/src/pages/Exhibition/Exhibition.vue @@ -139,7 +139,7 @@ export default { getList: function () { var self = this self.isLoading = true - axios.get(self.url + 'app/newscontent/listpagenewscontentrelease', { + axios.get(self.url + 'app/newscontent/listpagenewscontentrelease/' + common.area.areaCode, { params: self.page }).then(function (res) { for (var i = 0; i < res.data.rows.length; i++) { diff --git a/src/pages/Index/Index.vue b/src/pages/Index/Index.vue index c27f3f6..0415e15 100644 --- a/src/pages/Index/Index.vue +++ b/src/pages/Index/Index.vue @@ -73,7 +73,7 @@ export default { methods: { getDynamicsList: function () { var self = this - axios.get(self.url + 'app/newscontent/listpagenewscontentrelease/' + common.areaCode, { + axios.get(self.url + 'app/newscontent/listpagenewscontentrelease/' + common.area.areaCode, { params: self.dynamicsPage }).then(function (res) { var picNews = res.data.rows.splice(0, 1)[0] @@ -92,7 +92,7 @@ export default { }, getActivityList: function () { var self = this - axios.get(self.url + 'app/activitylibrary/listpageactivitylibraryfornetrelease', { + axios.get(self.url + 'app/activitylibrary/listpageactivitylibraryfornetrelease/' + common.area.areaCode, { params: self.activityPage }).then(function (res) { self.activityList = res.data.rows @@ -100,7 +100,7 @@ export default { }, getLiterature: function () { var self = this - axios.get(self.url + 'app/newscontent/listpagenewscontentrelease/' + common.areaCode, { + axios.get(self.url + 'app/newscontent/listpagenewscontentrelease/' + common.area.areaCode, { params: self.literaturePage }).then(function (res) { for (var i = 0; i < res.data.rows.length; i++) { @@ -111,7 +111,7 @@ export default { }, getExhibition: function () { var self = this - axios.get(self.url + 'app/newscontent/listpagenewscontentrelease/' + common.areaCode, { + axios.get(self.url + 'app/newscontent/listpagenewscontentrelease/' + common.area.areaCode, { params: self.exhibitionPage }).then(function (res) { for (var i = 0; i < res.data.rows.length; i++) { @@ -123,7 +123,7 @@ export default { // 轮播图 getSwiper: function () { var self = this - axios.get(self.url + 'app/newscontent/listpagenewscontentrelease/' + common.areaCode, { + axios.get(self.url + 'app/newscontent/listpagenewscontentrelease/' + common.area.areaCode, { params: { page: 1, rows: 3, diff --git a/src/pages/Index/components/DigitalResource.vue b/src/pages/Index/components/DigitalResource.vue index aa2f9c5..6178caa 100644 --- a/src/pages/Index/components/DigitalResource.vue +++ b/src/pages/Index/components/DigitalResource.vue @@ -62,7 +62,7 @@ export default { }, getLiterature: function () { var self = this - axios.get(self.url + 'app/newscontent/listpagenewscontentrelease', { + axios.get(self.url + 'app/newscontent/listpagenewscontentrelease/' + common.area.areaCode, { params: self.literaturePage }).then(function (res) { for (var i = 0; i < res.data.rows.length; i++) { diff --git a/src/pages/Resource/Resource.vue b/src/pages/Resource/Resource.vue index 03e87e9..6b1bc57 100644 --- a/src/pages/Resource/Resource.vue +++ b/src/pages/Resource/Resource.vue @@ -144,7 +144,7 @@ export default { }, getList: function () { var self = this - axios.get(self.url + 'app/newscontent/listpagenewscontentrelease', { + axios.get(self.url + 'app/newscontent/listpagenewscontentrelease/' + common.area.areaCode, { params: self.page }).then(function (res) { for (var i = 0; i < res.data.rows.length; i++) { diff --git a/src/pages/SearchList/SearchList.vue b/src/pages/SearchList/SearchList.vue index 3e21ca3..a17719d 100644 --- a/src/pages/SearchList/SearchList.vue +++ b/src/pages/SearchList/SearchList.vue @@ -290,7 +290,7 @@ export default { // 查询场馆 searchVenue: function () { var self = this - axios.get(self.url + 'app/venuesinfo/listpagevenuesinforelease', { + axios.get(self.url + 'app/venuesinfo/listpagevenuesinforelease/' + common.area.areaCode, { params: self.page }).then(function (res) { self.pageList = res.data.rows @@ -301,7 +301,7 @@ export default { // 查询活动 searchActivity: function () { var self = this - axios.get(self.url + 'app/activitylibrary/listpageactivitylibraryfornetrelease', { + axios.get(self.url + 'app/activitylibrary/listpageactivitylibraryfornetrelease/' + common.area.areaCode, { params: self.page }).then(function (res) { self.pageList = res.data.rows @@ -326,7 +326,7 @@ export default { // 查询文化动态 searchDynamic: function () { var self = this - axios.get(self.url + 'app/newscontent/listpagenewscontentrelease', { + axios.get(self.url + 'app/newscontent/listpagenewscontentrelease/' + common.area.areaCode, { params: { page: self.page.page, rows: self.page.rows, @@ -349,7 +349,7 @@ export default { // 查询艺术培训 searchArt: function () { var self = this - axios.get(self.url + 'app/newscontent/listpagenewscontentrelease', { + axios.get(self.url + 'app/newscontent/listpagenewscontentrelease/' + common.area.areaCode, { params: { page: self.page.page, rows: self.page.rows, @@ -379,7 +379,7 @@ export default { // 查询展览展示 searchExhibition: function () { var self = this - axios.get(self.url + 'app/newscontent/listpagenewscontentrelease', { + axios.get(self.url + 'app/newscontent/listpagenewscontentrelease/' + common.area.areaCode, { params: { page: self.page.page, rows: self.page.rows, @@ -398,7 +398,7 @@ export default { // 查询文化旅游 searchTravel: function () { var self = this - axios.get(self.url + 'app/newscontent/listpagenewscontentrelease', { + axios.get(self.url + 'app/newscontent/listpagenewscontentrelease/' + common.area.areaCode, { params: { page: self.page.page, rows: self.page.rows, diff --git a/src/pages/SearchResult/SearchResult.vue b/src/pages/SearchResult/SearchResult.vue index 4c3bc79..c1f1762 100644 --- a/src/pages/SearchResult/SearchResult.vue +++ b/src/pages/SearchResult/SearchResult.vue @@ -285,7 +285,7 @@ export default { // 查询场馆 searchVenue: function () { var self = this - axios.get(self.url + 'app/venuesinfo/listpagevenuesinforelease', { + axios.get(self.url + 'app/venuesinfo/listpagevenuesinforelease/' + common.area.areaCode, { params: self.page }).then(function (res) { self.venueList = res.data.rows @@ -295,7 +295,7 @@ export default { // 查询活动 searchActivity: function () { var self = this - axios.get(self.url + 'app/activitylibrary/listpageactivitylibraryfornetrelease', { + axios.get(self.url + 'app/activitylibrary/listpageactivitylibraryfornetrelease/' + common.area.areaCode, { params: self.page }).then(function (res) { self.activityList = res.data.rows @@ -318,7 +318,7 @@ export default { // 查询文化动态 searchDynamic: function () { var self = this - axios.get(self.url + 'app/newscontent/listpagenewscontentrelease', { + axios.get(self.url + 'app/newscontent/listpagenewscontentrelease/' + common.area.areaCode, { params: { page: 1, rows: 4, @@ -345,7 +345,7 @@ export default { // 查询艺术培训 searchArt: function () { var self = this - axios.get(self.url + 'app/newscontent/listpagenewscontentrelease', { + axios.get(self.url + 'app/newscontent/listpagenewscontentrelease/' + common.area.areaCode, { params: { page: 1, rows: 4, @@ -363,7 +363,7 @@ export default { // 查询数图资源 searchLiterature: function () { var self = this - axios.get(self.url + 'app/newscontent/listpagenewscontentrelease', { + axios.get(self.url + 'app/newscontent/listpagenewscontentrelease/' + common.area.areaCode, { params: { page: 1, rows: 4, @@ -383,7 +383,7 @@ export default { // 查询展览展示 searchExhibition: function () { var self = this - axios.get(self.url + 'app/newscontent/listpagenewscontentrelease', { + axios.get(self.url + 'app/newscontent/listpagenewscontentrelease/' + common.area.areaCode, { params: { page: 1, rows: 8, @@ -402,7 +402,7 @@ export default { // 查询文化旅游 searchTravel: function () { var self = this - axios.get(self.url + 'app/newscontent/listpagenewscontentrelease', { + axios.get(self.url + 'app/newscontent/listpagenewscontentrelease/' + common.area.areaCode, { params: { page: 1, rows: 4, diff --git a/src/pages/Travel/Travel.vue b/src/pages/Travel/Travel.vue index c06d0a2..316296f 100644 --- a/src/pages/Travel/Travel.vue +++ b/src/pages/Travel/Travel.vue @@ -100,7 +100,7 @@ export default { getTravelList: function () { var self = this self.isLoading = true - axios.get(self.url + 'app/newscontent/listpagenewscontentrelease', { + axios.get(self.url + 'app/newscontent/listpagenewscontentrelease/' + common.area.areaCode, { params: self.page }).then(function (res) { for (var i = 0; i < res.data.rows.length; i++) {