index.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <template>
  2. <view class="content">
  3. 政策新闻
  4. <up-overlay :show="show">
  5. <login @showChange='showChange'></login>
  6. </up-overlay>
  7. </view>
  8. </template>
  9. <script setup lang="ts">
  10. import { inject, computed, ref } from 'vue';
  11. //该依赖已内置不需要单独安装
  12. import { onShow, onPullDownRefresh } from "@dcloudio/uni-app";
  13. // 请求接口
  14. const $api = inject('$api');
  15. const $config = inject('$config');
  16. // 基本信息
  17. const config = ref({ logo: [], file: [] });
  18. const list = ref([]);
  19. const total = ref(0);
  20. // user
  21. const user = computed(() => {
  22. return uni.getStorageSync('user');
  23. })
  24. // 遮罩层
  25. const show = ref(false);
  26. onShow(async () => {
  27. await searchConfig();
  28. await searchOther();
  29. await search();
  30. if (!user.value) show.value = true
  31. })
  32. // config信息
  33. const searchConfig = async () => {
  34. config.value = uni.getStorageSync('config');
  35. };
  36. // 其他查询信息
  37. const searchOther = async () => { };
  38. // 查询
  39. const search = async () => { };
  40. const showChange = () => {
  41. show.value = false
  42. }
  43. </script>
  44. <style lang="scss" scoped>
  45. .content {
  46. display: flex;
  47. flex-direction: column;
  48. min-height: 100vh;
  49. background-color: var(--f1Color);
  50. }
  51. </style>