binding.vue 978 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <template>
  2. <app-layout>
  3. <app-phone-binding :bind="bind" @click="bindPhone" :phone="phone"></app-phone-binding>
  4. </app-layout>
  5. </template>
  6. <script>
  7. import appPhoneBinding from './app-phone-binding/app-phone-binding.vue';
  8. export default {
  9. name: "binding",
  10. data() {
  11. return {
  12. bind: false,
  13. phone: ''
  14. }
  15. },
  16. onLoad() {
  17. this.$request({
  18. url: this.$api.user.user_info,
  19. }).then(response => {
  20. if (response.code === 0) {
  21. if (response.data.mobile !== '') {
  22. this.bind = true;
  23. this.phone = response.data.mobile;
  24. }
  25. }
  26. })
  27. },
  28. methods: {
  29. bindPhone(data) {
  30. this.bind = data;
  31. }
  32. },
  33. components: {
  34. 'app-phone-binding': appPhoneBinding,
  35. }
  36. }
  37. </script>