notice.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <view class="container">
  3. <u-navbar leftIconColor="#fff" titleStyle="color:#fff;fontSize:36rpx;" :autoBack="true" bgColor="#2C6FF3"
  4. :placeholder="true" title="通知"></u-navbar>
  5. <view class="content">
  6. <scroll-view class="scrollview" :scroll-with-animation="true" scroll-y lower-threshold="100"
  7. :style="{height:fullHeight}">
  8. <view class="list" v-if="list&&list.length>0">
  9. <block v-for="(item, index) in list" :key="index">
  10. <view class="comm-main flex justify-between">
  11. </view>
  12. </block>
  13. <view class="more" style="overflow: hidden;">
  14. <u-loadmore :status="status" v-if="list.length>=1" />
  15. </view>
  16. </view>
  17. <view class="empty" v-if="list.length==0">
  18. <u-empty mode="list" text="没有任何通知!"></u-empty>
  19. </view>
  20. </scroll-view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import {
  26. list,
  27. update
  28. } from "@/api/system/employee.js"
  29. export default {
  30. data() {
  31. return {
  32. list: [], //列表
  33. fullHeight: 0,
  34. }
  35. },
  36. onLoad() {
  37. let _this = this;
  38. const query = uni.createSelectorQuery().in(this);
  39. query.select(".scrollview").boundingClientRect((data) => {
  40. uni.getSystemInfo({
  41. success(res) {
  42. // 针对iPhone X等机型底部安全距离做适配
  43. const model = res.model;
  44. const modelInclude = [
  45. "iPhone X",
  46. 'iPhone XR',
  47. "iPhone XS",
  48. "iPhone XS MAX",
  49. "iPhone 12/13 mini",
  50. "iPhone 12/13 (Pro)",
  51. "iPhone 12/13 Pro Max",
  52. "iPhone 14 Pro Max"
  53. ];
  54. let safeDistance = modelInclude.includes(model)
  55. //动态设置商品区域高度
  56. if (safeDistance) {
  57. _this.fullHeight = res.windowHeight - data.top - 34 + 'px';
  58. } else {
  59. _this.fullHeight = res.windowHeight - data.top + 'px';
  60. }
  61. },
  62. });
  63. }).exec();
  64. },
  65. methods: {
  66. }
  67. }
  68. </script>
  69. <style lang="scss" scoped>
  70. .container {
  71. overflow: hidden;
  72. .content {
  73. .list {
  74. width: 100%;
  75. padding: 0rpx 13rpx 12rpx;
  76. padding-bottom: calc(110rpx + env(safe-area-inset-bottom) / 2);
  77. overflow: hidden;
  78. .comm-img {
  79. width: 130rpx;
  80. height: 130rpx;
  81. display: flex;
  82. flex-direction: row;
  83. align-items: center;
  84. justify-content: space-around;
  85. image {
  86. width: 130rpx;
  87. height: 130rpx;
  88. }
  89. }
  90. .comm-main {
  91. padding: 20rpx 30rpx;
  92. background-color: #fff;
  93. border-radius: 12rpx;
  94. margin-top: 12rpx;
  95. box-sizing: border-box;
  96. color: #999;
  97. line-height: 60rpx;
  98. position: relative;
  99. }
  100. }
  101. }
  102. }
  103. .empty {
  104. margin-top: 40%;
  105. }
  106. </style>