Browse Source

index on feature/index-and-welcome: f821f3c 启动页逻辑相关

master
zhaoyongnian 6 years ago
parent
commit
c4cbdd803f
  1. 8
      .vscode/settings.json
  2. 7
      app.js
  3. 52
      app.json
  4. 6
      jsconfig.json
  5. 378
      pages/indexNew/indexNew.js
  6. 8
      pages/indexNew/indexNew.json
  7. 94
      pages/indexNew/indexNew.wxml
  8. 411
      pages/indexNew/indexNew.wxss
  9. 46
      pages/start/start.js
  10. 26
      pages/start/start.wxml
  11. 86
      pages/start/start.wxss
  12. 2
      pages/toRegister/toRegister.js
  13. 8
      project.config.json
  14. 2705
      typings/wx.d.ts

8
.vscode/settings.json

@ -0,0 +1,8 @@
{
"files.associations": {
"*.cjson": "jsonc",
"*.wxss": "css",
"*.wxs": "javascript",
"*.wxml": "html"
}
}

7
app.js

@ -12,9 +12,12 @@ App({
//这个最初我是在组件中获取,但是出现了一个问题,当第一次进入小程序时导航栏会把 //这个最初我是在组件中获取,但是出现了一个问题,当第一次进入小程序时导航栏会把
//页面内容盖住一部分,当打开调试重新进入时就没有问题,这个问题弄得我是莫名其妙 //页面内容盖住一部分,当打开调试重新进入时就没有问题,这个问题弄得我是莫名其妙
//虽然最后解决了,但是花费了不少时间 //虽然最后解决了,但是花费了不少时间
const menuButtonInfo = wx.getMenuButtonBoundingClientRect()
wx.getSystemInfo({ wx.getSystemInfo({
success: (res) => { success: (res) => {
this.globalData.height = res.statusBarHeight this.globalData.height = res.statusBarHeight
this.globalData.deviceInfo.statusHeight = res.statusBarHeight
this.globalData.deviceInfo.navigationHeight = menuButtonInfo.height + (menuButtonInfo.top - res.statusBarHeight) * 2
} }
}) })
// 检查版本更新 // 检查版本更新
@ -43,5 +46,9 @@ App({
lordFlag: '' lordFlag: ''
}, },
previewImage: false, // 预览图片后会触发onShow,加个状态区分一下 previewImage: false, // 预览图片后会触发onShow,加个状态区分一下
deviceInfo: {
statusHeight: 20,
navigationHeight: 40
}
} }
}) })

52
app.json

@ -1,6 +1,7 @@
{ {
"pages": [ "pages": [
"pages/start/start", "pages/start/start",
"pages/indexNew/indexNew",
"pages/index/index", "pages/index/index",
"pages/mine/mine", "pages/mine/mine",
"pages/association/association", "pages/association/association",
@ -75,55 +76,30 @@
} }
], ],
"preloadRule": { "preloadRule": {
"pages/index/index": { "pages/indexNew/indexNew": {
"network": "all", "network": "all",
"packages": ["subpages/changegrid"] "packages": [
"subpages/changegrid"
]
}, },
"pages/discussion/discussion": { "pages/discussion/discussion": {
"network": "all", "network": "all",
"packages": ["discussion"] "packages": [
"discussion"
]
}, },
"pages/association/association": { "pages/association/association": {
"network": "all", "network": "all",
"packages": ["subpages/association"] "packages": [
"subpages/association"
]
}, },
"pages/mine/mine": { "pages/mine/mine": {
"network": "all", "network": "all",
"packages": ["mine"] "packages": [
"mine"
]
} }
},
"tabBar": {
"color": "#666666",
"selectedColor": "#FF0000",
"backgroundColor": "#FFFFFF",
"borderStyle": "white",
"list": [
{
"pagePath": "pages/index/index",
"text": "首页",
"iconPath": "images/home.png",
"selectedIconPath": "images/homeSelected.png"
},
{
"pagePath": "pages/discussion/discussion",
"text": "我有事说",
"iconPath": "images/discuss.png",
"selectedIconPath": "images/discussSelected.png"
},
{
"pagePath": "pages/association/association",
"text": "党群互动",
"iconPath": "images/association.png",
"selectedIconPath": "images/association-select.png"
},
{
"pagePath": "pages/mine/mine",
"text": "我的",
"iconPath": "images/mine.png",
"selectedIconPath": "images/mineSelected.png"
}
]
}, },
"window": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "light",

