|
|
@ -71,6 +71,7 @@ Page({ |
|
|
|
currentIndex: 0, |
|
|
|
loadMoreType: 'none', |
|
|
|
loadMoreVisible: false, |
|
|
|
defaultGridId:'',//默认网格
|
|
|
|
}, |
|
|
|
onShow: function() { |
|
|
|
if (wx.getStorageSync('token') != '' && wx.getStorageSync('token') != undefined && wx.getStorageSync('token') != null) { |
|
|
@ -95,6 +96,7 @@ Page({ |
|
|
|
shareType: options.shareType, |
|
|
|
id: options.id, |
|
|
|
type: options.type ? options.type : '', |
|
|
|
defaultGridId: options.defaultGridId ? options.defaultGridId : '', |
|
|
|
} |
|
|
|
wx.setStorageSync('shareObj', JSON.stringify(para)) |
|
|
|
} |
|
|
@ -122,6 +124,22 @@ Page({ |
|
|
|
}, 700) |
|
|
|
// 检查版本更新
|
|
|
|
checkoutVersion() |
|
|
|
|
|
|
|
// 获取默认网格
|
|
|
|
this.getDefaultGridInfo() |
|
|
|
}, |
|
|
|
// 获取默认网格
|
|
|
|
getDefaultGridInfo(){ |
|
|
|
let that = this |
|
|
|
api.getDefaultGridInfo().then(res => { |
|
|
|
if (res.code === 0 && res.msg === 'success') { |
|
|
|
that.setData({ |
|
|
|
defaultGridId:res.data |
|
|
|
}) |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
}, |
|
|
|
//获取当前网格的id
|
|
|
|
loadGridList () { |
|
|
@ -271,96 +289,143 @@ Page({ |
|
|
|
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() |
|
|
|
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 !== '') { //扫码进来的
|
|
|
|
// 扫码进来未注册的情况,先进到前置页面获取formid
|
|
|
|
// 是否是网格长的情况
|
|
|
|
if (that.data.gid == 'gridLeader') { // 是网格长
|
|
|
|
wx.redirectTo({ |
|
|
|
url: '/pages/gridLeaderRegister/gridLeaderRegister' |
|
|
|
}) |
|
|
|
} else { |
|
|
|
wx.redirectTo({ |
|
|
|
url: '/pages/formid/formid?gid=' + that.data.gid |
|
|
|
}) |
|
|
|
} |
|
|
|
// 优化注册流程
|
|
|
|
if (that.data.gid) { |
|
|
|
if (that.data.gid == 'gridLeader') { |
|
|
|
wx.redirectTo({ |
|
|
|
url: '/pages/gridLeaderRegister/gridLeaderRegister' |
|
|
|
}) |
|
|
|
} else { |
|
|
|
// 非扫码进入,通过搜索小程序直接进入的情况
|
|
|
|
wx.redirectTo({ |
|
|
|
url: '/pages/toRegister/toRegister' |
|
|
|
url: '/pages/formid/formid?gid=' + that.data.gid |
|
|
|
}) |
|
|
|
// 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') { // 是网格长,进网格长注册
|
|
|
|
if (state == '4') { |
|
|
|
if (wx.getStorageSync('shareObj')) { |
|
|
|
const para = JSON.parse(wx.getStorageSync('shareObj')) |
|
|
|
wx.redirectTo({ |
|
|
|
url: '/pages/formid/formid?gid=' + para.defaultGridId |
|
|
|
}) |
|
|
|
} else if (app.globalData.tempGridId == '') { |
|
|
|
wx.redirectTo({ |
|
|
|
url: '/pages/gridLeaderRegister/gridLeaderRegister' |
|
|
|
url: '/pages/toRegister/toRegister' |
|
|
|
}) |
|
|
|
} else { // 不是网格长,进网格提示页
|
|
|
|
} else { |
|
|
|
wx.redirectTo({ |
|
|
|
url: '/pages/formid/formid?gid=' + that.data.gid |
|
|
|
}) |
|
|
|
} |
|
|
|
} else { // 直接进首页
|
|
|
|
} else { |
|
|
|
if (wx.getStorageSync('shareObj')) { |
|
|
|
const para = JSON.parse(wx.getStorageSync('shareObj')) |
|
|
|
if (para.shareType === 'newsDetail') { |
|
|
|
if (para.shareType === 'heartDetail') { |
|
|
|
wx.navigateTo({ |
|
|
|
url: `/subpages/heart/pages/heartDetail/heartDetail?id=${para.id}` |
|
|
|
}) |
|
|
|
} |
|
|
|
wx.removeStorageSync('shareObj') |
|
|
|
} |
|
|
|
that.getBannerList() |
|
|
|
that.getFirstInfo() |
|
|
|
that.getNoticeList() |
|
|
|
that.getNewsList() |
|
|
|
that.getIssueList() |
|
|
|
that.getProjectList() |
|
|
|
that.loadGridList() |
|
|
|
that.getBannerList() |
|
|
|
that.getFirstInfo() |
|
|
|
that.getNoticeList() |
|
|
|
that.getNewsList() |
|
|
|
that.getIssueList() |
|
|
|
that.getProjectList() |
|
|
|
that.loadGridList() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 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()
|
|
|
|
// 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 !== '') { //扫码进来的
|
|
|
|
// // 扫码进来未注册的情况,先进到前置页面获取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 { // 直接进首页
|
|
|
|
// 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()
|
|
|
|
// that.getNewsList()
|
|
|
|
// that.getIssueList()
|
|
|
|
// that.getProjectList()
|
|
|
|
// that.loadGridList()
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
}) |
|
|
|
} else { |
|
|
|
console.log('登录失败' + res.errMsg) |
|
|
@ -427,7 +492,7 @@ Page({ |
|
|
|
}, |
|
|
|
// 我有事说
|
|
|
|
wyss() { |
|
|
|
if(this.data.departmentId == '1264168301160857601'){//特殊网格处理
|
|
|
|
if(this.data.departmentId == this.data.defaultGridId){//特殊网格处理
|
|
|
|
wx.showToast({ |
|
|
|
title: '该板块只针对辖区内居民使用,请联系您所属网格的负责人索取二维码扫码进入', |
|
|
|
icon: 'none', |
|
|
|