Skouter mortgage estimates. Web application with view written in PHP and Vue, but controller and models in Go.
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 
 

78 wiersze
2.1 KiB

  1. <template>
  2. <div class="panel">
  3. <side-bar :role="user.status" :active="active">
  4. </side-bar>
  5. <div v-if="loading" class="page loading">
  6. <spinner></spinner>
  7. </div>
  8. <home :user="user" v-else-if="active == 1" />
  9. <new-estimate :user="user" :fees="fees" v-else-if="active == 2" />
  10. <estimates :user="user" :fees="fees" v-else-if="active == 3" />
  11. </div>
  12. </template>
  13. <script>
  14. import SideBar from "./sidebar.vue"
  15. import Spinner from "./spinner.vue"
  16. import Home from "./home.vue"
  17. import NewEstimate from "./new.vue"
  18. import Estimates from "./estimates.vue"
  19. const user = {
  20. firstName: "test",
  21. lastName: "user",
  22. id: 12,
  23. status: 1,
  24. }
  25. // The default fees of a new loan. Percentage values take precedent over amounts
  26. const fees = [
  27. { name: 'Processing fee', type: 'Lender Fees', amount: 500, perc: 0 },
  28. { name: 'Underwriting fee', type: 'Lender Fees', amount: 500, perc: 0 },
  29. { name: 'Credit Report', type: 'Services Required by Lender',
  30. amount: 52.50 },
  31. { name: 'Appraisal', type: 'Services Required by Lender', amount: 52.50 },
  32. { name: 'Title Services', type: 'Title Company', amount: 1000 },
  33. { name: 'Lender\'s Title Insurance', type: 'Title Company', amount: 1599 },
  34. { name: 'Owner\'s Title Insurance', type: 'Title Company', amount: 451.00 },
  35. { name: 'Recording Charges', type: 'Government', amount: 99.00 },
  36. { name: 'State Tax', type: 'Government', amount: 2411.00 },
  37. ]
  38. // Used to check the current section of the app generally without a regex match
  39. // each time.
  40. function active() {
  41. if (this.hash == '' || this.hash == '#') {
  42. return 1
  43. } else if (/^#new\/?/.exec(this.hash)) {
  44. return 2
  45. } else if (/^#estimates\/?/.exec(this.hash)) {
  46. return 3
  47. } else if (/^#settings\/?/.exec(this.hash)) {
  48. return 4
  49. } else if (/^#sign-out\/?/.exec(this.hash)) {
  50. return 5
  51. } else {
  52. return 0
  53. }
  54. }
  55. export default {
  56. components: { SideBar, Spinner, Home, NewEstimate, Estimates },
  57. computed: { active },
  58. data() {
  59. return {
  60. loading: false, user: user, hash: window.location.hash,
  61. fees: fees
  62. }
  63. },
  64. created() {
  65. window.onhashchange = () => this.hash = window.location.hash
  66. }
  67. }
  68. </script>