diff --git a/pages/indexNew/indexNew.js b/pages/indexNew/indexNew.js index 199f9c7..33c64c3 100644 --- a/pages/indexNew/indexNew.js +++ b/pages/indexNew/indexNew.js @@ -1,578 +1,578 @@ -const app = getApp() -var api = require('../../utils/api.js') -var global = require('../../utils/config.js') -import { - getTimestamp -} from '../../utils/common' -import checkoutVersion from '../../utils/checkVersion' - -Page({ - data: { - first: true, - nomorenews: true, - departmentName: '', - departmentId: '', - 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: 'e锦水', //导航栏 中间的标题 - }, - 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, - loadMoreType: 'none', - loadMoreVisible: false, - defaultGridId:'',//默认网格 - }, - 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.loadGridList() - this.setData({ - pageNo: 1, - newsList: [] - }) - this.getNewsList() - } - } - }, - onLoad: function(options) { - if (options.shareType) { - const para = { - shareType: options.shareType, - id: options.id, - type: options.type ? options.type : '', - defaultGridId: options.defaultGridId ? options.defaultGridId : '', - } - wx.setStorageSync('shareObj', JSON.stringify(para)) - } - 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) - // 检查版本更新 - checkoutVersion() - - // 获取默认网格 - this.getResidentConfig() - }, - // 获取默认网格 - getResidentConfig(){ - let that = this - api.getResidentConfig().then(res => { - if (res.code === 0 && res.msg === 'success') { - res.data.forEach(item => { - if (item.residentType === 'default_grid') { - that.setData({ - defaultGridId:item.residentValue - }) - } - }) - } - }).catch(err => { - console.log(err) - }) - }, - //获取当前网格的id - loadGridList () { - let that = this - api.getGridList().then(res => { - if (res.code === 0 && res.msg === 'success') { - if (res.data.length > 0) { - that.setData({ - departmentId: res.data[0].gridId - }) - } - } - }).catch(err => { - console.log(err) - }) - }, - 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: 1, //this.data.pageNo, - pageSize: 5, //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: [] - }) - }) - }, - onReachBottom() { - this.setData({ - loadMoreVisible: true - }) - if (this.data.loadMoreType === 'loading') { - 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 (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 (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/toRegister/toRegister' - }) - } 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 === '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() - } - } - - // 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) - } - } - }) - }, - changeGrid() { - wx.navigateTo({ - url: '/subpages/changegrid/pages/changeGrid/changeGrid' - }) - }, - swiperChange: function(e) { - if (e.detail.source === 'touch') { - this.setData({ - 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/noticeNew/noticeNew' - }) - // wx.miniProgram.navigateTo({ url: '/pages/detail/detail?weburl=' + encodeURIComponent(global.baseURL + 'notice?departmentName=' + sessionStorage.getItem('departmentName')) }) - }, - // 跳转我的消息 - toInfoList() { - wx.navigateTo({ - url: '/subpages/home/pages/info/info' - }) - // wx.miniProgram.navigateTo({ url: '/pages/detail/detail?weburl=' + encodeURIComponent(global.baseURL + 'info') }) - }, - //了解锦水 - toUnderstandJs(){ - wx.navigateTo({ - url: '/subpages/understandJs/pages/index/index' - }) - }, - - // 跳转到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() { - if(this.data.departmentId == this.data.defaultGridId){//特殊网格处理 - wx.showToast({ - title: '该板块只针对辖区内居民使用,请联系您所属网格的负责人索取二维码扫码进入', - icon: 'none', - duration: 3000 - }) - }else{ - wx.navigateTo({ - url: `../discussion/discussion` - }) - } - }, - dqhd() { - wx.navigateTo({ - url: `../../subpages/associationNew/pages/associationlist/associationlist` - }) - }, - // 积分排名 - gointegralCentre() { - api.getUserInfo().then(res => { - // console.log('用户信息', res) - wx.navigateTo({ - url: `../../subpages/integralCentre/pages/index/index?points=` + res.data.points - }) - }).catch(err => { - console.log(err) - }) - - }, - - // 志愿者去哪 - goheart() { - wx.navigateTo({ - url: `../heartNew/heartNew` - }) - }, - // 跳转我的 - toMine() { - wx.navigateTo({ - url: '../mine/mine' - }) - }, - // 暂未开通模块显示敬请期待 - noMore() { - wx.showToast({ - title: '暂无更多消息~', - icon: 'none', - duration: 1000 - }) - }, - - //功能暂未开放 - nofunction() { - wx.showToast({ - title: '敬请期待', - icon: 'none', - duration: 1000 - }) - }, - //拨打电话 - getPhone(e) { - // return false - wx.showModal({ - title: '拨打电话', - content: `您确定拨打${e.currentTarget.dataset.number}`, - cancelColor: '#29B9A5', - confirmColor: '#29B9A5', - success: (res) => { - if (res.confirm) { - console.log('用户点击确定') - wx.makePhoneCall({ - phoneNumber: e.currentTarget.dataset.number - }) - } else if (res.cancel) { - console.log('用户点击取消') - } - } - }) - } +const app = getApp() +var api = require('../../utils/api.js') +var global = require('../../utils/config.js') +import { + getTimestamp +} from '../../utils/common' +import checkoutVersion from '../../utils/checkVersion' + +Page({ + data: { + first: true, + nomorenews: true, + departmentName: '', + departmentId: '', + 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: 'e锦水', //导航栏 中间的标题 + }, + 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, + loadMoreType: 'none', + loadMoreVisible: false, + defaultGridId:'',//默认网格 + }, + 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.loadGridList() + this.setData({ + pageNo: 1, + newsList: [] + }) + this.getNewsList() + } + } + }, + onLoad: function(options) { + if (options.shareType) { + const para = { + shareType: options.shareType, + id: options.id, + type: options.type ? options.type : '', + defaultGridId: options.defaultGridId ? options.defaultGridId : '', + } + wx.setStorageSync('shareObj', JSON.stringify(para)) + } + 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) + // 检查版本更新 + checkoutVersion() + + // 获取默认网格 + this.getResidentConfig() + }, + // 获取默认网格 + getResidentConfig(){ + let that = this + api.getResidentConfig().then(res => { + if (res.code === 0 && res.msg === 'success') { + res.data.forEach(item => { + if (item.residentType === 'default_grid' && item.residentCode === 'default_grid') { + that.setData({ + defaultGridId:item.residentValue + }) + } + }) + } + }).catch(err => { + console.log(err) + }) + }, + //获取当前网格的id + loadGridList () { + let that = this + api.getGridList().then(res => { + if (res.code === 0 && res.msg === 'success') { + if (res.data.length > 0) { + that.setData({ + departmentId: res.data[0].gridId + }) + } + } + }).catch(err => { + console.log(err) + }) + }, + 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: 1, //this.data.pageNo, + pageSize: 5, //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: [] + }) + }) + }, + onReachBottom() { + this.setData({ + loadMoreVisible: true + }) + if (this.data.loadMoreType === 'loading') { + 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 (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 (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/toRegister/toRegister' + }) + } 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 === '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() + } + } + + // 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) + } + } + }) + }, + changeGrid() { + wx.navigateTo({ + url: '/subpages/changegrid/pages/changeGrid/changeGrid' + }) + }, + swiperChange: function(e) { + if (e.detail.source === 'touch') { + this.setData({ + 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/noticeNew/noticeNew' + }) + // wx.miniProgram.navigateTo({ url: '/pages/detail/detail?weburl=' + encodeURIComponent(global.baseURL + 'notice?departmentName=' + sessionStorage.getItem('departmentName')) }) + }, + // 跳转我的消息 + toInfoList() { + wx.navigateTo({ + url: '/subpages/home/pages/info/info' + }) + // wx.miniProgram.navigateTo({ url: '/pages/detail/detail?weburl=' + encodeURIComponent(global.baseURL + 'info') }) + }, + //了解锦水 + toUnderstandJs(){ + wx.navigateTo({ + url: '/subpages/understandJs/pages/index/index' + }) + }, + + // 跳转到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() { + if(this.data.departmentId == this.data.defaultGridId){//特殊网格处理 + wx.showToast({ + title: '该板块只针对辖区内居民使用,请联系您所属网格的负责人索取二维码扫码进入', + icon: 'none', + duration: 3000 + }) + }else{ + wx.navigateTo({ + url: `../discussion/discussion` + }) + } + }, + dqhd() { + wx.navigateTo({ + url: `../../subpages/associationNew/pages/associationlist/associationlist` + }) + }, + // 积分排名 + gointegralCentre() { + api.getUserInfo().then(res => { + // console.log('用户信息', res) + wx.navigateTo({ + url: `../../subpages/integralCentre/pages/index/index?points=` + res.data.points + }) + }).catch(err => { + console.log(err) + }) + + }, + + // 志愿者去哪 + goheart() { + wx.navigateTo({ + url: `../heartNew/heartNew` + }) + }, + // 跳转我的 + toMine() { + wx.navigateTo({ + url: '../mine/mine' + }) + }, + // 暂未开通模块显示敬请期待 + noMore() { + wx.showToast({ + title: '暂无更多消息~', + icon: 'none', + duration: 1000 + }) + }, + + //功能暂未开放 + nofunction() { + wx.showToast({ + title: '敬请期待', + icon: 'none', + duration: 1000 + }) + }, + //拨打电话 + getPhone(e) { + // return false + wx.showModal({ + title: '拨打电话', + content: `您确定拨打${e.currentTarget.dataset.number}`, + cancelColor: '#29B9A5', + confirmColor: '#29B9A5', + success: (res) => { + if (res.confirm) { + console.log('用户点击确定') + wx.makePhoneCall({ + phoneNumber: e.currentTarget.dataset.number + }) + } else if (res.cancel) { + console.log('用户点击取消') + } + } + }) + } }) \ No newline at end of file diff --git a/subpages/associationNew/images/wcomment@2x.png b/subpages/associationNew/images/wcomment@2x.png new file mode 100644 index 0000000..1909321 Binary files /dev/null and b/subpages/associationNew/images/wcomment@2x.png differ diff --git a/subpages/associationNew/pages/eventlist/eventlist.wxml b/subpages/associationNew/pages/eventlist/eventlist.wxml index 1a4f7ec..f34c37f 100644 --- a/subpages/associationNew/pages/eventlist/eventlist.wxml +++ b/subpages/associationNew/pages/eventlist/eventlist.wxml @@ -25,18 +25,19 @@ - {{item.supportNum}} + {{item.supportNum}} - {{item.commentNum}} + {{item.commentNum}} - - 评论 + + + {{likesItem.nickname}}, diff --git a/subpages/associationNew/pages/eventlist/eventlist.wxss b/subpages/associationNew/pages/eventlist/eventlist.wxss index 35e2f53..af6c9ed 100644 --- a/subpages/associationNew/pages/eventlist/eventlist.wxss +++ b/subpages/associationNew/pages/eventlist/eventlist.wxss @@ -57,14 +57,14 @@ page { font-weight: 500; color: rgba(51, 51, 51, 1); line-height: 54rpx; + word-break: break-all; } .image-list { - /* width: calc(100% - 58rpx); */ - width: 100%; + width: calc(100% - 58rpx); margin-top: 30rpx; display: grid; - grid-template-columns: repeat(auto-fit, minmax(216rpx, 1fr)); + grid-template-columns: repeat(auto-fit, minmax(208rpx, 1fr)); grid-gap: 7rpx; } @@ -92,19 +92,38 @@ page { } .attitude .all image { - width: 30rpx; - height: 30rpx; + width: 34rpx; + height: 34rpx; +} + +.wcomment { + width: 146rpx !important; + height: 56rpx !important; } -.attitude .all .give-data { - font-size: 26rpx; +.likes image { + width: 32rpx; + height: 32rpx; + margin-right: 10rpx; +} + +.attitude .all .give-data-n { + font-size: 30rpx; font-weight: 500; color: rgba(51, 51, 51, 1); margin-left: 9rpx; /* width: 196rpx; */ } -.attitude .all .give-data.color { +.attitude .all .give-data-s { + font-size: 28rpx; + font-weight: 500; + color: rgba(51, 51, 51, 1); + margin-left: 9rpx; + /* width: 196rpx; */ +} + +.attitude .all .give-data-n.color { color: #FFB103; } @@ -116,10 +135,13 @@ page { margin-top: 25rpx; font-size: 28rpx; color: #333333; + display: flex; + align-items: center; + flex-wrap: wrap; } .line { - width: calc(100% - 60rpx); - height: 0.5px; + /* width: calc(100% - 60rpx); */ + height: 0px; background-color: #dddddd; } @@ -136,6 +158,7 @@ page { margin-top: 11rpx; font-size: 28rpx; color: #999999; + word-break: break-all; } .comment .comment-list text {