notice.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <!-- 平台通知 -->
  2. <template>
  3. <view>
  4. <view class="tab_status_box" style="margin-top: 10upx;">
  5. <view @click="to_mes" class="tab_status_box_no_focus">
  6. 消息列表
  7. </view>
  8. <view class="tab_status_box_focus">
  9. 平台消息
  10. </view>
  11. </view>
  12. <view class="loading_text" v-if="loading">加载中...</view>
  13. <view v-else>
  14. <view style="padding: 30upx 0;border-top: 6upx solid #f5f5f5;" :key="index" v-for="(item, index) in data">
  15. <view class="main_width">
  16. <view style="display: flex;align-items: center;justify-content: space-between;">
  17. <view style="color: #8a8b94;width: 100%;text-align: center;">
  18. {{(isNaN(Number(item.createtime))?item.createtime: formatDate(new Date(item.createtime*1000)))}}
  19. </view>
  20. </view>
  21. <view style="margin-top: 10upx;">
  22. <rich-text :nodes="item.content"></rich-text>
  23. </view>
  24. <view style="clear: both;"></view>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="loading_text" v-if="data.length==0&&!loading">暂无数据</view>
  29. </view>
  30. </template>
  31. <script>
  32. import commonData from '../../commonData.js'
  33. import commonFun from '../../commonFun.js'
  34. export default {
  35. data() {
  36. return {
  37. data: [],
  38. loading: false,
  39. sys_role: commonData.sys_role, //角色
  40. }
  41. },
  42. onLoad() {
  43. this.get_data()
  44. },
  45. onPullDownRefresh() {
  46. this.get_data()
  47. },
  48. methods: {
  49. to_mes() {
  50. uni.navigateBack({
  51. delta: 1
  52. })
  53. },
  54. get_data() {
  55. let params = {
  56. bizCatalog: 'NoticeEntity',
  57. handleMode: 'fetchall',
  58. pageIndex: 1,
  59. pageSize: 1000,
  60. query: {
  61. catalog: this.sys_role + 2
  62. }
  63. }
  64. this.loading = true
  65. uni.showLoading({
  66. title: '加载中...',
  67. mask: true,
  68. })
  69. commonFun.requestUrl('&WsAjaxBiz=Worker&WsAjaxAction=fetchPageData',
  70. params, res => {
  71. if (res.status) {
  72. uni.hideLoading()
  73. this.data = res.data.Result.pageData
  74. console.log(this.data)
  75. }
  76. uni.stopPullDownRefresh()
  77. this.loading = false
  78. })
  79. },
  80. },
  81. }
  82. </script>
  83. <style>
  84. </style>