6
jsconfig.json

@ -0,0 +1,6 @@
{
"compilerOptions": {
"target": "es2015",
"module": "commonjs"
}
}

378
pages/indexNew/indexNew.js

@ -0,0 +1,378 @@
const app = getApp()
var api = require('../../utils/api.js')
var global = require('../../utils/config.js')
import {
getTimestamp
} from '../../utils/common'
Page({
data: {
first: true,
nomorenews: true,
departmentName: '',
options: {
autoplay: false,
circular: true,
interval: 3000,
duration: 100,
previousMargin: 50,
nextMargin: 0,
displayMultipleItems: 3,
currentSwiper: '',
},
options2: {
autoplay: false,
circular: true,
interval: 3000,
duration: 100,
previousMargin: 50,
nextMargin: 0,
displayMultipleItems: 3,
currentSwiper: '',
},
swiperBannerList: [],
swiperData: [{
headUrl: '',
linkType: 2,
name: '222'
},
{
headUrl: '',
linkType: 2,
name: '222'
}
],
fromScan: false,
gid: '',
nvabarData: {
showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
title: '精致锦水', //导航栏 中间的标题
},
height: app.globalData.height * 2 + 20,
infoObj: {
time: '',
title: '',
amount: ''
},
noticeList: [],
innerHtmlStatus: true,
visibilityStatus: true,
pageNo: 1,
pageSize: 10,
timestamp: getTimestamp(),
newsList: [],
issueList: [],
projectList: [],
colorList: ['#fdf6e3', '#e9ecf5', '#f7eedf', '#efd9cc', '#e1efff'],
statusHeight: 0, // 自定义头部状态栏高度
navigationHeight: 0, // 自定义头部导航栏高度
currentIndex: 0,
},
onShow: function() {
if (wx.getStorageSync('token') != '' && wx.getStorageSync('token') != undefined && wx.getStorageSync('token') != null) {
if (!this.data.first) {
this.getBannerList()
this.getFirstInfo()
this.getNoticeList()
this.getIssueList()
this.getProjectList()
this.setData({
pageNo: 1,
newsList: []
})
this.getNewsList()
}
}
},
onLoad: function(options) {
if (options.scene) {
this.setData({
statusHeight: app.globalData.deviceInfo.statusHeight,
navigationHeight: app.globalData.deviceInfo.navigationHeight,
gridId: options.scene
})
} else {
this.setData({
statusHeight: app.globalData.deviceInfo.statusHeight,
navigationHeight: app.globalData.deviceInfo.navigationHeight,
})
}
console.log('options:', options)
if (options.scene) {
this.setData({
gid: decodeURIComponent(options.scene)
})
}
let that = this
setTimeout(function() {
that.getUserState()
}, 700)
},
getBannerList: function() {
let that = this
api.bannerList('0').then(function(res) {
console.log('res==', res.data)
that.setData({
swiperBannerList: res.data
})
})
},
getProjectList() {
let that = this
let para = {
pageIndex: 1,
pageSize: 10,
searchContent: '',
timestamp: getTimestamp(),
categoryId: ''
}
api.getProjectList(para).then(function(res) {
that.setData({
projectList: res.data
})
console.log('newsList', that.data.newsList)
})
},
getIssueList() {
let that = this
let para = {
pageIndex: 1,
pageSize: 10,
searchContent: '',
orderType: '1',
timestamp: getTimestamp(),
categoryId: ''
}
api.getIssueList(para).then(function(res) {
that.setData({
issueList: res.data
})
console.log('newsList', that.data.newsList)
})
},
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)
})
if (res.data.length < that.data.pageSize) {
that.setData({
nomorenews: false
})
}
})
},
onReachBottom() {
if (this.data.nomorenews) {
console.log('加载翻页')
this.setData({
pageNo: this.data.pageNo + 1,
pageSize: this.data.pageSize,
pageIndex: getTimestamp()
})
this.getNewsList()
}
},
toDetail(e) {
wx.navigateTo({
url: '/subpages/home/pages/newsDetail/newsDetail?id=' + e.currentTarget.dataset.id
})
},
getFirstInfo: function() {
let that = this
api.getFirstInfo().then(function(res) {
console.log('infoObj', res.data)
if (res.data !== null) {
that.setData({
infoObj: res.data
})
}
console.log('zheli', that.data.infoObj)
})
},
getNoticeList: function() {
let para = {
pageIndex: 1,
pageSize: 10,
timestamp: getTimestamp()
}
let that = this
api.noticelist(para).then(function(res) {
console.log('infoObj', res.data)
if (res.data !== null) {
that.setData({
noticeList: res.data
})
}
console.log('zheli', that.data.infoObj)
})
},
// 根据微信code查询用户当前状态
getUserState: function() {
let that = this
wx.login({
success(res) {
if (res.code) {
let code = res.code
api.getToken(code).then(function(res) {
let state = res.data.userState
console.log(state)
console.log('date', Date.parse(new Date()))
let date = Date.parse(new Date())
app.globalData.infoCompleted = state
wx.removeStorageSync('topGridName')
wx.setStorageSync('topGridName', res.data.grid)
wx.removeStorageSync('token')
wx.setStorageSync('token', res.data.token)
that.setData({
departmentName: res.data.grid
})
if (state == '0') {
if (that.data.gid !== '') { //扫码进来的
// 是否是网格长的情况
if (that.data.gid == 'gridLeader') { // 是网格长,进网格长注册
wx.redirectTo({
url: '/pages/gridLeaderRegister/gridLeaderRegister'
})
} else { // 不是网格长,进网格提示页
wx.redirectTo({
url: '/pages/formid/formid?gid=' + that.data.gid
})
}
} else { // 直接进首页
that.getBannerList()
that.getFirstInfo()
that.getNoticeList()
that.getNewsList()
that.getIssueList()
that.getProjectList()
}
} else if (state == '4') { //未注册,跳到我要注册页面
if (that.data.gid !== '') { //扫码进来的
// 扫码进来未注册的情况,先进到前置页面获取formid
// 是否是网格长的情况
if (that.data.gid == 'gridLeader') { // 是网格长
wx.redirectTo({
url: '/pages/gridLeaderRegister/gridLeaderRegister'
})
} else {
wx.redirectTo({
url: '/pages/formid/formid?gid=' + that.data.gid
})
}
} else {
// 非扫码进入,通过搜索小程序直接进入的情况
wx.redirectTo({
url: '/pages/toRegister/toRegister'
})
// if (app.globalData.tempGridId == '') {
// wx.redirectTo({ // todo:
// url: '/pages/toRegister/toRegister?code=' + code + '&t=' + date
// })
// } else {
// wx.redirectTo({
// url: '/pages/formid/formid?gid=' + app.globalData.tempGridId
// })
// }
}
} else {
if (that.data.gid !== '') { //扫码进来的
// 是否是网格长的情况
if (that.data.gid == 'gridLeader') { // 是网格长,进网格长注册
wx.redirectTo({
url: '/pages/gridLeaderRegister/gridLeaderRegister'
})
} else { // 不是网格长,进网格提示页
wx.redirectTo({
url: '/pages/formid/formid?gid=' + that.data.gid
})
}
} else { // 直接进首页
that.getBannerList()
that.getFirstInfo()
that.getNoticeList()
that.getNewsList()
that.getIssueList()
that.getProjectList()
}
}
})
} else {
console.log('登录失败' + res.errMsg)
}
}
})
},
changeGrid() {
wx.navigateTo({
url: '/subpages/changegrid/pages/changeGrid/changeGrid'
})
},
swiperChange: function(e) {
this.setData({
'options.currentSwiper': e.detail.current,
currentIndex: e.detail.current
})
},
swiperChange2: function(e) {
this.setData({
'options2.currentSwiper': e.detail.current,
currentIndex: e.detail.current
})
},
// 点击-更多,跳转通知列表
moreNotice() {
wx.navigateTo({
url: '/subpages/home/pages/notice/notice'
})
// wx.miniProgram.navigateTo({ url: '/pages/detail/detail?weburl=' + encodeURIComponent(global.baseURL + 'notice?departmentName=' + sessionStorage.getItem('departmentName')) })
},
// 跳转我的消息
toInfoList() {
console.log('ssssss')
wx.navigateTo({
url: '/subpages/home/pages/info/info'
})
// wx.miniProgram.navigateTo({ url: '/pages/detail/detail?weburl=' + encodeURIComponent(global.baseURL + 'info') })
},
// 跳转到banner详情
navigatetoBannerDetail(e) {
const {
id,
url,
newsflag
} = e.currentTarget.dataset
console.log(id, url, newsflag)
if (newsflag == '0') {
wx.navigateTo({
url: `/subpages/home/pages/webview/webview?url=${url}`
})
} else if (newsflag == '1') {
wx.navigateTo({
url: `/subpages/home/pages/newsDetail/newsDetail?id=${id}`
})
}
},
// 我有事说
wyss(){
wx.navigateTo({
url: `../discussion/discussion`
})
},
dqhd(){
wx.navigateTo({
url: `../association/association`
})
}
})

