|
|
@ -90,6 +90,14 @@ Page({ |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad: function(options) { |
|
|
|
if (options.shareType) { |
|
|
|
const para = { |
|
|
|
shareType: options.shareType, |
|
|
|
id: options.id, |
|
|
|
type: options.type ? options.type : '', |
|
|
|
} |
|
|
|
wx.setStorageSync('shareObj', JSON.stringify(para)) |
|
|
|
} |
|
|
|
if (options.scene) { |
|
|
|
this.setData({ |
|
|
|
statusHeight: app.globalData.deviceInfo.statusHeight, |
|
|
@ -102,7 +110,7 @@ Page({ |
|
|
|
navigationHeight: app.globalData.deviceInfo.navigationHeight, |
|
|
|
}) |
|
|
|
} |
|
|
|
console.log('options:', options) |
|
|
|
// console.log('options:', options)
|
|
|
|
if (options.scene) { |
|
|
|
this.setData({ |
|
|
|
gid: decodeURIComponent(options.scene) |
|
|
@ -120,7 +128,6 @@ Page({ |
|
|
|
let that = this |
|
|
|
api.getGridList().then(res => { |
|
|
|
if (res.code === 0 && res.msg === 'success') { |
|
|
|
// console.log('::::::::::::'+res.data[0].gridId +'????'+res.data.length)
|
|
|
|
if (res.data.length > 0) { |
|
|
|
that.setData({ |
|
|
|
departmentId: res.data[0].gridId |
|
|
@ -134,7 +141,7 @@ Page({ |
|
|
|
getBannerList: function() { |
|
|
|
let that = this |
|
|
|
api.bannerList('0').then(function(res) { |
|
|
|
console.log('res==', res.data) |
|
|
|
// console.log('res==', res.data)
|
|
|
|
that.setData({ |
|
|
|
swiperBannerList: res.data |
|
|
|
}) |
|
|
@ -153,7 +160,7 @@ Page({ |
|
|
|
that.setData({ |
|
|
|
projectList: res.data |
|
|
|
}) |
|
|
|
console.log('newsList', that.data.newsList) |
|
|
|
// console.log('newsList', that.data.newsList)
|
|
|
|
}) |
|
|
|
}, |
|
|
|
getIssueList() { |
|
|
@ -170,7 +177,7 @@ Page({ |
|
|
|
that.setData({ |
|
|
|
issueList: res.data |
|
|
|
}) |
|
|
|
console.log('newsList', that.data.newsList) |
|
|
|
// console.log('newsList', that.data.newsList)
|
|
|
|
}) |
|
|
|
}, |
|
|
|
getNewsList: function() { |
|
|
@ -215,14 +222,14 @@ Page({ |
|
|
|
getFirstInfo: function() { |
|
|
|
let that = this |
|
|
|
api.getFirstInfo().then(function(res) { |
|
|
|
console.log('infoObj', res.data) |
|
|
|
// console.log('infoObj', res.data)
|
|
|
|
if (res.data !== null) { |
|
|
|
that.setData({ |
|
|
|
infoObj: res.data |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
console.log('zheli', that.data.infoObj) |
|
|
|
// console.log('zheli', that.data.infoObj)
|
|
|
|
}) |
|
|
|
}, |
|
|
|
getNoticeList: function() { |
|
|
@ -233,14 +240,14 @@ Page({ |
|
|
|
} |
|
|
|
let that = this |
|
|
|
api.noticelist(para).then(function(res) { |
|
|
|
console.log('infoObj', res.data) |
|
|
|
// console.log('infoObj', res.data)
|
|
|
|
if (res.data !== null) { |
|
|
|
that.setData({ |
|
|
|
noticeList: res.data |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
console.log('zheli', that.data.infoObj) |
|
|
|
// console.log('zheli', that.data.infoObj)
|
|
|
|
}) |
|
|
|
}, |
|
|
|
// 根据微信code查询用户当前状态
|
|
|
@ -252,8 +259,8 @@ Page({ |
|
|
|
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())) |
|
|
|
// console.log(state)
|
|
|
|
// console.log('date', Date.parse(new Date()))
|
|
|
|
let date = Date.parse(new Date()) |
|
|
|
app.globalData.infoCompleted = state |
|
|
|
wx.removeStorageSync('topGridName') |
|
|
@ -284,6 +291,16 @@ Page({ |
|
|
|
that.getIssueList() |
|
|
|
that.getProjectList() |
|
|
|
that.loadGridList() |
|
|
|
|
|
|
|
if (wx.getStorageSync('shareObj')) { |
|
|
|
const para = JSON.parse(wx.getStorageSync('shareObj')) |
|
|
|
if (para.shareType === 'newsDetail') { |
|
|
|
wx.navigateTo({ |
|
|
|
url: `/subpages/heart/pages/heartDetail/heartDetail?id=${para.id}` |
|
|
|
}) |
|
|
|
} |
|
|
|
wx.removeStorageSync('shareObj') |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (state == '4') { //未注册,跳到我要注册页面
|
|
|
|
if (that.data.gid !== '') { //扫码进来的
|
|
|
@ -326,6 +343,15 @@ Page({ |
|
|
|
}) |
|
|
|
} |
|
|
|
} else { // 直接进首页
|
|
|
|
if (wx.getStorageSync('shareObj')) { |
|
|
|
const para = JSON.parse(wx.getStorageSync('shareObj')) |
|
|
|
if (para.shareType === 'newsDetail') { |
|
|
|
wx.navigateTo({ |
|
|
|
url: `/subpages/heart/pages/heartDetail/heartDetail?id=${para.id}` |
|
|
|
}) |
|
|
|
} |
|
|
|
wx.removeStorageSync('shareObj') |
|
|
|
} |
|
|
|
that.getBannerList() |
|
|
|
that.getFirstInfo() |
|
|
|
that.getNoticeList() |
|
|
@ -421,7 +447,7 @@ Page({ |
|
|
|
// 积分排名
|
|
|
|
gointegralCentre() { |
|
|
|
api.getUserInfo().then(res => { |
|
|
|
console.log('用户信息', res) |
|
|
|
// console.log('用户信息', res)
|
|
|
|
wx.navigateTo({ |
|
|
|
url: `../../subpages/integralCentre/pages/index/index?points=` + res.data.points |
|
|
|
}) |
|
|
|