index.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <view class="lli-develop-expect-page">
  3. <button class="lli-btn" @click="quitClick">退出登录</button>
  4. <CustomTabBar></CustomTabBar>
  5. </view>
  6. </template>
  7. <script setup>
  8. import {
  9. logout
  10. } from '@/api/login.js'
  11. import CustomTabBar from '@/components/custom-tabbar/custom-tabbar.vue';
  12. import { getCurrentInstance } from 'vue';
  13. import {
  14. onLoad,
  15. } from '@dcloudio/uni-app';
  16. const quitClick = ()=>{
  17. uni.showModal({
  18. title: '提示',
  19. content: '你确定要执行这个操作吗?',
  20. success: (res) => {
  21. if (res.confirm) {
  22. quit();
  23. } else if (res.cancel) {
  24. // 用户点击了取消按钮
  25. console.log('用户点击了取消');
  26. }
  27. }
  28. });
  29. }
  30. const quit = ()=>{
  31. uni.navigateTo({
  32. url: '/pages/login/index'
  33. });
  34. }
  35. onLoad((options) => {
  36. const instance = getCurrentInstance();
  37. console.log(instance.appContext.config.globalProperties)
  38. })
  39. // import { ref, onMounted } from 'vue';
  40. //
  41. // const listData = ref([]);
  42. // const page = ref(1);
  43. // const pageSize = ref(10);
  44. // const isLoading = ref(false);
  45. // const noMoreData = ref(false);
  46. //
  47. // // 加载
  48. // const loadData = async () => {
  49. // if (isLoading.value || noMoreData.value) return;
  50. // isLoading.value = true;
  51. // const newData = await fetchData(page.value, pageSize.value); // 假设 fetchData 是你的请求函数
  52. // if (newData.length > 0) {
  53. // listData.value = listData.value.concat(newData);
  54. // page.value++;
  55. // } else {
  56. // noMoreData.value = true;
  57. // }
  58. // isLoading.value = false;
  59. // };
  60. // onMounted(() => {
  61. // loadData();
  62. // });
  63. //
  64. // // 下拉加载更多
  65. // const loadMore = () => {
  66. // loadData();
  67. // };
  68. </script>
  69. <style>
  70. </style>