Browse Source

1.0.3版本 增加启动页 首页改版

master tagv1.0.3
lihenian 5 years ago
parent
commit
4db6f57eb3
  1. 7
      api/index.js
  2. 3
      app.json
  3. 6
      app.wxss
  4. 2
      components/navbar/index.js
  5. 6
      pages/complete/complete.wxml
  6. 1
      pages/indexNew/indexNew.js
  7. 2
      pages/indexNew/indexNew.wxml
  8. 163
      pages/start/start.js
  9. 6
      pages/start/start.json
  10. 25
      pages/start/start.wxml
  11. 110
      pages/start/start.wxss
  12. 2
      pages/toRegister/toRegister.js
  13. 2
      subpages/association/pages/associationDetail/associationDetail.js
  14. 4
      subpages/association/pages/createassociation/createassociation.js
  15. 7
      subpages/discussion/pages/addIssue/addIssue.js
  16. 2
      subpages/discussion/pages/discussionDetail/components/detailContent/detailContent.wxss
  17. 2
      subpages/discussion/pages/publishEvaluation/components/evaluationCallback/evaluationCallback.js
  18. 43
      subpages/home/pages/newsList/newsList.js
  19. 6
      subpages/home/pages/newsList/newsList.json
  20. 16
      subpages/home/pages/newsList/newsList.wxml
  21. 64
      subpages/home/pages/newsList/newsList.wxss
  22. 3
      utils/config.js

7
api/index.js

@ -0,0 +1,7 @@
const request = require('../utils/request')
/**
* 获取欢迎页信息
*/
export function getStartupPage () {
return request.get('startup/getStartupPage')
}

3
app.json

@ -25,7 +25,8 @@
"pages/notice/notice",
"pages/info/info",
"pages/noticeDetail/noticeDetail",
"pages/newsDetail/newsDetail"
"pages/newsDetail/newsDetail",
"pages/newsList/newsList"
]
},
{

6
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;

2
components/navbar/index.js

@ -31,7 +31,7 @@ Component({
},
//返回到首页
_backhome() {
wx.switchTab({
wx.navigateTo({
url: '/pages/indexNew/indexNew',
})
}

6
pages/complete/complete.wxml

@ -73,14 +73,14 @@
</view>
<view class="content">
<wux-cell hover-class="none">
<wux-input placeholder="*什么路几号(如南宁路168号)" controlled value="{{street}}" bind:change="adInputStreet"></wux-input>
<wux-input placeholder="*请填写所在小区" controlled value="{{street}}" bind:change="adInputStreet"></wux-input>
</wux-cell>
<wux-cell hover-class="none">
<!-- <wux-cell hover-class="none">
<wux-input placeholder="小区名称" controlled value="{{community}}" bind:change="adInputCommunity"></wux-input>
</wux-cell>
<wux-cell hover-class="none">
<wux-input placeholder="楼栋号-单元室(如5号楼701)" controlled value="{{building}}" bind:change="adInputBuilding"></wux-input>
</wux-cell>
</wux-cell> -->
</view>
</view>
<view class="tap">*请填写您的真实信息,我们会严格保密,请您放心</view>

1
pages/indexNew/indexNew.js

@ -405,6 +405,7 @@ Page({
},
//拨打电话
getPhone(e) {
return false
wx.showModal({
title: '拨打电话',
content: `您确定拨打${e.currentTarget.dataset.number}`,

2
pages/indexNew/indexNew.wxml

@ -78,7 +78,7 @@
<view class="newnotice" bindtap="getPhone" data-number="83312345">
<image class="image1" src="https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/06/rBAB7161AOiAXVKcAAAUoqwAWew587.png"></image>
<image class="image2" src="https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/06/rBAB7161AbyAfYVeAAAdNklNbvM579.png"></image>
<text>83312345</text>
<text></text>
</view>
<!-- 我有话说 -->

163
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() {
}
})

6
pages/start/start.json

@ -1,6 +1,4 @@
{
"navigationBarTitleText": "e锦水",
"navigationStyle": "custom",
"navigationBarTextStyle": "black",
"usingComponents": {}
"navigationBarTitleText": "欢迎页",
"navigationStyle": "custom"
}

25
pages/start/start.wxml

@ -1,17 +1,16 @@
<view class="page">
<image class="image-one" src="https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/05/rBAB716njY2ADRNbAAX8Nk6dBkI229.png" mode="scaleToFill"></image>
<view class="logo-style">
<image class="image-two" src="https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/05/rBAB716njbGAMRwZAAFzEo6DMTQ932.png" mode="scaleToFill"></image>
<view class="welcome">
<view class="bg-img">
<image class="bgimg" src="{{bgImage}}"/>
</view>
<view class="time">
<view class="time-info" bindtap="bindGetUserInfo">
<view class="left">
{{countDownNum}}s
</view>
<view class="right">
跳过
</view>
<view class="content" style="height: calc(100vh - {{deviceHeight}}px - 100rpx); top: calc({{deviceHeight}}px + 100rpx)">
<view class="countdown" wx:if="countdownNum > 0">
<view bindtap="immeEnter" hover-class="hover-skip" class="time">{{countdownNum}}s | 跳过</view>
</view>
<!-- <view class="imme-enter">
<button hover-class="hover-btn" bindtap="immeEnter">立即进入</button>
</view> -->
</view>
</view>

110
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;
}

2
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

2
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 => {

4
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'
})
}

7
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
})
}
})

2
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;

2
subpages/discussion/pages/publishEvaluation/components/evaluationCallback/evaluationCallback.js

@ -30,7 +30,7 @@ Component({
},
methods: {
backDiscussion () {
wx.switchTab({
wx.navigateTo({
url: '/pages/discussion/discussion'
})
},

43
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: []
})
})
},
})

6
subpages/home/pages/newsList/newsList.json

@ -0,0 +1,6 @@
{
"navigationBarTitleText": "新闻列表",
"usingComponents": {
"load-more": "../../../../components/loadMore/loadMore"
}
}

16
subpages/home/pages/newsList/newsList.wxml

@ -0,0 +1,16 @@
<view class="list-all">
<view class="list-item" wx:for-index="index" wx:for-item="item" wx:key="index" wx:for="{{newsList}}" data-id="{{item.id}}" bindtap="toDetail">
<view class="item-info">
<view class="item-info-name">{{item.newsTitle}}
</view>
<view class="item-info-time">
<text>{{item.deptName}}-{{item.newsCategoryName}}</text>
<text>{{filter.formatTime(item.newsStartTime, 'yyyy-MM-dd')}}</text>
</view>
</view>
<image src="{{item.newsImageUrl}}"></image>
</view>
</view>
<load-more loadMoreType="{{loadMoreType}}" loadMoreVisible="{{loadMoreVisible}}"></load-more>

64
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;
}

3
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() {

Loading…
Cancel
Save