Skouter mortgage estimates. Web application with view written in PHP and Vue, but controller and models in Go.
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 
 

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