index.vue 1.8 KB

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