您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

navBar.vue 9.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. <template>
  2. <!-- eslint-disable max-len -->
  3. <nav class="navbar navbar-light bg-light navbar-expand-lg fixed-top" style="font-size:18px;">
  4. <div class="container-fluid">
  5. <div class="col-md-2">
  6. <button
  7. class="navbar-toggler collapsed"
  8. type="button"
  9. data-toggle="collapse"
  10. data-target="#navbarDefault"
  11. aria-controls="navbarDefault"
  12. aria-expanded="false"
  13. aria-label="Toggle navigation"
  14. >
  15. <span></span>
  16. <span></span>
  17. <span></span>
  18. </button>
  19. <div class="navbar-brand text-brand" style="cursor: pointer;" @click="routerGoTo('/')">
  20. <img
  21. class="img-fluid"
  22. src="/img/logos/UVProp.png"
  23. alt="UVProp logo"
  24. style="width:110px;height:60px;"
  25. />
  26. Uni-Vate
  27. <span class="color-b">Properties</span>
  28. </div>
  29. <button
  30. type="button"
  31. class="btn btn-link nav-search navbar-toggle-box-collapse d-md-none"
  32. data-toggle="collapse"
  33. data-target="#navbarTogglerDemo01"
  34. aria-expanded="false"
  35. >
  36. <span class="fa fa-search" aria-hidden="true"></span>
  37. </button>
  38. </div>
  39. <div class="col-md-8">
  40. <div class="navbar-collapse collapse justify-content-center" id="navbarDefault">
  41. <ul class="navbar-nav">
  42. <li class="nav-item dropdown">
  43. <a
  44. class="nav-link dropdown-toggle"
  45. href="#"
  46. id="navbarDropdown"
  47. role="button"
  48. data-toggle="dropdown"
  49. aria-haspopup="true"
  50. aria-expanded="false"
  51. >Timeshare</a>
  52. <div class="dropdown-menu" aria-labelledby="navbarDropdown">
  53. <a class="dropdown-item cursor-pointer" @click="routerGoTo('/timeshare/buy')">To Buy</a>
  54. <a
  55. class="dropdown-item cursor-pointer"
  56. @click="routerGoTo('/timeshare/sell')"
  57. >To Sell</a>
  58. <a class="dropdown-item cursor-pointer" @click="routerGoTo('/timeshare/faq')">FAQ</a>
  59. <div v-if="isLoggedIn">
  60. <hr />
  61. <a
  62. v-if="isLoggedIn"
  63. class="dropdown-item cursor-pointer"
  64. @click="routerGoTo('/timeshare/sell')"
  65. >My Timeshare Weeks</a>
  66. </div>
  67. </div>
  68. </li>
  69. <li class="nav-item dropdown">
  70. <a
  71. class="nav-link dropdown-toggle"
  72. href="#"
  73. id="navbarDropdown"
  74. role="button"
  75. data-toggle="dropdown"
  76. aria-haspopup="true"
  77. aria-expanded="false"
  78. >Properties</a>
  79. <div class="dropdown-menu" aria-labelledby="navbarDropdown">
  80. <a
  81. class="dropdown-item cursor-pointer"
  82. @click="routerGoTo('/property/Commercial/Search')"
  83. >Search Commercial Properties</a>
  84. <a
  85. class="dropdown-item cursor-pointer"
  86. @click="routerGoTo('/property/Commercial/Sale')"
  87. >To Sell Commercial Properties</a>
  88. <a
  89. class="dropdown-item cursor-pointer"
  90. @click="routerGoTo('/property/Commercial/Rental')"
  91. >To Rent Commercial Properties</a>
  92. <hr />
  93. <a
  94. class="dropdown-item cursor-pointer"
  95. @click="routerGoTo('/property/Residential/Search')"
  96. >Search Residential Properties</a>
  97. <a
  98. class="dropdown-item cursor-pointer"
  99. @click="routerGoTo('/property/Residential/Sale')"
  100. >To Sell Residential Properties</a>
  101. <a
  102. class="dropdown-item cursor-pointer"
  103. @click="routerGoTo('/property/Residential/Rental')"
  104. >To Rent Residential Properties</a>
  105. <hr v-if="isLoggedIn" />
  106. <a
  107. v-if="isLoggedIn"
  108. class="dropdown-item cursor-pointer"
  109. @click="routerGoTo('/property/list/Commercial/MyListings')"
  110. >My Commercial Properties</a>
  111. <a
  112. v-if="isLoggedIn"
  113. class="dropdown-item cursor-pointer"
  114. @click="routerGoTo('/property/list/Residential/MyListings')"
  115. >My Residential Properties</a>
  116. </div>
  117. </li>
  118. <li class="nav-item dropdown">
  119. <a
  120. class="nav-link dropdown-toggle"
  121. href="#"
  122. id="navbarDropdown"
  123. role="button"
  124. data-toggle="dropdown"
  125. aria-haspopup="true"
  126. aria-expanded="false"
  127. >About</a>
  128. <div class="dropdown-menu" aria-labelledby="navbarDropdown">
  129. <a class="dropdown-item cursor-pointer" @click="routerGoTo('/about/us')">About Us</a>
  130. <a
  131. class="dropdown-item cursor-pointer"
  132. @click="routerGoTo('/about/timeshare')"
  133. >About Timeshare</a>
  134. </div>
  135. </li>
  136. <li v-if="isLoggedIn" class="nav-item dropdown">
  137. <a
  138. class="nav-link dropdown-toggle"
  139. href="#"
  140. id="navbarDropdown"
  141. role="button"
  142. data-toggle="dropdown"
  143. aria-haspopup="true"
  144. aria-expanded="false"
  145. >Admin</a>
  146. <div class="dropdown-menu" aria-labelledby="navbarDropdown">
  147. <a class="dropdown-item cursor-pointer" @click="routerGoTo('/status/list')">Status</a>
  148. <a
  149. class="dropdown-item cursor-pointer"
  150. @click="routerGoTo('/status/timeshareAdmin')"
  151. >Timeshare Week Admin</a>
  152. <a
  153. class="dropdown-item cursor-pointer"
  154. @click="routerGoTo('/status/tenderWeekAdmin')"
  155. >Tender Week Management</a>
  156. <a
  157. class="dropdown-item cursor-pointer"
  158. @click="routerGoTo('/unitConfiguration/list')"
  159. >Unit Configuration</a>
  160. <a
  161. class="dropdown-item cursor-pointer"
  162. @click="routerGoTo('/status/userManagementPage')"
  163. >User Management & Access</a>
  164. <a
  165. class="dropdown-item cursor-pointer"
  166. @click="routerGoTo('/status/changeLogPage')"
  167. >Changes Logs</a>
  168. <a
  169. class="dropdown-item cursor-pointer"
  170. @click="routerGoTo('/userDefinedGroups/list')"
  171. >Property User Defined Groups</a>
  172. <a
  173. class="dropdown-item cursor-pointer"
  174. @click="routerGoTo('/propertyTypes/list')"
  175. >Property Types</a>
  176. <a
  177. class="dropdown-item cursor-pointer"
  178. @click="routerGoTo('/searchLog')"
  179. >Search Logs</a>
  180. <a class="dropdown-item cursor-pointer" @click="routerGoTo('/Offers')">Offers</a>
  181. </div>
  182. </li>
  183. <li class="nav-item dropdown" v-if="!isLoggedIn">
  184. <a
  185. class="nav-link"
  186. @click="routerGoTo('/user/login')"
  187. id="navbarDropdown"
  188. role="button"
  189. data-toggle="dropdown"
  190. aria-haspopup="true"
  191. aria-expanded="false"
  192. >Login</a>
  193. </li>
  194. <li class="nav-item dropdown" v-if="isLoggedIn">
  195. <span>
  196. <a class="nav-link" @click="logout(routerGoTo('/user/login'))">Logout</a>
  197. </span>
  198. <!-- <span v-else></span> -->
  199. </li>
  200. <li>
  201. <span v-if="isLoggedIn">
  202. <a>
  203. Welcome!
  204. <br />
  205. {{ NAME }}
  206. </a>
  207. </span>
  208. <span v-else></span>
  209. </li>
  210. </ul>
  211. </div>
  212. </div>
  213. <div class="col-md-2" align="right">
  214. <button
  215. type="button"
  216. class="btn btn-b-n navbar-toggle-box-collapse d-none d-md-block"
  217. data-toggle="collapse"
  218. data-target="#navbarTogglerDemo01"
  219. aria-expanded="false"
  220. >
  221. <span class="fa fa-search" aria-hidden="true"></span>
  222. </button>
  223. </div>
  224. </div>
  225. </nav>
  226. </template>
  227. <script>
  228. import { mapState, mapActions } from 'vuex';
  229. export default {
  230. computed: {
  231. ...mapState('authentication', [
  232. 'user',
  233. 'flag',
  234. 'status',
  235. 'person',
  236. 'token',
  237. ]),
  238. NAME() {
  239. return this.person.fullName;
  240. },
  241. isLoggedIn() {
  242. return this.token !== null && this.token !== undefined;
  243. },
  244. // eslint-disable-next-line vue/return-in-computed-property
  245. Logout() {
  246. return this.logout();
  247. },
  248. },
  249. methods: {
  250. ...mapActions('authentication', ['logout']),
  251. routerGoTo(goTo) {
  252. this.$emit('routerGoTo', goTo);
  253. },
  254. },
  255. };
  256. </script>
  257. <style scoped>
  258. a {
  259. border: transparent thin solid;
  260. padding: 5px 12px;
  261. font-size: 110%;
  262. }
  263. a:hover {
  264. background-color: rgba(169, 224, 255, 0.75);
  265. border-radius: 5px;
  266. border: silver thin solid;
  267. }
  268. </style>