8
pages/indexNew/indexNew.json

@ -0,0 +1,8 @@
{
"navigationBarTitleText": "精致锦水",
"navigationStyle": "custom",
"navigationBarTextStyle": "white",
"usingComponents": {
"nav-bar": "/components/navbar/index"
}
}

94
pages/indexNew/indexNew.wxml

@ -0,0 +1,94 @@
<wxs module="filter" src="../../utils/filter.wxs"></wxs>
<view class="header" style="height: {{statusHeight + navigationHeight}}px;">
<image class="header-bg" src="https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/05/rBAB716nk-eAbEAxAAANn46uZ0I895.png" />
<view class="navigation" style="height: {{navigationHeight}}px; top: {{statusHeight}}px;">e锦水</view>
</view>
<view class="home" style="margin-top: {{statusHeight + navigationHeight}}px">
<!--所属网格-->
<view class="belong-grid">
<image class="belong-grid-bg" src="https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/05/rBAB716nk_uAaDAaAAA2_zNBm_Y236.png" />
<view class="grid" bindtap="changeGrid">
<image class="party-logo" src="https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/05/rBAB716nk1aAGwwcAAAFdGPP-1s507.png" />
<view class="grid-name">{{departmentName}}</view>
<image class="more-grid" src="https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/05/rBAB716nk3uAAMMcAAADckZSIh0279.png" />
</view>
<image bindtap="toInfoList" class="news" src="https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/05/rBAB716nk4yASWCrAAAKA-kIkt0142.png" />
</view>
<!-- banner swiperBannerList -->
<view class="banner">
<swiper circular="{{true}}" autoplay="{{true}}" interval="{{3000}}" current="{{currentIndex}}" bindchange="swiperChange">
<swiper-item wx:for="{{swiperBannerList}}" wx:key="index" wx:for-index="index" wx:for-item="item">
<view class="banner-item" data-id="{{item.id}}" data-url="{{item.url}}" data-newsflag="{{item.newsFlag}}" bindtap="navigatetoBannerDetail">
<image mode="aspectFill" class="banner-img" src="{{item.imgUrl}}" />
<view class="banner-content">
<view class="title">
<view class="title-text">{{item.title}}</view>
</view>
<view class="indication">
<block wx:for="{{swiperBannerList}}" wx:key="index">
<view class="spot{{index == currentIndex? ' active' : ''}}"></view>
</block>
</view>
</view>
</view>
</swiper-item>
</swiper>
</view>
<!-- 通知 -->
<view class="notice">
<view class="left">
<image src="https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/05/rBAB716nk6iAMXkjAAAJcTi5eUU272.png"></image>
<view class="circle"></view>
<view class="havenotice" wx:if="{{noticeList.length > 0}}">
<view class="notice-broadcast-content" class="scrollNotice">
<view class="ul list swiper-wrapper" class="notice_list">
<view class="swiperview swiper-position">
<swiper class="swiperitem" indicator-dots="true" autoplay="true" vertical="true" circular="true">
<block wx:for="{{noticeList}}" wx:key="{{index}}" wx:for-item="item" wx:for-index="index">
<swiper-item>
<navigator url="/subpages/home/pages/noticeDetail/noticeDetail?id={{item.id}}">
<text class="swiper-txt">{{item.noticeTitle}}</text>
</navigator>
</swiper-item>
</block>
</swiper>
</view>
</view>
</view>
</view>
<!-- <view class="notice-info" wx:if="{{noticeList.length > 0}}">疫情防控社区、医疗机构防控网格图联系方···</view> -->
</view>
<view class="right">
<image src="https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/05/rBAB716nk7iAHRq-AAAFYLGulzU493.png"></image>
<view class="name" wx:if="{{noticeList.length > 0}}">{{noticeList.length}}</view>
<view class="name" wx:else>0</view>
</view>
</view>
<!-- 我有话说 -->
<view class="grid-all">
<image bindtap="wyss" src="https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/05/rBAB716nki6AIOnKAAEFtEe51uE843.png"></image>
<image bindtap="dqhd" src="https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/05/rBAB716nkqeAFhyBAAEedWqz2eE440.png"></image>
<image src="https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/05/rBAB716nkrqAB9DJAAEx8Bq_7R8226.png"></image>
<image src="https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/05/rBAB716nks6ALQtRAAExnBUFGQs281.png"></image>
</view>
<!-- 列表 -->
<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>
<view hidden="{{nomorenews}}" class="nomorenews">没有更多了~</view>
<!-- <view>暂无更多</view> -->
</view>

