diff --git a/api/index.js b/api/index.js new file mode 100644 index 0000000..655978b --- /dev/null +++ b/api/index.js @@ -0,0 +1,7 @@ +const request = require('../utils/request') + /** + * 获取欢迎页信息 + */ + export function getStartupPage () { + return request.get('startup/getStartupPage') +} \ No newline at end of file diff --git a/app.json b/app.json index d4a9e25..d0ce9ac 100644 --- a/app.json +++ b/app.json @@ -25,7 +25,8 @@ "pages/notice/notice", "pages/info/info", "pages/noticeDetail/noticeDetail", - "pages/newsDetail/newsDetail" + "pages/newsDetail/newsDetail", + "pages/newsList/newsList" ] }, { diff --git a/app.wxss b/app.wxss index 4573037..603e336 100644 --- a/app.wxss +++ b/app.wxss @@ -4,12 +4,6 @@ page { height: 100%; - display: flex; - /* flex-direction: column; - box-sizing: border-box; */ - background: #f7f7f7; - position: relative; - z-index: 9999998; } .card { display: flex; diff --git a/components/navbar/index.js b/components/navbar/index.js index 18e9620..27d1998 100644 --- a/components/navbar/index.js +++ b/components/navbar/index.js @@ -31,7 +31,7 @@ Component({ }, //返回到首页 _backhome() { - wx.switchTab({ + wx.navigateTo({ url: '/pages/indexNew/indexNew', }) } diff --git a/pages/complete/complete.wxml b/pages/complete/complete.wxml index 16e42fd..742544e 100644 --- a/pages/complete/complete.wxml +++ b/pages/complete/complete.wxml @@ -73,14 +73,14 @@ - + - + *请填写您的真实信息,我们会严格保密,请您放心 diff --git a/pages/indexNew/indexNew.js b/pages/indexNew/indexNew.js index 0bfd93e..e71b3d9 100644 --- a/pages/indexNew/indexNew.js +++ b/pages/indexNew/indexNew.js @@ -405,6 +405,7 @@ Page({ }, //拨打电话 getPhone(e) { + return false wx.showModal({ title: '拨打电话', content: `您确定拨打${e.currentTarget.dataset.number}`, diff --git a/pages/indexNew/indexNew.wxml b/pages/indexNew/indexNew.wxml index 20db117..965eea4 100644 --- a/pages/indexNew/indexNew.wxml +++ b/pages/indexNew/indexNew.wxml @@ -78,7 +78,7 @@ - 83312345 + diff --git a/pages/start/start.js b/pages/start/start.js index 9a16879..5441859 100644 --- a/pages/start/start.js +++ b/pages/start/start.js @@ -1,109 +1,78 @@ -// pages/start/start.js -Page({ +const app = getApp() +import { getStartupPage } from '../../api/index' - /** - * 页面的初始数据 - */ +Page({ data: { - countDownNum: 5, - close: false + deviceHeight: 0, + countdownNum: 0, + bgImage: '', + timer: '', + scene: '' }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function(options) { - this.settime() - this.countDown() - }, - - countDown: function() { - let that = this; - let countDownNum = that.data.countDownNum; //获取倒计时初始值 - //如果将定时器设置在外面,那么用户就看不到countDownNum的数值动态变化,所以要把定时器存进data里面 - that.setData({ - timer: setInterval(function() { //这里把setInterval赋值给变量名为timer的变量 - //每隔一秒countDownNum就减一,实现同步 - countDownNum--; - //然后把countDownNum存进data,好让用户知道时间在倒计着 - that.setData({ - countDownNum: countDownNum - }) - //在倒计时还未到0时,这中间可以做其他的事情,按项目需求来 - if (countDownNum == 0) { - //这里特别要注意,计时器是始终一直在走的,如果你的时间为0,那么就要关掉定时器!不然相当耗性能 - //因为timer是存在data里面的,所以在关掉时,也要在data里取出后再关闭 - clearInterval(that.data.timer); - //关闭定时器之后,可作其他处理codes go here - } - }, 1000) + onLoad (options) { + if (options.scene) { + this.data.scene = options.scene + } + this.setData({ + deviceHeight: app.globalData.height }) + this.getStartupPage() }, - - settime: function() { - let that = this - setTimeout(function() { - if (!that.data.close) { - wx.redirectTo({ - url: `../indexNew/indexNew` + // 倒计时进入 + countDown () { + this.data.timer = setInterval(() => { + if (this.data.countdownNum > 1) { + this.data.countdownNum-- + this.setData({ + countdownNum: this.data.countdownNum }) + } else { + clearInterval(this.data.timer) + if (this.data.scene) { + wx.reLaunch({ + url: `/pages/indexNew/indexNew?scene=${this.data.scene}` + }) + } else { + wx.reLaunch({ + url: '/pages/indexNew/indexNew' + }) + } } - }, 5000) + }, 1000) }, - bindGetUserInfo: function(e) { - this.setData({ - close: true + // 立即进入 + immeEnter () { + clearInterval(this.data.timer) + if (this.data.scene) { + wx.reLaunch({ + url: `/pages/indexNew/indexNew?scene=${this.data.scene}` + }) + } else { + wx.reLaunch({ + url: '/pages/indexNew/indexNew' + }) + } + }, + // 获取启动页信息 + getStartupPage () { + wx.showLoading({ + title: '获取中...' }) - wx.redirectTo({ - url: `../indexNew/indexNew` + getStartupPage().then(res => { + wx.hideLoading() + console.log('获取启动页信息', res) + if (res.data.imgUrl) { + this.setData({ + bgImage: res.data.imgUrl, + countdownNum: res.data.duration + }) + this.countDown() + } else { + this.immeEnter() + } + }).catch(err => { + wx.hideLoading() + this.immeEnter() }) - }, - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady: function() { - - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow: function() { - - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function() { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function() { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh: function() { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function() { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function() { - } }) \ No newline at end of file diff --git a/pages/start/start.json b/pages/start/start.json index 9bd8876..37f535b 100644 --- a/pages/start/start.json +++ b/pages/start/start.json @@ -1,6 +1,4 @@ { - "navigationBarTitleText": "e锦水", - "navigationStyle": "custom", - "navigationBarTextStyle": "black", - "usingComponents": {} + "navigationBarTitleText": "欢迎页", + "navigationStyle": "custom" } \ No newline at end of file diff --git a/pages/start/start.wxml b/pages/start/start.wxml index 9eb0311..4b085c3 100644 --- a/pages/start/start.wxml +++ b/pages/start/start.wxml @@ -1,17 +1,16 @@ - - - - + + + - - - - - {{countDownNum}}s - - - 跳过 - + + + + {{countdownNum}}s | 跳过 + + + \ No newline at end of file diff --git a/pages/start/start.wxss b/pages/start/start.wxss index 2dc81d2..c4320e7 100644 --- a/pages/start/start.wxss +++ b/pages/start/start.wxss @@ -1,65 +1,81 @@ -.page { +page { width: 100%; - height: 100%; - position: relative; - top: 0; - left: 0; - z-index: 1000; + height: 100vh; } - -.image-one { - position: absolute; +.welcome { width: 100%; - height: 100%; + height: 100vh; + background: #fff; + position: relative; + overflow: hidden; } - -.logo-style { +.welcome .bg-img { width: 100%; - height: 220rpx; - margin-top: 455rpx; + height: 100vh; position: absolute; - display: flex; - justify-content: center; + left: 0; + top: 0; } - -.logo-style .image-two { - height: 220rpx; - width: 500rpx; +.welcome .bg-img image { + width: 100%; + height:100%; } -.time { - margin-top: 170rpx; - position: absolute; - width: calc(100% - 28rpx); - height: 60rpx; +.welcome .content { + width: 100%; + position: relative; + z-index: 10; display: flex; - flex-direction: row-reverse; + flex-direction: column; + justify-content: space-between; align-items: center; + box-sizing: border-box; + padding-bottom: 100rpx; } - -.time .time-info { - width: 150rpx; - height: 60rpx; - border-radius: 30rpx; - background: #fff; - opacity: 0.6; +.welcome .content .countdown { + width: 100%; + height: 50rpx; display: flex; - align-items: center; + align-items: flex-start; + justify-content: flex-end; + box-sizing: border-box; + padding: 0 20rpx; } - -.time .time-info .left { - width: 50%; - height: 40rpx; - line-height: 40rpx; - font-size: 30rpx; +.welcome .content .countdown .time { + font-size: 28rpx; + color: #333; + width: 150rpx; + height: 50rpx; + line-height: 50rpx; text-align: center; - border-right: 1rpx solid black; + background: rgba(255,255,255,0.5); + border-radius: 30rpx; +} +.welcome .content .countdown .hover-skip { + background: rgba(255,255,255,0.2); } -.time .time-info .right { - width: 50%; - height: 40rpx; - line-height: 40rpx; - font-size: 25rpx; - text-align: center; +.imme-enter { + width: 100%; + height: 84rpx; + display: flex; + align-items: center; + justify-content: center; +} +.imme-enter button { + background-image: linear-gradient(to right , #ff2d29, #ff4e4e); + height:84rpx; + line-height: 84rpx; + text-align:center; + color: #fff; + font-size: 36rpx; + border-radius: 16rpx; + padding: 0; + margin: 0; + outline: 0; + font-weight: normal; + width: 560rpx; } +.imme-enter .hover-btn { + background: red; +} \ No newline at end of file diff --git a/pages/toRegister/toRegister.js b/pages/toRegister/toRegister.js index 776bf97..bab127a 100644 --- a/pages/toRegister/toRegister.js +++ b/pages/toRegister/toRegister.js @@ -21,7 +21,7 @@ Page({ } }) let that = this - const versionNum = '1.0.2' + const versionNum = '1.0.3' api.getScanSwitch(versionNum).then(function (res) { console.log(res.data) let state = res.data.scanFlag diff --git a/subpages/association/pages/associationDetail/associationDetail.js b/subpages/association/pages/associationDetail/associationDetail.js index 21eaa80..78e2cab 100644 --- a/subpages/association/pages/associationDetail/associationDetail.js +++ b/subpages/association/pages/associationDetail/associationDetail.js @@ -255,7 +255,7 @@ Page({ icon: 'none', duration: 2000 }) - wx.switchTab({ + wx.navigateTo({ url: '/pages/association/association' }) }).catch(err => { diff --git a/subpages/association/pages/createassociation/createassociation.js b/subpages/association/pages/createassociation/createassociation.js index 5a3fa66..4c274a6 100644 --- a/subpages/association/pages/createassociation/createassociation.js +++ b/subpages/association/pages/createassociation/createassociation.js @@ -182,13 +182,13 @@ Page({ }, // 关闭弹框 closeDialog () { - wx.switchTab({ + wx.navigateTo({ url: '/pages/association/association' }) }, // 弹框确定按钮 confirmDialog () { - wx.switchTab({ + wx.navigateTo({ url: '/pages/association/association' }) } diff --git a/subpages/discussion/pages/addIssue/addIssue.js b/subpages/discussion/pages/addIssue/addIssue.js index 259f97b..f968aab 100644 --- a/subpages/discussion/pages/addIssue/addIssue.js +++ b/subpages/discussion/pages/addIssue/addIssue.js @@ -244,8 +244,11 @@ Page({ }, // 知道了 确认按钮 confirmDialog () { - wx.switchTab({ - url: '/pages/discussion/discussion' + // wx.redirectTo({ + // url: '/pages/discussion/discussion' + // }) + wx.navigateBack({ + delta: 1 }) } }) \ No newline at end of file diff --git a/subpages/discussion/pages/discussionDetail/components/detailContent/detailContent.wxss b/subpages/discussion/pages/discussionDetail/components/detailContent/detailContent.wxss index fabfa73..51c571c 100644 --- a/subpages/discussion/pages/discussionDetail/components/detailContent/detailContent.wxss +++ b/subpages/discussion/pages/discussionDetail/components/detailContent/detailContent.wxss @@ -98,7 +98,7 @@ margin-bottom: 105rpx; } .detail-content .altitude .normal { - width: calc(50% - 17.5rpx); + width: calc(50% - 17rpx); height: 84rpx; border: 1rpx solid #B8B8B8; border-radius: 42rpx; diff --git a/subpages/discussion/pages/publishEvaluation/components/evaluationCallback/evaluationCallback.js b/subpages/discussion/pages/publishEvaluation/components/evaluationCallback/evaluationCallback.js index 4667c2b..f07ea77 100644 --- a/subpages/discussion/pages/publishEvaluation/components/evaluationCallback/evaluationCallback.js +++ b/subpages/discussion/pages/publishEvaluation/components/evaluationCallback/evaluationCallback.js @@ -30,7 +30,7 @@ Component({ }, methods: { backDiscussion () { - wx.switchTab({ + wx.navigateTo({ url: '/pages/discussion/discussion' }) }, diff --git a/subpages/home/pages/newsList/newsList.js b/subpages/home/pages/newsList/newsList.js new file mode 100644 index 0000000..4beae49 --- /dev/null +++ b/subpages/home/pages/newsList/newsList.js @@ -0,0 +1,43 @@ +const api = require('../../../../utils/api') +import { getTimestamp } from '../../../../utils/common' +Page({ + data: { + loadMoreType: 'none', + loadMoreVisible: false, + newsList: [], + pageNo: 1, + pageSize: 10, + }, + onLoad () { + this.getNewsList() + }, + onReachBottom () { + this.setData({ + loadMoreVisible: true + }) + if (this.data.loadMoreType === 'loading') { + this.data.pageNo += 1 + this.getNewsList() + } + }, + getNewsList: function() { + let that = this + let para = { + pageIndex: this.data.pageNo, + pageSize: this.data.pageSize, + timestamp: getTimestamp() + } + api.newsList(para).then(function(res) { + that.setData({ + first: false, + newsList: that.data.newsList.concat(res.data), + loadMoreType: res.data.length === that.data.pageSize ? 'loading' : 'none', + }) + }).catch(() => { + that.setData({ + loadMoreType: 'none', + newsList: [] + }) + }) + }, +}) \ No newline at end of file diff --git a/subpages/home/pages/newsList/newsList.json b/subpages/home/pages/newsList/newsList.json new file mode 100644 index 0000000..91d27c4 --- /dev/null +++ b/subpages/home/pages/newsList/newsList.json @@ -0,0 +1,6 @@ +{ + "navigationBarTitleText": "新闻列表", + "usingComponents": { + "load-more": "../../../../components/loadMore/loadMore" + } +} \ No newline at end of file diff --git a/subpages/home/pages/newsList/newsList.wxml b/subpages/home/pages/newsList/newsList.wxml new file mode 100644 index 0000000..fe3af52 --- /dev/null +++ b/subpages/home/pages/newsList/newsList.wxml @@ -0,0 +1,16 @@ + + + + {{item.newsTitle}} + + + {{item.deptName}}-{{item.newsCategoryName}} + {{filter.formatTime(item.newsStartTime, 'yyyy-MM-dd')}} + + + + + + + + diff --git a/subpages/home/pages/newsList/newsList.wxss b/subpages/home/pages/newsList/newsList.wxss new file mode 100644 index 0000000..20b1eba --- /dev/null +++ b/subpages/home/pages/newsList/newsList.wxss @@ -0,0 +1,64 @@ +page { + width: 100%; + height: auto; + background: #fff; + min-height: 100vh; + overflow-y: auto; +} +/* 列表样式 */ +.list-all { + width: calc(100% - 48rpx); + margin-left: 21rpx; +} + +.list-all .list-item { + border-bottom: 1rpx solid #eaeaea; + padding: 41rpx 18rpx 31rpx 15rpx; + display: flex; + align-items: center; +} + +.list-all .list-item:last-child { + border: none; +} + +.list-all .list-item .item-info { + width: calc(100% - 220rpx); + height: 146rpx; + position: relative; +} + +.list-all .list-item .item-info .item-info-name { + width: calc(100% - 47rpx); + font-size: 32rpx; + font-weight: 500; + color: rgba(63, 63, 63, 1); + line-height: 50rpx; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + overflow: hidden; +} + +.list-all .list-item .item-info .item-info-time { + width: calc(100% - 23rpx); + height: 22rpx; + position: absolute; + bottom: 5rpx; + display: flex; + flex-direction: row; + justify-content: space-between; +} + +.list-all .list-item .item-info .item-info-time text { + font-size: 22rpx; + font-weight: 500; + color: rgba(170, 170, 170, 1); + line-height: 22rpx; +} + +.list-all .list-item image { + width: 220rpx; + height: 146rpx; + border-radius: 10rpx; +} \ No newline at end of file diff --git a/utils/config.js b/utils/config.js index 1c1be4b..b705e92 100644 --- a/utils/config.js +++ b/utils/config.js @@ -6,12 +6,13 @@ module.exports = { }; function BASEURL() { + // return 'https://eug-test.elinkit.com.cn/js/epdc-api/api/' // 锦水测试环境 // return 'https://eug-test.elinkit.com.cn/epdc-api/api/' // 测试环境 接口地址 // return "http://219.146.91.110:9094/epdc-api/api/" // 测试环境 ip接口地址 // return "https://epdc.elinkservice.cn/epdc-api/api/" // 正式环境 接口地址 // return 'https://epdc-app.qingdaoshibei.cn/epdc-api/api/' // 电政办 正式环境 接口地址 // return 'https://epdc-shibei.elinkservice.cn/epdc-api/api/' // 电政办 正式环境 接口地址 - return 'https://epdc-jinshui.elinkservice.cn/epdc-api/api/' // 锦水接口地址 + return 'https://epdc-jinshui.elinkservice.cn/epdc-api/api/' // 锦水正式环境接口地址 } function WEBROOT() {