ly-back.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template xmlns="">
  2. <view class="">
  3. <view class="p-f back-box">
  4. <ly-icon :size="60" color="" name="icon-fanhui"/>
  5. </view>
  6. <view class="p-f bottom-right"></view>
  7. <view class="p-f mac-info" @click="toSetting">
  8. mac:{{ userStore.mac || '未登录' }}
  9. </view>
  10. </view>
  11. </template>
  12. <script setup>
  13. import {reactive} from "vue";
  14. import {navigateBack, navTo, showToast} from "@/utils/app";
  15. import {useUserStore} from "@/store/useUserStore";
  16. import {useConfigStore} from "@/store/useConfigStore";
  17. import debounce from "@/utils/debounce";
  18. const configStore = useConfigStore()
  19. const userStore = useUserStore()
  20. const pd = reactive({})
  21. const props = defineProps({
  22. showBack: {
  23. type: Boolean,
  24. default: true,
  25. },
  26. autoBack: {
  27. type: Boolean,
  28. default: true
  29. },
  30. color: {
  31. type: String,
  32. default: '#FFF'
  33. },
  34. backClick: {
  35. type: Function,
  36. },
  37. })
  38. const clickHandle = () => {
  39. if (this.autoBack) {
  40. navigateBack()
  41. } else {
  42. this.$emit('backClick')
  43. }
  44. }
  45. const toSetting = () => {
  46. debounce.secondCountDown('toSetting', {
  47. time: 5000,
  48. limit: 10,
  49. repetition_time: 0,
  50. run: (num, count, statue) => {
  51. if (count > 5) showToast(`再点击${10 - count}次`)
  52. },
  53. success: () => {
  54. console.log('success')
  55. navTo('pages/setting/index')
  56. },
  57. fail: () => {
  58. console.log('fail')
  59. },
  60. })
  61. }
  62. </script>
  63. <style lang="scss" scoped>
  64. .mac-info {
  65. bottom: 10rpx;
  66. right: 20rpx;
  67. font-size: 35rpx;
  68. color: #cccccc;
  69. }
  70. </style>