diff --git a/pages/indexNew/indexNew.js b/pages/indexNew/indexNew.js index 5a8991b..8d551cb 100644 --- a/pages/indexNew/indexNew.js +++ b/pages/indexNew/indexNew.js @@ -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', diff --git a/subpages/heart/pages/heartDetail/heartDetail.js b/subpages/heart/pages/heartDetail/heartDetail.js index 60b3107..87aea60 100644 --- a/subpages/heart/pages/heartDetail/heartDetail.js +++ b/subpages/heart/pages/heartDetail/heartDetail.js @@ -25,6 +25,7 @@ Page({ selectedTab: '',//用来判断详情是否显示志愿者打卡 preloadVisible: true, timeJudge: false,//根据当前时间比较活动结束时间,判断活动是否已经结束,用以判断显示订单多多里面的志愿者 + defaultGridId:'',//默认网格 }, onLoad: function (options) { console.log("当前时间" + getTimestamp()) @@ -39,6 +40,8 @@ Page({ // if (this.data.actCurrentState == 2 || this.data.actCurrentState == 3 || this.data.actCurrentState == 4){ // this.clockList();//打卡列表 // } + // 获取默认网格 + this.getDefaultGridInfo() }, // 获取详情信息 getDetail() { @@ -220,13 +223,27 @@ Page({ current: e.currentTarget.dataset.src }) }, + + // 获取默认网格 + 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) + }) + }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { return { title: '活动详情', - path: `/pages/indexNew/indexNew?shareType=newsDetail&id=${this.data.id}` + path: `/pages/indexNew/indexNew?shareType=heartDetail&id=${this.data.id}&defaultGridId=${this.data.defaultGridId}` } } }) \ No newline at end of file diff --git a/subpages/home/pages/noticeDetail/noticeDetail.wxss b/subpages/home/pages/noticeDetail/noticeDetail.wxss index ef8cb3b..5138e84 100644 --- a/subpages/home/pages/noticeDetail/noticeDetail.wxss +++ b/subpages/home/pages/noticeDetail/noticeDetail.wxss @@ -69,4 +69,8 @@ color: #333333; text-indent: 76rpx; margin-top:22rpx; +} + +.richContent{ + word-break: break-all; } \ No newline at end of file diff --git a/subpages/understandJs/pages/delicious/delicious.js b/subpages/understandJs/pages/delicious/delicious.js index 882cd7c..44e649c 100644 --- a/subpages/understandJs/pages/delicious/delicious.js +++ b/subpages/understandJs/pages/delicious/delicious.js @@ -102,7 +102,7 @@ Page({ pageIndex: this.data.pageIndex + 1, pageSize: this.data.pageSize, }) - this.deptinfolist(); + this.noticelist(); } }, diff --git a/subpages/understandJs/pages/impression/impression.js b/subpages/understandJs/pages/impression/impression.js index a6dea52..9b6305a 100644 --- a/subpages/understandJs/pages/impression/impression.js +++ b/subpages/understandJs/pages/impression/impression.js @@ -119,7 +119,7 @@ Page({ pageIndex: this.data.pageIndex + 1, pageSize: this.data.pageSize, }) - this.deptinfolist(); + this.noticelist(); } }, diff --git a/utils/api.js b/utils/api.js index a557c0a..b7dc22c 100644 --- a/utils/api.js +++ b/utils/api.js @@ -49,7 +49,8 @@ module.exports = { getWxPhone: getWxPhone, completeResidentInfoV2: completeResidentInfoV2, completePartyInfoV2: completePartyInfoV2, - userPointsRankinglist:userPointsRankinglist + userPointsRankinglist:userPointsRankinglist, + getDefaultGridInfo:getDefaultGridInfo } function getToken(wxCode) { @@ -477,3 +478,7 @@ function getWxPhone({ wxCode, encryptedData, iv }) { }) } // *****************************爱心互助接口***************************end +// 获取默认网格信息 +function getDefaultGridInfo() { + return fly.get('dic/getDefaultGridInfo') +} \ No newline at end of file