411
pages/indexNew/indexNew.wxss

@ -0,0 +1,411 @@
page {
width: 100%;
height: auto;
overflow-y: auto;
background: #fff;
}
.header {
position: fixed;
width: 100%;
top: 0;
left: 0;
z-index: 1000;
}
.header .header-bg {
width: 100%;
height: 100%;
position: absolute;
z-index: 10;
left: 0;
top: 0;
}
.header .navigation {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
color: rgba(255, 255, 255, 0.9);
font-size: 32rpx;
position: relative;
z-index: 100;
letter-spacing: 2rpx;
}
.home {
width: 100%;
}
.belong-grid {
width: 100%;
height: 100rpx;
position: relative;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.belong-grid .belong-grid-bg {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
z-index: 10;
}
.belong-grid .grid {
width: 90%;
height: 100%;
position: relative;
z-index: 100;
display: flex;
align-items: center;
}
.belong-grid .grid .party-logo {
width: 24rpx;
height: 30rpx;
margin: 0 14rpx 0 22rpx;
}
.belong-grid .grid .grid-name {
font-size: 32rpx;
color: #fff;
}
.belong-grid .grid .more-grid {
width: 16rpx;
height: 22rpx;
margin-left: 10rpx;
margin-top: 5rpx;
}
.belong-grid .news {
width: 34rpx;
height: 34rpx;
margin-right: 22rpx;
position: relative;
z-index: 100;
}
/* bannner *********** start */
.banner {
width: 100%;
height: 340rpx;
}
.banner swiper {
width: 100%;
height: 340rpx;
}
.banner-item {
width: 100%;
height: 340rpx;
position: relative;
}
.banner-item .banner-img {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.banner-item .banner-content {
position: relative;
width: 100%;
height: 100%;
top: 0;
left: 0;
z-index: 100;
display: flex;
align-items: flex-end;
}
.banner-item .banner-content .title {
width: 100%;
height: 91rpx;
background: rgba(0, 0, 0, 0.4);
box-sizing: border-box;
padding: 0 20rpx;
display: flex;
/* align-items: center; */
justify-content: space-between;
}
.banner-item .banner-content .title .title-text {
width: 75%;
/* height: 50rpx; */
color: #fff;
font-size: 26rpx;
/* line-height: 50rpx; */
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-top: 10rpx;
}
/* 自定义轮播指示点样式 */
.indication {
height: 70rpx;
display: flex;
position: absolute;
/* bottom: -2rpx; */
right: 20rpx;
flex-direction: row;
/* align-items: center; */
justify-content: center;
}
/* 未选中指示点样式 */
.spot {
width: 10rpx;
height: 10rpx;
border-radius: 50%;
margin-right: 10rpx;
background-color: #c6c6c8;
}
/*选中指示样式 */
.spot.active {
width: 10rpx;
height: 10rpx;
border-radius: 50%;
background-color: #fff;
}
/* bannner *********** end */
/* 通知 start*/
.notice {
width: calc(100% - 88rpx);
height: 90rpx;
margin-left: 24rpx;
position: relative;
z-index: 888;
margin-top: -31rpx;
border-radius: 10rpx;
background: rgba(253, 253, 253, 1);
box-shadow: 0px 4px 29px 0px rgba(63, 63, 63, 0.1);
padding: 0 20rpx;
display: flex;
align-items: center;
}
.notice .left {
height: 28rpx;
width: calc(100% - 44rpx);
display: flex;
align-items: center;
}
.notice .left image {
height: 28rpx;
width: 62rpx;
}
.notice .left .circle {
width: 8rpx;
height: 8rpx;
background: #666;
border-radius: 50%;
margin-left: 21rpx;
}
.notice .left .notice-info {
height: 24rpx;
width: calc(100%-148rpx);
font-size: 24rpx;
font-weight: 500;
color: rgba(153, 153, 153, 1);
line-height: 24rpx;
margin-left: 22rpx;
}
/* 滚动start */
.havenotice {
overflow: hidden;
display: flex;
justify-content: space-between;
align-items: center;
height: 100%;
width: calc(100%-148rpx);
}
.notice-broadcast-content {
margin-left: 12rpx;
width: 85%;
height: 20px;
position: relative;
top: 1px;
overflow: hidden;
}
.notice_list {
width: 100%;
}
.li {
color: #333333;
font-size: 28rpx;
width: 100%;
height: 40rpx;
line-height: 40rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.notice-broadcast-more {
font-size: 28rpx;
font-weight: normal;
color: #ffa650;
margin-top: 16rpx;
}
.nomorenotice {
color: #666666;
margin-left: 14rpx;
}
.swiperitem {
height: 100%;
line-height: 30rpx;
}
.swiper-txt {
font-size: 28rpx;
color: #333333;
line-height: 40rpx;
}
.swiper-position {
position: absolute;
margin: -20rpx 0 0 20rpx;
width: calc(100% - 200rpx);
z-index: 2;
height: 46rpx;
overflow: hidden;
}
.swiperview .wx-swiper-dots {
display: none;
}
/* 滚动end */
.notice .right {
height: 32rpx;
width: 44rpx;
position: relative;
}
.notice .right image {
position: absolute;
width: 100%;
height: 100%;
left: 0px;
top: 0px;
}
.notice .right .name {
position: absolute;
text-align: center;
width: 100%;
height: 100%;
left: 0px;
top: 0px;
font-size: 22rpx;
font-weight: 500;
color: rgba(255, 255, 255, 1);
line-height: 32rpx;
}
/* 通知 end*/
/* 我有事说 */
.grid-all {
height: 356rpx;
width: calc(100% - 54rpx);
margin-top: 29rpx;
margin-left: 27rpx;
}
.grid-all image {
height: 50%;
width: 50%;
float: left;
}
/* 我有事说 end*/
/* 列表样式 */
.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 .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;
}
.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;
}
.nomorenews{
display: flex;
justify-content: center;
align-items: center;
font-size:28rpx;
color:#999999;
padding: 20rpx;
}

46
pages/start/start.js

@ -5,23 +5,24 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
countDownNum: 5 countDownNum: 5,
close: false
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function(options) {
this.settime() this.settime()
this.countDown() this.countDown()
}, },
countDown: function () { countDown: function() {
let that = this; let that = this;
let countDownNum = that.data.countDownNum;//获取倒计时初始值 let countDownNum = that.data.countDownNum; //获取倒计时初始值
//如果将定时器设置在外面,那么用户就看不到countDownNum的数值动态变化,所以要把定时器存进data里面 //如果将定时器设置在外面,那么用户就看不到countDownNum的数值动态变化,所以要把定时器存进data里面
that.setData({ that.setData({
timer: setInterval(function () {//这里把setInterval赋值给变量名为timer的变量 timer: setInterval(function() { //这里把setInterval赋值给变量名为timer的变量
//每隔一秒countDownNum就减一,实现同步 //每隔一秒countDownNum就减一,实现同步
countDownNum--; countDownNum--;
//然后把countDownNum存进data,好让用户知道时间在倒计着 //然后把countDownNum存进data,好让用户知道时间在倒计着
@ -39,65 +40,70 @@ Page({
}) })
}, },
settime: function () { settime: function() {
let that = this let that = this
setTimeout(function () { setTimeout(function() {
wx.switchTab({ if (!that.data.close) {
url: `../index/index` wx.navigateTo({
}) url: `../indexNew/indexNew`
})
}
}, 5000) }, 5000)
}, },
bindGetUserInfo: function (e) { bindGetUserInfo: function(e) {
wx.switchTab({ this.setData({
url: `../index/index` close: true
})
wx.navigateTo({
url: `../indexNew/indexNew`
}) })
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { onReady: function() {
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function() {
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide: function () { onHide: function() {
}, },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function () { onUnload: function() {
}, },
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { onPullDownRefresh: function() {
}, },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { onReachBottom: function() {
}, },
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () { onShareAppMessage: function() {
} }
}) })

26
pages/start/start.wxml

@ -1,17 +1,17 @@
<view class="page"> <view class="page">
<image class="image-one" src="../../images/start_bg.png" mode="scaleToFill"></image> <image class="image-one" src="https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/05/rBAB716njY2ADRNbAAX8Nk6dBkI229.png" mode="scaleToFill"></image>
<view class="logo-style"> <view class="logo-style">
<image class="image-two" src="../../images/start_logo.png" mode="scaleToFill"></image> <image class="image-two" src="https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/05/rBAB716njbGAMRwZAAFzEo6DMTQ932.png" mode="scaleToFill"></image>
</view> </view>
<view class="time"> <view class="time">
<view class="time-info" bindtap="bindGetUserInfo"> <view class="time-info" bindtap="bindGetUserInfo">
<view class="left"> <view class="left">
{{countDownNum}}s {{countDownNum}}s
</view> </view>
<view class="right"> <view class="right">
跳过 跳过
</view> </view>
</view>
</view> </view>
</view>
</view> </view>

86
pages/start/start.wxss

@ -1,67 +1,65 @@
.page { .page {
width: 100%; width: 100%;
height: 100%; height: 100%;
position: relative; position: relative;
top: 0;
left: 0;
top: 0; z-index: 1000;
left: 0;
z-index: 1000;
} }
.image-one { .image-one {
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100% height: 100%;
} }
.logo-style { .logo-style {
width: 100%; width: 100%;
height: 220rpx; height: 220rpx;
margin-top: 455rpx; margin-top: 455rpx;
position: absolute; position: absolute;
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
.logo-style .image-two { .logo-style .image-two {
height: 220rpx; height: 220rpx;
width: 500rpx; width: 500rpx;
} }
.time { .time {
margin-top: 170rpx; margin-top: 170rpx;
position: absolute; position: absolute;
width: calc(100% - 28rpx); width: calc(100% - 28rpx);
height: 60rpx; height: 60rpx;
display: flex; display: flex;
flex-direction: row-reverse; flex-direction: row-reverse;
align-items: center; align-items: center;
} }
.time .time-info { .time .time-info {
width: 150rpx; width: 150rpx;
height: 60rpx; height: 60rpx;
border-radius: 30rpx; border-radius: 30rpx;
background: #fff; background: #fff;
opacity: 0.6; opacity: 0.6;
display: flex; display: flex;
align-items: center; align-items: center;
} }
.time .time-info .left { .time .time-info .left {
width: 50%; width: 50%;
height: 40rpx; height: 40rpx;
line-height: 40rpx; line-height: 40rpx;
font-size: 30rpx; font-size: 30rpx;
text-align: center; text-align: center;
border-right: 1rpx solid black; border-right: 1rpx solid black;
} }
.time .time-info .right { .time .time-info .right {
width: 50%; width: 50%;
height: 40rpx; height: 40rpx;
line-height: 40rpx; line-height: 40rpx;
font-size: 25rpx; font-size: 25rpx;
text-align: center; text-align: center;
} }

2
pages/toRegister/toRegister.js

@ -21,7 +21,7 @@ Page({
} }
}) })
let that = this let that = this
const versionNum = '1.0.2' const versionNum = '1.0.3'
api.getScanSwitch(versionNum).then(function (res) { api.getScanSwitch(versionNum).then(function (res) {
console.log(res.data) console.log(res.data)
let state = res.data.scanFlag let state = res.data.scanFlag

8
project.config.json

@ -68,15 +68,15 @@
}, },
{ {
"id": 3, "id": 3,
"name": "补全用户信息", "name": "pages/index/index",
"pathName": "subpages/discussion/pages/addIssue/addIssue", "pathName": "pages/index/index",
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
"id": 4, "id": 4,
"name": "pages/index/index", "name": "pages/indexNew/indexNew",
"pathName": "pages/index/index", "pathName": "pages/indexNew/indexNew",
"query": "", "query": "",
"scene": null "scene": null
} }

2705
typings/wx.d.ts

File diff suppressed because it is too large
Loading…
Cancel
Save