index.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <view class="lli-develop-expect-page">
  3. <button class="lli-btn" @click="quit">退出登录</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. // 用户点击了确定按钮,执行你的操作
  23. console.log('用户点击了确定');
  24. quit()
  25. } else if (res.cancel) {
  26. // 用户点击了取消按钮
  27. console.log('用户点击了取消');
  28. }
  29. }
  30. });
  31. }
  32. const quit = ()=>{
  33. uni.navigateTo({
  34. url: '/pages/login/index'
  35. });
  36. }
  37. onLoad((options) => {
  38. const instance = getCurrentInstance();
  39. console.log(instance.appContext.config.globalProperties)
  40. })
  41. // import { ref, onMounted } from 'vue';
  42. //
  43. // const listData = ref([]);
  44. // const page = ref(1);
  45. // const pageSize = ref(10);
  46. // const isLoading = ref(false);
  47. // const noMoreData = ref(false);
  48. //
  49. // // 加载
  50. // const loadData = async () => {
  51. // if (isLoading.value || noMoreData.value) return;
  52. // isLoading.value = true;
  53. // const newData = await fetchData(page.value, pageSize.value); // 假设 fetchData 是你的请求函数
  54. // if (newData.length > 0) {
  55. // listData.value = listData.value.concat(newData);
  56. // page.value++;
  57. // } else {
  58. // noMoreData.value = true;
  59. // }
  60. // isLoading.value = false;
  61. // };
  62. // onMounted(() => {
  63. // loadData();
  64. // });
  65. //
  66. // // 下拉加载更多
  67. // const loadMore = () => {
  68. // loadData();
  69. // };
  70. </script>
  71. <style>
  72. </style>