bind-profile.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <template>
  2. <mx-submit-layout :button-text="buttonText" :bar-options="barOptions" :loading="loading" @submit="handleSubmit">
  3. <template #prepend>
  4. <activate-steps/>
  5. </template>
  6. <activate-steps-form ref="form"/>
  7. <template v-if="!completed" #suffix>
  8. <text class="text-primary underline" @click="relaunch">跳过绑卡,回到首页</text>
  9. </template>
  10. </mx-submit-layout>
  11. </template>
  12. <script setup>
  13. import {ref} from 'vue'
  14. import {useTransfer} from "@/hooks/useTransfer";
  15. import {confirmAsync, fnPlaceholder} from "@/utils/uni-helper";
  16. import {useProvideActivateSteps} from "@/pages/login/components/hooks/useActivateStepsInjection";
  17. import ActivateSteps from "@/pages/login/components/activate-steps.vue";
  18. import ActivateStepsForm from "@/pages/login/components/activate-steps-form.vue";
  19. // data
  20. const {relaunch} = useTransfer()
  21. const form = ref(null)
  22. const {loading, buttonText, completed} = useProvideActivateSteps()
  23. const barOptions = {
  24. title: '绑定会员卡',
  25. leftClickBlock: async () => {
  26. if (!completed.value) await confirmAsync('退出绑卡,回到首页')
  27. relaunch()
  28. return new Promise(fnPlaceholder)
  29. }
  30. }
  31. // methods
  32. const handleSubmit = () => {
  33. form.value.next()
  34. }
  35. </script>
  36. <style scoped>
  37. </style>