select-hospital.js 807 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. new Vue({
  2. el: "#main",
  3. data: {
  4. info: ""
  5. },
  6. mounted: function() {
  7. this.info = JSON.stringify({
  8. hospitalId: this.getRequest("hospitalId"),
  9. hosName: this.getRequest("hosName")
  10. });
  11. this.bindEvents();
  12. },
  13. methods: {
  14. bindEvents: function() {
  15. EventBus.$emit("jump-step", {
  16. step: 1
  17. }); //step: 跳转的步数
  18. },
  19. getRequest: function(name) {
  20. var url = window.location.href; //获取地址栏url
  21. var pattern = new RegExp("[?&]" + name + "\=([^&]+)", "g");
  22. var matcher = pattern.exec(url);
  23. var items = null;
  24. if(null != matcher) {
  25. try {
  26. items = decodeURIComponent(decodeURIComponent(matcher[1]));
  27. } catch(e) {
  28. try {
  29. items = decodeURIComponent(matcher[1]);
  30. } catch(e) {
  31. items = matcher[1];
  32. }
  33. }
  34. }
  35. return items;
  36. }
  37. }
  38. })