Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/H5/threeSide
| | |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <text class="flex j-center fs-27 color4 pb-48">全部已读</text> |
| | | <text class="flex j-center fs-27 color4 pb-48" @click="Allread">全部已读</text> |
| | | |
| | | </view> |
| | | |
| | |
| | | import { |
| | | getBanner, |
| | | getMessagelist, |
| | | getappletcinfo |
| | | getappletcinfo, |
| | | getread |
| | | } from './service.js' |
| | | export default { |
| | | components: { |
| | |
| | | msgListTotal: [], |
| | | member: 1, |
| | | userInfo: {}, |
| | | isLoading: false, |
| | | } |
| | | }, |
| | | onLoad(e) { |
| | | if (e.token && e.token != 'null') { |
| | | uni.setStorageSync('token', e.token) |
| | | onPullDownRefresh() { |
| | | if (!this.isLoading) { |
| | | this.pageNum = this.pageNum + 1 |
| | | this.getMessagelist() |
| | | } else { |
| | | return uni.showToast({ |
| | | title: '没有更多了...', |
| | | icon: 'none' |
| | | }) |
| | | } |
| | | |
| | | }, |
| | | onLoad() { |
| | | this.getBanner() |
| | | this.getMessagelist() |
| | | this.getappletcinfo() |
| | | }, |
| | | methods: { |
| | | Allread() { |
| | | getread().then(resp => { |
| | | console.log(resp, '====='); |
| | | this.getMessagelist() |
| | | }) |
| | | }, |
| | | getBanner() { |
| | | getBanner().then(resp => { |
| | | console.log(resp, '获取banner'); |
| | |
| | | } |
| | | getMessagelist(data).then(resp => { |
| | | console.log(resp, '获取消息列表'); |
| | | this.msgListTotal = resp.data.records.map(item => { |
| | | if (resp.data.records.length < 5 && this.pageNum == 1) { |
| | | this.msgListTotal = resp.data.records |
| | | this.isLoading = true |
| | | |
| | | } else if (resp.data.records.length < 5 && this.pageNum != 1) { |
| | | this.msgListTotal = [...this.msgListTotal, resp.data.records] |
| | | this.isLoading = true |
| | | } else { |
| | | this.msgListTotal = [...this.msgListTotal, resp.data.records] |
| | | this.isLoading = false |
| | | } |
| | | this.msgListTotal = this.msgListTotal.map(item => { |
| | | const timeDifference = new Date().getTime() - new Date(item.createTime).getTime() |
| | | // 使用 dayjs 的 duration 来处理时间差 |
| | | |
| | |
| | | export const getappletcinfo =(params)=>{ |
| | | return request.get(`/api/huacheng-sangeshenbian/applet/home/current-user-info`,params) |
| | | } |
| | | export const getread=(params)=>{ |
| | | return request.post(`/api/huacheng-sangeshenbian/applet/home/read`,params) |
| | | } |