record-tabs.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. function GetRequest() {
  2. var url = location.search; //获取url中"?"符后的字串
  3. var theRequest = new Object();
  4. if (url.indexOf("?") != -1) {
  5. var str = url.substr(1);
  6. strs = str.split("&");
  7. for(var i = 0; i < strs.length; i ++) {
  8. theRequest[strs[i].split("=")[0]]=(strs[i].split("=")[1]);
  9. }
  10. }
  11. return theRequest;
  12. }
  13. var query = GetRequest();
  14. function reseverLinks(str) {
  15. var link = top.menuLinkMap[str];
  16. return {
  17. href: link.href+"?code="+query['code'],
  18. title: str
  19. }
  20. }
  21. new Vue({
  22. el: '#app',
  23. data: {
  24. isAgent: false,
  25. innerTabs: [{title:'咨询',href:'../consultation/consultation.html'},
  26. {title:'随访',href:'../follow-up/follow-up.html'},
  27. {title:'待预约',href:'../follow-up/follow-up.html?type=2'},
  28. {title:'健康指导',href:'../guidance/guidance.html'},
  29. {title:'健康教育',href:'../education/education.html'},
  30. {title:'统计',href:''}
  31. ],
  32. activeidx: ""
  33. },
  34. mounted: function() {
  35. var vm = this
  36. if(vm.isAgent) { // 如果是代理,“供货授权”信息卡
  37. vm.innerTabs.push(reseverLinks("供货授权"))
  38. }
  39. vm.activeidx = query.tabIdex || "0"
  40. }
  41. })