| | |
| | | |
| | | Page({ |
| | | data: { |
| | | inter:1, |
| | | overLayList:{}, |
| | | showOverlay:false, |
| | | messageList: [], |
| | |
| | | // url: '../cause/detail/index?id=' + e.currentTarget.id, |
| | | // }) |
| | | // }, |
| | | |
| | | onClickHide(e){ |
| | | console.log(e) |
| | | this.setData({ |
| | |
| | | |
| | | }, |
| | | sendMsg(){ |
| | | |
| | | wx.request( |
| | | { |
| | | url: message.globalData.url + "/wx/group/manager/sendMsg", |
| | |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | getmessage(){ |
| | | wx.request( |
| | | { |
| | | url: message.globalData.url + "/wx/message", |
| | | method: "GET", |
| | | header: { 'token': wx.getStorageSync('token') }, |
| | | data: { |
| | | groupId: this.data.groupId |
| | | }, |
| | | success: (res) => { |
| | | for (let index = 0; index < res.data.data.length; index++) { |
| | | if (res.data.data[index].pic != null) { |
| | | res.data.data[index].pic = message.globalData.imageUrl + "/img/" + res.data.data[index].pic; |
| | | } |
| | | } |
| | | this.setData({ |
| | | messageList: res.data.data, |
| | | |
| | | }) |
| | | console.log(this.data.messageList) |
| | | try { |
| | | wx.setStorageSync('time', 'time') |
| | | } catch (e) { } |
| | | // wx.setStorageSync('time','time') |
| | | this.setData({ |
| | | isInput : 2 |
| | | }) |
| | | |
| | | |
| | | |
| | | wx.createSelectorQuery().select('#chat') |
| | | |
| | | .boundingClientRect(function(rect){ |
| | | console.log('rectheight',rect); |
| | | |
| | | /* 将页面移动到最底部(用xxx的height定位) */ |
| | | wx.pageScrollTo({ |
| | | scrollTop: rect.height |
| | | }) |
| | | }).exec() |
| | | } |
| | | }) |
| | | }, |
| | | endInter(){ |
| | | let thit = this |
| | | clearInterval(thit.data.inter) |
| | | }, |
| | | onUnload () { |
| | | this.endInter() |
| | | }, |
| | | onHide(){ |
| | | this.endInter() |
| | | }, |
| | | onLoad(e) { |
| | | this.setData({ |
| | | uid:wx.getStorageSync('id') |
| | | }) |
| | | |
| | | var date = new Date() |
| | | var month = date.getMonth() + 1 |
| | | var day = date.getDate() |
| | |
| | | }).exec() |
| | | } |
| | | }) |
| | | let that = this |
| | | that.data.inter = setInterval(function(){ |
| | | that.getmessage() |
| | | },10000) |
| | | } |
| | | }) |
| | |
| | | } |
| | | |
| | | .chat-item{ |
| | | padding-bottom: 2rem; |
| | | background-color: #F5F5F9; |
| | | margin-bottom: 20%; |
| | | } |
| | |
| | | } |
| | | .low{ |
| | | position: fixed; |
| | | bottom: 0rem; |
| | | bottom: 2rem; |
| | | width: 100%; |
| | | background-color: white; |
| | | /* height: 7%; */ |
| | |
| | | var ress = res.data.data |
| | | ress.pic = memberDetail.globalData.imageUrl + "/img/" + ress.pic |
| | | let imgs = [] |
| | | if (ress.idCardMaterials != '') { |
| | | if (ress.idCardMaterials != ''&&ress.idCardMaterials) { |
| | | imgs.push(...ress.idCardMaterials.split(",")) |
| | | if (ress.contractMaterials != '') { |
| | | if (ress.contractMaterials != ''&&ress.contractMaterials) { |
| | | imgs.push(...ress.contractMaterials.split(",")) |
| | | if (ress.transactionMaterials != '') { |
| | | if (ress.transactionMaterials != ''&&ress.transactionMaterials) { |
| | | imgs.push(...ress.transactionMaterials.split(",")) |
| | | if (ress.elseMaterials != '') { |
| | | if (ress.elseMaterials != ''&&ress.elseMaterials) { |
| | | imgs.push(...ress.elseMaterials.split(",")) |
| | | } |
| | | } |
| | |
| | | wx.navigateBack() |
| | | }, |
| | | openGroup(e) { |
| | | wx.navigateTo({ |
| | | url: "../../user/group/message/index?id=" + e.currentTarget.id + "&&ban=" + e.currentTarget.dataset.ban + "&&reportId=" + e.currentTarget.dataset.rptid |
| | | }) |
| | | if (wx.getStorageSync('role')==1) { |
| | | wx.navigateTo({ |
| | | url: "../../manager/group/message/index?id=" + e.currentTarget.id |
| | | }) |
| | | }else{ |
| | | wx.navigateTo({ |
| | | url: "../../user/group/message/index?id=" + e.currentTarget.id + "&&ban=" + e.currentTarget.dataset.ban + "&&reportId=" + e.currentTarget.dataset.rptid |
| | | }) |
| | | } |
| | | |
| | | |
| | | }, |
| | | onLoad() { |
| | | var date = new Date() |
| | |
| | | } |
| | | time = date.getFullYear() + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + secends |
| | | var lastTime = wx.getStorageSync('time') |
| | | wx.request( |
| | | { |
| | | url: userGroup.globalData.url + "/wx/user/group/list", |
| | | method: "GET", |
| | | data: { |
| | | id: wx.getStorageSync('id'), |
| | | newDate: time, |
| | | lastDate: lastTime |
| | | }, |
| | | header: { 'token': wx.getStorageSync('token') }, |
| | | success: (res) => { |
| | | console.log(res.data.data) |
| | | this.setData({ |
| | | groupList: res.data.data |
| | | }) |
| | | } |
| | | }) |
| | | console.log(wx.getStorageSync('role')); |
| | | |
| | | if (wx.getStorageSync('role')==1) { |
| | | wx.request( |
| | | { |
| | | url: userGroup.globalData.url + "/wx/manager/group/list", |
| | | method: "GET", |
| | | data: { |
| | | id: wx.getStorageSync('id'), |
| | | newDate: time, |
| | | lastDate: lastTime |
| | | }, |
| | | header: { 'token': wx.getStorageSync('token') }, |
| | | success: (res) => { |
| | | console.log(res.data.data) |
| | | res.data.data.map(item => { |
| | | if (item.time) { |
| | | item.time = item.time.substr(-8) |
| | | } |
| | | }) |
| | | this.setData({ |
| | | groupList: res.data.data |
| | | }) |
| | | } |
| | | |
| | | }) |
| | | }else{ |
| | | wx.request( |
| | | { |
| | | url: userGroup.globalData.url + "/wx/user/group/list", |
| | | method: "GET", |
| | | data: { |
| | | id: wx.getStorageSync('id'), |
| | | newDate: time, |
| | | lastDate: lastTime |
| | | }, |
| | | header: { 'token': wx.getStorageSync('token') }, |
| | | success: (res) => { |
| | | console.log(res.data.data) |
| | | this.setData({ |
| | | groupList: res.data.data |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | } |
| | | }) |
| | |
| | | |
| | | Page({ |
| | | data: { |
| | | inter:1, |
| | | messageList: [], |
| | | isShow: false, |
| | | height: null, |
| | |
| | | } |
| | | }) |
| | | }, |
| | | getmessage(){ |
| | | wx.request( |
| | | { |
| | | url: userMessage.globalData.url + "/wx/message", |
| | | method: "GET", |
| | | header: { 'token': wx.getStorageSync('token') }, |
| | | data: { |
| | | groupId: this.data.groupId |
| | | }, |
| | | success: (res) => { |
| | | for (let index = 0; index < res.data.data.length; index++) { |
| | | if (res.data.data[index].pic != null) { |
| | | res.data.data[index].pic = userMessage.globalData.imageUrl + "/img/" + res.data.data[index].pic; |
| | | } |
| | | } |
| | | this.setData({ |
| | | messageList: res.data.data, |
| | | |
| | | }) |
| | | console.log(this.data.messageList) |
| | | wx.createSelectorQuery().select('#chat') |
| | | .boundingClientRect(function(rect){ |
| | | console.log('rectheight',rect); |
| | | /* 将页面移动到最底部(用xxx的height定位) */ |
| | | wx.pageScrollTo({ |
| | | scrollTop: rect.height |
| | | }) |
| | | }).exec() |
| | | } |
| | | }) |
| | | }, |
| | | endInter(){ |
| | | let thit = this |
| | | clearInterval(thit.data.inter) |
| | | }, |
| | | onUnload () { |
| | | this.endInter() |
| | | }, |
| | | onHide(){ |
| | | this.endInter() |
| | | }, |
| | | onLoad(e) { |
| | | this.setData({ |
| | | uid:wx.getStorageSync('id') |
| | | }) |
| | | console.log(this.data.uid); |
| | | this.setData({ |
| | | uid:wx.getStorageSync('id') |
| | |
| | | }).exec() |
| | | } |
| | | }) |
| | | let that = this |
| | | that.data.inter = setInterval(function(){ |
| | | that.getmessage() |
| | | },30000) |
| | | }, |
| | | onShow(){ |
| | | console.log('123'); |