notification.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <view>
  3. <cu-custom bgColor="bg-blue" backUrl="/pages/index/index?id=apps" :isBack="true">
  4. <block slot="backText">返回</block>
  5. <block slot="content"> 通知公告</block>
  6. </cu-custom>
  7. <!-- 菜单 -->
  8. <view class="bg-white nav fixed flex text-center" :style="[{top:CustomBar + 'px'}]">
  9. <view class="cu-item flex-sub" :class="0==tabIndex?'text-blue cur':''" @tap="tabSelect" data-id="0">
  10. 我的通知
  11. </view>
  12. <view class="cu-item flex-sub" v-if="$auth.hasPermission('notify:list')" :class="1==tabIndex?'text-blue cur':''" @tap="tabSelect" data-id="1">
  13. 通告管理
  14. </view>
  15. </view>
  16. <!-- 子组件 (i: 每个tab页的专属下标; index: 当前tab的下标) -->
  17. <!-- 如果每个子组件布局不一样, 可拆开写 (注意ref只能为 "mescrollItem下标" 的格式, 另外 :i="下标" :index="tabIndex"也是固定写法) : -->>
  18. <my-notify-list ref="mescrollItem0" :i="0" :index="tabIndex"></my-notify-list>
  19. <oa-notify-list ref="mescrollItem1" :i="1" :index="tabIndex"></oa-notify-list>
  20. </view>
  21. </template>
  22. <script>
  23. import myNotifyList from "./myNotifyList.vue"
  24. import oaNotifyList from "./oaNotifyList.vue"
  25. import MescrollMoreMixin from "@/components/mescroll-uni/mixins/mescroll-more.js";
  26. import * as $auth from "@/common/auth"
  27. export default {
  28. mixins: [MescrollMoreMixin], // 多个mescroll-body写在子组件时, 则使用mescroll-more.js补充子组件的页面生命周期
  29. components: {
  30. myNotifyList,
  31. oaNotifyList
  32. },
  33. onLoad(tab) {
  34. if(tab&&tab.tabIndex){
  35. this.tabIndex = parseInt(tab.tabIndex)
  36. }
  37. },
  38. data() {
  39. return {
  40. tabIndex: 0 // 当前tab下标,必须与mescroll-more.js对应,所以tabIndex是固定变量,不可以改为其他的名字
  41. }
  42. },
  43. methods:{
  44. tabSelect(e) {
  45. this.tabIndex = parseInt(e.currentTarget.dataset.id);
  46. }
  47. }
  48. }
  49. </script>
  50. <style>
  51. .top-warp{
  52. z-index: 9990;
  53. position: fixed;
  54. top: --window-top; /* css变量 */
  55. left: 0;
  56. width: 100%;
  57. height: 120upx;
  58. background-color: white;
  59. }
  60. .top-warp .tip{
  61. font-size: 28upx;
  62. height: 60upx;
  63. line-height: 60upx;
  64. text-align: center;
  65. }
  66. </style>