diff --git a/config/api.js b/config/api.js index 2fb6ac6..2333e61 100644 --- a/config/api.js +++ b/config/api.js @@ -18,7 +18,9 @@ let api = { "app/newscontent/listpagenewscontentrelease", //获取新闻列表 newsDirectoriesId NEWS_MAIN_ID: "cadef8e1-1baf-4aec-a1b4-f002bd5e99f5", //新闻类型ID NEWS_BANNER_ID: "cb7cd502-ff00-4d58-83c1-c54c57add14c", + NEWS_MAIN_FUNC: "f367f74b-3778-4801-a0c5-b85377a12a0b", imgUrl: apiRoot + clinetNews + "route/file/download/true/", + getMainFunc: apiRoot + clinetNews + "app/newsdirectories/listnewsdirectoriesrelease", //获取首页功能 }, duty: { @@ -35,9 +37,9 @@ let api = { getUnitSignInfo: apiRoot + clinetDuty + "app/activity-join-company/get/", getMineSignInfo: apiRoot + clinetDuty + "app/activity-join/get/", getMineReportList: apiRoot + clinetDuty + 'app/activity-report/listpage', - doSaveActivityReport: apiRoot + clinetDuty + 'app/activity-report/save', + doSaveActivityReport: apiRoot + clinetDuty + 'app/activity-report/save', doEditActivityReport: apiRoot + clinetDuty + 'app/activity-report/updateactivityreport/', - getActivityReportDetail: apiRoot + clinetDuty + 'app/activity-report/get/', + getActivityReportDetail: apiRoot + clinetDuty + 'app/activity-report/get/', doDelActivityReport: apiRoot + clinetDuty + 'app/activity-report/remove/', }, article: { diff --git a/pages.json b/pages.json index dab509a..8e11122 100644 --- a/pages.json +++ b/pages.json @@ -226,6 +226,27 @@ "enablePullDownRefresh": false } + }, { + "path": "pages/news/oldtrees", + "style": { + "navigationBarTitleText": "古树名木", + "enablePullDownRefresh": false + } + + }, { + "path": "pages/news/newsList", + "style": { + "navigationBarTitleText": "新闻", + "enablePullDownRefresh": false + } + + }, { + "path": "pages/news/newsweb", + "style": { + "navigationBarTitleText": "新闻", + "enablePullDownRefresh": false + } + } ], "globalStyle": { diff --git a/pages/duty/activitydetail.vue b/pages/duty/activitydetail.vue index c5e22da..659e485 100644 --- a/pages/duty/activitydetail.vue +++ b/pages/duty/activitydetail.vue @@ -10,7 +10,7 @@ {{bean.status}} {{bean.name}} - + 参加人数:{{bean.joinedCount}}/{{bean.joinCount}} @@ -95,13 +95,13 @@ {{bean.startTime}} - + (一) 活动时间:{{bean.startTime}} @@ -120,23 +120,29 @@ (四) 活动主题:{{bean.theme}} - + + - (七)宣传内容 + (五)宣传内容 - - - - - - + + + + + + + + + + + + @@ -165,7 +171,8 @@ canJoin: false, token: '', mineSignInfo: {}, - uniSignInfo: {} + uniSignInfo: {}, + isRefresh: false, } }, onLoad(res) { @@ -190,6 +197,12 @@ } }, + onShow() { + if (this.isRefresh) { + this.isRefresh = false; + this.getActivityDetail() + } + }, methods: { closePage() { uni.navigateBack() @@ -216,13 +229,15 @@ var mark = { latitude: this.bean.latitude, longitude: this.bean.longitude, - iconPath: '/static/images/ic_location_mark.png' + iconPath: '/static/images/ic_location_marker.png' }; + this.latitude = this.bean.latitude; + this.longitude = this.bean.longitude; this.canJoin = '已发布' == this.bean.status || '报名中' == this.bean.status; this.covers.push(mark); this.covers = this.covers; } - console.log(this.bean) + console.log(this.covers) }, fail: res => { this.showPageLoading = false @@ -314,6 +329,12 @@ uni.hideLoading() } }); + }, + showImg(url) { + var u = this.imgUrl + url; + uni.previewImage({ + urls: [u] + }) } } } diff --git a/pages/duty/activitysign.vue b/pages/duty/activitysign.vue index f336fe1..b32c74d 100644 --- a/pages/duty/activitysign.vue +++ b/pages/duty/activitysign.vue @@ -2,7 +2,7 @@ - + 报名类型 @@ -279,6 +279,9 @@ title: "报名成功", success() { setTimeout(function() { + let pages = getCurrentPages(); // 当前页面 + let beforePage = pages[pages.length - 2]; // 前一个页面 + beforePage.$vm.isRefresh = true; uni.navigateBack() }, 1000) } @@ -287,8 +290,19 @@ } } }, - fail: res => { - + fail: res => { + console.log(res) + if (res.data) { + uni.showToast({ + icon: 'error', + title: res.data.msg + }) + } else { + uni.showToast({ + icon: 'error', + title: '网络错误' + }) + } }, complete: res => { uni.hideLoading() diff --git a/pages/duty/casereportdetail.vue b/pages/duty/casereportdetail.vue index b2446c6..f34ce38 100644 --- a/pages/duty/casereportdetail.vue +++ b/pages/duty/casereportdetail.vue @@ -66,7 +66,7 @@ - + @@ -75,7 +75,7 @@ 视频 + style="width: 120rpx;height: 120rpx;"> @@ -139,7 +139,9 @@ onShow() { if (this.isRefresh) { this.isRefresh = false; - this.showPageLoading = true; + this.showPageLoading = true; + _self.videoId = "" + _self.videoSrc = "" this.getDetailData(); } }, diff --git a/pages/news/index.vue b/pages/news/index.vue index fdc848d..e456593 100644 --- a/pages/news/index.vue +++ b/pages/news/index.vue @@ -5,16 +5,18 @@ - - - - + + + + + + + 搜索 - 搜索 - + @@ -23,6 +25,21 @@ + + + + + 古树名木 + + + + + {{item.directoriesName}} + + + @@ -77,10 +94,12 @@ token: "", searchContent: "", baseurl: this.$api.common.baseUrl, + imgUrl: this.$api.common.imgUrl, upgradeType: 'pkg', //pkg 整包 wgt 升级包 upgradeContent: '', //更新内容 upgradeUrl: '', //更新地址 - + funcList: [], + fixedSearch: false, }; }, onShow() { @@ -119,6 +138,7 @@ this.getAppVersion() // #endif this.getBannerList(); + this.getMainFunc(); }, onPullDownRefresh() { @@ -153,6 +173,8 @@ }); this.scroller.resetUpScroll(); this.getBannerList(); + this.funcList = []; + this.getMainFunc(); }, /*加载数据*/ @@ -249,16 +271,17 @@ /*滚动时导航栏浮动*/ navFloatShow(scroller) { if (scroller) { - if (scroller.scrollTop > 60) { - if (!this.showNavFloat) { - this.showNavFloat = true; - } - } else { - if (this.showNavFloat) { - this.showNavFloat = false; - } + if (scroller.scrollTop > 40) { + if (!this.fixedSearch) { + this.fixedSearch = true; + } + } else { + if (this.fixedSearch) { + this.fixedSearch = false; + } } - } + } + }, /*菜单框展示*/ menuShow(value) { @@ -345,6 +368,44 @@ this.$alert("请输入关键字"); } this.refreshData() + }, + getMainFunc() { + // + var _self = this; + uni.request({ + url: _self.$api.news.getMainFunc, + data: { + directoriesParentId: _self.$api.news.NEWS_MAIN_FUNC + }, + success(res) { + if (res.statusCode == 200) { + _self.funcList = res.data + } + }, + fail(error) {} + }) + }, + //古树名木 + openTrees() { + uni.navigateTo({ + url: '/pages/news/oldtrees' + }) + }, + //打开其他 + openOther(item) { + //判断是跳详情还是列表 + if ('0' == item.directoriesView) { + uni.navigateTo({ + url: '/pages/news/newsweb?url=' + item.directoriesTarget2 + '&title=' + item + .directoriesName + }) + } else { + uni.navigateTo({ + url: '/pages/news/newsList?nId=' + item.newsDirectoriesId + '&title=' + item + .directoriesName + }) + } + } } }; @@ -643,4 +704,53 @@ color: #b3b3b3; } } + + .func-box { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + height: 80rpx; + width: 100%; + white-space: nowrap; + + + } + + .func-item { + display: inline-block; + text-align: center; + width: 160rpx; + height: 186rpx; + margin-right: 21rpx; + + &:last-child { + margin-right: 0rpx; + } + + image { + width: 60rpx; + height: 60rpx; + } + + .txt { + font-size: 28rpx; + color: #262626; + } + } + + .fixed-box { + position: fixed; + top: 0; + left: 0; + width: 100%; + padding-top: 40rpx; + background: #ffffff; + z-index: 10; + padding-bottom: 10rpx; + } + + .nofixed-box { + position: static; + } diff --git a/pages/news/newsList.vue b/pages/news/newsList.vue index 499dac8..16fd30a 100644 --- a/pages/news/newsList.vue +++ b/pages/news/newsList.vue @@ -89,7 +89,8 @@ showNoData: false, showPageLoading: true, showNavFloat: false, - navBarHeight: '' + navBarHeight: '', + newsId: '' }; }, onShow() { @@ -123,6 +124,10 @@ this.category_index = e.category_index; } // #endif + this.newsId = e.nId + uni.setNavigationBarTitle({ + title: e.title + }) this.getCategory(); }, onPullDownRefresh() { @@ -160,7 +165,7 @@ url: this.$api.news.getMainFun, method: 'GET', data: { - 'directoriesParentId': this.$api.news.NEWS_MAIN_TAB + 'directoriesParentId': this.newsId }, dataType: 'json', success: res => { @@ -171,6 +176,7 @@ nextIndex = nextIndex <= 0 ? 0 : nextIndex; this.scroll_category_id = `category_id-${nextIndex}`; //动画滚动,滚动至中心位置 } + console.log(this.scroll_category_id) } else { this.$alert(res.msg); } @@ -181,39 +187,37 @@ /*获取数据*/ getData() { - // this.$app.request({ - // url: this.$api.article.index, - // data: { - // category_id: this.category_id, - // page_index: this.scroller.num, - // page_size: this.scroller.size - // }, - // method: 'POST', - // dataType: 'json', - // success: res => { - // if (res.code == 0) { - // if (this.scroller.num == 1) { - // this.list = []; - // } - // if (this.slider.length == 0) { - // this.slider = res.data.slider; - // } - // this.list = this.list.concat(res.data.list); - // this.scroller.endByPage(res.data.list.length, res.data.page); - // this.showPageLoading = false; - // } else { - // this.scroller.endSuccess(); - // this.$alert(res.msg); - // } - // }, - // fail: res => { - // this.scroller.endErr(); - // }, - // complete: res => { - // uni.stopPullDownRefresh(); - // uni.hideLoading(); - // } - // }); + this.$app.request({ + url: this.$api.news.getNewsList, + data: { + newsDirectoriesId: this.category_id, + page: this.scroller.num, + rows: this.scroller.size, + keywords: this.searchContent + }, + method: 'GET', + dataType: 'json', + success: res => { + if (res.rows != undefined) { + if (this.scroller.num == 1) { + this.list = []; + } + this.list = this.list.concat(res.rows); + this.scroller.endBySize(res.rows.length, res.rows.total); + this.showPageLoading = false; + } else { + this.scroller.endSuccess(); + this.$alert(res.msg); + } + }, + fail: res => { + this.scroller.endErr(); + }, + complete: res => { + uni.stopPullDownRefresh(); + uni.hideLoading(); + } + }); }, /*切换导航*/ diff --git a/pages/news/newsweb.vue b/pages/news/newsweb.vue new file mode 100644 index 0000000..3f824ff --- /dev/null +++ b/pages/news/newsweb.vue @@ -0,0 +1,28 @@ + + + + + diff --git a/pages/news/oldtrees.vue b/pages/news/oldtrees.vue new file mode 100644 index 0000000..6163faf --- /dev/null +++ b/pages/news/oldtrees.vue @@ -0,0 +1,43 @@ + + + + + diff --git a/pages/user/index.vue b/pages/user/index.vue index 5befa78..4508b77 100644 --- a/pages/user/index.vue +++ b/pages/user/index.vue @@ -257,7 +257,6 @@ 'token': _self.token }, success(res) { - console.log(res) if (res) { getApp().globalData.userInfo = res; _self.userInfo = res @@ -322,7 +321,6 @@ }, dataType: 'json', success: res => { - console.log(res) if (res.total != undefined) { this.certifNum = res.total } diff --git a/pages/user/login.vue b/pages/user/login.vue index a69a091..a434bd9 100644 --- a/pages/user/login.vue +++ b/pages/user/login.vue @@ -18,8 +18,6 @@ 登录 - 忘记密码 - | 注册账户 diff --git a/static/images/ic_old_tree_icon.png b/static/images/ic_old_tree_icon.png new file mode 100755 index 0000000..51c7998 Binary files /dev/null and b/static/images/ic_old_tree_icon.png differ diff --git a/static/images/ic_static_1.jpg b/static/images/ic_static_1.jpg new file mode 100755 index 0000000..ea781c7 Binary files /dev/null and b/static/images/ic_static_1.jpg differ diff --git a/static/images/ic_static_2.png b/static/images/ic_static_2.png new file mode 100755 index 0000000..6ee0bb1 Binary files /dev/null and b/static/images/ic_static_2.png differ diff --git a/static/images/ic_static_3.png b/static/images/ic_static_3.png new file mode 100755 index 0000000..6ec1af9 Binary files /dev/null and b/static/images/ic_static_3.png differ diff --git a/static/images/ic_static_4.jpg b/static/images/ic_static_4.jpg new file mode 100755 index 0000000..22a0b97 Binary files /dev/null and b/static/images/ic_static_4.jpg differ