message.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <template>
  2. <view class="content" >
  3. <view v-for="(item, index) in messageInfo" :key="index" >
  4. <view class="cu-timeline">
  5. <view class="cu-time">{{item.gmtUpdate1}}</view>
  6. <view class="cu-item cur cuIcon-noticefill">
  7. <view class="content bg-green shadow-blur">
  8. <view >{{item.gmtUpdate}}</view>
  9. <view>{{item.customer + item.operation}}</view>
  10. <view>{{item.result}}</view>
  11. </view>
  12. </view>
  13. </view>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. data() {
  20. return {
  21. messageInfo:[]
  22. };
  23. },
  24. onShow() {
  25. },
  26. onLoad(options) {
  27. console.log("buy onload")
  28. this.loadData();
  29. },
  30. onPageScroll(e) {
  31. },
  32. //下拉刷新
  33. onPullDownRefresh() {
  34. this.isLoadMore = false
  35. this.loadStatus = 'loading'
  36. this.loadData()
  37. },
  38. methods: {
  39. async loadData() {
  40. const that = this
  41. uni.showLoading({
  42. title: '正在加载',
  43. mask:true
  44. })
  45. that.$api.request('user', 'getMessage',failres => {
  46. that.$api.msg(failres.errmsg)
  47. that.isLoadMore=false
  48. that.loadStatus = 'nomore'
  49. if(that.pages>1){that.pages-=1}
  50. uni.hideLoading()
  51. uni.stopPullDownRefresh()
  52. }).then(res => {
  53. let data = res.data
  54. if(data.length > 0){
  55. that.messageInfo = data
  56. that.isLoadMore=false
  57. }
  58. else{
  59. that.isLoadMore=true
  60. that.loadStatus = 'nomore'
  61. }
  62. uni.hideLoading()
  63. uni.stopPullDownRefresh()
  64. })
  65. },
  66. }
  67. };
  68. </script>
  69. <style scoped>
  70. .content {
  71. color:#ffffff;
  72. }
  73. </style>