indexAdd.js 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. let userid = "2a7cbdee-9391-cd8b-cd8d-7cc78e88e9bf";
  2. let username = "潘明";
  3. let oatoken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyYTdjYmRlZS05MzkxLWNkOGItY2Q4ZC03Y2M3OGU4OGU5YmYiLCJjbGllbnRpZCI6ImFuZHJvaWRjbGllbnQiLCJncmFudF90eXBlIjoicGFzc3dvcmQiLCJzY29wZSI6Im9wZW5pZCBwcm9maWxlIGVtYWlsIFJlZmluZUFQSSIsImV4cCI6MTY4NTgxNTIwMSwiY29uZmlnIjoiMjAyMC0yMDk5In0.ws-CyJ-qS-8A4cQg4wGLnshNzO0YgR-tsG2TB-owmuc";
  4. // let userid = "";
  5. // let username = "";
  6. // let oatoken = "";
  7. window.addEventListener("flutterInAppWebViewPlatformReady", function () {
  8. window.flutter_inappwebview
  9. .callHandler("getuserinfo", "")
  10. .then(function (res) {
  11. userid = res.username;
  12. username = res.name;
  13. oatoken = res.oatoken;
  14. })
  15. });
  16. console.log(oatoken)
  17. setTimeout(function () {
  18. let indexVue = new Vue({
  19. el: "#indexBox",
  20. data: {
  21. apiurl: apiurl,//基础的页面请求地址
  22. userId: userid, //用户id
  23. userName: username, //用户中文名
  24. token: oatoken,
  25. nowFunc: "fun1",
  26. nowFuncList: []
  27. },
  28. methods: {
  29. selectFunc: (index) => {
  30. if (_this.token != "" && _this.token != undefined && _this.token != null) {
  31. } else {
  32. _this.$nextTick(() => {
  33. $.toast.prototype.defaults.duration = 1000;
  34. $.toast("暂无授权", 'cancel', function () {
  35. });
  36. })
  37. }
  38. },
  39. changeFunc: (fun) => {
  40. _this.nowFunc = fun;
  41. if (fun == "fun1") {
  42. _this.nowFuncList = [{
  43. "name": "会议申请",
  44. "img": "AFrontEnd/img/funcHYSSQ.png",
  45. }, {
  46. "name": "车辆申请",
  47. "img": "AFrontEnd/img/funcCLPQ.png",
  48. }, {
  49. "name": "请假申请",
  50. "img": "AFrontEnd/img/funcQJGL.png",
  51. }, {
  52. "name": "办公用品",
  53. "img": "AFrontEnd/img/funcBGYPSQ.png",
  54. }]
  55. } else if (fun == "fun2") {
  56. _this.nowFuncList = [{
  57. "name": "信访管理",
  58. "img": "AFrontEnd/img/funcXFBL.png",
  59. }]
  60. } else if (fun == "fun3") {
  61. _this.nowFuncList = [{
  62. "name": "发布管理",
  63. "img": "AFrontEnd/img/funcWZXXFB.png",
  64. }]
  65. }
  66. }
  67. },
  68. created: function () {
  69. _this = this;
  70. localStorage.setItem("mobile-token", _this.token);
  71. localStorage.setItem("mobile-userName", _this.userName);
  72. localStorage.setItem("mobile-userId", _this.userId);
  73. }
  74. ,
  75. mounted: function () {
  76. _this.nowFuncList = [{
  77. "name": "会议申请",
  78. "img": "AFrontEnd/img/funcHYSSQ.png",
  79. }, {
  80. "name": "车辆申请",
  81. "img": "AFrontEnd/img/funcCLPQ.png",
  82. }, {
  83. "name": "请假申请",
  84. "img": "AFrontEnd/img/funcQJGL.png",
  85. }, {
  86. "name": "办公用品",
  87. "img": "AFrontEnd/img/funcBGYPSQ.png",
  88. }]
  89. }
  90. })
  91. }, 100)