index.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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 {
  13. getCurrentInstance
  14. } from 'vue';
  15. import {
  16. onLoad,
  17. } from '@dcloudio/uni-app';
  18. const quitClick = () => {
  19. uni.showModal({
  20. title: '提示',
  21. content: '你确定要执行这个操作吗?',
  22. success: (res) => {
  23. if (res.confirm) {
  24. quit();
  25. } else if (res.cancel) {
  26. // 用户点击了取消按钮
  27. console.log('用户点击了取消');
  28. }
  29. }
  30. });
  31. }
  32. const quit = () => {
  33. uni.removeStorage({
  34. key: 'Mta-Auth',
  35. success: function(res) {
  36. console.log('success');
  37. uni.navigateTo({
  38. url: '/pages/login/index'
  39. });
  40. }
  41. });
  42. }
  43. onLoad((options) => {
  44. const instance = getCurrentInstance();
  45. console.log(instance.appContext.config.globalProperties)
  46. })
  47. // import { ref, onMounted } from 'vue';
  48. //
  49. // const listData = ref([]);
  50. // const page = ref(1);
  51. // const pageSize = ref(10);
  52. // const isLoading = ref(false);
  53. // const noMoreData = ref(false);
  54. //
  55. // // 加载
  56. // const loadData = async () => {
  57. // if (isLoading.value || noMoreData.value) return;
  58. // isLoading.value = true;
  59. // const newData = await fetchData(page.value, pageSize.value); // 假设 fetchData 是你的请求函数
  60. // if (newData.length > 0) {
  61. // listData.value = listData.value.concat(newData);
  62. // page.value++;
  63. // } else {
  64. // noMoreData.value = true;
  65. // }
  66. // isLoading.value = false;
  67. // };
  68. // onMounted(() => {
  69. // loadData();
  70. // });
  71. //
  72. // // 下拉加载更多
  73. // const loadMore = () => {
  74. // loadData();
  75. // };
  76. </script>
  77. <style>
  78. </style>