insideMessage.js 736 B

12345678910111213141516171819202122232425262728
  1. import httpRequestApi from '../../../utils/APIClient';
  2. import {
  3. formatDate
  4. } from '../../../utils/util';
  5. Page({
  6. data: {
  7. messageList: []
  8. },
  9. onLoad: function (options) {
  10. wx.setNavigationBarTitle({
  11. title: '消息列表'
  12. })
  13. httpRequestApi.getMessageList(1, 10).success((res) => {
  14. res.data.data.list.forEach( item => {
  15. item.gmtCreated = formatDate(item.gmtCreated,1)
  16. })
  17. this.setData({
  18. messageList: res.data.data.list
  19. })
  20. httpRequestApi.refreshMessageStatus().success((res)=>{
  21. console.log(res)
  22. })
  23. });
  24. },
  25. // onHide: function(){
  26. // }
  27. })